RISK game
Posted on August 29, 2005

Hmm is seems to me that american maps are a little bit strange ;-)
Filed Under Uncategorized | Leave a Comment
good set 2
Posted on August 26, 2005
good set 2 — more macro! ;-)
Filed Under Uncategorized | Leave a Comment
1st good set
Posted on August 25, 2005
I bought a Canon Powershot A510 3.2 megapixel digital camera.
Here is my 1st good photo set. (Images are resized from 2048×1536 to 1024×768.)
P.S. Is it a good idea to upload my images to flickr or should host them on my server?
Filed Under Uncategorized | Leave a Comment
Britannica: Great Books of the Western World
Posted on August 24, 2005

I was browsing through Britannica website and found “Great Books of the Western World” book set. Wonderful collection, but the great thing about this collection is the “Reading Guidance: A special section offers advice on how to get the most out of the Great Books collection, including a 10-year reading plan.“.
Get it now while you are still young!
Filed Under Uncategorized | Leave a Comment
Posted on August 23, 2005
Filed Under Uncategorized | Leave a Comment
How the vi editor would seem if it has been made by Microsoft
Posted on August 14, 2005

Filed Under Uncategorized | 1 Comment
Dive into Python
Posted on August 12, 2005

Best chapter intro ;-)
Being a philosophy major is not required, although if you have ever had the misfortune of being subjected to the writings of Immanuel Kant, you will appreciate the example program a lot more than if you majored in something useful, like computer science.
Filed Under Uncategorized | Leave a Comment
Python
Posted on August 10, 2005

I ranted about Java now let me do the same thing for Python. And just to be on the safe side I must say that I’m just learning it.
I got a “Dive into Python” book from the library and all my rants will be bases on information I got from this book.
When I write “boo: xxxx” It means that xxx is an quote from the book and “anal: xxx” is my analysis.
boo: __len__ is called when you call len(instance)
anal: thought the book author tells the everything in python is an object, so why does Python use functional way of getting the length?
boo:
try:
exept Error:
else:
if no exception is raised during the try block else clause is executed afterwards.
anal: if no exception is raised during the try block why should I jump from one location to another instead of simply continuing doing what I was doing in try block?
boo: for tag, (start, end, parseFunc) in self.tagDataMap.Items():
This looks complicated but it’s not.
anal: If it looks complicated it is complicated. Ex: ObjB a = (ObjB)((ObjA) t.getT(x.getV())).meth()).boo();. I don’t want to spend any time three month from now trying to understand what this code is trying to accomplish and how.
boo:
import os
import glob
dir=”\\home\\audio”
filelist = [os.path.join(dir, f)
for f in os.listDir(dir)
if os.path.splittext(f)[1] in “mp3″]
glob.glob(dir+’\\*.mp3′);
anal: glob what an intuitive name, but ok it’s used alot in Unix. But if it’s possible to accomplish same thing with os module why add a glob of synthetic sugar to standard library ;-)?
boo:
def copy(self)
if self.__class__ is UserDict(self.data)
return UserDict(self.data)
import copy
return copy.copy(self)
The copy method of a real dictionary returns a new dictionary that is an exact duplicate of the original.
If self.__class__ is not UserDict, then self must be some subclass of UserDict. UserDict doesn’t know how to make an exact copy of one of its descendants; there could, for instance, be other data attributes defined in the subclass, so you would need to iterate through them and make sure to copy all of them. Luckily, Python comes with a module to do exactly this, and it’s called copy.
anal:
I’m not sure that base class should care about it’s subclasses.
ok enough for now.
Filed Under Uncategorized | Leave a Comment
MyProgs/elendal
Posted on August 8, 2005
Programs I use:MyProgs/elendal and my bookmarks del.icio.us/elendal.
Filed Under Uncategorized | Leave a Comment
Java 5
Posted on August 5, 2005

I like Java for many reasons, but not Java 5.
Autoboxing is a new feature and it just introduced a bug in my code. I wrote a small test case Assert.assertEquals(dao.getAsList(), 100) and it compiled! How the hell can you compare object and primitive? With java 5 you can :-(. Method assertEquals accepts two objects as a parameter Assert.assertEquals(Object a, Object b). Java in it’s infinite wisdom now automagically converts primitive datatype like int to object like Integer. This sucks because is impossible to detect this kind of mistakes in compile time only at runtime (and my build runs more th a minute on my laptop).
I think too many people asked Sun to copy stupid things from C# and now we have to eat same shit Microsoft programmers eat.
Annotations for example. For my tests I used testng ,with testng you can either prefix your test method with @Test annotation and use it only with Java 5 or put @Test to JavaDoc comment and use it with any Java version. Why add additional complexity?
Generics.. Fuck. Such a nice concept. Well done in C++. MyClass<int> x. Wonderful! But I can’t do the same thing with Java 5 because when you say type T Java means Object. So when I need to implement method that for example sorts primitives I still have to write one method per type (boolean, byte, char, double, float, int, long, short). That’s exactly what generics is supposed to eliminate. Or if you want to accept only List as a parameter you can write T<extends List> but you can simply accept interface as a parameter and scrap generics nightmare.
public abstract class AbsComputation {
public abstract <A, DataT extends AbsData><A> <A> DataT compute(DataT data);
}
Can you understant this? I can’t, so why should I bother with clumsy syntax and no obious benefit?
Sun, please deprecate this while you still can!
Filed Under Uncategorized | 2 Comments
