望辰阁


以前远远望见山顶有个大亭子,今日终于能一睹芳容,登高远眺于尘埃之上?‍??‍? 2017.09.17

坚持写博客

在这微信微博肆虐的年头,写博客的真不多了。但对我来说,微博是给大家看的,微信给朋友看的,只有博客是给自己看的,致内心不同相位的另一个我?

Connected Standby 导致的问题

有个废弃的IntelComputeStick,Win8.1系统,拿来当Server,用一段时间后总是失去响应,ping显示丢包率100%。Google一把,发现是Connected Standby导致的问题。虽然电源配置中设置了NeverSleep,但在系统idle一段时间后,计划任务会用winsat改变电源配置,从而导致触发CS,在注册表中把CSEnabled改成0,就能完美解决。

收藏一张git 命令图

jenkins iOS编译 总结

1、首先安装jenkins,
从官网https://jenkins.io/下载最新的for MacOSX安装包;
填入初始密码,选择插件(选默认即可),添加用户,直到进入jenkins界面;

安装后会默认创建和使用jenkins用户,此用户下xcode编译,证书和provisioning profile配置会有一堆坑;

2、创建一个测试项目jktest,提交到git上 http://tixbay.net/gitblit/r/test/jktest.git
修改jenkins用户密码sudo passwd jenkins;
然后用jenkins用户登录系统;
随便找个目录git clone http://tixbay.net/gitblit/r/test/jktest.git 然后用XCode打开,选择配置好签名,能正常打包即可;
然后console进入工程目录,运行xcodebuild,不带参数,能build成功就成功一半了;
然后git提交和PUSH;

3、jenkins上新建一个freestyle project;
填上代码托管git地址;
buildstep 我们不用任何插件,直接Execute Shell,填入:

security unlock-keychain -p 密码 login.keychain
xcodebuild

第一步是必须的,否则在codesign时会出现unknown error -1:ffffffffffffffff,keychain名字一般为login.keychain,也可以自定义;

4、保存并手动触发build;

5、根据需要在配置xcodebuild参数;

图片上传测试

这几天文件上传突然不能用了,php返回错误是3,查了一圈磁盘空间,权限,配额都没发现问题,最后把apache换成nginx+phpfpm还是同样错误。这时才感觉可能是网络原因,通过ssh端口转发访问,成功上传

Mono运行c#偶发异常

写的一个负载均衡程序,在Win下运行良好,Mac和Linux下用Mono运行总会偶发一些Native异常 T.T

* Assertion at ./mono-os-mutex.h:135, condition `res != EINVAL’ not met

Stacktrace:

at <0xffffffff>
at (wrapper managed-to-native) System.Threading.Thread.SleepInternal (int) <0x00012>
at System.Threading.Thread.Sleep (int) <0x00023>
at CRI.V2.Common.JobGroup.WorkProc (int) <0x0034f>
at CRI.V2.Common.JobGroup/<>c__DisplayClass1.b__0 () <0x0001b>
at System.Threading.ThreadHelper.ThreadStart_Context (object) <0x0008e>
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) <0x001bb>
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) <0x00033>
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) <0x0005a>
at System.Threading.ThreadHelper.ThreadStart () <0x00039>
at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <0x0009c>

Native stacktrace:

0 mono 0x001c03d6 mono_handle_native_sigsegv + 342
1 mono 0x002132a1 sigabrt_signal_handler + 145
2 libsystem_platform.dylib 0x9f760ebb _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 libsystem_c.dylib 0x9f5e9a5c abort + 141
5 mono 0x003771b1 monoeg_log_default_handler + 129
6 mono 0x003772ab monoeg_assertion_message + 107
7 mono 0x0036d46b mono_thread_info_sleep + 1035
8 mono 0x002af9a1 ves_icall_System_Threading_Thread_Sleep_internal + 97
9 ??? 0x005108dc 0x0 + 5310684
10 mscorlib.dll.dylib 0x0196dba4 System_Threading_Thread_Sleep_int + 36
11 ??? 0x0050eee0 0x0 + 5304032
12 ??? 0x0050e9b4 0x0 + 5302708
13 mscorlib.dll.dylib 0x0196cf3f System_Threading_ThreadHelper_ThreadStart_Context_object + 143
14 mscorlib.dll.dylib 0x0196b4ec System_Threading_ExecutionContext_RunInternal_System_Threading_ExecutionContext_System_Threading_ContextCallback_object_bool + 444
15 mscorlib.dll.dylib 0x0196b324 System_Threading_ExecutionContext_Run_System_Threading_ExecutionContext_System_Threading_ContextCallback_object_bool + 52
16 mscorlib.dll.dylib 0x0196b29b System_Threading_ExecutionContext_Run_System_Threading_ExecutionContext_System_Threading_ContextCallback_object + 91
17 mscorlib.dll.dylib 0x0196d06a System_Threading_ThreadHelper_ThreadStart + 58
18 ??? 0x0050e965 0x0 + 5302629
19 mono 0x00106487 mono_jit_runtime_invoke + 951
20 mono 0x002deb26 mono_runtime_invoke + 150
21 mono 0x002e427c mono_runtime_delegate_invoke + 92
22 mono 0x002b59f5 start_wrapper + 693
23 mono 0x0036f9bd inner_start_thread + 349
24 libsystem_pthread.dylib 0x9f76a11b _pthread_body + 184
25 libsystem_pthread.dylib 0x9f76a063 _pthread_body + 0
26 libsystem_pthread.dylib 0x9f76993e thread_start + 34

Debug info from gdb:

xcode-select: error: no developer tools were found at ‘/Applications/Xcode.app’, and no install could be requested (perhaps no UI is present), please install manually from ‘developer.apple.com’.

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

农药确实是个很不错的游戏,易上手,5岁不到的宝宝都能操作,快节奏,能随时在茶余饭后开上一局,是PC game移动化的成功案例

Gravity Field Release

优化主界面效果;
增加第3章;
parsy-core线程同步Bug修复;

2.5.2017
—————————-

0.5.2
2.15.2017

—————————-

0.5.4
2.19.2017

—————————-

调整粒子效果
0.6.1
3.29.2017

—————————-

0.6.2
4.1.2017

NSString 相关

NSString 与 std::string 互转:

NSString -> std::string
NSString* s = @”test”;
std::string str = [s UTF8String];

std::string -> NSString
std::string str = “test”;
NSString* s = [NSString stringWithCString:str.c_str() encoding:[NSString defaultCStringEncoding]];

NSString 格式化:
[NSString stringWithFormat:@”…..”, p1, p2…];

多语言:
NSLocalizedstring是系统默认的本地化它会自动取Localizable.strings里面的键值。
如果自己新建了一个的xxx.strings文件,取值的时候要用NSLocalizedStringFromTable(@”label”, @”xxx”, nil);
Localize有时候没有中文可以选,只要在目录中 cp -R en.lproj zh-Hans.lproj 复制一份,然后添加到项目中即可