# Git tips

All

### Intro

Git is an essential part of the developer’s path and while working here and there I created a Git Tips summary [1] and it’s also here below:

# PyCharm

All

### Intro

My training at the bachelor level was always to avoid external help and program basically with a paper and a pen, later passing it to the computer! Mainly to avoid a lot to use unnecessary tools to do things they don’t require, trying to learn and improve yourself in a language is NOT HELPED if your IDE continue to solving all your issue.

But for improving the speed and IN REAL LIFE some tools really help, and this is the case for PyCharm! totally. Or even Microsoft VS PVT! microsoft cof cof

### PyCharm

You can find PyCharm here [1] and the download straight from the link [2]. I remember in the previous versions, back some years, it was kind of basic, nowadays though, it’s very powerful with many tools and stuff, it’s like a VS for python developers.
Remember to download/install python first, since it doesn’t come with the IDE.

I’m currently using version 2018.1.4, which is quite simple and basically plug and play. Install and run in 5 minutes.

# Correlation does not imply causation

All

### Intro

Recently I’ve come to the link [1] and it’s quite interesting and uncommon – just for funny knowledge though, nothing ext scientific.

### Correlation vs Causation

I remember studying statistics at bachelor/masters and the correlation was an interesting topic for me, really.  How come two things could be so correlated but not cause the other?! But yeah. Correlation does not imply causation. The examples [1] are there to show.

### My thesis

{Reminder: my thesis was about measuring performance metrics and execution of C++ programs}

Interestingly one of the bases of my master thesis is the assumption that correlation implies causation – which is quite a strong statement, but for the specific cases we deal and assuming the metrics measure all the system, we can then assume causationXcorrelation (X== implies). This is possible using the causal modal I assumed for the system [2] by the common cause principle of Reichbach [3].
It will be clearer below:

### However, you can infer causality from correlation

Using a causal network, with 20 possibilities to know causality, in the model below (stolen from [2]) we assume then: (N ->) Abnormality -> Metric. The model is very useful and should it will be used for other analysis. The one I considered on the models for the metrics.

# Conferences

All

### Intro

Although I finished my masters in 2017, in June, I still attend conferences and also send some papers for conferences I consider important – or related to what I do.
I think computer science and programming are basically an art and therefore it’s imperative to spread/share it not only with books but with our experience and contributions.

### Conferences

I think is a good way to meet people, learn things and also travel to different destinations, for example, a conference in Wien (aka Viena), or Graz, or even Portugal.

I usually use Wikicfp[1] to find conferences that have some alignment with the things I usually work, for example, conferences in python or scrum.

Recently I submitted some stuff for the ECRM conference, summarizing some work I previously did as Scrum Master.

Although my passion is Latex (sharelatex/overleaf), for some conferences I develop my summaries in onedrive or google drive, so I can share with Gabriel A., since we usually work together.

### REFs

[2] https://www.sharelatex.com/ (Legacy)

# Duo/Trio

All

### Intro

Well, I started to “play” a bit of Cajon after a show in 2011, with a saw with Yuri and Roger. The guys that were doing the songs were doing mostly covers and later let us play with the instruments.

So I found out that I really like percussion instruments and it’s great, cause that time my bass skills were not developing as fast as I thought they would.

### Band

Recently I moved to Toronto, ON, from Montreal and talking with some friends here –  friend of friends too –  we got together some guys and we started to play a bit. I actually bought MY FIRST CAJON. It was great, we realized that it was missing a singer, actually, a female singer. So then, we announced on kijiji and more than two people replied!
We did some tests and essays and we are selecting our female lead singer, which will start playing with us at nights on clubs and stuff. So we might get back to Montreal just for some small demos, who knows!! We have a set with several songs in different styles.

### REFs

No refs this time.

# Planning for activities

All

### Intro

I like to be on time on my events, instead of being ahead. Waiting 15 minutes is usually a waste of time when I can be reading some interesting news about SpaceX or programming in python at home.

However, some time ago I went to do an English exam, I think it was CELPIP. So I was going to be 15 minutes before the exam start – THIS IS A MISTAKE – but one station before the train actually stopped and asked everyone to leave. So there were so many people, although it was very nearby I could only get there 5 minutes AFTER! So no candles and no crying, I needed to book another exam.  I wrote an email right away to them, but it wasn’t enough actually.
Lesson learned, now I go to places 30 minutes/15 minutes before and carry my poetry book.

