November 13, 2010

Installing GIT on Ubuntu 9.10

On the to install GIT over Ubuntu 9.10, the instruction of the Github website didn't work! So I had to scratch my head and investigate it myself.

The instruction being as:

It is recommended to only use the Ubuntu package management system to get a basic Ruby environment. Then you will use gem to install all your ruby packages.


So to get started, you will need to install these Ubuntu packages:

$ sudo aptitude install ruby-dev libopenssl-ruby rubygems

You will also need to install the development package of your database client library, for example in the case of sqlite3:

$ sudo aptitude install libsqlite3-dev

You can now install Rails and Radiant using the gem command:


$ sudo gem install rails radiant

You will also need to install the Ruby wrapper for your database client library, for example:

$ sudo gem install sqlite3-ruby

Once radiant has been installed successfully, you need to add the directory containing the radiant command to your PATH. If you’re using Bash, you can add a line like this to your .bashrc file:



export PATH=$PATH:/var/lib/gems/1.8/gems/radiant-0.8.1/bin


Right at sudo gem install sqlite3-ruby I got stuck. I tried a lot of different suggestions available online, not sure if athey had any impact or not but I think this is what solved my problem: and because of a versioning mismatch I was not able to install it.
  • remove ruby 1.9 and ruby 1.9.1 and install ruby 1.8 and ruby gems 1.8.
and instead I had to add /var/lib/gems/1.8/gems/radiant-0.9.1/bin to my PATH.

----
Then, you need to install GIT. Ubuntu recommends to use GIT, first you must have a public SSH key, so we make one:
$ mkdir ~/.ssh
$ chmod 700 ~/.ssh
$  ssh-keygen -t rsa

add your public key to your github account https://github.com/account

$ sudo apt-get -y install git-core gitosis
$ sudo -H -u gitosis gitosis-init < ~/.ssh/id_rsa.pub 
 
You'd get something like
Initialized empty Git repository in /srv/gitosis/repositories/gitosis-admin.git/
Reinitialized existing Git repository in /srv/gitosis/repositories/gitosis-admin.git/
Your gitosis is installed!

November 12, 2010

Machine Learning

"All models are wrong, some are useful." - George Box

From the interesting talk by Hilary Mason.

October 11, 2010

Java Getting Bigger

Oracle publishes: Oracle and IBM Collaborate to Accelerate Java Innovation Through OpenJDK [Link].

This means a counter act against the great effort of Microsoft to stabilize its .NET framework. It means two giants of java will cooperate to gain better quality java, Oracle through the formerly SUN JDK, and IBM through OpenJDK. A neat competition and coordination. I am eager to see what is going on to the JSR!

Entropy for Dummies

The entropy is the expected amount of information you get in a sample of a distribution. You can think of it as "how surprised are you, on average, on seeing a sample of that distribution".

An unbiased coin toss has one bit of entropy, as any way is equally likely, but a toss from a coin where both sides are heads has entropy 0, as you're never surprised when seeing its results.

The entropy can also be seen as a constant minus the information gain of a distribution over the uniform distribution (and this divergence, as you know, is the number of bits you "save" when you use a code based on the actual distribution instead of on the uniform distribution).

it's best to get used to it by seeing how it works in theorems and algorithms, and for this I recommend Davd Mackay's book, you can get the PDF from here.

Source.

October 10, 2010

Wikipedia!

Today (it is 1:23 AM now) I started my very first contribution to wikipedia in Persian (Farsi) by the definition of polyhedron or چند وجهی as a beginning. Feels good! :)

To add your language (e.g. Persian) to the definition of a word I followed the following guide from here:


To link to a Hindi-language article from a relevant article in another language's Wikipedia, go to the bottom of the other language's article and add a link like this:

[[hi:Article title here]]

(For example, the bottom of the English Wikipedia article "India" contains a link, [[hi:भारत]], to the Hindi Wikipedia article "भारत".)

You will probably see other languages there (French, German, etc) with their links. If you do, then please add the Hindi link in the appropriate spot alphabetically; this helps us keep everything sorted.

October 8, 2010

Age of Data

Recently I have been busy implementing a C compiler as part of the Programming Languages and Compiler course at UTSA. This project is to be built on POET language.

Apart from school, I was interested in the "Journalism in the Age of Data" video post by Geoff McGhee.


Huge amounts of data available around us means something. Extracting and visualizing these data is quite challenging.

October 3, 2010

Matt Ridley: When ideas have sex.

I am pleased to announce that I succeeded in contributing to the TED.com community. By translating the fantastic talk When ideas have sex by Matt Ridley, I have the honor of letting a large group of Persian speaking people (across Iran, Tajikistan, Afghanistan, ...) to benefit from this community.

You can access the translation either by choosing the Subtitles in Persian (Farsi) under the video, or through my TED.com translator page.

*****Service, is what matters.*****

September 17, 2010

Back to Reality, Back to Math

This was the plan: Linear Algebra --> Linear Programming --> Convex Programming (Semi-definite programming) --> Optimization, Error Bound Analysis     Especially in Graphs!

Thanks PatrickJMT for the hard work and easy and quick math reminders. L’Hospital’s Rule was just fun!

----
PS:
After starting to read the book "Convex Optimization" by Stephen Boyd and Lieven Vandenberghe; I realized that convex optimization has lots of uses data mining, statistics, control theory, etc apart from the graph analysis topic that I am reading it for. It makes it even more exciting!

September 14, 2010

Keep my eyes in the sky, but my feet on the ground

Reality is we want to be there, but where we are, we have a number of steps before we can overcome all the limitations. Gustavo Stolovitzky (IBM Research)

http://www.youtube.com/watch?v=pKi30ai35mU

September 10, 2010

This did inspire me!

Virtual-Real Rehabiliation!

Rank Reduction

One of the interesting topics in linear algebra is matrix rank. It outlines ways that columns of a matrix correlate to each other. There are basic and free columns. and you can define free columns in terms of linear combination of basic columns. It highlighted a matter of data redundancy to me. So if you can define a column based on other columns, you won't need the content of those columns any more; just keep the coefficients that should be applied to basic columns and you are good to go! It seemed to be highly useful in matrix compression. An image which is a big matrix could be compressed like this by some matter of rank incrementation.

I succeeded in getting an algorithm to alter the rank. Unfortunately as it is not the current topic of my research, I was prohibited to work on this, deviate less and concentrate more on my research area. Anyway I found interesting relevant researches on matrix rank reduction, this is at the back of my mind for sometime to be used.

September 4, 2010

Rashomon

Rashomon: One of the best movies I have seen in my life. Whose story is true? Which is to trust? How can you judge?

What would you do if you were involved in the case? If you were the samurai, or the samurai's wife or even the bandit Tajōmaru, or even the farmer witeness? That is a hard situation for each of these characters. Tell me what would you do.

I keep my faith in the man.

September 1, 2010

Achilles Heel!

When Achilles was a baby, it was foretold that he would die in battle from an arrow. Naturally, his mother Thetis did not want her son to die. So she took Achilles to the River Styx which was supposed to offer powers of invincibility and dipped his body into the water. But as Thetis had held Achilles by the heel, his heel was not washed over by the water of the magical river. Achilles grew up to be a man of war who survived many great battles. But one day, an arrow shot at him was lodged in his heel, killing him instantly.

I had heard Achilles heel several times but never knew what it was about.

August 23, 2010

Interesting Problems

The Hershey Bar problem:
Give an optimal algorithm to break an mxn Hershey bar into 1x1 pieces. At each step, you can choose a single rectangle of chocolate and crack it along one of its vertical or horizontal lines. A single crack counts one step. You are to make the fewest number of cracks.


David Gries's coffee can problem:
Given a can of black and white coffee beans, do the following: Pull out two beans: if both are the same color, replace them with a white bean. If the two are different, replace them with a black bean. What color is the last bean?

August 15, 2010

The Common Feature Among All Living Beings

What is pain?

Is it a feeling? (If so, what is a feeling?) Is it absolute? What makes it different between us, a crocodile, a tree, a microbe? Does a microbe really feel pain?

Is pain really a good thing or a bad thing?

I think one thing common among all creatures is the pain. Whether it is a feeling or inter-cellular reaction chemical reaction or inner-cellular or whatever. It seems to be existent among all living beings.

It is the sense of pain that causes a living being to continue living. I am definitely sure of myself that I didn't feel pain, I wouldn't have lived until now.

August 13, 2010

Distribution of Factor Count for Numbers

I extracted the frequency of the factors for numbers in the range [2,  10^6]. It was quiet interesting for me. Why is it that 2,688 numbers have 30 unique factors but there are ZERO numbers that have 32 factors?

Motivation:
While studying about randomized algorithms in wikipedia, one of the very first algorithms in this context is the Miller-Rabin primality test and an important statement in their algorithm is that:

"If n is composite then at least three-fourths of the natural numbers less than n are witnesses to its compositeness."[1,2]

But a number like 22 has only two numbers are witnesses of its compositeness (2 and 11). So what does that mean. I thought that it could be true for most numbers if we get to infinity, therefore I counted the number of factors (witness of compisiteness) of the numbers from two to one million. And as the mubers grow their factor count become less comparable to their magnitude. So what does that quote mean?

[1] . http://en.wikipedia.org/wiki/Randomized_algorithm
[2]. Dietzfelbinger, M. and Hagerup, T. and Katajainen, J. and Penttonen, M. "A Reliable Randomized Algorithm for the Closest-Pair Problem", Journal of Algorithms, Vol 25, Issue 1, 1997.

July 28, 2010

In the Beginning God!

Here, I start blogging about different topics, which would be mostly based on science, religion and philosophy. I am a Muslim but I am actively studying other religions too. Deep conceptual thoughts are just so appealing to me!

Some scripture books on alphabetical order:
Avesta starts with "In the name of God"
Quran starts with "In the Name of God the Most Compassionate, the Most Merciful",
Torah and hence Bible start with "In the Beginning God",

So, it looks like they pretty much have the same idea!

I hope you have a good time here!