Skip to content

Instantly share code, notes, and snippets.

View hkilter's full-sized avatar
😐
Meh

H. Kemal İlter hkilter

😐
Meh
View GitHub Profile
#!/usr/bin/env ruby
#
# This script is a wrapper around pandoc that uses pandoc's
# builtin citeproc support to generate a markdown bibliography
# from bibtex.
#
# Inspired by Jacob Barney's [bib2mkd][] script.
#
# [bib2mkd]: http://jmbarney.dyndns.org/?/linux/bib2mkd/
#
@hkilter
hkilter / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hkilter
hkilter / py2svg.txt
Last active August 29, 2015 14:06
Converting a python list to an SVG path by Peter Collingridge
from: http://www.petercollingridge.co.uk/blog/converting-python-list-svg-path
Here's a short snippet of Python code that was I very pleased with. It converts a list of coordinates, such as this:
```
[(10, 200), (12, 220), (15, 180)]
```
Into the d attribute of an SVG path, such as this:
Today is a XML day for me. I am trying to parse a CSV file to a meaningful XML file to produce represent it on SCOM architecture. I wrote a Python code for parsing a basic SCOM CVS file to a fundamental SCOM XML file like that:
Python code:
import csv
csvFile = 'scom.csv'
xmlFile = 'scom.xml'
@hkilter
hkilter / parsx.py
Last active August 29, 2015 14:06
PARSX (Supply chain parser for SCML)
# Name: parsx.py
# Type: Parser
# Purpose: PARSX: XSCML parser
import csv
csvFile = 'scom-example.sc' # SC input
xmlFile = 'scom-example.xml' # XML output
csvData = csv.reader(open(csvFile))
xmlData = open(xmlFile, 'w')
@hkilter
hkilter / scom.csv
Last active August 29, 2015 14:06
csv file for PARSX
layer name layer id sublayers
product 1 2
agent 2 0
flow 3 0
operations 4 5
@hkilter
hkilter / scom.xml
Created September 26, 2014 16:01
Output of PARSX - scom.xml
<?xml version="1.0" encoding="UTF-8"?>
<scom>
<layer>
<layer_id>36</layer_id>
<layer_name>abc</layer_name>
<layer_value>7.6</layer_value>
</layer>
<layer>
<layer_id>40</layer_id>
<layer_name>def</layer_name>
@hkilter
hkilter / XPLOR-2-XYZ.py
Last active August 29, 2015 14:10
XPLOR-2-XYZ
## This script will convert PDB file saved by NIH XPLOR into XYZ format.
## Will also work on other PDB files, but does not process HETATM entries - only ATOM. Can be easily extended though.
## Usage:
## xplo2xyz.py [options] <file.pdb> [<file.xyz>]
## options:
## --version show program's version number and exit
## -h, --help show this help message and exit
## -o, --overwrite overwrite output file, if it exists
## -v, --verbose print info about files being processed
## Create file xplo2xyz.py, copy-paste into the content below and save.
@hkilter
hkilter / weasel.py
Last active August 29, 2015 14:23
Weasel program by R. Dawkins
# code - http://rosettacode.org/wiki/Evolutionary_algorithm
from string import letters
from random import choice, random
target = list("METHINKS IT IS LIKE A WEASEL")
charset = letters + ' '
parent = [choice(charset) for _ in range(len(target))]
minmutaterate = .09
C = range(100)
@hkilter
hkilter / falsepositivesversion2.R
Created September 27, 2015 11:02 — forked from vasishth/falsepositivesversion2.R
False positives in a lifetime [revised 23 Nov 2014; comments and corrections welcome]
## Our simulated scientist will declare
## significance only if he/she gets
## 2 replications with p<0.05:
stringent<-FALSE
## Set the above to FALSE if you want to
## have the scientist publish a single
## expt. as soon as it's significant:
#stringent <- FALSE
## num of scientists to simulate: