Overtone: Open source live-coding environment & audio collaboration platform written in Clojure

Overtone website masthead

According to the website, Overtone is a “live-coding environment and audio collaboration platform that’s free for everyone to download, hack on and make crazy-cool sounds either individually or in groups.” It is “a musical programming library written in Clojure which uses the SuperCollider audio engine and synthesis server under the covers.”

For a taste of what kind of sounds can be made in Overtone, check out this band’s website. Overtone also supports integration with Quil and Shadertone to integrate synchronized visuals with Overtone audio.

YDN-DB: HTML5 Javascript database library for IndexedDB

yathit logo

OK. So I’m not even gonna lie. I had no idea what IndexedDB was before I came across YDN-DB. I’ve only dabbled with serious JavaScript development so far, and the framework-soup that has arisen in the space rivals Java at this point.

Anyway, on to the website!

YDN-DB is a pure javascript library, which uses HTML5 browser database sunch as IndexedDB, WebDatabase (WebSQL) and WebStorage (localStorage). Most
modern browsers including IE10, Chrome, Firefox and Safari support either IndexedDB or WebSQL. The library can also be used in web client such as
phonegap, WebView and UIWebView mobile clients.

Supports:

  • Chrome 4+ (IndexedDB or WebSql)
  • Firefox 3+ (IndexedDB draft), Firefox 10+ (IndexedDB)
  • IE 6 (userdata), IE7+ (localStorage), IE10+ desktop/mobile (IndexedDB)
  • Safari 3.1+ desktop/mobile/iOS web client (WebSql)
  • Android web client, Android browser 2.1+ (WebSql), 4+ (IndexedDB)
  • Opera 10+ (WebSql), Opera 15+ (IndexedDB)

Code snippets:

var db = new ydn.db.Storage('db-name');
db.put('store-name', {message: 'Hello world!'}, 'id1');
db.get('store-name', 'id1').always(function(record) {
  console.log(record);
});

Indexed Queries

var q = db.from('people').where('age', '>=', 25);
q.list(10).done(function(peoples) {
  console.log(peoples); // list of first 10 peoples
});

var q = db.from('people').where('country', '=', 'US').order('name');
q.list(10).done(function(peoples) {
  console.log(peoples); // list of first 10 peoples from US ordered by name
});
q.list(10).done(function(peoples) {
  console.log(peoples); // next 10 peoples
});

Streaming API for reduced memory usage

var q = db.from('author').where('first', 'starts', input_value);
var ul = document.getElementById('auto-suggestion-list');
ul.innerHTML = '';
q.open(function (cursor) {
  var li = document.createElement('li');
  var people = cursor.getValue();
  li.textContent = people.first + ' ' + people.last;
});

Synchronize with REST backend services

var schema = {
  stores: [{
        name: 'todo',
        keyPath: 'id',
        Sync: {
          format: 'gcs',  // Google Cloud Storage
          Options: {
            bucket: 'ydn-note-data',
            prefix: 'todo/'
          }
        }
  }]
};
var db = new ydn.db.Storage(db_name, schema);
// GET https://ydn-note-data.storage.googleapis.com/todo/id123
db.get('todo', 'id123');
// PUT https://ydn-note-data.storage.googleapis.com/todo/id123
db.put('todo', 'id123');
// DELETE https://ydn-note-data.storage.googleapis.com/todo/id123
db.remove('todo', 'id123');

Hugo: Static Site Generator written in Go

Hugo masthead from website

I like simplicity, and nothing says simple like a plain, old, static HTML website. Static websites have some real advantages: they are generally pretty secure, they play nice with whatever source control system you use, and they are fast. A static site generator gives you those advantages plus some niceties like templating and asset reuse.

One of the most interesting things about Hugo is that since it runs on the Go language runtime, you can drop the package on your system of choice and go.

From the website:

Hugo doesn’t depend on administrative privileges, databases, runtimes, interpreters or external libraries. Sites built with Hugo can be deployed
on S3, Github Pages, Dropbox or any web host.

Organize your content however you want with any URL structure. Declare your own content types. Define your own meta data in YAML, TOML or JSON.
Use indexes to group your content however you want.

The next time I build a static site, I’ll definitely give Hugo a look. I found out about this tool from Web Appers.

Book recommendation: Cool Tools: A Catalog of Possibilities

Picture of Cool Tools Catalog

