Wrong colors in Windows Photo Viewer / Falsche Farben in Windows-Fotoanzeige

18. September, 2017

When colors in the Windows Photo Viewer (Win 8 to 10) look oddly wrong, it’s probably because of something called “color profile“.

Solution:

  1. Open “System Control” (Systemsteuerung)
  2. “Color Management” Farbverwaltung
  3. Select your monitor
  4. Check “Use my settings for this device” (“Eigene Einstellungen für das Gerät verwenden”) (otherwise, you can’t click anything at the bottom)
  5. Hinzufügen
  6. Select “sRGB IEC61966-2.1”
  7. Click “Set as Default Profile” (“Als Standardprofil festlegen”)
  8. Repeat for each monitor
  9. Restart Photo Viewer (Fotoanzeige)

How Houston Sends a Humbling Message About Climate Change

2. September, 2017

People in Houston have been drowning the past few days. Do they care about climate change right now?

No.

They are currently returning to houses that have been massively damaged. Are they caring about climate change now?

No.

These people have real problems at the moment. They don’t have the time, nerve or energy to waste on climate change. In the past few years, I’ve come to the conclusion that climate change isn’t a “problem”. Talking about it is a waste of time. People need jobs, they need money to pay rent, food, education, Netflix. Climate change is a nice but somewhat irrelevant topic to fill the gaps of boredom between.

So how to prevent climate change when talking about it is a waste of time? We need a new story. People love stories. Compare these two:

  1. If you smoke, your live will be 10 years shorter on average.
  2. My grandmother smoked all her life and she died with 95 in good health.

Both are “true” in the sense that they are facts which have been verified as well as could be. Which one do you like to hear?

So here is my story about climate change:

Climate changes. It changes all the time. Sometimes it’s hotter, sometimes it’s colder. Who cares. People have real problems. People need jobs. How do you create jobs? By doing new stuff.

When everyone has a car, you can’t sell more cars. You simply can’t get most people to buy two cars. You can replace the few that die every year but that’s not growth. That’s simply keeping the level. Today’s cars produce a lot of poisons. That’s bad for everyone. They need gasoline of which the US has only so much. We need to send soldiers to die in far away countries to make sure we get all the oil we need.

That’s a tragedy for the families involved and that’s a lot of our money wasted. This money doesn’t come from some magic place, it’s the money which every American pays in form of taxes.

If we replace all the bad cars with new cars, we will create a lot of jobs. New technologies need to be invented. Better batteries. More efficient and reliable power grids. When was your last power outage?

No more soldiers dying for oil. Cars which refuel themselves over night. No need to stop at dark fuel stations. Yeah, the fuel stations will go away. But a lot of people lost their jobs when we did away with horse carriages. Those were unhappy but overall, it was a change for the better.

Cleaner air. More jobs. Better health. Less power outages. Less traffic noise. Having a job will mean you can afford the new car and get rid of the old junk. With all those new cars, people will ask for better roads. With the new jobs, we can afford that as well. We can then invent technology to recycle millions of cars efficiently and sell that.

Here is how the story works: People have problems that are important for them. We can ignore that (and be ignored) or acknowledge it. Telling them “hey, here are even more problems and who knows how to solve them” isn’t going to work. So we need to paint a picture. One where they can find themselves in. One where they can see some actual problems of themselves solved.

That’s how you prevent climate change.


I Hate Green …

31. August, 2017

… in my blueberries.


Thunderbird: Using Images in Signature

24. August, 2017

lifewire has an excellent article how to put an image into mail signatures: “Automatically Use a Picture in a Thunderbird Signature

Keep in mind that those images add a lot of bloat to your mail. If you just send a few sentences, then even a small image can easily make the mail hundreds or thousands of times bigger.


Shortest Horror Joke Just Got Shorter

20. February, 2017

Previously, it was

The last human sits in front of his fireplace. Suddenly, there is a knock on the door.

Now, it’s

Trump says.


Good and Bad Tests

16. January, 2017

How do you distinguish good from bad tests in your code?

Check these criteria. Good tests

  • Nail down expectations
  • Monitor assumptions
  • Help to locate the cause of a failure
  • Document usage patterns
  • Allow to change code
  • Allow to verify changes
  • Are short (LOC + time)

Bad tests

  • Waste development time
  • Execute many, many lines of code
  • Prevent code changes
  • Need more time to write than the code they test
  • Need a lot of code to set up
  • Take ages to execute
  • Are hard to run

Expectations

There are a lot of checks in your compiler. Those help to catch mistakes you make. Do the same with your tests. There are a lot of things that compilers don’t check: File encodings, existence of files, existence of config options, types of config options.

Use tests to nail down your expectations. Read config files and validate the odd option.

Create a test which collects the whole configuration of your program and checks it against a known state. Check that each config option is set only once (or at least that it has the same value in all places).

When you need to translate your texts, add tests which make sure that you have all the texts that you need, that texts are unique, etc.

Assumptions

Convention over configuration only works when everyone agrees what the convention is. Conventions are assumptions. Your brain has to know them since they are no longer in the code. If this approach fails for you, write a test that validates your assumptions.

Check that code throws the exceptions that you expect.

If you have found a bug in a framework and added a workaround, add a test which fails when the bug is fixed. Add a comment “If this test fails, you can remove the workaround.”

Speed

The world speeds up. No one can afford slow tests, tests that are hard to understand, hard to maintain, tests that get in the way of Get-Things-Done™. Make sure you can run your tests at the touch of a button. Make sure they never fail unless they should. Make sure they fail when they should. Make sure they are small (= execute fast, few lines to understand, little code to write, easy to change, cheap to delete). Ten tests, each asserting a single fact, are better than one test that asserts ten facts. If your tests run for more than ten seconds, you lose.

Documentation

There is code rot. But long before that, there is documentation rot. Who has time to update the comments and documentation after a code change?

Why not document code usage in tests? Tests tell you the Truth™. Why give someone 100 pages of words they can’t trust when you can give them 100 unit tests they can execute?

Conclusion

Make your life easier. Stop wasting time in your debugger, begging for production log files, running code in your head. Write a good test today, it will watch your back for as long as the project lives. Write a thousand good tests and they will be like an army of angels, warding you from suffering, every time you press that button.


Virtual Cables for IoT Devices

10. January, 2017

IoT devices are a security nightmare: They should be easy to use / set up but hard to hack.

With classic devices, the solution is “cable”. If there is no cable between two devices, they can’t talk to each other. If you follow the cable, you can see who talks to whom.

Translating this solution for the wireless devices is “virtual cables”. Each device needs a wireless (NFC) connection area where the user can press a “virtual cable drum” (VCD). The device then passes a token to the VCD. Next, the user presses the VCD to the other device.

That creates a virtual wire between the two devices. The VCD is just a small NFC knob which can keep an encrypted token for a couple of minutes. Not having batteries and permanent storage will be a plus: No one can steal the tokens after the connections have been made.

In a similar fashion, the VCD could be used to install security updates: Put the token for the update or the whole patch on the VCD, press the VCD against the device to update to trigger the update.

Related articles: