Greymeister.net

Sometimes C-ing Is Believing

I sometimes forget how fast C is. Until I am working on a problem with reading thousands of numbers from one file, sorting them, and writing the results into another file.

1
2
$ time groovy PartialPhoneFileSort.groovy 0 250000  
groovy PartialPhoneFileSort.groovy 0 250000  15.88s user 5.67s system 123% cpu 17.413 total
1
2
$ time ./a.out phonelist.dat sorted.dat 0 250000
./a.out phonelist.dat sorted.dat 0 250000  0.13s user 0.01s system 99% cpu 0.141 total

Touche´ sir. Touche´. But then again…

1
2
3
4
5
$ wc -l < PartialPhoneFileSort.groovy 
    29
    
$ wc -l < phonefilesort.c 
    74

Two Methods

There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.

I think I know of a culprit for the latter case.

iPhone 5 and Apple’s Yo-Yo Stock

My Twitter feed has been inundated by people reacting to tech blogs and analysts defending iOS and ruminating on how the iPhone 5 was “good enough or your expectations were wrong”. I have a 4S that I bought unlocked on eBay. I don’t upgrade every cycle, so for me I was never going to buy the 5. My last phone was a 3GS I bought unlocked on eBay. My guess is that barring some unforseen incident I will probably buy whatever comes after the iPhone 5 (5S? or just “The iPhone”) unlocked on eBay.

The moral of this story is that some people don’t buy every iPhone because they don’t need or want to.

Coopetition

This article presents an interesting comparison between Amazon today and M$ during the Gates monopoly era:

Working with AWS now is a lot like a software company partnering with Microsoft in the 80s and 90s — it’s both your biggest partner and your biggest rival so tread carefully.

AWS isn’t the juggernaut M$ was in the 90s (yet), but Amazon has entered into Netflix’s wheelhouse with Amazon Instant Video (which coincidentally did not suffer a service disruption). I wonder how long Netflix can stand “coopetition” with Amazon before they consider moving services to other providers.