From 4ec8a75335c35ce2982ec2375a22a9fc84f24328 Mon Sep 17 00:00:00 2001 From: gecicidegisken Date: Thu, 8 Aug 2024 08:50:11 +0300 Subject: [PATCH] vault backup: 2024-08-08 08:50:11 --- _notes/compsci-notes/.obsidian/app.json | 4 ++- _notes/compsci-notes/.obsidian/workspace.json | 33 ++++++++++++------- _notes/compsci-notes/docker cheat sheet.md | 3 ++ _notes/compsci-notes/go conventions.md | 9 ++--- _notes/compsci-notes/go memory profiling.md | 5 +-- _notes/compsci-notes/python magic methods.md | 4 +-- 6 files changed, 37 insertions(+), 21 deletions(-) diff --git a/_notes/compsci-notes/.obsidian/app.json b/_notes/compsci-notes/.obsidian/app.json index 55a6128..20689b1 100644 --- a/_notes/compsci-notes/.obsidian/app.json +++ b/_notes/compsci-notes/.obsidian/app.json @@ -3,5 +3,7 @@ "showInlineTitle": false, "userIgnoreFilters": [ "templates/" - ] + ], + "defaultViewMode": "preview", + "propertiesInDocument": "visible" } \ No newline at end of file diff --git a/_notes/compsci-notes/.obsidian/workspace.json b/_notes/compsci-notes/.obsidian/workspace.json index 13aea77..059fd5b 100644 --- a/_notes/compsci-notes/.obsidian/workspace.json +++ b/_notes/compsci-notes/.obsidian/workspace.json @@ -11,8 +11,13 @@ "id": "721771a2977685ea", "type": "leaf", "state": { - "type": "empty", - "state": {} + "type": "markdown", + "state": { + "file": "clean code.md", + "mode": "source", + "backlinks": true, + "source": false + } } } ] @@ -81,6 +86,7 @@ "state": { "type": "backlink", "state": { + "file": "clean code.md", "collapseAll": false, "extraContext": false, "sortOrder": "alphabetical", @@ -97,6 +103,7 @@ "state": { "type": "outgoing-link", "state": { + "file": "clean code.md", "linksCollapsed": false, "unlinkedCollapsed": true } @@ -118,7 +125,9 @@ "type": "leaf", "state": { "type": "outline", - "state": {} + "state": { + "file": "clean code.md" + } } }, { @@ -129,12 +138,12 @@ "state": {} } } - ] + ], + "currentTab": 4 } ], "direction": "horizontal", - "width": 300, - "collapsed": true + "width": 300 }, "left-ribbon": { "hiddenItems": { @@ -145,16 +154,16 @@ "random-note:Open random note": false } }, - "active": "721771a2977685ea", + "active": "a8e0b56ea7f63830", "lastOpenFiles": [ - "go conventions.md", - "clean code.md", - "go memory profiling.md", "containers.md", - "templates/new note.md", "docker cheat sheet.md", - "python magic methods.md", + "go memory profiling.md", "til.md", + "python magic methods.md", + "go conventions.md", + "clean code.md", + "templates/new note.md", "test.md", "test plugin.md", "test git plugin.md", diff --git a/_notes/compsci-notes/docker cheat sheet.md b/_notes/compsci-notes/docker cheat sheet.md index c64b73e..35a32ad 100644 --- a/_notes/compsci-notes/docker cheat sheet.md +++ b/_notes/compsci-notes/docker cheat sheet.md @@ -37,3 +37,6 @@ The value of memory-limit should be a positive integer followed by the suffix b, `-v` : Bind mount a volume to the container. `docker run -v /host/path:/container/path` + + +#wip diff --git a/_notes/compsci-notes/go conventions.md b/_notes/compsci-notes/go conventions.md index 3e28ec6..f1d8e6a 100644 --- a/_notes/compsci-notes/go conventions.md +++ b/_notes/compsci-notes/go conventions.md @@ -1,9 +1,10 @@ --- title: "go: conventions" feed: show -date: 07-August-2024 +date: 07-08-2024 tags: - golang + - clean_code summary: Conventions for writing Go code --- @@ -47,11 +48,11 @@ All the files in a package live in a single directory. Packages collect related This is the code you don’t want others importing in their applications or libraries. Enforced by Go compiler. -`⁠**/pkg**` +`⁠/pkg` ⁠Can be used by external applications. Other projects will import these libraries expecting them to work. -- `*⁠/vendor**` +`⁠/vendor` ⁠Application dependencies. @@ -61,7 +62,7 @@ The `go mod vendor` command will create the `/vendor` directory for you. Configuration file templates or default configs. -`⁠**/test**⁠` ⁠ +`⁠/test⁠` ⁠ Additional external test apps and test data. Feel free to structure the `/test` directory anyway you want. For bigger projects it makes sense to have a data subdirectory. diff --git a/_notes/compsci-notes/go memory profiling.md b/_notes/compsci-notes/go memory profiling.md index 4c37c3f..d8001c6 100644 --- a/_notes/compsci-notes/go memory profiling.md +++ b/_notes/compsci-notes/go memory profiling.md @@ -2,7 +2,8 @@ title: "go: memory profiling" feed: show date: 25-07-2024 -tags: [golang] +tags: + - golang summary: Memory profiling in Go using pprof --- @@ -77,7 +78,7 @@ I also used all the `.out` files generated by my script, got a good look at the ## more on -[pprof the package]((https://pkg.go.dev/net/http/pprof)) +[pprof the package]((https://pkg.go.dev/net/http/pprof) [pprof the tool](https://github.com/google/pprof) diff --git a/_notes/compsci-notes/python magic methods.md b/_notes/compsci-notes/python magic methods.md index c1bc9df..bf213b4 100644 --- a/_notes/compsci-notes/python magic methods.md +++ b/_notes/compsci-notes/python magic methods.md @@ -31,7 +31,7 @@ in this contenxt, python will check `⁠bool(a_string)`⁠ and `⁠bool(5)`⁠ ### **why `len()` is not a method?** - In Python, builtin types (like list) are C structs containing a field called `⁠ob_size`⁠, which contains the element number in the collection. When `⁠len(x)`⁠ is used, instead of calling `⁠x.__len__`⁠, interpreter gets the value of `⁠x.ob_size`⁠, which is much faster than calling a method. -- *“No method is called for the built-in objects of CPython: the length is simply read from a field in a C struct. -Getting the number of items in a collection is a common operation and must work efficiently for such basic and diverse types as str, list, memoryview, and so on.”* +- *“No method is called for the built-in objects of CPython: the length is simply read from a field in a C struct. + Getting the number of items in a collection is a common operation and must work efficiently for such basic and diverse types as str, list, memoryview, and so on.”* --- \ No newline at end of file