Move Windows 10 to Virtualbox

Your super-fast laptop comes with Windows 10 installed. That may seem like a waste to you when you are a real Linux geek like me, but it isn’t. You can install your Windows 10 licensed copy in a VirtualBox environment that you run on the host operating system (Linux, what else?). This has the great advantage that you can easily make snapshots of your Windows environment. With snapshots you can easily revert to for instance a “clean install” situation. ...

July 7, 2016 · Maurits van der Schee

Porting a Flash game to HTML5

I confess: I love Flash and I think it is much better than HTML5. But Flash is dead now (I blame Apple) and we have to build in HTML5. Actionscript 3 was a beautiful and powerful language, especially for games. In this post I will describe how to port an application from beautiful Actionscript 3 code (Flash) to the ugly Javascript reality (HTML5). Why Flash was better Drawing graphics in Flash was easy and your drawings could be combined and even easily animated. Flash scaled seamlessly in high quality so that you did not have to bother about screen sizes. There was only one runtime implementation, so there were hardly any compatibility bugs. Animations performed great, even on older computers. It really was a developer dream come true. Now we have to work with Javascript, SVG and all kinds of different browser implementations, a huge step backwards. ...

July 3, 2016 · Maurits van der Schee

Linux Mint 18 is a winner!

Linux Mint 18 is released today and I understand why Linux Mint is the world’s most popular Linux distribution (according to DistroWatch). It has all the goodness of Ubuntu 16.04, combined with a user-friendly, familiar and modern looking interface with plenty of options to customize. Cinnamon vs. MATE There is a Cinnamon and a MATE version of Linux Mint 18. I tried them both briefly and I noticed several differences. The MATE version seems more light-weight as it feels a bit more snappy. It sports “Caja” as a file manager which is less powerful than “Nemo”, but still does not feel like it is missing important features. The MATE version has more configuration options than the Cinnamon version. The Cinnamon version on the other hand looks more modern and polished. Your desktop on a cube and wobbly windows, remember that thing? I think it was in 2007 when I have first seen that. It is still supported in MATE, wohoo! ...

June 30, 2016 · Maurits van der Schee

Ubuntu 16.04 with Gnome Flashback and Nemo

I love Ubuntu, especially 16.04 for it’s new software versions. The best official ‘derivative’ of Ubuntu is IMHO “Xubuntu”. It is even better than the original. Why? Because it is light-weight and has that nice old-school “Gnome 2” look. It did not change much and that is a good thing. I like stuff that does not change, especially when it works fast and good. The constant (needless) changes in the user interface (as Microsoft is doing to Windows) are driving me crazy. Apple seems to be more subtle in it’s user interface improvements. Ubuntu and Gnome have also made some dramatic changes in the past years, completely unnecessary in my opinion. XFCE has improved, but more subtle, like OSX. ...

June 27, 2016 · Maurits van der Schee

A slots-like dice game

12 years ago I wrote a game in Borland Delphi that I learned on a holiday. It is a game with 6 dice that plays a bit like a slot machine. You can play it with two or more people and you need six dice. Rules You start a turn by throwing a full set of six dice. You may call for any of following combinations and add the corresponding score to your turn score (where the series of d’s represent dice with the same number): ...

June 12, 2016 · Maurits van der Schee

Vertical bar graph in HTML+CSS

I wanted to display a simple bar graph, but as you know this site does not use JavaScript nor cross domain requests. I came up with the following PHP function to make a vertical bar graph using only HTML and CSS to render the graph: function vertical_bar_graph($values,$height,$title='',$description='') { $real_max = max($values); $max = pow(10,ceil(log10($real_max))); while ($max/2>$real_max) $max/=2; $html = '<div>'; $html.= '<div style="position: relative; clear: both; text-align: center;">'; $html.= $title.'</div>'; for ($i=0;$i<10;$i++) { if ($i%2==0) { $html.= '<div style="position: relative; top: '.($i/10*$height).'px; width: 100%;">'; $html.= '<div style="position: absolute; width: 100%; text-align: left; border-top: 1px solid #aaa;">'; $html.= '&nbsp;'.((1-$i/10)*$max); $html.= '</div>'; $html.= '<div style="position: absolute; width: 100%; text-align: right; border-top: 1px solid #aaa;">'; $html.= ((1-$i/10)*$max).'&nbsp;'; $html.= '</div>'; $html.= '</div>'; } else { $html.= '<div style="position: relative; top: '.($i/10*$height).'px; width: 100%;">'; $html.= '<div style="position: absolute; width: 100%; text-align: left; border-top: 1px solid #ccc;">'; $html.= '</div>'; $html.= '</div>'; } } $c = count($values); foreach ($values as $key=>$value) { $p = round(100*($value/$max)); $title = is_string($key)?$key.': '.$value:$value; $html.= '<div style="float: right; width: '.(100/$c).'%; height: '.$height.'px;">'; $html.= '<div style="width: 100%; height: 100%; background-color: #eee;">'; $html.= '<a style="display: block; position: relative; margin: 0 10%; background-color: #aaa; height: '.$p.'%; top: '.(100-$p).'%" title="'.$title.'">'; $html.= '</a>'; $html.= '</div>'; $html.= '</div>'; } $html.= '<div style="position: relative; clear:both; border-top: 1px solid #aaa;">'; $html.= $description.'</div>'; $html.= '</div>'; return $html; } echo vertical_bar_graph($values,300,'Traffic TQdev.com','Unique visitors (y-axis) per day (x-axis)') The output of this graph is: ...

June 9, 2016 · Maurits van der Schee

Microservices and single database

Microservices are highly popular and require that every service manages it’s own data. This does not necessarily mean that each service has it’s own database server. It can also only manage it’s data in one big central database system. As long as nobody else, but the service, interacts with that data it is still in line with the ideas of microservices. One database, multiple services Having one database server brings several advantages. For one, it does not require you to change your data structure if you come from a monolithic application. Second it also brings as an advantage that you can still have constraints to ensure consistency. As a third advantage I see that it also enables you to do simple backups and data analysis. You can let all these services have their own tables, their own scheme or even their own database, because unlike popular believe cross database queries are not that inefficient. ...

June 6, 2016 · Maurits van der Schee

Minesweeper in Python for iPad

Pythonista iOS app allows you to write Python on your iPad. I wrote Minesweeper 2 years ago and with version 2.0 of Pythonista it did not work anymore. I fixed that and also added three features (first click is not a bomb, timer starts on first click, support chording) contributed on the OMZ forum by a user named “git-bee” on github. Pythonista version 2.0 A lot has changed in version 2.0. The completely revamped scene module gives you a lot more possibilities for building 2D games and animations in Pythonista. You can even use custom OpenGL fragment shaders. Lots of new sample code and a tutorial for building a simple game are available in the included Examples folder. source ...

June 3, 2016 · Maurits van der Schee

Command line Wikipedia client updated

The “wped” command line Wikipedia client has received an update. It now supports language selection and it has an alternative “wikt” command for Wiktionary. Formerly the tool was hard-coded to connect to “en.wikipedia.org”, but now both the language and domain can be chosen. This change was initiate by a community pull request and I love the way this works on Github. The “wped” Wikipedia command Below you see a sample usage of the “wped” command: ...

May 31, 2016 · Maurits van der Schee

Alternatives to Oracle products

Oracle sued Google over some alternative implementation of an open source API. Developers world-wide are appalled by this move. Fortunately there is something you can do: Stop using Oracle products! There are plenty alternatives that are a safer choice. This posts lists the ones I could find. To avoid that this becomes a long boring one sided rant I will not explain the details of the case, but feel free to look it up: it is nasty. ...

May 28, 2016 · Maurits van der Schee