Skip to main content

Django_mosh

· 15 min read
ayanami

Django mosh

shell django-admin

django-admin startproject <proj name> .

run server

python manage.py runserver

app 可以通过 proj 初始 settings.py 集成

xv6book Notes(C1-4)

· 91 min read
ayanami

一些细节和思考:

Q: wait for reading the source code and thinking

A: after reading the source code and thinking

Go,Gin学习

· 20 min read
ayanami

Go & Gin & Gorm 学习

Go

Learn go by test

基本语法

package:类似namespace或者module

循环

func Repeat(character string) string {
var repeat string

godis源码阅读

· 33 min read
ayanami

tcp

echo

一个优雅超时关闭的方法

// WaitWithTimeout blocks until the WaitGroup counter is zero or timeout
// returns true if timeout
func (w *Wait) WaitWithTimeout(timeout time.Duration) bool {
c := make(chan struct{}, 1)
go func() {
defer close(c)

hibernate&jpa

· 13 min read
ayanami

jdbc: java database connectivity

jdbc 要先加载驱动,由各个数据库实现

jpa 通过 orm 框架生成 sql,再经过 jdbc 操作数据库

getBean 方法:

  • getBeanApplicationContext 接口中的一个方法,用于从 Spring 的 IoC 容器中显式地获取 Bean 实例。

  • 它通常在需要手动获取 Bean 时使用,比如在非 Spring 管理的类中或者在某些特定的场景下,你想要直接从容器中获取 Bean 而不是通过注入。

  • 使用 getBean 方法时,你需要知道 Bean 的名称或类型,并在调用时指定这些信息。

  • 示例代码:

linking 复习

· 17 min read
ayanami

linking 复习

No linker Problems

• efficiency: small change requires complete recompilation

• modularity: hard to share common functions (e.g. printf)

seperate compilation: separately compiled relocatable object files

reloc object files -> executable object file

What is linker

  • Linking is the process of: collecting and combining various pieces of code and data into a single executable file

  • Executable file: Can be loaded (copied) into memory and executed

ts基础

· 6 min read
ayanami

ts: 带静态类型的 js

配置 ts

tsc --init

tsconfig.json

重要配置

{

"compilerOptions": {

"target": "es2016", // 指定编译器

react practice:mosh gamehub

· 66 min read
ayanami

观前提示:

  1. 默认读者有基础的 js, ts, html 基础, 其中 html 和 js 在MDN Web Docs上看入门教程即可,ts 可以看mosh 的视频或者 google 一下 typescript tutorial 即可;
  2. 本人水平有限,错漏和不足之处敬请谅解
  3. 本笔记对应的视频: CodeWithMosh - React 18 for Beginners对应初级部分;code with mosh - React: Intermediate Topics对应进阶部分;相关代码可以在 github 找到。

gamehub: react + ts + ...

初级部分

前端部分

一切的开始:初识 React

浅入理解断点和调试器

· 13 min read
ayanami

浅入理解断点和调试器

主要参考1,2两篇文章

在写知识之前,不如先问自己几个问题:

  • debugger 的实现原理是什么?
  • 断点(breakpoint)和监视点(watchpoint)的区别?
  • 断点有哪些实现方法?具体到 gdb 之中,它是怎么实现的?

debugger 的最基本原理,就是这样的代码

int main(int argc, char** argv)