### My list for controlling anxiety

Poetry book

Turn off the cellphone’s 3G

Count, this makes your prefrontal cortex activate and relieve stress

Sing a song, either in your mind or very low
Do some exercises or stretching

# UnFair Scheduler on movies

All

Intro

Once I watched a movie and the director, in an interview, suggested he developed an algorithm to help the development of a good script + popularity. That’s amazing, except by the fact that I can’t find his name or the record of this interview, I think it was Padilha – Elit Squad 1&2/ Robocop – new version.

Movies vs algorithms

I think it is totally possible to develop such algorithms, and I think actually that Netflix was able to develop something similar. At least, that what I think, some guidelines to develop for some niches. I think the plot is not made by a machine, yet, but has some hints – although the development is not done by Netflix itself, but rather by 3rd party productions – I made a small list of some hints on those movies:

Some series always include the elements below:

80’s songs

Dark illumination/ some specific colours on the illumination

A strong female character with the development of self-steam

Confusing male characters

(…)
Queue algorithm

Although the hints above seem to appear always on those series, my main hypothesis is actually a queueing algorithm similar to the kernel scheduler of changing contexts. Well, bare with me on this one.

Each character is a process and has several scenes to be executed. If we get all the characters and split the time equally for the duration of a movie/series you have a Fair Scheduler [1].

But, this might not be the best, since the limbic human system (Musk quoting here) might wait more and more for the scenes of a certain character. In this case, for example, another algorithm could place a specific character more or less, in a not fair way to maximize climax or to focus in a specific detail of the plot. In an Unfair Scheduler, the time is divided equally for all the characters except one, which has less or more time than the others.

REFs

# Agile principles at Henry Ford’s book

All

### Intro

“The producer depends for his prosperity upon serving the people”.

“As we serve our jobs we serve the world”

Henry Ford

I started to read Henry Ford’s book, My Life and Work, which was written together with Samuel Crowther. The book is quite interesting and besides talking about his success, he also describes other aspects of life that are much wider and useful.
Henry Ford, very popular and controversial, interestingly we had a similar experience with the death of our mothers, this really changes ours personally in some way. But his mother died when he was 13, this is really really difficult much more than 19, which was my case. I tend to admire some thought of his book and strongly disagree with others at the same time.

He was born in 1863 and died a bit after the world war, in 1947. It is amazing the fact that he worked for Thomas Alva Edison and met him personally. Edison approved his automobile experimentation and certainly, this shaped the world.
[Henry’s views of Jews is very controversial and I won’t comment on that. I’m glad to have Arabic and Jews friends and life mentors.]

### Henry Ford’s Book

The book is quite interesting to read because of the language, he talks on the first perspective and direct interaction with the reader, he doesn’t break the 4th wall but it seems he is explaining something for the reader.

Sometimes the sentences are direct and short but hide specific and deep meanings, like about his thought of currency manipulation, his view of bankers, Democracy and Government interference on business.

### Henry Ford on Agile?

The producer depends for his prosperity upon serving the people.

Money comes naturally as result of service.

Although this may sound an exercise of thought but several Agile principles and can be interpreted in the book. Some of them can be highlighted here:

> Transparency

His defense of democracy is a clear example of transparency

>  Inspection

He aims for specific and minimalistic same cars models is a pure example of inspections, since one needs to have standards for inspections.

The chapters about his success and failures can also be seen as an adaptation. Experimentation is an adaptation.

The main thing, I must add is that Agile and specifically Scrum is heavy based on  Empiricism, which actually states that knowledge comes from experience and knowing variables to make decisions [Scrum Guide, pg 3]. That’s basically Henry’s ideas and even is corroborated by the avoidance of the creation of new methodologies and adoption of the so-called freak styles (page 9 of his book).

### Henry Ford against changes?

