Dabbler

March 29, 2009

iWork Autosave

Filed under: Software — 3riador @ 6:10 pm
Tags: , , , , , , ,

So I had the wonderful experience this weekend of losing over 1,200 words of work on a paper because I forgot to save it regularly. I was really, really sad about that and really bummed that Pages, my word processor of choice (I love the formatting tools), doesn’t support either autosaving or document recovery. However, my preference for Pages is strong enough that I didn’t jump ship to an auto-saving editor. Instead I went out and found WorkSaver. WorkSaver
Worksaver simply sits in your menubar and, at a definable interval will save every iWork document you have open, provided that it’s already been saved once. This means that whan I’m writing I don’t have to even worry about saving my document after creating it and choosing where to save it. Of course, it’s a shame that you have to manually save the file when you creat it, but it’s a lot better than losing all your work. I can highly recommend WorkSaver if you use iWork simply for the peace of mind it provides. Of course, it’s not perfect for everybody, but when I’d rather focus on writing a paper than on making sure my computer doesn’t decide to make it all go away, WorkSaver is just what I need.

March 24, 2009

Perl Snippets

Filed under: Perl, Programming — 3riador @ 6:39 pm
Tags: , , , , , , , , , ,

I’ve been getting into a mood lately that makes me fiddle around with fun Perl stuff, but sadly school’s picking up to the point that writing anything up isn’t going to happen. However, I have a couple short scripts that I’m just dying to share.

Just Another Perl Hacker

I figured that it was about time in my hacking career (read: I was bored enough) that I should make a japh script. After a couple attempts I came up with this:

#!/usr/bin/perl
while(){
 	for (map{ord($_)-33}split ''){
		$__++;
		$_||(print(chr($__+19))&&($__=0));
	}
}

print "n";

__END__
                   /|                        |
      !            ; :                        : :
                  | Y,                      ,P |
     !             |  Yb.        __        ,dP  |
                  l  YMMb,_ _,/  ,_ _,dMMP  /f
  !                 j;  `YMMP'  `--'  `YMMP'  ;j
                   :    YP`-._    _.-'YP   / ;
  !            !       `,  _,_    _/,_  ,/' /
                     `,_,   `o>  <o'/   ,_,!'
                         `            /'
                           |  _    _  |
      !                     / 88b  d88
                            `8P  Y8' /``-.
             !               `,    ,/
                             _`----'
                  !        _.'/ '          `,
                        .'_,'_..._           ;
       !               .',/.dMMMMMMb. |      /
                    .'./.MMMMMMMMMMM ; !    /    ;
                   / /.MMMMMMMMMMMMM/     /     ;
                  | ;dMMMMMMMMMMM!P/'   ,/'   !    ;
                  |/dMMMMMMMMMP'     .'          |
   !               ;dMMMMMMMMM|     _/            |
                 ;dMMMMMMMMMMb_|_!| /;            ;,
                 dMMMMMMMMMMMM`M`M`;.---..      '   `,
                :M!MMMMMMMMMMMMMMMP/'     `
               /|MMMMMMMMMMMMMMP/              _!_      `.
  !            / |MMMMMMMMMMMMMM|            |.-'  `-._             .'
             ;!  ;MMMMMMMMMMMMMM|            :         `-._ `-.     /  _
             |   ;!MMMMMMMMMMMMM;            |             `-. `-.._.'/
                 `YMMMMM!MMMP/'           |                `~~----'
               `-._, ``YMMMP'_.-'         ! ;_
                 |      /         `-.,_./     7
                _/    `,    !        /      _/
             ,-' ,  ,   /         _.'      /
            (_(_(__(__.'       !,-'        /
                            (__(__(_(_/'

Download

I’ll let you go ahead and figure it out on your own. It’s not super-hard, but it’s fun.

Mandelbrot

In another fit of boredom I decided that it was finally time to create a mandelbrot set renderer. I originally tried to make one of these in basic, long before I had the math to do so. I was proud that I got the real axis to render, and figured it was time to complexify it. To keep things simple I decided to make it render an ASCII-art version of the set that would fit in a terminal window. The output looks like this:

                        ...............................:::::oo@@@@o::::..........
                      ...............................::::::O@@@@@@@@o:::::.......
                     .............................::::::::oO@@@@@@@@o::::::::....
                   ...........................::::OOO8ooO@O88@@@@@@8@O8o::::Oo:..
                  .......................:::::::::o8@@@@@@@@@@@@@@@@@@@@OO@@@@::.
                 ...................:::::::::::::oOO@@@@@@@@@@@@@@@@@@@@@@@@@o:::
                ................:::::::::::::::o@@@@@@@@@@@@@@@@@@@@@@@@@@@@Oo:::
               ..............::::@oo::oOoo:::ooo@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8o:
               ...........:::::::oO@@@O@@8@OooO8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O::
              ..........:::::::::oO@@@@@@@@@@88@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@::
              ........:::::::8ooO8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@o::
              .:::::::::::::oO@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@o:::
              @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Oo::::
              .:::::::::::::oO@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@o:::
              ........:::::::8ooO8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@o::
              ..........:::::::::oO@@@@@@@@@@88@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@::
               ...........:::::::oO@@@O@@8@OooO8@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O::
               ..............::::@oo::oOoo:::ooo@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8o:
                ................:::::::::::::::o@@@@@@@@@@@@@@@@@@@@@@@@@@@@Oo:::
                 ...................:::::::::::::oOO@@@@@@@@@@@@@@@@@@@@@@@@@o:::
                  .......................:::::::::o8@@@@@@@@@@@@@@@@@@@@OO@@@@::.
                   ...........................::::OOO8ooO@O88@@@@@@8@O8o::::Oo:..
                     .............................::::::::oO@@@@@@@@o::::::::....
                      ...............................::::::O@@@@@@@@o:::::.......
                        ...............................:::::oo@@@@o::::..........

The code’s far from polished and not what I like to publish, but it’s a fun thing to look at and offers you some neat abilities to poke things around and fix some pesky problems that just need clear thinking applied to them. It’s available here.

March 11, 2009

Make a Money/Card Clip

Filed under: Uncategorized — 3riador @ 7:44 pm
Tags: , , , , ,

So the other day I finally got tired with my (awesome) wallet and decided to make something new. I ended up choosing a money clip. Not only would it be a nice, high quality, metal object living in my pocket, instead of a crummy, dirty wallet, but a money clip is good looking, classy and minimalistic way of keeping a hold of my money and cards. Looking around my room I didn’t really get any inspiration, until I saw an old metal fork lying in a box. I cut the head off with my dremel and a fiberglass cutting wheel. A little bit of sanding and bending resulted in a, super-useful money clip. I’ve been using it for the past few days and it’s been serving me really well, looking good, and altogether holding up like a quality product.

If there’s interest, I’ll put up more information / pictures and maybe put some of these bad boys up for sale.

January 13, 2009

GPSd under OS X

Filed under: Software — 3riador @ 12:52 am
Tags: , , , , , ,

So I recently picked up a cheap GPS module on Amazon. It was about $30 with shipping, and I got a neat little dongle which connects over USB to my computer and communicates with software. It didn’t come with support for OS X (although interestingly enough it shipped with Mac OS 8 and 9 drivers), but it promised to send generic NMEA-0183, so I wasn’t too worried.

When it showed up, some quick software probing revealed that it houses a usb to serial adaptor (a Prolific PL-2303, which I’ll get to in a bit) and a gps module that’s configured to send NMEA strings through the virtual serial port. This sort of information is compatible with a host of software, but most of it is commericial, and only available at a considerable price.

Luckily, there’s a wonderful open source project called gpsd which provides support for a wide raft of devices and protocols, and talks to an even wider assortment of software. Primarily, I wanted to be able to get my gps to talk to the network scanner Kismac, and Randall Munroe’s cyborg.py script. Both of these were built to take information from gpsd, so I was in business. However, gpsd, which is designed to play nicely with Linux, takes some coaxing under OS X. This is meant to describe how I got it all running. (more…)

December 11, 2008

Genetic Algorithms in Perl

Filed under: Perl, Programming — 3riador @ 1:20 am
Tags: , , , , ,

Inspired by recent genetic algorithms floating around, I decided to try my hand at implementing one in perl. I’d thought for a long time that it would be quite difficult, but really it’s quite easy. My biggest hangup was dealing with data structures, but once I did that, it turns out that all you really need is a few functions:

  • A fitness function, that determines which individuals are most fit to reproduce
  • A mutate function, that will add random chance into each generation
  • A breed function that allows the best individuals to reproduce.

I ended up implementing a very simple algorithm, but it’s fairly fast and very generic – it can be easily adapted to just about any task. Sadly, I have no fascinating application just yet, but if I stumble across one, I’ll be sure to post about it.

After the jump, I’ll put up some of the code I used and a link to the script, all for your viewing pleasure.
(more…)

October 29, 2008

Synchronized Presidential Debates

Filed under: Politics — 3riador @ 3:50 am
Tags: , , , , ,

I just ran across what is probably one of the cleverest and scariest analyses of the presidential debates I’ve seen this year. It’s ridiculous to see just how similar everything they say is. It’s kinda a shame that the debates were such a place for the candidates to simply spew their canned points to the television-watching world. Anyway:

(Via BoingBoing)

October 23, 2008

Fast and Simple Stock Quotes Using Perl

Filed under: Perl, Programming, Software — 3riador @ 10:18 pm
Tags: , , , , , , , , ,

One of the things that makes perl so powerful and fascinating is the huge number of modules that are available online, especially through the CPAN repository. Today I stumbled upon one called Finance::Quote, which does one thing, very simply: it retrieves stock (or mutual fund) quotes. You feed it a ticker symbol and it gives back a hash with all sorts of information, but most importantly, the price. I’m going to show how to use this to create a command line tool that will grab an up-to-the minute stock quote for any ticker symbol you give it.

(more…)

August 30, 2008

Tobias Wolff is a God among men

Filed under: Uncategorized — 3riador @ 5:41 pm
Tags: , ,

I was sitting and re-reading Tobias Wolff short stories the other day, and ran across this little quote, which tore my heart out, twisted my head around and made me totally fall in love with his writing again:

In the solemnity of her attention he heard himself saying things he had said to no one else, confessing hopes so implausible he had barely confessed them to himself. He was often surprised by his own honesty. But he stopped short of telling Mary Ann what was most on his mind, and what he believed she already knew, because of the chance that she didn’t know or wasn’t ready to admit she did. Once he said it, everything would change, for all of them, and he wasn’t prepared to risk this.

Tobias Wolff – “Two Boys and a Girl”

August 10, 2008

Getting Songs Off of Your iPod

Filed under: Software — 3riador @ 8:10 am
Tags: , , , , , , ,

In the last couple weeks, at least four people have asked me how to get music off of their iPods. The answer I gave all of them was Senuti (iTunes spelled backwards). It’s great! It does exactly what you need: takes songs from your iPod and puts them into iTunes, and it’s super easy to do. Once you have disk use enabled:

To copy songs back to your computer, all you have to do is select the songs and click the transfer button in the upper left hand corner of the application.

The songs will be copied to the your computer. They will be added to iTunes if you enabled the preference to automatically add them to iTunes.

It’s just that easy.

Of course, Senuti isn’t just a one trick pony, it can do other useful things as well, such as copying songs to a folder, or showing you what songs you already have in your iTunes library, and allowing you to hide them, so that you only transfer new songs.

So next time you feel like IM’ing me about how to get songs off of your iPod, remember Senuti, and save my sanity just a little bit.

August 3, 2008

Can Apple keep this up?

Filed under: Software — 3riador @ 12:42 am
Tags: , , , ,

It seems to me that Apple has undergone a change in the past year or so. With the introduction of the App Store, the iPhone 3G, and Mobile Me, Apple seems to have lowered its quality standards. In the past there was the common knowledge that you shouldn’t buy the first revision of a product because there were always bugs, but now Apple seems to be having even more problems. It’s pretty well acknowledged that one of the biggest reasons for the problems with Mobile Me was that it was pushed out early to keep up with the iPhone 3G. I even saw similar problems when I opened up the preferences on iTunes 7.7:

Picture 1.png

I’m afraid that Apple’s new products and schedules are clashing with their characteristic way of doing business. In the past they were able to wait until a product was just perfect before releasing it. Now, with their partnerships and such, at least with the iPhone, Apple is forced to announce their products earlier, and so they have much stricter deadlines to meet, which begs the question “Can Apple keep this up and still deliver the same quality product they have in the past?”

Next Page »

Blog at WordPress.com.