Search This Blog

Friday, December 14, 2012

Running 32-bit app AND ODBC setting with IIS 7 64bit

in case you need to use 32 bit web site , do not forget to set the application pool to "Enable 32-bit Applications" to true.
To use odbc for 32 bit , you must create your odbc DSN at  C:\Windows\SysWOW64\odbcad32.exe

see this thread
Running 32-bit app AND ODBC logging in IIS 7:

enjoy
Yaniv Tzanany

Sunday, September 16, 2012

How to start several processes from the Windows shell and wait for them all to complete?

i found this easy solution to achieve this

main.bat

start cmd /c proc1.bat
start cmd /c proc2.bat
:wait
sleep 1
IF NOT EXIST proc1done GOTO wait
IF NOT EXIST proc2done GOTO wait
del proc1done
del proc2done
echo All processes are complete

proc1.bat
proc1.exe
echo Done > proc1done


The sleep command is available in Windows Server 2003 Resource Kit Tools. If you don't have that, you could use a ping on localhost just to slow down that tight loop.

Saturday, August 18, 2012

Thursday, August 16, 2012

How to Debug C++ program running on AIX from Windows

great and easy way to debug your running c++ program on aic from windows.
here is the complete video guide.

http://publib.boulder.ibm.com/infocenter/ieduasst/rtnv1r0/index.jsp?topic=/com.ibm.iea.compileraix/compileraix/10.1/Quick_Start_Guide/Launching_a_Debug_Session/player.html

the PDF doc could be found here http://publib.boulder.ibm.com/infocenter/ieduasst/rtnv1r0/topic/com.ibm.iea.compileraix/compileraix/10.1/Quick_Start_Guide/Launching_a_Debug_Session.pdf


  1. The IBM Debugger for AIX is Eclipse-based. It is based on the Client/Server architecture. The client, or the User Interface is what you interact with. It is based on Eclipse and all platforms of IBM Debugger products have a similar-looking UI. However, they talk to a different engine.  The Debug Engine controls the user’s application.  With the help of expression evaluator, it can debug C, C++,  Cobol , and PL/I programs. On ZSeries, the engine can also debug high level assembly. The UI calls the engine by establishing a TCP/IP connection to the debugger engine. Users can debug on I-series, TPF mainframe, Z-series, AIX and on Windows®.  But before you attempt to launch a debug session, make sure your program is compiled with –g option. Otherwise, no source is displayed. This presentation illustrates how to launch a debug session on Windows.         
  2. There are other options that affect debugging.  -qfullpath will affect the ability of the debugger to find source files. -qlinedebug suppresses information on variables. -qtbtable can be used to suppress traceback tables. This can affect the ability of the debugger to build stack traces. -O should not be used. Debugging optimized code is possible, but the results can be misleading. Consult the your compiler documentation for more information.                                                                                                                                                                                                                                                                                                                                                                 
  3. This presentation illustrates how to launch a debug session on Windows. On Windows, from Start->All Programs->IBM->IBM Debugger for AIX->IBM Debugger for AIX, you can launch the UI. You can also set a shortcut to the UI program and place it on your desktop and double click the icon. Once the UI is launched, there are several steps to follow in order to launch a debug session.                                                                                                                                                                                                                                                                                                                                                                 
  4. Step 1: Select a profile location. Once the debugger is launched, you are prompted for a profile location. This is a place for breakpoint setting, view setting, and any other customization that you have done to the user interface.  You can select the check box “Use this as the default and do not ask again” to bypass this dialogue in the future.                                                                                                                                                                                                                                                                                                                                                                 
  5. Step 2: Check the Debugger Daemon. By default, the debugger daemon is set to port 8001, you will need to know the number when launching the debug engine.  In the UI, under the debugger daemon, circled in red, there are controls that let you:  stop listening, change port, and obtain workstation IP. Information provided from these controls is necessary for step 3.                                                                                                                                                                                                                                                                                                                                                                 
  6. Step 3: Launching the debugger engine  From a telnet/ssh session to the AIX machine where the debugger engine resides, the irmtdbgc –qhost=workstation:port a.out  command line will  launch the debugger engine. You can also attach to a running process by using the –a flag.  Note that if you use the default 8001 port,  it is not necessary to specify the port.  In the examples here, you are launching the debugger engine to connect to the host sunshine, default port 8001, to debug a program a.out, core file and attach to a process.                                                                                                                                                                                                                                                                                                                                                                 
  7. You can also specify the default host and port with the DER_DBG_ADDR environment parameter.  For example, you can put the export statement in your profile export DER_DBG_ADDR=host:port And then launch the debugger engine in a simpler way. irmtdbgc a.out will then launch the debugger engine to connect to host sunshine, port 8001 to debug program a.out                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Enjoy
