The Revelation needs YOU

July 28, 2010

Recently, I started a new programming project at home, in Ruby on Rails, and it brought to mind a blog post I wrote waay back in 2007.

Starting a Java program from scratch is so filled with overhead that experienced programmers I trust have just told me to use tutorial source code to start my project.

That’s good, solid, pragmatic advice, but it kinda feels like cheating.

The barrier to entry for Ruby/Rails is way less. Sure, you have to download Ruby and install the gems and Rails, but all of that is fairly easy.

From there, you navigate to the folder you want to contain your project folder (I like c:\projects\ or /home/liam/projects/) and type the following:
rails [projectName]

if you want to associate it with mysql (sqlite is the default) run this instead of the above:
rails -d mysql [projectName]

This creates the directory structure and the skeleton files you need. From there, it is a matter of another command line to add an appropriate business object.
(from inside the c:\projects\projectName folder) ruby script/generate scaffold [object_name]
This line does a lot of heavy lifting:
It creates skeletons for the model, the controller, the view, database migration file, routing information, helper files, and unit tests.
View files include edit, new, and list pages, as well as a layout page to customize that business object’s pages.
Controllers contain basic functionality for add, edit, and remove, as well as redirection logic for new, edit, and list.
Database migration is a wonderful thing. All of the database work is done in Ruby. Ruby and Rails provides you three schemas to work with: Testing, Development, and Production. This allows you to fully integration-test without touching other data. Also, updates to the database are immediately reflected in the schema file so you dont’ have to update your models or work in SQL to update your schema. Win-win from my perspective.
Once the scaffold generation is complete, yes, you actually have to do some work.
Populate the migration script with the data you want on the model/table, and code up the html.erb pages.
Before running the application, you’ll have to create your schema in mysql:
(in projects/projectName) rake db:create:all
and migrate to the newest version of the database:
rake db:migrate
There might be a little more work than that, if your development database has different authentication, you’ll probably have to find the database.yaml file and update it, but it should be obvious how to change the settings in that file.
Granted, the next step is one I’m not entirely sure of. I’ve always coded these applications inside an IDE, and the servers have always come with the IDE. I choose which one I want (usually mongrel, just because) and run it inside the IDE. If you are not such a person, never fear. I will do some last-second research and learn how to run it.


This just in: run the following (from projects\projectName)
ruby script/server

and that should start your server up on the default port of 3000.

Routing is a little different from what I was used to, back in the day, so I’ll go into it a little bit.

All of this is assuming a base url of http://localhost:3000/

So, if you want to look at the list page of Object:
objects
If you want to look at the new page of object:
objects/new
View:
objects/[id]
Edit:
objects/edit/[id]

If anyone is using these instructions and something I’ve said is wrong (which is possible) or a lie (which is likely), leave me a comment, and I’ll be sure to get back to you as quickly as possible.

Happy coding!

Summer Blog Challenge REMINDER

July 28, 2010

On August 3, the Summer Blog Challenge (SBC) will kick off the second of what it seems will become an annual event. You are cordially invited to join in. Here’s the basic format:
For 31 days, starting August 3, ending September 2, you, as a participating participant of the Summer Blog Challenge (SBC), will write one (1) blog post per day of at least 150 (one hundred fifty) words.
At the end of each week, I will try to have a report outlining how everybody did (post-wise and word-count-wise).
Cliff is widely known as the word-count champ around these parts, but I’m going to make an attempt to bring him down. (aside from cutting off his index fingers, I’m not sure how to proceed, but we’ll see how creative I can be)
Beyond the 150 (one hundred fifty) words per post, and the one (1) post per day, there don’t seem to be any hard and fast rules. There may be topical or word count challenges pushed around, but those will generally be to avoid ridicule, or to gain additional (possibly someone else’s) awesome points.
Awesome points will be awarded for:
-signing up
-each post
-each clean week (no missed days)
-two straight clean weeks (awarded only once per participating participant)
-three straight clean weeks (awarded only once per participating participant)
-31 days clean
-awesomeness (obviously)
-anything else

