常见系统数据文件
下表列出了常见的系统数据文件及其查找函数。
以/etc/passwd文件为例,读取数据的程序框架如下:
void get_pw_entry()
{
struct passwd *ptr;
setpwent();
while ((ptr = getpwent()) != 0) {
……
}
endpwe...
分类:
其他好文 时间:
2014-05-07 08:46:54
阅读次数:
341
对于边比较稠密的图,可以采用邻接矩阵(以顶点为中心)的方式表示,而边比较稀疏时,采用邻接表的结构更合适。两种都不能直观表达哪两个点相连或者最短路径是什么。
深度优先遍历类似于树的先根序遍历。与树不同的是,它需要对已经访问过的节点添加标记以免被重复遍历。
public class Depth {
/**
* 对k号节点深度遍历
* @param a
* @param col...
分类:
其他好文 时间:
2014-05-07 08:02:01
阅读次数:
293
在zigbee规范中,引入了profile, cluster的概念。具体说来,假设规范一个profile(可以理解成一套规定),这个profile用来规范智能家居领域的相关产品都要满足那些要求,那么home automation public profile就规定了智能家居都要做什么。当然了,你可以自己规范一个自己的profile,称为provite profile,而zigbee联盟则已经规范了...
分类:
其他好文 时间:
2014-05-07 07:45:25
阅读次数:
249
Action代码: public function index(){
$prod = I("get.prod_en");
$id = I("get.id", 0, "int");
if ($prod == ""){
$serviceProduct = array();//多重循环遍历的数组 //数据保存在两张表中,这里通过循环初始化$serviceProduct数组...
分类:
Web程序 时间:
2014-05-07 07:13:02
阅读次数:
440
#include
using namespace std;
class Base
{
public:
Base(){base = 1; cout
virtual ~Base(){cout
virtual void say(){cout
private:
int base;
static int count;
};...
分类:
编程语言 时间:
2014-05-07 06:59:24
阅读次数:
302
测试结果是private和public两种情况是不同的。...
分类:
其他好文 时间:
2014-05-07 06:20:37
阅读次数:
218
package com.grace.test;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class showDate {
pu...
分类:
编程语言 时间:
2014-05-07 04:56:51
阅读次数:
336
#include
using namespace std;
//汉罗塔递归求解函数 从a移到c
void move(int m,char a,char c);
void hanoi(int n,char a,char b,char c)
{
if(1==n)
{
move(n,a,c);
return;
}
hanoi(n-1,a,c,b);
move(n,a,c);
hano...
分类:
其他好文 时间:
2014-05-07 03:24:14
阅读次数:
228
using UnityEngine;
using System.Collections;
public class moive : MonoBehaviour {
public MovieTexture movTexture;
public GameObject moive_texture;
public GameObject quan_bt;
public GameObject...
分类:
其他好文 时间:
2014-05-07 03:13:16
阅读次数:
426
如果有下面的一个笔试题:
已知我们有如下的调用关系
logIt(”log message 1 “);
logIt(”log message2”,"log message3”);
logIt(”log message4”,"log message5”,"log message6");
请问下面的答案中哪个是正确的
A. public void logIt(String * ms...
分类:
编程语言 时间:
2014-05-06 15:34:03
阅读次数:
290