Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
terrancesnyder / install_selenium_rc.reg
Created June 21, 2011 14:41
install_selenium_rc.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SeleniumRC1\Parameters]
"Application"="C:\\windows\\system32\\cmd.exe"
"AppDirectory"="C:\\opt\\selenium-grid-1.0.8"
"AppParameters"="/c \"C:\\opt\\selenium-grid-1.0.8\\rc.bat\""
@terrancesnyder
terrancesnyder / force_index_example.sql
Created June 24, 2011 13:23
oracle force index scan
SELECT /*+ INDEX(patients sex_index) use sex_index because there are few male patients */ name, height, weight
FROM patients
WHERE sex = 'm';
@terrancesnyder
terrancesnyder / gist:1044831
Created June 24, 2011 14:05
XML xpath to ignore namespaces
//*[name()='HelloWorld']
#!/bin/bash
logo() {
echo " ______ __ __ _ "
echo " /_ __/_ ___________ / /_____ __ __ / / (_)___ __ ___ __"
echo " / / / / / / ___/ __ \/ //_/ _ \/ / / / / / / / __ \/ / / / |/_/"
echo " / / / /_/ / / / / / / ,< / __/ /_/ / / /___/ / / / / /_/ /> < "
echo "/_/ \__,_/_/ /_/ /_/_/|_|\___/\__, / /_____/_/_/ /_/\__,_/_/|_| "
echo " /____/ "
echo ""
@terrancesnyder
terrancesnyder / gist:1062758
Created July 4, 2011 00:33
Ubuntu Tomcat Native Library
# grab tc native library
sudo apt-get install libtcnative-1
# append below to setenv.sh
export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
@terrancesnyder
terrancesnyder / tree.xhtml
Created July 4, 2011 16:40
Example of a static loaded tree view control.
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:exforms="http://www.exforms.org/exf/1-0"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
@terrancesnyder
terrancesnyder / load-data.xhtml
Created July 5, 2011 01:47
Load initial form data
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
xmlns:exforms="http://www.exforms.org/exf/1-0"
xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
SELECT extractvalue(column_value, '.') as record_id
FROM TABLE(XMLSequence(XMLTYPE(
'<list>
<id>34123121234</id>
<id>12312221233</id>
</list>').extract('//id'))) t
@terrancesnyder
terrancesnyder / pentaho-jndi-setup.txt
Created July 6, 2011 16:07
Pentaho with JNDI connections
I know how to run the transformations or jobs based JNDI for Pan or Kitchen. You should set some properties in order that Pan or Kitchen can know the informations of the JNDI. They are as follows,
1.java.naming.factory.initial. For example, "org.osjava.sj.SimpleContextFactory".
2.org.osjava.sj.root. For example, "D:/pentaho/pentaho1.53/kettle250/simple-jndi".
3.org.osjava.sj.delimiter. For example, "/".
Therefore, I change some codes in the Pan.bat or Kitchen.bat.
set OPT=-Xmx512M -cp %CLASSPATH% -Djava.library.path=libswt\win32\ -DKETTLE_HOME="%
@terrancesnyder
terrancesnyder / repeater-simple.xhtml
Created July 6, 2011 19:36
Simple repeater for XHTML forms.
<!-- datasource -->
<xforms:instance id="fruits">
<fruits>
<fruit>Apple</fruit>
<fruit>Orange</fruit>
<fruit>Pear</fruit>
</fruits>
</xforms:instance>