Archive for December, 2007

Geek Gourmet - Quick Chicken Teriyaki Stir-fry

Sunday, December 30th, 2007

If you’re like me, you hate to take too much time away from whatever it is you’re working on to make yourself food.

Sadly, this tends to lead to a lot of eating out, or a very unbalanced diet. Fortunately for me, my lovely wife Angie is a health nut (in a good way, I swear! ;) ), and keeps me in line most of the time.

Despite the fact that it does take so much time occasionally, I do enjoy cooking, especially when the result is something as delicious as tonight’s dinner: Teriyaki Chicken stir-fry.

The best part about this meal is that it took me no more than 15 minutes of cooking (plus waiting for my rice cooker to finish), and the result is amazing.

Here’s what you’ll need:

  • 1 package pre-cooked chicken slices - I used Hormel Natural Choice Grilled Carved Chicken Breast (long enough name?), which is all natural with not preservatives and all that good stuff. It’s pretty good.

  • 1 bag of frozen stir-fry vegetables - I got the kind with snow peas, carrots, and mushrooms, but whatever works.

  • Teriyaki Marinade - I highly recommend Soy Vay Island Teriyaki: no corn syrup or preservatives, just a whole bunch of delicious stuff.

  • Rice - Whatever you prefer here. I just cook up some rice in my rice cooker, but they have that rice that comes in the microwavable bag that you just stick in for 4 minutes and it’s done. That’s probably fine, too.

  • Some sort of oil for the vegetables (optional)

Here’s how to cook it:

If you’re using a rice cooker or cooking your rice on the stove, start that first and then cook the other stuff. If you’re using microwave rice, you can probably wait until the point at which you add the chicken in to start that.

Heat up some oil in a frying pan (or wok, or you can use a sauce pan in a pinch), or don’t, or whatever. If you’re using a non-stick pan oil isn’t strictly necessary. I melted a bit of extra-virgin coconut oil in mine. It smells delicious and adds a hint of coconut flavor to whatever you cook in it. Olive oil or any other reasonable cooking oil will do, of course.

After the oil has warmed up for a couple of minutes, add in the vegetables, and stir them around until they are nice and warm all the way through. At this point I usually drain off the water that comes from the ice on the vegetables.

Next, add in some of the teriyaki marinade. Just enough to coat the vegetables, and stir it around for a couple of minutes.

Now, move all the vegetables to the edge of the pan, leaving some room in the middle. Add the chicken into the space in the middle.

Coat the chicken with a healthy coating of teriyaki marinade and let it cook in a little, then flip the chicken and add a little more marinade. You should see the sauce deliciously soaking into the chicken at this point.

Stir the vegetables and chicken together and, if you feel so inclined, stir in a bit more marinade.

As soon as the teriyaki sauce has thickened to your liking, you are done! Serve yourself up some rice (you remembered to start that earlier, right?), and scoop a helping of your veggies and chicken over the top.

Enjoy! I know I did :)

Python Web Browser on the way

Sunday, December 30th, 2007

I’ve spent a good chunk of my vacation working on some of what will become the internals of a web browser written in Python.

Some of the goals of the browser include:

  • Full conformance to all DOM 2 Modules (and equivalent DOM 3 modules when they become recommendations). This goal is already about 60% done.
  • Full conformance to CSS2.1, and eventually CSS3
  • Javascript support.
  • SVG and Canvas support
  • Little or no explicit support for deprecated standards and technologies (yes, this is a feature).

The most important features, and thus the ones getting the most attention, will the standards compliance and JavaScript support. Standards compliance is important because I want this browser to be an example of a browser which people should take seriously. I won’t, however, do extra work because somebody out there decided to not follow the standard when designing their webpage. JavaScript support is important for the same reason. Nobody is going to take a browser seriously (or be able to use it for any modern website) if it doesn’t support JavaScript.

So far I’ve got a complete (but also completely untested) implementation of the DOM 2 HTML, which took me a good amount of time longer than expected.

I started with a good base: pxdom, a complete implementation of DOM 3 Core and LS (Load and Save), and implemented my additions on top of that. It’s still a separate module, though, but there are a few places where I rely on some of the implementation specific details of pxdom. I have plans to remove the dependency at some point so that I can swap in other DOM core implementations.

On top of that I built my DOM HTML implementation, and laid a little bit of groundwork for DOM StyleSheets and CSS. I’ll be using cssutils, which is a mostly complete python DOM CSS implementation. The cssutils version 0.9.4b1 was just released with mention of some sort of selector support being added in version 0.9.5, which will hopefully make it so I don’t have to do a full CSS cascade implementation myself.

