Posterous
James is using Posterous to post everything online. Shouldn't you?
N3101777_33384447_8881__1__thumb
 

Out of James Aguilar

I am in love with charts

Charts are great for helping us make decisions.  I have recently fallen in love with them, partially because I've been reading too much Tufte.  And I'm not talking about the crappy graphs that Excel generates (at least by default).  I'm talking about graphs that look good and display the information in an easy to digest format.


Recently I was playing Mech Commander 2 (2000).  I got to feeling like the displays for weaponry and mech power within the game weren't telling the whole story.  They obscure the actual damage potential of weapons with big numbers.  The game guides are not much better.  I wanted to find out for myself which weapon really is the most powerful.  So I developed this chart:



Man, this chart really pulled the wool from my eyes.  It plots weapon damage per second versus critical slots used and heat generated.  Critical capacity and heat capacity are the two constraints on what weapons you can use, so what you want to do for any given mech is maximize your DPS at your chosen range given your chosen constraints.

A lot of the decisions I had been making based on gut feel were seriously incorrect.  For example, I never used short range missles (SRMs) before I created this chart.  Now I know that for their level of destructiveness, there is no weapon in the game that generates less heat.  I use them on all my short range mechs now when my heat is constrained by the harder-hitting weapons (heavy and pulse lasers).

I also had not realized various other interesting features of some weapons.  The Clan Ultra Light Autocannon (AC) does the same damage as the Clan Ultra Medium AC per critical slot, but takes less than half as much heat to do it.  The long tom cannon, the last weapon you get, is also the worst, and the thunderbolt (the second last) is not much better.  Lots of people think these weapons are good because they have high immediate damage, but over time they are not nearly as effective even as the weapons you start the game with.

Thinking about this also got me thinking about which of my mechs were actually most efficient.



The abbreviations are my made up metrics.  C/T is critical slots per ton.  MC/T is modified critical slots per ton (computes heat capacity in terms of critical slots and adds that to the critical slots count).  AMC/T is armor modified critical slots per ton, which does the same thing with armor as MC/T does with heat.  The chart is sorted first in mech class (light, medium, heavy, assault), and then in AMC/T.

What I found was that there is actually a wide variance in mech capabilities on a pound for pound basis.  The best mech in the game as it turns out is the Cougar.  People could easily overlook this because it's not big and intimidating like the blood asp.  But in this game what you're limited by is the weight of the mechs you want to bring to the table, not money or anything else.  Therefore you want to maximize your weapon-carrying capacity per ton, and the Cougar is what does that.

This also shows you pretty well what mechs you should not use.  For example, the Cyclops, while being big and heavy, is actually 33% less effective per ton than the cougar.  Likewise the Bushwacker and Jagermech have few redeeming qualities.

Shifting gears for a moment, there are a few other things I'd like to point out.  These charts aren't perfect.  If excel were a better program (or maybe if I were a better user), the bars in the second chart would all have exactly the same pixel width.  As it is they do not, which may lead to some visual confusion as you look at it.  My data in the second chart is also slightly incomplete.  The timber wolf does not have its armor value set, so its AMC/T comes out lower than it probably should.

I encourage you to use excel responsibly.  I don't use it very often, but I can definitely tell you a few things.  Do not leave the default graph colors.  They suck, and are ugly.  Change the background to white.  Change the axes to dark gray.  Change the gridlines to light gray and dotted.  The first graph was unreadable before these changes.

Another thing is that Excel does not support the first graph's labeling style for scatter plots.  I had to go to a third party to get that.  I won't be buying it myself since I rarely use Excel, but JWalk & Associates have done some really cool things with this plugin.  I encourage any frequent users to check out the generous 30 day trial.  Graphs like the scatter plot here are very difficult to generate in Excel by default, but they are wicked useful.  You may not think you need them, but you are wrong.

Charts and graphs are really fundamental to the presentation of data, so learn about them.  For god's sake don't use the spiderweb chart.  Tufte is an excellent resource.  I've been reading Visual Explanations and it's chock full of good examples and things to learn from.  He also has a lot of content online.

Loading mentions Retweet
Posted April 29, 2009
// 1 Comment

Adventureland

I liked Adventureland ok.  It wasn't the best movie ever, but it had some feeling.


My biggest concern about the move was the casual treatment of marijuana and alcohol.  There's nothing wrong with having a drink now and then.  And maybe this is California rubbing off on me, but I'm not going to condemn marijuana use either, although it's close enough to that blurry line of awareness abandonment that I still have no plans to try it.

My concern wasn't so much about the presence of these things as their mode of use.  Throughout the movie, it seemed like everyone used them mostly as anesthetic.  Maybe if your life is like that you need some anesthetic.  But if that's the case you're doing something wrong or you're in a situation that you need to get out of somehow.  I know life can be hard but I don't think you should spend so much of it on painkillers.

Loading mentions Retweet
Posted April 25, 2009
// 0 Comments

Thoughts on TPB conviction, digital piracy in general

I am not a fan of digital piracy.  I think it's good that the Pirate Bay guys are going to jail.

My axiom is that content production is good.  It's something that society should support.  Another is that content which we can represent digitally is non-rival and non-excludable and will continue to become these things to a greater degree in the future.  Content like this is a public good.  Therefore, in the long run it will become more and more difficult to make money from content, because it's not possible to prevent people from reproducing it without paying for it.  There are many examples of valuable goods that have this property: air, water from a river, the words of a great novel, etc.

Economics has provided us with several classes of solutions to the problem of making sure that public goods are produced at high enough rate.  We can pass laws that ration the consumption of a good.  For example, we have passed many such laws to force companies to not pollute the air.  We can also pass laws that artificially make a public good into a private one, as we have done with copyright.  There are more esoteric solutions that we may be able to use someday in the future, like the Coasian solution.  But the legal route is one possible route.

Finally, on a personal level, I do not care if people who are not willing to pay for a good get the chance to consume it.  I won't go into a detailed explanation of willingness to pay, but economics holds that everyone is willing to pay for goods at slightly different prices.  What you value at five dollars I may value at ten.  What if the seller is demanding eight dollars to buy this good?  Long story short, I don't care that you will not get the chance to consume it.

The Pirate Bay is a way for people, willing to pay or not, to get content for free when its producers want them to pay.  Inasmuch is it allows people to avoid paying for content, it also suppresses the production of that content by making it less profitable. 

It is no great loss that some people who would otherwise have gotten content for free might now have to pay.  And it's also no great loss that some people who were not willing to pay might now have to forgo consuming this content entirely.  I think the law is just and I support the outcome of this trial.

Loading mentions Retweet
Posted April 17, 2009
// 0 Comments

Having little experience in the matter

Having little experience in the matter, I don't know if this is unusual.  But sometimes when I'm reading in bed and my wife is dozing off, she will start laughing in her sleep.  Then she will wake up and try to explain to me what was funny.  


It'll be a story like, "There were these two bank robbers, and one of them needed to go to the bathroom.  And then there was a cop car behind them and this little kid was giving them the evil eye."  And then she starts laughing like crazy.

I think it is unusual.

Loading mentions Retweet
Posted April 11, 2009
// 0 Comments

Insightful blogging strategy

Here is how to make a blog post that seems insightful:

1. Pick a pet ideal of yours.
2. Find some famous person who has made a pithy quote supporting your ideal.
3. Find a real world anecdote that supports your point of view.
4. Throw some logic around it -- you need not prove the point, making gestures at its the vicinity is OK.
5. Finished!

Bonus points if there's a huge community of people around who will agree with you simply because they like the example instance in part 3. 

The biggest challenge is that I can't think of a much better way to argue.  Any attempt I could make in that direction wouldn't be an improvement.  I know that in science we have experiments and tests, but outside that all argument boils down to, "I have awesome examples supporting my point of view."

Inspiration: http://daringfireball.net/2009/04/complex

Loading mentions Retweet
Posted April 2, 2009
// 0 Comments

"The Caller"

Calling all programmers.  Are you in the habit of documenting your methods like this?


// Send rpc.  The caller must clean up the
// parameters after the rpc finishes.  This function
// takes ownership of done.
void SendRpc(RpcOp* op, InputParams* params, Closure* done);

Today I liberated myself from the tyranny of this documentation practice.  I should have known how to write things correctly before (I was an English major for a time).  But I have been doing it wrong for a long time, and apparently so have a lot of people whose code I've been reading.  So let me suggest a more compact representation of this doc comment:


// Send the rpc.  You must clean up the parameters
// after the rpc finishes.  We take ownership of done.
void SendRpc(RpcOp* op, InputParams* params, Closure* done);

Just changing the indefinite nouns to pronouns (from "the caller" and "this function" to "you" and "we") makes life a lot simpler.  The effect is more pronounced when there are more restrictions and caveats about the function you're writing.  Try it out for a while and let me know how it works.

Loading mentions Retweet
Posted March 27, 2009
// 0 Comments

Computer for sale

An image for my Craigslist broken computer sale post.

Loading mentions Retweet
Posted March 25, 2009
// 0 Comments

Second attempt at Eclipse Monokai theme

Click here to download:
test_prefs.epf (87 KB)

Beware: this will certainly rampage over some of your other settings.  If you want it to not, open it up in a text editor and delete the lines you don't need (you can find color lines with a regexp like /\d+,\d+,\d+/).  But when I tried this it made the file unusable, which means at least some of the non-color lines must be preserved.  I don't know enough about Eclipse to be able to tell which these are.

Loading mentions Retweet
Posted March 20, 2009
// 0 Comments

Screencaps of the schemes mentioned in the last post

Here are screen captures of what you will get if you use the configurations mentioned in my last post.  Don't take the code as an example of what I normally do -- it's just me fooling around with Android in my off hours.

   
Click here to download:
Screencaps_of_the_schemes_ment.zip (144 KB)

Loading mentions Retweet
Posted March 11, 2009
// 0 Comments

I get so tired of searching for programming editor color schemes

 

I think I've settled on something workable.  Finally.  I like the TextMate Monokai theme and it seems like it would work for pretty much any language you use it on.  Unfortunately, none of the editors I use regularly have ports of it.  So I have created them, one for Emacs and one for Eclipse.  I'll post them here for people who also want a sane default and don't want to muck around with their settings.

For people who use emacs, open your ~/.emacs file and replace your custom-set-faces with this:

(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(default ((t (:stipple nil :background "#272822" :foreground "#F8F8F2" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :family "outline-consolas"))))
 '(cursor ((t (:background "#F8F8F2" :foreground "#272822"))))
 '(font-lock-comment-face ((((class color) (min-colors 88) (background dark)) (:foreground "#75715E"))))
 '(font-lock-function-name-face ((((class color) (min-colors 88) (background dark)) (:foreground "#A6E22E"))))
 '(font-lock-keyword-face ((((class color) (min-colors 88) (background dark)) (:foreground "#F92672"))))
 '(font-lock-preprocessor-face ((t (:inherit font-lock-builtin-face :foreground "#66d9ef"))))
 '(font-lock-string-face ((((class color) (min-colors 88) (background dark)) (:foreground "#E6DB74"))))
 '(font-lock-type-face ((((class color) (min-colors 88) (background dark)) (:foreground "#66d9ef"))))
 '(font-lock-variable-name-face ((((class color) (min-colors 88) (background dark)) (:foreground "#FD971F"))))
 '(region ((((class color) (min-colors 88) (background dark)) (:background "#49483E"))))
 '(show-paren-match ((((class color) (background dark)) (:background "#3E3D32"))))
 '(variable-pitch ((t (:family "DejaVu Sans")))))

Note my font family is Consolas.  You may want to change this on your machine.

The Eclipse solution is a little bigger, partially because Eclipse is truly, epically stupid about colors and fonts.  Who designed this crap?

Anyway, I have a preferences.epf file stripped of Google-related preferences that has all the color data.  You will have to use File > Import > General > Preferences and load this file.  It will probably overwrite some of your other settings (especially around code formatting) unless you edit it first, because some non-color-related lines are required for it to work and I can't figure out which those are.  Because of the absolutely crazy insanely stupid way Eclipse handles syntax highlighting, this will probably break your Syntax highlighting in languages other than C++, Java, and XML, the only languages I have bothered to define the color theme for.  (This is because Eclipse is stupid, and more specifically because there is no common Eclipse framework for doing syntax highlighting.)

If it's helpful, here are the colors used in the theme for various general classes of objects:

             
                            fg                 bg
Default                #F8F8F2            #272822
Comment                #75715E
String literal         #E6DB74
Numeric literal        #AE81FF
Types, fn calls        #66D9EF
Keyword                #F92672
Function definition    #A6E22E
Function parameters    #FD971F

Current line highlight                    #3E3D32
Selection                                 #49483E

You can normally cannibalize one of these colors for any other purpose in a source file and it will still look good.  I don't pay attention to boldness or formatting, so I don't remember what those are set to.

Screen captures are available in the next post.

Edit: the Eclipse configuration I originally linked was poorly tested.  There's an updated one linked in this post which I tested on a clean workspace.

Loading mentions Retweet
Posted March 11, 2009
// 4 Comments