Monday, August 16, 2010

Shortcut nuisance

I started wondering what the bash (or rather libreadline with emacs key bindings) command was for deleting the next word (already making extensive use of ^u, ^w and the like).
bind -P| less is a big helper here, http://www.bigsmoke.us/readline/shortcuts is also.

My revelation now was finally realising that few of the keystrokes work on mac the same way as usual because the option key is not meta; meta is provided escape. So instead of Alt+b i actually want Esc+b.

I now have several options all of which suck:

  • I can turn option into meta in the terminal app which will cause me to loose my Umlauts (I use a selfbuilt kind of US-Alt-Intl keyboard layout)
  • I can let it as it is but then i have to remember the press escape along every time (escape seems the only special key that does not autorepeat). Btw i use http://pqrs.org/macosx/keyremap4macbook/extra.html to make caps lock escape which really helps here and in vim.
  • I could switch to iTerm which is as pretty as terminal when choosing the same fonts and then adapting http://ninjamonkeys.co.za/2007/07/19/iterm-tip-to-get-forward-alt-f-and-backward-alt-b-word-working/ to get all alt combinations to work but this only worked for half of those 
  • There is also something that looked like the answer to my prayers: a hacked iTerm that has a (mac) normal right option key and a (linux/unix-like) normal left option key (aka alt) (or v.v.). Unfortunately my Umlauts then only work in vim and not in bash. I don't know where this is coming from and i don't know how to go about debugging this. 

BTW Terminator doesn't do any of this right so forget it. (UPDATE: MacWise as well)
I think I will go with 1.

What annoys me most is that in all Cocoa apps these shortcuts have identical meaning to term/bash but only the ones using the control work. Why?

If someone has a workaround please tell me.
My Requirements:
I like my umlauts on right alt + Key, I'd love emacs binding to work with the left alt and if possible i'd love them to work in every Cocoa app.

usability fail

This is me trying to log in to the apple forums to comment on Safari not being able to set its language accept field in the http headers to anything other than the language set in system preferences (epic in itself i dare say).

So what's wrong here? This is actually an error page! I already hit the Create Account Button and this is the page telling me that the nick is already taken.  At least that is what i figured out after trying two other browsers that failed as well and finally succeeding by choosing a different nick.

<Apple Fan Boy Attitude> This is Apples way of making my user experience better by preventing discomfort caused by error messages.</Apple Fan Boy Attitude>

Commands that save your Sanity No 1

:w !sudo tee %
overwrites a file that you don't have permission to write to but edited with vim nonetheless.

Thursday, August 5, 2010

Replacing parts of your Macbook Air

I had a need for replacing my Macbook Air's top case and heard it was insanely difficult beforehand. This was definitely not the case (despite some 80 odd screws of over ten different sizes) thanks to this guide. So if you need to do it yourself don't fret, trust ifixit!

On a side note: I was thoroughly surprised to see how thought out and beautiful the inside of the Macbook Air was. I'm still unsure what to think of it but they even introduced blinds in black varnish look that have no other purpose but optical ones. Overall it is really an impressive piece of craftsmenship though not necessarily all by apple (e.g. i was most impressed with size of the mainboard)

Thursday, May 27, 2010

Mac OS X Skype Tab switch shortcuts

Since I had a hard time finding out what the command is for switching the tab in the conversation window, let it be known that it is Command+Shift+left/right Arrow

Monday, May 3, 2010

big/small delimiters fontsize

Ok this is old news but i am sick of googling it now.

Delimiters can be sized manually (i.e. not with \left \right) with \big \Big \bigg \Bigg. The sizing of these is adjusted (to the better when loading the amsmath package)

Non delimiters (and this includes Integrals and Sums) can be resized with \tiny
\scriptsize
\footnotesize
\small
\normalsize
(default)
\large
\Large
\LARGE
\huge
\Huge

Saturday, May 1, 2010

overlapping/embracing braces

I recently had trouble trying to tex this:



If you have some experience with latex you see the trouble with the overlapping here. It took a while and it's a load of patchwork, but it works beautifully.

\contraction{a_{n'} + \makebox[0pt][l]{$
\displaystyle{\cuntraction{\phantom{a_r(k) +
\overline\psi(x) \gamma^\mu \psi(x) A_\mu(x)}}}$}
a_r(k) + \overline\psi(x)} \gamma^\mu \makebox[0pt][l]
{$\displaystyle{\contraction{\phantom{\psi(x)
A_\mu(x) a^{+}_{n}}}}$} \psi(x) A_\mu(x) a^{+}_{n}
\ket{0}

It looks like this:


contraction was defined here and cuntraction is the same with an overbrace instead. To understand all ingredients review this pdf

The main idea is that makebox collapses the bounding box that latex uses to position items on a page without touching the content, so the under/overbrace will be displayed and dimensioned according to the lenght of its argument, which in turn won't be displayed because it's hidden via phantom. Since the bounding box is collapsed the following text will start as if there hadn't been any box.

PS:
I thought the above was complicated. Well i stand corrected, the following is plain ridiculous: