- 博客(77)
- 资源 (2)
- 问答 (1)
- 收藏
- 关注
原创 Leetcode 312: Burst Balloons
Leetcode 312: Burst Balloons Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst
2017-08-20 10:01:26
594
原创 积累
不得不说,概念还是挺重要的。To understand something其他概念外围设备 计算机系统除主机外的其他设备。包括输入和输出设备、外存储器、模数转换器、外围处理机等。是计算机与外界进行通信的工具。例如打印机、磁盘驱动器或键盘。对称矩阵的上三角阵:左下角为0编译原理简单优先文法 定义: 一个文法G,如果它不含空串产生式,也不含任何右部相同的不同产生式,并且它的任何符号对(
2017-08-18 18:10:10
417
原创 byte 与 int 转换
复习过程中,遇到的不太理解的地方(byte)b & 0xffbyte to int比较下面两个 public static int byte2Int(byte b){ return (int)b; } public static int byte2Int(byte b){ return (int)(b & 0xff); }疑问你肯定在想这个
2017-08-17 22:19:40
31995
1
转载 Leetcode 44:Wildcard Matching
Leetcode 44:Wildcard MatchingImplement wildcard pattern matching with support for ‘?’ and ‘*’. ‘?’ Matches any single character. ‘*’ Matches any sequence of characters (including the empty sequenc
2017-08-17 21:22:04
334
转载 Leetcode 10: Regular Expression Matching
Leetcode 10: Regular Expression MatchingImplement regular expression matching with support for ‘.’ and ‘*’. ‘.’ Matches any single character. ‘*’ Matches zero or more of the preceding element.
2017-08-16 23:25:34
347
转载 Leetcode 300 :Longest Increasing Sequence
Leetcode 300Given an unsorted array of integers, find the length of longest increasing subsequence.For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest increasing subsequence is [2, 3, 7
2017-08-16 22:31:09
447
转载 Leetcode 560: Subarray Sum Equal k
Leetcode 560 Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k.Example 1: Input:nums = [1,1,1], k = 2 Output: 2Note:
2017-08-16 21:59:26
323
原创 小易喜欢的数列
小易喜欢的数列小易非常喜欢拥有以下性质的数列: 1、数列的长度为n 2、数列中的每个数都在1到k之间(包括1和k) 3、对于位置相邻的两个数A和B(A在B前),都满足(A <= B)或(A mod B != 0)(满足其一即可) 例如,当n = 4, k = 7 那么{1,7,7,2},它的长度是4,所有数字也在1到7范围内,并且满足第三条性质,所以小易是喜欢这个数列的 但是小易不喜欢{
2017-08-15 13:54:29
1624
原创 堆棋子与曼哈顿距离
堆棋子牛客网通道: https://www.nowcoder.com/questionTerminal/27f3672f17f94a289f3de86b69f8a25b小易将n个棋子摆放在一张无限大的棋盘上。第i个棋子放在第x[i]行y[i]列。同一个格子允许放置多个棋子。每一次操作小易可以把一个棋子拿起并将其移动到原格子的上、下、左、右的任意一个格子中。小易想知道要让棋盘上出现有一个格子中至少有
2017-08-15 13:34:02
813
原创 Leetcode 561: Array Partition I
题目传送门: Leetcode 561. Array Partition I题目: Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), …, (an, bn) which makes sum of min(ai,
2017-05-03 17:36:38
540
原创 Leetcode 307: Range Sum Query - Mutable 之BIT
题目传送门: Leetcode 307.Range Sum Query - Mutable题目 Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. The update(i, val) function modifies nums b
2017-05-03 15:55:46
426
原创 Android Studio 的SDK Manager
CentOS 7 sdk文件夹里是add-ons,tools等等内容 打开sdk manager$ cd yourpath/sdk/tools$ android &&表示后台运行 打开avd$ android avd &
2017-05-01 16:43:10
810
原创 /etc/profile 修改致命令失效
对root用户起作用的方法:/usr/bin/vim /etc/profile虽然可以进入profile文件,但是对于普通用户,无法修改.通用方法: 终端输入此命令后export PATH=/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin正常修改/etc/profilesudo vim /etc/profile使之起
2017-05-01 16:22:53
6277
原创 Nginx-1.12.0——问题之启动失败
背景好久没写博客了,在本子上写写画画,也还不错。今天准备接触下HTTP/2,顺藤摸瓜,搜到Nginx的一些版本支持,就准备倒腾倒腾。第一步,安装Nginx。步骤下载 Nginx For Windowshttp://nginx.org/en/download.html教程来指导http://nginx.org/en/docs/windows.html主要说问题首先我的情况是这样的,nginx star
2017-04-14 15:57:37
4384
原创 Date(have a date)
推迟一周示例:Calendar curr = Calendar.getInstance();curr.set(Calendar.DAY_OF_MONTH,curr.get(Calendar.DAY_OF_MONTH)+7);Date date=curr.getTime();推迟一个月示例:Calendar curr = Calendar.getInstance();c
2016-07-20 19:53:02
911
原创 sql语句和一些命令
尽管经常用,经常搜,却还是记不住sql更新语句update table_name set xx=? where id=?命令:端口被占用 第一步 netstat -ano | grep 1099 //grep 一下 获得PID xxxx第二步 tasklist | grep xxxx //grep 一下 获取应用名第三步 任务管理器// kill掉这个应用持续
2016-07-20 19:48:44
291
原创 Python 转 EXE(知道真相的我眼泪掉下来)
20160718帮同学一个小忙,把 python 文件生成 Windows 下可执行文件。错的地方,哎,说多了都是泪环境1. 安装pythonpython 2.7 我的是 win7 64bit 但其实 32bit 64bit 都能装后面需要安装的其他东西需要参考python的版本 附一个链接,也可以从其他途径下载: https://www.python.org/do
2016-07-18 15:37:34
36562
原创 Are you happy?
2016/06/12你快乐吗 你在做什么呢 你有想法吗你觉得这样的生活值得吗 发脾气的时候,考虑到周围人了吗没有 我不快乐 我做什么呢 我还要做什么呢 我完完全全不想
2016-06-12 17:28:40
344
原创 JS(Coursera):More On Arrays
ArrayYou’ll learn some advanced array functionsSORTINGarray.sort()Alphabetical ordervar pets = ["Dog" , "Cat" , "Rabbit" , "Hamster"];pets.sort(); 按字母顺序 array.reverse() Descending order
2016-06-06 11:54:35
366
原创 JS (Coursera): For Loops
You’ll be able to create different kinds of for loopforclearly shows the start and end valuesis especially good for handling a series of data(data_structure.length tells you how many items data_str
2016-06-06 09:11:52
462
原创 JS (Coursera课程)
Events An event is when sth happens for example click on sth move the mouse press keyONLOAD EVENTonload is triggered when the object has loadedhtml> body onload="ale
2016-06-05 21:00:22
409
转载 Js 的 typeof 返回值
摘自:http://www.cnblogs.com/lidabo/archive/2011/12/29/2305770.htmljs中的typeof是一个运算符,一元运算。typeof sth不需要加括号的。 返回值是一个字符串,说明运算数的类型。typeof 1;typeof NaN;typeof Number.MIN_VALUE;typeof Infinity;typeof "123";typ
2016-06-05 14:06:49
7228
原创 asp.net 加个弹出对话框
平和、淡定asp.net,我对它没好感。工作需要,我要了解一点点。添加一个imageButton,弹出对话框的效果。<asp:ImageButton ID="dele" runat="server" OnClick="dele_Click" OnClientClick="if (!confirm('你确定要删除吗?')) return false;" ImageUrl="~/Image/dele.j
2016-06-03 10:46:14
432
原创 简单工厂模式
2016/05/15这几天,忙着做一个服务器端的小项目。服务器接收客户端的TCP消息,消息格式中:标识符 + 消息头 + 消息体 + 校验码 + 标识符根据消息头中的ID字段属性,对应着多种不同的消息体。运用简单工厂模式: 产品包括 产品抽象类和产品实体类; 1)工厂类:模式核心,含有一定的商业逻辑和判断逻辑,用来创建产品; 2)抽象产品类:具体产品继承的父类或者实
2016-05-25 21:38:27
348
原创 Centos 7 图形界面没有登录界面了
2016/5/8 not a nice day , but go 昨天莫名其妙就把centos的登录界面搞没了。 真是遭心,求救师兄,解决了。(不要问我怎么解决的,我也不知道)。遇到这么大个问题,总算是知道了一些linux的东西。首先,是界面出了问题,你用的哪种界面呢?Gnome,Kde? Centos一般默认为Gnome。 对应的为dgm服务 Kde对应的是kdm 还
2016-05-08 22:38:40
22139
1
原创 Centos MAC远程连接服务器
2016/5/4把手头的事情做好;想的长远是好事,太长远就有些不切实际了;我不知道你想依靠谁,我觉得你也不知道,那就靠自己吧。linux和MAC下连接远程服务器,命令行我就不说了CentOS下连接服务器打开文件栏,左侧下方有"连接服务器",打开它。输入地址。Mac下同样的,右击Finder,选择连接服务器,输入地址,以及用户和用户密码。注意选择服务器类型,ftp或其他。
2016-05-04 22:12:21
1460
原创 mysql数据库备份
linux下mysql数据库备份:$ mysqldump -uxxx -pxxxx 数据库名>数据库名.sql-u后为用户名 -p后为密码备份的数据库在当前的目录。pwd看一下。恢复这个跟导入文件是一样的 进入mysql后use 数据库名然后source 数据库名.sql;这里.sql文件就是我们上述的备份好的文件。注意路径的问题.
2016-05-04 22:05:54
359
原创 css设置段落缩进、行距
不知道怎么没有保存上,还把它弄丢了。今天又看了看,感觉有点不对<div id = "textDiv"> <p>而我听见下雨的声音,想起你用唇语说爱情,热恋的时候最任性,不顾一切的给约定;终于听见下雨的声音,于是我的世界被吵醒,发现你始终很靠近,默默的陪在我身边,态度坚定;而我听见下雨的声音,想起你用唇语说爱情</p></div>以前说过这个问题,但是我自己都忘了 block元素和inl
2016-05-04 21:22:26
3637
原创 AsyncTask获取数据库数据
2016_04_25—————R关于 http://blog.youkuaiyun.com/u010045971/article/details/50853651 未尽之事 1. 为应用程序添加provider的访问权限。 在manifest标签内,定义上面的提到的 permission permission android:name="co
2016-05-03 22:24:03
4431
原创 android res
——a little +Udacity截图: 尽量保持宽而浅的布局 完整层级不能超过十级SIZE: small normal largedensity: ldpi hdpi xhdpi xxhdpi xxxhdpi:res/layout res/layout-sw600dp res/layout-sw720dpSupporting M
2016-04-25 16:45:46
689
原创 Implementing Redlines(Android)
——Redlines,GoodlookingNexus5开启开发者模式 打开设置,点击关于手机 在版本号一行点击多下(五六次吧) 再返回就有开发者选项了这里因为开发者选项里有一个关于显示布局的功能,可以看到界面的Redline。 什么是Redline?字体,大小等等设置
2016-04-25 16:40:23
618
原创 App Bar
——Developervalues-v14res下文件夹values-14 values-21Develop > Reference > R.attr displayOptionsOptions affecting how the action bar is displayed.Must be one or more (separated by “|”) of the
2016-04-25 11:15:52
432
原创 Canvas绘制风向盘
——先画圆,再画刻度…已知风向值,确定N、NE、E、SE、S、SW、W、NW中的一个:String direction = "Unknown";if (degrees >= 337.5 || degrees 22.5) { direction = "N";} else if (degrees >= 22.5 && degrees 67.5) {
2016-04-25 11:09:21
1779
原创 ContentProvider
使用列表API使用API,SharedPreference存储,键值对Classes: WeatherDbHelper WeatherContract WeatherProviderSQLite存储,表public class WeatherDbHelper extends SQLiteOpenHelperSQLiteData
2016-04-25 11:06:18
3103
原创 使用AVD时的dp问题
——a minute observer我在使用平板来实现多屏幕时的不同效果之一,遇到了一些不大不小的问题。create an android virtual devicetablet选择的是Nexus 7分辨率1600x1920:xhdpi,然而生成的AVD分辨率却变小了。查看AVD detail时,发现屏幕密度(dpi:320)根据公式:px = dp * (dpi / 160 )所以 dp的sw
2016-04-15 18:20:46
553
转载 一个关于gravity和layout_gravity的例子
——处变不惊这其实是两部分,分开一些比较清晰<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="f
2016-04-15 17:19:55
838
原创 Drawable Resources
——Come On,developerhttp://developer.android.com/guide/topics/resources/drawable-resource.htmlseveral different types of drawables:Bitmap File .png , .jpg , or .gifNine-Patch File .9.pngLayer List
2016-04-14 10:23:24
413
C#加密 Java解密 不成功
2015-12-01
TA创建的收藏夹 TA关注的收藏夹
TA关注的人