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. C# 多线程详解 Part.01(UI 线程、子线程)

    基本概念 什么是进程?        当一个程序开始运行时,它就是一个进程,进程包括运行中的程序和程序所使用到的内存和系统资源.一个进程至少有一个主线程. 什么是线程?        线程是程序中的一 ...

  2. jQuery EasyUI datagrid实现本地分页的方法

    http://www.codeweblog.com/jquery-easyui-datagrid%e5%ae%9e%e7%8e%b0%e6%9c%ac%e5%9c%b0%e5%88%86%e9%a1% ...

  3. .Net Install类的Install、Commit等事件触发顺序

    .Net Install类的Install.Commit等事件触发顺序 空间   首先是Install其中调用base.Install过程中导致OnBeforeInstallOnAfterInstal ...

  4. WIFI接入Internet配置过程

    转载请注明出处:http://club.gizwits.com/thread-256-1-1.html AirLink模式GoKit2代配置路由SSID和密码方法如下:1.GoKit2上电2.长按Ke ...

  5. jsp网站与discuz论坛用户同步

    需求分析: 要想实现A(jsp网站)和B(discuz论坛)的同步,这里说的同步指的是 在AB网站任意一方注册之后在另一方都可以直接登录 AB两网站之间的用户登陆状态是同步的,在任意一方登录后,另一方 ...

  6. javascript 为啥不用instanceof检测数组,这里有一个示例坑

    前些天写js遇到了一个instanceof的坑,我们的页面中有一个iframe,我在index页面中计算得到了一个array,然后需要传递到Flight页面 这个嵌套的iframe中的一个函数(Sea ...

  7. mysql中in的用法

    今天在工作中遇到一个查询问题,两张表的联合查询,本来我的想法是先查询一张表,然后遍历查到的所有表,拿到id,去另外一张表查询,这样做也能解决问题,但是这样的话,就用不了框架里的分页了,自己写分页比较麻 ...

  8. PythonStudy——魔法函数 Magic Methods

    魔法函数 python中以双下划线开始和结束的函数(不可自己定义)为魔法函数 调用类实例化的对象的方法时自动调用魔法函数(感觉不需要显示调用的函数都叫) 在自己定义的类中,可以实现之前的内置函数,比如 ...

  9. go标准库的学习-crypto/rand

    参考:https://studygolang.com/pkgdoc 导入方式: import "crypto/rand" rand包实现了用于加解密的更安全的随机数生成器. Var ...

  10. Redis学习之路(007)- Redis学习手册(实例代码)

    在之前的博客中已经非常详细的介绍了Redis的各种操作命令.运行机制和服务器初始化参数配置.本篇博客是该系列博客中的最后一篇,在这里将给出基于Redis客户端组件访问并操作Redis服务器的代码示例. ...