Statička rezolucija tipova (static typing) je svojstvo nekih programskih jezika (C, C++, C#, Java, Pascal, …) da već prilikom kompajliranja imaju imaju (traže) dovoljno informacija o tipovima varijabli, što bi trebalo pomoći u ranijem otkrivanju trivijalnih pogrešaka uzrokovanim korištenjem krivih varijabli ili korištenjem varijabli na krivi način.
E, to u sprezi sa iole kompleksnijim libraryima ne funkcionira baš najbolje. Primjer je tipičan callback iz glib-a, funkcija koja iterira nad elementima GHashTable-a:
void g_hash_table_foreach (GHashTable *hash_table, GHFunc callback, gpointer user_data);
Problem je u ovom zadnjem. User-data pointer obično služi za prenošenje konteksta kojeg koristi callback funkcija. Iako zgodna ideja (pametnije od globalnih varijabli), ruši cijeli gorespomenuti koncept. Pa tako umjesto:
NekaStruktura *foo = bar(...); g_hash_table_foreach (table, callback, foo);
napravite
NekaStruktura *foo = bar(...); g_hash_table_foreach (table, callback, &foo);
i 2 sata tražite grešku u kodu, i onda frustrirani pišete ovaj blog post u 5 ujutro ;-)
Zanimljiv tekst koji tvrdi da je kriminal na Internetu zapravo koristan i da mu treba pristupiti drugačije nego kriminalu u “stvarnom svijetu”. (via)
Doduše, kad se sjetim koliko su lokalne tiskovine dizale Vicu krekera u nebesa, rekao bih da smo u ovom slučaju opet daleko ispred ostatka svijeta.
Neki Ameri se čude kako studentima i poslovnim ljudima pada na pamet varati.
Eh, di su oni od nas…
I’ve known for some time now that Google has extended its basic search page, and now various other elements can be added (feeds, clocks, calendars, games, sticky notes, etc…) to the personalized page for any G(whatever) user. A few days ago, I’ve also stumbled upon Netvibes, which follows basically the same principle in page design as Google. The cool thing about Netvibes is that it doesn’t require registration – I guess that the account is created for every new visitor, and returning visitors, based on their cookie, are presented with their customized pages. Today, I’ve found out about Mooglets, which is another attempt at personalized home page. While the look’n'feel is very polished (kinda reminds me of Konfabulator widgets), it uses up 100% of CPU (viewed with Firefox 1.5 under Linux). Definitely not cool.
Update: Today I’ve stumbled upon this one: Protopage. Seeing the previous three, I’m not overly impressed. But I am doumbfounded by how many of these pages exist out there.
I wonder how many people use these personalized home pages…
Btw, general announcement for English-speaking visitors: Since most of my blog entries of late have Croatian local theme, I’m considering switching over to using Croatian language exclusively. If there’s an non-Croatian-speaking soul out there who actually reads this blog, please let me know so I won’t abandon you ;-)
My pet peeve of the weekend is Flash. The Macromedia one.
Not because it’s proprietary, closed source, or evil.
Rather, it’s because:
- It demands exclusive access to soundcard and fails if I have music player running (which I always have)
- The Linux version is just too old
Of course, if the player was open sourced, these problems would quickly go away…