Friday, February 15, 2013

gSpeak Chrome Extension

gSpeak is a simple Chrome extension. To install it click here. Once you install the extension you will see the gSpeak button on the Chrome toolbar:


Click on the button in the toolbar to speak the text selection in the webpage. If there is no text selection in the webpage, the webpage content is spoken. While the speech is in progress, the badge on the button shows the remaining percentage of the text to be spoken. Clicking on the button pauses the speech. Once paused, if you click on the button within one second the speech is cancelled. After one second, clicking on the button resumes the speech.

You can adjust the speech settings on the gSpeak Options page:



Enjoy!

Sunday, November 25, 2012

JavaScript Instance Diagram

For JavaScript code:

var obj = {};


[Note: __proto__ is available on Chrome and Firefox]

For JavaScript code:

function Rect(w, h)
{
    this.width = w;
    this.height = h;
}
Rect.prototype.area = function() {
    return this.width * this.height;
}
var rect = new Rect(2,4);


[Note: __proto__ is available on Chrome and Firefox]



Tuesday, October 30, 2012

Eclipse: Show all instances of implementors of selected Java Interface

UPDATE: Added support for showing instances of classes that have specified Annotations (e.g. @Resource) on them. Added support for not showing instances for a class if the number of instances is 0.

In this blog entry I talked about extension to Eclipse Java debugger to show all instances of selected Java Class in the Expressions view. Someone requested the support for showing all instances of objects that implement selected Java Interface. I have implemented that feature now. To fully understand the context see the original blog entry first. Then see the screenshots below:





You can install the plug-in from the plug-in's update site:

http://sandipchitaleseclipseplugins.googlecode.com/svn/trunk/AllInstancesUpdateSite

Enjoy!


Wednesday, October 24, 2012

Windows 7: Thin Vertical Taskbar


With the widescreen monitors I like to have my Windows 7 Taskbar positioned on the left edge of the monitor with Auto-hide turned on. There are many benefits of this:

  • With widescreen monitor the horizontal space is plentiful
  • Having the Taksbar on the left keeps it out of the areas where you may do mouse based activity. Having it on the right edge interferes with mouse based scrollbar activity

But no matter how much I try I cannot make it thinner than this:


I can make it very short when the Taskbar is horizontal:


How I wish I could make it thinner like this:


I got annoyed enough that I went googling and figured out a way that works for me. I am going to show you how. Just follow these step:

  • Set the taskbar settings like so:



Right-click on the taskbar and select Properties menu to show the Taskbar and Start Menu Properties dialog.

  • Create a file ThinTaksBar.bat with content:

echo ThinTaskbar
net stop "UxSms"
net start "UxSms"

It basically restarts the service "UxSms". This needs to be run as administrator. You can run the script manually with as administrator using the runas command like this:

> runas /noprofile /user:administrator ThinTaksBar.bat
  • To automate this create a scheduled task using Task Scheduler. Configure to run it with highest priviledges approximately 2 minutes after login like so:


Next time you log in, after a minute or so you will have the thin Taskbar.

Thats all folks!

Sunday, October 21, 2012

Eclipse: Enhanced Cut Copy Paste Plus Plug-in

UPDATE: Now supports paste from history using (CTRL+SHIFT+Alt+V on Widnows and Linux, COMMAND+SHIFT+OPTION+V on Mac)



In this entry I blogged about the Cut Copy Paste Plus Plug-in. I have enhanced it to hook into Eclipse's standard paste command. The first paste invocation works as usual. If the General > Editors > Cut Copy Paste Plus > Quick Paste cycles through History is selected, the the quick successive invocation (within the delay specified by General > Editors > Cut Copy Paste Plus > Paste next delay(milliseconds)) of standard Edit > Paste command (CTRL+V on Widnows and Linux, COMMAND+V on Mac) will paste the strings from history.

















This special behavior of paste can be toggled using the Toggle Quick Paste Cycles Through History command (CTRL+SHIFT+V on Widnows and Linux, COMMAND+SHIFT+V on Mac).

BTW this works in any StyledText and Text widgets.

You can install the plug-in from Eclipse Marketplace:

https://marketplace.eclipse.org/content/cut-copy-paste-plus

Enjoy!

Saturday, July 21, 2012

Eclipse: Clone Remote Systems View Plugin

The RSE Plugin for Eclipse has the Remote Systems View which allows you to look at local file system as well as remote files system using SSH. I use this to view the file system of remote Linux machines from inside my Eclipse IDE on my development machine. This comes very handy for dragging and dropping files between Package Explorer to the remote machine's file system. However if you want to copy files from one remote machine to another it can get tricky because you may have to autoscroll to drag and drop the files due to the long expanded trees shown in the same view. Well, I thought let me just clone the Remote Systems View, place the original and the cloned views side by side, scroll to the right place in the trees in each view and then simply drag and drop  the files. Alas, the Remote System View does not support the cloning. Bummer... No fear....I wrote a small Eclipse Plugin which allows you to do just that. The Clone View feature lets you clone the Remote Systems View as many times as you like. You can further rename each view to your liking, e.g. the name of the remote machine on which you want focus in that view.


Here is the screenshot which shows the original and cloned views focused on different directories on the local file system, but you get the idea:



Get it from the update site here: http://sandipchitaleseclipseplugins.googlecode.com/svn/trunk/CloneViewUpdateSite 
As always feedback welcome. 
Enjoy!  

Thursday, July 19, 2012

Tip: Installing JDK RPM on linux and actaully using it


Oracle puts out JDK updates every now and then. The Linux update comes in the binary form (for install in any directory) and RPM form. I like RPM format because it plugs into OS's standard package installation mechanism. So I downloaded the RPM from here and installed it using:
> chmod u+x jdk-6u31-linux-x64-rpm.bin
> ./jdk-6u31-linux-x64-rpm.bin
:
:
:
and went to command line and typed:
> java -version 
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-48)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Huh? I had presumed that installing the RPM will do the right thing. Uh uh.
Sure enough:
> ls -l /usr/bin/java lrwxrwxrwx 1 root root 22 Apr 13 11:35 /usr/bin/java -> /etc/alternatives/java
> ls -l /etc/alternatives/java lrwxrwxrwx 1 root root 30 Apr 13 14:13 /etc/alternatives/java -> /usr/lib/jvm/jre-1.4.2-gcj/bin/java
revealed that java command was linked to  jre-1.4.2-gcj java.
Apparently you have to run the following commands to make the newly installed  java and javac as available alternatives.
> update-alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_31/bin/java 3000
> update-alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_31/bin/javac 3000




Now to see what all Java alternatives are available you can run:
> update-alternatives --display java
java - status is manual.
 link currently points to /usr/lib/jvm/jre-1.4.2-gcj/bin/java
/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1420
 slave keytool: /usr/lib/jvm/jre-1.4.2-gcj/bin/keytool
 slave rmiregistry: /usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry
 slave jre_exports: /usr/lib/jvm-exports/jre-1.4.2-gcj
 slave jre: /usr/lib/jvm/jre-1.4.2-gcj
/usr/java/jdk1.6.0_31/bin/java - priority 3000
 slave keytool: (null)
 slave rmiregistry: (null)
 slave jre_exports: (null)
 slave jre: (null)
