xiven.com stating the blatantly obvious since 2002

Archive

View: 2002, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, 2004, By category, Full index

Viewing entries for January 2003

Question: Does Google support pages sent as application/xhtml+xml?

Answer:

Google still lists my site but it doesn't have any details about its content, nor does it have a cache of it.  So the answer is:

Not really.

Posted: 2003-01-31 03:12:43 UTC by Xiven | Cross-references (0) | Comments (11)

This is optimising

Hideous code, the like of which you have never seen before and will hope never to see again:

UPDATE tech SET progress = GREATEST(progress - round(((assigned / 100) * (IF(user_id = 1,0,(IF(user_id = 2,162,(IF(user_id = 3,162,(IF(user_id = 4,162,(IF(user_id = 5,0,(IF(user_id = 12,0,(IF(user_id = 13,0,(IF(user_id = 15,165,(IF(user_id = 6,33,(IF(user_id = 21,123.75,(IF(user_id = 26,33,(IF(user_id = 28,27,(IF(user_id = 27,0,(IF(user_id = 29,0,(IF(user_id = 39,0,(IF(user_id = 44,32.4,(IF(user_id = 45,1069.36911,(IF(user_id = 47,277.2,(IF(user_id = 48,105.3,(IF(user_id = 49,196.04151,1)))))))))))))))))))))))))))))))))))))))))), 0) WHERE user_id IN (1,2,3,4,5,12,13,15,6,21,26,28,27,29,39,44,45,47,48,49) AND progress != 0 AND assigned > 0

20 updates for the price of one.

Posted: 2003-01-25 14:14:53 UTC by Xiven | Cross-references (1) | Comments (0)

So now, what is a conuery?

As noted earlier, our database access for Voidwars has been shooting through the roof with the number of queries reaching never before seen heights. Here's that graph:

Graph showing number of queries against time.  The graph clearly shows a steady and marked increase in the number of queries.

Database access with our web hosts is measured in conueries:

Conueries is a term we at DreamHost came up with to measure MySQL database usage. The word is a combination of connections and queries, as that is what the unit is derived from! Basically, the number of MySQL queries you have in a month, plus 25 times the number of connections you have is your total conueries for a month!

Trouble is, if we go over a certain amount per month, we get charged extra. Which is bad, especially when you're running a free game (amazingly, bandwidth is not a problem for us yet since we're only sending about 100MB of data per day).

We're already using persistent connections which reduces the number of database connections (the things worth 25x a query) that we make, by a very large amount. Now the problem is purely the number of database queries.

We're using JOINs wherever possible (ie. a lot) to reduce the number of queries needed and to improve general efficiency of the code, but it's not enough.

The reason for the large increase is almost certainly due to the rapid increase in the number of players that we had recently (until the game reached maximum capacity of 90). The main problem lies in the ticker. The ticker is a piece of code that executes once every 3 minutes and performs all actions in the game (executing ship orders, calculating resources mined/spent, increasing populations, calculating combat). It has been optimised in the past, but it would seem that it needs more work.

Not to worry though, we've spotted some places where we can improve things and GwieF will soon have it running much more efficiently for us (well we can't all work on it at once ;)). If it becomes necessary though, we may have to decrease the speed of the ticker (eg. make it once every 6 minutes). That wouldn't exactly be the end of the world.

Posted: 2003-01-24 16:37:22 UTC by Xiven | Cross-references (0) | Comments (2)

This looks ominous...

Voidwars database usage graph.

More details after Kam finishes eating. ☺

Posted: 2003-01-24 11:59:17 UTC by Xiven | Cross-references (1) | Comments (0)

Trackbacking across the universe

Since everyone else seems to be doing it, this weblog (damn I really need to think of a decent name for my weblogging software) now has Trackback support. Having implemented both Pingback and Trackback I can now say with certainty that Pingback is much nicer.

