- 博客(455)
- 资源 (36)
- 问答 (1)
- 收藏
- 关注

原创 中国电信 CTExcel - 亲测境外首选电话卡(推荐码:SHQL 或 KJNC)
官网中国电信美洲公司CTExcelhttps://www.ctexcel.us/index_pc.jsp?language=zh微信公众号 - “中国电信美洲公司”亲测好用因为公司内部调动,12月要去美国工作。机缘巧合,看到了网友推荐的境外电话卡 - 中国电信CTExcel。哈哈,是不是必须点进去瞅一眼~ 这一看一对比不要紧,当下就决定出国就用它了。话不多说,看图:...
2018-12-13 11:46:37
7191
6
原创 React 入门 04 - props 和 state
前言在前文React 入门 03 - 元素与组件中学习了React基础元素与组件,今天来探究一下React组件的两个基本属性props和state的用法与区别。它们的一个重要的不同点就是:props是传递给组件的(类似于函数的形参),具有只读特性,是不可修改的。state是组件内自己管理的(类似于函数内声明变量),是可以用特定方式进行值更新的。propsprops(“propert...
2020-04-09 14:33:48
529
原创 React 入门 03 - 元素与组件
前言从React 入门 02 - JSX学习了JSX的基本用法,本文我们开始深入探讨React 元素与组件。React 元素元素是构成React引用的最小砖块,描述了你在屏幕上想看到的内容。与浏览器的 DOM 元素不同,React 元素是创建开销极小的普通对象。React DOM 会负责更新 DOM 来与 React 元素保持一致。ReactDOM.render(...) 即用...
2020-04-09 03:20:54
541
原创 React 入门 02 - JSX
前言在 React 入门 01 - Hello World中,简单了解了下React基本概念以及如何运用到Html中。现在我们学习一下在React中配合使用最多的JSX相关知识。JSXJSX,是一个 JavaScript 的语法扩展。比如如下行语句,它既不是单纯Html语句也不是普通Java Script。JSX 可以很好地描述 UI 应该呈现出它应有交互的本质形式,在React中配合...
2020-04-08 06:40:07
528
原创 React 入门 01 - Hello World
前言基于项目需求,最近开始不得不接触前端开发的领域啦。吼吼,从此是不是可以成为所谓全栈开发了????~此系列学习笔记依然是以帮助自己学习、消化以及回忆为目的,将会涉及学习React,Type Script 以及目标 React Native 的心路历程。Git ????戳我吧~ReactReact 官方系列教程是我学习的主要参考资料。React 是一个用于构建用户界面的 JavaScri...
2020-04-08 05:45:14
454
原创 改善代码质量编程规范 - 学习总结
命名与注释命名范围项目名 包名 接口名 类名 函数名 变量名 参数名原则建议准确达意 对不同作用域,合理选择不同的长度。作用域较小如局部变量,可使用较短的缩写。 参考经典开源系统,使用耳熟能详的名字 借助上下文简化命名 借助类的信息简化属性和函数的命名,无需在属性和函数名字中再加入类名 借助函数的信息简化参数的命名 增加可读、可搜索醒 避免使...
2020-02-06 09:58:48
624
原创 Java Collections - Array 和 String 常用函数
Array基本操作完整代码请戳????GitHub~Array to String使用 Arrays.toString(...) 将数组转换为基本字符串。String[] array = new String[] {"One", "Two", "Three"};System.out.println(array); // [Ljava.lang.String;@61bbe9baSy...
2019-10-10 07:25:02
650
转载 Get to know Lambda and Functional Interfaces in Java 8
In simple words, a lambda expression is an instance of a functional interface. But a lambda expression itself does not contain the information about which functional interface it is implementing; that...
2019-10-09 07:19:05
282
转载 Java hashCode() and equals() – Contract, rules and best practices
A good article to talk about Java hashCode and equals.
2019-10-08 06:04:36
297
原创 Leetcode 961. N-Repeated Element in Size 2N Array
题目In a array A of size 2N, there are N+1 unique elements, and exactly one of these elements is repeated N times.Return the element repeated N times. Example 1:Input: [1,2,3,3]Output: 3E...
2019-01-11 14:33:42
610
原创 Leetcode 965. Univalued Binary Tree
题目A binary tree is univalued if every node in the tree has the same value.Return true if and only if the given tree is univalued. Example 1:Input: [1,1,1,1,1,null,1]Output: trueExampl...
2019-01-11 14:07:48
690
原创 Leetcode 971. Flip Binary Tree To Match Preorder Traversal
题目Given a binary tree with N nodes, each node has a different value from {1, ..., N}.A node in this binary tree can be flipped by swapping the left child and the right child of that node.Conside...
2019-01-09 15:19:51
671
原创 LeetCode 970. Powerful Integers
题目Given two non-negative integers x and y, an integer is powerful if it is equal to x^i + y^j for some integers i >= 0 and j >= 0.Return a list of all powerful integers that have value less ...
2019-01-07 15:01:05
502
原创 LeetCode 771. Jewels and Stones
题目You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of the...
2019-01-04 15:18:42
350
原创 Log4j、Log4j 2、JUL、JCL 、SFL4J 、Logback 与 Lombok 的使用
Log4JLog4j = Log for Java.Log4j是Apache的一个开放源代码项目,通过使用Log4j,我们可以控制日志信息输送的目的地是控制台、文件、数据库等;我们也可以控制每一条日志的输出格式;通过定义每一条日志信息的级别,我们能够更加细致地控制日志的生成过程。 Log4j有7种不同的log级别,按照等级从低到高依次为:TRACE<DEBUG<INFO<...
2018-03-12 16:18:14
2964
原创 LeetCode(617) 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 bin
2017-09-10 16:30:17
1334
原创 LeetCode(657)Judge Route Circle
题目Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back tothe original place. The move sequence is repres
2017-09-03 14:43:50
1197
原创 LeetCode(461) Hamming Distance
题目The 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,
2017-09-03 14:24:09
962
转载 面向对象OOA、OOD、OOP
OOAObject-Oriented Analysis:面向对象分析方法OOA是指在一个系统的开发过程中进行了系统业务调查以后,按照面向对象的思想来分析问题。OOA与结构化分析有较大的区别,OOA强调在系统调查资料的基础上,针对OO方法所需要的素材进行的归类分析和整理,而不是对管理业务现状和方法的分析。OOA(面向对象的分析)模型由五个层次:主题层、对象类层、结构层、属性层和服务层,五
2017-05-15 18:03:23
6268
1
原创 IntelliJ IDEA Ultimate 安装&激活
序搞了两年多的C++,然而由于未来工作语言选择,又要奔回Java ~\(≧▽≦)/~啦啦啦~向有经验的同学打听了下,大部分公司选择的IDE都是IntelliJ IDEA。既然又认识了一个新工具,必须先拿来练练手呀,不能入职之后,对于工具还是小白吧~安装先去官网IntelliJ看一看,有两个版本:Community免费版可用于开发简单的J2SE项目,但对于J2EE,JS等
2016-12-22 11:02:33
28164
转载 C++实现单例模式
单例模式单例模式,可以说设计模式中最常应用的一种模式了,据说也是面试官最喜欢的题目。但是如果没有学过设计模式的人,可能不会想到要去应用单例模式,面对单例模式适用的情况,可能会优先考虑使用全局或者静态变量的方式,这样比较简单,也是没学过设计模式的人所能想到的最简单的方式了。一般情况下,我们建立的一些类是属于工具性质的,基本不用存储太多的跟自身有关的数据,在这种情况下,每次都去new一
2016-09-23 21:22:23
987
转载 三次握手的第三个ACK包丢了——客户端认为连接建立,写数据时,会触发RST
序上次面试被问到一个问题,在TCP建立连接的三次握手阶段,如果客户端发送的第三个ACK包丢了,那么客户端和服务器端分别进行什么处理?听到问题,一下愣掉,有点傻了,根据读书时模模糊糊的印象,答了答,无疑打错了T...T分析当Client端收到Server的SYN+ACK应答后,其状态变为ESTABLISHED,并发送ACK包给Server; 如
2016-09-17 15:40:53
5348
1
原创 LintCode (192)通配符匹配
题目判断两个可能包含通配符“?”和“*”的字符串是否匹配。匹配规则如下:'?' 可以匹配任何单个字符。'*' 可以匹配任意字符串(包括空字符串)。两个串完全匹配才算匹配成功。函数接口如下:bool isMatch(const char *s, const char *p)您在真实的面试中是否遇到过这个题?样例一些例子:isMa
2016-09-02 21:16:02
1441
原创 将搜索二叉树转换成双向链表
题目对二叉树的节点来说, 有本身的值域, 有指向左孩子和右孩子的两个指针; 对双向链表的节点来说,有本身的值域, 有指向上一个节点和下一个节点的指针。 在结构上, 两种结构有相似性, 现在有一棵搜索二叉树, 请将其转换为一个有序的双向链表。分析用两种方法求解本题。方法一:由于是搜索二叉树,直接求出其中序遍历序列,构造双向链表即可。方法二:采用递归实现
2016-09-01 16:18:59
1346
原创 LeetCode(87) Scramble String
题目Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation of s1 = "great": great /
2016-08-31 17:31:00
788
原创 LeetCode(191)Number of 1 Bits
题目Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11' has binary representatio
2016-08-29 21:55:53
1124
原创 LeetCode(326) Power of Three
题目Given an integer, write a function to determine if it is a power of three.分析本题判断给定一个整数是否为3的整次幂,不可用递归和循环。32bit表示的int,3的整次幂最大数为1162261467,所以只需判断给定整数n能否被该最大数整除即可。代码class S
2016-08-29 21:50:02
1106
原创 LeetCode(231) Power of Two
题目Given an integer, write a function to determine if it is a power of two.分析判断给定整数是否为2的整次幂。当该整数对应的二进制串中只有1位1时,必然为2的整次幂。只需判断n&(n-1)是否为0即可。代码#include #include using namespace
2016-08-29 21:29:51
890
原创 LeetCode(350)Intersection of Two Arrays II
题目Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Note:Each element in the result should appe
2016-08-29 21:21:17
1004
原创 LeetCode(383)Ransom Note
题目Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be
2016-08-29 20:38:16
971
原创 LeetCode(389) Find the Difference
题目Given 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 t
2016-08-29 20:28:00
1925
原创 递归与非递归求二叉树深度
题目分别用递归与非递归算法求二叉树深度。分析方法一:递归方法大家都很熟悉,如何用非递归求解呢?我们知道二叉树有层序遍历,利用层序遍历的过程,记录当前层数,那么遍历结束后也就求得二叉树的层数,即深度。方法二:层序遍历需要使用一个队列来保存树的节点。初始化讲根节点入队。接着只要队列不为空,则出队,并将出队元素的子节点入队。当需要记录树的深
2016-08-26 11:47:43
4041
原创 LeetCode(179) Largest Number
题目Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.Note: The result m
2016-08-25 21:22:14
1190
原创 LeetCode(349)Intersection of Two Arrays
题目Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].分析求两个数组的交集,结果不含重复元素。代码/*349. Intersection
2016-08-25 20:26:37
957
原创 LeetCode(371) Sum of Two Integers
题目Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example:Given a = 1 and b = 2, return 3.分析考察位运算,不用+ - 计算两数之和。代码/*371. Sum of
2016-08-24 21:28:07
899
原创 LeetCode(386)Lexicographical Numbers
题目Given an integer n, return 1 - n in lexicographical order.For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9].Please optimize your algorithm to use less time and space. The
2016-08-23 22:02:15
2370
原创 LeetCode(387)First Unique Character in a String
题目Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.Examples:s = "leetcode"return 0.s = "loveleetcode",return 2.
2016-08-23 20:34:06
2250
原创 LeetCode(344) Reverse String
题目Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".分析字符串逆转,左右指针。代码class Solution {public:
2016-08-15 22:14:49
801
原创 LeetCode(130) Surrounded Regions
题目Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded region.For exam
2016-08-15 22:04:38
1781
原创 LeetCode(85) Maximal Rectangle
题目Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.For example, given the following matrix:1 0 1 0 01 0 1 1 11 1 1
2016-08-14 20:54:47
829
适配器模式(Adepter)C#实现及案例
2013-02-04
各种排序的C++算法实现(插入排序、合并排序、堆排序、快速排序)
2013-01-29
java+jsp+tomcat学生管理系统
2013-01-01
java 绘图板程序
2012-12-31
C++ MFC实现飞机大战游戏
2012-12-04
C语言桌面万年历
2012-12-04
Linux聊天室 -- select && 多线程实现
2015-12-22
Windows下Lex与Yacc配置必备工具
2015-01-22
MinGW开发工具
2015-01-09
lex与Yacc所需flex.exe bison.exe
2015-01-09
Web服务器的java实现
2013-02-15
Ubuntu 15.04 qtcreator打不开,请问有人遇到过吗?
2015-10-16
TA创建的收藏夹 TA关注的收藏夹
TA关注的人