这篇文章将涉及到线程池,线程池执行程序,和他们在Android中的使用。
我们将使用很多的利用,详细的(thoroughly)介绍这些主题。
李晓鹏
Adam
-
-
安卓计算下载速度
昨天开始封装一个安卓多线程下载器,在写的过程中,猜测想加入检测下载过程中的速度,于是google一番,得出一个比较靠谱的答案,在此总结一下。
-
Android拍照上传至PHP服务器并写入MySql数据库(下)
Android实现
调用系统相机,拍照:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); getFileUri(); intent.putExtra(MediaStore.EXTRA_OUTPUT, file_uri); startActivityForResult(intent, CODE_CAMERA); private void getFileUri() { image_name = Calendar.getInstance().getTimeInMillis() + ".jpg"; file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + File.separator + image_name); file_uri = Uri.fromFile(file); }
-
Android拍照上传至PHP服务器并写入MySql数据库(上)
-
anonymous
-
English Jokes(英文笑话)
1. 十个大兵与两个小偷的故事
Ten soldiers were setting up tents in the forest preparing for the night. Later, two thieves arrived and attempted to rob them of their rations, but were caught. The soldiers told them, "We would kill you, but we're in a good mood today. We'll release you if you can make us all laugh." The thieves reluctantly agreed. One begins to tell a humorous story. After the story, nine of the soldiers are laughing hysterically. However, one is merely looking at the thief with a blank stare. Consequently, one soldier told the thief "Sorry, not all of us laughed," and killed him. The other thief was nervous after seeing his friend killed, so he told a much less entertaining story. No soldiers were laughing except for the one who didn't laugh previously, so they killed the second thief as well. After killing the thieves, the soldiers asked their friend, "Why did you laugh during the second thief's story but not during the first's? It was much funnier after all." He responded, "When the second thief was speaking, I finally understood the first thief's story, and it was damn funny."
引用Zootopia(疯狂动物城)的一个场景,so hilarious!:
-
PHP学习笔记
php文件操作的模式
- r 只读权限打开文件
- w 只写权限打开文件,擦除内容,如果没有则新建文件
- a 只写权限打开文件
- x 新建一个只写权限的文件
- r+ 打开读/写权限文件
- w+ 打开读/写权限的文件, 擦除内容,如果没有则新建文件
- a+ 打开读/写权限文件,如果没有则新建文件;
- x+ 新建一个读/写权限的文件
将表单提交到本身页面
只需将form的action 设置为
<?php echo $_SERVER['PHP_SELF'];?>
为了防止跨站点攻击(XSS),我们通常需要使用htmlspecialchars()
避免$_SERVER[“PHP_SELF”] 被利用。如下:<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
正则匹配规则
- [abc] 单独的字符串 :a,b或c
- [^abc] 任意的单独字符串单不是a,b,或c
- [a-z] a-z任意的单独字符串
- [a-zA-Z] a-z 或A-Z中任意的单独字符串
- ^ 匹配整行开头 (比如 ^\d+匹配的是任意的数字开头的字符串)
- $ 匹配整行结尾 (比如\d+$匹配任意以数字结尾的字符串)
- \A 匹配字符串输入的开头
- \z 匹配字符串输入的结尾
- . 任意单个字符串
- \s 任意空字符串
- \S 任意非空字符串
- \d 任意数字
- \D 任意非数字
- \w 任意任何单字符(数字,字母,下滑线)、
- \W 任意非字符
- \B 匹配任意链接字符串
- (…) 捕获封闭的内容
- (a|b) 匹配a或b
- a? 0或1个a
- a* 0或多个a
- a+ 1或多个a
- a{3} 三个a
- a{3,} 3个或更多a
- a{3,6} 3到6个a
- i 忽略大小写 m 匹配多行 x 忽略空白
-
java8教程-泛型(Generics)
- 原文链接 [https://docs.oracle.com/javase/tutorial/java/generics/index.html)
- 翻译: Adamin90
- 转载请注明出处,谢谢!
泛型(已更新)
在任何繁琐的(nontrivial)软件项目中,bug是家常便饭。细心的规划,编程和测试可以帮助减少bug的普遍性(pervasiveness),但是无论如何,无论在哪里,bug总会伺机悄悄溜进(creep)你的代码,因为很明显,新的特性会不断的被引入,并且你的代码基数会不断变大和复杂。
幸运的是,一些bug相比其它比较容易检测。编译时bug可以在早期被检测到;你可以利用编译器的错误信息查明是什么问题并且解决,就在那时。然而,运行时bug会更加未预知,他们不会立即展示出来,不知道什么时候发生,可能根本不在程序真正出现问题的点上。
泛型通过更多的在编译时检测bug为你的代码增加了稳定性。
-
翻译:no more findViewById
-
GoodNight
use one day for establish this blog,thanks for opensource!
Now we can say good night!
``