Going electric, first drive

The ‘going electric’ will be different blogs from my usual beat. Not only because they will not be related (directly) to software development, but also because they are opinionated and personal reports; editorials about switching over to an electric car. They will list my personal joys and annoyances about the switch, but I’ll try to be fair and balanced.

Delivery

The delivery is fun with the unveiling process, where they remove an actual veil from the car. You get a quick run through of the basics, but since you also are a bit overwhelmed by the fact that you’re buying a new car, you follow suit. In retrospect, I would have liked a bit of time alone with the car, so I could inspect it, run my finger over all the gaps and see if they are ok. But they are definitely trying to get you on your way. “You really like to get going, don’t you?”… Hm, no, not really.

TeslaDelivery

But after listening to YouTube for 2.5 years I have a pretty good idea on how to drive the car; looky there… that right pedal makes it move. And next to it is the stop thingy. I’ll be fine. But it actually is that simple. There is no need to light a fire anywhere, so no start button to press. But also no reassuring vrooooommm that the system works and is ready, and that is somewhat eerie; sit, press brake, push down the drive direction selector, press the pedal and off you go.

(more…)

Continue ReadingGoing electric, first drive

Going electric, prelude

The ‘going electric’ will be different blogs from my usual beat. Not only because they will not be related (directly) to software development, but also because they are opinionated and personal reports; editorials about switching over to an electric car. They will list my personal joys and annoyances about the switch, but I’ll try to be fair and balanced. Oh, and this first one will be longer, so I’ll include chapters and pictures. 🙂

Pre-prelude

I’m a nerd, always have been. In primary school I was ridiculed because my fantasy sometimes got the better of me. Luckily nowadays nerds are cool, because people need nerds to make their gadgets work, so the world became a better place for me. But that could become a whole separate post. What matters is that technology always had my interest; I like spaceships, watch science fiction, and dreamt of flying on the Enterprise. But also more down to earth tech like cars and trains always had an appeal. Not in a way that I had posters of them on the wall, but those big American trains… As an adult, whenever I found a nice image, it was included in my set of rotating desktop wallpapers.

Besides beautiful images on my desktop, I read a weekly car magazine to know more about cars. Because, you know, supercars have a tendency to be totally unpractical. One of my favourite brands is Aston Martin, because they look good and actually are usable.

AstonMartin

(more…)

Continue ReadingGoing electric, prelude

TDD; an exercise in frustration

Recently I read an article about How to TDD a List Implementation in Java and it suddenly reminded me of an experience a colleague made me go through a few years back. At that time the company I was working for had a big piece of software with almost no automated tests, and they (of course) had stability issues. So I was an advocate of starting to write automated tests; by developers, by testers, unit tests, UI tests, the works, in an attempt to get the software stable.

After a year of hard work solely focused on bug fixing and writing tests, it finally started to pay off. (Yes, that is what it takes; the company decided to not release any new features for a whole year, but in the end it paid off big time. Major growth in market share, because clients took notice. But it took guts to choose that path.)

Testing had become common practice by then and at one point a colleague came up to me and asked me what I though about Test Driven Development (TDD). I said that it didn’t feel right, so he asked me if I wanted to give it a try.

Well… Of course!

(more…)

Continue ReadingTDD; an exercise in frustration

I have an idea; let’s write automated tests!

In the previous post I wrote about a lecture I did in Utrecht. It was about that companies decide that they “should be doing automated tests”, but are unaware of what that really means. Often the idea is triggered because it becomes apparent that even though a lot of money is spent on (manual) testing and testers, the quality of the releases does not really increase, and automated testing is seen as the answer. Which it is, at least partially.

In my lecture I stressed that automated testing is more than just rolling out JUnit. Automated testing involves careful consideration on what and when to test; a good testing landscape consists of several types of test, from unit tests, to integration tests and UI tests. And more importantly those should be in the correct ratio’s, ideally resulting in the famous testing pyramid (and hopefully not the dreaded testing cone).

testingpyramid

(more…)

Continue ReadingI have an idea; let’s write automated tests!

The occasional speaker

The JavaOne has ended and it was both under- and overwhelming. But on a more personal note I was not satisfied with how my talk went. Being an occasional speaker, I naturally am a bit nervous at the beginning, but somewhere along the line that usually goes away. This means I get into ‘the zone’, and feel inspired by the subject I am talking about.

However, this was not the case during my talk at the JavaOne; it kept dragging a bit, never gaining the momentum I’m used to. And I have been wondering about the reason; I’ve done the talk more often, so it is not that I don’t know what to tell on a given slide. It just didn’t… Take off.

So different from yesterday, when I was in Utrecht, giving a talk about automated testing. The setting there was… Cozy. Informal. I wasn’t even really nervous at the beginning, even though it was the first time I did the lecture, and I wasn’t sure if I had enough slides, or too many. Certainly the deck was way less pruned and polished than the JavaOne’s, but it took mere seconds to get into the groove.

