SBT and IntelliJ Idea
Recent versions of Idea (14 at the time of writing) play along quite nicely with SBT (Simple Build Tool - not so simple in fact). It can load project definitions, even when multiple subprojects are defined, and work with them. Unfortunately, it does the reading only once, when you import the project into the IDE. If you update your definitions afterwards, for example, when you add a new dependency, Idea might not be aware of the change. How to fix that?
Praise to Idea (and to hell with Eclipse)
I gave Eclipse its fair chance. To be honest, I gave it more than one chance over the years. Each and every time it was a disappointment. It is actually amazing how broken the beast is. I tried various version and every time I tried to do anything that was even slightly out of simple Java editing using Eclipse’ own project format, the thing failed in the most miserable way. For example, I tried repeatedly to install Android plugin so that I could write code for the platform. Occasionally it would succeed, only to be broken later by deployment of some other harmless plugin, which would not play along. And recently I was not able to install ADT plugin at all.
More on multi-platform mobile development
All software engineers hate to write the same thing twice. However, at the moment it seems unavoidable when one wants to support both iOS and Android. Some strategies exist to avoid them, however none is perfect. For example, Phonegapp allows to develop your application in HTML/JavaScript, but the look and feel is not as native as one could wish, performance is bad for anything complex and your code is at the mercy of hackers. There are some commercial platforms which allow you to write in C# and then deploy on both iOS and Android. This is not ideal either, until Apple and Google respectively start supporting .NET officially.
DSL in Scala
DSL (Domain Specific Languages) are, as the name implies, software development languages created for a specific niche or limited domain. Where could one use a DSL? For example, when writing a library to evaluate highly complicated financial products, it might be very beneficial to have a language designed to describe such products. The language will check correctness of a new product, will allow sharing of common pieces of definition, will be able to generate output that can be fed into other systems (risk calculation, trade processing, graphic representation). See this paper for a real world example of such a DSL.
Scala developer's dependency on Java
Scala is a great language. One of its strengths is the effortless interoperability with Java. However, given the fact that the language is still evolving, some compromises are needed in order to facilitate cooperation between Scala in Java. In effect, sometimes you can’t write 100% pure Scala solutions. Sometimes you have to add some Java code to your project, even if very simple one. There are two common examples of this: enumerations and annotations.
New Google Inbox - first impressions
Yesterday I received an invitation to Google Inbox - a new mail service from Google on top of the famous GMail. I wanted to use it because it provided reminders and allowed you to snooze emails in the inbox until later. I find these features extremely useful. However, the current versions of both Android client and the web interface are not without issues. Here are some of them I have noticed so far:
Android 5.0 - Lollipop
I have upgraded from Android 4.4 KitKat to Android Lollipop on my Nexus 5 mobile phone over the weekend. Some observations so far:
- Overall interface looks slicker and prettier
- The system seems slightly faster
- Automatic battery saving regime sounds nice
- I could say both good and bad things about the new notifications system:
- It tries to be more intelligent
- It is less useful when the screen is locked - I find tray area icons a much more informative and laconic option
- It is less secure from privacy point of view - the email notifications clearly show your email address even with screen lock - I think it’s a privacy oversight
- Multiple notifications can clatter your lock screen
- All these new features are almost not configurable
- Multiple notifications can clatter your tray area
- A number of applications failed to work correctly after the upgrade. Reinstalling them fixed most of them. My SSH/SFTP server is still broken, so I sent an email to the developer. We’ll see if it’s fixed in some reasonable future
- I am still able to connect to the phone via MTP and transfer files
- I find the extra swipe one needs to perform before unlocking the phone quite annoying and counter-productive
- Some people have complained they couldn’t reach me by phone. It’s not clear if it’s my device’ fault or they had issues on their end. A number of other people could call me just fine. I was able to place calls without issues
- It sounds like the OS clips audio track at the end during playback. I haven’t seen a setting which would control it
Black on white in Chrome
Using Stylish extension, you can have the following style on a web site, which colour palette is too bizarre for your eyesight:
<br />
/* Black on white */<br />
html, body, * {<br />
background: #FFF !important; color: #000 !important; background-image: none !important;<br />
}<br />
This is just a basic example, you might want to refine it to suit your needs. Possible options: change the appearance of visited links by changing the style of
a:visited
; remove images by setting
Mobile multi-platform development
Again I find myself thinking about how to write as little code as possible when developing applications for various mobile platform. I do find it annoying in the extreme, that iOS, Android and Windows Phone all have mutually incompatible technologies. As if they were doing it on purpose. But maybe they just do? It helps the companies to lock in software developers as well as end users, doesn’t it? Maybe they hope, that the developers won’t bother to write code for all the platforms and will just stick with one. Well, that doesn’t seem to be the case - any serious project is quickly ported to both iOS and Android, with Windows Phone and Blackberry sometimes joining the fun.
Using SSH in scripts ignoring known_hosts file
Sometimes you want to automate some SSH command execution and don’t really care about checking the remote machines in
~/.ssh/known_hosts
Warning: do this only if you really understand the consequences! I.e. it is very silly to ignore known_hosts on any machines across the Internet. It makes some sense on your intranet, where servers are rebuilt frequently and where external access is restricted; or where the user, executing the script, doesn’t have write permissions for its own home directory, so no known_hosts file can be created. And even then think long and hard before using this trick: