自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(170)
  • 收藏
  • 关注

原创 yolo系列(1):使用yolov3检测红绿灯

镜像地址: https://maozezhong.github.io/2018/04/29/yolo%E7%B3%BB%E5%88%97%EF%BC%881%EF%BC%89%EF%BC%9A%E4%BD%BF%E7%94%A8yolov3%E6%A3%80%E6%B5%8B%E7%BA%A2%E7%BB%BF%E7%81%AF/#more背景官网:YOLO: Real-Time Ob...

2018-04-29 18:37:03 10141 18

原创 扇形涂色问题

题目描述将一个圆形等分成N个小扇形,将这些扇形标记为1,2,3,…,N。现在使用M种颜色对每个扇形进行涂色,每个扇形涂一种颜色,且相邻的扇形颜色不同。求:有多少种涂色方法。分析设a(n)为符合要求的第n个扇形的涂色方法。 对扇形1有m种涂色方法,扇形2有m-1种涂色方法,扇形3也有m-1种涂色方法,扇形n也有m-1种涂色方法。于是,共有m×(m−1)^(n−1)种不同的涂色方法,...

2018-03-13 10:33:40 4554

原创 决策树剪枝

普通决策树剪枝决策树之决策树剪枝预剪枝 预剪枝是在完全正确分类训练集之前,较早的停止树的生长。具体在什么时候停止决策树的生长有多种不同固定方法: 1)决策树到达一定高度。 2)到达此节点的实例个数小于某一个阈值。 3)计算每次扩张对系统性能的增益,如果增益值小于某一个阈值则停止生长。 4)到达此结点的实例具有相同的特征向量,而不必一定属于同一类, 也可停止生长。预剪枝优缺点 ...

2018-03-05 10:08:34 467

转载 Ubuntu下LAMP环境搭建 Apache、MySQL、PHP

http://www.linuxidc.com/Linux/2016-01/127180.htm在测试apache的时候,编写info.php后,访问http://127.0.0.1/info.php显示404,将info.php移到html文件夹下就Ok了

2016-10-06 21:41:49 486

转载 ubuntu上的python+pip安装

http://www.linuxidc.com/Linux/2016-07/132875.htm

2016-10-04 11:03:44 399

转载 [scrapy]如何让你的scrapy爬虫不再被ban

http://www.cnblogs.com/rwxwsblog/p/4575894.html

2016-09-07 20:09:56 343

转载 scrapy 403error

原文链接:http://blog.csdn.net/tchenjx/article/details/51723726 user_agent:http://www.360doc.com/content/12/1012/21/7662927_241124973.shtml

2016-09-07 09:34:56 481

原创 Python scrapy run with Unhandled error in Deferred解决方案

错误提示是win32api有问题。 解决方案是重新下载pywin32。

2016-09-04 09:38:14 1334

转载 python--Scrapy安装

windows下pip安装Scrapy各种问题。。。 按照这个来:http://my.oschina.net/xtfjt1988/blog/364577 我是安了lxml,还有C++插件,然后pip install Scrapy就能成功了

2016-09-04 08:53:38 235

转载 Python爬虫利器二之Beautiful Soup的用法

http://cuiqingcai.com/1319.html

2016-08-30 14:46:35 307

转载 Python-第三方库requests详解

Requests 是用Python语言编写,基于 urllib,采用 Apache2 Licensed 开源协议的 HTTP 库。它比 urllib 更加方便,可以节约我们大量的工作,完全满足 HTTP 测试需求。Requests 的哲学是以 PEP 20 的习语为中心开发的,所以它比 urllib 更加 Pythoner。更重要的一点是它支持 Python3 哦!Beautiful is bett

2016-08-30 12:11:27 487

转载 python导入第三方库

Python 是一门优雅的语言,简洁的语法,强大的功能。当然丰富的第三方库,更能加速开发。那么问题来了,如何安装这些第三方库(包)呢?安装第三方库的方式其实不多。下面就介绍一些技巧。源码安装 很多第三方库都是开源的,几乎都可以在github 或者 pypi上找到源码。找到源码格式大概都是 zip 、 tar.zip、 tar.bz2格式的压缩包。解压这些包,进入解压好的文件夹,通常会看见一个 se

2016-08-29 21:18:21 21990 1

转载 在Windows下安装pip

原始链接:http://stackoverflow.com/questions/4750806/how-to-install-pip-on-windowspip is a tool for installing and managing Python packages, such as those found in the Python Package Index. It’s a replaceme

2016-08-29 21:00:19 459

原创 python中文注释

首先要确保eclipse编辑器环境的编码为utf8,这个是大前提;其次如果py文件中含有中文字符的话,需要在py文件中对编码进行声明。 修改eclipse编辑器编码: A) 设置工作空间编码:Window->preferences->General->Workspace->UTF-8 B) 设置编辑器编码:Window->preferences->General ->Editors->Text

2016-08-18 16:16:28 284

原创 简便使用命令行跑脚本

1.将cmd.exe快捷方式设置到桌面 桌面右击->新建->快捷方式(在请键入项目地址中填入“c:\windows\system32\cmd.exe”)2.设置其实位置为Python脚本的存放位置 右击cmd.exe->属性->起始位置出填入你存放Python脚本的地址3.打开cmd.exe,键入 python 脚本名.py

2016-08-17 15:42:52 3865

转载 TypedArray和obtainStyledAttributes使用

转载地址:http://www.cnblogs.com/rayray/p/3382087.html 在编写Android自定义按钮示例基础上,如果要指定字体大小产生这样的效果:其实是不需要自定义变量的,可以直接使用TextView的配置属性:<com.easymorse.textbutton.TextButton android:layout_width="fill_parent" an

2016-08-06 15:07:04 200

转载 java线程:wait,notify,notifyAll

转载地址:http://www.cnphp6.com/archives/62258 wait()、notify()、notifyAll()是三个定义在Object类里的方法,可以用来控制线程的状态。这三个方法最终调用的都是jvm级的native方法。随着jvm运行平台的不同可能有些许差异。 如果对象调用了wait方法就会使持有该对象的线程把该对象的控制权交出去,然后处于等待状态。

2016-08-05 16:39:56 185

转载 Eclipse配置主题以及文字风格

方法一:从Eclipse Marketplace中下载http://eclipsecolorthemes.org/ 这个网站上提供了很多已经配置好的颜色主题,有xml和epf两种格式,你喜欢哪个就下载下来。 我下载的是.epf文件,下载下来后File->Import->General->Preferences->找到你的.epf文件->Finish。你会发现,Eclipse的编辑环境变成了你要的那

2016-08-05 16:03:15 2013

转载 停止java线程方法,小心interrupt

转自:http://www.blogjava.net/jinfeng_wang/archive/2008/04/27/196477.html总结一下: - 一个线程运行完后它就自然死亡了。 - interrupt方法无法终止正在运行的线程。 - 使用共享变量(shared variable)发出信号,告诉线程必须停止正在运行的任务。线程必须周期性的核查这一变量(尤其在冗余操作期间),然后

2016-08-04 09:30:29 274

原创 android Run模式也会出现"Waiting for debugger"的解决方法

出现“waiting for debugger”窗口是在debug模式下运行出现的。但是,今天我在run模式下也出现了此窗口,并且一直如此。卸载程序重新运行也是如此。android真机在脱离电脑的情况下,会一直死在“waiting for debugger”。解决方法:重新启动手机 = = 。。。。。。。。。。。 可能是缓存什么的没有清干净,具体原因不清楚

2016-08-03 18:20:16 532

转载 如何将github项目导入Android Studio

