Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/feed-rss2.php on line 8
eduardomacielm’s Articles at TC101 Fall 2015 https://kenscourses.com/tc101fall2015 Introduction to Programming Python and C++ Thu, 26 Nov 2015 01:19:10 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ Bonus Point (Goodbye TC101) https://kenscourses.com/tc101fall2015/2015/bonus-point-goodbye-tc101/ Thu, 26 Nov 2015 01:19:10 +0000 http://eduardomacielm.wordpress.com/?p=374 Continue Reading →]]> Well.. everything has its time, and by now its time to finish with this class (unless you fail) .

This is probably my final blog post for #TC101, so far the best class I took this semester.

I want to thank Ken for teaching us so many things, not only programming, but even some life lessons.

Before I start to cry, here is my video review (in Spanish)

]]>
https://creativecommons.org/licenses/by/4.0/
Final final project post https://kenscourses.com/tc101fall2015/2015/final-final-project-post/ Thu, 26 Nov 2015 00:07:26 +0000 http://eduardomacielm.wordpress.com/?p=320 Continue Reading →]]> HERE IT IS!! AFTER A HUNDRED YEARS!!

Finally, my project is finished, of course with some help but, who didn’t need it?

In the code were 2 functions, one for grayscale and the other for scale (1/2);

What the grayscale function did was basically taking the RGB color property (1) for each pixel of the image, and getting the average of that 3 properties (redQuantum, greenQuantum and blueQuantum) to create a new color (2) and then creating a pixel with that color, to then add it to the picture in its correct place.

The scale function basically did the same, but now with 4 pixels. I mean it took the RGB of 4 pixels (2 up and 2 down), got the average of redQuantum, greenQuantum and blueQuantum and give that RGB properties to a new pixel, which takes place in a new picture that is half high and half wide, created by taken the size of the original and dividing it by 2. (3)

Here is our code: Hell yeah here it is

Now, my experience during this project… A lot of trouble, since trying to install magick++ on Mac to then giving up and installing it on Ubuntu… But I was a good friend and told everybody to stop losing their time trying to install it on Mac o Windows, so everybody did it on Ubuntu.

I, as at least half the class, got help from the codes of some partners, in my case, specially Miguel Angel Cardenas so, I thank him, who probably doesn’t know who I am but that’s mutual.

When I first saw his code, it seemed impossible to understand, but with a little of help I understood it and started to change what I though it worked.

There was a really big problem, which from my “circle” I was the first to suffer: “segmentation fault (core dumped)” after compiling and . First I though it was my compiler, but then everybody started to get it. So, after some hours spent with Omar, Alejandra, and Newton trying to fix it, until we realized that it was a problem with big pictures, which we couldn’t fix.

But after all this hours spent, it was done. And since now, and for the next years, every time I get involved in something hard like this, there’s one simple quote I will remember :”It’s OK to fail”.

 

  1. http://stackoverflow.com/questions/28151240/get-rgb-color-with-magick-using-c
  2. http://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/
  3. http://www.smashingmagazine.com/2015/06/efficient-image-resizing-with-imagemagick/

]]>
https://creativecommons.org/licenses/by/4.0/
Recursion and Loops https://kenscourses.com/tc101fall2015/2015/recursion-and-loops/ Wed, 25 Nov 2015 07:38:18 +0000 http://eduardomacielm.wordpress.com/?p=316 Here is my video tutorial about recursion and when to use what kind of loop:

]]>
https://creativecommons.org/licenses/by/4.0/
C++ Coding Conventions and Strings https://kenscourses.com/tc101fall2015/2015/c-coding-conventions-and-strings/ Wed, 25 Nov 2015 07:33:09 +0000 http://eduardomacielm.wordpress.com/?p=307 ]]> Here’s my video explanation about coding conventions:

And my video explanation for creation and use of strings

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ11 Yo Soy 666 https://kenscourses.com/tc101fall2015/2015/wsq11-yo-soy-666/ Wed, 25 Nov 2015 06:07:53 +0000 http://eduardomacielm.wordpress.com/?p=298 ]]> This WSQ… well, it has its reserved place in hell between Hitler and Justin Bieber.

Here is my faulty attempt:

666TheNumberOfThePriest

 

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ17 SciLastONE https://kenscourses.com/tc101fall2015/2015/wsq17-scilastone/ Wed, 25 Nov 2015 05:50:34 +0000 http://eduardomacielm.wordpress.com/?p=229 Continue Reading →]]> When I first read “download and “play with” SciLab” I really though it was a game… But I wasn’t disappointed when I saw it was a Software just like Matlab, but with the difference that this is compatible with MacOSX.

This is really going to be useful for us trough these years we’ll spent in Tec, so thanks Ken to take the time to check and recommend us this.

It is not that hard to use it, in fact, like if a giant scientific calculator and a program developer had a son.

However, here is my attempt to make a simple counter from 0 to 10 (yes, I know it just counted from 0 to 9, but hey, first time using it!)

Captura de pantalla 2015-11-24 a las 9.32.53 p.m.
Captura de pantalla 2015-11-24 a las 9.36.24 p.m.

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ16 https://kenscourses.com/tc101fall2015/2015/wsq16-10/ Wed, 25 Nov 2015 05:50:19 +0000 http://eduardomacielm.wordpress.com/?p=249 Continue Reading →]]> This WSQ was a little difficult because there were some new stuff you had to find out how to do and some libraries to use and the functions you use:

  •  <fstream>(1)
    • ifstream file(example): It opens and reads the file.
    • file.close(): Well… it closes the file.
    • file.is_open: Just checks if… well… the file is opened or not.
  • <string>
    • getline (file, string): it checks a line from the file and stores it          into the string.(3)
    • string.substr (position, length): it stores a fragment of the string, starting from the position and taking characters depending on the length you gave.(2)
  • <sstream>
    • istringstream stringnumber(string): it takes a string and gives a different string class that lets you do some operations with it: (4)
      • stringnumber >> float: assigns the value of your brand new string to a float.

cars.cpp

  1. http://www.cplusplus.com/reference/fstream/
  2. http://www.cplusplus.com/reference/string/string/substr/
  3. http://www.cplusplus.com/reference/string/string/getline/
  4. http://www.cplusplus.com/reference/sstream/istringstream/

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ15 Final Dash https://kenscourses.com/tc101fall2015/2015/wsq15-final-dash-4/ Wed, 25 Nov 2015 05:49:27 +0000 http://eduardomacielm.wordpress.com/?p=216 Continue Reading →]]> Well… not so much to say. Ken planned this WSQ so we did it a month before the deadline. And here we are, just a day ahead. But hey! Viva México!

Ok so… my plans…

I’ve been working on my project which was not as easy as I though. This weekend I was working with the codes of my remaining WSQs, and by now, I’m working also with my masteries, so prepare to see all my post in a single hour at the home page.

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ14 calculating e https://kenscourses.com/tc101fall2015/2015/wsq14-calculating-e/ Wed, 25 Nov 2015 05:48:29 +0000 http://eduardomacielm.wordpress.com/?p=205 Continue Reading →]]> This task was not exactly easy because there were different ways to understand the instructions.

What I did in my code was to give the number of iterations I wanted to do (of course as the number was bigger, the result was more accurate)

So it was all about a factorial function, and the function which takes the factorial and does the process. With a for loop, I only counted the iterations and that was all! Check my code:

enumber.cpp

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ13 Babylonian Method https://kenscourses.com/tc101fall2015/2015/wsq13-babylonian-method-11/ Wed, 25 Nov 2015 05:48:11 +0000 http://eduardomacielm.wordpress.com/?p=197 Continue Reading →]]> This WSQ was just like the previous one, you just had to follow an algorithm, in this case just wikipeding “Babylonian method”, and then there was something about methods to calculate square roots.

There was nothing in this WSQ that you aren’t supposed to know.

Baby.cpp

]]>
https://creativecommons.org/licenses/by/4.0/