Wednesday, May 29, 2013

Pixel Suggestions

So I've been playing with my new toy, the Chromebook Pixel. Everyone knows ChromeOS as the OS which is only a browser, but it is surprisingly capable. Of course, everything which works in Chrome, works well on the Pixel. This includes many Chrome apps, a few of which Google suggests upon the first use. (Hint to Google: Fix all those broken links!)

As a developer though, I spend most of my time either in a browser or in a shell. And on my laptops, most of the shell time is spent in ssh. ChromeOS works reasonably well for this. There are two apps I want to highlight for users like me. There are Chrome apps for secure shell and VNC. So far, I have been able to live completely inside ChromeOS without resorting to developer mode. I will blog more tips as I find them.

I've found myself recommending the Pixel quite a bit. The free Drive storage offer is worth more than the cost of the machine. And ChromeOS can be replaced with your favorite Linux distribution. The screen is great, with more pixels per inch than Apple's "retina" MacBooks, and with a better aspect ratio too! A better machine, with Drive storage, without the Apple tax, and without OS/X's many flaws (window management???)... How could you pass it up?


Tuesday, May 28, 2013

Google I/O 2013: Part 1


Google I/O is over, and it was awesome! I've been too busy to summarize it, so I'll post in chunks. This is the first part. A lot of this has already been covered in the tech media, but this is my take.

Devices: There was little news on the device front. The rumored new Nexus 4 LTE and Nexus 7 refresh did not materialize. But, a pure Android version of the Samsung Galaxy S4 was announced. It will be sold on the Play store for $649 and is expected on June 26. And a white Nexus 4 made an appearance. It will be sold on the Play store for $299 and is expected on June 10 with Android 4.3.

Android: The rumored Android 4.3 was nowhere to be seen! Although we can infer some of the improvements scheduled for 4.3, this was a deliberate omission. It was Google's way of saying they don't need a new Android version to deliver improvements and new APIs. Considering the constant talk of fragmentation and handset makers struggling to keep up with upgrades, this is an interesting shift in policy.

Instead, the majority of platform updates were bundled into a library, Google Play Services, which is available on Android devices back to Android 2.2 and which auto-updates just like the Play Store. The functionality in Play Services includes a battery-friendly location provider, geofencing, activity recognition, cross-device notification syncing, Google+ cross-platform single sign-on, the Maps API, Cloud Messaging, and multiplayer gaming functionality.

The gaming functionality will also be available on iOS.

Sunday, February 3, 2013

Robust buildout

If you followed the pyramid instructions from a previous post, you have a buildout.cfg file which lists package dependencies. Unfortunately, buildout by default lacks some reproducibility. Follow these instructions to specify the exact versions of the packages to use, which can be determined with the following command:

bin/buildout -Novvvvv|sed -ne 's/^Picked: //p'|sort -u


Saturday, February 2, 2013

100 Best Companies to Work For (2013)

Fortune recently released their updated "100 Best Companies to Work For" list. CNNMoney has great coverage of the list with the particulars of each company. The only thing missing is a map. I mapped the corporate headquarters of each company. Check it out:

Tuesday, January 29, 2013

OS/X and terminals

Being new to OS/X, my first concern is a usable terminal. Here are a few tips...

iTerm2
Apparently, Apple's terminal app really sucked in a previous life. It's better now, but iTerm2 had a head start. One of the most useful features is "mouseless copy," i.e., copy by highlighting, which will be familiar to all Linux users. Other neat features include the  exposé tabs and search capabilities.

Fonts
Monaco is good. Other popular options are Inconsolata and Source Code Pro, a monospace relative of Source Sans Pro.

Color Schemes
Solarized is available for iTerm2 and vim. Here are other options.

Mind Blowing
The potentially awesome feature of iTerm2 is tmux integration! You can attach to tmux sessions, and have their windows treated as normal tabs. It is a killer feature. A special patched version tmux is required, and it has plenty of drawbacks, but it's new. I've used screen over tmux in the past, but this could be worth the change.

Sunday, January 27, 2013

App Engine and Pyramid

There are so many interesting libraries and frameworks which help bootstrap and start building modern web apps. I decided to explore some of the choices for a personal project. I want this project to run on Google's App Engine, using python on the server. Everything else is negotiable.

Saturday, December 22, 2012

Threads and Exceptions

I learned something recently. One should be careful with catch(...). And one should be very careful with pthread_cancel.

The catch-all has a limited uses of course, since you usually know the types of exception to expect. However, there is the rare occasion for its use. What I learned is that you must always re-throw the caught exception. If you don't, pthread_cancel and pthread_exit may break.

The reason is that on Linux, those functions work by throwing a special exception. This exception is special and does not derive from std::exception. You must re-throw it. It is possible to catch this exception alone and re-throw. In order to do that, see this post.

The same logic also implies that when using pthread_cancel, you should not use functions which serve as cancellation points in destructors. In other words, it is best not to use pthread_cancel.

In summary:

  • When using catch(...), always re-throw.
  • Do not use pthread_cancel.

Note: the same does not appear to be true on Solaris.

References: Ulrich Drepper's blogKenneth's blog.

Monday, December 3, 2012

runonce

I sometimes need a process running in the background. Long ago, I wrote a very simple script which runs a command if not already running. Now, it's updated for OS/X.

https://github.com/jeffgarrett/scripts/blob/master/runonce

Sunday, December 2, 2012

MathJax for Blogger

For basic MathJax support in Blogger, all you have to do is edit the HTML of your template and put the following before </head>:
<script type='text/x-mathjax-config'>
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']],
                     displayMath: [['\\[','\\]'], ['$$','$$']]}});
</script>
<script src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' type='text/javascript'>
</script>
This is all you have to do if you aren't using Blogger's dynamic views. The principal issue with this method is that RSS readers do not render the LaTeX. This was the justification for the LaTeX for Blogger user script. But MathJax looks so much better on a retina screen!

It is possible to have the best of both worlds, and maybe one day I'll blog how...
$$\int_0^1 x^2 dx = \frac{1}{3}$$ Source: checkmyworking.com

Edit: Set your mobile template to "Custom" to pick up the MathJax on mobile.

Friday, November 30, 2012

New MacBook Suggestions

So I have a new MacBook. It's my first and only Apple product. Any suggestions?

I'm looking for a good terminal app and a good tiling window manager (a la i3). Also, is there a way to maximize windows without making them full-screen?

Wednesday, November 21, 2012

Battery Life Answer?

I may have found an answer to my question. My battery life is back over 24 hours. Investigation suggested that it was syncing-related. I tried the following two things (after other failed attempts) based on the weak evidence I had:
  1. Set my phone to always keep wi-fi on during sleep (under Wi-Fi, under Advanced in the menu). I have weak cellular coverage in my house, so falling back to cellular isn't necessarily better for battery.
  2. Disable Currents from syncing. It is a heavy abuser, and I don't use it.
Problem solved.

By the way, two apps I have used for keeping an eye on battery are BetterBatteryStats (good for investigation) and Battery Widget? Reborn! Pro (general purpose, good for keeping an eye on drain).

Thursday, November 15, 2012

Android 4.2 Battery Life?

My Galaxy Nexus' battery life has gone from about 25 hours on 4.1 to 8 hours on 4.2. The same is not true of my Nexus 7.

I haven't figured out what it could be. Any ideas?

Wednesday, November 14, 2012

Android Update Trick

Android 4.2 is rolling out to Galaxy Nexus and Nexus 7 devices. If you're impatient, there's a trick which worked for me:
  • Go to Settings
  • Disable Wifi
  • Go to Apps, then to All
  • Find Google Services Framework
  • Force Stop
  • Clear Data
  • Go back to Settings
  • Enable Wifi
  • Go to About phone/tablet
  • Go to System updates
  • Check now
Your mileage may vary.

Source: Gotta Be Mobile

Monday, October 29, 2012

Nexus Announcements

Google canceled the Android event today due to the hurricane, but the expected products were still announced. Take a gander.

Nexus 4

A new phone, the Nexus 7 was announced. The specs are below, with comparison to the previous Nexus and the recently announced iPhone 5. Most interestingly, it will support wireless charging.

Nexus 4Galaxy Nexus (GSM)iPhone 5
ProcessorQuad-core 1.5GHzDual-core 1.2GHzDual-core 1.3GHz
Display4.7" 320ppi4.65" 316ppi4" 326ppi
Camera8MP5MP8MP
Wireless chargingYesNoNo
NFCYesYesNo
Operating systemAndroid 4.2Android 4.1iOS 6
Battery2100mAh
15.3hr talk
390hr standby
1750 mAh1440mAh
8hr talk
225hr standby
Price$300 (8G), $350 (16G)
Subsidized: $200 and up
$350 (discontinued)$649 (16G), $749 (32G), $849 (64G)
Subsidized: $200 and up

Nexus 7

The pricing of the Nexus 7 has been reduced. Formerly, the 8G version was $200 and the 16G version was $250. Now, the 8G version is discontinued, the 16G version is $200 and the 32G version is $250. Also, a version with 32G and HSPA+ data will be released on November 13 for $300.

Nexus 10

A new Nexus 10-inch tablet with an extremely high resolution amazing display was announced. The Nexus 10 is 300ppi. For comparison, the iPad 3 and 4 are 264ppi. The Nexus 10 will be available for $400 (16G) and $500 (32G) on November 13.

Android 4.2

An incremental version update to Android, still called Jelly Bean, accompanies the devices. As expected, it will support multiple users (on tablets). This could be an important feature for shared tablets.

Google Now

Android 4.2 comes with an update to Google Now which adds flight information, restaurant and hotel reservations, and shipping details.

Photo Sphere

Android has had panoramic photos for some time, but now that Apple has it, I guess it's time for something new. This new feature produces StreetView-inspired 360-degree immersive experiences, shareable on Google+ and Google Maps. This is potentially interesting.

Gesture Typing

Android 4.2 also includes Gesture Typing, which sounds like direct competition with Swype, and now SwiftKey Flow.

Google Music

The announcement included unexpected updates to the Google Music service. First, they will have a matching service. Apple was first with iTunes Match, and then Amazon with their Cloud match (both $25/year), and now Google comes along with their matching service (free). The benefit is that music files can be matched against the content library and users can access music they legally own without having to upload it all. For people with large mp3 libraries, this is a much quicker way to get started with online music. The matching service will come to Europe first on November 13. Google also announced a partnership with Warner Music Group, the major label holding out from listing on Google Music.

Source: Google

Saturday, October 6, 2012

Funny!

Bing is aggressively advertising their Bing It On challenge, the "Side-By-Side Search Off." So what do you get if you search for "side by side search off"? Here's Google. Here's Bing.


Google has Bing's challenge page as the first link. Bing doesn't even have it on the first page! Challenge lost.