This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
启动 mongodb: | |
> mongod --dbpath [dir] | |
# 使用安全认证、指定路径、指定日志地址 | |
> mongod --auth --dbpath /usr/mongo/data --logfile /var/mongo.log | |
# 关闭服务器 | |
> db.shutdownServer() | |
# 修复 | |
> mongod --repair | |
mongodb commands: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import random | |
data = [1,2,3,4,5,6,7,8,9,0,11,12,13,14,15,16] | |
def randomize(data): | |
for i in xrange(0,len(data)*10): | |
idx1 = random.randint(0, len(data)-1) | |
idx2 = random.randint(0, len(data)-1) | |
if idx1!=idx2: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Net.Sockets; | |
using System.Net; | |
namespace ConsoleApplication1 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class NewBehaviourScript : MonoBehaviour | |
{ | |
public int lastTouchCount; | |
public float startTouchSpace; | |
public float thisTouchSpace; | |
public bool isControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Sample | |
{ | |
class Test | |
{ | |
public static System.Reflection.Assembly Compile(string source) | |
{ | |
var p = new Microsoft.CSharp.CSharpCodeProvider(); | |
var c = p.CreateCompiler(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
CGPROGRAM | |
#pragma vertex vert | |
#pragma fragment frag | |
#include "UnityCG.cginc" | |
uniform sampler2D _Ramp; | |
uniform half4 _Color; | |
struct v2f { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#description:python implementation of sockpol.cs for Unity corss domain socket security policy. | |
#last-modified:2012/4/9 14:03 | |
#author:huliangjie | |
import socket | |
import select | |
import threading | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Data; | |
using System.Drawing; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
C# 监听文件变化 | |
*/ | |
var fsw = new FileSystemWatcher("../../scripts"); // 监视指定文件夹 | |
fsw.Changed += fsw_Changed; // 注册事件回调 | |
fsw.EnableRaisingEvents = true; // 启用事件通知 (事件异步触发) | |
/* ================================= */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filename_in = "sourcefile.name" | |
filename_out = "destinationfile.name" | |
fin = open(filename_in, "r") | |
fout = open(filename_out, "w") | |
original_word = "WORD" | |
replace_by = "DROW" | |
match_buffer = "" | |
replace_count = 0 |
OlderNewer