Monday, September 8, 2008
Safari kicks ass, again
Sometimes, while at home, I really miss working so I bring work to home . So, this time was the turn of a cross-browser JavaScript madness, the problem manifests like this:
I didn't code that so I had no idea of what was causing the problem so I asked the guys working in that project to email me a static version of the page so that I had something to fill my evening with.
Besides the JavaScript in that page is painfully awful (I'm sorry guys, I had to say it) I managed to isolate the piece of code that was causing trouble. Many of you geeks might already be blaming some obscure for(;;) over every single element, or a diabolic recursion; well my friends this is not the case, or at least the for(;;) is not where you think it is, read on.
The offending code was merely a dozen of document.getElementById() calls. But wait, think about it, getElementById in 20.000 lines worth of elements, that's something we should handle more efficiently, well yes and no. Yes, you should narrow your element "universe" and work with subsets as much as you can, and also use CSS selectors to get your target. And No because the browser's engine could do us the favor of optimising it, can't it? That seems to be the case for Safari, whose performance is not affected *at all* by this experiment, and remains as snappy as always. Next in the podium is Firefox, whose performance degrades slightly, regarding the button state change, but fails terribly at the very beginning when it almost hangs up while loading the page. At the bottom of the podium (if any) there's IE6 which fails in every single aspect, and degrades much more with a much lesser number of elements.
Very well then, what have we learned with this? You have to code well, don't trust the browser's engine too much, Firefox is really good but it still has some issues and that IE6 sucks at rendering web pages and executing javascript code.
I just wanted to share my findings on this noble area of knowledge. Your comments are more than welcome.
Oh god, I really need a pint right now, make it a brown ale please.
There's a grid, big one, in which each cell has 3 image/buttons, each image has 2 states and they are exclusive, as in Low, Med, Hi, get the picture? Well, when the grid gets big (my HTML file right now has about 20.000 lines) performance goes down a lot, that means that when a user clicks a button the state change takes a noticeable second to happen, in IE 6 and 7.
I didn't code that so I had no idea of what was causing the problem so I asked the guys working in that project to email me a static version of the page so that I had something to fill my evening with
Besides the JavaScript in that page is painfully awful (I'm sorry guys, I had to say it) I managed to isolate the piece of code that was causing trouble. Many of you geeks might already be blaming some obscure for(;;) over every single element, or a diabolic recursion; well my friends this is not the case, or at least the for(;;) is not where you think it is, read on.
The offending code was merely a dozen of document.getElementById() calls. But wait, think about it, getElementById in 20.000 lines worth of elements, that's something we should handle more efficiently, well yes and no. Yes, you should narrow your element "universe" and work with subsets as much as you can, and also use CSS selectors to get your target. And No because the browser's engine could do us the favor of optimising it, can't it? That seems to be the case for Safari, whose performance is not affected *at all* by this experiment, and remains as snappy as always. Next in the podium is Firefox, whose performance degrades slightly, regarding the button state change, but fails terribly at the very beginning when it almost hangs up while loading the page. At the bottom of the podium (if any) there's IE6 which fails in every single aspect, and degrades much more with a much lesser number of elements.
Very well then, what have we learned with this? You have to code well, don't trust the browser's engine too much, Firefox is really good but it still has some issues and that IE6 sucks at rendering web pages and executing javascript code.
I just wanted to share my findings on this noble area of knowledge. Your comments are more than welcome.
Oh god, I really need a pint right now, make it a brown ale please.
Particle physics is getting cooler
If your senses have detected a sudden explosion of nerd activity, this might be the cause. The LHC is getting even closer to its operational status.
From the engineering point of view, all the magnets and most circuits must reach a superconducting state only possible at extremely low temperatures -2 kelvin and lower-. So that's the big news, the LHC is cold and almost ready for the first experiments which are expected to take place on 10th Sept., yay!
Why is this cool? Because it's the biggest and most important experiment(s) in the history of mankind, period.
If you've never heard about the LHC before I invite you to browse their fine website.
From the engineering point of view, all the magnets and most circuits must reach a superconducting state only possible at extremely low temperatures -2 kelvin and lower-. So that's the big news, the LHC is cold and almost ready for the first experiments which are expected to take place on 10th Sept., yay!
Why is this cool? Because it's the biggest and most important experiment(s) in the history of mankind, period.
If you've never heard about the LHC before I invite you to browse their fine website.
Saturday, September 6, 2008
1 carry-on item + 1 personal item + mum's scrambled eggs
Reading this post took me back in time a year and a half ago when I had to spend some time working in Glasgow, Scotland (aye mate, wundrful plaice).
I like to think of myself as an "easy traveler" because I kind of tend to get used to different cultures and usually enjoy the process, so when I read the above post my first thought was: "Well, some people just miss home sweet home, and some don't", but after a while I realised that is not the case at all, exhibit no. 1:
So, even when I wasn't actually missing anything I really liked to have a little something from back home, in this case breakfast and ham and cheese sandwiches where tokens from home while being far, far away.
I like to think of myself as an "easy traveler" because I kind of tend to get used to different cultures and usually enjoy the process, so when I read the above post my first thought was: "Well, some people just miss home sweet home, and some don't", but after a while I realised that is not the case at all, exhibit no. 1:
After a couple of weeks of living as a proper McPereyra in a flat in front of the Glasgow Park, every morning I tried to have a proper british breakfast, that is, if there was enough time: eggs, bacon, sausage and even some haggis, however, if I was running late -as was often the case, some habits will live with us forever- I used to buy a couple of donuts buns, or a scottish pie when I was feeling a bit more suicidal. Anyway, this might sound like a bit too much, or something you can't get used to but I did somehow. Most argentinians can't live without decent meat, mate and dulce de leche for long periods of time.
However, I went on vacation and my first destination was Paris, it was there where it happened: I actually got emotional when I got served for breakfast: (Proper)Coffee with milk, croissants, toasts, butter and marmalade, 'twas just like being at home.
So, even when I wasn't actually missing anything I really liked to have a little something from back home, in this case breakfast and ham and cheese sandwiches where tokens from home while being far, far away.
Coca-Cola® OpenSource
Coca-Cola® -or Coke® for some of you- has for long time been one of the most popular soft drinks out there and many have fantasised about beholding its might formula. Well, now you can at least have a glance at Coca-Cola's GPL version here. I found this while reading through my subscriptions so credit for the fine findings must go to this guy.
I'll probably continue buying my coke at the local market, or not buying it at all, but it's nice to know that you can go opensource with it too :D.
I'll probably continue buying my coke at the local market, or not buying it at all, but it's nice to know that you can go opensource with it too :D.
Thursday, September 4, 2008
Good boy, good boy...
Well, - as expected - Google came to its senses and retracted from their crazy EULA, that's it, here's the full story.
Wednesday, September 3, 2008
Don't cry you nerdy baby!
About my post about Chrome's license, don't cry! this is anything but new! that license applies to most Google applications, such as Gmail, GDocs and so on... so they've already done stuff to you and you liked it!
Subscribe to:
Posts (Atom)