# Mininook

### Musings on Christianity, Politics, and Computer Science Geekery

I've had many people over the years ask me what to look for when purchasing a good laptop.  That has changed over the years as we have seen a shift into multi-core computation and reliance on SSD technology.  So, here is a current run-down of buying tips (in order):

1. Buy just inside your budget, but do spend as much as you can for it, since that will probably make it last as long as it can for you.  Buying the cheapest means you'll likely need to replace it earlier.
2. Memory:  If you are comparing multiple computers, at this point go with the one with the most RAM.  4GB is standard now for mid-level laptops, 8GB is even better.  2GB is doable for chromebooks and it works for a netbook, but it's not good for doing anything "big" on the computer.  (For any real work I use my desktop or laptop with 8GB of RAM each).
3. Cores: The next thing to look at is the number of cores in the processor.  It goes hand in hand with the RAM, in that you want as many as possible.  In the worst case I'd trade off more RAM for fewer cores.  This information would likely be in the fine-print of the computer details, but it will say "x-core processor." I'm not too worried about the brand (Intel or AMD) at this point.  Typical low-end laptops have 2 cores.  For longevity, I'd go for at least a 4-core if possible.
4. Type and speed of processor:  This is secondary to the number of cores, mostly.  Intel has the reputation of being the best, followed by AMD.  However, AMD's processors are cheaper to buy, giving you more options in the lower-cost machines that could potentially be "faster" than their Intel counterparts.  (For desktops, I buy AMD to get more cores and speed for the price).  That is to say, after RAM and number of cores, I'd pick an Intel i7 or i5 line over the AMD chips (A-series processors), but I'd pick AMD's A10,A8 over the Intel i3, Pentium, Celeron, or Atom models.  At this point, don't buy a laptop with an ARM processor (that day will come soon).  Secondly, get the fastest processor of the best line you can (higher GHz).  Since the multi-core revolution, I'd say number of cores wins over speed of the core, since it allows the machine to do more at once, even slowly.
5. Hard drive: SSDs are faster. Period.  However, they're expensive and therefore smaller in size.  My netbook has a 32GB SSD hard drive, and it's been full for months.  So, I can't do much with it.  If you want to store music, documents, and a lot more, get one with a rotational HDD.  It may be a little slower, but it can store a lot more.  Plus, for a cheaper cost down the road, you can replace the HD with an SSD (about a \$100 upgrade).
6. Brand: Last but not least, get a brand you know.  Dell and Lenovo seem to be the go-to PC brands, and they've been around and solid for a while.  Asus and Acer are also great brands.  I'd personally stay away from HP for now and very off-brands.
Right image: 2012 Election Results (1), Left image: Hardest Places to Live in the US (2).

A few weeks ago, the New York Times posted a great article on the hardest places to live in the United States, based on education, median income, unemployment rate, disability rate, and a few other factors.  It is an incredible article, and I recommend reading it at nytimes.com.  As soon as I saw their graphic, I immediately wondered if there was a connection between political persuasion and hardness.  To look at this, I grabbed Mark Newman's version of the 2012 election results and a nice image comparator so that the two maps can be compared on top of each other.  The results are interesting!

For clarification: On the election results (left), each district is colored on a gradient from blue to red based on percentage of the vote for the winning candidate (purple would mean an even split Obama/Romney).  For the NYTimes hardness results (right), dzisctrics are colored on a gradient orange to green, where orange is worse (harder to live) and green is better.

What to make?  I don't know.  In the north-east (areas including New England, Kentucky, Michigan, Illinois, and parts of Virginia), it appears that the more liberal areas are usually the easier places to live, and the harder places to live are usually more conservative.  However, in the mid-west (the entire middle of the country west to California), it appears to be just the opposite.  In any case, it's interesting to think about!

###### References

1.  Newman, Mark. "Maps of the 2012 US Presidential Election Results." N.p., 8 Nov. 2012. Web. 14 Oct. 2014. <http://www-personal.umich.edu/~mejn/election/2012/>.

2.  Flippen, Alan. "Where Are the Hardest Places to Live in the U.S.?" The New York Times. The New York Times, 25 June 2014. Web. 14 Oct. 2014. <http://www.nytimes.com/2014/06/26/upshot/where-are-the-hardest-places-to-live-in-the-us.html>

I may be stuck in the past, or like punishment, but my editor of choice is still VIM.  However, certain tricks seem to be hard to find on Google searches, so I'm going to compile them here:

• Creating custom commands and keyboard mappings are easy in VIM.  To create a custom command, list the command in the .vimrc file.  The % character includes the current buffer's filename in the shell command.
command CommandName execute "!shellcommand %"
This command can be run in VIM using the standard :CommandName convention. To map this new command to a keyboard shortcut, use the map command in the .vimrc file.
map <F5> :CommandName<CR>

So, I always am using some command line shortcuts to do various tasks, and often have to look up the tricks every time I need to do something remotely fancy.  Here are some of my most-used helpful hints:

• To remove the leading spaces and tabs from each line of text on standard in (so use with a pipe for the input), this sed command will work well:
sed -e 's/^[ \t]*//'
• Reformatting XML/HTML files so that line returns inside tags are removed:
xmllint --format --noblanks infile.xml > outfile.xml

Large streams of data, mostly unlabeled.

Machine learning approach to fit models to data. How does it work? Take the raw data, hypothesize a model, use a learning algorithm to get the model parameters to match the data.

What makes a good machine learning algorithm?

• Performance guarantees: $\theta \approx \theta^*$ (statistical consistency and finite sample bounds)
• Real-world sensors, data, resources (high-dimensional, large-scale, ...)

For many types of dynamical systems, learning is provably intractable. You must choose the right class of model, or else all bets are off!

Look into:

• Spectral Learning approaches to machine learning