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
‘#c’ Articles at TC101 Fall 2015 https://kenscourses.com/tc101fall2015 Introduction to Programming Python and C++ Wed, 25 Nov 2015 19:00:06 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ Final Project https://kenscourses.com/tc101fall2015/2015/final-project-6/ Wed, 25 Nov 2015 19:00:06 +0000 http://opezaimd.tumblr.com/post/133942324590 We. Are. Done. Finally, our program works like a charm, after several days of research and hardwork, our project is capable of resizing an image and changing the color to black and white. 

We kinda did it in two parts, the first one being the black and white, that you can check out here.

For the “second part”, we researched and found out how to resize the source image using math and arrays. These links were reaaaaaally useful:

http://stackoverflow.com/questions/27351737/c-how-to-shrink-an-image-using-a-pointer-array
http://stackoverflow.com/questions/299267/image-scaling-and-rotating-in-c-c
http://doc.gnu-darwin.org/ImageMagick/www/ImageMagickObject.html
http://www.cplusplus.com/forum/general/2615/

We kinda teamed up with Eduardo, we worked together, and mutually helped each other. 

We had a lot of errors during the process about syntax but one we dealt with the most was an error called “segmentation fault”. After battling with it, we found out that our program wasn’t the problem, but the source image was. We looked and tried several images until we found one that worked, which was the golden retriever puppy on the English Wikipedia page of puppies. Eduardo told us that this picture didn’t have the same error and we confirmed that it didn’t.

We are really happy about the outcome of the project.

Here are some screenshots:

You can check out our final code here:

https://github.com/kenwbauer/TC101F15_Team06/blob/master/FINALPROJECT.cpp

]]>
We. Are. Done. Finally, our program works like a charm, after several days of research and hardwork, our project is capable of resizing an image and changing the color to black and white. 

We kinda did it in two parts, the first one being the black and white, that you can check out here.

For the “second part”, we researched and found out how to resize the source image using math and arrays. These links were reaaaaaally useful:

http://stackoverflow.com/questions/27351737/c-how-to-shrink-an-image-using-a-pointer-array
http://stackoverflow.com/questions/299267/image-scaling-and-rotating-in-c-c
http://doc.gnu-darwin.org/ImageMagick/www/ImageMagickObject.html
http://www.cplusplus.com/forum/general/2615/

We kinda teamed up with Eduardo, we worked together, and mutually helped each other. 

We had a lot of errors during the process about syntax but one we dealt with the most was an error called “segmentation fault”. After battling with it, we found out that our program wasn’t the problem, but the source image was. We looked and tried several images until we found one that worked, which was the golden retriever puppy on the English Wikipedia page of puppies. Eduardo told us that this picture didn’t have the same error and we confirmed that it didn’t.

We are really happy about the outcome of the project.

Here are some screenshots:

You can check out our final code here:

https://github.com/kenwbauer/TC101F15_Team06/blob/master/FINALPROJECT.cpp

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 25 https://kenscourses.com/tc101fall2015/2015/mastery-25-6/ Wed, 25 Nov 2015 05:08:39 +0000 http://opezaimd.tumblr.com/post/133909859880 On this mastery I’ll show you what are strings and how to use them in C++.

String are things that are represented by a sequence of characters.

We will create a function that works as a palindrome and tells the user if the word he input is a palindrome or not. Do as follows:

  1. Create a main program and leave a space before it for the function
  2. Create a function of type string called palindrome
  3. Condition the user input with VARIABLE.rbegin and VARIABLE.rend. This iterators make the string return reversed to the beginning and end. This is the Palindrome “function”
  4. In main(), ask the user for the input and call for the function.

Your program should look something like this:

Now let’s test it:

Great! Now you know how to do a basic program using string. If you want to learn more about strings, go to this webpage:

http://www.cplusplus.com/reference/string/string/

]]>
On this mastery I’ll show you what are strings and how to use them in C++.

String are things that are represented by a sequence of characters.

We will create a function that works as a palindrome and tells the user if the word he input is a palindrome or not. Do as follows:

  1. Create a main program and leave a space before it for the function
  2. Create a function of type string called palindrome
  3. Condition the user input with VARIABLE.rbegin and VARIABLE.rend. This iterators make the string return reversed to the beginning and end. This is the Palindrome “function”
  4. In main(), ask the user for the input and call for the function.

Your program should look something like this:

Now let’s test it:

Great! Now you know how to do a basic program using string. If you want to learn more about strings, go to this webpage:

http://www.cplusplus.com/reference/string/string/

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 2 https://kenscourses.com/tc101fall2015/2015/mastery-2-6/ Wed, 25 Nov 2015 04:37:12 +0000 http://opezaimd.tumblr.com/post/133908220850 On this mastery I’ll show you how to program in an online compiler and how to run your program in the same online tool.

There’s an online compiler and debugging tool called Ideone, which allows us to code online and then test it right there. So, go ahead and open ideone.com

Once you opened the webpage, something similar to this will appear on your screen. On the centre of the webpage is where our programs are written, On the bottom left , we have the language of the source code (which can be changed) and on the bottom right we have the run button.

Let’s create a “Hello World” program and run it:

As you can observe, our program was successful and it did output the desired outcome. 

Now, just to have fun, let’s see what happens if our program has a mistake:

This online tool is great, and now you know how to use it. Congrats!

]]>
On this mastery I’ll show you how to program in an online compiler and how to run your program in the same online tool.

There’s an online compiler and debugging tool called Ideone, which allows us to code online and then test it right there. So, go ahead and open ideone.com

Once you opened the webpage, something similar to this will appear on your screen. On the centre of the webpage is where our programs are written, On the bottom left , we have the language of the source code (which can be changed) and on the bottom right we have the run button.

Let’s create a “Hello World” program and run it:

As you can observe, our program was successful and it did output the desired outcome. 

Now, just to have fun, let’s see what happens if our program has a mistake:

This online tool is great, and now you know how to use it. Congrats!

]]>
https://creativecommons.org/licenses/by/4.0/
Matery 22 https://kenscourses.com/tc101fall2015/2015/matery-22/ Wed, 25 Nov 2015 04:04:59 +0000 http://opezaimd.tumblr.com/post/133906465560 On this mastery I’ll show you when to use what type of repetition in a program. 

For the purpose of this mastery, we’ll focus on while and for loops because they are the easiest and most used ones.

On mastery 19 we learned how to use a while loop. The while loop consists of something that will happen WHILE a condition is given. For example: WHILE x is greater or equal than 0, something will happen, and this process will continue to happen WHILE this condition is true.

On mastery 20 we learned how to use a for loop. A FOR loop is a type of loop which allows you to give specific conditions to it, and then repeat when this conditions are true.

Now, while and for may be seem like they are the same, but they certainly ain’t. The main difference between them is that FOR loops will continue happening for a given number of iterations. 

As you may recall, functions often use a for loop because of the iteration part. In someway, FOR loops are “better” when dealing with functions, while WHILE loops are great to work with inside main().

Picture and more information from this webpage.

]]>
On this mastery I’ll show you when to use what type of repetition in a program. 

For the purpose of this mastery, we’ll focus on while and for loops because they are the easiest and most used ones.

On mastery 19 we learned how to use a while loop. The while loop consists of something that will happen WHILE a condition is given. For example: WHILE x is greater or equal than 0, something will happen, and this process will continue to happen WHILE this condition is true.

On mastery 20 we learned how to use a for loop.

A FOR loop is a type of loop which allows you to give specific conditions to it, and then repeat when this conditions are true.

Now, while and for may be seem like they are the same, but they certainly ain’t. The main difference between them is that FOR loops will continue happening for a given number of iterations. 

As you may recall, functions often use a for loop because of the iteration part. In someway, FOR loops are “better” when dealing with functions, while WHILE loops are great to work with inside main().

Picture and more information from this webpage.

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 17 https://kenscourses.com/tc101fall2015/2015/mastery-17-10/ Wed, 25 Nov 2015 03:24:08 +0000 http://opezaimd.tumblr.com/post/133904163660 On this mastery I’ll show you what and how to use the conditional switch in C++.

