MrUll's

Mai 28, 2004

Profiling Java: Eclipse, Hyades for generating UML-like sequence diagrams running a Tomcat-Servlet-Framework

we built up a servlet framework using turbine,velocity and oracle proprietary BC4J. Latter comes from oracle to access oracle. nowadays oracle seem to prefer toplink. we use tomcat as servletcontainer. development occured in teamwork over some years now and we have nearly no technical documentation. so analyzing how it works is a common activity during bug fixing or to due to the growing application. my first approach was to use Poseidon for UML. Debugging using Eclipse and a manual drawing of sequence or activity diagrams to document whats going on. this kind of work is a little bit annyoing. so read about profiling tools (not commercial ones), and i noticed that someone mentioned that Hyades would be able to generate UML sequence diagrams. Some URLs about testing/profiling Java:

  • j2ee test tools (german language)
  • open-source-profilers-for-java provides an excellent listing
  • Hyades official Site

    the are some prerequisites (mainly correct versions) and some minor configuration is to be done if you want a running environment. At this point of time, latest release is 1.3.0. My working installation is using some older distributions:

  • Eclipse 2.1.3 (File: eclipse-SDK-2.1.3-win32.zip)
  • Stable build 1.2.0 (File: hyades.rac.nt_1.2.0_20031219_0843.zip hyades.runtime_1.2.0_20031219_0843.zip). Rac is Hyades Data Collection Engine.
  • XSD File: xsd_1.1.1.1_20031120_1149WL.zip
  • GEF File: GEF-runtime-I20031015.zip
  • EMF File: emf_1.1.1_20031120_1149WL.zip

    This is for a W2000 Platform. You have to use a JDK1.3. You have to be careful when sampling data (monitoring), GUI is slow for a large amount of data. Hyades 1.3 lists a paging feature: "Paging mechanism in Log View (improves UI responsiveness for large logs)". Maybe this is worth to be tested.

    Theres a small installation guide available, my installation was successful with it. to install and use the profiling and logging features of the Hyades project

    starting tomcat is done via Menue entry Profile=>Launch=>Java Process. Provide the following data:
    Class name "org.apache.catalina.startup.Bootstrap"
    Class path "C:\eclipse-SDK-2.1.3-win32\workspace\kat3\tdk\bin\bootstrap.jar"
    Parameters "start"
    VM Args: "-Dcatalina.base=C:\\eclipse-SDK-2.1.3-win32\\workspace\\kt\\tdk -Dcatalina.home=C:\\eclipse-SDK-2.1.3-win32\\workspace\\kt\\tdk"

    Another wise step is to define your own filter set. This is done via Window=>Preference. tree control: Profiling and Logging=>Profiling. i excluded mainly oracle packages (oracle.xml.*, oracle.jdbc.*, oracle.jbo.* ...)

    After you samled some data (Use profiling monitors rightclick menue to start/pause monitoring) use the object interactions or class interactions to access the UML like sequence diagrams.

    See screenshot


  • Mai 27, 2004

    script for file path konversion with awk

    This konverts a path "a/b/c/...../d/e" to "/another/d.e"



    echo "asdfasdf/lasdf/asdf3" | awk -F/ '{ i=NF;j=NF-1;print "/awk/" $j "." $i }'

    bash script for getting number of actual params passed

    this little script gets the number of passed parameters ($#), fetches and prints them out to stdout. Works inside bash shell (/usr/bin/bash)



    i=$#
    echo $i actual params:
    while let i
    do
    eval "echo \${$i}"
    i=$[i-1]
    done

    Mai 24, 2004

    Riding Cannondales Optimo (R1000) ...

    I have done some ridings now, and here's my report. These are my private perceptions and its worth for the reader to mention some contraints:
    acutally i ride 2 other road racers; a large (frame size 56) corratec la strada (heavy steel frame) for work; a litte to large for me but comfortable. A 54 cm sized steel filled brazing frame (hardo wagner) made of tange prestige tubes. it has exactly the same top tube length as the Optimo (size 54); its 54.5 cm.

  • Sitting position very long. first a had massive problems with the fitting of saddle and handle bars. maybe because of the seat post (not a straight one) and seat angle, it lengthens the sitting position about ca. > 1 cm. (in spite of the same top tube length as mentioned above) So it feels like a having a longer top tube. It reminds me of the sitting position for mtb/xc bikes. Actually i adjusted the saddle several times for achiving a more "shorter" position. with this i had to lower the handle bars maybe because the top tube is a bit longer; this is the case for the 54 sized frame (see specs below)
  • absorption for rough roads. excellent. in spite of max. air pressure, the frame swallows "nearly everything" on the road. sitting on light cobblestone pavements is nearly possible. turns road into a silk road ;)
  • rigidity/sprint excellent load transmission. unfortunately the heart rate limits the fun during sprinting on climbs. the frame offers an extraordinary stiff transmission. no flex, just going forward. it stands in no conflict with the shock absorption.
  • tends to understeer a little bit. the buildin carbon-fibre fork (Slice Ultra Si.) shortens the wheelbase in my opinion. a turn over results in touching/blocking the front wheel if you dont take care of your feet. There's even a technical paper about this. driving is very agile with this. But in spite of this, the driving line is very stable during high speed downhills (70-80 km/h; driving straight ahead). But driving turns is a bit too agile in my opinion. I'm not used to it a this point of time.
  • maybe too lightweighted ? in spite of a lifetime-long warranty (for the first time owner only) theres a technical paper describing constraints for Optimo and Caad7 Frames. Heres a quotation:
    Please understand that you are choosing light weight and a shorter frame life over more weight and a longer frame life. Please
    understand that you are choosing light weight over more dent resistant or rugged frames that weigh more. All frames that are
    very light need frequent inspection for cracks that would indicate that the frame is worn out from fatigue.

  • the optimo/cannondale oem brakes are too weak. its a long way for the braking lever because of massive flex. my weight is 71kg, this is absolutely not suitable for heavy drivers.

    Heres an ugly colored 2004 R1000 model. (i purchased the black one). Look at the seat post (lenghtens the sitting position; see above) and the slice fork (tend to understeer).



    Geometry:
    cannondale specs.

  • Mai 19, 2004

    Oracle open cursors ....

    Some problems exists regarding max open cursors. The question is its an cursor leak or does my application need so many cursors ?
    Parameters:
    open_cursors (how many concurrently opened cursors you can have per session)
    session_cached_cursors (how many cached CLOSED cursors you can have per session)

    Quickfix: increase value for open_cursors; 500-1000 is not too large.

    View:
    v$open_cursors: Attention, lists also _closed_ (cached) cursors.

    to get the actual opened statements/cursors use v$mystat or v$sessstat for all sessions:

    -- retrieves stat.val for stat. "opened cursors current"
    select a.sid, a.value, b.name
    from v$sesstat a, v$statname b
    where a.statistic# = b.statistic#
    and a.statistic#= 3
    order by value desc


    in case of a cursor leak, how to get the statement ? with the help of v$open_cursors:


    select sql_text, count(*) from v$sqlarea va,
    (
    select distinct address, hash_value
    from v$open_cursor oc
    where oc.SID in (
    select a.sid
    from v$sesstat a, v$statname b
    where a.statistic# = b.statistic#
    and a.statistic#= 3
    and value > 280
    )) vb
    where vb.address=va.ADDRESS and vb.hash_value=va.HASH_VALUE
    group by sql_text
    order by 2 desc


    (but attention, v$open_cursor also lists closed ones)

    Just read intersting informations:

    from the 9.2.0.5 patchset release notes:

    "PL/SQL Cursor Caching

    Prior to release of the 9.2.0.5.0 patch set, the maximum number of cursors that
    could be cached for fast lookup by PL/SQL was bounded by the value of the
    init.ora parameter open_cursors. If you currently have open_cursors set to a
    high value (for example, greater than 1000), it is likely that this is causing
    large numbers of PL/SQL cursors to be cached in the shared pool. This could lead
    to issues with memory management, frequent reloading of library cache objects
    and ORA-04031 errors.

    Patch set 9.2.0.5.0 alleviates the issue by changing the init.ora parameter
    which determines the upper bound for PL/SQL cursor caching from open_cursors to
    session_cached_cursors.

    Most users will not need to modify the value of either of these parameters. If
    you already have session_cached_cursors set to a value greater than the
    open_cursors parameter, then this change will have no performance impact upon
    your system.

    However, if you have session_cached_cursors set to zero, or set at a value
    significantly lower than the open_cursors parameter, and you are concerned that
    PL/SQL cursors need to be cached for optimal performance, then you should ensure
    that the session_cached_cursors parameter is increased appropriately.

    This issue is bug number 3150705. "




    Oracle SQL for scrolling forward (get next ID), single SQL Statement

    This SQL uses a Oracle-proprietary syntax. See Oracle Data Warehousing Guide, Chapter 19, Windowing Aggregate Functions. Oracle has to be installed with some Options to enable such kinds of queries. To check this, look at the login message (sqlplus):
    ...
    Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    ...
    The OLAP option has to be present. Another way to check this is via v$option. There, search for:
    OLAP Window Functions TRUE

    with this, assume you have a SQL (joins,restrictions,order by) which delivers ids (PK). Given an current ID the question is how to get the next or previous ID (having regard to the restrictions and sort). We use Windowing Functions an inline Views to do this:

    Select col1, col2, ...
    FROM X
    WHERE ID = (
    Select id_next
    from (
    Select Id, last_value(id) over (order by RowNr range between 1 preceding and 1 following) as ID_Next
    From (
    Select Rownum as RowNr, ID
    from (
    SELECT Id
    FROM X,Y,Z
    WHERE ... AND ... AND ...
    Order By ID desc
    )
    )
    ) where ID=123456
    )


    here, sortorder is by column value ID. look at the most inner statement. the outer statement just selects cols for the ID whos next (scroll forward) to ID 12346.

    Mai 18, 2004

    automatic source deployment using cvs history, awk, bash, ftp macros

    Here is a sequence of steps to push/upload sourcefiles to an remote server.

    1.) Create a base file listing with the help of the cvs history command. e.g. cvs history -c -D 2004-04-01 [–a] > filelist.txt
    use -a for committed files of all users.

    2.) Filelist contains lines in the following format:
    M 2004-05-03 15:34 +0000 billg 1.8 DiffTreeBuilder.java kat3/konverter/src/java/de/ems/kat3/xml/konverter/diff == remote

    What we need is:
    kat3/konverter/src/java/de/ems/kat3/xml/konverter/diff/DiffTreeBuilder.java
    This can be arranged with:
    cat filelist.txt | awk '{ print $8 "/" $7 }' > filelist2.txt
    A A Tagging Skript can be created using:
    awk '{ print "cvs tag -c DeploymentTagName " $8 "/" $7 }'

    3.) Now its getting interesting. We want a upload for all files in our generated Filelist. We are using FTP Macros for this. In you home directory a file .netrc has to be present; heres an example:
    machine servername
    login johndoe
    password isunknown
    macdef pe
    rename /application/$1 /application/$1.InTest20031204
    put $1 /application/$1

    Now in interactive ftp mode it is possible to push a file with the command
    $pe kat3/konverter/src/java/de/ems/kat3/xml/konverter/diff/DiffTreeBuilder.java

    We now want to do this for all files in our filelist. the first challenge is to use ftp in a no-interactive way so that it is possible to make a script to push several files:
    #! /bin/bash
    ftp kat3e << EOF
    \$pe $1
    bye
    EOF

    attend to the backslashed ftp-macro-call. Say that the code above is stored in a executable file called ftppeput.sh. You can use it now like this: ftppeput.sh kat3/src/de/ems/konverter/CComp.java.
    We want to do this for several files, assume a executable script called putfiles.sh:
    #! /bin/bash
    for files in `cat $1`
    do
    ftppeput.sh $files
    done

    Execution of putfiles.sh filelist.txt now calls ftppeput.sh for each line in file filelist.txt. Thats it. Happy scripting ... .)


    Mai 14, 2004

    Look a this posting (AP,14 May 04)

    HYDERABAD, India - A political candidate shot and killed himself Friday after hearing that he lost in India's parliamentary elections, police said.
    K. M. Rahmatullah of the Telugu Desam Party committed suicide in his home in southern India, said Anil Kumar, superintendent of police.
    He sought election in Andraha Pradesh state legislature, but lost to D. Narayan Reddy of the victorious Congress party of Sonia Gandhi.


    i think this should be an example for all (unsuccessul) politicians out there ;)


    SPD SL Pedal Information

    yesterday i noticed a difference between the three SPD SL Models which is worth to be mentioned because a never did not read about this before. its said that SPD SL has the advantage of a lower distance between shoe and pedalbody, in compare to Look, a lower cleat. But thats only half the truth. it applys specifically to the SDP SL Dura Ace model, as only there the face is lowered. the follwing image shows this, notice
    the level of the pedal in compare to the circumference of the axis, this is ca. 2 mm i think.


    now beginning with the ultegra model, the contact point between cleat and pedal is not lowered:


    Another reason for the dura ace model about 40 grams less weight.

    Mai 12, 2004

    What a rotten nation ;-)

    Think about these postings, both appeared nearly together in the news.

    Posting 1:
    Study: American Pesticide Levels Are High (AP)
    SAN FRANCISCO - Many U.S. residents carry unhealthy levels of pesticides in their bodies, with children, women and Mexican Americans disproportionately exposed to the toxic chemicals, according to a study to be released Tuesday. The Pesticide Action Network analyzed data collected by the U.S. Centers for Disease Control and Prevention in a study of more than 2,648 people tested for levels of 34 pesticides, the environmental group said.

    Posting 2:
    More Than 4 Percent of Young Americans Infected With Chlamydia
    TUESDAY, May 11 (HealthDayNews) -- More than one in 25 young women and men in the United States are infected with the bacterium that causes the sexually transmitted disease chlamydia. Rates of infection are alarmingly high among young black women (almost 14 percent) and young black men (more than 11 percent), a new study found. The study appears in the May 12 issue of the Journal of the American Medical Association.

    Posting 3 (14 May 2004)
    U.S. Worried by High Rates of Arthritis
    ATLANTA (Reuters) - Approximately one-quarter of American adults have been diagnosed with arthritis and another 17 percent may be suffering from the crippling disease, the Centers for Disease Control and Prevention (news - web sites) said on Thursday. ...

    Cannondale Optimo R1000

    i had a weak moment and ordered a new roadracer bike. forgive me. the guys in the "bunny hop shop" made a good price for a black R1000 Mod.2004. As i found nowhere information
    about its weight, we weighted it: ca. 7.8-7.9 kg. So with pedals, cage etc. maybe its 8.5 kg then (pessimistic)



    during testriding it feels like having a flat tire at the back wheel. but its 8.5 bar.

    coffee, concentration and working long

    just read an interesting information about the effect of coffeine. a study (University in Chicago Magazine "Sleep" (Edition. 27, No. 3) with 16 volunteers and up to 28 hours without sleep came to an interesting outcome. those volunteers drinking large amounts of coffee (less frequently) had more problems during concentrationtests in compare to those consuming more frequently but only a little amount of coffeine.

    Mai 11, 2004

    Cannondale Six13 Information

    Cannondale builds a ultra-lightweight roadracer. they say its weight is less then
    UCI allows. Well check out these two links with additional pics and information about
    the frameset. Unforunately its exclusiv-expensiv :)
    Six13 bike
    Six 13 frameset
    Maybe a R1000 is suitable for me; my old filled-brazing-steel-framed bike is too old now.

    Mai 10, 2004

    ems eProcure

    Look at the guys from our Company at the eProcure:



    Maybe it helps.

    Using my own Xwiki Bliki

    my plan is to use my own blog platform for my postings and homepage.
    at the time i analyze the Xwiki framework for this purpose. i has some
    interesting architectural komponents involved:
    i. tomcat
    i. jsp/struts
    i. hibernate
    i. open symphony
    but due to the lack of the possibility to publish into static files maybe
    i have to implement this first. we'll see.

    Cannondale CAAD7 Optimo => Tests,Weight ?

    my plan is to buy a new roadracer bike. my old one is aged. in spite of my old bike
    is build with an advanced frametechnology (filled brazing processing aso.) so my choice
    is maybe a Cannondale R1000 (CAAD7, optimo Frame). but i never find Testdata or Weigth.
    Maybe just buy and ride.

    South India Kata Kali Dance (Kerala)

    Are there any kata khali resources (movies etc.) on the web ?
    This strange Dance seems to be very interesting. On my Holidays
    in india in goa/gorkana/puna there was no opportunity to see
    such a performance. Some URLs/movies/Webgalleries/explanations
    (gestures) would be nice. thanks in advance.

    Hello World.

    These are the first lines. Hello World.
    Read this or not. Har. just read about
    an large IT Project delay in Germany.
    German Army (Bundeswehr) plans to redesign their whole
    Communication infrastructure. Project "Hercules".
    Costs / Budget / Target is 6 700 000 000 EUR so far.
    i bed it will never go live. just disestablish german army.
    effect: 6.7 Mrd less costs for Germany.