My LLM system prompt LLMs typically produce too much verbiage and its difficult to read through it and make sense of it. Here’s the system prompt I use with LLMs (those which let you set a system prompt). Be CONCISE, efficient, blunt and to the point. Assume the user is technically proficient. Avoid vague, flattering or corporate-ish language. Be technical and precise. Use SIMPLE and SHORT…
While I am not a strict command line affectionado, I have found myself to spend significant time in the terminal, especially when doing devops-y work. Here are some things I learned which will improve the speed when working in terminal. Note that many of the snippets here were found by me / edited long back. I may not be able to attribute the correct source of each snippet. Let me know if you know…
People do or do not use debuggers for a variety of reasons. For one thing, they are hard to setup in many codebases. Second, you can’t use them when your application is running on remote environments (such as kuberenetes). So, anecdotally, I have seen way more people using Print/ log.Debug compared to a debugger. Which is a shame, because while debug logging is convenient at times, debuggers…
Debuggers and REPL (Interactive prompt / intepreter) are invaluable development tools. They serve mostly complimentary functions. A Debugger is most useful to run a program and inspect program state in between. In contrast, an REPL is most useful to try out standard library functions when developing, and try out your own functions too without needing to establish an end-to-end flow (such as an API…
The humble beginnings Once upon a time, I had a use case for serving the contents inside of a zip file over HTTP, preferably without unpacking the .zip to a temporary directory. Go is a language made for writing HTTP servers. Since we can represent zip file as a filesystem fs.FS , how hard would it be to write a file server to serve files from it? Well, it was harder than I thought.
Why? Many times tests are run against a simple database like H2 or SQLite, whereas production uses a heavier DB like MySQL. However, its many times desirable to run testing with the real DB. For example, when the application makes use of DB-specific features or quirks, it’s required for proper testing. Once upon a time it took long time to setup MySQL through distribution package manager,…
This page includes an infrequently-updated list of interesting articles I have read recently and think to be significantly impactful. Computer Science - General These are generic - useful and educational software engineers regardless of what domain they work in. “Worse is Better” - An essay which describes how the “perfectly designed” software loses to…
I recently discovered the concept of distroless docker images. However, this project is quite a few years old. 1 The name may be quite misleading (much like “serverless”) - as distroless images are actually based on Debian (currently Debian 11, Bullseye). However, they don’t contain most of the stuff which is there in standard debian image, which such as all the command line…
Almost every time I see awk in a shell script, it is to extract a particular column - like awk '{print $1}' . Much has been written and said about how the plain text output of command line tools isn’t very flexible. Therefore powershell uses an object paradigm, where nobody understands what is going on. It appears a few tools, like Azure CLI have just defaulted to printing JSON. But this…
Caine: Then why bother? John: Maybe I am wrong. John Wick 4, (2023) It’s been a long overdue to write a post about my past year’s Google Summer of Code (GSoC) project. jnigen is an experimental bindings generator which aims to provide Java interoperability for Dart. It works by generating wrappers which call JNI through Dart’s FFI (Foreign Function Interface). I developed the…
When doing back-end development or just fiddling with SQL, installing postgres the traditional way may not be very convenient for many reasons. This post describes how to run postgres for local development using docker and docker compose. One important advantage for me is getting the latest version of postgres, since I tend to use a stable linux distribution. There’s already some amount of…
I am a weird creature in my friend circle for using Java to do DSA problems. (Everyone else uses C++). I am not that good anyway in Leetcode, so at least I will learn some more Java by doing this. Here’s the puzzle I was attempting to solve: Given a sorted array and an integer x , find k elements closest to x in the array ( Leetcode #658 ). The solution is very straightforward: find the…
This is my solution and logic for Problem 995 on Leetcode. This is actually copy of solution I posted on discussion forums. I find it a little hard to get the initial intuition & optimization from O(nk) to O(n) , and as usual, other solution posts are very terse. So I thought it is worth to explain a little more. Problem statement You are given a binary array nums and an integer k .
I have a parallel programming subject this semester, and as usual, there’s also a lab in which we try and execute small programs (mostly using OpenMP). First program is to find the value of Pi using Monte carlo methods. We have to then measure the performance with different number of threads, and tabulate it. Usually, when we add threads using pragma omp parallel for directive, we expect the…
About A software engineer with an enthusiasm for systems-level thinking and scientific approach to engineering problems. Interested in operating systems, compilers, developer tools, programming languages, back-end development and databases. I have some experience tackling difficult architectural, implementation and debugging challenges. Email: net.mahesh29 @ gmail.com Experience Software…