丰木木de学习计划

We are here to put a dent in the universe


  • 首页

  • 关于

  • 标签

  • 分类

  • 搜索

可以拖拽的树形表格

发表于 2019-08-18 | 分类于 JavaScript | 阅读次数:
字数统计: 271 | 阅读时长 ≈ 1

前几天在吹逼群里见到一个问题很有意思,

1
2
3
4
5
6
7
渲染一个树状结构,节点可以拖拽,实现以下特性
0.节点可以展开/收缩
1.将S从上/下方拖过上一个节点T的中位线时,S节点占位移动到T节点的位置。
2.将S节点拖入T节点20%-50%或50%-80%位置区间,但未穿过50%时,如果停留时间超过0.5秒,则将S节点加入T的子节点,并展开T节点。
3.当用户释放正在拖拽的S节点时,调整节点从属关系。
要求所有视觉由流畅的动画表现。
请梳理其中数据流关系。

自己试着实现了一下

阅读全文 »

react 入参类型判断

发表于 2019-06-02 | 分类于 JavaScript | 阅读次数:
字数统计: 92 | 阅读时长 ≈ 1

在用框架的时候,我们是经常需要对传入的参数做一个类型判断的。框架一般都给我提供了对应的工具函数。比如 react 就提供了 PropTypes 这个玩意,那么如果我们要自己做判断呢,我们要如何来做一个类似的类型检测。

阅读全文 »

git基本操作

发表于 2019-04-08 | 分类于 git | 阅读次数:
字数统计: 674 | 阅读时长 ≈ 2

Git一直都是使用的简单的命令,比如git add、git status、git pull、git push 、git commit、git checkout 、 git merge ,这些在工作的时候基本能满足大部分的需求了,但是一些复杂点的操作,或者其中的原理还是一知半解的,所以买了一些课程,也搜集了一些资料,希望可以把git彻底搞懂,

阅读全文 »

动态规划之“背包问题”

发表于 2018-08-11 | 分类于 leetcode | 阅读次数:
字数统计: 2,244 | 阅读时长 ≈ 11

做个找硬币的问题,然后自己啃了一下相关的动态规划的资料,随笔如下

阅读全文 »

Multiply-Strings

发表于 2018-08-05 | 分类于 leetcode | 阅读次数:
字数统计: 195 | 阅读时长 ≈ 1

题目:Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.

阅读全文 »

双指针

发表于 2018-07-13 | 分类于 leetcode | 阅读次数:
字数统计: 885 | 阅读时长 ≈ 4

今天做了一个题目:Remove Element

1
2
3
4
5
6
7
8
Given an array nums and a value val, 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 by modifying the input array in-place with O(1) extra memory.
The order of elements can be changed. It doesn't matter what you leave beyond the new length.
Example 1:

Given nums = [3,2,2,3], val = 3,
Your function should return length = 2, with the first two elements of nums being 2.
It doesn't matter what you leave beyond the returned length.

大概就是把数组中与val一致的数值去掉,然后,返回与val一致的元素的个数,题目不允许额外再使用一个数组。

阅读全文 »

hexo上传报错:No such device or address

发表于 2018-07-12 | 分类于 hexo | 阅读次数:
字数统计: 188 | 阅读时长 ≈ 1

今天使用hexo上传,报错(bash: /dev/tty: No such device or address)
个人推测和网络有关(网太慢了),但是不想等,所以就搜了一下解决方法

阅读全文 »

数字转成字母

发表于 2018-07-12 | 分类于 leetcode | 阅读次数:
字数统计: 615 | 阅读时长 ≈ 3

发现一个有小坑的题目 Integer to English Words
题目要求:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.

Example 1:
Input: 123
Output: "One Hundred Twenty Three"

Example 2:
Input: 12345
Output: "Twelve Thousand Three Hundred Forty Five"

Example 3:
Input: 1234567
Output: "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"

Example 4:
Input: 1234567891
Output: "One Billion Two Hundred Thirty Four Million Five Hundred Sixty Seven Thousand Eight Hundred Ninety One"

阅读全文 »

Eloquent_JavaScrip中的weresquirrel

发表于 2018-07-12 | 分类于 JavaScript | 阅读次数:
字数统计: 1,373 | 阅读时长 ≈ 8

看到了Eloquent_JavaScrip第四章(对象和数组)),这一章讲了一个松鼠人(weresquirrel)的故事,并用函数来找出其变身的原因,感觉很有趣,便动手实现了一下。数据连接

阅读全文 »

丑数2之自己挖坑埋自己

发表于 2018-07-09 | 分类于 leetcode | 阅读次数:
字数统计: 1,101 | 阅读时长 ≈ 5

今天做了丑数2,遇到个坑,卡主自己好久,所以make先,以后有空再仔细研究

阅读全文 »
123

丰林

丰林的个人博客,有一些网站的知识和前端学习随笔

23 日志
5 分类
27 标签
RSS
GitHub E-Mail
© 2018 — 2019 丰林 | Site words total count: 20.7k
由 Hexo 强力驱动
|
主题 — NexT.Mist v5.1.4