Cocos2d-x加载TiledMap地图出现黑线问题

当前测试版本Cocos2d-x 3.1.7版本,采用传统的TMXTiledMap会出现问题黑线问题,尤其是人物跳转超出屏幕范围会出现横黑线闪烁,如图。

Black Line

网上有很多方法,都比较繁琐。我的最快的解决办法是直接将cocos2d::TMXTiledMap替换为cocos2d::experimental::TMXTiledMap,其它方法不变。
原来方法

cocos2d::TMXTiledMap *_tiledMap = TMXTiledMap::create(StringUtils::format("res/maps/Level-%d.tmx",1));
this->ad[......]

Read more

光大银行收取西联支付汇款

Google终于给我寄钱了,激动了,办了一张光大银行啦,回来啦,赶紧填写西联汇款啦。结果最后发现“无符合条件的记录,请与发汇人确认汇款信息”。其实是按照网上的教程填写的,以往的教程是将“发汇人常驻国家(地区)”选择为“United States/美国”。但是目前我收到的Google Adsense的汇款账单方是


Google Asia Pacific Pte. Ltd.
70 Pasir Panjang Road
#03­71, Mapletree Business City Singapore 117371

请随身携带以下材料付款金额:$xx.xx

汇款监控号(MT[......]

Read more

Django自定义404,500页面

1.创建一个项目

django-admin.py startproject HelloWorld

2.进入HelloWorld项目,在manage.py的同一级目录,创建templates目录,并在templates目录下新建404.html,500.html两个文件。

3.修改settings.py
(1.)DEBUG修改为False,(2.)ALLOWED_HOSTS添加指定域名或者IP,(3.)指定模板路径‘DIRS’: [os.path.join(BASE_DIR, ‘templates’)],

# SECURITY WARNING: don't run with d[......]

Read more

nginx服务器配置解决API的跨域问题

在采用jquery ajax调用http请求时,发现了一系列问题:
如采用firebug调试API请求(这个API是自己服务器的应用),看到服务器明明返回200状态,response返回数据也是json格式,但ajax返回的error。
在排除json数据格式不正确的原因之后,发现了ajax error函数返回“networkerror failed to execute ‘send’ on ‘xmlhttprequest’ failed to load ‘http //“ XMLHttpRequest.status=0,就是没有初始化。
后来才知道是跨域问题(CORS),因为程序调用的[......]

Read more

CentOS 7 安装ftp服务器

走过很多弯路,就简单点总结。

1.安装ftp,相信这步很简单

# yum -y install ftp vsftpd

查看安装情况

#rpm -qc vsftpd /etc/logrotate.d/vsftpd /etc/pam.d/vsftpd /etc/vsftpd/ftpusers /etc/vsftpd/user_list /etc/vsftpd/vsftpd.conf

2.服务器配置

创建ftp根目录 /ftp/private(这里有个不解的问题,如果创建了一个/root/ftp/private的目录,登录时会提示500 OOPS: cann[......]

Read more

nginx每天定时分割日志

环境说明:
操作系统CentOS7.0,默认在线安装nginx。
nginx配置文件路径:/etc/nginx/nignx.conf,
nginx日志文件路径:/var/log/nginx/access.log
nignx.pid路径:/run/nginx.pid
新建的定时脚本位置/shell/nginx/logs.sh

1.新建脚本并执行

#mkdir /shell/nignx

#cd /shell/nginx

#vim logs.sh
#!/bin/bash

base_path='/var/log/nginx'

log_path=$[......]

Read more

Linux 设置Redis开机启动

CentOS7.0

假设Redis已经安装,版本3.2.4

#cd redis-3.2.4

#mkdir /etc/redis

#cp redis.conf /etc/redis/6379.conf

#cp utils/redis_init_script /etc/init.d/redis

#chmod a+x /etc/init.d/redis

#cp src/redis-server /usr/local/bin/

#cp src/redis-cli /usr/local/bin/

#vim /etc/init.d/redis
在脚本[......]

Read more

chmod: Unable to change file mode on swoole.so: Operation not permitted

情景是:安装swoole,发现无法写入目录权限 ,于是执行sudo chmod -R 777 extension发现以下错误(系统是OS X El Capitan 10.11)。

chmod: Unable to change file mode on extensions: Operation not permitted

各种尝试均无法解决。后来发现 OSX的System Integrity Protection(系统集成保护),就是系统的文件即使有了root权限依然无法使用(rootless)。

解决办法就是将Mac关机,然后重新启动,按下Power键之后长按Comman[......]

Read more

Mac 安装scikit-learn

尽管在http://scikit-learn.org/stable/install.html的官网上已经提供了相关的安装教程,但安装起来还是遇到不少困难,记录一下。

官方文档要求

Scikit-learn requires:
	Python (>= 2.6 or >= 3.3),
	NumPy (>= 1.6.1),
	SciPy (>= 0.9).

说一下我的环境

OSX 10.8.5
Python2.7

系统默认安装了多个版本的Python,可以通过

port select --list python

查看结果

Availab[......]

Read more