OpenJDK project panama 中一个重点功能就是 vector api,可以显著提升矩阵计算密集型程序的性能,例如在图形计算、机器学习、大规模计算(Lucene)等。
[…] CPU 的每个处理单元一次运算只能计算一个值,这个值成为标量值(scalar value)。处理单元需要 0 或多个周期(即 CPU 频率)完成一次操作计算。现代 CPU 包含多个核心,每个核心 …
A coroutine is an instance of suspendable computation. 协程是可被挂起的计算的实例。换句话说协程是一个对象,这个对象保存着一段可以切换线程的任务 + 当前执行的状态两部分信息。
日常涉及协程的编码,主要是描述协程的任务和管理多个协程的生命周期、异常处理等。
[…] Kotlin 使用堆栈帧管理要运行哪个函数以及所有局部变量。挂起协 …
有时候 commit 完代码后git push会遇到下面的错误
[…] To push the history leading to the current (detached HEAD) 错误提示说当前 HEAD 没有指向任何分支,但是你记得明明有指向一个分支的
[…] 1、假设你当前在 master 分支,且有两次提交
[…] Prj on …
关于 rust trait 非常好的介绍,比 rust book 详细,系统。
[…] Have you ever wondered what’s the difference between:
[…] Or ever asked yourself the questions:
[…] Well then this is the article …
some notes on rust ownership,reference,string and &str, and lifetimes
[…] //heap and stack: stack is store data that known,fixed size. //memory manager keeping track of what parts of code …
key points in scala-for-impatient 2nd book, best book for java developer to use scala in a rush.
scala-for-impatient 章节摘要,这本书对于 Java 开发者快速上手 Scala 帮助很大。
初学 rust 对于项目的 package 和 crate 的关系,module 和文件的关系有点理不清。做了一点笔记。
[…] A Cargo.toml is a package. and must have a package name, defined in [package] table:
[…] [package] name = …
理解 Spring 的 FactoryBean 和 ContextAware 接口。
[…] 一句话就是 FactoryBean 用于返回其他对象实例的,而不是自身类型的实例。
[…] public class Tool { private int id; // standard constructors, getters and setters } public …
some notes on scala future, includes:
[…] import java.time._ import scala.concurrent._ import ExecutionContext.Implicits.global Future { Thread.sleep(10000) println(s"This is the future at …
Scala 中很多使用 if 的地方都可以用 match case 来替换。常见的就是下面的这种写法:
[…] val res = msg match { case it if it.contains("H") => "Hello" case _ => "Other" } //更常见的用法是去匹配参数的模式: case …
scala type class notes:
关于 scala type class 非常好的文章
[…] //scala 没有专门的 type class 语法,而是借助 trait + implicit + context bound 来实现的, //所以很多时候识别 type class 比较困难。 //type class 由三部分构成 //1. type class: 即 …
//隐式参数是在调用时可以自动填充的参数,需要在调用范围内(scope) 有一个隐式变量可供填充。 def addInt(i:Int)(implicit n: Int) = i + n //需要提供一个隐式变量 n implicit val sn = 1 addInt(2) // 3 //如果有两个满足类型的隐式变量,则在编译 addInt(2) 时报错 //scala …
使用 wsl,MobaXterm,cmder,docker 打造可视化的 linux 开发环境
[…] 离不开 Windows 的理由很多,作为后端开发需要使用 linux 的情况也很多,双系统总归是不方便,而且 linux 下的 GUI 体验也没用 Win 10 好。
如果使用虚拟机,那么文件交换和网络等各种问题也需要解决,对系统的内存要求也更高一些。 …
最近非常火的一道携程面试题 Java
[…] public class Base { private String baseName = "base"; public Base() { callName(); } public void callName() { System.out.println(baseName); } static class Sub …