自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

FreeeLinux's blog

没有迷路的人

  • 博客(34)
  • 资源 (3)
  • 收藏
  • 关注

原创 PHP中PDO、mysql配置远程连接、ecshop安装

PHP新版中推荐的基于对象的数据库服务器的方式。开始PDO_mysql相关扩展: 基本使用步骤: 连接,认证,发送SQL,等待mysql服务器的执行结果,处理执行结果。安装PDO:安装pdo   sudo pecl install pdo   出现以下错误是说明pdo已经加入了php的默认安装,不需要再安装了   [Some stuff excluded for brevity]make

2017-03-31 13:40:46 2593

原创 SQL注入问题

sql注入如果SQL当中,存在浏览器端请求的数据(用户数据),用户通过特殊的形式,对我们的sql语句产生影响,称为sql注入(SQL Injection)。$sql = "SELECT * FROM `p34_admin` WHERE admin_name='$admin_name' and admin_pass=md5('$admin_pass')";例如上面的语句中,让admin_name=’o

2017-03-30 08:41:08 819

原创 PHP session的使用

对比cookiecookie的缺点:会话数据原文存储于浏览器端,原始数据的安全性较低。如果cookie数据量较大,由于每次请求都要携带,会增加带宽的使用。如何解决这两个问题呢? 使用session技术来实现。将会话数据存储于服务器端。同时使会话数据可以区分浏览器。 为每个会话数据建立独立的会话数据区(来存储当前会话的全部数据),每个会话数据区都存在唯一的标志,同时浏览器端存储该唯一标志(携

2017-03-29 22:46:39 679

原创 PHP cookie的使用

获取获取浏览器在请求时携带的cookie数据,使用超全局数组变量, $_COOKIE完成对cookie的获取。 其中每个 $_COOKIE 中的元素,对应一个cookie变量,元素的键就是cookie的key,元素的值就是cookie的value。时间设置通过cookie的第三个参数可以设置,有效期采用一个时间戳进行表示。 浏览器在向服务器发送请求时,会检测到cookie是否有效,只有没有过有

2017-03-28 20:44:50 592

原创 14. Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings.这道题让我印象深刻啊,库函数用好就是好。这道题意思是求一个字符串数组,我们求出数组中所有元素的最长公共前缀。所以我们初始以strs[0]为最长公共前缀,然后在后面其他字符串中find,如果匹配,返回首位置必须为0,否则我们需要缩小

2017-03-25 10:02:22 404

原创 13. Roman to Integer

Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.Subscribe to see which companies asked this question.这道题没什么难的,唯一难的就是鬼知道罗马数字都有什么。实际上对于罗马数字举例:4->

2017-03-24 00:37:57 361

原创 11. Container With Most Water

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two l

2017-03-22 16:28:25 437

原创 63. Unique Paths II[dp]

Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in the grid.For ex

2017-03-21 18:20:37 401

原创 2. Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it

2017-03-21 16:39:53 414

原创 3Sum

Given 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 contain duplic

2017-03-21 14:25:43 350

转载 全面剖析《自己动手写操作系统》的pmtest1.asm

段机制轻松体验 内存寻址: 实模式下的内存寻址: 让我们首先来回顾实模式下的寻址方式 段首地址×16+偏移量 = 物理地址 为什么要×16?因为在8086CPU中,地址线是20位,但寄存器是16位的,最高寻址64KB,它无法寻址到1M内存。于是,Intel设计了这种寻址方式,先缩小4位成16位放入到段寄存器,用到时候,再将其扩大到20位,这也造成了段的首地址必须是16的倍数的限

2017-03-18 10:34:23 799

原创 448. Find All Numbers Disappeared in an Array

Given 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 array.Could you

2017-03-17 02:06:50 341

原创 485. Max Consecutive Ones

Given a binary array, find the maximum number of consecutive 1s in this array.Example 1:Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digits are consecutive 1s.

2017-03-17 01:14:03 485

原创 nasm汇编以及bochs调试

先说下编译的命令:编译: nasm -f elf hello.asm -o hello.o加权限: chmod +x hello.o链接: ld -m elf_i386 -s -o hello hello.o直接运行就可以了。

2017-03-15 15:44:03 2045

转载 汇编基础——常用寄存器及其用途

通用寄存器的主要用途寄存器的分类寄存器主 要 用 途通用寄存器数据 寄存器AX乘、除运算,字的输入输出,中间结果的缓存AL字节的乘、除运算,字节的输入输出,十进制算术运算AH字节的乘、除运

2017-03-14 18:05:58 826

转载 实模式和保护模式

保护模式的起源最开始的程序寻址是直接的“段:偏移”模式,这样的好处是所见即所得,程序员指定的地址就是物理地址,物理地址对程序员是可见的。但是,由此也带来两个问题:无法支持多任务(程序员多个程序可能指定运行的物理地址一样)程序的安全性无法得到保证(用户程序可以改写系统空间或者其他用户的程序内容)实模式将整个物理内存看成分段的区域,程序代码和用户程序没有区别对待,而且每一个指针都是指向“实在”的物

2017-03-14 17:56:27 560

转载 shell 中 grep、sed、awk 命令

简介sed 是一种在线编辑器,它一次处理一行内容。处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(pattern space),接着用sed命令处理缓冲区中的内容,处理完成后,把缓冲区的内容送往屏幕。接着处理下一行,这样不断重复,直到文件末尾。文件内容并没有 改变,除非你使用重定向存储输出。Sed主要用来自动编辑一个或多个文件;简化对文件的反复操作;编写转换程序等。

2017-03-14 09:36:58 834

原创 409. Longest Palindrome

Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.This is case sensitive, for example "Aa" is not consider

2017-03-13 02:27:16 355

原创 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 that was added in

2017-03-13 01:55:06 359

原创 349. Intersection of Two Arrays/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].Note:Each element in the result must be unique.The result can be in an

