Sunday, April 29, 2012

Cool Tools:Excel Online - The web services I use

I wanted to show off embedding online spreadsheets from excel and sky drive, and remind myself how much I spend renting content, hosting, and renting software.  So, here's what an embedded excel sheet looks like To produce, save an excel file to your sky drive then click Share then Embedded:







The excel web app control is great, you can sort, filter, or make local modifications (they are not saved to the original). Anyway - have fun with this.


Sunday, April 22, 2012

Why would you make the maximum RAM in a laptop 4GB?

Lots of the new laptops coming out have a 4GB RAM limit.  This baffles me, the best bang for your buck  improvement you can make to a machine is to put in more RAM.  I use the Lenovo X220 precisely because it supports 16GB of RAM, and the first thing I did when I got it was upgrade the RAM to 16GB (total cost ~ 100$)



There are 2 reasons I can think of to have a 4GB ram maximum total:



1) Macbook Air Did It -  If it's good enough for apple , it's good enough for us. By the way, while I hate this reasoning, I bet it's actually the real reason.



2) Resume From Hibernate - Hibernate is a feature where all RAM is written out to disk so the machine can be powered down thus saving battery. To power back up, all content is read from disk into RAM and then we re-start the program execution.  The more RAM you have the longer resume from hibernate takes. Lets go through an example:



To resume from hibernate you need to read back all your RAM from disk.

Assume you can read disk at 100MB/s (that's pretty fast for a spinning disk)

Assume you need to read 16GB.

This will take (160s) or 2.5 minutes just to read back your RAM state.



I'll save how to fix hibernate for another blog post!














Thursday, April 19, 2012

The 5 assignment operators of "R"





In every programming language I've used, '=' is the assignment operator, but in R you can assign 1 to x in the 5 different ways listed below.  I'm sharing this with you because it reminded me how many ways there are to skin a cat, and how each of those choices has tradeoffs.



[A] x = 1

[B] x <-1

[C] 1 -> x

[D] x <<- 1

[E] 1 ->> x





[A] x = 1

'=' is supported in R, but rarely used.  Google Style Guide says don't use it. And I've never seen R code that does.



[B] x <-1

'<-' Is the most commonly used, so you'll almost always see x<-1.  Some R people claim x<-1 is a superior assignment operator since the '=' assignment  operator (x=1) can be confused with the equality operator (x==1).     It strikes me the '<-' assignment operator can be confusing as well.  When using negative integers a single space can really change the meaning aka: x<-1 vs x < -1. Trade offs are everywhere!



[C] 1 -> x

Assignment arrows work in both directions in the human mind, and they do in R too.



[D] x <<- 1



 '<<-'.  Assign not to x in local scope, but the x that is in the first parent scope.  To do this in a C family language you'd have to specify you wanted the x in the parent scope e.g:  ::x = 1. Notice the difference in R is that the operator changes the meaning of the variable passed to it. This is very strange in other languages.



[E] 1 ->> x

Assignment arrows work in both directions in the human mind, and they do in R too.





Monday, April 2, 2012

Cool Tools: Machine re-imaging:Ninite

I frequently need to re-image my machines, as a result, I need to install a bunch of apps (skype, paint.net quick time, picasa,etc). Every time I need to do this I forget that last time i found an app that solves this problem.



The app is called ninite, and it creates an on the fly downloader/installer for all the apps you want to install. Give it a try the next time you need to reimage a machine.



Hopefully, this will help me remember what I'm doing for next time.