有些效果是用substance的材质,但是材质上的属性无法用平常的Material方法调用,需要ProceduralMaterial去调用,
using UnityEngine;
using System.Collections;
public class TestProceduralMaterial : MonoBehaviour {
public GameObject TestCube;...
分类:
其他好文 时间:
2014-07-17 21:08:23
阅读次数:
438
比如一串字符串
123
如果只想拿到123怎么办呢?
用perl的正则表达式可以很容易的做到。
$str =~ s/(.+?)/$3/sg;
这种只能过滤掉左右对称的标签,如果你的字符串里的html标签不对称,或者是有缺陷,这种方式就做不了了。
如果上边的看不懂,那看个简单的:
$retPromotionInfo=~s///g;
$retPromotionIn...
分类:
Web程序 时间:
2014-07-17 21:06:10
阅读次数:
381
??
Building for UN
Time Limit: 5000MS
Memory Limit: 65536K
Total Submissions: 1367
Accepted: 599
Special Judge
Description
The United Nations has decided to buil...
分类:
其他好文 时间:
2014-07-17 20:37:19
阅读次数:
294
??
Description
Petya has k matches, placed in n matchboxes lying in a line from left to right.
We know that k is divisible by n. Petya wants all boxes to have the same number of matches in...
分类:
其他好文 时间:
2014-07-17 20:35:53
阅读次数:
249
pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t*mutex)函数
传入的参数mutex用于保护条件,因为我们在调用pthread_cond_wait时,如果条件不成立我们就进入阻塞,但是进入阻塞这个期间,如果条件变量改变了的话,那我们就漏掉了这个条件。因为这个线程还没有放到等待队列上,所以调用pthread_cond_wait前要先...
分类:
编程语言 时间:
2014-07-17 20:24:12
阅读次数:
236
题意:有n种面值的硬币a[i],每种硬币有c[i]个,问能组成不大于m面值(1~m)的个数。
多重背包模板:by背包九讲。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#d...
分类:
其他好文 时间:
2014-07-17 20:16:48
阅读次数:
233
package main
import (
"html/template"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"path"
"runtime/debug"
)
const (
ListDir = 0x0001
UPLOAD_DIR = "./uploads"
TEMPLATE_DIR = "./v...
一、下载pip并安装
# wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-1.4.tar.gz#md5=ca790be30004937987767eac42cfa44a
# tar -zxf pip-1.4.tar.gz
# cd pip-1.4
# python setup....
分类:
编程语言 时间:
2014-07-17 19:32:09
阅读次数:
271
UVA 12230 - Crossing Rivers
题目链接
题意:给定几条河,每条河上有来回开的船,某一天出门,船位置随机,现在要求从A到B,所需要的期望时间
思路:每条河的期望,最坏就是船刚开走3L/V,最好就是直接上船L/V,期望为4L/V/2 = 2L/V,然后在算上陆地上的时间,就是答案
代码:
#include
#include
int n;
d...
分类:
其他好文 时间:
2014-07-17 19:29:44
阅读次数:
223
1、某些数据库在外面是不能使用的。2、ContentProvider让A程序中的数据能让B程序使用3、ContentProvider主要是共享数据。可以添加ContentObserver来观察数据的变化4、中的authorities主要用于区分不同的provider5、content://cn.itcast.aqlite.provider((/person)/id)解析:content:// ...
分类:
移动开发 时间:
2014-07-17 19:28:01
阅读次数:
295