Yaniv Tzanany                                                                                                                                                                                                                                                                                                                                                   

How to Debug a Release build at C++ - VC6

follow the next steps
http://support.microsoft.com/kb/291585

i have no idea where its came from the next article


Debugging in Release Mode
I've heard a myth repeated many times by my fellow VC++ developers. It is that it is not possible to debug in Release Mode. Fortunately, this is a myth.
Rule 7: When all else fails try debugging in release mode.
It is possible to debug in Release mode. The first step is to turn on symbols:
  • In Project Settings (Alt-F2) under the "C++/C tab" set the category to "General" and change the Debug Info setting to "Program Database".
  • Under the "Link tab" check the "Generate Debug Info" tab.
  • Recompile using "Rebuild All"
This will allow you to see the symbols in the release version. You might want to also consider the following:
  • You may want disable your optimization settings when debugging your release version (though this isn't absolutely necessary).
  • If you have trouble placing breakpoints, the command "__asm {int 3}" will cause your program to stop at that line (be sure to remove these lines from your program when you are done debugging).
Debugging in release mode has several limitations.
  • The most annoying one is that you can't easily see into MFC because you don't have the symbols included for the MFC DLL.
  • You must add symbols to the release versions of all libraries and DLL's you wish to debug in your release application.

ActiveMQ - strater minutes

The next minutes are the link and info i used to start my way with ActiveMQ product.

Thursday, August 9, 2012

GetTickCount Linux Implantation


DWORD GetTickCount(void)
{
timespec time1;
clock_gettime(CLOCK_MONOTONIC, &time1);
return (time1.tv_sec * 1000) + (time1.tv_nsec/1000000);
}

Monday, July 30, 2012

JNI - get method signature

sometimes when you mixed java and C++ code you must used JNI.
So the best way to find the method signature is via javap application that exist in JAVA jdk.

in case you want to see the method  signature to initialize your jmethodID  follow the next steps:

  1. open command windows
  2. navigate to your class directory (where the class file exist, e.g. c:\xxx\bin\com\)
  3. run the javap.exe -c -s [class name]    ( without the .class e.g. javap -c -s myclass)
make sure your javap is in the PATH , or write the full path to it.

enjoy
Yaniv Tzanany

Tuesday, July 3, 2012

JAVA thread dump on linux

in case you want to see the thread dump of running java process , even the call stack of stuck program.
open new console and run the next command

kill -3 [pid] 

you should see some good info in the console/stdout  of the running process.

Yaniv T

Monday, July 2, 2012

Connect to SQL Server from Linux via ODBC


unixODBC (it’s a driver manager) and  should be our choice , on top of it we should plug a driver and we can find the  MS-SQL driver from Microsoft.
More details about this one could be found here http://msdn.microsoft.com/en-us/library/hh335190(v=sql.10)
From FAQ

The first version of the driver is a 64 bit
 This release supports Red Hat Enterprise Linux 5 and Red Hat Enterprise Linux 6 connecting to SQL Server 2008, SQL Server 2008 R2, and SQL Server 2012.

So if we are ok with the above restriction  … we can go forward with this driver.
We can Download the Microsoft ODBC for Linux from http://www.microsoft.com/en-us/download/details.aspx?id=28160

you can use Existing MSDN C++ ODBC Samples for Microsoft Linux ODBC Driver as described here http://blogs.msdn.com/b/sqlblog/archive/2012/01/26/use-existing-msdn-c-odbc-samples-for-microsoft-linux-odbc-driver.aspx
enjoy 
Yaniv Tzanany

Monday, May 7, 2012

Start / Stop Tomcat app via wget command

In my previous post i explain how to Start / Stop Tomcat app via ant command.
Please follow the instruction in the beginning of the previous post , how to set to a tomcat user a permission to run such manager commands.

Wget is a great utility to  retrieve files from the WWW.

the urls below are fit to Tomcat 7.0.26.

to stop application under tomcat use:
wget http://username:pwd@my-server:8080/manager/text/stop?path=/MySite

to start application under tomcat use:
wget http://username:pwd@my-server:8080/manager/text/start?path=/MySite


very easily to add to any batch processing .
more options could be found here

Tomcat Server Control with Wget and the Tomcat Manager 

For a complete list of tomcat manager urls - visit the Manager App HOW-TO.

Yaniv Tzanany

Start / Stop Tomcat app via ant build

In this post i will try to explain how to start and stop Tomcat site from command line.
All my tests worked on Tomcat 7.0.26 , i am sure its will work on older version with minor changes.


You must set a permissions to the tomcat user you want to use, in my case i used the tomcat user.
i changed the tomcat-users.xml file as follow:
<user username="tomcat" password="xxx" roles="manager-gui,admin-gui,manager-script,manager-jmx,manager-status"/>

restart Tomcat

Option 1 - via ant build file

i used the next build.xml file:



<project name="My Application" default="compile" basedir=".">

  <!-- Configure properties to access the Manager application -->
  <property name="url"      value="http://il-yanivt:8080/manager/text"/>
  <property name="username" value="tomcat"/>
  <property name="password" value="tomcat"/>

  <path id="tomcat.classpath">
<fileset dir="C:/Program Files/Apache Software Foundation/apache-tomcat-7.0.26/lib" includes="*.jar" />
<fileset dir="C:/Program Files/Apache Software Foundation/apache-tomcat-7.0.26/bin" includes="*.jar" />
  </path>

<taskdef name="stop" classname="org.apache.catalina.ant.StopTask">
<classpath refid="tomcat.classpath" />
</taskdef>

<taskdef name="start" classname="org.apache.catalina.ant.StartTask">
<classpath refid="tomcat.classpath" />
</taskdef>


<target name="stop" description="Stop web application">
<stop url="${url}" username="${username}" password="${password}" path="${site}"/>
</target>

<target name="start" description="Start web application">
<start url="${url}" username="${username}" password="${password}" path="${site}"/>
</target>

</project>


For a complete list of tomcat manager urls - visit the Manager App HOW-TO.

Open command windows  , change the directory where is your build.xml file is, and type the next command :
MySite mean your site name.

ant.bat start -Dsite=/MySite
ant.bat stop -Dsite=/MySite


enjoy 
Yaniv Tzanany

Tuesday, May 1, 2012

MQ CCDT files with C++


A client channel definition table (CCDT) file contains the details of all the client-connection channels defined at the WebSphere MQ Server. It is a binary file with the name amqclchl.tab and it is created automatically by the WebSphere MQ system when you create one or more client connection channels. You can find this file on the server at this location:

On Windows
\mqm\qmgrs\\@ipcc

On UNIX systems
/var/mqm/qmgrs//@ipcc

How to work with CCDT file in C++ MQ client ?
the easiest way to test your CCDT file is via the amqsputc program that shipped with MQ installation.
set the next env params ( the mqsslkeyr is for ssl key , i used in this sample , its optional, if no ssl required):
the paths is where to find your AMQCLCHL.TAB  files ...
more about Using WebSphere MQ environment variables

(make sure the MQSERVER env param is not set)


set mqchllib=C:\Program Files\IBM\WebSphere MQ\Qmgrs\MYQM\ssl\MQCLIENT
set mqchltab=AMQCLCHL.TAB
set mqsslkeyr=C:\Program Files\IBM\WebSphere MQ\Qmgrs\ MYQM\ssl\MQCLIENT\key

run the next command
amqsputc   MY.Q


if all configured well you should connect to QM and put messages into yours 


How to use CCDT  with C++  ?
the idea is simple , make sure you set the env param before connecting to the QM.
avoid setting the queue name and the channel name , or any connection details.
only the Queue name is important.

putenv("mqchllib=C:\Program Files\IBM\WebSphere MQ\Qmgrs\ MYQM\ssl\MQCLIENT");
putenv(" mqchltab=AMQCLCHL.TAB");
putenv("mqsslkeyr=C:\Program Files\IBM\WebSphere MQ\Qmgrs\ MYQM\ssl\MQCLIENT\key");

ImqQueueManager mgr;
mgr.connect();

ImqQueue q1;
q1.setName("MY.Q.NAME");

q1.setConnectionReference( m_QMgr );
q1.setOpenOptions(m_lOpenQueueInFlags);
q1.open();


Enjoy
Yaniv Tzanany

Wednesday, April 18, 2012

How To MQ SSL

You Must READ this : WebSphere MQ SSL channels on Windows

MQ SSL

SSL configuration of the Websphere MQ Java/JMS client

How to Set MQ ssl details programmatically (c++)?
My C++ code looks like this ( the MQ header from v7/6 version):

ImqChannel * pchannel = new ImqChannel;
pchannel->setChannelName("SSL_CHANNEL");
pchannel->setTransportType(MQXPT_TCP);
pchannel->setConnectionName ("myhostname(1414)");
pchannel->setSslCipherSpecification("TRIPLE_DES_SHA_US"); // its must be the same as the channel 

ImqQueueManager mgr;
mgr.setName("myQMgr");
mgr.setChannelReference(pchannel);
mgr.setKeyRepository("c:\\keys\\key");

To complete this post , and if you interesting with How to MQ SSL with CCDT files follow this post.

Yaniv Tzanany

Tuesday, April 10, 2012

Android App Development – Linear and Relative Layouts

the next article made my day, very good explanation with samples regards Android layout ... and all the headache about this subject.
Android App Development – Layouts Part One: Linear and Relative Layouts | Mobile Orchard:

enjoy
Yaniv T

ASP.NET ListView with DetailsView - get the new item selected

i have a listview with datapager attach to it , and when you clikc on an item you can edit/insert/delete this item in the details view control.

my problem was , when i add new item , so its added to the end of my list , mean to the last page, so if i wanted to continue edit it or chnage it , i needed to goto last page select it and edit it... bad idea...

so here is my solution on this


        protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
        {
// get the total items
            int total = DataPager1.TotalRowCount;
// calc the last page
            int pages = total / DataPager1.PageSize;
// set the pager to the last page
            DataPager1.SetPageProperties(pages * DataPager1.PageSize, DataPager1.PageSize, true);
// bind again my listview
            ListView1.DataBind();
// select the last one
            ListView1.SelectedIndex = ListView1.Items.Count - 1;
/// boooom your new item show again in your detals view

        }

enjoy
Yaniv Tzanany

Wednesday, March 14, 2012

android - DefaultHttpClient to AndroidHttpClient - Stack Overflow

while accessing the WEB on the main thread i get the next exception
AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1099)