As of right now, the full list of participants is as follows:
Cliff
Brad
Chad
Kelly
Kim
Kyle
Yours Truly
Shaun
Tammy

Cliff has mentioned on his site that he would like to keep the entrants to a reasonable size. I say fuck (forget) that noise. Get it right out of here. I never want to see (hear) that noise again. If we could get 400 (four hundred) or more people to sign up, I’d say bring it the fuck (heck) ON!

If you are interested in joining, from this point on, it would probably be best to drop me an email. I’d hate to miss your grand entrance. So if you are interested, send an email message to liam[at]bisonweb[period]ca with your name, your blog url and your credit card number*.

Awesome points and the future of your blog** are at stake.

Good luck!

* Please do not send me your credit card number. That was a joke and intended to be taken as such.
** The future of your blog does not depend in any way on your entering the Summer Blog Challenge (SBC).
*** Bisonweb inc. shall be held harmless from liabilities including, but not limited to: injuries, repetitive strain disorder, moodiness, lack of ideas, writer’s block, malaise, appetite loss, appetite gain, weight gain, erectile dysfunction, extraterrestrial abduction, out of body experience, feeling a loss of awesome points, tingling in the extremities, or acute alcohol consumption stemming from participation in the Summer Blog Challenge (SBC)
**** Awesome Points are a trademarked property of SOBU Holdings and are not transferrable for any reason other than:
-Showing off
-Reputation
-Throwing an awesome party

Upside-Down Bingo

July 26, 2010

No, that isn’t a euphemism for the Texas Triangle, the Humpty-Bumpty, or the Hunka-Chunka.

Working a bingo on Saturday, I saw something I didn’t expect to see. A woman playing bingo with the cards upside down.
Rather than feeling ridicule, I was immediately stricken by an amazingly strong curiosity.
Why does this woman play bingo upside-down?
I came up with five possible answers for your reading enjoyment:
1) The realist in me figures she was either drunk or mentally confused and didn’t really have any idea what she was doing. This is the boring explanation, so I’ll press on.
2) The idealist in me thinks she might be a world-champion bingo player. Just the quickest most amazing number-dabber in the city, if not the whole country. She turns the bingo card upside-down to give herself an additional challenge, because there are no points for speed in Bingo.
3) The fantasist in me considers the possibility that she was the victim of a drive-by surgery, where her eyes were removed and put in upside-down, so that she has to play this way to see the numbers correctly. I’m not totally against this theory, but it is a little creepy, in a Pan’s Labyrinth kinda way, so I’m moving on quickly and quietly, so not to disturb the monster with eyes in its hands.
4) The romantic in me sees long years of this woman playing bingo with her husband, where they would both go and spend time together. Tragically, the man went blind, and they would continue to go to bingo and buy their own sheets, but the woman would dab her husband’s cards and tell him to call out bingo when he won. A couple of years ago, the husband died in the night. The woman stopped going out, stopped answering the phone, stopped eating, and had to be hospitalized. After she was sent home, having gone through counseling, she understood that she had to interact again – to get out and see people. She had friends at bingo, people who had called her, people who missed her. So, she went back to bingo. It felt wrong, that empty spot on the other side of the table, but she pressed on. In a flash, she realized what was so wrong. She flipped her bingo cards around, and it was like her husband was there again. She opened up, and all those people who had been her friends before were friends again. She laughed, and she won a couple bucks. So now, every time she goes, she plays her bingo cards upside down to help her remember the man she loved. This is my favourite explanation, playing out like some bittersweet something-or-other you’d hear about your mother reading/watching/listening to, and you’d say, “huh,” and go on with your life.
5) She won on Bonanza with upside-down cards once, and now she can’t play them right-side up ever again or she’ll never win again. This is the most likely explanation and isn’t as touching as #4, but it is the way that bingo players are.
Did I overthink this one? Yes. Do I overthink everything? Possibly. But it’s way more entertaining this way than just trudging along the bingo hall floor schlepping Satellite tickets.

