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
<br /> <b>Warning</b>: Undefined array key "feed" in <b>/home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/gregs-high-performance-seo/ghpseo.php</b> on line <b>430</b><br /> <br /> <b>Warning</b>: Trying to access array offset on value of type null in <b>/home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/gregs-high-performance-seo/ghpseo.php</b> on line <b>430</b><br /> <br /> <b>Warning</b>: Undefined array key "feed" in <b>/home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/gregs-high-performance-seo/ghpseo.php</b> on line <b>431</b><br /> <br /> <b>Warning</b>: Trying to access array offset on value of type null in <b>/home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/gregs-high-performance-seo/ghpseo.php</b> on line <b>431</b><br /> TC101 Fall 2015 https://kenscourses.com/tc101fall2015 Introduction to Programming Python and C++ Thu, 05 May 2016 03:20:56 +0000 en hourly 1
Warning: Undefined array key "feed" in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/gregs-high-performance-seo/ghpseo.php on line 430

Warning: Trying to access array offset on value of type null in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/gregs-high-performance-seo/ghpseo.php on line 430

Warning: Undefined array key "feed" in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/gregs-high-performance-seo/ghpseo.php on line 431

Warning: Trying to access array offset on value of type null in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/gregs-high-performance-seo/ghpseo.php on line 431
https://creativecommons.org/licenses/by/4.0/ Course Review!!! https://kenscourses.com/tc101fall2015/2016/course-review/ Thu, 05 May 2016 03:20:56 +0000 http://andreatrejod.wordpress.com/?p=390 ]]> So first of all I’m about to let you know that I’m definitely #teamthor even if it’s not in civil war movie, which team are you guys??

Course Review!!!

Ok now, moving on…

Esta parte la haré en español porque creo que podré expresarme mejor. Este curso fue muy diferente a todos los cursos de las otras materias, en el video doy una idea general, y con diferente me refiero a que es un curso en el que puedes demostrar tus habilidades de autoaprendizaje, y yo lo vi más como un reto para darte cuenta si realmente te gusta la materia entonces vas a buscar información para realizar las tareas y quizes. Aunque también fue un poco difícil porque es la única materia con esta “modalidad” entonces algunas cosas las dejé de último momento, como esta, pero de verdad disfruté mucho el curso y espero que el video les agrade.

Aquí dejo una lista de lo que aprendí en el semestre en python:

  • Use of comments
  • Python conventions
  • Basic types and their use
  • Basic output (print)
  • Basic user input (text based)
  • Calling functions
  • Creating functions
  • Importing and using modules/libraries
  • Creating and using your own modules/libraries
  • Use of the conditional “if”
  • Use of “else” with a conditional and elif for Python
  • Nesting of conditional statements
  • Use of loops with “while”
  • Use of loops with “for”
  • Use of recursion for repetitive algorithms
  • When to use what type of repetition in a program
  • Creation and use of Lists/Tuples
  • Creation and use of strings
  • Validated user input (ensure correct/expected data entry)
  • Reading and writing of text files

And here are all my codes for all the wsq’s and quizes since I was missing some of them.

GitHub

Thanks for all Ken!!

 

]]>
https://creativecommons.org/licenses/by/4.0/
Quiz#7 https://kenscourses.com/tc101fall2015/2016/quiz7-3/ Thu, 05 May 2016 02:12:36 +0000 http://andreatrejod.wordpress.com/?p=370 ]]> The last quiz finally!!!!

The Quiz

In mathematics, the dot product, or scalar product (or sometimes inner product in the
context of Euclidean space), is an algebraic operation that takes two equal-length
sequences of numbers (usually coordinate vectors) and returns a single number.

Algebraically, it is the sum of the products of the corresponding entries of the two
sequences of numbers

What to Do

Create a function called dot_product that receives two lists of numbers (say list1 and
list2). The function returns what is the dot product of the two lists.

For full marks, if the lists are not the same size, then the function should return the
special value of NaN (which represents not a number).

  • For Python, you can create this value with the expression: float(‘NaN’)
  • For C++, check here: http://www.cplusplus.com/reference/cmath/nan-function/

Example. If the input is [2,4,5,6] and [1,2,3,4] the result will be 49 since (2*1)+(4*2)+(5*3)+(6*4) = 49

So this was me trying to do this quiz

**Thanks to this program we can make the product of two lists, it’s very simple, you only multiply each number of the list one by one, but as always in life, there’s one exception, if the size of the list is not equal, then you can’t make the product of the lists, so we have to make a conditional that makes sure to compare the size of the lists and it tells you if there are equals or not, to know the size of the list we can use len.

So here’s the screenshot of the program

And the link in GitHub

Quiz#7

]]>
https://creativecommons.org/licenses/by/4.0/
Quiz#4 https://kenscourses.com/tc101fall2015/2016/quiz4/ Mon, 02 May 2016 15:47:44 +0000 http://andreatrejod.wordpress.com/?p=178 ]]>  

This was my face when I realized I was missing Quiz #4 too:

Quiz#4

The number e is an important mathematical constant that is the base of the natural logarithm. It is approximately equal to 2.71828,[1] and is the limit of (1 + 1/n)n as n approaches infinity, an expression that arises in the study of compound interest. It can also be calculated as the sum of the infinite series.

Quiz#4

Create a function called euler_calc with a single parameter precision. The value of                  precision is used to determine when to stop calculating. Your calculation will stop                  when the two consecutive values estimating e differ by less than precision (remember          to use absolute value when calculating the difference between two values here).

So when I finished reading this, my face was just like WTH is this, so I did my research and I found some interesting stuff, because I didn’t understand a thing about this quiz haha.

In order to understand a little bit more of this number  you can check this link out, it explains perfectly what this number is about, so you can do your program better,and one way to know if the program is working correctly is knowing that the maximum value of the e number is:2.71828…so basically the user have to give you the parameter and the program will stop when this is between 2 numbers I think :S.

So here’s the screenshot of the program and the code in GitHub

Quiz#4

]]>
https://creativecommons.org/licenses/by/4.0/
#Wsq8 https://kenscourses.com/tc101fall2015/2016/wsq8-2/ Mon, 02 May 2016 15:27:13 +0000 http://andreatrejod.wordpress.com/?p=335 ]]> So I realized that I didn’t post some of the wsq and quizzes, now I get why Ken gave me a lower grade in the partials haha, damn it wordPress so here’s Wsq 8, which is about functions

In this program we reuse the concepts of the code, using “Fun with Numbers”but the only and huge difference is that we have to make a function, ok, this funciotn get  2 inter values, to begin with the program I declare 5 functions which are called: suma, multiplicación, división y residuo.

So here’s the screenshot of the program and the terminal:

#Wsq8

And the code in GitHub

 

 

]]>
https://creativecommons.org/licenses/by/4.0/
#Wsq13 https://kenscourses.com/tc101fall2015/2016/wsq13-29/ Mon, 02 May 2016 04:37:51 +0000 http://andreatrejod.wordpress.com/?p=305 ]]> So here’s the exam with some (a lot of) corrections, it was easy, but man I get too nervous in the exams, it’s difficult to me to concentrate, but anyway here it is:

1.-Escribe el función distancia cual recibe 4 números (x1, y1, x2, y2) cuales representan dos puntos en espacio (x1,y1) y (x2,y2). El método debe regresar la distancia entre los dos puntos. Recuerda que el valor cuadrada del hipotenusa del triangulo es igual que la suma de las cuadradas de los otro dos lados del triangulo (the hypotenuse squared is equal to the sum of the squares of the other two sides).

This one was a very easy actually, so here’s the screenshot of the program

#Wsq13

2.-(5 puntos) Escribe un función que se llama triangulo cual recibe un parámetro size y imprime un triangulo derecho como el siguiente. El renglón mas grande debe llevar size numero de “T”. SOLO imprime los “T”s y los endlines. Nota que no hay characteres (espacios) a la derecha de los T’s. Debe usar un ciclo “for” para controlar el repetición. Ejemplo es si size era 6.

Here’s number two:

#Wsq13

3.-Escribe un función que se llama superpower(a,b) con dos parameters de (enteros / int). Debe regresar el valor del primer parametro al poder del segundo, o mejor decir a b . No puedes usar un función de modulos de Python para hacerlo directo, pero con un ciclo usando multiplicación. Ejemplos: superpower(4,2) es 16 superpower(3,4) es 81:

#Wsq13