I’m taking a break from working on DOM implementations now and moving back to something which will actually allow me to see results: the rendering engine. I’m starting with just a stub implementation of the ViewCSS interface which allows me to use the getComputedStyle function to get the default style for any given element. With that, I should be able to render any HTML document as if it had no style applied to it. Later on I will hopefully be able to use the upcoming selector support in cssutils to make getComputedStyle work as expected.

This browser is something that I’ve been wanting to do for a very long time. I even sort of started to implement the rendering engine a long time ago using pycairo as the backend. I’m going to stick with that because it seems to be an ideal rendering backend for webpages (which would explain why it will be the only thing used for rendering as of Firefox 3.0 :) ), and for eventual SVG and Canvas support. Once I get to the part where I’m actually working on the user interface portion, I’m planning on writing a Python binding for glitz, which will provide the browser with OpenGL accelerated rendering by default.

Dearest Python,

Saturday, December 22nd, 2007

It’s been a really long time, and I’m sorry. I should have gotten back to you sooner, but I’ve been busy with the new job and new house and finding time to spend with Angie and the cats.

I know those are just excuses, but I want you to know that you’ve always kept a special place in my mind and heart. Your code is just so nice to look at, probably some of the prettiest code around.

And you know I’ve always been a sucker for languages with higher-order functions and lambdas. And let’s not kid ourselves, we both know you have one of the biggest collections of third party libraries out there, and your module and package system is probably the best I’ve ever had the pleasure of dealing with.

I’ve spent a lot of time with PHP lately, but that has been mostly in a professional setting and has just reminded me of all the things that you can do better than PHP can. One has to work at making PHP pretty, but you make it seem so natural.

We’ve had our flings in the past, some long, some short; but nothing has ever really come out of our relationship so far. Sure, there were some good little programs here and there, but nothing really spectacular, you know?

At one point I blamed you for the lack of results, but after some thinking I’ve come to realize that it was me all along; I wasn’t putting enough effort into finding the time to really make it a fruitful and fulfilling relationship.

I promise you that things will be different this time. We’re going to take the world by storm, you and I, and I don’t care what anybody says about it, it will be amazing. We’re going to show them all what we’re capable of.

Yes indeed, Python, I think that this is the beginning of something beautiful.

Yours Truly,

Paul Bonser

to be continued…

New Day Resolution

Wednesday, December 19th, 2007

I’ve decided that the New Year’s Resolution is just another way to procrastinate, which is why I’ve invented the New Day Resolution.

Well, I just did a Google search and it seems I’m not the first person to coin the term. I must be onto something though!

What’s a New Day Resolution? Is there something you want to improve about yourself? Well, if it’s too late to do anything about today, wake up tomorrow morning and look forward with determination to make that improvement. Don’t worry about yesterday or the day before that, because each day is a new day.

It’s something like that. For me, today, it’s as simple as making this blog post. Hopefully for someone else these same words that I’m writing now are inspiration enough to do something as simple and personally meaningful as well.

Why wait until the end of the year to make plans to improve yourself? It’s a good excuse to put something off until the end of the year, that’s why! “Oh, I’ll stop smoking at the end of the year” or “I’ll lose weight starting January 1st”

No.

Do it now. Not everything, of course, that would be too stressful, but don’t put things off so long. Make a list, start checking things off, keep track of your progress. Be sure to keep any promises you make to yourself!

As you get better at keeping all these little promises to yourself, you’ll be able to handle more of them at once without feeling bogged down. Basically, you’ll be accelerating toward your goals, which makes the progress feel much more impressive.

I have another post already partially written about progress and a nice driving metaphor to go along with it, but I’m going to save that for later because I’m feeling pretty sick and I need to go take a nap. (Taking better care of myself: another new day resolution!)

I’m posting though, because my new day resolution for the day is to post in my blog at least 4 times a week, preferably at least every other day. I posted two days ago, so now I’m posting today.

Doing it Right from the Beginning

Monday, December 17th, 2007

My coworker Scott Martin recently posted a list of things to do from the beginning of a project..

I had planned to post something along those same lines myself, but I guess he beat me to it.

