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
#rm alias:ls -force | |
#set-alias ls myls | |
filter lsColor{ | |
if($_.mode[0] -eq "d"){ | |
Write-Host $_.name -ForeGroundColor Green | |
} | |
elseif($_.get_Extension() -eq ".exe"){ | |
Write-Host $_.name -ForeGroundColor Yellow | |
} |
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 Tkinter as tk | |
import time | |
root = tk.Tk() | |
c0 = tk.Canvas(root, width = 300, height = 300) | |
for i in range(0,202,2): | |
time.sleep(0.1) | |
n = c0.create_oval(i,125,50+i,175, tags = 'o') | |
c0.pack() | |
c0.update() |
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 random | |
import time | |
def randomized_quicksort(a, left, right): | |
if left < right: | |
r = random.randint(left, right) | |
a[r], a[left] = a[left], a[r] | |
p = left | |
k = left + 1 | |
while k <= 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
import random | |
import sys | |
import time | |
def quicksort(a, left, right): | |
if left < right: | |
p = left | |
k = left + 1 | |
while k <= right: | |
if a[k] < a[left]: |
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<stdio.h> | |
#include<stdlib.h> | |
#include<string.h> | |
#include<time.h> | |
#include<windows.h> | |
int main(int argc, char *argv[]){ | |
clock_t start, end; | |
FILETIME creationTime, exitTime; |
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 random | |
#import pylab | |
import copy | |
G = 1.0 | |
H = 3.5 | |
M = 1.0 | |
def ngp(data, n): | |
m = [[0] * (n+1) for i in range(n+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
"実行コマンド | |
command! Run call s:Run() | |
nmap <F5> :Run<CR> | |
function! s:Run() | |
let e = expand("%:e") | |
if e == "c" | |
:Gcc | |
endif | |
if e == "py" | |
:Python |
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 main(): | |
while True: | |
n = input() | |
if 0 < n < 10000: | |
break | |
print 'Error: input 1 ~ 9999' | |
s = str(n) | |
c = '' | |
try: |
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 | |
import time | |
def isPrime(n): | |
if n < 2: | |
return 0 | |
if n == 2: | |
return n | |
if n % 2 == 0: | |
return 0 |
NewerOlder