Various formatting clean ups

This commit is contained in:
Sanchayan Maity 2024-10-01 13:59:32 +05:30
parent 518e430d61
commit bfaea2a8b0
11 changed files with 270 additions and 69 deletions

View file

@ -1,3 +1,7 @@
---
title: anime
---
## Watching ## Watching
- [ ] Saiki - [ ] Saiki

View file

@ -15,15 +15,15 @@ gdbus call --system --dest org.bluez --object-path /org/bluez/hci0/dev_6C_C4_D5
## Information on codecs ## Information on codecs
- https://www.soundguys.com/understanding-bluetooth-codecs-15352/ - [Understanding Bluetooth codecs](https://www.soundguys.com/understanding-bluetooth-codecs-15352/)
- https://habr.com/en/post/456182/ - [Audio over Bluetooth](https://habr.com/en/post/456182/)
- https://www.nytimes.com/wirecutter/blog/what-you-need-to-know-about-bluetooth-audio/ - [What you need to know about Bluetooth](https://www.nytimes.com/wirecutter/blog/what-you-need-to-know-about-bluetooth-audio/)
- https://www.bluetooth.com/learn-about-bluetooth/recent-enhancements/le-audio/le-audio-specifications/ - [LE audio specs](https://www.bluetooth.com/learn-about-bluetooth/recent-enhancements/le-audio/le-audio-specifications/)
- https://www.bluetooth.com/blog/best-recorded-bluetooth-presentations-from-2020/ - [Bluetooth presentations](https://www.bluetooth.com/blog/best-recorded-bluetooth-presentations-from-2020/)
## Transport payload sizes observed for SBC ## Transport payload sizes observed for SBC
@ -67,7 +67,8 @@ Consider an mkv file recorded with OBS, do the following
ffmpeg -i infile.mp4 -vcodec copy -filter:a "volume=3.000000" -c:a aac -b:a 320k infile-outputlouder.mkv ffmpeg -i infile.mp4 -vcodec copy -filter:a "volume=3.000000" -c:a aac -b:a 320k infile-outputlouder.mkv
``` ```
See the link <https://trac.ffmpeg.org/wiki/Encode/AAC> See the link [FFmpeg - Encode AAC](https://trac.ffmpeg.org/wiki/Encode/AAC).
# In-ear monitors
- [Making sense of an IEM tip fit](https://old.reddit.com/r/headphones/comments/10lly6d/how_to_make_sense_of_iem_tip_fit/)

View file

@ -4,37 +4,33 @@ title: Bookmarks
# Interesting projects # Interesting projects
- https://c9x.me/ - [c9x](https://c9x.me/)
- https://www.gnu.org/software/mes/ - [GNU mes](https://www.gnu.org/software/mes/)
# Mathematics # Mathematics
- https://abakcus.medium.com/the-best-of-springer-undergraduate-books-for-beginners-c0c55f9fdb11 - [Best of Springer undergraduate books for beginners](https://abakcus.medium.com/the-best-of-springer-undergraduate-books-for-beginners-c0c55f9fdb11)
- https://ocw.mit.edu/courses/mathematics/18-06-linear-algebra-spring-2010/index.htm - [OCW Linear Algebra](https://ocw.mit.edu/courses/mathematics/18-06-linear-algebra-spring-2010/index.htm)
- https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab - [Essence of Linear Algebra](https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab)
- https://twitter.com/thingskatedid/status/1335013038429065216
# Computer architecture # Computer architecture
## Course by Onur Mutlu at ETH Zurich - [Comp Arch course page - Onur Mutlu](https://safari.ethz.ch/architecture/fall2020/doku.php)
- https://safari.ethz.ch/architecture/fall2020/doku.php - [Comp Arch - Onur Mutlu Lectures](https://www.youtube.com/watch?v=c3mPdZA-Fmc&list=PL5Q2soXY2Zi9xidyIgBxUz7xRPS-wisBN)
- https://www.youtube.com/watch?v=c3mPdZA-Fmc&list=PL5Q2soXY2Zi9xidyIgBxUz7xRPS-wisBN
# Maths # Maths
- https://math.stackexchange.com/questions/1652937/a-good-book-for-beginning-group-theory - [Books for group theory](https://math.stackexchange.com/questions/1652937/a-good-book-for-beginning-group-theory)
# Miscellaneous # Miscellaneous
- https://www.dabeaz.com/coroutines/ - [Coroutines](https://www.dabeaz.com/coroutines/)
- https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html - [Coroutines](https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html)
- https://henrikwarne.com/2024/02/11/finding-a-new-software-developer-job/ - [Finding a new software developer job](https://henrikwarne.com/2024/02/11/finding-a-new-software-developer-job/)
- https://gist.github.com/cb372/5f6bf16ca0682541260ae52fc11ea3bb - [Writing an OS in Rust to run on RISC-V](https://gist.github.com/cb372/5f6bf16ca0682541260ae52fc11ea3bb)

View file

@ -4,4 +4,4 @@ title: FPGA
# Resources # Resources
- https://projectf.io/sitemap/ - [Projectf](https://projectf.io/sitemap/)

23
gstreamer/basesrc-eos.md Normal file
View file

@ -0,0 +1,23 @@
---
title: basesrc eos
---
Decided to look into this issue in the morning.
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/227
At first, got side tracked by the comment pointing to src_event . However, when send_event is invoked on the element, `src_event` isn't where it's received. `ElementImpl`'s `send_event` is where it comes to. Now, `udpsrc` is build upon `basesrc`. Had clearly forgotten how much the base classes hide away. So looking into how EOS is handled by `basesrc` led down a rabbit hole. The handling of EOS for push and pull mode is different. `ts-udpsrc` at least right now only supports push mode, which also makes sense considering that it implements asynchronous Task.
Now, scratching head on how much of this should be applicable to `ts-udpsrc` considering that it doesn't derive from `basesrc`.
[`basesrc` EOS handling](htps://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/210487b50abac1dbf04e181f0f685690c0863d33/subprojects/gstreamer/libs/gst/base/gstbasesrc.c#L1972)
For example, it's odd that the `base_src_loop` is triggered again to perform some operation asynchronously. On second thought though, guess it makes sense that what's to be done is done synchronously in `send_event`. The buffer pool also needs to be set to flushing?
What has to be done can be seen below.
[`base_src_loop` EOS handling](https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/210487b50abac1dbf04e181f0f685690c0863d33/subprojects/gstreamer/libs/gst/base/gstbasesrc.c#L3142)
- Pause task
- Post segment done message
- Push event?

View file

@ -27,19 +27,19 @@ There is `max-errors` property on audio decoder elements which can be helpful in
## Autoplugging ## Autoplugging
- [Autoplugging](https://gstreamer.freedesktop.org/documentation/application-development/advanced/autoplugging.html?gi-language=c) - [Auto plugging](https://gstreamer.freedesktop.org/documentation/application-development/advanced/autoplugging.html?gi-language=c)
- [Playback Components](https://gstreamer.freedesktop.org/documentation/application-development/highlevel/playback-components.html?gi-language=c) - [Playback components](https://gstreamer.freedesktop.org/documentation/application-development/highlevel/playback-components.html?gi-language=c)
- [Decodebin Design](https://gstreamer.freedesktop.org/documentation/additional/design/decodebin.html?gi-language=c) - [Decodebin design](https://gstreamer.freedesktop.org/documentation/additional/design/decodebin.html?gi-language=c)
## Why are queues required ## Why are queues required
- [Demuxing mp4 and queues](http://gstreamer-devel.966125.n4.nabble.com/demuxing-mp4-and-queues-td4689905.html) - [Demuxing mp4 and queues](http://gstreamer-devel.966125.n4.nabble.com/demuxing-mp4-and-queues-td4689905.html)
This is a classical problem, and a good illustration why you usually need queues after elements with N src pads, and before elements with N sink pads. This is a classical problem, and a good illustration why you usually need queues after elements with N source pads, and before elements with N sink pads.
The demuxer is pushing to its source pads from the same thread, and if you have connected these source pads with sync=true sinks, their chain function blocks until prerolling is done, that is until each sink with sync=true has received a buffer. Adding queues decouples branches of the pipeline, as they will start their own streaming thread. The demuxer is pushing to its source pads from the same thread, and if you have connected these source pads with sync=true sinks, their chain function blocks until pre-rolling is done, that's until each sink with sync=true has received a buffer. Adding queues decouples branches of the pipeline, as they start their own streaming thread.
## Dynamically remove or unlink elements ## Dynamically remove or unlink elements
@ -85,7 +85,7 @@ https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/274
### Decodebin ### Decodebin
This element automatically constructs a decoding pipeline using available decoders and demuxers via auto-plugging until raw media is obtained. It is used internally by `uridecodebin` which is often more convenient to use, as it creates a suitable source element as well. It replaces the old `decodebin` element. It acts like a demuxer, so it offers as many source pads as streams are found in the media. This element automatically constructs a decoding pipeline using available decoders and demuxers via auto plugging until raw media is obtained. It's used internally by `uridecodebin` which is often more convenient to use, as it creates a suitable source element as well. It replaces the old `decodebin` element. It acts like a demuxer, so it offers as many source pads as streams are found in the media.
``` bash ``` bash
gst-launch-1.0 souphttpsrc location=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm ! decodebin ! autovideosink gst-launch-1.0 souphttpsrc location=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm ! decodebin ! autovideosink
@ -93,7 +93,7 @@ This element automatically constructs a decoding pipeline using available decode
### Thumbnails ### Thumbnails
Can `GstDiscoverer` be used for thumbnails? Googling a bit, and we land on this issue [discoverer should generated video/image thumbnails](https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/58). This references [Thumbnailer Spec](https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html) and [Thumbnail Management DBus Specification](https://wiki.gnome.org/action/show/DraftSpecs/ThumbnailerSpec?action=show&redirect=ThumbnailerSpec). `GstDiscoverer` does not seem to have a thumbnailing API. Can `GstDiscoverer` be used for thumbnails? Search with Google a bit, and land on this issue [discoverer should generated video/image thumbnails](https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/58). This references [Thumbnailer Spec](https://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html) and [Thumbnail Management DBus Specification](https://wiki.gnome.org/action/show/DraftSpecs/ThumbnailerSpec?action=show&redirect=ThumbnailerSpec). `GstDiscoverer` doesn't seem to have a thumbnailing API.
There is a totem video thumbnailer which is the video thumbnailer for the **GNOME** desktop but seems not to be available as a separate library. [ffmpegthumbnailer](https://github.com/dirkvdb/ffmpegthumbnailer) based on ffmpeg is a lightweight video thumbnailer that can be used by file managers to create thumbnails for video files. However, packaging `ffmpeg` might be a concern here and `ffmpegthumbnailer` has a *GPL-2.0* license. FFmpeg is licensed under the LGPL license, however, if a particular build of FFmpeg is linked against any GPL libraries (notably x264), then the entire binary is licensed under the GPL. There is a totem video thumbnailer which is the video thumbnailer for the **GNOME** desktop but seems not to be available as a separate library. [ffmpegthumbnailer](https://github.com/dirkvdb/ffmpegthumbnailer) based on ffmpeg is a lightweight video thumbnailer that can be used by file managers to create thumbnails for video files. However, packaging `ffmpeg` might be a concern here and `ffmpegthumbnailer` has a *GPL-2.0* license. FFmpeg is licensed under the LGPL license, however, if a particular build of FFmpeg is linked against any GPL libraries (notably x264), then the entire binary is licensed under the GPL.
@ -109,11 +109,11 @@ Some links which have examples.
`GstDiscoverer` is used in Tracker Miner though not for everything. From [Into the Pyramid](https://samthursfield.wordpress.com/2019/12/01/into-the-pyramid/). `GstDiscoverer` is used in Tracker Miner though not for everything. From [Into the Pyramid](https://samthursfield.wordpress.com/2019/12/01/into-the-pyramid/).
- Tracker has a generic image extraction rule that tries to find metadata for any image/\* MIME type that isnt a .bmp, .jpg, .gif, or .png. This codepath uses the GstDiscoverer API, the same as for video and audio files, in the hope that a GStreamer plugin on the system can give us useful info about the image. - Tracker has a generic image extraction rule that tries to find metadata for any image/\* MIME type that isnt a .bmp, .jpg, .gif, or .png. This codepath uses the GstDiscoverer API, the same as for video and audio files, in the hope that a GStreamer plugin on the system can give useful info about the image.
- The GstDiscoverer instance is created with a timeout of 5 seconds. (This seems quite high — the gst-typefind utility that ships with GStreamer uses a timeout of 1 second). - The GstDiscoverer instance is created with a timeout of 5 seconds. (This seems high, the typefind utility that ships with GStreamer uses a timeout of 1 second).
- GStreamers GstDiscoverer API feeds any file where the type is unknown into an MPEG decoder, which is effectively an unwanted fuzz test and can trigger periods of high CPU and memory usage. - GStreamers GstDiscoverer API feeds any file where the type is unknown into an MPEG decoder, which is an unwanted fuzz test and can trigger periods of high CPU and memory usage.
- 5 seconds of processing non-MPEG data with an MPEG decoder is somehow enough to cause Linuxs scheduler to lock up the entire system. - 5 seconds of processing non-MPEG data with an MPEG decoder is somehow enough to cause Linuxs scheduler to lock up the entire system.
@ -127,7 +127,7 @@ Each GStreamer element has a detail called rank that defines the priority used b
## Opus RTP encoding decoding pipeline ## Opus RTP encoding decoding pipeline
Note that in place of rtpjitterbuffer, rtpbin also works. Note that in place of `rtpjitterbuffer`, `rtpbin` also works.
``` bash ``` bash
export AUDIO_CAPS="application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)OPUS" export AUDIO_CAPS="application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)OPUS"
@ -184,12 +184,14 @@ echo 0 > /proc/sys/kernel/yama/ptrace_scope
echo -1 > /proc/sys/kernel/perf_event_paranoid echo -1 > /proc/sys/kernel/perf_event_paranoid
``` ```
- Arch enables the Yama LSM by default, which provides a `kernel.yama.ptrace_scope` kernel parameter. This parameter is set to 1 (restricted) by default which prevents tracers from performing a ptrace call on traces outside of a restricted scope unless the tracer is privileged or has the `CAP_SYS_PTRACE` capability. Arch enables the Yama LSM by default, which provides a `kernel.yama.ptrace_scope` kernel parameter. This parameter is set to 1 (restricted) by default which prevents tracers from performing a `ptrace` call on traces outside of a restricted scope unless the tracer is privileged or has the `CAP_SYS_PTRACE` capability.
# Terminology # Terminology
- **Transmuxing**, also referred to as repackaging or packetizing, is a process in which audio and video files are repackaged into different delivery formats without changing the files' contents. ## Transmuxing
- Referred to as repackaging or packetizing, is a process in which audio and video files are repackaged into different delivery formats without changing the files' contents.
# Yocto # Yocto
@ -205,21 +207,22 @@ echo -1 > /proc/sys/kernel/perf_event_paranoid
- https://www.youtube.com/watch?v=OKTfNAmFTo4 - https://www.youtube.com/watch?v=OKTfNAmFTo4
- `running_time` is the amount of time "spent" in playing - `running_time` is the amount of time "spent" in playing
- Playing => Paused: Remember running time - Playing => Paused: Remember running time
- Paused => Playing: base_time = current absolutetime - running_time - Paused => Playing: base_time = current absolutetime - running_time
# Live pipeline # Live pipeline
## Live sources ## Live sources
- https://gstreamer.freedesktop.org/documentation/additional/design/live-source.html?gi-language=c - [Live source](https://gstreamer.freedesktop.org/documentation/additional/design/live-source.html?gi-language=c)
- https://gstreamer.freedesktop.org/documentation/additional/design/element-source.html?gi-language=c - [Element source](https://gstreamer.freedesktop.org/documentation/additional/design/element-source.html?gi-language=c)
- [gstbasesrc](https://gstreamer.freedesktop.org/documentation/base/gstbasesrc.html?gi-language=c)
-https://gstreamer.freedesktop.org/documentation/base/gstbasesrc.html?gi-language=c
## Pipeline to check base time gets updated after PAUSE -> PLAY transition ## Pipeline to check base time gets updated after PAUSE -> PLAY transition
@ -235,11 +238,11 @@ ninja -C build && env CK_FORK=no meson test --gdb -C build --suite gst-plugins-g
# Re-timestamping frames # Re-timestamping frames
- https://kaustav.space/2018-09-20/retimestamping-frames-in-gstreamer - [Timestamping frames in GStreamer](https://kaustav.space/2018-09-20/retimestamping-frames-in-gstreamer)
# H264 # H264
- https://doc-kurento.readthedocs.io/en/latest/knowledge/h264.html - [Kurento docs - H264](https://doc-kurento.readthedocs.io/en/latest/knowledge/h264.html)
# Video mp4 # Video mp4

109
gstreamer/quic.md Normal file
View file

@ -0,0 +1,109 @@
---
title: quic
---
## GStreamer
Existing implementations which support stream and datagram multiplexing are
- https://github.com/bbc/gst-quic-transport
- https://github.com/bbc/gst-roq
## gst-quic-transport
Few points to think about before hand
- Flow control
- Stream credits
- Priority among streams
### rtpquicmux
- Adds the flow identifier
- Maps RTP and RTCP packets to QUIC streams or datagram
- Each payload type and SSRC is send on a unique QUIC stream (uses a hash table to track this)
### quicmux
- Multiplex QUIC streams and datagrams on the same QUIC transport connection
- Adds meta to buffers to distinguish between stream and datagrams at the transport layer
- New stream (uni/bi-directional) or datagram connection is opened depending on the requested pad
- Buffers on stream pads don't map directly to frames at QUIC layer and are payloaded by the library.
- Uses custom query events for handling connections with `quicsink` downstream
### quicsrc
- Uses the meta on buffers to decide if the buffer is from a stream or datagram
# Media over QUIC
- Optimised for QUIC protocol either directly or via WebTransport.
- Utilises a publish subscribe workflow
- Designed to work with multiple MoQ streaming formats which define how content is encoded, packaged and mapped to MOQT objects along with policies for discovery and subscription.
## Terms
**Group**: a temporal sequence of objects. A group represents a join point in a track.
**Track**: an encoded bitstream. Tracks contain a sequential series of one or more groups and are the subscribable entity with MOQT.
**Object**: an object is an addressable unit whose payload is a sequence of bytes. Objects form the base element in MOQT model.
#### Objects
- Basic data element of MOQT is an object.
- An objects is an addressable unit whose payload is a sequence of bytes.
- All objects belong to a group (indicates ordering and potential dependencies)
- Uniquely identified by track namespace, track name, group and object ID.
- Can become unavailable but contents must not change over time.
- Comprises of metadata (never encrypted, visible to relays) and payload.
- Application alone responsible for content of object payload.
- Relay must not combine, split or otherwise modify object payloads.
#### Groups
- Collection of objects, sub-unit of track.
- Objects within groups shouldn't depend on objects in other groups.
- Behaves as joint point for subscriptions.
#### Track
- Sequence of groups.
- Entity against which a consumer issues a subscription request.
- Subscriber can request to receive individual tracks starting at group boundary.
### Session initialisation
- First stream opened is a client initiated bi-directional control stream.
- Peers exchange setup messages on this stream.
- Control messages must not be sent on any other stream, if received on a non-control stream, it'll be a protocol violation.
- Control stream is the only bi-directional stream. Objects are sent on uni-directional streams. A second bi-directional stream would be a protocol violation.
- Objects are sent on uni-directional streams.
### Stream cancellation
- Streams aside from the control stream may be cancelled due to congestion or any other reason.
### Termination
The transport session can be terminated at any point.
# WARP
- WARP streaming format is a media format designed to deliver CMAF compliant media content over MOQT.
- Fragments the bitstream into objects that can be independently transmitted.
- Uses a prioritisation strategy of assigning newer content a higher delivery order and video over audio when facing congestion.
- Either complete GOPS or individual frames are mapped to MoQTransport objects.
- Targeted at interactive levels of latency.
### Time alignment
WARP tracks may be time aligned. (*Don't understand this here*)
- Time aligned tracks must be advertised in the catalogue as belonging to a common render group.
- Presentation time of the first media sample contained within the first MOQT object of each equally numbered MOQT group must be identical.
### Media transmission
MOQT groups and objects need to be mapped to MOQ transport streams. Each MOQT object must be mapped to a new moq-transport stream.

View file

@ -6,58 +6,56 @@ title: Haskell
## Semirings ## Semirings
- https://doisinkidney.com/posts/2016-11-17-semirings-lhs.html - [Semirings](https://doisinkidney.com/posts/2016-11-17-semirings-lhs.html)
- https://doisinkidney.com/posts/2017-10-13-convolutions-and-semirings.html - [Convolutions & Semirings](https://doisinkidney.com/posts/2017-10-13-convolutions-and-semirings.html)
- https://r6.ca/blog/20110808T035622Z.html - [General Method of Computing Shortest Paths](https://r6.ca/blog/20110808T035622Z.html)
## Monoids ## Monoids
- http://blog.sigfpe.com/2009/01/haskell-monoids-and-their-uses.html - [Monoids & their uses](http://blog.sigfpe.com/2009/01/haskell-monoids-and-their-uses.html)
- https://www.haskellforall.com/2014/07/equational-reasoning-at-scale.html - [Equational reasoning at scale](https://www.haskellforall.com/2014/07/equational-reasoning-at-scale.html)
- https://apfelmus.nfshost.com/articles/monoid-fingertree.html - [Fingertree](https://apfelmus.nfshost.com/articles/monoid-fingertree.html)
- https://gist.github.com/cscalfani/b0a263cf1d33d5d75ca746d81dac95c5 - [Monoids in Haskell](https://gist.github.com/cscalfani/b0a263cf1d33d5d75ca746d81dac95c5)
## Continuation passing style ## Continuation passing style
- https://stackoverflow.com/questions/45334985/when-to-use-cps-vs-codensity-vs-reflection-without-remorse-in-haskell - [CPS vs Codensity vs Reflection](https://stackoverflow.com/questions/45334985/when-to-use-cps-vs-codensity-vs-reflection-without-remorse-in-haskell)
- https://deque.blog/2017/01/13/beautiful-code-control-fold/ - [Control fold](https://deque.blog/2017/01/13/beautiful-code-control-fold/)
- https://free.cofree.io/2020/01/02/cps/ - [CPS](https://free.cofree.io/2020/01/02/cps/)
- https://neilmitchell.blogspot.com/2014/06/optimisation-with-continuations.html - [Optimisation with continuations](https://neilmitchell.blogspot.com/2014/06/optimisation-with-continuations.html)
- https://jtobin.io/page2/ - [Transforming to CPS](https://jtobin.io/page2/)
## How to read sequential calculus notation ## How to read sequential calculus notation
![Sequential Calculus Notation Helper](../images/sequent-calculus.jpg "SequentCaculusHelper") ![Sequential Calculus Notation Helper](../images/sequent-calculus.jpg)
- http://logitext.mit.edu/tutorial - http://logitext.mit.edu/tutorial
- https://langdev.stackexchange.com/questions/2692/how-should-i-read-type-system-notation - [How to read type system notation](https://langdev.stackexchange.com/questions/2692/how-should-i-read-type-system-notation)
## Folds ## Folds
Alexis King's excellent explanation on folds Alexis King's excellent explanation on folds
- https://twitter.com/lexi_lambda/status/1198676516445589509 - [Discussion on Hasura Graphql PR](https://github.com/hasura/graphql-engine/pull/2933#discussion_r328821960)
- https://github.com/hasura/graphql-engine/pull/2933#discussion_r328821960
## Principles of Programming Languages ## Principles of programming languages
- http://kmicinski.com//cis352-s20/ - http://kmicinski.com//cis352-s20/
- https://www.youtube.com/user/krismicinski/videos - https://www.youtube.com/user/krismicinski/videos
# Category Theory # Category theory
## Resources ## Resources
@ -74,10 +72,9 @@ Alexis King's excellent explanation on folds
### Arrows as functions ### Arrows as functions
- Arrows are also called morphisms - Arrows are also called morphisms
- In a category, if there is an arrow going from **A** to **B** and an arrow going from **B** to **C** then there must also be a direct arrow from **A** to **C** that is their composition. Note that this is not a full category because it's missing identity morphisms. - In a category, if there is an arrow going from **A** to **B** and an arrow going from **B** to **C** then there must also be a direct arrow from **A** to **C** that's their composition. Note that this isn't a full category because it's missing identity morphisms. **In Mathematics and in Haskell, functions compose right to left**.
- **In Mathematics and in Haskell, functions compose right to left**.
### Properties of Composition ### Properties of composition
- Composition is associative. - Composition is associative.
- For every object, there is identity morphism. - For every object, there is identity morphism.
@ -96,11 +93,11 @@ Category is just a bunch of objects. One analogy is thinking of category as a gr
Composable "end of one is beginning of other". And remember that end or beginnings are objects. Thinking in terms of types, the objects should be types?. If the *end* type does match *beginning* type, we cannot compose right? Composable "end of one is beginning of other". And remember that end or beginnings are objects. Thinking in terms of types, the objects should be types?. If the *end* type does match *beginning* type, we cannot compose right?
When we are defining a category, the category is defined by giving objects, what the objects are, defining arrows and then defining composition. Composition is like a big multiplication table for arrows. For every arrow, one has to define their composition. When defining a category, the category is defined by giving objects, what the objects are, defining arrows and then defining composition. Composition is like a big multiplication table for arrows. For every arrow, one has to define their composition.
Different composition tables give different category. Different composition tables give different category.
We also have laws: Category also has laws:
1. Left Identity 1. Left Identity
2. Right Identity 2. Right Identity

39
maths/groups.md Normal file
View file

@ -0,0 +1,39 @@
---
title: groups
tags: maths, groups
---
# Quotient groups
Wiki: https://en.wikipedia.org/wiki/Coset
`Normal` subgroup of **G** is any subgroup of **G** which is closed with respect to conjugates.
### Theorem 1
If $H$ is a normal subgroup of $G$, then $aH = Ha$ for every $a \in G$.
There is no distinction between left and right cosets for a normal subgroup.
### Theorem 2
Let $H$ be a normal subgroup of $G$. If $Ha = Hc$ and $Hb = Hd$, then $H(ab) = H(cd)$.
### Theorem 3
$G/H$ with coset multiplication is a group.
### Theorem 4
$G/H$ is a homomorphic image of $G$.
### Theorem 5
Let $G$ be a group and $H$ a subgroup of $G$. Then
- $Ha = Hb$ _iff_ $ab^{-1} \in H$ and
- $Ha = H$ _iff_ $a \in H$
The motive for the quotient group construction is that it gives a way of actually _producing_ all the homomorphic images of any group $G$.
For quotient group construction in practical instances, $H$ is often chosen to "factor out" unwanted properties of $G$, and preserve in $G/H$ only "desirable" traits.

View file

@ -37,6 +37,13 @@ git merge -Xours origin/master
# Shell tips # Shell tips
## Disk space
```bash
du -cha --max-depth=1 / | grep -E "M|G"
du -cha --max-depth=1 /var | grep -E "M|G"
```
## Recursively remove execute permissions ## Recursively remove execute permissions
``` bash ``` bash

22
wrongs/casteism.md Normal file
View file

@ -0,0 +1,22 @@
---
title: casteism
tags: politics, nonsense
---
# Resources
- Annihilation of Caste by Dr. Ambedkar.
- https://en.wikipedia.org/wiki/Caste_system_in_India
- [Discussion on Reddit](https://old.reddit.com/r/india/comments/1cofme2/caste_system_is_definitely_part_of_hinduism_and/)
- One of the main problems of Left is that they only know Gita and Manusmriti as source of casteism. Hindus simply say but they're just two books.
- Instead, tell right wing about Dharmasutras - Apastambha Dharmasutra, Gautama Dharmasutra, Vaisista Dharmasutra, Baudhyana Dharmasutra, etc.
- Tell right wing about Puranas - how Bhagavad Purana bars women and Shudras from reading Vedas, how several Puranas tell people to put molten lead in Shudra's ears if they hear Vedas, etc.
- Tell them about how Chandogya Upanishad discriminates against Candalas.
- Tell them how Arthashastra, a non-religious document from ancient India, mostly deals with caste system and establishing discriminatory rules against Shudras.