Java Code Examples for org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager

The following are 20 Jave code examples that show how to use the org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager class. These examples are extracted from open source projects. You can click to vote up the examples you like. Your votes will be used in an intelligent system to get more and better code examples. Thanks!

Example 1

  8 

From project Android-OpenCNAM-Library,
under directory /android-opencnam-library/src/com/tomdignan/android/opencnam/library/ssl/,
in source file SSLHelper.java

public static HttpClient makeAdditionalSSLCertsHttpClient(Context context) throws Exception {
  final SchemeRegistry schemeRegistry=new SchemeRegistry();
  schemeRegistry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
  schemeRegistry.register(new Scheme("https",createAdditionalCertsSSLSocketFactory(context),443));
  final HttpParams params=new BasicHttpParams();
  final ThreadSafeClientConnManager connectionManager=new ThreadSafeClientConnManager(params,schemeRegistry);
  HttpClient client=new DefaultHttpClient(connectionManager,params);
  return client;
}

Example 2

  8 

From project apps-for-android,
under directory /Photostream/src/com/google/android/photostream/,
in source file Flickr.java

private void Flickr(){
  final HttpParams params=new BasicHttpParams();
  HttpProtocolParams.setVersion(params,HttpVersion.HTTP_1_1);
  HttpProtocolParams.setContentCharset(params,"UTF-8");
  final SchemeRegistry registry=new SchemeRegistry();
  registry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
  final ThreadSafeClientConnManager manager=new ThreadSafeClientConnManager(params,registry);
  mClient=new DefaultHttpClient(manager,params);
}

Example 3

  7 

From project agile-stock,
under directory /src/hk/reality/stock/service/fetcher/,
in source file BaseIndexesFetcher.java

public BaseIndexesFetcher(){
  HttpParams params=new BasicHttpParams();
  HttpConnectionParams.setConnectionTimeout(params,TIMEOUT * 1000);
  HttpConnectionParams.setSoTimeout(params,TIMEOUT * 1000);
  HttpProtocolParams.setUserAgent(params,Constants.USER_AGENT);
  SchemeRegistry schemeRegistry=new SchemeRegistry();
  schemeRegistry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
  ClientConnectionManager cm=new ThreadSafeClientConnManager(params,schemeRegistry);
  this.client=new DefaultHttpClient(cm,params);
}

Example 4

  7 

From project Airports,
under directory /src/com/nadmm/airports/utils/,
in source file NetworkUtils.java

public static HttpClient getHttpClient(){
  SchemeRegistry registry=new SchemeRegistry();
  registry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
  HttpParams params=new BasicHttpParams();
  ClientConnectionManager cm=new ThreadSafeClientConnManager(params,registry);
  HttpClient client=new DefaultHttpClient(cm,params);
  return client;
}

Example 5

  7 

From project android-download-manager,
under directory /src/com/yyxu/download/http/,
in source file AndroidHttpClient.java

/**
 * Create a new HttpClient with reasonable defaults (which you can update).
 * @param userAgent to report in your HTTP requests
 * @param context to use for caching SSL sessions (may be null for no caching)
 * @return AndroidHttpClient for you to use for all your requests.
 */
public static AndroidHttpClient newInstance(String userAgent,Context context){
  HttpParams params=new BasicHttpParams();
  HttpConnectionParams.setStaleCheckingEnabled(params,false);
  HttpConnectionParams.setConnectionTimeout(params,SOCKET_OPERATION_TIMEOUT);
  HttpConnectionParams.setSoTimeout(params,SOCKET_OPERATION_TIMEOUT);
  HttpConnectionParams.setSocketBufferSize(params,8192);
  HttpClientParams.setRedirecting(params,false);
  HttpProtocolParams.setUserAgent(params,userAgent);
  SchemeRegistry schemeRegistry=new SchemeRegistry();
  schemeRegistry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
  ClientConnectionManager manager=new ThreadSafeClientConnManager(params,schemeRegistry);
  return new AndroidHttpClient(manager,params);
}

Example 6

  7 

From project Android-OpenCNAM-Library,
under directory /android-opencnam-library/src/com/tomdignan/android/opencnam/library/ssl/,
in source file SSLHelper.java

/**
 * This is a last resort. I am starting to think SSL implementations are not very consistent across different android devices. insecure code taken from http://stackoverflow.com/questions/2642777/trusting -all-certificates-using-httpclient-over-https
 */
