Useful JavaScript Snippet

One of the coolest things in the PHP programming language is its excellent handling of arrays. The same, sadly, cannot be said for JavaScript 🙂

This small JavaScript function implements one of the cool functions available in PHP, making it easier to store things in an array, and then check to see if they’re in there later.

// Returns true or false based on whether the specified string is found
// in the array. This is based on the PHP function of the same name.
// Written by Beau Lebens
function in_array(stringToSearch, arrayToSearch) {
	for (s = 0; s < arrayToSearch.length; s++) {
		thisEntry = arrayToSearch[s].toString();
		if (thisEntry == stringToSearch) {
			return true;
		}
	}
	return false;
}

Assignment One… Owned

Well, after worrying that I had done something wrong or perhaps completely missed the point on my first assignment for EBS, I finally got my mark back…

Turns out there was nothing to worry about, and I actually got 91% for it! Now I can get into the second assignment, and hopefully keep it up to that standard.

The first one was about migrating a services-based company (I did it on a share-trading co.) onto the Internet, using E-Business in some way or another. It was specifically not about moving entirely online, just supplementing existing operations with online activity as well.

I’ll post a PDF copy of the assignment in a while, and I also have a bunch of assignments from the end of last study period that I haven’t posted as well.

webpad 3.0 Nearing Completion

Well, call me crazy, but I had some time off work, so I went ahead and worked on webpad Personal Edition 3.0. I got a lot done in the week or so that I was working on it, and it’s nearing a point that I will be happy with, barring one major hurdle: blog operations.

In version 3.0, I’ve decided to attempt to support 3 platforms for blogging, namely:

  1. blosxom (what I use)
  2. Blogger (what I used to use)
  3. MovableType (which I’ve never used)

This isn’t a problem in itself (apart from the complexity it adds to those operations :), but I don’t want to release anything for Blogger which is based on the current Blogger API, because they are planning on implementing the Atom API in the near future, which will be much better than what they’ve got now. In the meantime, blosxom is easy to support (filesystem-based, what could be better?) and I think MovableType is also going to be changing their API structure in the near future (as mentioned here).

I’m leaving all the blog operations until as late as possible in the development cycle for this version of webpad, but basically if the blog vendors don’t sort themselves out, I’ll just release this with blosxom support, and perhaps support for the existing APIs, then extend support and release a patch once Blogger and MT have implemented their new APIs.

This version also has some more advanced features like renaming and deleting files, creating new folders and XHTML compliance on all HTML that gets created directly by webpad. The interface has been updated as well to make it a little slicker, and hopefully load a little quicker (more reliance on CSS). The big news though, is that this version will be compatible with Mozilla browsers as well as IE (still working on some of the HTML tools for Mozilla though…). Coming along, coming along. Get on the mailing list at https://beaulebens.com/webpad/ if you’re not already, because I’ll be sending an email to that list with notification when webpad Personal Edition 3.0 is released.