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

[1]  https://en.wikipedia.org/wiki/Completely_Fair_Scheduler

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.

> Adaptation

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

The quick note of the day

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!

REFs

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.

class Node
{
public:
int data;
Node* next;
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)

   1. Read the nodes

   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:

1. Read, acc > read, acc > read, acc

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:

1. Read, acc > read, acc > read, acc (Scope function 1)

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.

string add_list = nullptr;
for(int i = 0; i < temp.size(); i++){
add_list += temp[i];
add_list += “->”;
}
add_list += “->nullptr”;

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!!

REFs

[1] https://stackoverflow.com/questions/32893566/why-is-g-returning-a-segmentation-fault-error-when-i-point-a-node-to-a-char

[2]https://stackoverflow.com/questions/17772103/can-i-use-if-pointer-instead-of-if-pointer-null

[3] https://github.com/FranciscoMeloJr/C-Tests/tree/master/solutions_print

[4] https://en.cppreference.com/w/cpp/container/vector

 

 

 

‘old’ Series

All

Intro

  During my childhood there was this channel called “Rede 21”, it was part of Bandeirantes group and they would broadcast 60s/70s shows: Bewitched, I dream Jennie and Star Trek. But also 80’s shows, as Knight Rider.

Elizabeth Montgomery & Martin Landau

   I found this video on youtube and all this memories came back!!! I miss all those shows very much!!
After a quick search I fould actually that many of them, almost all actors died already. Very sad. This includes Bill Daily, actor on ‘I Dream of Jeannie’, which died some days ago, very recently.  Barbara Eden is alive and well!!  I think it is time to use ‘Saudade’, this portuguese noun to describe when you miss something.

REFs

Implicit Types on scope declaration

All

Intro

One thing that is ambiguous to me is the implicit types of languages like python and c#.  This makes Python so powerful but also very confusing AT THE SAME TIME! Python and C# are very different, one strong typed and another is weak, but it’s interesting to compare how they handle a non-explicitly variable declaration.

Btw, I always use the Microsoft official guide, it’s quite explanatory[1]. Yes, I know proprietary stuff, but come on, C# is very useful and powerful too. The performance especially got better recently (a couple of years that is getting better already and GC too)

Python

On the declaration of the variable, we don’t need to explicitly say what it is, since it’s weakly typed. On the example below, x and y are different types and are not explicitly stated.

x = 5
y = “John”
print(x)
print(y)

 AND FOR ANONYMOUS VARIABLE: In python to use an anonymous variable, we use the _ –> underscore operator.

C#

C# is a strongly-typed language! However, in C# we can use one trick to make it more flexible by using the Implicitly Type VAR!!
By using the keyword var on the declaration of a variable. It’s up to the compiler figure out what type of variable is actually on the declaration. But interestingly it must be declared and used on the same statement.

var i = 10; // Implicitly typed.

int i = 10; // Explicitly typed.

It’s possible to download straight the Programming Guide from Microsoft here [2].

In a table

Everything looks better in a table, so we have:

Python C#
Anonymous _ var
Implicitly N/A var

REFs

[1] https://docs.microsoft.com/en-us/dotnet/csharp/index

[2]https://docs.microsoft.com/en-us/dotnet/opbuildpdf/csharp/programming-guide/types/toc.pdf?branch=live

 

Online MBA

All

Intro

Back when I was in the High School in Sao Paulo, I remember the release of Apprentice, with Roberto Justus. I watched every single episode! The episodes usually started at 10h40/11h pm. It was a bit late for me, but my mother used to watch me with. It was really fun indeed. This was back in 2004!

Apprentice

In Brazil, The Apprentice, with Donald Trump, was released by Record channel and there are actually 10 seasons. 8 with Roberto Justus, 2 with Joao Doria Junior. There is some debate around who was the best but it’s irrelevant.

Anyways, this Post is about Online MBA. Well, I consider all these series as an Online MBA, since all the episodes are online on YouTube. The first one has bad quality and the second one is incomplete, but I all the others are ok. it’s all in Portuguese-br though.

Watching the American version after watching the Brazilian version is quite interesting. I bet you can find one in your one mother language.

REFs

Below is one episode, Apprentice 4th session.

Linus is back/EBPF rules

All

Intro

I usually follow computer science/informatics news via PodCasts, as I follow space news via some youtube channels. Let’s go to the most important news of the week actually.

Linus is back

Well, and he is back to the kernel! finally! Great news!

eBPF

I remember SuchakraPani explaining to me about eBPF and how this package filter was extremely strong and flexible. Linus did comment on this on his return and how this is strong nowadays.

IBM buys Red Hat

This news leaked on Sunday and it’s that 32bi to buying Red Hat. Let’s see how Red Hat will change its structure.

 

Graph algorithms

All

Intro

I think one of the classes I most miss was Graph Theory, from Prof Estela Maris, at my undergrad level. It was extremely interesting and very theoretical, but quite useful in real life for some problems.
The proves of some properties of graphs were the part that demanded most of me, applying specific math knowledge for proving some properties of some graphs, i.e. trees, digraphs and so on.

I think most of the online courses I’ve seen so far they forget to tackle those kinds of data structure, and as another professor of mine used to say, if you forget the data structure you are halfway down the hill already.

So my recommendation is to study Graphs Theory and math proven, which certainly will be useful at some point.