They Took a What?!

July 23, 2010

The neighbourhood I live in has its ups and downs. The amazing neighbours next door are offset by the other neighbours who are not so amazing. The fact that it’s hard to get to our street for random traffic is offset by the fact that some people use it as their personal drag strip.
I don’t know how to offset the following:
Someone stole my flower pot. Now, some of you may say, “It’s just a flower pot,” or, “You own a flower pot? Dude…”
Yes, I own(ed) a flower pot. When we moved into the condo, six years ago, Kim bought a fig tree and I bought a Yucca tree. Hers came in a gigantic, nearly immovable brown pot and mine was in a smaller green pot. The green pot was half of the reason I got the tree, and when my incompetence with all flora flourished and the yucca went the way of the dodo, I kept the pot.
Sometime earlier this week, someone drove to our house and carried my flower pot to their car and took it away. I theorize this because, while my flower pot is not the behemoth that my wife’s is, when it is filled with dirt (and flowers), my pot is not light enough to take out of the neighbourhood. Certainly, at any rate, it would be inconvenient enough to motivate someone to leave it there. So some jerk took my flower pot.
What a neighbourhood. What a world. Screw you, flower thief.

Summer Blog Challenge, Take Two

July 21, 2010

It is time, once again, for the challenge of 31 days of non-stop blogging.

Without the distraction of an impending baby and a fruitless job search, can I continue to pump out 150 words per day, at minimum? Will I run out of things to say? Can I even hope to compete for the word-count title against such verbal diarrhetics as Cliff of peerpressureworks.com? Can I hope to say anything as self-revealing and profound as James of feelingsofwhite.com? Will James even participate? I’m not sure. What I am sure of is that, come August 3, it is back ON. And by ON, I mean on this blog, and at least peerpressureworks.com. And if peer pressure works, and I know that it does, there will be more than just we two.

Are you a blogger who has noticed cobwebs growing in the Add New text area? Have your followers been hounding you for updates?

Are you someone who has recently thought of blogging, but isn’t sure how to go about it?

Are you someone who has a lot to say but has no outlet?

If any of these apply, the Summer Blogging Challenge is definitely for you.

Heck, if you have an internet connection and a functioning knowledge of some written language, the Summer Blogging Challenge is for you.

Don’t hold back, jump right in. It’s only one post a day. 150 words. And you’ll get notoriety.

And Awesome Points.

If you are interested in joining in on the summer blogging challenge, comment on this entry, or the similarly themed entry at peerpressureworks.com and let us know: a) your name, b) your blog address

Good luck, and may the most dedicated (or just wordy) of us see it through to the end.

Local Man Takes Animal Without Paying

July 21, 2010

EDMONTON, AB

*Albert French, a 47-year-old welder living in the “Alberta Ave.” district of Edmonton left the Edmonton Humane Society in possession of a cat this afternoon. The pair left in French’s 1987 Chevrolet truck to begin a new life together.

The cat was 17 months old.

When reached for comment, French was friendly with reporters, even when confronted about the manner in which he acquired his new associate.

“Mickey’s a good cat,” French said without a hint of remorse or defensiveness. “I had cats before – they pissed everywhere, tore up the couch. But not Mickey. He’s got his post he scratches at, and his box for his business, and he’s good to go.”

Witnesses at the scene could not verify whether French, until recently, a resident of Antigonish, NS, acquired said accessories in the same manner, and EHS staff could only comment that their current goal is to find appropriate homes for 500 cats between now and July 31, 2010, in their Indy Cat 500 event.

Without editorializing, it can be hoped that French someday pays for his actions, particularly since he didn’t pay for the cat.