Switch is a statement that tests a variable for equality in a list of given conditions. It is somehow a summarized version of IF when you have a lot of conditions. 

This flow chart may help you understand better, and this webpage too:

The default syntax of switch goes like this:

switch (expression)
case “condition” : outcome
[default:statement]    //This is used when the variable input isn’t a valid option.

So, for the purpose of this mastery, lets create a program were the user can input his points on masteries so far and tell him if his good or screwed. Do as follows:

  1. Create our “basic” program.
  2. Inside the int, declare a char variable with an assigned value.
  3. Use switch to condition the outcome and tell the user if his good or screwed.

Your program should look something like this:

Now let’s test it:

Let’s just play with another value:

Great! Now you know what and how to use switch conditional.

]]>
On this mastery I’ll show you what and how to use the conditional switch in C++.

Switch is a statement that tests a variable for equality in a list of given conditions. It is somehow a summarized version of IF when you have a lot of conditions. 

This flow chart may help you understand better, and this webpage too:

The default syntax of switch goes like this:

switch (expression)
case “condition” : outcome
[default:statement]    //This is used when the variable input isn’t a valid option.

So, for the purpose of this mastery, lets create a program were the user can input his points on masteries so far and tell him if his good or screwed. Do as follows:

  1. Create our “basic” program.
  2. Inside the int, declare a char variable with an assigned value.
  3. Use switch to condition the outcome and tell the user if his good or screwed.

Your program should look something like this:

Now let’s test it:

Let’s just play with another value:

Great! Now you know what and how to use switch conditional.

]]>
https://creativecommons.org/licenses/by/4.0/
#FinalProject – #TC1017 https://kenscourses.com/tc101fall2015/2015/finalproject-tc1017/ Wed, 25 Nov 2015 03:13:36 +0000 http://luisduarteitesm.wordpress.com/?p=95 ]]> So we finally got the project complete!!!

After looking a lot of videos in YouTube and searching so hard on internet we found the way to convert the image into a scale so it could be smallest.

After doing the “hard part” we search on internet how to convert an image into gray. All this functions were made with arrays, rows and columns and it is hard to understand it all but if you look closely you will find that, first, the program count the number of pixels it has. Then, it change it the color of the pixels for the gray one. For the scale, it count the pixels and reduce it by the half by a grouping them.

The only problem was that it doesn’t work with .jpg images, only with .jpeg and we didn’t find out why 🙁

I’m exiting for doing this because I was so stressed with a lot of projects and take us a while to find the way of doing it. I need to say that I need to learn more functions and commands for improving my programing but I think I learned very well in this class, good job ken!!

Project.png

GitHub code:  https://github.com/kenwbauer/TC101F15_Team18/blob/master/ProyectoFinal.cpp

Luis Alfonso Duarte Palacios

Christian Orozco

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 8 https://kenscourses.com/tc101fall2015/2015/mastery-8-4/ Wed, 25 Nov 2015 02:44:01 +0000 http://opezaimd.tumblr.com/post/133901908420 On this mastery I’ll talk about coding conventions on C++. 

Coding conventions are just a set of “guidelines” that talk about the style to format a code. For example, how to correctly use braces, commas, comments, capitalization, etc. You can read a lot more of these “rules” in these webpages:

https://en.wikibooks.org/wiki/C%2B%2B_Programming/Programming_Languages/C%2B%2B/Code/Style_Conventions

https://gcc.gnu.org/wiki/CppConventions

Since masteries 1 and 7 we’ve been using the correct style and format. If we weren’t, we could’ve just written all our codes in one line instead of multiple lines, for example, tell me how do you prefer to read a code, like this? ->

Or like this? ->

Which one is easier to read?

And know you now why there are coding conventions: to make everything look nice and easy to read.

]]>
On this mastery I’ll talk about coding conventions on C++. 

Coding conventions are just a set of “guidelines” that talk about the style to format a code. For example, how to correctly use braces, commas, comments, capitalization, etc. You can read a lot more of these “rules” in these webpages:

https://en.wikibooks.org/wiki/C%2B%2B_Programming/Programming_Languages/C%2B%2B/Code/Style_Conventions

https://gcc.gnu.org/wiki/CppConventions

Since masteries 1 and 7 we’ve been using the correct style and format. If we weren’t, we could’ve just written all our codes in one line instead of multiple lines, for example, tell me how do you prefer to read a code, like this? ->

Or like this? ->

Which one is easier to read?

And know you now why there are coding conventions: to make everything look nice and easy to read.

]]>
https://creativecommons.org/licenses/by/4.0/
This isn’t a clever titleThis WSQ was not as hard as I thought,… https://kenscourses.com/tc101fall2015/2015/this-isnt-a-clever-titlethis-wsq-was-not-as-hard-as-i-thought/ Tue, 24 Nov 2015 07:45:44 +0000 http://opezaimd.tumblr.com/post/133851393220 The Killers

This isn’t a clever title

This WSQ was not as hard as I thought, but it required research and a full understanding of what was inside the text file. I checked these webpages, I think they are useful:
http://www.cplusplus.com/doc/tutorial/files/
http://www.cplusplus.com/forum/beginner/8388/

And you can check out my code here.

]]>
The Killers

This isn’t a clever title

This WSQ was not as hard as I thought, but it required research and a full understanding of what was inside the text file. I checked these webpages, I think they are useful:
http://www.cplusplus.com/doc/tutorial/files/
http://www.cplusplus.com/forum/beginner/8388/

And you can check out my code here.

]]>
https://creativecommons.org/licenses/by/4.0/
1as7 one https://kenscourses.com/tc101fall2015/2015/1as7-one/ Tue, 24 Nov 2015 07:22:28 +0000 http://opezaimd.tumblr.com/post/133850598880 image

Last WSQ of the semester, I can’t explain how fast it went!

I found Scilab as a very useful tool since it can do many things simultaneously. You have a text editor and it also graphs! It is indeed amazing and I know it may be useful in the near future for the career. 

]]>
image

Last WSQ of the semester, I can’t explain how fast it went!

I found Scilab as a very useful tool since it can do many things simultaneously. You have a text editor and it also graphs! It is indeed amazing and I know it may be useful in the near future for the career. 

]]>
https://creativecommons.org/licenses/by/4.0/
Project https://kenscourses.com/tc101fall2015/2015/project-11/ Tue, 24 Nov 2015 02:59:48 +0000 http://opezaimd.tumblr.com/post/133837316895 Today Ale and I finally did some serious advance in the fina project. We did a lot of research and we were able to run one part of the project, modifying the image to black and white. Here are some of the webpages we used:

Basic command-lines:
http://www.imagemagick.org/script/command-line-tools.php
http://www.imagemagick.org/script/command-line-processing.php

Convert input image to b&w/grayscale: 
http://www.imagemagick.org/script/color.php
http://www.imagemagick.org/script/color-management.php
http://stackoverflow.com/questions/13317753/convert-rgb-to-grayscale-in-imagemagick-command-line 

And that’s pretty much it. We will try to finish the project by doing the “second part” about resizing the image tomorrow. In the meantime, you can check our code here.

P.S. Here is how it’s shown in Ubuntu:

]]>
Today Ale and I finally did some serious advance in the fina project. We did a lot of research and we were able to run one part of the project, modifying the image to black and white. Here are some of the webpages we used:

Basic command-lines:
http://www.imagemagick.org/script/command-line-tools.php
http://www.imagemagick.org/script/command-line-processing.php

Convert input image to b&w/grayscale: 
http://www.imagemagick.org/script/color.php
http://www.imagemagick.org/script/color-management.php
http://stackoverflow.com/questions/13317753/convert-rgb-to-grayscale-in-imagemagick-command-line 

And that’s pretty much it. We will try to finish the project by doing the “second part” about resizing the image tomorrow. In the meantime, you can check our code here.

P.S. Here is how it’s shown in Ubuntu:

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