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
| python接收系统参数时第0个参数是指当前指定的文件名 | |
| 而实际上的参数列表是从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
| mac下一个处理plist文件的工具位于 | |
| /usr/libexec/PlistBuddy 工具 | |
| 查看plist文件中的某一项内容时就可以 | |
| /usr/libexec/PlistBuddy -c print:CFBundleShortVersionString plistname | |
| 就可以打印出相印工程的版本号 |
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
| Vim as a PHP IDE | |
| This Vim configuration is meant to be used to make Vim act more like an IDE. I use it mostly under MacVIM, so some things may be weird in different environments. For now, I'm just planning on using github to make managing my VIM configuraiton more easy, especially with deploying it to different environments. I'm not sure if I will make this a community projects. | |
| I do use this configuration on Linux while running plain vim, and it works fine for the most part. | |
| 上面的一稿文章。 | |
| 2、python的安装pydiction | |
| https://github.com/fsouza/Pydiction.git |
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
| 只有模板变量,字符串,整数和小数可以作为 {% ifequal %} 标签的参数。下面是合法参数的例子: | |
| {% ifequal variable 1 %} | |
| {% ifequal variable 1.23 %} | |
| {% ifequal variable 'foo' %} | |
| {% ifequal variable "foo" %} | |
| 其他任何类型,例如Python的字典类型、列表类型、布尔类型,不能用在 {% ifequal %} 中。 下面是些错误的例子: | |
| {% ifequal variable True %} |
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
| 总结一下: | |
| 进来的请求转入/hello/. | |
| Django通过在ROOT_URLCONF配置来决定根URLconf. | |
| Django在URLconf中的所有URL模式中,查找第一个匹配/hello/的条目。 | |
| 如果找到匹配,将调用相应的视图函数 |
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
| CGRect frame = CGRectMake(0, 0, 400, 44); | |
| UILabel *label = [[[UILabel alloc] initWithFrame:frame] autorelease]; | |
| label.backgroundColor = [UIColor clearColor]; | |
| label.font = [FontHelper fontFor:FontTargetForNavigationHeadings]; | |
| label.textAlignment = UITextAlignmentCenter; | |
| label.textColor = [UIColor whiteColor]; | |
| label.text = self.navigationItem.title; | |
| // emboss in the same way as the native title | |
| [label setShadowColor:[UIColor darkGrayColor]]; | |
| [label setShadowOffset:CGSizeMake(0, -0.5)]; |
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
| CGRect frame = CGRectMake(0, 0, 400, 44); | |
| UILabel *label = [[[UILabel alloc] initWithFrame:frame] autorelease]; | |
| label.backgroundColor = [UIColor clearColor]; | |
| label.font = [FontHelper fontFor:FontTargetForNavigationHeadings]; | |
| label.textAlignment = UITextAlignmentCenter; | |
| label.textColor = [UIColor whiteColor]; | |
| label.text = self.navigationItem.title; | |
| // emboss in the same way as the native title | |
| [label setShadowColor:[UIColor darkGrayColor]]; | |
| [label setShadowOffset:CGSizeMake(0, -0.5)]; |
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
| NSString * str = @"今天你还,好吗@?¥#¥"; | |
| // NSString *nStr = @"~`!@#$%^&*;:\"',.?"; | |
| NSMutableCharacterSet *set = [[NSMutableCharacterSet alloc] init]; | |
| [set formUnionWithCharacterSet:[NSCharacterSet lowercaseLetterCharacterSet]];//小写字母 | |
| NSLog(@"1 %@",[str stringByTrimmingCharactersInSet:set]); | |
| [set formUnionWithCharacterSet:[NSCharacterSet uppercaseLetterCharacterSet]];//大写字母 | |
| NSLog(@"2 %@",[str stringByTrimmingCharactersInSet:set]); | |
| [set formUnionWithCharacterSet:[NSCharacterSet symbolCharacterSet]];//符号 | |
| NSLog(@"3 %@",[str stringByTrimmingCharactersInSet:set]); | |
| [set formUnionWithCharacterSet:[NSCharacterSet punctuationCharacterSet]];//标点 |
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
| UITableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath]; | |
| CGFloat y = cell.frame.origin.y; | |
| CGFloat varY = abs(y - tableView.contentOffset.y); | |
| if (varY > 316.f) { | |
| CGPoint point = CGPointMake(tableView.contentOffset.x, tableView.contentOffset.y + 80.f); | |
| [tableView setContentOffset:point animated:NO]; | |
| } | |
| CGFloat y1 = cell.center.y; | |
| CGFloat offset = tableView.contentOffset.y; | |
| CGFloat deltaY = y1 - offset; |
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
| //左右轨的图片 | |
| UIImage *stetchLeftTrack= [UIImage imageNamed:@"brightness_bar.png"]; | |
| UIImage *stetchRightTrack = [UIImage imageNamed:@"brightness_bar.png"]; | |
| //滑块图片 | |
| UIImage *thumbImage = [UIImage imageNamed:@"mark.png"]; | |
| UISlider *sliderA=[[UISlider alloc]initWithFrame:CGRectMake(30, 320, 257, 7)]; | |
| sliderA.backgroundColor = [UIColor clearColor]; | |
| sliderA.value=1.0; | |
| sliderA.minimumValue=0.7; |