January 25, 2003

Enter the twilight zone …

I know I haven’t written much lately but it’s not because I had nothing to write (in fact, I had tons of stuff going through my mind which would have made good fodder for this blog :p) but because I was too busy to write. SM actually takes a bit more out of me in the way of writing since it is about ideas and thoughts and dreams and philosophies – unlike DC (The Developer’s Corner) where I just talk about development stuff. Here I have to try and be coherent instead of meandering all over the place as I have a habit of doing :p Anyway, enough of the apologies and on to the stuff I wanted to talk about … well, at least some of it :p

I finished reading Gordon R. Dickson’s "Necromancer" a couple of days ago and all I could say was "wow!!" because that book really spoke to me! I could totally identify with the protagonist and the way he thought and looked at the world and I really didn’t think that there were other people who thought that way (and here I am talking about the author – he must at least have seen the world partially like his protagonist to have written that way … at least that’s what I thought). I thought I coined the term "empath" because I believe that while a true telepath would be an impossibility (well, at least a sane one – all the vicious thoughts and secrets that they’d be bombarded with daily would make them go insane is what I think), I think that "empaths" are real and do exist. An empath (in case you are wondering <g>) according to my definition is basically somebody who can feel the emotions of another without actually knowing their thoughts and secrets. But I discovered that Dickson had used the term to describe his protagonist years ago! Plus, his protagonist says that nothing surprises him much because he can see it coming and the same is true of me – the latest example was that I saw the twist in the story coming in "Necromancer" way before it actually arrived – only thing was, that I was never sure that the plot would resolve the way I thought it would and yet, it did in the end!

Now I find myself wondering if I am simply remembering some of this because I’d read the other books in the series (the Dorsai series in case somebody is interested ..) or if I am just hitting the outskirts of the Twilight Zone :p So I decided to go back and re-read the whole series from the beginning since I’d read half the series ages ago (over ten to fifteen years ago if memory serves right) and have not even read the final half of the series yet. I started with the first book – "Dorsai!" – and was again hit with that weird feeling of … I don’t know .. can’t say deja vu since I have read the book before and so deja vu would be appropriate but then again, it’s not since I don’t remember most of this since I wasn’t thinking along those lines when I first read the book. This time the story is about an intuit – a person who intuitively knows the all possible future outcomes and so can take action so that a certain outcome will be possible. While I had never even thought of the concept of an intuit, I do agree again with some of the protagonist’s views. For instance, at the beginning he is described thus: "What seemed so plain, and simple and straightforward to himself, had always struck others as veiled, torturous and involved. Always he had been like a stranger passing through a town, the ways of whose people were different, and who looked on him with a lack of understanding amounting to suspicion. Their language failed on the doorstep of his motives and could not enter the lonely mansion of his mind. They said "enemy" and "friend"; they said "strong" and "weak" – "them" and "us". They set up a thousand arbitrary classifications and distinctions which he could not comprehend, convinced as he was that all people were only people – and there was very little to choose between them. Only, you dealt with them as individuals, one by one, and always remembered them as individuals, one by one; and always remembering to be patient." That is exactly how I feel about people!

I could probably go on and on with this and make this entry really long and boring but I’ll probably stop here for the moment. But I want to take this up again with another subject that has been on my mind related to people – but this time, to the real world and the situation in the world today … maybe tomorrow 🙂

I tested the image spider code yesterday and found that it worked for the first image and then continued to fetch the same image over and over again for the rest of the links. I thought there must be some bug in the code (and I couldn’t do any debugging with the debugger since each time I exited, Explorer would crash … hard <g> and so I had to debug using message boxes – which I hate doing) and spent most of my time trying to figure out where the bug was. I tried various approaches and went through a lot of code but all that time, I had the sneaking suspicion that the bug was somewhere else .. and I was right :p I discovered the bug finally just as I was about to give up for the day – the URL’s I got from the selected stuff on the page had some text encoding (the ampersand encoded as text for instance) and that was throwing things off. But what had confused me was the fact that any URL brought up the first picture on the list (that was probably a server side thing …) and I so I thought the problem was somewhere else. Ah well, I do have the solution now but I still haven’t implemented it since I tired to be too smart about it :p

I had been using third-party HTML parsing code but then discovered yesterday that I could use the IE browser component’s built-in IHTMLDocument2 interface to get a list of elements on the web page. I was using this fine for parsing a full-page by the time I discovered the problem with the URL text encoding and since I was simply returning the selected stuff on the page as a text range, I decided to use another method which returns a control range since I reasoned that this would allow me to access the stuff in the selection element by element and that the element attributes probably would be in the un-encoded form. However, I discovered only when I ran the code that the particular interface that I was using to do the job was not supported by Delphi! I hate when that happens! I guess I’ll have to go back to the original method I was using and translate the encoded stuff back to their un-encoded form for the moment but when I refine the code, I’m going to do away with the selection method altogether and use some sort of filtering – or simply return a list of links on the page and let the user select the ones that s/he wants to work with. But that’s for another day …

Posted by Fahim at 6:45 am  |  No Comments