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
/*** | |
* Copyright (c) 2012 readyState Software Ltd | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may | |
* not use this file except in compliance with the License. You may obtain | |
* a copy of the License at | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* Unless required by applicable law or agreed to in writing, software | |
* distributed under the License is distributed on an "AS IS" BASIS, | |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
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 android.view.MotionEvent; | |
import org.cocos2d.actions.base.CCRepeatForever; | |
import org.cocos2d.actions.instant.CCCallFunc; | |
import org.cocos2d.actions.interval.CCAnimate; | |
import org.cocos2d.actions.interval.CCMoveTo; | |
import org.cocos2d.actions.interval.CCSequence; | |
import org.cocos2d.events.CCTouchDispatcher; | |
import org.cocos2d.layers.CCLayer; |
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
// http://www.cocos2d-x.org/boards/6/topics/23093 | |
//Hi, I'm using this class for generating random numbers since our app has multiplayer support on all platforms and consistent pseudo random numbers are very important: | |
//Based on Java's LinearRandom pseudo random number implementation | |
class Random | |
{ | |
public: | |
Random(void); | |
Random( long seed); | |
static void setSeed(long _seed); |
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
package org.cocos2d.tests; | |
import android.view.KeyEvent; | |
import org.cocos2d.actions.base.CCFiniteTimeAction; | |
import org.cocos2d.actions.ease.CCEaseBackInOut; | |
import org.cocos2d.actions.instant.CCCallFunc; | |
import org.cocos2d.actions.instant.CCCallFuncN; | |
import org.cocos2d.actions.interval.CCMoveTo; | |
import org.cocos2d.actions.interval.CCSequence; | |
import org.cocos2d.config.ccMacros; |
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/local/bin/python | |
import os,sys | |
from xml.etree import ElementTree | |
from PIL import Image | |
def tree_to_dict(tree): | |
d = {} | |
for index, item in enumerate(tree): | |
if item.tag == 'key': | |
if tree[index+1].tag == 'string': |
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 | |
#gypify.py for GYP (http://code.google.com/p/gyp) | |
#Found @ http://code.google.com/p/gyp/issues/detail?id=82 (Oct 1, 2009) | |
#Download original @ http://gyp.googlecode.com/issues/attachment?aid=1601673567448205219&name=gypify.py&token=qm9EhXN3mZxrS1pniUgsh5nG6Bs%3A1328804204976 | |
#Attached is a script that converts a set of existing Chromium-dependent | |
#.sln and .vcproj files to .gyp. It currently supports executable, shared | |
#library, static library and build event projects. The output .gyp file is | |
#created by: |
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
# | |
# STL GDB evaluators/views/utilities - 1.03 | |
# | |
# The new GDB commands: | |
# are entirely non instrumental | |
# do not depend on any "inline"(s) - e.g. size(), [], etc | |
# are extremely tolerant to debugger settings | |
# | |
# This file should be "included" in .gdbinit as following: | |
# source stl-views.gdb or just paste it into your .gdbinit file |
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
#!/bin/bash | |
f=$(pwd) | |
mkdir drawable-mdpi drawable-hdpi drawable-xhdpi drawable-xxhdpi | |
# fake argv and argc in bash | |
argc=$#; argv[0]=$0 # argv[0] is a prog name | |
for foo in $( seq $argc ) | |
do |
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
function _common_section | |
printf $c1 | |
printf $argv[1] | |
printf $c0 | |
printf ":" | |
printf $c2 | |
printf $argv[2] | |
printf $argv[3] | |
printf $c0 | |
printf ", " |