This file contains hidden or 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
#!/usr/bin/env python | |
# encoding:utf-8 | |
def FCFS(cylinders, head, requests): | |
return requests | |
def SSTF(cylinders, head, requests): | |
req = [] | |
h = head | |
for i in range(len(requests)): |
This file contains hidden or 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
#!/usr/bin/env python | |
# coding:utf-8 | |
import time | |
import graphviz | |
class Tape(object): | |
def __init__(self, tape_string="", blank_symbol="B"): | |
self.blank_symbol = blank_symbol |
This file contains hidden or 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 <sys/syscall.h> | |
#define STRING "/bin/sh" | |
#define STRLEN 7 | |
#define ARGV (STRLEN+1) | |
#define ENVP (ARGV+4) | |
#define FD $0x03 | |
.globl main | |
.type main, @function |
This file contains hidden or 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
#!/usr/bin/env python | |
# encoding:utf-8 | |
import hmac | |
import pickle | |
import base64 | |
class Student: | |
def __init__(self, name, age): | |
self.name = name |
This file contains hidden or 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
#!/usr/bin/env python | |
# encoding: utf-8 | |
from z3 import * | |
''' | |
> https://zhuanlan.zhihu.com/p/30548907 | |
I forgot my flag & key. Help me recover them. | |
5616f5962674d26741d2810600a6c5647620c4e3d2870177f09716b2379012c342d3b584c5672195d653722443f1c39254360007010381b721c741a532b03504d2849382d375c0d6806251a2946335a67365020100f160f17640c6a05583f49645d3b557856221b2 |
This file contains hidden or 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 | |
from glob import glob | |
import os | |
image_names = glob("*.jpg") | |
pdf = "%s.pdf" % os.path.basename(os.getcwd()) | |
images = [Image.open(i) for i in image_names] | |
images[0].save(pdf, save_all=True, append_images=images[1:]) |
This file contains hidden or 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
#!/usr/bin/env python | |
from PIL import Image, ImageEnhance | |
import glob | |
def handle(im): | |
width = im.size[0] | |
height = im.size[1] | |
print(height, width) | |
for x in range(height): |
This file contains hidden or 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 | |
import glob | |
folders = [ | |
"images/*", | |
] | |
files = [] | |
suffix = "" |
This file contains hidden or 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 | |
''' | |
Black (0,0,0,1) (0,0,0) #000000 | |
White (0,0,0,0) (255,255,255) #FFFFFF | |
Red (0,1,1,0) (255,0,0) #FF0000 | |
Green (1,0,1,0) (0,255,0) #00FF00 | |
Blue (1,1,0,0) (0,0,255) #0000FF | |
Yellow (0,0,1,0) (255,255,0) #FFFF00 | |
Cyan (1,0,0,0) (0,255,255) #00FFFF |
This file contains hidden or 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 | |
''' | |
Black (0,0,0,1) (0,0,0) #000000 | |
White (0,0,0,0) (255,255,255) #FFFFFF | |
Red (0,1,1,0) (255,0,0) #FF0000 | |
Green (1,0,1,0) (0,255,0) #00FF00 | |
Blue (1,1,0,0) (0,0,255) #0000FF | |
Yellow (0,0,1,0) (255,255,0) #FFFF00 | |
Cyan (1,0,0,0) (0,255,255) #00FFFF |