• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            2012年12月10日

            Given an array S of n integers, are there elements x, y, z in S such that x + y + z = 0? Find all unique triplets in the array which gives the sum of zero.

            Note:

            • Elements in a triplet (a,b,c) must be in non-descending order. (ie, a ≤ b ≤ c)
            • The solution set must not contain duplicate triplets.

              一個重要的優化就是如果上個數已經求過集合了 例如[-1 -1 0 2 2]已經包含了[-1 0 2 2] 當然也包含了 [-1 0 2]集合的。

            posted @ 2012-12-10 11:38 micheal's tech 閱讀(209) | 評論 (0)編輯 收藏

            2012年12月4日

            #include <thread>

            template <typename Duration, typename Function>
            void timer(Duration const & d, Function const & f)
            {
                std::thread([d,f](){
                    std::this_thread::sleep_for(d);
                    f();
                }).detach();
            }

            posted @ 2012-12-04 18:10 micheal's tech 閱讀(1131) | 評論 (0)編輯 收藏

            This problem is caused when including <windows.h> before <winsock2.h>. Try arrange your include list that <windows.h> is included after <winsock2.h> or define _WINSOCKAPI_ first:

            先包含winsock2.h
            再包含windows.h

            posted @ 2012-12-04 15:39 micheal's tech 閱讀(1360) | 評論 (0)編輯 收藏

            2012年12月3日

            普通類調用中必須吧zmq設置為指針 否則單純構造無法初始化
            直接用初始化列表

            context(1),netsocket(zmq::socket_t(context, ZMQ_REP))

            posted @ 2012-12-03 17:51 micheal's tech 閱讀(374) | 評論 (0)編輯 收藏

            2012年11月14日

            看見費曼學習方法 我覺得可能管用,最近試一下。

            posted @ 2012-11-14 10:17 micheal's tech 閱讀(565) | 評論 (0)編輯 收藏

            2012年5月17日

            感覺動態規劃中最難的部分是在尋找 從狀態j到狀態i的遞歸式,就像證明歸納法一樣,你得找出具體的式子來。
            top bottom
            bottom up
            1. Longest Increasing Subsequence:
            L[i] = max(1+L(j))(j<l && a[j]<a[i])
            //if not exist any a[j]<a[i]
            L[i] = 1;

            getmaxvalueof array a[]


            2. Maximum Sum Increasing Subsequence
            almost same with above

            3. Maximum continous sum

            4. rod cutting

            posted @ 2012-05-17 09:54 micheal's tech 閱讀(435) | 評論 (0)編輯 收藏

            2012年4月17日

            最近在stackexchange網站上看到了一個非常好的問答,有人問:你做過的最有效的提高你的編程水平的一件事情是什么? 回首作為一個程序員這些年來的生活和職業道路,我使用了很多種不同的方法來提高我的編程技能 —— 閱讀代碼,編寫程序,閱讀書籍,聽講座,看視頻,等等。 我的問題是:你做過的最有效的提高你的編程水平的一件事情是什么?對于那些想提高水平的程序員,你的建議是什么? 我希望你們提供的答案是各種各樣的,并且不是那種“放之四海而皆準”的答案 —— 我希望得到適用于不同人的不同的答案。 有很多人給出了自己的答案,在這里,我將其中最受認可的前三種答案選出來翻譯給大家。 最受歡迎的回答:學無止境 沒有特別的先后次序… 和比自己更聰明的人一起工作永遠樂意聽取他人的意見,不管對方是低級水平,一般水平,資深,還是大師。職稱頭銜并不代表一切。學習其它的框架/語言,學習它們是的工作原理和思想,拿它們跟你已知的技術做比較。學習各種設計模式,最佳實踐理論,然后用它們檢查自己先前的知識,在需要的時候使用這些模式。結對編程 反對Joel說的一切。 第二受歡迎的回答:成為多面手 爭取成為一個‘多面手萬事通’ 在我職業生涯的早期,我在一種數據庫和編程語言上是個專家。不幸的是,這種數據庫在“數據庫戰爭”中落敗了,我才發現我的職業道路…很窄。在此之后,我下定決心以后決不能把自己封在一個小空間里。我開始學習所有手頭上能接觸到的東西:Windows,Unix,C,C++,Java,C#,Perl,Python,Access,SQL Server,Oracle,Informix,MySQL,等等。不管什么樣的新的,不常見的工具或技術,我都成為“大拿” —— “去問克雷格(作者自己),他要是不會,他會去學會的。”結果,我做了各種各樣的項目,從為環境監測做嵌入式系統,到為導彈防御做命令和控制系統。 我在各種的公司里唯一遇到的問題是:它們堅持要把我固定在一個專門的研究方向內,而我的專門研究是要成為一個多面手。[編輯:也叫做學識淵博的人或多才多藝的人或多領域專家。] 有些事情需要留意 … 高科技界里知識的半衰期是多少?根據摩爾定律(Moore’s law):18-24月內,半數你學到的知識都會過時。錯誤的遵循這種規律的專家會輕易的在這種技術發展的壓力崩潰;一個多面手要做的事就是不斷的豐富自己的技能,并從應用這些技能的經歷中吸取教訓。 第三受歡迎的回答:不要跟臭棋簍子下棋 我一直認為自己在不錯的程序員中也算是個“灌籃高手”。直到有個家伙——我們叫他艾倫——被招進團隊。艾倫很顯然在很多方面都比我優秀。也比我年輕。他讓我認識到,在過去的這些年里,我沒有多少長進。我是一個特定技術方向的程序員,而且是水平一般。 這驚醒我應該自覺的不斷提高自己的水平,特別是我寫的代碼的水平。 艾倫引導我學會了很多東西。他告訴我,大部分我寫的代碼在今后的數年里都將一直維護和進行擴展,寫代碼時要將這點銘記在心。我應該為我的代碼寫自動測試程序。艾倫說代碼的開發一定不能停止在第一版上,應該不斷的重構,提煉,讓它達到完美。我發現,我對這些語言和工具的使用都還有還很大的改進空間。 從艾倫那我學到的最重要的一件事情是:永遠不要停止學習。 數年后,艾倫離開了公司。我的心里突然感覺空蕩蕩的。這些年與他為伴讓我在技能上提升到了一個全新的水平,我知道現在我比團隊里的其他人優秀很多。他們仍然寫著糟糕的代碼,犯著以前犯過的錯誤。我努力教育他們,但他們對此不感興趣。事實上,他們討厭有人這樣傲慢自大的指出他們犯的錯誤。 于是,幾個月后,我也離開這這個公司。我去了一個很小的公司,在一個很出色的團隊里工作。那里每個人都渴望學習更多知識,我喜歡這樣的。 我很幸運能遇到艾倫。沒有他,我也許現在仍然待在那家死氣沉沉的公司和那幫食古不化的家伙在一起,哪都去不了,想的全是自己的私利。 這個討論在stackexchange網站上的地址是這里。 從我個人而言,我覺得第三個答案對我最有價值,不知各位同行們有什么感受?請寫在評論里與大家分享。

            posted @ 2012-04-17 08:40 micheal's tech 閱讀(385) | 評論 (1)編輯 收藏

            2012年4月12日

            今天開始記錄

            posted @ 2012-04-12 13:56 micheal's tech 閱讀(268) | 評論 (0)編輯 收藏

            2009年12月1日

            VS 2008 uninstall package.



            upgrade code.



            posted @ 2009-12-01 17:20 micheal's tech 閱讀(320) | 評論 (0)編輯 收藏

            2009年11月17日

            How can I run another application or batch file from my Visual C# .NET code?

            Published 01 June 04 11:54 PM

            Posted by: Duncan Mackenzie, MSDN
            This post applies to Visual C# .NET 2002/2003

            Suppose you want to run a command line application, open up another Windows program, or even bring up the default web browser or email program... how can you do this from your C# code?

            The answer for all of these examples is the same, you can use the classes and methods in System.Diagnostics.Process to accomplish these tasks and more.

            Example 1. Running a command line application, without concern for the results:

            private void simpleRun_Click(object sender, System.EventArgs e){
             System.Diagnostics.Process.Start(@"C:\listfiles.bat");
            }

            Example 2. Retrieving the results and waiting until the process stops (running the process synchronously):

            private void runSyncAndGetResults_Click(object sender, System.EventArgs e){
             System.Diagnostics.ProcessStartInfo psi =
              
            new System.Diagnostics.ProcessStartInfo(@"C:\listfiles.bat");
             psi.RedirectStandardOutput =
            true;
             psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
             psi.UseShellExecute =
            false;
             System.Diagnostics.Process listFiles;
             listFiles = System.Diagnostics.Process.Start(psi);
             System.IO.StreamReader myOutput = listFiles.StandardOutput;
             listFiles.WaitForExit(2000);
             
            if (listFiles.HasExited)
             {
              
            string output = myOutput.ReadToEnd();
              
            this.processResults.Text = output;
             }
            }

             Example 3. Displaying a URL using the default browser on the user's machine:

            private void launchURL_Click(object sender, System.EventArgs e){
             
            string targetURL = @http://www.duncanmackenzie.net;
             System.Diagnostics.Process.Start(targetURL);
            }

            In my opinion, you are much better off following the third example for URLs, as opposed to executing IE with the URL as an argument. The code shown for Example 3 will launch the user's default browser, which may or may not be IE; you are more likely to provide the user with the experience they want and you will be taking advantage of the browser that is most likely to have up-to-date connection information.

            C# code download available from http://www.duncanmackenzie.net/Samples/default.aspx

            By the way, this post is a simple port of an earlier VB FAQ post... just in case you thought you had seen it already in your feeds...

            posted @ 2009-11-17 13:10 micheal's tech 閱讀(301) | 評論 (0)編輯 收藏

            僅列出標題  下一頁
            久久99精品九九九久久婷婷| 久久99精品久久久久久动态图 | 国产精品欧美亚洲韩国日本久久| 青青热久久国产久精品 | 国内精品九九久久精品| 久久精品国产亚洲av麻豆色欲| 日日噜噜夜夜狠狠久久丁香五月| 精品久久久无码人妻中文字幕豆芽 | 国内精品久久九九国产精品| 久久精品国产精品亚洲| 午夜精品久久久久久毛片| 欧美久久精品一级c片片| 久久久国产精华液| 国产精品99久久精品爆乳| 人妻精品久久久久中文字幕69| 狠狠人妻久久久久久综合| 一本色道久久HEZYO无码| 777久久精品一区二区三区无码 | 亚洲精品99久久久久中文字幕| 久久精品亚洲中文字幕无码麻豆| 久久久不卡国产精品一区二区 | 久久久久国产亚洲AV麻豆| 波多野结衣中文字幕久久| 久久久久亚洲国产| 久久无码AV中文出轨人妻 | 久久免费99精品国产自在现线 | 香蕉99久久国产综合精品宅男自 | 性欧美大战久久久久久久| 99久久精品日本一区二区免费| 狠狠综合久久综合88亚洲| 久久久精品波多野结衣| 97久久精品人人澡人人爽| 久久久精品午夜免费不卡| 久久精品嫩草影院| 国产精品久久自在自线观看| 久久精品无码一区二区无码| 影音先锋女人AV鲁色资源网久久| 亚洲国产成人精品无码久久久久久综合| 国产精品狼人久久久久影院| 中文字幕亚洲综合久久2| 99精品久久久久久久婷婷|