Current `best' version is /usr/java/jdk1.6.0_31/bin/java.




And finally to select which java to use - use the command:
> update-alternatives --config java
There are 2 programs which provide 'java'.
  Selection    Command
-----------------------------------------------
 + 1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
*  2           /usr/java/jdk1.6.0_31/bin/java
Enter to keep the current selection[+], or type selection number: 2 


Select the one from the list and type ENTER. Then do:
> update-alternatives --config javac
:
:

and viola! Now the system will use the Java you selected.
Hope this helps you!

Wednesday, July 04, 2012

Lamps


Here are some
Lamps
I made recently

Tuesday, June 26, 2012

Oops sculpture

Whimsical Oops Sculpture
made from from 
twigs
and
Birch wood slice


Saturday, June 23, 2012

Dancer Sculpture

Dancer Sculpture
 made from from 
twigs
and
Birch wood slice
I tried to use the slope of
the Birch wood slice
to give a sense of 
movement
to 
the Dancer

Wednesday, February 01, 2012

Eclipse: Cut Copy Paste Plus Plug-in

The Cut Copy Paste Plus Eclipse Plug-in enhances the cut, copy functionality by recording the history of the text that was cut or copied. It enhances the paste functionality by allowing you to paste the text from the history. To use the cut and copy history functionality you do not have have to do anything special. To access the special paste functionality you have to invoke Paste Plus command which is by default bound to Ctrl+Shift+V on windows and linux and Command+Shift+V on mac. You can change the keybindings to liking using the Preferences > General > Keys preference page. When you invoke this command the text that was last copied is pasted. If you re-invoke the same commands within a short period of time (default 1 second) - the text from the history is pasted.

The behavior of the plug-in can be configured in the Cut Copy Paste Plus preference page:


In the following example I copied the words three, four and five. Then I invoked the Paste Plus command. The first time it pasted five :

Ctrl+Shift+V
 

Then I invoked the same command quickly and it pasted four :

Ctrl+Shift+V (within 1000 millisecond)

  Then I invoked the same command quickly again and it pasted three :

Ctrl+Shift+V (within 1000 millisecond )

BTW this works in any StyledText and Text widgets.

You can install the plug-in from Eclipse Marketplace:

https://marketplace.eclipse.org/content/cut-copy-paste-plus

Enjoy!

Saturday, December 31, 2011

Code Clips Eclipse Plug-in

The Code Clips Eclipse Plug-in lets you create code clips on the fly and associate abbreviations with them. The abbreviations are expanded using the TAB key.



If there is more than one abbreviation that matches the prefix before the caret then a content assist style popup is shown. You may select the item in the popup by clicking on it or typing it's ordinal number. Once selected the expansion associated with the selected abbreviation is inserted in place of the prefix.



The expansion text may contain the following variables:



The numbered variables ${1} through ${9} act as tab stops. The ${clipboard} variable will be replaced by the contents of the clipboard at the time of expansion. You can use the Variablize... dialog to convert multiple occurrence of same word into a variables. All occurrences of the same variable can be edited together using the Linked editing support of Eclipse editors.

To create a code clips use the Edit > Create Code Clip menu item


or use Control+5 (windows and linux) or Command+5 (mac) keyboard shortcuts. This will show the Create Code Clip dialog.


If you had any text selected in the editor that will be populated in the Expansion text area. You may insert the above mentioned variables using the Insert Variables menu button.

You can manager the Code Clips using the Manage Code Clips dialog which can be invoked by clicking on the Manage... button in Create Code Clips dialog :


The Code Clips Eclipse Plug-in is available on Eclipse Marketplace!

Tuesday, December 27, 2011

UPDATED:One-click editor splitting in Eclipse

In the One-click editor splitting in Eclipse post I blogged about a simple Eclipse plug-in that lets you split the active editor. I have updated the plug-in to let you split the active editor with any other editors in the same tab. The functionality is available in the Split Editor toolbar's Horizontal and Vertical split button's drop down menu.


The updated Split Editor Plug-in is available on Eclipse Marketplace!

Saturday, December 10, 2011

TIP: Stable history navigation using Eclipse toolbar

Eclipse has a nice location history navigation toolbar. By repeatedly clicking on the history toolbar buttons you can quickly navigate to the locations the cursor/focus was at in various editors that are open. Unfortunately, out of the box, the position of the history navigation toolbar buttons is not stable if you have files of varying types open in the editor area. That is because the toolbar contributed by various editors are shown and hidden as the focused editor changes. These editor contributed toolbars (shown in blue rectangle below), when shown, are inserted to the left of history navigation toolbar. The following two screenshots demonstrates the behavior.



Fortunately there is a way to fix this behavior. It is possible to to drag the editor toolbar to the right-most side of the toolbar strip like shown in the following screenshot:



With this adjustment the history navigation toolbar remains in same place making it easier to use.

You may have to unlock the toolbars to see the drag handles as shown in the screenshot below:


I think this should be the default location of editor toolbars in Eclipse. Just filed this enhancement.

Such small adjustments makes the tool more productive.


Sunday, December 04, 2011

Selection Explorer Eclipse Plug-in


This Selection Explorer feature shows information about:
  • Active Part (this is somewhat similar to Plug-in spy action)
    • Part name
    • Part Id
    • Class implementing the part
    • Super class of the class implementing the part
    • Interfaces
    • Contributing Plugin
  • Active Selection
    • Class of selection objects
    • Superclass of selection object
    • Interfaces
    • Adapted Types
    • toString() value
  • Active Contexts
  • Active ActionSet Contexts

in the Selection Explorer view. Here are some screenshots:


Clicking on the hyperlinks shows the Open Type dialog:


Thursday, December 01, 2011

Close Views Eclipse Plug-in


The Close Views feature provides commands related to closing views:
  • Window > Close (active) View - This closes the last active view.
  • Window > Close All Views in Tab - This closes all views in the tab containing the last active view.
  • Window > Close Other Views in Tab - This closes other views in the tab containing the last active view.
  • Window > Other Views -  This closes all views except the last active view.
  • Window > Close All Views - As such this closes all the open views. If all the views are already closed it offers to reset the perspectives.
Here is a screenshot:



Update site:
http://sandipchitaleseclipseplugins.googlecode.com/svn/trunk/CloseViewsFeatureUpdateSite/site.xml

Also on Eclipse Marketplace.

Monday, November 28, 2011

Path Tools Eclipse Plug-in Updated


What is new?

  • Added support for Copy Path, Explore and Command Line Shell actions to local resources in RSE (needs RSE)
  • Added Copy SVN URL for resources in SVN based projects (needs Subclipse)

Read more here.

Wednesday, July 13, 2011

Google Factor

Recently I joined the Google+. Today I got an invite for Google Music. Was looking at my Google Accounts page and realized so much of our life is on Google based services.

Just came up with a new term - Google Factor or GF for short

Google Factor, noun
GF, acronym

definition:
  • Percentage or ratio of your waking life that involves Google services
usage:
  • What is your GF?
  • Just signed up for new Google Service FOO, now my Google Factor is .37.
Kind of scary!

Friday, June 17, 2011

Eclipse: Key Strokes display utility

Key Strokes is a simple Eclipse plug-in to display the typed Key Strokes in a small, always-on-top window. Useful for doing Eclipse screen casts no matter which platform you are on. Only works when working inside Eclipse.



You can install the plug-in from it's update site:

http://sandipchitaleseclipseplugins.googlecode.com/svn/trunk/KeyStrokesUpdateSite

Please file any issues at:

http://code.google.com/p/sandipchitaleseclipseplugins/issues/list

Enjoy!

Saturday, June 04, 2011

Eclipse: Command Key binding Cross Reference

I dusted off an Eclispe Plug-in that I had developed a few years ago. The idea is similar to Emac's describe-key (Ctrl+h) and where-is (Ctrl+w) but applied to Eclipse with some additional bells and whistles.

The  Command Key binding Cross Reference Plug-in shows a pop-up dialog. The dialog can be invoked in two modes:
  • Key binding centric
  • Command centric
Key binding centric mode can be invoked by clicking on the keys icon (Ctrl+Alt+Shift+K) in the status bar. It shows the following pop-up dialog:



The focus is in the Keysequence: field. You can type any modified keys and it shows the key sequence in text for e.g. Ctrl+D in the screenshot above. The BACKSPACE works normally. If you want to enter the BACKSPACE key itself use the small left arrow menu next to the Keysequence: field. In the bottom table it shows all the commands that match the key  sequence text. The current hierarchy of contexts, platform, and some help info is shows in the legend at the bottom. For example, the legend is showing that the Editing Java Source context is the most active context. The commands applicable in the context are shown in normal font. The commands not applicable in any of the active contexts are shown in disabled font. You can invoked the active commands by double clicking on the row or selecting the row and typing Enter key.

Eclipse has different key binding schemes. You can explore the key bindings of other schemes by selecting it in the Scheme: combo box.

You can type the keys without any modifiers. In that case commands matching all modifier variants of the key sequence are shown:



This can help you see if you are defining the key binding modifiers in a consistent fashion.

Command centric mode can be invoked by clicking on the keys icon(Ctrl+Alt+Shift+L) in the status bar. It shows the following pop-up dialog:



In this mode the Command: field has the focus. You can just type part of the command name and it will filter out the matching commands. To anchor the match at the beginning use the ^. You can use the * and ? as the wildcards. You  can easily switch Key binding centric mode by hitting tab.

Lastly, the P column shows the icon of the platform if the command is defined for a specific platform such as Windows, Macor Linux. The U column shows the icon if the user has customized the key binding using Preferences > General > Keys.

You can install the plug-in from it's update site:

http://sandipchitaleseclipseplugins.googlecode.com/svn/trunk/commandkeybinding.xref.updatesite


Please file any issues at:

http://code.google.com/p/sandipchitaleseclipseplugins/issues/list


Works in Eclipse 3.5.x and 3.6.x.

Enjoy!