- 博客(12)
- 资源 (3)
- 收藏
- 关注
原创 拖延心理学
如果处于一个对自己要求严格追逐完美害怕犯错害怕出丑拖延不前不敢尝试的时期,不如来看一些客观的观念吧,个别的观念可以融入过往经历以及性格来分析一下。成熟之时,应该对这些话更有体会。万事无完美。努力尝试是一件好事,而不是愚蠢或软弱的表现。失败并不危险。失败是正常的,这是生活的正常组成部门。真正的失败是不敢去经历。每个人都有局限,包括我自己。如果那是一件值得去做的事情,那么为
2016-04-27 11:54:04 589
原创 CUDA内核函数的连续执行
以下是两个连续的CUDA核函数衔接的一种思路:要完成的功能:1. 向量的计算computer(暂时以两向量求和为例);2. 对结果向量求和SUM。思路1:写1个计算的内核函数,中间结果保留,求和函数调用cublas。#include "cuda_runtime.h"#include "device_launch_parameters.h"#include "cublas_v2.h"
2016-04-19 23:17:31 1607
原创 一个MEX程序示例
mex文件是由C或Fortran语言编写的源代码,经matlab编译器处理而产生的二进制文件。它可以被matlab解释器自动装载并执行的动态链接程序,类似windows下的dll文件。mex文件实现了C语言与matlab的接口,以下例子阐述该接口。#include "mex.h" #include double GetLogLike(int size, double* x, double
2016-04-12 16:57:50 647
原创 linux下C/C++程序简单调试
假设已经有Windows下调试程序的基础,要在linux下进行简单的程序调试,可以使用gdb(Linux下的一个调试工具)。前提是在编译的时候加上 -g选项。以下是常用命令使用方法和作用: file a.out //把要调试的程序a.out加载进来。file是把要调试的那个程序加载进来,a.out即要调试的程序名。b 112 //在程序的112行添加断点r //将程序跑起来
2016-04-06 16:01:01 740
原创 24. Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. Y
2016-04-05 00:31:32 204
原创 22. Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()
2016-04-04 23:21:42 186
原创 4Sum
Given 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:Element
2016-04-04 22:38:33 227
原创 17. Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input:Digit st
2016-04-03 23:03:39 198
原创 12. Integer to Roman
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.题意:整数转为罗马序列。思路:把1000,900,500,400,100,90,50,40,10,9,5,4,1作为基数,然后进行除法和取余运算。class
2016-04-03 22:21:17 228
原创 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). Fin
2016-04-03 17:10:01 217
原创 The hunt(狩猎)影评
所谓影评,其实只是写写自己看过电影后的一些体会,一家之言,如有不同望淡然置之~ 这是一部来自丹麦的电影,印象中看过的丹麦电影不多,但都是思想深刻类型的。这部《狩猎》也同样给人留下了深刻的印象。故事讲述的是一个小女孩儿说了一个她遭受幼儿园教师(主角)对她性侵犯的谎话,然后这个主角陷入各种悲惨的处境,甚至威胁生命。 影片中最悲惨的一块儿当然是真理被绑架,一群自以为正直的人还在不
2016-04-03 01:02:57 3404
原创 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, and there exists one unique longest palindromic substring.题意:找一个字符串的最大回文子字符串
2016-04-01 01:05:57 195
CUDA编程指南
2016-04-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人