Going electric; scheduling the AC on a Tesla

The last few blogs had a “not my usual content” text here, but this one is about software development. As it turns out Tesla is missing a -for me- very critical piece of functionality; being able to start the airconditioning (AC) system at a certain time. It is possible to turn on the AC immediately via the app using the fan icon (see the image below), but not automatically at 06:00, while I’m still counting sheep in my bed.

TeslaAppFirstScreen

But to my amazement, every Tesla car is accessible via the internet through a REST API. This API is what the Tesla app uses to access the vehicle. Using this API is not officially supported, but Tesla does not seem to mind people accessing it.

Okay! That is interesting! I’m a software engineer, I can handle a REST API…

(more…)

Continue ReadingGoing electric; scheduling the AC on a Tesla

Going electric, a closer look

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.

Charging

After arriving home, in one piece I may add, it was time to inspect the car closer. But first replenish that battery. I had a Tesla wall connector installed, and a friend of mine suggested to me to also install a Maxem load balancer. I’ll do a separate post on that. The point I want to make is that on all the video’s you see a sleek US style connector being inserted smoothly. So when I inserted mine, it did not go in as smoothly; the connector we have is more bulky and it does not do that smooth insert.

tesla-us-to-eu-charging-connector

But the car clicked, so okay! But then there was an error message in the car saying that it was charging, but not optimally. So I started calling both Maxem and Tesla, something was not putting enough juice in the car. 30 confusing minutes later it turned out I need to push harder against the connector, so it was in all the way. Ahm. Sorry!

(more…)

Continue ReadingGoing electric, a closer look

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