自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 纯css实现checkbox的checked样式

纯css也能实现checked样式今天使用微信的WEUI的checkbox的时候,发现点击checkbox是有checked和unchecked的变化的,但是想要去获得checkbox的checked状态时,发现event listener里居然没有该checkbox的click之类的事件。这才发现,weui只是纯粹的css样式,没有对应组件的js代码。那么问题来了,没有js事件,weui是如...

2018-05-23 22:45:18 23921 1

原创 后台开发 知识点收集

原知识点总结连接,由于有些问题比较熟悉,所以就没有在自己文章中再列出来了计算机网络tcp/udp区别http状态码http协议报头字段osi模型、tcp/ip模型以及各层对应的协议session机制、cookie机制tcp三次握手,四次挥手打开网页到页面显示之间的过程https和http的区别post和get的区别ip子网划分两个网络MTU不同时如何通信数据...

2018-05-05 23:20:55 320

原创 网易游戏面试

c内存布局 - BSS(为初始化数据段 uninitialized data segment)未初始化数据是在程序中声明,但是没有初始化的变量,这些变量在程序运行之前不需要占用存储器的空间。Block Started by Symbol,BSS段的变量只有名称和大小却没有值 - RW read write 已初始化读写数据段 - RO read only 只读数据段,即常量区...

2018-05-02 16:34:38 3727

原创 头条面试

Conclusion面试总共50分钟,问的相当简单,只问了一道算法题,面试时间包括写代码的时间。Detail自我介绍编程:一个数组中找到第K大的数。附加题:不移动原数组元素。附加的这个条件没想出来,面试官就说那直接就写满足基本条件的代码吧。我写的是快排思想的那种解法,第一次实际去写这道题,之前一直知道这道题的解法,但是没有具体去实现过,所以写起来稍微有些慢了。最后在写parti...

2018-05-02 16:11:23 623

原创 Linux相关

sedawk守护进程top

2018-04-25 22:34:22 135

原创 守护进程

文章主要参考:https://www.jianshu.com/p/47ceac3a0e51 以及 http://www.cnblogs.com/mickole/p/3188321.html守护进程概述Linux Deamon守护进程是运行在后台的一种特殊进程。它独立于控制终端并且周期性地执行某种任务或者等待处理某些事件的发生。它不需要用户输入就能运行而且提供某种服务,不是对整个系统就是...

2018-04-22 13:48:29 474

原创 Nginx相关

proxy_pass vs rewriteupstream#

2018-04-16 14:57:28 124

原创 腾讯面试准备

hash、map、dict区别右值引用虚函数和纯虚函数虚表运算符重载epoll和selectes原理一面waf运行在nginx哪一个阶段nginx后台连接超时是否会再连接 估计是max_fails, fail_timeouttcp黏包?大数据求中位数需要注意的问题数据库分布式数据库分表数据库拆表大数据读取数据...

2018-04-15 23:29:28 281

原创 PHP面经

CORS(cross origion resource sharing)跨域资源共享,可以允许跨站请求资源。客户端需要用特定的方法去请求资源(如xmlhttprequest)同时需要带上特定的报文头信息,服务端也要支持跨域的资源请求memcache和redis的异同点memcache可以利用多线程,吞吐量高,适合大访问量memcache只支持简单的key/value结构mem...

2018-04-13 21:45:51 414

原创 设计模式

工厂模式将直接new一个对象的操作放到工厂中,在工厂中新建对象,并返回$ob = new Object();改为$ob = Factory::createObject();好处:当对象的构建比较复杂的时候,将其放到工厂中可以避免代码冗余以及减少出错;类的创建由于业务会经常变化的时候,如果用传统的直接new方法,则会每次变动都需要在new的地方跟着变动单例模式限定一个...

2018-04-13 21:44:10 112

原创 leetCode#338.Counting Bits

DescriptionGiven a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array.Example: Fo...

2018-04-03 17:17:20 145

原创 操作系统

操作系统四个特性并发:同一时段运行多个程序,并行为同一时刻运行多个程序虚拟:通过时分复用,空分复用等手段,把物理实体虚拟为多个共享:系统资源可以被内存中多个并发执行的进线程共同使用异步:系统中的进程是走走停停的方式执行,且以不可预知的速度推进操作系统的主要功能处理机管理:进程控制、进程同步、进程通信和进程调度存储器管理:内存的分配、内存保护、地址映射、内存扩充设备管...

2018-03-28 16:25:20 193

原创 排序算法总结

排序算法 平均时间复杂度 最好时间复杂度 最坏时间复杂度 空间复杂度 稳定性 冒泡排序 O(n^2) O(n) O(n^2) O(1) 稳定 选择排序 O(n^2) O(n^2) O(n^2) O(1) 不稳定 插入排序 O(n^2) O(n) O(n^2) O(1) 稳定 ...

2018-03-27 16:03:03 142

原创 数据库 面试复习

前言自从大三学完数据库后,这门课就没再看过。最近要找实习了,发现面试总避免不了要问数据库相关的问题,回过头去找课本,才发现书都已经被我扔了。。。只能根据网上的数据库面试题来复习了。数据库事务的四个特征ACID,分别对应Atomicity、Correspondence、Isolation、Durability原子性:事务的所有操作,要么全部完成,要么全部不完成,不能停滞在中间环...

