16 Feb 2020

Chrome tabs count

History / Edit / PDF / EPUB / BIB / 2 min read (~258 words)

I'm a tab hoarder and I would like to keep my tab count under control. How do I do that?

In January 2015 I wrote an extension for Chrome that allowed me to track how many tabs I had open. I called it the Chrome tabs count extension. It displays the number of currently opened tabs in the extension bar and when you click on the extension button itself, a chart is displayed with shows the tabs and windows count at each point a tab was opened/closed. This allows you to see the patterns of tabs creation/closing you have.

Chrome tabs count screenshot

Such a tool will not help you reduce your tab count, but awareness is the first step toward reducing the number of tabs you have open at all times.

The second step is to taper (slowly reduce) the number of tabs you have open at all times. My strategy has been to reduce by 10 tabs each week the maximum number of tabs I had open. I started with over 160 tabs and I am now at 100 tabs after 6 weeks. I use the Loop Habit Tracker app to set up a daily reminder to make sure my tabs count is under the limit specified for this week and I try as hard as possible to finish the day with the number of tabs open below or at this limit.

15 Feb 2020

Photo geolocation

History / Edit / PDF / EPUB / BIB / 2 min read (~225 words)

I have taken a lot of pictures and I'd like to see where they were taken on a map. I also don't want to have to upload those pictures to a server or download some software.

I've developed a simple tool called Photo geolocation which is a small client-side application. It uses leaflet to display the images on an OpenStreetMap map. The EXIF image metadata is extracted from the image by reading the image data using exif.js. From the EXIF image metadata we extract the GPS coordinates, which are then used to place a pin on the map at the appropriate location. It is possible to click on the pin to see what picture was taken at the provided location.

To use the tool, simply go to the website and drag and drop your images on the page. The images will be read by your browser, the EXIF image metadata read directly by the browser (nothing being sent to a server). The images with GPS coordinates will have a pin displayed on the map at the location they were taken, while those that do not have GPS coordinates will be simply logged to the browser console and not displayed.

14 Feb 2020

Vocabulary gradient

History / Edit / PDF / EPUB / BIB / 2 min read (~272 words)

I write a lot of articles and I want them to be understood by most people. How do I use the most common language possible?

My approach is to write whatever I want to write about using whatever language I come up with first. Then I use a tool I've developed which I've called the vocabulary gradient. It is a very simple tool where you will generally copy and paste the article you've written and look at the result of the analysis. The tool uses a word frequency list as specified in the README.md. This list was built using the Project Gutenberg library, which makes the word frequency list a bit outdated.

The report generated by the tool presents the minimum, average, maximum and standard deviation of the index of the words used in the text you provided. Those numbers give you a rough overview of the difficulty of your text based on word frequency alone. The lower your average and maximum is, the simpler the article should be to understand An histogram is also generated, where the bins are based again on the index of the word in the frequency list. Finally, the provided text is rendered with each word index as a subscript. Words that are unknown are highlighted in yellow, while words for which the index is high are shaded with a darker shade of gray as their index increases.

With this information in hand, you can spot the words that have high word frequency indexes and try to replace them with lower index words.

13 Feb 2020

Data anonymizer

History / Edit / PDF / EPUB / BIB / 1 min read (~186 words)

I want my clients to share with me confidential data without revealing what the exact values are so that I can train machine learning models on this data.

I wrote a simple python package that uses pandas and scikit-learn to apply some simple transforms to the data. Some transforms that are applied to the dataset can change the distribution of the data, changing its statistical properties, while others preserve them but simply rescale the domain.

Given an anonymizer dataset using this tool, it is possible to do a preliminary data audit and possibly train machine learning models on the data to give a quick idea to clients whether their data looks promising or not without actually revealing the true numbers (except if desired).

The main concern with this approach is that most clients are not technical, and thus having them anonymize their data is generally not easy, if not impossible. Thus it means that such a tool is currently not applicable in the desired context.

12 Feb 2020

Visual Studio Code Run Me extension

History / Edit / PDF / EPUB / BIB / 2 min read (~228 words)

I frequently run the same commands with different parameters but I have a terrible memory. I also use Visual Studio Code a lot.

I developed an extension in 2018 called Run Me whose goal is to allow you to define commands that you can customize through a form, which is a series of questions that will be asked to you, before launching the command with the parameters you provided.

I've used it to do all kinds of things, from launching OBS to resetting the Windows 7 visuals when it lowers them down due to low memory. I also use it to automate various tasks such as creating new articles using a template, opening my buffer document that I use on a daily basis to write notes and more.

Here's an example of my configuration file which I use to start OBS and to reset the Windows 7 visuals.

"run-me": {
    "commands": [
            "identifier": "start_obs",
            "description": "Start OBS x64",
            "command": "\"C:\\Program Files (x86)\\obs-studio\\bin\\64bit\\obs64.exe\"",
            "working_directory": "C:\\Program Files (x86)\\obs-studio\\bin\\64bit"
            "identifier": "reset_visuals",
            "description": "Reset W7 visuals",
            "command": "sc stop uxsms & sc start uxsms"