Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://flask.pocoo.org/snippets/88/ | |
import os, sqlite3 | |
from cPickle import loads, dumps | |
from time import sleep | |
try: | |
from thread import get_ident | |
except ImportError: | |
from dummy_thread import get_ident |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include(CMakeParseArguments) | |
find_program(NIM_EXECUTABLE nimrod PATHS ENV PATH) | |
mark_as_advanced(NIM_EXECUTABLE) | |
# Determine the valac version | |
if(NIM_EXECUTABLE) | |
execute_process(COMMAND ${NIM_EXECUTABLE} "--version" | |
OUTPUT_VARIABLE NIM_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Short guide to TCP/IP Client/Server programming in Common Lisp using usockets | |
; | |
; The main reason for this guide is because there are very few examples that | |
; explain how to get started with socket programming with Common Lisp that I | |
; could understand. After spending a day trying, I finally came up with a small | |
; bit of code that makes it easy to understand the basics. I've written this | |
; primarily for myself, but should help others get started as well. | |
; As usual, we will use quicklisp to load usocket. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Short guide to UDP/IP Client/Server programming in Common Lisp using usockets | |
; | |
; The main reason for this guide is because there are very few examples that | |
; explain how to get started with socket programming with Common Lisp that I | |
; could understand. | |
; After working on a short example on TCP, I found the | |
; need for a UDP tutorial. So, here goes. | |
; As usual, we will use quicklisp to load usocket. |
These are for the combined vim-sexp
(https://github.com/guns/vim-sexp) and vim-sexp-mappings-for-regular-people
(https://github.com/tpope/vim-sexp-mappings-for-regular-people) plugins. vim-sexp
is neat on its own but Tim Pope makes common stuff much easier.
Note that some vim-sexp
functionality depends on <LocalLeader>
mappings. This is a different leader key than the global leader, and is the variable maplocalleader
(instead of mapleader
). To see if you have this set, use :echo maplocalleader
; if it errors out you'll need to set it, otherwise it will echo the key. If you want to set your LocalLeader
to <Space>
, you'll need two commands in your .vimrc
, since by default <Space>
is bound to <Right>
in normal mode:
nnoremap <Space> <Nop>
let maplocalleader=" "
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY:all | |
all: avro-tools-1.7.7.jar schemas-0.5.1/src/main/resources/avro/variants.avpr src/test/TestAvro.java | |
rm -rf generated | |
mkdir -p generated | |
#generate java classes | |
java -jar $< compile protocol schemas-0.5.1/src/main/resources/avro/ ./generated | |
#compile classes | |
javac -d generated -cp avro-tools-1.7.7.jar -sourcepath generated:src generated/org/ga4gh/*.java src/test/TestAvro.java | |
# archive | |
jar cvf generated/ga4gh.jar -C generated org -C generated test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.cakesolutions.spark | |
import org.apache.spark.SparkConf | |
import org.apache.spark.api.java.JavaSparkContext | |
import scala.Tuple2 | |
fun main(args: Array<String>) { | |
val inputFile = args[0] | |
val outputFile = args[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTSJDK=path/to/htsjdk-2.0.1.jar:path/to/apache-ant-1.8.2-bzip2.jar:path/to/commons-compress-1.4.1.jar:path/to/commons-jexl-2.1.1.jar:path/to/commons-logging-1.1.1.jar:path/to/ngs-java-1.2.2.jar:path/to/snappy-java-1.0.3-rc3.jar:path/to/xz-1.5.jar | |
all: | |
rm -rf tmp | |
mkdir -p tmp | |
javac -d tmp -cp ${HTSJDK}:. Test.java | |
java -cp ${HTSJDK}:tmp Test path/to/dbsnp_138.b37.vcf |