Skip to main content

PhpStorm And Git SSH Keys

PhpStorm has amazing git integration. Pulling (cmd+t) and committing (cmd+k) work like a charm and are visualised well. During a commit you can even select a file and hit cmd+d to see a last-minute diff of the changes you're about to commit. In that window you can still fix any mistakes that were about to be committed.

I set up a project recently that required a public SSH key to be on the server in order for me to gain access to the git repository. But when performing a git pull PhpStorm told me this:

Fetch failed: fatal: Could not read from remote repository.
Update canceled

No more information than that.
Now, `git pull` on the command line worked like a charm and debugging the SSH connection with `ssh -vvv` obviously didn't show any problems.

The problem stems from the fact that PhpStorm uses the default public key to connect to a git repository and it expects it to be named "id_rsa".

I have multiple projects set up on different git hosts and it always seemed to take the right key. What happened to be the case though was that my ~/.ssh/config file always happened to have the hostname of git host as its "Host" entry.

This time I had set it up so that "Host" was named something else and "HostName" had the actual fully qualified domain name.

Of course when PhpStorm pulls or pushes to the git repository it checks the config file of the project's .git folder and that will have the actual hostname in there. It _does_ check for an entry in your ~/.ssh/config file but in my case it did not find a "Host" entry with the name it was looking for. When PhpStorm does not find a matching entry in ~/.ssh/config it will default to using the key with name id_rsa.

I did not have an ida_rsa & key pair in ~/.ssh so PhpStorm failed to connect to the git repository.

The two things you can do to fix this are:

1) copy the public and private key-pair you'd like PhpStorm to use to and id_rsa respectively


2) Rename the "Host" entry in ~/.ssh/config to actually match the domain in the project's .git/config file

Gripes About Open Source Software

Naturally, I think, when a product gets chosen to solve a certain problem there is a certain naivety with people that nudges them into thinking that the product they’re going to rely on actually works as they expect it to work. It isn’t until after you’ve spent time studying and using it, when the initial shine comes off and the true product starts to show itself, that you know if it was the right choice.

Another factor that heavily influences the choice made is the cost of the product. Open Source Software is often free, and that is great. That is to say, it’s free up front, you have no idea about the Total Cost of Ownership down the line. It may not cost you cash to obtain the product, but it might still cost you time, and thus money, trying to understand how to use it. To the decision-maker however, free is a very powerful argument.

And then there’s a third big influence when you’re choosing a product, whether it be as a company to be used by your developers or by yourself as a developer, and that is the idea that Open Source Software is malleable. You can modify it to fit your needs. Even if it doesn’t completely solve your problem out of the box, it can be made into something that does.

The first factor is not a jab at Open Source Software as such. Closed software can be terrible as well but I’m willing to argue that with OSS it’s more of a crapshoot. Closed software is usually paid for, there’s a business model involving money. The company distributing the software needs money to survive. If they sell bad software they will cease to exist. So unless the product you are about to buy is really new, you can be fairly certain that it works well enough. With OSS this is much more of a gamble because there is way more choice. When choosing a product, or framework, or even Operating System you don’t know whether it will work, whether you’ll find and get support, whether the product will get abandoned or if something new shows up and steals the show. Imagine how a company must feel if they trained all their developers in Angular only to be outdone by Polymer a year after.

The second reason, the cost, looks good on paper because there’s a nice 0 in the “Total Amount” column. Projects get sold on the premise that cheap solutions stay cheap, but that is not guaranteed. Especially not when the developers have never used or integrated that software package. No trustworthy estimate can be made and there is a chance that the project starts slipping and goes over budget. The further the project advances the harder it becomes to drop the problematic free software because of the billed man-hours invested in it trying to make it work.

Third, there is the idea that when you have the code, you can change it. But when software gets chosen in the hope that it solves a problem for your customer, you can safely assume that you do not want to get involved in the development of this product. You do not want to help improve the software. You want to get in and out. The company chose it for certain reasons, one of those was cost. You don’t generally want to skim the profit your company makes by fixing bugs in a product that isn’t your company’s. I’d even say you can’t, without asking.

And then the call comes in. The client has a problem. They try their best to come up with a vague problem description and off you go. You start debugging. You dive into the product you hardly know anything about. Though as a developer you have knowledge of two incredibly simple but powerful tricks. You know how to print text and how to tail a file.

This brings me to the biggest gripe of Open Source Software. The incredible amount of time wasted on Open Source Software by amateurs, enthusiasts and developers that don’t know the software, but they know how to error_log and System.out.println and printf. Trying to work their way through code, hunting for that one bug that’s making the thing they want to work not work the way they want it to. And then, after hours of hunting they find the problem and they go on freenode to ask for help about the next step.

There, in that project’s IRC channel on freenode, they’re then told to write a bug report with a reproducible and if possible a publicly accessible test-scenario. They’ll spend another hour or so gathering their thoughts, writing it up in a forum they first had to create a new account for only to have their bug sporadically looked at and either forgotten or, if they are lucky, fixed in a release months, if not years, from now.

The sheer inefficiency in much of the Open Source community is mind-boggling. I think it’s beautiful that so many amateurs put in so much of their free time into helping out. But it is sad that all that time is spent so inefficiently compared to what a full-time developer that knows the product can do. A developer with the right debugging tools to cut through the product with much more ease than someone who spends a day looking at code he’ll never look at again.

That last bit isn’t even true. When in the future that client calls again with another problem you’ll be back at square one:

error_log(“Do we get here?”);

Link Exposed Filter-Block To Panel Page In Drupal

Creating a search page in Drupal is easy, exposing a filter in a block is easy too. The exposed filter-block knows where to submit the query to because it knows about the path of the search page.

But if you don't want to create a search page, just a Views content pane and insert that in a panel page, the exposed filter-block does not know where to go to as a Views content pane does not have a path. The trick here is to set the "Link display" to "Custom URL" in the Views content pane's "Advanced->Other" settings and fill out the path of the panel page that holds the Views content pane.

For instance, if you've made a panel page with "search" as the path and it contains your Views content pane for search-results... then set the "Link display" for that Views content pane to "Custom URL" and "search". Now the exposed filter will link to the search panel page.

If all else fails you can also try to set "Use Panel Path" to "Yes'".

Remotely Administering Your Grandparents' Computer

When I got my granddad an iMac I knew I was going to have to administer it remotely. OS X makes this easily configurable, and I will go through the steps of setting up your parents' or grandparents' Mac. First of all, set up the new computer like you normally would if it were your own. Choose a username for yourself in the setup, not the one for whom the computer will be for. The account for your parent or grandparent will be added later. The first account created during setup of the computer has administrator rights. If you are doing this on a computer that has already been set up for your relatives then you will have to add a new user account and make sure it can administer the computer. Modify the already existing account and uncheck the "Administer this computer" checkbox so they cannot administer the computer anymore. Effectively making your new user account the sole administrator of the computer. When the initial OS X setup has completed and you are logged in with your own account, make sure to go to System Preferences->iCloud and check that "Back to my Mac" is turned on and functioning properly. The other iCloud functionality can be turned off. All you want is to be able to reach your parents' Mac over the Internet when they turn it on.

You can verify whether it is working if you see the newly setup computer in the "Shared" section of Finder on your own computer. The screenshot below shows "Jozef's iMac" in Finder.

If you do not see the computer in Finder then check System Preferences->iCloud again. It could be that Back to my Mac gives a little warning about it not being able to connect to the Internet. A setting might have to be changed on your parents' wireless router. The router needs NAT or UPnP enabled. Once this works go to System Preferences->Users & Groups and add a user account for your parent. Make it so that "Allow user to administer this computer" is not checked. You will be the administrator, not them. When they have their own account you are done. You can go home and every time your relative turns on the computer you will see it appear in your Finder's Shared section. Now here's the genius. Back to my Mac doesn't just allow you to administer a Mac remotely, it also lets you help your parents or grandparents use their computer. When clicking "Share Screen..." to connect to the remote Mac you will be presented with the option to log in as the administrator without interrupting their session... but also to share their screen in case you need to assist them.