I’ll throw in my two cents with a much shorter and vaguer list, with my comments and a few extra items as well. This will make a lot more sense if you read the list at the above link first.

  • Internationalization + Smarty

    These two items go together. Basically, there shouldn’t be any text which makes its way to the users which comes from anything but a template file. Seriously, don’t put text in your code.

  • Code standards

    Here’s a secret: what your standards are really doesn’t matter. It’s the fact that you have standards that matters. It’s really annoying to read code with two different layouts. Pick one and stick with it.

  • Code generation

    I disagree with Scott about code generation being bad. The one thing that needs to be done for it to be okay, however, is for it to be generated, and updated, automatically. The first code you should write isn’t the code to generate the code, but the code to call the code to generate the code when the source of the data used to generate the code is changed.

    For example, if you are reading in one file to generate another, then before you read in the file, run some code which checks the last modified time of the generated file and compares that with the last modified time of the source file, if the source file is newer, regenerate.

    If you feel so inclined, also check the timestamp on the code which generates the file, and if it is newer than the generated file, regenerate also. This will get rid of the instance where you change the generator code but don’t change the input file.

    Alternatively, if you have some sort of interface or tool which generates the input file, have that tool run the script to update the generated file.

  • URL rewriting

    As we all know, Cool URIs don’t change. So make some sensible decisions at the start of your site design, and stick with the URLs from there on out. All you need is a single script to redirect all URLs to (except images and CSS and things), which then delegates the work out to some actual PHP files. This is also helpful in that it makes it so you don’t have to have all of your PHP files inside of your document root, just the one that does the routing, which brings me to my first new rule…

  • Keep non-documents out of your document root.

    The fewer things you actually have in your document root, the fewer unexpected security holes there will be. If a file is not going to be directly accessed from a web browser, don’t put it where a web browser can get to it. All of your configuration files and almost all of your code should be kept out of your document root.

    A structure like the following works well:

    • application root
      • htdocs - static HTML files, images, CSS files, a single code file to load in other files based on the requested URL
      • src - all of your actual code. Set your inclide_path to here and keep everything neatly organized into subdirectories
      • templates - Smarty, or whatever templates you are using.
      • cache - whatever sort of disk cache you need. This includes Smarty cache, RSS feed cache, etc…
  • Don’t Repeat Yourself (DRY)

    This is basic stuff right here, but it can never be said enough: Don’t write code that does the same thing as code you’ve already written. Or if you have to do so, then combine the two pieces of code together. It is a huge pain when you have to figure out why something is working the old way when you already changed the code that does that thing to do it a new way.

    If you are copying and pasting code, then something is probably wrong.

  • Don’t Repeat Other People/Don’t Reinvent the Wheel

    This one is a bit different. What I mean by this is don’t write any code that you don’t have to. If somebody else has a library that already does what you want, use that, unless there is a very, very compelling reason for you not to. If a library has licensing issues, or is really slow, or doesn’t fit into your platform somehow, it might makes sense to write it yourself, but first check to see if there’s already something else which meets your needs.

    Spending an hour searching something is going to take less time than writing it yourself.

What guidelines do you follow from the start with every project that you do?

The List - An experement in Social Relevance

Sunday, December 9th, 2007

I’ve had this idea floating around in my head for a while. Take the general idea of Hot-or-Not or Kittenwar!, and expand it to be a general comparison of two things. I chose to make the comparison on “Social Relevance”. In short: what things do people consider to be important topics.

I knew it wasn’t a complicated program, but I’d always been too busy with other stuff, or too lazy to actually do it.

Today I had some free time, so I finally hacked together a quick prototype implementation. I’ve called it “The List.”

You can add items to the list, giving them a title and description. In the description, HTML is allowed, so you can link to more information or include a picture. I run everything through the HTML Purifier upon submission, so it should be pretty secure.

Items in the list are sorted by their score, which is an item’s win percentage multiplied by the number times that item has been voted upon. I will change the score calculation if needed in the future.

Here are some things I’m planning on adding at some point:

  • The ability to edit items
  • Merging of duplicate items
  • Reporting and removing of inappropriate/bogus/spam items
  • Item search
  • Details pages for individual items, perhaps with item comments
  • Some sort of feed of top items

Please give The List a try and leave me some feedback, questions, complaints, and bug reports as comments on this blog post. I’m curious to see what others think and to see what makes its way to the top of the list.

Interviewing myself for Shane & Peter

Friday, December 7th, 2007

I found these interview questions from Shane & Peter via Jarkko Laine. I just realized I haven’t introduced myself very well, and that these questions might help to do that at least a little bit.

What’s your personal mission statement?

My personal mission is to work toward owning my own successful company which allows me to be my own boss, work on projects that I enjoy using as well as selling, and to be independently wealthy.

I’ll be building this company myself, with no external funding, because as stated above, I want to actually own the company, not just run it.

In the meantime, my mission is to bring everything I can to my current job, to help this company to be as innovative and productive as possible. It feels good that I get to create software which is being used by thousands of people. I wouldn’t want to work at a place where I get absolutely no input into what I am helping to create, and I don’t want to be building something boring that nobody would ever really see. My current job fulfills my job requirements pretty well, and keeps me fed while I work my way toward my long-term goals.

