Saturday, February 26, 2011

History of open source licensing

The open source software movement traces its history to the formation of the Free
Software Foundation ("FSF") in 1985 by Richard Stallman. Free Software is more of an ideology that emphasizes the freedom users have with the source code  and  not  with  the price one pays for the software. In essence, free software is an attempt to guarantee certain rights for both, users and developers. These freedoms include:

  • Freedom to execute the program for any reason
  • Freedom to examine the source code, see how it works and change it to do what you would like it to do
  • Freedom to redistribute the source and keep the money generated from it
  • Freedom to modify and redistribute the modified source code

In order to guarantee these freedoms the GNU General Public License (GPL) was created. In short any software licensed under GPL must include the source code. Any modifications made to a GPL source code  will also be  licensed under GPL. This was to ensure that software once "opened" to the community could not be "closed" at a later time.

In 1998 a non-profit institution called Open Source Initiative (OSI) defined the term "open source software" to emphasize a break with the anti-business past associated with GNU to place a new emphasis in the community on the possibilities of extending the free software model to the commercial world. The OSI does not define a specific license as GPL but lays down the pre-requisites of the distribution terms of open source software. It thereby accepts various licenses whose distribution terms comply with the Open Source Definition (OSD). There are ten criteria mentioned at the OSI Web site
( The main intentions for the OSD are described in the article "Open source licensing, Part 1: The intent" [1] by Martin Streicher and are summarized in Table below


Read more at Getting started with Open source development

Friday, February 11, 2011

Open source business model

Understanding the economics behind how open source operates can be interesting in
itself! You've probably heard the saying "There’s no such thing as a free lunch". Do you think this applies to open source? Are the users of open source software getting a free lunch?

If the creators of open source software are giving their users a free lunch, then how do they themselves earn a living or even be profitable? You might  be  asking yourself "Why should this matter to me as  developer?" Strictly speaking, at this point you can choose not to bother; however, from  my experience, this knowledge will help you understand some of the nuances behind why communities and companies do what they do. You may use this knowledge to your advantage, and perhaps use it as a  guide  towards  your success when you start your own open source project!

The big picture

An  open source business model is  a model used by companies that are involved in the development of open source software to keep themselves financially viable and successful. In fact today these companies compete with traditional proprietary software companies for investor’s money on the stock markets. Traditional software companies get revenue by the sale of the software they create, that is, they earn money for each copy of the software sold.

As illustrated in the Figure below, traditional software business models monetize software by either directly selling software products or by providing software development services.
How about open source software companies? Stepping back into the evolution of open source software, it is fair enough to say that the initial roots of open source software were sowed by either community projects which had mutual sharing as their main concern (over business ambitions) as in the case of the GNU project, or funded by government contractsas in the case of BSD UNIX. However as open source software usage progressed to the extent that many of  them were viable alternatives to  their commercial counterparts, commercial software companies became interested  in  finding ways by which they could promote,  develop  and monetize  open source software.
During this period many startup companies emerged,  such as Red  Hat. Red Hat  focuses on the development and promotion of the Linux open source software, building their revenue and profits around it.
These companies  began  to explore new economic  models, different from  traditional commercial software to succeed in the competitive software market.

This phase  – companies involved in the development and promotion of open source
software – has lasted for around a decade or more now. Today there are probably very few domains  of  product  software from operating systems to  Business Intelligence, in which there are no commercial companies promoting open source communities and  their software. Studies have been carried out by groups to find out the various economic models employed by these companies. The top four models are illustrated in this Figure
Read more at Getting started with Open source development

Wednesday, February 9, 2011

Partioning a Number Sequence in Clojure

I have the following input:

(def nums [123456789012 123456789012])

I'd like the following output:

[[1234 5678 9012] [1234 5678 9012]]

Note both of these sequence contain numbers not strings...

I figured this would be really simple by doing the following:

Convert each entry into a String
Partition each string by 4
Convert each partition back into an integer

Attempt 1:

(defn split-nums [nums factor]
       (fn [x] (Integer/valueOf (str x)))
       (partition factor (str %)))

(println (split-nums nums, 4))

When I run this I get the following error:

Caused by: java.lang.NumberFormatException: For input string: "clojure.lang.LazySeq@4834333c"
Which tells me I am dealing with a lazy sequence that I need to force evaluation on but when I try to (str (doall x)) I get the same result.

Attempt 2:

A version with / and mod. This also fixes leading zeros problem.

(defn int-partition [num size]
   (let [f (int (Math/pow 10 size))]
      (loop [n num l ()]
         (if (zero? n) 
            (vec l) 
            (recur (int (/ n f)) (conj l (mod n f)))))))

(defn split-nums [nums factor] (vec (map #(int-partition % factor) nums)))

Attempt 3:

(defn split-nums [nums factor]
  (map #(map (fn [x] (Integer/valueOf (apply str x))) ; apply str
             (partition factor (str %)))
(str (lazy-seq [1])) ; "clojure.lang.LazySeq@20"

(apply str (lazy-seq [1])) ; "1"

I'd probably write it to accept one number, then use map, instead of taking a coll.

(defn split-number [n factor]
  (->> (str n)
       (partition-all factor) ;; or partition
       (map (partial apply str))
       (map #(Integer/valueOf %))))
(map #(split-number % 4) [12345678 12345678]) ;; => ((1234 5678) (1234 5678))