Wednesday, July 16, 2008

Hide and show contents of a div

One of the websites that I am maintaining during my dayjob was getting quiet cluttered on the right side. So I decided that all the logo's of possible banks should be hidden untill clicked on. I know this is possible, I just didn't know the right code from the top of my head.

However, Dustin Diaz's blog gave me the solution after a quick Google.

This resulted in the following code:

<script type="text/javascript">
function switchDiv(obj)
{
var el = document.getElementById(obj);
if ( el.style.display != 'none' ) {
el.style.display = 'none';
}
else
{
el.style.display = '';
}
}
</script>
<div id="whatever" style="margin-bottom:2px;"><a onclick="switchDiv('nameofdivtoshowandhide');"><img src="imageonwebsite" </a></div>
<div id="nameofdivtoshowandhide" style="margin-bottom:2px; display: none;"><img src="imagewithalllogos.jpg" </div>


This is definitely repeatable code, which I should save for future use.

Monday, April 21, 2008

Ajax: first experience

I haven't written in a while, but that doesn't mean I haven't been busy. Actually I have been improving my knowledge of both PHP and MySQL, picking up additional JavaScript knowledge on the way.

Everybody has heard of Ajax, or Web 2.0, nowadays. So naturally I tried to pick this technology up as well.

Coding everything manually proved to be quiet difficult, especially since my knowledge of JavaScript is so limited. Then I came across Xajax, which is a PHP based framework to create ajax-like webapplications.

I am working on a project right now where I will be using this framework, and hopefully the first version can be released soon.

Tuesday, March 11, 2008

Good PHP book

I think I should look into buying a good PHP book, since the Java book I bought helped me learn so much quicker then reading tutorials on websites. One book I came across, and am really considering, is: PHP voor het World Wide Web; ISBN10: 9043005452; by Larry Ullman.

Monday, February 25, 2008

Browser MMOG; Ikariam!

Last week I stubled on a online game, Ikariam. It is a complete webbased game, and therefor can be played on every computer with a recent browser. I would summarize it as a slower running version of Settlers. And with slower running, I mean the game time. For instance, upgrading a building takes from twenty minutes to a few hours. Of course for a webbased game this isn't a bad thing, since most people will play this when doing their work etc. So quickly login and start some things, and the go back to work....

Thursday, February 14, 2008

Update: Airforce

As posted before, I have applied to join our airforce. Before they let you start the training, the run you through multiple selection rounds. Right now I made it to the last two. They run sort of independant of eachother. This march 6th I will have to go to the Central Military Hospital to get some (X-ray)scans of my skeleton, brains and heart. I will also get an invitation soon to fly a few flights in a real plane. It will be sort of like the flight simulator which I had to do earlier, except that in the flight simulator you'd fly solely on instruments, and in the plane you will fly without instruments.
This will be done during 1 week in Portugal. I am looking forward to go there, and make my first hours in the pilotseat. And to see some nice parts of the town Evora offcourse...

The plane I will be flying is a Slingsby Firefly T67-M200. Looks like quite a nimble plane!

Thursday, February 7, 2008

New videocard, but which one?

Recently I finally made the upgrade to the dual-core era, but I decided to use the onboard graphics of the Asus M2A-VM HDMI motherboard. Based on the AMD 690G, with Radeon X1250 graphics, it basically supports everything up to DirectX 9.0c. And I didn't expect to do a lot of gaming.
However, recently I wanted to play a few games again, mostly try Call of Duty 4: Modern Warfare. And doing that on a 690G/X1250 is really not advisable. So I started looking at what videocard might be a viable option for me.

It should not be to expensive (so <= €100,-), preferably passively cooled, and be the fasted possible within those requirements. Now I have been very interested in the new Radeon HD 3400 / 3600 series. But until now I could not find decent benchmarks with both series included. Today I found those at Legitreviews.com.

I will definatelly skip the HD 3400 series, but I think the HD 3650 is really a viable option.

Monday, February 4, 2008

Ubuntu 8.04 Hardy Heron Alpha

Yesterday I upgrade my Ubuntu Gutsy install to the latest 8.04 Alpha (#4 I believe). First I was planning to do a clean install from a freshly downloaded ISO, but then I decided to see if an upgrade would work.

This turned out te be pretty easy. I haven't worked long on 8.04 yet, but have yet to encounter problems. I guess the upgrade went pretty smooth.

First edit your sourcelist:

sudo gedit /etc/apt/sources.list
replace gedit with your favorite text editor. I used gedit because I have no idea wether nano has an easy replace function. In the sources.list file, replace every gutsy with hardy. This will make sure that when you do the next apt-get update, it will connect to the hardy repos.

sudo apt-get update
sudo apt-get dist-upgrade

Now it will install everything which is needed to upgrade your current 7.10 install to the 8.04 alpha. After apt-get is finished, reboot et voila! You can now try the latest Ubuntu.