Visual Studio Code is a great editor with amazing Intellisense and debugging capabilities (for
Python as well). There is however one thing that I could not swallow: the tab behavior when a
completion was suggested.
With (Neo)Vim shift+tab and tab respectively cycle up and down the completion list.
I wanted to have the same experience in Visual Studio Code. After some Googling a lot of trial and
errors, this is what I came up with (it works pretty nicely! You can paste the text below in the
file that is opened after you click on File -> Preferences -> Keyboard Shortcuts)
The issue, which arises because Bash on Windows does not currently expose any
network interfaces, has been fixed by Adam Seering in its
WSL PPA.
The fix he proposed, though, only works on when you install jupyter using
Ubuntu repositories. In case you want to have it working with pip, I found
the following to be helpful:
Approximately a month ago I fell for the new Dell XPS 15. It had the right price/spec combination
(I went for the high-end model with 512GB SSD) so I went for it. This had of course some drawbacks,
the main one leaving a *NIX like system.
Of course I am not the first guy making the switch, so there are lots of helpful resources around
(although I might write one for the data scientists using Python).
One thing struck me though: Jekyll has no official Windows version. There is on unofficial
guide but I wasn’t too eager to follow that. So I started playing around with Pelican, as I
know some Python and as this is the tool that I already use with the GoDataDriven blog and
website.
Around the same time, I saw the announcement, on Hacker News, of Hugo 0.15, that introduces a
Jekyll import tool. And, more importantly maybe, it offers a simple .exe binary that you can just
drop anywhere and call with hugo (or hugo.exe).
So in between things (mostly in the train) I gave it a go and issued:
hugo import jekyll jekyll_blog_folder hugo_blog_folder
Magically, all of my posts were converted. The code highlighting and the front matter were adjusted
accordingly to hugo syntax (although I had to adjust the url). What was left out was the theme.
So the longish part of the transition began: rewriting my old theme for Hugo. Albeit the process was not difficult, some extra docs could have helped. Moreover the way to two theming engines works is different. But in the end I’ve finished and now my blog (and website) too is running with the hugola them (from hugo + Lanzani, but it nicely resembles ugola, which is the Italian for uvula).
In the process I removed some cruft: I removed JQuery and therefore Bigfoot and rewrote the other only thing that was using JQuery: the activation of the blue above the current page in the side bar. The old code was the typical exaample of JQuery usage:
The above snippet searches for the blog-active element and add the classes needed for the highlighting. It turns out that you can do the same in pure (modern) javascript if you make blog-active or whatever other class you’re using, into an id. Then you’re off with the following:
While these changes do not make it easier to blog, they are a symptom that I should have a bit more time to do so. So hopefully I can begin crunching posts again!
Since itertools is supposed to provide you with better tools to write functional Python code, I
thought it was odd that they have an example with x += step, redefining the x variable with
every new invocation (although, to their defense, they only say that it is equivalent to the
provided definition.
I sat therefore down wanting to create a “functional” version of it. Here’s what I came up with
(Python 3.4 required)
I consider myself an advanced Vim user. But I always found annoying the multiple cursors support
that Vim has (through vim-multiple-cursors) and below the Atom and Sublime standards.
For example, say I have this piece of SQL and I want to convert all the field names to lowercase:
Doing it with macros it tedious, and with multiple cursor, at least in Vim, it can be annoying,
especially if you have lots of tables create like that, spanning multiple lines.
Enter normal mode
Normal mode comes to the rescue here: you just need to know which commands you would execute on one
line to get the desired result (in this case _g~w) and the range of lines where the commands
should be executed (in this case 2,5). Then it’s just a matter of typing :2,5norm _g~w and,
almost magically, the code will be transformed in what we wanted!
When searching for a good restaurant, I found Bij Brons in Almere. As it was the highest rated
restaurant in Almere, I decided to reserve a table for two on a (lovely) Friday evening.
On the phone I chose the “5 gangen menù” which is the most expensive option the restaurant offers
(for a mere €43.50 per person I have to say). By peeking their website, I read somewhere that their
mission statement (or strategy statement, depending on how you call it) is to offer
great food for reasonable prices (take notes, Twitter!). This, together with their high rating,
convinced me that there were no tricks hidden behind the price, nor any up selling.
Starting from our phone call, Ivonne (the lady that owns the place, together with her husband, John)
impressed me by spelling out my name right (“Giovanni” is, for Dutch-speaking, not the easiest word
to pronounce correctly). Later at the restaurant I understood the reason: she speaks
fluent Italian although she’s as Dutch as it gets!
But the good things do not end up here. Upon arrival (the local was full, luckily we called in
advance) we found a modern restaurant with classic touches that was intimate and warm. Ivonne asked
immediately if there was anything we didn’t wanted on our menu, to which my wife promptly answered
“Onions!”. Afterwards, as my wife was pregnant, Ivonne said that the salmon we were going to have
was safe for the baby. She then offered to look up whether the paté was safe as well, but I
said that I’d Google that. It turns out fresh paté properly conserved is also safe for the baby.
Let me say that I’ve never experienced such a level of care for the guests: we’re often asked these
questions, but Ivonne did so because she cared, not because she had to.
Afterwards, the various courses began appearing. I asked suggestion for the wine. Ivonne chose
wisely: first a red wine (I don’t remember the name), then a white Almaral Gewurz to accompany the
salmon. Food and wine were nothing short of delicious.
As we approached the fourth course, I took the wine choice in my hands and ordered a red
Valpolicella. When John (cook and owner) heard me, he made a big smile, as if I already knew,
even if I didn’t, what was coming next.
The remaining courses were flawless. Contrary to what I thought by reading the menu, we received 5
courses + dessert. The dessert probably doesn’t count as it is served in a glass rather than on a
plate.
It really was a magical evening at Bij Brons. You should check it out if you ever pass by Almere.
It seems like, right now, I only write in this blog when a get a new child or when I speak at some
public event. Not breaking the tradition is this post, with the link to the slides accompanying the
talk.
As John Gruber aptly put it (although for
another conference):
Great crowd, great venue, and an amazing array of fellow speakers. It was a real honor and a
thrill to speak [there].
I completely share John’s take if I had to describe my experience at NoSQL matters Barcelona.
It took more than 9 months (9 months and four days to be precise), but Elia Lanzani is now here.
He’s a healthy boy. He weights 3.8 kg and he seems like he could be a sleeper (I certainly hope so!).
The real hero is of course my wife that almost didn’t blink while delivering. If before this I was
writing little here, rest assured I’ll write even less now :)
I was honored to have been invited at NoSQL matters Dublin 2014 as a speaker. The title of the talk
was Real time data driven applications (and SQL vs NoSQL databases) and being there was a great
pleasure. Dublin is lovely, they have really good beer, the typical Irish breakfast charmed me and
beef had me yearning so good was it.
As a cherry on top of that, my wife flew with me, as we got married six years ago.
You can find the slides for the talk here in pdf and on Speakerdeck. I’ve even uploaded some
pictures to Flickr.
As announced (you heard it here first!) I talked at PyData Berlin 2014. You can find the
slides at Speakerdeck and a video of the presentation on Youtube. The video seems to be rather
popular on the PyData Youtube channel, but we’ll see if it’ll stand the test of time.
Kudos to Numfocus and Pydata for promoting the conference and kudos to the organisation for
putting the video’s online in record time (faster than WWDC’s video’s).