Apparently, you need to set the SelectionLanguage property of a JavaScript XML Document object to XPath so you can select nodes via XPath.

var xmldoc = new ActiveXObject("Microsoft.XMLDOM");
// or var xmldoc = new ActiveXObject('Msxml2.DOMDocument.3.0');
xmldoc.async = "false";
xmldoc.loadXML(xmlData);
xmldoc.setProperty("SelectionLanguage", "XPath");


After which you can use XPath to select nodes. This is inevitable for MSXML 3.
Posted by Alexis' Blog
I needed a hashtable implementation in JavaScript and here's what I’ve come up. It is used like this:

var ht = new Hashtable();
ht.put(“key”, “value”);
var val = ht.get(“key”); // returns null if not found


The implementation is like this:

function Hashtable(){
this.hash = new Array();
this.keys = new Array();

this.location = 0;
}

Hashtable.prototype.hash = null;
Hashtable.prototype.keys = null;
Hashtable.prototype.location = null;

Hashtable.prototype.get = function (key) {
return this.hash[key];
}

Hashtable.prototype.put = function (key, value) {
if (value == null)
return null;

if (this.hash[key] == null)
this.keys[this.keys.length] = key;

this.hash[key] = value;
}

Posted by Alexis' Blog
Filed under: ,
Songbird™ is a desktop Web player, a digital jukebox and Web browser mash-up. Like Winamp, it supports extensions and skins feathers. Like Firefox®, it is built from Mozilla®, cross-platform and open source.
Get Songbird
Posted by Alexis' Blog
Filed under: ,
I stumbled upon this site that provides quick reference to Web development.
Posted by Alexis' Blog
Filed under:
In VB6, in order for you to make the Printer object in VB6 recognize the return of the CommonDialog.ShowPrinter method, you have to set something like:

Printer.TrackDefault = True
' then show the printer dialog
commonDialog1.ShowPrinter

The only problem here is that the commonDialog.DefaultPrinter is set to True by default. Thus, it practically sets the default printer to the selected. Any subsequent calls to the Printer object follow the printer selected in the Printer Dialog Box. Essentially you are setting a default printer via the dialog.

I have yet to find a way to retrieve the hDC (printer device handle) from the CommonDialog Print dialog such that it can be passed to the Printer object--if it indeed is possible. Because right now, I don't think this is the most efficient way to do it.
Posted by Alexis' Blog
Filed under: ,
When using Ajax Pro, you have to add the runat="server" tag on the form to be used. In other words, you have to have at least one server-side form in the class whose type is to be registered as an Ajax class. Otherwise, you'll end up with a Compiler Error CS0030 Error Message Cannot convert type 'type' to 'type'. It took me almost an hour troubleshooting this.
Posted by Alexis' Blog
Filed under: , ,
A student/colleague during the recent Ajax Lecture at Mapua brought up Anthem.NET. It is an Ajax "framework" for .Net web applications. Since it's the first time I heard about it, I took some time learning it and how it works.

From what I've found so far, it makes it easier for developers to build Ajax-based dotNet web application. For instance, with the widespread AjaxPro library, you have to manually implement Ajax on each method to be invoked. Ajax classes can be attributed as such, yes, but if you want to make custom controls with Ajax implementation, you have to make it for yourself. In a nutshell, since AjaxPro is an Ajax "wrapper" that you can just reference to, you still have to get your hands dirty in creating the actual rich controls Ajax is famous for.

Anthem.NET has made it easier by packaging custom controls wherein developers can use the familiar "runat=server" tag and attributes such as PreCallBackFunction, PostCallBackFunction and CallBackCancelledFunction (among many others). These attributes are valid server-side control attributes that can call client-side JavaScript functions. This is interesting because, you have more control on your Ajax invocations.

I believe the backbone of Anthem.NET is very much like AjaxPro. Only Anthem.NET pushed it further with pre-built classes and server-side controls. It's actually more like Atlas.
Posted by Alexis' Blog
Filed under: , ,
... there is always a well-known solution to every human problem -- neat, plausible, and wrong. -- H. L. Mencken (1880-1956), "Prejudices"


This quote made me rethink my primary notions on my previous blog: Yes perhaps, the simplest solution is not that simple at all! It could be complex enough to be wrong.

Optimization

