Posts tagged “boring”
 
Kip

Accented memories

Written by Kip on Monday, August 30, 2010 at 8:49 pm (EDT)
Tagged as:

Over the weekend I went to my ten-year high school reunion, and I noticed something interesting when catching up with people. When I haven’t talked to someone in a long time, I forget that they speak with an accent. I guess it’s because I don’t remember their voice, and my brain fills it in with “accentless” Midwesterny broadcast English. Then they talk and I’m thinking “oh wow, you have a southern accent that I totally don’t remember1.” Which shouldn’t surprise me, most of these people spent most of their childhood in North Carolina.

1 Not that there’s anything wrong with that, I have one too
Kip

Personal goals

Written by Kip on Friday, April 16, 2010 at 2:42 pm (EDT)
Tagged as:

In the six years since college, I have put on about forty pounds and added about 2-4 inches to my waistline (depending on the brand of pants). I keep thinking eventually I’ll do something about it, but I keep putting it off. So I’ve decided I need to stop this infinite loop.  I’m going to start off with the goal of completely eliminating the following from my diet:

  • Soft drinks and sweet tea (pretty much any drink besides water and milk)

  • French fries

  • Ice cream

  • Cake and cake-like substances (this includes brownies and doughnuts)

Assuming I manage to keep to this, I will re-evaluate the list in a few months and maybe add other things I really shouldn’t be eating. I realize that regular exercise would probably be an ideal approach in a perfect world. But I’m pretty sure the odds of me continuing to exercise regularly for a long period of time are pretty close to zero. Maybe if I worked at a company that had a gym on-site there would be a 25% chance I would actually spend some time there, and a 7%1 chance that I would go regularly for more than a year. So I’m hoping that attacking the most unhealthy parts of my diet will pay off.

Now I must apologize for boring you with aspects of my life that no one but me could possibly care about. I’m hoping that I will be more likely to stick to it after making a public announcement.

1 48% of all statistics are made up on the spot
Kip

Something you probably couldn’t care less about

Written by Kip on Saturday, July 25, 2009 at 12:58 am (EDT)
Tagged as:

Longtime readers of this website probably remember1 that, when I created the current layout (nearly four years ago), I commented that the Homer icon beside the title of my posts was just a placeholder.  Well, I finally decided to do something about it.  I opted to just use my gravatar, as I started doing in the comments last year.  In case you’re curious, my current gravatar is from a doodle of one of The NiNjAS.  But if you were one of my true fans you would know that already.

1 actually they probably don’t
No Comments
Kip

Little things

Written by Kip on Thursday, January 15, 2009 at 11:24 am (EST)
Tagged as:

This post is to let you know about several small tweaks to this site that I’ve been working on lately, even though you probably don’t care at all. :)

One of the cooler things is that I’ve written some PHP code to programmatically generate gradient images.  If you’ve looked around the web you know that gradients are essential to modern web design, and I figure there’s no need to fire up Photoshop everytime I need one.  (Now if I can just write a glossy floor generator I’ll be totally web 2.0 compliant.)  You can view the gradient generator source code, if you’d like.  Of course, this kind of thing is so easy to do with PHP and a bit of 7th grade math that it’s almost not worth posting.  But I figured I’d share anyway.

Thus far I have put these gradients into action in two places on this site: as sexy new comment headers (as seen here, for example); and in the background of any picture in our photo album.

I can’t remember if I ever posted about this, but I wrote some Javascript a while back which is currently in use on the photos page, which scales the photo to fill your browser.  jQuery is awesome.  (And every modern browser1 can scale images without making them look grainy.)

I’ve also fixed the bug with the stored name/e-mail from adding a comment.  I have to apologize for the accidental breach of privacy, which would have exposed your e-mail address to other visitors to the site for up to an hour after your visit.  Now the name/e-mail fields are filled in by Javascript, so they are not cached server-side.

Another small change is that timestamps on posts and comments are now converted to your local timezone.  You can still hover over the timestamp to see an ISO-8601 timestamp, part of the datetime microformat I adopted when I added hAtom support.  Speaking of which, I finally found a way to validate hAtom: there is a site, transformr.co.uk, which will take a URL to a page supporting hAtom, and it will generate a true atom feed for it.  Here is mine.  I’m still not sure who would benefit from that though.  If you know enough to use the hAtom feed, then you probably know enough to click the little feed icon in the address bar too.  Oh well, it’s there if you want it.

1 I don’t consider IE6 to be a modern browser.
Kip

Java overload

Written by Kip on Friday, January 12, 2007 at 10:21 am (EST)
Tagged as:

Something I learned today: overloaded method resolution in Java is done at compile-time, not runtime.  Warning: if you have no idea what half the words in that sentence meant, then you probably don’t care about the rest of this post.

Let’s say Alice (who is in tons of hacking books for some reason) wrote this code:

1
2
3
4
5
6
7
public class Alice
{
  public static long roundToNearestFive(long n)
  {
    return Math.round(n / 5.0) * 5L;
  }
}

And let’s say Bob (who totally has a thing for Alice even though she says they are just friends) wrote this code:

1
2
3
4
5
6
7
public class Bob
{
  public static void main(String[] args)
  {
    System.out.println(Alice.roundToNearestFive(12.7);
  }
}

When Bob runs his code it will print 10, since 12.7 will be silently converted to an integer (12) to be passed into roundToNearestFive(), and 12 is closer to 10 than to 15.  Bob could call roundToNearestFive( Math.round(12.7)) to fix this, but that is annoying because now he has to first round his floating-point numbers before passing them into a rounding function.  So Bob asks Alice to provide a fix, and she adds a version of the function which takes a floating-point number:

1
2
3
4
5
6
7
8
9
10
11
public class Alice
{
  public static long roundToNearestFive(long n)
  {
    return Math.round(n / 5.0) * 5L;
  }
  public static long roundToNearestFive(double d)
  {
    return Math.round(d / 5.0) * 5L;
  }
}

She sends a new .jar file to Bob with the change, and he runs his code again, expecting it to now output 15.  But it still prints 10.

The problem is that when Bob compiled his code, there was no roundToNearestFive(double) function available.  So the compiler generated bytecode that looked something like Parent.roundToNearestFive( (long)12.7).  So even when he runs with Alice’s new code in place, the bytecode is still forced to call the integer version of the function.  The only solution for Bob is to recompile his code against the new .jar file sent from Alice.

For further reference, here is the spec for binary compatibility in Java.  And here is more information about Alice and Bob.

No Comments
 
 
RSS feeds: Kip's - Stephanie's - Both
Admin