(5 puntos) Escribe un función que se llama fibonacci cual recibe como parametro un entero no negativo (int) “n” y regresa un entero cual representa el numero en la serie de fibonacci en posicion n. La definición (modificado) del serie de Fibonacci para hoy es: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 ……….. Entonces fibonacci(0) es 0, fibonacci(5) es 5, fibonacci(8) es 21, fibonacci(10) es 55.

#Wsq13

And all the codes in GitHub

 

 

]]>
https://creativecommons.org/licenses/by/4.0/
#Wsq12 https://kenscourses.com/tc101fall2015/2016/wsq12-30/ Sat, 30 Apr 2016 03:16:52 +0000 http://andreatrejod.wordpress.com/?p=236 ]]> Dear blog, it’s been a while since my last post haha, but well it’s almost the en of the course!!! yay!! so I need to get this posts done, I’m in a good mood so I have to take advantage of that haha…

Ok here’s Wsq12:

What to Do

Create a program that asks the user for a word which will be your search word and the name of a file to open and search for that word. Then create a function that will receive two parameters (both string) representing those two data points. This function returns the number of occurrences of that word in that file.

Details

You will need to open a file and read the text line by line. This is straight forward in Python since you can treat the file as a list of lines (strings) and iterate over that using a for loop. Check the section “Looping over a file object” in this link for an idea but your book also has this information

The link that Ken provide us was very useful, you should check it out

Also this link help me to understand a little bit more of this files thing in python.

Here are the screenshots of the program and terminal and the code in GitHub as well.

#Wsq12

#Wsq12

So I hope you can use this, and see you well read you soon!!

 

]]>
https://creativecommons.org/licenses/by/4.0/
diegotc101 2016-04-25 18:02:43 https://kenscourses.com/tc101fall2015/2016/diegotc101-2016-04-25-180243/ Mon, 25 Apr 2016 23:02:43 +0000 http://diegotc101.wordpress.com/?p=242

]]>
https://creativecommons.org/licenses/by/4.0/
diegotc101 2016-04-07 20:05:20 https://kenscourses.com/tc101fall2015/2016/diegotc101-2016-04-07-200520/ Fri, 08 Apr 2016 01:05:20 +0000 http://diegotc101.wordpress.com/2016/04/08/240/

]]>
https://creativecommons.org/licenses/by/4.0/
diegotc101 2016-04-07 19:49:34 https://kenscourses.com/tc101fall2015/2016/diegotc101-2016-04-07-194934/ Fri, 08 Apr 2016 00:49:34 +0000 http://diegotc101.wordpress.com/2016/04/08/238/

]]>
https://creativecommons.org/licenses/by/4.0/
#Wsq11 https://kenscourses.com/tc101fall2015/2016/wsq11-25/ Thu, 07 Apr 2016 05:47:26 +0000 http://andreatrejod.wordpress.com/?p=219 ]]> Bueno este wsq fue tan difícil de realizar que solo por eso lo voy a poner en español jaja, y esto es de lo que se trata:

Your jobs is to create a program that asks the user for two pieces of data:

  • The lower bound of the sequence
  • The upper bound of the sequence
Then you check the values from the lower bound (inclusive) to the upper bound (inclusive) and make a report of them. During the analysis of each number, if a Lychrel number is found it should be reported immediately with something like “Found a Lychrel number: 196”

Details

The report must show:
  • The range of numbers analysed (lower to upper bound)
  • The number of natural palindromes (no addition to inverse needed)
  • The number of non-Lycherels encountered (become palindromes)
  • The number of Lycherel number candidates (that did not converge to palindrome)

Since you will not be able to prove that a number is Lycherel (since you cannot computer forever to check), our definition for a Lycherel candidate will be if a number does not converge after 30 iterations of applying the addition to the inverse.

Wow, Ken si que se esforzó en complicarnos un poco la vida jaja, primero que nada tenemos que entender que es un número Lychrel y este link fue de gran ayuda.

Para entender un poco mejor que era lo que necesitábamos hacer realmente en el programa el video de Ken fue de gran ayuda, y lo dejo aquí por si alguien no lo ha visto.

Y después de varios intentos fallidos, el programa funcionó correctamente, o al menos eso creo. Aquí están los screenshots :

#Wsq11

the second part and the terminal:

#Wsq11

and the code un GitHub

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