21. febrúar 2007

Update troubles....

For some unknown (possibly stupid) reason I decided to update the fink package manager today to a newer version. After a painstakingly long update process (needed to compile the whole thing on my machine) I discovered to my horror that I couldn't run any of the terminal programs. The only thing that happened was the printout of this error:
Reason: Incompatible library version: tar requires version 6.0.0 or later,
but libiconv.2.dylib provides version 5.0.0
(Was trying to run tar)

So after some digging around I discovered that a conflict existed between this libiconv.2.dylib file I (for some reason) had in two separate locations on my machine.
One was at: /sw/lib
ls -all /sw/lib/libiconv.*
1270620 Feb 21 15:06 /sw/lib/libiconv.2.3.0.dylib
20 Feb 21 15:06 /sw/lib/libiconv.2.dylib -> libiconv.2.3.0.dylib
20 Feb 21 15:06 /sw/lib/libiconv.dylib -> libiconv.2.3.0.dylib
804 Feb 21 15:06 /sw/lib/libiconv.la
The other was at:
ls -all /usr/lib/libiconv.*
    16 Aug 19  2005 /usr/lib/libiconv.2.2.0.dylib -> libiconv.2.dylib
987544 Oct 3 11:55 /usr/lib/libiconv.2.dylib
20 Aug 19 2005 /usr/lib/libiconv.dylib -> libiconv.2.2.0.dylib
786 Sep 11 22:48 /usr/lib/libiconv.la
Asking otool (man otool) to list the names and version numbers of the shared libraries that the object file uses reveiled the following:
otool -L /sw/lib/libiconv.2.dylib
/sw/lib/libiconv.2.dylib:
/sw/lib/libiconv.2.dylib (compatibility version 6.0.0, current version 6.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.7)
otool -L /usr/lib/libiconv.2.dylib
/usr/lib/libiconv.2.dylib:
/sw/lib/libiconv.2.dylib (compatibility version 5.0.0, current version 5.0.0)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.0.7)
There is indeed a discrepency between the versions of the two libiconv.2.dylib files. So what did I try? Ofcourse simply renaming the old version to a backup filename and creating a symlink to the new updated file in the /sw/lib directory. Simple right?

Wrong! This had to be one of those times when I make a typing-error and don't double check it. So I successfully created this symlink in the /usr/lib/ directory:
/usr/lib/libiconv.2.dylib -> /sw/lib/libconv.2.dylib
Notice the missing "i" in the target filename!

So after a hopefull restart I discovered to my horror that OS X was permanently stuck on the loading screen (apparently this library is used for some sort of character set conversions, don't ask). So, I was stuck. Couldn't log into my machine to correct the problem. Thank god I have a lot of higly skilled co-workers, one of which suggested that I'd try booting into OSX in single-user mode (omg, always learning something new!). So that gave me access to local computer through a simple the shell prompt. After some fumbling with unlocking the file-system (tip: 'fsck -y' then 'mount -uw /') I managed to undo my changes and reboot back into my normal system and by fixing the small typo and recreating the symlink, everything worked just fine.

A rather boring story I hope you agree, but a nice way of learning how to do a "safe-mode startup" on a Mac and re-mounting a read-write file-system.

Have phun kids :)

9. febrúar 2007

A worthy reminder...

Computer science is no more about computers
than astronomy is about telescopes.
--Edsger Dijkstra.

24. janúar 2007

Today's Quote

"We built a radio just like the books specify,
but it did not play music...

[Only later did we learn that] the music was in the waves,
not in the radio."

-Zor and YenDor, R.U.R. (Dr. Rosalind Picard)

22. janúar 2007

It is unscientific to believe in humans...

Found a wonderful dialog that Dr. Picard presented at MIT in 1997. If you have 10 minutes to spare, check it out :)

Machines That Can Deny Their Maker

Rosalind W. Picard

The following dialogue was presented as part of the lecture "Toward Machines That Can Deny Their Maker," given at the MIT Course "God and Computers" by Rosalind W. Picard during the fall semester 1997.
 
The dialogue was inspired, in part, by the 1921 play of Karel Capek, entitled "R.U.R.," which stands for Rossum's Universal Robots. This play is where the word robot originated, from the Czech "robotit," which means "to drudge." In R.U.R., humans have figured out the secret to making robots that are emotional and alive. However, the robots can only live for 20 years. Afterward, they expire (die.)
 
The robots in this dialogue share the following features with those in R.U.R.: They are affective computers, with an extensive set of emotional abilities. They do not know how to make themselves, nor do they know how to prolong their existence beyond 20 years. They do not have the "secret recipe" that is what gave them life. But, they have the desire to find it.

17. janúar 2007

Ch-ch-ch-ch-Changes...

Mucking about on Youtube is simply fun :)

Was searching for Bill Gates keynote at the CES this year (since they can't webcast it properly for non-windows browsers). Just wanted to witness the awful catastrophe I thought this keynote was with my own eyes.

Finally found all the parts of Mr. Gates keynote and forced myself to watch most of it ( Part 1 and onward). When comparing this keynote to the one held by Steve Jobs earlier this year at WWDC 2007 and last years WWDC 2006, it was simply dreadful. While Apple's CEO talked in moderation with lots of visual aids and actually demo'ed the technology and enhancements that he was talking about, microsoft's CEO talked in (at times) excruciating length about how their new flagship OS, Windows Vista, provided "interconnected device experience", how "intuitive and simple" their UI and navigation and how innovative the infrastructure is (honestly, what does that mean? and why do the users care?). Why not simply show it? Lengthy dictator-like sermons get tired really fast. Since it's so simple and intuitive, show it.. the users should get it right away right?!

It was simply sad to watch, how should the users trust Windows Vista enough to use if the developer, microsoft, is to afraid to show and demo its features live? Simply sad...

Also a historical stroll through bright and dark times at Apple watch these videos:
1983 Apple Keynote-The "1984" Ad Introduction
Macworld Boston 1997-The Microsoft Deal
Apple WWDC 2006-Windows Vista Copies Mac OS X
The Boston 97 event was just excruciating to watch, although Mr. Jobs rightly pointed out that "For Apple to win, Microsoft doesn't have to loose". I however had a hard time not laughing out loud when Jobs announced that "The era of setting this up as a competition between Apple and Microsoft is over as far as I'm concerned" especially after watching the third video in the list. It's good to know that Apple and Microsoft (and others) are still competing, keeps us all healthy :)



The bottom-line, I honestly don't think I'd accept a job offering at microsoft at this point. I however would love the opportunity to work with Apple.

What closed the deal and finally won me over? It's the 15 minute long commencement speech that Steve Jobs gave at Stanford University in 2005. This is a man I want my work to impress. If you only watch one video, watch that one.

4. janúar 2007

Rotating a matrix CW/CCW in Python

Just for those of you who are wondering, like I was :)

import sys, os

def rotate( indata, height, width, rotate_ccw ):
outdata = []
for col in range( width ):
newrow = []
for row in range( height ):
if( rotate_ccw ):
newrow.append( indata[row][(width-1)-col])
else:
newrow.append( indata[(height-1)-row][col])
outdata.append( newrow )
return outdata

#Test the rotation
test = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]

print test
print "Rotate CW"
rotated = rotate(test, 3, 3, False )
print rotated
print "Rotate CCW"
print rotate(rotated, 3, 3, True )

In under 15 minutes, hurray for Python!

2. janúar 2007

I am the ROBOT!

For those of you who might be interested, I've finally posted the first (bare bones) version of my new pet-project project web page.


Visit: Rob the Robot Project Page


I still have to update the already completed phase pages (phase0 and phase1) with images, blueprints and code but all in good time :)

Meanwhile, happy new year!
I've got a good feeling about 2007... It's gonna be great :D

24. desember 2006

"Tilvalin jólagjöf 1.999 kr." (stendur merkt)

Hagkaup er með svarið, alveg tilvalið!


Gleðileg jól öll sömul
Merry Christmas everybody
:D

4. desember 2006

jesús...

Googlism for: sverrir

sverrir is one of a group of international and world
sverrir is the most acute actor i've ever met
sverrir is "epitaph" a collection of icelandic folk songs with a medieval ambience
sverrir is a third year student in business administration and he´s the chairman of mágus
sverrir is de lammeren maar gaan scheren want die zet'ie nu toch niet meer buiten
sverrir is found in the name of sverrir sigurdarson


Og Signý hélt að hún hefði verið með ömurlegt google-thingy... holy crap! This sucks monkey balls...

Hvað á þetta eiginlega að þýða:
"sverrir is found in the name of sverrir sigurðarson"...
barmafullir bakpokar batman.. þetta sökkar feit!

Finndu þitt googlesim (og vertu fyrir soul-crushing vonbrigðum)


Edit:
hihi.. þetta er fyndið:

30. nóvember 2006

An eye for an eye....

Even now in heaven, there were angels carrying savage weapons...





An eye for an eye
makes the whole world
blind...

24. nóvember 2006

Priorities, indifference and irresponsibility

This story was posted recently on slashdot.org following the shooting by the troubled German youngster from Emsdetten.

Bret540 writes:
"A Reuters news story reports that German lawmakers are considering a crackdown on 'violent computer and simulated war games' because a youth decided to attack other students at his school. The young man was apparently already under police consideration for weapons-related violations, and was described as 'someone with no friends.'"

From the article:
"Wolfgang Bosbach, the deputy head of Chancellor Angela Merkel's Christian Democrats (CDU) in parliament, said it was time to consider banning games that simulate wanton killing. 'We need effective guidelines to protect children from exposure to different types of media, but we don't need (simulated) killer games that can lead to brutalisation,' Bosbach was quoted on the Netzeitung news Web site as saying." InfoWorld has more details on the event as well.[more]


Besides the same blame-the-worlds-problems-on-video-games platitude I think this story describes a more subtle but much graver attitude problem people have today. Namely the blind urgency everybody feels regarding detailed diagnosis and observation rather than actually providing people with the help they need.

That the young man was described by the police as 'someone with no friends' is more terrible than I can imagine. Why, since the police obviously had knowledge of the fragile state of this youngster, didn't they try to give him the help he needed?

In my opinion, it's both criminally negligent and fundamentaly in-human! And WE are to blame.

23. nóvember 2006

Proper motivation

For every hour I spend debuging poorly documented code Fluffy gets it!
()_()
(>.<)
((")(")
Fluffy has died 3,421 times so far.


Be apart of the solution, help save Fluffy!
Document your code properly!

22. nóvember 2006

My new awesome toy

Bought the new Mindstorms NXT set when I went to London last week. Awwwwwesome stuff! I've been fidgeting like a 5 year old the whole day while waiting to get home to piece it together and build my first robot.

Just as a hint to those of you who might also own this system, when sending a direct command to the NXT module you have to omit the first byte (Byte0) in the output and response buffers. The framework does that for you (thanks Lego for not documenting that in the SDK, could have saved me two hours of frustrated debugging).

As an example, to start/stop the continuous rotation of motor A, you'd have to send the following data:

nFANTOM100::tStatus status;
nFANTOM100::iNXTIterator* nxtIteratorPtr = NULL;
nFANTOM100::iNXT* nxtPtr = NULL;

nxtIteratorPtr = nFANTOM100::iNXT::createNXTIterator( false, 0, status );

if( status.isNotFatal())
{
nxtPtr = nxtIteratorPtr->getNXT( status );
nFANTOM100::iNXT::destroyNXTIterator( nxtIteratorPtr );

ViUInt8 tachoticks = 360;
ViUInt8 speed = 100;

ViUInt8 directCommandBuffer[] = { // Removed the initial byte!
0x04, // Set outputstate
0x00, // The output port 0-2
speed, //power set point -100 to 100
0x01 | 0x04, // mode byte,
0x01, // Regulation mode (no regulation)
0x10, //turn ratio
0x20, // Run state (idle)
tachoticks
};

// Same thing here, decrease the size of the return buffer by 1 (documented size is 3)
unsigned char responseBuffer[2];

// Send the direct command to the NXT.
nxtPtr->sendDirectCommand( true /* we want a response */,
reinterpret_cast< ViByte* >( directCommandBuffer ), sizeof( directCommandBuffer ),
reinterpret_cast< ViByte* >( responseBuffer), sizeof( responseBuffer ),
status );
}


I'll post some further details as I get through the basic robots and finally get to program something on my own. I fear however that the NXT's measly 106k memory could become a major hurdle in my robot world domination plans.

9. nóvember 2006

Horfði ekki á sjónvarpið í gær

Já, hana nú .. horfði ekki á sjónvarpið með Rannveigu í gær, var þessi í stað að dunda mér í að prófa DHTML upp á nýjan leik. Hef ekki gert neitt lengi skemmtilegt DHTML í nokkur ár og langaði aðeins að prófa hvort eitthvað nýtt væri á seyði.

Í einhverjum óheyrilegum leiðindum þegar ég var úti í Kanada þá hafði ég skrifað einfaldan kóða sem birti NxN matrixu af pixelum á vefsíðu. Hægt var svo að smella á hvern pixelinn og breyta litinum á honum. Langaði að prófa mig áfram í því að búa til naívt teikniforrit í vafrara. En hef svo sennilega verið kallaður út í bjór eða eitthvað þvíumlíkt því ekki náði það langt.

En jú ég tók þetta project og ákvað að nota það sem grunn. Gekk út frá því í byrjun að ég gæti, í stað þess að teikna hvern pixel (ísl: kassa), frekar látið kassana teikna sig sjálfa eftir einhverjum reglum. Þannig væri jafnvel mögulegt að búa til einhver falleg form og hreyfimyndir. Gaman :)

