如下所示 给出2个解法
def euler_problem_18_1():
"""
this problem spend my half-day but noting to finished ,so bad
"""
rows = '''
3
7 4
2 4 6
100 5 9 3
'''
...
分类:
编程语言 时间:
2014-06-07 01:28:18
阅读次数:
261
title:
Largest palindrome product
Problem 4
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91
99.
Find the l...
分类:
其他好文 时间:
2014-06-07 01:24:27
阅读次数:
398
How do I install all developer tools such as GNU GCC C/C++ compilers, make and others, after installing CentOS from a shell prompt?you can following the nest line do ,install almost all development to...
分类:
系统相关 时间:
2014-06-07 01:23:47
阅读次数:
317
这个是在Linux下遇到的,以前从来都不需要支持中文,最近项目需要。
FILE *fp=NULL;
fgets(buf, sizeof buf, fp);
printf ("buf=%s\n", buf);
成功,就这样就满足我的需求了。
之前的弯路是fread()来读取,这个就太麻烦了,所以换了算法。...
lxc-start: cgroup is not mounted在执行lxc-start时出现上述问题是因为cgroup在宿主机上没有挂载。fix:vim /etc/fstabnone /sys/fs/cgroup cgroup defaults 0 0重启机器即可...
分类:
其他好文 时间:
2014-06-05 10:49:06
阅读次数:
270
Ubuntu 安装oepnssh 报错
有时候由于linux版本不够新,或者安装的包不知是什么原因坏了。报如下错误
unable to correct the problems, you have held broken prckages
可以用如下命令解决
sudo apt-get autoclean
sudo apt-get autoremov...
分类:
其他好文 时间:
2014-06-05 09:31:23
阅读次数:
174
Linux命令:vi全局替换方法
语法为 :[addr]s/源字符串/目的字符串/[option]
全局替换命令为::%s/源字符串/目的字符串/g
[addr]: 表示检索范围,省略时表示当前行。
如:“1,20” :表示从第1行到20行;
“%” :表示整个文件,同“1,$”;
“. ,$” :从当前行到文件尾;
s :表示替换操作
[optio...
分类:
系统相关 时间:
2014-06-05 09:23:09
阅读次数:
354
主要步骤:
1.开发者要书写的文件主要是configure.in和Makefile.am
2.运行autoscan检测源文件生成configure.scan并修改成configure.in
3.编辑configure.in
4.由aclocal命令生成aclocal.m4
5.运行autoconf生成configure脚本
6.运行autoheader生成config.h.in文件...
分类:
系统相关 时间:
2014-06-05 07:51:31
阅读次数:
439
1、网络中进程之间如何通信?
本地的进程间通信(IPC)有很多种方式,但可以总结为下面4类:
消息传递(管道、FIFO、消息队列)
同步(互斥量、条件变量、读写锁、文件和写记录锁、信号量)
共享内存(匿名的和具名的)
远程过程调用(Solaris门和Sun RPC)
但这些都不是本文的主题!我们要讨论的是网络中进程之间如何通信?首要解决的问题是如何唯一标识一个进程,否则...
分类:
系统相关 时间:
2014-06-05 07:39:53
阅读次数:
376
有个好网站http://www.lfd.uci.edu/~gohlke/pythonlibs/ , 这个网站可以下载许多非官方的python库的安装包。
1.首先去这个网站下载cx_freeze安装包后安装。
2.在C:\PythonXX\Scripts\ 下可以看到cxfreeze-quickstart.bat, XX为版本号
3.运行cxfreeze-quickstart.bat...
分类:
编程语言 时间:
2014-06-05 06:24:55
阅读次数:
350