一:访问修饰符:1.省略访问修饰符具有默认的访问特性,即具有包访问特性,只能被同一个包中的类使用。2.public访问修饰符用于说明类和类的成员的访问权限。这种类叫公有类。在一个文件中只能有一个public类型的类。例如:Rect和UseImport两个类,分别在两个不同的包中。顺便回顾一下不同类要...
分类:
编程语言 时间:
2015-07-12 00:16:28
阅读次数:
181
Red and Black
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 12211 Accepted Submission(s): 7601
Problem Description
There is a rect...
分类:
其他好文 时间:
2015-07-11 09:16:35
阅读次数:
160
go 语言中的结构体方法结构体名称的大小写有着不同的意义: 小写表示不能被别的包访问package mainimport "fmt"type Rect struct { width,height int}func (r *Rect) area() int { return r.width*r.hei...
分类:
编程语言 时间:
2015-07-10 12:53:15
阅读次数:
141
参考:Adjusting font size with TikZ picture调整字体大小的几种方式,大小依次增大,具体如下:\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge用法如下:\node (c) at (1,2) {\large x};...
分类:
其他好文 时间:
2015-07-09 16:10:23
阅读次数:
194
方法一:利用偏移量来滚动- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated;方法二:利用rect来滚动- (void)scrollRectToVisible:(CGRect)rect animated:(BO...
分类:
其他好文 时间:
2015-07-08 02:04:44
阅读次数:
500
1.实线,(下划线/删除线)
写一个新类 UnderLineLabel :
UILabel
- (void)drawRect:(CGRect)rect {
// Drawing code
[super drawRect:rect];
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGSize f...
分类:
移动开发 时间:
2015-07-07 11:08:01
阅读次数:
253
1、代码2、运行1、代码 1 package main 2 3 import "fmt" 4 5 type Rect struct { 6 x, y float64 7 width, height float64 8 } 9 10 func (r * Rect) Area() f...
分类:
编程语言 时间:
2015-07-06 22:59:48
阅读次数:
180
I've been working for the past 15 months on repairing my rusty math skills, ever since I read a biography of Johnny von Neumann. I've read a huge stac...
分类:
其他好文 时间:
2015-07-06 15:34:47
阅读次数:
114
UIColor 转UIImage
- (UIImage*) createImageWithColor: (UIColor*) color
{
CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
UIGraphicsBeginImageContext(rect.size);
CGContextRef c...
分类:
其他好文 时间:
2015-07-05 16:55:50
阅读次数:
160
可用以下代码:UIGraphicsBeginImageContextWithOptions(size, opaque, scale);// code[view drawViewHierarchyInRect:rect afterScreenUpdates:YesOrNo];UIImage *imag...
分类:
移动开发 时间:
2015-07-05 07:02:39
阅读次数:
160