Neatware Header

MyrmecoX
Professional
Tcl/Tk IDE

Enterprise
Server,Runtime

Ladybug
StudioXP
Video Control

PlayerXP
MPEG,AVI,VCD

Snaml
Java
J2EE,XML,JSP

Tcl
XHTML,WML

Applications

    Expect Database Java COM GUI Network Web Services Itanium
  1. Expect


  2. Expect is a tool for administration and testing automation such as telnet, ftp, and password. The Expect in the Myrmeco XP worked better on Windows NT, 2000, and XP platforms.

    • Test Automation
    • By using tcltest package you can complete regression test for Java or other C++ packages. You can rapidly develop testing code under the Myrmeco XP to test serial port, Ethernet card, DSL/cable modem and other network devices. Myrmeco XP can also help developers to test switch, router, and embedded systems automatically.

      "Tcl, is a secret weapon used by large network hardware corporations to test their devices." by Michael J. Norton, Cisco Corp.

    • Administaration Automation
    • You may use Myrmeco XP to write and test scripts that complete the tasks of administarator. For example, you can write expect scripts to automating the configuration Cisco routers and switches under the Myrmeco XP in your notebook. So you can do remote and mobile configuration and testing.

    • A Simple Example
    • This Expect example shows how to launch several Notepad programs, gets process id, waits for seconds, and then closes all processes. You can edit following code and execute Run expect item under the Build menu. It shows the potential to integrate your applications with Expect under Myrmeco XP.

      Use expect package. spawn, close, and wait.

      package require Expect
      

      set timeout variable to -1 so no timeout to execute the code. The default timeout value is 10. Usually this is the first statement! n is the number of spawned processes.

      set timeout -1; set n 2
      

      launch n Notepad programs by spawn command; store process id in sp array with index from 0 to n; and wait 10 secondes.

      for {set id 0} {$id < $n} {incr id} {
        spawn -noecho notepad.exe; set sp($id) $spawn_id
      }
      
      after 10000
      

      close all processes. The -i tag indicates that the next argument is a process id. Use wait to make sure the close be finished.

      for {set id 0} {$id < $n} {incr id} { 
        close -i $sp($id); wait -i $sp($id)
      }
      
  3. Database [^]


  4. In Myrmeco XP you can use Oracle database through Oratcl connector and other database such as DB2, SQL Server, and Access through ODBC connector. You can integrate the database, Java, and extensions within an application.

    • Oracle
    • Oratcl connector oratcl is a special extension for ORACLE database in Myrmeco XP. It allows you use special features of Oracle.

      Following example uses the sample database in the Oracle8i.

      package require Oratcl
      

      logon to POLITE database

      set logstr "SYSTEM/NULL@ODBC:POLITE"
      set logon [oralogon $logstr]
      

      open statement handle

      set h [oraopen $logon] 
      

      call sql and output the result

      orasql $h "select ename, job from emp order by job"
      orafetch $h { puts [format "%s %s" @1 @2]}
      

      close statement handle and logoff

      oraclose $h
      oralogoff $logon
      
    • ODBC
    • You can connect to any database with ODBC driver with ODBC connector tclodbc in Myrmeco XP. Since almost all the database like Oracle, SQL Server, DB2, Sybase, and MySQL support ODBC under Windows, you can use ODBC connector to access these database.

      Below example creates a new Access database in current directory, sets its datasource as testdb, and builds some tables.

      package require tclodbc
      
      set driver "Microsoft Access Driver (*.mdb)"
      set dbfile testdb.mdb
      set dsn TESTDB
      

      create datasource with driver, dbfile, and dsn.

      proc create_datasource {driver dbfile dsn} {
        if {![file exists $dbfile]} {
          database configure config_dsn \\
            $driver [list "CREATE_DB=\"$dbfile\" General"]
        }
      
        database configure add_dsn \\
            $driver [list "DSN=$dsn" "DBQ=$dbfile"]
      }
      

      remove datasource

      proc remove_datasource {driver dsn} {
        database configure remove_dsn $driver "DSN=$dsn"
      }
      

      create tables

      proc create_tables {db} {
        $db "CREATE TABLE Table (
             IntData INTEGER, CharData CHAR (20), DateData DATE)"
        $db "CREATE UNIQUE INDEX TableIndex0 ON Table (IntData)"
        $db "CREATE        INDEX TableIndex1 ON Table (CharData, DateData)"
      }
      

      connect to datasource, and create a database as well as tables.

      database db $dsn
      create_datasource $driver $dbfile $dsn
      database db $dsn
      create_tables db
      

      close database

      db disconnect
      
  5. Java [^]


  6. You can use Java classes with the help of tclblend in Myrmeco XP. For example,

    • Call AWT
      package require java
      

      create an awt frame

      set f [java::new java.awt.Frame]
      $f setTitle "Hello World!"
      

      create an awt textarea, write text, and add to component

      set text [java::new java.awt.TextArea]
      $text setText "Java text example in Myrmeco XP."
      $f {add java.awt.Component} $text
      

      set frame position, pack and show

      $f setLocation 256 100; $f pack; $f toFront; $f show
      
    • Java Regression Testing
    • Following example shows how easy to use Myrmeco XP to test the Java codes with tcltest.

      package require java
      package require tcltest
      

      Test Java charAt() method. "1.1" is the name, or identifier, of the test.

      tcltest::test 1.1 {java.lang.String.charAt() method work?}  { 
      

      test and compare the return result. If the 7th char is not H, the test will return an error result. We can write any test scripts in the test body.

      	set s [::java::new String "I am a Java String"]
      	$s charAt 7 
      } H
      
  7. COM [^]


  8. COM is a Microsoft standard for the components on Windows. Many Windows applications such as Excel and Word provide COM Automation which allows third party developers to use the functions in them. There are many COM components available as well and you can use them to construct large applications. Myrmeco XP includes tcom which is an COM connector to allow you use COM components.

    Below examples demonstrate how to launch a Windows application and control them.

    • Launch IE with URL
    • This example launches IE and visit Neatware website.

      package require tcom
      

      create an IE object app, set it visible, and navigate it.

      set app [::tcom::ref createobject "InternetExplorer.Application"]
      $app Visible 1; $app Navigate "http://www.neatware.com" 
      

      release app object

      ::tcom::release $app
      
    • Use Windows Script Hosting
    • This example demonstrates how to use WSH to control the action of the Calculator. load tcom, close Tk window, and hide the errors.

      package require tcom
      catch {wm withdraw .}
      

      open WinShell object and run Calculator program in windows.

      set wshell [::tcom::ref createobject WScript.Shell]
      $wshell Run "calc"
      

      active Calculator, wait 2 seconds, input digital 9, /, and 7, and see the result.

      $wshell AppActivate "Calculator"; after 2000
      $wshell SendKeys "9{/}"; after 2000
      $wshell SendKeys "7"; after 2000
      $wshell SendKeys "~"; after 2000
      $wshell SendKeys "%\\"
      

      close object

      ::tcom::release $wshell
      
  9. GUI [^]


    • Myrmeco XP supports TK for rapid and dynamic GUI development for cross platforms. BLT extension in Myrmeco XP will help you generate wonderful and zoomable graph, barchart, and other curves for EDA and CAD applications. BWIDGETS extension allows you use advanced widgets in Myrmeco XP. Finally ITCL and IWIDGETS may help you develop GUI applications in object-oriented organization.

  10. Network


  11. Myrmeco XP provides powerful support for the development of client/server applications through network. The Execute wish item in the Build menu allows you run several clients and servers. The TCP/IP and Socket support in the Tcl makes you develop and test network applications easily and rapaidly.

    • Echo via Socket

      Below example starts a server and waits client to send a string and echo back to client.

      Server

      callback function must have three parameters: socket handle, address, and port.

      proc callback {sock addr port} {
      	fconfigure $sock -translation lf -buffering line
      	fileevent $sock readable [list echo $sock]
      }
      

      echo fuction reads from socket and puts the line back.

      proc echo {sock} {
      	global var
      	if {[eof $sock] || [catch {gets $sock line}]} {
      		close $sock; set var done
      	} else {
      		puts $sock "$line"; puts "show echo: $line"
      	}
      }
      

      init socket and wait done.

      set port 2800
      set sh [socket -server callback $port]
      puts "socket is ready"
      vwait var; close $sh
      

      Client

      open a client socket in localhost.

      set host localhost; set port 2800
      set s [socket $host $port]
      fconfigure $s -buffering line; puts $s $host
      
  12. Web Services [^]


  13. You can use Web Services and provide a Web Services by using the SOAP package in the Myrmeco XP.

    • SOAP Client
    • This example demonstrates a Web Service that converts F degree to C degree.

      package require SOAP	

      connect a web service and return an handle wsTemp.

      set wsTemp  ::SOAP::create C2F \\
          -uri    "http://www.soaplite.com/Temperatures" \\
          -proxy  "http://services.soaplite.com/temper.cgi" \\
          -params { "temp" "float"} \\
          -name   c2f
      

      input C degree, return F degree from [-40, +40)

      for {set i -40} {$i < 40} {incr i} {
        puts "C:$i = F:[$wsTemp $i]"
      } 
      
    • SOAP Server
  14. Itanium® [^]


  15. Intel® Itanium® is the 64-bit processor which could run Windows and Liunx/Unix applications. Its EPIC (Explicitly Parallel Instruction Computing) architecture, fast floating point computing, and 64-bit memory addressing found a solid hardware platform for the demands of large applications in the future.

    Itanium® 2, the second-generation of Itanium® family, boost performance by 50 to 100 for existing first-generation Itanium applications. Itanium® 2 delivers performance improvements through 3x increase bandwidth of system bus to 6.4GB/s, 3MB L3 on-die cache, increased core frequency to 1GHz. It is also binary compatibile with first-generation Itanium® software.

    Intel's chipset E8870 will support 2-way and 4-way Itanium servers. Other vendors such as HP and IBM will provide chipsets to support 32-way or more supoort of multiple processors. Itanium-based platforms will run on a variety of Operating Systems such as Windows, Linux, and Unix.

    Myrmeco XP worked for all Windows. Neatware decided to port Myrmeco XP on Intanium® because we expect performance, compatibility, and large scale applications for it. At first we tested Myrmeco XP on the Windows XP 64-bit for Itanium. It worked fine on Itanium without one line modification. Then we decided to develop Myrmeco XP Runtime for Itanium® to benefit 64-bit performance. To make sure the port from 32-bit to 64-bit is worth we designed and tested our benchmarks. The result is better than our expection: the speed of 64-bit Runtime is as twice fast as 32-bit without special optimization! Rewrite some algorithms will increase more performance. The Runtime for Itanium 64-bit has been added into Myrmeco XP Enterprise Edition. The applications such as Web Services (SOAP) based on the Myrmeco XP Runtime benefit from the performance of Itanium® 64-bit immediately. Large file processing such as database image file, multimedia file, and high-performance computing file is another benefit of the 64-bit processor.

    Myrmeco XP Runtime Benchmark

    Myrmeco XP Itanium Benchmark

    This chart shows the Myrmeco XP Benchmarks of write/read hash file on Itanium®. There are 256K items in hash table. Red color represents for Itanium® 32-bit and blue color represetns for Itanium® 64-bit on WindowsXP 64-bit.