Time of Update: 2018-12-04
一旦你瞭解了OCaml便會感到它是一門非常神奇的語言,不過學習它的第一步卻是非常困難的。希望這個小小的教程可以讓事情變得簡單些。首先OCaml不是一個結構化語言,它屬於函數語言家族。純粹的函數語言沒有提供迴圈機制(你需要使用遞迴來完成迴圈),變數也不可改變,以及其它的一些限制。幸運的是OCaml不是一個純粹的函數語言因此可以使用迴圈與更改變數。現在讓我們開始OCaml的探險曆程吧:)首先讓我們啟動OCaml,在命令提示字元下輸入 ocaml 。你將看到下面的內容:Objective Caml
Time of Update: 2018-12-04
#include <iostream>#include <algorithm>#include <cstring>#include <vector>#include <fstream>using namespace std;const int maxn=100;const int INF=999999;int pre[maxn];bool visited[maxn];int d[maxn],cost[maxn][maxn],n,m; /
Time of Update: 2018-12-04
轉移:Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject") MyFileObject.CopyFile server.MapPath("NewsFile/"&sSaveFileName&""),server.MapPath(""&sTitle&"/"&sSaveFileName&"")
Time of Update: 2018-12-04
template<class T> class Widget;template<typename T> class Widget;這兩種聲明區別不大。但在一些場合,必須使用typename。 template<typename C> // typename/class都行void f(const C& container, // 直接用C就好 typename
Time of Update: 2018-12-04
問題描述判斷包含萬用字元的匹配字串是否完全符合輸入的字串,匹配字串中包含的萬用字元僅有‘ * ’和‘?’,且萬用字元不會連續出現 。(要求完全符合,而不是包含)其中,萬用字元‘ * ’:代替 0 個或多個字元,萬用字元‘ ? ’:代替一個字元 要求實現函數int GetMatchSta (const char *ArrStr, const char *KeyStr)【輸入】 ArrStr : 給定的字串 KeyStr : 包含萬用字元的匹配字串【輸出】
Time of Update: 2018-12-04
/**File: pc.cpp**Title: Demo Producer/Consumer.**Short: A solution to the producer consumer problem using pthreads.*This is a simple FIFO pipe between two tasks. The primary problem is*ensuring that the producer blocks if the FIFO is full, and the
Time of Update: 2018-12-04
設有n種不同面值的硬幣,各硬幣的面值存於數組T[1:n]中。現要用這些面值的硬幣來找錢,可以實用的各種面值的硬幣個數不限。當只用硬幣面值T[1],T[2],…,T[i]時,可找出錢數j的最少硬幣個數記為C(i,j)。若只用這些硬幣面值,找不出錢數j時,記C(i,j)=∞。 輸入結果儲存在1.txt中,輸出結果儲存在2.txt中。#include<iostream>#include <fstream>using namespace std;int
Time of Update: 2018-12-04
for ( argp = argv+1 ; *argp ; argp++ ) { if ( **argp == '-' ) { opt = *argp + 1; if ( !*opt )usage(); while ( *opt ) {switch ( *opt ) {case 's':/* Use "safe, slow and stupid" code */ stupid = 1; break;case 'r':/* RAID mode */
Time of Update: 2018-12-04
ListNode* find_midlist(ListNode* head){ ListNode *p1, *p2; if (head == NULL || head->next == NULL) { return head; } p1 = p2 = head; while (1) { if (p2->next != NULL && p2->next->next != NULL)
Time of Update: 2018-12-04
Dialog 有兩種使用方法:一:在Activity中重寫onCreateDialog(int id)的方法來建立Dialog的對象並返回,然後調用Activity中的showDialog(int id)和DismissDialog(int id)來顯示和隱藏Dialog對話方塊@Overrideprotected Dialog onCreateDialog(int id) {AlertDialog.Builder dialog=null;if(id==100){LinearLayout ll
Time of Update: 2018-12-04
因為12月6日要考日語二級,所以暫時停止對blog的更新,希望大家諒解~特別是落奇先生~很感謝你關注我blog是否更新~有你的關注,更加能督促我堅持下去! 自學了一年左右就去報了日本語二級(JLPT-2),本來沒有打算過的,結果出來還真的沒有過,但是死的太慘烈了~離合格線就差一分239! 如果上次過了,我真的也會崇拜我,但是一切都是因為那一分發生了改變!! 這次我真的也是沒有多少把握,因為工作忙的原因,我很少有時間看日語,所以決定花這10幾天,每天晚上回家要看看真題,衝刺一下,不管結果如何,
Time of Update: 2018-12-04
/* * Memory Setup stuff - taken from blob memsetup.S * * Copyright (C) 1999 2000 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl) and * Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl) * * Modified for the Samsung SMDK2410 by * (C)
Time of Update: 2018-12-04
遊戲開發中,免不了有很多定時任務、動畫效果。這些不是在一次的流程中就能執行完畢的。正常情況下,我會想到用線程,但是,這麼多定時任務,這麼多動畫效果,哪能這麼多線程呢?~ 於是,笨木頭有笨方法~自己類比一下多線程就好了嘛~不就間隔一段時間執行一個函數麼,簡單~來,看看: public class GameEventThread extends Thread {private final String TAG = "GameEventThread";private int SLEEP_TIME =
Time of Update: 2018-12-04
Terminal 裡提示編譯錯誤,原因是 World
Time of Update: 2018-12-04
原文連結:http://blog.csdn.net/zhangxaochen/article/details/8058590假如有這樣的代碼(hello 是個sprite):hello->setRotation(720);hello->runAction( CCRotateTo::create(2, 720) );設定 sprite的初始角度720度,然後命令他 "CCRotateTo::create(2, 720)"。
Time of Update: 2018-12-04
http://www.cppblog.com/besterChen/archive/2011/01/20/138965.html 轉載聲明 本文轉載於 冥冥之中 的163部落格,地址:http://blog.163.com/fengyi1103@126/blog/static/138356274201081741324532/ 感謝 毛叔 網友 翻譯。 在這篇教程裡,我們會講解如何使用cocos2d和Tiled Map
Time of Update: 2018-12-04
http://www.cnblogs.com/lovers/articles/2624745.html背景:接到一個任務將某個廠家提供的視頻SDK進行封裝,接入某電網公司視頻監控統一平台,從該平台提出的介面協議中第一次看到SIP和一些互動報文。又一次深深感受到知識的匱乏。。。。。曆經兩天,google、論壇、部落格全用上了收集相關資料,覺著不錯的列舉如下:1.
Time of Update: 2018-12-04
原文連結:http://blog.csdn.net/zhangxaochen/article/details/8033270box2d 記憶體管理: b2Shape 的管理寫box2d 的代碼,往往都見過這樣的一段: b2EdgeShape groundEdge; b2FixtureDef boxShapeDef; boxShapeDef.shape=&groundEdge;這個代碼往往寫在 init()
Time of Update: 2018-12-04
我的程式裡-《我的歌聲裡》程式員版http://v.pps.tv/play_32K66I.html#from_wlist《青春代碼》IT男為愛做駭客 無悔青春http://v.pps.tv/play_33LR90.html屌絲程式員http://v.pps.tv/play_34YF3C.html#from_wlist程式員之歌~程式員都是SB
Time of Update: 2018-12-04
Type: CreationalSingleton: 保證一個類只有一個樣本,並且提供一個全域指標指向他。Singleton也能夠被無狀態化。提供工具性質的功能。#include <iostream>using namespace std;class Singleton{public: static Singleton* instance() { static Singleton uniqueInstance; return