Skip to content

Instantly share code, notes, and snippets.

View fieldju's full-sized avatar

Justin Field fieldju

View GitHub Profile
;
; test script for programming assignment 1
; spring term, 2011
"Test Script"
"Values should be repeated, first your result, then correct result"
(map (lambda (x) (begin (display x) (newline)))
(list
(plusOne 42)
43
#include <stdio.h>
#include "bst.h"
#include "assert.h"
#include "structs.h"
#include "type.h"
/*----------------------------------------------------------------------------
very similar to the compareTo method in java or the strcmp function in c. it
returns an integer to tell you if the left value is greater then, less then, or
equal to the right value. you are comparing the number variable, letter is not
@fieldju
fieldju / controller.php
Created May 11, 2012 23:46
multiple datagrids with grocery CRUD using IFRAMES
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Controller extends Application{
private static $data = array();
public function __construct(){
parent::__construct();
@fieldju
fieldju / Student.php
Created June 4, 2012 08:08
model for student
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Student extends ActiveRecord\Model
{
# explicit table name
static $table_name = 'Student';
# explicit pk since our pk is not "id"
//static $primary_key = 'StudentID';
@fieldju
fieldju / admin.php
Created June 5, 2012 03:01
admin controller
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Admin extends Application{
private static $data = array();
public function __construct(){
parent::__construct();
create table RebuilderProcess (
id integer not null auto_increment,
finsihDTTM datetime,
hql varchar(255),
lastCompleted integer,
lastUpdatedDTTM datetime,
log TEXT,
numberCompleted integer,
startDTTM datetime not null,
status varchar(255),
@fieldju
fieldju / craftbukkit.sh
Created September 4, 2012 05:34
script to start craftbukkit / minecraft server
#!
screen -d -m -S minecraft java -Xms1024 -Xms1024 -jar craftbukkit.jar
@fieldju
fieldju / ActiveMQBrokerMonitorThread.java
Created November 8, 2012 17:41
ActiveMQBrokerMonitorThread
package cnwk.foreman.ingestion;
import cnwk.foreman.util.LangUtils;
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.util.ServiceStopper;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import java.net.InetAddress;
import java.util.concurrent.atomic.AtomicBoolean;
@fieldju
fieldju / activemq.xml
Created November 8, 2012 18:36
activemq bean definitions / configuration
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<bean id="broker" class="org.apache.activemq.broker.BrokerService" scope="prototype">
<property name="persistent" value="true"/>
<property name="useLocalHostBrokerName" value="true"/>
@fieldju
fieldju / method.java
Created November 13, 2012 06:51
method
@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
public void getBTOConvertAndSaveToForeman(final Integer itemVersionId) {
ItemVersion itemVersion = null;
String sql = "" +
"SELECT " +
"c.createStaffName, " + //1
"p.hed, " + //2
"p.body, " + //3
"c.createDate, " + //4