Archive for Takniki Vishleshan

Removing echo in irb while running in emacs

My emacs ruby setup was behaving strangely. While using the inferior ruby mode i.e. M-x run-ruby , the command given to the irb was echoing. Very annoying and no visible solution on the net.

I opened up inf-ruby.el and realized that ruby mode was built on top of the shell mode of emacs. Now the solution was simple. One just had to turn off echo in comint mode. Just add the following to your init.el (yes i use windows at work)

;; for turning of the echo

(defun echo-false-comint ()
(setq comint-process-echoes t))

(add-hook  ’comint-mode-hook  ’echo-false-comint)

And the world will seem like a better place to live in. Thank you emacs lisp. 

Leave a Comment

of github origins and removal

As described in this previous post, I was on my way to glory setting up my own source control.

This post is about setting up github.

The account creation is straight forward though one is also required to give the ssh key (not necessary) . Ample details on the site on how to generate on if you dont have already.

So my folly was of a typo. Somehow I typed git@github instead of git@github.com while adding remote source repo. After that when I tried to push the code I got the following error

ssh: github: Name or service not known
fatal: The remote end hung up unexpectedly

After a couple of permutation combinations i zeroed down on the cause. Now the simple thing was to remove the origin. Which is easy

git remote rm origin

Thats it. Good to go. Now one can specify another remote origin and continue as happy users.

Comments (1)

gitting things right

So this friday night found me setting up a source control for myself (finally).

I had no doubts about the capabilities of linus written git so I went ahead with it.

First step : getting git

The git package in ubuntu universe is 1.5.4 which is quite old so head to the git site for the latest package.

Second step : Installing git

Though this step is straightforward, one might face errors as i did.

The simple installation is three steps

~/git$ ./configure

~/git$ make

~/git$ make install

This should install git. If you face errors then the most common problem is that you might not be meeting all the dependencies required to compile git. Best way to ensure that the dependencies are met is to build dependencies of the git core by doing the following

~/git$ sudo apt-get build-dep git-core

After this everything should be hunkydory. This ubuntu forum discussion might be more useful.

After this I wanted a repository on the net. I chose github.

Make an account and follow the subsequent steps and you will be good to go.

Except , I faced a little problem because of my own folly which deserves another quick little post.

Comments (1)

Look Who Is Here

So I was not wildly speculating after all. A tiny new star is born. Google has announced the coming of ChromeOS.

First things first.

It will be a Linux Kernel(what else is new) running GoogleChrome on top. So it will be a platform we already know. The big bad web. No more service calls to the OS :D . It will essentially be a net OS for netbooks. Initially atleast. And then it will begin world domination. Lord save you. For a long time now I have been suspecting an evil empire rising.

As the faq of the matter points out, it will be free AND open source. The open sourcing will happen sometime later this year. The product will be available in the second half of 2010.

How does it change the world?

For good or bad, the world will change. The control buttons will change hands. Your life will be controlled by binary decisions (More than it is now). Your thought process will be controlled and directed to whatever the binary dictates. Do you think that is being too cynical? Wait and watch :D

Leave a Comment

Re – Rethinking Http :)

My friend and colleague , Vishal  had these questions after reading this post of mine.

a. What do we mean by Half Duplex and Full Duplex?

These are communication jargons back from my electronic engg. days :)

A half duplex communication is a two way communication between two devices. But these two devices cannot communicate at the same time. In other words you can either transmit or recieve at a time but not both. A very good example is walky talky communication.

Colonel Vishal : Hello Capt. kgthegreat. What are you working on? Over.

Capt. kgthegreat : Hello hello , Colonel Vishal. I am still working on accesibility. Over.

You hit the transmit button and say something and then say over to signal the end of transmission and release the transmit button.  Now the other party repeats the same protocol to transmit.

A typical example from our software world will be a strict client server interaction. Firstly a handshake is done between the client and server. Then Client sends a request. Server recieves and then sends a response back. The HTTP protocol is designed the same way. You have HTTP request and response objects.

Whereas a Full Duplex communication is more like a modern day telephone conversation. You can transmit and recieve at the same time. Jonas Jacobi talked about getting this behaviour in HTML 5 Commmunication protocols.

Find more information here.

b. What exactly is Web Sockets?

Web Socket is a new Full Duplex interface defined under HTML 5 Specifications. And yes it is a protocol just like HTTP is a protocol. Like HTTP , if implemented , it will sit on top of TCP/IP Layer.

So instead of  ” http : //www.kumargaurav.info ” you will have “ ws : //www.kumargaurav.info ” if implemented.

I will let the people who helped creating it talk more about it.

Here is an excellent FAQ on websockets if there are more questions (which is a healthy sign).

Go here for HTML 5 Specifications which is work in progress.

Go here to know more about the most common network protocol.

Another general reading which I can suggest and personally endorse is Andrew Tanenbaum’s Computer Networks. Its a life changing experience :) .

