ankit gupta


Replacing dual boot with Bash on Windows

For most of my career, I have found a computer with dual boot setup — Windows and Ubuntu — to be an essential component. I use Ubuntu for all the software development and Windows for editing word documents, working with Adobe products, and playing games (something which is still largely absent from Linux distributions). Until recently, I have found that writing code on Ubuntu to be very efficient. Compared to when I was using Windows along, it saves me a lot of time wasted in trying to get some compiler/framework to work and dealing with incompatibility issues on Windows. A simple apt-get install on my Ubuntu machine goes a long. The only drawback of this setup is that I have to switch between the two operating systems. I cannot switch to a short burst of gaming and get back to work. But, that never became a huge issue.

More …

Is Chromebook for you? — the goods and bads of a Chromebook

My Lenovo laptop broke a few months back. I sent it for repairs and needed something cheap and lightweight in the meantime. I always wanted to use a Chromebook for fun but never considered it suitable for my needs as I develop primarily in Java. However, this time I was working on some projects where I was doing front-end web development and visualizations and a Chromebook would would have worked for me. I could still ssh into my Linux box to do some Java development (although I won’t recommend it). I finally bought a  Acer Chromebook 13 (CB5-311) and I have been using it regularly for over a month now. I have some good and bad things to say about Chromebooks and a little something about the whole idea of “moving to cloud”.

More …

Heat Map Chart of Semantic Role Labels

While doing text analytics on a large document collection, the analyst is often looking for relationships between entities like person, organization, location etc. The existing approaches to finding related entities automatically are quite primitive. They are generally some variant of finding relationship by co-citation of entities and bibliographic coupling of documents. According to this scheme, two entities are considered “related” if they are mentioned in the same document. Conversely, two documents are considered related, if they have common entities mentioned in them. A major problem with this scheme of “relatedness” is that the nature of relationship (semantics) between two entities is unknown until the documents mentioning the entities together are not read by the analyst.

More …

How to use Swing widgets in an Eclipse RCP application?

Eclipse RCP is a great platform for developing nice GUI applications with Java. It provides a wonderful framework to build application with its very useful publish-subscribe event model and annotation based dependency injection. It feels almost like magic when you switch from developing hard-coded Swing applications to Eclipse.

More …

Don't teach them calculus before they can add !!

Lately, there has been quite a discussion online about changing ways to teach computer programming. Programming is being realized as a very useful tool for practitioners in almost every domain. Yet, the way it is being taught continues become more and more convoluted. As a result, more and more students are frightened of the word “ programming”. We have finally managed to make a beast out of something that is amazingly simple in reality. We have also managed to kill the fun and joy that programming has to offer.

More …

First Date with Blender

WoodOnCloth_reducedBlender is a great free and open-source tool for creating 3D computer graphics. In my knowledge it is the only open-source tool that gives a real competition to its commercial counterparts. I have come across it several times and always wanted to learn it. But, I kept procrastinating. Finally, I got some free time last week and got hands on a very nice video tutorial on YouTube. The tutorial is easy to follow and I was able to learn the Blender interface and was able to replicate the tutorials to produce some really nice graphics that I am really proud of. Here are couple of images that I have created so far.

More …

Initializing a final variable when the method used to assign throws an exception.

A good programming practice is to make a variable final whenever possible. However, following this principle can sometimes be tricky. One such case is when the variable/field is initialized with return of a function that throws exception. Let me explain using an example. Suppose, you have classes Foo and Bar as follows:

More …

What can you do with Java annotations? – Part 2

In the previous post I briefly wrote about Java annotations and some of their uses. There is plenty of documentation about syntax and features online and hence I don’t want to write about it again.

More …

What can you do with Java annotations? – Part 1

Java 5.0 introduced annotations among many things. Annotations are a way of adding metadata to Java elements such as classes, methods, variables, parameters and packages. An annotation in its simplest form looks something like this:

More …

What does brushing and linking mean in information visualization?

Visualization systems generally consist of several independent visualizations, each allowing exploration of a different aspect of data. Over years, researchers have developed several interaction techniques to allow users to explore data. Two of these several techniques are Brushing and Linking.

More …

Using switch-case for String in Java6

Until Java 7, developers were not able to use String in switch-case construct. The only option was to write a huge if-else block like this

More …

How to run a loom project from sublime?

Loom is a game engine that provides live update functionality which makes testing code very easy. It is slowly gaining popularity at least among the newbie game developers and students (ones like me) as it is free and provides normal developers to take a shot a game development. without too much investment.

More …

Dealing with missing headers and files on Debian when compiling software and libraries.

If you are using any Debian-based OS like Ubuntu for some time, it is possible that you might have tried to compile some library or software and encountered the same old error like this

More …

What is the fastest way to find if a number is prime?

Quoting wikipedia,

More …

Processing: My first impressions

Long I have not known about an interesting environment for working on graphics and animation. It is called Processing. I have long been using Java for all my desktop application needs (with occasional also some animation/custom component coding in Swing). So, I know the pains of developing even a simple visualization, animation or even a worthy UI using Java/Swing.

Recently I started working for a visualization group as an RA/Lead Developer. At work, it is often a requirement to prototype some visualization real fast and hence I was introduced to Processing. And to put it in words, it was like “I was given a power that I could not wield”, and this was not because Processing was ugly or complicated. Rather, it is because it is very different from what I have been doing so far with Swing. In this post, I will try to discuss my first reactions to Processing, which do not include any code samples (that is for later).

More …

How to get the calling class name from the static method of the superclass in Java?

While coding Java for one of my projects, I came across a  weird requirement. I had a super class that had a static method and I wanted to know the name of the sub classes of my super class that called the method. Let me explain that by example.

More …

Animating the console!

There are times when I love to use command-line/terminal (whatever you want to call it). And when I do I like to do something fun with it, and not just putting text to read. This post contains two examples of some fun code that you might wanna use to make something nice of your command-line application.

More …

Competition, Collaboration and Software.

If you happen to be a guy who has spent some time in online forums for software developers, you might be aware of the flame wars that go on between different software such as vim and emacs or netbeans and eclipse, or between different operating systems. I happen to be the guy who just hates these kind of discussions. The problem with these flame wars is that they start as simple comparisons or discussions and evolve into pure blasphemy.

More …