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 com.example; | |
import android.media.MediaPlayer; | |
import android.media.AudioManager; | |
import java.io.IOException; | |
public class AndroidSound { | |
private static AndroidSound instance = null; | |
private static MediaPlayer mediaPlayer = null; |
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
#-*- coding: utf-8 -*- | |
import subprocess | |
if __name__ == '__main__': | |
ps = subprocess.Popen(['nodejs','ps2.js'], stdin=subprocess.PIPE, stdout=subprocess.PIPE) | |
out = ps.communicate(input='http://www.daum.net'.encode())[0] | |
print(out.decode('utf-8')) |
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
def withinRangeSearch(aList, key, kpick=lambda x:x[0], vpick=lambda x:x[1]): | |
left = 0 | |
right = len(aList) - 1 | |
if key < kpick(aList[left]): | |
return vpick(aList[left]) or left | |
if key >= kpick(aList[right]): | |
return vpick(aList[right]) or right |
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 | |
/* | |
#cgo LDFLAGS: -lproj | |
#include <string.h> | |
#include <proj_api.h> | |
*/ | |
import "C" | |
import ( | |
"fmt" |
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
const rx = require('rx') | |
let s = new rx.Observable.from([1,2,3,4,5,6,7,8,9]) | |
let ss = s.controlled() | |
ss.subscribe((x) => { | |
console.log("Pull "+x) | |
setTimeout(() => process(1, x), 100) | |
}) |
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 pyproj | |
import cv2 | |
import numpy as np | |
import csv | |
EPSG5174 = pyproj.Proj("+proj=tmerc +lat_0=38 +lon_0=127.0028902777778 +k=1 +x_0=200000 +y_0=500000 +ellps=bessel +towgs84=-115.80,474.99,674.11,1.16,-2.31,-1.63,6.43 +units=m +no_defs") | |
EPSG5179 = pyproj.Proj("+proj=tmerc +lat_0=38 +lon_0=127.5 +k=0.9996 +x_0=1000000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs") # UTMK | |
EPSG5186 = pyproj.Proj("+proj=tmerc +lat_0=38 +lon_0=127 +k=1 +x_0=200000 +y_0=600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs") | |
fromarray = [] |
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 cython.parallel import prange | |
import numpy as np | |
cimport numpy as np | |
def calculate_z(int maxiter, double complex[:] zs, double complex[:] cs): | |
""" Calculate output list using jullia update rules.""" | |
cdef unsigned int i, length | |
cdef double complex z, c | |
cdef int[:] output = np.empty(len(zs), dtype=np.int32) | |
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
/* filename: diffusion.c | |
* compile: | |
* gcc -O3 -std=gnu99 -c diffusion.c | |
* gcc -shared -o diffusion.so diffusion.o | |
* | |
* .so file place /usr/lib or /usr/local/lib or set LD_LIBRARY_PATH for custom location | |
*/ | |
void evolve(int w, int h, double **in, double **out, double D, double dt) { | |
int i, j; |
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.util.regex.Pattern; | |
import java.util.regex.Matcher; | |
class Main { | |
public static void main(String[] args) { | |
String s = "여기는.어디.입니까-12"; | |
Pattern p = Pattern.compile("^([^.]+\\.[^.]+\\.[^-.]+)(?:-([0-9]{2}))?$"); | |
Matcher m = p.matcher(s); | |
if(m.find()) { |
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
/* | |
* Licensed to the Apache Software Foundation (ASF) under one or more | |
* contributor license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright ownership. | |
* The ASF licenses this file to You under the Apache License, Version 2.0 | |
* (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
OlderNewer