- 博客(95)
- 资源 (25)
- 收藏
- 关注
原创 Error running ‘Android Debugger (-1)‘
Android Studio Attach Debugger突然失效了,看了下Event Log,报一下错误2:10 下午 Can’t bind to local -1 for debugger2:10 下午 Error running ‘Android Debugger (-1)’: Unknown error2:10 下午 Error running ‘Android Debugger (-1)’Invalid argument : Argument invalid[port]网上也有类似的
2021-09-09 14:19:34
1280
原创 Android布局方案-优先展示右侧控件
布局方案-优先展示右侧控件优先展示右侧控件蓝色的textview设置成weight=1 width=0,外层再包一个LinearLayout wrap_content<LinearLayout android:layout_width="480dp" android:layout_height="wrap_content" android:background="#fff" android:orientation="horizon
2021-07-15 20:56:23
873
2
原创 《头条前端埋点设计》一文小节
《头条前端埋点设计》一文小节头条的前端埋点https://mp.weixin.qq.com/s/QanYnjRN5TM_NlJtQzCALg先明确埋点分类,头条定义了两种类型埋点,一种是页面事件,另一种是触发事件。前者又包括两部分,一种页面级别的,一种元素级别的埋点。对应于阿里的页面埋点和曝光埋点。页面事件页面级别页面在前端的定义中以location.pathname区分页面级别可以统计页面的可见时间和活跃时间可见的判断标准:(visible)页面在当前浏览器的 viewport 中,且浏
2021-07-11 23:40:12
1110
2
原创 翻页效果的RecyclerView
实现一个自定义LayoutManager,默认只有一个抽象方法,实现的重点在于onLayoutChildren对页面的布局和滑动操作,当然还有缓存。属性定义mPosition是当前item的位置信息,mPositionOffset是偏移信息,mMinVy是最低的y方向的速度,这个需要根据不同屏幕尺寸来定。private static final int MIN_VY = 300;pr...
2018-07-16 14:44:07
4018
原创 ConcurrentHashmap拾遗
为什么Hashtable ConcurrentHashmap不支持key或者value为null?在很多java资料中,都有提到 ConcurrentHashmap HashMap和Hashtable都是key-value存储结构,但他们有一个不同点是 ConcurrentHashmap、Hashtable不支持key或者value为null,而HashMap是支持的。为什么会有这个区别?在设...
2018-07-16 14:42:40
211
原创 小爱技能开发大赛-抽签技能开发分享
“抽签”技能的开发流程基本沿袭官方给出的Hello World的开发方式。 首先明确技能的功能,一般而言,抽签包括两个步骤,设置抽签人数,依次开始抽签。此外还需要支持查看已经抽签的结果。再看应用场景,因为技能的对象面向于智能音箱,而音箱的人机交互方式只有通过语音进行,所以对于给用户的交互过程既要保证功能的准确传达,又要保证其简洁与稳定。 针对上述要求,小爱开发平台使用意图与词表的交互模型,意图...
2018-06-27 20:15:25
1170
1
原创 美团点评2018 CodeM资格赛(Java语言)
题目一美团在吃喝玩乐等很多方面都给大家提供了便利。最近又增加了一项新业务:小象生鲜。这是新零售超市,你既可以在线下超市门店选购生鲜食品,也可以在手机App上下单,最快30分钟就配送到家。 新店开张免不了大优惠。我们要在小象生鲜超市里采购n个物品,每个物品价格为ai,有一些物品可以选择八折优惠(称为特价优惠)。 有m种满减优惠方式,满减优惠方式只有在所有物品都不选择特价优惠时才能使用,且最多...
2018-05-28 23:51:52
1029
原创 Volley理解
概述物理质量使用Volley 需要Volley.jar(120k),加上自己的封装最多140k。使用OkHttp需要 okio.jar (80k), okhttp.jar(330k)这2个jar包,总大小差不多400k,加上自己的封装,差不多得410k。Volley 的优点非常适合进行数据量不大,但通信频繁的网络操作可直接在主线程调用服务端并处理返回结果可以取消...
2018-05-06 15:24:49
787
原创 【Android面试特辑】Android线程与线程池总结回顾
总结一下Android中Thread和ThreadPool的内容,建议保存图片查看,欢迎补充。
2018-03-22 21:51:42
300
原创 二进制中0的个数
师兄的一道网易面试题问题:求二进制0的个数,要求从第一位为1往后统计个数答:主要考虑正负数情况。对于正数,在不为0的情况下,计算其2进制,容易得0的个数。对于负数,因为已知第一位是1的,所以不用担心有高位0,直接取1,然后依次左移,看&原值是不是0。停止条件是这个数为0。public static int numberOf0(int num){ int count=0; i...
2018-03-18 14:17:44
5002
原创 阿里笔试测试题(零售通App中使用消息数的红点引导用户点击)
题目如下:例子:这道题当时没做出来,一个是因为时间短,一个是因为思路太不成熟。构建这个树比较麻烦,数据结构选好了其实就比较简单。大致要求就是求得一级节点消息数的最大值。构建这棵树,采用HashMap<String,Node>这样可以快速根据字符串找到对应地Node,同时拿一个ArrayList<Node>存储下根节点连接的一级节点,便于后期求一级节点。public clas...
2018-03-15 19:05:42
955
原创 82. Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Given 1->1-
2018-01-11 11:16:55
190
原创 109. Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is defined as a binary tree in which th
2018-01-09 18:49:54
440
原创 剑指offer-42-翻转单词顺序列
牛客最近来了一个新员工Fish,每天早晨总是会拿着一本英文杂志,写些句子在本子上。同事Cat对Fish写的内容颇感兴趣,有一天他向Fish借来翻看,但却读不懂它的意思。例如,“student. a am I”。后来才意识到,这家伙原来把句子单词的顺序翻转了,正确的句子应该是“I am a student.”。Cat对一一的翻转这些单词顺序可不在行,你能帮助他么?
2017-12-23 11:46:21
184
原创 剑指offer-36-数组中的逆序对
在数组中的两个数字,如果前面一个数字大于后面的数字,则这两个数字组成一个逆序对。输入一个数组,求出这个数组中的逆序对的总数P。并将P对1000000007取模的结果输出。 即输出P%1000000007
2017-12-21 09:57:19
241
原创 88. Merge Sorted Array
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold add
2017-09-09 22:04:23
282
原创 581. Shortest Unsorted Continuous Subarray
Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too.You need to fin
2017-09-08 21:07:36
285
原创 605. Can Place Flowers
Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - they would compete for water and both would die.Gi
2017-09-08 16:04:32
225
原创 27. Remove Element
Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant memory.
2017-09-08 15:22:14
231
原创 26. Remove Duplicates from Sorted Array
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with
2017-09-08 14:38:44
212
原创 661. Image Smoother
class Solution { public int[][] imageSmoother(int[][] M) { int[][] ave = new int[M.length][M[0].length]; for (int i = 0; i < M.length; i++) { for (int j = 0; j < M[i]
2017-09-07 22:14:47
306
原创 643. Maximum Average Subarray I
Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the maximum average value.Example 1:Input:
2017-09-07 22:11:51
272
原创 1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same
2017-09-06 23:30:45
293
原创 121. Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), d
2017-09-06 22:22:10
361
原创 Android7.0完美适配——FileProvider拍照裁剪全解析
//博客链接:http://wenjiehe.com/2017/05/30/2017-05-30-android-fileprovider/在做android7.0的适配时,发现拍照裁剪图片等功能莫名其妙地崩溃了。通过观察控制台的崩溃记录,原因很明显,file:// 不被允许作为一个附加的 Uri 的意图,否则会抛出 FileUriExposedException,接下来就依次适配之。...
2017-05-30 20:32:02
22017
原创 409. Longest Palindrome
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.This is case sensitive, for example "Aa" is not con
2017-05-10 22:43:38
249
原创 242. Valid Anagram
Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat", t = "car", return false.Note:You may ass
2017-05-10 22:23:25
288
原创 169. Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element
2017-05-10 22:08:12
258
原创 563. Binary Tree Tilt
Given a binary tree, return the tilt of the whole tree.The tilt of a tree node is defined as the absolute difference between the sum of all left subtree node values and the sum of all right subtre
2017-05-10 21:43:35
394
原创 基于Hexo的博客同步中的一些问题
这篇文章讲讲在我的Octopress博客更换成基于Hexo的博客后,为了在多台电脑能够同步中遇到的问题。我基于这个回答来解决这个问题的。问题主要出在theme上,由于NexT主题引自第三方,所以这就牵扯到git中的submodule问题了。想偷懒把不引入,但是好像不行,于是按以下思路进行解决:clone NexT官方的github到自己的仓库,然后引入子模块,我这边不知道为什么有“already e
2017-05-06 21:26:15
1617
原创 IntelliJ IDEA下使用默认Spring MVC框架运行失败的解决方案
使用IDEA,直接导入Spring MVC框架目录结构: web.xml<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" x
2017-04-28 20:51:45
6835
1
原创 安装APK在android7.0以下版本出现INSTALL_PARSE_FAILED_NO_CERTIFICATES错误的解决方案
android studio升级到2.3,然后打包发布程序时,在android 7.0 安装的好好的,其他版本居然出错(我在华为进行的兼容性测试),回想了一下我升级的内容,经过一番google,把问题定位在android studio最后的签名版本选择上。这是官方说明:Android 7.0 引入一项新的应用签名方案 APK Signature Scheme v2,它能提供更快的应
2017-04-22 21:18:13
10130
4
原创 404. Sum of Left Leaves
Find the sum of all left leaves in a given binary tree.Example: 3 / \ 9 20 / \ 15 7There are two left leaves in the binary tree, with values 9 and 15 respectively. Return 24
2017-03-03 21:12:34
436
Chart.js-2.7.2 全部资料
2018-04-23
libsublime-imfix.so
2018-01-04
kotlin学习教程
2017-05-21
chart.js v2.5.0 全部资料
2017-05-14
Spring MVC IDEA版本DEMO
2017-04-28
Nanopi2创客秘籍
2016-03-14
BootLoader(for Smart210)
2016-03-13
libmgncs-1.0.8.tar
2016-03-04
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人