Keylane

(more…)

Continue ReadingThe occasional speaker

JavaOne 2017 first impressions

  • Post category:Java

So this is my first visit ever to the JavaOne. I’ve been to many national conferences, but never to a yearly, world wide appealing one. And I’m both amazed and disappointed.

javaone

Amazed because of the conference size; integrated with the Oracle World, the conference hands out a paper with the sessions for easy reference. But instead of one for the whole conference, you get one for each day. And it is full. 6 large news paper size page full of almost micro sized printed sessions. You almost start to wonder if every visitor is a speaker. Doing ‘just’ one talk makes you feel insignificant.

Amazed because of the venue size; blocking off a street, people sitting and coding everywhere, distributed over 4 large buildings. Security everywhere. Police guiding traffic. JavaOne occupies only the second floor of Moscone West building, with over 20 conference rooms. Large hallways, several floors high, a HUGE podium for the keynotes, full with displays where just one of them won’t fit in my house. Impressive. Humiliating.

(more…)

Continue ReadingJavaOne 2017 first impressions

Full circle – the applet is here to stay?

  • Post category:Java

For those who have been following my blogs, or heard my ‘One application to rule them all’ talk, know that I’ve been hanging a lot of my spare time experiments on my hour registration applet. It has served me well for over a decade, but the fact that browsers no longer support applets forced me to make decisions on how to maintain that functionality.

The simplest approach would have been to convert the applet into a stand alone application. Not that big of a hassle; login screen, connect to the HTTP back end, and off you go. But I decided to try and write a JavaFX application instead, with a login screen connecting to that back end, which is able to run on multiple platforms. Just for the sake of experience.

But the discoveries made during this effort have uncovered some interesting gems, and I wanted to share this one: CheerpJ. It runs any old fashion applet in a browser via Javascript, without any changes to the code!

cheerpj

(more…)

Continue ReadingFull circle – the applet is here to stay?

The art of waiting

The hour registration application is working nicely, on windows, on android, on OSX, but there is always room for improvement. One of the most obvious issues is that the original applet is a lot quicker when retrieving data from the server. I suspect this has to do with the fact that the applet maintains a web session and that the JavaFX app does an authentication on each request. And yes, of course I could (and probably will) improve that, but it also is an opportunity to try out something else; asynchronous communication. Now, I could pull open a can of threads and try to do this myself, but there have been wheels invented for this. So in this post I’m going to try Java 8’s CompleteableFuture, RxJava and JDeferred.

The app’s communication is very suited to try something like this, because there are 6 separate calls being made to the backend, and some of those calls are depending on each other. The calls are:

dh2fx_fetchData
1. The hours for a given date.
2. Totals per project for the current week.
3. Totals per day for the current week.
4. All projects.
5. The favorite projects for the current user.

(more…)

Continue ReadingThe art of waiting

Is it a screen or control?

The common thread running through my hobby software activities lately, is the porting of my hour registration applet to a JavaFX desktop, mobile and web version. Yesterday I picked up work on the favorites; those projects who are currently most used.

dh2_applet

In the original applet the favorites (as seen on the right in the image above) are implemented as a list and share the same screen space as the full tree of projects. Switching between either is done using an accordion; a layout similar to a tabbed pane, showing a header and per header a content. The content of one tab is shown at a time, and switching is done by clicking on the tab header. The main difference is that the headers are intermixed with the content, and move up or down when other content is revealed. Not unlike an accordion has ridges that move apart to show the space in between. I wanted to have the same visualisation in the JavaFX version, I could have settled on a tabbed pane, but what is the fun in that?

Now, JavaFX 8 already has an accordion control, but it behaves differently from what I want. In my usage there is only one tab visible, while the default accordion can (un)fold multiple tabs, and even have them all closed. It’s a minor UI/UX difference, but not what I want, so I decided to write it my version.

(more…)

Continue ReadingIs it a screen or control?

ResponsivePane

In the previous posts I have blogged a lot about the ‘one code base’ application that runs on all popular platforms, from desktops like PC and OSX, mobile like Android and iOS, and finally on web with the use of JPro’s brilliant library. The core of that application was the fact that depending on the available screen size, or better: scene size, a different layout was automatically selected. Below on the left the MigPane based layout for desktop, on the right the same controls put into a TabbedPane for mobile.

Beside changing the actual layout, also a different stylesheet was automatically loaded, so (for example) the arrows in the data picker became more touch friendly. This worked perfectly, even dynamically adapting as you resized the application while running on the desktop or in a web browser. However, the code for doing this adaptive layout was intermixed in the application, and I decided to extract it into a layout manager called ResponsivePane. (more…)

Continue ReadingResponsivePane