2011-08-25

LaTeX formulas in gnuplot

As a reminder to myself: On the TeX Stackexchange, there is a nice question and discussion by me and some helpful people on how to use LaTeX code in gnuplot / how to embed LaTeX equations in a plot. A copy of my revised answer:

First, we set up a gnuplot called test.plt:

plot [-5:5] [-1.5:1.5] sin(x+pi) title "$\\sin(x+\\pi)$"

Then we also set up a small Makefile:

.SUFFIXES: .plt .tex .pdf

%.tex: %.plt
gnuplot -e " \
	set format '$%g$' ; \
	set terminal epslatex standalone color ; \
	set output '$@' \
	" $<

%.pdf: %.tex
	pdflatex $<

all: test.pdf
Running "make all" will produce this plot:

2011-08-10

Emacs other-window backwards

I am currently writing a lot of text in Emacs, and I need to work on multiple files in parallel. So I use the split window functionality a lot. With C-x o you can switch to the next split window. However, it would be nice to go backward as well. The solution is simple, and is given on Stackoverflow and some other blogs:

(defun prev-window ()
  (interactive)
  (other-window -1))
(global-set-key (kbd "C-x p") 'prev-window)

Just put this in you init.el, and you can cycle backwards using C-x p.

2011-08-08

SSL Everywhere for Safari

The EFF has published a Firefox extension to force HTTPS on as many websites as possible. This is a good idea(tm). But on OS X I use Safari, not Firefox. So I was wondering if there is a similar extension for Safari. It turns out there is. However, this extension is available in source only. The reason for this is given in a blog post by the developer. In short: The Safari extension API is limited, and the extension cannot guarantee that all your session cookies are transferred via HTTPS, making you vulnerable to stuff like Firesheep. And that is a bad thing(tm). But it is still useful, since it will redirect you to secure versions of the websites. One thing to note when following the build instructions: You need to enroll in the free Safari Dev program, and get a developer certificate. This is very well described over at Apple's developer center. After that, you can enable the developer menu in Safari's settings and just install the extension from the cloned git repository.

2011-08-07

What are the best Web Galleries?

I am one of the few avid MobileMe users. I use the gallery and like it. Nice upload features, integration into iPhoto. Not perfect, but it does the work, plus I have lots of disk space. However, Apple makes the transition from MobileMe to iCloud. During this transition, several features of MobileMe will be dropped. Besides the very useful syncing of keychains between computers, the gallery will cease to function. Some strange photo stream service will be introduced, which does not seem to be a real gallery replacement, but more like a large cache of you last 1,000 pictures taken. Useful, but only to a limited extent. So what are my alternatives? I need (in order of importance):

  • Share with other people (who are not signed in, a la Facebook)
  • 5-10 GB space for pictures or more
  • Able to make photo albums, user gets a nice web browser based viewer
  • Option for users to download the photos
  • Optional high resolution versions of photos (2048 pixels or more)
  • Good integration with iPhone, iPhoto et al.
I would pay for that service, if it includes 10 GB space or more. 

I already found out that Flickr and Picasa Web offer unlimited space, but in the free version there are quite the restrictions (limited image resolution, image usage by hoster, limited number of photos that can be controlled, advertisements, ...). Plus for example the Picasa Web Uploader for the Mac is horribly outdated (iPhoto '08...?).

So what other options are there? Which one is the best?