码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
【MongoDB】在Mongodb使用shell实现与javascript的动态交互
关于利用mongodb的shell执行脚本,这点在以前的文章中有点遗漏;现在在此篇博客中做个补充; 一、在命令行中传入脚本文件 定义一个javasciprt文件,名称为:script1.js,内容如下: print("I am albert shao in the script1.js") 定义另一个javascript文件,名称为script2,内容如下: print("I like...
分类:数据库   时间:2014-11-19 07:32:24    阅读次数:270
Cipe Coding Summary Part2
25.Matrix PositionGiven an NxN matrix with unique integers :Find and print positions of all numbers such that it is the biggest in its row and also th...
分类:其他好文   时间:2014-11-19 07:28:20    阅读次数:216
python-2014.11.19
总结的他人的Python的学习笔记:1. 输出重定向到日志文件:f= open("logfilename","a")print >> a," 输出的内容,主要要有前面的重定向号>>"f.close() #注意关闭资源2. 使用from __future__ import division ,使用新功...
分类:编程语言   时间:2014-11-19 07:27:09    阅读次数:190
完数求法
#include#includemain(){unsigned int i,a,m;for(i=2;i<1000;i++){m=0;for(a=1;a<i;a++){ if(i%a==0) m=m+a;}if(m==i){ printf("\n%5d\n",i); for(a=1;a<i;a++){...
分类:其他好文   时间:2014-11-19 07:26:37    阅读次数:177
php 根据key删除数据元素
先上代码<?php $arr1=[‘hehe‘=>‘jasf‘,‘haha‘=>‘asdfqwew‘,‘xixi‘=>‘2j3k213‘]; print_r(array_diff_key($arr1,[‘haha‘=>‘‘])); //echo"<hr/>"; functionarray_unset(&$array1) { //$len=func_num_args(); $args=func_get_args();//获取传递过来的所..
分类:Web程序   时间:2014-11-19 02:11:32    阅读次数:296
Linux常用命令(二十一) - find之参数详解
一.使用name选项: 文件名选项是find命令最常用的选项,要么单独使用该选项,要么和其他选项一起使用。 可以使用某种文件名模式来匹配文件,记住要用引号将文件名模式引起来。 不管当前路径是什么,如果想要在自己的根目录$HOME中查找文件名符合*.log的文件,使用~作为 'pathname'参数,波浪号~代表了你的$HOME目录。 find ~ -name "*.log" -print 想要在当前目录及子目录中查找所有的‘ *.log‘文件,可以用: find . -name "*.log" -...
分类:系统相关   时间:2014-11-19 01:19:42    阅读次数:295
Python标准库:内置函数dict(**kwarg)
本函数是从一个字典参数构造一个新字典。参数kwarg是键值对的字典参数,以两个*开头的参数,就会收集成字典形式。例子:#dict() #以键对方式构造字典 d1 = dict(one = 1, two = 2, a = 3) print(d1)输出结果如下:{'two': 2, 'a': 3, 'one': 1}蔡军生  QQ: 9073204  深圳...
分类:编程语言   时间:2014-11-19 01:18:31    阅读次数:201
lower_bound 和 upper_bound的用法
#include#include#include#include#include#include#include#include#include#includeusing namespace std;int a[5]={3,4,11,51,61};int main(){ int pos1,...
分类:其他好文   时间:2014-11-19 00:05:48    阅读次数:212
python __init__ __call__
__call__ 和 __init__半毛钱的关系都没有。后者是构造类的实例时会调用的方法,并不是构造方法。前者是在实例上可以呼叫的方法。代码示例如下:>>> class foo: def __init__(self): print "init" def __call__(self): prin.....
分类:编程语言   时间:2014-11-19 00:02:27    阅读次数:334
python编码处理:unicode字节串转成中文 各种字符串举例说明
编码问题一直是很头痛的问题:当字符串是:'\u4e2d\u56fd'>>>s=['\u4e2d\u56fd','\u6e05\u534e\u5927\u5b66']>>>str=s[0].decode('unicode_escape') #.encode("EUC_KR")>>>print str中...
分类:编程语言   时间:2014-11-18 23:11:20    阅读次数:280
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!