Skip to main content

Posts

Showing posts with the label scala

Weapon of choice

Everybody has their favorite when it comes to cars, sports or jeans and the same goes for work tools. Some prefer OS X over Linux or Maven over Gradle and don't even get me started on browser wars. I've had my share of trying out different tools to choose the ones I want to use but every now and then I change some of my tools. This time I'm telling what my day to day tools currently are and why I changed one of them. The solid foundation When I get to choose my tools there's one solid foundation that works as a base for all other tools. This has been my number one choice for over ten years with a little variety over time. Linux. No question about it, I've used for years, I know my way around it and it offers everything I need in work and at home. The variety comes from different distributions and desktop environments although those have also been very stable for the past four or five years, Debian has the stability I want and XFCE offers everything I need fr...

Sharing to help myself

It's been a while since my last post but I have a good excuse. I've been in a new customer project (well new for me) for two months now and have absorbed a lot of new information on the technology stack and the project itself. This time I'll be sharing a short post about sharing code and how it can help the one who's sharing the code. I'll be giving a real life example of how it happened to me. My story Back when I was implementing first version of my simple-todo REST-service I used Scala and Play framework for the service and specs2 for testing the implementation. Since then I've done a few other implementations of the service but I've continued to use specs2 as a testing framework. I wrote about my implementation and shared the post through various services and as a result someone forked my work and gave me some pointers on how I could improve my tests. That someone was Eric Torreborre  the man behind specs2 framework. I didn't take his ref...

a walk in the dark side

Previously I got my first version of simple todo rest service working with scala and play framework and had some ideas what to do next. Since then I've implemented a second version of the rest service, this time backed by MongoDB . I also managed to create a simple web application as a user interface for the service. TL;DR; https://github.com/jorilytter/simple-todo/tree/mongodb-integration https://github.com/jorilytter/simple-todo-ui MongoDB with scala This was a idea that I had earlier and the actual implementation was pretty straightforward with the help of salat library. Integrating salat with play framework required me to implement a custom context but salat documentation already provided this solution so it was just a matter of reading the documentation. Other issue that I faced was with reading and writing json documents but that's where play's documentation provided the needed answers after some initial searches with google. Like before the implem...

Second try with Scala and REST

As I mentioned in my previous post I tried to create a simple REST service with Scala and spray.io , but that turned out to be unbelievably difficult. A second try with Scala and REST turned out to be successful. Play to the rescue When my experiment with spray.io didn't work out I had an idea to try out Play 2 as a base to my REST service. Working with Play 2 was a walk in the park compared to spray.io even though not entirely painless but much easier and less frustrating. Starting out with Play 2 was really quick thanks to a good documentation and examples that are up to date. Basically I just ran the command play new appName and started coding. So far I have REST service and a in-memory implementation of todo tasks with some unit tests. REST service is all Play 2 with routes and a single application class. The current service layer implementation is a single class with tasks in a mutable Map where a individual task is a case class, so just some basic Scala code. I r...

Creating something concrete with Scala

Since I attended a course on functional programming with Scala at Coursera (see previous posts) I've been having a idea to make something concrete with Scala. Having only minimal experience with Scala I decided to try something simple with well known Scala libraries. The project First I'll try to create a simple todo application that saves all the data to a some database (maria, redis, mongo) and the tasks are managed via REST-service. Once I've done that I have two ideas what to do after that. I'll either try to create some sort of UI that uses the REST-service or I'll extend the simple todo application to a Kanban board type of application and try to create the UI after that. I haven't decided with what I'll be creating the UI since I'm not that familiar with current frontend technologies so that'll be decided later. First try At first I tried to create a REST-service with spray but that didn't work. Maybe it's just me but to...

Course completed

As I wrote in previous posts I've been attending a course Functional Programming Principles in Scala on coursera. I've completed the course and will write my final thoughts of the course this time. First weeks The first three weeks was like a  boot camp to drop out everyone who's not fully commited to the course. I've written about the first weeks in a previous post so I'm not going to repeat myself. Weeks four and five Weeks four and five were a positive surprise in two different ways. First of all the subjects were much more interesting and practical than in previous weeks. The second nice surprise was that the homework for the two weeks was combined. Week four was about pattern matching which is a essential part of Scala and I found it to be a very interesting concept, easy to understand and it can simplify the code. Week five was about lists. Nothing shocking during the week as lists are similar to lists in Java but in Scala lists do have some o...

Learning Scala online

As I mentioned on my last post I've been attending Functional Programming Principles in Scala course at Coursera . It's been three weeks now and I thought I should express my current feelings about the course. Course arrangements Arrangements on the course are just about what I expected. Series of video lectures per week, some quizzes in the videos and homework that's evaluated automatically in a matter of minutes. Homework assignments and videos are given on mondays and homework deadline is in about ten days from that. On the first three weeks the lectures and homework has been about abstract presentations of entities and mathematical definitions. Lectures Lectures i.e. videos can be viewed online or downloaded and one can also download english subtitles for the videos and the slides shown on videos are also downloadable as pdf's. The subtitles could be helpful sometimes but the quality isn't that good, missing and wrong words, so I don't use...

Summer is over and it's time to get back in business

Now that summer is over and summer vacation is just a faint memory in the past it's time to get back in business. This time I'm writing about boring work days and how I'm going to try to overcome that troubling feeling I'm getting. Background For the past four weeks in work the days have been repeating themselves. Every day has been like a repeat from the day before but a bit slower. When this happens it means that work tasks are also repeating the same pattern again and again. For me this is a bad situation! I know from the past that this is a situation where I'm getting bored and losing my motivation more and more every day. When I'm losing my motivation at work I know I'm also losing my motivation to do anything useful at my free time. I knew I had to do something so I wouldn't lose interest to everything and one day I would wake up realizing that I've spent six months browsing netflix. First step Probably not the first thing I did...