UseCases: Answers to the project questions

12903816_997885020265517_1069176269_o

In the activity of the description of the Use Cases of our project, my team and I concluded in four use cases: Installation, Turn on Rasplapse (the fancy name of our app 😀 ), User let Rasplapse create a Timelapse, and Name and save the video with Rasplapse. In all the cases the actor is the user of the app.

The first is pretty obvious: the user would need to download the Pi4J library, and downlaod the Rasplapse software. The second one enables the user to connect his/her Raspberry Pi to a power source (to turn it on, of course) and then click on the Rasplapse symbol in the desktop to open the program.

The other couple of use cases are more complicated that the last two, since they describe the behavior of the app and its functionality. The third one is the use case where the user name and select the directory where the video is going to be saved.

Finally there’s the action of letting Rasplapse to create a Timelapse: the user is asked for a duration and a photo-rate for the app to take the pictures in that range. After that, the camera takes a few seconds, and then starts to take photos in the photo-rate and duration specified. After this time range is finished, the user can find the video in the directory selected previously.

Our project is in the right path since we’ve bought the engines that are going to move the camera, and we are in the process of testing the code.

 

The silliest project ever (and for silly I mean tremendously difficult!)

This week I finally finished #wsq09 “Movies”. I worked in this task for over two weeks; I spent nights in front of my laptop; I couldn’t slept because this task tormented me, but at last I beat one of the most difficult tasks of my life! Here is the description of my experience doing this incredibly, extremely, tremendously, awfully difficult wsq09.

The instructions for this task were: create a program that read a file, outside the program of course, with the names of some actors and movies where they have appeared. You should record this information wherever you want, and ask the user for an input: if the user write two movies separated by either “|”, “&” or “^”, the program should output the actors of the movies the user wrote with their respective restriction. “|” stands for all the actors that appeared in each movie (logic gate OR); “&” stands for all the actors that appeared in both movies (logic gate AND); and “^” stands for all the actors that appeared in one of the movies, but not both (logic gate XOR). Finally there was another option: the user could write the name of an actor and the program should find all the actors with whom he/she has acted in any movie.

The chosen tool or what I called it, the ‘designed hitter’ tool I used was a HashMap. This tool works as a Python’s dictorionary, where you have a key and a set of values of that key. There was only one important problem with the HashMap, the program couldn’t have access to the HashMap once running, in other words, I couldn’t read the HashMap line by line just like an ArrayList or any other similar tool. Once the HashMap was created by reading the file, an ArrayList of every key with their respective values was created too. Now with the movies and their respective actors arranged, an inputBox was shown so the user could wrote whichever option he/she wants and the output would be the actors with the selected restriction.

Another important aspect of my code is the use of an Iterator for displaying the actors in the option ‘b’ where the user simply write the name of an actor, and the program should return all the actors whom he/she has appeared with. The Iterator is an object that works when calling the method ‘iterator ()’. This object enables you to cycle through a collection of data, helping to obtain or remove elements. I used the Iterator to search for the name of the actor, and collect all other actors that appeared in the same list.

Here I leave the link to my Github repository where my classmates can see my code.

Hope that I help someone because this task is tremendously hard!

https://github.com/RichardCT/Movies/tree/master/Movies/src

Movie_actors