<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Programming on Saleem Ansari</title>
    <link>/tags/programming/</link>
    <description>Recent content in Programming on Saleem Ansari</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>(c) 2024 Saleem Ansari</copyright>
    <lastBuildDate>Thu, 21 Feb 2013 00:00:00 +0000</lastBuildDate>
    <atom:link href="/tags/programming/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>SBT and Specs for BDD in Scala</title>
      <link>/2013/02/21/sbt-and-specs-for-bdd-in-scala/</link>
      <pubDate>Thu, 21 Feb 2013 00:00:00 +0000</pubDate>
      <guid>/2013/02/21/sbt-and-specs-for-bdd-in-scala/</guid>
      <description>I had used RSpec earlier for Behaviour Development Development for a Ruby on Rails project. Today I learnt how to do BDD in Scala.&#xA;Chapter 4 of Programming Scala introduces Traits and Specs for testing the code. Here is how I set it up:&#xA;I already had Scala installed. So the first step was to setup sbt ( Simple Build Tool for Scala ). Setup was easy ( described in detail here ):</description>
    </item>
    <item>
      <title>Scala script tool seems to be broken Fedora 17</title>
      <link>/2013/02/20/scala-script-tool-seems-to-be-broken-fedora-17/</link>
      <pubDate>Wed, 20 Feb 2013 00:00:00 +0000</pubDate>
      <guid>/2013/02/20/scala-script-tool-seems-to-be-broken-fedora-17/</guid>
      <description>I am running Scala on Fedora 17 and I seem to face a problem. I created a /tmp/hello.scala file, as follows:&#xA;println(&amp;quot;Hello world&amp;quot;) This works just fine if I run it on Ubuntu 12.04 i.e. it prints Hello world. However, when I try to run it on Fedora, I don&amp;rsquo;t get any output and the script keeps waiting forever.&#xA;So I tried to inspect what&amp;rsquo;s happening here:&#xA;$ bash -x scala /tmp/hello.</description>
    </item>
    <item>
      <title>Set up for learning Scala with Emacs</title>
      <link>/2013/02/18/set-up-for-learning-scala-with-emacs/</link>
      <pubDate>Mon, 18 Feb 2013 00:00:00 +0000</pubDate>
      <guid>/2013/02/18/set-up-for-learning-scala-with-emacs/</guid>
      <description>Obviously the first step is to install Scala language.&#xA;$ sudo aptitude install scala OR $ yum install scala Then I ran my first Scala &amp;ldquo;Hello world!&amp;rdquo; program from CLI.&#xA;Setting up Scala mode for Emacs was a bit of a pain so I merged the old scala-mode and the latest into my repo. Here are very simple steps to setup scala-mode for Emacs.&#xA;$ cd ~/.emacs.d/ $ git clone git://github.</description>
    </item>
    <item>
      <title>XML, RSS, ATOM and Java</title>
      <link>/2012/10/03/xml-rss-atom-and-java/</link>
      <pubDate>Wed, 03 Oct 2012 00:00:00 +0000</pubDate>
      <guid>/2012/10/03/xml-rss-atom-and-java/</guid>
      <description>I was searching for ways to generate xml feeds ( ATOM / RSS ) using Java. It appeared to be trivial task but its not. There are so many different libraries in Java which are capable of reading and writing XML in Java that it became a daunting task to evaulate them. After a bit of experimentation I have settled down with JDOM. JDOM is so simple to use.&#xA;On top of that, ROME tools make it even easier to read/write feeds using Java.</description>
    </item>
    <item>
      <title>C&#43;&#43; inheritance and function overloading</title>
      <link>/2010/07/17/c-inheritance-and-function-overloading/</link>
      <pubDate>Sat, 17 Jul 2010 00:00:00 +0000</pubDate>
      <guid>/2010/07/17/c-inheritance-and-function-overloading/</guid>
      <description>Here is a simple looking C++ program, which has two classes A and B ( which derives from A ). A has a function fun() which B tries to overload as fun(int). Sounds simple and the program looks correct but it doesn&amp;rsquo;t compile. Have a look at http://codepad.org/NQ3JNuRr .&#xA;Its hard to digest for it is an obvious code to compile in C++. The code listing is as below:&#xA;#include&amp;lt;iostream&amp;gt; using namespace std; class A{ public: void fun(){cout&amp;lt;&amp;lt;&amp;#34;fun\n&amp;#34;;} }; class B: public A{ void fun(int i){cout&amp;lt;&amp;lt;&amp;#34;funB\n&amp;#34;;} }; int main() { B b; b.</description>
    </item>
    <item>
      <title>Finding duplicate files on your system?!</title>
      <link>/2007/09/04/finding-duplicate-files-on-your-system/</link>
      <pubDate>Tue, 04 Sep 2007 00:00:00 +0000</pubDate>
      <guid>/2007/09/04/finding-duplicate-files-on-your-system/</guid>
      <description>I ( and many others ) have a lot media files ( mp3, jpg, avi, etc. ) lying around in the system. I wondered that how shall I get the list of all the duplicate files lying in my computer. Writing a script in Ruby which identifies the duplicate files using the MD5 hash values of the files contents, was no difficult a task. Here is the script.&#xA;#!/usr/bin/ruby ## This file finds all the duplicate files form a directory given ## at the command line.</description>
    </item>
    <item>
      <title>Learning Ruby</title>
      <link>/2007/09/04/learning-ruby/</link>
      <pubDate>Tue, 04 Sep 2007 00:00:00 +0000</pubDate>
      <guid>/2007/09/04/learning-ruby/</guid>
      <description>Ruby - The Programming Language&#xA;Here a few links that are good as a first look while learning Ruby.&#xA;General:&#xA;http://blade.nagaokaut.ac.jp/ruby/ruby-talk/index.shtml http://www.ruby-lang.org/ http://www.37signals.com/ http://www.ruby-doc.org http://api.rubyonrails.com/ http://www.ruby-forum.com/ http://www.rubyforums.com/forumdisplay.php?f=1 http://www.sitepoint.com/forums/forumdisplay.php?f=227 http://railsforum.com/ http://www.rubyinside.com/ http://redhanded.hobix.com/ http://www.rubyist.net/~matz/ http://www.planetrubyonrails.com/ :symbols in Ruby&#xA;http://glu.ttono.us/articles/2005/08/19/understanding-ruby-symbols http://onestepback.org/index.cgi/Tech/Ruby/SymbolsAreNotImmutableStrings.red Writing daemons&#xA;http://daemons.rubyforge.org/classes/Daemonize.html more to come&amp;hellip;</description>
    </item>
    <item>
      <title>Emacs: the GNU&#39;s editor</title>
      <link>/2007/08/20/emacs-the-gnus-editor/</link>
      <pubDate>Mon, 20 Aug 2007 00:00:00 +0000</pubDate>
      <guid>/2007/08/20/emacs-the-gnus-editor/</guid>
      <description>I have been using Vim editor for past ( almost ) four years, but now I have switched over to Emacs. I find it more intuitive ( just a personal opinion ). While I was learning Emacs I had few queries. So, I have prepared a small HOWTO which might help a new emacs user.&#xA;HowTo Colorize the syntax? M-x font-lock-mode Here M is the Meta key, which may be Alt or Esc (top-left corner of the keyboard).</description>
    </item>
  </channel>
</rss>
