`
xuanzhui
  • 浏览: 200820 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论
文章列表
DropWizard  http://www.dropwizard.io/0.9.2/docs/getting-started.html Jetty for HTTP Jersey for REST 官方说法 capable of doing 30,000-50,000 requests per second   定义依赖 <dependencies> <dependency> <groupId>io.dropwizard</groupId> < ...
安装 pip install beautifulsoup4 建议安装lxml,作为beautiful soup的内置解析器 对于windows,到 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 搜索下载并安装 pip3 install "lxml-3.6.0-cp35-cp35m-win_amd64.whl"   核心方法 http://www.crummy.com/software/BeautifulSoup/bs4/doc.zh/ find(name, attrs, recursive, text, **kwarg ...
以下基本是在文章 在Ubuntu上使用Nginx部署Flask 应用 上做了部分调整,没有使用virtualenv,python版本3.4。   依赖 安装pip3 sudo apt-get install python3-setuptools sudo easy_install3 pip   安装python3-dev,uwsgi依赖,否则直接安装uwsgi可能会遇到python.h找不到的问题 sudo apt-get install python3-dev   安装Flask sudo pip3 install Flask   安装uwsgi sudo pi ...
官方文档:https://github.com/square/okhttp/wiki/Recipes https://github.com/square/okhttp   以下只考虑小数据量请求,比如请求rest json API     相关注意点 1. okhttp3比较多的地方使用了builder模式,OkHttpClient、Request、FormBody等都可以通过<Class>.Builder()获取相应的Builder,进而进行相关的配置。   2. ResponseBody用完了要及时关闭 Each response body is backe ...
1. 正常定义Activity   <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- 实际显示区域 --> ...
Android uses Hex ARGB values, which are formatted as #AARRGGBB. That first pair of letters, the AA, represent the Alpha Channel. You must convert your decimal opacity values to a Hexdecimal value. Here are the steps:   Alpha Hex Value Process Take your opacity as a decimal value and multiply it ...
在drawable里面定义xml,在background中引用 <Button android:id="@+id/completeBtn" android:layout_width="80dp" android:layout_height="40dp" android:layout_marginTop="32dp" android:text="完成" android:textColor="@color/white" android:tex ...
Android 5 (Lollipop) 版本的按钮自带阴影,部分场合比较难看,取消阴影的方法   Lollipop has a nasty little feature called  stateListAnimator  which handles the elevations on Buttons, which leads to shadows.   Remove the stateListAnimator to get rid of the shadows.   You have got multiple options to do that:   In code: ...
1. float运算的坑 float f = 9.9f; float m = f * 100.0f; System.out.println(m);    结果并不是990 不管是乘以100还是100.0f  8.9f 也有这个问题    2. string split问题 String ss = "5.11.17.0/24,,2635167,,0,1,,,,"; int i = 0; System.out.println("size: " + ss.split(",").length); for (Stri ...
Activity之间通过intent传递object时,该object的class需要实现Parcelable。   Interface for classes whose instances can be written to and restored from a Parcel. Classes implementing the Parcelable interface must also have a non-null static field called CREATOR of a type that implements the Parcelable.Creator interf ...
相关工具库很多,都是科学计算的东西:numpy、scipy、pandas、matplotlib、sympy、mayavi2   SciPy官网的介绍 http://www.scipy.org/getting-started.html NumPy's array type augments the Python language with an efficient data structure useful for numerical work, e.g., manipulating matrices. NumPy also provides basic numerical rou ...
一般sdk自带的随机数都是伪随机数   RANDOM.ORG提供了API可以获取真随机数   JSON-RPC API – Release 1   首先需要申请key 调用API的url https://api.random.org/json-rpc/1/invoke   python测试 >>> base_url='https://api.random.org/json-rpc/1/invoke' >>> import requests >>> req_dict={'jsonrpc':'2.0','method' ...
1. py2需要 import urllib    py3需要 import urllib.parse   以下不特殊说明显示的都是py3的结果,编码之后的字符串可以到一些站长网站去解码校验 2. quote_plus用于对字符串编码 >>> quote_plus('中文') '%E4%B8%AD%E6%96%87'   可适用场景,get方式的请求参数需要传入urlencoded json字符串 >>> d = {'a':'a','b':u'b'} >>> d {'a': 'a', 'b': 'b'} ...
问题: * daemon not running. starting it now on port 5037 * error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: XXX(10048) could not read ok from ADB Server * failed to start daemon * error: cannot connect to daemon   原因: 基本是因为5037端口被占用   解决: 一般把什么手机助手退出即可   以下适 ...
搬运自Android Developer   Activity   Managing the Activity Lifecycle   As you'll learn in the following lessons, there are several situations in which an activity transitions between different states that are illustrated in figure 1. However, only three of these states can be static. That is, th ...
Global site tag (gtag.js) - Google Analytics