root > Senior Software Engineer | Scala, AWS, Kubernetes, Microservices, Python, Go, PostgreSQL

Technical Blog: Functional Programming, Cloud Architecture & DevOps


  • Home

  • Categories

  • Archives

  • Tags

  • Search

Moving from (spring mvc,tomcat,postgresql) to (finatra,mongodb)

Posted on 2018-06-08 | In scala , programming , finatra ,

I was thinking to rewrite my summarizer app for a while. But couldn’t decide what to use, should I move to play mvc or sth else.. There was a Scala meeting in Helsinki this year, so I joined to meeting and first time I heard about Finatra. Finatra is an HTTP API framework built on top of Finagle. Twitter, Tumblr vs. some big companies use it and develop same time. The project is very active! The documentation is well written. You can easily start to write a sample app. So after some tryings I decided to use Finatra for my service. And about database, basically I store text documents and summaries, so it was easy decision to use Mongodb.

Read more »

Scala does not read file from resources folder after compiling

Posted on 2018-06-01 | In scala , programming ,

While running my app with Intellij Idea , I had no problems with resource folder. It was reading files and passing tests. It was implemented like this:

val resourcesPath = getClass.getResource("/lexical/stopWords.csv").getPath
val source = fromFile(resourcesPath)
val text = try source.mkString finally source.close()
Read more »

Scalastyle HeaderMatchesChecker problem

Posted on 2018-05-19 | In Scala , Software Development , Coding ,

Problem is that idea shows warning if you dont have a blank line following the header in a file. My environment is:

scalaVersion: "2.12.4"
sbt.version: "1.1.5"
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
Read more »

How to mock a call by name function using ScalaMock?

Posted on 2018-05-17 | In scala , programming ,

I was trying to mock my call-by-name function with ScalaMock, so it can run the passed function inside my mock. My workmates helped me to find the solution. Error: scala.concurrent.impl.Promise$DefaultPromise@69b28a51 cannot be cast to Either The problem is related with my mock for myFunction(). I pass a call-by-name function to myFunction()(f: => T) which returns T, after evaluating it, myFunction() returns Either[ErrorCode, T]. So the mock should be like that:

Read more »

Scala forward reference extends over definition of value x

Posted on 2018-04-19 | In Scala , Software Development , Coding ,

Problem is that can not find the function we call. Try put the function top of it. Or still not work then define as lazy value. If it is referenced somewhere and scalac is confused with the sequence, making it lazy could do the trick Example: ```scala def functionA() { functionB() }

Read more »

how to run sbt projects with intellij idea

Posted on 2018-03-17 | In scala , programming ,
  1. From the Run menu, select Edit configurations
  2. Click the + button and select SBT Task.
  3. Name it Run the program.
  4. In the Tasks field, type ~run. The ~ causes SBT to rebuild and rerun the project when you save changes to a file in the project.
  5. Click OK.
  6. On the Run menu. Click Run ‘Run the program’.
Read more »

How to move from tumblr to jekyll - part 1

Posted on 2018-02-20 | In Tumblr , Jekyll , Blog , Writing ,

Almost 4 years I have been using tumblr for blogging. I was not happy with tumblr because of google analytics and crawling problems. And I want to try something different. First I tried wordpress but it didn’t work well with my home server, I have an orange pi, so it was very slow to open any page with wordpress. I decided to use static blog, after some research, It was best to use Jekyll for blogging. Good idea but a bit hard to move everything, because there is not any tool which can move to all tumblr posts to your jekyll blog. After trying some tools I finally found a way to move all posts!

Read more »

Intellij Idea shortcuts

Posted on 2018-02-19 | In Software Development , Coding ,
  • refactoring : shift + F6
Read more »

Github tricks when merge has conflicts

Posted on 2018-02-19 | In Git , Software Development , Coding ,

For example; we have branch task-12 multiple people commit to branch and they fix conflicts you want to git pull and then commit your changes but when you git pull it has conflict with your local copy of this branch then follow this steps to get latest version of branch without confilicts

Read more »

Functional Programming for Mortals

Posted on 2017-09-21 | In Scala , Software Development , Coding , Functional Programming , Books ,

I started to read a new book about Scala. You can read it online or you can buy it.

Read more »
1 2 3 … 21
teaddict

teaddict

205 posts
37 categories
645 tags
RSS
GitHub
© 2025 teaddict