I didn’t get home till late in the evening yesterday since I was out on a shoot most of the day. Still, I found some time to work on bits of the Blog code – I couldn’t get the Addict spell checking and thesaurus working with the WPTools component the day before but I fixed that problem yesterday – it was fairly simple actually and that’s why I got it fixed so quickly :p I also took a look at the internal format that WPTools was using to store the new entries (or changes to existing entries) into the database and found out that the entries were being saved as richtext. Now this wasn’t something I wanted since I normally store Blog entries as plain-text interspersed with HTML tags to implement the formatting, image embedding etc. So I took a further look at the WPTools options and discovered that I can specify the format that I wanted the entries to be saved in. I specified HTML and then found out that this saved the entry as a complete stand-alone web page replete with header and body sections. So I’ll have to go back and see what other formats exist and whether any of them can be used for Blog or if I have to be satisfied with the HTML format and then strip out the extra sections at the time of publishing.
March 14, 2003
March 13, 2003
I actually managed to work on three different areas of Blog yesterday and so work on the 8.0 release has officially begun since I’ve archived off the 7.1 code :p I actually had time to check out the web-update component and it seems to be almost working <g> – almost in that it downloads the update information, detects the updates, downloads them and then has problems with copying the updates over from the temporary location for some reason or another. I was in the middle of figuring that last bit out when I started having Net access problems again and decided to shelve that for the moment.
I then began working on the Blog code and split off some of the utility routines into a different package. Delphi packages work like Dynamic Link Library (DLL) files in that you can create an application using the package, distribute the package along with the application (instead of having the code compiled into the final application itself) and have things work fine. This way, I can separate code functionally in to different packages so that updating Blog in the future will be as simple as updating a particular package or maybe just the main executable. If I finally make the decision to merge Blog and BlogMan (the jury is still out on that one …) I will put the metablog API into one package, the regular Blog functionality code into another and the individual blogging utility support code (for Blogger, MT, B2 etc.) into their own packages so that everything is separate and self-contained. Not sure if this is workable but the first step on that road has been taken.
Once the code separation compiled successfully, I replaced the main window’s editor component with WPTools instead of PlusMemo. I had to do some code changes to accommodate the component and had to do some further stuff to support HTML but it does work beautifully in that it loads existing Blog entries (don’t think images will work though – so I’ll need to do something about that) and shows the formatted text instead of the HTML code 🙂 I did realize that I was going to have a few problems though – the main one is going to be how to allow people to do their own HTML tweaks since you can’t type in HTML tags directly into the edit window – at least I don’t think so since it didn’t work when I tried. This also invalidates the existing custom snippet option … unless I provide a separate HTML edit tab and this should work since WPTools also has an HTML tag edit mode which is pretty nice. So I’ll have to look into how to get that going.
The other problem is that I will not be able to highlight the words from a Find operation as easily as I did with PlusMemo – though I might be wrong here since I haven’t looked at the WPTools help totally yet. In this case, I can keep PlusMemo to display results from a find operation but that would mean that you’d have to view those results in HTML mode instead of WYSIWYG mode. But the good news is that WPTools support find operations (as well as find and replace) within an entry and so I can add that support in to Blog. Images are going to be another sore point in that I’ll have to figure out how I’m going to handle them. The existing image directory tag will probably have to be done away with (actually not done away with totally since it can be useful for other things – but done away with as far as inline images go) and a new method to be figured out. Since WPTools retains links to images, I will also have to figure out how to do the whole image upload thing on subsequent uploads. Yes, I know of all the possibilities but each of those has problems but I guess I’ll cross that bridge when I actually get to it …
March 12, 2003
I have been contemplating making the editor component in Blog WYSIWYG so that users have better control over what they type and to lessen the need for the preview window since some people feel that the preview tab is not as user-friendly as the older method where the preview window was below the text window. Of course, I’m also contemplating making the preview a true preview by incorporating the template into the preview but that’s besides the point :p Anyway, I wrote to the folks over at WPTools and asked them if they’d be interested in sponsoring a copy of their excellent editor component suite since that would allow me to embed truly WYSIWYG editing into Blog easily and yet retain existing features like the spell checker and thesaurus.
I got a response almost immediately from Julian Ziersch over at WPTools saying that they’d be glad to sponsor me provided I displayed the WPTools logo in my about dialog as I currently do for DBISAM. Since that was the least I could do for such a generous offer, I immediately agreed and Julian has already set me up with my own copy of WPTools though I haven’t had the time to download it and start integrating it into Blog. Since I’m still having access problems, slow down issues with my host’s server and a myriad of other web related problems, it might be that the first work-in-progress-towards 8.0 build of Blog might actually be for the WPTools enhancements instead of the web-update stuff :p Guess we’ll know when I finally do make a release instead of talk about it <vbg>
March 11, 2003
My web host still seems to be having problems with their server – while web access, FTP and e-mail seems to be fine, I can’t seem to execute any CGI and so am not able to post to Solipsistic Meanderings 🙁 I had a long entry yesterday that I wanted to post but was unable to do so either from BlogMan or directly from the web interface either. I’m hoping that they have got everything sorted out today …
We seem to be having web trouble everywhere because we had problems accessing the Net from work too. We’d be online for a minute and then be offline and then online and so on and so forth. It tends to be pretty irritating plus, you can’t do anything online since you keep on getting knocked offline. Anyway, since I couldn’t get online, I didn’t have much of a chance to test the web-update component – plus, yesterday was an extremely busy day and I really didn’t have too much time for anything much. I won’t get to test the web-update component today either since I am going to be out of office most of the day on a recce for a human rights story that we are supposed to do.
My friend for whom I did the data-mining app, Harvester, was able to finally test it out after a lot of trouble – mostly because .NET apps don’t seem to be able to run if you simply plop the executable into a directory and run it. I’ve always done a setup for the apps I’ve written since they were internal and I could afford to have huge setup files but since Harvester was going via e-mail, I simply sent the exe and the other needed file – big mistake! It wouldn’t run at all on my friend’s machine till I got him a setup package. Maybe I am doing something wrong and I’ll have to read up a bit more on this but I’m beginning to dislike .NET – especially since I did the same app in Delphi later on in just a couple of hours … yes, I had the logic in place from the prior iteration but still it’s just plain silly how long it took to do the app in .NET given the fact that it finally wouldn’t work as well as I would like and ended up with a huge distribution – about 8MB compressed down to a 5MB setup as opposed to a single 700k executable which will compress down to perhaps 300k in Delphi. I think I’ll stick with Delphi from now on unless somebody asks specifically for .NET :p
I did the second iteration of Harvester in Delphi for a specific purpose – to test out a set of components which were supposed to help with parsing HTML. I’ve been looking at several such components since I have several apps which parse HTML and constantly find the need to do more parsing and a component which does the job well would be a boon. However, these components were not to be that boon :p Maybe I want too much since I want to be able to pass a full HTML file or a string containing just an HTML fragment and have either one parsed by the component. None of the tools I’ve found so far seem to deal with HTML fragments. I was thinking about this yesterday and it occurred to me that I could write my own component to do this! So I began planning out how to do this and then came up with a design which started taking shape in the form of code. I have a basic framework but haven’t written the actual parsing code yet to see if I can actually represent a full HTML document or a HTML fragment using my framework. But since the code just won’t leave me alone and keeps on going through my head, I’ll probably continue to work on it as soon as I can …
March 10, 2003
My e-mail (and probably access to this site too) has been mostly down over the weekend since my host has been reinstalling the OS on their server and doing some other maintenance type of work. When I received an e-mail from them saying that they were going to do maintenance over Saturday night and that it would only take two hours, I knew that it was probably going to end being longer than that :p But even I didn’t expect it to stretch out for as long as it did and I was beginning to get irritated since the farook.org address has become my main e-mail address and I was cut off from it due to the server outage. Anyway, things are back to normal again and the server (at least the POP access part of it) seems to be faster now and so I guess all’s well that ends well …
Nothing much at all in the way of coding since I needed to take a break from work (plus mostly what I needed to test was online stuff and so I couldn’t do it from home …) and so I spent the weekend watching movies and reading a bit …
March 8, 2003
Still working on the web-update component with frequent forays into side jobs :p I thought of a few enhancements for the data mining app I wrote for my friend (I call it Harvester) and implemented that today. I would like to go back to that app at a later time and try to come up with some form of a template based approach which would let somebody choose a web page, define the values they want to extract by highlighting and naming them and have the program extract those values from any page which fits that particular template. Sounds easy enough but it would be a heck of a lot harder to implement than you’d imagine because of the uncertainty factor – the web page layout can change at any time, the page might be dynamically generated and might not have had some information which might appear on another page of the same category etc. But, it is an interesting concept and something that would tie in with quite a few of my other projects.
The only work I was able to do on the web-update component was to test it further. I discovered a few more bugs at the file download stage and fixed those but I still haven’t gotten to a stage where all the selected components are successfully downloaded. The only thing I can be happy about is that I used the kind of test data which does create problems and has helped me identify a few bugs and logical errors which otherwise might not have been identified till much later :p
March 7, 2003
I didn’t have too much time for coding today but I did go back to the web-update component. I had discovered that the demo for the web-update component had suddenly started a mysterious IDE crash each time I tried to close the demo project. I thought this was due to a new grid component that I had introduced into the demo project to display the update information for all the new components. I tried fixing the problem for a while before I realized that the crash was caused not by the grid component but by the web-update component itself :p So I had to hunt through the code to see what I had changed that would cause the crash – I finally discovered that I had mistakenly moved up the call to the Free method of a string list before some code that used that string list in the destructor for the web-update component. Once I fixed that, it worked fine again 🙂
While I did manage to get the demo finally compiled and running with the new changes to the update component that supports individual component updates, I found that it still didn’t work exactly right. I fixed a few bugs and code glitches which was stopping it from even downloading and parsing the update info file but that’s as far as I got yesterday. So I still need to make sure that the parsed information is displayed properly and that user input is received as to which components are to be downloaded before only those components are downloaded and installed. If all of that works, then everything is set and I can go back to Blog 8.0 and incorporate the web-update component into it.
March 6, 2003
I did a little bit of work on the web-update component but didn’t get around to testing it since I got involved in another project :p A friend of mine wanted a data-mining application written that would allow him to select some information on a web page and then have the program identify the different elements in the selection and populate a CSV file with the information so that it can probably be imported into a database. Now, I wasn’t planning to write a customizable data-miner where you can specify how each field was to be derived – sort of like Snipper if you recall. Rather, I was going to write a custom data-miner which would work for this particular web page … but I am toying around with the idea of a customizable utility in the back of my mind … just so you know :p
I decided to go with Visual Studio .NET and C# for the app since I’d done all of my previous HTML parsing stuff in Delphi and had always run into one particular problem – being able to parse the HTML in a selection as HTML tags and attributes. I thought this was due to a limitation in Delphi’s support for some of the MS HTML handling interfaces and so decided to go with C# where MS would have made sure that it supported the latest :p The UI itself came together pretty fast but I still prefer Delphi’s RAD IDE – MS just hasn’t learnt enough from their competition. While the Visual Studio .NET IDE is pretty good and makes UI development much faster, they don’t have (or at least *I* couldn’t find ..) some of the elements that make UI development such a pleasure with Delphi – simple things like being able to link the menu component to the statusbar component so that menu hints are displayed on the statusbar … little things like that. Plus, C#’s toolbar stuff is abysmal – you can’t write event code for each toolbar button, you just have to figure out which button was clicked from a generic toolbar button clicked event and then carry out the specific action for that particular button. I hated that … but I digress …
I managed to get the UI going pretty fast and then came the actual data extraction stuff. The UI had a web browser component where the user selected the data that they wanted to extract and the identification of the selected portion on the web browser view was simplicity itself since I’d done it many times before – all I had to to do was get an IHTMLDocument2 interface for the browser component and then get the selection property of the interface to get an IHTMLSelectionObject interface. Now came the tough part, actually parsing the stuff. I’d assumed before (not so sure that’s how it should be done now though …) that if I was able to create a control range using the createRange method for the selection, that I’d be able to get a list which would have the HTML tags and their attributes neatly separated. This was what I’d been trying to do in Delphi a couple of times before but always ended up failing. I thought it would work in C# but what do you know? I failed again :p So, I’m beginning to think that maybe it’s my approach which is flawed.
Anyway, since that approach didn’t work and a few others I tried didn’t either, I decided to go back to manually parsing the selected HTML. I did find something that I had not known before – that the IHTMLTxtRange interface created by createRange had both an HTMLText property as well as a Text property. I’d always been using the Text property before but now I used the HTMLText property since I had found that most of the information I needed was in table cells – so all I had to do was isolate the table cell information and work with that. I wrote a new function to isolate just the text in table cells and then the rest was just a matter of coding … It all works fine now – at least I think so but I’ll know for sure once my friend has had a go at the final app …
March 5, 2003
I was able to figure out the solutions to all the minor problems I had with the web-updater component yesterday and the code is finally done, but not tested yet :p I even added in the code to handle optional components that the user can decide not to update at the current moment though I have no such components yet. As far as I can tell, the code came together really well but since I am still putting together a demo application to test the functionality, I don’t know for sure that it works the way I want it to and that it works smoothly. I’ve already started work on a demo application though and should be able to see if it works today. In the meantime, I’ve also thought of a few problem areas and improvements overnight and that too can be incorporated into the component.
I still have no idea how much overhead that the web-updater component will add to Blog and while everybody says that download sizes of a few megabytes are no problem, I still seem to be stuck in the early dial-up days since I feel guilty at each additional kilobyte :p Of course, some of the UI changes I have in mind will add a lot more than a few kilobytes (especially the replacement of all the data grids with something a lot better looking and more functional) but I’m hoping the the web-update component will over set that eventually by the fact that you don’t have to download the full installer each time you want to update but instead can download just the bit(s) that you need. Let’s see how that goes as things progress though since the proof of the pudding is always in the eating :p
March 4, 2003
In my usual quirky and unpredictable style, I’ve put the CD cataloging application on hold and gone back to the web-updater component :p I tested its functionality yesterday and after some tweaks and bug fixes, was able to get it working with a single file download. Of course, I had to immediately start working on the source to handle multiple files and to implement a mechanism to assign versions to each different component and to check versioning on each component separately and download only those that have been updated. I’m still trying to get all the details into place for that. While the basic idea isn’t much more different than doing a single file, the actual implementation details are bogging me down – such as how do I send update information to the parent component since I can’t do a simple old version number and new version number deal as I would for a single component. I’d have to send a whole list containing the component name and the old version and the new version. Add to this the fact that I also want to go by release date since the same version component might be updated or fixed and re-released with a new release date (yes, I know I can up the version number here but there are instances where this is not practical due to my internal beta numbering system) and the fact that I also want to provide optional update components (like plug-ins) that the user can deselect from the download list, and the complexity grows ever more :p But I’ll work it out …
In the meantime, don’t expect Blog 8.0 to be out soon :p Even the first work-in-progress release containing the web update stuff should take a while since I’ll probably start working on a few other things (probably including the CD cataloger which I currently call DiskMan and maybe even a rebirth of PostMan due to certain other circumstances …) concurrently. BTW, I’ve heard from one user that he loses custom snippet toolbar buttons on restarting Blog. Now this was one of the main fixes I implemented for the 7.1 release and it seems to work just fine over at my end. So I’m not sure why it’s not working for him. Are custom snippet toolbar buttons working fine for everybody else? Or doesn’t anybody use custom snippet toolbar buttons anymore? :p