Saturday 26 May 2018

HouseScanner: Motivation

I now have a small family and we live in a small flat in Malmö. We don't plan to live like that forever, and therefore we are looking for houses in the area.

Some of the requirements for the house are:

  • Location (not too far from our work locations)
  • Price (both a total price and a cost per square meter and per month)
  • Local tax rates in the town we want to settle down.

I'm using a spread sheet to keep track of some houses, in order to see a price trend over time and to be able to compare between houses. Until now, I've entered the information manually:

  • Date when the add was published
  • Address
  • Town
  • Starting price
  • Taxation value
  • Number of rooms
  • Maintenance costs
  • Year the house was built
  • Living area
  • Other area
  • Garden area
  • Travel time from my work to the house
  • Travel time from my wifes work to the house
  • Final price (Updated when the house is sold)
  • Contract date (Updated when the house is sold)
  • Estimated renovating costs (A guesstimate based on the pictures and text in the ad)
  • Calculated monthly costs, both for 2% and 6% interest rates.

Some of the parameters can be fetched automatically. I've marked them in bold.

I use the parameters to estimate a monthly cost, and also a monthly cost per square meter. That cost is calculated as the sum of:

  • the monthly cost at an interest rate of 6%
  • the estimated need of renovations, multiplied by 4% and divided by 12,
  • the estimated increase/decrease in travel time, in terms of minutes per month multiplied by 3
  • the changes in local taxes and 
  • whether the house is in Lund or not (with a penalty of 2000 SEK if it isn't in Lund). We love Lund and we want to live there!

Fetching all those parameters is a very time consuming task and in the next blog post, I'll try to automate some of them to save time.

Saturday 19 May 2018

Trains: Boiled, Fried or Mashed?

The local newspapers reported about two nasty incidents that ended well.

In Tomelilla, an off-duty firefighter found a four-year old child alone in a car. The weather was sunny and the temperature was quite high outside the car and very high inside the car.

Together with his officer, they started breaking in to the car. The mother arrived and unlocked the car. Luckily, the child didn't suffer any damages after spending at least fourty minutes in that car.

As a parent, I hope that I will never meet a child inside a locked car. If I do, I hope that I have the courage and presence needed to help that child. Being in a hot car is extremely dangerous.

Some sixty kilometers westbound, a similar incident occurred. Hundreds of passengers, including pregnant women, elderly people and small children found themselves trapped in a powerless train outside Malmö.

The internal loud speaker system failed, and after some fifty minutes, the passengers opened the train doors and went out on the tracks, where trains were operating in the opposite direction.

On a train, one should always follow the train personnels directions. But what to do if the clock is ticking, and the temperatures keep raising without any information? In the former incident, the necessary actions should be obvious. In the latter, one needs to consider the train operators ability to act,

I don't blame the people that left the train, even with the risk of being on the tracks in mind. However, the train operator needs to find out how to act. The passengers shouldn't need to choose between risk beeing overheated, electrocuted or run over by other trains.

Saturday 12 May 2018

Important Stuff

Today, I had more important things to do than blogging.

She said yes.

Saturday 5 May 2018

TrafficControl: Refactoring and User Interface Fixes

After adding a toolBar for hiding/showing the different windows of the program, I need to review and refactor my code.

Before adding a widget that helps the user to create a network file, I need to review/refactor the code and fix some bugs. One of them is that when resizing the dockWidgets for tracks/trains/stations, those widgets reset their sizes immediately.

Another bug is that the buttons in the toolbar aren't changed when the windows are closed using the "x" button on the top right. Fix: Connect the signal visibilityChanged to the same slot as the buttons are connected to. In that slot, update both buttons and 


In this code review, I'll focus on variable names, documentation of functions and whether there is redundant code or not. I'll also omvestogate the need of new test cases.