Categories
Mozilla Open Source Programming

Benchmarking And Testing Browsers

When people talk about open source they often talk about the products, not the process. That’s not really a bad thing (it is after all about the product), but it overlooks some really interesting things sometimes. For example open source tools used in open development.

A few months ago Jesse Ruderman introduced jsfunfuzz, which is a tool for fuzz testing the js engine in Firefox. It turned up 280 bugs (many already fixed). Because the tool itself is not horded behind a firewall it’s also helped identify several Safari and Opera bugs. It’s a pretty cool way to find some bugs.

The WebKit team has now released SunSpider a javascript benchmarking tool. Something tells me this will lead to some performance improvements in everyone’s engine. How much will be done for Firefox 3.0 is a little questionable considering beta 2 is nearing release, though you never know. There’s been some nice work on removing allocations recently. So just because it’s beta, you can’t always assume fixes will be minor in scope.

Another test that many are familiar with is Acid 2 which essentially is checking CSS support among browsers. Ironically this one too was released when Gecko is somewhat late in the development cycle.

Efforts like this really help web development by allowing browser developers to have a baseline to compare their strengths and weaknesses. Having a little healthy competition as motivation can be pretty helpful too πŸ˜‰ .

Categories
Politics Programming Tech (General)

Time Sucks

One of the hardest things to program is the Date and Time. This is especially true when your doing it on the web. Why is that? Using a unix timestamp is immensely helpful and resolves many of the complexities, but it does have some issues (besides the Y2K38 bug). Well lets take a look at some of the “typical” things you need to be aware of:

  • Your server is in one timezone, your users are in 23 others.
    Users don’t care what the time is at the site. They want things in their time.
  • Does your server even know your users timezone?
    You could do this with JavaScript, and send it to the server, but that’s a mess. Or send a timestamp to the client, and let JavaScript print it out. But that’s still messy.
  • Timezones aren’t obvious (think Indiana).
    Did you know some even use :30 such as UTC-3:30 for Newfoundland Standard Time.
  • Looking back in time (or forwards) is difficult (how many hours between X and Y accounting for leap years, and DST changes)?
    This is a mess, enough said. And just in case you have a formula, did you account for the conversion between Julian and Gregorian calendars? Don’t forget not everyone switched in 15 October 1582 / 4 October 1582. Going forward remember we’ll eventually have another leap day, since the Gregorian calendar isn’t perfect.
  • Your server observes DST. Does your user? When?
    Get the picture? Remember most states do, except for Hawaii (yea, that’s another Timezone) but Arizona doesn’t either, except for Navajo Nation. Again Indiana!
  • The Politics of Time…
    If you call UTC+2 Israel Standard Time, you upset visitors from Muslim nations like Egypt. Call it Central Africa Time, or Egypt Standard Time and your considered anti-semitic. Same goes for UTC+8, is it Chinese Standard Time or Hong Kong Time? Most avoid this by just listing UTCΒ±N. Unfortunately this confuses people, especially Americans who only refer to timezones as “Eastern” (UTC-5), “Central” (UTC-6), “Mountain” (UTC-7) “Pacific” (UTC-8). Note these American names aren’t so common in all of North/South America.
  • Daylight Savings Time for 2007+
    Then you have a bunch of clowns who voted for the Energy Policy Act of 2005, creating the Y2K7 bug. The idea was an extra hour of daylight in the evening would reduce electrical use. What they didn’t realize is that it cuts daylight from the morning. My guess would be a follow up bill may fine the sun for failing to provide adequate light, and eventually include economic sanctions. πŸ˜›

I thought a while back this could suck. Think about all the time/money that goes into updating and testing systems for these few extra weeks of DST. What a drag.

Swatch Internet Time was an obvious bust, but perhaps we could all just use UTC?

Categories
Programming Software

In Search Of The Epoch Child

