Monday 7 September 2009

Single Word Suggest Oracle

* This is kind of a data dictionary for the type ahead search box providing suggestions.

This is kind of a data dictionary for the type ahead search box providing suggestions.

This file is similar to the class MultiWordSuggestOracle provided by GWT. The behaviour of the GWT class was different from what was needed. Extending the class was not an option since many methods were private. Also member variables were private without any getters or setters.

The name Single Word Handler explains the purpose of class. Normally all characters are used in matching.

Tuesday 11 August 2009

Performance/ Optimization Tips

General


1. When testing for memory or timings, the first open of a document after bouncing server, always takes huge amount of resources. Hence this one should be ignored for the time being. But you should look into it atleast once to see if the first open can also be optimized.
2. When unsure of the results, perform the same scenario about 10 times to reach a conclusion

Accessibility links

W3ORG Specs:


  1. Quick Tips - http://www.w3.org/WAI/quicktips/
  2. Live Regions - http://www.w3.org/TR/aria-state/
  3. Eg of Live Regions: - http://www.alistapart.com/articles/waiariahttp://accessibleajax.clcworld.net/
  4. RIA - http://www.w3.org/TR/aria-roadmap/
  5. Report on WAI Markup for AJAX Live Regions - http://developer.mozilla.org/en/docs/AJAX:WAI_ARIA_Live_Regions
  6. ARIA Reference Implementation - http://test.cita.uiuc.edu//aria/

Shortest code to read entire file

I don't remember where I had read this, but this in undoubtedly the smallest piece of code for reading the whole file.
Scanner loScanner = new Scanner(new File("C://Fazeel-C//MSS//workspace//FastTreeProj//src//sample//JSONs.txt"));
loScanner.useDelimiter("\\Z");
String wholeFile = loScanner.next();       
loScanner.close();