<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gerger</title>
	<atom:link href="http://gerger.co/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://gerger.co/blog</link>
	<description>Hello there! We are Gerger. We build Formspider, the Web 2.0 Framework for PL/SQL developers. These are our adventures.</description>
	<lastBuildDate>Sun, 06 May 2012 05:31:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>ORA-04030 and dbms_xslProcessor.valueOf</title>
		<link>http://gerger.co/blog/2011/11/03/ora-04030-and-dbms_xslprocessor-valueof/</link>
		<comments>http://gerger.co/blog/2011/11/03/ora-04030-and-dbms_xslprocessor-valueof/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 15:39:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[04030]]></category>
		<category><![CDATA[ORA-04030]]></category>
		<category><![CDATA[XMLType get node value]]></category>

		<guid isPermaLink="false">http://gerger.co/blog/?p=233</guid>
		<description><![CDATA[While reading values from XML nodes for a bulk operation, we encountered the &#8220;ORA-04030: out of process memory when trying to allocate&#8230;&#8221; error raised by dbms_xslProcessor.valueOf procedure. When I first searched the web, I found out that small PGA size or kernel parameters not large enough to allow enough RAM was the cause of the [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>While reading values from XML nodes for a bulk operation, we encountered the &#8220;ORA-04030: out of process memory when trying to allocate&#8230;&#8221; error raised by dbms_xslProcessor.valueOf procedure.</p>
<p>When I first searched the web, I found out that small PGA size or kernel parameters not large enough to allow enough RAM was the cause of the problem. Then I tried to tune the database and operating system parameters. However down that path madness lied. Soon enough I’ve found myself playing with parameters that are better left alone.</p>
<p>Then I tried XMLType API’s instead of the XMLDom API’s and the result was successful. Memory and SWAP usage significantly decreased.<br/></p>
<h3><span>How to read xml node values with XMLType</span></h3>
<p>My XML to read looks like:</p>
<pre class="code">&lt;PANELDTLS&gt;
  &lt;PANELDTL&gt;
    &lt;ENABLED_YN&gt;Y&lt;/ENABLED_YN&gt;
    &lt;INSERT_YN&gt;N&lt;/INSERT_YN&gt;
    &lt;LABEL_TX&gt;ID&lt;/LABEL_TX&gt;
  &lt;/PANELDTL&gt;
  &lt;PANELDTL&gt;
    &lt;ENABLED_YN&gt;Y&lt;/ENABLED_YN&gt;
    &lt;INSERT_YN&gt;N&lt;/INSERT_YN&gt;
    &lt;LABEL_TX&gt;Description&lt;/LABEL_TX&gt;
  &lt;/PANELDTL&gt;
  &lt;PANELDTL&gt;
    &lt;ENABLED_YN&gt;Y&lt;/ENABLED_YN&gt;
    &lt;INSERT_YN&gt;N&lt;/INSERT_YN&gt;
    &lt;LABEL_TX&gt;Name&lt;/LABEL_TX&gt;
  &lt;/PANELDTL&gt;
  .
  .
  .
&lt;/PANELDTLS&gt;</pre>
<p>and I want an output like:</p>
<pre class="code">ENABLED_YN INSERT_YN LABEL_TX
---------- --------- -----------
Y          N         ID
Y          N         Name
Y          N         Description</pre>
<p>Here is the query to read text node:</p>
<pre class="code" style="overflow: auto;">select dbms_xmlgen.convert(
         extract(column_value,'/PANELDTL/ENABLED_YN/text()').getStringVal(),
         1 /*means decrypt escape characters*/ ) enabled_yn,
       dbms_xmlgen.convert(
         extract(column_value, '/PANELDTL/INSERT_YN/text()').getStringVal(),
         1) insert_yn,
       dbms_xmlgen.convert(
         extract(column_value, '/PANELDTL/LABEL_TX/text()').getStringVal(),
         1) label_tx
from table( XMLSequence( xmltype(
'&lt;PANELDTLS&gt;
  &lt;PANELDTL&gt;
    &lt;ENABLED_YN&gt;Y&lt;/ENABLED_YN&gt;
    &lt;INSERT_YN&gt;N&lt;/INSERT_YN&gt;
    &lt;LABEL_TX&gt;ID&lt;/LABEL_TX&gt;
  &lt;/PANELDTL&gt;
  &lt;PANELDTL&gt;
    &lt;ENABLED_YN&gt;Y&lt;/ENABLED_YN&gt;
    &lt;INSERT_YN&gt;N&lt;/INSERT_YN&gt;
    &lt;LABEL_TX&gt;Description&lt;/LABEL_TX&gt;
  &lt;/PANELDTL&gt;
  &lt;PANELDTL&gt;
    &lt;ENABLED_YN&gt;Y&lt;/ENABLED_YN&gt;
    &lt;INSERT_YN&gt;N&lt;/INSERT_YN&gt;
    &lt;LABEL_TX&gt;Name&lt;/LABEL_TX&gt;
  &lt;/PANELDTL&gt;
&lt;/PANELDTLS&gt;').extract('/PANELDTLS/PANELDTL')))</pre>
<p>Uğur Koçak
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://gerger.co/blog/2011/11/03/ora-04030-and-dbms_xslprocessor-valueof/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The 100th Confirmed Installation</title>
		<link>http://gerger.co/blog/2011/06/15/the-100th-confirmed-installation/</link>
		<comments>http://gerger.co/blog/2011/06/15/the-100th-confirmed-installation/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 13:58:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gerger.co/blog/?p=227</guid>
		<description><![CDATA[When we made Formspider Installer available in February, we counted how many people are actually downloading it. After a while a thought came to our minds. PL/SQL developers from all over the world were downloading Formspider. But were they installing it? We had built a notification system to the installer that alerted us when an [...]]]></description>
			<content:encoded><![CDATA[<p>When we made Formspider Installer available in February, we counted how many people are actually downloading it. After a while a thought came to our minds. PL/SQL developers from all over the world were downloading Formspider. But were they installing it? We had built a notification system to the installer that alerted us when an installation attempt failed (with user’s permission of course). However, we had no mechanism to know how many of the installation attempts succeeded. We updated the installer in May to count the successful installations.</p>
<p>Formspider Installer opens up a thank you web page when the installation completes and we count how many times we render the thank you page. This page serves to a much more important purpose too. We’ve felt like the end of the installation did not really reflect our sentiments about how happy we are that you are giving Formspider a shot. Our thank you page shows how we really feel about it.</p>
<p>Formspider surged passed 100 installations in just five weeks. This is amazing. Thanks to Formspider, we have met many people from all around the world. We exchanged ideas, received invaluable feedback and hopefully we were able to help them as well.</p>
<p>On behalf of the team, I would like to sincerely thank everyone who is giving Formspider a shot. We love to hear what people do with Formspider. Please don’t be a stranger. Let us know what you do. Send us an email, ask a question or get involved in social networks. We are here to help.</p>
]]></content:encoded>
			<wfw:commentRss>http://gerger.co/blog/2011/06/15/the-100th-confirmed-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let&#8217;s meet at Oracle Open World</title>
		<link>http://gerger.co/blog/2011/06/04/lets-meet-at-oracle-open-world/</link>
		<comments>http://gerger.co/blog/2011/06/04/lets-meet-at-oracle-open-world/#comments</comments>
		<pubDate>Sat, 04 Jun 2011 13:40:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gerger.co/blog/?p=223</guid>
		<description><![CDATA[This year, Formspider team applied to present at the Oracle OpenWorld via Oracle Mix. We submitted the presentation “Forms Modernization: The PL/SQL Way”. We believe Oracle Forms modernization is an important topic for many Oracle customers. We would like to share our experience and knowledge in how organizations can protect their Forms and PL/SQL investment. [...]]]></description>
			<content:encoded><![CDATA[<p>This year, Formspider team applied to present at the Oracle OpenWorld via Oracle Mix. We submitted the presentation “Forms Modernization: The PL/SQL Way”. </p>
<p>We believe Oracle Forms modernization is an important topic for many Oracle customers. We would like to share our experience and knowledge in how organizations can protect their Forms and PL/SQL investment. If you are interested in seeing this presentation at Oracle OpenWorld please vote for it on the <a href="http://goo.gl/8ypOj">Oracle Suggest-A-Session page</a>. </p>
<p>Admittedly, the process to vote is a little tedious. If you don’t have an Oracle account, you have to sign up and then vote for at least three presentations in order for your vote to be valid. However, we promise the presentation will be totally worth your effort. <img src='http://gerger.co/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><a href="http://goo.gl/8ypOj">Vote for Forms Modernization: The PL/SQL Way now</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gerger.co/blog/2011/06/04/lets-meet-at-oracle-open-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free PL/SQL and Web 2.0 Training</title>
		<link>http://gerger.co/blog/2011/06/03/free-plsql-and-web-2-0-training/</link>
		<comments>http://gerger.co/blog/2011/06/03/free-plsql-and-web-2-0-training/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 11:10:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gerger.co/blog/?p=221</guid>
		<description><![CDATA[Formspider, our Web 2.0 framework for PL/SQL developers, is moving ahead full speed. In four months and with just a $5/day Google AdSense budget, Formspider surpassed 500 downloads and 500 online users. We all would like to thank you from the bottom of our hearts. We are determined to help PL/SQL developers build amazing web [...]]]></description>
			<content:encoded><![CDATA[<p>Formspider, our Web 2.0 framework for PL/SQL developers, is moving ahead full speed. In four months and with just a $5/day Google AdSense budget, Formspider surpassed 500 downloads and 500 online users. We all would like to thank you from the bottom of our hearts.</p>
<p>We are determined to help PL/SQL developers build amazing web applications. We believe Formspider is the best way to achieve this goal. To prove this, we are offering free Formspider training to anyone who is interested.</p>
<p>So how does this actually work? If you are located in Istanbul, Turkey just contact us to schedule the training.</p>
<p>If you are not located in Istanbul, we can come to your office anywhere in the world and provide a five day Formspider training completely free of charge. The training may be for one developer or hundred. All we ask from you is to pay for travel, lodging and a reasonable €100 Per Diem for the daily expenses of the trainer. The five day training itself is completely free.</p>
<p><a href="mailto:contact@theformspider.com">Contact us now</a>, let us show you how Formspider can help you build platform independent beautiful web applications with just PL/SQL.</p>
]]></content:encoded>
			<wfw:commentRss>http://gerger.co/blog/2011/06/03/free-plsql-and-web-2-0-training/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript vs. JavaFX</title>
		<link>http://gerger.co/blog/2011/05/27/javascript-vs-javafx/</link>
		<comments>http://gerger.co/blog/2011/05/27/javascript-vs-javafx/#comments</comments>
		<pubDate>Fri, 27 May 2011 21:03:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gerger.co/blog/?p=216</guid>
		<description><![CDATA[We built the XML Editor for the Formspider IDE in Java, because the original Formspider IDE was a Java Application. When we were preparing the Formspider Online IDE for the Web, we also had to move the XML Editor to the Web. In one of the brilliant moments of my career I told the team [...]]]></description>
			<content:encoded><![CDATA[<p>We built the XML Editor for the Formspider IDE in Java, because the original Formspider IDE was a Java Application. When we were preparing the Formspider Online IDE for the Web, we also had to move the XML Editor to the Web. In one of the brilliant moments of my career I told the team “Hey, we have a working editor in Java. Why don’t we convert it to JavaFX and be done with it?” This should be simple right? Right…After months of work, we finally got the editor working in JavaFX. The fact that we converted from Java to JavaFX, did not help as much as we hoped it would.</p>
<p>We went live with the Formspider Online IDE and started observing user behavior. Something was not right. People were signing up but not really doing anything. A quick investigation revealed that we were having problems with the XML Editor. It was failing for more than 50% of our users. Some people didn’t have Java on their machines, some had the open SDK that did not support JavaFX and some had problems we could not figure out.</p>
<p>Formspider IDE was not a joyride for the lucky few who was able to run the editor either. On average, a user had to wait about two minutes before the IDE was ready for input. The 1.5 MB jar was downloaded quickly enough but it took ages for the computer to install the jar and getting it ready to run. The security alert that kept popping up was also very annoying from the user’s perspective.The state we were in with the Online IDE was clearly unacceptable.</p>
<p>JavaScript came to the rescue. We were actually smart enough to sponsor a coding contest for a JavaScript editor while we were working on the JavaFX one. The team of Bilal Gültekin and Bahattin Tozyılmaz were the winners. In the picture below you see Bilal receiving their bounty, a teddy bear filled with $2600 dollars. We are also looking forward to host both Bilal and Bahattin as our interns this summer.</p>
<div id="attachment_219" class="wp-caption aligncenter" style="width: 310px"><a href="http://gerger.co/blog/wp-content/uploads/2011/05/bilal.jpg"><img src="http://gerger.co/blog/wp-content/uploads/2011/05/bilal-300x225.jpg" alt="" title="Bilal Recieving His Teddy Bear" width="300" height="225" class="size-medium wp-image-219" /></a><p class="wp-caption-text">The Award Ceramony</p></div>
<p>After the contest was over, Öskan took over the code base for the XML Editor in JavaScript and prepared it for production use. After several weeks of work, the editor was ready for beta testing. However, the problem was so severe that even a partially working editor written in JavaScript was better than a thoroughly tested editor written in JavaFX. So we skipped the beta pretty quickly. We were already annoying pretty much every user, how much worse could we really get?</p>
<p>After a few quick iterations, we were incredibly happy with the results. Now our new XML Editor written entirely in JavaScript loads instantly and runs for our every user. Most importantly, our users started to engage with the Online IDE. I see them creating panels, text fields and windows everyday.</p>
<p>If you used the Formspider Online IDE before and you did not have a pleasant experience at all, I apologize and kindly invite you <a href="http://goo.gl/afm5a">to give it another try</a>. If this is going to be your first time with the Online IDE, nevermind… <a href="http://goo.gl/afm5a">It all works just fine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://gerger.co/blog/2011/05/27/javascript-vs-javafx/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Caching Dynamically Generated Scripts</title>
		<link>http://gerger.co/blog/2011/03/23/caching-dynamically-generated-scripts/</link>
		<comments>http://gerger.co/blog/2011/03/23/caching-dynamically-generated-scripts/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 21:18:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jsp]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[servlet]]></category>

		<guid isPermaLink="false">http://gerger.co/blog/?p=210</guid>
		<description><![CDATA[If static JavaScript or CSS files are served from the application server, we take it for granted that they are going to be cached by the browsers. However, dynamically generated content (Javascript and CSS in particular) could also be cached as if it is static and sent from the server only when it is changed. [...]]]></description>
			<content:encoded><![CDATA[<p>If static JavaScript or CSS files are served from the application server, we take it for granted that they are going to be cached by the browsers. However, dynamically generated content (Javascript and CSS in particular) could also be cached as if it is static and sent from the server only when it is changed. <b>Nevertheless, application servers provide no support for this at all</b>. So, the responsibility rests on the shoulders of the server-side code which generates dynamic content.</p>
<p>I looked all over the Internet but was unable to find a solution, so I wrote my own code. It&#8217;s written for a Java Servlet but the same logic can be applied to other languages too. The servlet below sends a piece of JavaScript to the client that it builds dynamically and adds the necessary headers to the response so that the browser can cache it.</p>
<p>Here&#8217;s the code that gets the job done:</p>
<pre class="code">public class TestServlet extends HttpServlet {
    private static final String CONTENT_TYPE = "application/x-javascript";

    public void init(ServletConfig config) throws ServletException {
        super.init(config);
    }

    public void doGet(HttpServletRequest request,
                      HttpServletResponse response) throws ServletException, IOException {

        Calendar c1 = Calendar.getInstance();
        c1.clear();
        c1.set(2011,2,22,13,12);
        long lastModifiedDate = c1.getTimeInMillis();

        response.setContentType(CONTENT_TYPE);
        response.addDateHeader("Last-Modified",lastModifiedDate);

        PrintWriter out = response.getWriter();

        long lastFetchedDate = request.getDateHeader("If-Modified-Since");
        boolean notModified = false;
        if (lastFetchedDate&gt;-1){
            if (lastModifiedDate&lt;=lastFetchedDate){
                response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
                notModified = true;
            }
        }
        if (!notModified){
            System.out.println("test");
            out.println("var test = {};");
            out.println("test['a']='b';");
            out.println("alert(test['a']);");
        }

    }

    public void doPost(HttpServletRequest request,
                       HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }
}&nbsp;</pre>
<p>To keep the example simple, I used a static date for the last modified date.</p>
<p>Here is how you can include this servlet in an html document as a javascript file:</p>
<pre class="code">&lt;html&gt;
    &lt;head&gt;
    &lt;script type="text/javascript" src="http://localhost/test/testservlet"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;/body&gt;
&lt;/html&gt;
</pre>
<p>When you run this from an application server, the first time you access the page you will see the message &#8220;test&#8221; in application server console, meaning that the servlet did the necessary work and generated the JavaScript code. The next time you access the page, the JavaScript will already be cached by the browser. Therefore, even the alert still pops up when the page is accessed, you will not the see message &#8220;test&#8221; in the server console. Since the dynamically created JavaScript is already cached in the browser and the headers were set up correctly, the server did not bother to generate the code all over again and responded much faster just like it would if the JavaScript was actually in a static file.&nbsp; </p>
<p>M. Serdar Biçer</p>
]]></content:encoded>
			<wfw:commentRss>http://gerger.co/blog/2011/03/23/caching-dynamically-generated-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aloha ICSSP 2011</title>
		<link>http://gerger.co/blog/2011/03/12/aloha-icssp-2011/</link>
		<comments>http://gerger.co/blog/2011/03/12/aloha-icssp-2011/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 15:23:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gerger.co/blog/?p=205</guid>
		<description><![CDATA[We are thrilled to announce that our team member M. Serdar Biçer will present his paper “Defect Prediction Using Social Network Analysis on Issue Repositories” at the International Conference on Software and Systems Process, ICSSP 2011. His work generated great interest from the committee of reviewers and was one of the 18 papers accepted to [...]]]></description>
			<content:encoded><![CDATA[<p>We are thrilled  to announce that our team member M. Serdar Biçer will present his paper “Defect Prediction Using Social Network Analysis on Issue Repositories” at the International Conference on Software and Systems Process, ICSSP 2011.  His work generated great interest from the committee of reviewers and was one of the 18 papers accepted to the conference world wide. We congratulate him for his amazing success. Serdar, enjoy your trip to Hawaii!</p>
]]></content:encoded>
			<wfw:commentRss>http://gerger.co/blog/2011/03/12/aloha-icssp-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Maps Api v3 Location Search with jQuery Autocomplete Plugin</title>
		<link>http://gerger.co/blog/2011/02/17/google-maps-api-v3-location-search-with-jquery-autocomplete-plugin/</link>
		<comments>http://gerger.co/blog/2011/02/17/google-maps-api-v3-location-search-with-jquery-autocomplete-plugin/#comments</comments>
		<pubDate>Fri, 18 Feb 2011 01:27:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gerger.co/blog/?p=13</guid>
		<description><![CDATA[When I needed Google Maps style auto complete in my application, I looked into a lot of JavaScript libraries but I couldn’t find a useful solution. Since I’m new to JQuery, at first I couldn’t realize how it simple all this was. With JQuery auto complete plug-in we can pull data from local or remote [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Arial, Helvetica, sans-serif;">When I needed  Google Maps style auto complete in my application, I looked into a lot of JavaScript libraries but I couldn’t find a useful solution. Since I’m new to JQuery, at first I couldn’t realize how it simple all this was.<br />
</span></p>
<div><span style="font-family: Arial, Helvetica, sans-serif;">With JQuery auto complete plug-in we can pull data from local or remote sources. In this example , I used <strong>google.maps.Geocoder</strong> as the remote data source.</p>
<p>For those who are not familiar with the term, geocoding is the process of converting addresses like (&#8220;1600 Amphitheatre Parkway, Mountain View, CA”) into geographic coordinates (latitude and longitude values).</p>
<p>There are two different geocode requests in this example:</p>
<p>1. I used first geocoding request to convert user address into latitude and longitude values,<br />
2. The second request is the <strong>Reverse Geocoding</strong>, to convert search results into human readable format.</p>
<p></span></div>
<div><span style="font-family: Arial, Helvetica, sans-serif;">Reverse Geocoding often returns more than one result. I think it is best to fetch all these results and serve all of them to the user instead of showing only one result.</p>
<p>After getting search results for a given keyword, the map’s viewport is adjusted to the selected search result using <strong>map.fitBounds(bounds)</strong>.</p>
<p>Let’s examine the script;</p>
<p>First initialize the map with basic options;</p>
<pre class="code">var mapOptions = {
  zoom : 10,
  mapTypeId: google.maps.MapTypeId.ROADMAP,
  center: new google.maps.LatLng(41.06000,28.98700)
};

var map = new google.maps.Map(document.getElementById("map"),mapOptions);</pre>
<p><span style="font-family: monospace;"><br />
</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">Then create a google Geocoder object;</span></p>
<pre class="code">var geocoder = new google.maps.Geocoder();</pre>
<p><span style="font-family: Arial, Helvetica, sans-serif;">Bind the auto complete event to the search input box,</span></p>
<pre class="code">$(function() { $("#searchbox").autocomplete({ source: function(request, response) {</pre>
<p><span style="font-family: Arial, Helvetica, sans-serif;">In source event I created a callback function that process the geocoder results;</span></p>
<div>
<pre class="code">geocoder.geocode( {'address': request.term }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) {</pre>
<p><span style="font-family: Arial, Helvetica, sans-serif;"><br />
</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">My first geocoder request takes address as a parameter, and the callback functions processes the returning result object if geocoder status is OK. Then using the returning location which usually has one string, I prepare a Google Maps <strong>LatLng</strong> object to get a list of search results with reverse geocoding;</span></p>
</div>
<pre class="code">var lat = results[0].geometry.location.lat();
var lng = results[0].geometry.location.lng();
var latlng = new google.maps.LatLng(lat, lng);</pre>
<p><span style="font-family: Arial, Helvetica, sans-serif;"><br />
</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;">This is the second and the last request to google geocoder with latlng;</span></p>
<pre class="code">geocoder.geocode({'latLng': latlng}, function(results1, status1) {</pre>
<p><span style="font-family: Arial, Helvetica, sans-serif;">This request also have a callback function that generates label, value and bounds </span></p>
<pre class="code">if (status1 == google.maps.GeocoderStatus.OK) {
if (results1[1]) {
             response($.map(results1, function(loc) {
        return {
         label: loc.formatted_address,
         value: loc.formatted_address,
         bounds: loc.geometry.bounds
}
               }));
          }
    }
 });</pre>
<p><span style="font-family: Arial, Helvetica, sans-serif;">Finally, when the user selects an option from search results, to navigate the map to that place, I wrote the following code in the auto complete <strong>select </strong>event;</span></p>
<pre class="code">select: function(event,ui){
var bounds = ui.item.bounds;
  map.fitBounds(bounds);
 }</pre>
<p><span style="font-family: Arial, Helvetica, sans-serif;">Here is the full demonstration of my auto complete example; </span></p>
<div><span style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div>
<pre class="code">&lt;!DOCTYPE PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
<span style="white-space: pre;"> </span>&lt;head&gt;
<span style="white-space: pre;">  </span>&lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;<span style="white-space: pre;"> </span>
<span style="white-space: pre;">  </span>&lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"&gt;&lt;/script&gt;<span style="white-space: pre;"> </span>
<span style="white-space: pre;">  </span>&lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"&gt;&lt;/script&gt;
<span style="white-space: pre;">  </span>&lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/&gt;<span style="white-space: pre;">  </span>
<span style="white-space: pre;"> </span>&lt;/head&gt;
<span style="white-space: pre;"> </span>&lt;body&gt;
<span style="white-space: pre;">  </span>&lt;h1&gt;Google Maps Autocomplete Search Sample&lt;/h1&gt;
<span style="white-space: pre;">  </span>&lt;div align="left"&gt;
<span style="white-space: pre;">   </span>&lt;input type="text" value="" id="searchbox" style=" width:800px;height:30px; font-size:15px;"&gt;
<span style="white-space: pre;">  </span>&lt;/div&gt;
<span style="white-space: pre;">  </span>&lt;div align="left" id="map" style="width:800px; height: 600px; margin-top: 10px;"&gt;
<span style="white-space: pre;">   </span>
<span style="white-space: pre;">  </span>&lt;/div&gt;
<span style="white-space: pre;">  </span>
<span style="white-space: pre;"> </span>&lt;/body&gt;
&lt;/html&gt;
&lt;script type="text/javascript"&gt;
<span style="white-space: pre;"> </span>$(document).ready(function(){

<span style="white-space: pre;">  </span>var mapOptions = {
<span style="white-space: pre;">   </span>    zoom: 10,
<span style="white-space: pre;">   </span>    mapTypeId: google.maps.MapTypeId.ROADMAP,
<span style="white-space: pre;">   </span>    center: new google.maps.LatLng(41.06000,28.98700)
<span style="white-space: pre;">   </span>  };

<span style="white-space: pre;">  </span>var map = new google.maps.Map(document.getElementById("map"),mapOptions);

<span style="white-space: pre;">  </span>var geocoder = new google.maps.Geocoder();<span style="white-space: pre;">  </span>

<span style="white-space: pre;"> </span>    $(function() {
<span style="white-space: pre;"> </span>        $("#searchbox").autocomplete({
<span style="white-space: pre;"> </span>        
<span style="white-space: pre;"> </span>          source: function(request, response) {

<span style="white-space: pre;">  </span>        if (geocoder == null){
<span style="white-space: pre;">  </span>        <span style="white-space: pre;"> </span>geocoder = new google.maps.Geocoder();
<span style="white-space: pre;">  </span>        }
<span style="white-space: pre;"> </span>            geocoder.geocode( {'address': request.term }, function(results, status) {
<span style="white-space: pre;">  </span>            <span style="white-space: pre;"> </span>if (status == google.maps.GeocoderStatus.OK) {

<span style="white-space: pre;"> </span>                <span style="white-space: pre;"> </span>var searchLoc = results[0].geometry.location;
<span style="white-space: pre;">  </span>            <span style="white-space: pre;"> </span>var lat = results[0].geometry.location.lat();
<span style="white-space: pre;"> </span>                <span style="white-space: pre;"> </span>var lng = results[0].geometry.location.lng();
<span style="white-space: pre;"> </span>                <span style="white-space: pre;"> </span>var latlng = new google.maps.LatLng(lat, lng);
<span style="white-space: pre;"> </span>                <span style="white-space: pre;"> </span>var bounds = results[0].geometry.bounds;

<span style="white-space: pre;"> </span>            <span style="white-space: pre;"> </span>    geocoder.geocode({'latLng': latlng}, function(results1, status1) {
<span style="white-space: pre;"> </span>            <span style="white-space: pre;"> </span>        if (status1 == google.maps.GeocoderStatus.OK) {
<span style="white-space: pre;"> </span>            <span style="white-space: pre;"> </span>          if (results1[1]) {
<span style="white-space: pre;"> </span>            <span style="white-space: pre;"> </span>        <span style="white-space: pre;"> </span>  response($.map(results1, function(loc) {
<span style="white-space: pre;">  </span>      <span style="white-space: pre;">   </span>             return {
<span style="white-space: pre;"> </span>      <span style="white-space: pre;">   </span>                  label<span style="white-space: pre;">  </span>: loc.formatted_address,
<span style="white-space: pre;"> </span>      <span style="white-space: pre;">   </span>                  value<span style="white-space: pre;">  </span>: loc.formatted_address,
<span style="white-space: pre;"> </span>      <span style="white-space: pre;">   </span>                  bounds  <span style="white-space: pre;"> </span>: loc.geometry.bounds
<span style="white-space: pre;"> </span>      <span style="white-space: pre;">   </span>                }
<span style="white-space: pre;"> </span>      <span style="white-space: pre;">   </span>              }));
<span style="white-space: pre;"> </span>            <span style="white-space: pre;"> </span>          }
<span style="white-space: pre;"> </span>            <span style="white-space: pre;"> </span>        }
<span style="white-space: pre;"> </span>            <span style="white-space: pre;"> </span>      });
<span style="white-space: pre;">   </span>         }
<span style="white-space: pre;">  </span>            });
<span style="white-space: pre;"> </span>          },
<span style="white-space: pre;"> </span>          select: function(event,ui){
<span style="white-space: pre;">      </span>var pos = ui.item.position;
<span style="white-space: pre;">      </span>var lct = ui.item.locType;
<span style="white-space: pre;">      </span>var bounds = ui.item.bounds;

<span style="white-space: pre;">      </span>if (bounds){
<span style="white-space: pre;">       </span>map.fitBounds(bounds);
<span style="white-space: pre;">      </span>}
<span style="white-space: pre;">  </span>       <span style="white-space: pre;">  </span>}
<span style="white-space: pre;"> </span>        });
<span style="white-space: pre;"> </span>    });<span style="white-space: pre;">   </span>
<span style="white-space: pre;"> </span>});
&lt;/script&gt;</pre>
<p><img src="http://3.bp.blogspot.com/-_MeHfGensB0/TV1K2s3RokI/AAAAAAAAAN8/CHjRiKKqVFs/s400/mapsautocompsearch.jpg" border="0" alt="" /></p>
<p>Aziz Ünsal ( <a href="http://twitter.com/#!/azizunsall" target="_blank">@azizunsall</a> )</p>
<p></span></div>
]]></content:encoded>
			<wfw:commentRss>http://gerger.co/blog/2011/02/17/google-maps-api-v3-location-search-with-jquery-autocomplete-plugin/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Formspider Available for Local Installation</title>
		<link>http://gerger.co/blog/2011/02/16/formspider-available-for-local-installation/</link>
		<comments>http://gerger.co/blog/2011/02/16/formspider-available-for-local-installation/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 02:38:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gerger.co/blog/?p=23</guid>
		<description><![CDATA[We just made Formspider available for downloading and installing locally. This was important as there was quite a bit of interest in the local installation. The team tested the hell out of the installer but please, please, pretty please let us know if you run into any issues. Giving feedback is incredibly easy. If the [...]]]></description>
			<content:encoded><![CDATA[<p>We just made Formspider available for downloading and installing locally. This was important as there was quite a bit of interest in the local installation. The team tested the hell out of the installer but please, please, pretty please let us know if you run into any issues. Giving feedback is incredibly easy. If the installer fails, it will ask your permission to send us the installation log. It collects no personal information and asks for an optional email address to get back to you when the problem is fixed.</p>
<p>The Installer currently supports Windows only. We are going to support other platforms but in the meantime, if you need Formspider installed to a different OS, contact us at contact@theformpider.com. We’d be happy to guide you through it.</p>
]]></content:encoded>
			<wfw:commentRss>http://gerger.co/blog/2011/02/16/formspider-available-for-local-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wrapping PL/SQL Source Code and a Strange Bug (PLS-00753)</title>
		<link>http://gerger.co/blog/2011/02/15/wrapping-plsql-source-code-and-a-strange-bug-pls-00753/</link>
		<comments>http://gerger.co/blog/2011/02/15/wrapping-plsql-source-code-and-a-strange-bug-pls-00753/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 22:08:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[PL/SQL]]></category>
		<category><![CDATA[wrapping source code]]></category>

		<guid isPermaLink="false">http://gerger.co/blog/?p=27</guid>
		<description><![CDATA[Wrapping process makes PL/SQL source code unreadable. Developers can wrap package specifications, package bodies, functions, procedures, type specifications and type bodies. Unfortunately triggers cannot be wrapped. To wrap the trigger code you need to place your source code to a package or procedure and call it from the trigger. There are two ways to wrap [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Wrapping process makes PL/SQL source code unreadable. Developers can wrap package specifications, package bodies, functions, procedures, type specifications and type bodies. Unfortunately triggers cannot be wrapped. To wrap the trigger code you need to place your source code to a package or procedure and call it from the trigger.</p>
<p>There are two ways to wrap PL/SQL source code.</p>
<p><b>1. Wrapping PL/SQL source code with wrap utility</b></p>
<p>Wrap utility takes two parameters. First one (<i>iname</i>) is the PL/SQL source code file and the second one (<i>oname</i>) is the output file that will hold the wrapped code.</p>
<pre class="code">wrap iname=example_input_file.sql oname=example_output_file.plb</pre>
<p>This is an easy way to wrap source code because you do not need to handle DDLs bigger than 32767 bytes. But this way, you need to save DDLs into different files and execute the wrap command frmo the command prompt for each file.</p>
<p><b>2. Wrapping PL/SQL source code with DBMSL_DDL package</b></p>
<p>The DBMS_DDL package contains an overloaded wrap API to wrap PL/SQL source code.</p>
<pre class="code">dbms_ddl.wrap(ddl varchar2, lb pls_integer, ub, pls_integer) return varchar2;

dbms_ddl.wrap(ddl dbms_sql.varchar2s, lb pls_integer, ub, pls_integer) return dbms_sql.varchar2s;

dbms_ddl.wrap(ddl dbms_sql.varchar2a, lb pls_integer, ub, pls_integer) return dbms_sql.varchar2a;</pre>
<p>In this method of wrapping, developers need to handle CLOB values that are bigger than 32767 bytes. They need to convert CLOB values to either <i>dbms_sql.varchar2s</i> or <i>dbms_sql.varchar2a</i> format.</p>
<p>We wrapped all our source code the second way in Oracle 10.0.2.1. We liked the ability ti generate all the encoded scripts automatically in PL/SQL. The encoded scripts run just fine from SQLPlus or similar tool. However, when we run the scripts using JDBC, we have faced a problem. Some packages started to give the following error mesagge:</p>
<p><b><i>PLS-00753: malformed or corrupted wrapped unit</i></b></p>
<p>First, we tried to solve the problem with changing character encoding but this did not help us. Then we started again to investigate the problem and we found a really interesting statement in the following forum thread. <a href="http://kr.forums.oracle.com/forums/thread.jspa?threadID=864095">site</a>.</p>
<p>“<i>This only happens if the last character of the wrapped code is at the end of a line.</i>” </p>
<p>We looked over all our uncompiled packages and verified the problem. Then we found an odd solution to this strange bug. We started to break down the last character of the wrapped code to next line. It does not mess up the wrapped code and works just fine in different oracle 10g versions.</p>
<p>Here is the function which extracts the DDL of the specified object in <i>dbms_sql.varchar2a</i> format and then wraps the source code using the <i>dbms_ddl.wrap</i> utility. We used <i>dbms_sql.varchar2a</i> due to the length of our object DDLs. At the end, there is a code block which converts <i>dbms_sql.varchar2a</i> to CLOB. It breaks down the last character of the wrapped code to the next line if the last character of the wrapped code is at the end of the line.</p>
<pre class="code">function extractCodeWrapped(in_objectType_cd varchar2, in_objectName_tx varchar2)
return  clob
is
 v_ddl_index_nr number;
 v_cur_pos_nr number;
 v_next_pos_nr number;

 v_ddl_2a dbms_sql.varchar2a;
 v_wrapped_ddl_2a dbms_sql.varchar2a;

 v_wrapped_ddl_cl clob;

 cursor cur_objectDDL is
   select -1 line, 'create or replace'||chr(10) text from dual
   union all
   select line, text
   from user_source
   where type = in_objectType_cd
   and name = in_objectName_tx
   order by line;

begin
 dbms_lob.createtemporary(v_wrapped_ddl_cl,true);

 -- extract DDL of the object
 v_ddl_index_nr := 1;
 for rec in cur_objectDDL loop
   v_ddl_2a(v_ddl_index_nr) := rec.text;
   v_ddl_index_nr := v_ddl_index_nr + 1;
 end loop;

 -- wrap source code of the object
 v_wrapped_ddl_2a := dbms_ddl.wrap(v_ddl_2a,1,v_ddl_2a.count);

 -- Convert dbms_sql.varchar2a to CLOB
 for i in 1..v_wrapped_ddl_2a.count loop

   -- if it is the last line check the last character. If the last character is
   -- at the end of line, break down it to next line.
   if i = v_wrapped_ddl_2a.count then
     -- find the positions of line feeds (chr(10)) at the line
     v_cur_pos_nr := 0;
     v_next_pos_nr := 0;
     loop
       v_cur_pos_nr := instr(v_wrapped_ddl_2a(i), chr(10), v_cur_pos_nr+1);
       v_next_pos_nr := instr(v_wrapped_ddl_2a(i), chr(10), v_cur_pos_nr+1);

       exit when v_cur_pos_nr = 0 or v_next_pos_nr = (length(v_wrapped_ddl_2a(i))-1)
              or v_next_pos_nr = length(v_wrapped_ddl_2a(i));
     end loop;
     -- if the line length is 74, the last character is at the end of line.
     if (length(v_wrapped_ddl_2a(i)) - v_cur_pos_nr) = 74 then
       -- append the line as two lines; first one is until last character and
       -- second one is only last character
       dbms_lob.writeappend(v_wrapped_ddl_cl, v_cur_pos_nr, substr(v_wrapped_ddl_2a(i), 1, v_cur_pos_nr));
       dbms_lob.writeappend(v_wrapped_ddl_cl, 71, substr(v_wrapped_ddl_2a(i), v_cur_pos_nr+1, 71));
       dbms_lob.writeappend(v_wrapped_ddl_cl, 1, chr(10));
       dbms_lob.writeappend(v_wrapped_ddl_cl, 2, substr(v_wrapped_ddl_2a(i), v_cur_pos_nr+72, 1)||chr(10));
     else
       -- otherwise append the line directly
       dbms_lob.writeappend(v_wrapped_ddl_cl, length(v_wrapped_ddl_2a(i)),v_wrapped_ddl_2a(i));
     end if;
   else
     -- if it is not last line append the line directly
     dbms_lob.writeappend(v_wrapped_ddl_cl, length(v_wrapped_ddl_2a(i)),v_wrapped_ddl_2a(i));
   end if;

 end loop;
 -- add '/' character end of object wrap
 dbms_lob.writeappend(v_wrapped_ddl_cl,3,'/'||chr(10)||chr(10));

 -- return wrapped source code
 return v_wrapped_ddl_cl;
end;
</pre>
<p>Here is sample code which calls the function:</p>
<pre class="code">declare
 v_objectType_cd varchar2(200) := 'PROCEDURE';
 v_objectName_tx varchar2(255) := 'TEST_PROCEDURE';

 v_wrapped_ddl_cl clob;
begin
 v_wrapped_ddl_cl := extractCodeWrapped(v_objectType_cd, v_objectName_tx);
 dbms_output.put_line(v_wrapped_ddl_cl);
end;
</pre>
<p>Samet Basaran</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://gerger.co/blog/2011/02/15/wrapping-plsql-source-code-and-a-strange-bug-pls-00753/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

