原创 C++讀取csv文件

保存表頭,通過序列號找到相應數據,通過表頭獲取對應的值 #include "stdafx.h" #include <fstream> #include <sstream> #include <map> #include <Windows.

原创 apache+php+mysql環境配置

1.先在某個目錄下新建三個文件夾,命名爲apache,php,mysql 2.先安裝好apache,並確保其能成功運行。 3.將下載好的php文件放入剛纔新建的php文件夾下 4.配置apache與php 5.新建一個php文件

原创 node.js 連接數據庫

var mysql = require("mysql"); var TEST_DATABASE = "test"; var TEST_TABLE = "user_data"; var client = mysql.createConn

原创 C++ split 字符串分割實現

#include "stdafx.h" #include <vector> #include <Windows.h> #include <iostream> using namespace std; vector<string> Spl

原创 C++ sort 對自定義類型進行排序

#include "stdafx.h" #include <vector> #include <Windows.h> #include <iostream> #include <algorithm> using namespace std

原创 cocos2dx 3.x lua環境配置與代碼調試

版本: Cocos2dx 3.10 Lua 環境配置: 這裏使用VS +BabeLua進行編輯與調試 新建項目: 直接上圖(注意紅框的地方!)     注意事項: 1.增加路徑,以前的版本有,後來再也沒看了.注意看紅框地方,要加入這個才

原创 js字符串補0

function fill(num, n) { var len = num.toString().length; while (len < n) { num = "0" + num; len

原创 Cocos2dx WebSocket的使用

Cocos2dx封裝了WebSocket,可以直接在項目中使用 廢話不多說,直接上代碼 //HelloWorldScene.h #ifndef __HELLOWORLD_SCENE_H__ #define __HELLOWORLD_S

原创 C++ 獲取時間 毫秒級

#include <Mmsystem.h> #pragma comment( lib,"winmm.lib" )uint32 beginTime = timeGetTime(); 複製去Google翻譯翻譯結果

原创 Cocos2dx NotificationCenter(廣播或通告)的使用方法

1.添加一個觀察者 NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(ClassName::method),"message",nullptr)

原创 typescript事件通知機制

PS: 本文參考PureMVC 用到的模式是觀察者模式,本來是自己想要一個事件通知機制,剛好看到pureMVC,於是單獨把裏面的事件通知剝離出來單獨用,只有靜態的方法,如果你想要考慮複用的話, 可以把靜態改掉。代碼如下 emitter.

原创 html異步加載js

function loadScript(url, callback) { var script = document.createElement('script'); script.type = 'text/javascr