Too many words

I recently started a new project on GitHub: a library and a set of Windows, command line and web application to easily generate pass-phrases using Italian language dictionary.

I created the project in Visual Studio Community 2015 and created the online repository with the integrated extension: everything seemed normal except for one small detail.


The language details is the colored bar with details about the programming language used in the project: it was all wrong!
It showed programming languages I did not even know they existed, let alone used!

As GitHub uses an automatic system to determine the language used in a project, I started to think what could have fooled it into thinking my project was created with such exotic languages.
The easier answer to this question was the data contained into the italian dictionaries: a long list of common and uncommon italian words needed to generate random pass-phrases.

There is a simple method to override the automatic selection by let GitHub know what files needs to be ignored because imported from other libraries or because they are part of the Linguist documentation files.
So I edited the .gitattrtibutes file by adding:

$ cat .gitattributes
PassaFraseCore/Dizionario/* linguist-documentation

So instructing GitHub to identify all the files in the subfolder PassaFraseCore/Dizionario as  Linguist
And the result was much better!


What’s your number?

I assume I do not need to present here the music streaming service Spotify.
Though very costly is the latest and greatest service to listen music unlimited in regards to time and devices.

Spotify is also a very social application that easy allow users to show and whatc what their freinds are listening to.
Freinds are determined using relations on Facebook, but not all the users decide to link Spotify and Facebook accounts, so sometimes you might have a hard time finding your friends.

One easy way to add a riend not connected via Facebook is to use the direct link in the form


Where UserID is the numerical identifier of any user. It is very easy to find this number, but it appears three is some confusion on how to find it: this is a very easy guide on how to look for it.

playlistFirst of all open the desktop client and pick any of your playlist: below the playlist title you’ll find your display name. It is an hyperlink, just click it.

userNext page is your own homepage and it contains all of your information including the ID: click on the ellipsis button below your name and choose “Copy Spotify URI”.

That string is the direct link to your user: you can give it to a friend that can go directly to your page by pasting it in the Spotify Client Search field.

Command a Ghost

Everyone working with graphics in a serious way with a computer should be acquainted with Ghostscritpt. For those who are not, it is a an interpreter suite for PostScript and Portable Document Format: I will not cover it in depth here, but you can learn more at the related Wikipedia article or visiting the official website.
It is a very powerful and versatile tool and one could write books about, but in this post I will focus on one conversion I personally found very useful , but not particularly user-friendly.
So I am publishing this for my own exercise and with the hope of helping other users.

Take the following command:

gswin64c.exe -dNOPAUSE -dBATCH -r600 -sDEVICE=tiff24nc -sCompression=lzw -sOutputFile=scansioni%d.tif scansioni.pdf

comprised of several parts

  • gswin64c.exe
    the executable name: in this case is the 64-bit Windows one.
    You should replace it with the program file appropriate for you OS and architecture
    instruct the parser not to pause and ask for input at the page breaks
  • -dBATCH
    GS will exit at the end of the process instead of entering in interactive loop reading PostScript commands.
    Please note that both -dNOPAUSE and -dBATCH can be replaced by the single -o
  • -r600
    output resolution in DPI. Writing just one value will set vertical and horizontal resolution the same, otherwise you can use the form -rXRESxYRES
  • -sDEVICE=tiff24nc
    the output device, in this case a TIFF file with color depth 24bits
    Other common values could be -sDEVICE=tiffgray or -sDEVICE=jpeg.
  • -sCompression=lzw
    the compression to use for the TIFF file, in this case the Lempel–Ziv–Welch algorithm
  • -sOutputFile=output%d.tif
    the filename of the output: the use of %d will generate one file for each page in the original document appending number to the name output
  • input.pdf
    the original PDF file to read from

this blog post act as a sort of cheat sheet for rapid reference, but complete information on how to use GS can be found at How to use Ghostscript and Details of Ghostscript output devices.

Build action in Visual Studio

Earlier today I was creating a new class file for a project of mine in Visual Studio.
Then I went on using the class defined in that file in a web form, but, to my surprise, the class was inaccessible.

I double checked the access level of the class, but it appears that wasn’t the issue, so I started googling for this problem, but I ended up looking at situation different from mine and not really useful.
After a few minutes of scratching my head on this unusual problem, I finally had a look at a pane I rarely look at:

compileIn the Properties pane, the Build Action was set to Content instead of Compile: this is the ways of telling the IDE to include this file in the project as a static resource. So, in this case, the class file was included as a simple plain text file with no action performed on it: no compilation mean of course no usable class, so that was the reason for the seemingly inexplicable behavior.

To have a deeper look into this topic, I strongly advise to read this interesting post on StackOverflow.

Solve iCloud sync issue on Windows

There are cases whre the iCloud folder on yopur Windows machine is not synchronizing with your account, no matter what.
There is a way to get out from this issue by cleaning up the iCloud configuration and let the client to set it up from scratch again:

  • From the iCloud control panel sign out your account
  • Go to %appadata%\R­oaming\Apple Computer\MediaStream
  • Delete all files and folders in MediaStream folder and restart the machine
  • From iCloud control panel, log back in.

From this time forward, the iCloud service will re-synch your data from the cloud.

S-Health and password

One of the very annoying new functionality of the Samsung’s S-Health application is the password protection.
After update, during setup the user is asked to set a password, but at this stage is not clear to the user how this password will work. In fact, once set, it will ask the password every time the software is accessed for any reason, not only on startup.

This means, for instance, the step counter will not work when you turn the phone on until you unlock it; if you mistakenly touch the widget on the homescreen and fail to input password, all the activity is suspended until you do so.

As this application is hardly keeper of your utmost secrets (bank account and the like) it is unclear to me why it should provide for this feature by default.
To make the matter worse, the option to manage the password is not shown in the S-Health configuration.
It tooks me a little while to figure out that this feature was activated via the menu button:

Menu > Settings > Password

There you can easily disable the password and get back to the hassle-free usage.