Choosing a password…

My wife received an email from a good friend recently that contained a link to a website. My wife is pretty internet-savvy, so she was wary of the link, despite the source, as the email contained just the link, no subject and no other content. However, it did throw her a little because it was sent to other mutual friends as well (listed in the to field).

It was evident that the source friends email account had been compromised*, which prompted me to write this blog post about passwords and what makes a good choice of password.

There are many good articles on password selection that I highly recommend you read:

However, these are the rules of thumb that I generally keep:

  • Never use a single dictionary word or name;
  • Make sure it’s more than 8-10 characters;
  • Use punctuation marks or other characters (e.g. !, ?, #, $, & etc);
  • If you’re worried about forgetting your password, use a password manager app (The WordPress article above lists a few).
  • Change them, if you can, regularly (the password manager app helps with this).

If you have any other suggestions or articles on password security, feel free to post them in the comments section.

* I have no knowledge of the strength of my wife’s friends password, I just thought it would be good to reiterate password strength in light of the situation.

OSX 10.7+ Flush your DNS cache

Have you been trying to flush your DNS cache in Apple’s OSX with dscacheutil -flushcache and wondering why it doesn’t work?

Well, they changed it in 10.7 and 10.8. Sheesh, the nerve of them! To flush your DNS cache now, you need to use the following command:

sudo killall -HUP mDNSResponder

OS X keeps a local cache of resolved DNS queries for a time defined by the DNS server, but sometimes it may be necessary to reset the cache immediately and re-query a DNS server. For example, you might do this after an entry on the server is changed or a new entry is added.”

Job done! Enjoy.

JQuery UI’s Accordion and Internet Explorer 7/8

Recently utilised jQuery UI’s accordion widget for a client and found that we had some issues with Internet Explorer 7 and 8 where it wouldn’t open the other tabs. It was reporting an error:

Unexpected call to method or property access

Referring to a line in jQuery:

prepend: function() {
    return this.domManip(arguments, true, function( elem ) {
        if ( this.nodeType === 1 ) {
5855:           this.insertBefore( elem, this.firstChild );
        }
    });
},

It turned out that, as you may or may not know, Internet Explorer is very finicky when it comes to strict HTML code and after close inspection of my HTML code around the accordion, I had a hidden input field inside the accordion selector div (I was using the accordion to display a LOT of radio fields). Once I moved this hidden field outside the accordion div, it worked fine.

So, just keep in mind, for your accordion div, just keep it to the H3 heading and content div for each tab. Anything else will basically break it in IE7 & 8.

Turn Off Firefox’s New Mixed Content Blocker

With version 23 of the Firefox browser, they’ve implemented a mixed content blocker. This will block content that has been loaded from an non secure source, if you’re viewing a secure page (i.e. https).  However, it’s been shipped with a bug in that it if you allow the content to be shown, it only remembers it for that page load.

This turns into a rather tedious repetition of allowing the content. When you’re developing web content in a devel environment, that may include mixed content, it’s rather annoying.

Until that bug is fixed (reportedly in Firefox 24), you can turn it off in Firefox’s advanced config. Please note, that you should only do this if you know what you are doing and that the content you are browsing is indeed safe.

To do this, go to ‘about:config‘. In the search box, type ‘mixed’.

In the options that should appear:

  • security.mixed_content.block_active_content
  • security.mixed_content.block_display_content

Change block_active_content to false and leave block_display_content as false. This should enable the content without the blocking notification/actual blocking.

OSX Mountain Lion & AWOL Web Sharing

I just discovered that Apple had removed the Web Sharing preference from OSX Mountain Lion (10.8) when I tried to access my MySQL server on my MacBook Pro.

If you had discovered the same thing and are wondering how to get it back, I found this great guide by Neil Gee that fixed me right up.

Titanium – Always add a className to your table view rows!

Something that I’ve found to be increasingly temperamental is Ti Android’s differing ability (or inability) to handle different types of table view rows.  I’ve recently had a few situations where I’ve been stuck on a ‘WTF’ moment, trying to figure out what the hell is going on with my app in Android and why it wasn’t working.  Each time, it’s been one single thing that has been causing all the heartache and hear-tearing. The className parameter.

At the time of writing, Titanium’s SDK is up to version 2.1.1. I started writing Ti apps around about 1.5-ish and it was considered that the className property was more a performance helper in iOS than anything else. These days, it’s becoming more and more clear that it’s a necessity if you’re releasing an Android app.

So, remember kids, don’t forget the className parameter. If your table rows vary in any way other than the value of the title, then give it a different className.

Titanium – Gotcha with using events to update views in Android

While developing an app with Titanium Mobile which consisted of displaying messages (a bit like email), I was getting a crash in Android when I checked for new messages and updated the table views, however it was only crashing after I’d viewed the message list in a category and gone back to the main screen for a refresh. The frustrating thing is that it ran fine in iOS but not in Android. Read more of this post

Toolbars and other views in Titanium for Android

While doing some investigation for my own Titanium project, I came across someone who was having trouble putting a custom toolbar (because Ti.UI.Toolbar isn’t supported in Android) when using a full screen image view as a backdrop for their app.

Read more of this post

Using Windows via Parallels and Can’t Send Control+Alt+Delete?

After getting rid of my dogs-body windows machine which complimented my Macbook Pro at work, I started using Parallels 6 for all my Windows needs.  However, I was a bit confused that I couldn’t press Control+Alt (Option)+Delete on my Apple keyboard to send the Control+Alt+Delete signal to Windows to log in. Going via the menus – Devices -> Keyboard -> Ctrl+Alt+Delete – got very old, very fast.

After a bit of search and buried deep in a forum archive, I found that the following key combination will send the correct signal to Windows: Control+Option(Alt)+Command+Function(Fn)+Delete. Granted, it’s like mashing both palms on the keyboard at the same time, but it does the job.

OAuth-Signpost and Request Token 411 errors

If you come across problems with using OAuth-Signpost and HTTP 411 errors, then you may want to check whether your service provider allows requests via POST. As I found out with writing my Hattrick application, the latest version of OAuth-Signpost is hardcoded to use POST with the DefaultOAuthProvider despite having the javadoc saying it defaults to GET.

As Hattrick only allows GET requests, I had to modify the DefaultOAuthProvider code to default to GET but I also added a method to change the request type:

private String requestMethod = "GET";

protected HttpRequest createRequest(String endpointUrl) throws MalformedURLException,
 IOException {
  HttpURLConnection connection = (HttpURLConnection) new URL(endpointUrl).openConnection();
  connection.setRequestMethod(requestMethod);
  connection.setAllowUserInteraction(false);
  connection.setRequestProperty("Content-Length", "0");
  return new HttpURLConnectionRequestAdapter(connection);
}

public void setRequestMethod(String requestMethod) {
  if (requestMethod != null && !"".equals(requestMethod)) {
    this.requestMethod = requestMethod;
  }
}

This solved my 411 errors and haven’t looked back since.