从github上下载了一个开源项目:MoneyTextView 存放地址:D:\android_new\MyProject\MoneyTextView在导入前,要更改一些参数:第一个文件:MoneyTextView\build.gradledependencies { classpath 'com.android.tools.build:gradle:0.6.+'

2016-08-02 16:04:15 2751

原创 Error:(20, 45) 错误: <匿名com.example.administrator.androidthread.MainActivity$1>不是抽象的, 并且未覆盖Handler中的抽象

原因:自动的import错将java.util.logging.Handler包import进来了;解决: 将import java.util.logging.Handler替换成 import android.os.Handler;

2016-07-28 11:06:02 3451 1

原创 替代setLatestEventInfo()的方法

最近在看《第一行代码》,到通知这一块内容的时候,涉及到了setLatestEventInfo()的使用,但是现在android已经不支持这个方法了,于是上网查找了一下替代方法。先上原来使用setLatestEventInfo()的代码//1.新建一个通知管理器NotificationManager manager = (NotificationManager)getSystemService(NO

2016-07-27 10:58:45 717

原创 (报错)java.lang.SecurityException: Permission Denial: opening provider

测试调用外部提供的ContentProvider时候报错解决: 在自定义内容提供类的工程中的manifest加:<provider android:name="com.example.administrator.databasetest.DatabaseProvider" android:authorities="com.example.databasetest.provi

2016-07-26 10:49:32 1169 1

原创 216. Combination Sum III

题目:https://leetcode.com/problems/combination-sum-iii/代码:public class Solution { public List<List<Integer>> combinationSum3(int k, int n) { int[] num = {1,2,3,4,5,6,7,8,9}; List<List

2016-07-20 20:25:18 67

原创 140. Word Break II

题目:https://leetcode.com/problems/word-break-ii/代码:public class Solution { private final Map<String, List<String>> cache = new HashMap<>(); private boolean containsSuffix(Set<String> dict, String

2016-07-19 10:15:29 83

原创 Genymotion无法登陆?手动下载模拟器

1.OVA下载 选择适合版本下载 http://pan.baidu.com/s/1kUCDVt92.找到以下路径:C:\Users\Administrator\AppData\Local\Genymobile\Genymotion\ova 将下载的ova放到这个文件夹下3.双击ova,导入VirutalBox4.启动genymotion即可

2016-07-17 10:44:17 520

原创 35. Search Insert Position

题目:https://leetcode.com/problemset/algorithms/#代码:public class Solution { public int searchInsert(int[] nums, int target) { int i; for(i=0;i<nums.length;i++) { i

2016-07-17 10:33:43 234

原创 VirtualBox\Genymotion--安装及问题解决

软件地址:1.虚拟机–VirtualBox http://pan.baidu.com/s/1kU9WfYJ2.Genymotion http://pan.baidu.com/s/1hrAIiLu软件安装过程出现的问题及解决方法:问题1:VirtualBox打不开 解决1:安装路径选择默认的!!!!,或者只是将c盘改成d盘(我是这么解决的。。。) 解决2:删除你的home 文件夹 /home/

2016-07-16 22:08:34 841

原创 96. Unique Binary Search Trees

题目:https://leetcode.com/problems/unique-binary-search-trees/代码://G(n) = G(0) * G(n-1) + G(1) * G(n-2) + … + G(n-1) * G(0) public class Solution { public int numTrees(int n) { int[] g = new

2016-07-16 10:35:16 180

原创 Android Studio---Plugin is too old(插件版本太低)解决方法

1.下载适合版本的gradle https://github.com/inferjay/AndroidDevTools#sdk-tools2.studio中 file->setting-> 红圈处为gradle的路径

2016-07-15 16:38:54 1696

原创 AVL树(平衡二叉树)

一颗AVL树是其每个节点的左子树和右子树的高度最多差1的二叉查找树(空树的高度定位-1)。 二叉查找树的性质:对于树中的每个节点X,它的左子树中所有项的值小于X中的项,而它的右子树的所有项的值大于X中的项。AVL树的插入在树中插入一个值可能破坏AVL树的性质,所以我们要对树进行调整,这一操作就是**旋转**。在插入以后,只有从插入点到根节点的的路径上的节点的平衡可能改变,因为只有这些节点的子树可

2016-07-15 13:26:27 753

原创 108. Convert Sorted Array to Binary Search Tree

题目:https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/代码:/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode

2016-07-15 10:51:45 215

原创 22. Generate Parentheses

题目:https://leetcode.com/problems/generate-parentheses/代码:public class Solution { public List<String> generateParenthesis(int n) { List<List<String>> lists = new ArrayList<>(); lists

2016-07-15 10:17:10 215

原创 137. Single Number II

题目:https://leetcode.com/problems/single-number-ii/代码:public class Solution { public int singleNumber(int[] nums) { Arrays.sort(nums); int i; for(i=0;i<nums.length-2;i=i+3)

2016-07-14 10:07:33 171

原创 230. Kth Smallest Element in a BST

题目:https://leetcode.com/problems/kth-smallest-element-in-a-bst/代码:/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; *

2016-07-13 10:18:21 163

原创 328. Odd Even Linked List

题目:https://leetcode.com/problems/odd-even-linked-list/代码:/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; }

2016-07-13 09:47:42 178

原创 318. Maximum Product of Word Lengths

题目:https://leetcode.com/problems/maximum-product-of-word-lengths/代码:思路: 用marks数组来区分两个字符串是否有相同的字母。在本程序中每个字母对应一位的1,比如a对应1,b对应10(二进制),c对应100.。。。。。。那么如果marks与一下是0的话说明没有相同的字母public class Solution {

2016-07-12 11:56:11 157

原创 144. Binary Tree Preorder Traversal

题目:https://leetcode.com/problems/binary-tree-preorder-traversal/代码:/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; *

2016-07-11 09:31:42 150

原创 94. Binary Tree Inorder Traversal

题目:https://leetcode.com/problems/binary-tree-inorder-traversal/代码:/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; *

2016-07-11 09:27:52 182

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除