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
#! /bin/bash | |
#clear file content | |
echo '' > /tmp/png.txt | |
echo '' > /tmp/str.txt | |
#find all png image | |
for file in `find ./ -iname "*.png"`; do | |
result=`echo ${file} | grep -o "\.xcassets.*"` | |
if [[ ${result} == "" ]] |
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
@interface UIView(ImageMask) | |
- (void)setMaskImage:(UIImage *)maskImage; | |
@end | |
@implementation UIView(ImageMask) | |
- (void)setMaskImage:(UIImage *)maskImage { | |
objc_setAssociatedObject(self, @selector(setMaskImage:), maskImage, OBJC_ASSOCIATION_RETAIN_NONATOMIC); | |
UIImageView *view = [[UIImageView alloc]initWithImage:maskImage]; | |
view.frame = self.bounds; | |
self.layer.mask = view.layer; |
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 main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" | |
"strings" | |
) |
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
i = 1281854581821 | |
def getReverse(base, num): | |
if num < 10: | |
return base*10 + num | |
return getReverse(base*10+num%10, num/10) | |
def getReverse1(num): | |
i = 0 | |
while num: | |
i = i*10 + num%10 |
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
i = 1281854581821 | |
def getMax(num): | |
if num < 10: | |
return num | |
return getMax(num/10) | |
def isLastEqualFirst (num) : | |
if num < 10 : | |
return YES |
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
class Node(): | |
index = 0 | |
neighbors = [] | |
def __init__ (self, arg) : | |
self.index = arg | |
def description(self): | |
out = [] | |
out.append (self.index) | |
for item in self.neighbors: |
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
class Node(): | |
index = 0 | |
neighbors = [] | |
def __init__(self, arg): | |
self.index = arg | |
def description(self): | |
out = [] | |
out.append (self.index) | |
for item in self.neighbors: | |
out.append(item.index) |
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
#1.遍历某个路径的子目录 | |
#2.按行读取头文件和源文件 | |
#3.找到对应关系行 | |
#4.判断是否在注释范围内 | |
#5.分析并存储关系 | |
import os, os.path, re, sys | |
_g_relations = {} | |
_g_graphRelations = {} |
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 pickOne (array1, array2) : | |
length = len (array2) | |
if length == 0 : | |
return | |
for i in range (0, length) : | |
tempArray1 = array1[:] | |
tempArray2 = array2[:] | |
moveArrayItem (tempArray1, tempArray2, i) | |
print (tempArray1) | |
pickOne (tempArray1, tempArray2) |
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
- (CGFloat)strokeWidth { | |
if (_strokeWidth < 0.0001) { | |
_strokeWidth = 5.f; | |
} | |
return _strokeWidth; | |
} | |
- (UIColor *)strokeColor { | |
if (!_strokeColor) { | |
_strokeColor = [UIColor redColor]; |