Archive for July, 2006

Latex: Citations in Figures

Wednesday, July 26th, 2006

For some unknown, mysterious reason you can’t put a \cite command as an argument of the \caption statement. I stumbled upon this today when I was trying to attribute an image that I shamelessly snurched from the web.

Apparently, the cause is not as mysterious as I thought. If you want to know why this happens, do some research on fragile commands and moving arguments. Do you need to understand these things throughly? Probably not. You just need to remember that you may sometimes need to protect a \cite when it is an attribute of something else:

\caption{Very Stupid Image \protect\cite{source}}

So here is a new rule of thumb: if you nest a command in an attribute of another command and latex freaks out, you might be dealing with a fragile command inside of a moving attribute. Sticking a \protect in front of the command is a good place to start troubleshooting the problem.

Update 12/15/2006 04:03:46 PM

One caveat here - if you put citations in image captions, then they will show up in your list of figures. This looks a little ugly, and it can mess up your citation order. For example, if you use IEEEtran.bst for your BibTex formating, then the first cited source should be [1], second source should be [2] and etc… Unfortunately if your list of figures is on page 3, then the first citation on that page will be counted as [1] even if the actual image does not show up till page 64.

So be careful with these.

Update 01/08/2007 10:05:32 AM

I figured out the caption and the list of figures issue. It turns out that \caption can take an optional parameter which is the text for the list like so:

\caption[Stupid Image]{Stupid Image \protect\cite{source}}

If you use it this way the citation only shows up under the figure, but not in the LoF and thus the order of references is preserved.

Moving Forward

Wednesday, July 26th, 2006
This is how I feel

It seems that the paperwork needed to finally register my thesis course is going to get done by the end of the week. And I think my assistantship is still going to cover it. I’m really relieved that I will not have to shell out an obscene amount of money for the stupid last 3 credits of my masters degree.

I feel like things are finally moving forward. Now I just have to finish writing the damn thing and defend it.

MPAA suing a Millionaire

Tuesday, July 25th, 2006
MPAA Sucks

So far RIAA have been suing old ladies, single mothers, young children, and dead people. It is a brilliant strategy - you sue innocent people who can’t pay legal fees and extort money from them. If they can’t pay up, you can always suggest that they drop out of college. The rule of thumb is that if you sue middle or lower class people they will not be able to afford a lawsuit, and will have to settle.

Apparently MPAA was not taking notes. They decided to up the ante and sue a millionaire. He has lots of money so they can squeeze a big settlement out of him, right? Wrong. If you have money, you can hire expensive lawyers to tell MPAA to suck it. Shawn Hogan, the said millionaire CEO is willing to spend $100,000 or more in legal fees to prove his innocence, and stick it to the litigious movie makers.

Go Shawn! You are the hero of the internet generation! I think we should all figure out what Mr. Shawn’s company is selling, and buy some just to support his cause. mrgreen

Cursed Dice

Tuesday, July 25th, 2006
Dice Set

Reading about a guy who buried a set of allegedly cursed 10 sided dice in his back yard reminded me of our own set of dice related superstitions. You may think this guy is silly, but I can totally relate to that. I’m the least superstitious guy around. I usually laugh when people talk about black cats, broken mirrors and all the things that. But when it comes to dice - that’s a whole different story. Sadly, you have never played RPG or tabletop games you most likely will not understand this.

Here are some of the dice superstition from my gaming years:

  • There are lucky dice, unlucky dice and neutral dice. You should never ever mix them.
  • If you store lucky dice with neutrals dice, they will loose their power.
  • If you store unlucky dice with any other dice, they will infect the whole set.
  • Dice use up their luck when rolled repeatedly. Each time you get one or two desirable rolls you should retire the dice for a turn, and allow it to recharge before rolling it again. Otherwise you may tap out all the luck out of it for the rest of the game
  • If you treat your dice well, the dice gods will favor you. Never call your dice stupid, or curse at them. It guarantees bad luck.
  • Even the best dice will roll low once in a while. However, lucky dice usually yearn to redeem themselves after a particularly bad roll or series of rolls. A dice that just rolled 1 is likely to roll high the next time. This only applies to lucky dice though.
  • Dice gods hate to be taunted. You should refrain from saying things like “Anything but 1″
  • It is lucky to invoke the name of a relevant in-game deity before your roll. If you play in Star Wars universe, you may invoke the Force.
  • Sharing dice is very unlucky. If your dice get mixed with your opponent’s dice, they may turn against you.
  • You should have a pre-roll ritual - such as shaking the dice certain number of times, huffing on them, whispering to them and etc… It does help.

Statistically speaking, all of those things are bullshit. I personally do not believe in any of these things. But I do half-jokingly conduct my little pre-roll rituals, watch not to tap out my lucky dice, and segregate the good and bad dice.

As a side note, there are high and low rolling dice. It is virtually impossible to manufacture a perfectly random die. The cut, wear and tear on the corners, distribution of weight and etc are all important factors. Sometimes you get dice that are cut in a way that gives them minimal preference on certain rolls. Sometimes you get ones that have air bubbles trapped in them, or where the plastic is denser in one area. These effectively act as “loaded” dice even thought they are perfectly untampered with.

The superstitions, and rituals do help you keep track of those odd dice, whether you are doing it consciously on not. mrgreen

OMG! This guy beats Edoh!

Monday, July 24th, 2006

I finally found someone who can compete with Dr. Edoh for the Worst Computer Science Instructor Award. At least Edoh attempted to teach us data structures using Java. This guy picked VB:

Linked Lists in VB

Wow… Just wow… I seriously think that any of my Dr. Edoh stories can top this. “Antihokes” aside, this guy really deserves some kind of recognition. How the hell do people like that get teaching jobs at a college level?

found via the daily wtf.