原创 靜態二維數組與指針數組

// test_array.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "stdio.h" //#

原创 VS2010導入源代碼方法以及編譯中出現的錯誤修改

從網上下載了一個C文件工程,裏面有.c結尾的源文件和.h結尾的頭文件。想要把這個工程導入到VS2010中去,方法如下: 在VS2010  File  菜單欄中選擇new->project from existing code,然後按照提示

原创 cuda下調試矩陣相加程序

這幾天一直在調試cuda下的矩陣相加程序,但一直運行錯誤,最後才發現是我的NVIDIA不支持double類型,導致出錯。下面是我的代碼:  #include "stdio.h" #include "cuda_runtime.h" #in

原创 vim 配置成IDE環境

最近由於換機器配置了幾個vim環境,覺得有必要總結一下。 首先下載資源裏的vim配置IDE環境文件包,將其中的vimrc 文件跟 vim文件夾分別拷貝到用戶主目錄下,拷貝成爲.vimrc 跟.vim。打開vim編輯器,就發現強大的界面出來

原创 dojo MultipleEditor 類

用於DataGrid 編輯時,根據不同數據類型展現不同的編輯樣式 dojo.provide("widget.MultipleEditor"); dojo.require("dojox.grid.cells.dijit"); dojo.d

原创 leetcode word search

#include<stdafx.h> #include<iostream> #include<string> #include<vector> using namespace std; class Solution{ public: b

原创 C++ 字符數組初始化

字符數組的輸入輸出可以有兩種方法:(1) 逐個字符輸入輸出,不會在後面自動加\0結束符,需要記錄數組長度,對應初始化的例子: const int N=8; char ch[N]={'a','b','c','d','e','f','g','

原创 宏定義的編譯鏈接

在沒有編譯的時候它存在哪?沒預處理的時候它當然時在源文件或頭文件中了,這裏連連目標文件都還沒,程序文件更沒有,是吧?編譯時在哪?編譯的時候,準確的說是預處理的時候,它就不在了,它的位置被其值取代了。比如://在頭文件中定義宏set_pll

原创 leetcode 編輯距離

class Solution { public: int minDistance(string word1, string word2) { // Start typing your C/C++ solution

原创 python爬蟲含登錄

#!/usr/bin/python # -*- coding: utf-8 -*- import re; import cookielib; import urllib; import urllib2; import optparse;

原创 leetcode minimum window substring

class Solution { public: bool findAll(vector<int> to_find,vector<int> has_find){ bool flag=true; for(int i=0;i<

原创 leetcode simplify path

#include<stdAfx.h> #include <iostream> #include <stack> #include <string> using namespace std; class Solution{ public:

原创 dojo require provider registerPath

轉自:http://www.okajax.com/a/200807/0HW9522008_6.html package機制 說完了dojo裏的類繼承機制,不得不說說package機制。 主要用到的有  dojo.require 

原创 leetcode interleaving string

class Solution{ public: bool interLeave(string s1,int len1,string s2,int len2,string s3,int len3){ bool flag=false;

原创 字符串循環左移——編程珠璣第二章B

將字符串“abcdefg”,循環左移3位,得到“defgabc”. 字符串循環左移,有四種基本算法。 1,臨時字符數組保存abc,將defg左移到頭,abc補充。時間複雜度N+rotdist,空間複雜度rotdist。 2,每次臨時保存最