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
// "org.json4s" %% "json4s-native" % "3.2.4" | |
import org.json4s._ | |
import org.json4s.native.Serialization._ | |
case class AAA(a : Option[Long],b : Option[Long],c : Option[Long]) | |
object JsonTest { | |
def toJson[Value <: AnyRef](any : Value) : String = { | |
write(any)(DefaultFormats) |
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
bool HelloWorld::init() | |
{ | |
if (!Layer::init()) return false; | |
auto reader = cocostudio::SceneReader::getInstance(); | |
// SceneEditorデフォルトに存在するサンプルを読み込む | |
auto node = reader->createNodeWithSceneFile("FightScene.json"); | |
auto hero = node->getChildByTag(10005); // サンプル上のheroに設定されていたtagの値 | |
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
case class Version(v: Int *) extends Ordered[Version] { | |
def compare(other: Version) = { | |
c(v,other.v) | |
} | |
def c(v1: Seq[Int], v2: Seq[Int]): Int = { | |
val diff = v1.headOption.getOrElse(0) compare v2.headOption.getOrElse(0) | |
if(diff == 0) c(v1.tail,v2.tail) else diff | |
} | |
} |
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
// header file | |
#include "cocos-ext.h" | |
#include "CCPointer.h" | |
// https://github.com/ivzave/cocos2dx-ext/blob/master/CCPointer.h | |
USING_NS_CC; | |
USING_NS_CC_EXT; | |
class CCLabelTTFWithAnimation |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ |
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
for i in *.png ; do /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool -e PVRTC --bits-per-pixel-4 -o "${i%.png}.pvr}" -f PVR $i ; done |
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 SampleScene::onEnter() | |
{ | |
〜略〜 | |
// 時間があっているかチェックする | |
NtpChecker::sharedInstance()->check(this, ntpchecker_selector(SampleScene::bonus)); | |
} | |
void SampleScene::bonus(NtpResult result) | |
{ |
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
def convertLine(line) | |
line = line.gsub("]","").gsub("[","") | |
line = line.gsub(" +09:00","") | |
# 変換候補文字列を抽出 | |
# ex. N'POINT (0 0)' -> GeomFromText('POINT (0 0)') | |
points = line.scan(/N'POINT \(.+?\)'/) | |
points.each do |point| | |
line = line.gsub(point,point.gsub("N'","GeomFromText('").gsub(")'",")')")) | |
end | |
line + ";" |
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
def convertLine(line) | |
# 可読性のため一次変数に受ける | |
result = line.gsub("]","").gsub("[","").gsub("UNIQUEIDENTIFIER","NVARCHAR (38)") | |
result = result.gsub("NVARCHAR \(MAX\)","NVARCHAR \(256\)") | |
result.gsub("DATETIMEOFFSET (7)","TIMESTAMP").gsub("sys.geography","geometry") | |
end | |
def convertDDL(path) | |
@inDDL = false | |
@isGEO = false |
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
# APIGateway + Lambda + DynamoDB | |
# sample query | |
# {"tableName":"performance_test","operation":"read","payload": {"test_id":"aaaaaaa"}} | |
# {"tableName":"performance_test","operation":"delete","payload": {"test_id":"aaaaaaa"}} | |
# {"tableName":"performance_test","operation":"create","payload": {"test_id":"aaaaaaa","value":"aaaaaaaaa"}} | |
import boto3 | |
import json | |
print('Loading function') |
OlderNewer