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:
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.
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.
Labels:
Divsie,
GoogleAppEngine,
OSX,
Pyramid,
WebDevelopment
Saturday, December 22, 2012
Threads and Exceptions
I learned something recently. One should be careful with
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,
The reason is that on Linux, those functions work by throwing a special exception. This exception is special and does not derive from
The same logic also implies that when using
In summary:
Note: the same does not appear to be true on Solaris.
References: Ulrich Drepper's blog, Kenneth's blog.
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 blog, Kenneth'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
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
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.
</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:
- 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.
- 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?
Update: Battery Life Answer?
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:
Source: Gotta Be Mobile
- 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
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.
Source: Google
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 4 | Galaxy Nexus (GSM) | iPhone 5 | |
---|---|---|---|
Processor | Quad-core 1.5GHz | Dual-core 1.2GHz | Dual-core 1.3GHz |
Display | 4.7" 320ppi | 4.65" 316ppi | 4" 326ppi |
Camera | 8MP | 5MP | 8MP |
Wireless charging | Yes | No | No |
NFC | Yes | Yes | No |
Operating system | Android 4.2 | Android 4.1 | iOS 6 |
Battery | 2100mAh 15.3hr talk 390hr standby | 1750 mAh | 1440mAh 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.
Saturday, October 6, 2012
Funny!
Wednesday, September 5, 2012
Everything is Relative
A Hulu commercial for IE9 shows a number of flattering quotes, including "IE9 is amazingly fast," from no less than the New York Times. That doesn't seem right.
A search suggests this quote came from a September 2010 blog article, "Microsoft's New Browser Is Pretty Cool. No, Seriously." The context of the quote is awesome (emphasis added):
First and foremost, IE9 is amazingly fast. Past versions of Internet Explorer always seemed bloated and slow, especially compared to Google‘s Chrome. But I’ve been using both for a week, and Microsoft’s browser keeps up with Chrome on my PC. (Full disclosure: Microsoft lent me an up-to-date laptop that shows off IE9 better than the bargain-priced netbook I usually work on.)And this is what they chose for the commercial!
Thursday, June 14, 2012
Tips for Google: Southwest in Flight Search
Google's flight search could be useful. But, sadly, they don't have my prices for Southwest Airlines. Something must be done!
I can speculate a few reasons SWA excludes itself from other agencies or sites, and chooses to sell exclusively on their own website:
Regarding the second point, in my personal experience, Southwest's fares are definitely more expensive than competitors', to the tune of about 25%. But SWA is more customer-friendly. It is much better not being hit with fees for every little thing. Flying American? Want to check a bag? Fee. Want to switch flights? Fee. Want to cancel your reservation? Fee. Want to redeem a rewards ticket without enough notice? Fee.
You pay more for Southwest's flexibility. Is it worth it? Probably.
Maybe it doesn't make sense to allow "ordinary" people to comparison shop if they lose their reputation for being cheap. If big G really wanted to list SWA prices I can imagine, say, only listing their prices on pages where you also show the competitors' fares with one checked bag included while also listing the base fare. That seems fair, pun intended.
I can speculate a few reasons SWA excludes itself from other agencies or sites, and chooses to sell exclusively on their own website:
- It may cost money to be in those systems, either explicitly through fees or implicitly through added overhead due to commissions.
- Southwest might lose its reputation as a low-cost carrier if its fares were shown side-by-side with other carriers.
Regarding the first point, Google doesn't need the fee revenue, and including SWA in the search results will drive more traffic to SWA's own website. There is precedent. SWA lists fares both on Travelport and Expedia's Egencia. Comparison-shopping is ok for corporate travel, but not regular consumers?
Regarding the second point, in my personal experience, Southwest's fares are definitely more expensive than competitors', to the tune of about 25%. But SWA is more customer-friendly. It is much better not being hit with fees for every little thing. Flying American? Want to check a bag? Fee. Want to switch flights? Fee. Want to cancel your reservation? Fee. Want to redeem a rewards ticket without enough notice? Fee.
You pay more for Southwest's flexibility. Is it worth it? Probably.
Maybe it doesn't make sense to allow "ordinary" people to comparison shop if they lose their reputation for being cheap. If big G really wanted to list SWA prices I can imagine, say, only listing their prices on pages where you also show the competitors' fares with one checked bag included while also listing the base fare. That seems fair, pun intended.
Subscribe to:
Posts (Atom)