Categories: "Full Stack Dev & Design"

IE 6 not refreshing

Just stumbled upon yet another funky IE6 "bug" (if I may say so...

When you want to automatically refresh to another page, you send a header that looks something like:

Refresh:0;url=http://blah.blah.blah

The funky thing is that if that header exceeds the maximum size of 263 characters, IE won't do the refresh!

Okay there's got to be a limit, but why so low? And why "263" ??

No need to say, auto refreshes work fine in Firebird with headers much longer than that.

I guess this is why you still need to put some dirty message underneath like 'if nothing happens, please click here! :/

PS: Please don't tell me to use a Location: instead. This would make it impossible to set cookies.

Introducing i18n and l10n

When you develop a piece of software or a website up to a certain point, there comes a time when you try to reach an international audience.

No doubt your first move will be to provide an English version of your software or website.

However, you will soon realize this is not enough. Of course, many people do understand English to some extent; but you have to realize how painful it can be for them. Maybe you don't even realize how easily you can understand English compared to the average. Of course, if you are yourself a native English speaker, you need to try and imagine that every software you use comes in French or German by default! How would you feel about that? :P

Furthermore, you may have spent some time on making your software or website accessible. Users can now change the font size and enhance contrast if they have trouble reading those lines of funky rendered text... That's fine... but what's the use if their problem is not with the formatting but with the language!?

Full story »

Date Arithmetic With MySQL

MySQL offers pretty useful functions when you want to manipulate days:

  • You can add a time interval to a date value with ADDDATE() or DATE_ADD()
  • You can subtract a time interval from a date value witf DATE_SUB()
  • You can find the interval between two dates with  DATEDIFF()

It's often easier to compute this stuff directly in MySQL rather than in PHP.

For all date functions see the MySQL Manual.

IE, CSS & TEXTAREA hell !

We used to have an article here about styling textareas with CSS in IE. It was one more post on the web about one more bug in Internet Explorer 6. It has been fixed in between.

In case you still need this, we had a workaround which consisted of applying width:100% on a div around the form, like this:

<div style="width:100%">
  <form>
    <label for="t1">Try to type in here:</label>
    <textarea id="t1" style="width:100%">Try to type here!</textarea>
  </form>
</div>

Web application caching

Blogs, as most current web applications, need to address the server-side caching issue in order to reduce webserver load.

It looks like most people are quite happy with caching static versions of their pages for some defined amount of time. This method has often been called something like "half-baked/half-fried" in reference to the long running baked (static) versus fried (dynamic) discussion.

I'd actually call it "baked on demand"... but regardless of what name we use, I would not be satisfied with this.

I have actually done some experiments caching my blog homepages which is enough to significantly reduce load, but this really makes them too static for me. I do want to log some stuff in realtime, I do want new user comments to show up instantly, and most of all: I do want the page to be customized for each user: display new posts since last visit, display his personal choice of categories, etc... Caching a whole page for every possible combination seems plain stupid. (And it is! :>> )

Actually, the only smart caching mechanism one can be satisfied with in high-end web-applications is block-caching. As a matter of fact, a web page can actually almost always be considered as an assembly of different blocks. Some are static, some are dynamically updated several times a day, some are related to the user himself and some are so dynamic they change everytime the page is displayed, no matter what! By caching each of these blocks individually when it makes sense and rebuilding only those necessary at a given time, you can then reconstruct your whole page dynamically significantly faster than if you had to reconstruct all blocks from scratch every time.

And there you have it: performance and functionality. Yeah, Okay, I know... it's also much more complex to implement than any other caching mechanism... ;D