Skip to content

Instantly share code, notes, and snippets.

View ar's full-sized avatar

Alejandro Revilla ar

View GitHub Profile
@ar
ar / QMUX patch
Created April 13, 2011 12:32
MUX patch
diff --git a/jpos/src/main/java/org/jpos/q2/iso/QMUX.java b/jpos/src/main/java/org/jpos/q2/iso/QMUX.java
index cedffdc..1dacefa 100644
--- a/jpos/src/main/java/org/jpos/q2/iso/QMUX.java
+++ b/jpos/src/main/java/org/jpos/q2/iso/QMUX.java
@@ -271,6 +271,8 @@ public class QMUX
if (timeout > 0)
DefaultTimer.getTimer().schedule (ar, timeout);
}
+ if (sp.rdp (req))
+ throw new ISOException ("Duplicate key " + req + " detected");
public class CustomerCreate extends RestActionSupport {
private final String name = "304.301.CUSTOMER";
@Override
protected Map<String, Object> doExecute(DB db, JPublishContext jpc, Configuration c) throws BLException, ISOException {
final ISOMsg request = new ISOMsg("2304");
final Date date = new Date();
request.set(7, getDate(date));
request.set(11, getStan());
@ar
ar / StringUtil.java
Created December 1, 2011 21:15
String[] Encode/Decode
public class StringUtil {
public static String encode (String[] ss) {
StringBuilder sb = new StringBuilder();
for (String s : ss) {
if (sb.length() > 0)
sb.append(',');
if (s != null) {
for (int i = 0; i<s.length(); i++) {
char c = s.charAt(i);
switch (c) {
@ar
ar / fsm
Created May 21, 2012 18:44
FSM Implementation
// Model:
/*
* Copyright (c) 2004 jPOS.org
*
* See terms of license at http://jpos.org/license.html
*
*/
package org.jpos.fsm;
@ar
ar / codeFixes.patch
Created May 26, 2012 16:55
Code Contribution - Christopher
From 1c37c901400dba8b71c11e7494ef662926901549 Mon Sep 17 00:00:00 2001
From: Christopher Barham <[email protected]>
Date: Fri, 25 May 2012 09:36:45 +0200
Subject: [PATCH 01/12] Fix double check locking idiom for DefaultTimer lazy
init
---
jpos/src/main/java/org/jpos/util/DefaultTimer.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
@ar
ar / jpos-cloc.txt
Created October 3, 2012 17:10
cloc on jPOS as of 1.8.7
903 text files.
897 unique files.
1987 files ignored.
http://cloc.sourceforge.net v 1.56 T=9.0 s (94.1 files/s, 13827.4 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Java 768 9825 26755 72120
@ar
ar / CBBS.H
Created July 31, 2014 23:57
CBBS.H (CS/1)
/* CBBS.H
17:45 19/09/89 APR Primer release
Version Cambio
--------------
1.00A - Primer release funcionante (se cuelga cada 2 o 3 dias)
1.00B - Se pusieron RQ y RL (Request y Release) en todas las funciones
supuestamente no reentrantes (scanf, open, close)
@ar
ar / UOSAT.TXT
Created August 1, 2014 01:17
CX7BY's BULLETIN
Msg: 1287
De: CX7BY
Fecha: 18/08/91
Hora: 20:25:44
Tema: Satelite
HR AMSAT NEWS SERVICE BULLETIN 196.01 FROM AMSAT HQ
SILVER SPRING, MD JULY 15, 1991
TO ALL RADIO AMATEURS BT
@ar
ar / gist:88514c37a77677852845
Created August 13, 2014 15:26
Verifying that +apr is my Bitcoin username. You can send me #bitcoin here: https://onename.io/apr
Verifying that +apr is my Bitcoin username. You can send me #bitcoin here: https://onename.io/apr
var isoMsg = Java.type("org.jpos.iso.ISOMsg");
var isoSource = Java.type("org.jpos.iso.ISOSource");
var commit = function(id, ctx) {
try {
isoMsg = ctx.get("ISO_SOURCE");
isoSource = ctx.get("ISO_REQUEST");
isoMsg.set(39, "00");
isoSource.send(isoMsg);