Skip to content

Instantly share code, notes, and snippets.

View ar's full-sized avatar

Alejandro Revilla ar

View GitHub Profile
@ar
ar / HttpQuery.java
Created July 31, 2016 21:41
Sample HTTP client participant
package org.jpos.rest.client;
import java.io.IOException;
import java.io.Serializable;
import java.io.ByteArrayInputStream;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
import org.apache.commons.httpclient.methods.GetMethod;
@ar
ar / XLabel.java
Last active June 25, 2016 20:51
XLabel
// XLabel.java
// When used with PREFORMATTED mode, elements are appended to the DOM on the client side without consuming server memory
// When combined with server push, it can be used to monitor large logs with a user experience similar to tail -f (quite responsive)
// The reload button works as a "clear", because of course we just have state on the server for the last setState call
// Known issues pending fix: if one calls setState twice with exactly the same content, Vaadin is smart enought to avoid the
// client-side update, but in this case, we do want the update anyway (i.e. adding a line with the same content).
package org.jpos.server.ui;
import com.vaadin.ui.Label;
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);
@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
@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 / 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 / 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 / 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 / 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 / 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) {