blog's Introduction
blog's People
blog's Issues
swift
swift
- 不需要main()函数做入口。
- let for const, var for let, 跟js不同
显示转换/隐示转换
- swift只有显示转换
- value to string:
let apple = 2
let appleSummary = "I have \(apple) apples."
- make null array, dict,
let emptyArray = [String]()
andlet emptyDict = [String:Float]()
for loop
- there is
for-in
,for
,while
,repeat-while
if-switch
- if后必须是一个bool表达式
force unwrap
https://www.mokacoding.com/blog/impliticly-vs-force-unwrapping-swift-optionals/
Function
func greet(person: String) -> String{
let greeting = "Hello, " + person + "!"
return greeting
}
Closure闭包
https://www.zhihu.com/search?type=content&q=js%20%E9%97%AD%E5%8C%85
UIButton state
Swift foundation
protocol
private(set)
ERROR
-
Ambiguous reference to operator function '>='
https://stackoverflow.com/questions/38449252/ambiguous-reference-to-member -
2019-06-11 13:56:09.121447+0900 GuessTheNumber[85183:6591564] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<GuessTheNumber.ViewController 0x7fba0dc07a30> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key resultLabel.'
-
setTitle cannot used on UIbutton
https://stackoverflow.com/questions/28591250/uibutton-settitle-doesnt-work
swift-4
Error
- fatal error: Unexpectedly found nil while unwrapping an Optional value
未登录identifier, 登陆identifier
emit-on
https://qiita.com/gitseitanaka/items/d708f3c955cbf8b2158f
- EventEmitter
Electron
- server: nodejs, front: chromium
- use HTML css, js to develop desktop application
monaco editor
use delete in JS
delete nameUsed[priviousNameIndex]
swift static initialize
static var initialYear: Int { return 1600 }
swift optional
swift mutating
- method for struct, enum
delegate example
https://www.jianshu.com/p/c65f13683001
binding
- for reactive application or service
sql
sql
erd
ddl
question
sqlの内部実行順序
cte使い方, subqueryとの違い
golang
method
func (b box) getSize() int{
return b.length * b.width
}
// with pointer as receiver
func (b *box) getSize() int{
return b.length * b.width
}
- why use pointer as receiver, cause you wanna change the value
ctf
- skip <script> but
<img src="123" onClick = "alert(1)">
cant ? - ' make sql error
sql-2
vue
vue socket io error
- MetinSeylan/Vue-Socket.io#62
- uncaught type of class ???
- MetinSeylan/Vue-Socket.io#174
npm
use of old version of npm
https://askubuntu.com/questions/1036278/npm-is-incorrect-version-on-latest-ubuntu-18-04-installation
link
ln -s /usr/local/bin/npm /usr/bin/npm
wsl file cannot edit by vscode
- microsoft/vscode#17860
- 由于用vue-cli或者其他脚手架生成的文件默认为root, 需要chrown来改成普通用户才能access
file permission of linux system
vue client generate file, permission error
- unsolved
golang package management
- "github.com/woshahua" 全局path导入有效
- 导入 math/rand, can/rand 这类,需要在使用是用 crand can/rand 来区别。
- 如果文件中有go可执行文件 package名需要为main
babel for vue
- unsolved
set chrome headless
- https://qiita.com/tonio0720/items/70c13ad304154d95e4bc
- they just change the option
-https://gist.github.com/anandsunderraman/e351485319a8a0e7df7e
express cannot use html
eslint recommand setting cant use console.log
- let system can use console.log
https://stackoverflow.com/questions/34215526/eslint-how-to-disable-unexpected-console-statement-in-node-js
socketio broadcast.to.("room")
- 发送给除了自己以外的人
jquery focus
swift-3
tableView ???
- dequeueReuseable
- didSelectRowAt
- identifier for tableView
newItem is a label
func add(newItem item: ToDoItem) {
items.append(item)
}
get, set ??
- getter, setter used for public or private the operation of the value
-https://qiita.com/codelynx/items/43e1c4f176730d952d13
swift _ in
tableView 滑动
web hook
segment fault
golang
tech knowledge
- fatal error : 致命的错误。
- git rebase: something like merge
https://git-scm.com/book/ja/v1/Git-%E3%81%AE%E3%83%96%E3%83%A9%E3%83%B3%E3%83%81%E6%A9%9F%E8%83%BD-%E3%83%AA%E3%83%99%E3%83%BC%E3%82%B9 - CROS
- cant get server data by the file out of the server directory
typescript
类型
var counter; // any type
var counter = 0; // number type, 推断
var counter: number; // number type
var counter: number = 0;
- null和undefined不能被当作类型使用.
- var作用域, let, const块作用域(常量)
联合类型
var path: string[] | string;
类型守护
- like guard in swift
- use typeof and instanceof
next ---javascript
swift-2
swift struct/class
- struct pass value, class pass pointer
- for array you can do
var a = [Int]()
a = [0]
a += [1, 2] // a = [0,1,2]
弹出框
- UIAlertController
cocoapods
use MARK
//MARK: - Networking
/************************
//MARK: - JSON parsing
/************************
delegate委托
locationManager.delegate = self
info.list setting
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSLocationUsageDescription</key>
<string>为了获取气象信息需要定位你当前的位置。</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>为了获取气象信息需要定位你当前的位置。</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>openweathermap.org</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
closure swift
- 在闭包函数中一定要使用self来带入函数。
.double >
- 转换为double值
intValue, StringValue, int, string
pwa
@objc
- why this timer selector need objc
timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: (#selector(ViewController.updateTimer)), userInfo: nil, repeats: true)
visual code 开发
函数式编程|kotlin
api gateway
golang snippet vscode
缓存区溢出攻击
glide not show image
kotlin standard library usage
companion object
destroy{ view = nll} why we need this.
how to read file from asset android kotlin
kotlin lambda should be moved out of parenthesses
-https://www.reddit.com/r/Kotlin/comments/8x199t/intellij_lambda_argument_should_be_moved_out_of/
文件
- 文件就是字节序列,每个I/O设备,键盘,磁盘,甚至网络都可以看成是这样。系统中所有输入输出都是通过一小组成为Unix I/O的系统函数调用读写文件来实现的
clousure
- https://www.zhihu.com/search?type=content&q=%E9%97%AD%E5%8C%85
- 函数被声明并被带入时会保存区域内的变量
relogin terminal
- exec $SHELL -l
kotlin::class java
- class in kotlin stands for java class
null 安全
kotlin class need init ???
RecyclerView has no LayoutManager androidx.recyclerview.widget.RecyclerView
hash -r
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.