2017-03-13 01:34:41 459

原创 290. Word Pattern

Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str.Examples:p

2017-03-13 01:09:13 394

原创 242. Valid Anagram

Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat", t = "car", return false.Note:You may assume the stri

2017-03-12 23:23:13 357

原创 205. Isomorphic Strings

Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced with another chara

2017-03-12 23:03:51 344

原创 204. Count Primes(埃拉托色尼)

Description:Count the number of prime numbers less than a non-negative number, n.Credits:Special thanks to @mithmatt for adding this problem and creating all test cases.class Solution {public: in

2017-03-12 20:33:43 334

原创 202. Happy Number

Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of i

2017-03-12 19:41:54 274

原创 67. Add Binary

``c++ Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1” Return “100”.```c++class Solution {public: string addBinary(string a, string b) {

2017-03-11 20:32:23 385

原创 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 constructed from the magazines ; oth

2017-03-11 18:40:02 366

原创 532. K-diff Pairs in an Array

Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an integer pair (i, j), where i and j are both numbers in

2017-03-11 16:40:41 1101

原创 459. Repeated Substring Pattern

Given a non-empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may assume the given string consists of lowercase Englis

2017-03-06 15:02:19 663

原创 26. Remove Duplicates from Sorted Array

Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with cons

2017-03-05 21:26:18 261

原创 28. Implement strStr()

Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.class Solution {public: int strStr(string haystack, string needle) {

2017-03-05 19:54:14 304

原创 20. Valid Parentheses(括号)

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all valid but "

2017-03-05 12:59:04 301

原创 5. Longest Palindromic Substring

Given 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 answer.Example:Input:

2017-03-05 02:23:04 314

原创 数据库三大范式

范式是关系型数据库规范程度的级别划分,下面来说说数据库的三大范式。首先弄清几个概念: 候选码:候选码是可以区别表中一行数据的属性或属性的集合。比如学生表student(id,name,age,sex),其中id可以作为候选码。id和name组合也可以区别表中一行数据,此时id可以称为码,id和name的组合也是码。但是它们不是候选码,因为去掉name,id也可以表示一行数据。而候选码可以说是不可

2017-03-01 00:09:28 538

muduo网络库

如果你用其他的编译不通过,就用这个吧。

2016-12-01

MySQL-python-1.2.5.win64-py2.7.exe

有效解决安装mysql-python时遇到的error: Unable to find vcvarsall.bat问题,以及 %1 win 32 问题

2016-09-20

valgrind-3.10.1

Linux内存泄漏检测工具

2016-08-11

空空如也

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

TA关注的人

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