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.cocos2dx.lua; | |
import org.cocos2dx.lib.Cocos2dxLuaJavaBridge; | |
import org.cocos2dx.lib.Cocos2dxActivity; | |
import cn.cmgame.billing.api.BillingResult; | |
import cn.cmgame.billing.api.GameInterface; | |
import cn.cmgame.billing.api.LoginResult; | |
import cn.cmgame.gamepad.api.Gamepad; | |
import cn.cmgame.gamepad.api.KeyState; |
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
-- add dragging sensitive of the ccui.Pageview | |
function smoothpv(pageview, n) | |
n = n or 8 | |
local pagen = #pageview:getPages() | |
for i = 0, pagen-1 do | |
local page = pageview:getPage(i) | |
page:addTouchEventListener(function(sender, e) | |
if e ~= ccui.TouchEventType.canceled then | |
return | |
end |
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 com.example.hello; | |
import android.app.Activity; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.widget.Toast; | |
import android.app.AlertDialog; | |
import android.app.Dialog; | |
import android.content.Context; |
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
/* Unipay SDK for cocos2d-x */ | |
package com.xingdong.tpyzz; | |
import android.annotation.SuppressLint; | |
import android.app.AlertDialog; | |
import android.content.DialogInterface; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.os.Message; |
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
static char* ito10_tab100[100] = { | |
"00", "10", "20", "30", "40", "50", "60", "70", "80", "90", | |
"01", "11", "21", "31", "41", "51", "61", "71", "81", "91", | |
"02", "12", "22", "32", "42", "52", "62", "72", "82", "92", | |
"03", "13", "23", "33", "43", "53", "63", "73", "83", "93", | |
"04", "14", "24", "34", "44", "54", "64", "74", "84", "94", | |
"05", "15", "25", "35", "45", "55", "65", "75", "85", "95", | |
"06", "16", "26", "36", "46", "56", "66", "76", "86", "96", | |
"07", "17", "27", "37", "47", "57", "67", "77", "87", "97", | |
"08", "18", "28", "38", "48", "58", "68", "78", "88", "98", |
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
#coding: utf-8 | |
"""Default tags used by the template system, available to all templates.""" | |
from __future__ import unicode_literals | |
from django.template import (Node, NodeList, Library, TextNode, | |
TemplateSyntaxError, VariableDoesNotExist) | |
from django.template.smartif import IfParser, Literal | |
register = Library() |
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
# Check the alias | |
keytool -list -keystore ${MYKEY}.jks | |
# Export to PKCS12 | |
keytool -importkeystore -srckeystore ${MYKEY}.jks -destkeystore ${MYKEY}.pkcs -srcstoretype JKS -deststoretype PKCS12 -alias ${MYALIAS} | |
# Convert to PEM | |
openssl pkcs12 -in ${MYKEY}.pkcs -out ${MYKEY}.pem |
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
# 查询缺失的主键ID | |
set @a := 0; | |
select t.r0, t.r1 from | |
( | |
select id, @a+1 as r0, id-1 as r1, if(id>@a+1, 0, 1) as 'series', @a:=id as 'a' from test | |
order by id | |
) t | |
where t.series=0 | |
order by t.id | |
; |
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
#coding: utf-8 | |
"""添加自定义过滤器""" | |
from jinja2 import Environment | |
from jinja2.runtime import Undefined | |
def do_date(date, format): | |
"""时间格式化 | |
~ 用法:{{xxx|date('%Y-%m-%d %H:%M:%S')}} | |
""" | |
s = date.strftime(format.encode('utf-8')) |
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
#coding: utf-8 | |
class Struct(dict): | |
""" | |
- 为字典加上点语法. 例如: | |
>>> o = Struct({'a':1}) | |
>>> o.a | |
>>> 1 | |
>>> o.b | |
>>> None | |
""" |
OlderNewer