Blogs

Embedding a list of your YouTube videos into your website

Posted February 16th, 2009 by Maarten

I recently found out it's quite easy to create a page on your website showing your own YouTube videos, which automatically displays new videos as you add them (provided you have basic knowledge of PHP). My YouTube page is right here on my website. You could create the same page as follows:

  • Download an RSS parser for PHP. I used Magpie RSS: http://magpierss.sourceforge.net/. Read their documentation to set up the parser. Amongst other things, a writable cache folder is needed.
  • Create a PHP file which will generate the list.
  • Optionally, create a PHP file which will display a YouTube video player.

Files with the PHP code can be found at the bottom of this page. To view them on screen right away, click the images below. I am sure this code can be greatly improved, but at the moment this is working just fine for me.

Code for the list page:
PHP code for YouTube video list

Code for the player page:
PHP code for YouTube video player

Note I added the fmt%3D22 suffix to the parameters for the embedded player, this will show videos in HD if possible. Warning: the videos will not load if this suffix is added while the quality is actually lower. Use fmt%3D18 for high quality and stereo sound, or no suffix if the quality is even lower than that. Be sure to take a look at the div tags and replace their style (including size) attributes to create a look which suits your website, or add the CSS style to your CSS file.

Be aware that the RSS file doesn't get updated every few minutes, but within an interval of a couple of hours. This means newly uploaded videos on YouTube will not be visible immediately.

Playing Need for Speed III with Wine

Posted August 29th, 2008 by Maarten

I recently found out that it isn't too difficult getting my favourite racing game, Need for Speed III, to run with Wine.

My current installation is Slackware Linux 12.1 with Wine 1.0 from SlackBuilds.org. My system supports 3D acceleration, so I compiled Wine with OpenGL support (as is the default in the SlackBuild script).

  1. Execute winecfg and set the Windows version to 98. Add your CD-ROM mountpoint to the list of drives in Wine. I used drive letter D.
  2. Mount the Need for Speed CD-ROM or image.
  3. Execute /SETUP/ENGLISH/SETUP.EXE, or choose Spanish if you prefer. Click through the setup options as you would normally. I chose the "full installation" option. There should be no errors during the copying of the files to your hard disk, if there is, try to copy the files manually. There may be an error like Could not get 'HardWareKey' value at the end of the installation, which can be ignored. At this point the game can be run by executing WINEDEBUG=+relay wine nfs3.exe -d3d0 from the directory to which the game was installed. This way the game will also use 3D acceleration, limited to a display size of 800x600. Note: executing wine nfs3.exe will result in the game complaining about corrupted files.
  4. To get the game to use a display size of up to 1152x864, the file d3da.dll needs to be patched and renamed to voodoo2a.dll as is explained by Robert Schuster in the Wine AppDB. This will only work if you have the exact same version of the file. I've attached the full file at the bottom of this page to save you some trouble.
  5. Now the game can be started using WINEDEBUG=+relay wine nfs3.exe -voodoo2. At this point I was able to play the game without major trouble, though it does tend to get stuck after finishing a race sometimes.

Installing Slackware Linux on a Shuttle XPC

Posted August 16th, 2008 by Maarten

Shuttle XPC containing Slackware Linux

It shouldn't be necessary to write an installation guide for a Shuttle XPC since they are made to support Linux kernels. I got a SN68PTG5 (Glamor Series) model, which comes with an AMD processor and an NVidia card (GeForce 7050 PV / NVIDIA nForce 630a which has HDMI/DVI output), a SATA disk drive and plenty of memory. I'm writing this down here anyway to inform anyone who might be interested in buying it, that it works fine with Linux. I installed Slackware Linux 12.1 and a recompiled version of the default 2.6.24.5 kernel on it. I used the proprietary NVidia drivers, version 173.14.12.

At first I gave KDE 4.1 (Slackware packages by Robby Workman) a go. It looked really pretty, had some interesting new functionality, but I decided to skip it for now because a number of my favourite packages of KDE programs weren't available for KDE 4 yet. There were also a number of strange bugs, such as empty message dialogues (blame may lie with one of the following: the Slackware packages, the NVidia drivers or this KDE 4 release). I had hoped to use the new 3D effect enriched KDE 4 desktop, which worked for the most part. But as is known, some of the NVidia cards don't work well with KDE 4 at the moment. Other XPC models which contain Intel graphics cards probably function properly, since their drivers are released licensed as open source. The only thing I noticed was some occasional flickering of certain bars (those of minimised windows in the taskbar or WM buttons on the top-right corner of windows), but this was another factor which made me go with an alternative for now.

My alternative was the default KDE 3.5.9 release which comes with Slackware 12.1, enhanced with Compiz Fusion, which at the moment still outdoes KDE 4's 3D effects greatly. View a short demo below (flickering is only present in the recording).

Please Download Flash player to view this video.

Divided they stood, together they fell

Although China had been ahead of Europe in technological development for centuries in ancient times, Europe eventually caught up and outdid China. The causes can be retraced when comparing maps of the two regions.

Europe is home to a large number of significant peninsulas and islands, such as the British isles, Scandinavia, Denmark, Iberia, Sardinia, Sicily, Italy and Greece. At the same time the continent is divided by mountain ranges such as the Alps and the Pyrenees. As a result Europe was largely fragmented into a lot of independent states which were strong enough to defend themselves and keep their own languages and cultures. The natural barriers on the continent were enough to help divide the states, but they didn't hold back the knowledge of new technologies. This meant that when one state would disregard or ban a certain technology, another would adopt it and eventually the first state would have to adopt it as well to prevent lagging behind (and thus risking to be conquered).

For China the case seems to be the opposite because its coast is hardly indented, its rivers are much wider than Europe's (and thus provide an easier means of transportation). For this reason China's regions were united early (largely because of conquest). Now, when a technology was rejected inside China by whomever its leader at the time was, the whole of China would adhere to it and there were no other states which would have forced China to readopt it.

This is one of the many interesting conclusions Jared Diamond draws in his book Guns, Germs and Steel.