This file contains hidden or 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
// life cycle | |
NSMutableString *s1 = [NSMutableString stringWithCapacity:10]; | |
NSMutableString *s2 = [[NSMutableString alloc] initWithCapacity:10]; | |
[s2 release]; | |
// fill string | |
[s1 appendFormat:@"%@ Objective-C!", @"Hello"]; | |
NSLog(@"%@", s1); | |
// append string | |
[s1 appendString:@" Glad to be here."]; | |
NSLog(@"%@", s1); |
This file contains hidden or 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
// Source:http://answers.unity3d.com/questions/133838/extending-the-editor-with-c.html | |
// 这个代码存为LookAtPoint.cs | |
using UnityEngine; | |
using System.Collections; | |
public class LookAtPoint : MonoBehaviour { | |
public Vector3 lookAtPoint; | |
// Use this for initialization | |
void Start () |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
void GameLayer::useSpriteSheet() | |
{ | |
// 建立SpriteBatchNode | |
// 方法1: | |
CCSpriteFrameCache::sharedSpriteFrameCache()-> | |
addSpriteFramesWithFile("sprite_sheet.plist"); | |
_gameBatchNode = CCSpriteBatchNode::create("sprite_sheet.png"); | |
this->addChild(_gameBatchNode); | |
// 方法2: |
This file contains hidden or 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
/* | |
Return an array in this structure | |
http://stackoverflow.com/questions/20173954/how-to-return-a-multidimensional-table-from-c-function-to-lua | |
In Lua array values usually starts at 1. | |
{ | |
[1] = { ["field1"] = "1", ["field2"] = "2" , ["field3"] = "3" }, | |
[2] = { ["field1"] = "10" , ["field2"] = "20", ["field3"] = "30" } | |
} | |
*/ |
This file contains hidden or 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
# !/bin/bash | |
# Copyright (c) 2011 Float Mobile Learning | |
# http://www.floatlearning.com/ | |
# | |
# Extended by Ronan O Ciosoig January 2012 | |
# | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the "Software"), |
This file contains hidden or 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
# 列出当前目录往下所有层次目录的svn:ignore属性内容,方便查看项目的所有忽略属性 | |
svn pg -R svn:ignore . |
This file contains hidden or 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
Sub btnGenerateCppSrc_Clicked() For i = 8 To 146 Step 1 'ActiveSheet.Cells(i, 12).Interior.Color = ColorConstants.vbWhite If ActiveSheet.Cells(i, 3).Interior.Color = ActiveSheet.Cells(5, 2).Interior.Color Then ' 跳过对灰色行的处理 ElseIf IsEmpty(ActiveSheet.Cells(i, 3)) Then ' 跳过空行 Else Dim cellString, minValueStr, maxValueStr, commentStr, finalString As String cellString = ActiveSheet.Cells(i, 3).Text minValueStr = ActiveSheet.Cells(i, 6).Text maxValueStr = ActiveSheet.Cells(i, 7).Text commentStr = ActiveSheet.Cells(i, 5).Text 'Debug.Print cellString Dim typeStr As String If ("float" = LCase(ActiveSheet.Cells(i, 11).Text)) Then typeStr = "float" Else typeStr = "int" End If finalString = "FG_ATTR_CLAMP_SYNTHESIZE(" & typeStr & ", m_" & cellString & ", " & cellString & ", " & m |
This file contains hidden or 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
<!DOCTYPE html> | |
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<style> | |
body { | |
background: repeat url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/7QCIUGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAGscAVoAAxslRxwCAAACAAAcAnQAV8KpIENoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbGQgLSBodHRwOi8vd3d3LnJlZGJ1YmJsZS5jb20vcGVvcGxlL0NoYWV5b3VuZ1dpbGxOZXZlckNoYWVvbAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPAAACAxiVFJDAAAEPAAACAx0ZXh0AAAAAENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueQAAZGVzYwAAAAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAA |
This file contains hidden or 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
-- 固定分钟采样数量(防止停服时遗漏采样行)的在线人数分钟采样详单 | |
SET @TOTAL_MINUTES_OF_A_DAY := 24*60; | |
SET @CURR_MINUTE := 0; | |
SELECT | |
(@CURR_MINUTE := @CURR_MINUTE+1)-1 as sampleId, | |
@targetDateBeginTs+60*(@CURR_MINUTE-1) as sampleTimeTs, | |
FROM_UNIXTIME(@targetDateBeginTs+60*(@CURR_MINUTE-1)) as sampleTime | |
FROM | |
-- 以下临时表可生成10000种排列组合 | |
(select 0 union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) t1, |