I Wasted Time with a Custom Prompt for R with ESS

I wanted a custom prompt for R with ESS. I wanted a double struck R. I probably did it wrong. It never worked. Actually it worked most of the time, and that is worse than never working. Kind people helped me. I still got it wrong. I take full responsibility. It was better not to do it. If you want to try, here is where I left it.

.Rprofile

Make the ℝ prompt stand out (be sure to tell ESS how to handle this):

options(prompt="ℝ> ")

.emacs.el

Tell ESS how to handle my custom prompt:

(setq inferior-ess-primary-prompt "ℝ> ")

Handle the custom ℝ prompt in ess. Don’t use custom here.

(setq inferior-S-prompt "[]a-zA-Z0-9.[]*\\(?:[>+.] \\)*ℝ+> ")

How to Format Magrittr Chains with ESS

Here is an example of how to format magrittr chains with ESS. Those interested will also be happy to learn of ess-R-fl-keyword:%op% and ess-%op%-face.
For example, to get the an indent after only the first statement.

(add-to-list 'ess-style-alist
             '(my-style
               (ess-indent-level . 4)
               (ess-first-continued-statement-offset . 2)
               (ess-continued-statement-offset . 0)
               (ess-brace-offset . -4)
               (ess-expression-offset . 4)
               (ess-else-offset . 0)
               (ess-close-brace-offset . 0)
               (ess-brace-imaginary-offset . 0)
               (ess-continued-brace-offset . 0)
               (ess-arg-function-offset . 4)
           (ess-arg-function-offset-new-line . '(4))
               ))
(setq ess-default-style 'my-style)

Thank you Mr. Vitalie Spinu.
ADDENDUM
How I did it:

(setq gcr/ess-style
      (copy-alist
       (assoc 'RRR ess-style-alist)))
(setf (nth 0 gcr/ess-style) 'GCR)
(setf (cdr
       (assoc 'ess-continued-statement-offset
              (cdr gcr/ess-style)))
      0)
(add-to-list 'ess-style-alist gcr/ess-style)
(setq ess-default-style 'GCR)

Addendum: 2015-08-12
The latest version of ESS includes a RRR style.
It formats Magrittr chains as expected by default with ess-first-continued-statement-offset.

Entity Framework in the Enterprise on Pluralsight

What I want to know how to do in entity framework:

  • Create
    • High speed database contexts
    • Object rich database contexts
    • Dynamically composable database contexts for when pre-built don’t exist
  • Understand
    • Best path
    • Performance trade-offs
    • Risks and Challenges

With those questions in mind I watched Entity Framework in the Enterprise: Incorporating Entity Framework into applications that are architected for the enterprise.

Personal notes follow.

Continue reading “Entity Framework in the Enterprise on Pluralsight”

Three Nice Looking Diff Tools and My Pick

1 Desire

Diff’s are hard. 80% of the time they are simple and fast. 20% of the time they are, well, complicated! My days of text-only diffs are coming to an end. They remain a part of my toolbox but I want a grown-up GUI diff tool. Fortunately there are plenty of options. But how to choose?

  • My decision making process was pretty simple: write down questions about them and answer them in a big spreadsheet
  • See where that takes me
  • Make a decision

Here is how it went.

Continue reading “Three Nice Looking Diff Tools and My Pick”

Speed Up FileVault2 Decryption

FileVault2 (FV2) provides disk encryption for OSX. I am unfamiliar with it.
I read about it at the Apple website. It doesn’t explain much. I wanted to know
how OSX handles it. To learn I tried it out.
After installing OSX I turned on FV2. The encryption was seamless. 8GB in 15m.
I installed 58GiB more of applications and copied files. Then I wanted to
re-provision the machine.
I booted into an external drive with OSX 10.9 (10.9) on it. I erased the disk on
the box. When I erased it I was asked for a new password. I provided it. I am
guessing that FV2 wanted a new password. I booted back into 10.9 and OSX
reported that FV2 is turned on. Seems like you can’t just wipe a FV2
encrypted partition. I asked OSX to decrypt the partition. It did and I tried
erasing the partition again and it worked fine. Going through the provisioning
process again I found that decrypting 58GiB takes about 2 hours.
Some experimentation left with the plan that when I want to re-provision a OSX
box I will erase the partition and re-image it and boot into it to decrypt the
partition. Surely there are command line tools to do so. I did investigate
that people I want directions that anyone may follow in the UI.

How to Type the OSX "Pretzel" Key in Unicode

Emacs tells you everything that you need to know about it using describe-char:

             position: 927 of 1056 (88%), column: 33
character: ⌘ (displayed as ⌘) (codepoint 8984, #o21430, #x2318)
preferred charset: unicode (Unicode (ISO10646))
code point in charset: 0x2318
script: symbol
syntax: . which means: punctuation
category: .:Base, j:Japanese
to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
buffer code: #xE2 #x8C #x98
file code: #xE2 #x8C #x98 (encoded by coding system utf-8-unix)
display: by this font (glyph code)
mac-ct:-*-Lucida Grande-normal-normal-normal-*-17-*-*-*-p-0-iso10646-1 (#x3B4)
Character code properties: customize what to show
name: PLACE OF INTEREST SIGN
old-name: COMMAND KEY
general-category: So (Symbol, Other)
decomposition: (8984) ('⌘')
There are text properties here:
fontified t