题目:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two...
分类:
编程语言 时间:
2014-11-02 00:36:25
阅读次数:
215
socket是一种双向通信的起点和重点,氛围服务器端和客户端Socket服务器端用到的方法有MethodDescriptions.bind()This method binds address (hostname, port number pair) to socket.s.listen()This...
分类:
编程语言 时间:
2014-11-02 00:36:49
阅读次数:
145
helloworld篇章值:swift中类型分为两种:第一种是值类型,该类型的每个实例持有数据的副本,并且该副本对于每个实例来说是独一无二的一份,比如结构体(struct)、枚举(enum)、元组(tuple)都是值类型。第二种是参照类型,该类型的实例共享数据唯一的一份副本(在native层面说的话...
分类:
编程语言 时间:
2014-11-02 00:35:00
阅读次数:
261
java里finally 关键字通常与try catch块一起使用。用来在方法结束前或发生异常时做一些资源释放的操作。最近也看到网上有一些讨论try catch finally关键词执行的顺序的文章,并给出了finally块是在方法最后执行的。这些观点普遍认为:1)finally关键词是在程序ret...
分类:
编程语言 时间:
2014-11-02 00:33:56
阅读次数:
271
采用tkinter实现了几个简单的GUI界面调用tkinter的方式非常简单,只需要如下几行代码1 import Tkinter2 top = Tkinter.Tk()3 # Code to add widgets will go here...4 top.mainloop()使用Button .....
分类:
编程语言 时间:
2014-11-02 00:33:48
阅读次数:
548
1 //下面代码实现设置和获取学生姓名和成绩。 2 class lesson5homework 3 { 4 public static void main(String[] args) 5 { 6 TestCode TC=new TestCode()...
分类:
编程语言 时间:
2014-11-02 00:31:38
阅读次数:
273
#include int main(){ int max(int x,int y);int min(int x,int y);int length, n, post, mintime, maxtime;int i;int x[1000];int y[1000]; scanf("%d",&i); in...
分类:
编程语言 时间:
2014-11-02 00:30:10
阅读次数:
230
作为一种简洁的脚本语言,对文件操作的支持非常好,只需要几个语句就能够完成文件操作Python还提供了持久化库pickle,可以内存中的对象持久化到文件中。虽然有大量对象进行持久化并需要还原的时候会有所欠缺,一般情况下算是提供了一个非常强大的数据源,不需要指定配置数据库,即可持久化所需要的对象。就像有...
分类:
编程语言 时间:
2014-11-02 00:29:45
阅读次数:
258
Java并发中正确使用volatile原文链接 http://ifeve.com/how-to-use-volatile/作者:一粟 整理和翻译自Twitter实时搜索的PPT前几天并发编程群里有同学对volatile的用法提出了疑问,刚好我记得Twitter有关实时搜索的这个PPT对这个问题解释的...
分类:
编程语言 时间:
2014-11-02 00:29:09
阅读次数:
360
想看看java版的数据结构,了解一下树的一些操作,写了个顺序表熟悉一下 1 package com.sqlist; 2 3 /** 4 * @author xiangfei 5 * 定义一个顺序表 6 * 7 */ 8 public class SqlList { 9 final ...
分类:
编程语言 时间:
2014-11-02 00:30:02
阅读次数:
232
#pragma once#include #include #include #include template class CMySM{public: CMySM() { m_pMem = NULL; m_hMem = NULL; } ~CMyS...
分类:
编程语言 时间:
2014-11-02 00:24:48
阅读次数:
228
1、1 if (!("a" in window)) {2 var a = 1;3 }4 alert(a);阅读代码:如果window不包含属性a,就声明一个变量a,然后赋值为1,最后弹出这个变量的值。理解代码:javascript没有块级作用域,所以var a=1;定义的a是全局的,又因为全...
分类:
编程语言 时间:
2014-11-02 00:24:11
阅读次数:
238
python中提供了两种创建线程的方式1.采用thread.start_new_thread(funciton,args..)2.集成Thread类第一种方式import thread as timport time#Define a function for the threaddef print...
分类:
编程语言 时间:
2014-11-02 00:23:22
阅读次数:
256
有这么两个奇怪的工厂:工厂X只生产杯具,工厂Y只生产洗具。最近,两个工厂决定将产品实行打包策略:即一个杯具搭配上一个洗具。但由于杯具和洗具的形状和功能各不相同,对于某个类别的杯具来说,只能搭配某些类型的洗具。现在,两个工厂的厂长大人想知道最多能成功的搭配多少对杯具与洗具。 类似于上面例子中提到...
分类:
编程语言 时间:
2014-11-02 00:23:29
阅读次数:
370
openssl生成公私钥对 生成私钥 openssl?genrsa?-out?rsa_private_key.pem?1024 导出公钥 openssl?rsa?-in?rsa_private_key.pem?-out?rsa_public_key.pem?-pubout 私钥转PKCS#8编码 openssl?pkcs8?-to...
分类:
编程语言 时间:
2014-11-01 23:23:38
阅读次数:
576
首先感谢Dash?我再也不用到处乱找文档了 再次感谢日食记 让我的看到了世界的美好 好的 我们进入正题 注解 我所有的学习心得都建立在ECMAscript5之后 IE9之前的浏览器概不负责 javascript Array是一个好玩的对象 ...
分类:
编程语言 时间:
2014-11-01 23:21:00
阅读次数:
464
spring mvc 4.1 返回json报406错误的解决办法 浏览器访问,报 The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the reque...
分类:
编程语言 时间:
2014-11-01 23:21:07
阅读次数:
396