In general, there are two kinds of code optimization: one for speed and another one for space. By speed I mean the code executes in the least amount of time. By space I refer to code that executes in the least number of lines. It is oftentimes difficult to balance the two. But when you do, you get code that is atomic and easy to maintain.
Posted by Alexis' Blog
Filed under:
Yesterday I presented Asynchronous JavaScript and XML (Ajax) to a bunch of MSCS graduate students at the Mapua Institute of Technology. I needed to adjust my lecture to a level where most students (even those without or with minimal webapps experience) will be able to relate to.

It was a great opportunity and privilege for me to be able to present my understanding of Ajax. I was also a learning experience for me.

My Powerpoint presentation (with notes) can be downloaded here. The sample codes I used can also be downloaded and reviewed using this link.
Posted by Alexis' Blog
Filed under: ,
I remember doing my first few C/C++ programs in college using the Turbo IDE , which was still run in DOS. Now Borland is reviving it and packaging it with much more. Check out this link for details.
On Aug. 8, the company's Developer Tools Group, which is up for sale, is scheduled to announce single-language versions of the components of Borland Developer Studio, the company's IDE (integrated development environment) for Microsoft Windows and .Net applications.
Posted by Alexis' Blog
Filed under:
These past few days I have been exploring the OpenSource world and have been discovering great things from it. Most of my career so far have focused on Microsoft technologies, making me naive on the alternatives.

First experiment: install PHP, MySql and Apache Server. I've read from forums that the best way to go was to install them individually. Okay I skipped that part--since there are programs like XAMP and WAMP that does it automatically for me. Yes they are good programs and I've tried them but in the end I feel dumb and lost as to where to start. I guess the people from the forums are right. So I decided to install them piece by piece.

Particularly I was successful in setting up PHP on IIS 5. As Microsoft cheapskate as I am, I downloaded the MSI installer for PHP5. I had no problems configuring it to work on IIS since the installer automatically did it for me. (Don't blame me; I needed a jump start on the thing!)

Until I had a problem: I can't seem to employ Sajax on my PHP application. Loading images were quite a problem. (Footnote: I have been using Ajax.net for ASP.Net web applications.) First error I encountered was: "
Notice: Undefined index: REQUEST_URI in C:\WebSites\PHPSamples\sample_code\section_2\Sajax.php on line 30"
. Looking at the code, line 30 says:
return $_SERVER["REQUEST_URI"];
Apparently, there seems to be a discrepancy in variables among web servers. In this case, IIS does not recognize REQUEST_URI, instead it recognizes SCRIPT_NAME. I am not quite sure yet on this part but after changing that line, it worked. But I still can't make Sajax work properly on IIS.

So I decided to run my script on Apache. First task: install and configure Apache. Hmm, again it seems easy with the MSI installer around courtesy of Apache Software Foundation. But again as I'm used with user-friendly auto-configuring installers, I missed some manual configuration required. And when I finally had Apache up and running, I realized that I needed to configure it to run PHP scripts. As I don't know how, I searched the web and stumbled upon this one. That article suggests uninstalling the MSI-installed Apache web server and manually set it up with the procedures it cited. So I followed step by step and voila! It worked! Even the REQUEST_URI variable is defined on Apache. Now I may proceed with learning PHP with Ajax.

I have two web servers installed on my machine. I am running ASP/ASP.Net scripts on IIS while PHP on Apache. I have yet to find out how I can run both server-side scripting on IIS.

Lesson learned: Nothing gives a solid foundation than learning the basics. (I had to learn it the hard way.)
Posted by Alexis' Blog
Filed under: , ,
I stumbled upon this site containing tons of links for pursuing web development.
Posted by Alexis' Blog
Filed under:
In my pursuit to monitor my past and present personal projects, I needed to find alternate open-source programs. For version control, a friend recommended SVN. However I also find CVS rather helpful. According to my friend, both are "similar frameworks but with different protocol/implementation." I almost chose the CVS path since it readily has UI; unlike SVN which does not (please correct me if I'm wrong; I'm new to these things). I need to install third party applications: Tortoise SVN and Tortoise Merge. Meanwhile, there is also a CVS counterpart: Tortoise CVS. Two great open-source programs. Now, I need to study.
Posted by Alexis' Blog
Filed under:
More Posts « Previous page