Tag Archive for Geek

Public Restrooms Are Scary

Tagged as: , , , , , Nov 05
# use_public_toilet.py
#
# Algorithm for using a public toilet.  Success will vary based on the
# toilet/situation (obviously).  However, this seems to be a generally safe
# way to approach using a toilet.
#
# Handles both male and female needs as well as exceptional cases such as
# no available toilet, getting dirty, and entering the wrong gender's
# bathroom.
#
# Algorithm is roughly:
# 1) Enter bathroom
# 2) Find suitable toilet
# 3) Protect yourself if it's a stall toilet that you sit on
# 4) Do your business
# 5) Finish up

import common_sense

# Sometimes even nature's calling cannot overrule common sense
# Including when you walk into the wrong bathroom
if (bathroom.is_disgusting or bathroom.is_dangerous
    or bathroom.gender != you.gender):
    you.hold('your waste')
    return # (i.e., get out of there!)

my_toilet = None
# Only male urinaters get to use the urinals, at least in the common case
# (Abnormal cases are unhandled here)
if you.need() == 'urinate' and you.gender == 'male':
    for urinal in bathroom.urinals:
        if not urinal.empty:
            continue
        my_toilet = urinal

# If you are not a male urinating or there is no urinal available
if my_toilet is None:
    # Time to look for the stall
    for stall in bathroom.stalls:
        # Use an empty toilet that can also be initialized to a clean state
        if not stall.empty or (not toilet.clean and not toilet.works):
            continue
        you.enter('Stall %s' % stall)
        my_toilet = stall
        break
    else:
        # You could not find a suitable stall to use
        return

    you.wipe('toilet seat')
    you.put('toilet seat cover')
    while not toilet.seat_covered():
        you.put('toilet paper')

# Finally the time has come to get down to business
try:
    you.sit()
    you.do_your_business()
except TouchDirtyException:   # Don't touch the toilet!
    you.cry()

you.flush(my_toilet)
you.wash_hands()
you.leave()
if you.satisfied:             # Be happy, you're done
    you.smile()


3 Comments »

Understanding Domains

Tagged as: , , Sep 03

If I could have your attention, I would rather like to quickly rant about something that I see all of the time.

  1. People pay for their own domain name
  2. Those same people want to get e-mail
  3. Those people proceed to register an e-mail address with some free webmail (e.g., Yahoo!, Google, etc)

Why does require a rant? Because they paid for their own domain! Instead of having to register SomeOrganizationSomeGroup@gmail.com, they could very well just decide that they want to get SomeGroup@TheirDomain.com. Doesn’t that seem more appealing? Isn’t that more professional and more enjoyable? Yes, yes I think that we can all agree to that.

The only argument that I can think of is that people want to be able to use the webmail clients to access their e-mail. I hear ya. But maybe more importantly, Google hears ya. I don’t want to be a Google salesman, but their standard edition of Google Apps is pretty free. And that will pretty much take care of you.

Together, we can combat annoying-to-remember e-mail addresses. We can do it!

Leave A Comment

Tough To Say Whether It’s Even Decent

Tagged as: , Jun 18

I have been working on a budgeting application called Budse (actually for quite some time now). It’s a straight forward application that allows you to create a set of accounts that have rules assigned to them, which dictate how to split up whole account deposits (e.g., a paycheck). I originally had the idea because I wanted to start budgeting using the 40-30-20-10 rule. But then I realized that I wanted to use the idea but customize it a little bit more for my needs.

But enough about the details. On to my point.

So I am working on Budse by myself. I started the project, and it has been a one-man show the whole time. As an individual developer working on an open source project, sometimes I dream. I start to think big about people actually using it. Big dreams, I know. Haha currently I doubt it if anyone aside from me uses it. When I was coding and especially when I was deciding on how to license it, I thought that since it fulfilled my need it would be useful to other people as well. Maybe that’s not true. Maybe it is. It remains to be seen.

It is so easy to dream of becoming great. But maybe dreaming big isn’t such a bad thing. Maybe if I lost the ability to dream big, I would lose a little bit of who I am. So while I am currently unsatisfied with its use, I am definitely going to press forward!

1 Comment »

Changing Permalinks

Tagged as: , , Apr 25

Oh boy that was sweet. Okay let me qualify that by saying that I enjoy when things are easy and efficient. If you feel differently, then you may very well disagree with me.

So on a nice lazy morning I decided to look into converting my permalink structure to one that I preferred. Permalinks are how Wordpress describes permanent links to a post. When I first started this blog a couple of years ago (seriously, that long??) I decided on going with a fairly standard /yyyy/mm/dd/post-name type of structure for my posts. However, I am now a little opposed to this since it reveals more information than I would like. I tend to think that my writing transcends time since I am not usually writing about current events so I want to remove a visitor’s perception that my post is not worth reading just because it is old.

After searching online, I came upon Scott Yang’s Permalink Redirect plugin. The instructions seemed easy enough so I:

  1. Downloaded it
  2. Unzipped, installed, and activated it
  3. Accessed the new Settings->Permalink Redirect page. Under “Old Permalink Structure” clicked the link after “Current permalink structure”
  4. Accessed Settings->Permalinks. Changed to a /post-id/post-name structure. (I used tags that I found here.)

All of my old links are now redirecting correctly! And that, my friends and enemies, is sweet! Especially since it took less time than it has taken me to write this post. I’m loving Wordpress all over again for its abilities, both built-in and extensible.

Leave A Comment

Go, Go, Stop!

Tagged as: , Mar 20

I often like to think about things that I take for granted. It makes me more appreciative of what I have, and I don’t think that’s a bad thing at all. A while back, I was thinking about how great the yellow light is. For me, more often than not it’s a sign that says, “figure out if you can make this light!” Sometimes this is a resounding yes, and sometimes it’s a resounding no. Sometimes it’s even “you better get going pronto!” Can you imagine, though, what it would be like without yellow lights? Drivers would be moseying along thinking that they’re good to go, when all of a sudden they need to slam on their brakes. Accidents would abound because brakes cannot stop you instantly.

Recently, I even got to experience a similar kind of fun. Many of the lights along a street that I commute on were out. So as expected all of the cars treated each malfunctioning light as an all-way stop intersection. And that wrecked havoc on my commute. Boy am I glad for signals!

Oddly enough, this reminded me of a problem that I am dealing with at work. The problem is that I am trying to make a single database access for every single object that I want to create. That would be analogous to a stop sign which lets everyone through one at a time. Ideally I am trying to code things that will allow for multiple objects with a single database connection. This would be with the lights that let multiple cars through. I do enjoy finding out how good software practices relate to life.

1 Comment »