Skip to content

Instantly share code, notes, and snippets.

View dmccreary's full-sized avatar

Dan McCreary dmccreary

View GitHub Profile
@dmccreary
dmccreary / xforms-css-display-borders.xml
Created February 11, 2014 03:09
XForms CSS example of turning on element borders to see box model for each page region.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xxf="http://orbeon.org/oxf/xml/xforms">
<head>
<title>XForms CSS Wireframe with Visible Borders</title>
<xf:model>
<xf:instance xmlns="">
<data>
<myNumber1></myNumber1>
<myNumber2>abc</myNumber2>
<myNumber3>-1</myNumber3>
<myNumber4>101</myNumber4>
@dmccreary
dmccreary / xforms-accesskey-example.xml
Created February 11, 2014 04:36
Example of using the accesskey attribute within an XForms application. This allows user to use the "Alt" key to navigate directly to fields in form. Not all browsers support these features.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xxf="http://orbeon.org/oxf/xml/xforms">
<head>
<title>XForms Access Key Demonstration</title>
<xf:model>
<xf:instance xmlns="">
<data>
<first-name></first-name>
@dmccreary
dmccreary / xforms-css-required-fields.xml
Created February 11, 2014 05:23
XForms CSS for styling required fields using three types of label layout styles: top, left and right.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xxf="http://orbeon.org/oxf/xml/xforms">
<head>
<title>XForms Minimal Template</title>
<xf:model>
<xf:instance xmlns="">
<data>
<first-name>Sue</first-name>
<middle-name></middle-name>
<last-name>Johnson</last-name>
<phone></phone>
@dmccreary
dmccreary / xforms-css-decimal-right-aligned.xml
Created February 12, 2014 22:28
XForms CSS for right alignment of decimal values
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xxf="http://orbeon.org/oxf/xml/xforms">
<head>
<title>XForms Label Layout Styles</title>
<xf:model>
<xf:instance xmlns="">
<data>
<inputs>
<amount1>123</amount1>
<amount2>456</amount2>
<amount3>789</amount3>
@dmccreary
dmccreary / arduino-draw-8x8-led.cpp
Last active April 18, 2025 16:04
Arduino program to draw pixels in an 8x8 LED matrix using multiplexing. This example draws "I", "Heart", "U".
/*
Display "I", "Heart", "U" on a 8 by 8 LED matrix
Dan McCreary, Feb. 14th, 2014
*/
// You can get an red LED matrix for under $5
// Here is a sample: http://www.amazon.com/Common-Anode-Diameter-Display-Matrix/dp/B00EZBZF5K/ref=pd_sim_sbs_e_1
// we are not using pins 0 and 1 and 13
// Connect pins 1-8 (bottom edge) and pins 9-16 (top edge) on the LED matrix
// to the Arduino digital outputpins 2-12 and Analog pins A0 to A3 as outputs
@dmccreary
dmccreary / ws2812b-driver.
Created April 24, 2014 12:29
Sample code for using a breadboard Arduino to drive WS2812B LED strip with Adafruit NeoPixel library
#include <Adafruit_NeoPixel.h>
// Sample code for using a breadboard Arduino to drive WS2812B LED strip with Adafruit NeoPixel library
// I got mine on e-bay:
// http://www.ebay.com/itm/181268207260?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649
// Note - colors for data and ground vary
// I used a 16MHZ Crystal Oscilator
#define PIN 8 // connect the Data In pin
// Parameter 1 = number of pixels in strip - I used 12
@dmccreary
dmccreary / table-pagination.xml
Last active January 29, 2020 14:55
XForms table pagination with Orbeon. In this example the Prev and Next buttons are disable by binding rules.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<head>
<title>XForms 2 Row Repeat Test Using nodeset and id for Repeat</title>
<xf:model>
<xf:instance xmlns="" id="save-data">
<data>
<row>
<first-name>Dan</first-name>
<last-name>McCreary</last-name>
<phone-ext>111</phone-ext>
@dmccreary
dmccreary / column-label-hidden-in-control.xml
Created May 6, 2014 20:02
Orbeon column label hidden within control working with multiple alerts and error summay
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:xf="http://www.w3.org/2002/xforms">
<head>
<title>XForms demo of label within table headers</title>
<xf:model>
<xf:instance xmlns="" id="save-data">
<data>
<row>
<integer1>1</integer1>
<integer2>2</integer2>
<integer3>3</integer3>
@dmccreary
dmccreary / disable-save-when-not-dirty-or-invalid.xml
Last active August 29, 2015 14:01
Example Orbeon form for disable Save when not dirty or invalid. Depends on the Orbeon error-summary control.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://orbeon.org/oxf/xml/formatting"
xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:widget="http://orbeon.org/oxf/xml/widget">
<head>
<!-- fr:error-summary has errors-count-ref which can store number of errors to data. You can use that data to enable button. -->
<title>Example of Visit All Failing</title>
<style type="text/css">
.orbeon .xforms-control {display:block; padding:5px;}
/* not needed in a table display:inline-block; width:10ex; text-align:right; */
.orbeon .xforms-label {font-weight:bold!important; display:inline-block; margin-right: 1ex;}
// --------------------------------------------------------------------------- Motors
// These are the pins to the the motor drive chip for the left wheel
int motor_left[] = {12, 13};
// These are the pins to the the motor drive chip for the right wheel
int motor_right[] = {6, 7};
// --------------------------------------------------------------------------- Setup
void setup() {
Serial.begin(9600);