Jump to content


Check out our Community Blogs

dbug

Member Since 09 Sep 2010
Offline Last Active Apr 28 2012 08:55 AM
-----

Posts I've Made

In Topic: Please help this is driving me insane!

06 November 2010 - 08:37 AM

$_SESSION array is not populated with session data until session_start() is called. This is why you have to call session_start() at the begining of the page (before the first access to $_SESSION). If not, then isset($_SESSION['<anything>']) always returns false.

In Topic: First writing and then reading, reopen ?

22 October 2010 - 12:18 AM

If you open the file in write only mode ("w"), then you must close and reopen it in read only ("r") or read-write ("rw") mode to be able to read it.

Another option is opening the file in read-write mode from the begining and, after writing, use fseek to go to the begining of the file and start reading it without having to close and reopen.

EDIT: if you are doing this to verify if the file has been correctly written to the disk, this might not be the best way to do it. Due to operating system caching on the file system, it's very probable that what you read comes directly from memory instead of disk. So you aren't really verifying if it has been correctly written physically.

In Topic: Happy Birthday CodeCall!

20 October 2010 - 12:41 AM

I'm quite new to this forum. I found it when I was tired of some other thematics in other forums and I decided to search google for a forum specific to programming. I don't remember if it was the first entry or not but I liked it, so I registered. I was also searching for an english forum to help me improve my knowledge of it (this is still a work in progress :rolleyes:). I like to investigate and find the source of the problems, and I also like to learn everything I can, so I enjoyed very much some of the questions I answered.

Now I'm a bit disconnected because I have a lot less time to spend here (current work is quite time demanding). Hope I can return soon.

Happy birthday

In Topic: Ms c++ 2005 2008 2010

16 October 2010 - 11:42 PM

The Visual Studio redistributables contain the C/C++ runtime support for applications. This support may change a little from version to version (basically adding new features, but sometimes changing some behaviour), so they are different and you need the redistributable corresponding to the version you used to compile the application. In fact, multiple runtime versions may be installed in a single computer without problems because the critical DLL names are different (applications are explicitly linked against a specific DLL, so they won't load if this DLL is not present).

In Topic: Help with prolog question....!!!

30 September 2010 - 06:44 AM

drives(Y,4WD) :- is_a(Y,handyman).

This is incorrect. the second argument should be fourwd. Using this, it works fine for me:

3 ?- drives(john,fourwd).
false.

4 ?- drives(john,sportscar).
true .

5 ?- drives(david,fourwd).
true.

6 ?- drives(david,sportscar).
false.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download