现在位置: 首页 > geist发表的所有文章
  • 11月
  • 12日
综合 ⁄ 共 9021字 评论关闭
This is now out-of-date. There will be a new version as part of #1683. Cesium is a client-side virtual globe and map library written in JavaScript using WebGL. The Cesium stack is coarsely organized and composed of four layers: Generally, each layer adds functionality, raises the level of abstraction, and depends on the layers underneath it. The layers are: Core - number crunching like linear algebra, intersection tests, and interpolation. Renderer - a thin abstraction over WebGL. S......
阅读全文
  • 08月
  • 04日
综合 ⁄ 共 851字 评论关闭
PyQt4学习资料汇总 一个月前研究了下PyQt4,感觉比较不错。相比wxpython,界面美观了很多,并且将界面设计与代码逻辑很好的分离了开来。关于PyQt4的资料也不少,这里我将我找到的资料汇总一下,以防自己以后忘得一干二净。 1.PyQt4资料链接  http://www.riverbankcomputing.com   http://wiki.woodpecker.org.cn/moin/PyQt  http://www.commandprompt.com/community/pyqt/book1  http://wiki.python.org/moin/PyQt  http://code.google.com/p/pyqt-doc-cn/ 2. 写代码时,最好的帮助文档:  http://www.riverbankcomputing.com/stat......
阅读全文
  • 04月
  • 24日
综合 ⁄ 共 990字 评论关闭
1. gcc -E source_file.c -E,只执行到预编译。直接输出预编译结果。 2. gcc -S source_file.c -S,只执行到源代码到汇编代码的转换,输出汇编代码。 3. gcc -c source_file.c -c,只执行到编译,输出目标文件。 4. gcc (-E/S/c/) source_file.c -o output_filename -o, 指定输出文件名,可以配合以上三种标签使用。 -o 参数可以被省略。这种情况下编译器将使用以下默认名称输出: -E:预编译结果将被输出到标准输出端口(通常是显示器) -S:生成名为source_file.s的汇编代码 -c:生成名为source_file.o的目标文件。 无标签情况:......
阅读全文
  • 02月
  • 17日
综合 ⁄ 共 2538字 评论关闭
Circle Time Limit: 2000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 You have been given a circle from 0 to n - 1. If you are currently at x, you will move to (x - 1) mod n or (x + 1) mod n with equal probability. Now we want to know the expected number of steps you need to reach x from 0. 输入 The first line contains one integer T — the number of test cases.   Each of the next T lines contains two integers n, x (0  ≤ x < n ≤ 1000) as we mention above. 输出 For each test ......
阅读全文
  • 02月
  • 17日
综合 ⁄ 共 3690字 评论关闭
Problem Description Yesterday, my teacher taught me about bit operators: and (&), or (|), xor (^). I generated a number table a[N], and wrote a program to calculate the matrix table b[N][N] using three kinds of bit operator. I thought my achievement would get teacher's attention. The key function is the code showed below. There is no doubt that my teacher raised lots of interests in my work and was surprised to my talented programming skills. After deeply thinking, he came up with ......
阅读全文
  • 12月
  • 30日
综合 ⁄ 共 607字 评论关闭
   简单的树状数组题,题意:统计这个star左下角star的个数, 就是这个star的level。现在要你总计图中level从0到N-1的star 分别有多少个?因为数据是输入的坐标是按Y的升序、如果Y相等, 则按X的升序。所以我们发现我们可以完全忽略Y,只要统计小于 本身X的star个数,就是level了.  #include<stdio.h> #include<string.h> int c[32002],val[15011]; void update(int k,int dir)//改变第K项的值 { while(k<32002) { c[k]+=dir; k+=k&(-k);//从C[k]往根节点一路上溯 } } int sum(int k) { int sm=0; w......
阅读全文
  • 11月
  • 05日
综合 ⁄ 共 1212字 评论关闭
1 关于节点数: 所谓节点数、即每个rs-485接口芯片的驱动器能驱动多少个标准rs-485负载、根据规定、标准rs-485接口的输入阻抗为≥12kω、相应的标准驱动节点数为32、为适应更多节点的通信场合、有些芯片的输入阻抗设计成1/2负载(≥24kω)、1/4负载(≥48kω)甚至1/8负载(≥96kω)、相应的节点数可增加到64、128和256、 下列为常用的一些驱动ic比较: 型 号 32个节点: sn75176、sn75276、sn75179、sn75180、max485、max488、max490 64个节点: sn75lbc184 128个节点: max487、max1487 256个节点: max1482、max1483、max3080~max308......
阅读全文
  • 10月
  • 14日
综合 ⁄ 共 3119字 评论关闭
状态空间搜索。。不过状态数量比较多,很容易TLE 优化的方法: 1、压缩状态 因为地图最大16*16,所以可以用0-255来标记每一个格子,很轻松的将二维坐标变为一个整数 2、使用邻接表 如果每次都使用“尝试走一步看看行不行”的方法,会重复很多次无用的判断。所以用一个vector来保存每个空地相邻的空地,每次走路就遍历这个vector 3、判重的方法 一开始我用了State类型的map来判重,速度很慢。而使用整数来标记格子后,可以用一个三维数组(因为最多有三个ghost)进行判重,我自己测试时的速度就由20s提升到了1s 很搞笑的是我用普通b......
阅读全文
  • 09月
  • 14日
综合 ⁄ 共 488字 评论关闭
View Code 1 interface A{ 2 public String AUTHER="Mihchael"; 3 public void printA(); 4 } 5 interface B{ 6 public void printB(); 7 } 8 interface C extends A,B{ 9 public void printC();10 }11 class X implements C{12 public void printA(){13 System.out.println("A....");14 }15 public void printB(){16 System.out.println("B.....");17 }18 public void printC(){19 System.out.println("C......");20 }21 }22 public class test1 {23 pub......
阅读全文
  • 05月
  • 01日
综合 ⁄ 共 1734字 评论关闭
先说说断点续传的原理:这是HTTP 1.1协议的一部分,并不需要客户端特意去做多么复杂的事情。以前我曾经看过一个单位的技术标书,其中有下载的断点续传这一要求,给出的offer居然还挺高的... 简单的说,只要利用了HTTP协议 (http://www.ietf.org/rfc/rfc2616.txt )中的如下字段来和服务器端交互,就可以实现文件下载的断点续传: Range : 用于客户端到服务器端的请求,可通过该字段指定下载文件的某一段大小,及其单位。典型的格式如: Range: bytes=0-499 下载第0-499字节范围的内容 Range: bytes=500-999  下载第500-999字节......
阅读全文
  • 03月
  • 21日
综合 ⁄ 共 1918字 评论关闭
linux真是太强大了。 查看ubuntu的资源占用的命令为$: top top命令就可以查看内存,cpu和进程了,很方便 top: 主要参数 d:指定更新的间隔,以秒计算。 q:没有任何延迟的更新。如果使用者有超级用户,则top命令将会以最高的优先序执行。 c:显示进程完整的路径与名称。 S:累积模式,会将己完成或消失的子行程的CPU时间累积起来。 s:安全模式。 i:不显示任何闲置(Idle)或无用(Zombie)的行程。 n:显示更新的次数,完成后将会退出to 显示参数: PID(Process ID):进程标示号。 USER:进程所有者的用户名。 PR:进程的优......
阅读全文
  • 02月
  • 01日
综合 ⁄ 共 1853字 评论关闭
程序设计风格 1.最终目的是设计一个好的软件; 好软件的标准: 一,正确性-能完成需求中的所有要求; 二,可扩展性-易于修改; 三,高效的数据结构与算法; 四,易读性; 五,可移植性等; 大道至简。 2.变量名,宏定义,见名知义 3.空格和缩进 一致性和习惯用法 4. If(i==0){ //TODO } 尽量用If()else if() else{} 而非switch(){case 1: break;//fall through};case0:case 1:case2: ;;;break; 5.enum,const,#define 代替魔数。 6.注释;简单而不过分简单; 7.数据结构与算法 最基本的:基本检索和排序; 8.界面  在进行设计的时候......
阅读全文