Wednesday, March 30, 2011

Tcl nob, newbie beginners tutorials list.

Just found these good looking tutorials for beginners and thought it will help someone...


I'll update when I find more...

Tcl, Read dynamic variables

I've just solved another Tcl mystery I had from day one in Tcl (around 2 months :)
It was not critical until today!

Example
set qwe.qaz.1 Hello
set qwe.qaz.2 From
set qwe.qaz.3 ShloEmi

set wanted_qaz 3
upvar 0 "qwe.qaz.${wanted_qaz}" wanted_qaz_val
set this_will_be_ShloEmi $wanted_qaz_val

Hope this helps...

Tuesday, March 29, 2011

GUIDE: tclunit/TDD for Tcl, usage and examples.

As promised (tdd-tools-for-tcl.html) here is my humble experience/research with tclunit.

Guides / tutorials found



Research results

Usage example

Have fun...

Sunday, March 27, 2011

GUIDE/TWEAK: Improve Eclipse load time

In my old station Eclipse load around 35~37 seconds. This is slow!
After a short research I've found that there is a way to speed things up...
After executing this steps I've improved the load time to ~11 seconds.

Uninstall unnecessary plugins
  1. Eclipse menu -> Help -> Install New Software
  2. On the lower right you'll find 'what is already installed?' Click it.
  3. On the 'Installed Software' tab select the wanted plug-ins and select 'Uninstall...'.
  4. Follow the instructions...


Configuring the Eclipse.ini file to improve performance.
NOTE - Execute the following steps on your own risk!! I'm not responsible (It works for me).

  1. Close Eclipse
  2. Goto your Eclipse root folder.
  3. MAKE COPY / DUPLICATE THE ORIGINAL 'eclipse.ini' FILE before moving to the next step!!!
  4. Edit the file 'eclipse.ini' to contain the folwing text:
-data
C:/Devenv/Devenv eclipse workspace
-showlocation
-showsplash
org.eclipse.platform
--launcher.defaultAction
openFile
-vm
C:/Program Files/Java/jre6/bin/client/jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Declipse.p2.unsignedPolicy=allow
-Xms128m
-Xmx384m
-Xss4m
-XX:PermSize=128m
-XX:MaxPermSize=384m
-XX:CompileThreshold=5
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+CMSIncrementalPacing
-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC
-XX:+UseFastAccessorMethods
-Dcom.sun.management.jmxremote
  • If any thing goes wrong - use the duplicated file you made at step 4!!


Have fun...

Solution sources

Friday, March 25, 2011

TDD unit testing tools for Tcl

After committing my first 'big' feature to my current employee, I got a feeling that something was left behind in the heat of the rush. That think was, of course, the new code test coverage.

That lead me to try and find tools / guidance for Tcl TDD.

Here are the things I've found for Tcl:

  1. A very good TDD tutorials found
    1. http://www.agiledata.org/essays/tdd.html
    2. http://geosoft.no/development/unittesting.html
  2. TDD tools for Tcl
    1. Wiki comparison of available tools for Tcl -  http://en.wikipedia.org/wiki/List_of_unit_testing_frameworks#Tcl
    2. tclunit - http://www.tcl.tk/man/tcl8.4/TclCmd/tcltest.htm
      1. Download here - http://sourceforge.net/projects/tclunit/

Thats all, not much. I intend to check tclunit, experience with it and report back later on... see Y'a.

Wednesday, March 23, 2011

Guide: Drawing graph for free using GraphViz opensource lib.



  • file.dot


digraph G {
Yehiel -> Shlomi;
Aviva -> Shlomi;

David -> Rotem;
Ilana -> Rotem;

Shlomi -> Yeara;
Rotem -> Yeara;
}



  • Command line example

drive:> "c:\Program Files\Graphviz path\bin\dot.exe" -Tbmp file.dot -o out.bmp


  • Output (out.bmp)
(see above ...)

Saturday, March 19, 2011

Tcl documentation

After 2-3 days of research, analyzing the available options and trying to work with some doc tools - here is my conclusion for Tcl documentation:

ROBODoc
Homepagehttp://www.xs4all.nl/~rfsber/Robo/
Wiki          - http://en.wikipedia.org/wiki/ROBODoc


Impressions
  • VERY easy
  • Clean documentation
  • Various output types (PDF, HTML, CHM, ...)
  • Supports many languages (If you manually configure it I believe it can support any language). 

I've also tried Doxygen
Prons
  • After spending 1/2 a day i gave up configuring it with Tcl.
  • The documentation in the code should have special chars 
    • Ugly inline documentation
    • When pressing F2 (function quick help) this ugly characters make the documentation more ugly.
  • At this stage I gave up.

Major resource pages 

Monday, March 14, 2011

Guide: Tcl documentation / manuals for Eclipse

This is very helpful and reduces the time it takes to open IE + open the Tcl help web page + typing the wanted Tcl command +++...

Here are the steps
  1. download the appropriate Tcl manuals from here
  2. unzip the html files to an appropriate location.
    • for our example: 'C:\Tcl\doc\html'
  3. open eclipse, Menu->window->preferances->Click
  4. Tcl->Man Pages->Configure->Add->Click
  5. Alternatively, in the filter type: 'man' t\and select Tcl/Man pages.
  6. Name: Tcl/Mans
  7. Add->Click
  8. Folder: 'C:\Tcl\doc\html'
  9. Ok, Ok, Ok


Test it
press F2 on the 'proc', 'set' or 'lappend' keywords to start using the help...

Enjoy...

Sources
1. Tcl manuals
2. The guide I used to connect eclipse and the Tcl manuals