Orestes Carracedo

Scrum Master, PHP Ninja, cat owner

2 post(s) archived on January 2015.

14 January 2015

I've been entering Facebook's Hacker Cup for a few years now. Some years I've gotten past a couple of rounds, others I haven't done so well. Anyways, I really like participating and I decided to share my setup.

I use the same structure for every problem so I can be more efficient. Every problem:

  • Is in a directory named using the point value and the problem name, like 30 Balanced smileys.
  • Contains a readme file with the full description of the problem.
  • Contains an example directory with the input and output files provided in the problem description.
  • The data directory contains the generated input provided for the submission.
  • The generated directory contains the output generated for the submission.

The tight loop

I'm using the simplest quickest feedback loop I could come up with:

  1. Run the program piping in the input from the example file and piping out the output to an output file.
  2. Diff the generated output file against the expected output file.
  3. Repeat

An example using php:

watch -n 1 "php solve.php < example/input.txt > output.txt && diff example/output.txt output.txt"

Using python:

watch -n 1 "python solve.py < example/input.txt > output.txt && diff example/output.txt output.txt"

I usually have this running in a session, and code in a different one. I like running the code very second and not relying on file watchers

What I often do wrong

This time I entered the qualifying round the last day. I ignored my calendar events for the day when I shouldn't. As a result, I entered the round feeling in a hurry and didn't concentrate as much as I should've.

In past editions I've overlooked the constraints and tested the code using simple scenarios. The problem comes when the generated input hits the constraint limits and my code is not optimized at all, taking a lot of time to perform the calculations and making me fail the problem.

Another mistake I made was preparing only one problem. Chances are I'm going to be fail to think about every scenario and fail the problem. Solving (or at least trying to) all the round's problems should always be the way to participate.


Categories: programming
Comments: --
31 January 2015

Not that long ago I wrote about the beginning of a new chapter. Well, that was a short chapter. In hindsight, I guess I was trying to motivate myself and push through the merger. In the end, I wasn't able to make it. I don't see myself in the new project and I decided to leave before taking on a vital project that's coming up next.

I'm writing this sitting at the cafe in the OVD Asturias airport. Javier Morales and I have been delegating our tasks to the Software Development team based of Gijón. We're closing up the Software Development Department in Barcelona, everything will be moved up here.

It's been a rough two weeks. We had an awful weather and we barely did anything besides coming and going from the hotel to the office. The other team is absorbing all the knowledge pretty well and we're confident they'll be able to maintain our software for however long the company decides to keep it running.

In my time at Focus On Emotions, my team grew an shrunk as the circumstances provided. Overall, I'm very satisfied with our work here and I'd like to take a moment thank everyone who has been part of the team.

Virginie Faure worked with us at the very beginning of our product development. She wrote part of the core of our CMS and she moved in the blurry line that divides frontend and backend developers. She had a knack for interface and visual design and shaped the look and feel of our products.

Sergi Penya helped us quite a bit as a consultant. Most of our early interactivity projects where outsourced to him.

Valentí Gamez wasn't even 20 years old when he joined Focus On Emotions. He took care of the CMS maintenance role and helped us tremendously when migrating our website to Twig.

Xavier Rubio helped us as an external consultant. He's truly one of the most fearless developers I know. Through the years, Xavi helped us on electronics, backend, fronted and a myriad of other aspects of our software.

Dimas López came in to be the solid third dev on our team. We've been friends for many years but couldn't quite find the right opportunity to work together. In our time working together he absorbed all the knowledge like a sponge. It's been great seen him progress as fast and as far as he has now.

Raúl Jimenez consulted for us for almost two years. His work on our template engine made us one of the best solutions in the marked.

I'd like to give an special mention to Javier Morales. He's been the most important part of the Software Development team for quite a while now. He's evolved into a serious Senior Developer, capable of chewing anything you throw at him. Without him, Focus On Emotions would've never been as successful as it got to be.

Thank you guys sharing your time with me. I'm really grateful I had your help through this years.

Leaving Focus On Emotions

Categories: career
Comments: --