Skip navigation.
Home

Computers

gazihan's picture

Creating DLLs in Windows

I've always seen and hated those weird macros that preceded functions of header files. Why couldn't they be clean and simple? I hated them because I didn't know much about them, they seemed arbitrary, prone to error, non-standard, no way of knowing the real motivation behind. 

Not anymore. Today I had to create an intermediary DLL between two different object file formats and I had to go down to the level of dirty and hacky in the quest to make it work. And I stumbled upon this awesome page that has the "ultimate header file" template. I discovered half the things there myself, but it nailed the coffin of problems for me. 

Here are the problems that I had to tackle in general:

gazihan's picture

Developing in Windows!

Here we go. I formatted my laptop hard drive, wiping away both Windows and Gentoo Linux... It was a tough choice nevertheless, but I had to because (1) my reiserfs partition got corrupted and some config files at my home directory were unwriteable (creating all kinds of fun), (2) my windows partition was too small to do any development on, (3) with the advisor change, I stopped using my laptop at work. I also stopped using Linux at work and entered into the mighty world of Java and Windows, a very positive experience indeed. 

gazihan's picture

IBDS patch: fixed step size for precise collisions

Right now, the binarySearch for collisions stop when the distance for the first contact is within the collision tolerance. For high tolerance values this seems to be ok, but high tolerance creates less accurate simulations.

When the tolerance is low, the while loop in Simulation::binarySearch() actually gets executed and the simulation ends up stepping lower than the real step size. This is easily verified by doing sim->getCollisionDetection ()->setTolerance (0.0001) in CollisionModel.cpp. As the bodies start hitting the ground, the actual timestep varies as can be seen by the time display on the render window. I think this is bad, since most applications would expect the simulation to have the same step size everytime it is stepped. Attached is a patch that forces Simulation::timeStep() not to return till the expected timestep is reached.

http://www.impulse-based.de/phpBB2/viewtopic.php?p=151

gazihan's picture

Yet Another (and rightly so) Linux-Windows Rant

Oh boy. I saw this comment rant when I surfed over to the news about KDE looking for summer of code dudes. While I agree 100% with most of the comments he makes there, I'm a Linux user by choice - such a paradox...

It's not necessarily that Windows is far more superior than Linux, it's just that simple and intuitive tasks get done in Windows easier than they are in Linux and things in Windows just work without problems most often than in Linux. On the contrary, Linux shines when you are obsessive about how you want things done, therefore it's occasionally more fun.
You want to do NAT in Windows? You buy Wingate and you are done. You can see all the connections live on the Window and you have a lot of control over what happens with it, very discrete from anything else in the system. In Linux you have to learn what iptables is, how you sort of indirectly use its internal structure for NATing, etc.

(a) If you have time to do all that, great. Now you are an iptables guru and it'll be very helpful for many other things you will want to do at some point in the future. This definitely is a plus over a simple solution that works and does just what you want. (b) BUT, if you DO want a simple solution that works and does just what you want, your best bet is to find a howto and copy and paste a bunch of commands that you don't have much idea about. In such a case you'll have much less control over the whole thing, and when it breaks you'll spend much more time on it since you'll most likely have to revert to (a). This is definitely bad for the person that wants simplicity.

alihan's picture

Awsum!


gazihan's picture

IBDS const correctness

Here is a patch that improves const-correctness in vector and matrix classes of IBDS.

gazihan's picture

Dreamhost lifts the limits on domain names!

Great news, Dreamhost lifts the limits on the number of domains and subdomains! Now they have one standard plan and it includes unlimited domain names. They charge $9.95 per domain name per year, which is 4 cents cheaper than Godaddy.

I'm not sure when this happened, but I just realized this accidentally. In time I'll transfer my other domain names from Godaddy to here as they expire there.

So if anyone has any domain name idea, just go to the control panel and start hosting!

gazihan's picture

Pointers, smart pinters and ownerhsip

Pointers are the root of all evil when writing a C++ application. You are allowed to point to almost anywhere in the memory address space provided for you. With this huge power in your hands, you try and create objects in the memory, point to them during their lifetime, use them, pass their pointers around and share them, and you are supposed to destroy them when you are done with them. It doesn't matter which class creates an object and which class destroys it, all you know is someone needs to create it, someone needs to destroy it, and in the meantime everybody is allowed to use it. But if anybody tries to use a pointer that is not pointing to a live object, all hell is set loose.

This huge power and the weak creation/destruction restrictions (or lack of them) creates a playground with almost no rules. By definition, this situation invites chaos in the program, and possible disagreements between programming team members over very fundemental design decisions, or disagreement between different parts of code written by the same person. This is unacceptable. The efficiency benefits, if any, of having such a powerful framework is likely to be wiped out completely by the programming/debugging efforts, runtime errors, and memory leaks. This has to stop, noone is meant to have such powers, especially in big projects.

Solutions are many in numbers and the starting point is organization. There has to be a set of agreed rules that guarantee prevention of chaos. Since this can be done in many ways, there is yet another headache we need to worry about, incompatibility. When you try to mix code with different apporaches, you are doomed to be the child between two disagreeing stubborn parents. Which brings me to the importance of standards.

gazihan's picture

Laptop cleaning

For the first time I opened up my laptop and cleaned the inside of it. It was getting really hot and the fan wasn't really blowing anything anymore, so I thought this would be a good idea. I found this site that has a bunch of links to guides on how to disassemble laptops. I followed this guide to disassemble it step by step and it worked out great. I must say I was a little nervous because it's the time of the year that I accumulate a lot of static electricity, but touching the desktop cases around often helped a lot. There was a substantial amount of dust inside, along with my hair mixed with guinea pig hair:) I couldn't find a compressor, so I tried to take off as much as possible. The clumps of dust that I extracted from the fan casing made me feel I was doing the right thing. For this I had to remove the cooler from the CPU, and then I used some thermal paste to seal it back in.
Now my laptop is running as good as before, and I can feel the air being blown out from the fan. Mission accomplished.

Syndicate content