From the Google Chrome extension developers group:

Hello extension developers,

Yesterday, the Google Chrome extensions gallery was updated to a new
version.  Here are some of the visible changes:

1.) The “Most Popular” section on the landing page was renamed to
“Popular”.  This section will now feature a rotating random subset of
popular apps in the gallery.

2.) If your extension uses the i18n package, you can assign embedded
items (such as screenshots) to specific locales.  To test the gallery
in a different language add ?hl=<language code> to the end of a
gallery URL.  For example: https://chrome.google.com/extensions?hl=es

3.) If you try to upload an extension which requires NPAPI or file
access, you will now receive a notice that your extension will need to
be reviewed before it will go live in the gallery.

In particular, we’re very excited to improve internationalization
support of extensions in the gallery.  Developers who translate and
localize their extensions have a much wider audience of potential
users they can attract.  If you’re interested in how extensions can be
internationalized, please read our announcement blogpost:
http://blog.chromium.org/2010/01/google-chrome-extension.html

Happy coding,
~Arne

 

A little while back I was trying to make a small IRC bot but I eventually lost my interest in it. While writing the bot I had to write a regex to match the raw IRC message pattern. A friend (thanks Jobe) on IRC came up with the following regex:

^(?:[:@]([^\\s]+) )?([^\\s]+)(?: ((?:[^:\\s][^\\s]* ?)*))?(?: ?:(.*))?$

It will match 4 groups (source, command, target and the parameters). A small example in JAVA:

Pattern pattern = Pattern.compile("^(?:[:@]([^\\s]+) )?([^\\s]+)(?: ((?:[^:\\s][^\\s]* ?)*))?(?: ?:(.*))?$");
Matcher matcher = pattern.matcher(line.subSequence(0, line.length()));
 
if (matcher.matches()) {
	//i.e irc.mibbit.net
	source = matcher.group(1);
	//i.e 433/NOTICE
	cmd = matcher.group(2);
	//i.e RoomBot/#mibbit
	target = matcher.group(3);
	//i.e I have 3093 clients and 1 servers
	param = matcher.group(4);
}

Would you have done differently?

 

Do you find it difficult to remember which loop you should use when developing? There are a few rules of thumb:

  • If you have to iterate over a collection of elements the use of a for-each-loop is almost always the most elegant solution.
  • If you need a loop that is not used for a collection but in example to repeat a certain action a few times the for-each-loop can not be used. In that case you have to choose between a for-loop and a while-loop. A for-each loop can only be used for collections.
  • The for-loop is a good choice if the number of iterations is already known (how often the loop should be passed). This information can be stored within a variable but may not change while passing the loop.
  • The while-loop is a good choice if the number of iterations is not known. The end of the loop can be determined by a condition. For example looping trough a file line by line till you reach the end of the file.
  • If you iterate over a collection of elements and you want to remove an element out of the collection you should use a for-loop in combination with a Iterator if you want to go through the entire collection. You should use a while-loop if you want to discontinue execution of the loop before it has reached the end of the collection.

I do use these rules of thumb when developing applications in the JAVA programming language. Each language may have it’s own way of doing things best.

© 2011 Joshua Lückers Suffusion theme by Sayontan Sinha