Thursday, April 09, 2009

I chanced upon this today -

http://www.cs.tufts.edu/~nr/cs257/archive/jeannette-wing/pi.pdf

Kudos to Jeanette Wing for writing this FAQ in very simple language. There is a lot of great material about the Pi-Calculus out there but most of it is either pedagogical or addresses the research community - very little readable text that simply explains the lay-of-the-land.

If you are curious about concurrency and process calculi, the above is a pleasant read. On the other hand, if you are already well versed in the topic, there is probably nothing here that you don't already know.

Thursday, April 09, 2009 12:32:51 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Saturday, March 14, 2009

April 7nth: Update: Clip.1.10 is posted here. See below.

April 8th: Update: Clip.1.11 is posted here. See below.

I finally scratched a long standing itch and wrote this tool. I don't understand why I didn't do this a few years back.

Clip lets you interact with the Windows clipboard from the command line. Of course, you need to do this only if you are a heavy command line user.

Clip lets you copy/move/delete files in the clipboard from the command line; you can copy and paste files between cmd shell windows and between the cmd shell and windows explorer. You can also dump clipboard data on the console (redirect it to files, if you choose) and pipe data into the clipboard. It also lets you examine various clipboard formats and such. The clip command t2f is rather handy for situations where you have a list of file names (as cut/copied text) in the clipboard and you want to perform actual file operations on them.

Finally, Vista apparently comes with a clip.exe that does very little. It might be lying in your path before my clip.exe is. Fix it by (1) renaming one of these programs OR (2) putting this program's dir before system32 in the PATH. I did the later.

Clip v1.11 - A Clipboard tool for the Command Line
March 2009 (c) Roshan James

Usage:
  clip <cmd sequence>

Commands:
formats - Lists data formats currently available in the Clipboard
text    - If the clipboard has text, display it
clear   - Clears clipboard
in      - Copies stdin to clipboard as text
put <text> - Puts text into clipboard.

flist   - List files in clipboard (uses "FileDrop" format)
fcopy   - Copy files in clipboard to current dir
fmove   - Move files in clipboard to current dir
fdelete - Delete files in clipboard to current dir
faction <cmd> - Executes the specified command as the action.
          Possible use: delegate file copy to robocopy.
files <wildcard> - Extends (uniquely) the file list in the clipboard.
cut     - Sets the shell action for files to 'cut'
copy    - Sets the shell action for files to 'copy'
paste,drop - Executes the current shell action, like a shell 'paste'.

display <format name>
        - Displays clipboard data (if possible). Format names are those
          listed by "formats" command. Use doubles quotes if format
          names have spaces

t2f     - Text to Files: takes the current text data in the clipboard and
          converts it into a list of filenames for pasting. Each text line
          is treated as a file path.

Ex: Copy file contents to clipboard.
> type test.text | clip in

Ex: Copy clipboard contents to file.
> clip text > test.txt

Ex: Put *.txt files in clipboard.
> clip files *.txt

Ex: Cuts *.txt files into the clipboard.
> clip files *.txt cut

Further, clip commands are executed in sequence. Hence we have:
Ex: Copy txt files from all subdirs to current dir.
> dir *.txt /s/b | clip in t2f fcopy

Ex: Convert clipboard content to plain text.
> clip text | clip in

Send me bugs, typos, suggestions.

Clip is written in C# and has been tested on Windows Vista; it may/should run on other windows versions where the right version of the .Net framework is installed - the 2008 version - whatever it is called. All the file operations assume a certain semantics for the "FileDrop" format of the clipboard - this could very well change between windows versions, so if you have a different windows and file operations don't work, let me know. Clip is free for use; use it at your own risk - I am not responsible for any damage caused.

April 7nth: Update: Cut, Copy, Paste...

Clip has been upgraded to version 1.10. The new commands include cut, copy and paste. "Clip files *.txt" acts like a select operation where files are added to the clipboard without specifying a shell behavior when pasting happens. On pasting the shell reverts to its default action, which is "copy". The newly added cut and copy commands lets one specify the shell action. Hence "clip files *.txt cut" will place the txt files into the clipboard with a cut action associated with them. Simply executing "clip copy" or "clip cut" will change the action for the files currently in the clipboard. The paste command acts like a shell paste - it will copy or cut/move depending on what the current action is.

April 8th: Update: Adding "Copy Path to Clipboard" in the "Send To" context menu.

Clip has a new command called put. "clip put hello" will put the string hello into the clipboard. This is handy in several instances. One of which is motivated by Jean Pierre Daviau's comment below. We can add a "Send To" shortcut in explorer to copy any file's path. Go to an explorer window and type "shell:sendto" in the address bar.

image

This should display a list of shortcuts that are in the default "Send To" menu. Create a new shortcut there to clip.exe and give it a nice nice name such as "Send Path to Clipboard" and then edit the shortcut to have the command line argument "put" as well.

image

We are done. As a consequence we can right click on a file and now do:

image

The above instructions are for the Vista shell.It should be easy to find the equivalent for XP as well.

 

Download Clip Binary

Download Clip Sources

Saturday, March 14, 2009 7:18:35 AM (Eastern Standard Time, UTC-05:00)  #    Comments [5]  | 
 Monday, March 09, 2009

I recently had this dream, a nightmare if you please, that the chocolate factory is actually run by the Oompa-Loompas. There is no Willy Wonka, or at least not anymore! The Oompa-Loompas run the factory and they have a vague memory of what Willy Wonka was and so they try to be him; though they have to also run the mill and do the impromptu dances. The chocolate factory still makes great profits selling its chocolate, though Grandpa Joe feels that its not as wonderful as he remembers it. But what does Grandpa Joe know, he is an old man. Of course, the tragedy is that Charlie, who is actually Willy Wonka in disguise, is turned away because you actually have to be a Oompa-Loompa to work at Willy Wonka's Chocolate factory.

Fortunately this is all just a nightmare and nothing like this can ever possibly happen in real life. Phew!

Monday, March 09, 2009 12:31:57 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 Thursday, December 18, 2008

Penguin Logic

I saw this on the door of one of my Professors, Larry Moss, who is a mathematician and a logician. Couldn't help laughing. (I feel it should say "Therefore, Penguins are some old TV shows", anyhow..)

Thursday, December 18, 2008 7:22:17 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 Monday, December 15, 2008

For a while now I have been using the Sumatra PDF viewer on windows as opposed to Acrobat Reader (which is pretty much the standard). The main reason is this: when I am working with Latex or Tex and generating pdf documents Acroread is very annoying because it holds a lock on the PDF file. This means that part way during compilation pdflatex complains that is cannot open the PDF file for output. I then have to close Acrobat Reader, rerun pdflatex, and then open up the file and go to the particular page to see the changes. That entire hassle is eliminated with Sumatra PDF.

Sumatra PDF does not hold a lock on the file. Which means pdflatex runs to completion just fine. Further Sumatra detects that the PDF file has changed on disk and refreshes itself! When it does this refresh as far as possible it stays on the same page (it does not do an effective restart) and hence I can see the little edit I made immediately. Sumatra PDF is a bit slower that Acrobat Reader, has less features and has crashed on occasion. Despite that, it says me a large amount of time when working with Latex. Highly recommended for these purposes.

Sumatra PDF

http://blog.kowalczyk.info/software/sumatrapdf/

MikTex

http://miktex.org/

Monday, December 15, 2008 12:09:38 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2]  | 
 Monday, December 01, 2008

India has a odd situation with respect to politics and government. Most well educated people don't want to have anything to do with it. These fields are not considered 'good' or 'respectable' career options. The people who run the administration and drive the policy making are the ones who were the bottom of your high school or college class. No one who has the skills to be anything better considers politics to be a respectable enough life goal. While I was in India I thought this was normal and maybe even the right thing.

