I Think I’ve Died to Death

For the last month, I’ve been busy. Stupid busy. Retarded busy. My employer has had me working 10 to 12 hours a day six days a week. Sometimes seven. I’m doing the same job I had been doing prior, just for a better situation. I can actually afford to live, now. I’ll be upgrading the accommodations for my family, upgrading my car, potentially upgrading my computer, and hopefully in the next ten years I’ll be upgrading my career as a professional metrologist.

[Read more]

Chamfer Calculator in Rust

I’m going to go through my old TI-82 calculator and rewrite my most useful little trig tidbits in Rust for everyone to use. The first one I’m going to reiterate will be my chamfer calculator. This is pretty handy if you ever have to measure chamfer diameters in a production environment. You can quickly calculate the greatest diameter of any given print dimension chamfer with this tool. It ought to compile on the latest version of Rust without warning. Should. I’ve hit my Ballmer curve, so I’ll just throw that warning right away.

[Read more]

Euler’s Totient Function in Rust

Figured I’d write a much quicker varient of the Totient Function in Rust. Excellent language. I don’t have a grasp on the finer points available to Rustaceans, but I can hopefully put concurrency and whatnot to use at some point. The code is quick, but I know it can be quicker if I just spend some time putting it together.

This is the quick crap I dreamt up:

use std::env;

fn gcd(mut m: u64, mut n: u64) -> u64 {
   while m != 0 {
       let old_m = m;
       m = n % m;
       n = old_m;
   }
   n
}

fn totient(mut a: u64) -> u64 {
    let mut y = 0;
    let o = a;
    while a != 0 {
        if gcd(o, a) == 1 {
            y += 1;
        }
        a -= 1;
    }
    y
}

fn main() {
    let args: Vec<_> = env::args().collect();
    let n: u64 = args[1].parse::<u64>().unwrap();
    let m: u64 = args[2].parse::<u64>().unwrap();

    let x = (n..m).collect::<Vec<u64>>();

    for i in &x {
        let o = totient(*i);
        println!("{:?}, {:?}", i, o);
    }
    
}

The code should compile with no problems. Yes, I realize that u64 is overkill. No, my code will never require unsigned 2^64 integers. It may be a quirky choice, but whatever. Change to u32 as needed, though I’m sure it won’t be a problem for anyone.

[Read more]

Euler’s Phi Function in Ruby

I’ve taken a few implementations apart and I’ve tried to figure out what the intention of Euler’s Phi function is. I think I’ve got it. I found an interesting implementation in Ruby here but it wasn’t satisfactory. Sure, the code was incredibly minimalistic, but it was also recursive and overflowed the stack for anything over 7704 iterations. I didn’t like the inflexibility of it. So I rewrote it in big ugly moron code that isn’t recursive, but is capable of scaling to some decently large totients. I might see if I can code something similar in Rust, just for shits and giggles.

[Read more]

Updates. Downdates. All-around-dates.

This is more of a ping than anything. Not that I really need to ping anyone or anything. Figured I’d let you know I still breathe. I’m still around, I’m still cooking up things to contribute, despite my complete lack of available time in which to do it. I have kids, I have gainful employment, and I have a significant other, so don’t expect much in the way of me contributing to this blog. Not that I’ve ever continually contributed to this damn thing at any point- I’ve mostly excised bits of my brain and shat them into text, all for you to analyze and use as needed.

[Read more]

Begone, ye Bastards!

I’m writing this because I’m bored. I’m downloading old humble bundle games via a not-so-quick WOW cable connection being borrowed. It’s a relaxing day. I’m not regretting being bored at all. It’s kind of nice to feel unplugged in some ways, yet still plugged in other ways.

I’m ready to pass out. I feel physically exhausted for seemingly no reason at all. It’s almost as though carbon monoxide is seeping into the atmosphere and replacing slowly oxygen and carbon dioxide as the typically bonded gases in my hemoglobin. I just feel energy escaping my body without the typical expenditure you would expect.

[Read more]

Happy Memorial Day

Happy Memorial Day. Now that’s out of the way, I’m going to ramble and rant about atheism.

I killed your god. I killed every single deity you could ever believe in. More than that, I truthfully am not the original cause of death of your deity. Myself, along with everyone who has ever been a reasonable and rational human being has had stake in destroying your spiritual beings.

I had read recently on Salon that there are Christians in the world who don’t believe the biblical story of Noah is factual, along with a host of other traditional stories, and relegate almost all of those “events” to basically being metaphors. Those same individuals don’t necessarily take the bible at face value as being a text of history, but entirely of religion. They’re the ones Salon claims “should not be discounted” with the rest of Christianity. I disagree. I don’t see anything written thousands of years ago by dehydrated nomads as having relevance to modern life. God is easily disproven. More than that, why should the burden of proof rest on the atheist when it comes to spirituality? That’s exactly like saying “Unicorns exist. Prove me wrong.” That isn’t logic. That’s fallacy, and that’s all Christians have. Fallacy is their bread and butter.

[Read more]

PC-DMIS and Sentinel HASP

I recently found myself having to deal with Sentinel HASP and Windows 7. Specifically, in installing a PC-DMIS version prior to 2013. Windows 7 has this ungainly habit of installing the most recent drivers available for any piece of equipment plugged into it. This is mostly an alright thing, but sometimes it creates problems when newer drivers break older software.

Son of a bitch.

So I attempted to install this older version of PC-DMIS, but it wasn’t communicating at all with the HASP dongle via the new driver. It wasn’t having that at all. I attempted to run haspdinst.exe -i to install the old driver, to no avail. I tried uninstalling the most recent driver using Device Manager, haspdinst.exe -remove, and nothing worked.

[Read more]