failing like never before

25Apr/100

The ipad… and Other Fail News

I stopped by Best Buy on my way to the grocery store to have a quick look at the much lauded Apple ipad. My opinion summed up in one word:

meh.

Pros:

  • shiny
  • long battery life
  • more portable then a typical laptop

Cons:

  • almost impossible to achieve a reasonably fast typing speed on it
  • shiny (which results in fingerprints and glare)
  • does nothing that my laptop can't do
  • can't do a lot of things my laptop can do
  • costs $150 more then the refurbished laptop I just bought
  • closed platform
  • wide-aspect movies look weird on a 4:3 screen
  • back-lit screens are not ideal for reading books
  • development work for the ipad must be done in Objective  C
  • less portable then a Motorola Droid or Nexus One (or even an iphone)

In other fail news:

A week ago, I got a big batch of images that needed to be resized and displayed on one of the websites that I manage. This required that I crop and resize each photo so that it be exactly the correct size to be displayed on the site, a time consuming and quite laborious task. So I figured I could probably whip up a script with Python and ImageMagick to help automate the process, with idea being that my program would allow the user to simply highlight the "relevant" area of an image and then the program would crop and resize it to the correct size.

I ended up having to use wxPython to do all the GUI type stuff, which meant I had to spend some time learning the ins and outs of GUI programming seeing as how my experience with that kind of stuff is fairly limited. So for the past week, I've been spending about an hour a day learning wxPython and knocking together a sort of program to make my life easier. Today, I looked at my image resizer program and realized I had created some of the most god-awful code ever seen by mankind.  It was basically 100+ lines of uncommented and completely unintelligible spaghetti code.

I threw my monster out and did the cropping and resizing by hand, which ended up taking me less than an hour.

Tagged as: , , , No Comments
18Apr/100

Things that Happened

What I did this weekend:

  • procrastinated
  • cooked enough food to last me to the middle of the week
  • ate all the food I cooked (I was hungry)
  • tried to sleep in but failed miserably (I ended up waking up at 7:50am)
  • rode my bike 25 miles, stopped and stared at the houses in Brentwood that probably cost more money then I'll ever make in ten lifetimes
  • procrastinated by looking at various electronic gadgets on-line that I have no need for and couldn't possibly afford
  • tried to work on my lab but was distracted by food
  • sat in the computer lab for about three hours, wrote two lines of code, and tried unsuccessfully to help someone with his Linux troubles
  • procrastinated by doing laundry and then sewing up the holes in my black jeans (there were a lot more holes the I realized)
  • tried to study but somehow ended up watching old Justice League Unlimited episodes on youtube
  • finally got my butt in gear around 7pm on Sunday night and hit the library

On another note, I added a basic captcha to the comment box on this blog in order to reduce the amount of spam Akismet had to handle (Akismet is great, but it does occasionally mark stuff incorrectly). Amazingly enough, a few spam bots are making their way past my captchas! Modern image processing is impressive stuff...

Filed under: Daily Log, School No Comments
16Apr/100

OCaml Infix Notation and Parenthesis

So when I first picked up LISP, I found myself hating everything about the language, from its distinctively un-C-like functional style, to the inordinate number of parenthesis required by the syntax. But before long, I found myself accidentally writing my math homework in prefix notation and putting parenthesis around all of my sentences, just out of pure habit. With time, I began to find the LISP style more relaxing to develop in, and started to understand the stark beauty of the language. A few months after my first excursion into LISP, I was telling people how LISP was the most beautiful language ever created.

Now, enter OCaml, a functional language free from legacy cruft, and inspired in some form from LISP. I thought I would love being able to develop in a LISP-like language without having to worry about ending statements with a dozen end-parenthesis (which I thought to be LISP's only big syntax flaw), but I found the lack of required parenthesis initially quite awkward. Yes, there are a lot of insipid little parenthesis in LISP, but the point of them is to clarify the code and they do! Parenthesis are what allow LISP to have such simple and easy to understand syntax. (Lets face it, Ocaml just doesn't have the "Its full of cars!" sort of easily understood syntax.) Of course, since OCaml makes parenthesis optional in most cases, one could simply add parenthesis to everything in OCaml, much as one would in LISP. I got over the parenthesis business in OCaml quite quickly, although I still miss them quite a bit.

The one thing I could never get over however, was the weird way OCaml uses built-in operators (like '+', '-', '/', etc.) in infix notation, but has all other functions used in typical prefix notation. By enclosing an operator in parenthesis, it can then be used in prefix notation, but this is a little clunky. I would think that it would be better to force all aspects of the language to follow the same common rules in order to reduce confusion, but the OCaml designers were apparently following a different line of reason from mine.

Although OCaml's odd mix of infix and prefix notation has remained a thorn in my side whenever I lay hand to keyboard to bang out some OCaml code, I've nevertheless managed to gain a good understanding of the language. I've also started to find the usefulness of the language, but my heart still pines for LISP...