Skip to content

Perl regex builder in emacs

  • Perl regex builder in emacs
    • Read the wiki and there are 2 options
    • Best is this
    • Roughly confirmed that is the best and newest
    • Set up an el-get for it tonight
    • Played around for while can’t get el-get to load it
    • I can’t even load it myself
      • Probably my fault
    • Posted ticket on github page here

Markdown vignettes in R

If you somehow didn’t have a reason to look into r-markdown with knitr before,
then this is yet another really good one.

Use your space appropriately

When facing a decision of how to utilize space it is sometimes easy.
Choosing between allocating land for a water purification plant vs
a donut shop might not be an easy choice but it is an obvious one.
How then do we allocate our internal or mental space?

Inside us the space is limitless. Most of the time though we don’t feel that way.
Instead there seems to be little free space, and that results in a feeling of
being overwhelmed and unable to cope with life. That is normal and all humans
experience this phenomenon.

The good news is that we are in charge of our internal landscape. Even better,
it is always with us! We can tidy it up whenever wish. We can open up more space.
Perhaps it is more like discovering it then opening it up, because it is already there.

That new space can help to accommodate new investments, like learning how to knit
for example. It may also simply be observed, and left alone. That is really
helpful for “making space” for all of the surprise trials that inevitably will
occur in life. Usually they aren’t very surprising though, given the nature of
this reality. Nonetheless, it makes everything easier when you have a lot of
room to breathe!

Do less to do more

Do less to do more.

It does result in doing more! You just aren’t spread so thin.

It is the only reasonable approach.

Edit a source block with its name shown in org

My preference is to rely upon heading property inheritance to define source block
names. That way, you can just do your work knowing “where” you are working and
keep it simple by not having to name everything. That was just fine until I
wrote a document where I needed to name each source block.

It gets easy to forget the source block’s name. Not the end of the world, but very nice to know.

(defun gcr/org-edit-src-code-plus-name ()
  "Edit the well-described source code block.
Attribution: URL `'"
  (let* ((eop  (org-element-at-point))
         (name (or (org-element-property :name (org-element-context eop))
         (lang (org-element-property :language eop))
         (buff-name (concat "*Org Src " name "[" lang "]*")))
    (org-edit-src-code nil nil buff-name)))

quantmod Quantitative Financial Modelling & Trading Framework for R

The quantmod package for R is designed to assist the quantitative trader in the development, testing, and deployment of statistically based trading models.

What quantmod IS

A rapid prototyping environment, where quant traders can quickly and cleanly explore and build trading models.

What quantmod is NOT

A replacement for anything statistical. It has no ‘new’ modelling routines or analysis tool to speak of. It does now offer charting not currently available elsewhere in R, but most everything else is more of a wrapper to what you already know and love about the language and packages you currently use.

quantmod makes modelling easier by removing the repetitive workflow issues surrounding data management, modelling interfaces, and performance analysis.

Help Changing the Throttle Cable on a C10

When observing the bike from the RH side, rotate the center cable mechanism CW so the carbs are at full throttle. This will bring the “pull” cable access “notch” so it faces the rear of the bike, and more accessible from the top. During the time you are rotating the mechanism, pay attention to the individual carb linkages and you will see a gap form between a stop and a section of the linkage. When the carbs are at full throttle, find a suitable flat blade screw driver and wedge it in this gap to hold the carbs open once you’ve released the cable mechanism. This will give you ample time to fiddle with getting the cable end in the hole and engaged. A pair of long, long-nosed needle nose pliers, or a long hemostat works best in getting the cable end in place.

Via COG.

Exemple Complet Minimal

This is a French acronym used by some mailing list members; it stands for “Exemple Complet Minimal”, or “Complete Minimal Example”. The term refers to test files that can reliably reproduce a bug with the minimal amount of code.

Seal the wiring deal

use butt connectors, ring terminals, and spade clips ad a good crimper. Before crimping, I’ll coat the wire end and the connector with a dielectric paste, avoiding silicon sealer, as it can shrink and allow moisture in. A layer of heat-shrink tubing guarantees a water tight worry free connection.

Nice example of converting wide to tall data with tidyr

Nice example.

> x <- structure(c(1961, 1961, 1961, 1961, 1, 1, 1, 1, 1, 2, 3 
+         , 4, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 
+         , 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 
+         , 28, 29, 30, 31, 32, 33, 34, 35, 36) 
+     , .Dim = c(4L, 12L) 
+     , .Dimnames = list(NULL, c("year", "month", "day", "A", "B", "C" 
+         , "D", "E", "F", "G", "H", "I")) 
+     ) 
> xdf <- 
> xdf 
  year month day A B  C  D  E  F  G  H  I 
1 1961     1   1 1 5  9 13 17 21 25 29 33 
2 1961     1   2 2 6 10 14 18 22 26 30 34 
3 1961     1   3 3 7 11 15 19 23 27 31 35 
4 1961     1   4 4 8 12 16 20 24 28 32 36 
> require(tidyr) 
> require(dplyr) 
> xdf %>% gather(station, discharge, -year, -month, -day) 
   year month day station discharge 
1  1961     1   1       A         1 
2  1961     1   2       A         2 
3  1961     1   3       A         3 
4  1961     1   4       A         4 
5  1961     1   1       B         5 
6  1961     1   2       B         6 
7  1961     1   3       B         7 
8  1961     1   4       B         8 
9  1961     1   1       C         9 
10 1961     1   2       C        10 
11 1961     1   3       C        11 
12 1961     1   4       C        12 
13 1961     1   1       D        13 
14 1961     1   2       D        14 
15 1961     1   3       D        15 
16 1961     1   4       D        16 
17 1961     1   1       E        17