I provide a suggestion.
```golang
type Res struct {
Value any `json:"value"` // Int or Float
FloatValue float64
IntValue int
}
func (r *Res) UnmarshalJSON(source []byte) (err error) {
// json.number is type of float64
type Temp struct {
Value float64 `json:"value"`
}
var temp = Temp{}
decoder := json.NewDecoder(bytes.NewReader(source))
//means that number convert to json.Number
decoder.UseNumber()
//decode json
if err = decoder.Decode(&temp); err != nil {
return err
}
var convertToInt bool
var convertValue int
// convert float64 to int
if convertToInt {
r.IntValue = convertValue
} else {
r.FloatValue = temp.Value
}
return
}
```
usage:
```golang
func Usage() {
var source = []byte(`{"value":123}`)
var res Res
_ = json.Unmarshal(source, &res)
// use intValue
res.IntValue
// use floatValue
source = []byte(`{"value":123.23}`)
_ = json.Unmarshal(source, &res)
res.FloatValue
}
```
The core issue is how to convert float64 to int.
All the numbers in a JSON string are the type of float64.
解压∶TheUnarchiver 文档:无
Md:VScode 穿透:无
图床:无 音乐:apple Music
搜索: 自带 翻译:自带
ssh: Iterms2 开发:VSCode
网络代理:clash 截图:自带
你手里握着 100w
拿去存银行,年利 4%,不算复利的话,30 年你的本金和利息一共:100w + 100w*4%*30 = 220w
如果算复利的话,100w + 100*(1+0.4*)^30 = 324w
英语应该是最有用的了吧。
我也在持续学习英语当中,看英文表达的时候,发现他们也会有很多特别精简的表达,就是那种只能意会的语句。
不好意思,浏览了一下 OP 的历史记录,不是实习。
这些题目让我主观意识是实习,先入为主了,特别是看过哪些书还有搜索引擎是啥之类的,特别像在问实习生。
既然不是实习的话,这些题目有些简单了,而且有些回答 OP 回答的不够充分。
第四个问题,尽量回答和计算机相关的,AutoCAD 没必要回答。
感觉第四个问题是面试官知道 OP 是转行专门问的,特别是自学过哪些计算机课程,如果你回答操作系统、数据结构之类的,可能面试官可以继续深入。
9 的话,回答的太简单了,完全可以深入一下,可以把 mysql 的事务操作好好讲讲。
Books 在 mac 和 iPhone 上面缺点很明显。
Mac:看 pdf 的话是用 preview 打开的,阅读时长进度也不能被记录。
iPhone:无法调整 equb 的文字排版,两侧和底部留白太多了。
只有在 iPad 上面看是最舒服的。
When I started to learn Python, a very known book named "the hard way to learn python", I learned Python step by step and typed every example.
And now I have started to improve my English, I still use `the hard way` to learn and improve it.
1. read as many books as possible, from easiest to harder books, 'the magic tree house series', 'harry potter', 'steve jobs' and other books. I prevented knowing every word, avoiding looking up the unknown words except the word makes me can not understand the entire sentence.
2. Keep listening, I use Apple Podcasts to listen to my favorite episodes, at first I listen to the Ted talks daily, but it's a little difficult for me to understand, they say too fast! So I changed, Now I listen to "Let's Master English" and "Footprint", they suit me, I can understand what they say now!
I don't care about the grammar and words, I learn them as a baby, and the baby doesn't care about them too.
I hope I can see the English movie without subtitles, and I can talk freely with a native speaker.
@
Tolcol 千万别装,装了就卸载不了。贼麻烦。
我现在所有软件都是 arm 的,但是活动监视器里面仍然有两个进程是 intel 的
看着很烦。VisualizerService-x86 & CarbonComponentScannerXPC
1. 英语,了解更大的世界。quora 上的老哥们幽默风趣。
2. 健身,减掉 40 斤之后,开始塑形,现在觉得自己哪哪都非常的顺心。
3. 拼多多百亿补贴,我现在啥都在上面买了,鞋子衣服之类的价格是实体店的 1/3 。
4. macmini ,再也不用去听 pc 的噪音了。
5. 小米指纹锁,开门方便太多太多了,和家里的智能家居结合,进门自动开灯。
6. 电瓶车,开车真是最痛苦的事,停车更痛苦。
7. 智能手表,在外掏手机的次数越来越少了。
8. apple books 、apple music 、podcasts ,apple 的软件做的真是简洁好看。
我用的二代,有线、无线测试的是都是 16ms 延迟。
但是在具体的使用中,无线连接的话,鼠标偶尔会闪现,能明显感觉到不跟手,所以我都是连线使用。
和 MBP 内置的 trackpad 不能比。
m1 用 golang 跑了一下:
go run fib.go
102334155
used time: 218.433792ms
代码:
fib.go
```golang
package main
import (
"fmt"
"time"
)
func fib(a int) int {
if a <= 2 {
return 1
}
return fib(a-1) + fib(a-2)
}
func main() {
t := time.Now()
fmt.Println(fib(40))
fmt.Printf("used time: %s\n", time.Now().Sub(t))
}
```
百亿补贴 2021 m1pro + 16g + 512G 能做到 9990 了
你在吐槽别人用错字的情况下,也犯了以下问题:
1 、标点符号使用不规范
2 、语法错误
但是以上两点并不影响我理解你的意思。
所以,严于律己,宽以律人。
能理解别人的话就够了,不用去纠结语法、顺序、错别字、标点等, 毕竟只是一个聊天而已。
如果严苛的情况,自会有多重校验的。
——————
对了,是否可以在 IM 集成以上问题的校验插件?