I was recently writing a test for a side project (more on that in a future post), which looked like this: #[test] fn test_render_index_page () -> anyhow :: Result < () > { let json = std :: fs :: read_to_string ( "tests/data/gdoc/index.json" ) ? ; let doc = serde_json :: from_str ( & json ) ? ; let html = gdocs2hugo :: gdoc_to_html :: render ( & doc ) ? ; insta :: assert_snapshot ! (…
This is an additional post in the “ Go is not good ” series. Go does have some nice features, hence the “The Good” part in this post, but overall I find it cumbersome and painful to use when we go beyond API or network servers (which is what it was designed for) and use it for business domain logic. But even for network programming, it has a lot of gotchas both in its design and implementation…
For a side project I'm writing in Go, I needed to send an email to each registered user during the night. Their night actually, according to each user's time zone. More precisely at a random time between 3am and 4am to spread email sending and avoid any rate limiting from SMTP providers or spam detection systems. Coming from a Java/Scala background, I was looking for a large number of setters or…
In the last 24 hours, two articles related to code benchmarking showed up on my Twitter timeline , where the authors describe the optimization of a tiny bit of code via successive benchmarks. Both articles immediately triggered the same reaction in my head: "WTF, this is wrong! Why did they wrote this in the first place, and why do they focus on optimizing this bad solution?" The second article…
This post explains a quick afternoon hack to turn a foot pedal controller for music synthesizers into a programmable USB foot keyboard. A couple of weeks ago, for a personal project, my wife needed to manually transcribe many hours of interview recordings. Text-to-speech software were failing miserably both because of the people's strong local accent and poor recording quality. To ease the task…
This blog is now a static website powered by the Pelican generator. It's the 3rd major change since I started blogging in 2002 . It began with Movable Type , a Perl blogging tool. There wasn't much choice at that time, and it did the job even if I did not like Perl (and still do not). In 2009 I switched to Drupal 6 , which allowed me to have a nicer visual layout and have more control on the…
TL;DR: this post explains the MongoDB storage structure we use at Actoboard to efficiently store non periodic time series. Storing one Mongo document for each data point is woefully inefficient, so we store them in fixed-size segments, which speeds things up by more than an order of magnitude. MongoDB makes the developer's life easier When we started Actoboard, we decided to use MongoDB to store…
GitHub has faced a spectacular hack : a disappointed developer has exploited a weakness in Ruby on Rails to gain commit access to the Rails master branch and create issues in the future . As a result, GitHub asks us to confirm our ssh keys, but this can have been used to change almost any data in the system. How's it possible? This weakness comes from the mass assignment feature in Rails. To ease…
This blog has been mostly silent in 2011. Blame both Twitter that makes capturing quick thoughts so easy and a busy year as I started my freelance business. But a new year is starting, and along with the traditional wishes I owe an update to the people that still look around here. There have been many important events in the world this year, but I will talk about the selfish me, since this year…
The guys at ZeroTurnaround have published an interesting report on the development habits from over 1300 Java developers. One of the questions that really struck me was " how often do you redeploy? " My answer to this question is "on my development machine, never". I use Jetty which is really easy to embed in a regular application. So all of the projets I work on have this tiny class in their…