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
#!/usr/bin/python | |
# encoding:utf-8 | |
import sys | |
import heapq | |
import math,random | |
import time | |
# 1 获取一个随机解 | |
# 2 从上一个解中获取一个随机解 | |
# 新解为最优时,选定新解;否则按概率在解与新解中选择 | |
def annealing(sa, newF, T=10000.0, cool=0.95): |
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
教育背景 | |
2008/09 - 2012/07 厦门理工学院 学士 | |
工作经历 | |
2013/03 - 2013/10 厦门一江网络 前端工程师 + 服务器管理 | |
专业及语言技能 | |
熟悉linux服务器的管理使用 如 vim, bash, crontab 等(四年的ubuntu操作经验, 从大二开始使用ubuntu作为桌面系统) | |
掌握的语言包括 python, golang, nodejs, objective-c | |
对数据结构和算法,有过专门的训练学习 |
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
#!/usr/bin/python | |
# encoding:utf-8 | |
""" | |
一个点过的所有环里面有很多点集是重复的,只需要保留最小的那个 | |
譬如C1C2C3C1, C1C3C2C1 这两个环是不同的,点集却是相同的,当然造价一般是不同的,那么只需要保留造价最低的一个就可以了 | |
找出所有的过某一点的所有环,数据存储格式如下: | |
d = { | |
“C1”: [], |
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
#!/usr/bin/python | |
# encoding:utf-8 | |
""" | |
题目: http://www.wmsstech.com/puzzles_view_chemical.html | |
本解法是,取一个最小环,然后不断的往里面加点 | |
当加点时,尝试该点的所有入度出度的组合 | |
当尝试某个组合时,譬如 加入点k, 使用的组合是 x->k, k->y | |
那么找到x的出度,尝试将他转移到k,y,以及y的可达点,看能否获得一个更好的组合 | |
然后找到y的入度,尝试转移到k,x以及x的来路上,看能否获得一个更好的组合 |
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
// 注意,如果输入的是汉字的话,输入拼音后,会出现新的一行,让你选择拼音所对应的汉字,这个也会触发UIKeyboardWillShowNotification | |
// 所以,你要加个变量,来判断键盘是否消失,没消失的话就不在上移界面 | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view. | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(keyboardWillShow:) |
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
// 然后鉴于,一个页面里面可能有多个输入源, so 遍历下面 | |
for (UIView *view in self.view.subviews) { | |
if ([view isFirstResponder]){ | |
[view resignFirstResponder]; | |
return; | |
} | |
} |
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
参见这个http://stackoverflow.com/questions/8550579/uiactionsheet-cancel-button-not-dismissing-actionsheet | |
说是最下面的属于被tab bar controller 劫持的部分,so 你需要从tab bar 上显示 action sheet | |
嗯,测试了下 | |
[sheet showFromTabBar:[[self tabBarController] tabBar] ]; | |
或者 | |
[sheet showInView:[[self tabBarController] tabBar] ]; | |
都可以解决问题 |
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
#!/usr/bin/python | |
# encoding:utf-8 | |
""" | |
幻方类型:N为奇数 | |
构造方法: | |
1. 先画一个n×n方格表, | |
则横向方向的坐标索引x为(0,1,2,3,...,n-2,n-1), | |
纵向方向的坐标索引y为(0,1,2,3,...,n-2,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
@interface UILabel (dynamicSizeMe) | |
-(float)resizeToFit; | |
-(float)expectedHeight; | |
@end |
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 <UIKit/UIKit.h> | |
#import <AVFoundation/AVFoundation.h> | |
@protocol QRScannerViewControllerDelegate <NSObject> | |
- (void) catch:(NSString*)content; | |
@end | |
@interface QRScannerViewController : UIViewController | |
@property (assign, nonatomic) id<QRScannerViewControllerDelegate> delegate; |
OlderNewer