Max Garten's Fall 2019 Journal
coding is witchcraft
Class: (aspiring) Wizard
Strength: 10 (-0)
Dexterity: 12 (+1)
Constitution: 11 (+0)
Intelligence: 12 (+1)
Wisdom: 15 (+2)
Charisma: 16 (+3)
Backstory: A man who spent his younger years being possessed by a sloth demon, now seeks to rewrite his past failures in a better light. Although his stats are geared towards a Bard, a voodoo witch priestess cursed him with a terrible singing voice and eternally sub-par dance moves, so that one's out. Thus after shaking the demonic entity which plagued him, he resolved to go back and do what he always truly wanted, become a wizard.
Honestly: Enough with the dramatics (for now.) I am a man who after majorly botching almost the entirety of my academic career in the past, due to self-destructive tendencies and generally being a fool, now hopes to right those mistakes. After spending almost 6 years doing manual labor (kitchens, factories, welding, unions, to list some) I came to realize I loathed what I was doing. To be a cog in a machine that you despise is a fate worse than death, in my opinion. So for the good of my mental health I have come back to an institution where knowledge is cherished instead of attacked. I have an amazing wife who somehow puts up with me, a wonderful son who loves almost every form of (board/card/video) game he can get his hands on, and 3 fat cats. I spend far too much time researching and world-building for Dungeons and Dragons, have scorched my retinas with enough anime and manga to probably earn me the 10,000 hour mark of being an artisan-level nerd, and my ultimate goal is to make a robotic body so I may slough off this mortal coil and transcend to a new form. That, or make Gundams so the world can put an end to silly conflicts over resources as if we are basic apes, and start fighting about philosophical nightmares in the cold, vacuous Astral Sea.
Filler text- your entry goes here; remove this line to receive full credit.
I leave excuses for those inclined to think they're somehow not at fault, and for that reason I can succinctly say, I messed up. For the first time I'm imagining I'll have to turn a program in late, as I keep getting an error that I cannot begin to wrap my head around. Organizing my thoughts well enough to compose an email has always been a challenge that i prefer to avoid seeing as how I write, and think, like a madman would. But I've come to realize that's my folly, as here I am hours away from a deadline without the faintest idea of how I can go about beginning to solve my problems that were caused by my negligence and procrastination. Honestly, it sucks. I will endeavor to never have this happen again as it's not a feeling I'm particularly comfortable with. However despite me not being able to finish this program tonight I've had a lot of fun with fun with flags (go figure.) The idea of making a loop to generate shapes to me was at first something that seemed wildly harder than it actually ended up being (I don't know that it'll work as it compiles fine but always come up with the error of “error loading img” so i can't actually see). specifically in the case of circles, making multiple that descend the side of the flag (as mine are supposed to) simply adding to the y value each time the loop processes at a constant spacing will promote (what i assume to be) a relatively neat pattern. Polygon command gave me a bit of pause, and it took me a long while to realize you had to specifically name each x and y point of the array before it could have a basis to go off of. anyhow, I guess I need to learn up more on these argc and argv bits as I don't understand them at all. Base 9 letter division wasn't all that different from base 10 or 8 for me as i never had an instance where a value was borrowing and being borrowed from so all of my numbers ended up being pretty clean to figure out. It seemed to be excessively short, my hope is that base 12 will kick my ass, I kind of miss having a brick wall to hit my head against (except in the case of this program where i genuinely don't even have a faint clue as to why it's giving me this error…)
that's all, bit of a bummer of a journal entry, but I guess I'm a bit of a bummer in terms of a person so it all equals out. the universe is a lot more fair than many of us would like to think…
The end of October… hold on… by my calculations, that's not a lot of time left in the semester.. where does the time go? Well, that existential dread aside let's get into the dumpster-fire that was cnv1. This isn't to say the project in its parameters or instruction was bad in itself, but the ways and lengths that I will go to to subconsciously sabotage myself from seeing an easy answer are absolutely baffling. Let's start with evaluating the ways so i can look back in the future and hopefully one day go “heh, I remember that, sure am glad that specific hell is purged from my being,” instead of grim horror of realizing I've stagnated. Due to hearing about structs last week (and thinking they sounded interesting) I convinced myself that the optimal way about going at this was to create a bunch of structs and pack some of em with an array here and there. Why? I honestly… I couldn't name a reason other than a stray thought, that i let myself get hung up on. So after spending plenty of time realizing that all I had to do was what cnv0 did and that can be done without structs it just needed another loop to go from bound1 to bound2, i headed off to do just that. Mistake number 2, in putting another loop I thought variables for indexing were clashing so i made like 4 variables to try and drive these loops, to avoid overwriting the value of a bound was my reasoning, then i realized no matter what I did I never changed the damn upper bound limit (nor lower in fairness but I could have without the use of an index.) So yeah I slapped a lot of unnecessary values in there, then ditched 'em because of how convoluted it was for no functional purpose. so yeah, in the future I hopefully remember for loops will only ever change 1 value, period. Somehow didn't get tripped up by not accounting for a NARY counter reset, however my overthinking overtook me and instead of realizing the reset can be thrown in right after the display of the value (because it's no longer needed once that task is performed) i tried slamming the whole thing inside another loop to have that loop solely reset the nary counter. then realized I was gonna make some serious exponential growth happen and then caught my pretty obvious oversight. So yeah, that was a trip. However most of this was caught without any need for a compiler to scream at me that I'm an idiot, I'M the one who can catch that I'm an idiot and I do take just a bit of pride in that fact. So hopefully I can “debug” myself of these damn errors one day but until then I'll just keep plugging along. pctA seemed difficult and imposing when introduced because it is a new change in perception, however personally I kind of enjoy those kinds of challenge (hence, why I started liking these damn letter divisions in the first place) so I went in with an open mind. and assuming I did it right, which the verification confirmed for me, I found it actually really easy. But maybe it just seemed that way due to it only being 8 variables. who knows, either way, i look forward to base 12.
cnv0 - a project I will look back on fondly as, as the one project where I never needlessly over-complicated something. through not having the ability to input this program as code (in Canada) I had to rely on what I actually knew and tried to work out how the computer would try and rationalize what I had put. It was entertaining in its own way, and yielded me with a paper code that I would later, upon returning home, slap into lab46 and compiled cleanly first shot. Not only did it compile, it performed the specifications of cnv0 to what looked DAMN close to being perfect. a simple for loop and a couple if statements can compare the results of a remainder division to a counter and tick up an assigned counter and then base the display off the results of the counter. Upon comparing it with the cnv0verification, i encountered nothing but errors for my side of the code. Puzzled, I figured I'd ask Haas Delgado about it during next class. After some much needed help, that I was running the verify code in the wrong directory (rookie mistake on my part) my code actually did match up almost perfectly. Sans, values 4, 9, 25… numbers that my original code didn't take into account the fact that if something is able to be square-rooted it would only tick the counter up, once. So i had to adjust to account for that but thats just a || in the statement following an if.
After so much time of scratching my head over pct8, a simple observation discovered by Haas, Lord of Letters, unraveled almost 2 hours of work that yielded almost no results into narrowing down juuuuuust enough that it started a cascade. O < S, 3 little characters, made 2 hours of toiling with no real discovery, turn into the immediate falling into place of every single digit. You have NO IDEA how frustrating this is to me, albeit it is also really fucking cool. So I'll focus on the fact that it is neat that something so small can cause an effect of that magnitude. pct9 I was able to accomplish during breakfast this morning. apparently we'll be shifting the meta, so to speak, of pcts to base8 now, this challenge is welcome.
I always say I'll get to these sooner but never seem to then actually do. Ahhh well, c'est la vie.
bcf0 was a neat introduction to the array type variable. Very useful for storing multiple values, so long as you display out those variable correctly. my hardest part in the whole project was figuring out how to store the numbers needed (0 or 1) into the array and then display them in one fell swoop. I learned, thanks to some much needed tutelage from Haas Boss, there isn't a way to do this in one convenient step and that my thinking of making parts of a program try and do too much simultaneously would be my ruin. After a little evaluation (and some more help) I realized the best way to make programs work, in general, is to break up the steps and make sure they their very niche job well and leave other steps to other parts of the program. In this projects case; keep one loop entirely for writing your variables into the array, and then after the array has been fitted, use a separate loop to display it. this way the loop to write the binary value into our array can work backwards (as is needed, described in the program specifications) and then can be viewed in the correct order after it has been done but before the next cycle of the loop kicks in, meaning the loop for display should be in the loop encompassing the loop that writes to our array and not in inside this section at all. epf1 is something like a DLC skin pack for bcf0, that instead of paying for we had to code. The primary function of the program is the same but instead of having to worry about displaying the values to the screen you must figure how to display to an 10-segmented LED instead. Luckily this allows for most of the parent code, bcf0 to remain the same but change the display to fit the Pi kit. this is done by writing the values of the array in binary (as bcf0) would do, but then using if statements to translate “if array[x] == 1 turn on, if array[x] == 0 turn off” which can be done using wiringPi.h library (after initializing the pins to output mode) by switching the pin assigned to that array[x] to either HIGH or LOW. unsurprisingly i got this backwards as well, HIGH is actually OFF as the electric current meets a stalemate being powered from 1 side and having HIGH power on the other, with nowhere to flow the current doesn't pass through and stays trapped, keeping the light off. so, don't make the same mistakes I did, remember LOW is ON and HIGH is OFF if current is already being supplied to the LED.
Canada, a land of maple syrup scented, Molson-chugging, good-natured yahoos; and as I came to find out, scads of problems trying to access American sites. As well as our beloved lab46. So unfortunately I was without the ability to do anything technical at all on my vacation, that being said I had what needed to be done for the project so i set out to writing the code out by hand. as it were, I've input the code I transposed from my handwritten copy in to lab46 and found that it works; however my guess is not the way it is intended to for the project. the only reason i say this is because after attempting the verification command in the cnv0 subdirectory all of my answers were displayed as ERR, however doing them manually by executing the program yielded the correct results.
I was foolish in also not already having written down my letter divisions, as previously stated attempts to access lab46 through PuTTY was a failure in the savage northern tundra that is Canada. Much to my chagrin, I had transcribed my pct8 to paper on a separate sheet, hit a colossal mental block, resigned myself to starting fresh after a couple days of mental cooldown, went to view it in Canada, and after 6 failed attempts realized I had been an idiot to not at least bring that with me.
But I saw a bunch of birds, and had a great time with Bree and Coop (my wife and son, respectively) so all-in-all I'd say it was a rousing success as far as vacations can go. And there's no point in being down about what you can't do, you just have to focus on what you actually can do. So I just have less time to complete these, hopefully pressure truly does make diamonds in this case.
After enough letter divisions these pct projects have become far easier to understand; after seeing enough patterns repeated, recall of that information becomes much easier and thus drastically reduces time it takes. the little tricks become ingrained and eventually I'm assuming you'll start to develop a “feeling” for certain things at first glance, once you get to a high proficiency with doing these as I'm assuming our wonderful cyborg overlord Matt Haas has. But these are just usual signs of gaining proficiency with any skill, and for the longest time now I've been a bit misguided in thinking these were simply exercises to teach us how to figure out (a problem; in this specific situation-) math with limited knowledge, and to be able to identify patterns. But instead i think i've finally caught how important a seemingly lesser part at first glance of this task, is actually the more important to me, and this may be just personal. It's ultimately not a project just about finding the answer but also conveying how you got it. In the order of processing information my mind always prioritized finding the values and making sure they were right and then quickly tried to put it into “sub-par, almost-human coherent thought” to show it was I who had figured it out and didn't somehow just cheat or bullshit the entire thing. But after writing my solution a day in advance, and then rereading it the next day i found it read like a madman had been gibbering away while someone transcribed it. And then it hit me, not only is the critical thinking aspect needed in finding the values in the problem, but it's also needed to express your thoughts to another in a way that is informative and cohesive. informative is something I think I can accomplish regularly, however my stream-of-thought default style of writing can lead to unnecessary repetition, and overall detracts from the presentation of my information, but it's been my own personal ruling of “that's just how i present myself and other's can deal with it,” and albeit that's gonna stay my ruling for most scenarios, i now see that articulation of an abstract thought process is also a form of critical thinking.
mtf1 was a real bastard to figure out at first, had to untrain my brain from defaulting to how it always worked beforehand, that is to say, seeing a table and saying “oh thats a table” and instead remembering “this is a series of output rows with consistent spacing to simulate a table.” not fun, at first, but after the first headache when you really begin to understand that it's just variable rows being printed after a header. after a quick loop to display header, you can notice the main for loop should be accommodating of rows, and once you know rows are tended to, next up is columns. columns have their own set of problems as this is where you must put your determination of what calculation is being done, a process made simpler by a bunch of if statements. once you know rows is a foor loop encapsulating if statements to choose the calculation and that then the columns must be displayed it starts to line up. however, REAL bastard to try and figure out at first. Personally it took me far too long to figure that out..
mtf0 proved to be an eyeopening experience into how naive my understanding of the actual coding language is. for char type variables, when specifying in the program, you need to use single quotes around the character otherwise the program won't understand. such as
char SUMFIN = + char SUMFIN = '+'. as well as needing to remember to use parentheses inside the condition of an if statement if you want to do a piecewise && or ||. that aside, I found the logic for this project rather easy to grasp, if statements scan for the char type from the input and then perform the specified for loop according to the input. really wasn't too terrible to figure out. If anything most of my setbacks in this were from syntax and spelling rather than the problem or logic. which allows me to see I am in fact making progress with this class, I just now need to focus on other areas. Namely, syntax and typing more accurately.
I was worried that my atrocious solution to last week's pct was the reason i got bumped down to intermediate level this week, however i was fortunate enough to overhear a conversation of some peers outside of class about how the difficulty drop was to alleviate some stress in order to focus on mtf0, which is understandable and i appreciate. however after completing a certain level and having to go back down, the problems seem
too easy. i found very little challenge in this week's pct, but maybe that's just me and i should keep my mouth shut as not to irk others. Albeit if anyone besides myself reads these I would be happy to help in the very select areas that I can be of any assistance. I swear, I'm actually much nicer than I look.
project dow0, what a way to hammer “if” statements down. despite having to type out somewhere in the neighborhood of 20 of these devilish little statements, i found this project rather refreshing now having a better understanding of how to take input, extract parts of it (to which, if i could build a church to the int variable type for how insanely easy they make that task i would. marble statues and stained glass windows for that blessed variable type,) store the extracted values, and what in odin's name stderr finally does. and i've finally found a commenting style that suits me both in terms of aesthetics as well as helps me keep organized. All in all, the only part that was even viewable as “hard” was more-so tedious, in having to type out almost 2 dozen if statements. i looked at the problem of how to determine what multiple of 7 would be best to subtract from our computed value for the final part of the math and yet to no avail did I find a better way to, than a series of if statements repeated ad nauseum. i wanted to work an if/else statement in there somewhere however i couldn't find a proper place without it messing with the other parts of the function or looking entirely out of place. And albeit, Haas Boss has said multiple times it's folly on our end to declare a variable without initializing some value to it i tried my hand at global variables this time around and found when i initialized them outside of the main it returned undesirable results. that being said, declaring but NOT initializing the variables was how i ended up going and it worked out to favorable results. (i will say too, i did make some more tweaks in the time i spent editing the code wherein i un-initialized or solely declared the variables and this yielded better ends. so my method of determining if this was the sole flaw that was giving me problems, is flawed in-and-of itself. maybe someone else had a better time also initializing them outside the main.)
On a completely related note, pct's continue to kick my ass right when I begin to think I'm getting the knack for them. this week my solution was almost entirely via process of elimination, moving slowly and evaluating sections of problems with multiple answers over and over and over until i started to think maybe life truly has no meaning, maybe everything adrift in the Astral Sea is arbitrary at best, yearning for purpose with absolutely no idea what to do with such a thing if they even had it.. and then before i knew it i was staring at a mostly crossed out matrix of numbers, knowing my stars had aligned and that if I hadn't used the matrix to fill out what a number can't be then i would still be lost in a void of contemplative platitudes. now i just have to figure out how to explain how i arrived at my answers…
I would first like to preface this week's journal by saying that I was wrong in the case of the C Book; where I have in the past stated that I did not care for how it read nor presented information, upon a second read barring slightly better knowledge of the material i can see the first time through reading I wasn't truly paying attention. However i'm someone who will never be satisfied having been told something in only 1 way from a single source. and upon looking through a lot of other resources to see if someone can “say it a better way,” i would refer anyone who reads these to check out codeforwin.org, it's nothing special just informative and user friendly, more resources can't hurt.
Speaking of resources being helpful, for the first time i turned a project in days ahead of deadline, thanks to a plethora of lovely resources. Specifically in the case of format specifiers (%hu, %d, %c, etc.) I can't figure out if that's something most code writers just know or have their own dedicated resources for. maybe some of 'em have a pocket journal with bits and fragments in the way that straight up wizards lug around their tomes. the fact that int variables hold no remainder when divided (specifically using the / command) tripped me up at the beginning of trying to figure out how to separate it until browsing some resources (codeforwin) i saw the % command which divides and returns the remainder and suddenly the entire thing fell into place. just ALWAYS remember to put a semicolon at the end of the command line. Seriously, throughout the 3 codes we've written in the past week i've forgotten a semicolon in each and every one. but besides minor syntax problems such as the semicolon problem, my unease about the strange world of computer language has subsided considerably.
Speaking of errors, after trying my hand at a game of “guessing at ANY point of the letter division problems,” i can succinctly say, it's not worth it, don't even bother. Seriously, if you make even 1 assumption, as i did (2 or 3 different times…) you will more than likely get incomprehensibly lost, just stick to what is 100% known and when you feel like you've hit a wall, plug some values in, it'll work wonders in helping whittle down on the possibilities of the values you don't yet know. And in case anyone hasn't seen a peak behind Haas Delgado's artisan abilities in letter division I would strongly recommend 2 things; 1) go ask him for help sometime, it's a very pleasant experience, he only took 1 finger for some much needed guidance. a steal, as i would have gone up to 3 fingers and 2 chickens, but that's neither here nor there. 2) FREAKIN GRAPH PAPER MAN. you don't have to bother to write 0 - 9 ten times like some sad Bart Simpson parody, just block out a 10 by 10 square and give it a letter key on the side (could do a number key on the top or bottom at well if you wanted some extra help) matrix made in approximately 8 seconds and i can guarantee it'll look cleaner too.
I find that after having read Unix for the Beginning Mage, a slew of opportunities unfold for you in the lab46 terminal. Navigating around has become a breeze and jotting down a quick list of commands makes reference painless. The tone of the writing is fun enough that I may even bother to read it again, I'm a big fan of dramatic writing and Joe Topjian brings it like he's trying to convince you Unix will open a whole new world for you, one of fantasy and magic. It's taken me 3 weeks to get any semblance of bearings in this class, but after finally getting to a point that I feel comfortable with navigating this hell, I realize Joe Topjian was right. Being able to see a random command and figure out “oh so the argument can also rename,” or figure out immediately if it's in reference to a file or a directory makes everything exponentially easier in trying to follow the Haas Boss as he zips about. I figured in the past a few times he must have been speaking aramaic and I just didn't know that was a prerequisite for the course, but the great sage Joe has bestowed upon me the tools to learn. Can't recommend this thing enough.
I'm not entirely sure how I managed to do it but in my looking for pct1, during week 2, I stumbled upon my pct2 file, transcribed it over to paper, trusted wholeheartedly that I couldn't have failed the simple task of checking my pct1 file (oh how I continue to surprise me…) solved, and submitted. upon looking at my pct2 earlier this week i was met with the same sight of my already completed “pct1” and realized, man I need to double-check myself more.. Luckily our sensei is a man who understands life is rife with mistakes and has allowed me to do my actual pct1 as pct2. This was both very nice on his part, and on my mind, as after having to smack my head into a wall many times over during solving for “pct1” (the impostor that was actually pct2) last week due to its' intermediate level being my starting point. I found the easy mode of the actual pct1 (my pct2. man this is confusing to have to explain.) to be almost comical in comparison. By my second observation i could figure out 4 of the numbers. Nothing like the painfully piecewise solution of the intermediates. Albeit, i found myself having more fun during the intermediate (pct2, impostor “pct1” in my case,) wracking my brain for some new way to view this thing to align the perspectives so that I can finally hit that electric moment of revelation.
Moral of the story (or tl;dr for some,) in my first encounter with Haas Boss, the moment he revealed to us he does letter division problems for fun and can throw out random commands as if he was speaking a language anyone could decipher, I thought, “Masochist. Who, does all that this is, with so much vigor, but a masochist?” And here I am almost a month later wondering if I too, am a masochist for this lunacy.. Still can't jive with the C Book though… the C part of this C/Unix course needs more effort on my part to comprehend, but some wikibooks are helpful for me (can't vouch for total validity but what i've seen thus far has checked out.) Specifically the wikibook on C Programming (https://en.wikibooks.org/wiki/C_Programming), the Beginning C section proved invaluable in even attempting to understands dtr0 for me and has answered more than a few questions of mine regarding sof0. if anyone reads these, please check it out, hopefully there's something there for you and it isn't a total waste of time.
Letter division will forever be a combination of words that will wreak havoc in my skull, from the amount of time I spent scratching my head about how to possibly go about solving my problem. Through many hours of toil and 2 sheets of scratch work I finally managed to complete the task. Only to discover, to my chagrin, that I had not entirely processed what the assignment was about sans the “think real hard to find the answer” part.
I did the work, found the solution, and was content with knowing I had bested the challenge, only to realize this was a horrible mistake, and in a file pct1.puzzle.solution lies my deadliest trap yet, trying to explain how the madman's chicken-scratch on my page got me to answers. This is problematic for me as I am a habitual eraser of things so that I can put new work in that space, a poor practice i need to correct. This project, albeit very mentally challenging, shows me areas in which i could improve on in overall note-taking as well, which I assume is also a part of the master plan behind whatever painful mind-bender this was. And will try to keep those lessons in mind for future endeavors.
Thankfully through the grapevine it was revealed to me dtr0 was switched to a bonus project as i was going to have to more than likely take a 25% hit in order to finish it up correctly rather than rush and my efforts be in vain. Although the looming shadow that dtr0 carried with it was helpful in its' own right, as the sample code for the project was enough to make me cock my head to the side and make me wonder if I was a masochist for signing myself up for this class and spur me to read and better note-take from Unix for the Beginner Mage and The C Book which has alleviated a sizable amount of my concerns, and for anyone who was putting it off (if anyone besides myself reads these) I would stress that they are of immense value in helping navigate this class.
All in all as this is a journal for me to look back upon and see my past shortcomings allow me to take a moment to tell you, future me, that if you are still mis-budgeting your time and writing your journals and future codes 2 days before they are due, then you will have disappointed a past self that has hoped better for you. And adapt the changes you want into your ethic instead of just noticing them.
8/20/2019: PuTTY successfully installed after an embarrassing amount of time spent staring at the screen wondering if I was still looking at English. Fired that up only to have a miniature panic attack at the fact that it was asking me for a host and a port number. Host is firstname.lastname@example.org, as for port I wasn't sure so I stuck with what was default and my computer has yet to erupt into flames and engulf me so that's a plus. Upon loading PuTTY I realized I had forgotten everything else i needed to do.
Present: After having beseeched our friendly sensei to grant me some insight as to what all I had entirely forgotten, I learned that once PuTTY is booted up and you've connected to the host, slap in a good ol' cd src/c4eng/cci0 to flip you on over to another place where data is stored. This is where you wanna work for the cci0 project. Once you've come this far, simply do a nano file and input the code politely provided to you by Boss Haas (or is it Haas Boss?) Once finished I followed the steps for compiling using the gcc command (which we should apparently be questioning what all it does) and was met with a “you done scronked up” message. Please learn from my mistakes, future me and/or other reader, ALWAYS close your parentheses and and remember semicolons. Polished that up and compiled cleanly, then got to work on the info.text file, kept it short and sweet knowing I would go overboard here. With both completed I submitted them, and then (like a fool) exited the session before committing to the repository. Came back later to commit those, only to log back in and find nothing there, the ls command confirmed… [max.exe has stopped working…] Still not sure what the ever-loving hell I did to those poor things. Anyhow, tried following the steps to set up the repository (cloning, hg commands, the gamut of it all) only to be met with a frustrating amount of error messages and me being too untrained to even attempt to know what hell I hath wrought upon myself. So I bailed, and opted to instead rewrite both info.text and hello.c again, got them both situated/compiled and submitted them again. More than likely I've turned in twice the needed amount of work, however I'm just praying it exists even once out there. I shall take my shortcomings in this project as a sign that I have nowhere to go but up from this point, and desperately need to spend more time trying to make sense of this all. Perhaps a chart would work well with remembering command prompts…