Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
terrancesnyder / oracle_jp_date.sql
Created August 20, 2011 16:40
Oracle SQL Get Date in Japanese
SELECT TO_CHAR(to_date('28-06-2011', 'DD-MM-YYYY'), 'Month', 'nls_date_language=japanese') AS b FROM dual;
-- 6月
@terrancesnyder
terrancesnyder / print.java
Created September 14, 2011 19:23
Print JPEG Java
package com.halo.struts.action;
import java.io.FileInputStream;
import java.io.IOException;
import javax.print.Doc;
import javax.print.DocFlavor;
import javax.print.DocPrintJob;
import javax.print.PrintException;
import javax.print.PrintService;
@terrancesnyder
terrancesnyder / java_servlet_images.java
Created September 14, 2011 19:50
Java Image Servlet with Quality Filters
/*
jTicketing is a management tool for online ticketing and box office, which provides a highly configurable enterprise class solution.
Copyright (C) 2010-2011 OpenPRJ srl
All rights reserved
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
@terrancesnyder
terrancesnyder / mule-simple-soap-to-http-wrapper.xml
Created October 14, 2011 18:39
Mule Simple Passthrough to REST Service while exposed as WSDL
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
xmlns:mule-xml="http://www.mulesoft.org/schema/mule/xml"
xsi:schemaLocation="
@terrancesnyder
terrancesnyder / start.bat
Created October 15, 2011 21:00
mongodb startup windows
mongod --jsonp --port 8600 --directoryperdb --rest --dbpath C:/opt/mongodb/data
@terrancesnyder
terrancesnyder / mule-email.xml
Created October 16, 2011 00:47
Mule Email Listener
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:pop3s="http://www.mulesoft.org/schema/mule/pop3s"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/pop3s http://www.mulesoft.org/schema/mule/pop3s/3.1/mule-pop3s.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd ">
@terrancesnyder
terrancesnyder / oracle-fk-research.sql
Created October 17, 2011 14:01
oracle get all FK and their tables
SELECT uc.constraint_name||CHR(10)
|| '('||ucc1.TABLE_NAME||'.'||ucc1.column_name||')' constraint_source
, 'REFERENCES'||CHR(10)
|| '('||ucc2.TABLE_NAME||'.'||ucc2.column_name||')' references_column
FROM user_constraints uc
, user_cons_columns ucc1
, user_cons_columns ucc2
WHERE uc.constraint_name = ucc1.constraint_name
AND uc.r_constraint_name = ucc2.constraint_name
AND ucc1.POSITION = ucc2.POSITION -- Correction for multiple column primary keys.
@terrancesnyder
terrancesnyder / ActiveDirectoryBrowser.java
Created October 17, 2011 18:27
Java Active Directory Browser
package org.mule.example.echo;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
@terrancesnyder
terrancesnyder / xforms-examples.xml
Created October 19, 2011 16:56
XForms Validation / Binding Snippets
<!--
The constraint Property:
When evaluating to XPath false, the associated model item is not valid;
the converse is not necessarily true. This model item property does not prevent
form controls and XForms actions from setting invalid values into data nodes.
Example:
Here, a constraint property associated with element my:to indicates
that its value must be greater than that of element my:from.
-->
@terrancesnyder
terrancesnyder / delete.bat
Created November 2, 2011 16:33
Windows Delete Folders Recursively (SVN)
for /d /r . %d in (.svn) do @if exist "%d" rd /s/q "%d"