现在位置: 首页 > aiptek发表的所有文章
目前android版本早已经四4.xx了,5.0的版本也快出来了.  关于基本环境搭建有好多的文章都介绍过。 我在这里简单的整理了一下,就不用自己专门写此类的文章了. Android SDK 4.0.3 开发环境配置及运行     http://bk-lin.iteye.com/blog/1477808 android 4.0 for windows 7 开发环境搭建   http://cash.iteye.com/blog/1463253  Windows搭建Eclipse+JDK+SDK的Android      http://blog.csdn.net/sunboy_2050/article/details/6336480 Ubuntu搭建Eclipse+JDK+SDK的Android       http://blog.csdn.net/sunboy_2050/article/details/69......
阅读全文
  • 04月
  • 09日
综合 ⁄ 共 851字 评论关闭
大意不再赘述。 思路:比较简单,当前决策向下走或者上右走,状态方程也比较容易写出,边界条件也可以很好的写出来。 如果将问题扩展一下,要满足最短路径的路径条数呢?如果是多个人一起走,使得总的路程最小呢?动态规划还能有效地求解吗?留给大家思考哦。 #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <string> #include <algorithm> #include <ctype.h> using namespace std; const int MAXN = 400; bool G[MAXN][MAXN]; char str[M......
阅读全文
  • 01月
  • 07日
综合 ⁄ 共 1711字 评论关闭
调试服务器程序时最怕遇到需要运行10天半个月才遇到一次的bug,这种bug很难还原现场,同时还要时刻注意服务器是否挂掉。 本文给出一个解决方法可以极大的提高调试效率。 使用本文方法可以在断言失败时自动dump,可用于还原bug环境进行调试。另外崩溃时也会自动记录crash dump。 断言函数 bool xassert(bool r){ if(!r) __asm int 3 return r; } 最终异常处理函数,遇到这里的话说明程序只能挂掉了,写crash dump LONG WINAPI LastExceptionHandler(PEXCEPTION_POINTERS pEi){ auto h=CreateFile("crash.dmp",GENERI......
阅读全文
  • 12月
  • 22日
算法 ⁄ 共 2771字 评论关闭
A Mini Locomotive Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 2115   Accepted: 1173 Description A train has a locomotive that pulls the train with its many passenger coaches. If the locomotive breaks down, there is no way to pull the train. Therefore, the office of railroads decided to distribute three mini locomotives to each station. A mini locomotive can pull only a few passenger coaches. If a locomotive breaks down, three mini locomotives cannot pull all ......
阅读全文
  • 11月
  • 06日
综合 ⁄ 共 7224字 评论关闭
前言 本文翻译自TopCoder上的一篇文章: Dynamic Programming: From novice to advanced ,并非严格逐字逐句翻译,其中加入了自己的一些理解。水平有限,还望指摘。 前言_ 我们遇到的问题中,有很大一部分可以用动态规划(简称DP)来解。 解决这类问题可以很大地提升你的能力与技巧,我会试着帮助你理解如何使用DP来解题。 这篇文章是基于实例展开来讲的,因为干巴巴的理论实在不好理解。 注意:如果你对于其中某一节已经了解并且不想阅读它,没关系,直接跳过它即可。 简介(入门) 什么是动态规划,我们要如何描述它? 动态规......
阅读全文
  • 09月
  • 08日
综合 ⁄ 共 4184字 评论关闭
postgres ubuntu apt-get 数据源 sudo vim /etc/apt/source.list # deb cdrom:[Debian GNU/Linux 7.2.0 _Wheezy_ - Official amd64 CD Binary-1 20131012-14:05]/ wheezy main #deb http://mirrors.163.com/debian/ wheezy main non-free contrib #deb-src http://mirrors.163.com/debian/ wheezy main non-free contrib deb http://mirrors.sohu.com/debian/ stable contrib main non-free deb-src http://mirrors.sohu.com/debian/ stable contrib main non-free deb http://security.debian.org/ wheezy/updates ma......
阅读全文
  • 05月
  • 08日
综合 ⁄ 共 1678字 评论关闭
在ios8以前,我们想要进行ui实时调试,可以依赖的技术手段有:  用xcode启动app,然后点击xcode暂停运行按钮,然后在调试控制台输入下面语句: po [[UIWindow keyWindow] recursiveDescription] 然后就可以看到完整的UI结构和层级关系,类似如下: <UIWindow: 0x7b691cd0; frame = (0 0; 320 480); gestureRecognizers = <NSArray: 0x7b6921f0>; layer = <UIWindowLayer: 0x7b691e00>>    | <UIView: 0x7c078b30; frame = (0 0; 320 480); autoresize = W+H; autoresizesSubviews = NO; layer = <CALayer......
阅读全文
  • 04月
  • 18日
综合 ⁄ 共 5716字 评论关闭
errno.h 是C语言C标准函式库里的标头档,定义了透过错误码来回报错误资讯的宏:   errno宏定义为一个int型态的左值, 包含任何函式使用errno功能所产生的上一个错误码。   一些表示错误码,定义为整数值的宏:   EDOM 源自于函式的参数超出范围,例如sqrt(-1)   ERANGE 源自于函式的结果超出范围,例如strtol("0xfffffffff",NULL,0)   EILSEQ 源自于不合法的字符顺序,例如wcstombs(str, L"\xffff", 2)   查看错误代码errno是调试程序的一个重要方法。当linux C api函数发生异常时,一般会将errno变量(需includ......
阅读全文
  • 02月
  • 17日
综合 ⁄ 共 1201字 评论关闭
其实也没有什么,就拿mysql为例; 现在数据库建表, 让后写一个测试类 经本人测试绝对可用 import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; /** *在mysql数据库里成功测试,并且发现mysql的blob数据库不支持存储图片,只支持 *65535字节以下的本本数据存储。不过其他的大型数据库是支持储存图片的. */ public class InsertBlob {public static void main(String[] args) { try{File......
阅读全文
  • 02月
  • 12日
综合 ⁄ 共 702字 评论关闭
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"><mx:Script><![CDATA[public function getValue():void{v.text = DateField1.text;}public function initValue():void{DateField1.monthNames=["一月", "二月", "三月", "四月", "五月",     "六月", "七月", "八月", "九月", "十月", "十一月",     "十二月"];DateField1.dayNames=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];var d:Date = new Date();d.setF......
阅读全文
  • 02月
  • 12日
综合 ⁄ 共 62字 评论关闭
很早很早以前,我就用VSS了 很早以前,我就写测试用例了 但今天才传到VSS上,因为我的思维发生了变化:由单兵作战 想团体作战变化
阅读全文
  • 01月
  • 19日
综合 ⁄ 共 841字 评论关闭
题目大意:给出一棵树,将树中的一个节点去掉之后,这棵树会分裂成一些联通块,求去掉哪些点之后,所有联通块的大小不超过所有节点的一半,并按顺序输出。 思路:基础的子树统计问题,只要深搜一遍就可以出解。这个步骤和求树的重心很像,是树分治的基础。 CODE: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #define MAX 10010 using namespace std; int points; int head[MAX],total; int next[MAX << 1],aim[MAX << 1]; int size[MAX]; bool an......
阅读全文