Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts

Tuesday, May 3, 2011

LUA tutorial / newbie, nob getting started and advanced links.

NOB? here you go:

Fast start

Know your LUA

Reference cards

A bit more advanced stuff
Integrating LUA with Eclipse
Hope this helps.

Thursday, April 7, 2011

GUIDE: TDD unit testing tools for Tcl

As promised in http://shloemi.blogspot.com/2011/03/tdd-tools-for-tcl.html here is my experience with tcltest package and eclipse.


The story
Suppose we have a function called 'bits_serialize'.

This function should serialize a given data into bits_per_io bits per package (for examples see the tests below and what they return).

This function have the following signature:  bits_serialize {bits_per_io description}, where:
  • bits_per_io
    • How much bits each package have.
  • description
    • a pair of {data bits}, where:
      • data 
        • the data we want to serialize.
      • bits
        • the size, in bits, we want to serialize this data.
let's test this function using tcltest...

Test code
# Generated using http://pygments.org/
source unit-under-test.tcl ;# contains the definition of bits_serealize 

test base--always-ok {This is as simple as it gets.} -constraints {
} -setup {
} -body {
 return TRUE
} -cleanup {
} -result TRUE

test bits_serealize--partial-quanta {description here...} -constraints {
} -setup {
} -body {
 return [bits_serealize 32 " 0x01 16 "]
} -cleanup {
} -result [list 1]

test bits_serealize--full-quanta {description here...} -constraints {
} -setup {
} -body {
 return [bits_serealize 32 " 0xFFFFFFFF 32 "]
} -cleanup {
} -result [list [ format "%u" 0xFFFFFFFF ]]

test bits_serealize--over-quanta {description here...} -constraints {
} -setup {
} -body {
 return [bits_serealize 32 " 0x060504030201 64 "]
} -cleanup {
} -result [list [ format "%u" 0x04030201 ] [ format "%u" 0x0605 ]]

test bits_serealize--way-over-quanta {description here...} -constraints {
} -setup {
} -body {
 return [bits_serealize 32 " 0x060504030201 320 "]
} -cleanup {
} -result [list [ format "%u" 0x04030201 ] [ format "%u" 0x0605 ] 0 0 0 0 0 0 0 0]

test bits_serealize--cross-quanta {description here...} -constraints {
} -setup {
} -body {
 return [bits_serealize 32 "
  0xFF 1
  0xFF 2
  0xFF 3
  0xFF 4
  0xFF 6

  0x04030201 32
 "]
} -cleanup {
} -result [list [ format "%u" 0x201FFFF ] [ format "%u" 0x403 ]]

test bits_serealize--quanta-and-half {description here...} -constraints {
} -setup {
} -body {
 return [bits_serealize 32 "
  0xFFEEDDCCBBAA 48
 "]
} -cleanup {
} -result [list [ format "%u" 0xDDCCBBAA ] [ format "%u" 0xFFEE ]]


eclipse-unit-testing

Results

++++ base--always-ok PASSED
++++ bits_serealize--partial-quanta PASSED
++++ bits_serealize--full-quanta PASSED
++++ bits_serealize--over-quanta PASSED
++++ bits_serealize--way-over-quanta PASSED
++++ bits_serealize--cross-quanta PASSED
++++ bits_serealize--quanta-and-half PASSED

My impression 

I definitely recommend using this unit!! and to my surprise eclipse supports it built in (see picture ==>).

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

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

Tuesday, February 22, 2011

Guide: Connect Eclipse to SVN

Installing SVN for Eclipse


Eclipse->Menu->Help->Install new software...click
Work with='http://download.eclipse.org/releases/helios'
Collaboration... select the following (click the picture for details...):



1. Subversive revision graph.
2. Subversive SVN Integration for Mylyn project.
3. Subversive SVN JDT Ignore Extensions.
4. Subversive SVN Team Provider.
Next...Next...Accept licence...Finish.

Select the appropriate SVN connector (native or Java base, and the appropriate SVN version) and follow the instructions according to your selection.

Using SVN


Connecting to an existing SVN repository


Eclipse->File->Import...SVN->Project from SVN...
URL:...Browse...
Authentication...if needed.
Next...Finish...Follow the instruction.

Connect your project to an existing SVN


Eclipse->Right click the wanted project->Team->Share Project...->SVN->Next
URL: Paste the SVN repository path...Browse...Select SVN path...
Next...Follow the wizards...
Your done.

Sunday, February 20, 2011

Guide: Setting up Eclipse with DLTK and ActiveState to debug TCL.

Let's start working...

Download and install Eclipse SDK
1. Download Eclipse (I used 'Eclipse IDE for Java Developers').
2. Unzip (or install, depends on the download type) to your favorite location.

Download and install DLTK
3. Run Eclipse.exe from that location.
4. Menu->Help->Install new software...
5. Right of 'Work with:' click the 'Add' button.
6. In the name enter 'DLTK'
7. location = 'http://download.eclipse.org/technology/dltk/updates/'
8. Click OK and wait a few seconds for the Eclipse environment to fetch the versions.
9. Select the appropriate version (for 'Helios Eclipse SDK' (version 3.6.1) I used DLTK 2.0v). Note: You can select the minimum for TCL (listed below), I selected all the DLTK.
10. Next.. Next ... Accept the license agreement, Wait for the download to finish.

here is a minimum list i found to install TCL DLTK:
>>> Dynamic Language Toolkit – Core Frameworks
>>> Dynamic Language Toolkit – Core Frameworks SDK
>>> Dynamic Language Toolkit – iTCL Development Tools
>>> Dynamic Language Toolkit – iTCL Development Tools SDK
>>> Dynamic Language Toolkit – TCL Development Tools
>>> Dynamic Language Toolkit – TCL Development Tools SDK
>>> Dynamic Language Toolkit – XOTcl Development Tools
>>> Dynamic Language Toolkit – XOTcl Development Tools SDK

Setting up Eclipse Tcl interpreter
11. Download and install TCL Shell and interpreter.
12. Using Eclipse IDE: Menu->Window->Preferences->TCL->Interpreters
13. click 'Add'
1. Name='TCL'
2. Browse... path to the Tcl interpreter executable (I've installed it at '')

Setting up Eclipse Tcl debugger
14. Install 'Komodo remote debugger'
15. Using Eclipse IDE: Menu->->Window->Preferences->TCL->Debug->Engines->Active State
16. Under 'Paths' tab->'External debugger engine'->Path->...->Select the debugger path and file ('dbgp_tcldebug.exe' for windows).


Now you are all set. You should be able to choose new TCL project, write your Tcl code and debug your programs.

Other posts used to create this instalation guide:
* http://blogsai.wordpress.com/2009/10/15/configuring-eclipse-as-tcltk-ide/
*

Have fun...