Yeah, that was more of a “mission babble” than a “mission statement” but this is my blog, so nyeah!

What’s the biggest mess you’ve dealt with this year?

At home, one of my cats overate a bit too much. Thank goodness for tile floors.

At work, I checked in some code which had a teensy bug in it which may have taken some sites down for a short period of time. Whoops.

What current entrepreneurial efforts consume your time?

Well, I’m starting with this blog to introduce myself to the internet community and to get to know some others, as well as to have a place to showcase my ideas and projects.

There are also some top-secret projects which I can’t reveal until it’s Alpha or Beta time.

Why do you do what you do? What inspires you? When do you get most excited?

I love the idea of doing something new. Something that nobody has ever done or seen before. Also exciting is doing something that makes people go “Wow! That’s awesome!” When I’m creating things, it’s also exciting when I can imagine myself actually using it. There’s nothing worse than making something you know that neither you nor anyone else will ever even use.

Boxers or Briefs? or as Naomi says, Bikini or Thong, duh?!?

The ever popular hybrid/mutant boxer-briefs.

What do you do when you’re not [designing | programming | managing | writing | toiling for the wo/man]?

I like to hang out with my wife, Angie, and our three cats, Kitty, Cisco, and Ninja.

What one thing made the biggest difference when getting started?

Well, I’m just barely getting started, but I could never even think of getting started without the support of my wife. We have precious little free time together and I won’t cut into any of that without first getting an okay from her.

In return, I’ll make sure that I have plans for the future to increase the amount of free time that we have to spend together. I suppose having that plan should go into my personal mission statement as well.

I want do well enough with my business that I can increase the amount of time I get to spend with my family (Angie and the cats, that is)

What’s your exit strategy?

Well, I’ll keep a helicopter parked on the roof and an underground tunnel/escape chute, just in case.

Well, honestly I don’t know. I’m still working on my entrance strategy, really. Once I’ve got that all worked out, I’ll get back to you about the exit strategy.

What is the last thing that made you belly laugh?

Someone at work, I’m sure. That is one good thing about working with a room full of other developers…we all have compatible senses of humor.

Two seconds ago: “Why is there a bomb on Pavan’s desk?”

Ahh, inside jokes.

Two more seconds ago (about a new Macbook Pro): “This is what it’s like when somebody brings a baby into an office full of women.”

Have you ever been in business before?

Not my own business, no.

At what point do you consider yourself successful?

When I can wake up in the morning and go to work by walking into my office and sitting down. At that point, I will consider myself successful in my own business.

Right now I consider myself successful already since I am living comfortably and working toward the future which I want.

What was your first experience with a computer?

It’s a toss-up between a really, really old DOS machine and the Apple Macintosh plus that my family got when I was in grade school.

My first experience programming was in Hypercard on that old Mac. My first real experience programming was in QBasic from DOS on a 486DX2.

Steve Jobs vs Bill Gates in a jello wrestling match, where’s your money?

I’m not giving any of my money to either of them. Did I mention that I’m strictly a Linux user?

Where do you do your best thinking?

Usually when I’m in the shower or exercising, or some other place when I don’t have access to a pen and paper.

Sometimes it’s when I’m torturing Angie with an explanation of my latest Idea in far too much technical detail.

What does your average daily work / life balance look like? How much time do you work, play and sleep?

Currently I work from 9-6. In the evenings, if Angie is home, I usually hang out with her, and we do errands or watch some TV shows, or just hang out.

If Angie is not home (she works too), I generally will work on one of my “top-secret” projects.

If I could introduce you to anyone, who would it be?

Someone who is living comfortably on their own personal business, and knows how they managed to get there.

Other than that, somebody with similar interests who would like to hang out and talk geek talk.

What stops you from giving up when you are frustrated?

A strong desire to never leave anything incomplete. I suppose that’s a nice way of saying “OCD”.

Of course, this also sometimes stops me from starting something when I think I might not have enough time to finish it in one sitting.

If Chuck Norris and Steven Hawking had a baby (hey it’s my damn interview), would you vote for her for president?

That would depend on her platform and fiscal policy.

Of course, I’m not completely sure either of their wives would approve.

Newscorp Buying Beliefnet?

Monday, December 3rd, 2007

Update: Well, it’s official, Beliefnet has been acquired by “Fox Entertainment Group”. Steve Waldman released an announcement on Beliefnet via YouTube. Nothing about the price yet.

Apparently Beliefnet is being (or has been) purchased by Newscorp.

Beliefnet, for those who don’t know, is “…the largest spiritual web site.”. And their social network is a place for people to gather and discuss religion. Since religion is something that people tend to be very passionate about, it’s a good basis for an online community.

