- 博客(262)
- 资源 (9)
- 收藏
- 关注
原创 OpenGL_入门
当前,三维图形编程工具中最为突出的是SGI公司的OpenGL(Open Graphics Language,开放式的图形语言),它已经成为一个工业标准的计算机三维图形软件开发接口。值得一提的是,虽然微软有自己的三维编程开发工具DirectX,但它也提供OpenGL图形标准,因此,OpenGL可以在微机中广泛应用。OpenGL非常接近硬件,是一个图形与硬件的接口,包括了100多个图形函数用来建立三维模
2017-10-12 16:44:34
577
原创 Unity_UGUI的事件系统
IPointerEnterHandler指针进入public void OnPointerEnter(PointerEventData eventData);IPointerExitHandler指针退出public void OnPointerExit(PointerEventData eventData);IPointerDownHand
2017-09-07 12:34:26
2813
原创 Unity_Attribute属性大全
using UnityEngine;using UnityEngine.Serialization;using System.Collections;using System.Runtime.InteropServices;//[RequireComponent(typeof(Rigidbody))]//[DisallowMultipleComponent]//[AddCompone
2017-09-07 11:41:47
664
原创 MongoDB_索引
'use strict';// connect MongoDBvar mongodb = require("mongodb");var server = new mongodb.Server("127.0.0.1", 27017, {auto_reconnect:true});var client = new mongodb.Db("testDB", server, {w:1});c
2016-02-03 23:33:50
600
原创 MongoDB_排序
'use strict';// connect MongoDBvar mongodb = require("mongodb");var server = new mongodb.Server("127.0.0.1", 27017, {auto_reconnect:true});var client = new mongodb.Db("testDB", server, {w:1});c
2016-02-02 23:34:02
695
原创 MongoDB_逻辑操作符
'use strict';// connect MongoDBvar mongodb = require("mongodb");var server = new mongodb.Server("127.0.0.1", 27017, {auto_reconnect:true});var client = new mongodb.Db("testDB", server, {w:1});c
2016-02-02 23:21:31
661
原创 MongoDB_记录条数limit和跳过条数skip
'use strict';// connect MongoDBvar mongodb = require("mongodb");var server = new mongodb.Server("127.0.0.1", 27017, {auto_reconnect:true});var client = new mongodb.Db("testDB", server, {w:1});c
2016-02-02 23:00:25
3703
原创 MongoDB_类型操作符
'use strict';// connect MongoDBvar mongodb = require("mongodb");var server = new mongodb.Server("127.0.0.1", 27017, {auto_reconnect:true});var client = new mongodb.Db("testDB", server, {w:1});c
2016-02-02 22:49:36
473
原创 MongoDB_条件操作符
'use strict';// connect MongoDBvar mongodb = require("mongodb");var server = new mongodb.Server("127.0.0.1", 27017, {auto_reconnect:true});var client = new mongodb.Db("testDB", server, {w:1});c
2016-02-02 00:06:47
1151
原创 Node.js_assert
var assert = require("assert");//assert.fail("2", "2", "assert.fail", ",");//var a = true;//var b = false;//assert(a == b, "测试是否为真。为真:不抛出异常;为假:抛出异常");//var a = 10;//var b = 10;//assert.equal
2016-02-01 23:01:58
517
原创 Node.js_exports和module.exports
Node.js中的exports与module.exports的区分1. module应该是require方法中,上下文中的对象2. exports对象应该是上下文中引用module.exports的新对象3. exports.a = xxx 会将修改更新到module.exports对象中4. exports = xxx 直接改变了 exports的指向上面这4条揭示了这两个
2016-01-31 12:42:46
502
原创 JavaScript_全局函数
console.log(Infinity);// 代表正的无穷大的数值。console.log(NaN);// 指示某个值是不是数字值。console.log(undefined);// 指示未定义的值。var uri = "www.baidu.com";var enUri = encodeURI(uri);var deUri = decodeURI(enUri);console.l
2016-01-30 22:54:44
465
原创 JavaScript_RegExp
var str = "visit cxm";var pat1 = /cxm/i;console.log(str.match(pat1));var pat2 = new RegExp("x");console.log(pat2.test("cxm"));// 是否匹配到,找到返回true,没找到返回falsevar pat3 = new RegExp("x");console.log
2016-01-30 22:27:18
377
原创 JavaScript_Math
console.log(Math.E);console.log(Math.PI);console.log(Math.SQRT2);console.log(Math.SQRT1_2);console.log(Math.LN2);console.log(Math.LN10);console.log(Math.LOG2E);console.log(Math.LOG10E);consol
2016-01-30 22:06:42
417
原创 JavaScript_Array
var arr = new Array();arr[0] = "hello";arr[1] = "world";arr[2] = "cxm";var arr1 = new Array();arr1[0] = "zqr";console.log(arr);console.log('concat:' + arr.concat(arr1));console.log('join:'
2016-01-30 21:56:29
411
原创 JavaScript_Date
var date = new Date();console.log(date);console.log(date.getFullYear());console.log(date.getMonth());console.log(date.getDay());console.log(date.getHours());console.log(date.getMinutes());conso
2016-01-30 20:40:41
476
原创 JavaScript_String
var x = "c,x,m";var y = new String("cxm");console.log(x);// => c,x,mconsole.log(y);// => c,x,mconsole.log(x[0]);// => cconsole.log(x[2]);// => xconsole.log(x[4]);// => m// 字符串属性console.log(x.
2016-01-30 19:17:49
375
原创 JavaScript_Json使用
// Json对象// var obj = {};// obj.name = "cxm";// obj.level = 80;// JsonLog(obj);// var obj = {};// obj.actor_id = {};// obj.actor_id.name = "cxm";// obj.actor_id.level = 80;// JsonLog(obj);
2016-01-28 23:39:31
398
原创 Node.js_Stream流
/** * Created by cxm on 2016/1/11. */var fs = require("fs");var zlib = require("zlib");// 读取流//var data = "";//var readStream = fs.createReadStream("input.txt");//readStream.setEncoding("utf
2016-01-17 14:39:03
408
原创 Node.js_Buffer缓冲区
/** * Created by cxm on 2016/1/11. *//*// 方式1var buf = new Buffer(10);console.log(buf.toString());// 方式2var buf = new Buffer([10, 20, 30, 40, 50]);console.log(buf.toString());// 方式3var b
2016-01-17 14:07:37
405
原创 Node.js_Dns模块
/** * Created by cxm on 2016/1/11. */var dns = require("dns");// 将域名(比如 'runoob.com')解析为第一条找到的记录 A (IPV4)或 AAAA(IPV6)。参数 options可以是一个对象或整数。如果没有提供 options,IP v4 和 v6 地址都可以。如果 options 是整数,则必须是 4 或
2016-01-16 14:54:45
393
原创 Node.js_Path模块
/** * Created by cxm on 2016/1/11. */var path = require("path");// 规范化路径,注意'..' 和 '.'。console.log(path.normalize("/test/test1//////2slashes/1slash/tab/.."));// 用于连接路径。该方法的主要用途在于,会正确使用当前系统的路径分
2016-01-15 18:21:36
881
原创 Node.js_OS模块
/** * Created by cxm on 2016/1/11. */// OS模块var os = require("os");// 定义了操作系统的行尾符的常量。console.log(os.EOL);// 返回操作系统的默认临时文件夹。console.log(os.tmpdir());// 返回 CPU 的字节序,可能的是 "BE" 或 "LE"。consol
2016-01-15 17:51:04
907
原创 Node.js_Get和Post
/** * Created by cxm on 2016/1/11. */var http = require("http");var url = require("url");var util = require("util");var querystring = require("querystring");// Get//http.createServer(functio
2016-01-15 17:05:17
304
原创 Node.js_常用工具
/** * Created by cxm on 2016/1/11. */var util = require("util");/*function Base(){ this.name = "Base"; this.base = 2016; this.sayHello = function() { console.log("Hell
2016-01-13 22:57:05
329
原创 Node.js_全局对象
/** * Created by cxm on 2016/1/11. */// setTimeout(function, delay)//function sayHello()//{// console.log("Hello World");//}//var time = setTimeout(sayHello, 2000);//clearTimeout(sayHello
2016-01-12 23:15:49
415
原创 Node.js_基本类型
/** * Created by cxm on 2016/1/11. */// numbervar count = 100;console.log(typeof(count));// stringvar str = "cxm";console.log(typeof(str));// functionvar func = function(data){ consol
2016-01-12 15:20:44
551
原创 Node.js_路由
/** * Created by cxm on 2016/1/11. */var server = require("./server");var router = require("./router");server.start(router.route);/** * Created by cxm on 2016/1/11. */var http = require("ht
2016-01-11 23:29:01
425
原创 Node.js_函数
/** * Created by cxm on 2016/1/11. */// 函数function say(str){ console.log(str);};function execute(func, value){ if (func) { func(value); }};execute(say, "Hello Wor
2016-01-11 23:12:00
317
原创 Node.js_事件驱动
/** * Created by cxm on 2016/1/11. */// 引入events事件模块var events = require("events");// 创建EventEmitter对象var eventEmitter = new events.EventEmitter();// 绑定connection事件eventEmitter.on("connecti
2016-01-11 22:21:47
358
原创 Node.js_同步/异步回调
/** * Created by cxm on 2016/1/11. */var fs = require("fs");// 回调函数// 同步读取//var data = fs.readFileSync("input.txt", "utf-8");//console.log(data.toString());////console.log("程序执行结束.");//
2016-01-11 22:06:07
413
原创 C#设计模式_单例模式
using System;using System.Collections;using System.Collections.Generic;using System.IO;using System.Linq;using System.Net;using System.Text;namespace CShapeTest{ // 没有考虑线程安全,如果有两个子线程在同时调用
2016-01-01 16:38:49
322
原创 C#_Http(Get/Post)
using System;using System.Collections;using System.Collections.Generic;using System.IO;using System.Linq;using System.Net;using System.Text;namespace CShapeTest{ class Start {
2015-12-27 22:45:10
408
原创 C#_List<T>升序排序和降序排序
using System;using System.Collections;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;namespace CShapeTest{ class Hero { private int age;
2015-12-27 15:06:53
15252
原创 C#_Dictionary<TKey, TValue>的使用
class Person { private int age; private string name; public Person(int age, string name) { this.age = age; this.name = name; }
2015-12-27 13:04:14
1335
原创 C#_List<T>的使用
class Person { private int age; private string name; public Person(int age, string name) { this.age = age; this.name = name; }
2015-12-27 12:51:48
461
原创 C#_IEnumerable和IEnumerable<T>
using System;using System.Collections;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;namespace CShapeTest{ // 实现非泛型IEnumerable可枚举接口 class Teacher:
2015-12-22 22:58:46
3448
原创 C#_LINQ数据查询
using System;using System.Collections;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;namespace CShapeTest{ class Master { public int Id {
2015-12-22 22:34:58
614
原创 C#_StreamReader读取文本文件
using System;using System.Collections;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;namespace CShapeTest{ class Start { static void Main(
2015-12-20 13:29:19
5330
原创 C#_FileStream读取文本文件和二进制文件
using System;using System.Collections;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;using LitJson;namespace CShapeTest{ class Start { st
2015-12-20 13:05:52
15473
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人