Skip to content

Instantly share code, notes, and snippets.

@congjf
congjf / str_to_table.py
Created November 29, 2018 07:42
A function to convert the String object with certain row flag and column flag to the table (list) object
def str_to_table(str, row_flag, col_flag):
rows = str.split(row_flag)
table = []
for r in rows:
cells = r.split(col_flag)
table.append(cells)
return table
@congjf
congjf / GoSublime.sublime-settings
Created November 20, 2018 09:26
Configurations of the GoSublime plugin of Sublime Text 3
{
"env": {
"GOROOT": "<your_go_root_path>",
"GOPATH": "<your_go_path>",
"PATH": "$GOPATH/bin:$PATH"
},
"gscomplete_enabled": true,
"fmt_enabled": true,
"gslint_enabled": true,
@congjf
congjf / SpringBoot.md
Last active October 16, 2016 07:51
Spring Boot

Steps

  • Create a build.gradle file, like build.gradle
  • Open IDEA, and import the build.gradle created before

Gradle

The Spring Boot gradle plugin provides many convenient features:

  • It collects all the jars on the classpath and builds a single, runnable "über-jar", which makes it more convenient to execute and transport your service.
@congjf
congjf / kivy example
Last active June 15, 2016 01:11
kivy example
from kivy.app import App
from kivy.uix.widget import Widget
class PongGame(Widget):
pass
class PongApp(App):
def build(self):
# default.custom.yaml
# save it to:
# ~/.config/ibus/rime (linux)
# ~/Library/Rime (macos)
# %APPDATA%\Rime (windows)
patch:
schema_list:
- schema: luna_pinyin # 朙月拼音
- schema: luna_pinyin_simp # 朙月拼音 简化字模式
@congjf
congjf / .Title
Last active August 29, 2015 14:02
Swift 语言基础
Swift 语言基础
@congjf
congjf / .Title
Created March 27, 2014 01:51
Objective-C Learning Resource
Objective-C Learning Resource
@congjf
congjf / go.markdown
Last active August 29, 2015 13:57
3rd Libs

框架

Web

  • Web.go 最简单的web框架,非全械式框架
  • Revel 类Rails框架,全栈式框架
  • Martini 推荐,非全栈框架

其他框架

@congjf
congjf / Concurrency.1.ShareByCommunicating.markdown
Last active August 29, 2015 13:57
Effective Go in Chinese

share by Communication

并发编程是一个大的课题,这里仅仅只是用于说明Go语言。

并发编程在许多环境中为实现正确的访问共享变量时所需要的细节不同而产生困难。Go语言在共享变量的传递时鼓励另一种方法,并且,实际上,从未通过共享分隔执行的线程而起作用。仅有一个goroutine在任意给定的时间可以访问值。设计上,数据“竞争”不可能发生。为了鼓励这一方法,我们提出一个谚语:

不要使用共享内存来进行通信;而是通过通信来共享内存。

例如,索引数通过围绕一个数值变量的互斥,来被最好的完成。但是作为高层级的方法,使用channel来控制访问,很容易编写清晰、正确的程序。