I use the GNU Emacs Calc, an RPN calculator, exclusively unless I’m away from a computer; as a programming, scientific and general calculator. This is my cheat sheet for my oft-used functions. There’s also a printable, broad-coverage official reference card (PDF). True to Emacs’ documenting tradition, the manual documents all features extensively, with examples too. Programming Binary Set binary…
Flash memories comes in different forms and use different interfaces to connect. Pen drives use flash memory while SSDs use solid state storage. SSDs can be interfaced with your mobo1 either through SATA or PCIe; M.2 is actually a form factor (standard stating about the size and form of such drives which are small and rectangular; looks like RAM modules compared to the 2.5 inch drives), connecting…
Problem At times we might need uniqueness constraint for a common column across tables. Let’s say we’ve a bunch of products a retailer sells e.g. books, toys and dresses. Each item-kind needs its own table as they’ll have different inherent properties e.g. {author, pages} for books, {weight, colour} for toys and {material, fit} for dress. We’ve two requirements business-wise: A unique item code is…
I completed Advent of Code (AoC) 2018 today. It’s a puzzle jam: yearly from Dec 1 to 25 a couple of puzzles are published everyday. It’s popular in geek circles; folks solve them in winter when business is dull. Leaderboards are filled with people who solve them well within the release day. There aren’t any restrictions on when or how you solve these puzzles. This piece shares my experience for…
TL;DR Any program can have two classes of issues: Runtime problems: situations programmer foresaw and handled; expected. E.g. invalid inputs, no access to resource, unreachable network, … Bugs: programmer mistakes; unexpected. E.g. buffer overflow, access violation, … There are different tools to deal with each; don’t conflate one with the other. An assertion is just a validation of a programmer…
Here’s a curated list of learning resources I usually recommend for self-studying the domain of Computer Graphics. Introduction Learning graphics concepts isn’t the same as learning a rendering library; the latter is usually not very beneficial since a new library eventually replaces/takes over. Strive to learn the theory behind the domain, not the tools or their idiosyncrasies. Once you…
You can’t learn everything from scratch practically; you need to stand on the shoulder of giants. These articles were very insightful; either it’s a clear writing that shares my already-held belief or something that reshaped my thinking. I’ve collected them over the years. I’ve given short descriptions to most links. It’s a bookmark page updated once in a while. By Authors Eric S Raymond Renowned…
I neither have a micro HDMI adapter nor a dedicated display for the Pi. I just want to use it as a server. Thanks to Raspbian for providing a simple way to auto-enable SSH on boot! I prefer the leaner, manual approach over NOOBS, the more popular option. dd Raspbian’s image on to a new SD card To auto-start SSH service on boot touch ssh in /boot partition Insert SD card, connect ethernet cable…
My root partition had unused space while /home was starving. I needed to resize both without data loss. I’d foreseen this and created my Linux partitions using LVM while installing Arch 😇 . Since operations here involve resizing /, boot from Live USB and then perform them. Also make sure the USB is UEFI bootable; otherwise it’d mean changing BIOS settings to enable Legacy Boot. This may lead to…
Becoming a good programmer doesn’t happen in a day. Like most fields, you need grit more than intelligence/smartness. Guidelines Write small toy programs to prove yourself right / wrong It’s easy to get lost in the details of a large project; it’s just noise A toy program is a simple way of filtering signal from noise Document what you learn Sprinkle enough comments; they’ll help you later…
Git has its oddities with unusual commands and flags. I keep learning something new every now and then. A decent understanding of basic Git concepts is a prerequisite. show time! The easiest way to see the diff introduced by a reference (fancy name for commit) is not git diff! git show REF # changes introduced in a particular file by a commit git show REF -- path/to/a/file It shows details about…
See Arch Linux Installation for installation notes. Network In the newly installed Arch you might notice that there’s no network connectivity. Fix it with iwctl. iwd seems to be the simplest and fastest for wireless network on Linux. It’s self-sufficient having a built-in DHCP client. Manually fixing /etc/resolv.conf with some standard DNS addresses should get you online. However, I prefer…
I had a great first experience participating in a game jam – 5th Alakajam. A three-day game jam where we1 wrote a primitive, real-time tactical strategy game: Sneak Out. The game is playable within a browser, thanks to raylib and WebAssembly. Sneak Out! from within the browser I’m a person with a decent degree of analysis paralysis. A code jam was the perfect antidote to kick me out of my…
Basics like initializing (a repository), staging and commiting files aren’t explained here; they simply make sense; no ‘Aha!’s there. Moving references, branching and merging — coupled with Git’s arcane command names1 — are the confusing parts. Basics Git is a distributed VCS; each repo can be both a server/client Honestly, git (sub)commands are just graph manipulating commands Every…
I tried upgrading the firmware of my old iOmega 1 TB HDD. Internally it’s a Barracuda LP family, ST31000520AS model Segate HDD. Seagate had released a firmware upgrade for this drive in 2010. I’m around 9 years late to the party! My laptop doesn’t have a CD-ROM drive, also I prefer burning the ISO to a USB stick — why waste a CD, eh? Rufus kindly refused as the supplied Seagate update ISO’s…
Within C++, there is a much smaller and cleaner language struggling to get out. — Bjarne Stroustrup C++ is vast. If you’re beginning to learn it, the internet has enough discouraging words. Just start learning instead of reading about it i.e. don’t learn about C++, learn C++. The innumerable topics might be daunting, but don’t worry. Knowing a few concepts will get you productive. More than the…
An IDE should at least aid with Auto-completion (a.k.a Intellisense) Jump to definition On-the-fly error checks Additionally it’d be good to have Context-sensitive document lookup Show variable and function type Show function description Auto-run gofmt on save Auto-add/remove used/unused packages on file save We’ll get these working for Go on Emacs using LSP. It’s no secret that Emacs’ LSP support…
I’ve a dual GPU laptop: Lenovo Legion Y520-15IKBN; the Nvidia GeForce 1050 Ti Mobile for graphics-heavy (3D) tasks and Intel HD Graphics 630 for rendering the rest. It has an SSD and a traditional spinning disk. UEFI + GPT as opposed to the classic BIOS + MBR combo is preferable. I’m a long-time Xubuntu user but I wanted to try Arch Linux. Here I note my experience in getting this…
I believe resistance is futile if someone is bent on spying on you; there’re both serious and creative ways to go about it. Talking to your processor, behind your back, isn’t the primary or only means. Our’s is a golden age where corporates and government agencies stoop low enough to pry into bedrooms. Did you know that almost all machines1 you own have a processor aside from the one you paid for?
Steps Disable Windows defaults Windows 10 Run → services.msc → Touch Keyboard and Handwriting Panel Service; stop and disable Disable Tablet mode under Tablet mode settings Windows 7 Disable Tablet PC services from the Windows Features list Disable Flicks in Pen and Tablet settings Install latest manufacturer drivers before first plugging in to the system Plug in device and test Enable Force…
Fork? Food!? When you fork1 a repository in GitHub, from your repository’s viewpoint, the one you forked from is called the “upstream”; a term used commonly in the FOSS world for a long time, to denote the original authors (or their repository) of a software. Fork is a concept introduced by GitHub (the code hosting platform) for separation of concerns; Git (the version control…
Here are some of the useful, but not widely known, options of GCC I use periodically. Output preprocessor output, assembly and object code gcc -save-temp=obj -o hello main.cpp outputs the following in addition to hello hello-main.ii: annotated output of preprocessor hello-main.s: assembly hello-main.o: object code GCC Build Specs gcc -dumpspecs Gives the specifications with which GCC was built.…
This note is a guide to setup auto completion for C and C++ modes in Emacs on Windows with minimal manual work. We need Clang, Irony and some Company; we additionally require CMake and MinGW for building something small. Although there are many methods of getting this working, this was the most performant and least time-taking solution for me, so I’m documenting it here. The general…
Ingredients CMake MinGW compiler (one of MinGW, TDM, MinGW-W64, …) Lua binaries LuaRocks setup binaries ZeroBrane Studio Steps Involved Make sure the commands cmake and mingw32-gcc are accessible from a general Command Prompt Install CMake; straight-forward Install MinGW64; choose i686-6.2.0-posix-dwarf-rt_v5-rev0. Both archive and installer works. mingw-w64 project’s MinGW only has gcc.exe…
I did quite a few things to get this blog up and running the way you see it now. Steps I Still Remember Install Hugo; just extract and put in PATH — can’t be simpler. Create a dummy site using the Quickstart guide; straight forward. Install Ghostwriter inside the themes directory. Hugo recommends that customizations be done outside the theme’s directory tree to clearly…
Many static site generators are coming up these days; 175 and still counting. Apart from the prime selling point of content creation from the comfort of your favourite text editor in Markdown, most have a wide gamut of themes to choose from. You are free to remix the theme to your taste however you see fit. Want to change the line spacing and paragraph alignment? Sure thing! Don’t like…