This makes it such a safe bet buying relatives a Mac if you have one yourself already. The software to administer it and help them if they need assistance is built right in, it's beautifully integrated and easy to understand. I think it is one of the unsung advantages of Apple's OS X eco-system.

Drupal 7, Multilingual, Panels and Node IDs

When working with Panels in Drupal 7 it is possible to add an existing node to a panel. The relevant part of the UI looks like this:

Its help text says you can just type the node ID straight away, or use URL arguments to identify them. This works as long as the website isn't multilingual. As soon as it's multilingual though the ID entered in this field doesn't have to be node ID but the translation node ID, or tnid, of the node that has to be displayed in the panel.

The help-text in that case is wrong.

You'd expect you'd be able to add the node ID and Drupal would get the tnid of the node when it needs to display it, but it doesn't. It just assumes it is the tnid and shows the node in the correct language with that tnid.

About BNP Paribas's Horrid Easy Banking app

A while ago I wrote about the BNP Paribas Easy Banking app for iPhone and how it has different password input validation than the input field on their website for Belgian customers.

After using the app I thought I should write about it some more. I care very much for details in a product, especially if I know the producer of the app has the means to put in the effort of taking care of every little thing. BNP Paribas is a bank, they surely have a lot of money. The problem is of course that they're a bank. That means they move at glacial speeds when it comes to technology. This has always been common knowledge but it's not just a myth, it's true as I know someone who works there as a developer.

BNP Paribas is a French bank, that implies their English is abysmal. This too, is common knowledge. Here's one example.

"This is your first time connexion"? Are they serious? Things like that irk me. But we're not done yet, here's the next screenshot.

"Please send once an empty texte message..." That is so French (they even spelled "text" in French) it's hiliarous. The whole explanation does not make much sense either. Also, there are arrows on the bottom that don't do anything. There is no previous or next page. You could argue that they're greyed out and that they'll become active as soon as there is a page to switch back to. I've looked through the app and found a section where there's more navigation possible. When on the home-screen, you can try and tap on the hard-to-hit "Troubles signing in?" text which does not look like a link or a button at all. When tapping it you end up at the professionally named "faq logon" section where UI atrocities like this take place.

I can't find a fitting description here. Do the BNP Paribas developers even know what they're doing? Is there anyone in charge of UX? I think it's safe to say that, seeing as we're discussing a bank here, there is no-one in charge of design and UX. The page has a back button, awkwardly placed underneat the "Close" button... and the arrow-keys on the bottom are still showing and still greyed out. I haven't found a place where they have a purpose. It's a sad state of affairs and these are just three examples, there are more.
Have you noticed how, in the screenshots, the app is not optimized for iPhone 5? I happen to have one, and I'm sure a lot of their best clients carry do too. The iPhone 5's been out for almost half a year now, it wouldn't be a bad idea to cater to their clientele.
BNP Paribas Belgium, if you happen to read this...

  • Please, have your app proofread by someone who's a better English speaker.
  • Don't prompt us about our apps being in Dutch because our "contract" is in Dutch and then show an English user interface. If you want to do it right you have us set the language in the app.
  • Upon starting the app we do not need a seven second animation of the BNP Paribas logo. We just want to get stuff done.
  • Optimize the Easybanking app for the iPhone 5. You make yourself look bad not doing it.

Getting Granddad A Mac

A Sunday not too long ago I visited my granddad for his 89th birthday and he asked me to take a look at his computer again. Some ISP settings had changed and his Outlook Express e-mail client didn't fetch or send e-mail anymore. The lady at the support centre directed him to their webmail client, but that's just not as good.

