in

Emerald Hand

Emerald Hand, Inc. community home page.

This Blog

  • Home
  • Contact
  • About
  • Directory of Computers/Tech Blogs

Syndication

News

I'm back to blogging

Worm in liquid maze

Design and development of information management tools.

October 2005 - Posts

  • Automatic Monorail helper docs

    I have mentioned before that I work on Monorail documentation. Mostly I'm doing this in my spare time. I want to make sure I have correct and valid documentation. I can use reflection to call all methods (with some predefined parameters). My code parses their output and generates some (format and small example. After this I still need to add explanations manually) of the documentation automatically. I got it done and now I want to release this small project. You can get it here (VS2003 C# project).

    The program can be used to make it convenient to see how to use different helpers (certain Monoral components) as it generates example input and output, especially if there're no docs available for the helper yet. You can also use this if you are developing or modifying some helper and want to see that it works as you expect it to work.

    HelperDocumentingComponent is used to generate documentation. It uses reflection to call all of the methods declared in the current helper only (No overridden methods are called). Output from each method is then converted to string (ToString) and shown on the webpage. CreateParam method generates a parameter for a method from a template picked by the parameter type.

    Generated docs follow this format:

    /// Docs in XML format to be inserted to the code
    /// ...
    /// ...
    Example output as it would be added to the page

    It is possible to specify which helper to document. Homepage (default.aspx) is using it to create links to all existing helpers. To show docs for a specific helper navigate to "~/helperdocs/generatehelperdocs.ashx?helperName=helpername". By default the program tries to find the helper in the Monorail assembly, but you can easily modify the source to look for it in a different assembly (or several others for that matter).

    If a method to be documented returns some object of a class the name of the class is shown instead of the object's value. In the future I might add code to show all of the object's properties.

    I am using several tools with this project. nAnt to run build files and Cassini to show example website without having to add it to IIS. I don't use nAnt to compile the solution, only to generate distribution. Building from VS.NET is easier for me. If you want to use nAnt to compile just launch "go.cmd". I believe it should work fine.

    To launch the server start "runServer.cmd". When Cassini dialog opens click on the link.

    I have not included nAnt to keep release archive file size small. If you choose to get it place it in "nAnt" folder in the "tools" directory. You can find nAnt here. Full Cassini distribution can be found here.

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 465; Sentence Count: 44; Grade Level: 6.7, more info...
    Posted Oct 28 2005, 05:47 PM by Ornus with no comments
    Filed under:
  • Dvorak

    I haven't blogged in a while now. It was mostly due to the right wrist pain I was having (carpal syndrome) and so I was unable to type a lot. When I could I had to focus on my work. I moved to using left hand for mouse control and I learned Dvorak keyboard layout.

    Learning a different layout was not too hard and I am glad I did. I like it much better. I moved keys around on my keyboard to help me learn faster. Nobody have mentioned doing this anywhere when I did my research on what Dvorak layout is and how to learn it. I'm almost sure that modern keyboards allow the keys to be popped out and popped back in at a new location, so if you ever want to change your keyboard layout you can just move the keys around.

    I also think trying to memorize where the keys are located was a good mental exercise. I had to give less attention to what I was writing, but having to focus at every thing I was doing was challenging. This has helped me to learn to focus better. The new layout also allows to type faster and with less stress on the hands. If you are interested you can read about all this from the aforementioned website. As a bonus most of the keys for common operations (copy, paste, etc.) are now located under the right hand. That compliments the way I'm using the mouse with my left hand.

    The pain is almost gone now and I am trying to resume my tasks. I want to write more often here.

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 275; Sentence Count: 19; Grade Level: 5.5, more info...
    Posted Oct 26 2005, 04:27 PM by Ornus with no comments
    Filed under:
  • Timestamping in nAnt

    I'm using nAnt to automate my projects' build and release. That means from time to time I will write about my experience with automatic building and releasing, and interesting things I find in the process.

    Today I had to solve a small problem in a nAnt scripts. I needed to timestamp archive of the release. While nAnt zip task can timestamp the file, the format it uses (MM/DD/YYYY HH:MM:SS) is not suitable for me. I prefer for the project release date to be a part of the version and to follow minor version (i.e. 0.5.20051004). I'm sure there are arguments for and against using such version format, but I like this and I wanted to solve specific problem of generating it.

    This is what I came up with:

    <property name="date.now" value="${ datetime::now() }"/>
    <property name="year.now" value="${ datetime::get-year( date.now )}"/>
    <property name="month.now" value="${ datetime::get-month( date.now )}"/>
    <property name="month.now" value="0${ month.now }" if="${ int::parse( month.now ) &lt; 10 }"/>
    <property name="day.now" value="${ datetime::get-day( date.now )}"/>
    <property name="day.now" value="0${ day.now }" if="${ int::parse( day.now ) &lt; 10 }"/>
    <property name="timestamp" value="${year.now}${month.now}${day.now}"/>

    timestamp property will have current date in YYYYMMDD format. It can be used to timestamp the archive (what I'm using it for), to generate build number, etc.

    This is an example of how you could use it to timestamp zip archive:

    <zip zipfile="${release.dir}\${project.name}.${timestamp}.zip">
     <fileset basedir="${working-release.dir}">
      <include name="**" />
     </fileset>
    </zip>

    Some of the properties, like release.dir must be initialized earlier, but I wanted to keep example simple so I omitted all initialization.

    If you find a simpler way to generate timestamp let me know. I'd be delighted to hear about it.

    Share this post: Email it! | bookmark it! | digg it! | reddit!
    Readability Stats: Word Count: 344; Sentence Count: 38; Grade Level: 3.8, more info...
    Posted Oct 04 2005, 04:39 PM by Ornus with 1 comment(s)
    Filed under:
Copyright © 2006-2007 EmeraldHand, Inc. All rights reserved.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems