自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Dufre

Stay Hungry,Stay Foolish

  • 博客(253)
  • 问答 (2)
  • 收藏
  • 关注

原创 TFLite Interpreter

文章目录ArchitechtureModel StructureSubgraphOperatorClass StructureTfLiteNode/TfLiteRegistrationInterpreter ImplementmmapTfLiteNodeTfLiteRegistrationTfLiteContextWorkflowInterpreterBuild::operator()Subgraph::Invoke()ExampleParseNodesParseTensorsSetTensorParame

2021-05-14 22:28:50 614

原创 AI学习笔记-CNN

A toy ConvNet: X’s and O’sSays whether a picture is of an X or an OFor exampleTrickier CasestranslationscalingrotationweightDeciding is hardWhat computers see?The red area is incorrectConvNet match pieces of the imageFeatures match pie

2021-02-14 15:05:04 453 1

原创 Linux操作系统之进程数据结构

前言操作系统对我来说很抽象的,学了几年,工作中天天打交道,却不懂它。偶然听了极客时间的一门课(这里就不打广告了),很有启发。其实操作系统就好比一个公司:进程管理:可以理解为公司的项目管理内存管理:可以理解为公共资源的管理,比如会议室文件系统:可以理解为项目开发过程中文档的管理输入输出系统:可以理解为售前售后体系进程和线程进程:相当于一个项目线程:相当于一个项目中一个个的开发任务就我的工作而言,一块开发板的软件开发(基于Android/Linux)叫一个项目,一个项目的开始我们叫开案。

2020-10-15 00:43:30 455 2

原创 Linux操作系统之进程如何调度?

前言操作系统对我来说很抽象的,学了几年,工作中天天打交道,却不懂它。偶然听了极客时间的一门课(这里就不打广告了),很有启发。其实操作系统就好比一个公司:进程管理:可以理解为公司的项目管理内存管理:可以理解为公共资源的管理,比如会议室文件系统:可以理解为项目开发过程中文档的管理输入输出系统:可以理解为售前售后体系公司有很多项目,但人手是有限的,有的项目时间很紧,有的项目是VIP客户,应该先排;有的项目可以缓缓,但也不能让客户等太久,所以作为公司老大,你应该如何分配任务呢?对操作系统来说,CP

2020-10-15 00:41:14 1524

原创 Linux操作系统之进程空间管理的用户态和内核态是如何划分的?

前言操作系统对我来说很抽象的,学了几年,工作中天天打交道,却不懂它。偶然听了极客时间的一门课(这里就不打广告了),很有启发。其实操作系统就好比一个公司:进程管理:可以理解为公司的项目管理内存管理:可以理解为公共资源的管理,比如会议室文件系统:可以理解为项目开发过程中文档的管理输入输出系统:可以理解为售前售后体系本篇文章主要有以下内容:进程空间管理之用户态和内核态是如何划分的用户态和内核态的划分进程task_struct里面有一个struct mm_struct的结构来管理内存st

2020-10-15 00:34:47 816

原创 如何用vscode画图

文章目录draw.io是我最喜欢的画图软件,没有之一,今天偶然看到它可以嵌入到vscode里面,就试用了一下,真香。github传送门vscode-drawio第一步:点击Draw.io into VS Code第二步:点击install第三步:选择打开Visual Studio Code第四步:这里就会自动去安装了,我这里已经安装过了注意:这里有可能会提示vs code版本过低,只要更新到最新版本就行了。最后就可以开始work啦最后还是要放上我的公众号,哈哈...

2020-05-15 20:44:14 11948 2

原创 leetcode No336. Palindrome Pairs

QuestionGiven a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + words[j] is a palindrome.Example 1:Inp...

2020-04-05 15:15:05 283

原创 leetcode No315. Count of Smaller Numbers After Self

QuestionYou are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smaller elements to the right of nums[i].Exa...

2020-03-03 14:29:29 329

原创 leetcodeNo743. Network Delay Time

Question743. Network Delay TimeThere are N network nodes, labelled 1 to N.Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node, v is the target nod...

2020-02-25 22:59:34 201

原创 leetcode No617. Merge Two Binary Trees

Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary tree....

2020-01-07 18:25:07 156

原创 Android A/B system - update_engine

文章目录update_engine overviewtrigger update_engine to start updateActionInstallActionDownloadPlanActionZERO/DISCARDREPLACE/REPLACE_BZ/REPLACE_XZSOURCE_COPYSOURCE_BSDIFF/BROTLI_BSDIFFFilesystemVerifierAct...

2020-01-04 17:36:43 3086 6

原创 leetcode No369. Plus One Linked List

QuestionGiven a non-negative integer represented as non-empty a singly linked list of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except the number 0 ...

2020-01-03 00:18:09 176

原创 leetcode No593. Valid Square

QuestionGiven the coordinates of four points in 2D space, return whether the four points could construct a square.The coordinate (x,y) of a point is represented by an integer array with two integers...

2019-12-31 16:32:04 185

原创 leetcode No283. Move Zeroes

QuestionGiven an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.Example:Input: [0,1,0,3,12]Output: [1,3,12,0,0]Algori...

2019-12-31 16:02:43 153 1

原创 leetcode No1114. Print in Order

QuestionSuppose we have a class:public class Foo { public void first() { print("first"); } public void second() { print("second"); } public void third() { print("third"); }}The same instanc...

2019-12-27 10:08:50 209

原创 C++多线程同步的几种方式

文章目录Overviewmutexlock_guardunique_lockcondition_variablefuturepromisepackaged_taskasyncReferenceOverviewC++的多线程同步方式有这么几种:mutexlock_guardunique_lockcondition_variablefuturepromisepackaged...

2019-12-26 20:25:35 8744 2

原创 leetcode No557. Reverse Words in a String III

QuestionGiven a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.Example 1:Input: "Let's take LeetCode con...

2019-12-25 17:08:20 133

原创 I2C和SPI协议

I2CI2C(Inter-Integrated Circuit)是Philips公司开发的两线式串行总线,I2C支持多主控(Multi-Mastering)模式,任何能够进行发送和接收的设备都可以成为Master,Master能够控制数据的传输和时钟频率,在任意时刻只能有一个主控。组成I2C总线的两个信号为数据线SDA和时钟SCL。I2C规定:每一支I2C设备都有一个唯一的七位设备地址数...

2019-12-23 20:15:56 463 2

原创 认真努力 - 我的2019

偶然看到CSDN的新年flag征文活动,也写下对2019的展望吧。工作工作是第一要务,在半年的时间内,研究了Android 9.0 Framework层的Accessibility Manager和Activity Manager。并且写了两篇博文:Android 9.0源码学习 - Launcher ActivityAndroid 9.0源码学习-AccessibilityManager...

2019-12-23 11:32:40 1147 2

原创 Android A/B system - bootctrl

Android A/B system系列Android A/B System概述Android A/B System -Generate OTA PackageAchitecture在Android A/B System概述中有讲到A升B的一个例子。下面这张图是想说明两个问题:启动的时候是如何知道要从A启动还是B启动?升级的时候是如何要更新A还是B?图中有两个流程,和涉及的一些模...

2019-12-20 17:37:51 3280

原创 leetcode No389. Find the Difference

QuestionGiven two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter at a random position.Find the letter that w...

2019-12-19 19:05:55 176

原创 Android A/B System - Generate OTA Package

