Arduino: Finally getting started (presentation)

Arduino

I always wanted to write a post with some sort of help for those curious about the fascinating world of Arduino. Here it is. Finally my getting started guide.

Please, stay only if…

  • you’re curious
  • you’re looking for new hobbies
  • you have some programming skills
  • you’re at no risk of divorce

A real disclaimer, arduino is a time sucker, same level as:

  • 3D printing,
  • video games,
  • aeromodelling,
  • etc.

Be careful.


Arduino: Finally getting started (post)

Arduino

I always wanted to write a post with some sort of help for those curious about the fascinating world of Arduino. Here it is. Finally my getting started guide.

Please, stay only if…

  • you’re curious
  • you’re looking for new hobbies
  • you have some programming skills
  • you’re at no risk of divorce

A real disclaimer, arduino is a time sucker, same level as:

  • 3D printing,
  • video games,
  • aeromodelling,
  • etc.

Be careful.


Quicky on Enumeratum for Scala 2 (presentation)

Enumeratum

Enumerations for Scala

Why should I care?

  • Enumerations are fundamental
  • You wish less maintenance
    • Find bugs at compile time
    • Code easy to understand
    • Meaningful data types

“Let the compiler help you!!!”


Dump your JVM (post)

This is a ultra-short post on JVM debugging tools. Did you get an OutOfMemoryError and have no idea how to proceed? This post is for you.

An example for memory analysis

I’d like to start with a dummy application as example. We will make it run and analyse its memory heap. With the tools I will introduce you can analyse many other indicators, but the procedure to get to that point hast the same initial steps. Once in the tool you can explore by yourself.

This application simply will create a huge amount of UUID instances and keep them in memory for a while. If we analyse it correctly, we should see them somewhere in our memory heap. So let’s get started.

Put in Main.scala the following:


Exception Handling in Spark 2.x (post)

Why Exception Handling (E.H.) in Spark?

  • data is rarely ideal
  • some scenarios don’t deserve an immediate halt
  • investigate newer scenarios as-per-priority (happier customers)
  • ease product evolution
  • understand application limitations

Exception Handling in Spark 2.x (presentation)

Why Exception Handling (E.H.) in Spark?

  • data is rarely ideal
  • some scenarios don’t deserve an immediate halt
  • investigate newer scenarios as-per-priority (happier customers)
  • ease product evolution
  • understand application limitations

Dotfiles (presentation)

Dotfiles? Me?

You’re eligible if you use:

  • Linux
  • macOS
  • Cygwin (over Windows)

And if at least one of the below is true:

  • you often ‎can’t remember commands and flags
git log --oneline \
  --decorate --all \
  --graph
  • you often lose configs of your apps (bash, htop)
  • you often use hostile shell in many remote hosts
>_
  • you happen to enjoy a very colorful environ</span>ment

Writing a post or a presentation? Both! (post)

Post or slides?

Presentations are great. Blogs too. Which one should do I dedicate my time to?

No need to choose, you can do both at once!

In this special post/presentation, I will give you an example with sources on how to build your own blog posts, and generate both:

  • a post, and
  • a presentation

from a single markdown file.


Writing a post or a presentation? Both! (presentation)

Post or slides?

Presentations are great. Blogs too. Which one should do I dedicate my time to?

No need to choose, you can do both at once!

In this special post/presentation, I will give you an example with sources on how to build your own blog posts, and generate both:

  • a post, and
  • a presentation

from a single markdown file.




JVM Memory Spaces (post)

This post is about:

  • what Java Memory Spaces are
  • why they are such a good idea
  • the spaces and their use in the JVM
  • how to measure their usage in practice
  • where to find more documentation about them

It will help you better understand concepts like:

  • OutOfMemoryError
  • PermGen
  • heap memory
  • etc.

JVM Memory Spaces (presentation)

This post is about:

  • what Java Memory Spaces are
  • why they are such a good idea
  • the spaces and their use in the JVM
  • how to measure their usage in practice
  • where to find more documentation about them

It will help you better understand concepts like:

  • OutOfMemoryError
  • PermGen
  • heap memory
  • etc.

Measuring the Performance of Anything In Scala (post)

Why benchmarking?

Coding consciously and the use of code reviews are of great importance when it comes to writing clean and efficient code. Sometimes however, I feel like I need stronger reasons to go one way or another, specially when I don’t really know what is happening under the JVM hood.

A benchmark helps describing the current status of your implementation. It provides awareness, helps deciding if improvement is worth the investment, and finally helps measuring the improvement of your change (if any).

Unfortunately getting such number is not so easy, but fortunately there are good tools to do it correctly. Keep reading if you’re interested.


Sorting Anything Cleanly with Scala (post)

Why sorting?

Sorting requirements are present in the vast majority of data processing applications. As Scala provides very good tools for addressing them, I thought it would be interesting to dive a bit into them to improve our code.

Here are some of the patterns that you may feel tempted to use, and what I consider is a better alternative. Leave a comment if you have even a better one!


Serializing (almost) Anything with Kryo (for Spark) (post)

What is Kryo?

Kryo serialization is one of the fastest on-JVM serialization libraries, and it is certainly the most popular in the Spark world.

To get the most out of this algorithm you must register the few classes that will have to be serialized. This will help to decrease the size of serialized objects, as their serialization will be tailor-made optimized by Kryo.

Registering your classes with Kryo in Spark is done this way:


Partial Functions in Scala (post)

What is a partial function?

In short, a partial function is simply a mathematical function f: X->Y that is not defined for some elements in the domain X.

The typical example is f: 1/x , not defined when x = 0.

But, what is a partial function in Scala?

It is a Scala trait that allows to express a partial function. For instance…


Subscribe via RSS