Updated Final Project

We have decided to make each room a folder. However, instead of having folders in folders for our room layout, we will have all the room folders in one subdirectory. We have also decided to use multiple files in each folder for the different actions to use. We have split the project up amongst ourselves. Two people will be coding in python and two people will write the room descriptions, action files, etc. We already have a basic implementation of the project, all we need to do is add some actions, add the room descriptions, and action files.

ECE 2524: Final Project

Hi everyone,
I guess I never wrote about my teams final project. Our team is making a battleship game. So far we have the entire game running on the terminal. We have used QT to build our program. We thought of using QT since couple of people in our group are in Soft engineering class. They mainly use QT for all their HWs. So far the only issues we are facing is the size of different ships. Initially we assumed that the ship size would be 1. This helped us make the code modular and simpler. Now we just to need to fix ship sizes etc. Besides this we also have been looking at making the game multiplier over a WiFi network. Some of the classes that we have been looking at is QAbstractSocket. If we figure out how to setup a simple chat server then we could potentially have the game running over a network as well.

Response to Shy then Engineers or Engineers then Shy?

Original Post

I agree with this post completely. First day of class is not as exciting as it used to be; no one tries to meet new people or talk to the person next to them. As difficult as it is maintain a social life as CPE, I feel like there are many opportunities to meet new people with similar interests, such as in school clubs or sporting events. I think effort is simply needed to meet new people.

Speaking up in class is entirely a different issue, I believe the main reason for no one wanting to speak up is because they are intimidated by public speaking. I know its a small class of 30 people, but I would nevertheless consider speaking up in class as public speaking.One way to fix this issue would be to make public speaking class part of our curriculum. Not only will this help in the short term, but it will be very useful on the job.

Well, its either my reason above, or no one knows the answer to the professors question.

 

Intro to Unix ECE 2524 Entry #9

I’ve been enjoying the break finishing up all the current unix assignments before the break began. I guess the last thing I did that I haven’t mentioned yet is the future of unix paper.  I thought this was an interesting paper to write about and research as technology in the future has always been an interest of mine. Upon finishing the paper I didn’t realize that part of the submission was creating a makefile to convert the paper to html and pdf. Since I started this paper in Word I wasn’t sure where to go and how to get it in to markdown format. Turns out markdown format is pretty much just plain text, so I was able to take the plain text file and simply add some white space where paragraphs were needed which wasn’t nearly as bad as I thought it would be. After getting the markdown file, converting it using pandoc was as simple as just googling what the command to do so was. Setting up the makefile after this was a piece of cake.

In 3574, we are getting a bunch of homeworks as he is trying to squeeze everything into these last couple of weeks which is really annoying. So we got stuck with an assignment over break. This proved to be pretty tough especially without being able to go see the TA for help.  The homework was on POSIX message queues.  I managed to set up everything necessary for the homework, but was stuck on one of the most trivial parts. The parameter for the message in the send and receive functions is a char*. I didn’t realize how annoying this was to convert my messages between char*s and QStrings.  Turns out everything I was doing wrong had to do with my error in conversion. I was using the same char* as my send and receive message because I didn’t realize how it was really storing the information into the pointer.  By having 2 char*s, one for receiving, and one for sending, this cleared up the issue. Such a small thing for all the debugging I had to do. Debugging for this homework was extremely annoying since you had to run 4 separate processes of the same program, then a fifth process of a different program. All 5 processes had to be run in a certain order, and remade, and reran every time I made a small change. It would take about 30 seconds just to get to the point where I could rerun the program. I finally got it working though after a few emails with the TA,

Cooperative Processes

My latest project in ECE 3574 is about cooperative process. The purpose of our assignment to communicate between 2 different files which includes 5 processes altogether. Cooperative process is the idea of of passing/retrieving information within the processes. There are two ways that this can be done:

1) Shared Memory

In shared memory, all communicating processes must establish a region of shared memory. Each processes then reads/writes to this shared memory location. It is important to make sure that two processes may read and write at the same time. A classic example of shared memory problem could be encountered during a producer consumer problem. The producer produces while the consumer consumes the information. The best place to put the data would be in the shared memory location which could be accessed by both the producer and consumer.