The main problem I have with Trackback is that the embedded RDF for autodiscovery is absolutely hideous to parse (even the example code given in the spec. falls down on several valid examples) and because you need a separate entry for each post, you need to make damned sure that you are looking at the right piece of RDF. Not to mention the fact that putting data that needs parsing inside a comment (<!-- -->) is just plain wrong.

Pingback is much more sensible: firstly all you need to look for is either an HTTP header or a simple <link rel="pingback"> tag; secondly, you send the permalink of the post you are linking to in your request so you don't need to have a different pingback URI for each post on your weblog.

Pingback also has a much better written specification, which explains everything very clearly with good examples. The Trackback specification leaves out many of the details (eg. How does the server find out which post you are referring to when you send a Trackback? -- answer: you need a unique trackback URI for each entry) and has several ambiguities (eg. url: The permalink for the entry. Which entry: the one I'm sending a Trackback to or the one I'm sending a Trackback from? -- answer: it's the latter).

All of this makes me wonder why Trackback appears to be more widely used than Pingback. The only technical advantage of Trackback over Pingback is the ability to send an excerpt of the document with the Trackback request. I can see how this can be useful (I don't use it personally), but it is not entirely impossible for a Pingback server to grab an excerpt from the source page should you wish to do so.

One reason I can think of is that many people seem to be very confused about Pingback:

...the key distinction being that trackbacks are client-server and pingbacks are peer-to-peer between servers. So [this software] could support trackbacks, but not pingbacks.

I hate to say this, but that is blatantly not the case. Pingback is just as much "client-server" as Trackback is. My code for Trackback and Pingback is very similar in both the client and server aspects (the only differences being in the format that the request is sent and in the method that the autodiscovery works).

Another reason why Trackback is quite successful is that a lot of people use Movable Type for their weblogs which of course comes with Trackback built in.

Ah well, I just hope this doesn't become another Betamax vs VHS scenario...

Posted: 2003-01-18 10:24:14 UTC by Xiven | Cross-references (0) | Comments (8)

Willow would never have approved

This is the best laugh I've had all day ☺ (via Aquarionics).

This text must be preserved for all time as an example of one of the worst possible things a web "designer" can do:

Welcome to The Buffy Network. It has come to our attention recently that a lot of visitors to this website do not have the correct setting on their computer when they try and access the site. For example, 0.82% of visitors are using Netscape - which does not support the kind of html coding we use. 2.10% of visitors dont have Java installed and/or turned on, Java is essential for some of the pop up windows we use. And 40.76% of vistors are using the wrong screen resoloution. Anything larger than 800 x 600 is too large, and the pages do not diosplay properly. Please try and use the right settings on your computer before entering the site, in order to make it look on your screen, how we intened it to look on ours. Thank you for visiting The Buffy Network. Please click 'Ok' to close this window.

which can be roughly translated as:

Welcome to The Buffy Network. It has come to our attention that we totally suck at web design. For example, 0.82% of visitors are using Netscape - it would be higher, but unfortunately, due to our aforementioned suckage with regards to web design, we've used a new type of html called "Microsoft is our bitch" which serves no purpose except to not work on other browsers. This is because other browsers are evil and the people who use them must be stupid. 2.10% of visitors dont have Java installed and/or turned on, Java is essential for some of the pop up windows we use. Pop-up windows are really really good 'cause they allow us to annoy the hell out of you until you go away and find a much better site. And no, we're not confusing Java with Javascript at all for they are in fact one and the same. And 40.76% of vistors are using the wrong screen resoloution. Yes there is in fact only 1 correct screen resolution; all other resolutions are evil, probably spawned by Satan himself. If you are using a wrong screen resolution you must change it immediately lest you be damned to live in the evil land of "accessiblity" for all eternity (if you're using a non-visual browser it's already too late for you). Please try and use the right settings on your computer before entering the site, in order to compensate for our incompetence. But remember, it's not our fault, it's yours!. Thank you for visiting The Buffy Network. If we haven't scared you off yet, wait till you see the rest of the site (view our source code at your peril). Please click 'Ok' to close this window.

Yes it is very sad that people exist who do things like that, but you can't help but be amused by the sheer ignorance and stupidity involved.

Posted: 2003-01-16 17:09:32 UTC by Xiven | Cross-references (1) | Comments (1)

What the cat says, goes

After some pretty thorough studying of the XHTML 2.0 working draft and after reading Hixie's thoughts on the matter I have come to the conclusion that, despite Mark's earlier tantrum on the issue, and my initial misgivings, XHTML 2 looks like a vast improvement over the current XHTML and HTML specs.

My personal favourites are as follows:

This is by no means a complete list of the good things about it. Those were just the things that really caught my attention.

I still have concerns about the ease of making the transition to XHTML 2 though. The early adopters (like myself - I fully intend to start using it the day after the final spec rolls out) are the ones who are going to "get it", since we'll have to provide XHTML 2 and legacy versions of the same documents until everyone's browsers support it (ie. till about 2023). This will be considerably more difficult than providing XHTML 1.1 and HTML 4 versions of the same document like I'm doing now, because of the large amount of structural changes that will be needed (specifically with regard to the <section> and <h> elements). Yes, I know no-one's forcing me to use XHTML 2 (just like no-one's forcing me to use XHTML 1.1 now), but I'm afraid that's just the way I am...

Posted: 2003-01-15 14:32:49 UTC by Xiven | Cross-references (1) | Comments (0)

Happy bunnies

Hell, find me another site that even uses XHTML 1.1 - Mark Pilgrim. Hello! Right here! ☺

He's right though, migrating to XHTML 2 looks like it's going to be damned near impossible. I'll probably still adopt it though, I clearly enjoy the pain.

Posted: 2003-01-13 15:38:24 UTC by Xiven | Cross-references (1) | Comments (1)

It looks exactly the same!

I just completely rewrote about 90% of the code behind this site. Doesn't look very different though does it?

Well to begin with it's my first attempt at writing Object-Oriented PHP. I only have 4 classes in this code (class Page, class HTMLpage extends Page, class CSSpage extends Page, class RSSpage extends Page) but it has at least been a "learning experience" for me.

Secondly, the weblog now sends various <link> elements which allow navigation of the weblog using Mozilla's (or Opera's) Site Navigation toolbar.

Thirdly, the weblog navigation itself has been simplified (it no longer uses 4 separate forms to do the job) which should help accessibility a bit.

Finally, as before, if this site detects that your user agent (browser) supports XHTML (with a Content-type of "application/xhtml+xml") it will send the page as XHTML 1.1. However if it detects that your browser does not support XHTML, it will instead send the page as 100% valid HTML 4.01. I'm fairly confident that this is the only weblog that does this (feel free to prove me wrong on this). Whether it was actually worth doing is another matter altogether ☺.

Note that you can force the site into either XHTML or HTML mode by adding a GET parameter of "force=xhtml" or "force=html" respectively.

Posted: 2003-01-10 07:41:40 UTC by Xiven | Cross-references (3) | Comments (3)

Another day, another browser

So Apple went and released their new web browser ("Safari").

Thanks to Mark's Safari review and Safari information for web designers I was able to find out that my website was broken in Safari as it would attempt to download it instead of displaying it (identifying itself as like Gecko was bound to cause problems and IMHO very stupid) but it should now be working fine. At least that's the theory, because like with Mac IE and Chimera I have absolutely no way of testing this without actually buying a Mac. Which is somewhat annoying.

Other than the various CSS problems which will hopefully be sorted out soon, there has been a lot of praise for this new browser. And Apple made it so it must be good (somewhat of an "in-joke", please ignore).

Posted: 2003-01-08 10:33:05 UTC by Xiven | Cross-references (0) | Comments (2)