Wednesday, January 13, 2010

Wiki world

As part of my foray into the wiki world of common good, I've written a small, but effective little script for automating conversion and reduction of JPG format images to PNG images of a specific size, using a tool called ImageMagick:
#!/bin/sh
for img in `ls *.jpg`
do
baseimg=`echo $img | sed s/\.jpg/\.png/`
convert $img -resize '300x300>' $baseimg
done

Certainly not the most versatile piece of code (yet), but it was written in minutes and has saved me quite a bit of time so far. If/when the need arises I'll modify it (and post it here).

Enjoy!

- - - - - - - - - -
ImageMagick does a number of things:

Sunday, January 10, 2010

Brave New World

After six months of shell scripting in the hopes of doing some more in-depth 'real' coding, I was laid off (budget cut-backs, poor economy in the US where my employer was based).

A week before typical Christmas holidays, and with only six months of experience but a bundle of enthusiasm I quickly found myself another (dare I say 'better'?) job writing custom aspx/C#... or at least I will be writing custom aspx/C# once I get past the preliminary learning curve of installing our product for our customers.

That brings me to a train of thought that has me wondering: How many other 'programmers' spend more time on installation, minor configuration, manual testing (not coded 'unit tests') and the like? Is it because I don't have experience that I'm pushed to these tasks? Is this the realistic expectation for the future, or do I have some hope of actually doing the work that I have been trained to (and love to) do?

I'm generally an easy person to please. Give me a work environment where the dress-code is clothing, the coffee and water never run dry, my co-workers aren't impossible to tolerate, and the keyboard isn't m ss ng the letter 'I', then I'm happy to go for a good six to twelve months just on those criteria alone.

But what about after those twelve months?

*raises glass* Here's to hoping the next year brings many coding challenges and happy times.

- - - - - - - - - -

Algorithm for ensuring job satisfaction:
if coffeepot.size == empty then: coffeepot.fill
if self.coworker.attitude == amicable then: smile; else: self.hopefor(best)
for letter in keyboard.letters:
if letter.value == null:
newkeyboard.get
Rinse and repeat ad nauseum

Sunday, July 12, 2009

Dvorak or Not Dvorak? or: "What did QUERTY ever do for me?"

"yd. ;gcjt xpr,b urq hgml.e rk.p yd. na'f eriov"

Eight seconds flat.

"The quick brown fox jumped over the lazy dogs."

Fifty-two seconds.

Not exactly stellar results, but with only two days of Dvorak practice under my belt, I'm not entirely surprised...

I first learned to touch-type on a QUERTY keyboard when I was fifteen years old. By the end of the four-month course I was pounding out a respectable 38 words a minute. Not top of the class, but not the bottom.

So why would I bother taking on such an arduous endeavour over a decade later? Because despite an atrocious ten words per minute, I've already noticed some improvements. The fingers of my left hand hardly move off of the home row when I type. Some words (the, not, net, that, there, then) roll from the tips of my fingers faster than the 'old' way. After two days. May not sound like much, but over the course of an eight hour day, five days a week for an entire year... The potential is showing...

Just don't ask me how long it took me to type this (short) post. I don't think I can count that high.

----------

xfdokt{ ld.ao-

Wednesday, May 20, 2009

OHS

An opportunity arose a couple of weeks ago at my new job that I jumped at (because I'm the 'newbie' and over-eager to please) for a non-programming-related responsibility. Being the keener I am, I'll be participating in an Occupational Health and Safety (OH&S) committee at work (because all those paper cuts could one day lead to sarchoidosis) so I'll need to complete a training seminar. As a bit of background, Newfoundland and Labrador has legislation requiring all employers with more than a certain number of employees to have an OH&S committee. The duties of the committee include, among other things, ensuring that health and safety problems are prevented or mitigated before they have a negative impact on people in the workplace.

As for the training itself, thanks to a great trainer from the Newfoundland and Labrador Employer's Council with a fair amount of field experience (and lots of anecdotes from that experience) the first day was both informative and somewhat entertaining as opposed to the boredom I was told to expect. The OH&S legislation is full of legalese (of course – it's a legal document after all) but the index provided at the training is quite useful in helping to identify specific information regarding specific health and safety issues (such as dealing with broken ladders, how deep to dig a trench and – somewhat more relevant to a person working in an office – water quality and fire exit requirements).

The mundane task of complying with legislation may not be the most relevant to my current career, however I'm optimistic that the jack-of-all-trades personality I have will lend itself to this endeavor.

- - - - - - - - - -
"""
jackOTrades.py
usage: jackOTrades.py <trade1> [trade2] [trade3] ...
"""
import sys, allTrades
if len(argv) <= 1:
print "You talentless hack!"
sys.exit(-1)
for tr in allTrades.allTradesList:
if tr not in argv[1:-1:1]:
print "You have skills!"
sys.exit(-1)
print "You are the master of nothing!"

Tuesday, May 19, 2009

It's about time I start blogging...

As a recent Computer Science (B. Sc.) graduate, I figured it was about time to start taking part in this whole 'technology' thing... Coming off of a semester with a full course load and countless late nights programming in the lab with my classmates with only injections of energy drink and the best Chinese take-out in the city to sustain me, I'm only now starting to settle in to life with a 'real job'. This first month has been both eye-opening and butt-kicking, but I think I'm going to like it enough to prop up my feet and stay a while.

My blog will probably be an amalgam of somewhat-related-to-coding editorials and a moderate to high amount of bad humour (any Americans able to tell me what colour-code that is? Red? Amber? Chartreuse?) with a smattering of random tid-bits about myself thrown in for good (or bad) measure.

So, where did I come up with this blog's name? I'll tell you! Plain ol' "crystal" (my first and preferred name) was taken and "crystal-the-awesomeist-coder-around" seemed a bit too long, not to mention self-important...

Anywho, enjoy lurking... I hope to entertain, inform and possibly digest your time.

- - - - - - - - - -
let E be entertain
let I be inform
let T be time
let d(X) be digestion of X

let Q = E and I and (d(T) or (not d(T)))
Q = E and I and (True)
Q = E and I