User Tools

Site Tools


blog:fall2015:dm016807:journal

This is an old revision of the document!


Week 1

C prog

Captain's log, we are en route to beginning our journey through C and C++. We press forward through a language of functions, where one must declare, define, and call the aforementioned in order for them to work in our programs. We have encountered strange data types of extraordinary power: char, short int, int, long int, long long int, float, double, and long double. The latter three being used where decimal's are needed. Though we may not yet have machines, we will still attempt to go where probably almost anyone who has signed up for this class, even those who dropped in week 2, or even individuals who have lightly googled the subject, have gone before. We do not know yet where this course will take us, but we move forward into the dark regardless, with our newly learned s/p/fprintf and stdin/out/err statements.

UNIX

This first week I was not of this course, mostly in part because I did not realize I would need it… again. Figuring out how to use the journal, navigate lab46, and checking new projects are becoming second nature. I am working on setting up the class IRC channel, subscribing to the mailing list, and getting used to the repository. I still find it a bit odd that these journal entries are due two days before the project, when often times they are meant to at least partially include things about the project you had worked on. I suppose it could encourage us not to procrastinate, or to revisit old entries to update or simply include updates in future entries. Just need to put the time in and it should all come together.

Week 2

C Prog

Houston we have machines. Standard I/O and Header files soon become a part of muscle memory soon after typing the words nano and a file name. Hands on learning with Lab46, with a variety of hg commands (status, add, commit, push, pull, log, etc.). We've begun learning a new way to do arithmetic, leading into our first project beyond Hello, World. Beyond that an introduction to base 2, 8, 16, and the traditional numeric system we know as base 10. 10 is no longer ten, but one zero, numbers can now also be symbols and no longer hold the same numeric meaning we once knew. Though since this code existed before I did, in some context I'm just now learning the truth. % is an escape character, which denotes a special character when preceding something. Simplifying a number like 110111100001 has never been easier now, being able to segment it off into four three digit segments to express it as 6748 in base 8, or three four digit segments into DEI in base 16. We've learned tricks like a base 2 number starting with a 0 is positive, and a 1 is negative in signed base 10. This coincides with how they line up with base 2 numbers on the table. With ASCII characters in the mix, attention to fine detail on quotes has never been more important. It's all confusing like most things language related the first time around, but it seems to get easier each day I see it.

UNIX

I attended my first class the day before our first assignment was due. Luckily it seemed like a good one to be at, with a lot of pertinent information for the task at hand. Figuring out how to navigate creating, compressing, etc was difficult at first. Once I learned the manual command it got quite a bit better. I was confused at first by the random symbols after having opened each file, until realizing if I sat back I could make out the portions of a horse. Unscrambling them wasn't an issue, nor putting them together into a text file, however when I went to make it into an archive and zip it, apparently I did it twice and caused lines through my stallion. I fear he may never race again. Tar seems to be a more efficient way, using less read/write than many other methods. Also with it being so close to the hardware, it's compatible on almost every device. Tar.xz seems to be a more modern format, which compresses better than gzip or bzip2. It does make me wonder the type of person who first programmed some of the functionality of UNIX, with commands such as touch and finger. We learned about using cat, /etc/motd, as well as wc, rev, etc. Quotes make sense, though back-quotes could be an oddball. Next week we get to mess with the hgrc and customize our setups a bit more to our liking. For now I keep looking at notes to do things, but it should come almost naturally.

Week 3

C Prog

Things are ramping up quicker as we move on through our 4th week of classes. We've gotten into a lot more code in the ways of if, else if, and else. Getting used to not using a semicolon now is new, but you learn quick since your code won't work properly if you don't. Imagine if my computer wouldn't turn on or my car wouldn't start if I hadn't done my homework (assuming the homework wasn't on the computer), it's a much bigger motivator. We got into the rules of how else cannot exist without if, if works when you have exactly 1 thing, else if works with 0 or more, and else is simply zero or one things. So if I want a cannoli, but there is only a salad drenched in ranch, else I don't eat, print hunger grows. We got into relational operators: instruction, fetch, decode, execute, store, and their relation in the instruction pipeline. Aside from almost always using fprintf to get used to it, we're now getting used to using == to mean equals instead of the traditional math expression =. It's just a different and technically more correct way to think of equals, as apposed to just “is.” Diving deeper we got into ways to write more efficient code using our new found friend if, using multiple parenthesis to group logical expressions or formulas with && and || or that may some day save memory in our future programs. It could make the difference in the long run if little Jimmy gets to play a game or program you helped write, if his computer specs are good enough. But thanks to your knowledge of for, while, and do while loops you've saved enough memory usage over the course of the code to make it all work for him. You're welcome Jimmy. All these tools, along with the incrementation notation which looks similar to what my grade should be (a++) allow us to do this weeks project. The initial logic and math involved was very straightforward from the prior squares project, however once you get to subtracting the largest fitting number multiple of 7, I actually had to stop and think. We figured out one way and learned a few more in class, however it is apparent there is a much easier method that only my inner child could deduce. I've attempted watching the Sonic the hedgehog Saturday morning cartoon and some episodes of Jim Henson's Dinosaurs to invoke him, but despite my glee the equation evades me. If only I had some icee's to melt down and pretend they were gummy berry juice to bounce around with, perhaps that could be the key to unlocking this memory.

UNIX

This week we got into memes, quotes, and wildcards. Somehow a full(literal) quote is only one quote, while a half quote is two quotes. How a half quote has twice as many quotes as the full quote and isn't called a double is initially confusing. It seems like there are a lot of terms that I've grown accustomed to based on how people use them in my surroundings, that in the UNIX world can mean fairly different things. Backtick makes sense at least. We echo'd memes, and denoted their variable access using the dollar sign. We also learned some of the key words/environment variables in UNIX like $USER, $HOME, $PATH. Much like Mario we bashed some stuff in our shells, and messed with alias'. Our good ole friend the PS1 and PS2 also made a showing, only this time not in it's console Dark Cloud playing self. Also figured out a fix to getting stuck while trying to do something to a series of > > >'s. My retention of the things I just did last week seem to fail me. I just need to continue practicing with different commands until I know what to type, what it is, and how to use it by heart. I've reached the project and messed with it a little, but haven't figured out the commands for all the different modification options. Manual is my friend, but sometimes I struggle to input the right command to look up and end up turning to Google. Google is not always my friend. I plan to look at and work on this more in depth tomorrow. I intend to tackle this hgrc file, and reclaim the use of my mouse. Not that arrow keys aren't fun, but the longer our code gets, the less fun it will become. Depending on the option, the effect it will have on the program can vary greatly. Currently I am still a little flustered with the system, but I'm sure we'll become old chums once I put more time into customizing it and making it my own. This project is good because it will force recognition with many of the commands involved, but until you grasp that it can be a real pain.

blog/fall2015/dm016807/journal.1442892273.txt.gz · Last modified: 2015/09/22 03:24 by dm016807