<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abhijeet S. Sutar on Medium]]></title>
        <description><![CDATA[Stories by Abhijeet S. Sutar on Medium]]></description>
        <link>https://medium.com/@ajduke?source=rss-bd7c33cdfd1b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9WPi18h3tn6G-vfq3OfDGA.jpeg</url>
            <title>Stories by Abhijeet S. Sutar on Medium</title>
            <link>https://medium.com/@ajduke?source=rss-bd7c33cdfd1b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 07:44:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ajduke/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using Git- Part -I : Basics]]></title>
            <link>https://ajduke.medium.com/using-git-part-i-basics-ba43fbd74b22?source=rss-bd7c33cdfd1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba43fbd74b22</guid>
            <dc:creator><![CDATA[Abhijeet S. Sutar]]></dc:creator>
            <pubDate>Fri, 21 Nov 2014 10:01:07 GMT</pubDate>
            <atom:updated>2014-11-21T10:01:07.850Z</atom:updated>
            <content:encoded><![CDATA[<h2>Introduction</h2><p>Git is popular distributed version control system created by Linus Torvalds, creator of Linux OS. So, as you might have guessed it is first used for version controlling the Linux Kernel code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*y-tXu9GcSFoNlYPs.jpg" /></figure><p>Its widely used in most of open source and closed source software development. Thanks to <a href="http://github.com/">Github</a> popularity and its own feature sets.</p><p>Most of software open source projects foundation such as Eclipse Foundation recently moved its projects SVN and CVS repositories to Git. You can read more about <a href="http://aniszczyk.org/2012/12/21/eclipse-foundation-migrated-to-git/">here</a> and <a href="http://mmilinkov.wordpress.com/2012/12/21/eclipse-says-goodbye-to-cvs/">here</a>.</p><p>This is basic tutorial targeted at fellow beginners to git version control system. It shows very basic git workflow to get started with git.</p><h2>Installation</h2><p><strong>For Windows and Mac OS</strong></p><p>For this, go ahead to <a href="http://git-scm.com/downloads">git-scm downloads</a> site then go ahead to download executable files specific to your Operating System. Click on downloaded installer file to install git on your machine.</p><p><strong>For Debian based OS- Ubuntu/Mint</strong></p><p>Execute following commands in terminal window, it installs git using PPA (personal package archive)</p><pre>sudo add-apt-repository ppa:git-core/ppa sudo apt-get update sudo apt-get install git</pre><p>Now, you have installed the git, you can check for proper installation using <em>git –version</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/0*vAtQRHpFJ2u6mDcZ.png" /></figure><p><strong>Note </strong>: For this tutorial, i will be using terminal for demonstration of all git commands. So, if you are on Windows OS, make use of <em>bash </em>command prompt that shipped with git installation and on Mac or Linux use normal terminal.</p><p>As now, we have git executable available from command prompt/terminal to execute the git commands.</p><p>Git executable has following basic format-</p><pre>git &lt;command&gt; &lt;switch-options/command-options&gt; &lt;sub-command&gt; &lt;more-sub-command-options&gt;</pre><h2>Doing Git global user configuration</h2><p><strong>Command to be used </strong>: git config</p><p>First step after installation, is to do user configurations that is to setup the name and email id so, that git can identify while you making commit, that basically adds ownership of each commit.</p><p>Execute the following commands-</p><pre>git config —global user.name &lt;your-name&gt; git config —global user.email &lt;your-email&gt;</pre><h2>Creating Git repository</h2><p><strong>Command to be used </strong>: git init</p><p>For tracking files using git, first you need to create git repository first. Lets create hello-git directory and initialize the git repository in it.</p><pre>mkdir hello-git cd hello-git git init</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*V8e7MgH7XXZM9Jew.png" /></figure><p>After initializing you will see the message that Initialized git repository as shown in above screenshot and if you checked out the ‘<em>hello-git’ </em>directory , you will notice ‘.<em>git</em>’ directory is created. This is the directory where git operates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/0*PxcszmXbY87oME2Z.png" /></figure><h2>Creating files and adding it to git</h2><p><strong>Commands to be used </strong>: git add, git commit, git status</p><p>Now, lets add few files to our newly created git project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*0oS3VFxYDIKp5wQg.png" /></figure><p>I have added the <em>hello.js </em>and <em>README.md </em>files to project directory, Now lets see what git tells us about status of our project directory.</p><p><strong>git status- </strong>this command lets you see whats the status of files in a git project directory</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*TvxLm4ZLnnFmkOlW.png" /></figure><blockquote><strong>Git File states</strong></blockquote><blockquote>As we are discussing from start that git tracks changes for git intialized directory. So, when working with git, filles goes to few states which explained as follows-</blockquote><blockquote><strong>Untracked Files</strong>: This are kind of files which are newly added to directroy and it is not tracked by git for version control</blockquote><blockquote><strong>Tracked Files </strong>: This are the files which are aleady committed to git but not staged or added to Index area</blockquote><blockquote><strong>Staged / Index Files </strong>:These are the files which are to be added to next commit.</blockquote><blockquote><strong>Modified / Unstaged files </strong>: These are files which are modifed but not staged</blockquote><p>As you can see it says our two files are Untracked, meaning that we haven’t told git to track our files. For telling this, we going to use <em>git add </em>command</p><p><strong>git add — </strong>It adds untracked or unstaged files to Staging/ Index area of git.</p><pre>Adding specific files : git add &lt;file-1&gt; &lt;file-2&gt; Adding all files in directory and sub-directories : git add . or git add —all</pre><p>For our case, i am going to add all files,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*Q9Or7_LAR59PMiWC.png" /></figure><p>As you can see that, files are added to staging area. Now, we need to commit our files to that is to add to git repository, for this we use <em>git commit</em></p><p><strong>git commit </strong>: In simple terms, this command does two thing first it adds files to git repository and makes the commit log based on commit message you provided</p><pre>git commit -m “&lt;your message&gt;”</pre><p>For our case,</p><pre>git commit -m “Initial commit for project, added hello.js and README.md”</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*I5xQiB5OBct5cy0v.png" /></figure><p>Now, after doing this you will see that your changes are committed to git repository.</p><p>Now, if you do <em>git status </em>, you will see no changes to commit, that means our working directory changes are recorded by git</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*01fpnbtlawWXfjvH.png" /></figure><p><strong>git log : </strong>This let you see your older commits, in this you can see commit hash , name of author, date to which commit has been made and commit message</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*GYDEBH4Q4Ker3rvE.png" /></figure><p>To see more compact commit messages, use <em>oneline </em>switch on log command shown as follows-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*wgOXVBMLE8CMTmOf.png" /></figure><h2>Doing more changes to files</h2><p><strong>Commands to be used </strong>: git diff, git add and git commit</p><p>Lets do more changes to files in repository and learn more git commands. Now, lets add few lines to hello.js and README.md, Open this files in the your favorite editor and add few lines to it. I have added few lines to files you can see those as follows-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*GfmK3Ep6F6Thk__H.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*QX1BkbpEonv9rWhU.png" /></figure><p>Now, if you do <em>git status</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*g88LqYEujZevjZNz.png" /></figure><p>You can see the files are tracked but not staged for commit, as compared previous un-tracked files. Now, in middle changing files, you might want to see what is been changes since last staged.</p><p><strong>git diff </strong>: It shows you code diff’s between what you have changed in working directory since your last commit for each files in directory.</p><pre>git diff &lt;options&gt; &lt;file-name&gt;</pre><p>If you just do <em>git diff, </em>without specifying the file-name you diff of all files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*6TCNiSqEHeWeSYiO.png" /></figure><p>While if you specified file-name as follows, it shows diff of only that particular file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*s_udkrKuGCp1vpZs.png" /></figure><p>You can see the lines in light green color, which are started with +, indicates that these lines are added since last commit.</p><p>Lets add files to staging area using git add command</p><pre>git add .</pre><p>Now, if do diff of repository, you will not see the anything because, by default <em>diff </em>command shows the diff’s between unstaged files.</p><p>To see diff’s of files that has been staged, you have to do following-</p><pre>git diff —cached</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*CHdhqe9suSJ3AYNt.png" /></figure><p>Now, lets commit the files-</p><pre>git commit -m “added the more contents”</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*GdKqfHu0GrX4UN_6.png" /></figure><p>and now if you do git log, you see our two commits as shown as follows-</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/0*8E-3_gazTvsdDqJs.png" /></figure><p>To get more information use –<em>stat</em>, which gives more information about which files are changed. Look at following image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*3tSykbkR0J6XRzkp.png" /></figure><p>I Hope this tutorial helped you to at-least understand basics of Git. Git has lot of cool features you might need it later as you get advanced. For that, be sure to check out this blog again for more tutorials on same.</p><p>Image Credit : <a href="http://izquotes.com/quote/273567">http://izquotes.com/quote/273567</a></p><p><em>Originally published at </em><a href="http://blog.ajduke.in/2014/06/22/using-git-part-i-basics/"><em>blog.ajduke.in</em></a><em> on June 22, 2014.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba43fbd74b22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Various ways to run Scala code]]></title>
            <link>https://ajduke.medium.com/various-ways-to-run-scala-code-cfd64147e4ac?source=rss-bd7c33cdfd1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfd64147e4ac</guid>
            <dc:creator><![CDATA[Abhijeet S. Sutar]]></dc:creator>
            <pubDate>Sat, 18 Oct 2014 09:22:45 GMT</pubDate>
            <atom:updated>2014-10-18T09:22:45.954Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/708/0*MpajOGrtZi7PfY1a." /></figure><p>For running example in this tutorial, make sure that, you have latest <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Java distribution</a> and <a href="http://www.scala-lang.org/downloads">Scala distribution</a> installed on your machine and environment variable SCALA_HOME points to base directory of the scala installation and %SCALA_HOME%/bin added to PATH variable.</p><h2>using Scala REPL</h2><p>It is basically command line interactive shell called as REPL short for <a href="http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop">Read-Eval-Print-Loop</a>.</p><p>To start scala REPL, open command prompt and simply type <em>scala. </em>After that, you will see new scala prompt waiting for your input as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/0*OyZT6K5ybD-t0T9h." /></figure><p>Now, you can type of any scala expressions or code in prompt and hit enter and you will get the output immediately as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/0*cmAhHvocD91Dnbvg." /></figure><h2>using Scala interpreter to run scala script</h2><p>You can save your scala code in the file with .<em>scala </em>extension (basically with any file extension but prefered .<em>scala </em>extension) and to run, provide file name with extension as parameter to scala interpreter</p><p>Create the file <em>HelloScala.scala </em>with following code</p><pre>val str = “Hello “+ “Scala “ println(“’str’ contents : “+str)</pre><p>Now, we can run this file using command shown as follows</p><pre>shell&gt; scala HelloScala.scala ‘str’ contents : Hello Scala</pre><p>As you can observe we do not require the any class definition declaration or so. We can put the code inside the file and we are ready to run it.</p><h2>using Scala interpreter</h2><p>Usual scala program contains lot code chunks spread of across lot of files, for running these programs we need to go through two stages, compile the scala source code using scala compiler and run the compiled bytecode using scala interpreter.</p><p>Lets create file named <em>Hello.scala </em>with following code</p><pre>object Hello {     def main(args:Array[String]):Unit = {       println(“Hello, Scala !! “) } }</pre><p>Little explanation about above program, we created object Hello, Object is way scala represent the static members and inside it we have main method taking param as array of strings and returning Unit which is same as void in Java. This main method more like one in java but scala version of it.</p><p>compile file using scala compiler <em>scalac, </em>as shown below,</p><pre>shell &gt; scalac Hello.scala</pre><p>It will create the couple of class files in current directory. To run this, we use scala interpreter (or java interpreter, a little later on this ) by passing the class name (not with .scala or .class extension). In our case, we do following</p><pre>shell &gt; scala Hello Hello, Scala !!</pre><h2>using Java interpreter</h2><p>As compiled Scala code is bytecode that we can run with Java interpreter which is java.exe or java.sh shipped with standard Java JRE distribution. But for this we need to put additional library in classpath.</p><p>We just need to add the <em>scala-library.jar </em>which located under <em>$SCALA_HOME/lib</em></p><p>To run using java interpreter, we use following command</p><pre>shell &gt; java -cp $SCALA_HOME/lib/scala-library.jar;.  Hello</pre><h2>using Scala worksheet</h2><p>This scala worksheet is part of <a href="http://scala-ide.org/index.htm">Scala IDE for eclipse</a>. It is like the REPL but much more convenient and powerful than REPL.</p><p>Following is excerpt from official github repo <a href="http://goo.gl/FaMJk">wiki</a> about the scala worksheet</p><blockquote>A worksheet is a Scala file that is evaluated on save, and the result of each expression is shown in a column to the right of your program. Worksheets are like a REPL session on steroids, and enjoy 1st class editor support: completion, hyperlinking, interactive errors-as-you-type, auto-format, etc.</blockquote><p>For creating new scala worksheet in scala ide, first create scala project then right click on scala project and go to following <em>New &gt; Scala WorkSheet</em></p><p>It will prompt for name for worksheet and folder to which worksheet to be created. Give any name, accept default folder and then hit enter</p><p>After that you will get the worksheet as shown as follows. it gives output at right of your code (one marked in red) as shown following figure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*0t-X9E34HGhkwSNY." /></figure><p>You can write any code inside object body and hit the save button and you have the output at right of your code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/0*4GuMirRzOc8L4BRV." /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/0*5YDjZz8qiyqIQ19M." /></figure><h3>Like this:</h3><p>Like Loading…</p><h3>Related</h3><p><em>Originally published at </em><a href="http://blog.ajduke.in/2013/05/31/various-ways-to-run-scala-code/"><em>blog.ajduke.in</em></a><em> on May 31, 2013.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfd64147e4ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>