LFGA Web

Week 3 - What I learned


Overview

This week was full of new concepts in which I would like to go deeper. We read about quantum physics and was a whole new world. We learned a new way of programming using TDD. We also learned new tools for testing and text editing. Finally, we had to do a movie recommender using our new knowledge.



Videos


Inventing on Principle

Things to note or learn:

Discussion:

I didn't think of this before, maybe I'm just working without a principle. Right now I don't have a principle... But as we can see in the video there are ways to discover our principle. What I could do to find my principle, is to be more observer, see what is happening, find a problem, find an activity or task that people aren't doing properly or the best way, and that's what triggers all. Now, when you find something like that, I'll try to believe in something... work for something to improve that part. I think I could do something like this, and finally, fight those things and that's how change begins.

Pale Blue

Two things to remember from this video. Number one, we don't have another place to go, all the resources that we have to live in this universe are here with use (up to now as we know). We have to be careful with our resources, take care of the world and try to make it a better place. The other point is that we are so little and fragile and... well.. let's try to be more humble, we are not that big.


The future of programming

Things to note or learn:


Discussion:

I find it very interesting how this guy tries to explain the problems and how programming communities invented new ways and styles of programming and how through time these ways of programming changed and improved. I liked the explanation and what this guy is trying to say and the message.

Now, all of these things had to change because technology changes and faces new problems and we have to create new solutions and this takes us to new languages and technologies. It is difficult to offer new technologies and for communities to accept them because they tend to resist change. This is the main problem that I can see.

In my opinion, the main message of the presentation is that we are going to face problems and that everything is not figured out. We are going to have new challenges and we have to try to solve them, but if we don't try to understand this then we are going to resist change and avoid new solutions. We have to be open to new solutions, new technologies and be able to work on new things. As this guy said, you accept that you don't know what you are doing and what's coming and start once again and learn again.


Machine learning - Google

Things to note or learn:


Moonshot Thinking from Astro Teller and inside Google X

Things to note or learn:

Discussion

In this part what I get most is the part of being constantly experimenting and learning things. I think by doing this you have two outputs. The first one is knowledge, if you try and fail then you are learning, and that's how I like to learn! by doing things by myself. The other one is innovation, if one of these ideas works then you have a new product that no one tried or invented before.

Also, I liked the freedom of doing things and coming up with new and crazy stuff. In my opinion, letting people imagine crazy and new stuff is a motivator for creativity and this is where innovation and new products are born. I wished we could all work like that.


La mejor presentaciĆ³n de tu vida

Things to note or learn:

Discussion

In this video, I learned tools to make better presentations. There are things that I would like to improve in my presentations.

The first thing that I can do is to cast the emotion that I'm feeling when I'm speaking, I could be more expressive. I want to do this because I want people to feel something. Second thing is to try to interact with the audience, ask questions, play with them or use them as an example, something like that. Use different tones and volumes in my voice to create a differentiation in ideas.

Finally, I think to know this is important because we need to communicate ideas. The last thing that I'll add is having feedback could also help us and remember that we will always keep working to improve our presentations.


Quantum computers explained, Google and NASA's Quantum Artificial Intelligence Lab and Double Slit Experiment

Things to note or learn:

Discussion

About these videos, I didn't understand all of the videos... but what I can get is that computation is changing and this is becoming more powerful. In this case, is using Quantum science to process the information, and is a whole new change because the information can be represented in new ways. Everything is changing and is exciting how they are creating a new future.

This is the example that Bret Victor gave us, that things are going to change. I see security changes, some algorithms are going to turn obsolete because is going to be so easy to crack or brute force them. This one of many consequences that I see. But, the point here is that we have to be open to new things and we are going to start once again, destroy what we have and create a new mechanism in multiple areas.

What Got You Here Won't Get You There: How Successful People Become Even More Successful,

Things to note or learn:

Discussion

There are a couple of things that I take with me in this video, but I just want to mention how interesting and fun was this presentation. I would like to read the book, I find it interesting how this guy presents the stuff and how it makes the audience be part of the presentation by making them participate.

One of the points that made me realize a lot of things is that if someone doesn't want to change, is not going to change. I mean change starts within one, not on other things, you are going to change because you want to change, not because someone tells you. We also have to understand that we can't change people, we are going to lose our time with someone who doesn't want to change. We can help people to change and I think we can begin by having good communication, let them know things.

The other point, that, in my opinion, is really important is that we have to be humble towards others. Is true what this guy says, we can learn new things from others and we could even be coached by somebody else. We also need to understand that we are not superior and we can learn from people that we think aren't prepared enough. This is a big mistake, let's try to learn from everyone and listen, I think others have different ways of seeing things and interesting histories.

To finish this part, I like the title of the book. I think is a book about how to keep improving ourselves. Once again we have to be humble and accept that we aren't perfect and will never be so keep learning things, find the way to know which parts could you improve, and finally really work on that, really do it.


Measure for Measure: Quantum Physics and Reality and The Quantum Conspiracy: What Popularizers of QM Don't Want You to Know

Things to note or learn:


Discussion

A lot of stuff going in here! Well, I didn't understand everything and I'm not an expert in that stuff. What I can notice is that science is trying to improve and is trying to find new things that could change the way we live. Also, what I can see is ta scientists are also having issues and that are striving to get an answer. Once again we have to be open to new changes not only in technology but in how we see the world.

What I also take is that we don't understand anything and that the most famous scientists knew this and that's what motivated them to discover other world and other forms in how life works. Let's take this with us, what we see is not the reality and that reality could not be real. Let's just live with that.

Lastly, just to point out that computers are involving using these crazy concepts and we don't know what awaits for us. In any case, we just need to be open to new stuff and relearn anything needed. I think that this could affect our lives in the distant future if new information comes out. If computers can change our lives and problems too.




Creating Movie Recommendation for Amazon Movies users


This week we are going to build a Movie Recommendation app, but to do this we have to learn new things. Let's go!

First of all, let's see a little example.

Creating a User-Based Recommender in 5 minutes

Link: Here

Here, we start by seeing the data set which is a user id related to an item, in this case, could be a movie, and the strength of the relation. Now the important here is how to do the recommendations. What we need to do is to compute recommendations for other users we are going to search users with similar tastes and pick the recommendations from their items. To find those users the model has to do it by their interactions. To compute this the model is using correlation coefficient with the interaction data. Now, you have users with similar tastes. Using the 'neighborhood', the model, and the similarity now you can make recommendations.

We need that verify that indeed is giving a good recommendation. This model is going to take 90% of the dataset as a training data set and the other 10% as the test set. In the example, we can see how to build that piece of code and do the test. The important thing here to note is that it is using the correlational coefficient to do recommendations and A/B to test it.


Now we have to develop this app using something called Test Driven Development. Let's read about it!.

Test Driven Development

Qs

This how you can do Test Driven Development:

Well, there are some advantages from coding like this.

I coded using this methodology and yes helps you a lot to think about what you are going to do next, and also helps with not losing focus on the part you are working on. Also makes you go back and refactor the code, so most of the time you are going to have a clean code. In my opinion, using this methodology helps you a lot on the code that you're building but also you'll have a lot of tests that work as documentation.


Now that we know about the methodology we can now learn something about the little pieces of code that do the tests.


UnitTest

Qs

First of all, is hard to define what is a "unit". In OOP tends to be a class in functional maybe a function. This is where the discussion begins whether the unit you're testing should be sociable or solitary.

Qs

Sometimes you a class needs some functionality from other classes; can we consider this as a "unit"? No, not all unit testers use solitary unit tests. Using the sociable test didn't lead to problems at all. So, we can call a sociable test, unit test. Because you are testing the behavior of a single unit (with multiple classes).

There's another discussion about the speed. But I just want to point out some things that could be useful:


Now that we know about unit testing we can look to a framework to do this..


Xunit

XUnit is the family name given to bunch of testing frameworks that have become widely known amongst software developers. The name is a derivation of JUnit, the first of these to be widely known. Basically, that's the definition. Qs

The main focus is to make it easy for developers to define the tests using their regular Smalltalk environment, and then to run either a subset or a full set of tests quickly. Later on, this became Junit. JUnit introduced the red/green bar progress indicator. The article is more of the history of the development.

Let's take the important parts:


Now that we understand some basics, we can now go and lear what is Stub and a Mock.


Mocks Aren't Stubs

The term 'Mock Objects' has become a popular one to describe special case objects that mimic real objects for testing.

We commonly confuse mocks with stubs. These are the differences:

On the one hand there is a difference in how test results are verified: a distinction between state verification and behavior verification. On the other hand is a whole different philosophy to the way testing and design play together, which I term here as the classical and mockist styles of Test Driven Development.

The article is giving two examples of testing I'll try to describe them.

Regular Tests

These are the commons tests, the conventional JUnit tests.

Qs

It follows a four-phase sequence: setup, exercise, verify, teardown. The setup method is where you create the objects. We create the objects and the asserts are verifying that the objects did the correct thing. In this case, we don't have to call the teardown, the garbage collector is going to do everything for us.

Here the style is state verification, we verify that everything is doing everything properly. Asserts here are important!.


Tests with mock objects.

Let's see this example, in here the author is using jMock library for defining mocks. jMock is a java mock object library.

Qs

Now we can see the example and some differences. First of all, the start is divided into the data and expectations, the data part sets up the objects we are interested in working with, the second part of the setup creates expectations on the mock object. The expectations indicate which methods should be called on the mocks when the SUT is exercised. The key difference here is how we verify that the order did the right thing in its interaction with the warehouse.

With state verification we do this by asserts against the warehouse's state. Mocks use behavior verification, where we instead check to see if the order made the correct calls on the warehouse. We do this check by telling the mock what to expect during setup and asking the mock to verify itself during verification. Only the order is checked using asserts, and if the method doesn't change the state of the order there's no asserts at all.

The other thing to note is that is not using the actual object's instance is using an instance of a mock object. The important here is also the behavior.

The Difference Between Mocks and Stubs


Meszaros uses the term Test Double as the generic term for any kind of pretend object used in place of a real object for testing purposes. The name comes from the notion of a Stunt Double in movies.

When do we use a Stub or a Mock?

Choosing Between the Differences

Besides the state and behavior verification there are other factors that we can consider to choose between mocks and classical:

To finish with this section we need to understand the context in which we are working to make a decision. Also, there is no better, they are only tools and they offer different solutions depending on the problem. Sometimes you need to use a mock when you are also testing behavior and it's really important to consider the other stuff that could be affected. But, you can always test with a regular framework and objects. In my opinion is important to have tested any kind of tests rather than no having something. Now we are going to learn this and we can use this in our development. Like the author said, you can just give it a try and see go it goes, but remember they are not the same and they cove specific and different needs.


This is what we are going to do, try unit testing using objects not mocks, but to do that we need a little thing more. The Java Tools.


Finally, let's read about the tool that can ease our work.

Java Build Tools: How Dependency Management Works with Maven, Gradle and Ant + Ivy

I kind of did a cheat sheet that I'm going to paste here.


Missing semester: Editors (Vim)

For this section I created my cheatsheet, I'm going to paste it here, I have to learn how to use vim!


Missing semester: Version Control (Git)



Conclusions

I just want to point the most important points here: