Author: Steve

Uploading a CSV to a REST web service

import org.apache.http.client.methods.*; import org.apache.http.client.*; import org.apache.http.impl.client.*; import org.apache.http.*; import org.apache.http.entity.mime.*; import org.apache.http.entity.*; import java.io.*; public class API_H01 { public static void main (String args[]) { try { HttpClient client = HttpClientBuilder.create().build(); File f = new File("/opt/tomcat8/hierarchy.csv"); MultipartEntityBuilder builder = MultipartEntityBuilder.create();…

Jython to call REST service and write output to a file

from org.apache.http.client.methods import * from org.apache.http.impl.client import * from org.apache.http.client import * from org.apache.http import * from org.json import * from java.io import * from java.util import * from java.lang import * client = HttpClientBuilder.create().build(); url = "https://host/api/invoices"; rq =…

Example of a structure in C

This is just a placeholder for how these work. Largely, this is the predecessor of object oriented programming in that a structure has properties that can be assigned. #include <stdio.h> #include <string.h> struct student {   int studentId;   char…

Robotic Process Automation

McKinsey Consulting defines Robotic Process Automation, or “RPA”, as follows: “RPA takes the robot out of the human. The average knowledge worker employed on a back-office process has a lot of repetitive, routine tasks that are dreary and uninteresting. RPA…

java dynamic SQL formatter

import java.sql.*;   public class dynColumns { public static void main(String[] args) { try { Connection con = DriverManager.getConnection("jdbc:oracle:thin:" + args[0]); Statement stm = con.createStatement(); ResultSet rst = stm.executeQuery(args[1]); ResultSetMetaData rstMeta = rst.getMetaData(); int columns = rstMeta.getColumnCount(); while (rst.next()) {…

SAML response between IDP and SP

samlresponse sent from idp back to browser, who posts via form to service provider. the response is encrypted with the public key of the service provider Usually, the SP creates a SAML request, and also creates a form whose action…