TODDBLOG/ tags/ tech

This feed contains pages in the "tech" category.

android review and recommendations

It is pretty difficult to find unbiased reviews of micro apps for some reason. Here are the parts of Android that I use regularly:

  • Cyanogen --not an app, but possibly the best thing you can do for your Android. I have noticed a nice speedup and have used a lot of the tools included with Cyanogen to debug things and poke around, just scratching the surface of what this makes possible.
  • A task killer. I have been using Advanced Task Killer only because it is the first search result. Before installing Cyanogen I was using something else, which worked equally well. One of these apps is essential, particularly with the limited CPU and RAM on ADP1/G1. Nearly all apps are not worth running backgrounded on this phone. I kill all tasks when things are slow. The mentioned app has a nice big "kill all" button.
  • Pandora -- even works pretty well on EDGE
  • Maps -- best mobile mapping experience I've seen thus far -- "Navigate" and Buzz are nice additions.
  • Power widget in Android 1.6+ -- quick access to power for the various radios, brightness, syncing.
  • Calendar Widget -- included "desktop" widget which lists upcomming events
  • Astrid todo lists with sync to web
  • RoboDefense -- tower defense game- incredible waste of time :)
  • Listen -- podcast receiver from google labs.
  • Google Talk -- clean enough to run in background on ADP1/G1.
  • Calendar -- included app with sync to web.
  • Included "music" app -- could use some polish, but it works.
  • Included music & search widgets
  • Bluetooth -- not an app, but the bluetooth audio support blows me away. I just get in my car, and press play in any music app. All audio goes through car speakers. I use this all the time.

Obvious missing item: mail client. I used K9 for a while, but have mostly given up. The ADP1/G1 is too slow for ~2000 item IMAP. Prove me wrong.

I have some other things that are handy somtimes, but not regularly. These include Amazon, Barcode Scanner, ConnectBot, OpenTable, Paypal- nice when you forget wallet :), Pixelpipe, Voice, Twitdroid.

I've been pretty satisfied with the ADP1 in the ~1 year I've had it. It has left me more impressed than everything I've owned prior including n97 and iPhone. I look forward to ending my ATT contract this summer at which point I'll probably buy the fastest iteration of Android phone that is available.

Posted Mon 15 Mar 2010 02:54:38 AM UTC Tags: tech
how to keep an ovrloaded db running

Here is my new trick to keep a website running when mysql is overloaded:

