Go语言中文网 为您找到相关结果 1670

Fun GoLang Projects?

<p>What are some fun project where using GoLang is preferred?</p> <p>On a daily basis I work with .NET (through the whole stack), but have always loved Python. A few weeks back I started playing around with Erlang, for fun (I did some courses in the language during my university years). </p> <p>Recently I started loo...阅读全文

grpc. pros and cons?

<p>hi guys, started a course on golang that uses grpc and proto buffers to build a rest service. seems useful enough but the instructor doesn&#39;t really go into much detail as to the reason why he using these tools to build the api. any medium/blog articles out there on the pros and cons of grpc? thanks!</p> <hr/>**评论:**<...阅读全文

How to handle streaming or long server processes in Go's HTTP server?

<p>When defining read/write timeouts in a new HTTP server, how can one account for long-running server processes, streaming, or large file downloads?</p> <p>I&#39;m most concerned with long-running server-side processes (anywhere from 30 seconds to a few minutes). I&#39;m sure holding the request open and using long timeo...阅读全文

JDK14初体验

JDK14也发布挺长时间了,从使用JDK8来,一直就没有动过升级JDK的想法,想想这种也不符合自己的风格,所以这次正好拿自己平时弄的一个项目试试手。 Test blocks 其实就是文本块,在之前用Golang、python的时候都使用过,这次总算可以在Java中也同样的使用了。 image.png 相对之前需要使用+拼接确实能省去一些输入量。 Pattern Matching for the instanceof Operator image.png 使用instanceof做match操作时,如果match上就可以把t传成match上的class,同时使用一个引用指向match上的对象。 Switch Expressions image.png 在switch中可以使用新的语法case ...阅读全文

博文 2020-06-02 19:32:45 潭州三哥

Python协程与Go协程的区别二

写在前面 世界是复杂的,每一种思想都是为了解决某些现实问题而简化成的模型,想解决就得先面对,面对就需要选择角度,角度决定了模型的质量, 喜欢此UP主汤质看本质的哲学科普,其中简洁又不失细节的介绍了人类解决问题的思路,以及由概念搭建的思维模型对人类解决问题的重要性与限制.也认识到学习的本质就是: 认识获取(了解概念) -> 知识学习(建立模型) -> 技能训练(实践) 阅读也好, 学习也好, 妨碍我们「理解」的障碍主要有两个: 高度抽象的概念 「模型」无法关联现象 也就是说 概念明确 + 关系明确, 才能构成「模型」, 对照「现象」, 形成「理解」。 在理解编程知识时可以关键归纳为两点:理解核心概念群+使用场景思考与故事化讲述 这里特别推荐码农翻身中大话编程式的科普: 码农翻身全年文章精华 并...阅读全文

博文 2019-12-11 09:32:40 liu_486

I often see people refer to Go as a new language with a budding ecosystem. What are some projects or libraries that are missing?

<p>I see people complain that Go is still too new or too small. What are some tools/libraries/projects that other languages have that Go is missing? What needs to happen for Go to be considered a language with a robust and thriving ecosystem?</p> <hr/>**评论:**<br/><br/>brokedown: <pre><p>Go is mature and rob...阅读全文

I love this language

<p>I just want to say, I&#39;ve been following the go language for a while now and I love it. I&#39;m a systems engineer who fell into software development and love doing it. I came from a matlab and python background so I&#39;m not the typical software developer, but I&#39;ve learned a lot. I&#39;ve heard the old guards&...阅读全文

Review in 2018 and Plans for 2019

