Now
What I am currently upto.
August 2025
August 12, 2025
I began to dip my toes into android app developement. No, I am not ok.
I've just grown tired of web development. I needed something new to do, without having to
learn a whole new language.
Here is the problem I wanted to solve:
I want to listen to music that I own. Smart phones don't technically have a
dedicated mp3 player anymore. There's apple music and google music, but
those are technically streaming apps that let you listen to music you have purchased
from their stores in offline mode. You don't own it. You don't have control over it.
Now, for some people this is fine. This is not fine for me.
I have tried a few mp3 player apps but they either suck, are full of ads or I can't
justify the cost.
My Solution:
I will build the mp3 player that meets my needs. Ad free, simple, and most importantly,
empower the user (me) to have control and access their/my music.
I have so many CDs and mp3 files that I don't have access to. Maybe there is a simple
way to import those files to apple music or google music, but at this point I don't care.
I don't like the way those apps were developed. Offline listening feels like an after
thought, so I figured, why not just make my own app? I needed something to do anyway.
More on this coming soon. Hopefully.
July 2025
July 11th, 2025
I was playing around with the Java Math library and came across this interesting way to check if an integer is prime:
private static boolean checkPrime(int n){
if(n <= 1){
return false;
}
//check if divisible by 2 or 3 b/c of integer rule (6k + i when < 5)
if(n % 3 == 0 || n % 2 == 0){
return false;
}
for (int i = 5; i <= Math.sqrt(n); i += 6){
if (n % i == 0 ||
n % (i + 2) == 0 {
return false;
}
}
return true;
}
Optimal Prime Checking with "Trial Division"
This is an optimal approach using "Trial Division".
Divisors of a number are guaranteed to appear in pairs at a minimum. For example:
- 28 ÷ 4 = 7, therefore 28 ÷ 7 = 4.
- Thus, the divisors of 28 include [4, 7].
The key insight is that for every divisor d of n, there is a corresponding divisor n/d.
- If d ≤ √n, then n/d ≥ √n.
- Therefore, we only need to check values up to √n, reducing the number of iterations.
Additionally, any integer can be expressed as 6k + i, where 0 ≤ i ≤ 5.
- The forms 6k, 6k + 2, 6k + 3, and 6k + 4 are all divisible by 2 or 3.
- Following this logic, if n is divisible by 2 or 3, it is not prime — unless n itself is 2 or 3.
Neat.
September 14, 2024
I am currently arguing with jdbc client. I have an array of strings that I want to insert into my db as one big string seperated by commas.
idea: ['str1','str2'] -> "str1,str2"
To achieve this, I wrote:
String strs = String.join(",", list); Should be simple enough. Java returns the list as a string as expected, but jdbc insists on entering it into my db as a String[].
UPDATE: Lucky for me using a list wasn't necessary, so I was able to change the data type in my DTO class from
List list; to
String[] arr; and it plays nice with jdbc array data type. Who would've guessed?
August 2024
August 31, 2024
I have a few different websites where I upload my photographs. Some of the images I upload are only 1mb, but I know these files can be smaller with comparible quality and resolution. I decided to start exploring compression algorithms, specifically for image compression. To start, I looked at bicubic interpolation, the slowest algorithm, but one that can yield a pretty high quality image. To compress the images, I wrote a python CLI which takes the path of an image or the path of a directory of images, opens the image file using cv2, reduces the file by a factor of x dependent on the resolution and then scales the image back up using bicubic interpolation. The CLI also gives the user an option to do a simple reduction, which uses a function available in the PIL(Python Image Library). Why Python? I chose to write it in python so that I could write it fast. I don't have a lot of experience in C or C++ and I didn't want to write it in Java. I am not a professional Python Programmer, so I don't always care about writing things in a pythonic way. I wrote this CLI and the algorithm in python because I just wanted to focus on the bicubic interpolation algorithm itself. You can check out the repo on my github. I plan to follow this up with a proper blog post eventually.
August 24, 2024
Began development on 'Simple Payroll', a web app built with Springboot to manage several business tasks for my client. I decided I wanted to do a bit of consulting on the side to supplement my income and diversify my skills. I figured it was a good way to get paid to learn new skills all while delivering software that somebody will actually use. The client wanted some software to handle many accounting related tasks. Yes, there are many products out there that already do this and more, but my client wanted something custom and something he could keep forever. No monthly subscription fees. I built an MVP, demo'd the prototype, and the client was on board immediately. Now, for the next 9 months, I will work on this app for my client, and I will get paid monthly.