Assuming you can narrow down your problem to a bad query on the site and you have no sensible way to disable what is causing it [or if you don't know the source of the bad queries] you can kill queries by regex using something like this

MYSQL="mysql -u root --password=passwd"
BAD_QUERY_REGEX=".*select * from users limit 100000.*"

while `true`; do 
  for x in echo 'show processlist'|$MYSQL|grep $BAD_QUERY_REGEX|awk '{ print $1 }'; do
    echo kill $x | $MYSQL
    done
  sleep 2
done

This will kill any query matching BAD_QUERY_REGEX every 2 seconds. This technique is valuable when some part of a site is killing the whole site because of bad queries. It's not immediately obvious that you can do this to save a site.

Posted Wed 28 Oct 2009 11:51:01 PM UTC Tags: tech
arduino heartbeat code

I recently got a mail from Chris McGuire asking about how I made the LED heartbeat effect.

For anyone interested, my code is here

Posted Mon 02 Mar 2009 09:49:49 PM UTC Tags: tech
2008 email sending statistics

Somehow I figured these numbers would be higher. I ran statistics back to 2004:

lolz% ./toys/mailstat ~/Mail/sent-mail
Mail sent by month: 2008
{1: 174,
 2: 293,
 3: 274,
 4: 322,
 5: 207,
 6: 238,
 7: 222,
 8: 274,
 9: 322,
 10: 473,
 11: 276,
 12: 193}
total: 3268
avg: 272

Avg for 2008: 272
Avg for 2007: 193
Avg for 2006: 187
Avg for 2005: 126
Avg for 2004: 159
Posted Sat 17 Jan 2009 11:37:25 PM UTC Tags: tech
startups and freedom

Paul Graham makes some intelligent calls on scale with regard to size and age and freedom of companies. The article is about allowing your team to ship code, but I found the part about startups being more free most interesting. I have noticed this pattern too. Since there are no established patterns and rules in young companies, they are free to do things now that will take much longer to pass in established companies. It is no wonder that art happens in the trenches.

For good programmers, one of the best things about working for a startup is that there are few checks on releases. In true startups, there are no external checks at all. If you have an idea for a new feature in the morning, you can write it and push it to the production servers before lunch. And when you can do that, you have more ideas.

From: The Other Half of "Artists Ship"

Posted Tue 02 Dec 2008 11:05:23 PM UTC Tags: tech
awesome wm

I have been very happy with the awesome window manager for several months since switching from Ion.

Here is a screenshot of my config:

awesome screenshot

Posted Tue 19 Aug 2008 09:02:39 AM UTC Tags: tech
what querycache sounds like

Last night Andrew, Viddler's frontend guy suggested to me that the MySQL querycache free space graph looked like a waveform and that MySQL was trying to tell us something.

So of course I had to convert the RRD data into a waveform.

The resulting sound is here.

I can't make anything out. It could be a different language.

Here is the code I used to make the sound:

#!/usr/bin/python

import pygame
import time

from Numeric import array
pygame.mixer.init(800, 8, False)

#sndarray = pygame.sndarray.array()

sndarray = []

f = open('vals.txt')
for line in f:
    val = float(line.strip())
    sndarray.append(int(val*10))
f.close()
#numsndarray = numpy.array(sndarray)
numsndarray = array(sndarray)
snd = pygame.sndarray.make_sound(numsndarray)
snd.play()
time.sleep(20)

Posted Fri 08 Aug 2008 04:11:54 PM UTC Tags: tech
iceweasel addons

Something in my iceweasel configuration is causing images to break, and I don't want to lose my many years of carefully crafted configuration, so I'm removing add-ons one by one to determine what is causing this.

I though this would be a good opportunity to list my favorite add-ons.

It turned out Torbutton was the culprit. Kind of surprising considering it was in the "tor off" state when it was causing the image bug.

Posted Tue 01 Jul 2008 07:23:59 PM UTC Tags: tech
generating video thumbnails

Here is today's contribution to the global pool. This data is a little hard to find.

As far as I know there are two FLOSS ways to make video thumbnails. Using mencoder:

mencoder /tmp/tmpMPbaKN/35dffc402a4b439978e6e05170d401c76b3c8cf0 -ovc lavc
-nosound -lavcopts vcodec=mjpeg:vqscale=2 vf scale=100 -of lavf -lavfopts
i_certify_that_my_video_stream_does_not_use_b_frames:format=image2pipe -ss
1.0 -frames 1 -o out.jpg

...and using ffmpeg:

ffmpeg -i /tmp/tmpMPbaKN/35dffc402a4b439978e6e05170d401c76b3c8cf0 -f mjpeg -t 0.01 -y out.jpg

Neither one works particularly well with incomplete video files.

Posted Fri 23 May 2008 12:15:19 AM UTC Tags: tech
reddit and hacker news

Two feeds I've tracked regularly for quite some time are Reddit and the slightly better version of the same site Hacker News. Lately I've been very disappointed with the posts that come to the forefront, perhaps in the same way I eventually became disappointed with Digg.

For those living in caves, all of these sites operate on a collaborative filtering model. Users submit interesting links and vote on what they think is most interesting. The top voted posts are put on the site's front page.

This model seems to work out great for the early lifetime of these sites, but every site I've followed eventually gets popular, and subsequently gamed. People vote up insignificant things, and posts get read because of their misleading buzz-filled headlines. Some such templates for this theme are:

  • Why controversial thing X is better than controversial thing Y.
  • 5 Easy steps to make your code sing
  • Why [thing you like] sucks
  • Tutorial on currently-buzzed topic that could easily be found simply googling

I feel like my limited attention is gamed by these "give me hits" posts even though some are potentially interesting. This is why I long ago unsubscribed from Digg and will probably have to do the same for HN and Reddit. I don't have a better solution yet. I think I could probably write a lot more about this. Back to work!

Posted Tue 13 May 2008 06:27:53 PM UTC Tags: tech