Wednesday, April 14, 2010

Tuesday Company Graduation Show



Another five week class of hilariousness! The video above is one of 7 from tonight's show. I've signed up for the same class again and the Wednesday Company class for the next five weeks. I'll have a lot more introspection at some point, but for now enjoy the show.

Sunday, April 11, 2010

Keep Looking for Patterns

Finding what I called "The Cycle" when dealing with feelings for former girlfriends help me break that pattern. But tonight I was thinking about the beginning of relationships. Seems like something was different when I was in college.

In high school, I had my first kiss when I was given a full week of freedom. My parents were out of town and I had to run the house, go to work, be an adult. I think having to step up in a lot of areas also helped me step up in the romance area.

My first girlfriend came out of being at college - again, more freedom, more responsibility (be an adult, but for 9 months instead of a week). Then a girl from fencing, where I was the new president. Later another fencer, where I was still the president, but taking on new tasks no president before me had done, such as going to Florida for a competition, and starting a fencing club at the local high school. And lasly, one more fencer when I was helping another college get their club off the ground. I was once again in a position where I was responsible for 30 plus people, and put in a situation that was both new and familiar all at once.

After that I moved to Cincinnati. So far everyone had been a student and the next girl was no exception. I was working my first Real Job where I was expected to be an expert. I was ready to be that expert, had been for the last four years. I wasn't just a student employee anymore and that meant that if I missed a deadline or screwed something up, lots of money was at stake for the first time and no one was there to take the fall for me or back me up.

After that everything kind of fizzled. I knew how to move around the midwest, and found myself back in Indiana. I had been running River City Fencing for several years now, so there wasn't a whole lot new to bring out new-Willness. So I made a bigger move, to San Francisco. It turns out that moving isn't enough, I'm downright good at it now.

Changed jobs out here. Not enough. Learned to kite surf. Not enough. Fencing is right out for the same reasons. SO if taking on more responsibility seems to be the key, what's next? What's next indeed.

Saturday, April 3, 2010

Pair Shaped

The Problem: You want to work on a some open source project, or a side project of your own, but you don't want to do it alone. Maybe you know someone, but it's hard to work together at a coffee shop and kinda weird to get together at someone's house.

The Idea: A place called "Pair Shaped" that's geared towards you. Doors open at 6:30pm sharp in the Financial District of San Francisco, so you check in using your phone, one of the perks of the membership, and you get in line for dinner which is served every night, buffet style. More guys and gals filter in, they're all in software so you can't help but talk shop, but you slip in a segue and next you're talking about the next Tron movie. At 6:51 sharp, you hear a cow bell and everyone stands up. One by one you introduce any new faces, and then go into things people need help with. Then a guy announces anything new about Pair Shaped, and lastly people shout out for a pair if they're still looking for one.

There's 24 chairs at Pair Shaped, but only 12 desks to work at. Everyone comes here to pair and so no one is left to flounder alone. Each desk has a 27" monitor and extra keyboard and mouse waiting for you - all you do is plug in your laptop and away you go. The WiFi is pretty clippy and the chairs are comfy, so you and your new buddy, Tom, get right to it.

Around 8:30pm you and Tom need a stretch break because while pairing is awesome, it's also exhausting. Sarah and Dave are also looking for a break so you challenge them to a game of ping pong. You thrashed them 21-15 and now you're thirsty, so you grab a drink from the fridge on your way back to the desk. you and Tom get a little stuck, so you lean over and ask Marty for a little help. Marty doesn't mind because his pair can keep cranking while he gives you a hand. You like that people are so open with their knowledge and are eager to help here. You and Tom crank on your code for another hour and a half and decide at 10pm that it is time to pack it in - Tom may be a freelancer, but you've got to get up in the morning - but it is good to know you could have stayed as late as midnight.

As you're walking out you notice that there's a new sponsored project. It seems The SoftwareShop has a project they've open sourced and they'd like to see some features implemented, but don't have the man-power to get it done. Next time you've got a free evening you know you could get a free meal out of working on that project. Then you notice an event scheduled for the weekend, "Level 2 Python". The first one was great and the class is just $50 bucks so you can't beat that for a whole day of education.

You wave good bye to Tom and pull out your phone. You're glad you went for that membership, having come to Pair Shaped four times this week only ran you $15 a night (What a deal for office space + meal + snacks) and that's way better than the drop-in rate of $20/night, plus you got a free helper on your project out of it. You're liking it so much that you're planning to ask your boss if you can host your next hack-a-thon out there.

The Questions: What do you think? Would you come to Pair Shaped? How many times a week would you come? Would you want to work on your own project? Would you be willing to pay $20 for a meal, snacks, and space for 5 hours? Is there anything else that Pair Shaped ought to be offering?

The Singleton Pattern

The Singleton Pattern pattern is about there only being one instance of a particular type of object. This becomes handy if you need a class that'll be maintaining the state of some resource during the life-cycle of your application. In a non-singleton situation, let's say I have two instances of my ControllerClass running around, and I tell one of them to set_lights_to_blue(), so it sets the lights to blue and notes the change in state. But the other instance doesn't know about this blue-light state, and still thinks the lights are green. So now my code starts running in to all kinds of crazy errors.


You could solve this particular problem a number of ways. One is to have all ControllerClasses subscribe to each other in an Observer Pattern, or you could make set_lights_to_blue() be a static method, but if you really want to go OO and get all the inheritance and skip the observer overhead, then the Singleton Pattern is the way to go. The one *gotcha* here is that you need to do some thinking to make a singleton class thread safe, otherwise you may end up creating multiple instance of your class anyway and the previously-mentioned chaos ensues.

Friday, April 2, 2010

Wanted to Document This

Compliments on my appearance are way up the last two weeks. Didn't
know what to attribute it to, but figured I ought to have a record for
the future.

Wednesday, March 31, 2010

Dear Amy Adams (the actress),

Why are you preggers and have a fiance? I would say life is cruel sometimes, but then you'd say "Ya snooze, ya lose!" In the meantime, thanks for being in great movies and making them awesome.

Love,
Will
(for the non-Amy readers out there: http://www.imdb.com/name/nm0010736/bio)

Tuesday, March 30, 2010

Don't Eat the Poisoned Meat

Good idea: cooking spaghetti for dinner
Bad idea: using meat from the freezer - I couldn't remember when it was purchased

Result: 2 Am rolls around and I know I'm going to be sick, just not right now. 3AM still impending sickosity, grabbed a bucket to be ready. 4AM "Hey, I might make it through this without getting sick". 4:15AM made good use of bucket next to my bed.

The lesson learned is to stay away from old meat, it will make you regurgitate your meal. Interpret that however you want.

Monday, March 29, 2010

Factory Patterns

In my book I covered two kinds of factory patterns, the Abstract Factory Pattern, and the Factory Method Pattern. Both are used to decouple concrete class creation from the objects that depend on them. Let's say I have a company and the company has a Department class. And in this company, each department has one of three job types: full-time, part-time, and contractor. I could have a method in the Department class like create_job(job_type)that takes a type and goes through a switch statement and coughs out a concrete job class.

Or, I could do something that will let me easily extend my Department with new job types in the future and apply the Factory Method Pattern. In this case, I make Department an abstract class, and create concrete classes called FullTimeDepartment, PartTimeDepartment, and ContractorDepartment. Each one will implement create_job() in their own way to return the appropriate job for that department. This rocks because now I can do something like:
my_department = FullTimeDepartment.new
job = my_department.create_job() #this returns a full time job!

Later, I can add a new department, the FullTimeButOnlyShowUpToWorkOnDaysThatDontEndInYDepartment without changing any existing code. I would then call .fire(:all) on that particular department, but we're making jobs here. So that's the Factory Method Pattern.

The other pattern is great for when you need to create families of stuff. Let's say you need a system for ordering office supplies for your department, things like staplers, paper clips, ink, and post-it notes. In most departments, a stapler can be just a standard black stapler. But those tricksters in the IT department love them some red Swingline staplers for some crazy reason. Here's a great time to use the Abstract Factory Pattern. In this case, each Department will have a OfficeSupplyFactory. Now both the Department and the OfficeSupplyFactory are abstract, and each concrete implementation of Department will specify which concrete OfficeSupplyFactory it will use. For instance, our BoringBusinessDepertment might use the PlainOfficeSupplyFactory, but the HipCoolWebDepartment will certainly be using the StuffWeSawInTheMoviesSupplyFactory.

Clear as mud right? Don't worry, basically the idea is that when you go to instantiate a concrete class in one of your objects, consider using a Factory Pattern of some sort.

Do It

I dare you.

Sunday, March 28, 2010

Personal Calling Card

Just placed an order for some personal calling cards. I hate handing out my business cards to friends even though it has my personal cell phone number on it. So I crafted a new card and ordered it through VistaPrint. It's got some art, my first an last name, cell, and email. It also has a big QR Code (2-D bar code) that you can use your phone or web cam to scan and you get all my contact info in your device without typing a damn thing. Sadly I bet only super geeks have an app to read a QR code, so I don't know how much utility it'll get. Alas, I'll love handing them out and talking about it.