Skip to content

Instantly share code, notes, and snippets.

View andypetrella's full-sized avatar

Andy Petrella andypetrella

View GitHub Profile
@andypetrella
andypetrella / gen-data.js
Last active March 31, 2019 11:52
Test WebCOLA
numberOfNodes = 10000
avgDegree = 10
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
}
@andypetrella
andypetrella / btw
Created August 3, 2018 18:23
fix swagger R json manipulations
FWIW, I know it's dirty/nasty :-/
@andypetrella
andypetrella / access.py
Created July 21, 2018 18:07
How to reference a scala object in python using Py4j (JavaGateway)
# This function takes the fully classified object name, say: <package>.<name>.
# Returns the static object instance on the heap
def ref_scala_object(object_name):
clazz = jvm.java.lang.Class.forName(object_name+"$")
ff = clazz.getDeclaredField("MODULE$")
o = ff.get(None)
return o
@andypetrella
andypetrella / a.py
Created March 15, 2018 09:24
ex in py
dam_dependencies = [
ProcessLineageDepsBuilder(input_schema, output_schema)
.identity_from_output("data")
.append('f', ['name', 'last'], "data"),
ProcessLineageDepsBuilder(input_schema_2, output_schema)
.identity_from_output("data")
]
dam_create_process_run_and_lineage(process, user,
code_version, process_name,
@andypetrella
andypetrella / a.py
Created March 15, 2018 09:24
ex in py
dam_dependencies = [
ProcessLineageDepsBuilder(input_schema, output_schema)
.identity_from_output("data")
.append('f', ['name', 'last'], "data"),
ProcessLineageDepsBuilder(input_schema_2, output_schema)
.identity_from_output("data")
]
dam_create_process_run_and_lineage(process, user,
code_version, process_name,
root@ip-172-31-15-75:/mnt/nd4j# cd ../libnd4j/
root@ip-172-31-15-75:/mnt/libnd4j# ./buildnativeoperations.sh
eval cmake
PACKAGING = none
BUILD = release
CHIP = cpu
LIBRARY TYPE = dynamic
/mnt/libnd4j/blasbuild/cpu
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.nd4j:nd4j-jdbc-api:jar:0.4-rc3.11-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. @ org.nd4j:nd4j:0.4-rc3.11-SNAPSHOT, /mnt/nd4j/pom.xml, line 327, column 21
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.nd4j:nd4j-jdbc-mysql:jar:0.4-rc3.11-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. @ org.nd4j:nd4j:0.4-rc3.11-SNAPSHOT, /mnt/nd4j/pom.xml, line 327, column 21
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.nd4j:nd4j-jdbc:pom:0.4-rc3.11-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. @ org.nd4j:nd4j:0.4-rc3.11-SNAPSHOT, /mnt/nd4j/pom.xml, line 327, column 21
root@ip-172-31-15-75:/mnt/libnd4j# ./buildnativeoperations.sh
eval cmake
PACKAGING = none
BUILD = release
CHIP = cpu
LIBRARY TYPE = dynamic
/mnt/libnd4j/blasbuild/cpu
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
{
"metadata" : {
"name" : "Serializable StateStream",
"user_save_timestamp" : "1970-01-01T01:00:00.000Z",
"auto_save_timestamp" : "1970-01-01T01:00:00.000Z",
"language_info" : {
"name" : "scala",
"file_extension" : "scala",
"codemirror_mode" : "text/x-scala"
},
@andypetrella
andypetrella / QPlot.snb
Last active March 9, 2016 02:33
Super basic qplot implementation on Scala collection, using R backend as renderer... in 74 lines :-)
{
"metadata" : {
"name" : "QPlot",
"user_save_timestamp" : "1970-01-01T01:00:00.000Z",
"auto_save_timestamp" : "1970-01-01T01:00:00.000Z",
"language_info" : {
"name" : "scala",
"file_extension" : "scala",
"codemirror_mode" : "text/x-scala"
},