Tuesday, May 17, 2011

Instant, cheap heat

I'm one of those people that's cold even in warm weather. Rather than constantly running up the heating bills, I make use of a flax bag. You only need to pop it into the microwave for a few minutes and it's warm for at least an hour. In fact, since the flax seed inside has a high heat capacity, even using an un-microwaved flax bag is equivalent to an extra blanket. They're certainly much cheaper (and more satisfying) than heating the whole space to 80 degrees!

Source: http://www.f-r-chiro.com/images/100_0942.JPG
Source: http://www.massagesantarosa.com/assets/HTPimages/BlueBeachMed-heating-pad.gif


I've been fortunate enough to have received flax bags for Christmas and so I've never had to buy my own. However, I'm told you can buy them at farmer's markets (~$20) or make them at home (some suggest using rice or other materials). I've also seen a few commercial versions. Do you have any good sources or tips on making your own?

Version control for the time-limited

I often keep many versions of the same file around in case I decide later that I needed some little paragraph or code snippet. It's also very useful to be able to see under which set of code a particular set of data was generated (e.g. "did I fix the bug before or after I made this data?"). Thus, I was looking for some version control software to help me out.

I won't claim that this is the best version control software out there, but it works well for me. I use Git as a backend (read more about it on Wikipedia if you'd like -- Linus Torvolds started it) and SmartGit as my user interface. It allows me to commit changes with comments or revert to old versions. I can also see the differences between versions and track file history (branches, etc.).

As your next step, you can check out some of the screenshots I've posted below (stolen from SmartGit's screenshots page) or read another review.


Directory and file list

Graphical change log

Differences between two files

Friday, March 25, 2011

Control the look and feel of Gmail with Minimalist

Yesterday I found a great Chrome extension for Gmail called Minimalist. It allows you to change almost anything in the Gmail interface. To give you a quick idea of the difference it can make, here are some images from their page in the Chrome web store:



~ in Matlab: not just for NOT

When reading Steve's article on the irregular behavior of Matlab's size() function, I was reminded of a neat trick.

Frequently I call a function and only use one or two of its output arguments. In many cases I use the first couple of output arguments, but occasionally I want to use, say, only the second output argument. If I assign the first output to some variable, I now have a meaningless variable floating around, taking up space, and potentially causing problems. A much more elegant solution is to call the function like this:
[~, output] = myFunction(input);
In this way, the first output argument disappears while the second is saved to the variable output.

If you'd like, you can read articles on the same topic by Matlab geniuses Loren and Steve.

Matlab subplot


I often use Matlab's subplot function to plot multiple things in one figure, like this:

However, I recently discovered that you can have them span multiple rows or columns:

Note: all figures shamelessly stolen from http://www.mathworks.com/help/techdoc/ref/subplot.html, Matlab's subplot documentation.

LyX

I've been using LaTeX for years and although I got used to doing my own formatting, it was clunky. I'd only use it if I was writing a final draft for homework or a paper, never for just jotting down notes. However, a friend of mine introduced me to LyX a few months ago and now I'm hooked.

LyX is a WYSIWYG ("what you see is what you get") editor: it auto-compiles most things for you so you don't have to wonder how it will look when you're done. This includes
  • text formatting (size, weight, font, etc.)
  • figures (auto-preview)
  • equations (auto-render/preview)
  • tables (auto-preview)
Now I don't have to compile my document to make sure that I typed everything in correctly and that it looks right. Instead of going through the usual messy process of nesting my lists, I simply tell LyX to start a list and tab as necessary.

Using LyX is so quick, easy, and painless that now I use it to write notes to myself and document my projects. LyX combines the simplicity of a regular text editor with the beauty of LaTeX.

Here's a screenshot I stole from Wikipedia:



In the interest of honesty, I have found a few limitations which I consider noteworthy:
  • Every now and then, somethings happens in my document and I'm unable to use certain functions. For example, one document all of a sudden stopped letting me use \int in the LyX auto-render math mode but would let me use it in the LyX "LaTeX code" mode. I'm still not sure what's going on here or how to fix it... (update: if you're having trouble with using \int and it says that \iint is being redefined, check out this thread).
  • Although you can add to the source code using the "LaTeX code" mode (ctrl+L), I haven't yet found a way to edit the automatically generated code. Of course you can view the code, copy it into your second-favorite LaTeX editor, and proceed but that's quite clunky.



Monday, February 28, 2011

Best Gmail extension: Boomerang

Does your inbox ever fill up with emails that you know you won't respond to for at least another week? If you archive them, you'll just forget to ever write them. Even if you stick them in a special "open me on ..." folder, you're unlikely to attend to them.

Do you ever want to delay sending a message by a few minutes? A few hours? A few weeks?

What if you send an email and want to make sure you're reminded about it if no one responds?

If you have ever had any of the problems above or are just plain curious, you should try Boomerang for Gmail. It's an extension available for Firefox or Chrome and I highly recommend it. You can read their FAQ here or download it here.