public static HttpClient makeInsecureHttpClient() throws Exception {
  KeyStore trustStore=KeyStore.getInstance(KeyStore.getDefaultType());
  trustStore.load(null,null);
  SSLSocketFactory socketFactory=new InsecureSSLSocketFactory(trustStore);
  socketFactory.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
  HttpParams params=new BasicHttpParams();
  HttpProtocolParams.setVersion(params,HttpVersion.HTTP_1_1);
  HttpProtocolParams.setContentCharset(params,HTTP.UTF_8);
  SchemeRegistry registry=new SchemeRegistry();
  registry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
  registry.register(new Scheme("https",socketFactory,443));
  ClientConnectionManager clientConnMgr=new ThreadSafeClientConnManager(params,registry);
  return new DefaultHttpClient(clientConnMgr,params);
}

Example 7

  7 

From project androidquery,
under directory /src/com/androidquery/callback/,
in source file AbstractAjaxCallback.java

private static DefaultHttpClient getClient(){
  if (client == null || !REUSE_CLIENT) {
    AQUtility.debug("creating http client");
    HttpParams httpParams=new BasicHttpParams();
    HttpConnectionParams.setConnectionTimeout(httpParams,NET_TIMEOUT);
    HttpConnectionParams.setSoTimeout(httpParams,NET_TIMEOUT);
    ConnManagerParams.setMaxConnectionsPerRoute(httpParams,new ConnPerRouteBean(25));
    HttpConnectionParams.setSocketBufferSize(httpParams,8192);
    SchemeRegistry registry=new SchemeRegistry();
    registry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
    registry.register(new Scheme("https",ssf == null ? SSLSocketFactory.getSocketFactory() : ssf,443));
    ThreadSafeClientConnManager cm=new ThreadSafeClientConnManager(httpParams,registry);
    client=new DefaultHttpClient(cm,httpParams);
  }
  return client;
}

Example 8

  7 

From project android_4,
under directory /zxing-1.6/android/src/com/google/zxing/client/android/,
in source file AndroidHttpClient.java

/**
 * Create a new HttpClient with reasonable defaults (which you can update).
 * @param userAgent to report in your HTTP requests.
 * @return AndroidHttpClient for you to use for all your requests.
 */
public static AndroidHttpClient newInstance(String userAgent){
  HttpParams params=new BasicHttpParams();
  HttpConnectionParams.setStaleCheckingEnabled(params,false);
  HttpConnectionParams.setConnectionTimeout(params,20 * 1000);
  HttpConnectionParams.setSoTimeout(params,20 * 1000);
  HttpConnectionParams.setSocketBufferSize(params,8192);
  HttpClientParams.setRedirecting(params,false);
  HttpProtocolParams.setUserAgent(params,userAgent);
  SchemeRegistry schemeRegistry=new SchemeRegistry();
  schemeRegistry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
  schemeRegistry.register(new Scheme("https",SSLSocketFactory.getSocketFactory(),443));
  ClientConnectionManager manager=new ThreadSafeClientConnManager(params,schemeRegistry);
  return new AndroidHttpClient(manager,params);
}

Example 9

  7 

From project android_download_manager,
under directory /src/example/filedownload/pub/,
in source file AndroidHttpClient.java

/**
 * Create a new HttpClient with reasonable defaults (which you can update).
 * @param userAgent to report in your HTTP requests
 * @param context to use for caching SSL sessions (may be null for no caching)
 * @return AndroidHttpClient for you to use for all your requests.
 */
public static AndroidHttpClient newInstance(String userAgent,Context context){
  HttpParams params=new BasicHttpParams();
  HttpConnectionParams.setStaleCheckingEnabled(params,false);
  HttpConnectionParams.setConnectionTimeout(params,SOCKET_OPERATION_TIMEOUT);
  HttpConnectionParams.setSoTimeout(params,SOCKET_OPERATION_TIMEOUT);
  HttpConnectionParams.setSocketBufferSize(params,8192);
  HttpClientParams.setRedirecting(params,false);
  HttpProtocolParams.setUserAgent(params,userAgent);
  SchemeRegistry schemeRegistry=new SchemeRegistry();
  schemeRegistry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
  ClientConnectionManager manager=new ThreadSafeClientConnManager(params,schemeRegistry);
  return new AndroidHttpClient(manager,params);
}

Example 10

  7 

From project archiva,
under directory /archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/admin/,
in source file DefaultArchivaAdministration.java

