Skip to content

Instantly share code, notes, and snippets.

View vaskaloidis's full-sized avatar

Vas Kaloidis vaskaloidis

View GitHub Profile
@vaskaloidis
vaskaloidis / power_minimum_cycle
Last active August 29, 2015 13:58
Standard ML functions to: raise a number to a given power, find the smallest of 3 numbers and cycle the first element of a list to thelast
(* Raises a to the power of b *)
fun pow(a:real, b:int) :real =
if b > 1 then a * pow(a, (b - 1))
else a;
(* Raises a to the power of b but it is a real*real->real *)
fun power((a, b):(real*real)) =
if a <= 0.0 then 1.0
else a * pow(a, b - 1.0):real;
@vaskaloidis
vaskaloidis / yaccgrammar.cpp
Last active August 29, 2015 13:58
Some YACC grammar
%{
#include <stdio.h>
%}
%%
command : expr '\n' { printf("The result is: %d\n",$1); }
;
expr :
expr '+' term
fun polyhelper ([], _, _) = 0.0
| polyhelper (a::b, x, e) = ( a * power (x, e) ) + polyhelper (b, x, e + 1.0);
fun polyeval([], _) = 0.0
| polyeval(a::b, x) = a + polyhelper(b, x, 1.0);
fun addToAll(x, nil) = nil
| addToAll(x, y::z) = (x::y)::addToAll(x,z);
fun powerSet(nil) = [nil]
fun member(e, nil) = false
| member(e, h::t) =
if e = h then true
else member(e, t);
fun union(nil, c) = c
| union(a::b,c) =
if member(a, c) then union(b,c)
else a::union(b,c);
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>apelon</groupId>
<artifactId>vas</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>vas sample plugin</name>
<build>
<plugins>
<plugin>
<groupId>apelon</groupId>
<artifactId>vas</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
@vaskaloidis
vaskaloidis / va-build-all.py
Last active August 29, 2015 14:19
va-buil-all.py
#! /usr/bin/python
#
# Build the entire ISAAC Project
import subprocess
import os
import sys
projects = ['va-isaac-parent',
'va-ochre',
@vaskaloidis
vaskaloidis / va-pull-repos-new.py
Last active August 29, 2015 14:19
Python Script to Git Clone each Apelon-VA ISAAC + OCHRE Framework
#! /usr/bin/python
#
# Pull each Apelon-VA Repo
#
import subprocess
import os
def git(*args):
return subprocess.Popen(['git'] + list(args), shell=True, stdout=subprocess.PIPE).communicate()[0]
[
{
"id":1673,
"collection_id":1666,
"name":"Address",
"created_at":"2015-10-19T19:45:22.000Z",
"updated_at":"2015-10-20T14:59:10.000Z",
"ord":1,
"anonymous_user_permission":"none",
"fields":[
@vaskaloidis
vaskaloidis / 1670.json
Created December 10, 2015 18:21
Attempting to update a Resource Map layer with HL7 Data, by using this command against endpoint: http://resourcemap.instedd.org/api/collections/1666/layers/1670.json
{
"layer":{
"id":"1670",
"name":"Medical Facility Information",
"ord":"1",
"fields_attributes":{
"0":{
"id":"13377",
"name":"Facility Type",
"code":"facility_type",