Who’d a thunk that in this digital, information-wants-to-be-free, give-it-to-me-fast age, a giant, $30.00 coffee-table book about… well… “cool tools” would be so popular? When it arrived and I showed it to my wife, her initial reaction was, “You paid 30 bucks for a catalog? You’re pretty weird.” Then when she sat down and started thumbing through it she got it: “This is a Sears catalog! There are some nice gifts in here!”

So. A Sears catalog for big kids in the digital age. I decided to buy a copy after hearing Kevin Kelly speak about it on the Triangulation podcast.

From the Amazon.com page:

Cool Tools is a highly curated selection of the best tools available for individuals and small groups. Tools include hand tools, maps, how-to
books, vehicles, software, specialized devices, gizmos, websites — and anything useful. Tools are selected and presented in the book if they are
the best of kind, the cheapest, or the only thing available that will do the job. This is an oversized book which reviews over 1,500 different
tools, explaining why each one is great, and what its benefits are. Indirectly the book illuminates the possibilities contained in such tools and
the whole catalog serves an education outside the classroom. The content in this book was derived from ten years of user reviews published at the
Cool Tools website, cool-tools.org.

Hazelcast: Java Open Source In-Memory Data Grid

Hazelcast logo

At work, we’re currently using the open source version of ehcache in our apps. In our next software stack refresh we’ve talked about investigating a distributed caching framework. I think that Hazelcast might be a contender. I like that it allows you to store date in simple Lists, Sets, Maps, and Queues and handles the distributed part for you. The question we’ll need to answer at work is “how tunable is Hazelcast?”

From the website:

  • Distributed java.util.{Queue, Set, List, Map}
  • Distributed java.util.concurrency.locks.Lock
  • Distributed java.util.concurrent.ExecutorService
  • Distributed MultiMap for one to many mapping
  • Distributed Topic for publish/subscribe messaging
  • Distributed Indexing and Query support
  • Transaction support and J2EE container integration via JCA
  • Socket level encryption for secure clusters
  • Write-Through and Write-Behind persistence for maps
  • Java Client for accessing the cluster remotely
  • Dynamic HTTP session clustering
  • Support for cluster info and membership events
  • Dynamic discovery
  • Dynamic scaling
  • Dynamic partitioning with backups
  • Dynamic fail-over
  • Web-based cluster monitoring tool

Here are some code snippets from the website:

Map

import com.hazelcast.config.Config;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;

import java.util.concurrent.ConcurrentMap;

public class DistributedMap {
    public static void main(String[] args) {
        Config config = new Config();
        HazelcastInstance h = Hazelcast.newHazelcastInstance(config);
        ConcurrentMap<String, String> map = h.getMap("my-distributed-map");
        map.put("key", "value");
        map.get("key");
        //Concurrent Map methods
        map.putIfAbsent("somekey", "somevalue");
        map.replace("key", "value", "newvalue");
    }
}

MultiMap

import com.hazelcast.config.Config;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.MultiMap;

import java.util.Collection;

public class DistributedMultiMap {
    public static void main(String[] args) {
        Config config = new Config();
        HazelcastInstance h = Hazelcast.newHazelcastInstance(config);
        MultiMap<String, String> multiMap = h.getMultiMap("my-distributed-multimap");
        multiMap.put("key", "value1");
        multiMap.put("key", "value2");
        multiMap.put("key", "value3");

        Collection<String> values = multiMap.get("key");

        // remove specific key/value pair
        multiMap.remove("key", "value2");
    }
}

Queue

import com.hazelcast.config.Config;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;

public class DistributedQueue {
    public static void main(String[] args) throws InterruptedException {
        Config config = new Config();
        HazelcastInstance h = Hazelcast.newHazelcastInstance(config);
        BlockingQueue<String> queue = h.getQueue("my-distributed-queue");
        queue.offer("item");
        String item = queue.poll();

        //Timed blocking Operations
        queue.offer("anotheritem", 500, TimeUnit.MILLISECONDS);
        String anotherItem = queue.poll(5, TimeUnit.SECONDS);

        //Indefinitely blocking Operations
        queue.put("yetanotheritem");
        String yetanother = queue.take();
    }
}  

Topic

import com.hazelcast.config.Config;
import com.hazelcast.core.*;

public class DistributedTopic implements MessageListener<String> {
     public static void main(String[] args) {
         Config config = new Config();
         HazelcastInstance h = Hazelcast.newHazelcastInstance(config);
         ITopic<String> topic = h.getTopic("my-distributed-topic");
         topic.addMessageListener(new DistributedTopic());
         topic.publish("Hello to distributed world");
     }

     @Override
     public void onMessage(Message<String> message) {
         System.out.println("Got message " + message.getMessageObject());
     }
}

Lock

import com.hazelcast.config.Config;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;

import java.util.concurrent.locks.Lock;

public class DistributedLock {

    public static void main(String[] args) {
        Config config = new Config();
        HazelcastInstance h = Hazelcast.newHazelcastInstance(config);
        Lock lock = h.getLock("my-distributed-lock");
        lock.lock();
        try {
            //do something here
        } finally {
            lock.unlock();
        }
    }
}

Executor Service

import com.hazelcast.config.Config;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IExecutorService;
import com.hazelcast.core.Member;
import java.io.Serializable;

public class DistributedExecutorService {
    public static void main(String[] args) {
        Config config = new Config();
        HazelcastInstance h = Hazelcast.newHazelcastInstance(config);
        IExecutorService ex = h.getExecutorService("my-distributed-executor");
        ex.submit(new MessagePrinter("message to any node"));
        Member firstMember = h.getCluster().getMembers().iterator().next();
        ex.executeOnMember(new MessagePrinter("message to very first member of the cluster"), firstMember);
        ex.executeOnAllMembers(new MessagePrinter("message to all members in the cluster"));
        ex.executeOnKeyOwner(new MessagePrinter("message to the member that owns the following key"), "key");
    }

    static class MessagePrinter implements Runnable, Serializable {
        final String message;

        MessagePrinter(String message) {
            this.message = message;
        }

        @Override
        public void run() {
            System.out.println(message);
        }
    }
}

ØMQ (AKA zeromq): Open-source async socket/messaging library & concurrency framework with support for 40+ languages & most OSes

zeromq logo

I found out about this project while listening to a FLOSS Weekly episode on SaltStack.

From the website:

  • The socket library that acts as a concurrency framework.
  • Carries messages across inproc, IPC, TCP, and multicast.
  • Connect N-to-N via fanout, pubsub, pipeline, request-reply.
  • Asynch I/O for scalable multicore message-passing apps.
  • Large and active open source community.
  • 40+ languages including C, C++, Java, .NET, Python.
  • Most OSes including Linux, Windows, OS X.
  • Free software with full commercial support.

Check out the Learn the Basics page. There’s some good stuff there.

SQLAlchemy: Python SQL Toolkit and Object Relational Mapper

SQLAlchemy masthead from site

SQLAlchemy looks cool enough to make me go hunting for a Java equivalent for use on projects at work.

Take a look at the features page. I’m particularly interested in the Unit Of Work

The Unit Of Work system, a central part of SQLAlchemy’s Object Relational Mapper (ORM), organizes pending insert/update/delete operations into
queues and flushes them all in one batch. To accomplish this it performs a topological “dependency sort” of all modified items in the queue so as
to honor inter-row dependencies, and groups redundant statements together where they can sometimes be batched even further. This produces the
maximum efficiency and transaction safety, and minimizes chances of deadlocks. Modeled after Fowler’s “Unit of Work” pattern as well as
Hibernate, Java’s leading object-relational mapper.

…and Raw SQL statement mapping

SQLA’s object relational query facilities can accommodate raw SQL statements as well as plain result sets, and object instances can be generated
from these results in the same manner as any other ORM operation. Any hyper-optimized query that you or your DBA can cook up, you can run in
SQLAlchemy, and as long as it returns the expected columns within a rowset, you can get your objects from it. Statements which represent multiple
kinds of objects can be used as well, with results received as named-tuples, or with dependent objects routed into collections on parent objects.

SQLAlchemy supports…

…dialects for SQLite, Postgresql, MySQL, Oracle, MS-SQL, Firebird, Sybase and others, most of which support multiple DBAPIs. Other dialects are
published as external projects. The corresponding DB-API 2.0 implementation (or sometimes one of several available) is required to use each
particular database. View Current DBAPI Support.

Bruce Eckel is a Java guy I respect. He wrote Thinking in Java and he said this about SQLAlchemy:

SQLAlchemy is a pretty amazing design…In SQLAlchemy, you need to explicitly start a session. What’s amazing is that all the changes you make
during that session are kept in some kind of parse tree, and then when the session ends SQL is created on-the-fly to produce a single, optimal
SQL statement for that particular sequence of changes. I found this idea pretty mind-blowing.

That sounds pretty sexy to me.