-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.json
More file actions
1 lines (1 loc) · 99.4 KB
/
index.json
File metadata and controls
1 lines (1 loc) · 99.4 KB
1
[{"contents":"Yesterday I attended the Barcelona on Rails Meetup. The meetup itself was actually a Dojo and a presentation followed by a discussion around code quality.\nThe speaker was Daniel Carral and started the presentation by introducing Extreme Programming practices. He briefly discussed the day to day, moment to moment, work of the XP developers (the innermost section of the diagram).\nThese practices are mostly part of my daily work and the bit I found most interesting was the discussion on simple design through this diagram:\nAs depicted in the diagram the last priority when developing should be that the tests pass (as this is a taken for granted as otherwise the Continuous Integration system would point it out and the code would not be merged).\nHowever, when working on other team\u0026rsquo;s codebase I think that due to the lack of knowledge of the codebase, specially for old codebases with lots of technical debt, sometimes we put initially the most emphasis on passing the test and later, on revealing intention and doing so through the fewest elements.\nI had not seen this diagram before but find it as a useful reminder of what should be our aim when developing software.\nThank you everyone who joined and contributed with their good vibes last Thursday at @xing_bcn. It\u0026#39;s been a pleasure to finally get to know @bcnonrails. Happy hacking! ;) pic.twitter.com/QyrzOtBBme\n\u0026mdash; Daniel Carral (@dcarral) February 19, 2018 Next, we started with the 99 bottles of beer code Kata based on Sandi Metz\u0026rsquo;s book of the same name.\nI bought Sandi\u0026rsquo;s book before Christmas this year, after watching during lunch at work one of her talks but it\u0026rsquo;s still unopened. It\u0026rsquo;s actually this Kata what triggered my interest to attend the meetup. During the Kata we went through the first Chapter of the book\nIn order to frame the discussion over the quality of the different solutions exposed, Daniel showed us some metrics used in the industry throughout time to measure code quality: from Lines of Code in the 60s to the well-known Cyclomatic complexity, ABC (Assignmets, Branches and Conditions) and even the squint test.\nWe also discussed a bit over the SOLID principles and the part that easy testing plays on assuring the quality of the code.\nAfter presenting different groups of people their solution, Daniel showed us 4 extra solutions to be discussed by the attendees.\nThe discussion itself proved useful and my take-out point was once again the KISS principle: Keep It Simple Stupid.\nHe also showed the quality assigned to each of the 4 solutions he presented by a Ruby tool called flog.\nConclusion I enjoyed the meeting and the ensued discussion as it was not Ruby-centric but rather about best practices on software development.\nFinally, after the meetup I am again looking forward to take up Sandi\u0026rsquo;s book.\nResources Daniel\u0026rsquo;s presentation can be found here.\nThe initial tests suites used for the code Kata are found here\n","description":"Review of the Barcelona Ruby Coding Dojo Meetup, February'18","keywords":["review,","meetup,","Coding","Dojo,","Ruby,","99","bottles,","extreme","programming"],"permalink":"https://esaezgil.com/meetups/barcelona_ruby_coding_dojo/","title":"Barcelona Ruby Coding Dojo - February'18"},{"contents":"Fitur is the largest trade show for the tourism industry in the world. It is held in Ifema, Madrid\u0026rsquo;s trade fair, once a year.\nDuring the last two days of the fair, minube organized Hackatrips, a hackathon encouraging innovation around the tourism industry.\nSince my day to day job involves creating technology to solve travelers\u0026rsquo; needs, I thought it would be nice to put together a project over a couple of days, working with new people and find out more about where the industry is heading to.\nPelos de punta #hackaTrips (by @minube, con la colaboración de @Oracle @BBVAAPIMarket @HotelsCombined) pic.twitter.com/Z8iJqVpPg8\n\u0026mdash; Raul Jimenez (@rauljimenez) January 20, 2018 The team The organizers created the teams for people who signed up individually and placed me in a team of four:\n three developers including myself a tourism expert which was supposed to give us context on the latest needs and demands of the industry. I wrote tourism expert with italics to remark the fact that this self-appointed expert was actually a vacation rental owner. It turned out that she attended the event to have an idea of hers for automating the paperwork of running her business developed for free by the developers of her future team.\nI handled the situation by offering her to work as contractors anytime in the future on an hourly-rate and taking a commission of the future huge revenue her idea would rake in. Obviously we have not heard back from her after the hackathon \u0026hellip;\nThe project The other two members of the team were Android developers. Taking into account our skills, we decided to make an Android app consuming information from a backend that would aggregate and normalize the different APIs we would make use of to create our product.\nWe had several ideas for travel related products and discussed the feasibility of completing each of them over the short time span of the hackathon.\nFinally, we set on to make an app that based on the information provided by the BBVA API for their customers, such as their income, inferred price sensitivity and other data would recommend upcoming trips, hotels and activities.\nHaving information about the clients\u0026rsquo; income and upcoming trips would eventually allow the bank to offer tailored loans and other services such as travel insurance.\nThe hackathon had several sponsors and some of them offered prizes for using their APIs so we aimed at using as many as possible. We ended up using:\n HotelCombined API for retrieving hotels in a destination along prices and their information like pictures BBVA API: we had to mock it as their testing API, which was the one we had access to, had basically no data and it basically spoiled our initial idea. An adhoc API created by minube for the hackathon with information about POIs and activities in the destination cities. Developing the project We defined the user flow of the app and the JSON schemas with the required information for each of the views. The two Android developers started working on the app with mocked responses and I started hacking together the endpoints in the backend.\nFor simplicity, I decided to use Flask for easily prototyping the endpoints. In terms of code quality this is by far one of the worst pieces of code I have ever written.\nI wasted some time at the beginning trying to figure out how to make use of Oracle\u0026rsquo;s infrastructure for deploying the flask app without any success and afterwards I was rushing to have the endpoints working for the demo towards the end of the event.\nIt was also not clear where we would obtain the information to tailor the list of destinations for each customer. Therefore, we opted again to just have an initial list for the demo as a proof of concept. Working with HotelsCombined API was less enjoyable than expected as their API response takes quite a long to load and has to be polled repeatedly making the user experience for our product quite bad.\nI made use of an AWS EC2 instance to deploy my simple Flask app and minutes before the deadline we managed to connect the Android app to the backend\u0026rsquo;s endpoints.\nHere is a video we recorded barely on the deadline (it was a requirement of the competition along making the code repository public):\n The other member of the team which was not coding, created a presentation explaining the idea behind the product for the demo at the end of the event. The presentation below might not be the latest version but allows for making an accurate idea of what it was like in the end.\n\n\nThe outcome As reflected by the video of the app and the presentation, our product idea and the execution was quite bad.\nOn the contrary, the projects created by the other teams were on average quite good and some of them exceptional. The technical level of many of the solutions proposed was quite high and I really liked many of the ideas of the other teams and their execution.\n¡Enhorabuena equipo! Segundo premio en #hackatrips, el #hackaton de #turismo sobre #innovación, y el premio al mejor uso de la #API de @HotelsCombined. #FITUR2018 pic.twitter.com/tZIhGqE1LS\n\u0026mdash; Geoblink (@geoblink_es) January 21, 2018 On the positive side I was surprised by the commitment of the other two developers of my team to have at least a working prototype ready for the demo.\nThe hackathon itself The hackathon was really well organized, both the venue and the food was great and having most of the sponsors providing on-site support was superb as well as the prizes:\nHowever, the agenda was a bit tight as the time for developing the project was merely 24 hours.\nSummary: This is my fourth hackathon over the last two and a half years attending as a participant. Reflecting back on the experience of this last hackathon, I came out with the following take out points:\n Participating in hackathons requires a big investment in terms of effort, stress and lack of rest over the weekend. Attending a hackathon alone is a double edged sword, specially if the skills and desires of the team you join are not aligned with yours. It\u0026rsquo;s not the best place for meeting other people working in the tech industry as everyone is focused on delivering. P.S. Take a look at some of my previous blogs about other hackathons I attended:\n Angelhack Barcelona as a participant THack Mallorca as a participant LauzHack Lausanne, Switzerland as a sponsor HackUPC Barcelona as a sponsor ","description":"Review of the Hackatrips hackathon, Madrid January'18","keywords":["hackathon,","android,","python,","docker,","AWS,","Fitur"],"permalink":"https://esaezgil.com/events/hackatrips_2018/","title":"Hackatrips - January'18 Madrid"},{"contents":"During the Hacktoberfest Barcelona event I started working on contributing to the Donate Bitcoin project.\nDonate Bitcoin is a simple yet clever project that creates a basic page to accept bitcoin donations through an URL and QR code linked to the user\u0026rsquo;s specified Bitcoin wallet.\nI started to work on improving this project while implementing it for my own blog donations page. My blog, a static website generated by Hugo, is lighting-fast and I quickly noticed that the Javascript console was complaining about some blocking calls in the new donations page:\n \nAs shown above, the problem originated from the blocking synchronous XMLHttpRequest calls on the main thread of the newly added Javascript and HTML code. In order to fix this, I had to make use of asynchronous calls and along the way I decided to refactor the code to make it more legible and understandable as well as:\n Avoiding Synchronous XMLHttpRequest on the main thread (as mentioned befores) Making self-contained functions Renaming the offending div to avoid clashes between element id and function name Failing gracefully when user input can not be handled Adding a default amount that is displayed on first load Start improving code style A minor User Experience tweak to reassure the user of the amount to be donated in fiat currency The most time consuming piece of work was related to figuring out that the original QR code generating library was not working properly on my browser due to the clashes between the library\u0026rsquo;s function and a div element\u0026rsquo;s identifier.\nFor my own use case in my blog, I just made use of another library for generating the QR codes. However, I assumed that this was not acceptable for the original project and dig on the problem until I solved it.\nTaking into account that I had in mind just some of the use cases of the original project and there were almost no tests, I wanted to be cautious about not breaking any of the functionalities nor changing its original behavior.\nUnfortunately this was not the case, and the maintainer of the project realized about it and released some fixes [1] [2] after merging my pull request.\nThe final result is shown below for the mobile layout:\n \nAlthough there is still room for improvement in the project, like adding tests and improving the code style I am happy that I contributed to improving the original project.\nFinally, take a look at my merge request\n","description":"Contributing to Donate Bitcoin project","keywords":["Javascript,","HTML,","Bitcoin,","open","source,","GitHub,","Hacktoberfest"],"permalink":"https://esaezgil.com/post/contributin_donate_bitcoin/","title":"Contributing to Donate Bitcoin"},{"contents":"Hacktoberfest is an event sponsored by GitHub and Digital Ocean to promote new contributions to open source. After talking with Joan, a fellow engineer at Skyscanner we decided to host such an event at Skyscanner\u0026rsquo;s premises: Hacktoberfest Barcelona.\nAfter spamming people around the office up to 10 engineers joined us to setup the event along our coworkers from the talent team. I did not expect such a big response but I am very glad that it was like that.\nWe created a Trello board with some tentative projects that people could contribute to.\nThanks to the people from Hacktoberfest Poznan that created a super cool website and released it under an MIT license, we could easily setup our own website for the event by hosting it in GitHub pages. Check it out at: hacktoberfestbarcelona.com\n Screenshot of the Hacktoberfest Barcelona mobile website\n \nA static website offers many advantages like instant hosting through Github pages as they are based on an amazon s3 bucket serving static content.\nUsing Cloudflare we enforced https and by configuring the appropriate DNS redirections in our domain registrar the website was ready to go public.\nAlong the way I learnt about SaaS for CSS styling, Gulp for asset management, minification and a Travis workflow allowing to push generated content into the main git branch from where the static content is served.\nRecently, Cloudflare added apps that are small customizable scripts. I found it to be very convenient for adding small functionalities like a cookie disclaimer.\nObviously, all of this can be achieved by adding the appropriate javascript and html code but for small and quick additions this worked pretty well and was less time consuming than doing it myself from the ground up.\nMaking use of Cloudflare apps we added a cookie notice, a before you go popup for newsletter subscriptions through MailChimp and sections for the sponsors, the organizers and for our newsletter.\nAfter setting up the website and the tickets in EventBrite we reached out to different developer communities in Barcelona and waited wondering whether anyone would bother to sign up.\nTo our surprise, the event was sold out in less than 3 hours (we could only host up to 40 people comfortably).\n Traffic distribution for Hacktoberfest Barcelona event\n \nMoreover, people kept signing up for the waiting list and eventually there were more people in the waiting list than in the event itself.\nIn order to track interest I also set up google analytics and added a newsletter to collect people\u0026rsquo;s emails interested in future events.\nWe split the different organizational tasks in the following way:\n setting up the website for the event: myself reaching out to people in the Barcelona software community: Jordi initial talk: Justyna logistic support (talent team) support for attendees: Joan Quickly the event was sold out and we decided to increase the number of tickets.\nDuring the event we shared pizza and drinks and later started working on issues with the hacktoberfest label in Github. the contributions ranged from projects that we use internally such as aiohttp to deep learning, algorithm books, opengl projects and others.\nWe gave away Skyscanner Tshirts to those participants that made at least a pull request and briefly shared what we were working on during the event.\nFinally, as a word of warning I will encourage organizers of free events to allow over booking of the event as a lot of people that sign up for these kind of events do not show up oblivious to the work and effort behind them.\nSpecial thanks to the organizers, talent team, Skyscanner for sponsoring the event and fellow Skyscanner engineers not mentioned here that helped before, during and after the event.\n","description":"Organizing Hacktoberfest, Barcelona October'17","keywords":["Hacktoberfest,","Barcelona,","meetups,","open","source"],"permalink":"https://esaezgil.com/meetups/hacktoberfest_barcelona/","title":"Organizing Hacktoberfest Barcelona - Oct'17"},{"contents":"Hacktoberfest is a month-long celebration of open source in which people are encouraged to contribute to open source projects in GitHub.\nI started this year\u0026rsquo;s contributions by making a pull request to MadBike an app that helps make use of Madrid\u0026rsquo;s public bike rental service.\nIn particular, this contribution tackles a reported issue for adding a map type selector using the Google Maps Android API. The proposed design hinted to that of Google\u0026rsquo;s default:\n \nTherefore, to achieve the proposed design and functionality I made use of a Spinner which takes as an input an ArrayAdapter with the translated Strings from the application\u0026rsquo;s resources.\nThe app makes use of a fragment that implements the onMapReady callback to draw the different UI elements. I simply added a private method that adds the spinner whenever the onMapReady callback is triggered. The last thing I did was adding the spinner to the fragment layout.\nThe most time consuming piece of work was related to properly setting up the application itself for development since the crashlytics dependency was not correctly configured.\nIn order to fix that, I had to do quite a bit of research and find the proper crashlytics version compatible with the code which led me to submit another Merge Request that was rejected for the sake of not polluting the maintainer\u0026rsquo;s production statistics. Furthermore, I had to fight with the Gradle configuration as well until I was able to successfully build the app.\nOverall, this contribution helped me refresh my Android development skills and learn about Butter Knife, a framework to inject views into Android components that I had never heard about before. As usual Voguella\u0026rsquo;s website has a really nice tutorial for it.\nThe final result is shown below:\n The not so happy part of the story is that my contribution has not yet been accepted. This is one of the drawbacks of contributing to open source projects as understandably maintainers work on them mostly on their spare time with no other reward than their personal interest on the project itself.\nThis has been the case as well for another contribution that I did some time ago for the Jinja project that is still pending to be merged.\n","description":"Contributing to MadBike Android app","keywords":["Android,","Java,","open","source,","GitHub,","Hacktoberfest,","mapview,","butterknife,","fragment,","google"],"permalink":"https://esaezgil.com/post/contributing_android_madbike/","title":"Contributing to MadBike Android app"},{"contents":"This is a brief review of grokking algorithms by Aditya Y. Bhargava.\nTLDR; really approachable, clear and concise concepts increasingly exposing the reader to more complex and handy algorithms based on previously discussed concepts.\nBook review Right after listening about a year ago to Aditya\u0026rsquo;s interview on the Talk Python podcast, I decided to buy his book out of curiosity.\n Grokking Algorithms by Aditya Bhargava \nDespite of taking me quite long to start, I finally went through it during my holidays. It is a light although technical reading that was very pleasurable to go through. Although most of the concepts were known to me, I read the book as the first step to start a deeper dive into some of them.\nIt was a good refresher of some of the concepts I had studied during my Bachelors in Telecommunications Engineering applied to different scenarios such as Bellman Ford\u0026rsquo;s algorithms or Drijkstra\u0026rsquo;s algorithm to compute the shortest path in a computer network, or the KNN classification method.\nOther interesting points were the overview of dynamic programming, greedy algorithms, big O notaton, the discussion on simple algorithms and its complexity, NP-complete problems, as well as the super simple implementation of BDFS in Python.\nOverall I enjoyed reading the book and as the author points out, instilled in me a demand for new and deeper knowledge on some of the topics.\nP.S. there\u0026rsquo;s a github repo with implementations of the different algorithms in many languages: https://github.com/egonSchiele/grokking_algorithms as well as an errata page: http://adit.io/errata.html\n","description":"Review of Grokking algorithms by Aditya Y. Bhargava","keywords":["review,","algorithms,","python,","book"],"permalink":"https://esaezgil.com/reviews/grokking_algorithms/","title":"Review: grokking algorithms by Aditya Y. Bhargava"},{"contents":"Today I attended Madrid ProductHunt as I was curious about Transferwise and about the startup scene in Madrid.\nThere were in total 4 presentations about the following projects:\n Transferwise Populate Zensei CityMapper Having spent two years living abroad I had heard about Transferwise before and I was very interested in the product and the company itself.\nProud to have @TransferWise in @MadProductHunt w/ @nilanp \u0026amp; @cataflu 💪👏 pic.twitter.com/lNRZ0X8xpx\n\u0026mdash; Keyvan Akbary (@keyvanakbary) September 21, 2017 Nilan VP of Growth at Transferwise lead the talk along Cata a software developer in the team. The content itself was very interesting, specially due to the parallelism I could establish between their company and mine, Skyscanner:\n Both companies solve a real issue experienced by millions of people around the world. Both companies focus their growth strategy on making a great product and increasingly building features around it that help spread the word of mouth. Both companies give a great amount of autonomy to their technical teams, including promoting an internal open source policy. Both companies started with a really simple product online, Skyscanner founder put an Excel sheet online and Transferwise founders created a Skype chat and later put a simple form. Alvaro Ortiz introduced Populate, a company building products to make the public data that governments publish more accessible to citizens through visualizations, normalization and tools that enable to query the data in a single place. He also talked about Gobierto a sort of SaaS for the government to enable effective sharing of the government data. Finally, he shared his personal take on what a startup could be, a lifestyle business and not necessarily an organization focused on achieving a big financial return on a venture capital investment.\nThe other two talks briefly introduced their companies and some of the problems they faced.\n","description":"Review of the ProductHunt Madrid, September'17","keywords":["meetup,","transferwise,","producthunt"],"permalink":"https://esaezgil.com/meetups/producthunt_madrid/","title":"ProductHunt Madrid - Sept'17"},{"contents":"This is my review of effective Android testing for mobile developers by Chiu-Ki Chan.\nTLDR; crystal clear style, incremental refactoring laying out the concepts and best practices as they arise.\nCourse review I really enjoyed the flow of the course by which as higher test constructions are added, the code for the example application evolves, making it more maintainable and clear.\nFurthermore I could see how the testing concepts I apply in Python on a daily basis working in the backend of Skyscanner Hotels have an equivalent in Android.\nI particularly enjoyed the refactor of the activity using the MVP pattern to isolate the interaction with the Android libraries and the robot pattern for implementing the separation of concerns.\nRecently, I contributed with a feature to the Skyscanner Android app which is as well using the MVP pattern. After going through the course, it is much clearer for me the reasoning for keeping all the logic in the Presenter. I had briefly worked with Mockito previously so the concepts were familiar to me and thanks to the MVP pattern I could see that it is straight forward to apply it for the testing of the Presenter in the app.\nMinor points to improve: There were some castings that were not so clear but nothing that affects the super comprehensive flow of the course, I would say it is rather a reflection of my lack of knowledge.\nAlthough at the end of each chapter, a summary is shown, I would have preferred to have diagrams showing the interactions between the different components both through and at the end of the videos.\nWhat I would like to see next: The course is a starting point for introducing the testing concepts behind Android but I would like to see a more complex app with async interactions with web services, maybe for a future course? Where can I sign up for it? :)\nFinal words: I would definitely recommend the course as an introduction to Android testing and best practices around it.\nScore: 10\u0026frasl;10\nP.S. Am i supposed to pay 30$ indefinitely to get access to courses I took at some point on Linkedin Learn? In that case I would rather go for courses on Udemy and other platforms in which after buying the course, you have lifetime access to the material.\n","description":"Review of the effective Android testing for mobile developers","keywords":["android,","review,","java,","testing,","course"],"permalink":"https://esaezgil.com/reviews/review_effective_android_testing_for_mobile_developers/","title":"Review: effective Android testing for mobile developers"},{"contents":"Yesterday I attended the Barcelona Blockchain Meetup. My goal was to get a feeling of the developer community in Barcelona around this technology.\nThere were only 4 presentations about the following projects:\n Wings Project NEM B9lab Fluon .@BlockchainBCN meetup about to kick off pic.twitter.com/MVNOlowuo0\n\u0026mdash; Enrique Saez (@eqirn) June 7, 2017 Previous to the meetup, I have read about the concept of ICOs in this Techcrunch piece of news. In the meetup, I learnt about a new concept, the DAO.\nI have become very curious lately about the blockchain technology and its possibilities to disrupt the backend infrastructure that powers our digitalized society.\nThe Wings Project explained their mission of adding transparency to the ICOs through external vetting of the projects. The external contributors that are rewarded for their work and opinion. The concept seems interesting but I doubt how scalable and reliable can become such process.\nICOs, the evolution of financing #blockchain Today at @BlockchainBCN meetup with @wingsplatform pic.twitter.com/bRTTNuIdXr\n\u0026mdash; Josep Figols (@josepfigols) June 7, 2017 The second presentation revolved around NEM a project I had not heard of before. Basically, the talk was a small demo of 2FA for this blockchain network.\nThe third talk was about B9lab, a company that offers training around the Ethereum blockchain.\nFinally, the fourth talk dealt with Fluon, a company that presented their vision on the future of asset management through blockchain. One of the points addressed during their presentation was about how their technology will enable for many people to invest freely. A flawed point for me since the inherent problem is not as much the possibility to freely invest but the concentration of assets.\nI expected the meetup to be more technical than it was as it seemed more like commercial presentations than a debate on the technology itself and its possibilities.\nThe blockchain space is certainly interesting and things are moving quickly as the following news show:\n Toyota prospects on Blockchain for autonomous vehicles Japan legitimizing Bitcoin Using Blockchain Smart contracts for controlling energy microgrids Top spanish companies creating a blockchain consortium I am increasingly excited and curious about the applications that can be derived from Blockchain.\n","description":"Review of the Blockchain Meetup, Barcelona June'17","keywords":["review,","meetup,","Blockchain"],"permalink":"https://esaezgil.com/meetups/blockchain_meetup/","title":"Barcelona Blockchain Meetup - June'17"},{"contents":"The Pyconweb conference, held in the premises of the Ludwig Maximilian University of Munich, took place during the last weekend of May. The conference aimed to gather people with a common interest for Python-based web development.\nThe talks I enjoyed most on Saturday were:\n The keynote from Rachel Willmer. .@rwillmer at @pyconweb keynote mentioning @Skyscanner as an example of continuous delivery #pyconweb (Enrique) pic.twitter.com/BG5M8OE5wZ\n\u0026mdash; Skyscanner Engineering (@SkyscannerEng) May 27, 2017 \n The presentation about Tornado from Jordi Soucheiron where he disclosed the importance of async programming for high-performant web servers. Jordi Soucheiron @jordixou demoing async web server programming with Tornado at @pyconweb .@tornadoweb #python #pyconweb (Enrique) pic.twitter.com/5VeVq60Hs2\n\u0026mdash; Skyscanner Engineering (@SkyscannerEng) May 27, 2017 \n The presentation about serverless by Randall Hunt. Although the talk felt a bit like an infomercial the demo that he did using Twilio, AWS lambda and API Gateway was really cool. .@jrhunt talking #serverless at @pyconweb pic.twitter.com/9VmpDqmOC1\n\u0026mdash; Enrique Saez (@eqirn) May 27, 2017 \n The talks I enjoyed the most on Sunday were:\n The keynote from Martijn Faassen, live coding included, about his Morepath framework and the limitations that frameworks impose on their users. Excellent keynote by .@faassen at @pyconweb #pyconweb #python pic.twitter.com/eSwNap5iG5\n\u0026mdash; Enrique Saez (@eqirn) May 28, 2017 \n How Open Source Changed my Life by Lasse Schuirmann about how a side project of his started getting traction and eventually turned into a businesses. Great talk from @LSchuirmann about \u0026#39;From fun to Business\u0026#39; at #pyconweb #PyCon2017 pic.twitter.com/OjhR83LaA8\n\u0026mdash; fejao (@fejao) May 28, 2017 \n Having attended the Barcelona Python meetup on a regular basis over the last two years, it was a good refresher to get in touch with professionals from all over Europe that rely on Python for their businesses\u0026rsquo;s technological needs.\nOn the other hand, I expected a higher number of talks would be relevant to my day-to-day job dealing with topics such as scalability issues, async-programming pitfalls with Python or high-availability architectures. Unfortunately, this was not the case.\nFinally, the organization was really really good. Lunch was delicious, just like coffee served over the weekend and the social event on Saturday night at Hofbräuhaus was spot on.\nIt was a fun weekend and I look forward to attend other conferences like this one in the future. Maybe Pyconweb 2018? Time will tell.\n","description":"Review of the Pyconweb conference, Munich May'17","keywords":["review,","conference,","python,","open","source","community"],"permalink":"https://esaezgil.com/meetups/pyconweb_17/","title":"PyconWeb - May'17"},{"contents":"AngelHack organized a hackathon in Barcelona last weekend. Having attended lately two other hackathons as a sponsor I thought it would be nice to get back to the hacker side and put together a project over the weekend.\nI came along with another engineer from Skyscanner. Neither of us had an idea for a project so we were eager to listen to other people\u0026rsquo;s ideas and join them to make it a reality over the weekend.\nSome great ideas to start the Hackathon #AH10 @AngelHack pic.twitter.com/7iioiWiofO\n\u0026mdash; Squiz Ideas (@SquizIdeas) May 20, 2017 We both ended up joining the Infobecas team which pitched their idea about a two-sided platform for institutions and scholarship seekers that automatically matches individuals with scholarships.\nThe reason for joining their team boiled down to the clear scope of the project, the social vision behind it and the feasibility of implementing a minimum viable product over the short time span of the hackathon.\nWe worked in a team of four but with only two developers. We discussed different possibilities for parallelizing the software developing work taking into account:\n the strict time constraint our own technical abilities and current expertise making a mobile first product, available from the beginning to the highest number of users We quickly concluded that going for a backend/frontend architecture implemented between two people over the next 24 hours would severely haphazard the possibility of having something usable for the demos. Therefore, we wanted to abstract from the frontend part as much as possible and focus on the backend where both of us had the most experience.\nThe solution we agreed on would make use of the Telegram API to connect people through a chat based interaction with our backend in charge of matching institutions offering scholarships with individuals based on the inputs collected through a chat-based conversation.\nWe chose the telepot python SDK to create a Telegram-based chat bot. However, after some initial fiddling and finding some shortcomings of the SDK regarding custom keyboards we opted in for migrating to the python-telegram-bot SDK.\nWe made use of Docker to deploy our application to the AWS cloud. Our dockerized environment consisted of 3 containers:\n redis: for data persistence, storing the user profiles collected through the chat a python app for the bot interacting with scholarship seekers a python app for institutions after matching their scholarship criteria with the scholarship seeker\u0026rsquo;s profile After ~24 hours we had a working prototype that was able to interact with the users through a series of predefined questions. Since there were only 2 minutes per team for pitching each project to the judging panel we rehearsed the interaction we would be showing and tweaked the user flow through the chat to make it more visually appealing.\njust submitted our project for #ah10 #barcelona #hackathon https://t.co/WEMIVDTcYu pic.twitter.com/lUsdrSKSMq\n\u0026mdash; Enrique Saez (@eqirn) May 21, 2017 Right before the demos we deployed our service to an EC2 machine. The code is available in GitHub: https://github.com/micetti/Infobecas\nAfter coding for most of the day/night we were awarded with the ESADE EWorks prize. At @ironhack @IronhackBCN @AngelHack #Barcelona thx @ESADE #eWorks prize goes to #infobecas #bot pic.twitter.com/wpJHGeUzJF\n\u0026mdash; Adriana Freitas (@adrianafreitas) May 21, 2017 \nThe hackathon was really well organized, both the venue and the food was great. However, I missed more interaction between different teams and overall a higher number participants would have made the event more enjoyable.\nFinally, the best part of hackathons is the possibility to attend talks from other people introducing new technologies that you can later hack with in your project. I guess that the short time span of the hackathon did not allow for this but it would be definitely a nice addition.\nAnd it\u0026#39;s a wrap for #AH10 #Barcelona. Congratulations to Seve, working to help millenials save and invest smartly! #hackathons pic.twitter.com/geWoCxpt0y\n\u0026mdash; AngelHack (@AngelHack) May 21, 2017 This is the third hackathon over the last 2 years in which I win a prize (out of 3 attending as a participant), so not bad :). Reflecting back on the 3 projects that I participated in, they all shared the following:\n A clearly defined scope before starting the actual coding An attainable goal from the technical side taking into account the time constraints A mobile first approach A working prototype even though it implies mocking some of the data A solution for an actual problem that is scalable and extendable P.S. Take a look at some of my previous blogs about hackathons I attended:\n THack Mallorca as a participant LauzHack as a sponsor HackUPC as a sponsor ","description":"Review of the AngelHack hackathon, Barcelona May'17","keywords":["hackathon,","review,","chatbot,","telegram,","docker,","python"],"permalink":"https://esaezgil.com/events/angelhack_barcelona/","title":"AngelHack - May'17"},{"contents":"As part of the Skyscanner ambassador group in Barcelona, we support the local software community by helping organize different events. On May 9th the Barcelona AWS meetup was held at the office.\nThere were two talks in the meetup, both dealing with serverless computing:\n1st talk\nThe first talk by Serhat Can dealt with serverless architectures on AWS Lambda. During the talk it was presented the experience of OpsGenie with serverless architectures for their alerting and monitoring service.\nOpsGenie is an alerting service somehow similar to the one that VictorOps offers. At Skyscanner we make use of VictorOps for alerting, on-call rotation and 24 hour support.\nOne of the use cases shown that caught my attention was the DynamoDB autoscaling system they have in place. Some of the cool features along it include a configurable DynamoDB table alarm in Cloudwatch that is updated with the increase/decrease of the table capacity.\nAt Skyscanner hotels we faced similar issues in the past as we make an intensive use of DynamoDB for the service that manages the sorting of hotel partners in the search results in case of price parity. The algorithm behind this computation, that we call Partner Sorting Algorithm serves the precomputed positions for each partner from a DynamoDB table.\nAnother familiar example was the use of Lambdas for replicating data across regions for DynamoDB and ElasticSearch aiming to decouple the replication logic from the application logic. This solution did not work for us due to the large size of our tables and the long time it took to replicate the data between regions.\nFinally it was mentioned the challenges that cloud-first services pose such as proper monitoring, high availability, replication, cold start time and blue-green deployment (that we manage through Slingshot).\nOverall it was really interesting listening to their experience as I can closely relate to many of the problems that surfaced to them while developing our own cloud-native services.\n Serverless Architectures on AWS Lambda from Serhat CAN \n2nd talk\nThe second talk focused on serverless data processing with Data Pipeline, Docker, Lambda, API Gateway, ECR and SNS by one of my colleagues at Skycanner, Radek Miazio.\nRadek talked about the different AWS services that could be used for the processing they needed to do in order to create an index for Skyscanner\u0026rsquo;s internal representation of the world. After discarding many of the AWS services due to their limitations, they settled up with Data Pipeline and explained some of the problems they faced such as:\n Complex setup due to the massive JSON The long initialization that caused API Gateway to timeout (service cold start again) Long delay in logs (up to 20 minutes) Limits to the infinite resources that the cloud provides Serverless data processing with Data Pipeline from Radek Miazio \nFinal thoughts\nFrom both talks it could be distilled that when designing a serverless service the solution has to take into account the constraints of the still immature services offered which sometimes are not clearly laid out in the docs.\nFinally these experiences also surface that the vast computing resources that the cloud provides outgrow the intricacies of developing ad-hoc services coupled to the available proprietary services.\nThe meetup was recorded and is available in Youtube:\n ","description":"Review of the AWS Meetup, Barcelona May'17","keywords":["AWS,","review,","meetup,","serverless"],"permalink":"https://esaezgil.com/meetups/bcn_aws_meetup_may_17/","title":"Barcelona AWS Meetup - May'17"},{"contents":"Lately, I have been answering some questions in StackOverflow related to Unit Testing in Python with Mock and pytest. These are some of the questions I answered:\n pytest and yield based tests pytest: How to force raising Exceptions during unit-testing? Mocking file open and throwing exception Avoiding a call to the database during tests Python how to test random choice Testing constructor using mock Preset input for Unit tests in Python 3 Mocking API calls in unit testing Going through the list, there are some common pitfalls that can be identified related to the misunderstanding of basic python unit tests concepts and pytest features and inner workings. Inspired by a similar post I recently bumped into, I will go through them in detail.\nWhat does patch do? Everything in Python is an object. As detailed in the Python docs the patch decorator/context manager allows to easily mock classes/objects. Any class/object can be replaced with either a mock, or in general any other object, during the test and restored afterwards.\nTherefore, patch allows to mock objects/calls in order to return predefined objects/constants/whatnot. This is really useful when testing system that interact with third parties, allowing for the removal of dependencies during tests.\nPatching external dependencies The following question, highlights precisely the aforementioned usage:\n How to avoid a trip to the database in this Test case from .models import ApplicationType def get_application_type(self, value): item_name = \u0026#34;Application Type\u0026#34; self.base_details[\u0026#39;application_type\u0026#39;] = None try: if value: try: result = ApplicationType.objects.get(title=value) # \u0026lt;= How do I avoid hitting this DB object? self.base_details[\u0026#39;application_type\u0026#39;] = result.id return True except ApplicationType.DoesNotExist: [...] else: self.error_msg = \u0026#34;Blank Value: {}\u0026#34;.format(item_name) return False except: raise During unit-testing it is a requirement to avoid the interaction with a third-party service. In order to do so, we can use patch as follows (notice that this is for illustrative purposes and I do not necessarily agree with what and how it is being tested):\n@pytest.mark.parametrize(\u0026#34;entry\u0026#34;, [\u0026#39;Type 1\u0026#39;, \u0026#39;Type 2\u0026#39;]) @patch(\u0026#39;ApplicationType.objects.get\u0026#39;) def test_get_application_type_populates_dict_when_value_provided_exists_in_database(self, db_mocked_call, entry): mocked_db_object = {\u0026#39;id\u0026#39;: \u0026#39;test_id\u0026#39;} db_mocked_call.return_value = mocked_db_object application_type = ApplicationTypeFactory.build(title=entry) assert self.base_info_values.get_application_type(entry) == True assert self.base_info_values.base_details[\u0026#34;application_type\u0026#34;] is not None In the test above, it can be seen that the call to the database is being patched. Furthermore, a dictionary, mocked_db_object, will be returned when the call is made.\nThis approach yields complete control over the inputs and outputs of our test and allowing to deterministically validate the code. The usage of parametrize is reviewed in detail further below.\nHowever, this does not imply that the integration with third-party services should not be tested through integration tests as I detailed in my previous post about test driven APIs\nA similar example is the following one in which the calls to the Redis database required patching:\n Mocking API calls in unit testing redispool = None class myRedis(object): def __init__(self, redisHost, redisPort, redisDBNum): [...] global redispool redispool = redis.ConnectionPool(host=self._redishost, port=self._redisport, db=self._redisdb) def write_redis(self, key, value): retval = self._redis_instance.set(key, value) LOGGER.info(\u0026#39;Writing data to redis (%s, %s). Retval=%s\u0026#39;, key, value, retval) return retval@mock.patch(\u0026#39;redis.StrictRedis.set\u0026#39;) def test_myRedis_write(mock_strict_redis_set): mock_strict_redis_set.return_value = {} myRedisObj = myRedis(\u0026#39;localhost\u0026#39;, \u0026#39;8888\u0026#39;, \u0026#39;11\u0026#39;) redis_connect = myRedisObj.redis_connect() connect = myRedisObj.write_redis(\u0026#39;1\u0026#39;, \u0026#39;2\u0026#39;) assert connect == {} As the previous examples show, one of the most important concepts is knowing where to patch, which the linked docs explain quite clearly.\nFinally, check the following question showing that checking the output of the calls being tested is not always required. Instead, what should be checked is that the calls took place with functions like called_with or call_count: Preset input for Unit tests in Python 3\nTesting exceptions: One of the key behaviors to test are exception handling. The way to test that exceptions are raised is by patching the call that can raise the exception. This can be achieved through the side_effect function.\nThe next example shows how to force raising an exception to test that it is properly managed.\n Mocking file open and throwing exception def validate_json_specifications(path_to_data_folder, json_file_path, json_data) -\u0026gt; None: schema_file_path = os.path.join(path_to_data_folder, \u0026#34;schema\u0026#34;, os.path.basename(json_file_path)) resolver = RefResolver(\u0026#39;file://\u0026#39; + schema_file_path, None) with open(schema_file_path) as schema_data: try: Draft4Validator(json.load(schema_data), resolver=resolver).validate(json_data) except ValidationError as e: print(\u0026#39;...\u0026#39;) exit() The non-working tests for this code were as follows:\n@patch(\u0026#39;builtins.open\u0026#39;, mock_open(read_data={})) @patch(\u0026#39;myproject.common.helper.jsonschema\u0026#39;, Draft4Validator()) def test_validate_json_specifications(mock_file_open, draft_4_validator_mock): validate_json_specifications(\u0026#39;foo_path_to_data\u0026#39;, \u0026#39;foo_json_file_path\u0026#39;, {}) mock_file_open.assert_called_with(\u0026#39;foo_path_to_data/schema/foo_json_file_path\u0026#39;) draft_4_validator_mock.assert_called() The person asking was trying to use the patch wrong and not taking advantage of side_effect. As it can be seen, every time the jsonschema function of the module being tested was called, a Draft4Validator object would have been created (had the class been correctly instantiated).\nInstead, the Draft4Validator object is the one to be mocked and the relevant calls to any of its methods the ones to be patched. An example of such way to proceed can be found in the answer I posted:\n@patch(\u0026#39;sys.exit\u0026#39;) @patch(\u0026#39;myproject.common.helper.jsonschema.Draft4Validator\u0026#39;) @patch(\u0026#39;builtins.open\u0026#39;) def test_validate_json_specifications(mock_file_open, draft_4_validator_mock, exit_mock): with pytest.raises(ValidationError): mock_file_open.return_value = {} draft_4_validator_mock = Mock() draft_4_validator_mock.side_effect = ValidationError validate_json_specifications(\u0026#39;foo_path_to_data\u0026#39;, \u0026#39;foo_json_file_path\u0026#39;, {}) assert draft_4_validator_mock.call_count == 1 assert draft_4_validator_mock.validate.assert_called_with({}) assert exit_mock.call_count == 1 In the previous test we can check again how easy it is to test the expected path for the exception through the creation of a mock object and associating a side_effect to it.\npytest basic features: Pytest is a very powerful testing framework and knowing about the feaures that it provides helps creating a robust and concise testing architecture for your project.\nSome of the most common used features are the following:\nTesting that exceptions are raised Fortunately, pytest provides powerful features to test that exceptions are handled properly.\nThe next example shows how to force raising an exception and test that it actually raised:\n pytest: How to force raising Exceptions during unit-testing? class MyRequest(metaclass=Singleton): def __init__(self, retry_tries=3, retry_backoff=0.1, retry_codes=None): [...] def request(self, request_method, request_url, **kwargs): try: return self.session.request(method=request_method, url=request_url, **kwargs) except Exception as ex: log.warning([...]]) raise The test could look something similar to the following:\nfrom requests.exceptions import ConnectTimeout, ReadTimeout, Timeout from unittest.mock import patch import pytest class TestRequestService: @pytest.mark.parametrize(\u0026#34;expected_exception\u0026#34;, [ConnectTimeout, ReadTimeout, Timeout]) @patch(\u0026#39;path_to_module.MyRequest\u0026#39;) def test_custom_request(self, my_request_mock, expected_exception): my_request_mock.request.side_effect = expected_exception with pytest.raises(expected_exception): my_request_mock.request(Mock(), Mock()) [...] Notice how easily side_effect allows for the testing of the proper management of the exception.\npytest parametrize: One of the most sought after behaviors when testing is actually testing the correctness of a myriad of relevant inputs/outputs. For this purpose, pytest provides a feature that yields such flexibility in a compact way through parametrize. The following questions are scenarios in which parametrize is highly relevant:\n pytest and yield based tests def is_equal(a, b): assert a == b We can test such a simple scenario with some tests:\nimport pytest class TestComplexScenario: @pytest.mark.parametrize(\u0026#34;my_integer\u0026#34;, [0, 1, 2]) def test_complex(self, my_integer): assert is_equal(my_integer, my_integer) The sample output looks like this:\ntest_complex.py::TestComplexScenario::test_complex[0] PASSED test_complex.py::TestComplexScenario::test_complex[1] PASSED test_complex.py::TestComplexScenario::test_complex[2] PASSED where it can be checked that all the inputs were tested.\nOther references:\n https://medium.com/@bfortuner/python-unit-testing-with-pytest-and-mock-197499c4623c http://treyhunner.com/2014/10/the-many-flavors-of-mock-dot-patch/ https://engineeringblog.yelp.com/2015/02/assert_called_once-threat-or-menace.html https://www.relaxdiego.com/2014/04/mocking-objects-in-python.html ","description":"Python unit-testing pitfalls \u0026 pytest basic features","keywords":["python,","testing,","mock,","pytest"],"permalink":"https://esaezgil.com/post/unittesting_pitfalls/","title":"Unit-testing pitfalls \u0026 pytest basic features"},{"contents":"Recently I had a comment in a merge request in which I was suggested to copy the Nth-1 last elements of a list, a[1:], instead of popping its first element, pop(0).\nI was curious about its performance implications and decided to do some simple tests:\nt1 = timeit.Timer(\u0026#39;a=50*[\\\u0026#39;a\\\u0026#39;];a.pop(0)\u0026#39;) t2 = timeit.Timer(\u0026#39;b=50*[\\\u0026#39;b\\\u0026#39;];b[1:]\u0026#39;) t1.timeit(10000)/10000 6.973965995712205e-07 t2.timeit(10000)/10000 8.281046990305186e-07 As shown in the results above, the difference is insignificant at least for small lists.\nChecking for bigger lists:\nt1 = timeit.Timer(\u0026#39;a=5000*[\\\u0026#39;a\\\u0026#39;];a.pop(0)\u0026#39;) t2 = timeit.Timer(\u0026#39;b=5000*[\\\u0026#39;b\\\u0026#39;];b[1:]\u0026#39;) t1.timeit(10000)/10000 2.4743527399550657e-05 t2.timeit(10000)/10000 4.327827289962443e-05 shows that there\u0026rsquo;s a ~53% performance penalty of slicing versus popping.\nChecking even bigger lists:\nt1 = timeit.Timer(\u0026#39;a=50000*[\\\u0026#39;a\\\u0026#39;];a.pop(0)\u0026#39;) t2 = timeit.Timer(\u0026#39;b=50000*[\\\u0026#39;b\\\u0026#39;];b[1:]\u0026#39;) t1.timeit(10000)/10000 0.0002497872758001904 t2.timeit(10000)/10000 0.00044558706480020194 shows that slicing the list carries a performance penalty of ~50% compared to just doing a pop of the first element. This penalty seems to plateau after a certain list size.\nSome resources to check: Time complexity in the Python wiki Python list implementation explained CPython internals: A ten-hour codewalk through the Python interpreter source code by Philip Guo ","description":"Performance of pop vs slice in Python lists","keywords":["python,","performance,","pop,","slice"],"permalink":"https://esaezgil.com/post/python_list_pop_slice/","title":"Python lists: pop vs slice performance"},{"contents":"Confronted with the task of writing a CV for the first time many students resort to Microsoft Word and sloppy templates to be found on the Internet.\nRecently, I was helping a family friend proofreading her CV and decided to also teach her about LaTeX and moderncv in order to craft a high quality CV for her summer internship applications.\nI used LaTeX extensively in the past to write my Master Thesis, multiple essays and student projects during my Master studies. Since I had been using MiKTeX in Windows, which takes quite a lot of space in the hard drive, I decided to check if I could make it through with a minimal LaTeX installation in my MacBook. Fortunately, this was the case:\nmoderncv and LaTeX minimal requirements for macOS:\n BasicTeX: BasicTeX is a subset of TeX Live of size 110 megabytes instead of 2 gigabytes. Perfect for our purposes!\n Texmaker: Texmaker is my favorite LaTeX editor, it is free and cross-platform.\n TeX Live Utility: a graphical interface for TeX Live Manager, which is a tool provided to update and maintain TeX Live. We will use TeX Live Utility to install moderncv and some extra packages required.\n After installing the previous, we need to install moderncv along some extra requirements through TeX Live Utility. As shown in the picture below, it can be done by simply searching for the packages and installing them.\n Installing packages with TeX Live Utility \nThe complete list of packages to be installed through TeX Live Utility are:\n moderncv xpatch fontawesome After this relatively short process you should be ready to start writing your shiny new CV.\nCheck Xavier Danaux\u0026rsquo;s GitHub for examples or LaTeX Templates to help you get started.\nFinally, bear in mind that moderncv includes a fantastic template for cover letters as well.\n","description":"LaTeX and moderncv setup","keywords":["LaTeX,","macOS,","moderncv"],"permalink":"https://esaezgil.com/post/moderncv_latex_mac/","title":"LaTeX and moderncv in macOS"},{"contents":"Working for the backend service at Skyscanner Hotels I take part in the development of new services and its associated APIs quite regularly.\nWhen it comes to API design and development, breaking API changes might void the work of other teams\u0026rsquo; work, haphazard the timely product delivery, negatively impact several KPIs and be responsible for not delivering any user value and of course break the service for existing users.\nTherefore, a flexible yet strong API contract from the beginning allows for the parallelization of the work, a much faster iteration and an incremental release of functionality.\nThis post aims to describe a strategy for validating and enforcing an API contract during its iterative development.\nTest-driven APIs During the development of an information system service, a solid development pipeline requires:\n a strong test suite an automated test infrastructure a zero-click deployment process Such a solid pipeline along a well-defined vision for the product plays a central role to the overall success of the project and the ever-increasing value delivery to the user.\nFurthermore, a strong test suite implies covering all layers of the service:\n the most basic behavior through Unit Tests the integration with third-party services through Integration Tests the overall user-facing functionality through Acceptance Tests Figure 1: Testing pyramid showing the decremental amount of tests a system should have for higher abstractions\n(original source: google testing blog) \nAs shown in Figure 1, a decremental test suite is based on the fact that the width and depth of tests covering the most basic behavior, though Unit Tests, will allow for a less exhaustive coverage of the subsequent testing stages.\nEvery higher logical abstraction implies a longer testing time:\n Integration tests: require interaction with third-party services Acceptance tests: require setting up blank production-like environments on the fly and interact with third-party services. Moreover, when it comes to acceptance tests for complex yet flexible APIs, the myriad of possible scenarios might quickly lead to a large set of acceptance tests yielding the previously detailed undesired scenario.\nIf not born in mind, a time-consuming testing pipeline will drag down the team\u0026rsquo;s iteration speed.\nEnforcing the API contract In order to overcome the aforementioned hurdle in the service we are creating at the moment, we implemented the following strategy:\n Created JSON Schemas for the API endpoints\u0026rsquo; responses. In order to enforce the API contract, all releases must be validated against them. There are several tools available to automate the validation of the defined schemas for example jsonschema in Python.\n Development of a new set of Unit Tests for our main endpoint (offering lots of flexibility on its usage), covering the different scenarios by:\n Mocking the response of third-party services.\n Creating a set of JSON schemas whose properties are not set to required.\n Validating the returned response from the endpoint against the defined JSON Schemas by dynamically setting the required properties for each test according to the scenario.\n Development of a new set of Integration Tests with the tightly coupled third-party services that would alert us of any breaking change on the 3rd party\u0026rsquo;s side. This can be achieved by validating that their response abides to the service\u0026rsquo;s contract defined in a JSON Schema.\n Development of a set of Acceptance Tests that check the different clients\u0026rsquo; use-cases and validates the endpoint\u0026rsquo;s responses against strict JSON Schemas (JSON Schemas in which all required properties are compulsory).\n Finally, the acceptance tests\u0026rsquo;s schemas can be used as the service\u0026rsquo;s documentation.\n","description":"Testing infrastructure during API design and development","keywords":["python,","API,","testing,","jsonschema"],"permalink":"https://esaezgil.com/post/test_driven_api/","title":"Test-driven information system services"},{"contents":"Logs are a fundamental piece of the web server architecture for debugging, monitoring and alerting purposes.\nSome of the infrastructure at Skyscanner Hotels\u0026rsquo; Backend makes use of logster to send logs to Graphite and generate alerts through Seyren enabling ChatOps through Slack. Although we usually check the different dashboards in Kibana, having a well-maintained set of logs is important for quickly looking up and investigating an event.\n Subset of the monitoring and alerting architecture \nLogrotate is a small utility that allows to rotate the logs: archiving the current log, start a fresh one and delete old logs.\nDue to different reasons we were having problems with some of our logs and the fix turned out to be to schedule the log rotation at a specific time.\nIn order to schedule the log rotate in our CentOS systems we followed these steps: Understand that logrotate is executed once a day. If we check the logrotate RPM rpm -ql logrotate we see something like the following:\n/etc/cron.daily/logrotate /etc/logrotate.conf /etc/logrotate.d /usr/sbin/logrotate /usr/share/doc/logrotate-3.8.6 /usr/share/doc/logrotate-3.8.6/CHANGES /usr/share/doc/logrotate-3.8.6/COPYING /usr/share/man/man5/logrotate.conf.5.gz /usr/share/man/man8/logrotate.8.gz /var/lib/logrotate.status The reason for logrotate being executed once a day can be seen in the previous list. The RPM creates a configuration entry in the /cron.daily/ directory. Consequently, logrotate will be executed daily.\n We would expect cron to be in charge of the scheduling of this task. However, for CentOS systems, anacron is the one in charge of the scheduling for daily events (among others). Furthermore, anacron introduces by default a random delay and it only starts running the scheduled tasks during the START_HOURS_RANGE as configured in /etc/anacrontab.\n Set the logrotate at a specific time: moving the logrotate configuration out of the /logrotate.daily/ directory and scheduling its execution through cron. An example of the aforementioned solution can be achieved through Ansible as follows (we make use of Ansible through TeamCity for our automated deployment pipeline):\n-name:checklogrotateconfigexistsincron.dailystat:path=/etc/cron.daily/logrotateregister:logrotate_config-name:movelogrotateconfigifexistingcommand:mv/etc/cron.daily/logrotate/opt/home/logrotate.cronjobwhen:logrotate_config.stat.exists-name:configuredailylogrotatecroncron:name=\u0026#34;schedule logrotate\u0026#34;minute=\u0026#34;0\u0026#34;hour=\u0026#34;3\u0026#34;job=\u0026#34;/opt/home/logrotate.cronjob\u0026#34; This way, logrotate will be executed every day at 3 am.\nCredits:\nI shall thank my colleague Kampde for his detailed walkthrough about the intricacies of cron, anacron and RPMs among others.\nReferences:\nLogrotate\nCentOS and logrotate at serverfault\n","description":"Scheduling log rotate in a CentOS system","keywords":["logrotate,","CentOS,","open","source,","logs"],"permalink":"https://esaezgil.com/post/logrotate_scheduling_centos/","title":"Scheduling logrotate in CentOS"},{"contents":"I have been enjoying the Talk Python Podcast for a while and at least two episodes revolve around the importance of having a blog as a software developer.\nIn episode #69 Write an Excellent Programming Blog guest A. Jesse Davis dissects the advice he gives in his own post Write an Excellent Programming Blog with tips for blog content and argues that blogging does not need to be regular but of high quality and lasting value, which I absolutely agree with.\nAnnouncing @TalkPython #69: Write an Excellent Programming Blog with @jessejiryudavis https://t.co/2gk8Euv91E pic.twitter.com/CmqosyEdGV\n\u0026mdash; Talk Python Podcast (@TalkPython) July 26, 2016 In episode #71 Soft Skills: The software developer\u0026rsquo;s life manual guest John Sonmez emphasizes the importance that the blog had for his own career and encourages others to do so. He also talks about his book that I read recently.\nMy new sounds: #71: Soft Skills: The software developer\u0026#39;s life manual https://t.co/MrvePrpuCE on #SoundCloud\n\u0026mdash; Talk Python Podcast (@TalkPython) August 12, 2016 Both episodes were quite influential on my decision to create my blog.\nThe main reason that I distilled from both episodes, quoting A. Jesse Davis, is: \u0026lsquo;your goal is to attract specialists in your field so you can share ideas with them\u0026rsquo;. John Sonmez puts it in another way as finding your niche or specialization and becoming a reference for it.\nFurthermore, A. Jesse Davis provides an interesting generic list of topics to write about:\n Story Opinion How-To How Something Works Reviews Reflecting back on my own blog I have covered so far either stories or reviews (Meetups, Hackathons, contributing to Open Source, books page). Topics I want to write about in the future are How-tos and How Something Works. I believe these two last topics are certainly the most valuable for others.\n[Update] Back in the day I also checked this post by Troy Hunt. Although there\u0026rsquo;s some controversy around the topic, I believe that maintaining for a while a technical blog can help me improve my skills. An example for it that I look up to is Jeff Knupp\u0026rsquo;s blog.\nScott Hanselman also refers to the invisible developers as Dark matter in his post and states that there should be a balance between yelling online and getting actual stuff done, which I agree with and personally like to lean towards the actual getting stuff done.\nFinally as Jason Fried suggests in this post, a blog is just about publishing and maybe having someone magically find it. It is about fighting the fear of having a zero counter next to the number of visits to your blog for the sake of creation and giving back to the community.\n","description":"Reasons for keeping a blog as a software developer","keywords":["review,","open","source"],"permalink":"https://esaezgil.com/post/reasons_for_a_blog/","title":"Reasons for a blog"},{"contents":"2016 is coming to an end and I would like to look back and review what I have been up to during the last year:\nHackathons During 2016 I attended 4 Hackathons:\nTHack Mallorca I attended THack Mallorca as a participant with my former colleague Tudor Barbu. Joining two other developers from MiNube we worked for the whole weekend and won several prizes. I wrote a post about the experience here.\nMore than 100 pro and student devs signed up for #thackmallorca @tnooz pic.twitter.com/SajkdBcivu\n\u0026mdash; Gene Quinn (@genequinn) May 7, 2016 Skyscanner internal Hackathon Another team from Skyscanner flew to Barcelona for some days and we worked in an internal Hackathon around some of our projects we felt could use some extra manpower. The Hackathon was very successful as we finished all the projects we started and as a consequence, some of my colleagues published an open source library: pyfailsafe.\nHackUPC I attended HackUPC in Barcelona as a sponsor to help out hackers make use of the Skyscanner API. It was my first Hackathon as a sponsor and the experience was really good, read more about it here.\nCode or ping-pong? Both at #hackupc Join us! #skyscanner #barcelona https://t.co/N69diMVcn7\n\u0026mdash; Enrique Saez (@eqirn) October 7, 2016 LauzHack I attended LauzHack in Switzerland once again as a sponsor. I delivered a talk to help hackers get started with the Skyscanner API and assist them over the rest of the weekend along my colleague Manuel Miranda. I wrote about the experience here.\nBuddyflights @LauzHack using #skyscanner API for travel https://t.co/tJLUxx1CeY it!@dtaschik @dubsmash @CodeVoyagers pic.twitter.com/1HNCM22c1G\n\u0026mdash; Enrique Saez (@eqirn) November 20, 2016 Meetups Being part of the Barcelona Ambassador group at Skyscanner\u0026rsquo;s Barcelona office provided me with the opportunity to both attend and help organizing multiple events for the software community in Barcelona:\nPython Meetup I have attended and help organizing most of the monthly Barcelona Python Meetup held at the office. From being a regular attendant I transitioned after my manager\u0026rsquo;s encouragement and the help of some of my team mates such as Pau Freixes, Manuel Miranda and Jordi Soucheiron to deliver a talk. I wrote about the experience here.\nAbout to start October\u0026#39;s meetup. Full house! #pybcn pic.twitter.com/t3XUY3DGEB\n\u0026mdash; Python Barcelona (@PyBCN) October 20, 2016 I continue to enjoy this Meetup and keep meeting new interesting people. It\u0026rsquo;s an event I would like to keep going over the upcoming year as well.\nFurthermore, I attended in November the Madrid Python Meetup, check the post I wrote about it.\nDocker Meetup During the weekend of the Docker anniversary, there were multiple events run all over the world. It was an informal gathering to talk about this technology. There was a brief introduction about Docker and a hands on lab in which we setup an example project.\nI also attended and helped organizing another Docker Meetup, this time during the week, in which Matt Feigal, an engineer from Google, talked about Kubernetes. His talk was quite interesting as I could see a lot of similar concepts between the AWS cloud and the Google cloud.\nStarting a #kubernetes talk at full #dockerbcn, thanks for filling it up @spiddy ! pic.twitter.com/mRzNTs9xcr\n\u0026mdash; Matt Feigal (@mattfgl) May 31, 2016 VLC weekend Meetup The VLC board met in Barcelona at our office (Skyscanner) during the weekend to discuss about their plans and whatnot. I had the opportunity to hang out with them during Saturday evening and during Sunday. Although we were not involved at all in their discussions it was nice to talk with the maintainers and leaders of such an important Open Source project.\nTalks As I mentioned previously, I delivered a talk in the Barcelona Python Meetup. It was a good experience since I learnt a lot while preparing for the talk and I look forward to deliver another one in the future. Take a look at the slides and the GitHub repo I created for it.\n\u0026quot;Best practices for a Python project\u0026quot; by Enrique Sáez #pybcn pic.twitter.com/pkw3ulxPgE\n\u0026mdash; Python Barcelona (@PyBCN) October 20, 2016 I also delivered a talk at LauzHack about the Skyscanner API. Check the slides.\nFinally, I delivered a short closing talk at HackUPC’16.\nOpen Source Contributions This year I started putting my GitHub account esaezgil to good use. I contributed to 3 different projects: Jinja, aiohttp and Pretix. My contribution to Jinja is still pending to be merged but the other four contributions I did to both Pretix and aiohttp were merged.\nIt was definitely a rewarding, sometimes challenging but overall good learning experience. I plan to keep contributing over the next year to Open Source projects.\nI wrote about my contributions here:\n Contributing to Pretix Contributing to aiohttp Thank you very much @vishalsodani and Enrique for making your first contributions to pretix! https://t.co/aUcxTT3Sg1 https://t.co/Xp9cQMjsL4\n\u0026mdash; pretix (@pretixeu) August 29, 2016 Internet famous I created my Twitter account, follow me :) @eqirn\nI created this Blog with Hugo, GitHub pages and automatic deployment through Wercker. This was an iteration of my first attempt to create a blog using Wordpress. I did not like the Wordpress interface and it looked quite shabby.\nI recorded a podcast along my former colleague Nicolas Vayias about our experience as a recent employee of a rapidly growing startup. It was an interesting experience since the interview was not scripted and the host, Richard Davidson, was in another office in a different country.\nSkyscanner acquisition I was on annual leave when I got to hear about this breaking news: Here’s to making travel search easy as pie. V. exciting day for Skyscanner and travellers: Ctrip announces agreement to acquire Skyscanner.\n\u0026mdash; Skyscanner (@Skyscanner) November 23, 2016 \nCtrip acquired Skyscanner for $1.7 billion\nExciting times ahead for us working towards helping travelers worldwide!\n","description":"2016 year review, python, open source, contributing, Hackathons, Meetups, talks","keywords":["python,","review,","open","source,","contributing,","Hackathons,","Meetups,","talks"],"permalink":"https://esaezgil.com/post/enrique_2016_review/","title":"2016 review"},{"contents":"Last November I attended the Madrid Python Meetup. Being a regular attendant of Barcelona Python Meetup I was curious about the Python community in Madrid.\nAfter many @pybcn meetups, my first @python_madrid meetup. Really welcoming community #python pic.twitter.com/mhTLMDou4Q\n\u0026mdash; Enrique Saez (@eqirn) November 30, 2016 There were four talks, all of them revolving around Python and Geographic Information Systems. This was a topic that I have not dealt with at all and was curious about what Python can help with.\n1st talk\n¡Empieza la reunión de @python_madrid y @GeoinquietosMad en la sede de @CARTO! pic.twitter.com/eX1tKVoMOr\n\u0026mdash; Pybonacci#QuedateEnCasa (@Pybonacci) November 30, 2016 Guillem Borrell talked about whether Madrid pollution measurements were being rigged by the government. He showed how most of the pollution meters were placed further away from the city center and after analyzing historical measurements with the help of Python, concluded that apparently it was not the case.\nThe most important take outs from his talk for me were:\n The data model and the obfuscation of the data in it can be part of the business model. By hindering competitors from using/accessing the data that is supposed to be freely available, such as the pollution measurements in this case, competitors are in disadvantage when when the contract is to be renewed.\n Data Science consists on Data cleaning most of the time rather than creating/implementing new fancy algorithms which was quite surprising for me.\n 2nd talk\nContinúa Juan Luis (no @astrojuanlu) en @python_madrid hablando de Cartopy y proyecciones @GeoinquietosMad pic.twitter.com/PvZCbUNObn\n\u0026mdash; Pybonacci#QuedateEnCasa (@Pybonacci) November 30, 2016 Juan Luis Ribero talked about geo referenced data visualization with Python. It was a really in-depth and long talk in which he explained:\n the basics such as map projections like Mercator, Universal Transverse Mercator, Web Mercator, etc. detailed Cartopy API and the different data transformations that it helps accomplish talked through some examples using Cartopy, open data from the regional government to create some cool visualizations. 3rd talk\nOriol Boix briefly explained the Carto API. The Meetup was hosted at Carto\u0026rsquo;s office so it was rather natural that they put together a talk about their product.\nContinuamos hablando del nuevo SDK de @CARTO en @python_madrid @GeoinquietosMad pic.twitter.com/jqz23yUAfO\n\u0026mdash; Pybonacci#QuedateEnCasa (@Pybonacci) November 30, 2016 4th talk\nFrancisco José Raga explained how to create Plugins for QGIS.\nThe main learning I got from his talk is that the IDE should be considered as an extendable tool and whenever a developer finds himself doing something over and over again is much better to develop a plugin to automate the job.\nSummary\nOverall the topics discussed in the Meetup were not directly related to my day to day work but it was refreshing to learn about people using Python for so many different things.\nFinally, this kind of events are used by companies to recruit people and this time was no different. I have heard countless times about it as a suggestion for people looking for a job to attend or do a presentation at this kind of events and I believe it is an effective way to find a new job.\nCarto\u0026rsquo;s office in the very city Center of Madrid were really cool by the way.\n\u0026quot;Hacer un plugin en @qgis es muy fácil\u0026quot; -Rafa (no me acuerdo de tu tuiter) @GeoinquietosMad @python_madrid pic.twitter.com/2gP0ba35eV\n\u0026mdash; Ramiro Aznar (@ramiroaznar) November 30, 2016 ","description":"Review of the Madrid Python Meetup, November'16","keywords":["python,","review,","meetup,","open","source","community"],"permalink":"https://esaezgil.com/meetups/python_meetup_madrid/","title":"Madrid Python Meetup - November'16"},{"contents":"Last November I attended the Madrid Python Meetup. Being a regular attendant of Barcelona Python Meetup I was curious about the Python community in Madrid.\nAfter many @pybcn meetups, my first @python_madrid meetup. Really welcoming community #python pic.twitter.com/mhTLMDou4Q\n\u0026mdash; Enrique Saez (@eqirn) November 30, 2016 There were four talks, all of them revolving around Python and Geographic Information Systems. This was a topic that I have not dealt with at all and was curious about what Python can help with.\n1st talk\n¡Empieza la reunión de @python_madrid y @GeoinquietosMad en la sede de @CARTO! pic.twitter.com/eX1tKVoMOr\n\u0026mdash; Pybonacci#QuedateEnCasa (@Pybonacci) November 30, 2016 Guillem Borrell talked about whether Madrid pollution measurements were being rigged by the government. He showed how most of the pollution meters were placed further away from the city center and after analyzing historical measurements with the help of Python, concluded that apparently it was not the case.\nThe most important take outs from his talk for me were:\n The data model and the obfuscation of the data in it can be part of the business model. By hindering competitors from using/accessing the data that is supposed to be freely available, such as the pollution measurements in this case, competitors are in disadvantage when when the contract is to be renewed.\n Data Science consists on Data cleaning most of the time rather than creating/implementing new fancy algorithms which was quite surprising for me.\n 2nd talk\nContinúa Juan Luis (no @astrojuanlu) en @python_madrid hablando de Cartopy y proyecciones @GeoinquietosMad pic.twitter.com/PvZCbUNObn\n\u0026mdash; Pybonacci#QuedateEnCasa (@Pybonacci) November 30, 2016 Juan Luis Ribero talked about geo referenced data visualization with Python. It was a really in-depth and long talk in which he explained:\n the basics such as map projections like Mercator, Universal Transverse Mercator, Web Mercator, etc. detailed Cartopy API and the different data transformations that it helps accomplish talked through some examples using Cartopy, open data from the regional government to create some cool visualizations. 3rd talk\nOriol Boix briefly explained the Carto API. The Meetup was hosted at Carto\u0026rsquo;s office so it was rather natural that they put together a talk about their product.\nContinuamos hablando del nuevo SDK de @CARTO en @python_madrid @GeoinquietosMad pic.twitter.com/jqz23yUAfO\n\u0026mdash; Pybonacci#QuedateEnCasa (@Pybonacci) November 30, 2016 4th talk\nFrancisco José Raga explained how to create Plugins for QGIS.\nThe main learning I got from his talk is that the IDE should be considered as an extendable tool and whenever a developer finds himself doing something over and over again is much better to develop a plugin to automate the job.\nSummary\nOverall the topics discussed in the Meetup were not directly related to my day to day work but it was refreshing to learn about people using Python for so many different things.\nFinally, this kind of events are used by companies to recruit people and this time was no different. I have heard countless times about it as a suggestion for people looking for a job to attend or do a presentation at this kind of events and I believe it is an effective way to find a new job.\nCarto\u0026rsquo;s office in the very city Center of Madrid were really cool by the way.\n\u0026quot;Hacer un plugin en @qgis es muy fácil\u0026quot; -Rafa (no me acuerdo de tu tuiter) @GeoinquietosMad @python_madrid pic.twitter.com/2gP0ba35eV\n\u0026mdash; Ramiro Aznar (@ramiroaznar) November 30, 2016 ","description":null,"keywords":null,"permalink":"https://esaezgil.com/post/python_meetup_madrid/","title":"Madrid Python Meetup - November'16"},{"contents":"Throughout the weekend of 18th - 20th November I attended Lauzhack, a student-organized and student-oriented Hackathon in Lausanne, Switzerland, as a Skyscanner representative.\nSuch lovely weather! Hackers at @LauzHack, check out the view! The Alps are are visible in all their glory! #HackTheAlps pic.twitter.com/32quDX60eW\n\u0026mdash; LauzHack (@LauzHack) November 19, 2016 The goal of the Hackathon was to encourage students from all over the world to work in a project over the weekend with the aim of networking, learning as much as possible and having fun in the mean time.\nHackerSpace :D#JustBuildIt pic.twitter.com/jSildNCCBE\n\u0026mdash; LauzHack (@LauzHack) November 19, 2016 I attended with my colleague Manuel Miranda in order to help hackers make use of the Skyscanner API in their projects. We also looked forward to spread the word about Skyscanner graduate program, Skyscanner internships and company culture.\nDuring the weekend we had the chance to address students in both the initial talk and in a tech talk. I delivered a tech talk in order to get hackers up and running in about 20 minutes with the Skyscanner API and its different endpoints.\nThese are the slides for the presentation:\nhttps://speakerdeck.com/esaezgil/skyscanner-api-guide-lauzhack-16\nDuring the rest of the weekend we tended to questions that hackers came up with during the development of their projects. It is a truly enriching experience when people find new usages for the provided data and it is specially valuable when some of them even find bugs that we can report back to our colleagues!\nThe event itself was really well organized and the premises of EPFL are top notch.\nCome have a chat with our sponsors at their booths about the cool tech they brought! pic.twitter.com/ZBamhr0Jom\n\u0026mdash; LauzHack (@LauzHack) November 19, 2016 The projects I liked the most using Skyscanner API were:\n TravCal: after setting the departure airport, Travcal queries for cached ticket prices and Hotel prices in different destinations and suggests tentative trips along its fares in your calendar. It was quite clever of them to make use of the calendar as it is instantly multi-device compliant from the very beginning. They won our Skyscanner challenge prize.\n BuddyFlights: the project suggests based on your Facebook friends\u0026rsquo; location intermediate stops for your journey along the price of the tickets. I love the idea and I hope that these guys keep working on it or even helps inspire our internal team in charge of the inspiration map in the website.\n CityMatch: this project included gamification in order to suggest travel destinations making use of Microsoft Cognitive services. I was instantly sold into the idea and hope that they keep working on it in the future.\n Buddyflights @LauzHack using #skyscanner API for travel https://t.co/tJLUxx1CeY it!@dtaschik @dubsmash @CodeVoyagers pic.twitter.com/1HNCM22c1G\n\u0026mdash; Enrique Saez (@eqirn) November 20, 2016 The projects I liked the most using other sponsor\u0026rsquo;s APIs were:\n WillIbeLate: making use of SBB data to predict train delays based on the day, the route and the weather.\n OpenAllergies: making use of the recently launched OpenFood API they warn the user about possible allergies by scanning a product\u0026rsquo;s barcode.\n My take out points:\n As a sponsor I really enjoyed the event. I had the chance to learn about challenges other sponsors face on a daily basis and found out about new cool technologies and products they are developing.\n This is my 5th Hackathon over the last year (2nd as sponsor) and I keep enjoying the thrill and out of the box thinking fostered by this kind of events.\n Hackathons set the perfect ambiance for innovation. Working within a strict timeframe helps effectively deliver the basics of an impactful product.\n Looking forward to LauzHack\u0026rsquo;17\n","description":"Review of the Lauzhack hackathon, Lausanne November'16","keywords":["hackathon,","review,","lauzhack"],"permalink":"https://esaezgil.com/events/lauzhack16/","title":"LauzHack - Nov'16"},{"contents":"HackUPC is a student-led and student-oriented hackathon for tech-enthusiast held in Barcelona, at the premises of Universitat Politecnica de Catalunya over the weekend of October 1st 2016.\nI attended the event as a company representative for Skyscanner, the main sponsor of the event. The hackathon gathered 500 students from all over the world and was an immense success.\nHackUPC Fall 2016 opening ceremony is about to start. The auditorium is filled with excitement! pic.twitter.com/FWxtD0YEfX\n\u0026mdash; HackUPC (@hackupc) October 7, 2016 This was my 4th hackathon over the last year so far but my first one as a sponsor and not a participant. Therefore, the event gave me the opportunity to gain a different insight for this kind of events.\nI spent about 18 hours at the event during weekend with the goal of helping participants make the most out of Skyscanner API.\nThe quality of the submissions was astonishing. It is quite refreshing to see how much can be achieved over a weekend of intense work and collaboration. The projects submitted making use of the Skyscanner API are posted here\nOne of my favorite moments during the Hackathon was the \u0026lsquo;Science Fair\u0026rsquo; demos at the end of the event. As part of the judging panel for the Skyscanner prizes I got to know the motivations behind the projects that were crafted during the weekend and learnt more about the rapid prototyping techniques and technologies that hackers made use of to create an MVP.\nFinally, I had the chance to deliver a short talk at the end of the event where I encouraged attendees to apply for a position at Skyscanner after talking with them over the weekend about company culture and mission.\nCode or ping-pong? Both at #hackupc Join us! #skyscanner #barcelona https://t.co/N69diMVcn7\n\u0026mdash; Enrique Saez (@eqirn) October 7, 2016 Overall, attending this event as a sponsor was a really good experience. Looking forward to attend another hackathon soon enough! We had an incredible time at #HackUPC to kick off the 2017 Hackathon Season! We can\u0026#39;t wait to see you all again in February 👏👏 pic.twitter.com/NsuJKggSgA\n\u0026mdash; Major League Hacking (@MLHacks) October 9, 2016 ","description":"Review of the HackUPC hackathon, Barcelona October'16","keywords":["hackathon,","review,","hackupc"],"permalink":"https://esaezgil.com/events/hackupc16/","title":"HackUPC - Oct'16"},{"contents":" Software Engineer passionate about the ICT industry. Currently based in Barcelona.\n MSc. in Wireless Communication Systems at Aalborg University. BSc. in Communication Systems Engineering at Universidad Carlos III de Madrid. Professional experience Software Engineer @ Skyscanner, Barcelona, Spain\n Building the most user-centric eCommerce marketplace in the travel industry. Focus on highly-available distributed backend systems using microservice architectures. Ericsson, Madrid, Spain\n Internship at Ericsson R\u0026amp;D in the Testing and Continuous Integration team within the Software Defined Networks department. MassM2M research group at Aalborg University, Denmark\n During my Master studies, I worked in the MassM2M research group and participated in the research, implementation and characterization of robust wireless communication systems.\n Video of the prototype transmitting audio over WiFi wtih a jammer activated\n Reseiwe, Denmark\n During the Master, I worked part-time at Reseiwe, a commercial spin-off from the MassM2M research group while completing my Master Thesis. ","description":null,"keywords":null,"permalink":"https://esaezgil.com/about/","title":"About me"},{"contents":"Over the last year I have attended the Barcelona Python meetup hosted at Skyscanner\u0026rsquo;s office. The meetups were a really positive experience and being a super welcoming community I decided to deliver a talk.\n\u0026quot;Best practices for a Python project\u0026quot; by Enrique Sáez #pybcn pic.twitter.com/pkw3ulxPgE\n\u0026mdash; Python Barcelona (@PyBCN) October 20, 2016 During the talk I covered the most common Python project\u0026rsquo;s structure and the resasoning behind it. I also went over the usual ways for distributing a Python Project and the popular testing tools available. Finally I also mentioned some of the widely regarded best practices for Python like PEP8.\nSlides:\nhttps://speakerdeck.com/esaezgil/python-projects-best-practices-1\nGitHub repo\nhttps://github.com/esaezgil/pythonBestPractices\nUnfortunately due to technical problems the talk was not recorded :(\n","description":"Best practices for a python project","keywords":["python,","talks,","open","source,","best","practices"],"permalink":"https://esaezgil.com/post/python_best_practices/","title":"Talk: Python Best Practices"},{"contents":"Recently I had the chance to contribute to Pretix (https://pretix.eu/about/en/) a Django-based event ticketing platform.\nI submitted a couple of merge requests that were accepted: - https://github.com/pretix/pretix/pull/202/files https://github.com/pretix/pretix/pull/204/files\nI will briefly detail some of the key learnings:\n Django models: Being absolutely new to Django, I had the opportunity to learn along the way about one of its key features, the Models. Models are objects that the ORM will store in the database, a quick intro here: http://tutorial.djangogirls.org/en/django_orm/ It was quite surprising as well the ease of the development thanks to the automatic migrations in the database schema. More detailed info on Models here: http://www.djangobook.com/en/2.0/chapter05.html\n all keyword in Python: In order to check whether a condition was True for all the elements of a list I simply iterated over them and checked for the condition:\nfor i, op in enumerate(positions): cancelable_products.append(op.item.allow_cancel) if False in cancelable_products: cancelable = False However a much simpler solution making use of list comprehensions and the all() keyword in Python is possible:\ncancelable = all([op.item.allow_cancel for op in positions]) Metaclasses in Python: Although I had read about Python Metaclasses in this excellent post (https://jeffknupp.com/blog/2013/12/28/improve-your-python-metaclasses-and-dynamic-classes-with-type/), Django Models are a really good practical example of their value and use. The Metaclasses are used in the Django Models to dynamically create classes.\n Difference between select_related and prefetch_related in Django: prefetch_related: does a separate lookup for each relationship, and does the ‘joining’ in Python. This allows it to prefetch many-to-many and many-to-one objects. select_related: limited to single-valued relationships - foreign key and one-to-one. Creates an SQL join including the fields of the related object in the SELECTstatement retrieving the related objects in the same (but more complex) database query. By using select_related instead of prefetch_related, one query to the DB is saved. More info on Django QuerySet: https://docs.djangoproject.com/en/1.10/ref/models/querysets/\n Head over to this post for more details on Metaclasses in Django: http://reinout.vanrees.org/weblog/2013/05/16/advanced-python-metaclasses.html\n","description":"Lessons learnt from contributing to an open source project, pretix","keywords":["python,","pretix,","open","source,","contributing"],"permalink":"https://esaezgil.com/post/2016-09-04-contributing-to-pretix/","title":"Contributing to Pretix"},{"contents":"Recently I had the opportunity to contribute to the aiohttp library. This is one of the libraries that we, the Hotels backend team at Skyscanner, make use of on a daily basis to create a new backend service.\nIn this post I will briefly explain the main learnings from this contribution.\nThe pull request can be found here: https://github.com/KeepSafe/aiohttp/pull/1020/files\nKey learnings:\n Living on the edge:\nWorking in the master branch of a project means that sometimes it may be unhealthy. It is always good advice to check whether master is healthy or not when you submit your MR to the CI system (Travis CI in this case) before pulling your hair searching for a non existing bug in your code.\n Namedtuples can be used to define a class through inheritance and by implementing the bool method,\nclass WebSocketReady(namedtuple(\u0026#39;WebSocketReady\u0026#39;, \u0026#39;ok protocol\u0026#39;)): def __bool__(self): return self.ok it is really easy to check for a condition:\nif WebSocketReady: ... Write Unit Tests: This might be obvious, but the point is not just to write them but to write them for every piece of code created. In this case I had written tests that checked the actual functionality on a high level like:\ndef test_websocket_not_ready(): websocket_ready = WebSocketReady(False, None) assert websocket_ready.ok is False assert websocket_ready.protocol is None But not the tests that checked the low level functionality like:\ndef test_bool_websocket_not_ready(): websocket_ready = WebSocketReady(False, None) assert bool(websocket_ready) is False Always good to bear in mind.\n","description":"Lessons learnt from contributing to an open source project, aiohttp","keywords":["python,","aiohttp,","open","source,","contributing"],"permalink":"https://esaezgil.com/post/2016-09-03-using-namedtuples-in-aiohttp/","title":"Contributing to aiohttp"},{"contents":"During my studies in Denmark I attended two Summer Universities: Aalborg University Summer School and DTU International Summer University.\nDuring both summers I met new people from all over the world, made new friends and worked in projects that were not a core part of my regular curriculum but were super interesting.\nDTU Summer University I attended DTU Summer University during summer of 2013 working along other students (coming from France, Italy and China) in two projects:\n My favorite project involved modulating VCSELs for optical access and FTTH. I had the chance to tinker with lab equipment, simulators and finally write the report.\nI really liked the idea of making an end to end project that started with lab measurements which were later used to simulate a bigger scenario in VPItransmissionMaker Optical Systems. Check the presentation we did with our results below:\n \n\nThis is the report we wrote: \n\n The other project I worked in was about making use of OPNET to simulate a P2P network under different scenarios. Check the presentation with our results below: \n\nAalborg University Summer School I attended this Summer University during summer of 2012. I had the opportunity to work in a large seven people group (members coming from Denmark, France, Greece and Spain). We were all attending the Network Coding class and we did a practical project trying to asses the advantages of Network Coding in a simple scenario. Check the slides with our conclusions:\n\n\nDuring this Summer School, it was my first contact with Project Based Learning that I would be working with over the next two years.\nSummary Overall Summer Universities were a really enriching experience. I can therefore not recommend enough to attend at least a Summer University during your studies and maybe later on apply for a summer internship to get relevant industry experience in your field.\nAt Skyscanner we offer motivated students summer internships throughout most of our European offices. Check our current internships and do not hesitate to reach out to me if you have any doubt!\nSome Summer University links:\n Aarhus Summer University Aalborg University Summer School DTU Summer University Study in Denmark Study in Finland Summer Schools in Europe ","description":null,"keywords":null,"permalink":"https://esaezgil.com/post/summerschools/","title":"Summer schools: an enriching experience"},{"contents":"During Friday night May 6 through Sunday May 8 I attended THack Mallorca, a Hackathon organized by Tnooz, a global provider of news and analysis to the travel industry.\nMore than 100 pro and student devs signed up for #thackmallorca @tnooz pic.twitter.com/SajkdBcivu\n\u0026mdash; Gene Quinn (@genequinn) May 7, 2016 During the weekend I worked almost non-stop in a 4 people team: 2 developers from minube and 2 developers from Skyscanner including myself.\nAfter discussing different sort of ideas during a quick brain storming session, we agreed on creating a new product targeting travelers who prioritize activities over sightseeing. We also tried to maximize our ROI by consuming three external APIs from different sponsors. The team developed an internal API that suggested the best hotel based on the location of the activities chosen by the user and I developed an Android app consuming the team\u0026rsquo;s API.\nOverall, it was a great but exhausting experience in terms of working in an extremely fast paced environment and collaborating with other developers immersed in the travel industry. We also had the chance to talk to many competing teams coming from other companies like Trivago or Viajes el Corte Ingles.\nThese events are quite refreshing as it allows to somehow blur the self-imposed limitations that are inherent to working in big companies with clear goals.\nIt was a great and nice surprise to win 3 prizes from 3 different sponsors:\n Second prize from HotelBeds for best use of their API Second prize from Musement for best use of their API First prize from Booking.com for best API feedback Time to code! More than 100 students\u0026amp; professionals are competiting for wining different prices as of 5,000 euros #ThackMallorca16\n\u0026mdash; APItude by Hotelbeds (@Hotelbeds_API) May 7, 2016 #thackmallorca kicks off with https://t.co/fda8NUftuo API prezo @tnooz pic.twitter.com/jvXH5rIbPX\n\u0026mdash; Gene Quinn (@genequinn) May 7, 2016 I had a great time during this event and would gladly join again in the future.\nProud to be part of team TechnoBeatles at #THackMallorca. We won 3 prizes! Thanks @tnooz for organising an awesome event!\n\u0026mdash; Tudor Barbu (@motanelu) May 8, 2016 Check the presentation we did for the final pitch:\nhttps://speakerdeck.com/esaezgil/activiti-dot-es-technobeatles\n","description":"Review of the THack hackathon, Mallorca May'16","keywords":["hackathon,","review,","thack"],"permalink":"https://esaezgil.com/events/thackmallorca16/","title":"THack Mallorca - May'16"},{"contents":"Tweets by eqirn ","description":null,"keywords":null,"permalink":"https://esaezgil.com/twitter/enriquesaez/","title":""},{"contents":"This is a brief list of the books I have read recently or I am reading at the moment:\n Clean Code by Robert C. Martin \nThe Clean Code book has once again put front and center for me that writing software is a practice in which its output should be centered around:\n the reproducibility of the results an incremental refinement of the work based on the tests written for reproducibility the easiness for other people to read, understand, maintain and extend the code Writing Idiomatic Python by Jeff Knupp \nI really enjoyed going through Jeff’s posts. His book although concise it is straight to the point, laying out important fundamentals in a clear way.\n Effective Python by Brett Slatkin \nListening to Brett on the @TalkPython Podcast episode #25 was pretty inspirational, starting from scratch with Python at his job at Google to leading teams and launching App Engine. I had to read his book and I am enjoying it and learning a lot.\n The Hitchhiker\u0026#39;s Guide to Python by Kenneth Reitz In one of our projects at Skyscanner Hotels we make use of Kenneth Reitz\u0026rsquo;s libraries: Requests. That is how I found out about his book The Hitchhiker’s Guide to Python that I made use extensively while preparing my Python Best Practices talk.\n Python 101 by Michael Driscoll Another book which I read through for my Python Best Practices talk. The hacker\u0026#39;s Guide to Python I also made use of Julien Danjou\u0026rsquo;s The hacker\u0026rsquo;s Guide to Python for preparing the Python Best Practices talk.\n Software Developer Life Manual by John Sonmez Again listening to episode John Sonmez on the @TalkPython Podcast episode #71 I was curious about his book. I have read most of the book so far and the take out points for me were:\n create a Blog give value back to the community (contribute to OS, interesting blog posts) The Effective Engineer by Edmond Lau This is a book we gave away as a prize at the LauzHack Hackathon in Switzerland which I attended as a Skyscanner representative. I was curious about it and I am reading it now.\n Grokking Algorithms by Aditya Bhargava I enjoyed this book and wrote a brief review about it: https://esaezgil.com/reviews/grokking_algorithms/\n Python Testing with pytest by Brian Okken Read my review about it: https://esaezgil.com/reviews/review_python_testing_with_pytest_okken/\n","description":null,"keywords":null,"permalink":"https://esaezgil.com/page/books_finished/","title":"Finished books"},{"contents":"This is a list of books I want to read next, feel free to recommend me some other books in the comments below:\n Head First Design Patterns by Eric Freeman Fluent Python by Luciano Ramalho Grokking Algorithms by Aditya Bhargava Designing Data-Intensive Applications by Martin Kleppmann Python Testing with pytest by Brian Okken \n","description":null,"keywords":null,"permalink":"https://esaezgil.com/page/next_books/","title":"Next books"},{"contents":" This file exists solely to respond to /search URL with the related search layout template.\nNo content shown here is rendered, all content is based in the template layouts/page/search.html\nSetting a very low sitemap priority will tell search engines this is not important content.\nThis implementation uses Fusejs, jquery and mark.js\nInitial setup Search depends on additional output content type of JSON in config.toml ` [outputs] home = [\u0026quot;HTML\u0026quot;, \u0026quot;JSON\u0026quot;] \\`\nSearching additional fileds To search additional fields defined in front matter, you must add it in 2 places.\nEdit layouts/_default/index.JSON This exposes the values in /index.json i.e. add category ` ... \u0026quot;contents\u0026quot;:{{ .Content | plainify | jsonify }} {{ if .Params.tags }}, \u0026quot;tags\u0026quot;:{{ .Params.tags | jsonify }}{{end}}, \u0026quot;categories\u0026quot; : {{ .Params.categories | jsonify }}, ... \\`\nEdit fuse.js options to Search static/js/search.js ` keys: [ \u0026quot;title\u0026quot;, \u0026quot;contents\u0026quot;, \u0026quot;tags\u0026quot;, \u0026quot;categories\u0026quot; ] \\`\n","description":null,"keywords":null,"permalink":"https://esaezgil.com/search/","title":"Search"}]