"StrictMode.ThreadPolicy was introduced since API Level 9 and the default thread policy had been changed since API Level 11, which in short, does not allow network operation (include HttpClient and HttpUrlConnection) get executed on UI thread. if you do this, you get NetworkOnMainThreadException.

This restriction can be changed, using:

    if (android.os.Build.VERSION.SDK_INT > 9) {
      StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
      StrictMode.setThreadPolicy(policy);
    }"

more android - DefaultHttpClient to AndroidHttpClient - Stack Overflow:

Yaniv Tzanany

Thursday, March 8, 2012

Tomcat 7 - Failed to start component - with DB2 jars

When i deployed my old app on Tomcat 7.0.26 , i get the next error while start up my site.


EVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/YANIV_DEV]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.tomcat.util.bcel.classfile.ClassFormatException: null is not a Java .class file
at org.apache.tomcat.util.bcel.classfile.ClassParser.readID(ClassParser.java:238)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:114)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2032)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1923)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1891)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1877)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1270)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:345)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
Mar 8, 2012 3:26:36 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\YANIV_DEV
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/YANIV_DEV]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:898)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)



The solution for such error was:

I changed the  $TOMCAT_HOME/conf/catalina.properties and i add db2jcc4.jar to tomcat.util.scan.DefaultJarScanner.jarsToSkip property value.
It is used to turn off classpath scanning (which is used across JavaEE 6 specs implementations).


