Posts tagged "programming":
resources
I'm tired of being asked for resources again and again. I'm dumping all of them here. I'll keep updating this list. I'm not categorizing them, I have better things to do in life. They are in no particular order. Ping me if an entry is stale. This is all I know atm. Will add more as and when I know. My own blog also has some notes, might be helpful.
Experiments with OCaml - part 3
Ok, so the error last time was the fact that emacs was not able to pick up the change in ocaml switches, hence I restarted for my compositor to pick my settings and emacs picked it up wonderfully. Next, Fira Code ligatures were actually insanely annoying in emacs so I switched to ProFont, and it looks wonderful. Third, dune and dune-format packages are lifesavers.
(...)Experiments with OCaml - Part 2
Ok, so it was getting a bit on my nerves that I wasn't able to cleanly do the things I wanted to. So I switched to git back. Sorry for disappointing :/ Another issue I keep running into is the fact that for some god knows what reason emacs isn't able to find the LSP in the path and I need to set it manually. It's so annoying. I'm using helix for now, as everything works out of the box for it.
(...)Experiments with OCaml
I feel embarrassed to admit that I've never written a real project in OCaml. So let's settle that today. I'll be doing this series to learn both jujutsu and OCaml properly. I'll push it to my codeberg once I've learned how to do that. So keep following along!
(...)sublinear algorithms
Notes from sepehr assadi's course
(...)HVM, a new model of computation
We have combinators with two main rewrite rules over here. One is the \(K\) combinator, which consumes two arguments and returns the first one.
(...)ELF Relocations
The reason we need relocations is because of a simple fact, the existence of shared libraries.
(...)ELF Structure
ELF files have a header section that can be read with readelf -h executable
which gives you quite
a bit of information about the binary.
Cool C++ features
I'm not mentioning stuff that got deprecated later on, or stuff that's trivial.
(...)Haskell notes
The above was just a test for seeing if org-babel works.
(...)Memory layouts
Whenever a program is run, it has two kinds of memories, stack and heap.
(...)OS Notes
Manages runtime of the system. Provides virtualization to the underlying system.
(...)UGRC hints
As of now printing everything using printk
functions.
Memory Ordering in C++ and OS support (Linux)
Some basic things to note:
(...)C Practice Questions
THESE QUESTIONS ARE HARD! PROCEED WITH CAUTION!
(...)Computer Architecture
Different Instructions: x86, ARM, RISC V, MIPS.
(...)Compilers
Read a source file, and write the output to another file.
(...)Pacdef
My first open source contributions and serious code, and how I want to take it much further …
(...)GPU Programming
To set up google colab, set the runtime to T4 and run
(...)Emacs setup
I began using emacs when a friend of mine bullied me into it. I had fiddled with emacs before but never lasted on it for a long time. I tried Doom, spacemacs, and whatnot, but it was always annoying to not have something that I wanted (Heck, I still want those buffer tabs).
(...)Classes in C++
Classes are nothing but a collection of variables and member functions that are also called methods.
(...)Calcurs update
Ok, let's roll.
(...)CSD
Moore's Law: The number of transistors in a dense integrated circuit doubles every two years.
(...)Calcurs
I wanted to have a sort of a parser that picked up my todos from my notes and scraped that as well as my schedule into a neat displayable format. The result, calcurs.
(...)Hacking snippets
GOT and PLT
Natas Solutions
Password is in the comments.
(...)CMake
Set up the dir tree as follows:
(...)Regex
General format:
(...)Notes on C
Must read: Brian Jorgensen Hall's blog
(...)References in C++
C++11 introduced 5 types of objects; lvalues, rvalues, glvalues, prvalues, xvalues.
(...)CS2200
Network Stack
Traceroute
TCP
Transmission Control Protocol. Originated along with ipv4 and hence the entire system is called TC/IP. It's IP Protocol Number is 6.
IPv6
IPv4
Fun fact: ARPAnet was 10.x.x.x
Rvalue references
Introduced on C++11, these are references to rvalues. These exist to extend the object lifetime of an rvalue, say, a function return value.
(...)Concurrency
C++ 11: Threads
(...)Registers in x86 and friends
There are 3 types of General-purpose data registers they are:
(...)CV Qualifiers
cvqualifiers
(...)Enum Classes in C++
Problems with regular enums:
(...)Sway Config
Getting coding superpowers with this dark theme! NOTE: This is very obsolete atp
(...)wtf is std::forward
Most of the article was inspired from this brilliant answer from stackoverflow.
(...)GDB Cheatsheet
More important commands have a (*) by them.
Static variables and functions
Initialised at the beginning of the program, before the main
function
is called. Stored in the data
section of the program if initialised or
bss
if not. Basically shares a location with a global variable.
Branch predictions
We can usually fit many operations in one clock cycle. So if all instructions were independent, we can in theory do like 5 or 6 instructions at once.
(...)ICMP
Used by network devices such as routers to send error messages back. Typically used for network diagnostic tools such as traceroute.
File Descriptors
On *nix systems, file descriptors are a number that are given to files
that have a stream attached to them. C can directly read and write from
file descriptors using the read()
command that takes a file
descriptor, a buffer and a length to be read.
ARP
The packet has 48-bit fields for the sender hardware address (SHA) and target hardware address (THA), and 32-bit fields for the corresponding sender and target protocol addresses (SPA and TPA).
(...)DHCPv6
In this example, without rapid-commit present, the server's link-local
address is fe80::0011:22ff:fe33:5566
and the client's link-local
address is fe80::aabb:ccff:fedd:eeff
.
DHCP
DNS
DNS is the domain name system. It is a methodical address-book kinda thing that returns the location of the nearest server for that domain name.
(...)OpenMP Optimizations
Who knew parallelisation would be so easy!
(...)C Macros
#define
defines a variable to a value (or nothing if it's not defined). It
is a literal find and replace kinda stuff, so be aware of what's happening
after rewrites. It can also be used in a functional fashion and has a bunch
of operators.
Python notes
Python has the capability of carrying out calculations. Enter a calculation directly into a print statement:
(...)