Spark的Python编程示例 代码段

    output = counts.collect()     for (word, count) in output:         print "%s: %i" % (word, count)       sc.stop()

lianzhu3 2016-03-01   39966   0
Spark  

C++ 获取本机IP地址和HostName 代码段

comment(lib, "ws2_32.lib"); int main() { WSADATA wsaData; WORD sockVersion = MAKEWORD(2, 2); ::WSAStartup(sockVersion

jopen 2015-06-16   2154   0
C/C++  

C#半角字符和全角字符相互转换函数代码 代码段

这两个C#函数分别用于将半角字符转换成全角字符和将全角字符转换成半角字符,调用简单 ///

/// 全角的函数(SBC case) /// ///

fdwm 2015-04-19   1507   0
C#  

C#自定义的字符串操作增强类 代码段

把字符串按照分隔符转换成 List /// 2、GetStrArray(string str) 把字符串 按照, 分割 换为数据 /// 3、GetArrayStr(List list, string speater)

fdwm 2015-04-19   1013   0
C#  

json字符串与Object、List、Map的互转工具类 代码段

rialize.Inclusion.NON_NULL); } /** * 泛型返回,json字符串对象 * 2015年4月3日上午10:42:19 * auther:shijing * @param

jopen 2015-07-08   9593   0
Java  

iOS实现漂亮的时钟代码 代码段

绕着下边中心点,需要改变图层锚点的位置。 根据锚点,设置position坐标,为时钟的中点。 思考秒针旋转的角度,怎么知道当前秒针旋转到哪,当前秒针旋转的角度 = 当前秒数 * 每秒多少°。 1>

pwmd 2015-07-19   6370   0
IOS  

微信H5的开头css部分 代码段

"Helvetica","Arial","sans-serif"; font-size: 14px; word-break: break-all; } *{ box-sizing: border-box; margin:

nyyb 2015-12-11   5135   0
CSS3  

asp.net文件上传和下载 代码段

flv;.doc;.docx;.xls;.xlsx;.ppt;.pptx;.txt;.pps;.pdf"; if (s.Split(';').Contains(imageType)) { //检查是否有此文件夹

atts 2016-01-22   1256   0
ASP.NET  

java采集网页 抓取网页 代码段

application/xml;q=0.9,*/*;q=0.8");// 只接受text/html类型,当然也可以接受图片,pdf,*/*任意,就是tomcat/conf/web里面定义那些 conn.setConnectTimeout(timeout);

123bt 2014-12-31   2520   0
Java   爬虫  

查看Linux系统信息 代码段

(Final) 查看系统是64位还是32位: 1、getconf LONG_BIT or getconf WORD_BIT [root@localhost ~]# getconf LONG_BIT 64 2、file

jopen 2015-12-10   4283   0
Shell  

c#生成随机数,随机字符串,随机颜色等 代码段

randomSeed.Next(256) ); } } //使用范例: // Generate a random word: string RandomWord = RandomHelper.RandomString(10

wufflina 2016-02-20   899   0
c#   随机数  

生成随机数,随机字符串,随机颜色等的C#代码 代码段

randomSeed.Next(256) ); } } //使用范例: // Generate a random word: string RandomWord = RandomHelper.RandomString(10

nbnb 2015-01-04   1833   0

Python 单词字母顺序不变且全部倒排 代码段

not None, itspecifies a string to be used as the word separator. The returned list willthen have one more

p34f 2014-12-29   1254   0
Python  

Python批量抓取图片 代码段

=0&fb=0&width=&height=&face=0&istype=2&ie=utf-8&word=python&oq=python&rsp=-1" outpath = "t:\\" def getHtml(url):

LueOsburn 2016-01-24   1508   0
Python  

json解析使用第三方类库JSONKit 代码段

// 1、JSON对象 // NSDictionary * dic = [data objectFromJSONData]; // NSLog(@"%@", dic); // 2、字符串data //

end5 2015-06-26   2015   0
IOS  

实用JS代码大全 代码段

display:inline 隐藏焦点 hidefocus=true 根据宽度换行 style="word-break:break-all" 自动刷新

cm54 2015-04-09   18021   6

Java工具类:全角半角相互转换 代码段

/** * 半角全角 * @param input String. * @return 全角字符串. */ public static String ToSBC(String input) { char

fdwm 2015-04-18   1104   0
Java  

C++在windows下获取本地主机ipv4地址和ipv6地址 代码段

printf(" \n"); printf(" \n"); } while(1); } int main(){ WORD wVersionRequested; WSADATA wsaData; int err; wVersionRequested

mx3y 2015-06-29   1629   0
C/C++  

获取硬盘序列号的C++代码 代码段

ToLittleEndian(pWords, 10, 19, pSerialNo); return TRUE; } //把WORD数组调整字节序为little-endian,并滤除字符串结尾的空格。 void ToLittleEndian(PUSHORT

pw36 2015-02-06   5311   0
C/C++  

PHP超大文件下载,断点续传下载 代码段

//获取文件扩展名 //echo $sourceFile; if (!ereg("[tmp|txt|rar|pdf|doc]", $file_extension))exit ("非法资源下载"); //检测文件是否存在

y3c5 2015-05-11   4237   0
PHP  
1 2 3 4 5 6 7 8 9 10