tag:blogger.com,1999:blog-24710263218071471602024-03-08T07:39:02.143-08:00Record LinkageA developer's guide to Record Linkage, List Hygiene, Database Marketing and Customer Data Integration. Tips and Tricks from Java, SQL, Awk and other programming languages that are useful in achieving an accurate customer database.Unknownnoreply@blogger.comBlogger106125tag:blogger.com,1999:blog-2471026321807147160.post-33651396117094227582012-03-22T13:04:00.000-07:002012-03-22T13:07:02.723-07:00City Councilman presents recognition to Scientology<span class="Apple-style-span" style="font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, sans-serif; font-size: 12px;"></span><br />
<div class="wp-caption alignnone" style="background-color: #f3f3f3; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px; border-top-right-radius: 3px; border-top-style: solid; border-top-width: 1px; margin-bottom: 10px; margin-left: 10px; margin-right: 10px; margin-top: 10px; padding-top: 4px; text-align: center; width: 410px;">
<a href="http://scientologyinglewood.org/" target="_blank">Scientology News from Inglewood, CA</a><br />
<br />
<img alt="" height="320" src="https://wpyadmin.ne.cision.com/wpyfs/00/00/00/00/00/18/B1/70/special-commendation.jpg" style="border-bottom-style: none; border-bottom-width: 0px; border-color: initial; border-color: initial; border-left-style: none; border-left-width: 0px; border-right-style: none; border-right-width: 0px; border-top-style: none; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;" title="March 13 Designated L. Ron Hubbard Day in Inglewood, California" width="400" /><a href="http://scientologyinglewood.org/2012/03/22/march-13-designated-l-ron-hubbard-day-in-inglewood-california/" target="_blank">Proclamation from City Council of Inglewood</a><br />
<div class="wp-caption-text" style="font-size: 11px; line-height: 17px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 5px; padding-left: 4px; padding-right: 4px; padding-top: 0px;">
Inglewood City Councilman Ralph Franklin presented a proclamation honoring Scientology Founder L. Ron Hubbard and the Church of Scientology of Inglewood, on March 8, 2012, marking the 101st anniversary of the birth of L. Ron Hubbard.</div>
</div>
<div style="margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em;">
Inglewood, California—In commemoration of the birth of Scientology Founder<a href="http://www.lronhubbard.org/" style="border-bottom-color: silver; border-bottom-style: dotted; border-bottom-width: 1px; color: #515151; text-decoration: none;" target="_blank"> L. Ron Hubbard</a> in his centennial year, Inglewood, California, has designated March 13 as L. Ron Hubbard Day.</div>
<div style="margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em;">
Inglewood City Councilman Ralph Franklin presented a special commendation in City Council chambers March 8, to the Church of Scientology of Inglewood.</div>
<div style="margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em;">
Signed by Mayor James T. Butts Jr. and<strong> </strong>members of the<strong></strong>Inglewood City Council, the commendation states:</div>
<div style="margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em;">
“<a href="http://www.lronhubbard.org/" style="border-bottom-color: silver; border-bottom-style: dotted; border-bottom-width: 1px; color: #515151; text-decoration: none;" target="_blank">L. Ron Hubbard</a> is highly regarded and respected. His <a href="http://www.cisionwire.com/church-of-scientology-international/r/march-13-designated-l--ron-hubbard-day-in-inglewood--california,c9231240#" id="_GPLITA_1" style="border-bottom-color: silver; border-bottom-style: dotted; border-bottom-width: 1px; color: #515151; text-decoration: none;" title="Powered by Text-Enhance">work</a> has brightened the lives of people from a variety of cultures, backgrounds, and walks of life, and his vision has made a notable impact on the residents of the City of Inglewood.”</div>
<div style="margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em;">
The Public Information Center of the newly opened Church of Scientology of Inglewood at South Market Street in Inglewood, and the Church of Scientology Community Center at the intersection of 81st and S. Vermont Street in South Los Angeles, include extensive multimedia presentations on the life and legacy of <a href="http://www.lronhubbard.org/" style="border-bottom-color: silver; border-bottom-style: dotted; border-bottom-width: 1px; color: #515151; text-decoration: none;" target="_blank">L. Ron Hubbard</a>.</div>
<div style="margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em;">
The Information Centers further provide an overview of the many Church-sponsored humanitarian programs active in Inglewood and in cities the world over.</div>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-73300818254323498522012-01-21T12:59:00.000-08:002012-01-21T13:01:09.818-08:00The big switchWell I am in the process of switching over to Mac. I know I know, but after the iPod, the iPad, and then seeing the new Mac Book Air, I couldn't resist. So I've started coding using the Xcode environment and getting used to the differences. Lets see how far this goes...Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-66284143525137151122008-03-16T12:03:00.000-07:002008-03-16T12:19:43.594-07:00Scientology Video ChannelCheck out the new Scientology Video Channel at www.scientology.org. This new site has 82 videos, nearly three hours of audiovisual presentations on Scientology. It answers any questions one might have on What is Scientology, What are the beliefs of Scientology and what it is doing around the world.<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.scientology.net"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px;" src="http://photos-d.ak.facebook.com/photos-ak-sf2p/v182/123/93/682574383/n682574383_740247_1001.jpg" alt="" border="0" /></a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-51901163400738840482008-01-06T18:03:00.000-08:002008-01-06T18:03:42.405-08:00ISAL Rates and Country ListingI always have a hard time finding this when searching the USPS website. So here is a link to the ISAL rates and country listing: <br /><br /><a href="http://pe.usps.com/text/imm/immc2_040.htm#ep2056404">293 International Surface Air Lift (ISAL) Service</a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-64902950528222329172007-12-23T22:09:00.000-08:002007-12-23T22:35:31.425-08:00Record Linkage ResourcesDownload whitepaper on <a href="http://www.sigmod.org/disc/disc01/out/websites/deb_december/monge.pdf">"Approximate Duplicate Detection"</a> which opens with the following: <br /><br /><blockquote>Detecting database records that are approximate duplicates, but not exact duplicates, is an important task. Databases may contain duplicate records concerning the same real-world entity because of data entry errors, unstandardized abbreviations, or differences in the detailed schemas of records from multiple<br />databases – such as what happens in data warehousing where records from multiple data sources are integrated into a single source of information – among other reasons. In this paper we review a system to detect approximate duplicate records in a database and provide properties that a pair-wise record matching algorithm must have in order to have a successful duplicate detection system.</blockquote><br /><br /><a href="http://www.cedeplar.ufmg.br/pesquisas/td/TD%20198.pdf">Download paper</a> on probabilistic record linkage and an automated procedure to minimize the undecided-matched pair problem. Here is an introduction to this paper: <br /><br /><blockquote>Probabilistic record linkage allows the assembling of information from different data sources. In this article, we present a procedure in case a one-to-one relationship between records in different files is expected but is not found only by applying the probabilistic record linkage methodology. Our data were births and infant deaths from the 1998-birth cohort whose mother’s place of residence was the City of São Paulo at the time of birth. Our assumption was that pairs for which a one-to-one relationship was obtained, and a best-link was found with the highest combined weight would be considered as uniquevocally matched pairs or gold-standard and should then provide information in order to decide about pairs in which such a relationship could not be established. For example, we observed that the for the unequivocally matched pairs a clear and expected relationship between differences in dates of death and birth registration could be assessed. As a result, such a relationship was used to help solving the remaining pairs for which a one-to-one relationship could not be found. Indeed, we reduced the number of non-uniquely matched records and even though we could not establish a one-to-one relationship for every single death we reduced the number of uncertain. We suggest that future research using record linkage should use combined strategies from results from first record linkage runs before a full clerical review (the standard procedure under uncertainty) in order to most efficiently (and less costly), retrieve record matches.</blockquote><br /><br /><a href="http://www.soa.org/news-and-publications/publications/magazines/the-actuary-magazine/february-2007/link2007feb.aspx">Applications of Record Linkage Techniques</a> <br /><br />Here is an excerpt: <br /><br /><blockquote>Record linkage is simply the bringing together of information from two or more records that is believed to relate to the same entity, e.g., the same individual, the same family or the same business. This may entail the linking of records within a single computer file to identify duplicate records. Alternatively, record linkage may entail the linking of records across two or more files. The challenge lies in bringing together the records for the same individual entities. Such a linkage is known as an exact match. The task is easiest when 1) the files have nearly unique identification numbers (e.g., social security numbers), 2) information is recorded in standardized formats and 3) the files are small. In the absence of nearly unique identifiers, names, addresses, dates-of-birth or other indirect identifiers are frequently used in the matching process.</blockquote>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-70227313021440374792007-12-23T21:41:00.000-08:002007-12-23T22:05:43.567-08:00record linkage descriptionHere is a good description of "Record Linkage" from the <a href="http://www.umanitoba.ca/centres/mchp/concept/dict/record_linkage.html">University of Manitoba website:</a><br /><br /><blockquote>Record linkage is simply the integration of information from two independent sources. Records from the two sources that are believed to relate to the same individual are matched in such a way that they may then be treated as a single record for that individual. Records brought together in this way are said to be linked. The principles of record linkage may be applied to any field in which it is necessary to bring together information recorded about persons in different places or at different times.</blockquote>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-81637120122631064942007-12-20T11:42:00.000-08:002007-12-20T17:02:20.262-08:00What is the Perfect Computer?<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://jamie.fsm.org/items/dmsmh_oak.html"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px;" src="http://bpi.goldenageofknowledge.net/images/items/grouped/flier-small/dmsmh_oak.jpg" alt="" border="0" /></a>As a computer programmer, I was intrigued by the opening chapters of Dianetics, the Modern Science of Mental Health, by L. Ron Hubbard claiming that man how the "Analytical Mind" is in fact a perfect computer. It makes calculations based on the data it has. It is ALWAYS RIGHT.<br /><br />But like a computer program with unfortunate bugs, the calculation may come out with a wrong conclusion, but based on data it has, the program is still "right".<br /><br />There are two parts to one's mind. The Analytical and the Reactive Mind. Dianetics says that the Analytical Mind IS the Perfect Computer.<br /><blockquote>"What would you want in a computing machine? The action of the analytical mind—or analyzer—is everything anyone could want from the best computer available. It can and does do all the tricks of a computer. And over and above that, it directs the building of computers. And it is as thoroughly right as any computer ever was. The analytical mind is not just a <i>good</i> computer, it is a <i>perfect</i> computer. It never makes a mistake. It cannot err in any way so long as a human being is reasonably intact (unless something has carried away a piece of his mental equipment).<p> "The analytical mind is incapable of error, and it is so certain that it is incapable of error that it works out everything on the basis that it cannot make an error. If a person says, “I cannot add,” he either means that he has never been taught to add or that he has an aberration about adding. It does not mean that there is anything wrong with the analytical mind." <br />- <a href="http://jamie.fsm.org/items/dmsmh_oak.html">L. Ron Hubbard, Dianetics, The Modern Science of Mental Health</a><br /></p></blockquote><p> If this were true, how is it possible that people make mistakes, wrong decisions and don't live "perfect" lives? Or more to the point, how does one prevent writing buggy computer software? The answer lies in <a href="http://jamie.fsm.org/store/cart/addtocart.html?id=dmsmh-2007.en.hc">Dianetics</a> and specifically in the chapter on the Reactive Mind. Dianetics should be required reading for any software developer. It would not only result in less buggy software being developed, it would make for a world of less stressed out programmers!<br /></p><a href="http://jamie.fsm.org/store/cart/addtocart.html?id=dmsmh-2007.en.hc">Anyone interested in Dianetics can get a copy of this book here.</a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-87484126834874755942007-10-30T17:18:00.000-07:002007-10-30T17:30:34.335-07:00Format your Code for BloggerFinally, I found a solution of how to easily format my Source Code examples for Blogger. I've seen many examples of how other blog services handle this, such as Wordpress, but I don't use Wordpress...<br /><br />Here is how to easily do this, until Blogger comes up with an easier way:<br /><br />Copy your source code example and paste it into this page: <br /><br /><a href="http://formatmysourcecode.blogspot.com/">Source Code Formatter for Blogger</a><br /><br />Click on the "Format Code" button and copy the results. <br /><br />Switch to "Edit Html" view in your Blogger Edit Post page and paste in the formatted code example. <br /><br />Here is what a sample PL/SQL example would looks like: <br /><br /><pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code>BEGIN<br /> FOR cur IN (select id from test)<br /> LOOP<br /> UPDATE table SET column = "DONE" WHERE id = cur.id where;<br /> COMMIT;<br /> END LOOP;<br />END:<br />/<br /></code></pre><br />Thanks to Greg Houston for this simple solution.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-24961603863729679182007-10-26T10:44:00.000-07:002007-10-29T21:26:13.369-07:00How to Use JList - for DummiesI've built a few Java programs and am still not proficient with my tools, so I am laying out a series of simple instructions for learning and using the basic Java Swing tools. This will reference the websites where I go for direction as well as examples that I've found useful. <br /><br />The first place I always start is the Java tutorials on using Swing:<br /><br /><a href="http://webdia.cem.itesm.mx:8005/web/java/tutorial/uiswing/components/list.html">How to Use Lists</a><br /><br /><br />I ran into a situation where I had to remove multiple elements from a JList. Here is the exact trick on how to do that. It worked perfectly: <br /><br /><a href="http://stoken-tips-and-tricks.blogspot.com/2007/06/howto-remove-multiple-items-from-java.html">Remove Multiple Items from a List</a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-9967124590571179782007-10-25T12:12:00.000-07:002007-10-25T12:28:14.067-07:00Percentage of Americans who do not fill out a Change of Address with USPSHere is an excerpt giving an estimate of how many Americans move each year that do not fill out a change of address request with the post office. These address changes would not be returned with NCOA and would require other means of address recovery such as a "Deluxe" NCOA service that utilizes other address change databases such as magazine subscription lists, utility company databases and even the "Pizza Hut" database they maintain of deliveries they've made and address changes they've maintained.<br /><br /><blockquote><br /><a href="http://www2.kbm1.com/leadership.aspx?pgID=900&newsID=13&exCompID=153">One of the fallacies surrounding consumer list compilation is that the U. S. Postal Service’s National Change of Address file is the answer to this problem. The fact is, however, that NCOA, while helpful, falls far short of the accuracy that most of us would prefer. An estimated 30 percent of the people who move in the United States never file a change-of-address form with the postal service. And even when they do, it is sometimes weeks or even months before that information is made available to list compilers or the direct marketers who use the lists.<br /><br />Competent list managers have created routines that address this problem. For example, if there is a change of address on a current, reliable source (such as new billing addresses for a charge account or new utility hookups) the new address might be placed in the consumer record. This type of effort can significantly improve address quality on a mailing list – but it cannot ever be perfect.<br /></a></blockquote>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-64985971563987894622007-10-24T16:37:00.000-07:002007-10-24T17:13:56.742-07:00Jlist or Jtable - I need a multi-column displayI'm gradually coming to grips with programming user interfaces in Java. Read a bit on the MVC (Model View Control) concept and while I see its value, it is a bit too steep a gradient at this point. I am starting off getting the basics of the Swing GUI and have been using Jgoodies with the Jigloo Windows builder. Even that is a bit steep as I want to know how to build these from the ground up and using the drag and drop tools resulted in skipping some of the basics that left me hanging, when trying to modify and customize what Jigloo provide.d<br /><br />What has helped learn this the fastest has been to work out some simple application that will be useful and then laying out a UML diagram including Use Case for the requirements, Activity Diagrams and Class Diagrams. A programmer is lost in the woods without these design tools. Then I've taken one element at a time, the JDBC database access, pulling up a list and displaying this, etc.<br /><br />I am up to a point where I need to display a simple list of entries from a database. The list should have 3 columns. I've only been able to get this to work with one column so far. So what I am looking into is whether it would be better to just use the JTable or figure out a "multi-column" JList. <br /><br />Here are some resources to figure this out:<br /><br /><a href="http://www.codeguru.com/java/Swing/JTable/index.shtml">Code Guru</a><br /><a href="http://java.sun.com/j2se/1.3/docs/api/javax/swing/JTable.html">Java Sun</a><br /><a href="http://code.dreamincode.net/snippet396.htm">Dream In Code</a><br /><a href="http://java.sun.com/docs/books/tutorial/uiswing/components/list.html">Jlist Tutorial</a><br /><br />One simple method of doing this would be to select your multi-column data from your data source and return this resultset to a String array.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-20450221218121015692007-10-24T16:34:00.000-07:002007-10-24T16:36:45.615-07:00Refresh a JTable from a JDBC connectionI have a Swing application that uses a JTable and JScrollPane to display data from an Access database via a JDBC connection. <br /><br />Even though I had properly coded the SQL INSERT statement and the data was loading into my database, the JTable was not refreshing with the new record. I tried the .revalidate() and the .repaint() methods to no avail.<br /><br />Finally, after reading Ben Hendry's <a href="http://wbt.sys-con.com/read/36190.htm">Mastering JTable</a> I was able to sort this out.<br /><br />In my JButton ActionListener I added the TableModel.addRow method and inserted the newly inserted records into the JTable as well. Followed by a .revalidate() and the data properly displayed without even a flicker in my application.<br /><br />Moral of the story - always use Model-View-Control (MVC) architecture and separate your view from your data and controls.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-28561153679071142052007-08-04T17:59:00.000-07:002007-08-04T21:27:51.663-07:00Switzerland Language Assignment by Postal Code<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.rollintl.com/roll/swisslang.gif"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px;" src="http://www.rollintl.com/roll/swisslang.gif" border="0" alt="" /></a><br />Map of Switzerland showing language areas.<br /><br />Language assignment by postal code:<br /><table><tbody><tr><th>Postal code</th><th>Area</th><th>Language </th></tr><br /><tr><td>1000 </td><td>Lausanne</td><td>French </td></tr><br /><tr><td>2000</td><td>Neuchatel</td><td>French and German</td></tr><br /><tr><td>3000</td><td>Bern</td><td>French and German</td></tr><br /><tr><td>4000</td><td>Basel</td><td>German</td></tr><br /><tr><td>5000</td><td>Aarau</td><td>German</td></tr><br /><tr><td>6000</td><td>Luzern</td><td>German</td></tr><br /><tr><td>6500..6999</td><td>Ticino</td><td>Italian</td></tr><br /><tr><td>7000</td><td>Chur</td><td>German</td></tr><br /><tr><td>8000</td><td>Zurich</td><td>German</td></tr><br /><tr><td>9000</td><td>St. Gallen</td><td>German</td></tr><br /></tbody></table>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-33583020535257744102007-07-26T20:23:00.000-07:002007-08-04T18:00:38.374-07:00Language Assignment By Postal CodeEvery so often I run across a need to assign languages by postal code. Currently I need to assign languages by the Belgium postal codes. The following table shows the prominent language for each postal code of Belgium:<br /><table><br /></table><table><tbody><tr><th>Capital </th><th>Language</th><th>Postal codes </th></tr><tr><td>Antwerp </td><td>DUTCH</td><td>2000-2999 </td></tr><tr><td>Brussels</td><td>BOTH</td><td>1000-1299 </td></tr><tr><td>Ghent </td><td>DUTCH</td><td>9000-9999 </td></tr><tr><td>Leuven </td><td>DUTCH</td><td>1500-1999, 3000-3499</td></tr><tr><td>Mons </td><td>FRENCH</td><td>6000-6599, 7000-7999</td></tr><tr><td>Liege </td><td>FRENCH</td><td>4000-4999 </td></tr><tr><td>Hasselt </td><td>DUTCH</td><td>3500-3999 </td></tr><tr><td>Arlon </td><td>FRENCH</td><td>6600-6900 </td></tr><tr><td>Namur </td><td>FRENCH</td><td>5000-5999 </td></tr><tr><td>Wavre </td><td>FRENCH</td><td>1300-1499 </td></tr><tr><td>Brugge </td><td>DUTCH</td><td>8000-8999 </td></tr></tbody></table><br /><br />Here is a map showing the language breakdown of Belgium:<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.ned.univie.ac.at/publicaties/taalgeschiedenis/en/belgie.gif"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px;" src="http://www.ned.univie.ac.at/publicaties/taalgeschiedenis/en/belgie.gif" alt="" border="0" /></a><br /><br /><a href="http://mycodeblog.blogspot.com/2007/08/switzerland-language-assignment-by.html">Here is a language assignment by postal code for Switzerland.</a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-71896073759652379332007-07-23T23:30:00.000-07:002007-07-23T23:38:58.764-07:00Salutations Used in Direct MailI am working on a direct mail project that requires personalized letters addressed to all manner of people from around the world - from members of Congress to Doctors, lawyers, members of parliament, etc. and these letters are being translated into multiple languages. I am searching for an already existing table of translated titles of address or salutations. <br /><br />The following pages include fairly complete lists of salutations but I am hunting around for more complete and then translated tables like this. If anyone out there knows of such a table, please let me know.<br /><br /><a href="http://home.kabelfoon.nl/~macdanie/misc/titel-am.htm">Table with Forms of Address</a><br /><a href="http://www.ita.doc.gov/ita_sec/Address%20and%20Salutation.htm">Official Forms of Address</a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-29125195252961323372007-06-17T00:06:00.001-07:002007-06-17T14:46:21.435-07:00Char_Instr - Another Matching AlgorithmI've using Soundex, Double Metaphone, Levenshtein Distance and other string matching algorithms, but somethings it is the simple things that work best.<br /><br />Here is a function I wrote in PL/SQL utilizing the INSTR() function to traverse through one string, checking each character as to whether or not it exists in the another string. <br /><br />This has been useful in checking for duplicates in mailing lists as well as identifying potential duplicates that should be reviewed. The function returns the number of characters from the second string that are the same as the first string.<br /><br />I've found the use of the Soundex to be too loose and the Levenshtein Distance algorithm to be lacking in its handling of transposed characters. Use of this function will give you a count of how many chars are the same regardless of position in the string.<br /><br /><span style="font-size:85%;"><span style="font-family:courier new;"><br />/*==========================================================<br /></span><span style="font-family:courier new;"> Function: char_instr (str1, str2) </span><br /><span style="font-family:courier new;"><br /> Purpose: To check how many characters from one string </span><br /><span style="font-family:courier new;"> exist in another string. The return value is the number </span><br /><span style="font-family:courier new;"> of characters </span><span style="font-family:courier new;">that exist in the in both strings.</span><br /><span style="font-family:courier new;"> ==========================================================*/<br /></span><br /><span style="font-family:courier new;">FUNCTION char_instr</span><br /><span style="font-family:courier new;"> (</span><br /><span style="font-family:courier new;"> str1 IN VARCHAR2,</span><br /><span style="font-family:courier new;"> str2 IN VARCHAR2</span><br /><span style="font-family:courier new;"> )</span><br /><span style="font-family:courier new;">RETURN NUMBER </span><br /><span style="font-family:courier new;">AS</span><br /><span style="font-family:courier new;"> v_exists NUMBER := 0;</span><br /><span style="font-family:courier new;"></span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> v_occurs NUMBER := 0;</span><br /><span style="font-family:courier new;"></span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> v_length NUMBER;</span><br /></span><span style="font-size:85%;"><span style="font-family:courier new;">BEGIN</span><br /></span><span style="font-size:85%;"><span style="font-family:courier new;">/*==========================================================<br /></span></span><span style="font-size:85%;"><span style="font-family:courier new;"> Get the length of the str2 </span><br /></span><span style="font-size:85%;"><span style="font-family:courier new;"> ==========================================================*/<br /></span></span><span style="font-size:85%;"><span style="font-family:courier new;"> v_length := LENGTH(str2);</span><br /></span><span style="font-size:85%;"><span style="font-family:courier new;">/*==========================================================<br /></span></span><span style="font-size:85%;"><span style="font-family:courier new;"> Loop through str2 and check if char exists in str1 </span><br /><span style="font-family:courier new;"> =========================================================*/</span><br /><span style="font-family:courier new;"></span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> IF( v_length > 0 ) THEN </span><br /></span> <span style="font-size:85%;"><span style="font-family:courier new;">FOR x IN 1..v_length LOOP</span><br /><span style="font-family:courier new;"></span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;">v_exists := INSTR(UPPER(str1), SUBSTR(UPPER(str2), x, 1)); </span><br /><span style="font-family:courier new;"></span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;">IF(v_exists>0) THEN</span><br /><span style="font-family:courier new;"></span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;">v_occurs := v_occurs + 1;</span><br /><span style="font-family:courier new;"></span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;">END IF;</span><br /><span style="font-family:courier new;"></span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;">END LOOP;</span><br /><span style="font-family:courier new;"></span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> END IF;</span><br /><span style="font-family:courier new;"></span></span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-size:85%;"><span style="font-family:courier new;"> RETURN v_occurs;</span><br /><span style="font-family:courier new;">END char_instr;</span><br /></span>*Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-16874473911048951542007-06-14T20:53:00.000-07:002007-06-17T14:48:21.128-07:00SQL Cheat SheetI've put together this page to give quick links to all the Oracle SQL tricks that I find myself continuing to search for on the net. This is a quick reference guide and will be expanded regularly.<br /><br />Oracle SQL Cheat Sheet<br /><br /><a href="http://mycodeblog.blogspot.com/2007/01/oracle-sql-script-tutorial.html">SQL Introduction and Definitions</a><br /><br /><a href="http://mycodeblog.blogspot.com/2006/12/oracle-sql-function-instr.html">INSTR()</a><br /><br /><a href="http://mycodeblog.blogspot.com/2006/12/sql-plus-delimited-output-file.html">Create a Delimited Output in SQL Plus</a><br /><br /><a href="http://mycodeblog.blogspot.com/2006/09/rename-column-in-oracle-sql-plsql.html">How to Rename a Column in Oracle SQL</a><br /><br /><a href="http://mycodeblog.blogspot.com/2006/11/how-to-delete-column-from-table-in.html">How to Delete a Column from a Table</a><br /><br /><a href="http://mycodeblog.blogspot.com/2006/10/how-to-use-variables-in-plsql-or.html">Use of Variables in SQL Plus or PL/SQL</a><br /><br /><a href="http://mycodeblog.blogspot.com/2006/10/formatting-query-results.html">Format Query Results to Display Currency</a><br /><br /><a href="http://mycodeblog.blogspot.com/2007/01/oracle-tochar-function.html">Display Seconds Past Midnight</a><br /><br /><a href="http://mycodeblog.blogspot.com/2006/11/how-to-select-top-results-in-group-by.html">Select Only Top Results in a Query</a><br /><br /><a href="http://mycodeblog.blogspot.com/2006/11/oracle-wildcards.html">Use of Wildcards in Oracle SQL</a><br /><br /><a href="http://mycodeblog.blogspot.com/2006/11/nvl-oracle-sql-null-field-handling.html">What is NVL and how does it work?</a><br /><br /><a href="http://mycodeblog.blogspot.com/2007/02/oracle-sql-decode.html">How to Use Decode in Oracle SQL</a><br /><br /><a href="http://mycodeblog.blogspot.com/2007/05/how-to-round-up-in-oracle-sql.html">How to Round Off a Number in Oracle SQL</a><br /><br /><a href="http://mycodeblog.blogspot.com/2007/03/oracle-thin-client-jdbc.html">Debug JDBC Connectivity with Oracle Thin Client</a><br /><br /><a href="http://mycodeblog.blogspot.com/2007/06/charinstr-another-matching-algorithm.html">Oracle String Matching Algorithm - CHAR_INSTR</a><br /><br />If you have any other tips or suggested entries, let me know!Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-67058445878517540192007-06-02T00:56:00.000-07:002007-06-02T01:11:06.411-07:00Nice Bike Tom!Check out these shots of Tom Cruise's new bike. I hear it has a Ducati engine and was custom built for him, sized to fit.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.visordown.com/i/a/830/vyrus_03.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px;" src="http://www.visordown.com/i/a/830/vyrus_03.jpg" alt="" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.product-reviews.net/wp-content/userimages/2007/05/vyrusmotorcycle.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px;" src="http://www.product-reviews.net/wp-content/userimages/2007/05/vyrusmotorcycle.jpg" alt="" border="0" /></a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-46456821365242890352007-05-29T10:04:00.000-07:002007-05-29T11:58:15.274-07:00Standard Mail $.02-$.03 rate reduction proposed by PRCNOTE: THIS IS ONLY PROPOSED AT THIS POINT - NOT YET APPROVED<br /><br />This morning I received the following pleasant news update from the DMA regarding a temporary rate reduction proposed on all Standard USPS mail:<br /><br /><blockquote>The Postal Regulatory Commission May 25 offered interim rate relief for Standard Regular flats and catalog mailers in response to the U.S. Postal Service Governors’ request to reconsider the recommended rates in March.<br /><br />The PRC’s decision grants a temporary rate reduction of 3 cents for all Standard Mail regular flats and 2 cents for Standard Regular nonprofit flats. The temporary transitional rate relief for Standard Regular flats mailers would end Sept. 29. <br /><br /><a href="http://www.dmnews.com/cms/dm-news/direct-mail/41255.html">click to read full story...</a><br /></blockquote><br />They would not require any software change be made but simply a blanket 3 cents per Standard Mail Flat and 2 cents per Non-Profit Standard Mail Flat to be deducted from the overall postage statement. <br /><br />Mailers concerned should contact their USPS postal reps and support this PRC recommendation.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-67045526757751291592007-05-24T10:53:00.000-07:002007-05-24T11:15:25.444-07:00How to Round Up in Oracle SQLRecently I needed to provide a report that had numbers rounded to the nearest thousand. I found the ROUND command but this appeared to be only rounding off decimal points to a specified number of spaces. The syntax for this is:<br /><blockquote>SELECT ROUND(<span style="font-weight:bold;">number</span>, <span style="font-weight:bold;">decimals</span>)<br />FROM table;<br /></blockquote><br />If you use 2 for the <span style="font-weight:bold;">decimals </span>your result would look like this: <br /><blockquote>SELECT ROUND(2.123,2) FROM DUAL;<br />Result: 2.12<br />SELECT ROUND(2.129,2) FROM DUAL;<br />Result: 2.13<br /></blockquote><br />However, I needed something that would round to the nearest thousandth. So I tried a negative number for the <span style="font-weight:bold;">decimals</span> like this and found it did exactly what I wanted:<br /><blockquote>SELECT ROUND(10234,-3) FROM DUAL;<br />Result: 10000<br />SELECT ROUND(10567,-3) FROM DUAL;<br />Result: 11000<br /></blockquote><br />While this is a basic Oracle SQL function, it is not clear that you can do this, hence this post.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-18070037581217693832007-05-17T10:08:00.000-07:002007-05-17T10:54:34.909-07:00USPS Rate Change - What do you think?May 14th, 2006 will go down in history as the most confusing day in mailers history. Unfortunately many people did not install the new presorting software on development machines and get them fully tested before the big date and tried to frantically switch over on May 14th. The tech support team at Firstlogic was overwhelmed with calls - specifically in their Presort support dept. Complaints regarding the post office rejecting their mail, confusing new requirements and general upset due to the increase in postage as a result of the new rate case. Mailers are experiencing anywhere upwards of $.10 per piece increase - the highest increase in standard mail that I can remember.<br /><br />I saw a post on the <a href="http://www.dmnews.com/cms/dm-news/direct-mail/41137.html">DM News website</a> that the USPS claimed the new rate case implementation was going smooth - however it is quite different on the ground in speaking to mailers and software support technicians.<br /><br />Per the below excerpt from DM News page, it looks as though the Postal Regulation Committee is considering reverting the Standard Flat Mail rate change due to the "rate shock" occurring:<br /><br /><blockquote>The Governors of the USPS asked that the rates for this category of mail be reconsidered because the price increases recommended by the PRC may impose an unnecessary degree of “rate shock” on the catalog industry and small businesses particularly. The recommended increase for some catalog mailers is as much as 40 percent, which is more than double what the Postal Service had proposed.</blockquote><br /><br />Here is a poll to find out your opinion of the new rate case. Please vote and let me know your comments on this.<br /><br /><blockquote><br /><div style="text-align: center;"><iframe src="http://polls.blogflux.com/poll.php?poll=11584&width=200&fontsize=11&height=200&amp;fontface=Verdana&padding=10&textcolor=%23000000&bgcolor=%23FFFFFF&doublespace=0&borderwidth=1&linkmap=1&bordercolor=%23cccccc" marginwidth="0" marginheight="0" frameborder="0" height="222" scrolling="no" width="222">&amp;amp;amp;amp;amp;amp;amp;lt;a href="http://polls.blogflux.com/poll-11584.html"&amp;amp;amp;amp;amp;gt;Take the poll&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;br /&amp;amp;amp;amp;gt;&amp;amp;amp;amp;lt;a href="http://polls.blogflux.com/"&amp;amp;amp;amp;amp;gt;Free Poll by Blog Flux&amp;amp;amp;amp;lt;/a&amp;amp;amp;amp;gt;</iframe><br /></div></blockquote>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-48220947044509115542007-04-24T11:56:00.000-07:002007-04-24T14:25:30.487-07:00Is anyone teaching us Morals anymore?<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.twth.org"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 150px;" src="http://www.twth.org/images/psa_page_p17.jpg" border="0" alt="" /></a><br />Back in the day, religion had its place in society of instilling moral values in our youth. With the separation of Church and State and the resulting exclusion of any religious material from the classrooms, a void was unintentionally forged - or should I say a chasm. <br /><br />In the last few years, we've heard more horrific stories of youth violence and their apparent lack of any moral sense. Look at the Columbine shootings or more recently the Virginia Tech rampage. Cho certainly had no sense of morals. Maybe this was the result of the psychiatric - mind-altering drugs he was on. He certainly would have been schooled in the generation where morals were stripped from our classrooms. <br /><br />Who is teaching our children morals these days anyway? <br /><br />There is a organization paving the way towards getting Moral values back into society. <a href="http://www.twth.org/">The Way to Happiness</a> is an organization that promotes "Moral Values for a Modern World. This is a non-religious moral code that anyone can follow. <br /><br />They have recently launched a campaign of Public Service Announcements that promote this moral code in terms anyone can understand. <br /><br />Here is a link to a video where you can watch one of these PSAs promoting one of these precepts, <a href="http://www.twth.org/get-involved/public-service-announcements/view/?id=17">Be Competent</a>.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-5701686810100752312007-04-03T22:27:00.000-07:002007-04-03T22:27:26.948-07:00Why Global Data Integrity is Important<a href="http://www.melissadata.com/enews/articles/0407/1.htm">Why Global Data Integrity is Important</a>Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-35371473497949562192007-03-24T13:37:00.000-07:002007-03-24T13:37:22.377-07:00Various Matching Algorithims<a href="http://www.codeproject.com/string/dmetaphone6.asp?df=100&forumid=16309&exp=0&select=564081">Implement Phonetic ("Sounds-like") Name Searches with Double Metaphone Part VI: Other Methods & Additional Resources - The Code Project - String</a><br /><br />I have only experimented with Levenshtein Distance and Soundex algorithms. This page gives a free download of the Double Metaphone algorithm implementations as well as several other samples that are very useful.Unknownnoreply@blogger.comtag:blogger.com,1999:blog-2471026321807147160.post-24900258250632083522007-03-19T16:41:00.000-07:002007-03-19T21:23:06.711-07:00Oracle Thin Client JDBCI've had problems setting connections to an Oracle DB using the thin client JDBC. This post is to track how this was solved. <br /><br />First you must have the oracle.jar file in your build path. <br /><br />Next I used the following for the actual connection: <br /><blockquote><br /><br />public static Connection getConnection() {<br /><br />Connection con = null; <br />try{<br /> Class.forName("oracle.jdbc.OracleDriver");<br />} catch (Exception e) {<br /> System.out.println("Failed to load driver.");<br /> return con;<br />}<br />try {<br /> con = DriverManger.getConnection(<br /> "jdbc:oracle:thin:username/pw@hostname:port:SID"<br /> );<br />} catch (SQLException ee) {<br /> ee.printStackTrace();<br />}<br />return con;<br />}<br /></blockquote><br /><br />I also had imported java.sql.*;<br /><br />The thing that was causing a problem with this before was that I did not have the host name, port or SID listed out. This was easily located in the tnsnames.ora file in the oracle installation folder.Unknownnoreply@blogger.com