“I spun the wheel and hit the jackpot. One hundred per cent discount.”

This reporter was only able to get a 60% discount. Not that there are any sour grapes, but we’ll certainly be keeping an eye on the shifty Mr. French.

* The names of the accused have been changed to protect the fictional.

The Curious Case of #4

July 15, 2010

#4 and #5 are contractors I have worked with in my time at my current employer.

#4 is a nice guy. Not from around here, but easy to get along with. Even a little eager to make friends. Totally out of his depth.

#5 is another nice guy. A local product, fresh out of school. I have less to do with #5 than with #4, but what I have had to do with #4 is the point of this tale.

#4’s openness and friendliness were very engaging. He asked a lot of questions, which is good when it comes to getting up to speed. I ask a lot of questions, too.

As time passed, though, the questions didn’t lessen. “How does one implement this kind of thing” and “What are the rules around this” became “I don’t know what to do next” and “Why doesn’t this work?”

Quite often, more specific questions are positive. They can be a sign of moving past the theoretical into the practical. They can also, as I have since learned, be a sign of desperation. The asker either does not get it or has lost his confidence. I’m not a stranger to this kind of desperation for my own part, in limited bursts.

Patience is a problem of mine. Not a lack of patience, but an over-abundance. This is how I failed #4.

Is it my fault that he did not make the effort to learn the platform he was developing against? Am I to blame that he was poor at — and never made an attempt to improve in — problem solving? Is it a judgment against me that the only initiative he ever took was to stroll over to my cubicle and attempt to get me to do his thinking for him?

The answer to all the questions above, I’m sure you realize, is no.

I did not, however, do him any favours by doing so much for him. Maybe, if I had turned him away or limited my assistance to pointing out reference and resources, the light would have come on sooner.

It appears that the light did come on, though, at the end.

On the morning of his last day with the company, #4 asked me to speak with him privately. He was desperate for help – further learning in Java and Spring, steps he would have to take to get better at his job.

I explained to him that he had used up a lot of my time, and his own, thinking that what he was doing was good enough, and that that had to stop. Still, I was open to tutoring him after hours, trying to drag him up to speed. I told him he should just get through the thing he was working on for now, and after that, we would talk about going forward.

We never got the chance to have that second talk. He was escorted from his desk and out of the office before the day was out.

There’s conflict in me over this. There’s equal parts failure, anger, fear, and regret. As with any job, there’s always the prospect of termination, and the fact that I have a definite end date is moderately terrifying. The impending end of my employment has definitely flashed in front of my eyes.

Above anything else, though, it seems like relief is the strongest feeling. I can go through my days, not jolted out of focus to answer the same question for the third or fourth time, not continually trying to solve someone else’s problems.

I’m not proud of feeling relief. It doesn’t look good on me to take joy or anything like it from another’s misery. At the same time, I’m not going to pretend that #4 was an asset to the team.

I feel bad for him. He has a little girl at home and a very hard road ahead. But he got past the hardest part — he got the job. He didn’t take the position and make it his own, which is his own failure.

Time to move on.

Perdido Street Station by China Miéville

June 26, 2010

China-freaking-Miéville.

Holy crap.

I started reading Perdido Street Station way back in the winter of 2008. I didn’t make it very far. It was a library book and I get distracted very easily, especially when it comes to books. I’ve always been curious about the “new weird” genre that’s been creeping around and China Miéville has consistently come very highly recommended.

I started the book and was intrigued by a number of characters. Yagharek the Garuda, who narrates some passages; and Isaac, the scientist/inventor who is in love with a half-bug, half-human artist named Lin.

I didn’t expect what I got. These characters are extremely in-depth, vivid, despicable, sympathetic, loving, hating – everything you would expect from any random asshole you pass on the street. Yeah, you see him screaming at his wife/kids/the bugs in his brains, but if you got to know him better, which you do with these characters, including one of the main antagonists, you might still think he’s an asshole, but you’d think so with an understanding that that is not all of what he is.

None of the characters in Perdido Street Station, not even the completely alien, are two-dimensional in the slightest. You always understand why they’re doing what they’re doing.

That said, what a creepy freaking book.

The artist performs her art by basically eating ingredients for coloured clay and crapping them out, forming them into sculptures. Her body is fully human, her head is an entire scarab. On the surface, that’s a little creepy, but if you dig deeper (and who digs deeper than China-freaking-Miéville), you find that she has quivering little headlegs when she opens her head’s carapace. Yeah, I won’t go any further. I subjected myself to this novel, but I won’t subject you to the grossest parts.

Probably the most compelling part of the story is the city itself. Like the bug-woman (a khepri), the cactus people, the water-dwelling vodyanoi, and the slake moths whose dream-sucking abilities make them the villain for this story, Miéville finds a way to breathe life into the steampunk city of New Crobuzon and imbues it with its own personality. The class system at work in the separations by neighbourhood and the vast system of railways which converge at Perdido Street Station are just a sample of the elements that contribute to the city’s creepy near-sentience. Nothing’s clean, nothing’s perfect, but it is a city that works.

All of this without even getting into the plot. I won’t. It seems like the plot is just a secondary consideration, a mere side effect of having created such a great setting and characters. The book doesn’t suffer for the simple story laid out. In fact, it gives the characters and the city a chance to step to the forefront.

I didn’t think I’d want to cheer for the bug lover and his woman. He seemed a little too creepy, maybe a little like Ignatius Reilly from A Confederacy of Dunces, but he stepped outside of that stereotype and showed he had a little more strength, drive, and social grace.

I can’t recommend this book without the warning that it is not for the faint of stomach. However, I will warn you, and I will recommend the book despite the constant mention of secretions, ovipositors, and bugs.

The Rain Wild Chronicles by Robin Hobb

May 19, 2010

When I try to list my favourite authors, I usually forget about Robin Hobb. I don’t know why that is. She writes a lot, she writes very well, and I love her characters.

Dragon Keeper and Dragon Haven, the two books that comprise the Rain Wild Chronicles, are no exception to this. The story takes place in the same universe and time frame as the Farseer, Liveship, and Tawny Man trilogies. It is set after the events in Fool’s Fate, but seems to be more of a sequel to the Liveship Trilogy.

Without having read the Liveship books, I was a little concerned – would I miss out on references, or woudl the history elude me?

I didn’t need to worry. Everything I needed to know was sufficiently explained.

The characters’ development throughout the two books was very strong. The story was told relatively simply, without sudden twists or gimmicky writing tricks. Nothing in the books surprised me and I don’t think anything was intended to.

This series didn’t grip me emotionally, the way that Farseer and Tawny Man did. There wasn’t the angst and unfairness that filled the Soldier’s Son series. This was more about alienation, ostracism, and finding your place in the world.

The story did not feel epic and there were no surprises, but the books were better for that.

Next up: Reaper’s Gale by Steven Erickson.

Two Kinds of Strength

May 18, 2010

The other night, I had a dream. I was strong. Stronger than I can remember being, awake. Maybe I was human, but I doubt it. I was too big.

She needed to die. She knew it, I knew it. I’m sure it was the reason I was there. Still, I hesitated. Enough of me fought through the character I inhabited, making it some kind of interactive fiction. Or maybe that was subtle characterization – the monster showing some humanity. Enough of me remained not to want to do this.

She looked up at me. She was impossibly old. There was strength there – one that helped her to accept what was to come. One that helped me similarly. She saw my acceptance and nodded. Time was extremely short. I picked her up around the knees to haul her over my shoulder. I swung her at a large rock. Before my dream ended, I heard her sigh and say, “Ah, well.”

First dream I’ve remembered in years.

EAVB_OZTTSKMMKW