protected void setupWagon(NetworkConfiguration networkConfiguration){
  if (networkConfiguration == null) {
    HttpWagon.setUseClientManagerPooled(true);
    ThreadSafeClientConnManager threadSafeClientConnManager=new ThreadSafeClientConnManager();
    threadSafeClientConnManager.setDefaultMaxPerRoute(30);
    threadSafeClientConnManager.setMaxTotal(30);
    HttpWagon.setConnectionManagerPooled(threadSafeClientConnManager);
  }
 else {
    HttpWagon.setUseClientManagerPooled(networkConfiguration.isUsePooling());
    ThreadSafeClientConnManager threadSafeClientConnManager=new ThreadSafeClientConnManager();
    threadSafeClientConnManager.setDefaultMaxPerRoute(networkConfiguration.getMaxTotalPerHost());
    threadSafeClientConnManager.setMaxTotal(networkConfiguration.getMaxTotal());
    HttpWagon.setConnectionManagerPooled(threadSafeClientConnManager);
  }
}

Example 11

  6 

From project 4308Cirrus,
under directory /tendril-android-lib/src/main/java/edu/colorado/cs/cirrus/android/,
in source file HttpUtils.java

public static HttpClient getNewHttpClient(){
  try {
    KeyStore trustStore=KeyStore.getInstance(KeyStore.getDefaultType());
    trustStore.load(null,null);
    SSLSocketFactory sf=new EasySSLSocketFactory(trustStore);
    sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
    HttpParams params=new BasicHttpParams();
    HttpProtocolParams.setVersion(params,HttpVersion.HTTP_1_1);
    HttpProtocolParams.setContentCharset(params,HTTP.UTF_8);
    SchemeRegistry registry=new SchemeRegistry();
    registry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
    registry.register(new Scheme("https",sf,443));
    ClientConnectionManager ccm=new ThreadSafeClientConnManager(params,registry);
    return new DefaultHttpClient(ccm,params);
  }
 catch (  Exception e) {
    return new DefaultHttpClient();
  }
}

Example 12

  6 

From project agile-stock,
under directory /src/hk/reality/stock/service/fetcher/,
in source file BaseQuoteFetcher.java

public BaseQuoteFetcher(){
  HttpParams params=new BasicHttpParams();
  HttpConnectionParams.setConnectionTimeout(params,TIMEOUT * 1000);
  HttpConnectionParams.setSoTimeout(params,TIMEOUT * 1000);
  HttpProtocolParams.setUserAgent(params,Constants.USER_AGENT);
  SchemeRegistry schemeRegistry=new SchemeRegistry();
  schemeRegistry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
  ClientConnectionManager cm=new ThreadSafeClientConnManager(params,schemeRegistry);
  this.client=new DefaultHttpClient(cm,params);
  this.cleaner=new HtmlCleaner();
  CleanerProperties prop=cleaner.getProperties();
  prop.setOmitDoctypeDeclaration(true);
  prop.setOmitUnknownTags(true);
  prop.setOmitComments(true);
  prop.setIgnoreQuestAndExclam(true);
  prop.setOmitDeprecatedTags(true);
  prop.setOmitXmlDeclaration(true);
  prop.setAdvancedXmlEscape(false);
  prop.setRecognizeUnicodeChars(false);
  prop.setOmitHtmlEnvelope(false);
  prop.setUseCdataForScriptAndStyle(true);
}

Example 13

  6 

From project android-bankdroid,
under directory /src/eu/nullbyte/android/urllib/,
in source file Urllib.java

public Urllib(boolean acceptInvalidCertificates,boolean allowCircularRedirects){
  this.acceptInvalidCertificates=acceptInvalidCertificates;
  this.headers=new HashMap<String,String>();
  HttpParams params=new BasicHttpParams();
  HttpProtocolParams.setVersion(params,HttpVersion.HTTP_1_1);
  HttpProtocolParams.setContentCharset(params,this.charset);
  params.setBooleanParameter("http.protocol.expect-continue",false);
  if (allowCircularRedirects)   params.setBooleanParameter("http.protocol.allow-circular-redirects",true);
  if (acceptInvalidCertificates) {
    SchemeRegistry registry=new SchemeRegistry();
    registry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
    registry.register(new Scheme("https",new EasySSLSocketFactory(),443));
    ClientConnectionManager manager=new ThreadSafeClientConnManager(params,registry);
    httpclient=new DefaultHttpClient(manager,params);
  }
 else {
    SchemeRegistry registry=new SchemeRegistry();
    registry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
    registry.register(new Scheme("https",SSLSocketFactory.getSocketFactory(),443));
    ClientConnectionManager manager=new ThreadSafeClientConnManager(params,registry);
    httpclient=new DefaultHttpClient(manager,params);
  }
  context=new BasicHttpContext();
}
 

Example 14

  6 

From project android-rackspacecloud,
under directory /extensions/apachehc/src/main/java/org/jclouds/http/apachehc/config/,
in source file ApacheHCHttpCommandExecutorServiceModule.java

@Singleton @Provides ClientConnectionManager newClientConnectionManager(HttpParams params,X509HostnameVerifier verifier,Closer closer) throws NoSuchAlgorithmException, KeyManagementException {
  SchemeRegistry schemeRegistry=new SchemeRegistry();
  Scheme http=new Scheme("http",PlainSocketFactory.getSocketFactory(),80);
  SSLContext context=SSLContext.getInstance("TLS");
  context.init(null,null,null);
  SSLSocketFactory sf=new SSLSocketFactory(context);
  sf.setHostnameVerifier(verifier);
  Scheme https=new Scheme("https",sf,443);
  SchemeRegistry sr=new SchemeRegistry();
  sr.register(http);
  sr.register(https);
  schemeRegistry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
  schemeRegistry.register(new Scheme("https",SSLSocketFactory.getSocketFactory(),443));
  final ClientConnectionManager cm=new ThreadSafeClientConnManager(params,schemeRegistry);
  closer.addToClose(new Closeable(){
    @Override public void close() throws IOException {
      cm.shutdown();
    }
  }
);
  return cm;
}
 

Example 15

  6 

From project android-utils,
under directory /src/net/beshkenadze/android/hacks/,
in source file DisableSSLCheck.java

public static HttpClient getNewHttpClient(HttpParams httpParameters){
  TrustManager[] trustAllCerts=getTrustCerts();
  try {
    KeyStore trustStore=KeyStore.getInstance(KeyStore.getDefaultType());
    trustStore.load(null,null);
    SSLContext sc=SSLContext.getInstance("TLS");
    sc.init(null,trustAllCerts,new java.security.SecureRandom());
    SSLSocketFactory sf=new MySSLSocketFactory(trustStore);
    HttpParams params=new BasicHttpParams();
    HttpProtocolParams.setVersion(params,HttpVersion.HTTP_1_1);
    HttpProtocolParams.setContentCharset(params,HTTP.UTF_8);
    SchemeRegistry registry=new SchemeRegistry();
    registry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
    registry.register(new Scheme("https",sf,443));
    ClientConnectionManager ccm=new ThreadSafeClientConnManager(params,registry);
    return new DefaultHttpClient(ccm,params);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return new DefaultHttpClient();
}

Example 16

  6 

From project android_framework_base_1,
under directory /core/java/android/net/http/,
in source file AndroidHttpClient.java

/**
 * Create a new HttpClient with reasonable defaults (which you can update).
 * @param userAgent to report in your HTTP requests
 * @param context to use for caching SSL sessions (may be null for no caching)
 * @return AndroidHttpClient for you to use for all your requests.
 */
public static AndroidHttpClient newInstance(String userAgent,Context context){
  HttpParams params=new BasicHttpParams();
  HttpConnectionParams.setStaleCheckingEnabled(params,false);
  HttpConnectionParams.setConnectionTimeout(params,SOCKET_OPERATION_TIMEOUT);
  HttpConnectionParams.setSoTimeout(params,SOCKET_OPERATION_TIMEOUT);
  HttpConnectionParams.setSocketBufferSize(params,8192);
  HttpClientParams.setRedirecting(params,false);
  SSLSessionCache sessionCache=context == null ? null : new SSLSessionCache(context);
  HttpProtocolParams.setUserAgent(params,userAgent);
  SchemeRegistry schemeRegistry=new SchemeRegistry();
  schemeRegistry.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
  schemeRegistry.register(new Scheme("https",SSLCertificateSocketFactory.getHttpSocketFactory(SOCKET_OPERATION_TIMEOUT,sessionCache),443));
  ClientConnectionManager manager=new ThreadSafeClientConnManager(params,schemeRegistry);
  return new AndroidHttpClient(manager,params);
}

Example 17

  6 

From project andstatus,
under directory /src/org/andstatus/app/net/,
in source file ConnectionOAuth.java

public ConnectionOAuth(MyAccount ma){
  super(ma);
  mOauthBaseUrl=ma.getOauthBaseUrl();
  HttpParams parameters=new BasicHttpParams();
  HttpProtocolParams.setVersion(parameters,HttpVersion.HTTP_1_1);
  HttpProtocolParams.setContentCharset(parameters,HTTP.DEFAULT_CONTENT_CHARSET);
  HttpProtocolParams.setUseExpectContinue(parameters,false);
  HttpConnectionParams.setTcpNoDelay(parameters,true);
  HttpConnectionParams.setSocketBufferSize(parameters,8192);
  SchemeRegistry schReg=new SchemeRegistry();
  schReg.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
  ClientConnectionManager tsccm=new ThreadSafeClientConnManager(parameters,schReg);
  mClient=new DefaultHttpClient(tsccm,parameters);
  OAuthKeys oak=new OAuthKeys(ma.getOriginId());
  mConsumer=new CommonsHttpOAuthConsumer(oak.getConsumerKey(),oak.getConsumerSecret());
  mProvider=new CommonsHttpOAuthProvider(getApiUrl(apiEnum.OAUTH_REQUEST_TOKEN),getApiUrl(apiEnum.OAUTH_ACCESS_TOKEN),getApiUrl(apiEnum.OAUTH_AUTHORIZE));
  mProvider.setOAuth10a(true);
  if (ma.dataContains(ConnectionOAuth.USER_TOKEN) && ma.dataContains(ConnectionOAuth.USER_SECRET)) {
    setAuthInformation(ma.getDataString(ConnectionOAuth.USER_TOKEN,null),ma.getDataString(ConnectionOAuth.USER_SECRET,null));
  }
}
 

Example 18

  6 

From project andtweet,
under directory /src/com/xorcode/andtweet/net/,
in source file ConnectionOAuth.java

public ConnectionOAuth(SharedPreferences sp){
  super(sp);
  HttpParams parameters=new BasicHttpParams();
  HttpProtocolParams.setVersion(parameters,HttpVersion.HTTP_1_1);
  HttpProtocolParams.setContentCharset(parameters,HTTP.DEFAULT_CONTENT_CHARSET);
  HttpProtocolParams.setUseExpectContinue(parameters,false);
  HttpConnectionParams.setTcpNoDelay(parameters,true);
  HttpConnectionParams.setSocketBufferSize(parameters,8192);
  SchemeRegistry schReg=new SchemeRegistry();
  schReg.register(new Scheme("http",PlainSocketFactory.getSocketFactory(),80));
  ClientConnectionManager tsccm=new ThreadSafeClientConnManager(parameters,schReg);
  mClient=new DefaultHttpClient(tsccm,parameters);
  mConsumer=new CommonsHttpOAuthConsumer(OAuthKeys.TWITTER_CONSUMER_KEY,OAuthKeys.TWITTER_CONSUMER_SECRET);
  loadSavedKeys(sp);
}

Example 19

  5 

From project android_external_oauth,
under directory /core/src/main/java/net/oauth/client/httpclient4/,
in source file HttpClient4.java

SingleClient(){
  HttpClient client=new DefaultHttpClient();
  ClientConnectionManager mgr=client.getConnectionManager();
  if (!(mgr instanceof ThreadSafeClientConnManager)) {
    HttpParams params=client.getParams();
    client=new DefaultHttpClient(new ThreadSafeClientConnManager(params,mgr.getSchemeRegistry()),params);
  }
  this.client=client;
}

Example 20

  5 

From project android_image_downloader,
under directory /src/com/cleverua/test/thumbs/,
in source file HttpClentFactory.java

public synchronized static DefaultHttpClient getThreadSafeClient(){
  if (client != null)   return client;
  client=new DefaultHttpClient();
  ClientConnectionManager mgr=client.getConnectionManager();
  HttpParams params=client.getParams();
  client=new DefaultHttpClient(new ThreadSafeClientConnManager(params,mgr.getSchemeRegistry()),params);
  return client;
}

ThreadSafeClientConnManager的20个例子的更多相关文章

  1. 关于定时执行任务:Crontab的20个例子

    关于定时执行任务:Crontab的20个例子 LeeLom 关注 2016.09.28 19:53* 字数 713 阅读 9186评论 6喜欢 15 简介 Linux crontab和Windows ...

  2. 1028 人口普查 (20 分)C语言

    题目描述 某城镇进行人口普查,得到了全体居民的生日.现请你写个程序,找出镇上最年长和最年轻的人. 这里确保每个输入的日期都是合法的,但不一定是合理的--假设已知镇上没有超过200岁的老人,而今天是20 ...

  3. MySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)的真正原因

    在博客Linux mysql 5.6: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N ...

  4. db2 import export load

    DB2中所谓的数据移动,包括: 1. 数据的导入(Import) 2. 数据的导出(Export) 3. 数据的装入(Load) 导入和装入都是利用DB2的相关命令把某种格式的文件中的数据保存到数据库 ...

  5. DB2常用命令

    DB2安装启动服务中启动不了,可用command启动并查看windows系统的日志.1.启动数据库  db2start2.停止数据库  db2stop3.连接数据库运行 db2命令之前要先运行db2c ...

  6. Scala HandBook

    目录[-] 1.   Scala有多cool 1.1.     速度! 1.2.     易用的数据结构 1.3.     OOP+FP 1.4.     动态+静态 1.5.     DSL 1.6 ...

  7. 大前端学习笔记整理【五】rem与px换算的计算方式

    前言 这段时间的小项目中算是真正意义上使用了rem来进行移动端的页面布局,项目结束了我反思了一下之前的对于rem的使用...原来我以前对rem用法完全是在搞笑啊!!结合这次这个小项目,我觉得我也有必要 ...

  8. Java 并发工具包 java.util.concurrent 用户指南

    1. java.util.concurrent - Java 并发工具包 Java 5 添加了一个新的包到 Java 平台,java.util.concurrent 包.这个包包含有一系列能够让 Ja ...

  9. Python2.4-原理之函数

    此节来自于<Python学习手册第四版>第四部分 一.函数基础 函数的作用在每个编程语言中都是大同小异的,,这个表是函数的相关语句和表达式. 1.编写函数,a.def是可执行代码,pyth ...

