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 PIL import Image, ImageDraw | |
import photos | |
base = photos.capture_image() | |
w = base.size[0] | |
h = base.size[1] | |
rainbow = Image.new(base.mode, base.size, "white") |
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 sys | |
colors = 'rb' | |
def same_line(l1, l2): | |
if len(l1) == len(l2): | |
for i in range(len(l1)): |
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 <iostream> | |
#include <string> | |
#include <opencv2/opencv.hpp> | |
#include <opencv2/nonfree/nonfree.hpp> | |
using namespace std; | |
using namespace cv; | |
int main(int argc, char* argv[]) { | |
// load color image |
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 jp.dip.poketo7878; | |
/** | |
* Created by masato on 2014/05/24. | |
*/ | |
public class StringEditor { | |
private String str; | |
public Edit[] edits; | |
public StringEditor(String sr) { |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 javax.swing.*; | |
import java.awt.*; | |
import java.util.ArrayList; | |
public class MultiSplitPane extends JPanel { | |
private int orientation; | |
private Boolean needSplit; | |
private Boolean splited; | |
private Component firstChild; | |
private MultiSplitPane private_second_child; |
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
require 'set' | |
k = [0]*5; m = [0]*5 | |
begin | |
puts Set.new([*1..5]).divide{|i| k[i-1]}.map{|i| i.to_a*""}*"." | |
end while | |
(if i = [4,3,2,1].index{|i| k[i] <= m[i-1]}; then i=4-i | |
k[i]+=1; m[i] = m[i]>k[i] ? m[i] : k[i] | |
((i+1)..4).each{|j| k[j] = k[0]; m[j] = m[i]; } | |
end) |
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
(load "~/quicklisp/setup.lisp") | |
(let* ((*standard-output* (make-broadcast-stream)) | |
(*error-output* *standard-output*)) | |
(ql:quickload :split-sequence)) | |
(defun parse-ls-l () | |
;;Throught first line | |
(read-line) | |
(loop for line = (read-line t nil nil) |
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
let l:cmd = printf('curl --form-string key=%s --form-string uri=%s --form-string "size=%d" http://outputz.com/api/post', | |
\ fnameescape(g:outputz_secret_key), | |
\ fnameescape({g:outputz_uri_function}()), | |
\ a:n) | |
if s:V.has_vimproc() | |
call vimproc#system_bg(cmd) | |
else | |
call system(cmd) | |
endif |
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
func! s:sync(bang, bundle) abort | |
let git_dir = expand(a:bundle.path().'/.git/') | |
if isdirectory(git_dir) | |
if !(a:bang) | return 0 | endif | |
let cmd = 'git pull' | |
if (has('win32') || has('win64')) | |
"let cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives | |
let cmd = '"'.cmd.'"' " enclose in quotes | |
endif | |
"cd to bundle path" |