[SOLVED] arduino libncurses.so.5: cannot open shared object file: No such file or directory

If you’re trying to work with arduino under Fedora 24 (may be under others as well) and you’re getting this kind of errors:

All you need to do is make a symbolic link to the required file. If you look under

You will find files like:

So you need to make a…

[Java 8] Collection.removeIf() example

 

[New Algorithm] Anagram

Jon Bentley’s book Programming Pearls contains a problem about finding anagrams of words. The statement: Given a dictionary of english words, find all sets of anagrams. For instance, “pots”, “stop” and “tops” are all anagrams of one another because each can be formed by permuting the letters of the others. I thought a bit and…

Simple Java socket server with Executor

And an example with the ExecutorService class:  

 

[HOWTO] Timing multiple threads using CountDownLatch

Here’s an example program which spawns a number of threads of a class and counts the time taken to execute them all. The CountDownLatch may also be used in simulation programs where a JOIN element is needed.

Some details from the Java API:

A synchronization aid that allows one or more threads to…

Best practices for better REST API

Copied from here: http://blog.mwaysolutions.com/2014/06/05/10-best-practices-for-better-restful-api/ Web APIs has become an very important topic in the last year. We at M-Way Solutions are working every day with different backend systems and therefore we know about the importance of a clean API design. Typically we use a RESTful design for our web APIs. The concept of REST is…

Java Comparator example

Here’s our class we want to compare. Note the implemented inner classes that implement the Comparator interface:

And here’s the client class:

 

Java Merge Sort

Here is a Java example of Merge Sort algorithm:

And here is the Bootom Up Merge Sort: