Quantcast
Channel: C++博客-所有随笔
Browsing all 7880 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

判断txet.Text是否为数字

private bool IsAccept()   {           try    {        Decimal.Parse(txt1.Text);        return true; <---这里要加一句    }    catch    {        MessageBox.Show("必须为数字!");          return false;    }}李鑫...

View Article


Image may be NSFW.
Clik here to view.

已知一个函数rand7()能够生成1-7的随机数,请给出一个函数rand10(),该函数能够生成1-10的随机数。

题目:已知一个函数rand7()能够生成1-7的随机数,请给出一个函数,该函数能够生成1-10的随机数。思路:假如已知一个函数能够生成1-49的随机数,那么如何以此生成1-10的随机数呢?解法:该解法基于一种叫做拒绝采样的方法。主要思想是只要产生一个目标范围内的随机数,则直接返回。如果产生的随机数不在目标范围内,则丢弃该值,重新取样。由于目标范围内的数字被选中的概率相等,这样一个均匀的分布生成了。显...

View Article


Image may be NSFW.
Clik here to view.

【技术分享】发布本人所属 Java 与 C++ 开源项目

     摘要: *** Java *** 1、Java 全能高效 MVC & REST 开发框架 Portal-Basic 2、Java 日志切割清理工具 Log-Cutter *** C++ *** 1、通用高性能 Windows Socket 组件 HP-Socket 2、Windows C++ 应用程序通用日志组件 VC-Logger  阅读全文~怪^_*兽~ 2013-05-21...

View Article

Image may be NSFW.
Clik here to view.

【奋战2013regional】 2013省赛总结

大大小小的现场赛我一共经历过14场了,不论什么挫折,于我只是过眼云烟,正如本次这场惨败。 之前组队联系赛做过N场,都是三人一机,各种练习几乎从未出过前十,于是信心爆棚。。。 这次比赛可以说完全暴露了我们队的弱点。 比赛流水账:...

View Article

Image may be NSFW.
Clik here to view.

aptitude

早上装apache的时候可能把以来关系搞坏了,用apt-get死活装不了,后来改用aptitude,一切顺利ewre 2013-05-21 11:59 发表评论

View Article


Image may be NSFW.
Clik here to view.

shell中绝对路径相关的2个命令

1,realpath2,basenamerealpath 获取绝对路径,basename则获取路径的叶子节点名称ewre 2013-05-21 16:11 发表评论

View Article

Image may be NSFW.
Clik here to view.

文件描述符重定向测试

 这是《Unix环境高级编程》第三章的一道习题,考察文件描述符的重定向问题。为此我写了个测试程序查看上述两条命令的区别。 #include <stdio.h>#include <stdlib.h>#include <fcntl.h>#include <unistd.h>int main(){...

View Article

Image may be NSFW.
Clik here to view.

实现一个无穷序列

 1 def checkIndex(key): 2     if not isinstance(key, (int,)): 3         raise TypeError 4     if key < 0: 5         raise IndexError 6  7 class ArithmeticSequence: 8     def __init__(self, start =...

View Article


Image may be NSFW.
Clik here to view.

子类化列表

 1 class CounterList(list): 2     def __init__(self, *args): 3         super(CounterList, self).__init__(*args) 4         self.counter = 0 5  6     def __getitem__(self, index): 7         self.counter...

View Article


Image may be NSFW.
Clik here to view.

老头子做作业之APUE1

记性不好,所以作业做起来--从第一章开始,期望有始有终1.1 对根目录(/)来说,没有parent,所以'.' or '..'就没有区别了,可以用ls -li来看inode,/.. 代表他本身1.2 多实例,Process ID递增,分配Process ID的具体方式-->//TODO:去查情景分析1.3 const char*...

View Article

Image may be NSFW.
Clik here to view.

re几个在我博客留言的同学

胜败乃兵家常事,你们能在省赛虐我们,确实很有实力。不过你们在我上一篇博客这么和我说话,我很不高兴。不过你们觉得我菜,可以藐视我,可就大错特错了。。。。。这是我们队第一次参加现场赛,我们之前合练怎么样,努力程度怎么样,你们可以去zju月赛,hustoj,codeforces...

View Article

Image may be NSFW.
Clik here to view.

隨機數生成

inline void MTRand::reload(){ // Generate N new values in state // Made clearer and faster by Matthew Bellew (matthew.bellew@home.com) register uint32 *p = state; register int i; for( i = N - M; i--;...

View Article

Image may be NSFW.
Clik here to view.

rand

     摘要:   Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->// MersenneTwister.h// Mersenne Twister random number generator&...  阅读全文chib...

View Article


Image may be NSFW.
Clik here to view.

(搬用工)开源日志库log4cplus+VS2008使用整理

     摘要: 一.简介log4cplus是C++编写的开源的日志系统,功能非常全面.本文介绍如何在Windows+VS2008中使用该日志库。二.下载可从网站[url]http://log4cplus.sourceforge.net[/url]上去下载 log4cplus 1.0.3...

View Article

Image may be NSFW.
Clik here to view.

MYSQL数据库管理之权限管理

     摘要:...

View Article


Image may be NSFW.
Clik here to view.

xml编码问题

默认情况下,Windows的Notepad把文件保存为ANSI格式,在这种情况,设定不同encoding有不同的结果:   encoding="GB2312" ,正常显示;   encoding="UTF-8"   ,出错,提示文本内容中发现无效字符 ;把xml文件在notepad另包存为UTF-8格式,   encoding="GB2312" ,出错,提示不支持从当前编码到指定编码的切换;...

View Article

Image may be NSFW.
Clik here to view.

联想G480 有线网卡驱动ar1816的linux驱动和安装方法 在ubuntu 12.10 下安装

     摘要: 联想G480 有线网卡驱动ar1816的linux驱动和安装方法 在ubuntu 12.10 下安装  阅读全文AlanTop 2013-05-22 15:37 发表评论

View Article


Image may be NSFW.
Clik here to view.

VS2010调试笔记

今天调试一个demo,发现如下错误。1>  系统找不到指定的文件。1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: The command "copy...

View Article

Image may be NSFW.
Clik here to view.

LTZ做作业之APUE2

看了下第一次作业,那个排版和高亮背景有点瞎,这次能好点就不错了.第二章是关于POSIX以及XSI的一些标准和limitation,就不做作业了,直接到第三章,没有睡午觉,有些困,不要写错...先贴一些比较好的思路(1)在AF_LOCAL(Posix: AF_UNIX)的Socket编程中,对Client端来说需要connectint connect(int sockfd, const struct...

View Article

Image may be NSFW.
Clik here to view.

【奋战2013regional】 【和小学弟一起刷题】NEERC 2012 练习赛总结 【坑】

总之,这场练习赛是有史以来做的最不好的。做了四个小时大家就草草收场总结了。说实话确实是受心情影响了,而且还是学弟喷我。。。。...

View Article
Browsing all 7880 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>