<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nico Balestra &#124; Nico Balestra</title>
	<atom:link href="http://www.nicobalestra.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.nicobalestra.com</link>
	<description>Because sharing is a matter of living</description>
	<lastBuildDate>Sun, 03 Feb 2013 22:23:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Data Abstraction Definition</title>
		<link>http://www.nicobalestra.com/?p=346</link>
		<comments>http://www.nicobalestra.com/?p=346#comments</comments>
		<pubDate>Sun, 03 Feb 2013 22:01:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.nicobalestra.com/?p=346</guid>
		<description><![CDATA[Do yourself a favour, read the Structure and Interpretation of Computer Programs. It will teach you that: The general technique of isolating the parts of a program that deal with how data objects are represented from the parts of a &#8230; <a href="http://www.nicobalestra.com/?p=346">Continue reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>Do yourself a favour, read the Structure and Interpretation of Computer Programs. It will teach you that:</p>
<blockquote><p>The general technique of isolating the parts of a program that deal with how data objects are represented from the parts of a program that deal with how data objects are used is a powerful design methodology called <strong>data abstraction</strong>.</p></blockquote>
<p>In my opinion OOP doesn&#8217;t favour data abstraction.<br />
A class glues together data (attributes) and functions dealing with the data (methods). In functional programming languages, data and functions which operate on the data are kept separated promoting <strong>data abstraction</strong>.<br />
I read this definition while learning Scheme with the beautiful Structure and Interpretation of Computer Programs (which I recommend for you health and safety).<br />
Here, the explanation of functions and procedures (data manipulation) is kept separated from the explanation of how the data is represented, separation which should also be advocated in your source code.<br />
Any comment is more than welcome.. it will help me to understand more and more!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicobalestra.com/?feed=rss2&#038;p=346</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript: Set nested object property.</title>
		<link>http://www.nicobalestra.com/?p=330</link>
		<comments>http://www.nicobalestra.com/?p=330#comments</comments>
		<pubDate>Fri, 01 Feb 2013 10:38:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Object]]></category>

		<guid isPermaLink="false">http://www.nicobalestra.com/?p=330</guid>
		<description><![CDATA[Suppose you have a Javascript object with the following structure: and now suppose that your application is such that you need to set one of the attributes of the above object by pointing to that attribute through a Javascript path. &#8230; <a href="http://www.nicobalestra.com/?p=330">Continue reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>Suppose you have a Javascript object with the following structure:</p>
<pre class="brush: jscript; light: true; title: ; notranslate">
var obj = {firstname : &quot;Nico&quot;,
           lastname:   &quot;Balestra&quot;,
           hobbies: [{
                       name: &quot;Clojure&quot;,
                       since: &quot;01/03/2012&quot;
                     },
                     {name : &quot;Javascript&quot;,
                      since : &quot;01/01/2011&quot;}]
          };
 </pre>
<p>and now suppose that your application is such that you need to set one of the attributes of the above object by pointing to that attribute through a Javascript path.<br />
Because you work for a company using Serverside Javascript and you are not allowed to use any library of the like of jQuery, you need to find a way to achieve this yourself.<br />
Therefore, suppose you need to set the date of my Javascript hobby so that it starts the 01/01/2010.<br />
The path referring to that attribute would be obj.hobbies[1].since. So you would like to do something like:</p>
<pre class="brush: jscript; light: true; title: ; notranslate">
setAttribute(obj, &quot;hobbies[1].since&quot;, &quot;01/01/2010&quot;);
</pre>
<p>And this is the setAttribute function</p>
<pre class="brush: jscript; light: true; title: ; notranslate">
var setAttribute = function(object, path, value){
  var paths = path.split(&quot;.&quot;);

  var traverse = function(context, pathStack){
    var currPath = pathStack.shift();
    var arr = currPath.match(/\[\d*\]/);

    if (arr != null){
     var arrIdx = parseInt(arr[0].match(/\d+/)[0]);
     var newCurrPath = currPath.replace(/\[\d*\]/, &quot;&quot;);
     
     traverse(context[newCurrPath][arrIdx], pathStack);

     }else if ((typeof context[currPath]) == &quot;object&quot;){
	traverse(context[currPath], pathStack);
     }else{
	context[currPath] = value;
    }
  };
	
  traverse(object, paths);
       	
}
</pre>
<p>I hope this may be of any help.<br />
Nico</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicobalestra.com/?feed=rss2&#038;p=330</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>I&#8217;m on AWS</title>
		<link>http://www.nicobalestra.com/?p=324</link>
		<comments>http://www.nicobalestra.com/?p=324#comments</comments>
		<pubDate>Sat, 20 Oct 2012 12:19:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nicobalestra.com/?p=324</guid>
		<description><![CDATA[I&#8217;m gland (and proud) to announce that my blog is now hosted on Amazon EC2. I was running this blog on my personal laptop using NO-IP to reattach my dynamic IP to my domain every time my computer rebooted. The &#8230; <a href="http://www.nicobalestra.com/?p=324">Continue reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m gland (and proud) to announce that my blog is now hosted on Amazon EC2.</p>
<p>I was running this blog on my personal laptop using NO-IP to reattach my dynamic IP to my domain every time my computer rebooted.</p>
<p>The reason why I decided to move my blog on AWS is mainly because having a laptop running all day(s) long just to host a blog was a waste of money and energy. </p>
<p>AWS is free for the first year. Anyhow, given the traffic I will have on my blog it will be still cheaper than hosting it on my laptop.</p>
<p>AWS is great. It allows you to customize your environment at the nth power and it costs you only for the actual usage (the less people I will have on my blog, the less I will pay.. so please go away <img src='http://www.nicobalestra.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Moving WordPress from my laptop to AWS was a 10 years old game.<br />
Just run a mysqldump, copy all WordPress files with rsync (or scp if you prefer) and create the Apache VirtualHost and that&#8217;s it.</p>
<p>It took me few hours only because I had some issue setting up the users for MySQL.</p>
<p>If you are wondering why I&#8217;m running my blog on my own environment rather than running it on wordpress.com, these&#8217;re the answers:<br />
1. Challenges &#8211; I can do what WordPress is doing<br />
2. Data ownership &#8211; All data is mine and managed by me only&#8230; at some extent since everything is still hosted in the cloud.<br />
3. I might use this EC2 instance for other project.. still without spending a penny!</p>
<p>I&#8217;m a happier (and richer and more eco-friendly) man now <img src='http://www.nicobalestra.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Nico</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicobalestra.com/?feed=rss2&#038;p=324</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clojure : How to instantiate a record from a map</title>
		<link>http://www.nicobalestra.com/?p=234</link>
		<comments>http://www.nicobalestra.com/?p=234#comments</comments>
		<pubDate>Wed, 19 Sep 2012 22:10:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Clojure]]></category>

		<guid isPermaLink="false">http://www.nicobalestra.com/?p=234</guid>
		<description><![CDATA[If your Clojure program is using records to encapsulate data, you know how cumbersome is to create a new instance of a record. For example, in my little application I have a record Delivery : Now&#8230; create an instance of &#8230; <a href="http://www.nicobalestra.com/?p=234">Continue reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>If your Clojure program is using records to encapsulate data, you know how cumbersome is to create a new instance of a record.<br />
For example, in my little application I have a record Delivery :</p>
<pre class="brush: clojure; light: true; title: ; notranslate">
(defrecord
  Delivery [_id userdef-id to-address from-address subj content])</pre>
<p>Now&#8230; create an instance of <em>delivery</em> is a bit of a pain:</p>
<pre class="brush: clojure; light: true; title: ; notranslate">
(def my-delivery
   (Delivery. &quot;1223&quot; &quot;abc&quot; &quot;nico@gmail.com&quot; &quot;david.smith@gmail.com&quot; &quot;Test email&quot; &quot;the content&quot; ))</pre>
<p>The pain comes from the fact that you need to remember exactly the position of every single field of your delivery record and you have to specify nil whenever one of the record component is not available (keep reading for an example).</p>
<p>You know that a Delivery is inherently a map. Try this at your repl to prove it:</p>
<pre class="brush: clojure; title: ; notranslate">
user# (defrecord MyRecord [_id])
|user/MyRecord
user#(isa? MyRecord java.util.Map)
|true
</pre>
<p>This means you can treat a Clojure record as a map, hence you can merge a record with a map.<br />
If you want to make a record instantiation a bit handier, this is how you could do:</p>
<pre class="brush: clojure; light: true; title: ; notranslate">
(def my-delivery (merge (Delivery. []) {:_id &quot;234&quot; :content &quot;the content&quot;}))
</pre>
<p>Here I&#8217;m basically creating an empty Delivery and I&#8217;m merging it with a map containing only the fields of the record I need to set.<br />
The same declaration would otherwise be:</p>
<pre class="brush: clojure; light: true; title: ; notranslate">
(def my-delivery (Delivery [&quot;234&quot; nil nil nil nil &quot;the content&quot;}))
</pre>
<p>Using the <em>merge</em> approach you will be able to create a new record without specifying nil components. Also you won't have to care about the order of the record fields.</p>
<p>You could potentially create a macro in order to make this new pattern (way of creating a new record) part of your programming language (mighty macros!).</p>
<pre class="brush: clojure; title: ; notranslate">
(defmacro defdelivery [name the-map]
  `(def ~name (merge (Delivery. []) ~@the-map)))
</pre>
<p>This way you could create a new record using the following code:</p>
<pre class="brush: clojure; light: true; title: ; notranslate">(defdelivery my-delivery {:_id &quot;123&quot; :content &quot;the content&quot;})</pre>
<p>Neat eh?</p>
<p>I am not 100% sure this approach has any drawback since I&#8217;m not a hardcore clojure developer but please don&#8217;t hesitate to comment this post in case there&#8217;s anything we all need to know about this.</p>
<p>Nico</p>
<p>EDIT: Thanks to Tylor for pointing out that what I tried to achieve in this article has actually been introduced in Clojure 1.3 (<a href='http://dev.clojure.org/display/design/defrecord+improvements'>defrecord improvements</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicobalestra.com/?feed=rss2&#038;p=234</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>My first working (and trivial) Clojure program</title>
		<link>http://www.nicobalestra.com/?p=193</link>
		<comments>http://www.nicobalestra.com/?p=193#comments</comments>
		<pubDate>Sat, 28 Apr 2012 22:24:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.nicobalestra.com/?p=193</guid>
		<description><![CDATA[I would like to share with you the joy of being able to finally make something working in Clojure. This is a very simple program solving a very simple problem usually described in any IT University: palindrome detection. My solution &#8230; <a href="http://www.nicobalestra.com/?p=193">Continue reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>I would like to share with you the joy of being able to finally make something working in Clojure.<br />
This is a very simple program solving a very simple problem usually described in any IT University: palindrome detection.<br />
My solution is not the most elegant and short one but it gave me the possibility to practice with Vectors.<br />
Obviously any suggestion is more than welcome, thank you!</p>
<pre class="brush: clojure; title: ; notranslate">
(defn is-letter [letter]
  (and (&gt; (int letter) (int \A)) (&lt; (int letter) (int \z))))

(defn check-palindrome
  ([word] (let [length (count (seq word))
                letter-vector (vec (filter #(is-letter %1) (seq (.toUpperCase word))))]
                (check-palindrome  letter-vector 0 (- (count letter-vector) 1) )
          )
  )
  ([letters start end ]  (cond
                           (&lt; end start) (Exception. &quot;The string is NOT a palindrome&quot;)
                           (not (= (letters start) (letters end))) (Exception. &quot;The word is NOT a palindrome&quot;)
                           (or (= start end) (= 1 (- end start))) (println &quot;The string is a palindrome&quot;)

                     :else  (recur letters (inc start) (dec end)))
   )
 )
 
(check-palindrome &quot;Murder, for a jar of red rum&quot;)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.nicobalestra.com/?feed=rss2&#038;p=193</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Which mobile phone do you think Einstein would own?</title>
		<link>http://www.nicobalestra.com/?p=180</link>
		<comments>http://www.nicobalestra.com/?p=180#comments</comments>
		<pubDate>Wed, 18 Apr 2012 18:41:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nicobalestra.com/?p=180</guid>
		<description><![CDATA[I was joking with my colleagues today about which one is the best between iPhone and Android. One of my colleagues said: Based on a statistic (no origin provided ) iPhone owners are wiser. Then I asked: What do you &#8230; <a href="http://www.nicobalestra.com/?p=180">Continue reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>I was joking with my colleagues today about which one is the best between iPhone and Android.<br />
One of my colleagues said: Based on a statistic (no origin provided <img src='http://www.nicobalestra.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) iPhone owners are wiser.<br />
Then I asked: What do you think Einstein would own?<br />
<strong>Silence!</strong> <img src='http://www.nicobalestra.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>As you might guess, my answer was Android. Android phones are customizable, are varied, are open (kinda of) so to me the answer was obvious.</p>
<p>Einstein would have been able to disclose his mobile phone&#8217;s source code, he would have been able to create applications on it <strong>for free</strong> using any computer he wanted (I wonder if he would own a Mac), he would have been able to fix bugs on his mobile himself. He would have been able to store files on his mobile phone using ANY computer without installing any software. And finally he would have been able to make his phone <strong>his</strong> unique phone, different from anyone else&#8217;s. That&#8217;s why I think he would have chosen an Android phone.</p>
<p>Now, I&#8217;m very curious to know what others think about this. So, please give me (and the community) your feedback and let&#8217;s see if my colleague was right.</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
]]></content:encoded>
			<wfw:commentRss>http://www.nicobalestra.com/?feed=rss2&#038;p=180</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Java is not n. 1 language! Wonder which one is it now? Read through&#8230;.</title>
		<link>http://www.nicobalestra.com/?p=171</link>
		<comments>http://www.nicobalestra.com/?p=171#comments</comments>
		<pubDate>Mon, 16 Apr 2012 22:29:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.nicobalestra.com/?p=171</guid>
		<description><![CDATA[Based on the TIOBE Programming Community index, Java is not the number one language in terms of popularity any more. This index is calculated monthly and it&#8217;s based on the number of Skilled engineers world-wide and the number of vendors. &#8230; <a href="http://www.nicobalestra.com/?p=171">Continue reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>Based on the TIOBE Programming Community index, Java is not the number one language in terms of popularity any more.</p>
<p>This index is calculated monthly and it&#8217;s based on the number of Skilled engineers world-wide and the number of vendors.</p>
<p>Java has been surpassed by&#8230; <strong>C</strong>! Yes&#8230; You read it well.</p>
<p>I&#8217;m really astounded by the news that such an &#8220;old&#8221; language is still so popular, but for some reason this really pleases me.</p>
<p>I only hope that some other language will take the lead soon (clojure?? <img src='http://www.nicobalestra.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>Anyway, for a deeper analysis on this new change of the lead in the programming languages panorama, this is the place to go: <a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html">TIOBE Index</a></p>
<p>nico<br />
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicobalestra.com/?feed=rss2&#038;p=171</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Why I&#8217;ve chosen to learn Clojure</title>
		<link>http://www.nicobalestra.com/?p=148</link>
		<comments>http://www.nicobalestra.com/?p=148#comments</comments>
		<pubDate>Mon, 16 Apr 2012 00:28:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.nicobalestra.com/?p=148</guid>
		<description><![CDATA[I&#8217;m a technical consultant and I work on a quite closed platform. This means that I don&#8217;t have much exposure to cutting edge technologies hence new programming languages. That&#8217;s why in order to keep my skills up to date I &#8230; <a href="http://www.nicobalestra.com/?p=148">Continue reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m a technical consultant and I work on a quite closed platform. This means that I don&#8217;t have much exposure to cutting edge technologies hence new programming languages. That&#8217;s why in order to keep my skills up to date I have to be proactive and learn new stuff on my own.<br />
After a year working with the same technologies, it was time to start learning something new. I come from a Java background even if I&#8217;m currently developing mainly in Javascript (E4X) and SQL (You are wondering how they mix together, aren&#8217;t you?). I&#8217;ve taken into consideration and I&#8217;ve even tried to learn languages such as Perl, Python or Ruby but I&#8217;ve never felt particularly &#8220;excited&#8221;. Perl was too messy in my humble opinion. Too many things could be made in many different ways. I found the syntax and the number of keywords really frustrating and very very difficult to read. In other words I didn&#8217;t enjoy it (even though I was fascinated by the idea of talking regex).</p>
<p>On the other hand I quite liked Python. The syntax is very clean, the language together with its vast core library is very powerful and there&#8217;s a big community around it which makes extremely easy to learn this wonderful language.</p>
<p>However it wasn&#8217;t enough. I was really looking for something new, something which could finally satisfy my continuous research for the &#8220;new&#8221;. The thing is, Java, Python, Perl, Ruby and so forth, they all share one thing in common: <strong>They all are imperative languages</strong>. This means that even if I was going to learn a new syntax and new libraries, I was already able to predict what the language was going to be like.</p>
<p>Imperative languages are so called because they are made of &#8220;statements&#8221; which instruct (order!) the machine &#8220;how&#8221; to do certain things to accomplish a particular task. Therefore, programming using imperative languages means creating programs which execute by changing their behaviour during the execution flow. So, even though I was going to learn a new language, I was not going to learn a new paradigm.. a new &#8220;way&#8221; to solve problems.</p>
<p>I&#8217;m not criticising all the aforementioned programming languages (who am I to dare?) but I&#8217;m just saying that I really wanted to see the art of programming from another perspective.</p>
<p>As you might know, programming languages are divided into two main categories:</p>
<ol>
<li>Imperative Languages</li>
<li>Declarative Languages</li>
</ol>
<p>Declarative languages comprise all languages which achieve a given task by declaring what results to obtain by their execution, without any mention on how to achieve such a result. I finally found what I was looking for.. a different (but far from new) approach to problem solving. Functional programming falls into the category of declarative languages and since it seems to be the new trend, I&#8217;ve decided to give it a go.</p>
<p>The most popular functional programming languages at the time of writing seem to be Heskell, Scala, Clojure, Scheme, F#, Erlang (and sorry if I forgot any).</p>
<p>All the people who were learning functional languages were interested to Heskell or Scala so I decided to go for&#8230; Clojure of course <img src='http://www.nicobalestra.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Clojure is a fairly new language which is based on a very old functional programming language I didn&#8217;t have the pleasure to study at uni (my teachers thought that Pascal was better!!). I&#8217;ve also heard in a couple of podcast that&#8217;s a challenging and very interesting language. So, here I am!!</p>
<p>I know, it&#8217;s not a &#8220;noble&#8221; reason to start learning a new language but I don&#8217;t regret it and after all I&#8217;m doing this for &#8220;fun&#8221;.</p>
<p>Now, I have started learning Clojure a couple of weeks ago and these are the main features of this fantastic language I&#8217;ve been able to grasp so far (I&#8217;m surely forgetting something):</p>
<ol>
<li>Rich Hickey was its inventor in 2007. Someone says he is set to be one of the most influential software developer in the IT panorama.</li>
<li>Clojure is a (non-pure) functional programming language (doh!). This means that in Clojure functions are first-class objects. You can pass objects as argument to a function and functions can return other functions as result of their computation.</li>
<li>Clojure runs on top of the JVM. This means you can potentially compile a Clojure script into a .class file and run it everywhere (that&#8217;s the Java motto at least).</li>
<li>As a consequence of point 2, data in Clojure is immutable. If you pass a list of values to a function, you&#8217;re guaranteed that the function will not change the content of the list.  This is a very important aspect with relation to concurrent programming in a multicore environment which is going to be thread safe (enforced by the language) with no need of locks.</li>
<li>Clojure is almost syntax-less. All you have to do is working with s-foms (basically lists) at all time. Being a functional programming language, source code in Clojure represents the data your program is going to process.</li>
<li>I was almost forgeting. Clojure is the most recent dialect of Lisp.</li>
</ol>
<p>I apologise to all the &#8220;purist&#8221; if this article sounds a bit unformal but I hope my next articles on Clojure will be.</p>
<p>What do you think about Clojure? Is there anything you would like to add or crticicize?</p>
<p>I promise, unless you are a spammer, your comments won&#8217;t be deleted <img src='http://www.nicobalestra.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Nico</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicobalestra.com/?feed=rss2&#038;p=148</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML TextArea can&#8217;t be a self closing tab</title>
		<link>http://www.nicobalestra.com/?p=129</link>
		<comments>http://www.nicobalestra.com/?p=129#comments</comments>
		<pubDate>Tue, 27 Mar 2012 21:40:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Developing]]></category>

		<guid isPermaLink="false">http://www.nicobalestra.com/?p=129</guid>
		<description><![CDATA[Hi all!! Recently, I have been asked to modify the dynamically generated web page I worked on in order to have it generating TextAreas together with Inputs. The web page meta information is stored into an XML. The back-end uses &#8230; <a href="http://www.nicobalestra.com/?p=129">Continue reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>Hi all!!</p>
<p>Recently, I have been asked to modify the dynamically generated web page I worked on in order to have it generating TextAreas together with Inputs.</p>
<p>The web page meta information is stored into an XML. The back-end uses E4X Javascript as a serverside language so storing the page definition into an XML document was the natural choice.<br />
Having said that, I eventually had to change my JS code in order to store a TextView into this XML in a way similar to this:</p>
<p><code>myXML.myTextArea = &lt;textarea rows="20" cols="10"&gt;</code></p>
<p>Afterwards my code would do this to render the textArea:</p>
<p><code>&lt;%== myXML.myTextArea %&gt;</code></p>
<p>Well.. pretty straightforward, right?</p>
<p>The problem is that this code would generate the following HTML:</p>
<p><code>&lt;textArea cols="10" rows="10"/&gt;</code></p>
<p>Unfortunately the HTML above doesn&#8217;t work since most of the browsers will interpret a self closing TextArea as an open tag (roughly). Apparently this is a bug at least in Chrome and Firefox and I&#8217;ve been able to reproduce it in IE9 as well.</p>
<p>This is how such a TextArea would look like:</p>
<div id="attachment_131" class="wp-caption aligncenter" style="width: 410px"><a href="http://nicobalestra.com/wp-content/uploads/2012/03/TextArea.png"><img class="size-medium wp-image-131" title="TextArea" src="http://nicobalestra.com/wp-content/uploads/2012/03/TextArea-300x99.png" alt="How self closing textArea looks." width="400" height="150" /></a><p class="wp-caption-text">Self closing textArea</p></div>
<p>&nbsp;</p>
<p>The (all but orthodox) way I&#8217;ve managed to solve this is this (don&#8217;t laugh, please <img src='http://www.nicobalestra.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> :<br />
<code><br />
&lt;%== myXML.myTextArea.toXMLString().replace("/&gt;", "&gt;&lt;/textArea&gt;") %&gt;<br />
</code></p>
<p>So, whenever you have to use a textArea (either generated from an XML as in my case, or manually written) don&#8217;t forget:<br />
<strong>TextArea can&#8217;t be a self closing tab <span style="text-decoration: underline;">(at least for now)</span></strong>.</p>
<p>Nico</p>
<p><script type="text/javascript">// <![CDATA[
      hopfeed_affiliate='nicoletto';     hopfeed_affiliate_tid='';     hopfeed_cellpadding='5';     hopfeed_font='Lucida, Lucida Grande, Lucida bright';     hopfeed_font_size='10pt';     hopfeed_font_color='#000000';     hopfeed_tab1_title='Software Development';     hopfeed_tab2_title='Java';     hopfeed_tab3_title='Android';     hopfeed_tab1_keywords='programming web software development';     hopfeed_tab2_keywords='java development jee';     hopfeed_tab3_keywords='android google mobile';     hopfeed_template_name='DEFAULT';     hopfeed_active_tab_color='#11527B';     hopfeed_inactive_tab_color='#D1DCEE';     hopfeed_active_tab_font_color='#FFFFFF';     hopfeed_inactive_tab_font_color='#000000';     hopfeed_hover_color='#D1DCEE';     hopfeed_border_color='#11527B';     hopfeed_align='center';     hopfeed_width='300';     hopfeed_rows='5';     hopfeed_fill_slots='true';     hopfeed_link_target='_blank';     hopfeed_path='http://nicoletto.hopfeed.com';
// ]]&gt;</script><br />
<script type="text/javascript" src="http://nicoletto.hopfeed.com/script/hopfeed_widget.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicobalestra.com/?feed=rss2&#038;p=129</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OwnCloud</title>
		<link>http://www.nicobalestra.com/?p=116</link>
		<comments>http://www.nicobalestra.com/?p=116#comments</comments>
		<pubDate>Fri, 16 Mar 2012 20:48:31 +0000</pubDate>
		<dc:creator>nicobalestra</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://nicobalestra.com/?p=116</guid>
		<description><![CDATA[If you are worried of your data being spread on the internet and if you&#8217;re not 100% sure on how your data is actually handled by the giant (google), here&#8217;s a solution for you. I&#8217;m sure this is not new &#8230; <a href="http://www.nicobalestra.com/?p=116">Continue reading &#8594;</a>]]></description>
				<content:encoded><![CDATA[<p>If you are worried of your data being spread on the internet and if you&#8217;re not 100% sure on how your data is actually handled by the giant (google), here&#8217;s a solution for you.</p>
<p>I&#8217;m sure this is not new for most of you but maybe I&#8217;ll catch that 1% not yet aware of.</p>
<p>OwnCloud is a web application you can install on your linux box which you can use as your own cloud (indeed).</p>
<p>All the services you get from most of the cloud services available for free (document sharing, file sharing, calendar sharing) are going to be available through this fantastic free and open source application.</p>
<p>All you need is:</p>
<p>Install the app on your linux box. It&#8217;s a very easy process and well documented on <a title="OwnCloud" href="http://www.owncloud.org" target="_blank">www.owncloud.org</a></p>
<p>If you, like me, are using a broadband service with dynamic ip definition, you need to set up a service (no-ip for example) to dynamically associate the changing IP address to a domain you previously bought.</p>
<p>And that&#8217;s it.. your own private cloud is there.. ready to be shared only with people you trust and being sure that no one is gonna have a look at your bank account details <img src='http://www.nicobalestra.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Just make sure to backup your date regularly or even better to buy a raid hardrive for the peace of mind. After all your privacy is priceless!!</p>
<p>&nbsp;</p>
<p>Nico</p>
<p><script type="text/javascript">
    hopfeed_affiliate='nicoletto';
    hopfeed_affiliate_tid='';
    hopfeed_cellpadding='5';
    hopfeed_font='Lucida, Lucida Grande, Lucida bright';
    hopfeed_font_size='10pt';
    hopfeed_font_color='#000000';
    hopfeed_tab1_title='Software Development';
    hopfeed_tab2_title='Java';
    hopfeed_tab3_title='Android';
    hopfeed_tab1_keywords='programming web software development';
    hopfeed_tab2_keywords='java development jee';
    hopfeed_tab3_keywords='android google mobile';
    hopfeed_template_name='DEFAULT';
    hopfeed_active_tab_color='#11527B';
    hopfeed_inactive_tab_color='#D1DCEE';
    hopfeed_active_tab_font_color='#FFFFFF';
    hopfeed_inactive_tab_font_color='#000000';
    hopfeed_hover_color='#D1DCEE';
    hopfeed_border_color='#11527B';
    hopfeed_align='left';
    hopfeed_width='300';
    hopfeed_rows='5';
    hopfeed_fill_slots='true';
    hopfeed_link_target='_blank';
    hopfeed_path='http://nicoletto.hopfeed.com';
</script><br />
<script type="text/javascript" src='http://nicoletto.hopfeed.com/script/hopfeed_widget.js'></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nicobalestra.com/?feed=rss2&#038;p=116</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