随机推荐

  1. Custom draw 和 Owner draw 的区别

    "Custom Draw" is a feature shared by all of Microsoft's common controls, which allows you ...

  2. gaoyong的干货

    http://blog.163.com/you888@188/blog/static/6723961920169319529515/    1.xe6安卓编程入门教程,一本很好的资料,全是干货,书印刷 ...

  3. shell字符串长度

    方法一 $ expr length "Find out the length of this string from Linux Bash shell." 57 方法二 str1= ...

  4. 用VC实现竖写汉字的方法

    中国人自古就有自右至左.从上到下书写汉字的习惯.而当我们在自己所编写的应用程序中使用输出函数输出的总是自左至右的横排文字.有没有可能在我们的应用程序中实现竖写汉字的效果呢?笔者偶然发现了一种利用VC实 ...

  5. 与众不同 windows phone (4) - Launcher(启动器)

    原文:与众不同 windows phone (4) - Launcher(启动器) [索引页][源码下载] 与众不同 windows phone (4) - Launcher(启动器) 作者:weba ...

  6. leetcode第一刷_Sqrt(x)

    这道题乍看下来很easy,实际上要注意的问题许多. 注意看给出来的函数的接口,返回的是int值,也就是计算结果是个近似值.如何求呢?难道是从2開始往上算?直到某个值正好接近x?当然不行,肯定超时了.再 ...

  7. Eclipse中快捷键的使用

    1:引入包   ctrl+shift+o 2:对输入进行提示:Alt+/ 3: 全局搜索:crtrl + h 4:Eclipse创建方法快捷键Alt+shift+M 5:Eclipse创建局部变量快捷 ...

  8. 《转载》常用算法经典代码(C++版)

    转自:http://blog.renren.com/blog/311453043/736944237 一.快速排序 void qsort(int x,int y) //待排序的数据存放在a[1]..a ...

  9. 与众不同 windows phone (24) - Input(输入)之软键盘类型, XNA 方式启动软键盘, UIElement 的 Touch 相关事件, 触摸涂鸦

    原文:与众不同 windows phone (24) - Input(输入)之软键盘类型, XNA 方式启动软键盘, UIElement 的 Touch 相关事件, 触摸涂鸦 [索引页][源码下载] ...

  10. SilkTest Q&A 6

    Q51.GMO在线的问题? 该问题是一个特例,不具有代表性,故不翻译了. Q52.如何为一个testplan的属性定义值? A52:你必须在使用前为一个testplan定义值: 1.确保你的test ...