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
(comment Add [org.clojure/java.jdbc "0.1.1"] to project dependencies) | |
(ns myproject.core | |
(:use [clojure.java.jdbc :only [with-connection, with-query-results]])) | |
(let [db-host "MyHost" | |
db-port 10000 | |
db-name "default"] | |
(def db {:classname "org.apache.hadoop.hive.jdbc.HiveDriver" ; must be in classpath | |
:subname (str "//" db-host ":" db-port "/" db-name) |
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 main | |
import ( | |
"fmt" | |
"runtime" | |
"sync" | |
) | |
type UpgradableLock struct { | |
uglMutex sync.RWMutex |
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
import java.io.RandomAccessFile; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.Method; | |
import java.nio.channels.FileChannel; | |
import sun.nio.ch.FileChannelImpl; | |
import sun.misc.Unsafe; | |
@SuppressWarnings("restriction") | |
public class MMapper { |
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
from multiprocessing import Pool | |
from functools import partial | |
def _pickle_method(method): | |
func_name = method.im_func.__name__ | |
obj = method.im_self | |
cls = method.im_class | |
if func_name.startswith('__') and not func_name.endswith('__'): #deal with mangled names | |
cls_name = cls.__name__.lstrip('_') | |
func_name = '_' + cls_name + func_name |
OlderNewer