c. Are we trying to say that Web Sockets is/are going to replace HTTP protocol?

No and Yes. No because it will take time (I think it is envisioned to be completely implemented and accepted by 2020) and yes because it is the right thing to do.  Another compramise in this direction is to make WebSocket sit on top of HTTP but I don’t know how good is that.

Leave a Comment

@GIDS 09 – Workshop on DSLs

Session by Venkat Subramaniam

What are DSLs?

DSLs are domain specific languages. The sole reason of their existence is to solve a single particular problem and to solve it well and better than any other general purpose language.

DSLs are not new as such. We come across a lot of examples of DSLs in our day to day coding. CSS , ANT etc. They have a purpose to their existence and it is difficult for you to make them deviate from their purpose unlike general purpose languages. And guess what. They are sooper good at their job. So DSLs make good sense.

So according to Martin Fowler , there are two types of DSLs , External and Internal. Internal DSLs are so called because they need a host language to define their look and feel. External DSLs have their own custom syntax and a parser is required to process them.   

How do I get Up and Running with My Very Own DSL? 

Answer is simple. You need a tool. There are some available. The best of the breed being ANTLR.  If you are an eclipse fanboi then take a look at xtext. My good friend and colleague , Phaneesh blogged about bloated softwares the other day. I am glad that some powerful stuffs still come in small packages. ANTLR is all of 2.93 mb :)  

Why do we need DSLs as an organisation?

As an organisation, we are looking at various new ways of development of new products and trying to better our software delivery model by changing the rules of the game. 

But we need to do it faster. We have tons of code in what is generally called as legacy architecture. In my opinion , we need good DSLs written by us to get things done faster and more efficiently. I know we are taking steps in those directions. DSLs will help us a great deal.

 

Get the whole presentation here. And while you are at it, browse the site. Its informative.

Leave a Comment

@GIDS 09 – Rethinking HTTP

I am at the Great Indian Developer summit 09 at IISC, Bangalore. Today is the Java Track

 

The Java Track

The Java Track

 

 

One interesting session I attended was Re-architecting the Web with HTML 5 Communication

Jonas Jacobi 

Why are we using http? Or rather, Why are we STILL using http?

Good Question. Because the powers to be decided that you , yes you are doomed to use http forever(?) whenever you want to connect to the internet.

No but really. Why are we still stuck on a half assed protocol such as http. Our backend interaction is not half assed nor is our desktop apps then why oh why is our internet experience be half assed. Why is client server interaction inherently half duplex rather than being full duplex.

One answer comes to mind. Http is half duplex. Why? Because HTTP and the internet was originally thought out to be a good toy for sharing intellectual documents (mainly text) until some one thought of the idea of expanding it and sharing pretty much everything. But somebody forgot to upgrade the protocol :) and this protocol was written way before (1983) I was born so its not me.

Then what is stopping us from upgrading this half assed protocol to something brand new and full assed. :D
Yes you said it. Let it flow , no? Why change it. Don’t fix it if it ain’t broken. Right? 

But it is hindering my interaction with the world. Why should I wait to hit the button everytime I want something. Don’t kid me with AJAX. Though it is a sooper sooper way to increase user experience but it is killing the servers with every small request (which is an HTTP Request which is a bloated block of data anyways) and I am inclined to think green here. With every http request I make I am leaving a Carbon Footprint behind me. 

So whats the solution? According to the speaker, the solution lies in yet another protocol which paradoxically(in my opinion) sits on HTTP and in future might sit on TCP/IP. They call it WebSockets. Interestingly this protocol was developed as a result of trying to control  a toy train using a browser.

Ok. So I stop here. I could not find a link a to the presentation but this blog post by Jacobi is pretty interesting. Google about websockets to know more.

Comments (1)

Why doing One thing right is always a good option

I am an inspired person today. 

Why , you may ask.


Simply because I saw a “thing” which works well and does what it was designed to do. Without a hitch. Without giving me pains. Making it a pleasure to use. 


The “thing” is one of the many travel portals around but this “thing” stands out. It is cleartrip and is honest to its name.


Such clean and clear interface. Such intuitive UI. Clearly some very good thought process has gone behind this work. Which is nothing but expected. Why would anyone make anything which is counter intuitive? I hate counter intuitive.


This is what I am wondering then.


“Travel is such a lucrative market in India. Why are other players not pulling up their socks?”



So I decide to pull it up for them or atleast help them pull it up. Since I don’t have access to their codebase I decide to turn beanbag critic. I will be a moron and ask stupid questions and point out stupid things. Don’t listen to me <psst. If you do then you stand a good chance of increasing your market share. But why bother. Let it flow , no?>. Here we are focusing on two other major market players , makemytrip and yatra


So first thing first. Which of the site loaded first? And any wild guesses bout why did it load first?


I like it <you too and my dog too like it> when things come to me faster. Why the eff should I wait for some ads <which i will never even glance at. Why? Because I am too busy. Hence I am spending money to get to my destination faster. Nice , no?> to load to use your site? Are you guys here to get my business? Really? Please check again with your promoters and come back. Or are we some ad boards? BTW , cleartrip also has ads on the front page but they are very conveniently in the forms of link on one side. Which brings us to our next moronic question.


Ah. Here is one potential customer. Lets scare him away. Lets throw lots of meaningless ads at him so that he gets confused and is tricked into clicking on one of them. woohoo <pat on back>. Who was thinking this while designing their homepage? 


So guys. All of us have heard of the google homepage. Its great idea , no? Why not just imbibe a great idea? Its simple, no? Cleartrip did it. Others did not.  The first thing which I see on cleartrip homepage is what I want to see  i.e. the place where I key in my info. To be honest, yatra does a good job of placement of the info seeking bars but why is it so cluttered? With makemytrip  I get confused. It may be because of bad colors <told you I was a moron>. In lot of ways cleartrip’s homepage  reminds me of google’s homepage <haha. fiends. they copy ideas. bad people. lets stick to confusing people. That is original.>. Other two remind me of a place where people can find something for their use like travel guides, holiday packages <by themes too>, Mobile <?>, buses, cars, deals , corporates but I wanted airline reservation , no? Give me that , no? Please , no?   Which brings me to the reason why I wrote this post.


Do one thing and do it right.


<Right. I have heard it thousand times. Hell, I have even given advices like this at so many conferences and to MBA types. But No. I cannot follow it. How can I afford to? I need EVERYONE in the boat , no? The bigger my customer base the greater chances I have of duping them into clicking on one of the moronic ads and getting that deal and even though he has come to my site for airline reservation I can somehow convince him to buy a holiday package or better still,  make him travel by bus or even better , sell him a tourism guide. That would be cool , no? My marketing prof will be proud.>




So Yes. Do one thing and do it right. I hate it when Cleartrip wants to sell hotel to me. But I will credit it to them that its inconspicuous. Not so with other as I have already exemplified.  


Ok so this was about the homepage. Lets take this slow because it is very interesting , UI design. So more moronic observations in the next post. I have many. What did you expect? Moron I am , no? :)  Next post we will try and delve deeper on more UI elements. 


Leave a Comment

@JAXINDIA 09 – EE 6 is coming

 

jaxindia 09

jaxindia 09

Attending a devblurb by Mike Keith

Java EE is coming.

 

How soon?

Expected release is May 09. But that is only expected :)

 

Should I be bothered?

No.

 

Why not?

Because if not anything, Java EE 6 will only make your life easier.

 

But what if I don’t know what you are talking bout?

All the more good reason to be not bothered.

 

Ok. I know what you are talking bout. What should i be looking forward to?

Look forward to using EJBLite which is specified in EJB 3.1 . It has all the simplest and most useful constructs. Make mine lite.

EE6 also understands the fact that people want to use their favorite frameworks wherever possible other than the base framework. EE6 makes life easier for them.

JPA 2.0 . There is a Criteria API . There is also introduction Java based expression language <woohoo>. Which I think is something exciting.  The world moves forward. 

 

kg : mike, how will it look like , the java expression language?

mike : duh. it will look like java.

kg : nice. 

mike : yes. so you can use Criteria API to make a SQL look more like a java method call on an object.

kg<mindconversation> : something like table1.select(a , b , c).where(a=f) .  <aloud> neat. wud love that. thanks. 

The expression language in JPA 1.0 , JPQL looked more like SQL. select ta1 from table1 ta1,table2 ta2 where ta1.id=1;

 

We also have an interesting concept called profiles in EE 6. Profiles are like flavors. So for example, you might be heavy on web app development but not using EJB at all then the profile will try and focus the java EE platform towards your specific classes of applications. 

“A profile is a configuration of the JAVA EE platform targeted at a specific class of applications” — the java EE6 specification , early draft. 

Each profile must be defined by a JSR.  The first profile specs is ready and is called the web profile.

I see a very good business potential of this idea. Now companies can come up with customised and specialised profiles and make EE6 work harder for their clients. So in future we can see some company , say IBM coming up with Social Application profile which might be an even narrower subset of Web Profile. Making EE6 more focused on what is my requirement rather than what EE6 can offer.

Another thing which I deem as important is annotations in Servlets 3.0 . Lot of potential to make my life easier.

 

Ok. So that’s it? Is this why you are excited? Get a life.

Yeah yeah. you go get a life. Or better still get EE6.

Go here for a detailed overview and you also have something called google at your service. use it. its free.

Leave a Comment

@JAXINDIA 09

Are devcons in India evolving? 

Yes and No.

For starters , the fact that they are happening is a good sign. 

That they are more like couple of google searches is a bad sign.

The fact that they have workshop days too is a good sign.

That sometimes the workshop turns out to be hidden advertising of proprietary technologies is a bad sign.

yada yada.

Leave a Comment

Older Posts »