learning Rust Series: Perfect Number

This will be a part of a series on my rust-learning journey. The goal of this post is to document my process of creating a simple program that determine if the number given is a perfect number1. And also list the perfect number until the given number. Imports 1 use std::io; This is the common input / output modules. Function to determine the perfect number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 fn is_perfect_number(n: i32) -> bool { let mut sum: i32 = 1; let mut i: i32 = 2; while i * i <= n { if n % i == 0 { sum = sum + i + n / i; } i += 1; } if sum == n && n != 1 { return true } else { return false } } This will calculate if the number is a perfect number or not. ...

June 17, 2024 · (updated April 23, 2025) · 4 min · 791 words · Kristian Alexander P

Org Mode Workflow

Table of Contents How I mapped my brain to org-mode Basically what I want is The 5 Steps from David Allen’s GTD Method Capture Clarify Organize Reflect Engage What I will need References Using org-mode Keybindings Specific org-mode variables org-directory and org-agenda-files org-archive-location org-todo-keywords Priority Tags Deadlines and Schedules Time-stamp Deadline Schedule The Agenda view. Configuring org-agenda-custom-commands Refiling and archiving Archiving Refiling Things of interest Using org-capture Capturing with templates Things of interest Synchronization, Capture Methods and everything else org-mode extensions Evil-mode org-fancy-priorities org-modern builtin packages saveplace savehist various files configuration How I mapped my brain to org-mode Lately I found that I am in dire need of an effective task management system as an IT support. There are some days where everything is hectic and I’m lost prioritizing my assignments. There’s moment where I was in the middle of doing one task, and suddenly another request / assignment came out of nowhere (not exactly nowhere, but you get the idea). Task management system is also useful for creating some kind of reporting, although this is not the main goal. ...

March 14, 2024 · (updated April 23, 2025) · 24 min · 4945 words · Kristian Alexander P

Literate Configuration with Emacs

Background I’m spending most of my long vacation reorganizing my github repositories, archiving some old repos (mostly android stuffs that I don’t use anymore). And when I’m looking into my dotfiles repos I remember once I’ve tried to use literate programming to manage them. I think one of the difficulties I had was editing the source code block inline. 1 2 3 4 This is how shell code block looks like in /Emacs/ #+begin_src sh echo true #+end_src Editing code blocks inline has many disadvantages, for one, indentation is quite tricky. You’ll never know the whitespaces until you tangled them. I’m sure there are solutions for this problems, but for now I just org-edit-special (bound to C-c '). ...

March 12, 2024 · (updated April 23, 2025) · 2 min · 417 words · Kristian Alexander P