Skip to content

Instantly share code, notes, and snippets.

View greghelton's full-sized avatar

Greg Helton greghelton

View GitHub Profile
set CP=C:\Users\gah285\.m2\repository\commons-codec\commons-codec\1.3\commons-codec-1.3.jar
set CP=%CP%;C:\Users\gah285\.m2\repository\org\mortbay\jetty\servlet-api\2.5-20081211\servlet-api-2.5-20081211.jar
set CP=%CP%;C:\Users\gah285\.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar
set CP=%CP%;C:\Users\gah285\.m2\repository\com\google\api-client\google-api-client\1.20.0\google-api-client-1.20.0.jar
set CP=%CP%;C:\Users\gah285\.m2\repository\com\google\apis\google-api-services-drive\v2-rev204-1.21.0\google-api-services-drive-v2-rev204-1.21.0.jar
set CP=%CP%;C:\Users\gah285\.m2\repository\com\google\apis\google-api-services-oauth2\v1-rev108-1.21.0\google-api-services-oauth2-v1-rev108-1.21.0.jar
set CP=%CP%;C:\Users\gah285\.m2\repository\com\google\http-client\google-http-client\1.20.0\google-http-client-1.20.0.jar
set CP=%CP%;C:\Users\gah285\.m2\repository\com\google\http-client\google-http-client-jackson2\1.20.0\google-http-client-jackson2-1.20.0.jar
set CP=%CP%;C:\Users\gah285\
import com.ibm.as400.access.*;
public class CallSrvPgm {
String firstName;
String lastName;
int ssn;
void getNextBySocialSecurityNumber(int ssn) throws Exception {
AS400 as400 = new AS400("machine", "userid", "password");
ServiceProgramCall pgm = new ServiceProgramCall(as400);
ProgramParameter[] parameters = new ProgramParameter[3];
var expect = require('chai').expect;
var isPalindrome = require('../src/ispalindrome');
describe('palindrome-test', function() {
it('should pass this canary test', function() {
expect(true).to.be.true;
});
it('should return true for argument mom', function() {
expect(isPalindrome('mom')).to.be.true;
@greghelton
greghelton / GetLatLngSrvPgmCall.java
Last active January 19, 2017 04:03
unit test RPG SRVPGM with JUnit
package com.frontier.dpiplant.geo;
import com.ibm.as400.access.*;
import static org.junit.Assert.*;
import java.util.Date;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Test;
public class GetLatLngSrvPgmCall {
static final Logger LOGGER = LogManager.getLogger(GetLatLngSrvPgmCall.class.getName());
@greghelton
greghelton / BL0100M01
Last active July 27, 2016 11:39
Using JUnit to test RPG
ctl-opt Option(*Srcstmt:*Nodebugio:*NoUnRef)
NoMain Debug(*YES);
/copy BL0100M01C
dcl-s uuidKey_t CHAR(16) TEMPLATE;
dcl-s maxResponseData_t CHAR(39) TEMPLATE;
dcl-ds uuidDS_t Template;
dcl-subf bytes_provided INT(10);
dcl-subf bytes_available INT(10);
dcl-subf reserved CHAR(8);
@greghelton
greghelton / PubSubApp.java
Last active April 28, 2016 18:12
The beta version of reactive programming is the traditional pub/sub app. It seems plausible that two instances of the same class may want to be in a pub/sub relationship so I wanted to code a class that would provide that.
package com.frisco.pubsub;
import java.util.Observable;
import java.util.Observer;
public class PubSubApp extends Observable implements Observer {
String name;
PubSubApp(String name) {
this.name = name;
this.setChanged();
}
@greghelton
greghelton / git commands
Last active April 25, 2016 19:13
The git CLI (command line interface) brings both git and linux commands to your Windows command terminal.
Start in Windows:
cd \users\username\dev\src\java\project\
C:\> set PATH=%PATH%;c:\progra~1\git\bin
C:\> bash
$ cd /c/users/gah285/dev/src/java/project
package com.reactive.chapter3;
import rx.Observable;
public class SimpleObservable {
public SimpleObservable go() {
Observable<Integer> arrayObservable = Observable.from(new Integer[] {3, 5, 8});
arrayObservable.subscribe(System.out::println);
return this;
@greghelton
greghelton / ReactiveSum2.java
Last active April 24, 2016 22:24
ReactiveSum2 - just trying to decipher the code of a more complex example
package com.reactive.summing;
import java.util.concurrent.CountDownLatch;
import java.util.regex.Pattern;
import com.reactive.helpers.RxCreateObservable;
import rx.Observable;
import rx.observables.ConnectableObservable;
import rx.schedulers.Schedulers;
public class ReactiveSum2 {
@greghelton
greghelton / ReactiveSum.java
Last active April 23, 2016 17:11
RxJava example that shows how dependent data is dynamically updated when other data changes
package com.reactive.summing;
import com.reactive.helpers.RxHelpers;
import rx.Observable;
import rx.subjects.BehaviorSubject;
public class ReactiveSum {
private BehaviorSubject<Double> a = BehaviorSubject.create(0.0);
private BehaviorSubject<Double> b = BehaviorSubject.create(0.0);
private BehaviorSubject<Double> c = BehaviorSubject.create(0.0);