Wednesday, June 25, 2008

C++ switch statement

just found out that VC++ switch statement does not allow to create new variables with dynamically allocated values inside any of the case statements

Tuesday, June 24, 2008

wxWidgets wxGrid is bad

some of the wxGrid selection getting functions arn't working correctly. in fact, i don't think they are even working in the latest version: wxGrid::GetSelectedRows, getGrid::GetSelectedCols, wxGrid::GetSelectedCells. all of them are supposed to return a wxArray subtype containing all the cells that are being selected, but none of them does that.

the only function that can be used for checking selection is IsSelection for checking if any cells are being selected, and IsInSelection to check if a cell is selected, you may build additional functions on top of those.

Sunday, June 22, 2008

Suspend problem still exist on Ubuntu

I was taking my laptop out of my bag today, and suddenly realized it is really damn hot all by itself, like around 50 celsius. It was on ubuntu suspend, and i guess suspend on ubuntu is still problematic, that it still drains a lot of energy from the battery, and because the fan no longer turns on, the entire laptop gets really hot. it can potentially melt the plastic. (and the battery drain was around 50% in just 50 minutes of travelling)

it could have been that i was just closing my lid in order to suspend my ubuntu, i felt heat when i was carrying it, but i thought that's because of the weather. i'' need to keep a close watch on this issue

Friday, June 20, 2008

wxWidget bug

I found a weird bug in wxString::Format function, if i were to substitude > 64 variables into the string, all the other substitutions will not work and be converted into the letter of their substitution type, example:

char c = 'i';
wxString::Format("%c %c %c <... repeat 61 more times> %c %c", c, c, c, <... repeat 61 more times> c, c);

the output of the above string will be "i i i i <... repeat 60 more times> c c" where the c represents the %c used in the string, and they are not converted to the variable c even though the string is perfectly valid and the c is being assigned.

wxString::Format function is an inline function that basically uses the printf function, I don't know if that's the maximum insertion any printf function can handle or is it just wxString::Format function made a limit to itself. probabaly should test them out

Sunday, June 8, 2008

things to ask before next Ubuntu question/answer session:

-cannot get disk usage from root. partition reports root has some error warning.
-after suspend wake up, it shows a white screen. don't know any way to get rid of it
-flash player no longer working with firefox. somehow there is no sound but the sound system works

UPDATE:

looks like all those problems listed above are fixed before me having the chance to visit FreeGeek.

openSUSE is still not running. I think it's because gdm and kdm cannot run on top of X11 due to the driver incompatibilty with NVidia video card. I don't exactly know how to fix it, but i heard openSUSE 11 fixed that problem. so i'll check that one out instead

Thursday, June 5, 2008

Visit to Free Geek

I went to visit Free Geek linux help session today for helps in fedora. unfortunately, i did not solve the problem I have with ksynaptics. but i did learn some cool stuff:

mknod -> used for making a device file in /dev. the expert said it's something related to "udev". i should look into it

dpkg-reconfigure xserver-xorg -> used for debian xorg.conf reconfiguration. it doesn't work in fedora, however. it is very useful when your xorg or any other conf file is messed up

locate - a program that updates its file database in midnight and fast search indexing of files

also, in bash, you can double tab in command prompt to list out all files in the directory that contain matching strings you have typed. this is tested and working in bash

------------------

btw, i did some research in Mac file system. apparently Mac file system is much cooler than linux: the reason why mac has such good file searching utility is because mac uses a special autofs device under /dev that can track all the current changes to directories, and file them to the searching index system. this is much better than the locate program unix has because the update is instant.

also, the time machine in Mac has a very advanced technology which allows hard links to directories, which is forbidden in unix because such multiple directory hard linking can cause bad loops. but mac solved that problem, and used it extensively in time machine so that there is only one copy of an tire folder of files if none of the files in the folder has been modified before previous backup. the only problem with it is that even if you just modified one byte in a big file, the file will be saved as separate files from before, this causes problem if you use many virtual machines, or MS Entourage, which saves all emails as a single database file that is often changed and big.