Archive for category Geekiness

New Monitor

Well I finally got sick of my small MacBook screen (useful while traveling but no fun at home when you have a lot of windows open). The new monitor is a 26″ Westinghouse LCD with a max resolution of 1920×1080. The color and brightness are outstanding and a hunt for dead pixels turned up none.

With the new screen I can more realistically deal with multiple large windows than before with my small laptop screen. I’m considering also getting a DVI-enabled KVM to allow my work laptop to easily be plugged in.

With the new monitor in place I feel like I’ve breathed some new life into my MacBook — it’s still plenty fast enough for most of what I do (the exception is running a Windows XP virtual session at a realistic speed). The big memory hog on this machine is still Microsoft Office (no surprise) which I only really use because it’s the only way to check my work email on this machine (using Entourage).

Overall, I’m quite pleased. Our main TV is a Westinghouse and despite it’s “off-name” brand for TVs and sneering remarks from the “big name” brand owners, I’ve been quite impressed with them.

2 Comments

Papaya

Well, I don’t normally function as an advertising agency, but I thought I’d mention to anyone using OS X that there’s a splendid new application out by Lighthead Software. It’s call Papaya and it’s purpose in life is to make sharing files easy and effortless.

Sharing can be such a pain because of problems between Windows and Mac or even just silly things like firewall rules, security, etc. It would be nice if there was a reasonable way to share files that was:

  1. Straightforward — don’t make me click around a lot
  2. Easy to share — let me IM or email something that people can easily reference in order to access the shared material
  3. Used standards that work regardless of your friend’s operating system

Papaya seems to be the answer.

Sharing files locally is automatic. Depending on your router/firewall, sharing files on the Internet may be just a tiny bit complicated but you only have to configure it once. For my own needs, this is beautiful. I can drag and drop files into Papaya, instantly get a link to share with friends and be on my way. No need to email large files, worry about acceptable formats or whatever else.

Papaya is priced at รขโ€šยฌ20( $31 USD as of 5.26.08). If you have a Mac and need to share files, I definitely recommend this.

Also, Lighthead Software also makes the extremely handy Caffeine application that will keep your laptop from sleeping, having the screen dim, etc. It’s a free program and it’s operated with just one click on turn on, one to turn off. I use it often.

To Lighthead Software, thanks for some excellent programs!

, , , , ,

No Comments

Tag. I’m it.

I normally do not participate in this sort of thing. But this one is a little bit more interesting and I have precious little information about myself on this blog. So when my lil’ sister Alison “tagged” me to write up 7 random things about me, I’ve decided I’ll actually do it. I’ve made it slightly more interesting (scary?) by making them things that I’d not terribly proud of about myself.

7 Random Things About Me That I Don’t Normally Admit

1. I’m red/green colorblind. My wife (and my oldest kid) are incredibly color oriented. I’ve wondered many times if my wife has tetrachromacy. This random fact is one that is used to the infinite amusement of family and friends as in “Hey, what color does the carpet look like? What about the blinds? Wow! That’s weird!”. Please stop — thank you.

2. I’m a terrible cook. This has not stopped me from trying. I’d like to take this time to apologize to my family especially and the close friends that I have caused to suffer. I assure you, my intent is delicious food.

3. I have a dream… that one day I will be an author. I don’t feel particularly gifted nor do I have anything particular interesting to share with the world but I think that it would be fun to work from home all the time, wake up late, and write off trips to exotic places as business expenses. I’ve also considered writing technical books like those in the O’Reilly series. Most of the authors write terrible drivel so my title would fit nicely. (By the way, I like O’Reilly better than any other tech-book publisher — I just think most of the authors are better coders than writers).

4. I like ABBA (the dance/pop group). I’m sorry Sarah.

5. On a related note, I have taught my oldest son to dance. I’m sorry Patrick. Very sorry.

6. I think that binary is really cool. I fantasize that I have an audience who cares about me explaining it to them. In fact, I regularly “test the waters” by attempting to explain base n number systems to those around me. This explains why I rarely get party invitations.

7. Speaking of numbers, I like them a lot and try to memorize them. I still know one of my good friend’s Social Security Numbers (Sam, you should have NEVER let me get near your wallet) and I can assure you that the largest size of a signed, 32-bit integer is 2,147,483,647. They’re fun. I’m worse with numbers and letters together (as in license plates) but I’m trying to hone my skills (my brother said he knew/heard of someone who could keep a queue of 7 or so in his head while driving — I’m not there yet, but I practice regularly.)

