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
import matplotlib.pyplot as plt | |
import cv2 | |
import numpy as np | |
img = cv2.imread('monna.jpg')[100:700, 350:800, ::-1] | |
img = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY) | |
img = cv2.resize(img, (12, 16)) | |
plt.imshow(img, cmap='gray') | |
import seaborn as sns |
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
struct SameHash: Hashable { | |
var hashValue: Int { | |
return 1 | |
} | |
let value: Int | |
} | |
func ==(lhs: SameHash, rhs: SameHash) -> Bool { | |
return lhs.value == rhs.value | |
} |
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
class A { | |
let a: String | |
} |
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
class A { | |
let a: String | |
} |
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
import time, json, yaml, re, os, myfunc | |
from slackclient import SlackClient | |
with open('slack.yaml', 'r') as f: | |
doc = yaml.load(f) | |
user_id=doc["user_id"] | |
user_name=doc["user_name"] | |
user_address=doc["user_address"] | |
print user_id |
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
extension UITextField { | |
func switchSecureTextEntry(isSecure: Bool? = nil, normalFont: UIFont? = nil, secureFont: UIFont? = nil) { | |
let defaultFont = UIFont.systemFontOfSize(14) | |
self.secureTextEntry = isSecure ?? !self.secureTextEntry | |
self.font = nil | |
if secureTextEntry { | |
self.font = secureFont ?? defaultFont |
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
@IBOutlet weak var passwordTextField: UITextField! | |
@IBAction func switchSecureEntry(sender: UIButton) { | |
passwordTextField.secureTextEntry = !passwordTextField.secureTextEntry | |
} |