Vamsi Pavan’s Place

When curiousity outbursts …..

Entries Tagged as 'Programming'

xerces-c: C++ SAX2 Parser

July 21st, 2011 · 1 Comment · Articles, C/C++, Source Code

Basics of validating xmls with a given schema in C++.
1. Create parser instance.

SAX2XMLReader* parser = XMLReaderFactory::createXMLReader();

2. Set required features to parser instance as follow.
// Enable the parser’s schema support parser->setFeature(XMLUni::fgXercesSchema, true);
// Schema validation requires namespace processing to be turned on.<br />parser->setFeature(XMLUni::fgSAX2CoreValidation,true);<br />parser->setFeature(XMLUni::fgSAX2CoreNameSpaces,true);

3. Set schema location using setPropery api call with/without namespace. If we want use […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:·····

Eclipse: resource is outof sync with the file system - permanent solution

January 29th, 2011 · No Comments · Java, Tools, Windows

Mysteriously got the following exception when trying to build an Eclipse project:
“resource is out of sync with the file system”
Although I can’t be sure, I think I may have deleted a file outside of Eclipse. To fix the problem, right click the project or edited resource […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:··

xerces-c: C++ SAX2 Parser

January 24th, 2011 · No Comments · C/C++, Source Code

Basics of validating xmls with a given schema.
1. Create parser instance.

SAX2XMLReader* parser = XMLReaderFactory::createXMLReader();

2. Set required features to parser instance as follow.
// Enable the parser’s schema support
parser->setFeature(XMLUni::fgXercesSchema, true);

// Schema validation requires namespace processing to be turned on.
parser->setFeature(XMLUni::fgSAX2CoreValidation,true);
parser->setFeature(XMLUni::fgSAX2CoreNameSpaces,true);

3. Set schema location using setPropery api call with/without namespace. If we want use ‘ExternalSchemaLocation’ property we need to […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:·····

SQL Loader: Import CSV to Oracle table

June 29th, 2009 · 1 Comment · Oracle Tech, Pl/SQL

One of the very common task in oracle environment is export/import of CSV files to Oracle database. Export is pretty straight forward as many of oracle clients provide this as standard functionality for any query. But for import, we can do by writing our own scripts using pl/sql or java or .NET or any other […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:

MySQL Error Number 1005 Can’t create table ‘.\mydb\#sql-328_45.frm’ (errno: 150)

March 15th, 2009 · 3 Comments · Pl/SQL

If you get this error while trying to create a foreign key, it can
be pretty frustrating. The error about not being able to create a .frm
file seems like it would be some kind of OS file permission error or
something but this is not the case. This error has been reported as a
bug on the MySQL […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:

java.sql.SQLException: Io exception: Invalid Packet Lenght

March 9th, 2009 · 1 Comment · Java, Jsp/servlets, Programming

Similar exceptions are :
1. java.io.IOException: Io exception: Unexpected packet
2. java.sql.SQLException: Protocol violation
3. java.sql.SQLException: Io exception: Bad packet type
4. java.sql.SQLException: Bigger type length than Maximum
5. java.sql.SQLException: Io exception: Invalid Packet Lenght
6. java.sql.SQLException: Closed Connection
7. java.sql.SQLException: Closed Statement
8. java.sql.SQLException: Refcursor value is invalid
9. java.sql.SQLException: Io exception: Size Data Unit (SDU) mismatch
10. java.sql.SQLException: Must be logged on to […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:

java.io.UTFDataFormatException: 5-byte UTF8 encoding not supported.

March 9th, 2009 · 1 Comment · Java, Jsp/servlets, Programming

An interesting exception faced while parsing xml content. Also, on further analysis on this error caused below similar issues started to raise.
Another similar exception is:
java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence
Here, I am trying to parse an xml string using byte array from the xml string, and give that array as input to xml […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:

Dealing with newline, \n or even \r in PL/SQL

January 8th, 2009 · No Comments · Pl/SQL, Programming

In my PL/SQL procedure I had to add a text including newline (\n in
java, ascii #10) in a text to be read by a java application. Tried with
the code
l_text := ‘hello\nworld’;
This did not work, the \n character behaves clearly different in PL/SQL than
in Java and only wrote ‘\n’, probably the same as writing a String […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:

java.sql.SQLException: Non supported SQL92 token at position: 1

July 25th, 2008 · 2 Comments · Oracle Tech, Pl/SQL

Seems like this is very common error in pl/sql programming. I know there are many last minute frustrations just because of this error which is no where related to any logic. This seems to be some format error in the programming language itself.
The error message is:

java.sql.SQLException: Non supported SQL92 token at position: 1
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:·

Empty links in javascript

May 28th, 2008 · No Comments · Java Script

Best of way of writing empty links in javascript is
<a href=”javascript:void(0);” onMouseOver=”status=”;return true” onClick=”myPopup();” >
here, due to onMouseOver attribute, it won’t display the link location in the browser status bar. Otherwise, you see the ugly location to “javascript:void(0)” in status bar.

Bookmark it!
These icons link to social bookmarking sites where readers can share and discover new […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:·