January 28th, 2010
Depressing release day for Apple’s iPad perhaps (their stock didn’t go bazirker); however neither did it when Apple originally released the iPod — it took about 6 months to a year before the iPod became mainstream (I’m sure it will impact their stock the same way for the iPad).
I’m betting the iPad has it’s uses (and people will want it) — digital magazine, books, recipes, couch, in bed, passenger in car/train etc….when you don’t want to lug a laptop around, and want a little more screen real estate than an iPhone/iTouch, you’ll want an iPad.
VN:F [1.8.4_1055]
Rating: 10.0/10 (2 votes cast)
VN:F [1.8.4_1055]
Tags: apple, ipad
Posted in UI Design | No Comments »
January 13th, 2010
Using ‘eix’ it becomes quite easy to construct a search command listing all the packages currently installed for a given category.
In my case, I wanted to unmerge (remove) all KDE and Gnome desktop packages from my Gentoo system, as I’ve been using it only as server for several years now.
# generate a list of gnome-base packages you have installed
eix -C gnome-base --only-names --installed
#send it to emerge once you've got it
sudo emerge --ask -C `eix -C gnome-base --only-names --installed`
The ‘-C’ flag is the category base (ie: gnome-base or kde-base) — the other arguments should be obvious. You can always type ‘man eix’ for the specifics.
It’s a good idea to run ‘revdep-rebuild’ after removing packages as well.
sudo revdep-rebuild
VN:F [1.8.4_1055]
Rating: 10.0/10 (1 vote cast)
VN:F [1.8.4_1055]
Tags: eix, emerge, gentoo, gnome, kde, removing desktops, removing packages
Posted in Linux | 1 Comment »
December 22nd, 2009
I spent a few minutes today debugging the reason why one of my “rake” tasks was getting 503 connections (Service Unavailable) from Yahoo’s API.
I had mistakenly thought this was due to the fact that Yahoo limits the number of requests to their API in a given day. I decided to put a “sleep” call in my code to be sure it wasn’t being denied access due to server-side throttling. Sure enough — all requests succeeded after adding a brief call to the “sleep” function.
One of my rails applications relies on daily updated statistics from a variety of APIs for a large set of domains (all within a loop). After adding a 2 second pause just before making the relevant API calls was enough to allow all my requests to succeed.
for dir in @directories
sleep 2
# do the api_call()
end
The caveat here is that the number of requests you are making will depend on how long it takes to complete…adding a 2 second pause will substantially increase the completion time. In my case it takes about 33 minutes (2 seconds x 991 domains)….obviously with twice as many domains, it would take over an hour to complete.
I have not tried, but using a fractional sleep (ie: .5 seconds) would probably be enough to succeed, depending on whatever Yahoo’s servers are willing to allow (ie: sleep .3). Also, I have considered extending the amount of time in between batch runs. I currently am collecting stats every 3 hours. I could decrease this crontab job to run once a day, or only run the report on domains that haven’t had a new stat created in the last 7 days (for example).
VN:F [1.8.4_1055]
Rating: 9.7/10 (3 votes cast)
VN:F [1.8.4_1055]
Tags: api, rails, rake, ruby, sleep
Posted in Development, Ruby on Rails | No Comments »