Parallel Computing Made Easy With Scala and Akka

  • April 08, 2014
  • Robert Sosinski
  • Scala

The foreseeable future of micro processors is definitely a multi-cored one. This means that individual CPU cores are not going to get much faster. Instead, chip manufactures are adding more CPU cores to each chipset. For example, the laptop I’m writing this tip on has a 2.3 GHz Intel Core i7. The i7 sports 4 CPU cores with Hyper-Threading, which effectively makes it an 8 core CPU. Servers can have even more CPU cores often spread across multiple processors. What this means for software engineers is that writing code that can run in parallel is not a luxury, but a necessity if you need your application to scale.

Read More


Getting Started with Actor Based Programming Using Scala and Akka

  • March 28, 2014
  • Robert Sosinski
  • Scala

Building concurrent software is difficult, especially when directly managing Threads. Handling synchronization with MutExes, memory barriers, and condition variables is rife with error. This is because under-synchronizing your code will lead to race conditions, while over-synchronizing your code lowers performance. The good news is that there is a better way, known as the Actor Pattern. Made popular with Erlang, the Actor Pattern makes it easy to separate concerns into isolated actors that allow for safe concurrency. Akka brings the same pattern to Scala, so you can build concurrent software faster, and safer, than ever before.

Read More


Binding Scope in JavaScript

  • April 28, 2009
  • Robert Sosinski
  • JavaScript

JavaScript as a language has a reputation of being both flexible and quirky. One such area of its flexibility is in how functions can be assigned, nested and returned just like any other data-type. However, as functions can execute code while nested many objects and functions deep, keeping track of scope becomes very important. But, scope in JavaScript can be pretty loose. For this reason, keeping a function’s scope consistent can be tricky. The good news is, once you know what to look for and understand how to use some of the tools JavaScript offers, keeping scope bound to the data you want is actually very easy.

Read More


The Difference Between Ruby Symbols and Strings

  • January 11, 2009
  • Robert Sosinski
  • Ruby

Symbols are quite an interesting, and often ill-understood, facet of Ruby. Used extensively throughout Rails and many other Ruby libraries, Symbols are a common sight. However, their rational and purpose is something of a mystery to many Rubyists. This misunderstanding can probably be attributed to many methods throughout Ruby using Symbols and Strings interchangeably. Hopefully, this tutorial will show the value of Symbols and why they are a very useful attribute of Ruby.

Read More


Understanding Ruby Blocks, Procs and Lambdas

  • December 21, 2008
  • Robert Sosinski
  • Ruby

Blocks, Procs and lambdas (referred to as closures in Computer Science) are one of the most powerful aspects of Ruby, and also one of the most misunderstood. This is probably because Ruby handles closures in a rather unique way. Making things more complicated is that Ruby has four different ways of using closures, each of which is a tad bit different, and sometimes nonsensical. There are quite a few sites with some very good information about how closures work within Ruby. But I have yet to find a good, definitive guide out there. Hopefully, this tutorial becomes just that.

Read More


Up and Running with Custom RSpec Matchers

  • December 10, 2008
  • Robert Sosinski
  • Ruby

RSpec continues to gain popularity among the Ruby community, and rightfully so. With RSpec, testing becomes much easier, and dare I say, kind of fun. The reason RSpec is great (at least for me) centers around two things, nested test cases and easy to write matchers. However, as much as I see RSpec users taking advantage of the former benefit, I still do not see many writing custom matchers. As such, this tutorial aims to show how simple and flexable RSpec matchers are.

Read More


Simple and RESTful Account Recovery for Ruby on Rails

  • March 24, 2008
  • Robert Sosinski
  • Ruby on Rails

Continuing on with building a simple and restful user authentication system is allowing your users to recover their accounts. Account recovery is necessary as user’s have a knack for forgetting their passwords. Often, I come across account recovery methods that are crufty or insecure. Such does not need to be the case, especially with Ruby on Rails.

Read More


Simple and RESTful Authentication for Ruby on Rails

  • February 23, 2008
  • Robert Sosinski
  • Ruby on Rails

Ruby on Rails seems to be driving more and more toward RESTful programming. However, my search for ideas on how to make a truly RESTful authentication system came up pretty dry. I either found systems that were not as RESTful as I wanted or far to complex then I deemed necessary. As such, I gave some thought on how to make my own.

Read More


Working with PGP and Mac OS X

  • February 18, 2008
  • Robert Sosinski
  • Security

PGP, or Pretty Good Privacy, is a commonly used and very secure encryption program using public key cryptography. Through PGP, you can encrypt information such as messages, documents and files in a manner so that only the recipient can decrypt and open them.

Read More


Starting Amazon EC2 with Mac OS X

  • January 26, 2008
  • Robert Sosinski
  • Systems

Amazon EC2 (Elastic Cloud Compute) is making a lot of buzz in the tech industry, and rightfully so. With EC2, you can ramp up to a massive server farm in a matter of minutes, while scaling back down to a single server when things calm down. The benefits are obvious, as you only pay for what you need and you have access to more computing power right when you need it.

Read More