This is relevant to me due to the fact that I worked on (and continue to work on, occasionally) Beliefnet’s recently-beta-launched social network.

I’m very much interested to see what becomes of this, since it may or may not have a direct (or indirect) impact on my work in the near (or not so near) future.

No, I don’t have any insider information, but I do see it as an interesting topic to talk about.

p.s. I apologise for the relatively content-less and off-topic-ish post, and I promise that I won’t make a habit of it. It’s just that it’s a bit exciting to be potentially involved in something as big as this potentially is. :)

Making Myself Happier With Myself

Saturday, December 1st, 2007

It’s time for some of that fabled “other stuff” mentioned in the headline of this site.

A bit about myself

I’m generally a very calm, laid-back, happy person. I don’t get frustrated too easily and I, by default, don’t let most things bother me.

It’s not for a lack of emotions that causes my general state, it’s an implicit knowledge that getting all flustered and upset and throwing a fit is a generally useless way to deal with a problem. Ignoring a problem won’t make it go away, but if that problem is a bad day at work or a horrible commute home, then you know what? It’s over at the end of the day. There, problem solved, you can forget about it.

The problems

There are, however, things that have bothered me about myself for several years. These are problems which no amount of ignoring will cause to go away. These are the kind of problems which require action.

Here are my two biggest problems:

  1. I am overweight
  2. I procrastinate

(Hey, those rhyme!)

The second problem has most likely caused the first problem to last much longer than it should have (and it was the original source of the problem as well, “Oh sure, I’ll start exercising this summer when I have more free time…”), but soon it will be a problem no more.

The solutions

I’ll cover they ways I’m going about solving my two problems in reverse order, since the second is the root of the first.

Stopping procrastination

There is really a single solution to both of these problems: STOP PROCRASTINATING

How does one do such a thing? Well, do a Google search for stop procrastinating, start reading about the various techniques for avoiding procrastination, spend some time considering which approach would work the best for you. Now, pause for a moment and think about what you are doing: You are procrastinating some more. Realization of a problem, as they say, is the first step toward solving that problem.

My solution to procrastination is fairly simple and seems to be effective for me. The hardest part of any task for me is simply starting it. Once I’ve started something, I want to keep going until I stop. I think this is part of the reason why I avoid starting things for so long. I’ve started to get myself in the habit of action. I still spend too much time thinking about things, looking things up, discussing things with others. But once I realize that I’m procrastinating, I realize that I need to just start doing whatever it is that I want or need to do.

In short, my solution to procrastination:

  1. Learn to recognize when you are procrastinating
  2. When you notice that you are, stop

Once you get in the habit of realization and cessation of your procrastination (I’ve got to stop with this rhyming business), procrastination shouldn’t be as much of a problem. I think in my case, doing anything which I had previously put off gets me into the mood for doing things, and I’ll have a burst of procrastination-free activity.

Losing weight

Okay, so the single solution is to stop stalling and act, but what exactly is the action to take for weight loss? Well, there’s a simple solution to weight loss:

Eat fewer calories than your body is burning.

That’s it. No need to go on a fancy diet, not need for pills or muscle-killing exercise plans. Though exercise is also essential for good health, it is not essential for keeping your ideal weight. They are two separate problems and should be treated as such.

My particular solution was taken from a wonderfully helpful free book, The Hacker’s Diet, by John Walker, the founder of Autodesk. If the fact that he’s a Millionaire/Programmer/Businessman (three things I hope to be someday), isn’t enough to be convincing, how about the fact that he went from 215 pounds to 145 pounds in six months?

I’m not looking to lose weight quite as fast as he did, but I have been losing slightly less than a pound per week since I started actively trying to lose weight. I’ve been overweight for the last four or five years, and all it took was getting started.

One of the really helpful things about the hacker’s diet is the way you track your weight. If you just measure your weight, it will vary wildly depending on how much water (or another soon-to-be-released substance) is in your system. This results in a depressingly squiggly line. If you use a sliding average, the line is much smoother, and reassuringly downward-trended (unless you really are gaining weight, of course).

For an example of this, check out my public weight-loss profile at PhysicsDiet.com or just look at this chart of my weight as of today:

my weight graph

Conclusion

The more I do things which I’ve been planning to do, the more I move away from my habit of procrastination. This blog itself is the result of me finally doing something that I’ve been putting off for quite a while. Soon enough I should be posting about other projects which I’ve wanted to do for a long time, but have been putting off.

It’s definitely worth it to stop procrastinating about stopping procrastinating.

What I'm Listening to

Loading...