Sunday, June 17, 2012

Quick Start C++ in Linux Mint/Ubuntu/Debian Hello World

1) Install C and C++ Compilers in Mint 

      sudo aptitude install build-essential 


2) Compile the first Program sudo gedit first.c add the following lines save and exit the file



            #include int main() { printf("Hello world\n"); return 0; } 


3) Firstly compile the code using the following command 

     cc -c first.c 
 that would produce an object file you may need to add to the library.


 4) then create an executable using the following command 

 cc -o first first.c


 5) Now run this executable using the following command

 ./first

Tuesday, January 31, 2012

Fix Broken Packages

Debian, fix broken package installations sudo apt-get -f install Running a .DEB file sudo dpkg -i skype-ubuntu_2.2.0.35-1_amd64.deb

Sunday, November 7, 2010

Installing XAMPP IN UBUNTU

After downloading the file give the below command

1. sudo chown root:byorn xampp-linux-1.7.3a.tar.gz

2. sudo tar xvfz xampp-linux-1.7.3a.tar.gz -C /opt/

3. cd /opt/lampp
sudo ./lampp start

Sunday, September 12, 2010

Groovy, Blob to String

sql.eachRow "select * from table1",
{
///println it.id

String result = ""
blobTest = (oracle.sql.BLOB)it.mydoc

byte_stream_test = blobTest.getBinaryStream()
byte_stream_test.eachLine {charset->

result += charset+"\n" }
println result;


}

Saturday, September 11, 2010

Staring Oracle in Ubuntu. - Problem and work around resolution.

1) /etc/init.d/./oralcle-xe.sh start


2) error:
Copyright (c) 1991, 2005, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=lexi)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
byorn@lexi:/etc/init.d$ sudo ./oracle-xe restart
Shutting down Oracle Database 10g Express Edition Instance.
Stopping Oracle Net Listener

3) Now:
sudo /etc/init.d/./oralcle-xe.sh restart

4) success:
ler(s) for this service...
The command completed successfully


Any body have any idea about this?

Friday, September 10, 2010

DB Connectivity With Groovy

import java.sql.Connection
import java.sql.DriverManager
import javax.sql.DataSource
import groovy.sql.Sql
import oracle.jdbc.driver.OracleTypes

driver = oracle.jdbc.driver.OracleDriver
Connection conn = DriverManager.getConnection(
'jdbc:oracle:thin:rcms/password@localhost:1521:xe');

/*
*
* Here we call a procedural block with a closure.
* ${Sql.INTEGER} and ${Sql.VARCHAR} are out parameters
* which are passed to the closure.
*
*/
Sql sql = new Sql(conn);

//define a closure
myclosure = {println it.cusid + " " + it.cusname }

sql.eachRow("select * from tbl_customer", myclosure);