Frekar einfalt að gera það á svona quick and dirty hátt, myndirnar teikna sig og hægt er að stækka svæðið og kassana sem birtast ásamt því að stoppa hreyfinguna.


Helsta vandamálið er að vegna þess að ég uppfæri myndina nú ekki á neinn sérstaklega hagkvæman máta, þá keyrir þetta svolítið hægt.


Hinsvegar fannst mér mun áhugaverðara að gera þetta almennilega gagnvirkt og hvernig hægt væri að skrifa inn og keyra sínar eigin reglur beint inn í vefsíðuna sjálfa. Loksins komst að leið sem gerði það kleyft að smíða og virkja JavaScript kóða á keyrslutíma. Því bætti ég við seinni hlutanum:


Þetta textabox gerir hverjum sem er kleyft að eiga við kjarnann í teiknirútínunni og ákvarða hvaða kubbar eru uppfærðir og hvenær. Fallið steptile(i,j) sér um að uppfæra litinn í kubbi í röð i, dálki j. Ég prófaði nú bara að fikta með sínus og kósínus kúrfur ásamt einhverri fallegri symetríu. Að fikta er gaman! :D


Prófiði: pixemotions
(er í hálfgerðu tilrauna formi ennþá þannig að ég ábyrgist ekki stöðugleikann) :)

Ef þið fáið út einhvert skemmtilegt mynstur, endilega postiði kóðanum fyrir það í komment, alltaf gaman að prófa og sjá hvað aðrir gera.

7. nóvember 2006

Blizzard fyndnir.. :)

Hver segir svo að þeir kunni ekki að grínast þarna hjá Blizzard? Mynd tekin af Druid Spells & Abilities Preview síðunni hjá Blizzard fyrir væntanlegu viðbótina við World of Warcraft.







hehe... ;)

6. nóvember 2006

Bíómiðar


Í 2. gr. 4. mgr. í Lögum um virðisaukaskatt (1988 nr. 50 24. maí) segir að undanskilin virðisaukaskatti er:
Starfsemi safna, svo sem bókasafna, listasafna og náttúrugripasafna, og hliðstæð menningarstarfsemi. Sama gildir um aðgangseyri að tónleikum, íslenskum kvikmyndum, listdanssýningum, leiksýningum og leikhúsum, enda tengist samkomur þessar ekki á neinn hátt öðru samkomuhaldi eða veitingastarfsemi.]


Þannig að hinn hefðbundi bíómiði sem nú kostar 900kr, kostar í raun án 24,5% vsk: 900*1.245 = 723 kr.

Bíómiðinn á Mýrina sem kostar 1.200kr. er sem sé 1.200-723 = 477 kr. dýrari!

Það er þannig nánast 500kr. dýrara að fara í bíó á Íslenskar myndir. Iss.. glætan! Hvernig hjálpar svona til að ýta undir innlenda framleiðslu?


p.s. og svo ef ekki sé nefnt að það kostar 50kr. aukalega að sjá myndir í fína nýja stafræna kerfinu þeirra í Kringlunni.

Fjúkk hvað ég er feginn að vera hættur að fara í bíó!!!

1. nóvember 2006

Einn fyrir Rannveigu


Your Candy Heart Says "Get Real"

You're a bit of a cynic when it comes to love.
You don't lose your head, and hardly anyone penetrates your heart.
Your ideal Valentine's Day date: is all about the person you're seeing (with no mentions of v-day!)
Your flirting style: honest and even slightly sarcastic
What turns you off: romantic expectations and "greeting card" holidays
Why you're hot: you don't just play hard to get - you are hard to get

17. október 2006

Almáttugur...

Eftirfarandi frétt birtist í Fréttablaðinu í dag:

Samræmdum prófum hætt


Alþingi Björgvin G. Sigurðsson, þingmaður Samfylkingarinnar, vill leggja niður samræmd lokapróf í grunnskólum og hefur lagt fram frumvarp þess efnis.

Alþingi Björgvin G. Sigurðsson, þingmaður Samfylkingarinnar, vill leggja niður samræmd lokapróf í grunnskólum og hefur lagt fram frumvarp þess efnis.

Björgvin segir prófin úrelt og valda meira tjóni en gera gagn. "Þau valda gífurlegri miðstýringu þar sem allt miðast við fáar bóklegar greinar en þau mæla ekki það sem verðmætast er eins og til dæmis færni í mannlegum samskiptum. Að auki búa þau til tapara þar sem allir eiga að koma út sem sigurvegarar," segir Björgvin og telur betri leiðir til til að mæla árangur skólabarna.- bþs/fréttablaðið


Þessi Björgvin blessaður hefði nú eitthvað til málanna að leggja ef hann væri ekki soddan grasasni eins og þessi frétt ber með sér. "Að auki búa þau til tapara þar sem allir eiga að koma út sem sigurvegarar". Það er ekki nóg að skerða eigi menntun ungafólksins okkar bæði á sviði raunvísinda og okkar ástkæra móðurmáli, heldur á núna að gera grunnmenntun barnanna að bölvaðri feel-goody unglingavinnu!

Höfum minni áhyggjur af því að öllum líði eins og sérstökum "sigurvegara" snjókornum sem finnst lífið og þjóðlífið eigi að snúast utan um rassgatið á þeim. Höfum frekar meiri áhyggjur af því að fólkið í landinu fái mannsæmandi grunndvallar kennslu og öðlist sómasamlega undirstöðu kunnáttu í þeirri þekkingu sem mannkynið hefur viðað að sér undanfarin ár þúsund og gerir okkur kleift að lifa eins og við lifum í dag!

Að láta svona út úr sér... sveimérþá!

Ekki misskilja mig þó, ég er fylgjandi því að fyrirkomulaginu á þessum svokölluðu "samræmduprófum" sé breytt og fært í betra horf. Ég er sammála því að ofur-áhersla sé lögð á (sem hreinlega jaðrar við bölvað snobb) ákveðin bókleg fög en lítil sem engin áhersla sé lögð á verknám í gunnskólum og mennastofnunum landsins.

Hinsvegar má ALDREI, ALDREI, ALDREI gleyma því að til þess að geta tekið þátt í nútíma þjóðfélagi og vera samkeppnishæfur á vinnumarkaðinum þá verður að tryggja að allir hafi sama grundvallarskilninginn á hinum "hefðbundnu" bóklegu fögum (s.s. stærðfræði, eðlisfræði, efnafræði, líffræði, íslensku, ensku, dönsku/þýsku/frönsku, osfrv..)! Sama hvar styrkleikar hvers og eins liggja.