(1)主要用了paint ,canvas 两个类中的方法
(2)主要用了画线和画圆的方法。
(3)drawline(起始点轴坐标,起始点y轴坐标,终点轴坐标,终点y轴坐标)
(4)drawcircle(圆心x轴坐标,圆心y轴坐标,半径,画布)
效果图:
直接上代码了:
package com.example.drawpicture;
import android.conten...
分类:
移动开发 时间:
2014-04-27 22:44:20
阅读次数:
364
主调函数分配内存块;在被调用函数中使用;
//写一个函数,;写一个主函数,用被调用函数,求出字符串1.在字符串2中间出现过几次!
#define _CRT_SECURE_NO_WARNINGS
#include"stdio.h"
#include"stdlib.h"
#include"string.h"
char mycount(char *myp, char *mysub, int *n)
{
...
分类:
其他好文 时间:
2014-04-27 22:33:20
阅读次数:
325
1.虚函数在类内部声明,形式为:
virtual (形参列表)
虚函数的声明比普通函数多一个virtual,公有派生类中可以省略virtual关键字,派生类中重写虚函数,必须要求返回值类型形参列表一致,否则会发生同名覆盖。派生类只有在公有继承的方式继承基类时,才会有虚函数的正常使用。使用虚函数的例子:
# include
using namespace std;
# include...
分类:
其他好文 时间:
2014-04-27 22:22:20
阅读次数:
273
题目链接:http://acm.fzu.edu.cn/problem.php?pid=2170
贴个baka爷的代码留念。。
数据出的有问题,输入的字符串长度不超过1000
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define inf 0x3f3f3f...
分类:
其他好文 时间:
2014-04-27 22:16:18
阅读次数:
359
#define _CRT_SECURE_NO_WARNINGS
#include"stdio.h"
#include"stdlib.h"
#include"string.h"
/*
键值对(”key = valude”)字符串,在开发中经常使用
要求1:请自己定义一个接口,实现根据key获取valude;40分
要求2:编写测试用例。30分
要求3:键值对中间可能有n多空格,请去除空格30分
注意...
分类:
其他好文 时间:
2014-04-27 22:11:20
阅读次数:
488
头文件:
#import
#import
@interface DirectionRouteUtils : NSObject
{
MKDirections *mDirections;
CLGeocoder *mGeocoder;
}
+ (instancetype)sharedInstance;
// 获取导航路线
- (void)findDirectionsFro...
分类:
移动开发 时间:
2014-04-27 21:35:59
阅读次数:
558
微软bing搜索每天都会换一张壁纸,而且分辨率都高,很适合当做壁纸,写了一个python去获取张壁纸,代码很简单
import urllib
import re
import time
def getHtml(url):
return urllib.urlopen(url).read()
def getImgUrl(html):
reg=re.compile(r'(http:/...
分类:
编程语言 时间:
2014-04-27 21:31:06
阅读次数:
558
上篇博客利用Hibernate搭建起一个简单的例子,把数据库的映射显示了出来在上一篇的博客基础上这篇博客讲述如何利用Hinbernate框架实现简单的数据库操作。
1、加入junit.jar
2、新建一个工具类HibernateUtils.Java把一些对session的公共操作封装起来
import org.hibernate.Session;
import org.hibernate.S...
分类:
系统相关 时间:
2014-04-27 21:23:59
阅读次数:
485
我们一般切换UIViewController的时候用的是如下代码
#import "UIViewControllerDemo.h"
UIViewControllerDemo *vc = [UIViewControllerDemo alloc] initWithNibName:nil bundle:nil] autorelease];
[self.navigationController pushViewController:vc animated:YES];...
分类:
其他好文 时间:
2014-04-27 21:21:00
阅读次数:
294
解题思路:
高数上的三重积分。注意:PI的精度要大些,一开始用的3.1415926通不过,精度太小,后来百度3.1415926535898。还有浮点数的除法记得*1.0。
题目中的oc = ob这条信息特别关键。
代码:
#include
#include
#include
#include
using namespace std;
#define pi 3.1415...
分类:
其他好文 时间:
2014-04-27 21:18:00
阅读次数:
387