自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

猫和鱼爪的鸟窝

Pain is in your mind.

  • 博客(15)
  • 资源 (9)
  • 问答 (2)
  • 收藏
  • 关注

原创 【leetcode】Text Justification

Question 我觉得还是翻译一下好 给一个字符串数组,一个L整数 1、一行最多有L个字符 2、把这些字符串尽可能多得放在一行 3、每个字符串之间都有空格分开 4、字符串之间空格的个数平均分配,如果不能除尽,那么左边的空格数大于右边的 5、最后一行字符串左对齐,之间以一个空格分隔,剩余用空格补齐TipsNo way, just let it be complex : )Codecla

2015-05-31 10:32:17 379

原创 【leetcode】Unique Paths II

QuestionTipsI think still use dynamic programming.class Solution {public: int uniquePathsWithObstacles(vector<vector<int> >& obstacleGrid) { int m = obstacleGrid.size(); int n = ob

2015-05-30 02:13:10 427

原创 【leetcode】Unique Paths

QuestionTips Using the dynamic programmingCodeclass Solution {public: int uniquePaths(int m, int n) { int **res; res = new int*[m]; for(int i = 0; i < m; ++i){

2015-05-30 01:00:54 357

原创 【iOS】自定义对象深拷贝、浅拷贝

问题情境 其实这是学习ios第二天,看了斯坦福大学的2013年秋季iOS公开课,做了一个纸牌匹配小游戏。其中遇到的问题不少,关于object-c的学习就不再赘述,其中的一个问题我觉得在这里记一笔,对今后有帮助——自定义对象的深拷贝、浅拷贝。 我有一个CCard类,用一个NSMutableArray来保存,我打算在牌堆中随机挑选6张牌(屏幕就打算放12张),再随机放入NSMutableArray中。我

2015-05-20 21:28:32 2283

原创 [Linux]内存共享

API头文件#include <shm.h>创建共享内存int shmget(key_t key, size_t size, int shmflg);key:键值,有效地为共享内存段命名 size:申请内存的大小获取创建好的共享内存void *shmat(int shm_id,const void *shm_addr, int shmflg);shm_id:由shmget创建返回的共享内存id

2015-05-18 19:26:04 382

原创 【Linux】MySQL C语言操作

C语言访问MySQL头文件#include <mysql.h>API//通常传递NULL,返回一个指向连接句柄的指针;如果传进去一个已有的结构,它将被重新初始化 MYSQL mysql_init(MYSQL );//连接数据库 MYSQL *mysql_real_connect(MYSQL *connection,//由mysql_init初始化的指针 const char *server_h

2015-05-12 23:37:02 401

原创 【LeetCode】Rotate list

QuestionMethod1 Using to pointers to make the distance equal k%ListNode.length()//This is got from a loop/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *

2015-05-12 22:57:13 336

原创 【Linux】mmap函数的内存映射

API#include <sys/mman.h>mmap//将文件映射到内存 void *mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off);成功:返回一个地址指针。 失败:返回MAP_FAILED参数说明addr:指定分配内存的起始地址,0时由OS决定len:需要分配的内存长度prot :期望的内存保

2015-05-08 19:29:00 562

原创 N-Queens && N-Queens II

QuestionTipsBacktracking  //You know ,I can do it well : ) Codeclass Solution {public: Solution(){ res.clear(); rec=NULL; } ~Solution(){ if(rec!=NULL) delete []rec;

2015-05-06 20:18:53 358

原创 【LeetCode】Anagrams

QuestionTipsHash tableCodeclass Solution {public: vector<string> anagrams(vector<string>& strs) { res.clear(); ht.clear(); if(strs.size()<=1) return res;

2015-05-05 20:34:49 402

原创 【POJ】Parencodings

ParencodingsTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 21004 Accepted: 12590Description Let S = s1 s2…s2n be a well-formed string of parentheses. S can be encoded in two d

2015-05-05 17:11:00 377

原创 Rotate Image

Questionclass Solution {public: void rotate(vector<vector<int> >& matrix) { for(int layer=0;layer<matrix.size()/2;++layer){ //View matrix like many circles int row=matrix.size()-2*l

2015-05-05 13:57:09 270

原创 【LeetCode】Permutations II

QuestionTipsStill the backtrackingSource Codeclass Solution {public: void BT(int d,vector<int> &nums){ if(d==nums.size()){ vector<int> t; for(int i=0;i<tmp.size();++i)

2015-05-05 11:19:51 332

原创 【LeetCode】Permutations

QuestionTips  BacktrackingCodeclass Solution{ public: void BT(int depth,vector<int> &nums){ if(depth==nums.size()){ res.push_back(tmp); return; }else{ for(int i

2015-05-04 23:00:03 297

原创 【linux】终端音乐播放器

简介 这次其实是经历一些面试之后决定要从windows的训练下脱离出来,去linux下试试手了。但是对linux下的编程工具只知道VI,没办法,可视化界面我想现在暂时是做不出了。还有,我coding都喜欢听着歌曲,这样不容易被外界干扰。于是乎,就打算做一个Terminal Music Player。困难  要说困难,最大的困难就是从windows用习惯了的Visual Studio下脱离出来,没有代

2015-05-04 21:49:46 1903

Thinking in Java 4th

绝对清晰,的Thinking in Java。不要任何分数的第四版。

2015-11-10

Vitamio Demo

Vitamio 4.0 demo搭建,本人在eclipse下运行亲测,导入即可 测试文件路径,/mnt/sdcard/eplayer/1367460960911_tm.mpg

2015-07-29

Terminal-Music-Player

自制的终端播放器,直接运行music即可,音乐文件放在“musicLoad"文件夹下。 快捷键: (全局) Alt + R/r 刷新界面 Alt + 1 歌曲列表界面 Alt + 2 歌曲名界面 Alt + 3 笔记本界面 Alt + N/n 切换歌曲 Alt + 0 退出 歌曲列表界面下: M/r 切换模式 ←→ 调整音量 ↑↓ 选中歌曲 Enter 播放歌曲 P/p 暂停播放 歌曲名界面下: ←→ 下一首/上一首 笔记本界面: clear 刷新

2015-05-05

Sudoku数读游戏

linux下的数读游戏,用console写的,基于哈佛课程

2015-04-25

WinPcap ARP欺骗简单源码

非常简单清晰的ARP欺骗,除了对ARP帧的手工添加,其他都是WinPcap开发者手册里的。

2015-04-13

匿名管道重定向cmd

适合学习但又搞不懂的新手,了解匿名管道的重定向作用

2015-03-21

NamedPipe命名管道通信

用MFC做的客户端和服务器,只是简单地传输文字、自动接收,用命名管道技术。可以用来新手学习

2015-03-20

LED8*8点阵驱动

简单的很,就是老师要求做的8*8LED点阵驱动,用multisim12打开,8*8点阵没有封装元件,就是用二极管代替了,或许老师看到了还能表扬你理解了点阵23333

2014-11-17

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

TA关注的人

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