“Cerco sviluppatore per sito web e/o app” …al Poli?

In questi giorni molte persone mi chiedono di indicare sviluppatori fidati per lo sviluppo di siti web e app.

Credo che ci sia una grande incomprensione sul percorso di studi in Ingegneria Informatica che il Politecnico di Milano offre e sulle competenze che esso trasmette ai futuri ingegneri.

In questo corso di Laurea (e Laurea Magistrale) sono offerti corsi eminentemente teorici che insegnano ad affrontare problemi astratti in modo generale (es. programmazione concorrente, analisi matematica, linguaggi formali, ricerca operativa…).

Non si fanno progetti pratici, né tantomeno programmi “veri”, né si imparano davvero specifiche tecnologie, a parte rarissime eccezioni che comunque non consentono di acquisire un’esperienza sufficiente per affermare – in buona fede – di essere davvero esperti di qualcosa.

Dunque, l’unica esperienza pratica che abbiamo è quella che ci siamo costruiti noi stessi con i progetti che facciamo nel tempo libero (poco). L’enorme carico di studi non consente peraltro di impegnarsi su progetti significativi, perché manca il tempo materiale per realizzarli.

Lo studio universitario (specialmente al Polimi) è un’attività a tempo pieno e non conosco nessun collega studente che stia cercando un lavoro, a maggior ragione se solo a progetto. Non sto dicendo che questo stato di cose mi piaccia (personalmente lo detesto), però questa è la realtà.

Peraltro, chiedere ad un ingegnere di fare un sito web (al 90% statico) che potreste fare benissimo da soli su WordPress.com è come sparare ad una zanzara con un cannone. E vi costerebbe anche caro.

Per cui no, non farò il vostro sito web/app e non sono neanche in grado di indicarvi nessuno che sia interessato a farlo.

How to recover PDFs and books from iBooks on macOS

Apple iBooks generally does a good job of managing your collections of books and PDF. But, you know, sometimes shit happens and your contents are gone. This happened to me a few days ago. Where should you look in your filesystem and in your backups to restore your books and your PDFs?

First of all, don’t worry for the books you bought on the iBooks Store: they can be re-downloaded from the store at any time. You can even choose not to have a local copy and to fetch them on demand.

The real problem here are the PDFs that you manually loaded on iBooks and can be synchronized with iCloud.

Some PDF files in iBooks.
Some PDF files in iBooks.

So, where are the files stored?

The e-books you bought on the iBooks Store and all the local contents (those books not in iCloud) are stored in:


Instead, the books that are in iCloud and are synced with all your devices are in:

~/Library/Mobile Documents/iCloud~com~apple~iBooks/Documents

(that’s an hidden folder, you can reach that using the Terminal).

This information is useful if you have a backup and can restore the files in these folders. This will not restore your collections, but at least you will have your files back.

I haven’t still found a reliable way to backup or restore the entire iBooks database (books and collections) if iCloud fails. This problem is open for further research. 🙂

Check iCloud settings

Another thing worth mentioning is to check whether iCloud is syncing or not your books. This settings is hidden in the iCloud preferences in macOS, and can cause some headaches, specifically partial or incorrect synchronization.

iCloud preferences
First, go to System Preferences, iCloud; then click on the options button of iCloud Drive.
iCloud Drive preferences
…then, check that the iBooks sync is correctly set to your preferences. If the checkbox is selected, your books will be synchronized among your devices.

Also, there is an option in the preferences of the iBooks app to synchronize your collections. Make sure it’s enabled if you want to sync:

Option for syncing iBooks collection, in the iBooks preferences.
Option for syncing iBooks collection, in the iBooks preferences.

Block those annoying cookie warnings using your adblocker

In Italy and EU some stupid laws oblige webmasters to add cookie notices to their sites, to inform the users that cookies are being used. But who the hell cares? Often there is no choice but to abandon the site you’re visit or consent to cookies, and power users already know how to disable or enable cookies on a per-site basis using their browser’s settings.

Cookie warnings are useless, obtrusive and just another item to dismiss on web pages. Luckily, we can block most of them easily.

If you’re using a browser plugin like AdBlock Plus, Adblock, uBlock Origin or others which support ABP-style blocklists (and you really should!), you can add these two lists which block a whole lot of cookie warnings:

  1. Prebake.eu
  2. I don’t care about cookies

The URLs of the lists can be found on the web pages: you just need to add them to your blocker. Usually this can be done in the extension preferences.

If you’re not using any adblocker, I really recommend uBlock Origin. It’s a fast and lightweight ad blocker which can make your browsing experience just better.

