Skip to content

Instantly share code, notes, and snippets.

@dvas0004
dvas0004 / csv_ascii_transform.py
Last active October 29, 2015 09:20
Convert csv to ascii
import csv
with open('log_transformed_truncated.csv', 'w') as outfile:
c = csv.writer(outfile)
counter = 0
with open('log_prepared_truncated.csv','rb') as f:
for row in csv.reader(f, delimiter=','):
counter = counter + 1
mod_row = []
if counter != 1:
{
"template" : "*",
"settings" : {
"analysis": {
"analyzer": {
"custom_keyword": {
"type": "keyword"
}
}
},
#!/bin/sh
#
# resolve symlinks
#
#### DV: START BUGFIX ####
export JAVA_HOME=/usr/lib/jvm/default-java
jdkhome=$JAVA_HOME
#### DV: END BUGFIX ####
@dvas0004
dvas0004 / puch-db-find-regex.js
Created January 12, 2016 13:31
regex example using pouchdb-find
db.find({
selector: {
_id: {$gte: null},
name: {$regex: ".*ri.*"}
},
fields: ['_id', 'debut', 'name', 'series']
});
@dvas0004
dvas0004 / polygon_tiling_google_maps.html
Created March 1, 2016 16:25
polygon tiling google maps example
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Circles</title>
<style>
html, body {
height: 100%;
margin: 0;
classifier = skflow.TensorFlowEstimator(model_fn=conv_model, n_classes=outer_name+1,
batch_size=10)
# use a full grid over all parameters
param_grid = {"steps": [1000, 1500, 2000, 2500, 3000],
"learning_rate": [0.01, 0.03, 0.05, 0.08],
"batch_size": [8, 10, 12]}
# run grid search
@dvas0004
dvas0004 / setup.py
Created March 21, 2016 13:35
modified setup.py for PyVLFEAT
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Installation script for the vlfeat module
"""
import numpy
import sys, os
from distutils.core import Extension, setup
from distutils.errors import DistutilsFileError
mLayout = findViewById(R.id.fullscreen_content);
if (ContextCompat.checkSelfPermission(mContext,
android.Manifest.permission.CAMERA)
!= PackageManager.PERMISSION_GRANTED) {
// Should we show an explanation?
if (ActivityCompat.shouldShowRequestPermissionRationale((Activity) mContext,
android.Manifest.permission.CAMERA)) {
@dvas0004
dvas0004 / opencv_play.cpp
Created July 5, 2016 09:56
testing openvc webcam / video functions
#include "opencv2/opencv.hpp"
#include "opencv2/videoio.hpp"
#include "cv.h"
#include "highgui.h"
#include <iostream>
#include <sstream>
#include <unistd.h>
using namespace std;
using namespace cv;
var ReactTable = React.createClass({
getInitialState: function() {
return {currentData: this.props.data};
},
render: function() {
var key = Date.now();