Week 17 – Building Queries on MySQL

Weekly Learnings

This is the first week coming back from the winter break, and we’re jumping right into the action. First, I think the book we’re working with is fantastic! I love the simple, elegant, and pragmatic approach of only using the right side for examples and as reference. It makes both working through the exercises and understanding the logic behind it much easier.

I have been fortunate enough to use MySQL at work, but normally development is done through APIs, and actual access to the database is limited to some select statements to verify data. This week, was particularly satisfying as I finally got to get a solid grasp on both how JOIN statements work. This has been a question that I have previously gotten during interviews, and felt I have come short explaining properly because the concepts were not clear.

I also found this blog on the subject to be very good. It has a better way to graphically represent the INNER, and OUTER join relationships. I have to agree with the author that the ven diagram representation of this functions is just not adequate.

Say NO to Venn Diagrams When Explaining JOINs

Overall, i’m very much looking forward to this class! I think learning more about databases is fundamental for any developer!

Posted in CST-363, CSUMB | Comments Off on Week 17 – Building Queries on MySQL

Week 15 – Media Final

This has been a really good class. My only regret is that we didn’t dive deep enough into media manipulation. I would have liked to spend more time doing sound manipulation, and learning to mixers work. But I realize this is a short class, and we had too many topics to cover. Demystifying images and filters, and creating our own was very interesting, and it puts in perspective why and how applications like Snapchat are so successful. It also means we have the tools to start our work into something similar to this.

This last lab was also very interesting. I do love parsing strings, and putting a small page together was very interesting. It’s clear this was just to touch on how HTML works, because python already has very robust HTML frameworks that can make a lot of this work trivial. But as an experiment on delivering a simple webpage, it was pretty interesting. I think for me, more than the HTML, I really enjoyed finding a creative way to show the word count. I did research into the heatmap algorithm, and then curving the count so there is a better color distribution was the most fun.

The final project was a bit more rough. We spent a lot of time working on it, and trying to deliver the best user experience as well as a complete product. The biggest raw improvement was using smaller images, which translates to a lot less work copying pixels from one picture to another. Then optimizing so we only draw items we care about and not rendering maps on every action. Those small tweaks made a huge difference in performance, and overall, helped us deliver a better product.

Below is the demo video for our game:


What I would most recommend students taking this class is to come with some basic knowledge of python. Even a light pass on basic syntax and data structures can be incredibly helpful. It’s also very valuable to brush up on all your array, and dictionary knowledge. Those are very important data structures that will be used constantly through your labs and knowing how they work will make your life much easier. Finally, be very curious and be willing to experiment with the knowledge. Some of the most fun I had in this class was when I took the assignments off the rails and just tried to see what happened when I changed images, or sounds to do other things.

Being curious in this class has big payoffs in the way of knowledge and understanding.

Posted in CST-205, CSUMB | Comments Off on Week 15 – Media Final

Week 14 – Strings, Lists and Dictionaries

Weekly Learning

This was a very interesting week. I think we ran a bit ahead of ourselves when we built our game and it meant we didn’t have much of an opportunity to add more lists and dictionaries. I don’t think that was necessarily bad, but it gave me the opportunity to also cleanup some of the code and make smarter choices. I got to also see some of the solutions from my classmates. Some of them introduced already classes, and other very nice structures into their games. I don’t think that is a bad idea, but i do think it’s not necessarily as useful in a context as small as this game. It could certainly make things easier for some of the manipulations we’re doing like keeping track of user inventory. But to me, more important than classes, is make sure the code is highly maintainable and scalable. On that, I’ve been doing a lot of a reflexion. Without a loader or storage, class data structures are limited on what they can do in the scope of this game. So you end up essentially replicating the same functionality that a dictionary would have with the added overhead and complexity of a class.

Dictionaries and lists are less than ideal as well, but in this case, they are just good enough to make the code highly maintainable and scalable. The small changes we made to add better inventory management, and cleanup event handling proved it right to some extent as the refactor was swift and effective.

I think one of the most important lessons I got from this game exercise is that abstraction for the sake of abstraction is not a good pattern. Abstraction must aim to solve specific problems, and those problems must be derived from the data that is being used. In this case, things like Rooms, and Inventories, and Hero states are the data, so our abstractions were to make that data manipulation easy, effective and expandable. Mike Acton puts it far more succinctly in his presentation on Data Oriented Design presentation.

The second exercise of text parsing and word counting was equally interesting. I have always had a special place in my heart for parsers and I wrote an xml and html parser many years ago. This was a bit different, we just wanted to get the headlines, and since structures didn’t need to be kept or maintained, a lot of those learning didn’t really need to apply. But it’s always fun trying to solve those sort of puzzles. Trying to find the start and end of a tag, and run searches over strings is an interesting task as you unravel what is useful and how it’s useful.

I love the topics of this class. I wish it was a bit longer of we spent more time or used better tools for each specific issue. JES is so limited on what it can do, and python is less than efficient for things like image manipulation. But I believe that overall the point of the class is to get us to understand why and how this files and systems work and on that, it’s done a great job at peaking my interest.

Posted in CST-300, CSUMB | Comments Off on Week 14 – Strings, Lists and Dictionaries

Week 13 – Making Games

Weekly Learning

This has been a very interesting week. Despite the longer time since it’s Thanksgiving, we still ran short of on time for creating our projects. The week assignment was essentially to create a game similar to Zork where the user navigates from room to room and can do actions, take objects, etc. Since i have a bit more experience on both programing and design, I took a bit more point on this one. I think the solution we came up with was very good, although I wish we had had more time to collaborate and come up with more functionality. The biggest success was to take a data driven approach. That means most of our functions are incredibly generic and can be used for any object or room accordingly.

From there, expanding the layout and the general functionality of the program was nearly trivial since we only had to add more data points and all the loops would just automatically take care of what needed to happen. I think this was a brilliant solution to an otherwise very hard to solve problem with the limited amount of time we had to work on it.

The end product was very solid. Our game was not only playable but even with the limited infrastructure we put in place, we could add a number of events, triggers, items, rooms, etc and the game would require very little additional work. If we continue expanding on this, we could easily have a full fledge adventure with proper win and lose conditions.

Right now, the biggest challenge on our approach is to clean up our flows and tighent up the data handling. Introducing things like classes would make a big different since it would allow us to clean up a lot of the flows where we rely heavily on string matching rather than a more polymophic approach.

Overall, this has been a very pleasant (though time crunched) lab. The collaboration with the rest of the guys was a very valuable experience on organizing the team and working all in the same file at the same time.

Posted in CST-300, CSUMB | Comments Off on Week 13 – Making Games

Week 12 – Sound and Games

Weekly Learning

This week we had a lot of work between the midterm, and the different labs. The Midterm was an interesting and creative experience. I really enjoyed coming up with the different ideas of what the filters should be and how to achieve different effects on them. I’m very proud of Cristian’s work on the Atomize filter! He executed the idea exactly how I saw it in my mind, and then we just kept building on it. I’m a little sad we didn’t achieve the exact effect that I wanted on the image: A more spread out dot pattern better simulating the pop colors of a comic book. However, the final result was very good!

The sound lab was very interesting. I had never worked with sound files, so understanding how sampling works, how to manipulate volume, or normalize the sound was a very educational experience. However, the one I enjoyed the most was the hangman. It was an interesting problem and lab to work on. It flexes the logic muscles and helps form a better idea of what computer science and programing in general are. It allows you to be creative with a solution, but gives you a clear goal and rule set to follow. Watching the videos of how other people solved the same problem, and both the similarities and differences between their approaches, was very interesting.

It also helps me grow as a developer to see how different people tackle a common problem. In general, the video presentations have been very good. Looking at other solutions, and the thought process behind them is very valuable experience you don’t get working by yourself. The fact that I can take those ideas and improve on them, or even just see how my own ideas are successful in someone else’s code gives me a level of insight I rarely get at my job, where my solution is the only solution because I’m the only person working on the problem. Code reviews can go a long way to provide you feedback, but nothing replaces comparing your code to someone else’s and picking the best parts of both.

Posted in CST-205, CSUMB | Comments Off on Week 12 – Sound and Games