Showing posts with label Coursera. Show all posts
Showing posts with label Coursera. Show all posts

Saturday, June 17, 2017

Course: Introduction to CSS3 on Coursera

My current client is Green Power Monitor (GPM) which is a company based in Barcelona specialized in monitoring renewable energy power plants and with clients all over the world.

I'm part of a team that is developing a new application to monitor and manage renewable energy portfolios. We use C# and F# in the back-end and ClojureScript in the front-end.

I'm in the front-end team. We're developing a challenging SPA with lots of data visualization which has to look really good.

We're taking advantage of Om (a ClojureScript interface to React), core.async and ClojureScript to be more productive.

In other teams I've been before, there were different people doing HTML & CSS and programming JavaScript. That's not the case in GPM. We are responsible not only of programming but also of all the styling of the application. We are using SASS.

For me, not having done CSS before, it was a big challenge. I dreaded every time I had to style a new Om control I had programmed. My colleagues Jordi and Andre have helped me a lot (thanks guys!). However I wanted to get more productive to be more independent and use less of their time, so I decided to do a CSS3 course.

I did the Introduction to CSS3 course from the University of Michigan. I learned how to use CSS3 to style pages focusing on both proper syntax and the importance of accessibility design. I really liked Colleen van Lent's classes and how she encourages to experiment and make messes to learn. Thanks Collen!

After the course I'm starting to be able to style my controls with less trial and error and having to ask less doubts to Jordi and Andre.

Learning CSS3 and doing all the styling myself is helping me to become a bit more rounded as a front-end developer.

Friday, November 14, 2014

MOOCs: Web Application Architectures in Coursera

I recently finished this Coursera course by Dr. Greg Heileman from the University of New Mexico: The theory in this course was a great introduction to know general concepts and patterns that are used in web development and see how they are applied in Ruby on Rails.

However, the homework assignments were not challenging at all.

In any case, I'd like to thank Coursera and Professor Heileman for offering this course.

Sunday, August 10, 2014

Some home-made implementations of map

This post originated in a conversation we had during the last Barcelona Software Craftsmanship event.

We talked about a technique to recursively processing list elements once at a time in which you have to focus on two things:
  1. How to process an empty list (the base case of the recursion)
  2. How to process a non empty list in terms of the result of processing the tail of the list (the list except the first element)
To illustrate it, let's see a possible implementation of map in SML:


It uses the following list functions:
  • hd to extract the head of the list (its first element)
  • tl to extract the tail of the list (the list except the first element)
  • null that returns true if the list is empty and false otherwise
The :: operator adds an element at the beginning of a list.

We can use a similar approach to write map in Racket:


Here the name of the functions are a bit more expressive: first, rest and empty?.
The cons function adds an element at the beginning of a list.

A more idiomatic way to write map in SML would be using pattern matching:


This version is using the same approach but pattern matching makes the code more concise and expressive.

As a bonus here is a beautiful way to append two lists in SML using the same technique and pattern matching:


This is very well explained in the first unit of of the Programming Languages course from Washington University at Coursera that I completed last year.

There is going to be a new edition starting up Oct 2. I cannot recommend it highly enough.

Friday, January 31, 2014

MOOCs: A Brief History of Humankind in Coursera

Two weeks ago I finished this great Coursera course by Dr. Yuval Noah Harari from Hebrew University of Jerusalem:

"This course surveys the entire length of human history, from the evolution of various human species in the Stone Age up to the political and technological revolutions of the twenty-first century to present a panoramic study on the history of Humankind; following the Cognitive, Agricultural and Scientific Revolutions, and the Unification of Humankind. Its aim was to give a brief but complete overview of the history of Homo sapiens."

You can watch this video where Dr. Harari introduces its course.

It's been the longest course I've finished in Coursera (17 weeks). It has changed my perspective on many different historical processes and human phenomena such as religion, economy or politics. The contents are very critical and sometimes even controversial but I think it's been worth it to be exposed to these ideas in order to reflect on the past and the present of humankind from a different angle.

There's also a book which discusses the contents of this course in greater depth: From Animals into Gods: A Brief History of Humankind

Thank you very much to Coursera and Dr. Harari for offering this wonderful course.

Thursday, December 26, 2013

MOOCs: Programming Languages in Coursera

Two weeks ago I finished this great Coursera course by Dan Grossman from the University of Washington:

In this course we learned many of the basic concepts behind programming languages, with a strong emphasis on the techniques and benefits of functional programming.
We used three programming languages, ML, Racket, and Ruby, in order to learn learn key issues in designing and using programming languages, such as modularity and the complementary benefits of static and dynamic typing.

Dan did a great work on the videos to explain very clearly some hard concepts such as pattern matching, thunks, promises, streams, currying or partial applications. The challenging set of weekly assignments helped me a lot to digest the materials.

This course was at the same time a challenge and a great experience. As one of the course mates said on the forum:
"This course opens your mind... It's exciting! (And annoying sometimes haha)".
I can't agree more. This course was tough and challenging. Some weeks I even thought I wouldn't be able to finish the assignment. You had only two submissions per assignment and only one timed opportunity per exam. It's been probably the toughest course I've taken so far in Coursera, but at the same time it's also been the most rewarding one.

I'm very proud and happy to have been able to complete it and I've learned a lot about functional programming and a bit about object oriented programming. I think it's made me a better programmer.

To finish, I'd like to thank Dan, his team and Coursera for making this great course possible.

Friday, December 13, 2013

MOOCs: Introduction to Systematic Program Design - Part 1 in Coursera

Last month I finished this great Coursera course by Professor Gregor Kiczales from the The University of British Columbia:
This course is a 10 week introduction that presents a design method that enables you to approach the design of complex programs systematically. I saw a previous version of the course and felt curiousity about it.
Their method shows how to model the information in a problem domain, how to structure program data to mirror that information and how to further structure the data to lead to a well organized program. It also teaches how to distinguish those parts of a program that are naturally data driven, from those that should use an alternative algorithmic approach. The method also uses a first test approach to unit-testing.

The course goes slowly and Professor Kiczales explains all concepts very well. Moreover, their design methodology with its design recipes and templates helps to make explicit many of the unconscious design decisions experienced programers often do. For that reason I think it's a great introduction to programming.
In my case, having some previous programming experience, I found that applying the method systematically for most of the small programs done during the course was a bit overkilling. However, in the end, it paid off when we started working with generative recursion to produce fractals and with bactracking searches. Following the recipes of their method proved to be really useful.

Another reason to do this course was the languages it uses: several teaching languages that are subsets of Racket (a Lispy language). This makes this course a gentle introduction to the basics of functional programming.
It gave me the chance to practice a lot with recursion, immutability and higher order functions, and it also helped me to get into the "Lisp cycles":
It was a great course. I think that Professor Kiczales and his team did a really great work and I'd like to thank them and Coursera for giving us this opportunity.

I'm looking forward to start the second part.

Thursday, October 3, 2013

MOOCs: Microeconomics Principles in Coursera

This last September I studied this great Coursera course by Dr. José J. Vázquez-Cognet from the University of Illinois Urbana-Champaign:
I've just received my grades:
This course provided an introduction to functions of individual decision-makers within the larger economic system. The nature and functions of product markets, theory of the firm under varying conditions of competition and monopoly, and role of government in promoting efficiency in the economy.

It was a great course. I think that Dr. Vázquez did a great work in finding very interesting and familiar examples to ilustrate topics covered in the course, especially the videos and interviews with different local businesses. I learned very interesting things and it has helped me to understand the present world a bit better.

Thanks to Coursera and José J. Vázquez-Cognet for this course.

Saturday, September 21, 2013

MOOCs: Solved 8 Puzzle assignment

I've just solved the fourth assignment from Princeton's Algorithms I course in Coursera.

This time we had to write a program to solve the 8-puzzle problem (and its natural generalizations) using the A* search algorithm.

Although I didn't understand well the problem description the first time I read it, in the end, this has been the easiest assignment so far.
I used TDD to code the Board class but only tested afterwards the Solver class.

These were the assessment tests result:
Compilation:  PASSED
Style:        FAILED
Findbugs:     No potential bugs found.
API:          PASSED

Correctness:  24/24 tests passed
Memory:       8/8 tests passed
Timing:       17/17 tests passed

Raw score: 100.00% [Correctness: 65%, Memory: 10%, Timing: 25%, Style: 0%]
I was a bit tired so I decided not to fix the style.

Tuesday, September 17, 2013

MOOCs: Solved Collinear Points assignment

Last Sunday I finished the third assignment from Princeton's Algorithms I course in Coursera.

The problem consisted in drawing every (maximal) line segment that connected a subset of 4 or more of the points given a set of N distinct points in a plane.

First, we had to write a brute force algorithm with order of growth N4 in the worst case that used space proportional to N. And then, we had to write a faster algorithm with order of growth N2log(N) using also space proportional to N.

This time I used TDD only for the Point class. For the Fast and Brute algorithms I wrote some unit tests afterwards that compared the program results for given inputs provided in the course site with the expected outputs.

When I submitted my solution, I started having a very frustrating problem in the Fast tests.
Although my solution seemed to be working with the provided inout files, (even with the rs1423.txt example that I'll show you later), the assessment tests were crashing after a test with random segments. This crash aborted the tests so I was getting a message saying that:
Total: 0/18 tests passed: 
Test aborted. Ran out of time or crashed before completion
Since the inputs that were making it fail were random, I couldn't get them to debug my program. I checked the code many times but I couldn't find any bug that could be causing that problem.

After asking in the course forums, I found out that it was a failure in the grading system which was overloaded by thousands of people submitting their assignments on Sunday night.

After a couple of hours, I submitted my solution again and these were the assesment tests results:
Compilation:  PASSED
Style:        PASSED
Findbugs:     No potential bugs found.
API:          PASSED

Correctness:  36/36 tests passed
Memory:       1/1 tests passed
Timing:       17/17 tests passed

Raw score: 100.00% [Correctness: 65%, Memory: 10%, Timing: 25%, Style: 0%]

I had spent a lot of time chasing a ghost bug but, in the end, at least it was over.
I made a mental note to myself: "don't try to submit when the grading system is too busy".

To finish, I'd like to show the picture that my program produces when it's fed with the rs1423.txt file:


It's Robert Sedgewick, the course professor.

Thursday, September 12, 2013

MOOCs: A Brief History of Humankind in Coursera

I'm following Dr. Yuval N. Harari's "A Brief History of Humankind" course on Coursera.

It's a very interesting course which surveys the entire length of human history, from the evolution of various human species in the Stone Age up to the political and technological revolutions of the twenty-first century.

You can still enroll if you're interested.

Saturday, September 7, 2013

MOOCs: Model Thinking in Coursera

This summer I studied this great Coursera course by professor Scott E. Page from the University of Michigan:

I've just received my grades:

This course provided an introduction on how to think using models. Specific topics included, among others, decision-making, tipping points, economic models, crowd dynamics, Markov processes, game theory and predictive thinking.

It was a great course. The topics were very interesting and I liked very much the way the lecturer approached them. I learned very interesting things.

Thanks to Coursera and Scott E. Page for this course.

MOOCs: Solved Randomized Queues and Deques assignment

I finished this afternoon the second assignment from Princeton's Algorithms I course in Coursera.
This time we had to develop two generic data types: a Randomized Queue and a Deque.

These were the assesment tests results:
Compilation:  PASSED
Style:        PASSED
Findbugs:     No potential bugs found.
API:          PASSED

Correctness:  32/32 tests passed
Memory:       47/47 tests passed
Timing:       24/24 tests passed

Raw score: 100.00% [Correctness: 65%, Memory: 10%, Timing: 25%, Style: 0%]

As in every assignment of this course, the APIs were already fixed by the professors and there were several memory and time constraints for each operation of both generic data types.

I'm using TDD to get to my solutions and, even though, having the APIs predefined kills the fun in the programming by intention part of TDD, I've still found this technique very useful.

Developing the Deque with TDD was very smooth.
I started driving my code with just the pre-defined idea of using a linked list to meet the memory and time requirements. For me, it was nice to see how far the tests could take without even have to create a linked list inside the Deque. Later on I got to a test that drove me to realize that I needed a double-linked list instead.
Having said that, I must admit that I wasn't able to find a way to put that double-linked list in place using baby steps. So I just cheated and did a big change to make the new test pass while keeping the previous tests in green.

A couple of days later, I started developing the Randomized Queue and, in this case, TDD wasn't smooth at all.
I think that the culprit was the fact that we were forced to use a static method of the provided stdlib library to generate random numbers. The fixed APIs plus the static random numbers generation made it very difficult to test the Randomized Queue.
My way around was feeding the queue with integers in ascending order, then using the random number generation function with a given seed to know which of them will be dequeued, and finally resetting the random number generation function with the same seed before calling dequeue several times. This is hardly TDD and the resulting tests were very ugly.

Another thing that I didn't TDD was the resizing of the array implemented inside the Randomized Queue. I just put it there and used the tests to know eveything was still working. Now, I realized that I could have made the array public for a while in order to develop that feature using TDD, and deleted the test once it was working and made the array private again. Well, I'll try this approach next time.

That's all. I'm still enjoying the course and I'm looking forward to start the new assignment: Collinear Points.

Sunday, September 1, 2013

MOOCs: Solved "backwash" problem in Percolation assignment

I've just finished the first assignment from Princeton's Algorithms I course in Coursera.

This first assignment was to write a program to estimate the value of the percolation threshold via Monte Carlo simulation.

I thought that the solution I coded last weekend was fine because it was correctly computing the percolation thresholds for many different grid sizes.
However, when I tested it today using the provided PercolationVisualizer class, I realized that it was suffering from the "backwash" problem.


The problem was also detected by the automatic assessment tests:
Compilation:  PASSED
Style:        PASSED
Findbugs:     No potential bugs found.
API:          PASSED

Correctness:  16/20 tests passed
Memory:       8/8 tests passed
Timing:       9/9 tests passed

Raw score: 87.00% [Correctness: 65%, Memory: 10%, Timing: 25%, Style: 0%]
There were four tests checking the backwash problem.

It took me a couple of hours but, in the end, I managed to fix it by using two WeightedQuickUnionUF objects instead of one.

This was the final result of the automatic assessment tests:
Assessment Summary
Compilation:  PASSED
Style:        PASSED
Findbugs:     No potential bugs found.
API:          PASSED

Correctness:  20/20 tests passed
Memory:       8/8 tests passed
Timing:       9/9 tests passed

Raw score: 100.00% [Correctness: 65%, Memory: 10%, Timing: 25%, Style: 0%]

I'm enjoying this course very much!