i found the solution here
db2 - Including DB2JCC4 in Tomcat 7:

enjoy
Yaniv Tzanany

Wednesday, February 22, 2012

JVM COBOL within Apache Tomcat

After installing the micro focus product , we needed to use the Java to Cobol calls.
our java code is running within tomcat 5.5.X via JVM 5.
using microfoucus jar files is not enoght  .. i get the next error

Micro Focus COBOL Runtime Support for Java is preventing this application from executing because an internal Java property is not setup. Reason: Application should use "cobjrun" to execute this application instead of the default "java" trigger

i knew that i need to use cobjrun as my running process and not just java runtime.
based on this article Running JVM COBOL within Apache Tomcat: i started .
in the end i managed to make such call.
the only changes i needed are:

in the file setclasspath.sh .. i changed the _RUNJAVA env .
_RUNJAVA=/opt/microfocus/cobol/bin/cobjrun32

in the file catalina.sh  i add the next env settings

#yaniv add
COBDIR=/opt/microfocus/cobol/
COBJVM=sun_150
LD_LIBRARY_PATH=/opt/microfocus/cobol/lib/:/usr/java/jre/lib/sparc:/usr/java/jre/lib/sparc/client:/usr/java/jre/lib/sparc/native_threads:$LD_LIBRARY_PATH
PATH=/opt/microfocus/cobol/lib/:/usr/java/jre/sh:/usr/java/sh:/usr/java/bin:/usr/java/jre/bin:$PATH
CLASSPATH=/opt/microfocus/cobol/lib/mfcobol.jar:.:/usr/java/jre/lib/rt.jar:/opt/microfocus/cobol/lib/mfimtk.jar:/opt/microfocus/cobol/lib/xerces.jar:/opt/microfocus/cobol/lib/castor-0_9_4_1-xml.jar:/opt/microfocus/cobol/lib/mfcobol.jar:.:/usr/java/jre/lib/rt.jar:/opt/
COBCPY=/opt/microfocus/cobol/cpylib:$COBCPY
export COBDIR
export COBJVM
export LD_LIBRARY_PATH
export PATH
export CLASSPATH
export COBCPY

