comparison

Java String comparison FAQ: How to compare Java Strings

Java String comparison FAQ: Can you share some examples of how to compare Strings in Java?

If you're like me, when I first started using Java, I wanted to use the "==" operator to test whether two String instances were equal, but for better or worse, that's not the correct way to do it in Java.

In Scala you compare Strings with '==', not 'equals'

Scala String FAQ: How do you compare string equality in Scala?

In Scala you compare two Strings with the == operator. This is different than Java, where you compare two Strings with the equals method.

Here's a quick demonstration that shows this works. If you run the following Scala String tests in the Scala REPL or in your favorite IDE:

A comparison of WordPress and Drupal (May, 2009)

Summary: A comparison of Wordpress and Drupal, circa 2009. (2011 Update: Drupal 7 is much easier to use than Drupal 6, which was described in this article.)

Perl if, else, elsif ("else if") syntax

Summary: A collection of Perl if, else, and else if examples.

Here's a quick demo of the Perl if/else syntax, including the "else if" syntax, which is really elsif. (I wrote this because after working with many different languages I can never remember the "else if" syntax for most languages, and elsif is pretty rare.)

The Perl if/else syntax

The Perl if/else syntax is standard, I don't have any problems here:

My first problem with Windows

In light of those recent Microsoft ads that show that Windows PCs are cheaper than Macs (without ever using the word "Windows"), here's my first problem with Microsoft Windows:

Three minutes and two seconds, how long it took to log into my Windows PC

Mac Pro performance comparisons from Macworld

Every year that I see the performance numbers on Mac Pro systems, I wonder why their disk subsystems are so slow compared to iMacs? Looking at these new 2009 performance numbers from Macworld, I'm again amazed that an iMac is faster working on a Zip archive than a Mac Pro is.

Perl comparison operators

Perl equality FAQ: Can you share a list of the Perl equality operators?

Sure. Here's a convenient list of the Perl comparison operators (also known as Perl equality operators, equal, or not equal operators).

The Perl comparison operators are different for numeric and string comparison tests, as you can see in the following table:

Syndicate content