Search This Blog

Saturday, January 7, 2012

Start working with Celerity


How do i start
i downloaded JRUBY from  http://jruby.org/download and install it.

i opened a  command prompt - to install celerity.

D:\MyStuff\jruby\jruby-1.6.5.1\bin>jruby -S gem install celerity
Fetching: celerity-0.9.1.gem (100%)
Successfully installed celerity-0.9.1
1 gem installed

i opened the https://github.com/jarib/celerity/wiki/getting-started
i copied the example/first script into a file d:\temp\test.rb

back to the command prompt
D:\MyStuff\jruby\jruby-1.6.5.1\bin> testrb.bat D:\Temp\test.rb

looks worked to me

the second option is to run the script we mention , line by line from the command prompt ( for understanding).
in the command prompt - type irb
D:\MyStuff\jruby\jruby-1.6.5.1\bin> irb
puts "Hello world!"


now you can put each script line - and see the result of each command.


its just a starter , i am still investigating ...
use the command line tutorial ->   http://ruby.about.com/od/tutorials/a/commandline.htm

Yaniv Tzanany

Thursday, January 5, 2012

Web Application Testing in Ruby

"Watir drives browsers the same way people do. It clicks links, fills in forms, presses buttons. Watir also checks results, such as whether expected text appears on the page."
Watir.com | Web Application Testing in Ruby:

celerity based on Watir -> another competitor
http://celerity.rubyforge.org/

sound worth to try .... i get enough develop my own screen scraping
similar tools can be found at
http://en.wikipedia.org/wiki/Watir
http://en.wikipedia.org/wiki/Web_scraping


Yaniv Tzanany

Friday, December 30, 2011

JSOS - servlets office suite (servlets)

Probably the largest collection of
Java(tm) Servlets and filters

Tuesday, December 27, 2011

asp.net XML binding - how to check field/column exist.

The problem:
when dealing with xml binding , in my case i have attributes on each row.
not all the attributes are existing in the row , so when i use the binding method , i get failed.

e.g.
old code

<div id="divDynmic" runat="server" visible='<%# Eval("AllowDynamicParam").ToString().Trim() == "true" %>'></div>

if AllowDynamicParam is not exist in your xml as an attribute , you get failed.

so i solved this like this - i created the next method :

    public string GetData(object o, string key,string defaultValue)
    {  
        GridViewRow gvr = o as GridViewRow;
        XPathNavigator nav = ((IXPathNavigable)gvr.DataItem).CreateNavigator();
        string attribValue = nav.GetAttribute(key, "");
        if (!string.IsNullOrEmpty(attribValue))
            return attribValue;

        return defaultValue;
    }


the main problem was to deal with
gvr.DataItem - its return XmlDataSourceNodeDescriptor   object and its sealed - no docs on it.
so my new code look like this:
<div id="divDynmic" runat="server" visible='<%# GetData(Container,"DynamicParamMandatory","false") == "true" %>'></div>

enjoy
Yaniv Tzanany

Monday, November 14, 2011

MFC CString

very good article about CString Management, and some conversion method .