Makefile生成ota包的命令是make otapackage,可以看到.PHONY: otapackage,它依赖于$(INTERNAL_OTA_PACKAGE_TARGET)。接下来看$(INTERNAL_OTA_PACKAGE_TARGET),它依赖:$(BRILLO_UPDATE_PAYLOAD)(for a/b system)$(BUILT_TARGET_FILES_PA...

2019-12-10 19:26:32 2423 2

原创 Android9.0源码学习-Sensor Framework

在之前的学习中,Android Sensor概述介绍了常用传感器的功能,测量值的含义,测量原理等等。Android Sensor应用介绍了app如何得到Sensor的数值。那么接下来就应该思考应用层是如何得到硬件测量的数值,传感器的数值又是如何一步一步上传至应用层的。...

2019-11-12 00:16:25 1453

原创 Android Sensor应用

文章目录Sensor types supported by the Android PlatformClasses and InterfacesSensor ManagerSensorSensorEventSensorEventListenerAPI and Example使用步骤ExampleMotion sensorsPosition sensorsEnvironment sensorsSe...

2019-10-11 17:30:48 489

原创 Android Sensor概述

文章目录Sensor分类Sensor axesMobile device axesAutomative axesMEMSaccelerometers/gravitygyroscopesmagnetometersilluminationbarometertemperatureproximitySensor就是传感器,提供高精度的原始数据,比如操作系统,手势,倾斜等动作就是利用重力传感器的数据来判断...

2019-09-30 16:29:13 1809

原创 Android屏幕适配

前言这篇文章来源于最近遇到的一个问题:微博在我们的平台上crash。查看log,一开始怀疑的点在找不到资源文件上,但是反编译发现资源文件存在。android.content.res.Resources$NotFoundException: Drawable com.sina.weibo:drawable/divider_horizontal_timeline with resource ID ...

2019-08-10 17:35:46 577

原创 Android A/B system - update_engine(一)

Android A/B System的升级过程是怎样的?理解这一过程就需要理解update_engine的逻辑。首先来看main.cc,main.cc主要做了这些事:log相关初始化crc-32 table调用update_engine_daemon.Run()/system/update_engine/main.ccint main(int argc, char** argv) ...

2019-07-22 20:34:36 2468

原创 Android Studio使用布局编辑器

布局编辑器可以使用拖拽的方式构建界面,不需要手动写布局XML文件。新建一个工程,建好后,双击activity_main.xml,会出现布局编辑器。布局编辑器简介先来看看官网的教程,每个区域的作用。这里注意左下方,可以切换Design/Text。1. 工具箱:您可以拖动到布局内的视图和视图组列表。2. 组件树:查看布局的层次结构。3. 工具栏:用于在编辑器中配置布局外观和更改某些布局属...

2019-07-18 17:16:29 9884 2

原创 leetcode No337. House Robber III

QuestionThe thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the root, each house has one and only one parent house. Aft...

2019-07-11 18:06:15 245 4

原创 leetcode No213. House Robber II

QuestionYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are arranged in a circle. That means the first ...

2019-07-11 18:04:46 149

原创 leetcode No198. House Robber

QuestionYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjac...

2019-07-11 18:01:32 133

原创 leetCode No162. Find Peak Element

# QuestionA peak element is an element that is greater than its neighbors.Given an input array nums, where nums[i] ≠ nums[i+1], find a peak element and return its index.The array may contain multip...

2019-04-30 16:15:41 210

原创 leetcode No1022. Sum of Root To Leaf Binary Numbers

Welcom to follow Dufre/LeetCodeQuestionGiven a binary tree, each node has value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit. For example, if th...

2019-04-11 16:50:31 262

原创 leetcode No208. Implement Trie (Prefix Tree)

Welcome to Github- LeetCodeSolutionThe data structure Trie (Prefix tree)You can see 《Algorithm》 Chapter 5.2 Triesbool isWord whether the node corresponds to the end of the key, or is just a key p...

2019-04-06 13:49:16 228

原创 Android A/B System概述

OverviewA/B update又叫无缝升级,是Android提出的一种新的升级方式。可以简单理解为,内存中有两套系统(假设为A和B),你正在使用A,B在更新,你仍然可以使用,等B升级好了,再切换为B。优点:更新系统的时候不会影响用户的操作,不需要长时间的等待(因为有两套系统)更新系统的时候不会刷成砖头(失败了可以回到原来的系统,系统中总是有一套可用的系统)缺点:因为有两套系...

2019-03-19 17:49:08 5737 2

原创 Android System Architecture

Android System Architecture包括以下几个部分:Application framework:Application framework是Android应用开发经常用到的,简单来说是给应用开发人员提供了丰富的接口,使之能专注业务,而不是底层实现。Binder IPC:IPC是指进程间通信(Inter-Process Communication) ,像应用程序使用系统...

2019-03-18 17:44:20 678

原创 leetcode No240. Search a 2D Matrix II

QuestionWrite an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted in ascending from left to right.Integers ...

2019-02-20 19:27:36 120

原创 leetcode No145. Binary Tree Postorder Traversal

QuestionGiven a binary tree, return the postorder traversal of its nodes’ values.Example:Input: [1,null,2,3] 1 \ 2 / 3Output: [3,2,1]Output: [3,2,1]Follow up: Recursive solu...

2019-01-29 11:36:49 185

原创 leetcode No448. Find All Numbers Disappeared in an Array

QuestionGiven an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements of [1, n] inclusive that do not appear in this arra...

2019-01-18 19:49:28 141

原创 leetcode No461. Hamming Distance

QuestionThe Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.Note:0 ≤ x, y ...

2019-01-17 19:45:11 141

空空如也

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

TA关注的人

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