现在位置: 首页 > fzjdhsrbs发表的所有文章
  • 12月
  • 19日
综合 ⁄ 共 266字 评论关闭
 找规律(循环点) //题目分类上的。。。 #include <stdio.h> unsigned int f[100] ={0,1,1}; int main() { int a, b, n, i; while(scanf("%d%d%d",&a,&b,&n)) { if(a==0&&b==0&&n==0) break; n %=48; if(n==0) n = 48; for(i=3;i<=n;i++) { f[i] =(a*f[i-1] + b*f[i-2]) % 7; //printf("i=%d ;%d\n",i,f[i]); } printf("%d\n",f[n]); } return 0; }
阅读全文
  • 06月
  • 08日
综合 ⁄ 共 1951字 评论关闭
转载自:http://www.cppblog.com/Khan/archive/2009/12/08/102793.html Vector 其实就类似动态数组. 事先分配好一定量的内存. 当需要的内存值大于某个阀值. 就重新申请内存. 重新分配. 当小于某个阀值, 也会导致重新分配.(自动收缩部分, stl没有明确规定, 有些库实现了)正确: code1      vector<string> vecFiles;      vector<string>::iterator  it_pos;      //@todo 已下载文件过滤      for (it_pos = vecFiles.begin(); it_pos != vecFiles.end(); ) {         string strTmp = *it_pos;        if( objDownHi......
阅读全文
  Nginx学习笔记2—Nginx(Win32) nginx.conf 中文详解 用户 用户组 user www www; #工作进程,根据硬件调整,有人说几核cpu,就配几个,我觉得可以多一点 worker_processes 5; #错误日志 error_log logs/error.log; #pid文件位置 pid logs/nginx.pid; worker_rlimit_nofile 8192; #工作进程的最大连接数量,根据硬件调整,和前面工作进程配合起来用,尽量大,但是别把cpu跑到100%就行 events { worker_connections 4096; } http { include conf/mime.types; #反向代理配置,可以打开proxy.conf看看 include /etc/n......
阅读全文
  • 05月
  • 20日
综合 ⁄ 共 10203字 评论关闭
糟糕的SQL查询语句可对整个应用程序的运行产生严重的影响,其不仅消耗掉更多的数据库时间,且它将对其他应用组件产生影响。   如同其它学科,优化查询性能很大程度上决定于开发者的直觉。幸运的是,像MySQL这样的数据库自带有一些协助工具。本文简要讨论诸多工具之三种:使用索引,使用EXPLAIN分析查询以及调整MySQL的内部配置。   一、使用索引     MySQL允许对数据库表进行索引,以此能迅速查找记录,而无需一开始就扫描整个表,由此显著地加快查询速度。每个表最多可以做到16个索引,此外MySQL还支持多列索引及全文检索......
阅读全文
  • 05月
  • 15日
综合 ⁄ 共 132字 评论关闭
http://bbs.51js.com/viewthread.php?tid=82188 http://bbs.51js.com/viewthread.php?tid=82188 http://bbs.51js.com/viewthread.php?tid=82188
阅读全文
  • 04月
  • 16日
综合 ⁄ 共 3884字 评论关闭
  1.      registry初始化 CU_ErrorCode    CU_initialize_registry(void); //用户在调用任何其他CUnit函数之前调用本函数,如果不这样做可能会导致系统崩溃。 返回值为: CUE_SUCCESS初始化成功。 CUE_NOMEMORY内存分配失败。 2.    registry释放 void CU_cleanup_registry(void); //当测试完成后,用户应该调用这个函数进行清理和释放的框架所使用的内存。   //其他一些关于注册的内部函数,主要用于内部和测试的目的,较少使用 CU_pTestRegistry CU_get_registry(void); CU_pTestRegistry CU_set_registry(CU_pTestRegistry pTe......
阅读全文
  • 04月
  • 15日
综合 ⁄ 共 5706字 评论关闭
from: http://heikezhi.com/2011/08/26/ssh-productivity-tips/ SSH有很多非常酷的特性,如何它是你每天的工作伴侣,那么我想你有必要了解以下16条高效使用SSH的秘籍,它们帮你节省的时间肯定会远远大于你用来配置它们的时间。 1. 多条连接共享 如果你需要在多个窗口中打开到同一个服务器的连接,而不想每次都输入用户名,密码,或是等待连接建立,那么你可以配置SSH的连接共享选项,在本地打开你的SSH配置文件,通常它们位于~/.ssh/config,然后添加下面2行: ControlMaster auto ControlPath /tmp/ssh_mux_%h_%p_%r 现在......
阅读全文
  • 02月
  • 21日
综合 ⁄ 共 3660字 评论关闭
Maze Stretching Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 708   Accepted: 187 Description Usually the path in a maze is calculated as the sum of steps taken from the starting point until the ending point, assuming that the distance of one step is exactly 1. Lets assume that we could “stretch” (shorten or extend) the maze in vertical dimension (north-south). By stretching, we are just changing the passed distance between two cells. (it becomes X instead of o......
阅读全文
  • 01月
  • 26日
综合 ⁄ 共 643字 评论关闭
<!-- list --> <property name="users"> <list> <ref bean="u1"/> <ref bean="u2"/> <ref bean="u3"/> <ref bean="u4"/> <ref bean="u5"/> </list> </property> <!-- set --> <property name="sets"> <set> <value>赵薇</value> <value>林心如</value> <value>李宇春</val......
阅读全文
  • 12月
  • 03日
综合 ⁄ 共 392字 评论关闭
编程的时候,对于时间的处理,很多时候,我们都用到了时间戳类型,即timestamp类型。 插入数据的时候,不注意的话,执行sql总是报“无效的月份” 这是因为我们的数据格式不对,但是如果我们复制一个timestamp的数据字段过来,我们发现也插不进去。 下面提供一种格式,仅供参考,也为自己做个笔记: 比如对于下面这张表: sql语句如下:  insert into pg_gene t(t.id,t.gene,t.displayer_order,t.create_time,t.last_update_time,t.created_by_user,t.updated_by_user) values('1',1,'1',to_timestamp('2014-01-11','yyyy-MM-dd'),t......
阅读全文
  • 11月
  • 21日
综合 ⁄ 共 573字 评论关闭
题目描述:http://acm.nyist.net/JudgeOnline/problem.php?pid=2 就是输入一串括号,看顺序是不是匹配的。如果括号数是奇数,肯定不匹配啦~这里用到的数据结构的栈,每次比较当前括号与栈顶括号是否匹配,匹配则栈顶元素出栈,否则当前括号入栈。最后检查栈是否为空,为空的话说明全部匹配了。 #include<stdio.h> #include<string.h> char str[10005]; char stack[10005]; bool check() { int nLen; int top = -1; nLen = strlen(str); if(nLen & 1) return false; for(int i = 0; i < nLen; ++i) { ......
阅读全文
  • 11月
  • 12日
综合 ⁄ 共 1927字 评论关闭
#include "mystack.h" #include <iostream> using namespace std; char get_command() { char command; bool waiting = true; cout << "Select command and press <ENTER> : "; while (waiting){ cin >> command; if (command == '?' || command == '=' || command == '+' || command == '-' || command == '*' || command == '/' || command == 'q') waiting = false; else{ cout << "Please enter a valid command:"<< endl << "[?]push to stack [=]print to......
阅读全文