Lost track remote branch [git tip]

All
Intro 
  I remember I deleted the local branch AND I COULDN’T FIND IT!! It was only on the remote.
So what I’ve done? I basically lost track of it.
Tracking a remote branch
    What I did was to delete my local branch and create again using the track option:
git checkout –track origin/daves_branch
      That’s magic, you will get local branch straight from the origin!!
Ref

[1] https://stackoverflow.com/questions/9537392/git-fetch-remote-branch

PHP memories

All
Intro 
    I remember I started learning php from a book in the second year of the univesity. It was quite interesting, some people say you cant learn a programming language, or script, from a book. I tend to disagree though, I first is quite a ok way to learn. But of course, combining with practical part, undoubtedly.
PHP
   I didn’t practice much php for a bit and re-learning it from [1] made me miss the forms and the buttoms. So simple and yet so well done.
    <br><br>
Gender:
<input type=”radio” name=”gender” value=”female”>Female
<input type=”radio” name=”gender” value=”male”>Male
<input type=”radio” name=”gender” value=”other”>Other
<br><br>

Ref

One feature – one branch policy

All

Intro

I remember when creating a new feature in a branch in my first week of work. Then I learned that it was much more easy this way. Otherwise we would need to rebase everytime from origin/dev.

One feature – one branch – (one commit)

So in some teams for each new feature, a new branch news to be created from dev(or masters), the feature is created and then the merge request is created.
This is quite simple and after the feature is merged, the branch is done. Create a new branch.

   It’s very wise to squash for only one commit! yes, so the history is very clean! so nice. Sometimes I dont follow this though, I use two or three commits!

Ref

[1] https://medium.com/ki-labs-engineering/one-feature-branch-one-commit-4393aa0a96cd

 

View at Medium.com

Scons performance

All
Intro 
  In one of the company project, we use scons, but some people hate it actually. I think it’s quite decent, the python scripts are clean and simple to read. But the problem is actually the performance.
Scons Performance
   There is actually a current debate about the scons performance [1] vs [2]. I don’t know why (some bias) I tend to think [1] is a bit more right, at least the benchmarks are quite convincing.
Python fault
But the scripts are written in python, what were you expecting?
 
  [2]https://github.com/SCons/scons/wiki/WhySconsIsNotSlow

MVC

All
Intro
When I worked in Agile Solution, as FSD, I really learned many things but I think one of the most important was the use of MVC model on Js/CSS/Html.
One of the reasons I got into this company was because my honour thesis used the MVC model.
Functional Programming
  Sometimes I had questions specially about Functional Programming, which is very interesting but demands you to learn a new way of thinking [4], which NC Patro explains very well about it.
SAPUI5
  Besides this, we used some stuff from the SAPUI API [2], which for me seemed more a library though.
Tip for learning 
 Use the materials from W3School[3], which I always use when beginning a new thing.
NZ
By the way, one of the guys that most taught me about it, Mateus, has his own youtube channel [1]. He recently moved to New Zealand.

MAD MAD MAD

All

Multiple Asurred Destruction

Sometimes I’m glad that Game Theory was invented, the humanity would not be here otherside – who knows. This military doctrine always came to me while watching those apocaliptic movies, Terminator for example – breaking the so called Nash Equilibrium [1]

Game Theory

   Game theory came to my life after watching A Beautiful Mind and got stuck there.
Nash Equilibrium
   In the Nash Equilibrium, none of the opponents will change their chosen straties after considering the opponents choices.
Programming Games with AI
   So when I first started my game implementation using concepts of a “AI for Games” book. I started very hard to implement games with those concepts. But I couldn’t finish them, specially because I wasn’t using Git and I was programming in C – which is awesome but for those things is much faster use some Python libraries. I can’t find those codes unfortunately.

Choice supportive bias in train

All

Intro

It’s very usual to see people selling stuff in the trains in Sao Paulo.
Once coming back from work, in a train back in Sao Paulo, someone started to offer a hamer to the people inside the train car.
It was bizarre. No one wanted to buy the hamer obvously.
(The more bizarre was the choice supportive bias that happened two minutes later – wait for it)
But then one person on the other side of the train raise the hand and bought it!
And then another one!!
(The catch)
Well, the seller left the train car and I could see from the window that the first buyer was actually working with him! XANANIGAINS!
THOSE GUYS MANAGED THE SUPPORTIVE BIAS without studying it in the School!!

Lesson

  When making choices your brain will play tricks on you. so try to avoid those biases with the most racional decision. Specially in groups decision, and I guess that’s why in elections the ballout paper is hidden and secret. It will be another bias! haha

Ref

[1] https://en.wikipedia.org/wiki/Choice-supportive_bias

Head First Design Pattern and Christopher Okhravi

All

Intro

    During a interview, I remember we talking about MVC models and how the change in the Model would change overall model. I was asked then what was this pattern. And I was like (forgot face ???) instead of saying Strategy Pattern.
    Thanks for Christopher Okhravi, nowadays 12 of them are straight on youtube videos[2] from the book [1].

Design Patterns

  Strategy Pattern
         Using composition over inheritance
  Observer Pattern
         Poll vs Push archtecture. Keep on asking for changes
   Decorator Pattern – adding behavior dynamically to an object
   Factory Pattern – creation of objects
   Abstract Factory – build objects without specify the concrete object
  Singleton – restricts to one unique object the creation
  Command Pattern – encapsultes request as object, and have a queue of command
   Composite Pattern – combine requests for example commands.

REFs

[1] Head First Design Patterns

RNN

All

Intro
A bit before finishing my master, with the help of Prof Orlando Silva, from Mackenzie during his Neural Network classes.

I started learning a bit of the Recurrent Neural Networks, aka RNN!
Not dead anymore

I was quite impressed with how powerful were they and the fact that the field stood still for so long time until recently.
So I tried learning it, from the basic to the more advanced. The math for me in the begin was difficult but after several book you kind of get use to it.
Resevoir Computing

Doing this small research I came to the Prof Murilo B, at Aberdeen University and his work with Reservoir Computing. He knew so many things and so many properties of those things.

I was impressed on how many things we could use it, from speech recognition to Chaos theory!!!!

Some properties

Since one can think about recurrent networks in terms of their properties as dynamical systems, it is natural to ask about their stability, controllability and observability:

Stability

concerns the boundedness over time of the network outputs, and the response of the network outputs to small changes (e.g., to the network inputs or weights).

Controllability

is concerned with whether it is possible to control the dynamic behavior. A recurrent neural network is said to be controllable if an initial state is steerable to any desired state within a finite number of time steps.

Observability

is concerned with whether it is possible to observe the results of the control applied. A recurrent network is said to be observable if the state of the network can be determined from a finite set of input/output measurements. A rigorous treatment of these issues is way beyond the scope of this module!

Git

I forked from Torch RNN library here [2], you should do the same!

Summary

I did a small summary of my research and if you have more interested it you can see it here[1]. It is very very small and summarized, i.e. 15/16 pages.
[1] https://docs.google.com/document/d/1fE_6TLHhz010YeYFa1g0SHfkDYWNzL8qFD5RoroY_rM/edit?usp=sharing

[2] https://github.com/FranciscoMeloJr/rnn

[C++ tips] Enums

All

Intro

   I personally think we subtilize enums in all the languages. The sentence “Francisco, you can use a Enum here instead of int” comes to my mind.

C++

   One thing that I like about c++ enums implementation is that you can break the flow:

All examples are from here [1]. I hope I don’t go to hell to use such clever examples here:

// color may be red (value 0), yellow (value 1), green (value 20), or blue (value 21)

enum color

{

    red,

    yellow,

    green = 20,

    blue

};

    Blue is 21!! Like, breaking the flow!

Defect Reports

   By the way, I don’t know if you like to search about Defect Reports, it is very helpful actually.
Spending some time on it might save your time in the future actually.

Refs[1] https://en.cppreference.com/w/cpp/language/enum

[2] http://open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1638