Technological Musings

Thoughts of a technology enthusiast

Site security: Use pass phrases and not complex passwords

An excellent article on how to enforce pass phrases and why they outperform traditional ‘secure’ passwords with complex rules.

It’s also much easier, and less frustrating for your users.

Why passphrases are more user friendly than passwords

I recently had to change my Atlassian password. The password input placeholder read ‘A few words you’ll find easy to remember’. Nice to see they’re following this advice.

Learning Stenography for super fast document production

After listening to this podcast, I want to learn more about Stenography.

Why do it?

Achieving 150-200wpm would be awesome. Sounds like a steepish learning curve, but a much larger payoff than learning Dvorak or Colemak.

IntelliJ IDEA memory settings

From Note: Site no longer active.

Give more memory to IDEA and it will perform better. No big surprise, but some recommendations based on 3 different approaches. I now use the ‘Balanced’, summarized below. More memory without starving everything else on the machine.

2GB for Xmx and 2GB for Xms, more balanced approach to the memory consumption


For Mac, it’s in ~/Library/Preferences/IntelliJIdea15/idea.vmoptions.
For Windows, it’s in Program Files (x86)/JetBrains/bin/idea.exe.vmoptions.

Update: IntelliJ provides a shortcut from the Help menu to customize the VM Options. It will open or create the file in the OS specific location. On the Help menu, choose ‘Edit Custom VM Settings’.

Starting from scratch isn't always the best approach

Something to keep in mind. Green field isn’t always the best answer.

Here’s an example where they took a 10 year old existing application and applied UX. The end user was very satisfied with the outcome, and didn’t care about anything under the covers.

The author came to the realization that doing it this way made the most sense, as it would have taken much longer to start from scratch, and in the user’s eyes would only be marginally better.

Too often we want to re-write a system from scratch rather than update an existing one. Something to be very wary of.

Finding Tomcat files when running inside IntelliJ IDEA

Investigating a problem, and created a custom logger using logback. Defined the file location as ${catalina.base}/logs/filename.log, but wasn’t sure where to find it.

Did a full drive search and discovered where IntelliJ stores it (at least on OSX).

To save myself future searches, it stores it in ~/Library/Caches/IntelliJIdea15/tomcat folder where IntelliJIdea15 will reflect the current version you’re running.

Within this directory will be folders for the various Tomcat Run Configurations. Inside the Run configurations folder will be the logs, webapps and conf folders.

More IntelliJ hints and tips

I’ve been using the 15 EAP, and now preview for awhile, and really appreciate the new features.

JetBrains has released another ‘Tips and Tricks’, which includes some of the new features in 15. If you’re an IntelliJ user, it’s well worth skimming through the list to see if you’re not using a feature you could be.

Git: Better commit messages

To push yourself to write better commit messages, consider defining a better starting template.

Place the following text into a .git-message.txt file in your home directory:

# If applied, this commit will...
# Explain why this change is being made
# Provide links to any relevant tickets, articles or other resources

Then do
git config commit.template $HOME/.git-message.txt

Now when you do a commit, the above comments will appear and remind you of the important parts of a commit message.

Obviously adjust it according to your project’s standards and requirements.

Setting a default value w/o Null

In a constructor or other method, instead of using code like:

String value = (input == null) ? "default" : input;

you can use something like this:

// Guava
String value = Optional.fromNullable(input).or("default");

//JDK 8
String value = Optional.ofNullable(input).orElse("default");

IntelliJ: Tips of the Day

I will periodically post hints and tips related to IntelliJ features. I’ve been using it now for almost 3 years, and am totally sold. Yes, it’s not free, but I think the price is well worth it.

Built-in Clipboard history. cmd-ctrl-V/ctrl-shift-V.

Default is 20, but like most things in IntelliJ, it’s customizable. Editor/General. Maximum number of contents to keep in clipboard:

Context management (Similar to Eclipse Mylyn).
Task Management plugin. One of the plugins that ships with IntelliJ.

Load, save and clear context (basically open tabs). Join Context with changesets in version history. Connect to Issue Tracker.

Git support. If you’re running 14.1+, the Git support is very good. Especially for the most common actions.

In addition, you can have it perform actions while doing a commit. Organize imports, format code, analyze code, notify of new TODOs etc.

I still prefer Eclipse’s approach to this with save actions (i.e. performed everytime a file is saved), rather than at the point I’m committing, but it does provide the functionality.

IntelliJ: Replace text while preserving case

How many times have you replaced text twice because the basic word was the same, but the starting letter in different cases was a difference case?

If you use IntelliJ, you don’t need to do that.

In the replace dialog is an option for ‘Preserve case’. Click it, and IntelliJ will do the right thing.

e.g. change This text to this text

Replace ‘this’ with ‘that’. IntelliJ will convert text to

change That text to that text.