2)Message Passing

There is no memory allocated in message passing. A small mail box with a corresponding mail box number is attached to the processes. The processes send and receive data through this mailbox. A communication link must be established for two processes to communicate. My current project focus of Message Passing which utilizes Posix Message Queues.

FTP(File Transfer Protocol)

While doing research for the futures paper, I found some information about FTP. FTP is also called as File Transfer Protocol. We are aware that Unix is a server based operating system. There is one central server and the data of this server can be accessed by several other computers which have access to the parent server. Often times, the access is restricted by enforcing a user name and/or a password. Each computer is like a branch where the server acts as the root of this tree.

FTP is the way to transfer data to and from these server. It can be very beneficial in office where the main data might need to be accessed by all the employees. There is a list of FTP commands that could be found on Google. Some of these commands are:

APPE: Append

DELE: Delete File

MKD: Make directory, etc.

All these commands are typed in the Linux terminal. There are several other ways of transferring files and FTP is one of the major and famous one out there.

Look at this link for several other FTP commands:

http://en.wikipedia.org/wiki/File_Transfer_Protocol

ECE 2524: Piping

Hi everyone,
Past week we had a unix assignment in which we had to pipe two cpp files. One of the cpp files called “Generator.cpp” counted numbers and printed them to standard out. The other cpp file called “Consumer.cpp” took numbers from standard in took their average and printed it to standard out. Our assignment was to pipe them and also create a make file. Creating a Make file was really easy. The hardest part of this assignment I found was piping the two cpp files. At first I thought if U just use ./generator | ./consumer .. it should work, but I was wrong. The best way to this is to create a seperate cpp file in which you use fork command and also execute ./generator and ./consumer. Everything worked fine then. The key thing was to kill the ./generator using the kill command. One part that I was stuck on was waiting on the ./consumer to end. I used waitpid and wait command; however, it did not work. The generator executable was fine with the waitpid command. But ./consumer was not working. My program would get stuck when I called the wait command twice. If anyone have some thoughts on that then it would be great.

Intro to Unix ECE 2524 Entry #8

I’ll go ahead and start off this blog by talking about the makefile assignment since I haven’t said anything about that yet.  At first, I thought making a makefile would be extremely difficult; I figured that since the process was often automated it must be very hard. I actually found it to be very intuitive for the most part. Each target will be re-created based on any dependencies that it has, so if any of its dependencies change then the target will be recreated based upon the commands listed for that target. I found especially beneficial that you can have multiple targets if they have the same dependencies and are created by the same commands, this came in handy for the parser.tab.hpp, and parser.tab.cpp files which were both dependent on parser.ypp and were created by the same bison command.

The most recent assignment was on forking processes and creating a pipe.  The first part of the assignment was to create a makefile which proved to be very easy after the last homework.  For the most part the homework was very straightforward and took nothing more than looking at examples and reading the man pages.  Of course I had a couple small bugs, but Darren pointed me in the right direction with these issues, and I got the homework finished without too much trouble.  I have a lot more experience in C++ so it is a lot easier for me to write C++ code then it was with writing Python which was a struggle especially through poor documentation.  I thought this was a cool assignment that showed how the beginnings of a shell may come together.

The most recent assignment in 3574 wasn’t too difficult after some guidance from Sean.  This goal of this homework was to use threads to perform matrix multiplication.  Reading from the input file actually proved to be more difficult than I had expected since Sean told me he would probably do a of error checking by supplying oddly formatted input files.  He showed me how to use QRegExp (regular expressions) to get a good pattern for determining if the input is an int or a float, and then if the input didn’t match either of those then you know that there is something wrong with the input. This eliminates the need to check for a multitude of different things such as if there are letters entered, or special characters, or who know’s what else. The regular expression catches it all with ease.  I read the input files into a QList of QStringLists, which gave me access to the matrix elements in a similar way to a 2-D array.  After that it was pretty easy just to run a for loop to make the correct number of threads, calculate the correct products then output it to the resultant matrix.  I found that there was no need for mutexes since there is no thread was going to access to the same memory location, so this made the assignment even easier.