Blog
Page: 0 ... 5 ... 10 ... 15 ... 20 ... 25 ... 30
gethostbyname_r Buglet
Date: 3/12/2004
I've been getting reports for Damn Small Linux users that Scribe can't connect to servers because the call to gethostbyname_r fails.

There is a topic here about the issue on the DSL forums if you want to post suggestions, information, test results, slander or pictures of your pets.

The relevant code in Lgi is in src/common/INet/INet.cpp on line 500 or so:
Host = NEW(HostEnt);
if (Host)
{
	memset(Host, 0, sizeof(*Host));
	
	HostEnt *Result = 0;
	int Err = 0;
	if (gethostbyname_r(HostAddr, Host, Buf, sizeof(Buf), &Result, &Err))
	{
		char *ErrStr = GetErrorName(Err);
		printf("%s:%i - gethostbyname_r('%s') failed (%i - %s)",
			__FILE__, __LINE__,
			HostAddr, Err, ErrStr);
		DeleteObj(Host);
	}
}
(0) Comments | Add Comment

New Clothes For Scribe
Date: 30/11/2004
Some new goodness for the about window and the title page. All written in nice configurable HTML that you could, if you wanted to, change to something else I guess.
Is it hot or not?

And for those of you with an eye for detail, what other feature is visible (not) in the first screenshot?
(8) Comments | Add Comment

Are We There Yet?
Date: 29/11/2004
It sounds simple I know but I don't know if it can be done. What I want is to be able to have 2 people using windows at the same time, 2 graphical logins at once. I've heard about fast user switching on XP and I would like to know if somehow that could be retasked with liberal use of SSH and TightVNC to allow a second simultaneous (remote) user to access their own desktop, separate from the local user?

I know it's a little out of Windows league but I thought it might just be possible now days.

And before you suggest linux / X windows:
(0) Comments | Add Comment

I Hate Web Browsers
Date: 19/11/2004
Imagine your proofing some HTML with images on your hard disk before putting them online. Seems like a reasonable thing to do right? And you want to use images in your HTML, still all good. So you put the images in the same directory as the HTML and try some code like this:
<img src='image.jpg'>
But it doesn't work does it. Noooooooo.
<img src='./image.jpg'>
Nope.
<img src='file:///image.jpg'>
Nah mate.
<img src='file:///./image.jpg'>
Sorry...
<img src='file:image.jpg'>
Wrong again.

*mutter*

Yes both IE and Firefox fail this simplest of tests. Truely I am amazed. How did this happen?
(6) Comments | Add Comment

Holy Browser Batman!
Date: 17/11/2004
Oh my gosh...!?!

I didn't think you'd take me seriously!

I know it's half way through the month but check out the Browser Stats for this month.

Gecko is kicking some major butt in the browser wars.
(0) Comments | Add Comment

Writing software that uses XML
Date: 17/11/2004
Over the last few years I've been writing software I've begun using XML as a standard way to store applications settings and other data instead of some other 'proprietary' format (or *shudder* 'the registry'). And well I've gone through several of my own XML parsers, with various API's and methods of doing things. And now I've come 'home' in the sense that I have what I would imagine to be the final API that I will use for XML for the next 5 years at least.

There are 2 basic ways of parsing XML, a SAX style interface or a DOM tree interface. The SAX interface parses the XML and calls you back to tell you about the structure of the document. You only ever know about the current element that the parser is parsing. Whereas a DOM tree parser returns an in memory representation of the entire file in a tree structure that follows the format of the file. You can then modify that and write it back to disk.

The benifit of the DOM tree style parser is that you have access to the whole document at any given time, making the code far simpler. This also allows you to do pervasive changes to the whole document easily. Something that just saved me hours of coding. My particular API also allows you to read/write objects between C++ native types and XML using one set of serialization code. This is an important step towards very simple and robust XML code. You can't imagine how painful it is maintaining one set of code to read the XML into C++ types and then a completely separate set of code to write that back out to XML. The code itself is in GXmlTree.h and GXmlTree.cpp in Lgi if your interested.

I will certainly be using XML more now that it's trivially easy to load and save for me. For instance I'm migrating all the options files for my applications over to XML. Including Scribe v2.

All hail DOM parsers!
(1) Comment | Add Comment