V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  iceiceice  ›  全部回复第 1 页 / 共 2 页
回复总数  28
1  2  
用 fasthttp
相比这两个,我还是觉得特斯拉要好,或者考虑下极氪 001 ?虽然车机烂,但是机械素质 续航是真的挺。
2022-06-11 00:23:42 +08:00
回复了 iceiceice 创建的主题 程序员 5000 以下笔记本电脑求推荐
谢谢上面的三个老哥,我去看看~
2022-06-07 17:39:01 +08:00
回复了 minilei 创建的主题 云计算 腾讯良心云 618 首单活动会有国内轻量 3 年的吗?
前段时间 腾讯云客服说 618 可能有三年的,叫我等她消息,不晓得是真是假,估计是骗加微信的
2022-06-01 10:04:20 +08:00
回复了 Horance 创建的主题 程序员 618 云服务器有推荐的吗, 2 核心 4G,可选三年那种
同问,我也想要 3 年的那种,但是逛了一圈没得
2022-05-10 17:15:31 +08:00
回复了 iceiceice 创建的主题 程序员 现在有没有好用便宜的云服务器推荐啊,最好能连外网的
@zww340277220 5 年 440 ,我的天
2022-05-10 17:06:24 +08:00
回复了 iceiceice 创建的主题 程序员 现在有没有好用便宜的云服务器推荐啊,最好能连外网的
@acehowxx 我怎么看到是 5 美元 /月啊,一年差不多 400 元
2022-05-10 16:54:29 +08:00
回复了 iceiceice 创建的主题 程序员 现在有没有好用便宜的云服务器推荐啊,最好能连外网的
@linglin0924 看了一下,腾讯云确实便宜
2022-05-10 16:52:32 +08:00
回复了 iceiceice 创建的主题 程序员 现在有没有好用便宜的云服务器推荐啊,最好能连外网的
@leogm9408leo 好的 我去看看
2021-04-29 15:38:28 +08:00
回复了 zhoudaiyu 创建的主题 Kubernetes 各位公司用的 k8s 有自己二次开发过的吗?
华为的 kubeedge 就是基于 kubelet 精简修改的
2021-01-11 16:40:16 +08:00
回复了 cernard 创建的主题 问与答 有人用 61 键键盘写代码吗?
同 poker2 用着很舒服,突然换个键盘还有点不习惯
2020-12-23 16:45:30 +08:00
回复了 MonkeyBro 创建的主题 深圳 高新园上班,哪个村租房方便啊??
2300 我当时租的自如的,大冲城市花园。不过是单间
2020-12-02 16:39:31 +08:00
回复了 mashaofeixxx 创建的主题 推广 第三次开车 NUC 黑果套餐 抽一人送三星雷电 3 移动硬盘.
gogogog
2020-06-12 15:21:40 +08:00
回复了 lancelock 创建的主题 Go 编程语言 有个 go 的问题,求解答
package jsonconv

import (
"bytes"
"encoding/json"
"log"
"regexp"
"strconv"
"strings"
"unicode"
)

/*************************************** 下划线 json ***************************************/
type JsonSnakeCase struct {
Value interface{}
}

func (c JsonSnakeCase) MarshalJSON() ([]byte, error) {
// Regexp definitions
var keyMatchRegex = regexp.MustCompile(`\"(\w+)\":`)
var wordBarrierRegex = regexp.MustCompile(`(\w)([A-Z])`)
marshalled, err := json.Marshal(c.Value)
converted := keyMatchRegex.ReplaceAllFunc(
marshalled,
func(match []byte) []byte {
return bytes.ToLower(wordBarrierRegex.ReplaceAll(
match,
[]byte(`${1}_${2}`),
))
},
)
return converted, err
}

/*************************************** 驼峰 json ***************************************/
type JsonCamelCase struct {
Value interface{}
}

func (c JsonCamelCase) MarshalJSON() ([]byte, error) {
var keyMatchRegex = regexp.MustCompile(`\"(\w+)\":`)
marshalled, err := json.Marshal(c.Value)
converted := keyMatchRegex.ReplaceAllFunc(
marshalled,
func(match []byte) []byte {
matchStr := string(match)
key := matchStr[1 : len(matchStr)-2]
resKey := Lcfirst(Case2Camel(key))
return []byte(`"` + resKey + `":`)
},
)
return converted, err
}

/*************************************** 其他方法 ***************************************/
// 驼峰式写法转为下划线写法
func Camel2Case(name string) string {
buffer := NewBuffer()
for i, r := range name {
if unicode.IsUpper(r) {
if i != 0 {
buffer.Append('_')
}
buffer.Append(unicode.ToLower(r))
} else {
buffer.Append(r)
}
}
return buffer.String()
}

// 下划线写法转为驼峰写法
func Case2Camel(name string) string {
name = strings.Replace(name, "_", " ", -1)
name = strings.Title(name)
return strings.Replace(name, " ", "", -1)
}

// 首字母大写
func Ucfirst(str string) string {
for i, v := range str {
return string(unicode.ToUpper(v)) + str[i+1:]
}
return ""
}

// 首字母小写
func Lcfirst(str string) string {
for i, v := range str {
return string(unicode.ToLower(v)) + str[i+1:]
}
return ""
}

// 内嵌 bytes.Buffer,支持连写
type Buffer struct {
*bytes.Buffer
}

func NewBuffer() *Buffer {
return &Buffer{Buffer: new(bytes.Buffer)}
}

func (b *Buffer) Append(i interface{}) *Buffer {
switch val := i.(type) {
case int:
b.append(strconv.Itoa(val))
case int64:
b.append(strconv.FormatInt(val, 10))
case uint:
b.append(strconv.FormatUint(uint64(val), 10))
case uint64:
b.append(strconv.FormatUint(val, 10))
case string:
b.append(val)
case []byte:
b.Write(val)
case rune:
b.WriteRune(val)
}
return b
}

func (b *Buffer) append(s string) *Buffer {
defer func() {
if err := recover(); err != nil {
log.Println("*****内存不够了!******")
}
}()
b.WriteString(s)
return b
}

func TestJsonCamelCase_MarshalJSON(t *testing.T) {
type Person struct {
HelloWold string
LightWeightBaby string
}
var a = Person{HelloWold: "xxx", LightWeightBaby: "muscle"}
res, _ := json.Marshal(JsonCamelCase{a})
fmt.Printf("%s", res)
}
2020-06-08 10:13:37 +08:00
回复了 wbofeng 创建的主题 Go 编程语言 Beego 再出发
新版的 beego 的 log 支持自定义 log 吗
我感觉前三个很类似,原理都是一个,后两个也差不多
2020-04-14 14:13:08 +08:00
回复了 taaaang 创建的主题 生活 买了个超高层
我住 42L 感觉还可以,夏天早上很凉快,风大,阳光也可以。等电梯还好,可能我们这电梯快吧,一般现在都有备用电源也不担心停电。最后,谁说楼层高没有蚊子,现在的虫子太精明了,不晓得怎么就上来的 0 0~
autojump +1
2019-04-29 10:26:39 +08:00
回复了 wallriding 创建的主题 Apple iPhone 8 Plus 还是 XS Max 还是等下半年新款?
同刚入 xr,打算用 4 年再说。(之前 se 用了 4 年,终于忍不住换了)
1  2  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2501 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 35ms · UTC 16:06 · PVG 00:06 · LAX 09:06 · JFK 12:06
Developed with CodeLauncher
♥ Do have faith in what you're doing.