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
#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
#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
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
define(`forloop', | |
`pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')') | |
define(`_forloop', | |
`$4`'ifelse($1, `$3', , | |
`define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')') | |
forloop(`i', 1, 1000, | |
`ifelse(eval(i % 15 == 0), 1, FizzBuzz | |
,ifelse(eval(i % 5 == 0), 1, Fizz | |
,ifelse(eval(i % 3 == 0), 1, Buzz |
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
define(`forloop', | |
`pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')') | |
define(`_forloop', | |
`ifelse(eval($1 < `$3'), 1, | |
`$4`'define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')') |
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 Data.List | |
data L = L (Maybe L) Int deriving (Eq) | |
instance Show L where | |
show (L Nothing l1) = show l1 | |
show (L (Just p) l1) = (show p) ++ "." ++ (show l1) | |
instance Ord L where | |
(L Nothing l1) `compare` (L Nothing l2) = l1 `compare` l2 |
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 | |
import console | |
base = photos.capture_image() | |
w = base.size[0] | |
h = base.size[1] | |
paris = 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 | |
# In[5]: | |
from PIL import Image, ImageDraw | |
from matplotlib.pyplot import imshow | |
import numpy as np | |
import random |
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 <vector> | |
#include <queue> | |
using namespace std; | |
struct vect2 { | |
int x; | |
int y; | |
}; |