restart your tomcat .. and enjoy
Yaniv Tzanany

Configure Putty with Xming

very good instruction could be found here

Using PuTTY and Xming for X11 Forwarding


in case of failure such
Xlib: connection to "10.11.197.11:0.0" refused by server
Xlib: No protocol specified

try to run xming
Xming.exe -ac  


should help ... 


enjoy 
Yaniv Tzanany
 

Tuesday, February 21, 2012

Creating Top Down Web Service via Apache Axis2

This tutorial is meant to demonstrate the use of the newly introduced Axis2 Web Services tools in the Web Tools Platform Project using the WTP 2.0 drivers. Also this tutorial shows how to create a simple top-down Web service from a WSDL file and test that with the WSE (Web Service Explorer). The WSDL file in this scenario calculates the area of an rectangle and its the same WSDL that used in the Axis web services tutorials.

old ... but do the job

Creating Top Down Web Service via Apache Axis2

Monday, February 6, 2012

Setting the applicationOriginData on MQMessage

the applicationOriginData on MQMessage java class , is a great way to add some app extra info on the message.
"This is information that is defined by the application suite, and can be used to provide additional information about the origin of the message."

In addition to add such data you must open the queue with the next option:
MQC.MQPMO_SET_ALL_CONTEXT


and when put the message add the same option above  on the MQPutMessageOptions.
this is the only way i managed to add such info on the message.


enjoy
Yaniv Tzanany

Sunday, February 5, 2012

SQLite with VC++

In case you are looking for sqlite3.lib , you can create it via the next command .


create lib file from def file
lib /def:sqlite3.def /OUT:sqlite3.lib
more details could be found in this post create-lib-file-from-dll.


check out the wrapper class i found , very easy to use and to implement CppSQLite - C++ Wrapper for SQLite.


Check out example1 in this article  Loading and Saving In-Memory Databases  we loading and saving the contents of an in-memory database to a file on disk , very common in the real world.


i extend the cppSQLite , to enable to read DB from disk into memory


void CppSQLite3DB::open(const char* szFile,BOOL inMem)
{
if(inMem)
{
open(":memory:");
loadOrSaveDb(mpDB,szFile,false);
}
else
open(szFile);
}

Yaniv Tzanany


Wednesday, February 1, 2012

SQLite - starter kick

SQlite , its very popular Database , easy to use , i used it as InMemory db.

download software from Sqlite home page.

know your limits -> Frequently Asked Questions .

Know your Datatypes In SQLite Version 3.

Command Line Shell For SQLite.

in case you need ODBC for sqlite , you can find it here SQLite ODBC Driver.
nice tool for sqlite its the sqlite browser.
check out Sqlite wrappers you might find something for your needs.

(i used the 3.7.10 version)
command line usage example to open db

sqlite3.exe yaniv.db
sqlite> .mode column
sqlite> .headers  on
sqlite> select * from t1;


Create a new db (open cmd window)
sqlite3.exe myTest.db
sqlite> CREATE TABLE t2(t  TEXT,nu NUMERIC,i  INTEGER,r  REAL,no BLOB ,EFFEC_DATE DATE );
sqlite> INSERT INTO t2 (t,nu,i,r,no,EFFEC_DATE) VALUES('500.0', '500.0', '500.0', '500.0', '500.0','2010-10-23');
sqlite>.quit


.read excute sql file
import value into db

sqlite>.separator ,
sqlite>.import  dd.txt t2

// will show you all master objects
sqlite> SELECT * FROM sqlite_master;


enjoy 
yaniv Tzanany

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