摘要: Command-basedImmediate modeDisplay listsArray-basedVertex arrayVertex buffer objects1. Immediate modeglBegin(GL_TRIANGLES)glColor3f(0, 1, 1)glVertex3f(0, 0, 0)#...glEnd()● Very slow; for each function call:– argument marshalling– C function call– glGetError handling● ...millions of vertices in a sce 阅读全文
posted @ 2011-07-15 18:56 我的小屋子 阅读(130) 评论(0) 推荐(0) 编辑
摘要: View Code 1 import pygame$ 2 from OpenGL.GL import *$ 3 $ 4 def initGL():$ 5 glClearColor(0.0, 0.0, 0.0, 0.0)$ 6 $ 7 def resizeGL((w, h)):$ 8 glViewport(0, 0, w, h)$ 9 $10 def paintGL():$11 glClear(GL_COLOR_BUFFER_BIT)$12 glBegin(GL_TRIANGLES)$13 # vertices here$14 $15 pygame.init()$16 pygame.displa 阅读全文
posted @ 2011-07-15 18:22 我的小屋子 阅读(175) 评论(0) 推荐(0) 编辑
摘要: for x in arange(-10.0, 10.0, 0.04): for y in arange(-10.0, 10.0, 0.04): r = cos(x) + sin(y) glColor3f(cos(r*y), cos(x*y*r), sin(x*r)) glBegin(GL_POINTS) glVertex2f(x, y) glEnd() glFlush看,神奇吧! 阅读全文
posted @ 2011-07-11 18:25 我的小屋子 阅读(135) 评论(0) 推荐(0) 编辑
摘要: echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_allwhen ping response is disabled, others cannot ping you, but you can ping others.to enable ping response:echo 0 > ...to make it default, add the below line to /etc/sysctl.confnet.ipv4.conf.icmp_echo_ignore_all = 1 阅读全文
posted @ 2011-07-08 13:53 我的小屋子 阅读(146) 评论(0) 推荐(0) 编辑
摘要: # gcc -c hello.c# ar cr libmyhello.a hello.o# gcc -shared -fPCI -o libmyhello.so hello.o将库与程序链接:gcc -o hello main.c -L. -lmyhello 阅读全文
posted @ 2011-07-08 13:52 我的小屋子 阅读(121) 评论(0) 推荐(0) 编辑
摘要: example 1:string str("Hello, world!");BOOST_FOREACH(char c, str){ cout << c;}它相当于:string str("Hello, world!");for(int i = 0; i < str.length(); ++i){ char c = str[i]; cout << c;}example 2:int arr[] = {1, 3, 5, 2, 0};BOOST_FOREACH(int & a, arr){ ++a; ....}arr中的值被 阅读全文
posted @ 2011-07-08 13:49 我的小屋子 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Network scanning is the process of discovering active hosts on the network andinformation about the hosts, such as operating system, active ports, services, andapplications. Network scanning is comprised of the following four basic techniques:■ Network MappingSending messages to a host that will gen 阅读全文
posted @ 2011-07-08 13:48 我的小屋子 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 模式切换vim有三种工作模式,编辑模式,命令模式,和行末模式。编辑模式进入行末模式: 按Esc进入命令,然后冒号进入行末模式命令模式进入编辑模式: 按a(在当前字符后面插入光标)、按i(前面)命令模式:h -- 光标向左移一个字符l -- 向右移一个字符j -- 向下移一个字符k -- 向上移一个字符0 -- 到行首$ -- 到行末w -- 到下一个wordb -- 到前一个word1G -- 到文件首G -- 到文件末u -- 撤销上一次修改Ctrl+r -- 恢复上一次修改dd -- 删除一行dw -- 删除一个wordx -- 删除一个字符cw -- 修改一个wordr -- 修改一个字 阅读全文
posted @ 2011-07-08 13:46 我的小屋子 阅读(105) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;template<typename T, size_t n>void printValues(T (&arr)[n]){ for(size_t i = 0; i < n; ++i) { cout << arr[i] << ' '; } cout << endl;}int main(){ int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; printValues(a);} 阅读全文
posted @ 2011-07-08 13:44 我的小屋子 阅读(91) 评论(0) 推荐(0) 编辑
摘要: If a class is derived using private or protected inheritance, then user code may not convert an object of derived type to a base type object.why?Because when using private or protected inheritance, access to the members of the base part of the derived object may become more restrictive than the base 阅读全文
posted @ 2011-07-08 13:41 我的小屋子 阅读(139) 评论(0) 推荐(0) 编辑