Skip to content

Instantly share code, notes, and snippets.

@greeness
greeness / gist:1887114
Created February 22, 2012 20:40
dou di zhu
斗地主人工智能 [2007-3-7]
http://www.ylog.net/blog_show.asp?log_id=2148
近一周在制作斗地主纸牌游戏的人工智能
算法主要是用宽度优先生成一棵搜索树
再根据玩牌的技巧进行剪枝与判权....
节点权值判断主要由有限状态机构成
@syuhari
syuhari / CardFlip
Created October 13, 2012 21:50
flip card for cocos2d-x
void Card::flipAction() {
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
CCSprite* card = CCSprite::spriteWithFile("card_face.png");
card->setPosition(ccp(winSize.width/2, winSize.height/2));
this->addChild(card, CARD_FACE_TAG, CARD_FACE_TAG);
card->setVisible(false);
CCSprite* card2 = CCSprite::spriteWithFile("card.png");
card2->setPosition(card->getPosition());
1. 修改 php-fpm.conf 文件,添加(或修改)如下配置:
[global]
error_log = log/error_log
[www]
catch_workers_output = yes
2. 修改 php.ini 文件,添加(或修改)如下配置:
@CptAsgard
CptAsgard / Greyscale.cs
Created May 15, 2014 11:24
Unity Greyscale image effect
using UnityEngine;
using System.Collections;
public class Greyscale : MonoBehaviour {
public Material mat;
void Start() {
mat.SetFloat( "_Power", 0.0f );
}

C#编码规范

概述

规范制定原则

  • 方便代码的交流和维护。
  • 不影响编码的效率,不与大众习惯冲突。
  • 使代码更美观、阅读更方便。
  • 使代码的逻辑更清晰、更易于理解。
@peterskipper
peterskipper / callorfold.py
Created September 17, 2014 16:28
A simple program to calculate exact pot odds in Texas Hold'em poker, and use them to determine mathematically when to call or fold
#Evaluate Poker Hands at the flop in Texas Hold'em
import collections
#Some Constants
VALUES = ["A","2","3","4","5","6","7","8","9","10","J","Q","K"]
SUITS = ["s","h","d","c"]
HIGH_STRAIGHT = ["10", "J", "Q", "K", "A"]
#Helper function to check input
def check_card(card):
@wong2
wong2 / cmds.txt
Last active August 14, 2025 07:28
在任意聊天中输入。 [ ]表示后面要跟一个空格(可能还需要别的参数才能生效)
//wearversion
//wearlog
//wearvoiceinputenable
//wearvoiceinputdisable
//weargoogleapi
//assert
//pushassert
//uplog
//upcrash
//switchnotificationstatus
@pantone170145
pantone170145 / AdMobUtility.cs
Last active February 21, 2024 23:47
AdMob test device ID acquisition for Unity (Checked unity version: 5.2.3p2)
using UnityEngine;
using Cryptography = System.Security.Cryptography;
using System.Text;
#if UNITY_IOS
using UnityEngine.iOS;
#endif
/// <summary>
/// AdMobUtility
@jringrose
jringrose / FindProjectReferences.cs
Last active June 17, 2022 21:34
Unity editor extension that uses spotlight on OSX for lightning fast project reference searches. Asset serialization mode should be set to "Force Text" in the editor settings.
/*
MIT License
Copyright (c) 2016 Jesse Ringrose
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@gccpacman
gccpacman / wechat_getappmsgext.py
Created April 29, 2016 14:27 — forked from chen206/wechat_getappmsgext.py
微信公众号文章抓取阅读数和点赞数
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import json
from urlparse import urlparse, parse_qs
import requests