02 2015 档案

摘要:Given a string containing only digits, restore it by returning all possible valid IP address combinations. Example: Input: "25525511135" Output: ["255 阅读全文
posted @ 2015-02-28 15:28 Grandyang 阅读(21643) 评论(5) 推荐(5) 编辑
摘要:Qt中的QDialog类是用来生成对话框的类,QFileDialog 类是QDialog的衍生类,主要用来生成打开文件,或是打开文件目录的对话框,或者是保存文件的对话框,下面我们一一来看代码:1. Load File Dialog/** * Button event for Load File bu... 阅读全文
posted @ 2015-02-28 08:07 Grandyang 阅读(1798) 评论(0) 推荐(0) 编辑
摘要:Qt中QCheckBox的按键响应如下,其中checkbox为对象名:void YourClass::on_checkbox_toggled(bool state) { // Do something here} 阅读全文
posted @ 2015-02-28 07:38 Grandyang 阅读(1275) 评论(0) 推荐(0) 编辑
摘要:http://www.zcool.com.cn/tosearch.do?page=4&world=%E6%9A%82%E5%81%9C&cateType=104&subcateType=0&channel=0&other=0&sort=0&uid=0&time=0&limit=10&recommen... 阅读全文
posted @ 2015-02-28 05:37 Grandyang 阅读(2438) 评论(0) 推荐(0) 编辑
摘要:Qt中的QTabWiget 类提供了一个标签控件,但是这个控件默认初始化的颜色是白色,和原窗口的颜色不同,看起来非常的违和,所以我们希望将其的背景颜色设为当前窗口的背景颜色。我们所要做的就是先将应用程序窗口的背景颜色取出来,然后再赋给QTabWiget 类的每个标签,比如说我们有tab1和tab2两 阅读全文
posted @ 2015-02-28 03:10 Grandyang 阅读(1750) 评论(0) 推荐(0) 编辑
摘要:用OpenCV同时显示两个摄像头的内容的代码如下:#include #include #include #include #include #include using namespace std;int _tmain(int argc, _TCHAR* argv[]) { CvCapture... 阅读全文
posted @ 2015-02-27 04:48 Grandyang 阅读(3705) 评论(0) 推荐(0) 编辑
摘要:在做项目中,我们经常需要获取系统的当前时间,那么如何获取呢,参见下面的代码:/* asctime example */#include /* printf */#include /* time_t, struct tm, time, localtime, asctime *... 阅读全文
posted @ 2015-02-27 01:55 Grandyang 阅读(20243) 评论(0) 推荐(0) 编辑
摘要:Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1 ... n. Example: Input: 3 Output: [ [1,null,3,2], 阅读全文
posted @ 2015-02-26 13:16 Grandyang 阅读(22746) 评论(9) 推荐(3) 编辑
摘要::-) smile:-] polite smile:-( frown:-[ another frown:-/ or :-\ skepticism, annoyance, or a slight frown:-| indecision, deadpan, or indifference; also o... 阅读全文
posted @ 2015-02-26 06:50 Grandyang 阅读(10314) 评论(0) 推荐(0) 编辑
摘要:Qt中的信号槽系统是不同类中间传递数据的神器,如果连接父子空间之间的信号槽很重要,在父类中实例化子类的时候一定要注意将父类连上,不然信号槽无法使用,比如若子类是个对话框Dialog类,一定不要忘了加thisQtClass *qc = new QtClass(this);qc->exec();然后如果... 阅读全文
posted @ 2015-02-26 05:41 Grandyang 阅读(2581) 评论(0) 推荐(1) 编辑
摘要:Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? Example: Input: 3 Output: 5 Explanation: Given n = 3, the 阅读全文
posted @ 2015-02-25 14:56 Grandyang 阅读(23991) 评论(4) 推荐(4) 编辑
摘要:Qt中的Label标签控件的作用绝不仅仅限于显示静态文本,其实它的功能很强大,由于其有setPixmap()成员函数,故而可以当显示图片窗口使用,而且还可以实时显示摄像头捕获的图片,然后它对鼠标事件的支持却没有QWidget那样强大,很多时候我们想要QLabel捕获鼠标单击或双击的事件,它本身无法实 阅读全文
posted @ 2015-02-25 01:41 Grandyang 阅读(3354) 评论(0) 推荐(0) 编辑
摘要:Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Example 2: Note: Try to come up as many solutions as you 阅读全文
posted @ 2015-02-24 15:13 Grandyang 阅读(32861) 评论(15) 推荐(2) 编辑
摘要:Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. Example 1: Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac" Output: 阅读全文
posted @ 2015-02-24 14:03 Grandyang 阅读(17721) 评论(14) 推荐(3) 编辑
摘要:Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only 阅读全文
posted @ 2015-02-24 02:26 Grandyang 阅读(34939) 评论(17) 推荐(2) 编辑
摘要:Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Example 1: Input: [1,3,null,null,2 阅读全文
posted @ 2015-02-23 15:13 Grandyang 阅读(22361) 评论(8) 推荐(4) 编辑
摘要:Given a binary tree, return the inorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Recursive so 阅读全文
posted @ 2015-02-22 05:51 Grandyang 阅读(34954) 评论(11) 推荐(8) 编辑
摘要:Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文
posted @ 2015-02-21 14:55 Grandyang 阅读(14492) 评论(7) 推荐(0) 编辑
摘要:Ctrl-CCopyCtrl-XCutCtrl-VPasteCtrl-ZUndoCtrl-YRedoCtrl-ASelect AllCtrl-FLaunch Find DialogCtrl-HLaunch Find / Replace DialogCtrl-DDuplicate Current ... 阅读全文
posted @ 2015-02-21 02:42 Grandyang 阅读(749) 评论(0) 推荐(0) 编辑
摘要:在使用Qt和OpenCV编程时,对于它们各自的图像类QImage和IplImage难以避免的需要互相之间的转换,下面我们就来看它们的相互转换。1. QImage 转换为 IplImageIplImage *QImageToIplImage(const QImage * qImage){ int... 阅读全文
posted @ 2015-02-21 01:46 Grandyang 阅读(2064) 评论(0) 推荐(0) 编辑
摘要:Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2015-02-20 13:52 Grandyang 阅读(19989) 评论(5) 推荐(2) 编辑
摘要:在Qt中经常需要弹出窗口,QMessageBox可以实现此功能,一共有三种窗口,information, question, 和 warning,critical, about分别对应感叹号,问号和叉号等等,使用方法很简单,一共有三个参数,第一个是父窗口句柄,剩下两个分别为窗口名称和显示内容,显示内... 阅读全文
posted @ 2015-02-20 07:13 Grandyang 阅读(14690) 评论(0) 推荐(0) 编辑
摘要:Qt5从Qt4升级后,很多原来Qt4中定义的函数或者变量由于种种原因在Qt5中被遗弃,所以用Qt5来编译Qt4的一些工程项目时,难以避免的会需要修改一些地方,下面就罗列一些我遇到的一些需要修改的地方:- Qt5中UnicodeUTF8不再是QCoreApplication的一个成员,所以下面的代码需... 阅读全文
posted @ 2015-02-20 05:11 Grandyang 阅读(5704) 评论(0) 推荐(0) 编辑
摘要:Go to Linker -> General -> Additional LIbrary Directories:qtmaind.libQt5Cored.libQt5Guid.libQt5Widgetsd.libQt5Multimediad.libQt5MultimediaWidgetsd.lib 阅读全文
posted @ 2015-02-20 03:16 Grandyang 阅读(282) 评论(0) 推荐(0) 编辑
摘要:Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2015-02-19 17:29 Grandyang 阅读(14288) 评论(4) 推荐(0) 编辑
摘要:Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2015-02-18 14:36 Grandyang 阅读(40751) 评论(2) 推荐(2) 编辑
摘要:Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced bina 阅读全文
posted @ 2015-02-18 07:54 Grandyang 阅读(16785) 评论(11) 推荐(0) 编辑
摘要:Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is d 阅读全文
posted @ 2015-02-17 14:45 Grandyang 阅读(17133) 评论(6) 推荐(0) 编辑
摘要:1. leetcodehttp://leetcode.com/2. careeruphttp://www.careercup.com/http://hawstein.com/posts/ctci-solutions-contents.html3. glassdoorhttp://www.glassd... 阅读全文
posted @ 2015-02-17 03:38 Grandyang 阅读(17957) 评论(2) 推荐(0) 编辑
摘要:Given two strings s and t, return the number of distinct subsequences of s which equals t. The test cases are generated so that the answer fits on a 3 阅读全文
posted @ 2015-02-16 14:50 Grandyang 阅读(15808) 评论(11) 推荐(1) 编辑
摘要:Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: click to show hints. Hints: If you n 阅读全文
posted @ 2015-02-16 11:07 Grandyang 阅读(23014) 评论(3) 推荐(3) 编辑
摘要:3DSlicer, a free open source software for visualization and medical image computingAcetoneISO:镜像文件挂载软件Adobe Photoshop Album, an image organizing appli... 阅读全文
posted @ 2015-02-14 00:42 Grandyang 阅读(8556) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree struct Node { int val; Node *left; Node *right; Node *next; } Populate each next pointer to point to its next right node. If there 阅读全文
posted @ 2015-02-13 13:51 Grandyang 阅读(18632) 评论(14) 推荐(1) 编辑
摘要:Qt中的表单控件QListWidget类提供了许多信号函数,可以和用户交互,其中有个currentRowChanged ( int currentRow ) 是检测当前选中行是否发生了改变,如果改变了,该信号函数被触发。void QListWidget::currentRowChanged ( in... 阅读全文
posted @ 2015-02-13 04:57 Grandyang 阅读(4366) 评论(0) 推荐(0) 编辑
摘要:这三个类相互有关联,但是有不尽相同,首先从名字上看,QDir 和 QDirIterator 是针对于文件目录的,也就是文件夹,我们知道,对于一个文件夹,可以包含很多文件,也可以包含其他文件夹,通常是一个树的结构。文件夹里还可以包含符号链接,符号链接是指向其他文件或文件夹的一种链接,和Windows系... 阅读全文
posted @ 2015-02-13 01:56 Grandyang 阅读(4835) 评论(0) 推荐(0) 编辑
摘要:You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following defin 阅读全文
posted @ 2015-02-12 15:07 Grandyang 阅读(17301) 评论(0) 推荐(1) 编辑
摘要:在Qt中添加按钮或表格控件时需要添加其按键响应,一般来说有两种方法,一种是直接实现其响应函数,第二种是自己写一个响应函数,然后用Qt的信号槽将它们连接起来。愚以为第一种方法更为简单一些。声明这些控件:QPushButton *pbutton;QListWidget *lwidget;然后实现它们的响... 阅读全文
posted @ 2015-02-12 02:16 Grandyang 阅读(3977) 评论(0) 推荐(0) 编辑
摘要:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the fo 阅读全文
posted @ 2015-02-11 15:14 Grandyang 阅读(16079) 评论(6) 推荐(1) 编辑
摘要:Qt 支持的图片格式如下:FormatDescriptionQt's supportBMPWindows BitmapRead/writeGIFGraphic Interchange Format (optional)ReadJPGJoint Photographic Experts GroupRe... 阅读全文
posted @ 2015-02-11 05:41 Grandyang 阅读(1544) 评论(0) 推荐(0) 编辑
摘要:初学Qt的人会经常搞不清这三个图像类QGrphicsView, QGraphicsScene 和 QGraphicsItem,它们到底有什么区别呢?QGrphicsView类实际上是为QGraphicsScene类的内容提空了一个控件,它在一个可滑动视图空间内可视化QGraphicsScene的内容... 阅读全文
posted @ 2015-02-11 05:19 Grandyang 阅读(1501) 评论(0) 推荐(0) 编辑
摘要:The DNA sequence is composed of a series of nucleotides abbreviated as 'A', 'C', 'G', and 'T'. For example, "ACGAATTCCG" is a DNA sequence. When study 阅读全文
posted @ 2015-02-10 16:11 Grandyang 阅读(17957) 评论(17) 推荐(1) 编辑
摘要:Qter开源社区http://www.qter.org/[Qt教程], 作者yafeilinux[视频]QT学习之路:从入门到精通 《C++ Qt 编程视频教程》 阅读全文
posted @ 2015-02-10 01:33 Grandyang 阅读(557) 评论(0) 推荐(0) 编辑
摘要:Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2015-02-09 17:09 Grandyang 阅读(40141) 评论(18) 推荐(1) 编辑
摘要:Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2015-02-09 08:39 Grandyang 阅读(28193) 评论(3) 推荐(1) 编辑
摘要:Say 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 阅读全文
posted @ 2015-02-08 16:12 Grandyang 阅读(22947) 评论(1) 推荐(1) 编辑
摘要:Given a non-empty binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any 阅读全文
posted @ 2015-02-08 15:55 Grandyang 阅读(25384) 评论(11) 推荐(3) 编辑
摘要:Canvas APIBasic LayoutsCamera ExampleVideo Widget ExampleImage Viewer ExamplePart 6 - Loading and SavingShow in Finder / Show in ExplorerItem Views Ex... 阅读全文
posted @ 2015-02-07 06:18 Grandyang 阅读(438) 评论(0) 推荐(0) 编辑
摘要:ActiveQt ExamplesUsing ActiveX from Qt applications.Animation Framework ExamplesDoing animations with Qt.Animated TilesApplication ChooserEasing Curve... 阅读全文
posted @ 2015-02-07 04:09 Grandyang 阅读(14890) 评论(0) 推荐(0) 编辑
摘要:http://blog.sina.com.cn/s/blog_a6fb6cc90101gynd.html 用了这么久的Qt,IDE一直都是VS与Creator并用(实际开发以VS为主),至于哪个更好这里不发表看法,各有所长,而且也因人而异,萝卜青菜,各有所爱。 Qt5发布很久之后,才把版本从之前的... 阅读全文
posted @ 2015-02-07 01:56 Grandyang 阅读(3183) 评论(0) 推荐(0) 编辑
摘要:GTK+2.0 中的容器控件与布局技巧GTK+图形化应用程序开发学习笔记(一)—概述 阅读全文
posted @ 2015-02-06 06:13 Grandyang 阅读(532) 评论(0) 推荐(0) 编辑
摘要:https://developer.gnome.org/gtkmm-tutorial/unstable/index.html.zh_CN1. 序言1.1. 本书 1.2. gtkmm 2. 安装2.1. 依赖关系 2.2. Unix 和 Linux 2.3. Microsoft Windows 3.... 阅读全文
posted @ 2015-02-06 06:02 Grandyang 阅读(1101) 评论(0) 推荐(0) 编辑
摘要:CvMat:typedef struct CvMat{ int type; int step; /* for internal use only */ int* refcount; int hdr_refcount; union { uchar... 阅读全文
posted @ 2015-02-06 04:12 Grandyang 阅读(2362) 评论(0) 推荐(0) 编辑
摘要:Given an unsorted array of integers, find the length of the longest consecutive elements sequence. Your algorithm should run in O(n) complexity. Examp 阅读全文
posted @ 2015-02-06 01:01 Grandyang 阅读(25207) 评论(13) 推荐(2) 编辑
摘要:原文地址: http://blog.csdn.net/holybin/article/details/17711013在OpenCV中Mat、CvMat和IplImage类型都可以代表和显示图像。 IplImage由CvMat派生,而CvMat由CvArr派生即CvArr -> CvMat -> I... 阅读全文
posted @ 2015-02-05 00:44 Grandyang 阅读(3509) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 whic 阅读全文
posted @ 2015-02-05 00:14 Grandyang 阅读(9813) 评论(4) 推荐(0) 编辑
摘要:Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning 阅读全文
posted @ 2015-02-04 05:04 Grandyang 阅读(17953) 评论(10) 推荐(1) 编辑
摘要:Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. A palindro 阅读全文
posted @ 2015-02-03 14:54 Grandyang 阅读(22262) 评论(3) 推荐(1) 编辑
摘要:多行注释:VS2010: /NotePad++: Ctrl QXcode: CMMND /回到光标所在之前位置VS2010: Ctrl +/-关闭当前页:VS2010: 鼠标中键NotePad: Ctrl W选中当前词:VS2010: ... 阅读全文
posted @ 2015-02-03 02:04 Grandyang 阅读(1358) 评论(0) 推荐(0) 编辑
摘要:Given a reference of a node in a connected undirected graph, return a deep copy (clone) of the graph. Each node in the graph contains a val (int) and 阅读全文
posted @ 2015-02-02 13:56 Grandyang 阅读(21549) 评论(15) 推荐(1) 编辑
摘要:刷题必备书籍:Cracking the Coding Interview: 150 Programming Questions and Solutions简历:The Google Resume: How to Prepare for a Career and Land a Job at Apple... 阅读全文
posted @ 2015-02-02 09:59 Grandyang 阅读(1988) 评论(1) 推荐(0) 编辑
摘要:There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it cost 阅读全文
posted @ 2015-02-02 09:19 Grandyang 阅读(21071) 评论(6) 推荐(2) 编辑

Fork me on GitHub