My granddad had a very old Windows XP desktop tower with a small 15" display, doing no more than 1024x768, a 1GHz CPU and 384MB RAM. It took minutes to boot and sometimes minutes to open Internet Explorer windows. It was also very noisy. I've been wanting to get him a new computer for the past 3 years but he always told me it wasn't necessary. He found his computer good enough for what he needed to do with it. Personally I attribute his resistance to a new computer as fear for something new. He is 89 years old now and was 86 when I first talked to him about a new computer. People don't like change after a certain age. Young people find it incredible, but old people just do not easily learn anything new anymore.

Of course, the computer I had planned on buying him was a Mac. One might argue that getting someone a Mac, coming from Windows XP, would be too big of a change but think about it... How much different is going from Windows XP to Windows 7, or nowadays Windows 8? I dare to say the learning curve is just as big (with Windows 8 even more so) than going from XP to OS X 10.8.

For some reason I couldn't figure out how to get his e-mail client to fetch e-mail again. Innerly I got frustrated that everything took ages to accomplish and made the decision of getting him a new computer. I didn't tell him I was going to, he'd argue, again, it wasn't necessary. Sometimes you just have to tell people what to do and what to use because they don't know any better.

The next day after work I got him the cheapest iMac and called him up. I said: "Granddad, don't be upset, I just got you a new computer. I know in the past you told me not to get one but I think it's necessary. A computer should be fast, easy to understand, not need a whole desk just for itself and be noiseless. What time do you go to bed?"

It was 18:30 when I rang him up and he told me he usually didn't go to sleep before eleven so I said: "Good. I'll be there in an hour."

Unboxing the iMac was an experience, he expected a traditional desktop PC and was amazed:

"So we don't need this (big) keyboard an mouse anymore?" — "No."
"And this tower down here?" — "Nope."
"And these speakers?" — "Neither."
"The monitor can go as well?" — "Yep."

All those cables, gone. The keyboard was wired, his mouse was wired, the monitor had 2 wires, power and data, his speakers had wires to the back of the desktop tower, he had a USB hub because his old computer only had 2 ports, the tower had a power-cable as well and then there was the ethernet cable for Internet access. His Internet router was a wireless one but the computer didn't have a Wi-Fi card in it.

After unpacking I plugged in the one cable that comes with an iMac and turned on the computer. It frees up all those messy cables and in fact the whole computer table could go away. The iMac is so small it can just sit on his proper wooden "bureau" and take up no space other than the foot on which it stands.

After running through the install I set up Mail and iCloud for him and logged him into the iTunes Store and Mac App Store. I made it so that scrollbars always showed. In the past I always thought that Apple made the wrong choice of leaving us the choice to turn on scrollbars. It turns out they were right leaving the option, elderly don't quite grasp the disappearing scrollbars and lack the knack of knowing that there might be more content, even if a scrollbar isn't showing. I also removed unnecessary apps like System Preferences and Launchpad.

That evening I taught him three apps, which I placed next to Finder on the Dock: Safari, Mail and Contacts. (I'd install Pages and Numbers later) He was thrilled to find out there was no right-click, saying: "Oh, that is so much easier."

The next day I got an e-mail from him, telling me what he had done that day, checking the header of the mail I saw:

Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))

My 89 year old granddad had turned on his new iMac, opened Mail, composed a new e-mail and sent it. Success.

The Solr Wildcard Problem And Multiterm Solution

A while ago I ran into a problem with Solr and wildcard searches. Turns out it's more of a little known fact than a problem, Solr treats wildcards a bit different than how one would expect.

Normally, when a user enters a search-term we will append '*' to it so it will find words starting with the term that is being searched for. Common sense dictates that when someone searches for "train*", the set of results will also contain the word "train" itself. But "train" is not part of the results. When looking for "train*" Solr will return "trainer", "training", "trains" but it won't return results with the word "train" in it.

In case you want documents matching the exact word as well you will have to change your Solr statement. Instead of searching for "word*" you'll have to look for "word OR word*", only then documents matching "word" will turn up in the result-set.

After discussing it with Nick Veenhof, it turns out that, as of Solr 3.6 there's been a new type of analyser introduced that addresses this shortcoming (although it seems to be more of a side-effect). The multiterm analyser type. Copy the query analyzer section of the text fieldType and change the type to "multiterm". What multiterm addresses is that when you look for "train*" it will run the query as if you've been searching for "train", "trains", "training", "trainer". You might be inclined to think that that's the same as searching for anything that starts with "train", but that is not the case. Without specifying the multiterm analyser the wildcard searches are not analysed at all and thus can't be used for stemming, or downcasing or accent mapping...

Specifying the new multiterm analyser will also "expand" the wildcard search to the actual word, in our case "train", which is what we were looking for.

In case you're using Drupal to interface with Solr there's an issue filed about this along with a simple example explaining the difference between a non-analysed wildcard search and a multiterm search.

Tomcat, Solr And Special Characters

If Solr does not return any results when looking for words with special characters, this post could explain why.
Solr's example schema.xml comes with the charFilter element to map special chars to their ASCII equivalents. Look for the following in the "index" and "query" section of the solr.TextField class:

<charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/>

You can open the mapping-ISOLatin1Accent.txt file to see what gets mapped to what.

What often gets overlooked is that Tomcat, which takes the search request URI, also has to properly encode those special characters or they'll end up like gibberish when it reaches Solr. This is simple to do. The URIEncoding="UTF-8" attribute needs to be added to the Connector element in Tomcat's conf/server.xml

It is not part of a standard Tomcat installation, which is what most people use when setting up Solr.

This is what the Connector should look like:

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" />

Now, when looking for "bacteriën" (bacteria) or "financiën" (finance) Tomcat won't mess up the 'ë', Solr will properly map them and look for "bacterien" and "financien".

At the time of this writing, a patch for this issue just got applied to Solr 4.1 which will take care of the encoding for us. It will ask the HTTPRequest for its character encoding and convert it correctly.

Ten Things I Wish Apple Does In 2013

2012 seems to have been all about the hardware at Apple. Retina displays on 2 new 10" iPads, iPad mini (magnificent device), retina displays on newly designed 13" and 15" MacBook Pros, complete overhaul of the range of iPods, a superb iPhone 5 and a drastically less voluminous iMac.

Apple knows the hardware department is top-notch, they're doing great things, nothing needs to change. They don't need to redesign anything and 4 years down the line their devices will still look the best. The problem lies with the software side of things. Things don't "just work" anymore.

Things don't just work anymore and that's understandable. Today's software-world is many times more complex than it was in 2004. Computing has changed. The era of the single desktop computer in a family's home, without any cloud integration, has passed.

Nowadays we have multiple devices each. Kids have their own notebooks for schoolwork, they are given iPads as entertainment devices, as they get older they get smartphones and their parents could very well be reading books on their own iPads once the kids are put to bed.

Together with the shift to multiple devices Apple has also pushed the digital consumption to all of those devices. We expect all our content to be available everywhere, all the time. In a world where not all devices are constantly online this creates technical problems. Apple's trying its hardest to get its iCloud infrastructure to keep it all in sync but there's work left to be done.

As 2012 was the year of hardware, I hope Apple does nothing but improve its software in 2013. Here is what I feel really needs to be addressed:

  1. Unify Apple IDs and iCloud IDs.
    Provide a way to merge the two IDs and stop the dichotomy between the two. There are people backing up things on their iPhones to iCloud with a different login than the one they buy content with on the Apple Store. It is a mess and it needs to be fixed.
  2. Gives us back our / / e-mail address.
    Long-time Apple users will feel the same. Those who've had e-mail addresses but refused to pay for Apple's abysmal service during the .Mac and MobileMe years never got their e-mail addresses back once iCloud rolled around the corner. Moreover, they can't opt to have iCloud e-mail because the <first part> is already taken by their own <first part> Apple ID of old.
  3. Make iMessage work.
    In the previous blog post I've written about it in great length: iMessage does not work well enough. It fails to deliver messages to iPhone when the user you are addressing has an iPad within Wi-Fi range, but he himself is currently somewhere without a data connection. iMessage does not fall back to sending a text message once 1 device has been found. When iMessaging, you primarily target someone's phone. It should arrive at the phone at all times.
  4. Make iMessage more sentient.
    Currently when I'm chatting to someone via iMessage from the computer my iPhone is going berserk. Do the way Google does it and don't make the phone buzz when iCloud knows you're chatting from the computer. Set a 5 or 10 minute timeout after the last-received message before an iPhone can buzz again.
  5. Update Maps POIs.
    Apple Maps is great. It is beautiful, it's easy to use, it works on the home-screen, it gives good directions. It gives them to the wrong destination. Apple's Maps app is great, there's not a wrong street on it, but it's their (Yelp's) POI data which is incredibly inaccurate. It is so bad it becomes unusable. Get rid of Yelp or do a major effort to update it, world-wide. Because I see gas stations where there aren't any at all, I see hotels 3 blocks from where they actually are, I see shops on the wrong side of the road... Nothing is accurate. I'd say that's OK for the POIs around where you live, because you know better... But you use POIs when you're somewhere you've never been before. People fully rely on this information when it is all they have. I've been updating POIs in my neighbourhood for 6 months, not one has changed.
  6. Sync "Do Not Disturb" via iCloud.
    When someone doesn't want to be disturbed, one could assume he doesn't want to be disturbed on any of his devices. Sync this switching on and off of the "Do Not Disturb" setting between all devices registered with the same iCloud ID. No-one feels like switching to "Do Not Disturb" mode on three seperate devices every night before going to bed. The same goes for "Airplane Mode".
  7. Make iCloud work for movies outside USA. (Update: Apple added this on 2013-02-27)
    This one's easy. When you're not in the USA, deleting a purchased movie from iTunes will delete it forever. It does not work the way music does outside of the United States. If it doesn't, then why does iTunes tells us: "Your movie purchases in iCloud will also appear whenever you're signed into the iTunes Store." Clearly it doesn't. Your movie purchase will not appear once you've deleted it. There is no re-downloading movies.
  8. Update iWork. (Update: Apple released iWork '13 on 2013-10-22)
    iWork dates back to January 2009. That's 4 years. That's older than most people's computers. It's seriously lagging behind in functionality. You only need one example: it still has a separate window for Search & Replace. Enough said.
  9. Remove excessive skeuomorphism. (Update: Apple released iOS 7 on 2013-09-18)
    Skeuomorphism is a good thing. Windows 8 looks too stark. But in iOS and OS X it has been overdone. iBooks is ridiculous, and it's telling that in an update Apple added the option to remove the book artefacts around pages. The calendar is ridiculous as well and we don't need shredding animations when deleting a Passbook ticket. Skeuomorph icons are a good idea because we do need to quickly recognize objects as address books and calendars, but the applications don't have to function like their physical instantiations.
  10. Update some OS X behaviour.
    When cmd+tabbing to Finder and no Finder window is open, or if it is minimised, show it anyway. I know it might not adhere to OS X's window-model but it's been an annoyance for years, especially for people switching away from Windows. Do not make us stare like fools at our desktop where seemingly nothing happened other than then menubar changing to "Finder". Just open a new Finder window, OK?
    On the same topic, get rid of the buttons to minimise and zoom windows. Zooming has not been doing what people have been expecting it to be doing for years. The people who "get" the zoom button are so few that they won't mourn its removal. Declutter the UI and get rid of zoom. You either drag the window out to your preferred dimensions or you go full-screen. No "zooming".
    Get rid of the minimise button as well, or find a way to make it "just work". Why introduce a preference to minimise windows in their Dock icons when it's almost impossible to get them back? It is very unintuitive. People need to hit F3 for Mission Control and see their windows. If there are any minimised, show them below the line like it was in previous OS X versions.

There you have it, my wish list of things Apple needs to address in order to reinstate the confidence its customers should have when using their products. I could have added more but ten things is enough. Let's hope they find their way to this page. Let's make things just work.