Thursday, July 17, 2008

ODBC Missing Driver... 64 Bit

Note to self, if you can't find your installed ODBC-driver. It might be because you installed a 32-bit driver on a 64-bit system. Try looking in:
C:\Windows\SysWOW64\odbcad32.exe
That's all. 

Friday, June 27, 2008

Is w32codecs Freezing Your Ubuntu?

Wanted to play an Realmedia file? Installed w32codecs? Now Totem is freezing your Ubuntu Hardy? And by freezing, I mean: you can move the mouse, nothing else workse, no ctrl-alt-backspace, no ctrl-alt-F1.

Then do the following:
  1. Make sure you have gstreamer0.10-pitfdll installed.
  2. Install (if you haven't already) w32codecs.
  3. Execute the following three commands in the terminal:
    rm -rf ~/.gstreamer-0.10
    gst-inspect-0.10
    gst-inspect-0.10 pitfdll
  4. Try Totem again. Should work now.

Thursday, June 26, 2008

Muxtape Downloader Shell Script

I got to confess something: I love Muxtape! Did you know there is a userscript which lets you download the songs? It's not encouraged though...

Also: I've been trying to learn Shell Scripting. So I decided: why not make a Muxtape downloader. This is my first shell script (longer than a few lines). I've thrown together code I found at various site, and I find programming with bash... special. Currently: the script looks like this (warning: it's rotten to the bone!):
#!/bin/bash

#Fetch URL
wget -O /tmp/muxtape_html.out http://$1.muxtape.com

#Fetch titles
sed -n '/<div class="name">/,/<\/div>/p' /tmp/muxtape_html.out > /tmp/muxtape_titles.out
titles=`cat /tmp/muxtape_titles.out`
echo ${titles//<div\ class="\">/} > /tmp/muxtape_titles.out
titles=`cat /tmp/muxtape_titles.out`
echo ${titles//\ <\/div>/;} > /tmp/muxtape_titles.out

#Fetch kettle
egrep -o "Kettle.*" /tmp/muxtape_html.out > /tmp/muxtape_links1.out
sed -e 's,Kettle(,,' /tmp/muxtape_links1.out > /tmp/muxtape_links2.out
sed -e 's,);,,' /tmp/muxtape_links2.out > /tmp/muxtape_links.out

cat /tmp/muxtape_links.out | tr -d '[' > /tmp/muxtape_links.out
cat /tmp/muxtape_links.out | tr -d ']' > /tmp/muxtape_links.out
cat /tmp/muxtape_links.out | tr -d "'" > /tmp/muxtape_links.out

#Make arrays
titles=`cat /tmp/muxtape_titles.out`
IFS=";"
titlesa=($titles)

foo=`cat /tmp/muxtape_links.out`
IFS=","
bar=($foo)
compar=$(( ${#bar[@]}/2 ))

#Get songs
for (( i = 0 ; i < ${#bar[@]} ; i++ )) do
if [ $i -lt $compar ]
then
k='http://muxtape.s3.amazonaws.com/songs/'
a=${bar[$i]}
b=${k}$a
q="?"
k=${b}$q
e=${bar[$i+${#bar[@]}/2]}
z=${k}$e
echo ${titlesa[$i]}
wget -O ${titlesa[$i]}.mp3 $z
fi
done
Yuck! But it works, save it in script.sh, make it executable and then ./script.sh muxtape_username
This will save all mp3s. It took me an hour to figure this out, and I'm sure lots of you could do this much better. Still, it was cool to build... but in Perl or PHP I could've done this much quicker and cleaner. Oh and by the way: don't abuse this... Muxtape are friendly people.

Friday, March 14, 2008

Assembly Component {303994BA-6487-47AE-AF1D-7AF6088EEBDB}

I recently tried to install the Nokia Software Updater, but it gave me this error:

Error 1935. An error occured during the installation of assembly component{303994BA-6487-47AE-AF1D-7AF6088EEBDB}.

Quick research showed that this had something to do with MSXML 4.0. So I quickly went here and downloaded the msi installer. Which gave me the same error.

Apparently you have to force an uninstall of MSXML 4.0 SP0 or SP1, open a cmd-window and enter the following two lines:

msiexec /qn /x {35343FF7-939B-401A-87B3-FF90A5123D88} msiexec /qn /x {2AEBE10C-D819-4EBF-BC60-03BF2327D340}

Close and restart. Yes: you must restart (I hate it as much as you do).

Now install the msi. Then install the Nokia software. Everything works fine now.

Sunday, January 20, 2008

Javascript browser detection using DOM capabilities

Just found this, pretty handy!

// browser detection

var isIE = document.all;
var isIE7 = isIE && window.XMLHttpRequest && window.ActiveXObject;
var isIE6 = isIE && document.implementation;
var isgteIE6 = isIE7 isIE6;
var isIE5 = isIE && window.print && !isgteIE6;
var isIEDOM2 = isIE5 isgteIE6;
var isIE4 = isIE && !isIEDOM2 && navigator.cookieEnabled;
var isIE3 = isIE && !isIE4 && !isIEDOM2;
var isNS = navigator.mimeTypes && !isIE;
var isNS3 = isNS && !navigator.language;
var isNS4 = document.layers;
var isNS6 = document.getElementById && !isIE;
var isNS7 = isNS6;
var isNS71 = document.designMode;
var isNSDOM2 = isNS6;
var isDOM2 = isIEDOM2 isNSDOM2;

Tuesday, October 23, 2007

Game: Portal

Man, what a surprise this game was!

This is a great puzzle game, which you should also play multiple times (once with the commentaries).

You're a woman who wakes up in a cell inside a lab and presented with a portal that lets you walk out of the room and into another. With this gun you must solve lots of puzzles which get gradually harder.

Along the way, GlaDOS, an AI with a computerized female voice, guides you. GlaDOS is incredibly funny, and gets even funnier at the end. The whole game is actually hilarious, in a good way! The scripts and characters are wonderfully designed. The game is minimalistic in nature and all these little extras are just the topping of the... cake.

GlaDOS will lie to you, cute turrets who'll say "Where are you?" everytime you go into hiding, an amazing weighted companion cube, and cake. This game is full of little surprises. You just have to play it and experience its awesomeness!

"Cake, and grief counseling will be available at the conclusion of the test.
Thank you for helping us help you help us all."

Pros:
  • FPS puzzle game, with portals!
  • Great ending song.
  • Hilarious humor.
  • Unforgettable characters.
  • Minimalistic and focused nature, without ever becoming boring.
  • Where's my sequel?

Cons:
  • A tad short.

Now only Company Of Heroes: Opposing Fronts and Quake Wars remain on my list of games-to-play. But that's for later.

Game: Half Life 2 - Episode 2

Wow.

Half Life blew me away, again. I finished the game in one big long marathon session. Twice. The second time with the developers' commentary enabled - which I still love.

I'm not going to spoil anything, but I found the ending completely unexpected and fantastic. Also, Merle Dandridge's voice acting (Alyx) was incredible. When the credits rolled over my screen I just wanted to play Ep. 3 immediately. The game itself was great, with the return of old friends, and the introduction of new friends - and new enemies.

Just like episode 1, the game provides you with a companion (either Alyx or a Vortigaunt) most of the time.

Maybe I'll play Half Life 2, Ep. 1 and Ep. 2 in one big sitting soon...

Pros:
  • Story is great!
  • Characters to love.
  • Great voice acting.
  • Graphics are enhanced and still look amazing.
  • Cinematic physics - so cool.
  • Longer than the first episode.
  • Great sound track.

Cons:
  • Err, none?
  • Okay, maybe still too short ;).
  • Also: no new real weapons, I would love to handle a sniper myself (instead of the crossbow).
  • You might lose some sleep.

Game: The Settlers: Rise Of An Empire

Another quick review for this one. Not much to say about this game, I mean: it's Settlers. It's back, and it's 3d and cuter than ever :).

Pros:
  • Settler's back!
  • Game looks very nice.
  • Long and entertaining missions.
  • Happy atmosphere.

Cons:
  • Few bugs still around.
  • Needs quite a bit of system resources.

Game: Medal Of Honor: Airborne

I've been playing some games last weekend, Medal Of Honor: Airborne being one of them.

Basically it's just another WW2 FPS with nothing special. The drops at the beginning of each mission are pretty nice, and the levels aren't badly designed either.

The graphics look nice but were somewhat sluggish, how come this game needs so much resources when Half Life runs so nice in all its glory without a peep?

So quickly: pros:
  • The WW2 hype is almost over, so this game is nice if you just can't get enough WW-action.
  • Graphics look fine.
  • Level design.
  • Airborne-theme.
  • Non-linear misions.

Cons:
  • High system requirements.
  • Your weapons are difficult to handle, while the AI has no problems hitting you.
  • Gets boring quickly.
  • Not a real story.

Sunday, September 23, 2007

Some Articles

Saturday, September 15, 2007

SQL: Check Existing Rows Matching A Condition

Instead of this:

IF (SELECT COUNT(*) FROM Table1 WHERE ... ) > 0

use this:

IF EXISTS(SELECT * FROM Table1 WHERE ...)

Great tip provided by this article.

Wednesday, September 12, 2007

Programming Can Ruin Your Life

The application of programming specific processes and habits to the everyday is where peril lies. The same traits that make you a great programmer can make you an awkward, misunderstood and miserable human being.
Amazingly good read.

Monday, September 10, 2007

Game: Bioshock

I finished Bioshock a few moments ago. There's not much I will say about this game because it has been reviewed and analyzed to dead at other sites and by other people.

I can say though that this game is fantastic, both story- and graphic-wise. Also: it often scared the hell out of me.

There is one big downside with this game: the constant crashing. Maybe my configuration is getting old, but this game is actually running quite fine when it's not crashing.

It also could have something to do with Windows Vista. Here's how a typical game session goes for me.

1. After a while it became clear that I have to disable high detail shaders. This will cause the game to crash less with certain video cards.
2. Start Bioshock. "Bioshock.exe has stopped working and has to close." Start Bioshock. "Bioshock.exe has stopped working and has to close." (Repeat this one to ten times.) Finally I see the splash screen and the game loads (strange).
3. Play and enjoy.
4. A new area is coming up, save right before going to the next level. Exit.
5. Edit Default.ini (toy with the audiodevice, add a new D3DDrv, comment out FMOD):

;AudioDevice=FMODAudio.FMODAudioSubsystem
AudioDevice=D3DDrv.D3DAudioDevice


6. Start game again (don't forget to repeat step 2 a few times). Load my save. Go to next area.
7. Wait until area finished loading. When I don't use step 5, my whole system locks up slowly and the area never loads. Save. Exit again.
8. Edit Default.ini again, otherwise I have no in-game sound:

AudioDevice=FMODAudio.FMODAudioSubsystem
;AudioDevice=D3DDrv.D3DAudioDevice


9. Start again, load save, loads fine, continue from step 3.

But still, the game is awesome (but release a patch, quick!).

Also I want you to see the cinematic trailer if you haven't. Don't forget to pick up all the audio diaries in the game and listen to them, the story and characters are so great.

One final note: if you were wondering, I saved all the Little Sisters. After being presented with the first choose to either harvest or rescue them I was too moved not to save them (it was just a sad sight). So I got the 'good' ending. I was happy I did, I would've felt very guilty otherwise, especially after seeing the 'bad' ending (look on Youtube or play the Bink vids).

Pros:
  • Amazing story.
  • Great atmosphere.
  • Possibly best graphics seen in a game up to date.
  • Can be real creepy at times.
  • The music (both the grammophone music and the orchestral score are great).
  • Nice set of weapons, plasmids, hacks and more.

Cons:

  • You'll need a very high-end PC.
  • Game loves to crash.
  • The activation system-slash-copyright protection is a royal pain.
  • No multiplayer (not a real downside for me, but might be a pity for some).
  • The story is just a tad predictable at times.

And now I'm going to rip the music out of the fmod files :).

Friday, August 10, 2007

Scrolling Unfocused Windows

I've been looking for a way to do this for some time now: scrolling unfocused windows, in Windows. You can do it with a Mac (movie here) and on Linux. I became accustomed to it after prolonged Ubuntu-use on my laptop. (It's incredibly handy on lower resolutions too.)

So I posted a note (with replies) on Pownce...

So I'm using KatMouse now. Program is working perfectly fine, and was exactly what I had in mind.

Also: I'm beginning to like Pownce (much more than Twitter anyway).

Sunday, July 29, 2007

Simulating LIMIT with offsets in SQL

How can you do this (x is number of rows to fetch, y is offset):
SELECT * FROM my_table LIMIT x, y
(Mysql)

or this:
SELECT * FROM my_table LIMIT x OFFSET y
(PostgreSQL)

in a DBMS that doesn't support LIMIT statements (take Oracle for example).

In Oracle, you can use ROWNUM, which holds the current row number:
SELECT * FROM
(SELECT ROWNUM limit, * FROM my_table ORDER BY order_field)
WHERE limit BETWEEN x AND y
In SQL Server (>2005), you can use a similar trick, using the ROW_NUMBER function:
WITH ordered AS (
SELECT ROW_NUMBER() OVER (ORDER BY order_field) AS limit, *
FROM my_table)
SELECT *
FROM ordered
WHERE limit BETWEEN x AND y
When using another database (Access for example), you can use TOP when available:
SELECT * FROM
(SELECT TOP x * FROM
(SELECT TOP x+y * FROM my_table ORDER BY order_field)
AS innerT
ORDER BY order_field DESC) AS outerT
ORDER BY order_field
Or, another option:
SELECT TOP x * FROM my_table
WHERE order_field NOT IN
(SELECT TOP y * FROM my_table ORDER BY order_field)
Some databases don't allow TOP in subselects, so we have to use yet another method:
SELECT * FROM my_table outerT
WHERE
(SELECT COUNT(*)
FROM my_table innerT
WHERE innerT.order_field <= outerT.order_field)
BETWEEN y+1 AND x+y
ORDER BY outerT.order_field ASC;
Should that fail too, you can always do:
SELECT TOP x * FROM my_table WHERE order_field > z
with z the last fetched order_field value from the previous page.

You can also find a handy article on the IBM site describing how you can simulate row numbers.

Friday, July 27, 2007

Game: Jade Empire - Special Edition

So I picked up Jade Empire for the PC a few days ago. I was astonished because I didn't even know it was released for the PC. (I've been jealous of console owners who could play the game and then I even miss the PC release!)

So after I quick install I was ready to go. I was more than happy to experience a new Bioware-experience. As coincidence would have it, I had been playing a few Neverwinter Nights premium modules the days before just because I wanted a Bioware experience. (And no, KotOR 2 and NWN 2 just aren't the same.)

And the game didn't disappoint. I you haven't played it yet: you should. The whole story was fantastic. The characters were well though out, and the combat was fun without being frustrating (I didn't die a single time on the easiest difficulty level).

If you are a hardcore PC RPG gamer you will notice that this game is a tad linear. Of course there are quite a lot of side quests but you can't roam very freely. This seems to be a typical characteristic of more 'modern' RPGs, like Fable, or even Overlord. On the other hand, this also has pros: at least you don't get lost or distracted. Also: Fable could learn a few things from Jade Empire, this is how a console RPG should be done: it's all about the story and the atmosphere. The game is fun, quick to pick up and you don't have to manage your inventory and character every two steps while still keeping enough numbers, statistics and options for you to look at.

I think I'm going to rest for a bit now after this marathon-gaming-session. But I think I'm going to replay the game with another character later.

Let's hope that Mass Effect comes to the PC as well.

Pros:
  • Another Bioware classic.
  • Amazing atmosphere.
  • Great story.
  • Cool styles and techniques.
  • Original oriental setting of the game.
  • A right amount of side quests.
  • Well ported: no crashes, no control problems.
  • Graphics are still good.
  • Music.
Cons:
  • Camera misbehaves sometimes .
  • Leaves you wanting much more ;).

Tuesday, July 03, 2007

Game: Overlord

This game took me a little longer to finish: two days.

The game itself is actually pretty good but not that special. I had expected a bit more from it: being more evil for example.

Pros:
  • Nice story.
  • Minions.
  • Graphics are decent.
  • Sound is nice.
  • Maps and environments are awesome.
  • Will remind you of Dungeon Keeper (and Fable too).
Cons:
  • Not evil enough.
  • Very, very linear. No replay value, apart from the different endings (which you can watch anyway by installing RADTools).
  • Could do with a bit more spells.
  • Just needs more tweaking, Overlord 2 could be something really worth your while tho, so why not pick up this one?

Thursday, June 28, 2007

Game: Call Of Juarez

I started playing Call of Juarez today and... wait, I just finished it too.

All in all a nice game, I only had a small problem playing it on my computer, the game started with an Exception error. Installing the latest patch didn't help either.

I was ready to blame the copy protection (since those have been bugging a lot of games lately in my experience). But the no-dvd crack didn't help either. (It seems that official technical support people are giving those cracks to people who had problems. Makes you wonder...) There were a few other people with my problem too on the forums.

So then I tried the only other thing I could think of. I set the compatibility mode of the game to 'Windows XP'. If you have the same problem and are running Windows XP 64 bit, then give it a try, because after that the game started and worked perfect.

The game itself is actually pretty nice. Two playable characters, a mediocre story, a large environment, nice graphics, very fitting music and voice acting. Only the long stealth missions and platforming with Billy (one of the characters) got on my nerves. But the fact that you can play as an ass-kicking reverend afterwards is worth it.

So: pros:
  • Enjoyable action! There is slowmo.
  • Great music, good voice acting.
  • Two characters. Two gaming styles.
  • Great graphics (especially the maps, nature and towns).
  • Multiplayer is quite fun.
  • Original genre (well, we had Gun before tho).
and cons:
  • Doesn't really stand out.
  • Long stealth and platforming missions.
  • You'll need a potent machine to run it.
  • Few glitches (Windows 64 bit problem, see before).
  • Few map glitches (I managed to accidentally get to parts where I wasn't supposed to be - yet - and couldn't go back).

Thursday, May 24, 2007

Tumblr

I've had a Tumblelog for some time now. I absolutely love its keep-it-simple style. Updated almost daily. Go check it out at:

http://macuyiko.tumblr.com/

P.S.: if you want to run your own, I recommend Bazooka.

Tuesday, May 01, 2007

The Number

Wow! The Internet is going crazy about some random number (and it's not 23). Apparently, typing out an hexadecimal value will get you killed / deleted / censored / jailed / destroyed / raped / ignored / access to HD-DVD content. It goes something like: 09 F9 11 02. But it also has 9D 74 E3 5B in it. Maybe D8 41 56 somewhere too. C5 63 56 may or may not have something to do with it. I will give away that it ends with 88 C0 tho. Digg is going nuts. Moderators are constantly deleting any article about this number. They are even deleting irrelevant posts to cover up their censoring tracks. However, they seem to forget that this is the Internet.

Articles about The Number (growing):
Another article on rudd-o.

Also: Google is full with the stuff.

February 13th! Wired blog posts the key.

Reddit also seems to have no problem with the key.

Explanation about the key at Doom9.

igul222 also has a nice list about the number.

Let's see how this ends. I wonder how Mr. Rose will talk his way out of this. He'll probably will.

Update: this just in. Told ya :).