The Original Jelani Harris The one and only

16Sep/090

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
10Sep/0913

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