2018-03-16 14:47:38 734

原创 从输入URL到页面加载的过程

经典面试题之一,这次得搞得明明白白的,顺便把计网也复习复习。 首先感谢知乎的up主:撒网要见鱼,这是他的原文,本篇文章也是基于他的文章总结启发而来,主要就是记录记录笔记。面试前复习浏览器输入url,查看缓存,解析域名,涉及dns相关知识 dns 使用udp,占53号端口dns服务器分为四种 本地域名服务器、权威域名服务器、顶级域名服务器、根域名服务器dns查询分为两种方式,递...

2018-03-15 10:15:48 4739

原创 牛客#机器人的运动范围

Description地上有一个m行和n列的方格。一个机器人从坐标0,0的格子开始移动,每一次只能向左,右,上,下四个方向移动一格,但是不能进入行坐标和列坐标的数位之和大于k的格子。 例如,当k为18时,机器人能够进入方格(35,37),因为3+5+3+7 = 18。但是,它不能进入方格(35,38),因为3+5+3+8 = 19。请问该机器人能够达到多少个格子?Code一开始没注...

2018-03-07 23:31:28 338

原创 牛客#第一个只出现一次的字符

Description在一个字符串(1<=字符串长度<=10000,全部由字母组成)中找到第一个只出现一次的字符,并返回它的位置Code之所以记录这道题,倒不是因为这道题难,而是为了记录下这道题在python下的解法。 这道题的常规解法就是遍历字符串,然后存在数组中,统计次数。最后遍历数组,得出第一个只出现了一次的字符。 然而由于python中的dict会自动排序(py...

2018-03-06 16:44:38 216

原创 leetCode#647. Palindromic Substrings

DescriptionGiven a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end indexes are counted as different substrings even ...

2018-03-01 18:09:23 106

原创 leetCode#303. Range Sum Query - Immutable

DescriptionGiven an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1sumRange(2, 5...

2018-03-01 14:38:02 122

原创 leetCode#746. Min Cost Climbing Stairs

DescriptionOn a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reac...

2018-03-01 12:07:06 128

原创 leetCode#121. Best Time to Buy and Sell Stock

DescriptionSay 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 ...

2018-02-28 17:46:42 119

原创 git commit -a

今天提交git时遇到这样一个问题,我在项目里rm掉了许多文件,等到想commit的时候,发现这些被删除的文件都是not staged的状态,这要一个个的去git rm就太蛋疼了。这时候就发现了git commit -a这个命令。OPTIONS-a, --allTell the command to automatically stage files that have been modif...

2018-02-28 11:06:48 6633

原创 leetCode#167. Two Sum II - Input array is sorted

DescriptionGiven an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the...

2018-02-25 09:59:11 150

原创 leetCode#125. Valid Palindrome

DescriptionGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car

2018-02-06 23:24:27 128

原创 leetCode#18. 4Sum

DescriptionGiven an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note: The

2018-01-09 14:15:55 94

原创 leetCode#16. 3Sum Closest

DescriptionGiven an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would

2018-01-08 17:34:02 114

原创 leetCode#5. Longest Palindromic Substring

DescriptionGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad"Output: "bab"Note: “aba” is also a valid

2018-01-08 16:22:31 111

原创 leetCode#4. Median of Two Sorted Arrays

DescriptionThere are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1:nums1 = [

2018-01-03 22:35:11 108

原创 leetCode#15. 3Sum

DescriptionGiven an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set must not con

2018-01-03 15:43:39 128

原创 leetCode#119. Pascal's Triangle II

DescriptionGiven an index k, return the kth row of the Pascal’s triangle.For example, given k = 3, Return [1,3,3,1].Note: Could you optimize your algorithm to use only O(k) extra space?Codeclass Solu

2017-12-29 17:40:36 90

原创 leetCode#118. Pascal's Triangle

DescriptionGiven numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5, Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]]Codeclass Solution(object)

2017-12-29 10:43:55 100

原创 leetCode#107. Binary Tree Level Order Traversal II

DescriptionGiven a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree [3,9,20,null,nu

2017-12-28 17:02:05 107

原创 leetCode#111. Minimum Depth of Binary Tree

DescriptionGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.Code# Definition for a binary tr

2017-12-26 22:07:48 97

原创 leetCode#100. Same Tree

DescriptionGiven two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the same value.E

2017-12-22 17:04:48 113

原创 leetCode#83. Remove Duplicates from Sorted List

DescriptionGiven a sorted linked list, delete all duplicates such that each element appear only once.For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3.Code# Definition for

2017-12-22 10:50:46 130

原创 leetCode#448. Find All Numbers Disappeared in an Array

DescriptionGiven 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

2017-12-20 23:04:16 115

原创 leetCode#226. Invert Binary Tree

DescriptionInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia: This problem was inspired by this original tweet by Max How

2017-12-19 21:52:32 123

原创 leetCode#617. Merge Two Binary Trees

DescriptionGiven 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-12-18 22:34:20 125

原创 leetCode#198. House Robber

DescriptionYou 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 adja

2017-12-15 10:52:48 115

原创 leetCode#169. Majority Element

DescriptionGiven 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 elem

2017-12-14 15:18:08 91

空空如也

空空如也

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

TA关注的人

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