Submitted by gouki on 2018, October 10, 11:02 PM
安装sqlite3的时候,报:
XML/HTML代码
- /usr/local/include/stdint.h:2:10: error: #include nested too deeply
- #include <stddef.h>
- ^
- /usr/local/include/stdint.h:59:11: error: #include nested too deeply
- # include <stdint.h>
- ^
- /usr/local/include/stdint.h:72:11: error: #include nested too deeply
- # include <sys/types.h>
- ^
- /usr/local/include/stdint.h:76:10: error: #include nested too deeply
- #include <limits.h>
- ^
- /usr/local/include/stdint.h:82:11: error: #include nested too deeply
- # include <inttypes.h>
- ^
- 5 errors generated.
开始的时候以为cgoenabled=0结果 。go env的时候发现有打开。
又以为可能是xcode-select 没装,于是执行xcode-select --install 进行工具安装 。症状依然。最后找到这里:https://github.com/SOHU-Co/kafka-node/issues/881,看来有不少人有这个问题。只是有人说,brew doctor一下就行了。光执行,并没啥用
最后有一个人提出:
XML/HTML代码
- mkdir /tmp/includes
- brew doctor 2>&1 | grep "/usr/local/include" | awk '{$1=$1;print}' | xargs -I _ mv _ /tmp/includes
一下子全解决了!
| 评论:0
| 阅读:14135
Submitted by gouki on 2018, September 27, 12:53 AM
有人说重置SMC可以解决这个问题,然而我没有试。最后看LOG,居然一堆连网错误,难道要校验checksum?
再到苹果官网上看到这个:
https://discussions.apple.com/message/33927150#33927150
- Hi,
-
- Had the same problem, but for me it worked by
-
- removing all DNS search domains
- untick the automatic proxy configuration
-
-
- for the Wifi adapter.
-
- good luck.
果然尝试。果然有效(最终发现还是有问题,终于。。重置NVRAM,安装完成)
网址:https://appletoolbox.com/2017/12/macos-could-not-be-installed-how-to-fix/
- 节选
- Next, let’s try out the basic NVRAM reset (or PRAM for older Macs) on your computer.
- Follow these steps if you are not sure about how to do the NVRAM reset
- Shut down your Mac
- Turn it on and immediately press and hold these four keys together: Option, Command, P, and R macOS Could Not Be Installed, How-To Fix
- Release the keys after about 20 seconds, during which your Mac might appear to restart
- Open System Preferences and check (and adjust, if necessary) any settings that reset, like volume, display resolution, startup disk selection, or time zone
- 说白了,就是启动的时候 cmd+option+P+R,等20秒。放开,再重启
一切都清静 了。只是感觉这一版,没什么变动的
Flutter | 评论:0
| 阅读:12133
Submitted by gouki on 2018, September 24, 10:35 AM
要知道gorm的callback看代码就可以知道了:
XML/HTML代码
- func init() {
- DefaultCallback.Create().Register("gorm:begin_transaction", beginTransactionCallback)
- DefaultCallback.Create().Register("gorm:before_create", beforeCreateCallback)
- DefaultCallback.Create().Register("gorm:save_before_associations", saveBeforeAssociationsCallback)
- DefaultCallback.Create().Register("gorm:update_time_stamp", updateTimeStampForCreateCallback)
- DefaultCallback.Create().Register("gorm:create", createCallback)
- DefaultCallback.Create().Register("gorm:force_reload_after_create", forceReloadAfterCreateCallback)
- DefaultCallback.Create().Register("gorm:save_after_associations", saveAfterAssociationsCallback)
- DefaultCallback.Create().Register("gorm:after_create", afterCreateCallback)
- DefaultCallback.Create().Register("gorm:commit_or_rollback_transaction", commitOrRollbackTransactionCallback)
- }
类似:beginTransactionCallback 的一共有9个,事务和创建等等。一般事务的话会用的比较多一点,还有就是针对时间的beforecreate等
当然更多的还得看官方的文档:http://gorm.io/zh_CN/docs/hooks.html。默认会执行什么,应该执行什么,这里都有写,可以看一下下的
| 评论:0
| 阅读:14888
Submitted by gouki on 2018, September 23, 5:23 PM
下述是指在mac下面。linux 8 是这样的
ulimit -n 运行一下,看看是多少,如果是65536就算了。不是的话,如果有需要就自己改一下。常见的ulimit -n 65536,直接运行就行了,但这只是临时的
其实以下内容是COPY来的。我没有细究。
原文来自:http://ronglei0324.blog.163.com/blog/static/676332232013122112049188/
- $ sysctl kern.maxfiles
- kern.maxfiles: 12288
- $ sysctl kern.maxfilesperproc
- kern.maxfilesperproc: 10240
- $ sudo sysctl -w kern.maxfiles=1048600
- kern.maxfiles: 12288 -> 1048600
- $ sudo sysctl -w kern.maxfilesperproc=1048576
- kern.maxfilesperproc: 10240 -> 1048576
- $ ulimit -n
- 256
- $ ulimit -n 1048576
- $ ulimit -n
- 1048576
| 评论:0
| 阅读:14188
Submitted by gouki on 2018, September 22, 9:37 AM
从13年之后就再也没有碰过GO,当时遇到的问题都很妖,所以后来就再也没碰过(为什么我的需求都那么怪?)
重操GO,准备花上1~2周温习,直接上项目吧,这个网址不错:https://github.com/EDDYCJY/blog,简单的教程,等我看完先
| 评论:0
| 阅读:10996