tag:blogger.com,1999:blog-78557574159772574092024-03-05T10:47:29.392-08:00carlo scarioniMy Software Development BlogAnonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.comBlogger54125tag:blogger.com,1999:blog-7855757415977257409.post-51581703804133281642015-02-18T06:25:00.003-08:002015-02-18T08:45:21.545-08:00Clustering customers for machine learning with Hadoop and Mahout
<!doctype html>
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote {
margin: 0;
padding: 0;
}
body {
font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
font-size: 13px;
line-height: 18px;
color: #737373;
background-color: white;
margin: 10px 13px 10px 13px;
}
table {
margin: 10px 0 15px 0;
border-collapse: collapse;
}
td,th {
border: 1px Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com0tag:blogger.com,1999:blog-7855757415977257409.post-69571833269929308302014-09-05T09:34:00.003-07:002014-09-05T09:36:55.574-07:00Ruby unit testing is weak as a safety net
<!doctype html>
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote {
margin: 0;
padding: 0;
}
body {
font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
font-size: 13px;
line-height: 18px;
color: #737373;
background-color: white;
margin: 10px 13px 10px 13px;
}
table {
margin: 10px 0 15px 0;
border-collapse: collapse;
}
td,th {
border: 1px Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com8tag:blogger.com,1999:blog-7855757415977257409.post-68045220893425025362013-10-11T09:22:00.000-07:002013-10-11T09:24:21.318-07:00Checking Jquery Ajax requests from Capybara<!doctype html>
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote {
margin: 0;
padding: 0;
}
body {
font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
font-size: 13px;
line-height: 18px;
color: #737373;
background-color: white;
margin: 10px 13px 10px 13px;
}
table {
margin: 10px 0 15px 0;
border-collapse: collapse;
}
td,th {
border: 1px Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com0tag:blogger.com,1999:blog-7855757415977257409.post-18015919405341794372013-10-07T13:24:00.000-07:002013-10-07T13:24:15.096-07:00Simple setup for testing MongoDB map reduce with Ruby<!doctype html>
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote {
margin: 0;
padding: 0;
}
body {
font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
font-size: 13px;
line-height: 18px;
color: #737373;
background-color: white;
margin: 10px 13px 10px 13px;
}
table {
margin: 10px 0 15px 0;
border-collapse: collapse;
}
td,th {
border: 1px Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com0tag:blogger.com,1999:blog-7855757415977257409.post-5827469741172391762013-09-15T11:09:00.000-07:002013-09-15T11:13:10.486-07:00Analyzing your Mongo data with Pig<!doctype html>
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote {
margin: 0;
padding: 0;
}
body {
font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
font-size: 13px;
line-height: 18px;
color: #737373;
background-color: white;
margin: 10px 13px 10px 13px;
}
table {
margin: 10px 0 15px 0;
border-collapse: collapse;
}
td,th {
border: 1px Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com0tag:blogger.com,1999:blog-7855757415977257409.post-4479065972041497622013-07-29T08:05:00.003-07:002013-07-29T10:41:32.558-07:00Javascript for Java developers 1.Lack of Classes. Instantiating objects
<!doctype html>
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote {
margin: 0;
padding: 0;
}
body {
font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif;
font-size: 13px;
line-height: 18px;
color: #737373;
background-color: white;
margin: 10px 13px 10px 13px;
}
table {
margin: 10px 0 15px 0;
border-collapse: collapse;
}
td,th {
border: 1px Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com3tag:blogger.com,1999:blog-7855757415977257409.post-50131897402265831022013-04-17T07:11:00.001-07:002013-04-17T07:11:19.992-07:00Pro Spring Security and OAUTH 2
OAuth and Spring Security
ol{margin:0;padding:0}.c3{max-width:468pt;background-color:#ffffff;padding:72pt 72pt 72pt 72pt}.c5{color:inherit;text-decoration:inherit}.c0{height:11pt;direction:ltr}.c2{color:#1155cc;text-decoration:underline}.c4{font-weight:bold}.c1{direction:ltr}.title{padding-top:0pt;line-height:1.15;text-align:left;color:#000000;font-size:21pt;font-family:"Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com9tag:blogger.com,1999:blog-7855757415977257409.post-78266319564933896772013-02-10T05:59:00.001-08:002013-02-10T05:59:49.570-08:00Duck typing in Scala (kind of). Structural Typing.Scala offers a functionality known as Structural Types which allows to set a behaviour very similar to what dynamic languages allow to do when they support Duck Typing (http://en.wikipedia.org/wiki/Duck_typing)
The main difference is that it is a type safe, static typed implementation checked up at compile time. This means that you can create a function (or method) that receives an expected duckAnonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com1tag:blogger.com,1999:blog-7855757415977257409.post-42542934718383715222013-02-05T15:22:00.001-08:002013-02-05T15:22:43.573-08:00Understanding Currying with ScalaLearning Scala is not an easy task. There are many things to learn. Some of them are very different and some of them seem complex.
Currying is a technique not necessarily complex, but is one that you probably are not familiar with if you come from Java background as it is not a straightforward technique to apply in that language. Currying allows to turn a function that expects two arguments intoAnonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com3tag:blogger.com,1999:blog-7855757415977257409.post-33971574094631608472013-02-05T07:45:00.000-08:002013-02-05T07:45:27.340-08:00On programmers and programming languages. Your opinion? This is a small article in which I want to talk about a couple of issues that I sometimes talk about with my colleagues at work, but most of the time keep to myself. These are two subjects that I would like to know the general software community’s opinion about.
The first thing is regarding the role of software developer and using different programming languages in your work.
The second Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com1tag:blogger.com,1999:blog-7855757415977257409.post-10635972078176039962012-09-14T06:17:00.001-07:002012-09-14T06:17:52.802-07:00JRuby transparently running methods asynchronously. Combining Ruby metaprogramming techiniques and Java concurrent FutureJRuby is great, it offers an opportunity to combine my two favorite languages and here is another great way of combining Java power with Ruby beauty and convenience.
In this case I created a small gem in a couple of hours (still not really well tested, just some simple unit tests) that allows to use some of the nice metaprogramming techniques from Ruby to transparently execute methods Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com0tag:blogger.com,1999:blog-7855757415977257409.post-75107189766750455222012-09-07T07:19:00.000-07:002012-09-07T07:19:39.303-07:00Setting up a Hadoop virtual cluster with VagrantUsually for testing and using virtual machines, I go online, download the iso image of the machine I want to install, start Virtual Box, tell it to init from the iso, and install the OS manually, and then install the applications I want to use.
It is a boring and tedious process but I never really cared very much about
However recently I discovered the power of Vagrant and also Puppet. They Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com2tag:blogger.com,1999:blog-7855757415977257409.post-37095849244505439732012-06-16T11:46:00.000-07:002012-06-16T11:46:48.716-07:00Simple MRI Ruby v JRuby performance comparison.The following is a very simplistic performance comparison running 2 program examples, running them with both MRI Ruby and JRuby, in the following categories:
Single threaded compute intensive.
Multi threaded compute intensive.
The compute intensive function is simply a O(n2) function that multiplies the inner loop index by the outer loop index in every iteration.
We will use Jruby version Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com0tag:blogger.com,1999:blog-7855757415977257409.post-16131039649251391792012-06-05T04:01:00.001-07:002012-06-13T07:14:49.605-07:00Using Java to access MongoDB, Redis, CouchDB, Riak, CassandraI had a requirement in my current job to persist some messages at different points in the running of the system. At the beggining we didn’t know the format in which the messages were going to be saved, where to save them or even which messages to save. Last weekend I started working on my own in a small library for persisting java objects in different datasources and with different formats so Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com0tag:blogger.com,1999:blog-7855757415977257409.post-39398385106651531592012-05-13T12:18:00.002-07:002012-05-13T12:25:17.126-07:00Beginners guide to the use of indexes for improving search performanceAs you know one of the most important techniques when designing your database schema or your searching enabled systems is the selection and creation of indexes for increasing the performance of your various queries. What you may not know is why and how indexes help.
An index is in simple terms an optimized data structure , that allows searching our original structure in a more efficient Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com0tag:blogger.com,1999:blog-7855757415977257409.post-20001064524000522782012-05-07T04:33:00.000-07:002012-05-07T04:33:48.680-07:00ruby-recommender gemI have just started developing a Ruby Gem for a recommendation engine based on concepts from Apache Mahout.
The gem is located in here github. At the moment it is very basic. An example of usage follows:
require 'recommendations'
def save_as_csv_file(file_path,values)
File.open(file_path,'w') do |file|
Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com0tag:blogger.com,1999:blog-7855757415977257409.post-19267284622683446512012-04-22T10:17:00.000-07:002012-04-22T10:17:32.339-07:00Creating a custom Spring 3 XML namespaceFor me historically maybe the least approachable part of the Spring Framework is the system to define custom XML schemas to use in the configuration files for defining beans (The ones like aop, security, integration , util, etc). I think this might be the case to most people as well. In this article I will show step by step how to create custom namespaces for their use with Spring. It won’t be a Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com1tag:blogger.com,1999:blog-7855757415977257409.post-63140282728513275322012-03-22T13:12:00.000-07:002012-03-22T13:12:01.120-07:00Injecting dependencies in RubyAlthough I have read various times that dependency injection is not needed in Ruby, it is a practice that I am very much used to thanks to the great Spring Framework and can't seem to make sense of any other way of doing things :).
In my current spare time application for example I needed to have a Recommender in my controller for recommending movies for the current user.
It works simply like Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com2tag:blogger.com,1999:blog-7855757415977257409.post-84962996784881623742012-03-04T03:43:00.003-08:002012-03-04T04:19:00.414-08:00Adding recommendations in RubyI am developing a small movies web application, and I wanted to add a simple but functional recommendation engine to it. So I started to work on it.
Algorithms and formulas from this post are based on the great book Algorithms of the Intelligent Web
Recommendations in applications are based on similarities. Similarities between two or more users, or similarity between two or more Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com0tag:blogger.com,1999:blog-7855757415977257409.post-24124658718377591132012-02-18T06:11:00.001-08:002012-02-18T06:11:51.330-08:00Basic searching in Ruby with SolrSolr is a server application built on top of the Apache Lucene searching engine. It offers a Http interface for storing and querying data.
Internally the way Solr roughly works (and Lucene as it is the engine that powers solr) is by indexing Documents for later searching and retrieval. A Document is described with a collection of Fields, each of this fields can be individually indexed and/Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com1tag:blogger.com,1999:blog-7855757415977257409.post-16459750592651809012012-02-05T10:31:00.000-08:002012-02-09T07:32:51.394-08:00Private Keys, Public Keys and CertificatesThis is a quick tutorial that will cover
- Generate a private key
- Generate a .cert certificate with that private key
- Extract the public key from the certificate.
- Sign a file with private key and verify the signature with the public key
- Import the private key and certificate into a java keystore.
1. Generate a private key
openssl genrsa -out private.key 1024
2. Generate Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com0tag:blogger.com,1999:blog-7855757415977257409.post-59713408529502849182012-01-05T07:04:00.000-08:002012-01-05T07:04:21.592-08:00Running a Ruby map-reduce job with HadoopI am currently developing and app in my spare time and needed to merge a file with itself to include movies that are both Romance and Comedy.
The file looked somthing like this:
movie-a Comedy
movie-b Comedy
movie-a Romance
I wanted to produce a file of the form
movie-a [Comedy,Romance]
Ignoring the movies that don't include both genres.
I inmediately thought of using hadoop, even Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com1tag:blogger.com,1999:blog-7855757415977257409.post-65229163373544346292011-12-16T04:55:00.000-08:002011-12-16T04:55:28.238-08:00Basic movement game AII really love to play video games, and for a while I’ve been wanting to learn a bit about video game programming mainly AI and physics.
I have just read the first 20 or so pages of the good book on AI Artificial Intelligence for Games
and I though I was going to try the first easy algorithms that are explained there. So here I will introduce a little bit of the simplest way to develop the seekAnonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com0tag:blogger.com,1999:blog-7855757415977257409.post-90566886172260535502011-09-11T13:25:00.000-07:002011-09-12T01:46:41.911-07:00Alternatives to Multi Threading for concurrency in Java. STM and ActorsIn the Java world we are used to work with concurrency dealing directly with Threads, Synchronization and Shared Data.
Java introduced a great deal of improvement in version 5 with the new concurrency facilities it provided, and had built on it in subsequent versions of the language.
These facilities are great and powerful, but they still can sometimes be hard to use correctly. I will cover Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com1tag:blogger.com,1999:blog-7855757415977257409.post-73984170581497454122011-07-03T14:43:00.000-07:002011-07-03T14:43:36.738-07:00Understanding the event driven model for concurrencyFor some time now there’s been this idea that the normal concurrent model for web applications that many of us are used to is not the best way to do things for large amounts of concurrent clients.
The model I’m talking about is of course the One Request - One Thread model . I started to read about it and the main concern show towards this model, is that it can’t scale very well to many requests Anonymoushttp://www.blogger.com/profile/05231758018563704360noreply@blogger.com0