11 March 2015

Eclipse (Rational) stuck on cleaning/building workspace forever

..or at least seems so.

Sometimes - usually with complex projects including mutiple sub-projects open in RAD/Eclipse - your IDE gets stuck on Building workspace or even Cleaning projects at various stages (in my case it was 100%) and despite Progress bar showing undergoing work, it would never end. Also, you are unable to close the IDE in a normal manner, only killing the process can end it and after restart, build/clean re-starts automatically up to no avail, to get you stuck again.

There a few things you can do about it:


  1. level: NEAT
    try starting RAD/Eclipse with -clean -clearPersistedState flags. it will cause removal of unused artifacts and rebuild the indexes
  2. level: ROUGH
    go to .metadata/.plugins/org.eclipse.core.resources/.root/.indexes and delete all contents (3 files) and restart your IDE. it will see indexes physically wiped so will rebuild them from the scratch
  3. level: VILLAIN
    go to .metadata\.plugins\org.eclipse.ui.workbench and rename workbench.xml to other name, like workbench.xml.bak . It will remove all existing workspace-lifetime artifacts and will revert you to default perspective after re-launch, but it seems to do wonders in terms of unblocking existing zombie artifacts
Just be careful, always do backups when messing with .metadata files in case IDE throws any nasty errors at you at the next re-start (yeah, it happens)

Good luck!

12 January 2015

Obscured by the cloud - why google hides functions in API docs ???

Just a quickie. I need to make a few Google Sheets scripts for some side projects, and struggle finding some basic low-level tools in Google API docs. For instance, you can't find String object documented....but it's still in there.

So I managed to successfully use function such as

toDateString
substring
indexOf

wondered why, and probable answer (not obvious to me) is that they are supported as a part of JavaScript which you can use in Google Script editor. Seems google just went so abstract in what they want developers to use form Google API services and apps that they dropped maintaining documentation for generic stuff like above. It causes some confusion, at least for me (I haven't been following any updates for devs from g's side).

Next time I will just remember.

Anyway, if you want to convert a cell contents which behind the scenes is stored by the sheet as:

Thu Dec 11 2014 01:00:00 GMT+0100 (CET)

to some more human readable form

use toDateString which yields

Mon Jan 12 2015

straight from JS: http://www.w3schools.com/jsref/jsref_todatestring.asp

or put his bit of code:

var month = data[row][col].getMonth() + 1;
var neatDate = data[row][col].getDate() + "/" + month +"/" + data[row][col].getFullYear();


good luck!