Thursday, October 04, 2007

Capturing a Image from a Web cam

This is a small C++ code sample that allows a image to be captured using a web cam. OpenCV library is used and it provides easy way to capture the image.

int captureImageNew(){
CvSize imgSize;
IplImage* image= 0;
imgSize.width = 320;
imgSize.height = 240;
//Initializing capture from the web cam
CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );
if( !capture )
{
return -1;
}

// Create a window which present the captured image
cvNamedWindow( "capture", CV_WINDOW_AUTOSIZE );

// Show the image captured from the cam in the window and repeat until ESC is pressed
for(;;)
{
// Get one Image
image= cvQueryFrame( capture );
if( !image)
{
break;
}
cvSaveImage("C:\\ll.JPG",image);
cvShowImage( "capture", image);

//If ESC key pressed exit
if( (cvWaitKey(10) & 255) == 27 ) break;
}

cvReleaseCapture( &capture );
cvDestroyWindow( "capture" );
return 0;
}

Thursday, June 07, 2007

Adding Linux Share

NFS configuration needs "exporting" a directory, which can then be "imported" by clients and needed to be accessible under the mount point.

vim /etc/exports
add this "/root/system/software 10.8.106.131(rw,no_root_squash)"

exportfs - maintain list of NFS exported file systems -a will add the unexported files to the list "exportfs -a"

restart the NFS service "/sbin/service nfs reatart"

To Access the shared folder
mount -t nfs user@host_ip:/folder/to/be/mounted /mount/to/this/folder.

.

Thursday, April 26, 2007

"mono --version" and "mcs --version" return the version of the Mono distribution.

Mono C# compiling can be done for following following runtimes
  • mcs: compiler to target 1.1 runtime.
  • gmcs: compiler to target the 2.0 runtime.
To create a dynamic library using the gmcs just use the following command.

"gmcs -t:library -out:sss.dll -recurse:Com.test.foo.SSL\*.cs"

To execute the compiled exes use the following command.
"mono foo.exe "

To compile with gtk# for UIs use the following command.
mcs -pkg:gtk-sharp-2.0 -recurse:Com.test.foo.SSL\*.cs

Tuesday, April 24, 2007

Instructions on how to run XWiki on JBoss

JBoss installation

These instructions are for the JBoss Application Server 4.0.X and MySQL ; other versions may differ.

* Download and install JBoss Application Server . It's usually as simple as unzipping it in a directory. Let's call this directory [JBOSS_HOME].
* (optional) If you want to modify the port on which JBoss is running, edit [JBOSS_HOME]/server/default/deploy/bossweb-tomcat55.sar/server.xml. Search for "8080" and replace with the port value you wish to use. Change the [JBOSS_HOME]/server/default/deploy/http-invoker.sar/META-INF/jboss-service.xml using the same way to the port you like.

Configure JBoss

* If your datasource is a MySQL database then copy the file called "mysql-xa-ds.xml" in to the "[JBOSS_HOME]/server/default/deploy" directory.
* Put the relevant mysql java connector jar file to the "[JBOSS_HOME]/server/default/lib".


Install XWiki application

* Add a jboss-web.xml to the "WEB-INF" directory in the XWiki WAR.
* Copy the XWiki WAR into a directory named xwiki/ in [JBOSS_HOME]/server/default/deploy.

Thursday, April 19, 2007

Apache Http to Https

I wanted to redirect all the http requests coming to Apache web server to https requests. I found a simple solution to do that. This method may not be the ideal way for that but it worked for me.

first make sure that /etc/httpd/conf/httpd.conf contains the following line

LoadModule rewrite_module modules/mod_rewrite.so

Then add following lines to httpd.conf
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*)$ https://www.foo.com/$1 [L,R]

finally restart the apache using
service httpd restart

last but not least test it using http://www.your.domain.com/
then you will see https://www.your.domain.com/

hope this method works for all...............


Monday, March 26, 2007

SOC 2007

Hi all,


I’m an undergraduate in the Department of computer science and engineering at University of Moratuwa, Sri- Lanka. Currently I’m in the third year. Recently I underwent training at an organization called Integrated Systems International at Sri-Lanka. I was exposed to industrial work there for a 6 month period of time. I like to do programming in Java.

I personally believe that effective documentation and source sharing and subversioning is very important for software development. So I personally experienced the role that XWIKI can play in the software development. When I sow XWIKI on SOC 2007 I decided that I can do something from here. Earlier I thought of doing the Subversion Integration project. But that idea changed immediately after I found the IDE Editor Integration project. I like Eclipse and XWIKI. I want Eclipse to like XWIKI. So I decided to apply for the IDE Editor Integration project.

For more details contact me for by replying to this or sending me a mail to djtharindu@gmail.com.

Best Regards,
Tharindu Jayasuirya.