Have Done in 2018: Jul 26, 2018, spent almost a month, work for Expise Technology(http://www.expise.com), do tensorflow.js developing. I got 500 dollars from this work. The boss is called Jamie. (This is the first time I realize that I'm useful for others and capable of being a programmer. Thanks to the world.) Almost at the same time, at 17/08/201...阅读全文

博文 2019-02-16 08:34:42 yingshaoxo

这些 Python 高效率技巧,一般人都不会

你估计已经看了不少关于 Python 技巧的文章,里面可能会提到变量拆包(unpacking)、局部函数等,但是 Python 还有很多不为人知的高效用法,等待着被人发现。本文将介绍作者纵观全网之后,都属于很少没提及的技巧。入门Python其实很容易,但是我们要去坚持学习,每一天坚持很困难,我相信很多人学了一个星期就放弃了,为什么呢?其实没有好的学习资料给你去学习,你们是很难坚持的,这是小编收集的Python入门学习资料,关注公众号【百战编程】回复关键词“ 资料 ”,即可免费领取!希望对你们有帮助 清理字符串输入清理用户输入的问题,几乎适用于我们可能编写的每个程序。通常将字符转换为小写或大写就足够了,这时只需要使用正则即可,但是对于复杂的情况,有一种更好的方法:在上述示例中,可以看到空格符“...阅读全文

博文 2020-01-07 11:32:53 百战编程

Go入门系列(一)伊始

欢迎来到Golang入门系列,说起这个系列出现的缘由,1、Golang的潜力无疑;2、笔者希望把所有有价值的主流语言全学一遍。 首先,我们来明确下定位,Go始于07年,在09年开源,官方团队来自Google。 然后是最耐人寻味的一点,它是一门面向对象的or面向过程的语言? Yes and no. Although Go has types and methods and allows an object-oriented style of programming, there is no type hierarchy. The concept of “interface” in Go provides a different approach that we believe is easy ...阅读全文

博文 2020-02-24 21:32:58 RabbitMask

利用阿里云容器服务实现自定义节点伸缩

摘要: 容器服务目前提供创建节点触发器的功能,调用节点触发器,并可以利用openAPI查看扩容出来的ECS节点方便管理和自动化的需求. 本文将向您介绍完成这一能力的步骤。 简介 阿里云容器服务很早就提供了基于集群CPU/内存的平均使用量触发节点自动伸缩功能,帮助许多客户自如应对业务压力的弹性变化。其原理是利用阿里云的云监控能力,在资源使用(cpu和memory)达到阈值时,触发节点伸缩。 同时还有一些企业级用户希望根据自身的监控数据和逻辑判断是否进行扩容和缩容操作,甚至可以按照固定时间进行节点扩容和缩容,针对这种场景,就需要调用的是扩容或者缩容触发器。 容器服务目前提供创建节点触发器的功能,调用节点触发器,并可以利用openAPI查看扩容出来的ECS节点方便管理和自动化的...阅读全文

Resources to learn Go

<p>Hi guys I would like to get some recommendations about web-based resources to learn Go. I have searched the web and came up with the ones I put on this <a href="https://mindweb.network/board/learn-to-code-googles-go">MindWeb Board</a>. Which other resources like books, videos or websites would you guys recommend?</p&...阅读全文

在 MaxCompute UDF 中运行 Scipy

摘要: 新版 MaxCompute Isolation Session 支持 Python UDF。也就是说,Python UDF 中已经可以跑二进制包。刚才以 Scipy 为例踩了一下坑,把相关的过程分享出来。 新版 MaxCompute Isolation Session 支持 Python UDF。也就是说,Python UDF 中已经可以跑二进制包。刚才以 Scipy 为例踩了一下坑,把相关的过程分享出来。 下载 Scipy 包并上传资源 首先,从 PyPI 或其他镜像下载 Scipy 包。你需要下载后缀为“cp27-cp27m-manylinux1_x86_64.whl”的包,其他的包会无法加载,包括名为“cp27-cp27mu”的包。以下的截图来自 https://...阅读全文

Templating in Go

<p>I&#39;ve been switching from js frameworks like react/inferno to a template engine that compiles to go because they seem to be much faster. I&#39;m using hero template (not sure if I&#39;m gonna switch to valaya&#39;s template), but I&#39;m not sure if they come with js support at all. Give the following example:</p&...阅读全文

构建更小Docker镜像的一些建议

背景: 前两天在群里看到有人提到说,自己构建了一个镜像,明明就只往base镜像中增加了tomcat,但是构建好的镜像大小最终却是两倍的tomcat包的大小,最后看到Dockerfile后才发现作者在把tomcat包拷贝进去之后,又使用RUN指令,执行了一次chmod a+x tomcat,我想说,这么搞镜像不大那是不可能的。另外一件事就是前段时间,同事说让搞一个公司级别的base镜像,要稳定并且尽量小,借着这两个事,和大家分享几点Docker镜像相关的事情。 首先,镜像的大小最终取决于如下几点: 1.业务需求和debug的便利性(比如科学计算和普通的java或者golang程序) 2.业务镜像构建的依赖特性(构建过程和交付物的依赖关系) 3.交付物的定义过程(Dockerfile分层过程中的...阅读全文

博文 2020-03-22 22:32:47 BGbiao

About to switch to Python because I've hit a brick wall in Go. Help appreciated!

<p>Hi there, I&#39;m a game designer/programmer who&#39;s working on a new game. I am the man responsible for the mess of spaghetti PHP 3 code that was Neopets in the early 2000s and want to do things the right way this time.</p> <p>I&#39;m creating a REST API using GoBuffalo and gocql (Cassandra) for my game. I&...阅读全文

资源 2018-03-17 16:30:11 xuanbao

Bootstrapping: Why do you need to have an old version of Go working on your computer in order to install a new one?

<p>Currently, on attempting to install an up-to-date version of Go using the <a href="https://github.com/moovweb/gvm" rel="nofollow">GVM</a>, one is confronted with a bootstrapping problem. </p> <p>The GVM README.md explains it as follows: &#34;Go 1.5+ removed the C compilers from the toolchain and...阅读全文