So You Think You Can Hash
Rust Tooling @ Microsoft 🐘 @ciura_victor@hachyderm.io 🦋 @ciuravictor.bsky.social 🦀 So You Think You Can Hash CppCon September 20242024 Victor Ciura | @ciura_victor - Unleashing 🦀 The Ferris Rust Tooling @ Microsoft 🐘 @ciura_victor@hachyderm.io 🦋 @ciuravictor.bsky.social 🦀 So You Think You Can Hash CppCon September 20240 码力 | 119 页 | 6.54 MB | 5 月前3ThinkJS 2.0 中文文档
Node.js ���������� ���� //user controller, home/controller/user.js export default class extends think.controller.base { //login action async loginAction(self){ //���get����������� if(this md5 = think.md5('think_' + data.pwd); //���������������������� let result = await this.model('user').where({name: data.name, pwd: md5}).find(); //���������������������� if(think.isEmpty(result)){ 20:21:09] [THINK] Server running at http://127.0.0.1:8360/ [2015-09-21 20:21:09] [THINK] ThinkJS Version: 2.0.0 [2015-09-21 20:21:09] [THINK] Cluster Status: closed [2015-09-21 20:21:09] [THINK] WebSocket0 码力 | 238 页 | 1.87 MB | 1 年前3ThinkJS 2.1 Documentation
Features Using ES6/7 features //user controller, home/controller/user.js export default class extends think.controller.base { //login action async loginAction(self){ //if it's a get request, then get all request data which has checked in logic let data = this.post(); let md5 = think.md5('think_' + data.pwd); //take username and encrypted password to match data in database let data.name, pwd: md5}).find(); //if no result found, it means username or password error if(think.isEmpty(result)){ return this.fail('login fail'); } //write user info into session0 码力 | 148 页 | 1.69 MB | 1 年前3ThinkJS 2.0 Documentation
Features Using ES6/7 features //user controller, home/controller/user.js export default class extends think.controller.base { //login action async loginAction(self){ //if it's a get request, then get all request data which has checked in logic let data = this.post(); let md5 = think.md5('think_' + data.pwd); //take username and encrypted password to match data in database let data.name, pwd: md5}).find(); //if no result found, it means username or password error if(think.isEmpty(result)){ return this.fail('login fail'); } //write user info into session0 码力 | 141 页 | 1.61 MB | 1 年前3ThinkJS 2.2 Documentation
or */yield features. //user controller, home/controller/user.js export default class extends think.controller.base { //login action async loginAction(self){ //if it's a get request, then get all request data which has checked in logic let data = this.post(); let md5 = think.md5('think_' + data.pwd); //take username and encrypted password to match data in database let data.name, pwd: md5}).find(); //if no result found, it means username or password error if(think.isEmpty(result)){ return this.fail('login fail'); } //write user info into session0 码力 | 156 页 | 2.62 MB | 1 年前3ThinkJS 2.2 中文文档
或者 */yield 来解决异步回调的问题。 //user controller, home/controller/user.js export default class extends think.controller.base { //login action async loginAction(self){ //如果是get请求,直接显示登录⻚页⾯面 if(this 20:21:09] [THINK] Server running at http://127.0.0.1:8360/ [2015-09-21 20:21:09] [THINK] ThinkJS Version: 2.0.0 [2015-09-21 20:21:09] [THINK] Cluster Status: closed [2015-09-21 20:21:09] [THINK] WebSocket WebSocket Status: closed [2015-09-21 20:21:09] [THINK] File Auto Reload: true [2015-09-21 20:21:09] [THINK] App Enviroment: development 访问项目 打开浏览器,访问 http://127.0.0.1:8360/ 即可。 如果是在远程机器,需要通过远程机器的 IP 访问,同时要保证0 码力 | 277 页 | 3.61 MB | 1 年前3ThinkJS 3.0 中文文档
提供的脚手架,可以快速的创建一个项目。为了可以使用更多的 ES6 特性,框架要 求 Node.js 的版本至少是 6.x ,建议使用 LTS 版本。 安装 ThinkJS 命令 $ npm install -g think-cli 安装完成后,系统中会有 thinkjs 命令(可以通过 thinkjs -v 查看版本号)。如果找不到这个命 令,请确认环境变量是否正确。 如果是从 2.x 升级,需要将之前的命令删除,然后重新安装。 0 下可以直接使用 Koa 的 middleware。 Controller 将基类 think.controller.base 改为 think.Controller ,并移除 think.controller.rest 类。 Model 将基类 think.model.base 改为 think.Model 。 启动流程 本文档带领大家一起看看 ThinkJS 是如何启动服务和处理用户请求的。 Application 类,执行 run 方法。 根据不同的环境(Master 进程、Worker 进程、命令行调用)处理不同的逻辑 如果是 Master 进程 加载配置文件,生成 think.config 和 think.logger 对象。 加载文件 src/bootstrap/matser.js 文件 如果配置文件监听服务,那么开始监听文件的变化,目录为 src/ 。 文件修改后,如0 码力 | 129 页 | 2.12 MB | 1 年前3Back to Basics: The Factory Pattern
like games (that’s totally fine!), or if you do not know anything about them at all. But I do think games are an interesting use case case of real-time systems.Real time systems (1/2) ● So just looking management is taking place 13 Command and Conquer Red Alert For today’s talk, I want us to think about software design for a real time application--I’ll use a ‘game’ as an exampleMy expectations pattern of today is.... ○ But before I spoil the pattern (even though it’s the name of the talk) let’s think about what our goals areMy expectations and why this talk exists (2/2) 15 ● This talk is part of0 码力 | 93 页 | 3.92 MB | 5 月前3基于Kubernetes构建容器云平台的实践 - UCloud优刻得实验室负责⼈ 叶理灯
Think in Cloud . 北北京 Think in Cloud . 北北京 基于Kubernetes构建容器器云平台的实践 UCloud优刻得实验室负责⼈人 叶理理灯 中⽴立安全·赋能产业 Think in Cloud . 北北京 UCloud内部容器器平台,提供弹性、分布 式的应⽤用托管服务平台,帮助开发者⼀一站 式轻松开发并部署应⽤用程序。KUN底层基 于 Kubernetes 统⼀一代码管理理 统⼀一编程框架 统⼀一通讯协议 统⼀一部署环境 计算平台/KUN 公共服务 存储平台 Think in Cloud . 北北京 基于RBAC实现 账号管理理隔离 01 IPv6 02 Operator管理理有 状态的服务 03 监控 04 Think in Cloud . 北北京 • K8S提供了了多种身份认证策略略,具体如何实施? • K8S的有两 ser,如何管理理User? • K8S有⼀一套完整的权限系统,但如何处理理User与权限的绑定? • 对于多集群,如何实现User跨集群的管理理? 基于RBAC实现账号管理理隔离 Think in Cloud . 北北京 基于RBAC实现账号管理理隔离 • 选择Token认证⽅方式 • 通过服务账号SA模拟普通⽤用户User,即User与SA⼀一⼀一对应 • 所有模拟账号SA放置同⼀一个NS,统⼀一管理理0 码力 | 30 页 | 3.52 MB | 1 年前3A Brief Immersion - 傅若愚
���� THINK FUNCTIONALLY THINK FUNCTIONALLY A Sad Story About API disasters THINK FUNCTIONALLY THINK FUNCTIONALLY 是可忍孰不可忍? THINK FUNCTIONALLY THINK FUNCTIONALLY ⾃⼰写个Promise? THINK FUNCTIONALLY FUNCTIONALLY THINK FUNCTIONALLY 或许,还有更简单的办法! THINK FUNCTIONALLY THINK FUNCTIONALLY 完⼯之后的样⼦ 看起来棒棒哒! THINK FUNCTIONALLY THINK FUNCTIONALLY 第⼀步,定义⼀个叫做Async的 东西,将异步过程封装起来 其中⽤到的Result如下: THINK FUNCTIONALLY FUNCTIONALLY THINK FUNCTIONALLY 注意到它是⼀个Functor,所以 第⼆步,定义⼀个map函数 THINK FUNCTIONALLY THINK FUNCTIONALLY 注意它也是⼀个Monad,所以 第三步,定义⼀个flatMap函数 THINK FUNCTIONALLY THINK FUNCTIONALLY 第四步,给flatMap改个名字,叫做then0 码力 | 40 页 | 3.39 MB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100