Happy browsing! 🙂

P.S.: yeah, even this blog has a cookie warning… which can be successfully blocked using the above method!

How to (temporarily) regain write performance on Samsung 840 EVO SSD

Samsung 840 EVO

Samsung 840 EVO SSD is a popular Solid State Drive device, one of the most sold for a long period of time. Sadly, it’s affected by a serious performance problem. Samsung released over the time multiple firmware upgrades which address the read performance slowdown. If you haven’t done it yet, it’s time to upgrade to the latest version (at the time of the writing, EXT0DB6Q).

Also, it’s advisable to enable TRIM on the SSD if it’s not already enabled. I used trimforce to enable it on my Mac.

Even after the firmware upgrades, I noticed that my 250 GB SSD suffers from dramatic write speed slowdowns. The tests performed using Blackmagic Disk Speed Test on a Mac show that write speed decreased to 45 MB/s: worse than a traditional HDD! Read speed was instead ok after the firmware upgrades, well over 450 MB/s.

I found an effective but temporary fix to regain the lost performance:

  1. Fill the free space of your SSD with data. For example, duplicate some large files that you already have. It will be a quite slow process, especially towards the end.
  2. Delete those useless files.
  3. Leave the PC on for 15 minutes or more and let the SSD quietly do its garbage collection.

Then, test again the write speed of your SSD. For me, the results were impressive, with stable write speeds up to 275 MB/s.

Note that this is a temporary fix: the performance will degrade again and you will have to redo the same trick.

Adium + Facebook Chat + 2-factor auth: yes, we can!

Update (2015-08-01): this is no longer working. Facebook dropped the support for XMPP.

Adium is one of the best multi-protocol chat clients for OS X. Among the supported services, Facebook chat is included. But on April 30, 2014 Facebook decided to deprecate the Facebook Chat API, so external clients are not able to connect to the chat using that API.

However, it appears that the XMPP protocol is still working. So, let’s use it.

  1. If you use two-factor authentication (2FA), first go to https://www.facebook.com/settings?tab=security and generate a new app password for Adium.
    Facebook app passwords
  2. Open Adium and go to menu Adium -> Preferences… -> Account.
  3. Create a new XMPP (Jabber) account. Do not create a Facebook account, that will not work.
    Adium: new XMPP account
  4. Insert username@chat.facebook.com as the Jabber ID (“username” is your username on Facebook).
  5. If you use 2FA, insert the app password generated at step 1 as your password. If you’re not using 2FA, insert your Facebook password.
    Adium new account
  6. Go to “Options” and enable SSL/TLS.
    Adium - Enable SSL/TLS
  7. Click on “Ok”.
  8. After a brief delay, Adium should connect to Facebook chat!

How to make SonarQube accept tabs instead of spaces for indentation

I’m developing a Java application as a university assignment and I’m using SonarQube for automatic code quality assessment.

Sonar is quite rigorous in spotting errors in code, and this is often useful. But it becomes annoying when Sonar floods the list of problems with multiple messages about the use of tabs instead of spaces for code indentation. Eclipse by default indents code with tabs: I think that this is the right decision and I don’t want to change that setting, even if SonarQube doesn’t like it.

So, how to configure SonarQube to accept spaces?

  1. Start Sonar and go to http://localhost:9000. This is the main dashboard of SonarQube.
  2. Log in using the link in the upper right corner of the screen. Username and password are both “admin” by default.
  3. Click on “Quality profiles” in the upper toolbar. You should see only one profile, called “Sonar way”.SonarQube Quality Profiles
  4. Use the “Copy” link to make a duplicate of this profile. Name the new profile as you want, e.g. “Sonar way (tabs)”.
  5. When it’s done, click on the number relative to the new profile in the “Rules” column. Sonar should come up with a list of active rules.
  6. Use your browser search feature to find the rule named Tabulation characters should not be used”. Deactivate it using the button on the right.
    SonarQube Rules
  7. Using the upper toolbar, go to Dashboards -> Home, then click on your project. You should now be in the dashboard of your project.
  8. Choose Settings -> Quality Profiles.
    Quality profile for project in SonarQube
  9. Select the new quality profile and click “Update”.
  10. Now, in Eclipse, you should force a full analysis of your project. To do this, run the project as “sonar:sonar” profile using Maven.You can also type mvn sonar:sonar in a terminal window in the folder that contains your pom.xml file.
  11. Go again in the SonarQube dashboard. Now you should no longer see the warnings about spaces.