↓ Skip to main content

Keeping a site up to date while highlighting changes

Question
#

How can you keep a website up to date and yet have previous visitors recognize new content as fast as possible?

Answer
#

As I am a developer, what is the most straightforward answer to this problem is to use a tool such as diff. When I write articles on my blog, I use Visual Studio Code which I have configured to save on window getting out of focus (or the current tab of the editor being changed). With this save event, I also create a git commit automatically with a very boring message “Automated save from VS Code.”. The point is not to have a fancy commit message, but to have a trace of when the changes where made. This allows me to offer to my visitors the ability to view the history of changes that were done to an article.

The downside to this approach is that it is not very easy to diff the article between two versions using the github web UI. It requires manually playing around the url, to provide the base and latest article SHA1 hash and to find the article in the list of files changed, which makes the experience rather painful and likely to lead nobody to do it.

Given that the git repository is available on my server where the blog is hosted, it would be possible for me to run a git diff command provided the last version seen by the visitor. This would allow me to present the changes that were done since the visitor last came. For instance, removal of sentences would be simply not displayed as removed since it is likely to be irrelevant to the visitor, however new sentences would be highlighted in green.


Vocabulary gradient

Problem
#

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?

Solution
#

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.

Reference
#


Data anonymizer

Problem
#

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.

Solution
#

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.

Reference
#


Good execution of a project through consensus instead of leadership

Question
#

How can a project be well executed through consensus instead of leadership?

Answer
#

To properly execute a project without a leader that makes important decisions, time is one of the most critical components. Without enough time, decisions are not consensus but decisions made by the individuals available at the time the decision is required. It is also important not to rush things as it will simply lead to bigger and bigger mistakes happening more and more quickly. At one point a few or many team members will realize they’ve moved too far too fast and many of the necessary pieces are missing, which makes the work they’ve done so far either irrelevant or of low value.

The team members also need to know each other well enough to know their strengths and weaknesses. Without this knowledge, weaknesses are often ignored because they are the weaknesses of everyone.

Decisions need to be reviewed regularly to ensure consistency. Since there is no single leader that keeps the project in their head and wants to see it to completion, it is necessary to ensure that the work that is planned and executed is consistent towards a common vision. Not doing so can lead the team to work on features that go in opposite directions, features that are not aligned with the users the project targets. Acceptable moments to review those decisions are during the planning sessions and the review/demo sessions.

Team members should often work in pairs with a different individual in the team to ensure that their understanding of the project gets discussed with different individuals with different positions. This avoids working with the same person that shares your opinion of the work to be done, while some other individuals may completely disagree with this opinion. Surfacing such differences of opinion early in the development process is critical since it can lead to work that is not aligned with the project.

Overall, we want to reduce as much as possible the time between the moment an individual or group of individuals have an incorrect understanding of the project’s goals and the correction of their understanding.

Reference
#


Measuring success

Question
#

How will you measure your success over the next year?

Answer
#

Over the past few years success for me has been defined less by goals and more by being able to work continuously on a process. For example, I might want to get better at writing. My goal is not something like “write one technical book by the end of 2020” but rather “write technical content daily”. This decreases the pressure and the need to perform while allowing me to do what I want.

I feel happier and more successful when I can keep doing the same thing over and over, even though I may have no motivation. It shows me that it’s possible to accomplish pretty much anything, as long as you’re willing to put in the effort.

Because I evaluate success this way, it is easy for me to track if I’m successful. I use the Loop Habit Tracker (an android app) to track whether I’ve worked on something I told myself I wanted to improve. My list started small and contained very mundane things such as “Bed is done”, “Empty table”, “No dirty dishes” and started including more and more habits, such as “Read 1 wikipedia article”, “Answer 1 problem” and “Answer 1 question”.

Being able to keep a good habit is what defines success to me. With the help of the app I’m able to add more and more habits without forgetting the previous ones since I’m reminded to do them at the desired weekly frequency.


Visual Studio Code Run Me extension

Problem
#

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

Solution
#

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"
		}
	]
}

Reference
#


Productive meetings

Question
#

What does a productive meeting look like?

Answer
#

There are a few people invited, less than 6 ideally. Everyone invited knows why they are in the meeting and will contribute to the discussion.

An agenda for the meeting has been set, with a pre-determined amount of time for each item on the agenda. One person is responsible to make sure that the agenda is followed and that the time is respected.

Notes are taken by the different individuals that are part of the meeting.

Items that appear to require more discussion than anticipated are noted and the involved individuals may spend additional time outside of the meeting to make their point, either through another meeting or by writing a document explaining their position.

A list of actionable items is defined at the end of the meeting and responsibles are assigned to those items. Deadlines are also assigned to those items so that people can expect those items to be completed by the defined date.

References
#


Knowing what your users need without having users

Problem
#

I need to know what the users of my library need, but I don’t have any users yet. What should I do?

Solution
#

When you are defining who your target audience is, it can be rather difficult to decide who your users will be. If you’ve been building capabilities in a certain domain for a while and can solve specific problems with those capabilities, then you will likely want to look for users that may have those problems. You may even end up creating personas or prototypical users who have the problems that your library might solve.

Once you’ve established those prototypical users, you should try to find them in person and confirm your assumptions. You do not want to be building features that they don’t need. In the event you cannot get access to any real users, you can still make use of user proxies. User proxies are people that can somewhat act as the true end-users, but are not the true end-users, so that you have to be careful about what they tell you they need since it is likely to be biased by their actual position. Some potential user proxies are:

  • The users’ manager
  • Salespeople
  • Domain experts
  • Former users
  • Customers
  • Trainer and technical support
  • Business or system analysts

In User Stories Applied: For Agile Software Development, Mike Cohn suggests to use more than one user proxy to mitigate the bias from any specific user proxy. Make sure that the user proxies are of different types. This technique is comparable to using ensembling in machine learning.

Reference
#


AST in python

Problem
#

I want to analyze a python script to extract something from it. How do I do that?

Solution
#

Python has an abstract syntax tree like most programming language.

You can use the ast module to parse a string that contains the code you want to analyze.

A simple example is as follow. It will read a file defined in the file variable, use ast to parse it, returning a tree that can then be traversed using the visitor pattern. Defining visitors lets you separate the responsibility of each of them, making the code that analyzes code easier to understand.

import ast

class ClassVisitor(ast.NodeVisitor):
	def visit_ClassDef(self, node):
		# Do some logic specific to classes
		self.generic_visit(node)

class FunctionVisitor(ast.NodeVisitor):
	def visit_FunctionDef(self, node):
		# Do some logic specific to functions
		self.generic_visit(node)

visitors = [
	ClassVisitor(),
	FunctionVisitor()
]

with open(file, "r") as f:
	code = f.read()

	tree = ast.parse(code)

	for visitor in visitors:
		visitor.visit(tree)

Reference
#


Working on the most important task

Question
#

Why aren’t we always working on the most important task?

Answer
#

For bad reasons:

  • We don’t want to work on the most important task.
  • The most important task feels overwhelming.
  • The most important task seems too risky.
  • The most important task doesn’t seem fun to work on.
  • We want to work on fun tasks, not hard tasks.
  • We want to work on what interests us, not what provides the most value.
  • We think that the task we’re working on is more important, but it isn’t.
  • We don’t know how to solve the most important task.

For acceptable reasons:

  • We don’t know what is the most important task at the moment.
  • We don’t understand what is important to our clients.

For good reasons:

  • The most important task has prerequisites that need to be completed before it can be done.
  • The most important task is being done by someone else already.
  • The importance of tasks is likely to change soon due to a change in objectives.