Henry Ford’s words were pro simplicity but he was against changes and new methodological breakthrough. In other words, relying on what was already working to do things instead of too much risk and too much creativity.
This was expected though since he’s academic, engineer and worked in Edison’s company.  Why? Because engineering is about using what works to do things, not about invention, although with some extent of experimentation I might add, of course.
The disagreements with his son also corroborate for this interpretation of his lines of thought. Using known methodologies to do things, faster and client based.

### Fundamental idea

The thing I liked must on the book, and that changed my whole interpretation of Henry’s idea, is that actually according to him the creation and use of automobiles is an exercise of freedom. A car is a tool for human’s freedom of going – freewill

I personally never saw that way, but that’s true. If you don’t have a  car you really on either someone’s else’s car or public transport, therefore your exercise of free will is limited by some borders and he aimed to break those borders.

### Quick but important note

There are many controversies in the book, for example stating that people are not all equal, which I personally must disagree. All persons are equal, undoubtedly.

[Again, Henry’s views of Jews are not expressed on the book, at least the part I read. Discrimination of any kind, in my opinion, is pure nonsense and ignorance.]

### REFs

Henry Ford’s: My Life and Work.

Scrum Guide, by Ken Schwaber and Jeff Sutherland

# Jupiter Project

All

### Intro

Once a guy at my work mentioned Jupiter Notebook. It was quite interesting indeed.

### Jupiter Notebook

Well, it makes easier to share content especially for academia[1]. According to their own website [1]:

The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text.

### Jupiter Lab

I started to play with it since the tests with Dask actually!

# Printing nodes

All

### Intro

Solving some problems with C++ is quite interesting:

This one, as simply as follows: You have a sequence of nodes, and you need to print the sequence of values within the nodes.

##### Node(int data, Node* next = null) { this->data = data; this->next = next; } };

So then the test is to create a function that returns, as string,”0 -> 1 -> 4 -> 9 -> 16 -> nullptr”, when this goes in new Node(0, new Node(1, new Node(4, new Node(9, new Node(16)))))

All my solutions are here [3] and are details below.

### Solution 0 (used in all the solutions)

All my solutions use while(list) to iterate over the nodes, it’s quite simple and direct utilization.  The vector used was from std [4] – as suggested. This article here [5] talks about the performance of STL vectors and specifically the push_back function.

My main solutions was (pseudo-algorithm)

2. Accumulate the values

3. Read the accumulate values and create the string

4. Return the string

### Solution 1

The solution one the one with everything combined. I run for each node, convert it to string, adding with the ” – > ” in the final string.

This solution is then an implementation of my pseudo-code in only one passage over the nodes. So:

Read node, create string, accumulate > Read node, create string, accumulate> Read node, create string, accumulate (…)

### Solution 2

The solution one was the simple iterate on the nodes, create a vector of strings (vector library) and accumulate the strings. Later use a for loop to go on each and accumulate on the string the values. Adding the null at the end, since it has a comparison.

This solution is then a break on my pseudo-algorithm, in a way to break it in two:

2. read string, change, acc new string > read string, change, acc new string

### Solution 3

This solution was basically the previous, but with the function += instead of append. This is nothing in C++ concatenation and append is different in Python for example.

Then the solution is the same as Solution 2

### Solution 4

This solution I basically read the nodes, put all the info in a vector and then send this vector to another function, which aims to congregate all the string creation. This seems redundant but breaks the solution in two:

1. Reads the content of the nodes

list->data access.

2.  Create the string

The function that will iterate over the temp vector and concatenate the string forming the ” -> ” value.

So then:

2. read string, change, acc new string > read string, change, acc new string (Scope function 2)

### Notes

While doing some tests with Repl.it, my favourite online compilation framework, I came with a bizarre error related to the non declaration of add_list, I think is a memory problem on the previous runs, because the error wouldn’t go away. I deleted the solution, restarted and it worked – all good.

for(int i = 0; i < temp.size(); i++){
}

### Conclusion

My conclusion is to use the function or a separate solution, instead of putting everything together in the same place.

One must be careful because not all the issues that occur on the pointers access are segmentation fault[1], which can also occur. The solution with if(pointer) and while(pointer) are valid and are prefered over the pointer!=null actually, to simplify the reading of the code [2].

I would like to compare the solutions with other compilers and I found that nullptr only works if we have C11 and use std=c++0x, for Gcc 4.6 btw!!