<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Scala on Saleem Ansari</title>
    <link>/tags/scala/</link>
    <description>Recent content in Scala on Saleem Ansari</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>(c) 2024 Saleem Ansari</copyright>
    <lastBuildDate>Tue, 08 Dec 2015 10:07:23 -0800</lastBuildDate>
    <atom:link href="/tags/scala/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>ScalaQuine</title>
      <link>/2015/12/08/scalaquine/</link>
      <pubDate>Tue, 08 Dec 2015 10:07:23 -0800</pubDate>
      <guid>/2015/12/08/scalaquine/</guid>
      <description>A Scala quine ( program that prints itself ):&#xA;$ cat ScalaQuine.scala Here it is:&#xA;object ScalaQuine extends App { val x = &amp;quot;&amp;quot;&amp;quot;object ScalaQuine extends App {%c val x = %c%c%c%s%c%c%c%c println(x.format(&#39;\n&#39;, &#39;\&amp;quot;&#39;, &#39;\&amp;quot;&#39;, &#39;\&amp;quot;&#39;, x, &#39;\&amp;quot;&#39;, &#39;\&amp;quot;&#39;, &#39;\&amp;quot;&#39;, &#39;\n&#39;, &#39;\n&#39;))%c}&amp;quot;&amp;quot;&amp;quot; println(x.format(&#39;\n&#39;, &#39;\&amp;quot;&#39;, &#39;\&amp;quot;&#39;, &#39;\&amp;quot;&#39;, x, &#39;\&amp;quot;&#39;, &#39;\&amp;quot;&#39;, &#39;\&amp;quot;&#39;, &#39;\n&#39;, &#39;\n&#39;)) } Compile and run:&#xA;$ scalac ScalaQuine.scala $ scala ScalaQuine Same as original program:&#xA;object ScalaQuine extends App { val x = &amp;quot;&amp;quot;&amp;quot;object ScalaQuine extends App {%c val x = %c%c%c%s%c%c%c%c println(x.</description>
    </item>
    <item>
      <title>Writing two books with AsciiDoc: Apache Mahout and Scala</title>
      <link>/2014/07/20/writing-two-books-with-asciidoc-apache-mahout-and-scala/</link>
      <pubDate>Sun, 20 Jul 2014 11:24:05 -0700</pubDate>
      <guid>/2014/07/20/writing-two-books-with-asciidoc-apache-mahout-and-scala/</guid>
      <description>For past few weeks I have been gathering my notes on two topics: Machine Learning with Apache Mahout and Programming in Scala. Now I have created two repositories for these two books, with source-code in AsciiDoc format. They are avilable on GitHub.&#xA;Machine Learning with Apache Mahout Programming in Scala Read on!</description>
    </item>
    <item>
      <title>OAuth2.0 Server using Play! 2.0 Framework in Scala</title>
      <link>/2014/07/09/oauth2.0-server-using-play-2.0-framework-in-scala/</link>
      <pubDate>Wed, 09 Jul 2014 05:33:56 -0700</pubDate>
      <guid>/2014/07/09/oauth2.0-server-using-play-2.0-framework-in-scala/</guid>
      <description>OAuth2.0 supercedes OAuth1.0 protocol, specifically in making it simpler to use. It supports different workflows as described in its specification RFC-6749. The most concise pictorial representation I found is here.&#xA;I created a Play! 2.0 Application in Scala which supports server to server token exchange using OAuth2.0 Protocol. You can find the project source code on GitHub at play-oauth2-server. Its a complete working server codebase, with:&#xA;Basic User login Client registration with Callback URL Auth Code generation Authentication Token and Refresh Token generation This application also demonstrates the following:</description>
    </item>
    <item>
      <title>Creating Desktop Shortcuts for Scala IDE on Linux</title>
      <link>/2014/06/10/creating-desktop-shortcuts-for-scala-ide-on-linux/</link>
      <pubDate>Tue, 10 Jun 2014 02:18:11 -0700</pubDate>
      <guid>/2014/06/10/creating-desktop-shortcuts-for-scala-ide-on-linux/</guid>
      <description>Download the Scala IDE from here, unzip it at ~/software/scala-eclipse, such that the contents look as follows:&#xA;$ pwd /home/saleem/software/scala-eclipse $ ls artifacts.xml configuration eclipse eclipse.ini epl-v10.html features icon.xpm META-INF notice.html p2 plugins readme Create a launcher script for Scala IDE /bin/scala-ide, and make it executable:&#xA;$ cat /bin/scala-ide #!/bin/bash /home/saleem/software/scala-eclipse/eclipse $ chmod +x /bin/scala-ide Configure launcher icon ~/.local/share/applications/scala-ide.desktop. You can copy a config file from /usr/share/applications/ directory and make changes as follows:</description>
    </item>
    <item>
      <title>Machine Learning with Mahout and Scala</title>
      <link>/2014/06/03/machine-learning-with-mahout-and-scala/</link>
      <pubDate>Tue, 03 Jun 2014 22:27:10 -0700</pubDate>
      <guid>/2014/06/03/machine-learning-with-mahout-and-scala/</guid>
      <description>This post is coming after a long time. Apologies for that.&#xA;Alright, this one is for the fans of Apache Mahout and Scala programming language. I had given a talk on Machine Learning with Apache Mahout and Scala ( slides ) at OSDConf.in. The code examples are present on GitHub at this repo.</description>
    </item>
    <item>
      <title>Scala at BootConf 2014</title>
      <link>/2014/03/23/scala-at-bootconf-2014/</link>
      <pubDate>Sun, 23 Mar 2014 00:23:46 +0530</pubDate>
      <guid>/2014/03/23/scala-at-bootconf-2014/</guid>
      <description>I attended BootConf 2014 today.&#xA;The day began with Arduino for Robotics by Naveen Kumar. It was such a wonderful 1 hour session, purely demo based, and very interactive. Second talk was Varnish Caching Server by Vivek Gupta. Vivek explanined how a caching server fits in a clustered environment and what all things that we can do with Varnish.&#xA;Next was my talk Introduction to Scala. You can find the slides here, and all the code for demo at this GitHub repository.</description>
    </item>
    <item>
      <title>A simple Scala parser to parse 44GB Wikipedia XML Dump</title>
      <link>/2014/02/03/a-simple-scala-parser-to-parse-44gb-wikipedia-xml-dump/</link>
      <pubDate>Mon, 03 Feb 2014 00:00:00 +0000</pubDate>
      <guid>/2014/02/03/a-simple-scala-parser-to-parse-44gb-wikipedia-xml-dump/</guid>
      <description>I had to parse a Wikipedia XML Dump ( 44GB XML file uncompressed ). The XML dump is available here, and I have also created a smaller sample file to run this code: sample wiki.xml file.&#xA;Below is the XML event based parser using Scala&amp;rsquo;s XMLEventReader:&#xA;package xml import scala.io.Source import scala.xml.pull._ import scala.collection.mutable.ArrayBuffer import java.io.File import java.io.FileOutputStream import scala.xml.XML object wikipedia extends App { val xmlFile = args(0) val outputLocation = new File(args(1)) val xml = new XMLEventReader(Source.</description>
    </item>
    <item>
      <title>Attending ScalaTraits 2013 event in New Delhi</title>
      <link>/2013/08/25/attending-scalatraits-2013-event-in-new-delhi/</link>
      <pubDate>Sun, 25 Aug 2013 00:00:00 +0000</pubDate>
      <guid>/2013/08/25/attending-scalatraits-2013-event-in-new-delhi/</guid>
      <description>First of all I was surprised that an event specifically targeted towards Scala was happening in India and very fortunately in New Delhi itself. I attend the ScalaTraits 2013 event in New Delhi a couple of days back.&#xA;The event was put together by Knoldus, a company specializing exclusively in Scala and related technologies.&#xA;The agenda was like this:&#xA;Introductory talk This talk was an introduction to the Scala ecosystem as a whole by Vikas Hazrati.</description>
    </item>
    <item>
      <title>On choosing Play2 framework</title>
      <link>/2013/04/16/on-choosing-play2-framework/</link>
      <pubDate>Tue, 16 Apr 2013 00:00:00 +0000</pubDate>
      <guid>/2013/04/16/on-choosing-play2-framework/</guid>
      <description> </description>
    </item>
    <item>
      <title>Emacs and Akka Pi example</title>
      <link>/2013/03/15/emacs-and-akka-pi-example/</link>
      <pubDate>Fri, 15 Mar 2013 00:00:00 +0000</pubDate>
      <guid>/2013/03/15/emacs-and-akka-pi-example/</guid>
      <description>I was trying The first Akka Example here&#xA;Install the TypeSafe stack on RPM distro:&#xA;$ sudo yum install typesafe-stack Setup a g8 project:&#xA;$ g8 typesafehub/akka-scala-sbt Akka 2.0 Project Using Scala and sbt organization [org.example]: in.tuxdna name [Akka Project In Scala]: akka-pi akka_version [2.0.1]: version [0.1-SNAPSHOT]: The I added the Pi.scala to src/main/scala folder. Then I tried to compile it from within Emacs, to check if it will be easier navigate compilation errors in the code.</description>
    </item>
    <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>
  </channel>
</rss>
