Sunday, February 27, 2011

Create a graphviz dot file from a gedcom 6 xml file.

Create a graphviz dot file from a gedcom 6 xml file.



 
 
 
digraph G {
 label="My Heritage Tree"; 
 bgcolor="white";
 margin="0,0"; /* default margin is 0.5 inches */
 /* splines=false; */
 ranksep="0.15 equally"; /* vertical distance between each generation, default separation between ranks is 0.75 inches */
 node[fontsize=8, fontname="Helvetica", shape=plaintext];
 edge[arrowsize=0.5, color=black, dir=none];  
  
   
    
   
   
    
   
   
    
   
   
}
 

 
 
  
  
   
       
    
     
    
     ->
    
    
    
     
       
    
     
    
    
       
 
    
 
  
  
  [ label=" 
  
   
   
    
   
   
    
     
   
    \n
    *
    
   
   
    \n
    †
    
      
   
    
     
    
    \n
    (∞
    
     
     
      
     
     
      
       
     
      \n
      *
      
     
     
      \n
      †
      
     
     
    )
    
   
  "];
  
  
 

Friday, January 15, 2010

extjs & jquery & Oracle Apex

To get the grid "dynamic" try somthing like (assuming that you use the jQuery adapter) this:

Ext.onReady(function() {
 jQuery("table.standardalternatingrowcolors",this).each(function(){
 var table = this;
 // create the data array
 var myData = new Array();
 jQuery('tr[td]',table).each(function(){
   var tr = new Array();
   jQuery('td', this).each(function(){  
     tr[tr.length] = jQuery(this).html();
   });
   myData[myData.length] = tr;
 });
 // create the metadata array
 var myHeaders = new Array;
 jQuery('tr[th]',table).each(function(){
   jQuery('th', this).each(function(){  
     var header = {};
     header["name"] = jQuery(this).attr('id');
     header["dataIndex"] = jQuery(this).attr('id');
     header["header"] = jQuery(this).html();
     header["sortable"] = true;
     header["width"] = 90;
     myHeaders[myHeaders.length] = header;
   });
 });
 
  var ds = new Ext.data.Store({
   proxy: new Ext.data.MemoryProxy(myData),
   reader: new Ext.data.ArrayReader({id: 0}, myHeaders)
  });
  ds.load();
 
  var colModel = new Ext.grid.ColumnModel(myHeaders);
  jQuery(table).attr(id,'x');
  var grid = new Ext.grid.GridPanel({el: 'grid-example', ds: ds, cm: colModel});
  grid.render();
  grid.getSelectionModel().selectFirstRow();
  jQuery(table).show();
 
 }); // replace each table on the page
 
});

FOP & JBoss & Oracle Apex

Add the missing Oracle XML Parser v2 (you may find them e.g. in JDeveloper/lib) libraries (lib/xmlparserv2.jar, lib/xml.jar) by opening the fop.war with your favorite zip program (e.g. rename fop.war to fop.zip) and saving the libraries WEB-INF/lib. Then copy the fop.war to the e.g. jboss\server\default\deploy directory. Maybe you have to restart your application server (dependent on your settings). Then try http://your-hostname:your-port/fop/apex_fop.jsp (e.g. http://127.0.0.1:8080/fop/apex_fop.jsp) to see if your work was successful.

Manage Service / Instance Settings / Report Printing
Print Server: Standard Support
Print Server Host Address: 127.0.0.1
Print Server Port:8080
Print Server Script: /fop/apex_fop.jsp

<%@ page import='java.io.*'%>
<%@ page import='org.xml.sax.InputSource'%>
<%@ page import='org.apache.fop.apps.Driver'%>
<%@ page import='org.apache.fop.apps.Options'%>
<%@ page import='oracle.xml.parser.v2.XMLDocument'%>
<%@ page import='oracle.xml.parser.v2.XSLProcessor'%>
<%@ page import='oracle.xml.parser.v2.XSLStylesheet'%>
<%@ page import='oracle.xml.parser.v2.DOMParser'%>
<%
// see http://xml.apache.org/fop/output.html for all output types
XMLDocument   v_doc;
XSLStylesheet v_xsl = null;
String        v_fop;
DOMParser     parser = new DOMParser();
XSLProcessor processor = new XSLProcessor();
String        v_encode = "UTF-8";
 
String p_xsl = request.getParameter("template");
String p_xml = request.getParameter("xml");
 
/* transform an XML source to XSLFO using an XSL transformation */
v_xsl = new XSLStylesheet(new java.io.StringReader(p_xsl),null);
parser.parse(new java.io.StringReader(p_xml));
v_doc = parser.getDocument();
ByteArrayOutputStream v_out = new ByteArrayOutputStream();
processor.processXSL(v_xsl, v_doc, v_out);
v_fop = new String(v_out.toByteArray(),v_encode);
 
/* The FOP process */
Driver driver = new Driver();
driver.setRenderer(Driver.RENDER_PDF);
 
driver.setInputSource(new InputSource(new StringReader(v_fop)));
 
ByteArrayOutputStream outBuffer = new ByteArrayOutputStream();
driver.setOutputStream(outBuffer);
 
driver.run();
 
OutputStream outStream = response.getOutputStream();
response.setContentType("application/pdf");
response.setContentLength(outBuffer.size());
outStream.write(outBuffer.toByteArray());
outStream.flush();
%>

jQuery autocomplete and Oracle Apex

Here you can find some code if you want to use the jquery.autocomplete.js without modification.
Download the autocomplete jQuery plugin and upload then to your "Shared Components"/"Cascading Style Sheets".
Also upload the basic jquery library there.

Download Links:
http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
http://jquery.com/

Add the following to your Page HTML Header where you want to use the autocomplete list:







This looks complex, but the only thing your have to change is to change the name of the item where you want to have a autocomplete list

Tuesday, January 12, 2010

Paging with SQL mysql: startrow and maxrows
SELECT * FROM person ORDER BY LAST_NAME DESC LIMIT 11, 10
oracle: startrow and endrow
SELECT s.*
FROM (
 SELECT ROWNUM as COUNTER, x.*
 FROM (
  SELECT p.NAME, p.FIRST_NAME, p.LAST_NAME
  FROM person p
  ORDER BY p.LAST_NAME DESC
 ) x
) s
WHERE s.COUNTER BETWEEN 5 AND 8;

Sunday, December 13, 2009

Users created per day in drupal

SELECT 
DATE(FROM_UNIXTIME(created)) INTER, 
count(*) USERS
FROM users 
GROUP BY DATE(FROM_UNIXTIME(created))
ORDER BY DATE(FROM_UNIXTIME(created)) DESC

Saturday, October 24, 2009

Information Management beyond Business and Analysts

Informationsverarbeitung abseits der Trampelpfade.
Die Funktionen, die nur Programmiereren zur Verfügung sethen den erweiterten Endbenutzern zur Verfügung stellen. Ohne dabei jedoch eine Programmierstprache mit der verwendeten Programmiersprache zu entwickeln. Keine neues Metamodell im Metamodell.
Die Erweiterbarkeit der Lösung muss der Lösung immanent sein.
z.B. Ist JSF (Java Server Faces) eine nette Art Web-Formulare zu entwickeln. Einmal entwickelt wird jedesmal ein Programmierer benötigt um ein Feld im Formular zu ergänzen. Solche Werkzeuge gehen von der Metapher der Bau-Architektur aus. Dabei wird die Domäne Information in ein Korsett gezwängt das Ihrer nicht gebührt. Informationen sind Informationen und keine Materie. Es ist eine adequate Umgebung notwendig um die Information als solche zu behandeln. Flexibilität und nicht Starrheit ist gefragt.
Unter dem Schlagwort "Business Intelligence" wurde in den leztten Jahren ein Weg beschritten der Endbenutzern mehr Freiheitsgrade einräumt.
Mit OLAP (Online Analytical Processing) wurde neue Konzepte eröffnet und der Bereich der Wissensrepräsentation um zwei wichtige Bereiche erweitert – Domänen und Hierarchien. Mit den Bestrebungen ROLAP wurden diese neuen Erkenntnisse versucht in die relationale Welt zu integrieren.
Das relationale Modell ist der heutige de-fakto Standard für Wissensrepräsentation. Sind jedoch die heutigen Umsetzungen des relationalen Paradigmas zeitgemäß oder durch den "Markt" geprägt.
Feierte die "objektorientierung" in den letzten Jahren mit Java und C# ihren Siegeszug in der Entwicklung, so ist aktuell der Trend zu Flexibilität innerhalb dieser Domäne zu beobachten. Objektorientierung ist sehr effizient wenn es sich um die Umsetzung von paradigmatisierten Wissen handelt. Objekte haben Attribute und Methoden. Solange diese im Umfeld von Bau-Architktur (Software-Architektur) Verwendung finden sind diese auch entsprechend effizient. Objekttypen (Klassen – siehe Sokrates) sind Vorlagen zur industriellen Fertigung von Bauelementen. Damit erhält die Industrialisierung in der Software-Entwicklung die notwendige Innovation. Für Wissenrepräsentation sind diese Modelle jedoch zu unflexibel. Wer legt fest wie die Klasse zur Beschreibung eines Ziegels aussieht? Welche Attribute hat die Klasse Ziegel zu haben? Ist die Farbe für den späteren Bewohner des Baus wichtig, so ist der Dämmwert für den Förderungsantragsteller ein weseltliches Beschreibungskriterium. Jedoch ist für den Architekten die Dimension des Bauelements vorrangig.
Die Welt der objektorientierten Sichtweise serialisiert bzw. persistiert die Informationen des Objekts.
Durch Serialisierung können Objekte sterben und wieder zum Leben erweckt werden. Persistierung ist die Umschreibung das Wissen eines Objekts abzulegen.
Dies erlaubt weder Dekduktion noch Induktion. Aus dem Standpunkt der Wissenrepräsentation ist Objektorientierung die Haftanstallt der Information.
Das relationale Modell per se erlaubt eine deduktive Informationsgewinnung. Durch Einführung des Entity-Relationship Modells wurde die Univeralität des relationalen Modells auf seine Rolle als Persistenz-Topf vorbereitet. BI (Business Intelligence) hat sie aus dieser Rolle zum Teil wieder befreit.
Wie können "UPDATE" und "CREATE", "ALTER" Statements dem Benutzer präsentiert werden.
Informationssysteme sollten nicht nach Function Points bemessen werden, sonder nach "Information Points".
Wie rasch kann eine Änderung bzw. Erweiterung durch den Endbenuzer herbeigeführt werden?
Drupal gilt zwar als CMS (Content Management System), ist im Konzept jedoch viel mehr als das. Unter Verwendung des Moduls CCK (Content Construction Kit) verbirgt sich eine Oberfläche mit der dem erweiterten Endbenutzer die Möglichkeit eingerämt wird die Datenstruktur zu ändern. Mittels CCK werden an die relationale Datenbank "ALTER" und sogar "CREATE" Anweisungen gegeben. Eine semantische Zwischenschicht übernimmt die Aufbereitung für die weitere Informationsbearbeitung.
Ähnlich dem "Naked Objects" Ansatz werden "graphische" Benutzerschnittstellen zur Laufzeit erstellt und fordern den Benutzer auf seine Informationen in strukturierter Form bekanntzugeben.
Mit welchen Aufwand können flexible Ansätze mit vertretbarem Aufwand in kommerziellen Projekten umgesetzt werden?
Und wie kombiniert sich das alles mit heutigen defacto Standards wie XML und Service Orientierter Architektur? Schnittstellen sind definiert und ermöglichen Verbindungen. Verbindungen ermöglichen Bauwerke. Gewölbe sind stabil. Setzen wir Schlusssteine oder suchen wir nach Erkenntnisfortschitt?
Warum dann nicht einfach "Wiki". Etwas verstehen bedeutet etwas zu strukturieren. Strukturieren bedeutet Relationen aufzubauen. Beziehungen setzten Schnittstellen. Durch schneiden entsteht Redundanz.

Sunday, November 11, 2007

Contrast

It's the contrast. It's the contrast that makes photos interesting. It's the contrast that give us a feeling of time. It's the contrast that makes us live.

Monday, July 30, 2007

jQuery colspan and rowspan table using cell break

xxxhx1hx1hx1
xxxhxx1hxx2hxx3
hy1hyy1hy1a123
hy1hyy2hy11.12.13.1
hy1hyy3hy1456
hy2hyy3hy1789
hy2hyy3hy1101112
hy2hyy3hy1131415
hy3hyy3hy2123
hy3hyy3hy2123
hy2hyy3hy1123
hy2hyy3hy1123
hy3hyy3hy2123
hy3hyy3hy2123
Example:
 $("#table").rowspan(0);
 $("#table").rowspan(1);
 $("#table").rowspan(2);
 $('table tbody tr:visible').each(function(row) {
   $('#table1').colspan(row);
 })
jQuery.fn.rowspan = function(colIdx) {
 return this.each(function(){

  var that;
  $('tr', this).each(function(row) {
  $('th:eq('+colIdx+')', this).filter(':visible').each(function(col) {
      if ($(this).html() == $(that).html()) {
        rowspan = $(that).attr("rowSpan");
        if (rowspan == undefined) {
  
          $(that).attr("rowSpan",1);
          rowspan = $(that).attr("rowSpan");
        }
        rowspan = Number(rowspan)+1;
        $(that).attr("rowSpan",rowspan); // do your action for the colspan cell here
        $(this).hide(); // .remove(); // do your action for the old cell here
      } else {
        that = this;
      }
      that = (that == null) ? this : that; // set the that if not already set
  });
 });

 });
}
jQuery.fn.colspan = function(rowIdx) {
 return this.each(function(){

  var that;
  $('tr', this).filter(":eq("+rowIdx+")").each(function(row) {
  $(this).find('th').filter(':visible').each(function(col) {
      if ($(this).html() == $(that).html()) {
        colspan = $(that).attr("colSpan");
        if (colspan == undefined) {
          $(that).attr("colSpan",1);
          colspan = $(that).attr("colSpan");
        }
        colspan = Number(colspan)+1;
        $(that).attr("colSpan",colspan);
        $(this).hide(); // .remove();
      } else {
        that = this;
      }
      that = (that == null) ? this : that; // set the that if not already set
  });
 });

 });
}

Wednesday, August 09, 2006

EL Expression / Scriptlet "switching"

<% pageContext.setAttribute("x", "33"); %> x'= x''= <%= pageContext.getAttribute("x") %>

Thursday, July 27, 2006

Fractal Recursion

... may this be a recursion following fractal rules? "... fractal ... denotes a shape that is recursively constructed or self similar ..." "... fractal ... a shape that appears similar at all scales of magnification ..." [Wikipedia, the free encyclopedia] " ... recursion specifies ... and then defining rules to break down complex cases into simpler cases ... " [Wikipedia, the free encyclopedia] "For example, the following is a recursive definition of person's ancestors:
  • One's parents are one's ancestors (base case);
  • The parents of any ancestor are also ancestors of the person under consideration (recursion step)."
[Wikipedia, the free encyclopedia, http://en.wikipedia.org/wiki/Recursion] If the breakdown rules follows the laws of fractal shapes you will come up to a second level recursion or a fractal recursion. "... It’s an infinite spiraling curvature of double helix around their coherent line of symmetry in its center (gravity of space/time), which is in its turn coiled in its own frame of reference; hence one of two equal and opposite spirals of double/helix within/without a double helix. It has no beginning and end, because the only beginning and end of all its fractal recursions is right here and now. All infinity of exponentially larger and smaller curvatures (light speed difference) begins and ends here and now. ..." [http://www.prophetsmanual.com/content/index.cfm?navID=20&itemID=20] "A Fractal Theory of the Origin and Meaning of the Universe ... The fractal recursion ... is obvious. " [http://www.schoolofwisdom.com/cosmo.html] I listed here some statements on different kinds of the phenomena of fractal recursion. None of this are my personal opinions on this topic. The interesing is that in some views recursion and fractal laws seem to have an evident influence or are influenced to see the world.

Wednesday, June 22, 2005

Willi’s “TWiki” Style

Willi’s “TWiki” style When analyzing character text (e.g. readme.txt, license.txt, register.txt) this will guide you to the following “TWiki” style for writing structured text that is readable as text and as transformed XHTML page. *** Header <h1>Header</h1> valid only if at the beginning of a line ** Header <h2>Header</h2> valid only if at the beginning of a line * Header <h3>Header</h3> valid only if at the beginning of a line Header: <h4>Header</h4> Valid only if the ‘:’ is the last character in this line and the Text starts at the beginning of the line. *** Header: alternative representation of an Header 1 ** Header: alternative representation of an Header 2 * Header: alternative representation of an Header 3
Header
******
alternative representation of an Header 1 Valid, only if the line follows directly at the beginning of the next line
Header
======
alternative representation of an Header 2 Valid, only if the line follows directly at the beginning of the next line
Header
------
alternative representation of an Header 3 Valid, only if the line follows directly at the beginning of the next line - a - b - c <ul> <li>a</li> <li>b</li> <li>c</li> </ul> bullet item + a + b + c <ol> <li>a</li> <li>b</li> <li>c</li> </ol> list items summing up 1) a 2) b 3) c Alternative representation of an ordered list Only valid if the line starts with the ‘1)’ signiture 1. a 2. b 3. c Alternative representation of an ordered list Only valid if the line starts with the ‘1.’ Signiture. Also possible ‘1.1.2’, etc. A. a B. b C. c Alternative representation of an ordered list Only valid if the line starts with the ‘A.’ signiture chr(10), chr(13) <br/> * * * <hr/> Only valid if it starts at the beginning of the line. Use three or more lines ***** Alternative representation of a horizontal line = = = <hr/> Only valid if it starts at the beginning of the line. Use three or more lines ===== Alternative representation of a horizontal line - - - <hr/> Only valid if it starts at the beginning of the line. Use three or more lines ----- Alternative representation of a horizontal line
 *L*  *C*    *R* 
  A2   2      2  
<table> <tr><td>L</td><td>C</td><td>R</td></tr> <tr><td>A2</td><td>2</td><td>2</td></tr> </table>
---------------------
 *L*  *C*    *R* 
---------------------
  A2   2      2  
---------------------
alternative representation of a table
---------------------
| *L* | *C*  |  *R* |
---------------------
|  A2 |  2   |   2  |
---------------------
alternative representation of a table

Monday, May 23, 2005

Our virtual world is flexible

People who have to deal with numbers like to use E*cel. People who have to deal with lists like MS-Execl and people who have to deal with tables like E*cel. They can start with one cell entering their data. When the need more information they can enter more information around the first entered data. They can enter data to the right and below. For those who are more skilled they can also enter data above and to the left (i.e. inserting new column and rows or moving the data they have entered to a different area). They do not need some developer to create a table and enter or import/copy their data to play around with it.

Startup

Willi is up with his blog.