Supposedly I should “tag” others but I don’t like the idea — people shouldn’t be forced to share. If you’re in some way influenced to share about yourself by reading this post, just let me know and I’ll link to it. There — that’s nicer.

, ,

1 Comment

Congratulations!

…Behold, children are a heritage from the Lord,
the fruit of the womb a reward.
Like arrows in the hand of a warrior
are the children of one’s youth.
Blessed is the man
who fills his quiver with them!
He shall not be put to shame
when he speaks with his enemies in the gate.

, ,

1 Comment

Forever Updating

I find little time these days and I noticed with some annoyance that I was behind with my WordPress updates. I run a number of sites (13 WordPress sites alone) and updating from 2.5 -> 2.5.1 is sort of painful and tedious.

So I made a script (most of the domain names are removed but you could add to the list):

sites=(illusoryfollies.com
       flanaganclan.com
       sarahflanagan.com)
 
base_path="/var/www/vhosts"
wordpress_download_url="http://wordpress.org/latest.tar.gz"
wordpress_download_file="latest.tar.gz"
wordpress_download_directory="wordpress"
wordpress_database_update_url="wp-admin/upgrade.php?step=1&backto=%2Fwp-admin%2F"
jailed_directory="httpdocs"
temp_directory="wp-temp"
 
number_of_sites=${#sites[@]}
 
 
echo "Updating $number_of_sites websites with the latest version of Wordpress."
 
for current_site in ${sites[@]}
do
  echo "Now processing $current_site..."
  echo "  Setting up directories..."
  if [ -e $base_path/$current_site/$jailed_directory ]
  then
    echo "  !!Detected a jail'ed website..."
    mkdir -p $base_path/$current_site/$jailed_directory/$temp_directory
    cd $base_path/$current_site/$jailed_directory/$temp_directory
  else
    mkdir -p $base_path/$current_site/$temp_directory
    cd $base_path/$current_site/$temp_directory
  fi
 
  echo "  Downloading latest version of Wordpress..."
  wget -q $wordpress_download_url
  echo "  Uncompressing..."
  tar zxfv $wordpress_download_file > /dev/null
  cd $wordpress_download_directory
  echo "  Copying into existing directory..."
  cp -r * ../..
  cd ../..
  echo "  Updating database..."
  wget -q "http://$current_site/$wordpress_database_update_url" -O /dev/null
  echo "  Cleaning up..."
  rm -rf $temp_directory
  echo "Done processing $current_site."
  echo ""
 
done

Now it takes about 15 seconds to update everyone’s site and it even performs the “Database Upgrade” step (at least for now).

Automation is a good thing. Speaking of which, I’m interested in Capistrano but I still haven’t really done anything with it. It looks like fun… I’ll have to add a post if I have any luck experimenting with it.

, , , ,

No Comments

Integration of Information = Value

… at least in some cases.

It’s easy to store information on your cell phone by typing some text in. It’s more advanced to be able to send text messages. But what about providing a “universal” interface (meaning a web services interface) that can receive text and makes text available?

This is what Twitter does. I wasn’t very impressed when I first heard about it a while back because it seemed so… simplistic. Anyone can write a simple database with users and allow them to post text messages. But I was missing the point.

I can now use my cell phone to send a message to Twitter (there’s a program called MobileTwitter that I just downloaded and installed. This text messages pretty much instantly wings its way to the Twitter servers. From there, people can subscribe to my “stream” of messages using desktop-based clients (I use Spaz on my MacBook and my Windows PC). However, I’m not stuck using one companies application — all I need to do is poll the web service. A simple curl call will easily retrieve my latest Twitter message

curl -u andrewflanagan:mypassword http://twitter.com/statuses/user_timeline
/andrewflanagan.xml?count=1 -s -o /var/twitter/andrewflanagan.xml

and a few lines of PHP will make it displayable on my web page:

$xml = new SimpleXMLElement('/var/twitter/andrewflanagan.xml', 0, true);
$status = $xml->status->text;

Alternatively I could have the PHP script directly call Twitter but I ran into some problems since it takes longer to load the pages each time someone visits and Twitter unfortunately limits requests to 70/hr which results in ugliness when I get too many hits on my site. So instead I set up a cron job that runs every 5 minutes (using the curl call above) and updates the locally-stored XML file.

But anyway, the point of this is that you can easily define new interfaces for entering, receiving, and displaying text. It’s simplistic, yes. But it means that on my way back from work (in the car) I can update the front page of my blog with a message using my cellphone. I can also be pulled over by a state trooper. They have no appreciation for the depth and usefulness of this technology!

, , , ,

2 Comments

Design & Functionality

I have always been a stickler for functionality in my programming. What I seek to do is develop solutions through code that model existing efficient functionality or create entirely new abstract models that can be understood clearly and manipulated easily to achieve functionality.

I’m not a “GUI guy” and I have a hard time when I move from developing an easy-to-interface class library to an easy-to-use user interface. Basically, I seem to have no trouble with the idea of adequately describing objects (even abstract objects) and developing easy interfaces. However, displaying this information to a user is harder.

I’m a big fan of simplistic interfaces. I like my new virtual server provider and my new domain registrar because both sites are simplistic. They have well-defined functions and they present the information in easy-to-understand lists. You don’t have to grasp some complex object model or understand what the difference is between clicking on “My Account” and “My Hosting” or some bizarre thing like that. It just makes sense.

Now, at the same time, both these sites (and I love them dearly) are rather ugly. I myself don’t mind this at all. They’re functional and they feel right — like a solid metal tool in my hand, it doesn’t look pretty but I thoroughly enjoy using it.

The intersection of functional code and beauty to me is pure happiness. However, beauty is, or at least is often regarded as being in the eye of the beholder. And on the Internet, there’s a lot of beholders.

I’m reminded of the site CSS Zen Garden; it allows you to view the same material using many different style sheets. There’s some beautiful graphics and layouts but at the same time the actual content never changes (you’re simply switching stylesheets). I like this a lot. Beautiful websites are great but beautiful websites where the presentation is perfectly separable from the content are wonderful. I know this isn’t really “functionality” but it allows the opportunity for such. With this concept, you can develop extremely functional content and then alter the stylesheet to present that functionality in a myriad of ways.

I actually did something like this (but very simplistically) for our family website. I have a stylesheet for each month and every month visitors are presented with a different stylesheet by default. It helps keep the site from feeling old and boring to myself and to others. The functionality is always the same (very plain-vanilla WordPress functionality)

There’s a lot of this sort of thing happening on the Internet and there are plenty of good, clean websites with very solid and well-thought-out designs that provide excellent functionality. But it’s not really the norm I wouldn’t say.

My new iPhone to me is an example of combining functionality with beauty. It’s not quite as functional as I would like but it’s much better than what I’ve had in the past. The interface and presentation of material though is absolutely wonderful (like much of what Apple makes).

I guess my rambling point is that popular success seems to lie at the intersection of functionality and beauty. Allow users to aid in defining beauty (through open and customizable interfaces) and you’ve added even more value.

I’m revving up to produce some new web applications (and possibly an iPhone app if I can find the time). I think my biggest issue is that although I feel confident making functional applications and making them have customizable interfaces, I’m pretty lousy at developing anything more than the most simplistic presentation. I’ve picked up some books on design so maybe I’ll actually get better at it. We’ll see… more to follow as I pursue this.

, , , , ,

No Comments

Easter Fun!

So — on what date does Easter fall? Now YOU can impress your friends by using either of the Perl scripts below… Thanks to this site which supplied both Butcher’s and Oudin’s algorithm:

Butcher’s Algorithm in Perl (1876 — and the Perl code is almost that old too! ๐Ÿ™‚ )

sub GetEasterDate {
my($year)=@_;
my $a=$year%19;
my $b=int($year/100);
my $c=$year%100;
my $d=int($b/4);
my $e=$b%4;
my $f=int(($b+8)/25);
my $g=int(($b-$f+1)/3);
my $h=(19*$a+$b-$d-$g+15)%30;
my $i=int($c/4);
my $k=$c%4;
my $l=(32+2*$e+2*$i-$h-$k)%7;
my $m=int(($a+11*$h+22*$l)/451);
my $month=int(($h+$l-7*$m+114)/31);
my $p=($h+$l-7*$m+114)%31;
my $day=$p+1;
return($month."/".$day."/".$year."\n");
};

Oudin’s Method in Perl (1940)

sub GetEasterDate {
my($year)=@_;
my $century = int($year / 100);
my $G = $year % 19;
my $K = int(($century - 17) / 25);
my $I = ($century - int($century / 4) - int(($century - $K) / 3) + 19 * $G + 15) % 30;
my $I = $I - (int($I / 28)) * (1 - int($I / 28) * int(29 / ($I + 1)) * int((21 - $G) / 11));
my $J = ($year + int($year / 4) + $I + 2 - $century + int($century / 4)) % 7;
my $L = $I - $J;
my $month = 3 + int(($L + 40) / 44);
my $day = $L + 28 - 31 * int($month / 4);
return($month."/".$day."/".$year."\n");
};

The second algorithm is more efficient. If I run 100,000 years of calculations I get about .035ms better performance over the “older” method.

For those of us who just “want the facts”, here you go:

  • 4/12/2009
  • 4/4/2010
  • 4/24/2011
  • 4/8/2012
  • 3/31/2013
  • 4/20/2014
  • 4/5/2015
  • 3/27/2016
  • 4/16/2017
  • 4/1/2018
  • 4/21/2019
  • 4/12/2020
  • 4/4/2021
  • 4/17/2022
  • 4/9/2023
  • 3/31/2024
  • 4/20/2025
  • 4/5/2026
  • 3/28/2027
  • 4/16/2028
  • 4/1/2029
  • 4/21/2030
  • 4/13/2031
  • 3/28/2032
  • 4/17/2033
  • 4/9/2034
  • 3/25/2035
  • 4/13/2036
  • 4/5/2037
  • 4/25/2038
  • 4/10/2039
  • 4/1/2040
  • 4/21/2041
  • 4/6/2042
  • 3/29/2043
  • 4/17/2044
  • 4/9/2045
  • 3/25/2046
  • 4/14/2047
  • 4/5/2048
  • 4/18/2049

Oh, and if you’re looking for a pattern, there is one: Every 5,700,000 years.

Thanks to yesterday’s Slashdot post for getting me interested in this.

, , , , ,

3 Comments

iPhone Happiness

Well. I purchased an iPhone Thursday. Friday was NOT a productive day. In fact, neither was today. It’s a great little tool and it’s very handy.

One of the first things I noticed was that my voicemail messages (which get emailed to me from my VoIP provider) were NOT able to be played on the iPhone. Basically, they support WAV files but they must be in a specific format.

Solution? Well, I immediately thought that I could set up a spare email account on one of my domains and use procmail to run a conversion on the audio on my Linux box (and forward the results to my regular email account). I did a search and was pleasantly surprised to see that it had already been done (in exactly this way). However, after trying to get it working on mine I realized that it was a little messy since I was using virtual mappings (in order to store all email domains/users/aliases in a Postgresql database). Hmmm… So, I played around with maildrop (with which I was previously not at all familiar with). After much, much tweaking of permissions on folders (maildrop requires some odd and sometimes nearly conflicting permissions for things to work) I was able to get it to work as expected. I shamelessly stole the script that had already been created, emerged sox and some other utilities to support the conversion and fixed some bugs that I found along the way in my mail config (finally cleared out 250+ emails that had been queued up forever).

After all that, I still have a slight issue. A WAV file goes from being 60K to being 500K when I convert it to the “acceptable” format. Oh well. AT & T’s EDGE network isn’t the fastest for downloading 500K but I guess it’s a lot better than nothing. It sure is nice to be able to get both your Cell voicemails and your home voicemails all on the same device. The iPhone is the first (so far as I know) cell phone to offer “visual voicemail” where voicemail is essentially downloaded rather then being available over one of those irritating “press 7 to delete your message”-type interfaces.

Phew… fun stuff. I’ve decided that since I spent the time playing with maildrop I might add some fun things (like system automation via email). There are definitely a few maintenance tasks that might be nice to automated via email. At work I have a proxy and email (at least from my work email account) is one of the few things that I’m allowed to use. I guess in theory I could run a really slow, email-based terminal session (email “ls -al” and after about 30 seconds get the results emailed back). That would be kind of cool. And a terrible security hole. ๐Ÿ™‚

Sorry I’ve been slow on updating. I need to get back into the habit. Hope all my faithful reader(s) are well!

, , , , , , , , ,

3 Comments

My Hobby

Giving my fuel economy in rods per hogheads.

Thankfully Google does the conversion for you!

,

1 Comment