How to Analyze Tweet Sentiments with PHP Machine Learning

Machine learning is rarely mentioned in the same sentence (or article, for that matter) with PHP, so each time this happens, I’m all ears.  Here’s one that I came across recently – How to Analyze Tweet Sentiments with PHP Machine Learning.

Unlike many other “hello world” kind of examples, this article examines a real and quite common problem, which can be easily adopted to other similar problems – SPAM filtering, marketing segmentation, fraud detection, etc.

Zeal + Vim = offline CakePHP (and other) documentation

As any long time Vim user, I’m constantly looking for ways to tweak and improve my text editor configuration, and make me even more efficient.  Today, I came across a very handy addition – Zeal – an offline documentation browser for developers. (Thanks to this blog post, which also mentions Dash as an alternative for those of you on the MacOS.)

With Zeal, you can download a whole lot of documentation sets for pretty much any web development technology out there – programming languages, frameworks, libraries, tools, and more.  And then you can easily integrate Zeal with whatever text editor or IDE you are using.

For Vim, there are, as always, several options.  Some of them are listed here. I personally opted for the Zeavim plugin.  The installation is straight forward and everything works out of the box.  After giving a quick try, I decided to adjust my .vimrc file to use CakePHP framework documentation together with the PHP programming language documentation whenever I’m working with any PHP file.  Here’s what I had to add:

" Zeal offline documentation
let g:zv_file_types = {
       \ 'php': 'cakephp,php',
       \ }

Now, whenever I edit a PHP file and hit “,z” (I use comma as a leader, by the way), Zeal window pops up with the relevant documentation search.

It’s super fast. It works offline, and it’s awesome!

Slimming down Docker images

It’s been a while since I posted anything about Docker.  That’s mostly because I still don’t really use it for anything – playing around locally, testing and learning doesn’t count yet.

But just to keep the ball rolling, here are a couple of handy links for the ideas on how to improve your Docker images, so that Docker uses much less space, benefits more from caching, and brings up the containers faster:

Both articles are around the same theme – choose your  base image carefully, try to minimize the layers, use only what you need, and don’t forget to clean up the disk space with “docker system prune“.

This is why you shouldn’t interrupt a programmer

Yup.  This is exactly why you shouldn’t interrupt a programmer.  It takes him at least a few minutes to get back to where he was, irrelevant how brief and unimportant the interruption was.  And that’s why we invented managers (interrupt them all you want!), asynchronous communication (emails, ticketing systems, etc), and other tools and processes.

Happy 20th birthday, LWN!

Linux Weekly News (aka LWN) is celebrating its 20th birthday.  Wow, that’s quite impressive! Not many web sites can say that.  But even fewer can do so while covering technology news related to Linux and other Open Source Software.

I’ve been a reader of LWN since their early days.  I’ve been subscribed to it also at different times during the years (see 2002, and then 2004).  And I’m glad that they are still around.  I still catch up with the RSS feed on a weekly basis.

Happy birthday, LWN!  And thanks for all the hard work and excellent content.