in case you wondered if you can poll on sockets set to non-blocking mode:
poll should behave in exactly the same no matter whether the socket is blocking or non-blocking so there should be no trouble.
03 November, 2009
A quick not about the poll() method for sockets
05 October, 2009
Back in the world
Yesterday evening i came back from my holidays. The transit from Fiji home took about 48 hours, with too many hours waiting on the airports Auckland, L.A. and Heathrow.... so i was quite exhausted when we finally arrived. Now I am fighting with my jetlag and tomorrow... well tomorrow work starts again. Hope everything at work worked while i was gone :)
my holiday were 3 weeks in New Zealand where me and my friends traveled the northern island and then 1 week in Fiji for relaxing. New Zealand is an awesome country i can highly recommend to pay a visit to.
its the first country i've visited so far where i would want to live.
i cant say the same about fiji.... but it was ok for a one week holiday there.
maybe i'll write some more about my holidays at some later point. we will see.
29 August, 2009
The next best thing to Agent Racksack for Linux
like i already once posted, i would love to have agent ransack running natively under linux on my ubuntu. i then settled for regexxer, but down the line i didnt like it.
i even eventually started to code one myself.
but then i found two quite decent search tools.
my favorite one is kfind.
seems that program is the closest you can get to agent ransack. at least it fullfills nearly every of my wishes in a search tool, so thats how i search now.
a more native-gnome approach would be the program gnome-find. though i think kfind is faster to use.
28 August, 2009
Qt Creator Tipps
I really dig Qt Creator (though my first euphoric stance has already relativated itself a little).
but because the IDE still is somewhat of an underdog, help in the net is somewhat rare.
therefore i decided to give a short summary about how one can setup some important settings for custom makefile projects. (they also might come in handy for all other people using the IDE).
all my descriptions are based on my qt creator IDE version 1.2.1 used under ubuntu 9.04.
i am pretty sure some posted points will save people out there some time.
*) getting your source files into your project
your project will contain a
example:
your project is located in
/home/f/sources/testApp/
and you want to have a file included in
/home/f/sources/CommonSourcecode/foo.cpp
Then add
./CommonSourcecode/foo.cpp
to
/home/f/sources/testApp/
pointing to
/home/f/sources/CommonSourcecode/
done!
*) setting up include directories
your project will contain a
/home/f/sources/Includes
*) using scons with qt creator
using scons is easy. Press STRG + 4 to go to the projects view. choose the project, then in the build settings, choose build steps. under "override" put in the word "scons".
done!
*) setting up the debugger for your custom makefile project
Press STRG + 4 to go to the projects view. choose the project, then in the "Run Settings". Press the plus, add a name, with "browse" choose the already-built executeable you want to debug.
done!
*) get your qt creator to display #define correctly
do you have a preprocessor macro inside your code that qt creator greys out although it shouldnt? put all those #defines you want qt creator to know inside the
by example if you want it to not grey out
#ifdef _DEBUG
foo = bar;
#endif
then add
#define _DEBUG
to your
done!
hope some points are helpful to you.
happy coding!
18 August, 2009
Kudos to Qt Creator!
i recently came across a "new" IDE for C/C++ development. well, is "Qt Creator" really new? not exaclty, so lets call it the underdog of IDEs then.
but because of my dissatisfaction with everything apart from visual studio i've so far used, i immediatly tried out the new 1.2.1 version of Qt Creator.
and boy, i am amazed! this is really a great IDE for developing C++ applications. The name is a bit irritating because it implies its purpose is to create QT apps.
well, maybe it is, but its also very good for "normal" apps. till now i have used eclipse. i hate it but i sticked to it because of its good parser and syntax highlighting. plus the debugger is capable of showing you the base classes members of your instances and resolves the type. this made it the best IDE i knew so far. but now i am more and more working with qt creator. so here a small comparison between qt creator and eclipse of the cons for me of both IDEs
Qt Creator vs Eclipse CDT
Qt Creator Pro's
*transparent
*fast
*philosophy resembles a bit to the one of visual studio (projects/searching)
*add your doxygen documentation to the IDE for reference
*the best damn debugger there is usable under linux c/c++!!!
Eclipse CDT Pro's
*code on hover
*best syntax highlighting so far
qt creator is very transparent in what it does. it took me a long while to figure out how i could use my custom scons apps&libs and the somewhat obscure file structure that is used in our projects with eclipse. it is quite lightweight and not that bloated like eclipse, there are only a few config files which are used to set all up.
qt creator is very fast in comparison to the devillish slow eclipse. building, starting the debugger, changing the views, searching. everything SEEMS fast. eclipse does not seem fast. eclipse is coded in java, qt creator isnt. plus qt creator is only for c++. these will be two of the major reasons for this.
i hate the inline search in eclipse. and i also dont like the "normal" search with its results window. ok, thats taste but i like it more the way visual studio and also qt creator does present the search.
another thing is the "project" approach in qt creator. i find the philosophy behind the eclipse workspaces and then included subprojects very confusing, even stupid. i dont get the benefits. and in eclipse, where is a setting stored? in the workspace or in project? and can i export it, and how can i export it to use it somewhere else?
in qt creator the projects of not-"automaked" projects have 3 relevant files. a project has some resemblance to a visual studio project.
3 files, manually editable. it is plain dead simple. plus, getting custom make projects work in IDEs is always problematic, thats not only eclipse. but it wasnt that difficult with qt creator.
want to include your doxygen help somehow in eclipse CDT? forget it. i even searched eclipses bugzilla mailing list. to no avail.
yes, it shall be possible in other IDEs like code::blocks ( i think it was codeblocks), but i didnt succeed to get it working. with qt creator? after 2 hours i had everything set up. now, i can press F1 when i am over myClassInstance->MyMethod() and instantly a window with the doxygen help will popup. aaah. how nice. this even beats visual c++.
but now comes the best part:
the qt creator debugger!
i always missed the top notch visual studio debugger that microsoft ships with their product.
i dont know about VS2003 debugger for c/c++ but from VS2005 onward the ms debugger definetly beats everything out there i could get running on ubuntu.
strongly worded if we look at debugging c/c++, the linux platform is 4 years behind microsoft.... until now. now there is qt creator.
this baby has built in STL debugging support. heaven on earth! you even can change the STL variables value for simple types!
if you are capable of, you can even write your own helper functions for using it with qt creator to visualize your data types in your own preferred way. this can be done via adding the appropriate c++ code to your
qtsdk-2009.03/qtc-debugging-helper directory. there you find a gdbmacros.cpp file.
of course qt creator is not perfect. syntax highlighting is not as good as in eclipse. nonetheless its still better than what visual studio users are used to. another problem is with my ubuntu (coming with gnome) there are some visual quirks. then there are also problems with the debugger. on certain code it may crash, like when he tries to resolve an unititialized STL iterator.
despite small issues, i just can highly recommend to try out this IDE. especially if you come from windows. it is also an IDE where you have already a WYSIWYG editor included for building GUI apps, also something you wont find often. i havent really tested it though because i tend to write C# apps if i need GUI or use exising wxWidget apps but it looks&feels professional.
so give it a try!
07 June, 2009
My first working weekend
It was time.... after working for nearly four years now I had my first weekend that I needed to work.
The first 48 hours I had a total of 7.5 hours of sleep
And now its sunday, i'm done and am now waiting in a cafe to go back home. but i have some more hours until my taxi goes to the airport.
man i'm tired. plus the benefit was biased: it was not really the most successful weekend.
it was cool that i got some experience out in the field, but this working hours... no thats nothing for me.
btw i am currently playing around with mono quite a bit.
plus i am playing around with SDL.NET, which i think is a quite cool and simple framework.
though nothing compared with microsofts framework you have real cross plat´form compatibility.
when working with it i found also a nice-nice c# and sdl.net game that you should try out:
dyson
go check it out. it also should work under linux thru mono, but when i tried it it crashed.
well, i sent the developers a crashreport and a coredump.
they didnt send a reply though.
dyson is a RTS game. can somebody explain to me why there are no reasonably high-level written
open-source RTS games out there??? the only one matching that criteria out there being either developed in c++ or C# out there is Glest. which i dislike....
i'd kill for getting my hands on some c# RTS sourcecode to play round with. if anybody knows one, please tell me.
though i dont think anybody will read this specific post
best bytes
27 April, 2009
dual screen solution on ubuntu 9.04 jaunty with nvidia
after updating to the new version of jaunty of course the dual screen stuff did not work anymore. the xorg.conf couldnt be read anymore, and even couldnt be backed up....
anyways, after update was complete i needed to play around a bit.
to get dual screens in jaunty running again with synergy i then found the folowing solution:
i started System>Administration>"Hardware Drivers", activated the revommended NVIDIA accelerated graphics driver (version 180), rebootet and then started nvidia-xconfig.
now i started System>Administration>Nvidia XServer Settings, enabled under "X Server Display configuration" the second screen again, changed the configuration to "TwinView" and everything was fine.
Seems ATM i am not using Xitami extensions anymore.
now only thing that needs to be done after update is is... i need to get my broken gcc running again....
after my update from hardy to jaunty (with middle-step updating to interprid) i was surprised to find that the build-essential package wasnt installed any more. after reinstalling... i still cannot compile, but i will will have a look now
best bytes