现在位置: 首页 > kamoulmomeree发表的所有文章
  • 02月
  • 12日
综合 ⁄ 共 1502字 评论关闭
pushup函数写成lson.mins < rson.cnt,于是我又以WA屠版了。。。T^T #include <iostream> #include <stdlib.h> #include <stdio.h> #include <string.h> #include <algorithm> #include <map> using namespace std; const int maxn = 100010; int s[maxn]; int n, t; template <class T> char scanf(T *x) { (*x) = 0; char ch = getchar(); while(ch < '0' || ch > '9') { ch = getchar(); if(ch == EO......
阅读全文
  • 10月
  • 12日
综合 ⁄ 共 949字 评论关闭
求点阵上取3点组成的三角形内部的点数,利用PICK定理 PICK定理:平面上以格子点为顶点的简单多边形的面积=边上的点数/2+内部的点数-1 这样只要利用叉积求出三角形面积,在利用gcd求出边上点数,就可以计算了 代码: #include <cstdio> #include <cstring> #include <algorithm> using namespace std; struct Point { int x, y; Point() {} Point(int x, int y) { this->x = x; this->y = y; } void read() { scanf("%d%d", &x, &y); } } p[5];......
阅读全文
  • 09月
  • 27日
综合 ⁄ 共 76字 评论关闭
如果图片本身就有白色的边框, 可以利用word本身提供的剪切功能来实现。(视图—工具栏—图片—修剪) wps也类似,调出工具栏中的图片找到修剪的那个就可以了
阅读全文
  • 05月
  • 28日
综合 ⁄ 共 9719字 评论关闭
String odsStr = "测试"; String newStr = new String(odsStr.getBytes("GBK"), "ISO8859_1");   首先需要说明一下我们经常用到的字符集,有ISO8859-1,GB2312,GBK,GB18030,UNICODE。这里ISO8859-1字符集只 包含英文字符,使用一个字节存储。GB2312、GBK和GB18030字符集包含中文字符,他们都兼容ISO8859-1字符集,他们的字符存储格式是变长的,其中GB18030包含GBK,GBK包含GB2312。UNICODE包含世界上所有国家的字符,UNICODE又分为UTF-8,UTF-16和UTF-32三种,UTF-8是变长字符集,它兼容ISO8859-1,即英文字符使用一个字节编......
阅读全文
  • 05月
  • 14日
综合 ⁄ 共 1257字 评论关闭
最近在论坛看到有人问,如何快速生成100万不重复的8位编号,对于这个问题,有几点是需要注意的: 1.    如何生成8位随机数,生成的数越随机,重复的可能性当然越小 2.    控制不重复 3.    考虑性能 针对这个问题,我写了如下的示例来解决,希望能为有这类需求的人提供指导   生成100万条8位不重复数据的示例 USE tempdb GO   -- 创建测试表 CREATE TABLE tb(id char(8))   -- 创建用于自动过滤重复值的唯一索引 CREATE UNIQUE INDEX IX_tb ON tb(id) WITH IGNORE_DUP_KEY GO   -- 测试数据插入的处理时间, 记录开始处理的......
阅读全文
  • 03月
  • 21日
综合 ⁄ 共 3434字 评论关闭
1.      如何绘制一个字符串 一般使用CCLabelTTF 四个步骤: 1)初始化 CCLabelTTF *pLabel = CCLabelTTF::create(“Hello Cocos2d-x”, “Arial” , 24); 参数1:字符串内容 参数2:字体 参数3:字符串的大小    2)检查CC_BREAK_IF();       CC_BREAK_IF(!pLabel);   //判断指针pLabel 是否创建成功,否则break    3)设置坐标点       CCSize size = CCDirector::SharedDirector()->getWinSize();       pLabel->setPosition(ccp(size.width/2 , size.height-50));    注:ccp为一个点的类    补充:CCDirector 导演类,整体框架......
阅读全文
  • 02月
  • 02日
综合 ⁄ 共 1674字 评论关闭
#import <QuartzCore/QuartzCore.h> 一、给图片加上阴影  UIImageView*pageContenterImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"onePageApple.png"]]; //添加边框 CALayer*layer = [pageContenterImageView layer]; layer.borderColor= [[UIColor whiteColor]CGColor]; layer.borderWidth=0.0f; //添加四个边阴影 pageContenterImageView.layer.shadowColor= [UIColor blackColor].CGC......
阅读全文
  • 01月
  • 26日
综合 ⁄ 共 3779字 评论关闭
获取视频文件:         ContentResolver contentResolver = mContext.getContentResolver();        String[] projection = new String[]{MediaStore.Video.Media.TITLE};        Cursor cursor = contentResolver.query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, projection,                 null, null, MediaStore.Video.Media.DEFAULT_SORT_ORDER);        cursor.moveToFirst();        int fileNum = cursor.getCount();               for(int counter = 0; counter < fileNum; counter++){                    L......
阅读全文
  • 01月
  • 12日
综合 ⁄ 共 2509字 评论关闭
 The Falling Leaves  Each year, fall in the North Central region is accompanied by the brilliant colors of the leaves on the trees, followed quickly by the falling leaves accumulating under the trees. If the same thing happened to binary trees, how large would the piles of leaves become? We assume each node in a binary tree "drops" a number of leaves equal to the integer value stored in that node. We also assume that these leaves drop vertically to the ground (thankfully, there's no ......
阅读全文
  • 12月
  • 24日
综合 ⁄ 共 4247字 评论关闭
1.配置JDK6 (1)root身份编辑sources.list文件:sudo gedit  /etc/apt/sources.list (2)在sources.list文件末尾添加如下源:deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse (3)保存sources.list后在终端进行更新操作:sudo apt-get update (4)执行如下命令安装jdk6:apt-get install sun-java6-jdk。 或者如下: $ sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse" $ sudo apt-get update $ sudo apt-get install sun-java6-jdk 2.安装工具包   sudo apt-get install ......
阅读全文
  • 12月
  • 19日
综合 ⁄ 共 302字 评论关闭
import java.util.ArrayList; import java.util.Iterator; public class generic { public static void main(String[] args){ //尖括号指定操作的数据类型 ArrayList<String> s = new ArrayList<String>(); s.add("abc1"); s.add("abc2"); s.add("abc4"); Iterator<String> it = s.iterator(); while(it.hasNext()){ String str = it.next(); System.out.println(str); } } }
阅读全文
  • 12月
  • 18日
综合 ⁄ 共 5829字 评论关闭
原文链接: http://apps.hi.baidu.com/share/detail/16825793 其他有用的链接: http://wenku.baidu.com/view/da862b175f0e7cd184253692.html     Matlab的符号运算总结-m文件 http://blog.chinaunix.net/u1/37798/showart_453835.html Matlab的符号运算功能强大,看了些资料,都比较啰嗦,然后再次总结为一个m文件测试大部分符号运算功能   %% 符号变量与符号表达式%%%%%%%%%%%%%%%%%%%%%%%%%%%%1.符号变量与符号表达式%%%%%%%%%%%%%%%%%%%%%%%%%%%clear all ;clc;close all;% f =sym( 'sin(x)+5x')% f —— 符号变量名% sin(x)......
阅读全文