Why is this? In large part because we see the ugly side of our politics too often: the crudeness, the outright dishonesty, the corruption and the incompetence. "I don't want to be in there, fighting the pig in the mud".

Case in point: Growing up in Kerala I have heard this man  make too many inappropriate and distasteful comments on the state TV channels. He is the sort of textbook politician whose uncouth manner paints such a low picture of politics in my state that it deters most well to do people from having anything to do with him and his ilk.

Last week we had the terrorist situation in Mumbai that left everyone saddened and apprehensive of the future in the region. Mr Achuthanandan, who is currently the Chief Minister of the State of Kerala, shows up at the home of one of the commandos, Major Sandeep Unnikrishnan, who died fighting the terrorists. Why? To use a rather blunt metaphor, its a bit like a dog pissing on a pole to mark its territory - the obligated visited to show your solidarity and to establish your political presence.

The deceased Major's father decides that he does not want to entertain any such display in his house and he tells Mr Achuthanandan to leave. What would someone who truly felt for their loss do? What would someone who is touched by the situation in Mumbai and for those who lost their lives there do? And what does Achuthanandan do?

 

Major Unnikrishnan's father refuses to meet Kerala CM

Kerala CM insults slain Major's dad.

Monday, December 01, 2008 4:50:45 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 Thursday, October 09, 2008

American politics can be very interesting - a bit more that some of the popular sport here. Once in a while however you come across absolute gems, like this one by Amazon (seriously, this is on their homepage - sheer genius!):

image

And in the explanation of this is:

This Meter is Measuring...
This meter was calculated by comparing the all-time sales of the following groups of items.
   Republican: Waterford Holiday Heirlooms Republican Elephant Waterford
   Democrat: Waterford Holiday Heirlooms Democratic Donkey Waterford

"Waterford Holiday Heirlooms Democratic Donkey".... ha ha ha. Brilliant!

Thursday, October 09, 2008 3:52:41 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Wednesday, September 03, 2008

Google has released a new browser called Google Chrome. I had heard of this project a while back when I was working at Google and I have been hoping ever since that they release it so that I can finally get off Internet Explorer.

So Chrome is fast, feels light weight and uncluttered. After playing around with it a bit I have replaced IE as my default browser (finally). This is just their Beta 1 release but it feels so good.

logo_sm

There are a few things that I would like it to have such as integration with the fingerprint authentication service so that the logons I created previously work with Chrome as well.

You should try it out:
http://www.google.com/chrome/

There is a fun comic here about chrome:
http://www.google.com/googlebooks/chrome/

And many YouTube videos:
http://www.youtube.com/watch?v=JGmO7Oximw8
"Browsers need to get better because they were designed for an era when web pages were doing completely different things..". I agree.

 

I have heard from places that Chrome does not work well with Silverlight. Personally I don't care too much because I don't use Silverlight myself. I have never been convinced enough to install Silverlight because I felt that it would make an already slow and frustrating browsing experience degenerate a bit more. Which is interesting because now that Chrome is so fast i probably don't mind the penalty of Silverlight slowing it down a bit. So if some folk at MS write a good Silverlight plugin for Chrome arrogant little uns like me might try it out.

 

On Privacy

You should also read the privacy policy (if you care about such things). No, no one is stealing your passwords, but someone can be watching your "behavior":
http://www.google.com/chrome/intl/en/privacy.html

I for one have disabled the auto-suggestions feature as explained here: http://www.google.com/support/chrome/bin/answer.py?answer=95656&hl=en

Its a nice feature, but when I think through the implications, I'd rather not have it. Your mileage might vary.

 

Now can someone write a fast, lightweight and feature rich Email and Calendar app so that I can get rid of Outlook?

Wednesday, September 03, 2008 10:50:24 AM (Eastern Standard Time, UTC-05:00)  #    Comments [4]  |