Recent Posts (all)
The Mac vs PC debate is practically as old as the youngest of the two platform. I’ve tried to take
a biased look at the whole thing again.
My first machine was an IBM x286. I was 6 years old and our neighbor was working for IBM and
he thought my brother and I would be interested in playing with a computer. Boy, was he right!
For practically 15 years I’ve use DOS, Windows 3.1, 95, 98, and Windows XP.
When I started university, I got myself an Acer laptop. What a piece of junk that was. After a
couple of months (in 2005) I’ve wiped it and installed the second Ubuntu version ever released.
At the university we were using Scientific Linux: Ubuntu felt like fresh air.
When I decided to move to the Netherlands in 2006, I’ve bought my first Mac. What convinced me was
the iPod: it was so more intuitive than any other electronic device used up to that moment that I
thought that if Macs were half that good, I was missing out.
I was right. My first Mac was an iBook G4. The battery would last 7 hours and after replacing the
hard drive with an 80GB 7200rpm variant and upgrading the RAM to 1GB (IIRC) it was flying compared
to the Acer.
That wasn’t the only great thing about the Mac. Everything felt as good as the iPod.
I’ve kept using Macs during my PhD, with various iMacs, Macbook Pros, Macbook Airs, and what not.
When I first got into industry I had to use a Dell with Windows 7 Enterprise Edition. It was a
piece of junk, commodity enterprise laptop.
Once I joined GoDataDriven I immediately got a Macbook Pro.
In the meantime, however, something happened. Microsoft was changing course, developing an open
source friendly attitude and people were kind of discontent of the hit Apple software quality was
taking, reportedly due to the huge success that the iPhone is.
After two year I decided to get a Dell XPS 15" for work. I wanted to challenge myself and see how
far could I go using Windows (10). After two years of use, I went back to a Mac. Why?
Where the Dell shined
There are a number of area’s where the Dell shined for me. The Dell:
- Came with an NVidia video card, a touch screen, and overall a sturdiness that makes me
feel more comfortable when carrying it around. The new Macbook Pros are good, but they
seem more fragile to me (it seems I’m not the only one);
- Is considerably cheaper for similar specs;
- Comes with more ports than Thunderbolt 3 (it does have a single Thunderbolt 3/USB C
port);
- Has a physical ESC key. As a NeoVim user this is a big deal to me :)
On the other hand the Dell runs Windows, and this has also a number of advantages:
- Windows management is built into the OS;
- The OS feels really fast, everywhere;
- I was on the beta release of the OS and it felt really stable, as in one blue screen of
death in several months (which is fine for a beta OS);
- The OS has several features that made me very productive in it, such as the fact that it
remembered most used folders and placed them in the favorites; that I could easily open Explorer
and more nifty things with super easy shortcuts, etc.;
- With the inclusion of WSL you could get a full fledged Linux distribution inside Windows with
minimal overhead;
- Microsoft is actively listening to its users and releasing tons of stuff in each beta update.
Contrast that to macOS, that feels mostly stagnant compared to its younger sibling iOS.
Given all the above, I could work on my laptop just fine for two years. I installed all
the various Python packages, virtualenvs and whatnot (without Anaconda), Scala, Spark, Docker,
and databases such as Postgres and MySQL. I even got PyCuda working with the NVidia GPU I had.
Verdict: If you want to use a Windows machine to use the above, you will be fine. Don’t drink too
much Apple kool aid.
Where the Mac shines
That said: why did I come back? The single, biggest factor, is applications. I think macOS has
much better frameworks to develop applications.
It is also true that third party apps usually cost more, but they
give me a much better experience. In particular I love:
- Mailmate: this is my favorite email client. It’s so good I don’t even know where to start;
- Launchbar is an application launcher so complete you can hardly find something it can’t do.
I’ve tried countless of these on Windows, but nothing comes close;
- Vimr is a Neovim client. Again, nothing even remotely as polished on Windows;
- Transmit is the golden reference for file transfer on macOS. The developers sweated every
detail;
- Things is a to-do app that doesn’t get in the way and it’s just so beautiful I can’t resist it
:)
- Soulver deserves so many words of praise I’d have to spend the night writing about it;
- iTerm: you’d think it’s not so difficult to create a high quality terminal emulator. If I look
at the status of Windows terminal emulator, I’d say you’re wrong.
- Dictionary.app is so invaluable that you realize how much you miss it only when you don’t have
it anymore. Microsoft: build your own Dictionary.app;
- Preview.app is another app that Windows should copy 1:1. There’s nothing close to it on Windows
(I’ve tried!)
- iMessage and Facetime. Sorry, my wife has an iPhone :)
- Omnigraffle: Visio alternative, with a twist: it’s a joy to use!
Besides apps there are a lot of other touches that I really enjoy about the Mac:
- Three-finger-selection and drag. You just drag with three fingers and you can select text and
move windows around. So good!
- HiDPI on macOS is way better than what you have on Windows; it seems a joke to leave HiDPI to
apps, as Windows does;
- The trackpad is just slighty better than the Dell I had, but vastly better of the majority of
PCs;
- Battery life is still better on the Mac, although the Dell I had had a much higher res display,
that used tons of energy. And colors on the Dell are better;
- PDF support is everywhere, from screenshots to fonts, to every single thing in the OS;
- Spell correction in n languages in basically every text field of the OS, without apps having to
do anything fancy;
- Access to accented letters using dead keys;
- When in an app, typing ⇧ ⌘ / opens up a dialog where you can search all menu items of
an app. Not remembering a shortcut? Just type ⇧ ⌘ / and type it! Again, you don’t know how much
you miss it until you don’t have it anymore.
Where the Mac falls short
Not all is good in macOS land however:
- You can’t turn off the internal display when you connect an external laptop unless you close the
lid. I can’t imagine the difficult computer science challenges that makes this still a thing;
- No native windows management. Third party apps exist, but Windows does a much better job here;
- The app switcher does not show a preview, and groups windows by app. I thought this wouldn’t
bother me much, but after two years on Windows, it does;
- (High) Sierra feels more unstable that the Windows beta I was running. It doesn’t feel an
OS coming out of the richest company on earth.
As for work: I could install all the stuff I wanted, excluding PyCuda because, guess what,
these things don’t ship with a NVidia card, no matter how much money you have.
Conclusion
Well, I already gave it away: I’m back to Mac, apps being the biggest factor, but I gained a lot
of nice touches in the switch!
I always hoped app.net would have become a new Twitter.
Not only was it friendlier than Twitter towards developers and users, but I was delighted every
time I had to interact with it: I was using Riposte. If you followed the previous link I can tell
you that I share Manton’s opinion:
Riposte is arguably the best social networking client out there.
The developer behind Riposte, Jared Sinclair also developed another
delightful app: Unread, a beautiful RSS reader for iPhone and iPad.
Unread, luckily, didn’t end up the way Riposte did. It was acquired by Supertop, but, due to the
success of Supertop’s other app, Castro, it did not get the attention it deserved.
I was therefore delighted and scared when Supertop announced that they sold Unread to
Golden Hill Software. Delighted because the new owner has
more time to work on it, and scared as what change is always scary.
Being scared turned out not to be such a unjustified feeling: the 1.7 version broke my set up with
Stringer, a self-hosted, anti-social RSS reader.
Basically Stringer offers a Fever-compatible API. The new version of Unread tried to do some
smart things with the API, that Stringer was not offering.
I immediately wrote to John, Golden Hill Software’s owner. He quickly replied that he would look
into it.
A few days later a new version of Unread came out but, alas, no fix for my issue.
I was kinda disappointed. I had to wait for the next release.
But no. John wrote me saying he pushed a PR to Stringer fixing the issue.
What a great developer! If you’re on iOS, please give it a spin. As a bonus, the newest version
merges the iPhone and iPad version, which is timely as I realized some months ago that
Mr. Reader, my favorite iPad RSS reader, was not developed anymore.
So give it a go, and support a great developer!
Yesterday somebody called my wife. She didn’t pick up. Today (Saturday), upon picking up, the voice
on the other hand presented himself as a Vodafone emploee. He said one of Vodafone’s system suffered
some data loss and they wanted to check some personal information.
We recently moved, so my wife assumed that it might have been related. On the other hand she hears
from me the worse stories about phishing and scamming that she got suspicious. She thought: “Why
aren’t they sending me an email or a letter?” and she asked to be called one hour later, when I
could have picked up the phone. The caller pushed back, saying it would only take 20’’. She pushed
back again, so he agreed to call back.
I know no systems containing the sort of information you could give on the phone would fail
without a backup lying around. Especially for a company the size of Vodafone.
But maybe my wife misunderstood something, it could have been related to a new contract, etc. She
said that on the background many people were talking, like in a real call center.
So I called Vodafone myself. The lady on the phone told me I was the third person that day notifying
them about it. She told me no systems had failed.
“Good”, I thought. Let me handle the guy. An hour later I picked up the phone. “Zakaria from
Vodafone” he told me.
At that point, I already had LinkedIn open. I wanted to ask him his family name to look him up there.
“What’s your family name Zakaria?”. “I’m just here to ask some details about… “.
“I said what’s your family name Zakaria”.
He hung up.
There was not much to do, but what followed shows that Vodafone really handled it classy via their
Twitter account. At 16:12 I
tweeted
@vodafoneNL someone is calling your clients, pretending to be you, and asking personal info. Time
to send an SMS around?
At 16:45 they got back at me and then via PM they asked:
Very good that you send us this message Giovanni. If I understand correctly someone called you
pretending to be someone from Vodafone Customer Service and asks you for personal information. Can
you tell me exactly how this conversation went ? And can you give me what day and time it was? I
also need your mobile number so I can figure this out with our security department :-).
After telling them what happened, they promptly replied:
Thanks for sending the information. That does sound like a very strange conversation. I’ll send it
right away to our security department for research. Good that you indicate this to us. If you
encounter anything suspicious again let us know, then we investigate this immediately.
I have no idea what they’re going to do with it, but I really do hope they stop Zakaria and his
likes!
Sometimes, instead of using NeoVim, I do like to use
Visual Studio Code (with Vim keybindings).
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)
[
{
"key": "tab",
"command": "selectNextQuickFix",
"when": "editorFocus && quickFixWidgetVisible"
},
{
"key": "shift+tab",
"command": "selectPrevQuickFix",
"when": "editorFocus && quickFixWidgetVisible"
},
{
"key": "tab",
"command": "selectNextSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
},
{
"key": "shift+tab",
"command": "selectPrevSuggestion",
"when": "editorTextFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
}
]
The commands should be pretty self-explanatory! To accept the suggestion, you can use enter
(that’s the default together with tab).
In case you are playing around with the
Windows Subsystem for Linux and
jupyter, you might have notice this error:
Invalid argument (bundled/zeromq/src/tcp_address.cpp:171)
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:
pip uninstall pyzmq
sudo add-apt-repository ppa:aseering/wsl
sudo apt-get update
sudo apt-get install libzmq3 libzmq3-dev
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
pip install --no-use-wheel -v pyzmq
pip install jupyter
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:
$( ".blog-active" ).addClass( "menu-item-divided pure-menu-selected" );
$( ".blog-active" ).removeClass( "blog-active" );
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:
window.onload = function() {
document.getElementById("blog-active").className = "menu-item-divided pure-menu-selected pure-menu-item";
};
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!
Today I was sifting through the documentation for itertools.count
Return a count object whose .next() method returns consecutive values.
Equivalent to:
def count(firstval=0, step=1):
x = firstval
while 1:
yield x
x += step
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)
def _count(first, step):
while 1:
yield first
yield from count(first + step, step)
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:
1CREATE TABLE test (
2MYFIELD1 STRING,
3MYFIELD2 STRING,
4...
5MYFIELDN STRING
6)
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!
1CREATE TABLE test (
2myfield1 STRING,
3myfield2 STRING,
4...
5myfieldn STRING
6)
This is one of the features that keeps me in Vim and not in one of the emulated Vim mode out there
(like Atom Vim mode)
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.
Thanks John and Ivonne.
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.
Without further ado,
here’s the link to the slides.
←
9/15
→