Has this ever happened to you: You come across some piece of software and want to take a look at its source code. You open its codebase and it is sprawling - many layers of abstraction and much more complicated than what you expected. You think you can implement the concept in much fewer lines of code and in a much simpler fashion. If you attempt to do so, you may get the core concept (the…
I recently ran into a Rust lifetimes issue when working on a toy project of mine. The simplified problem is as such: I have a struct Foo which owns a String and has a counter.
struct Foo { owned_string: String, prefix_index: usize } What I want to do is to implement the Iterator trait for this struct. I want to iterate over all prefixes of this owned string. We might do something like this:
Sometime back, I went into a deep rabbit hole. This is a documentation of what I found. Consider the Ubuntu APT repository. I’m using the bionic-backports one.
Each APT registry contains a ‘Release’ file which is an index of all the files in the repository. There are files listed with their associated archive files (a ‘.gz’ and a ‘.xz’…
A set of arcana about build tools, linkers, programming languages etc which are probably only useful to me
LD_DEBUG spits out debug information about linkers cmake –trace to trace the evaluation of a cmake file Use LD_PRELOAD + RTLD_NEXT in order to “intercept” function calls #include_next to include the next header file match. Similarly RTLD_NEXT RTLD_LOCAL to restrict…
Recently, at work, we were debugging an issue where dlclose was not unloading the library . You might wonder why that even matters - if your library contains any global symbols, then their state will persist across a dlopen, dlclose sequence. In other words, your library isn’t starting from a clean state every time.
In the case we were debugging, this issue manifested in the following…
I’m Kishore Ganesh. I love everything about Computer Science, from nifty discrete math proofs to more concrete systems-domains like Operating System to visual domains like Computer Graphics. I love building projects, especially in domains I’m unfamiliar with.
One of my favorite things to do is to dive into a new topic and spend multiple weeks building up expertise on it.
My most notable…
JSON is one of the most common data interchange formats there is. Thankfully, it is also a pretty simple one. I had written a JSON parser in C++ sometime back, and whilst making it I came across a few decisions that were more involved than I thought they would be. So I have decided to write an article around that JSON Parser. While JSON Parsing is simple, writing one would definitely be useful to…
Good compilers prevent you from shooting yourself in the foot. Today, you have a wide assortment of programming languages to choose from, you can have your pick of paradigm. As a brief detour, the perspective of programmers comes full circle as they move from beginner to slightly experienced to intermediate.
The beginner is deathly afraid of the differences between programming languages. In…
A long, long time back, in a galaxy far far away, I was doing the same thing I’m doing right now. Booting up a blog. Genesis. Creation. My older blogs are many years behind me, and now a new journey begins.
I have witnessed a stark change in how I view blogging, or how I view writing in general over my 4 years of college. More on that in a later post, but I’m excited to embark on this new…