User Tools

Site Tools


opus:spring2015:hju:journal

C/C++ Programming Journal

MONTH Day, YEAR

This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.

As an aid, feel free to use the following questions to help you generate content for your entries:

  • What action or concept of significance, as related to the course, did you experience on this date?
  • Why was this significant?
  • What concepts are you dealing with that may not make perfect sense?
  • What challenges are you facing with respect to the course?

January 25, 2015

Most part that I had to do for the project CCI0 was already done ahead since I had to do it for UNIX project. However, it was first time making a program using C by myself. Making a program is always a fun thing to do. I reviewed what I learned in the class especially all the terms that was used in the “Hello, World!” program. Because I don't know most of the command that is used in Terminal or PUTTY, it was little bit challenging for me using those. I am pretty sure that there is a command for “copy”. However, I almost write whole thing all over again and I realized that I don't have to do that. In my lab 46 account, there are files and folders all over the place because I don't know how to erase them. I think I should clean some files up before it gets really messy.

January 31, 2015

For the project mms0, I had to make a program that gives me an answer for the square two digit number ending with 5. Since there were not much explanation about how to make a program, I had to do it by myself. I start programming by applying the multiplication program that we did in class. It was very challenging. However, I had so much fun, especially, figuring out how to make fscanf and fprintf work. Now, I know the concept of %d and how to apply in a program. It was easy to understand: %d equals to a number that we define on the next to following comma. Also, it seems like I can use as many %d as I want. :-D Because I found out the answer to the every problem that I had on the book, I don't have any problem.

Febuary 7, 2015

First of all, project mbe0 was extremely hard!! 8-o I kept trying and got errors every time. The first challenge was how to separate number into digits. I tried by myself and eventually it got so long and messy. So I got help from the internet and it gave me how to get the digits separate. After that, I got stuck on adding digits. It wasn't hard but confusing. But I draw a number tree on a paper, and it helped me make a program. I learned how to use if else statement and logic that is related to math. For now, my program can't handle it. However, I know how to make it. For any digit numbers, I just have to make more “add” variable and make more branches. I totally see the pattern. … OMG.. is.. is it the next project? …. oh… I think I can do it but it gives me so much headache.

February 24, 2015

The project for last week was mbe1 which is similar to the mbe0. However, I used the loop and array to make it work for the 2 to 8 digits. Actually, I wrote the code that works to 10 digits using for loop. I put each digit to the digit array backwards. Therefore, the result array had the result backwards. Everything worked fine till then. However, at last, I did not know how to merge array to the 1 number. So I just used n*11 for the answer which worked fine. But it is still mystery. I learned it is important to initializing every value, otherwise, the value get the randomized number. Also, for the rounding number part, I just used if statement (which is not really good way I think). If the number before was more than 9 than just add 1 to the next number. Something like that. It took me long time to write mbe1 code. However, it was worth it.8-)

March 6, 2015

I had a lot of problem making function work. So I wasn't able to submit the project afn0. However, generous Matt gave the class good hint of how to make a function using char * with array. It was very confusing at first. Still working on it. I learned “char array[];” can be also written as “char *array;” It is functionally the same. However, in the function, it is better to use without square bracket. Also, another interesting thing was *(array+n), which can be written as array[n]; Cool! It solved my problem of how to return array in a function. Because one question that I had was that I couldn't write “return(array[n]);” He just totally solved my problem. Only thing that I had to write was “return(array);” Awesome. I also learned debugging with gcc called gdb, I guess. It seemed very helpful although I did not try by myself yet.

March 8, 2015

I figured out the 19 digit problem. It was problem of whether signed or unsigned. After I fix my code unsigned long int n; fscanf( stdout, “%lu”, n ); It worked up to 20 digits. I was so happy. However, I bumped into another problem that the calculation went wrong whenever the input value ends with zero or zeros. I kind of felt bad. But other than that, I think I did pretty well since it took me for 2 weeks to finish this project. Awesome. If I have time, I want to write a perfect code for this project that gives the right value even though it ends with 0.

April 7, 2015

I didn't even look at the project because I was super busy with other classes. So I looked up the project today and finished today. cbf0 project wasn't that long. However, I encountered new functions that is related to making files, reading files and writing files. It was fopen, fclose, fput, and fseek. I was able to change the position for fscan by using fseek function. SEEK_END allowed me to read from the end of the file. So my code opened two files( input, output ) and read input file 12byte from the end using fseek and fscan. I make sure to put into an array. Then, I used fput to put the array to the output file. It was nice project to practice handling files. Now, I think I can read and write any file. So confident.

UNIX/Linux Fundamentals Journal

MONTH Day, YEAR

This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.

As an aid, feel free to use the following questions to help you generate content for your entries:

  • What action or concept of significance, as related to the course, did you experience on this date?
  • Why was this significant?
  • What concepts are you dealing with that may not make perfect sense?
  • What challenges are you facing with respect to the course?

January 22, 2015

As I was working on the project UXI0I, I learned a lot. For example, I learned how to edit my opus and how to customize it. Honestly, Lab46 and wiki was quite interesting. I got my lab46 email and activate it. Also, I used lab46 mercurial repository for the first time! (I add commit and push to repository) At the point of finishing the lab, I got familiar logging in to the system and using terminal (prompt) for the lab46. However, I got confused when I tried to get RIC thing which was all about class chat and the channel and stuff. I eventually got connected to the server but I did not know when to use it and how to use it. This was the biggest challenge of UXI0I. Although it is only beginning of the class, I enjoyed learning about UNIX and Linux.

January 31, 2015

The second project, arc0, was quite challenging to me in general; because I had to read a lot about the new words related to archive and file compression and I don't like reading. Moving and copying files were easy, however, it took a while to actually extracting file. The fact that .xz is a type of compressed file was interesting. Also, figuring out the shape of the scrambled files was fun. I didn't know that there was a specific shape, however, I eventually find out as I was playing with tac and rev. I noticed that, for learning computer, playing with things can improve my skill. As I was working through the project, I had a problem. I stuck on STDIO redirection (>). Whenever I use it, it didn't work. So I just copy and paste the text in order to make an result.txt . It was a fun project! HORSEEE =)

February 11, 2015

I finished my first puzzlebox and it was very hard for me to finish it. I learned about the command name file which shows me what type of file it is. It was really useful figuring out the puzzlebox. I look up the type of the file named riddle.html and it said that it was originally shiny.tar so I decompressed it and I got the file named making.waves which was uuencoded so using uudecode I found out the file that is zipfile. So I unzip it. The whole process was similar. Looking for the file type and do something to make it readable. nice! Finally, I was able to get to the result.txt. It was a hard project but learned a lot about the extension of the file and the file type.

February 12, 2015

The second puzzle box, pbx1, was easier than the last one since this was my second time solving a puzzle box. I basically did the same thing, however, I learned chmod command which is for authority to get access. I learned 700 is highest. Also, after I got the file, I had to convert the hex code to ascii code. I was trying to use the octal to ascii program, however, I had no chance to use it since the code was hex. So I figure it out by using converter from google. Then I made the file in order to get the bat ascii art. Because I couldn't change the order of the line I edited with nano. In this lab, chmod was the new thing that I used in the lab.

March 04, 2015

It was hard project. Not even close to getting png file. Working on dd command. if= file name of= output file skip= offset count= length. if is an option of reading file and of is an option of the output of the file. skip is a command of where to read file. count is an option of how many block size would dd command will read. bs stands for block size. I used dd to separate file to part1 part2 part3 and toc. some code was encoded so I had to decode it. And I got the rle file so I had to use some special command which is called rletopnm which converts rle file into pnm. So I got the pgm file. Still stuck here and I have to expand the file to x2.

March 14, 2015

Udr1, fun project. I guess I have to get gizmo before even starting the main part of the project. Thankfully, I got the two files that I am supposed to get. I got these files by using dd. [dd if=data.file of=result bs=1 skip=5552] So one file was some ascii art that is 203 byte and other file is reverse data of gizmo according to the instruction. However, I got stuck getting the second file reversed. The instruction said that I have to make a shell scripting. It's been a while writing script. So I asked for some help. I hope this work out nice. I just read the alpine and got the data.file-turbo and I think I have to work on numbers again..

March 17, 2015

For udr1, I used dd command most of the time. First, I separated a file into 2 files using dd if of bs count skip. For the first file I used ctrl+c to find the last character of the string. Then skip everything using dd and get the second file. Then, I made a script that saves the last of the string file into the temp file and append each character into one file called gizmo. It took a while to get the complete file(like 3 hours for my laptop). Now I am starting the real part of udr1. I got some questions wrong, but, don't know the result of getting wrong. I saw the project called udr2 last morning,ah….. Can't wait till I start the project! I am happy hahahahah.. When will the udr project will end?

April 11, 2015

Udr2 took long time to finish. The task was analyzing packet from the 6 sessions. The key was to find out what information each packet has. Also, find the specific packet using bgrep. Bgrep tells me the hex address of the specific packet that I am looking for. Another interesting thing was the unix time. There was a command for converting time to unix time(date) and timestamp packet contains the unix time encoded with hex. However, the time recorded as a name of the file doesn't seems like matching the time actually recorded. Because I used hex editor so many times, I find out how to find specific hex character. For example, if I want to find 8A, I can use \8A in the command line of the editor. To find the next matching, I can use '/' and before matching is '?'. I learned a lot through this project since it took me long time to finish it 8-)

opus/spring2015/hju/journal.txt · Last modified: 2015/04/13 14:52 by hju