摘要:MinaTimeServer.java Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package com.vista; import java.io.IOException; import java.net.InetSocketAddress;...
阅读全文
摘要:automake 所产生的 Makefile 除了可以做到程序的自动编译和链接外,还可以用来生成各种文档(如manual page、info文件),可以将源代码文件包装起来以供发布。所以程序源代码所存放的目录结构最好符合GNU的标准惯例。下面以hello.c程序生成Makefile文件作为例子。 1,在当前目录下创建一个名为hello的子目录。hello这个目录用于存放 hello.c这个程序及相...
阅读全文
摘要:1, 读写空指针 先看第一种情况,printf试图访问空指针,以打印出字符串,而sprintf试图向空指针写入字符串,这时,linux会在GNU C函数库的帮助下,允许读空指针,但不允许写空指针。 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#in...
阅读全文
摘要:1,文件的读写 0号文件描述符—标准输入,1号文件描述符—标准输出,2号文件描述符—标准错误 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include #include #include #include #include int ...
阅读全文
摘要:第2章Shell编程没什么多说的,记录个代码,本章最后的那个简单的CD管理程序 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#!/bin/sh # Very simple example shell script for managi...
阅读全文
摘要:1,第一个程序 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include int main() { printf("hello,linux\n"); return 0; } 编译运行: Code highlighting p...
阅读全文
摘要:1,到LumaQQ的官网下载LumaQQ 2006,将获得的tar包解压缩到/opt目录下 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->sudo tar –zxvf lumaqq_2006M2-linux_gtk2_x86_no_jre.tar.g...
阅读全文
摘要:以tree实用程序(以树型结构获取目录树)为例,介绍Ubuntu中如何管理源码包,包括查询,获取,编译源码包,直至安装。 1) 在获取源码包之前,确保在软件源配置文件/etc/apt/sources.list中添加了deb-src项 2) 使用如下命令获取tree源码包的详细信息: Code highlighting produced by Actipro CodeHighlighte...
阅读全文
摘要:看来看去还是这本最实在,没有过多花哨的东西,带着小任务一步步教你上手Ubuntu,适合我这样的新手。
阅读全文
摘要:早上一打开虚拟机登录Ubuntu时,就遇到两个问题,
1)开机进入登录界面,输入用户名、密码回车后提示:“用户的$home/.dmrc已被忽略,这将无法保存默认会话和语言。该文件应该由用户所有,并且权限设置为644。用户的$home目录应由用户自己所有,别的用户也无法写入。”
2)登录进去后,Ubuntu的任务栏不见了。
阅读全文
摘要:项目主页:http://azureus.sourceforge.net/ 原理:节点选择所需要的信息都已经被内容分发网络(CDN)给收集好了,CDN使用动态DNS将用户请求引导到低延时的备份服务器处。 作者认为若两个用户被定向到一组相似的备份服务器,也就说明它们离此服务器很近,进而说明两者之间也很近。这种基于CDN的信息能减少跨ISP的流量。 和上一篇的思路不同,不需要新的网络设施,不依赖ISP和...
阅读全文
摘要:P2P文件共享和流媒体系统,内容分发,减轻服务器负载,VoD在用户共享视频内容方面同步很少,因此更难。需要每个节点贡献出一些硬盘空间(1GB)。新的内容复制,内容发现的调度机制。 VoD和其他流媒体播放系统不同的地方在于每个节点可以在同一时间观看影片的不同部分,从而减小了相互之间的协助性,因此需要每个节点贡献出一些硬盘,而不是只贡献出一些播放缓冲区。从某种意义上看,就成为一...
阅读全文
摘要:网络上的p2p流量控制,确保客户方与服务提供方资源的有效,公平利用。对于传统的TCP应用,ISP可以控制TCP的网络反馈包来控制流量,但对于P2P应用的控制则麻烦的多。 作者提出需要ISP和P2P应用携手合作来解决流量控制问题,通过他们提出的P4P框架建立一个信息门户来为两者提高当前网络的信息,比如拓扑结构,拥塞率等。可以将这个门户作为第三方提供,ISP和P2P应用都从它获取网络信息,实现可以使用...
阅读全文
摘要:Hiweed GNU/Linux 是基于 Debian 和 Ubuntu 构建;Hiweed Linux 是一个由国人制作的一个 Linux 发行版,Hiweed Linux 基于 Ubuntu 8.10 ,可以说 Hiweed Linux 是一个中文本土化的 Ubuntu ,相对比 Ubuntu 上手更容易,免去了安装 Ubuntu 后的一系列的“汉化”过程。
阅读全文
摘要:题目描述:鱼的种类有多种,但有些鱼会互相攻击对方,在给定一定数目的钱时,怎么买尽可能多的鱼,并且要求找出在买的鱼数目相同的情况下所花的钱是最多的一个方案。 测试用例 输入 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1000 10 10 78 9...
阅读全文
摘要:这道题最难的地方是当一种药和它的一个后续药品出现后,如何防止其他的后续药品在搜索中出现,因为搜索的时候是按位置顺序探测的,所以位置不是相邻的时候,从下一层回退回来并不知道前面已经有这样的状态。剪枝的条件应该还有,我这个代码还是很慢。 测试用例: 输入: Code highlighting produced by Actipro CodeHighlighter (freeware)htt...
阅读全文
摘要:题目描述:有一个k(1≤k≤80)位的十进制正整数n,设计一个程序,找到满足条件:P3+ P2+3P≤n的P的最大值。 测试用例: 输入: 1000000000000001000000000000003000000000000001 输出: 100000000000000 Code highlighting produced by Actipro CodeHighlighter (free...
阅读全文
摘要:接着上一篇《论文阅读笔记(一)》,继续记录《The Google File System》的阅读体会: (16)主节点在启动时轮询各个子节点上包含的数据块信息,这通过正向心跳包来实现。这样做的好处是避免了主节点和子节点的信息同步问题,因为子节点的信息是随时在动态变化的,并且只有子节点才对它包含的数据块信息有话语权。 (17)操作日志包含了关键元数据更改的历史记录,定义了并发操作的逻辑时序。因此必须...
阅读全文
摘要:读完《The Google File System》,记录下学习心得: (1)组件的失效是经常的事情,GFS把这放在考虑的首位,持续性的系统监控,错误检测, 容错机制,自动恢复至关重要。 (2)读写的文件巨大,I/O操作机制和数据块的大小要重新审视,应以MB计。 (3)对文件的互斥操作主要是数据追加,而非覆写,对文件的随机写几乎不存在。文件一旦写操作完成后,后续就只是进行顺序的读操作。因此,数据追...
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include #include #include using namespace std; class decnum { friend decnum pow(const decn...
阅读全文
摘要:一个4×5的棋盘,输入马的起始坐标,求马能返回初始位置的所有不同走法的总数(马走过的位置不能重复,马走“日”字)。 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->#include using namespace std; c...
阅读全文
摘要:MFC里的静态拆分窗口是一种很有意思的效果,但它们毕竟不是独立的窗口,还框在一个大窗口中, 那么要使用真正完全独立的窗口怎么做呢?本文参考侯捷的《深入浅出MFC》的第13章的思路,实现了多个独立的视图窗口,代码如下: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHig...
阅读全文
摘要:本文是整个系列文章的最后一篇,将创建一个完整的虚拟office应用程序(如图所示)来做为ending. 1,在CCY457OpenGLView类中加入下述变量,用来保存office内各个物体的显示列表 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter...
阅读全文
摘要:本文将介绍如何从Obj文件格式中创建3D对象,我们使用的是Nate Miller的obj格式加载类。 This would be very useful to create large Virtual Reality applications as we could make use of the readily available 3D model files or make ...
阅读全文
摘要:Shadows Conceptually drawing a shadow is quite simple. A shadow is produced when an object keeps light from a source from striking some object or surface behind the object, casting the shad...
阅读全文
摘要:Reflections Adding reflections to a program too can improve its realism to a great extent. Here we'll look at a simple method to create reflection where we simply redraw the object with an appropr...
阅读全文
摘要:Selection Selection is a powerful feature of OpenGL that allows you click at some position of the OpenGL window using the mouse and determine which of your objects lie beneath it. The act of selecting...
阅读全文
摘要:本文在第11篇文章的基础上,为其加入显示各种二次曲面的代码; Quadrics Every quadric has a few settings associated with it. We have to create a quadric first and then customize its settings to render the shape we want. ...
阅读全文
摘要:wglUseFontBitmaps函数 The wglUseFontBitmaps() function creates a set of bitmap display lists based on the glyphs in the currently selected font in the current DC for use in the current OpenGL RC. It bas...
阅读全文
摘要:本文对第11篇文章进行修改,使用显示列表来存储渲染命令。 显示列表 OpenGL provides a facility to create a preprocessed set of OpenGL commands called a display list. Creating a display list is a straight forward process. We jus...
阅读全文
摘要:Blending and Transparency Blending in OpenGL provides pixel-level control of RGBA color storage in the color buffer. To enable blending we must first call glEnable(GL_BLEND). We have to set up the ble...
阅读全文
摘要:本文在第9篇文章的基础上,为立方体加入纹理映射的功能。 Texture Mapping Texture Mapping in OpenGL is a fairly straightforward concept. Every texture is nothing but an image of some sort. Texture mapping is basically applyin...
阅读全文
摘要:本文在第8篇文章的基础上,为其加入灯光效果。 Materials OpenGL materials are description of what objects are made of. It basically specifies how much of light they reflect and this is what we would be seeing. OpenGL li...
阅读全文
摘要:OpenGL支持两种颜色模式:RGBA和颜色索引模式,本文关注于前者。 Smooth Shading and Flat Shading When Smooth Shading is specified, the color values are interpolated between vertices. If Flat Shading is specified, one verte...
阅读全文
摘要:本文中将对第5篇文章的太阳系模型进行修改,加入一些动画效果。此外还会加入显示帧速率的代码。 加入动画效果最容易的方法是响应WM_TIMER消息,在其消息处理函数中改变一些参数值,比如每过多少毫秒就旋转一定的角度,并且重绘场景。 Frame Rate Frame rate is nothing but the number of frames that can be ren...
阅读全文
摘要:在上一篇的基础上加入对键盘和鼠标的事件处理程序,以便用其来控制3D物体的旋转和移动。 1,首先在CCY457OpenGLView类中为WM_KEYDOWN, WM_LBUTTONDOWN, WM_LBUTTONUP 和 WM_MOUSEMOVE四个事件加入事件处理函数。 2,在CCY457OpenGLView.h中加入下列用于控制旋转和移动的变量: Code highlighti...
阅读全文
摘要:Transformations - Translation, Rotation and Scaling Translation is nothing but moving along an arbitrary axis. Rotation is spinning about an arbitrary axis. Scaling is increase or decrease in size alo...
阅读全文
摘要:视见体 Viewing Volume is nothing but the region of 3D Cartesian space in that will occupy the window. It is nothing but the minimum and maximum x, y and z values that are inside the window. So if a verte...
阅读全文
摘要:剪裁区域 In OpenGL when you create a window to draw in we must specify the coordinate system we want to use and how to map the specified coordinates into physical screen coordinates. We would be usin...
阅读全文
摘要:源代码下载:OpenGL_ch2.rar WGL – Windows的 OpenGL扩展层 The WGL extension consists of a set of functions (wglCreateContext, wglDeleteContext etc.) and structures (such as PIXELFORMATDESCRIPTOR, GLYPHMETRICSF...
阅读全文
摘要:3D图形学基本概念PerspectivePerspective refers to the angles between the lines that lend the illusion of three dimensions. Colors and ShadingMoving beyond line drawing, we need to add color to create a solid object. Shading refers to the way the color is applied to the polygon. Shading can be of two types i
阅读全文
摘要:想不服都不行,实在是太牛的代码,诡异的算法思路,出神入化的STL技巧。。。
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->#include #include #include #include using namespace std; struct Movie { string name;//电影...
阅读全文
摘要:以前用递归的回溯搜索思路做过一次,参见ZOJ1002 Fire Net(递归版),今天想着用非递归的方法试试看,呵呵,比我想象中要难啊,主要还是堆栈里究竟放什么,这一点上思路一直没理清。因此用了整整一天的时间,总算用非递归的方法把1002给AC掉了,在代码中我引入了堆栈层次的概念,模拟系统堆栈的行为,并且在搜索时加入了剪枝,但代码写得还是很烂,继续思考如何改进。
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->#include #include using namespace std; const int MAXSIZE = 8;//棋盘大小 int chess[MAXSIZE][MAXSIZE]={0}...
阅读全文