The Original Jelani Harris The one and only


Increasing performance of Adobe CS3 Flash in Vista

When I first started to use Flash CS3 in Vista I noticed that all of my flash movies were performing very very slowly.

Honestly .. I'm not sure why. But, here's how you can make it perform better.

Here's how to speed up flash CS3 for vista

Here's how to speed up flash CS3 for vista

  1. Navigate to your Program Files -> Adobe folder(s) -> Adobe Flash CS3 and find the Flash.exe.
  2. Right click on that file and goto the Compatibility tab.
  3. Check "run this program in compatibility mode", and voila, suddenly it's running as fast as it did on XP. Happy coding!
Tagged as: , , , No Comments

Case-insensitive replaceAll in Java

The replaceAll function in the java.lang.String class replaces each substring found in that matches the regular expression to replace.

String sentence = "The sly brown fox jumped over the lazy fox.";
String result = sentence.replaceAll("fox", "doggie");
System.out.println("Input: " + sentence);
System.out.println("Output: " + result);

Would output:

Input: The sly brown fox jumped over the lazy fox.
Output: The sly brown doggie jumped over the lazy doggie.

However there are cases where we want to replaceall substrings and ignore the case, or make it case insensitive.

String sentence = "The sly brown Fox jumped over the lazy foX.";
String result = sentence.replaceAll("fox", "dog");
System.out.println("Input: " + sentence);
System.out.println("Output: " + result);

Input: The sly brown Fox jumped over the lazy foX.
Output: The sly brown Fox jumped over the lazy foX.

To create the case sensitive version of replaceAll we do not need to create a new wrapper function or create a utility class somewhere. All we need to do is prepend the Case-insensitve pattern modifier (?i) before our regex to indicate that we don't care about the case sensitivity of the regex.

String sentence = "The sly brown Fox jumped over the lazy foX.";
String result = sentence.replaceAll("(?i)fox", "dog");
System.out.println("Input: " + sentence);
System.out.println("Output: " + result);

Input: The sly brown Fox jumped over the lazy foX.
Output: The sly brown dog jumped over the lazy dog.

Tagged as: , 13 Comments

No more updates to Google Notebook

One of the only Google app (apart from Gmail) that I use the most Google Notebook will have no more updates. Before I signed up to Google I used to keep all of the websites that I thought were useful in my bookmarks and that became really messy really quickly. Also with the useful firefox extension I can now just right click and add to notebook if I ever run across a website that I want to return to later.

Google notebook isn't perfect. I just wish they would continue making it a better product. But now that I think about it, Google is an company that makes most of it's revenue selling advertisements online (that I hardly see due to AdBlock) and I don't see how they could've made their Notebook app a profitable endeavor. I know that I wouldn't pay for a "pro" version, and that their ads  would be GreaseMonkey'd out or plain ignored - all I want is a list of bookmarks not solicitations!

Now I'm going to search online for other alternatives to replace and to transfer all of my bookmarks to. I'm looking at delicious right now - I just don't like sharing my bookmarks with the world too much. But maybe I'll let it go once I get my lifestream properly set up on here.

Filed under: Uncategorized No Comments

WordPress 2.7 is slick

I just have to say that the newest version of WordPress is really, really slick.  My favorite part is that now WordPress can upgrade itself and I don't have to rely on a plugin to automatically upgrade my wordpress pages for me.

At first it really disturbed me at how fast wordpress would push out updates, but now I really don't need to worry about it anymore. WordPress has now become it's own little platform. It's almost like SaaS (Software as a Service), but it's running locally on your server.

Now I just need to make some plugins.

Filed under: wordpress No Comments

Using overflow:auto for a tbody tag in IE 6.0

Guess what? It's not possible! in Opera 7.20, IE 5.5 or IE 6.0. Instead what happens is that it's treated like a regular table without the scrollbars. Also, the styling specified for the tbody is applied to every tr row. How lame.

Another reason why we all should just stop supporting IE 6.0.


Remove Anchors from a Url in Javascript

Here is something useful that I discovered in my programming for the Apparatus Complex. I needed to strip out the anchor portion of a link and leave the rest of the url intact. For example I wanted:

To look like:

Here's the ideal way to do this with Javascript:

	//Grab our current Url
	var url = window.location.toString();
	//Remove anchor from url using the split
	url = url.split(“#”)[0];

It doesn't get any easier than that. What this code does is grab the URL from the current window, and then splits the string where a '#' is. Whether or not if the '#' exists in the string, it'll truncates the string up to the '#' or return the whole url.

Thanks to Jonathan Rochkind in the comments for this simpler version.

Filed under: Uncategorized 8 Comments

JQuery is the best javascript library out there

I officially declare JQuery to be the best javascript library out there. So much documentation, so many plugins, so many interesting things you can DO with that library. I just lost 7-8 hours, implementing a prototype of a feature for my discussion site, Apparatus Complex. In particular it's a meta-game that I'm developing so that users can compete with each other in a role-playing game  while they wait for the site to update itself with content from other people.

So I had a crazy idea of using jquery and ajax to let people drag and drop equipment into slots, and then dynamically update what that piece of equipment would do to their statistics. Doing this in flash is really easy, I first got the drag and drop implemented (so easy with the Jquery UI), then I set the restrictions on which column each orb could belong in, and then I added the automatic update of the statistics just moments later. It was simply brilliant and it was pretty darn efficient. If you want to play around with this, it's located right here. The equipment orbs are generated randomly and so are the names.

By the way, MooTools and Prototype and Scriptalicious are okay as well. I'm just really impressed with JQuery right now.


Adding a delay to JQuery Functions

Recently I was working on a few functions that I didn't want to have activated immediately after hovered over a div. I neededthe functions to activate after a half a second of hovering by the user. To do this I created this this piece of code.

var display_timeout = 0;
$(".orb_space").hover(function () {
		if(display_timeout != 0) {
                // save a reference to 'this' so we can use it in timeout function
		var this_element = this;
                display_timeout = setTimeout(function() {
				display_timeout = 0;
				// perform things with this_element here buy referencing it like $(this_element)
				if (!$(this_element).hasClass('magic')) {
			}, 500);
		function () {
			if(display_timeout != 0) {

Let's go through line by line to see what's happening here.

Lines 2: The JQuery hover function has two parameters. The first parameter is for the function to call when the user hovers onto the element, and the second one is for when the user hovers out. Lines 4-16 consist of the first function and lines 19-24 consist of the second.

Lines 4-6: So if we happen to flash our mouse over the element very fast twice, this will make sure that we only have one timeout function happening.

Line 9: When we in the setTimeout function we need to remember a reference to our current element so that we don't have to do some tricky DOM navigation to get the hover activated element with the setTimeout event. It's just easier to just make a variable to remember the element.

Lines 11-15: First we reset the display_timeout variable, and then we can perform our necessary hover actions in this setTimeout function. The 500 indicates that we want this function to occur after 500ms.

Lines 20-23: This looks very familiar doesn't it? It's the same thing from lines 4-6. This is so that if the user rolls out of the hover element, the timer countdown will immediately stop and the hoverin functions will not occur.

Tagged as: 8 Comments

Old domain, new language

So I've been the proud owner of a new website that I was surprised to get: I've actually had it for awhile and nothing is there except an outdated version of WordPress, and a blank hello world page. I'm surprised that it hasn't been spammed (or hacked) to hell now. But now I need to do something with it.

I was considering making it a personal art portfolio, but now I'm leaning towards making it an art community where people share and critique each other's artwork. The only thing I'm concerned with is that I don't want people stealing art from deviantArt and claiming them as their own and having people complain to me about it. It's just one of those things I sorta don't want to deal with, and that I know I'm going to deal with when Apparatus Complex gets  popular in the future - when it's complete.

Of course before I actually go through with this community website I have to look at all of the "competition" and see what they do right and what they do wrong and then capitalize on those issues. That's business and research I suppose. Having facts and history and repeating it doesn't guarantee that a site will be popular.

Also, I do plan on creating this website in a new language. I've heard a lot of good things about Ruby on Rails (and not-so good things). I also just found out that my webhost, Site5, completely supports rails so there's no reason now why I shouldn't be learning this popular and new language.

The best way that I learn a new language is to have a project - or a goal - in mind so that I can visualize what my goal is and what I take the steps I need to do to get there. I'm not really one of those programmers that can just do all of the examples in a book and claim that I know the language. I have to get really deep into the planning of the project, and notice the parallels between the new language I'm learning and the old languages I already know. Like just skimming through some sample code, I notice that the way Ruby is structured it looks like Python with Java sprinkles. Or maybe, more like Java Flakes cereal with Ruby marshmallows.

(That actually sounds kinda delicious. I'm in the mood for Lucky Charms now.)

They say that once you learn/master one programming language, all of the other languages you want to learn get easier. I think that's 100% true.

Tagged as: , No Comments

Middleware is your friend

There's nothing wrong with reinventing the wheel. In fact, sometimes that's the best way to learn how something works. But if you just want to get something done, middleware is your best answer. Here is some that I personally recommend.

Blogging Software

WordPress - With thousands of plugins and full customization, why would you install anything else? Perhaps if you're the kind of person that sits around wearing black turtle necks and hates something because it's popular. But you're not one of those kind of people? Right? Expression Engine isn't bad either - but you pay for that kind of quality.

3d Engines

Ogre for C++, Python, and C#. A great 3d engine that my friend and I are using to create our games. Ogre has a great community, with a very helpful wiki to get newbies started. However, some of it assumes that you know a little bit about 3d graphics before the intermediate ones seem to be truly helpful.

Tagged as: , No Comments