The UNIX Epoch is 00:00:00 UTC on January 1, 1970. That’s essentially the beginning of time for UNIX based systems. You know, “In the beginning when Ken Thompson and Dennis Ritchie created the /usr and the /etc1.

I’m curious if anyone has tracked down someone (preferably a geek) who was born on the Unix Epoch. I guess we can’t be too exact since the question would be “are you born when your head is out, or when your butt is out? Can the cord still be attached or do you need to be unplugged?” or something to that effect.

All kidding aside, it would be interesting to know if anyone has come to the realization that they are the Epoch Child. I’m not sure (any calendar scholars can help me out here), but it seems the last child to have a time standard’s origin coincide with their birth may have been Jesus (and obviously any other child born that night). In that case, it seems they likely it was rounded as best they could (see Wikipedia discussion of Jesus’s Birth Year and Date).

Remember to account for the timezone. For example if your born in New York, that’s -5:00. So anyone feel like finding him/her? Obviously some proof would be necessary to prove your the epoch child.

It would also be interesting to find some others, but this seems to be the most interesting.

1 Yea, lame Genesis joke.

Categories
Accettura Media Hardware Programming

No pain no gain, lots of little stuff

I’ve coded quite a bit the past few days on an old project I’ve had sitting in the vault for some time. I really want to get this thing done soon. In the process I’ve gotten to write things that I’ve never really done before. Nothing quite as fun as a problem you’ve never approached before. Lots of code, little time… so much I want to get done, and I want it done yesterday ;-). I really want to push this thing into production quality soon (because that’s when things really become fun).

Oh yea… my foot hurts. Here’s a tip for anyone doing yard work this spring (well summer soon). When using a shovel, don’t settle for an old pair of sneakers, use boots. Stepping down on the top of the shovel to dig it into the somewhat hard ground today, I hit a large-ish rock, shifting the shovel, and causing my foot to hit it about the inner part of my foot, right under arch as well as slightly up the side, not bad, but no fun. Now I’ve got some minor swelling, and has me limping slightly around the house.

I’m starting to get that addict-like urge to do some upgrading around here… thinking about another stick of RAM for my Thinkpad (T43), to max it out, and a 1GB upgrade for my Mac Mini.

Categories
Personal Programming

Quieter Times While Coding

Since school is done (just waiting for grades, and a piece of paper to make me an official college grad), I’ve been poking on job sites. I’ve also been coding away for a few days now making good progress, on a yet to be announced project.

So things may be a little quiet.

Categories
Personal Programming

Really Busy

I’ve been really busy lately, hence posting is a bit light. I plan to pickup soon. I’ve been working on many things.

On a side note, switching programming languages (Visual Basic .NET, JavaScript, HTML, CSS, PHP, Perl) all in one day can be very confusing at times. I’ve been finding myself mixing up syntax quite a bit in the past few days. Yuck. For those wondering, Visual Basic is by far my least favorite.

Categories
Programming

Woke up this morning

Woke up this morning, went to my Enterprise Computing class (an amusingly basic programming class I was encouraged to take because it’s VisualBasic .NET), to do this silly problem where using a loop calculate how long it would take to pay for payment making wage per hour:

Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
        ‘ Declarations
        Dim payment, wage, totalWage, hours As Single
 
        ‘ Get input
        payment = Val(txtPayment.Text)
        wage = Val(txtWage.Text)
 
        ‘ Do the magic
        hours = 0
        totalWage = 0
        Do While (totalWage < payment)
            totalWage += wage
            hours += 1
        Loop
 
        ‘ Print the result
        lblResult.Text = hours
    End Sub

Yea, I feel really good. And yes, that’s supposed to be a loop. πŸ˜€ Well worth getting out of bed ;-). Got a good laugh out of coming to class to see that as the lab.

Categories
Mozilla Personal

Fun with Todo Lists week of 10/11

