Totient Calculator in C

Rewrote my totient calculator in C. It’s pretty much a direct translation of the excrement I wrote in Rust. Be gentle, there are obvious points that I miss completely in C that veterans in the ancient language would scoff heartily about. I don’t yet know what the hell a struct is for or the extents of threading. All in good time.

So here’s my uncommented and fully unnecessary data type usage.

[Read more]

Chamfer Calculator in C

I’ve converted the Rust Chamfer Calculator to C for shits and giggles, and to learn something new. If you have any recommendations on tutorials for C socket programming, please feel free to contact me. Without further ado, here’s my garbage:

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

double to_radians(double degrees);
double chamf(double angle, double depth, double bore);

int main(int argc, char *argv[])
{
        if (argc < 4 || argc > 4)
        {
                printf("Usage: %s angle depth bore\n", argv[0]);
                exit(0);
        }

        double ang = strtod(argv[1], NULL);
        double dep = strtod(argv[2], NULL);
        double bor = strtod(argv[3], NULL);

        double cha = chamf(ang, dep, bor);

        printf("Angle: %f\nDepth: %f\nBore: %f\nChamfer Diameter:
%.16f\n", ang, dep, bor, cha);

        exit(0);
}

double to_radians(double degrees)
{
        return degrees * (M_PI / 180);
}

double chamf(double angle, double depth, double bore)
{
        return (tan(to_radians(angle)) * depth) + bore;
}
[Read more]

Upgrade Complete

After a brief downtime, I’ve re-provisioned (due to my incredibly cheap VPS situation) and I’m back up and running with a much newer instance and updated software. I’m also changing distros to experiment with resource management on my incredibly small allocation.

I’m sure it’ll work out better than Fedora Core did. FC seems to be a bit of a resource hog.

I’ve been trying to shoehorn Rust onto my FreeBSD 10.2 x86 machine, but it just isn’t happening. I can’t compile it. There are no functional x86 packages (only x86_64), and I’m pretty much giving up on having remote access to a Rust compiler of my own. Oh well.

[Read more]

Goofing off

I’m being a slacker. Don’t you judge me. I have my blog set up that I can update from anywhere, albeit tediously. Still cool, though. What isn’t cool is having to rely on Pandora for music. Also, this fucking sinus infection is horrible. I have Fallout centaur embryos flying out of my face with every sneeze.
I’m ready for bed.
It looks like I’m headed for another boring week where things still haven’t picked up to feel like actual work. Oh well. At least I’m gainfully employed.
I miss my future wife every day. When did this turn into a “stream of consciousness” entry?
Blah.

[Read more]

Updated, Upgraded, All Set

Jekyll 3 is something new entirely. My original template didn’t play nice. Completely lost my nav bar in the header and in the footer. That was no bueno. I’ve since adapted to just using a ‘_data/’ block to contain my navbar YAML. I guess that’ll work, though I suspect my install may be broken. No help was offered by #jekyll just yet. We’ll see if maybe I can get some info from them.

[Read more]

Connected

I’m almost restored to my former glory. Bought a cable modem, shot some textual nonsense to Comcast in India, plugged everything in, and now I have my updated router and modem. Everything is all set for $30 in services and $50 in extra hardware.

Not bad. The only task left to tackle is getting my FreeBSD machine connected, upgraded, and ready to roll. I don’t feel that my setup is complete without remote access.

[Read more]

The Linux Party

Taken from http://www.trollaxor.com/2001/12/linux-party.html.

First, there was a plan: how to bring together the two different development groups at work? My boss said there was a sort of tension he thought could be eased by some social interaction. Not easy. Both the different development groups despised one another, each thinking its “art” was more important and eloquent than the others'.

First there was the XML group. They worked on our website, documentation and formatting, and simple configuration apps and some front-ends to Java stuff. They also did our web sites. They used CSS, HTML, XSL, JavaScript, and a bit of Java. They typically dressed casually, drank coffee and tea, and liked to work straight from the spec: no ”Learn XSL in 30 Days” books were to be found in their cubicle farm.

[Read more]

Ink

My New Tat

So I’ve got some new ink. Figured I’d show off. I’ve had the idea for it rattling around in my head for two years or longer.

The first part, “Pia Fraus”, is latin for “Pious Fraud”. It’s basically a catholic phrase that entails the idea that a religion is justified in lying and being unethical so long as it preserves the religion. The second part, “Temet Nosce”, means “Know thyself”. It was initially proposed as a warning to readers to know their limits. It has that meaning to me, as well, but also means to me that I should stay true to myself. Then, of course, there’s the dead tree.

[Read more]