Skip to content

Instantly share code, notes, and snippets.

View grundprinzip's full-sized avatar

Martin Grund grundprinzip

View GitHub Profile
@grundprinzip
grundprinzip / 1_create.py
Created August 17, 2021 13:10
Parquet Column Names
import pyarrow as pa
import pyarrow.parquet as pq
col1 = pa.array([1,2,3])
col2 = pa.array(["a","b", "c"])
table = pa.Table.from_arrays([col1,col2], ["This aint; `no (name)", "Isthis"])
pq.write_table(table, "result.parquet")
@grundprinzip
grundprinzip / kiddos.py
Created February 3, 2021 09:59
A noise monitor for the M5Stack Fire device.
from m5stack import *
from m5ui import *
from uiflow import *
import machine
from easyIO import *
import time
import utime
SAMPLE_PERIOD = 50
@grundprinzip
grundprinzip / impfungen.ipynb
Last active January 8, 2021 22:20
Impfanalyse
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"".php_info()."";
# To download requirements use the downlod_requirements script in this dir.
# Remember, all modules below need to support python 2.6.
allpairs == 2.0.1
bitarray == 0.8.1 # Needed by impyla
cm-api == 10.0.0
Fabric == 1.10.2
pexpect == 3.3
pg8000 == 1.10.2
/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.18/lib/impala/sbin-retail/impalad --flagfile=/var/run/cloudera-scm-agent/process/13478-impala-IMPALAD/impala-conf/impalad_flags CDH_HCAT_HOME=/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.18/lib/hive-hcatalog TOMCAT_HOME=/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.18/lib/bigtop-tomcat CDH_SOLR_HOME=/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.18/lib/solr CDH_PIG_HOME=/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.18/lib/pig PARCELS_ROOT=/opt/cloudera/parcels CLOUDERA_MYSQL_CONNECTOR_JAR=/usr/share/java/mysql-connector-java.jar TERM=xterm GLOG_logbuflevel=-1 CDH_HUE_PLUGINS_HOME=/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.18/lib/hadoop LD_PRELOAD=/opt/toolchain/sun-jdk-64bit-1.7.0.67/jre/lib/amd64/server/libjsig.so CDH_HIVE_HOME=/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.18/lib/hive SCM_DEFINES_SCRIPTS=/opt/cloudera/parcels/CDH-5.4.0-1.cdh5.4.0.p0.18/meta/cdh_env.sh GLOG_minloglevel=0 CDH_VERSION=5 HIVE_DEFAULT_XML=/etc/hive/conf.dist/hive-default.xml CLOUDE
A = LOAD '/data/twitter/twitter_10.json' USING JsonLoader('created_at:chararray, id:long,id_str:chararray,text:chararray,source:chararray,truncated:boolean, in_reply_to_status_id:long, in_reply_to_status_id_str:chararray, in_reply_to_user_id:long, in_reply_to_user_id_str:chararray, in_reply_to_screen_name:chararray,user:map[],geo:chararray,coordinates:chararray,place:chararray');
B = FOREACH A GENERATE user;
DUMP B;
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<title>Generated by gitinspector 0.3.2</title>
<script type="application/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="application/javascript">
(function($){$.extend({tablesorter:new
function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;
curl 'http://diufpc301.unifr.ch:8888/hbase/api/getRowQuerySet/Cluster/ngrams2/\[\]/\[%7B%22row_key%22:%22lessons%20%2c%22,%22scan_length%22:1,%22columns%22:\[\],%22prefix%22:false,%22filter%22:null,%22editing%22:false%7D\]' -X POST -H 'Cookie: _ga=GA1.2.1596215157.1368361607; sessionid=3573d7f153a8db484363c41483cb67ae; __utma=76128977.1596215157.1368361607.1391528684.1392888595.7; __utmz=76128977.1391528684.6.2.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); SPRING_SECURITY_REMEMBER_ME_COOKIE=YWRtaW46MTM5NDA5ODIxMjkwODo2OTFmZDVmNWYzZDRiMjQ5ZmJkOWE2MTRjY2I1ZWUyMQ; CLOUDERA_MANAGER_SESSIONID=s2s4iiz3mou519o1ffotqa771; JSESSIONID=1lwc22vlawb7lamz1ts9wosv; __utma=97986186.1596215157.1368361607.1393231096.1393242275.21; __utmb=97986186.52.10.1393242275; __utmc=97986186; __utmz=97986186.1392286914.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)' -H 'Origin: http://diufpc301.unifr.ch:8888' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.
#!/usr/bin/env python
import sys
import json
import base64
import requests
import urllib
def issuccessful(request):
if 200 <= request.status_code and request.status_code <= 299: