Skip to content

Instantly share code, notes, and snippets.

Avatar
🏔️

ixaxaar ixaxaar

🏔️
View GitHub Profile
@swenzel
swenzel / live_plot.py
Last active Sep 2, 2015
Live spike raster plot for PyNEST
View live_plot.py
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2015 Swen Wenzel <swenzel@uos.de>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@rednaxelafx
rednaxelafx / Notes.md
Created Nov 17, 2011
java.lang.InternalError: a fault occurred in a recent unsafe memory access operation in compiled Java code
View Notes.md

Error message:

2011-11-17 09:32:51,715 [ajp-0.0.0.0-8009-3] ERROR com.alibaba.citrus.webx.impl.WebxRootControllerImpl - Error occurred while process request /
java.lang.InternalError: a fault occurred in a recent unsafe memory access operation in compiled Java code
        at java.nio.Bits.swap(Bits.java:27) ~[na:1.6.0_17]
        at java.nio.Bits.swap(Bits.java:37) ~[na:1.6.0_17]
        at java.nio.DirectByteBuffer.getInt(DirectByteBuffer.java:614) ~[na:1.6.0_17]
        at java.nio.DirectByteBuffer.getInt(DirectByteBuffer.java:624) ~[na:1.6.0_17]
        at com.taobao.common.nmap.Nmap.next2(Nmap.java:135) ~[common-nbeanutils-1.2.0.jar:na]
@paradigmatic
paradigmatic / FASTA.scala
Created Aug 23, 2012
FASTA parser in Scala
View FASTA.scala
import scala.util.parsing.combinator._
object FASTA {
case class Entry( description: String, sequence: String )
def fromFile( fn: String ): List[Entry] = {
val lines = io.Source.fromFile(fn).getLines.mkString("\n")
fromString( lines )
}
View clojure_is_for_aristotelians.md

Clojure is for Aristotelians

I was reading ["Clojure is for Type B Personalities"][2] and it sparked some thoughts I had about the intersection of western philosophy and programming.

One could say Mathematics is an extension of Epistemology. And all theory about computability are an extension of mathematics. I reckon how one thinks about computability and how one writes computable functions are a reflection of a person's natural epistemological tendencies. This is going to be just as unscientific as ["Clojure is for Type B Personalities"][2], but hopefully another

@drmarshall
drmarshall / event_export.py
Created Jun 8, 2015
Example Mixpanel raw event export script
View event_export.py
#! /usr/bin/env python
#
# Mixpanel, Inc. -- http://mixpanel.com/
#
# Python API client library to consume mixpanel.com analytics data.
import hashlib
import urllib
import time
try:
@mountainstorm
mountainstorm / export-group.py
Created Dec 24, 2013
Blender python export script; allows you to render out a scene but with everything not in the chosen group as transparent. Useful if you want to create sprites or use bits of a scene as 2d layers.
View export-group.py
# coding: utf-8
# Copyright (c) 2013 Mountainstorm
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
View AgdaBasics.agda
module AgdaBasics where
apply : (A : Set)(B : A Set) ((x : A) B x) (a : A) B a
apply A B f a = f a
_∘_ : {A : Set}{B : A Set}{C : (x : A) B x Set}
(f : {x : A}(y : B x) C x y)(g : (x : A) B x)
(x : A) C x (g x)
(f ∘ g) x = f (g x)
View HBase-Client-API.scala
package com.chetan.poc.hbase
/**
* Created by chetan on 24/1/17.
*/
import org.apache.spark._
import org.apache.hadoop.hbase.{CellUtil, HBaseConfiguration, TableName}
import org.apache.hadoop.hbase.mapreduce.TableInputFormat
import org.apache.hadoop.hbase.util.Bytes
import org.apache.hadoop.hbase.client._
@johnynek
johnynek / scalding_alice.scala
Created Jul 18, 2014
Learn Scalding with Alice
View scalding_alice.scala
/**
git clone https://github.com/twitter/scalding.git
cd scalding
./sbt scalding-repl/console
*/
import scala.io.Source
val alice = Source.fromURL("http://www.gutenberg.org/files/11/11.txt").getLines
// Add the line numbers, which we might want later
val aliceLineNum = alice.zipWithIndex.toList