孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 26 下一页

2011年5月27日

摘要: 类属性算法swap_ranges的作用是交换连个区间中的值,而且着两个区间可以在不同的容器中,例如 swap_ranges(first1,last1,first2) 上面的语句将区间[first1,last)和区间[first2,first+N)中的类荣相互交换,其中N=last1-first1.规定这两个区间不可以重叠 阅读全文
posted @ 2011-05-27 20:43 孤独的猫 阅读(1067) 评论(0) 推荐(0) 编辑

摘要: 类属性算法swap的作用是对两个值进行交换 阅读全文
posted @ 2011-05-27 20:39 孤独的猫 阅读(737) 评论(0) 推荐(0) 编辑

2011年5月26日

摘要: 类属算法rotate对区间内的元素进行循环移位操作,如: rotate(first,middle,last) 将区间[first,last)内的元素循环左移middle-first个位置 阅读全文
posted @ 2011-05-26 20:52 孤独的猫 阅读(280) 评论(0) 推荐(0) 编辑

摘要: 类属算法replace的作用是把一个区间中所有等于某个特定值的元素用另一个值代替 阅读全文
posted @ 2011-05-26 20:50 孤独的猫 阅读(256) 评论(0) 推荐(0) 编辑

摘要: 移除tempfile的硬链接 阅读全文
posted @ 2011-05-26 20:38 孤独的猫 阅读(200) 评论(0) 推荐(0) 编辑

摘要: linux下C语言编译为汇编代码 阅读全文
posted @ 2011-05-26 20:17 孤独的猫 阅读(4544) 评论(2) 推荐(0) 编辑

2011年5月25日

摘要: 使用类属性算法accumulate和multiplies计算连乘积示例如下: 阅读全文
posted @ 2011-05-25 21:38 孤独的猫 阅读(322) 评论(0) 推荐(0) 编辑

摘要: 类属性算法find分别用于数组、表和输入输出流 阅读全文
posted @ 2011-05-25 21:35 孤独的猫 阅读(524) 评论(0) 推荐(0) 编辑

摘要: #include #include int commStr(char *str1,char *str2,int *lenpt) { int len1,len2,ln,count,i,k,p; char *st; if ((len1=strlen(str1))0;ln--) { for (k=0;k+ln=len2;k++) { for (p=0;p+ln=len1;p++) { for (i=0;iln;i++) if (str2[k+i]!=str1[p+i]) break; if (i==ln) count++; } } if (count) break; } *lenpt =ln; re 阅读全文
posted @ 2011-05-25 20:25 孤独的猫 阅读(419) 评论(0) 推荐(0) 编辑

摘要: 将已知字符串s中的前导空白符和尾随的空白符去掉,并将字符串中非空白符之间的连续多个空白符缩减为一个 阅读全文
posted @ 2011-05-25 20:09 孤独的猫 阅读(1263) 评论(0) 推荐(0) 编辑

2011年5月24日

摘要: 阅读下列程序说明和 C 程序,把应填入其中__n__ 处的字句,写在答卷的对应栏内。 [程序说明] 对于正整数 n ,输出其和等于 n 且满足以下限制条件的所有正整数的和式,即组成和式的数字自左至右构成一个非递增的序列。如n=4,程序输出为 阅读全文
posted @ 2011-05-24 20:58 孤独的猫 阅读(408) 评论(0) 推荐(0) 编辑

摘要: 复制字符串函数可写为 char *cpystr(char *from,char *to) { char *addr=to; while (*to++=*from++); return addr; } 阅读全文
posted @ 2011-05-24 19:55 孤独的猫 阅读(233) 评论(0) 推荐(0) 编辑

2011年5月23日

摘要: 1.序列容器 STL序列容器有 * vector  提供对变长序列的随机访问,插入和删除操作时间均为分摊常量 * deque  提供对变长序列的随机访问,插入和删除操作时间均为分摊常量 * list  提供对变长序列的线性访问(O(N)),但是对任意位置的插入和删除为常量时间 阅读全文
posted @ 2011-05-23 20:18 孤独的猫 阅读(251) 评论(0) 推荐(0) 编辑

2011年5月22日

摘要: 设有程序 $ cat -n base2.cpp 1 #include 2 using namespace std; 3 class Base 阅读全文
posted @ 2011-05-22 20:59 孤独的猫 阅读(431) 评论(0) 推荐(0) 编辑

摘要: 有如下的C++代码 阅读全文
posted @ 2011-05-22 20:28 孤独的猫 阅读(216) 评论(0) 推荐(0) 编辑

摘要: 1.使用$# $ pg opt.sh #!/bin/sh #opt.sh 阅读全文
posted @ 2011-05-22 16:02 孤独的猫 阅读(275) 评论(0) 推荐(0) 编辑

摘要: $ cat -n simple1.pl 显示XML的代码 1 #!/usr/bin/perl 2 # simple.pl 3 use Data::Dumper; 阅读全文
posted @ 2011-05-22 11:21 孤独的猫 阅读(266) 评论(0) 推荐(0) 编辑

摘要: 1. $ echo Hit to exit * 返回 Hit to exit gd1.pl invoice.xml inXML.dtd pdate.pl perl1.pl perl2.pl perl3.pl perl4.pl perl5.pl perl6.pl perl7.pl perl8.pl pfind.pl pwho.pl s2 simple1.pl simple.pl testalgor.pl tie1.pl 等 * 表示当前目录下的所有文件,如果要显示Hit to exit *字符,需要用 $ echo "Hit to exit *" 阅读全文
posted @ 2011-05-22 11:10 孤独的猫 阅读(205) 评论(0) 推荐(0) 编辑

2011年5月19日

摘要: 求二叉树的深度的C算法如下int Height(BiTree T){ int m,n; if(!T) return(0); else m=Height(T->lchild); n=Height(T->rchild); return((m>n?m:n)+1); } 阅读全文
posted @ 2011-05-19 20:15 孤独的猫 阅读(235) 评论(0) 推荐(0) 编辑

2011年5月18日

摘要: 首先安装XML::Writer,XML::Parser等模块 1.执行/usr/bin/perl -MCPAN -e 'install "YAML"' 安装YAML模块 2.进入CPAN模式,进行下载模块操作 $ sudo perl -MCPAN -e shell 3.在CPAN模式下进行安装,nolock_cpan> install XML::Writer XML::Parser 4.Ctrl+Z退出安装 阅读全文
posted @ 2011-05-18 21:34 孤独的猫 阅读(1286) 评论(0) 推荐(0) 编辑

2011年5月17日

摘要: 现欲构造一个文件/目录树,采用组合(Composite)设计模式来设计,得到的类图如下:C++代码为: 1 #include <list> 2 #include <iostream> 3 #include <string> 4 5 using namespace std; 6 7 class AbstractFile { 8 protected: 9 string name; /*文件或目录名*/10 public:11 void printName() {cout<<name<<endl;} /*打印文件或目录名称*/12 virt 阅读全文
posted @ 2011-05-17 20:13 孤独的猫 阅读(1144) 评论(0) 推荐(0) 编辑

2011年5月16日

摘要: linux读取文件要用到stdio.h文件,在/usr/include下包含大部分的C头文件,sys/types.h也位于其中,/usr/src/linu-版本号 存放有你的内核源代码。 在linux下读文件也是fopen("文件名","方式"),方式有r,w等,下面为一端读文件的代码(cat 7_3.c) 阅读全文
posted @ 2011-05-16 22:05 孤独的猫 阅读(12971) 评论(0) 推荐(0) 编辑

摘要: linux下C语言编程 阅读全文
posted @ 2011-05-16 21:40 孤独的猫 阅读(1389) 评论(0) 推荐(0) 编辑

摘要: /* sgx 2008-10-30 c语言 双向链表 */ #include #include #include 阅读全文
posted @ 2011-05-16 21:26 孤独的猫 阅读(985) 评论(0) 推荐(0) 编辑

2011年5月15日

摘要: 调用CGI脚本文件的例子 你可以使用以下的语句来执行服务器中的CGI脚本http://localhost/cgi-bin/test.cgi ,而在perl中使用$ENV{QUERY_STRING}来获取传递的参数,并且进行相应处理,并返回浏览器供显示。首先由一test1.html,里面填写表单(Form),代码如下: 阅读全文
posted @ 2011-05-15 16:25 孤独的猫 阅读(2877) 评论(0) 推荐(0) 编辑

2011年5月14日

摘要: 绘制多行文本需要计算行高,然后绘出字符串 阅读全文
posted @ 2011-05-14 15:49 孤独的猫 阅读(4801) 评论(0) 推荐(1) 编辑

摘要: 在GDI+中可以用FontFamily和Font设置字体,其中FontFamily构造函数带一字体参数,如:FontFamily ff = new FontFamily("Times New Roman"); Font类则有多个重载的函数: 阅读全文
posted @ 2011-05-14 15:36 孤独的猫 阅读(5656) 评论(0) 推荐(1) 编辑

摘要: 1./etc/profile 用户登录时,自动读取/ect目录下profile文件,此文件包括 阅读全文
posted @ 2011-05-14 09:57 孤独的猫 阅读(831) 评论(0) 推荐(0) 编辑

2011年5月13日

摘要: 可以用cgi对环境进行读取,直接用pint语句打印出来#!d:/perl/bin/perluse warnings;use strict;print "Content-type:text/html\n\n";print "<HTML><HEAD><TITLE>Request Info</TITLE><HEAD> \n";print "<BODY><BLOCKQUOTE><TABLE BORDER =1>\n";foreach ('R 阅读全文
posted @ 2011-05-13 22:38 孤独的猫 阅读(329) 评论(0) 推荐(0) 编辑

摘要: 使用perl进行CGI开发必须安装WEB服务器,一般用Apache比较好,因为它可跨平台,并且可以经perl、python等模块编译其中,速度更快,下面就简单介绍一下Apache在windows下的安装和配置: 阅读全文
posted @ 2011-05-13 22:20 孤独的猫 阅读(1524) 评论(0) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 26 下一页