Skip to content

Commit

Permalink
vault backup: 2024-08-08 08:50:11
Browse files Browse the repository at this point in the history
  • Loading branch information
gecicidegisken committed Aug 8, 2024
1 parent 8074543 commit 4ec8a75
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 21 deletions.
4 changes: 3 additions & 1 deletion _notes/compsci-notes/.obsidian/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
"showInlineTitle": false,
"userIgnoreFilters": [
"templates/"
]
],
"defaultViewMode": "preview",
"propertiesInDocument": "visible"
}
33 changes: 21 additions & 12 deletions _notes/compsci-notes/.obsidian/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
]
Expand Down Expand Up @@ -81,6 +86,7 @@
"state": {
"type": "backlink",
"state": {
"file": "clean code.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
Expand All @@ -97,6 +103,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "clean code.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
Expand All @@ -118,7 +125,9 @@
"type": "leaf",
"state": {
"type": "outline",
"state": {}
"state": {
"file": "clean code.md"
}
}
},
{
Expand All @@ -129,12 +138,12 @@
"state": {}
}
}
]
],
"currentTab": 4
}
],
"direction": "horizontal",
"width": 300,
"collapsed": true
"width": 300
},
"left-ribbon": {
"hiddenItems": {
Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions _notes/compsci-notes/docker cheat sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 5 additions & 4 deletions _notes/compsci-notes/go conventions.md
Original file line number Diff line number Diff line change
@@ -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
---

Expand Down Expand Up @@ -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.

Expand All @@ -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.

Expand Down
5 changes: 3 additions & 2 deletions _notes/compsci-notes/go memory profiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---

Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions _notes/compsci-notes/python magic methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.”*

---

0 comments on commit 4ec8a75

Please sign in to comment.