Every so often it becomes necessary to make a todo list public so I actually feel motivated. Without further delay:

  • Finally write that cheesy International Business Paper (4 pages double spaced, on pretty much anything) [4/14/05]
  • Finally write that History of American Art Paper (no clue how long, more complex, and really boring)… this is long term, not this week.
  • Commit a few reporter patches (simplify UI, figure out the rest of localization/prefs)
  • Get Mozilla building on my Thinkpad… this has been the most frustrating experience ever [4/16/05]
  • Start work on a Prototype UI for my Principles of Systems Design Project… may be long term. [4/14/05]
  • Ping Asa for some icon love, and see if the last patch I’m working on will make mozPod 0.1 (yea, I’m late again). [4/14/05]
  • More work on project aquarius
  • Add Firefox counter to blog (added 4/14/2005) [4/14/05]
  • A special little project πŸ˜‰ Those who know me well will be surprised I didn’t do this long ago. More info coming soon.
  • Another special little project (added 4/11/2005) [4/13/05]
Categories
Personal Programming

Paul Graham on College

Paul Graham, whose writing I greatly admire wrote an excellent bit on College recently. Being a college student myself, I found this to be by far the most interesting thing he’s ever written (and there’s quite a bit of competition there). A few things he wrote stick out in my mind:

The way to be good at programming is to work (a) a lot (b) on hard problems. And the way to make yourself work on hard problems is to work on some very engaging project.

Couldn’t agree more, and considering that I’m a geek, this one comes rather naturally. I didn’t need to make an effort to accomplish this one, it just happened for me. I guess that’s a good thing.

In fact, the amount of math you need as a CS major is a lot less than most university departments like to admit. I don’t think you need much more than high school math plus a few concepts from the theory of computation. (You have to know what an n^2 algorithm is if you want to avoid writing them.) Unless you’re planning to write math applications, of course. Robotics, for example, is all math.

Finally someone with credibility admits this one. One of the reasons I avoided the CS major was simply my dislike of math (and more importantly the dislike it has for me). It surprises people that I know how to program without a CS degree. It surprises people even more to know that I royally stink at math (just ask any former math teacher/professor I’ve had). Nobody believes that I can code because of this… well go figure I can.

The worthwhile departments, in my opinion, are math, the hard sciences, engineering, history (especially economic and social history, and the history of science), architecture, and the classics. A survey course in art history may be worthwhile. Modern literature is important, but the way to learn about it is just to read. I don’t know enough about music to say.

I agree with the one omission of a Business degree. It goes very well with a CS degree should you pursue one. Simply for the reason that just about whatever you do with your CS degree will take advantage (if not require) it. Take for example a corporate IT department. To advance, you’ll need a business background. A small company? You can bet a business degree will prove critical to your success. Startup? Hello, that is a business. Having a product is 10% of a successful company. The other 90% of it is a good business to support, continue, sell, market, manage that product. Take a look at the dot com bubble to see why Business ranks. To his credit he does mention economic history, which is also important. No matter what you’ll be involved in business if you want to succeed. Either with a startup, or with a corporation, understanding the business implications of decisions you make are essential to how you’ll be valued as an asset.

Of slightly less interest (at least right now) is the topic of Grad school, which I agree with. Though with a business degree, it has more merit than it likely will with a CS degree.

Overall a great (and recommended) read.

Categories
Programming Web Development

Coding with Timezones

I’ve got a bit of a complex question here for all you professional web developers:

Environment
Website targeting international users in all 24 timezones. Website based in US.

Problem Summary
How do you handle timezones correctly? What is the best strategy?

Problem Expanded
The particular problem I see is Daylight savings. I’ve seen several sites ask it based on GMT (-5 for New York for example). Now what that misses is Daylight Savings. Not everyone in all timezones participates, and each has a different time when they implement it. Keeping it in GMT isn’t exactly desirable either, since users need to know the time (in their timezone).

Anyone take on the issue? I’ve searched high and low, and yet to see a good solution. Most just leave it as GMT, or hide times (put it in very low contrasting color compared to it’s background for example).