Tag Archives: #4c93cb

#TC1014#Mastery5 #Mastery6

#proyecto #TC1017

1017

al finalizar mi proyecto, me siento realmente satisfecha con el trabajo que hicimos mi compañero Pablo y yo.

para mi fue muy dificil iniciarlo, pero Pablito me ayudó jaja

creo que lo mas dificil fue hacer las condiciones, porque necesitabamos usar demasiada logica, pero cometiendo errores se aprende, y fue asi el resultado, aprendí .

 aqui esta nuestro hermoso proyecto

:

https://github.com/kenwbauer/PabloMitzi

gracias por la ayuda Ken 🙂 

#TC1014 #WSQ08

 

Hice esta WSQ usando funciones de dos maneras, asignando valores de retorno a cada funcion o imprimiendo en cada funcion el resultado. Cualquiera de las dos formas es efectiva dependiendo de lo que estes buscando, si el resultado lo usaras muchas veces es mejor utilizar valores de retorno para asignar un nuevo valor a la variable, cuando se ejecute la funcion.

El entender como utilizar funciones nos puede ahorrar muchas lineas de codigo ya que simplifica las cosas cuando son bien implementadas.

Aqui esta mi codigo:

https://gist.github.com/Irvingutierrez/eee77481c55d297d2558

Referencias:

Summerfield, M. (2009). programming in python 3. Madrid, España. Ediciones Anaya.

1014  08

Scilab #WSQ17 #TC1017

17 1017

Hello dudes 😀

This WSQ is about  SciLab but what is it ? Well let me tell you this is a mathemathical enviroment created to help you to make calculations, programs, functions an plots.  It’s very entretaining even you can play  all day doing  functions, plots and vectors, whatever its awesome.

Maybe you will ask If its difficult to use but thats no the case e it’s very simple to use it 🙂 you can solve all the problems you could have in you career.  I found this tutorial for download this program this help me to download in my MAC 🙂  I think is the same for Windows.

Here is a a tutorial for beginners 

http://www.scilab.org/content/download/849/7901/file/Scilab_beginners.pdf

For Yosemite Users

 http://www.scilab.org/content/view/full/1266

For download this follow this link 🙂 

https://www.scilab.org

 

17 1017

Lists in Python #Mastery23

My video on the creation and use of lists in Python:

https://www.youtube.com/watch?v=i-4Ma0iCeIY&feature=youtu.be

Oscar Ricardo López López A01229116

23

#Mastery23 #Mastery26 #TC1017

Vectores y matrices

los vectores y matrices son casi lo mismo, solo el plano en el que trabajan es diferente en cada uno de los casos, dependiendo de cual uses

Un vector, también llamado array(arreglo) unidimensional, es una estructura de datos que permite agrupar elementos del mismo tipo y almacenarlos en un solo bloque de memoria juntos, uno despues de otro. A este grupo de elementos se les identifica por un mismo nombre y la posición en la que se encuentran. La primera posición del array es la posición 0.

Podríamos agrupar en un array una serie de elementos de tipo enteros, flotantes, caracteres, objetos, etc.

Crear un vector en C++ es sencillo, seguimos la siguiente sintaxix: Tipo nombre[tamanyo];

Ejm:

 
 
 
int a[5]; // Vector de 5 enteros
float b[5]; // vector de 5 flotantes
Producto product[5]; // vector de 5 objetos de tipo Producto

Podríamos también inicializar el vector en la declaración:

 
 
 
int a[] = {5, 15, 20, 25, 30};
float b[] = {10.5, 20.5, 30.5, 12.5, 50.5}
Producto product[] = {celular, calculadora, camara, ipod, usb}

Como hay 5 elementos en cada array, automáticamente se le asignará 5 espacios de memoria a cada vector, pero si trato de crear el vector de la forma int a[] , el compilador mostrará un error, porque no indiqué el tamaño del vector ni tampoco inicializé sus elementos.

https://ronnyml.wordpress.com/2009/07/04/vectores-matrices-y-punteros-en-c/

Tambien estos incluyen las matrices.

las cuales funcionan:

bidimensional. La manera de declarar una matriz es C++ es similar a un vector:

1
int matrix[rows][cols];

int es el tipo de dato, matrix es el nombre del todo el conjunto de datos y debo de especificar el numero de filas y columnas.

Las matrices también pueden ser de distintos tipos de datos como char, float, double, etc. Las matrices en C++ se almacenan al igual que los vectores en posiciones consecutivas de memoria.

Usualmente uno se hace la idea que una matriz es como un tablero, pero internamente el manejo es como su definición lo indica, un vector de vectores, es decir, los vectores están uno detrás del otro juntos.

La forma de acceder a los elementos de la matriz es utilizando su nombre e indicando los 2 subíndices que van en los corchetes.

Si coloco int matriz[2][3] = 10; estoy asignando al cuarto elemento de la tercera fila el valor 10.

Mastery 04

Como subir trabajos en Blog RSS

Como estoy haciendo en este momento, subiendo un trabajo en el blog rss, lo pondre por pasos:

  1. el primer paso es crear una cuenta en este sitio: https://withknown.com/
  2. ya teniendo una cuenta en este sitio procederemos a crear una entrada, en tu pagina principal podras ver que existen diferentes simbolitos en los cuales le puedes picar y te permitira hacer varias cosas, como poner estados, hacer post, poner fotos, poner audios, etc. mi preferido y lo que yo recomiendo para poder subir trabajos con mayor comodidad, es elegir el post
  3. ya elegido el post, deberas proceder a ponerle un titulo, en el cual debes indicar cual actividad es y de cual grupo eres pero no olvides poner antes de cada información un signo de # por ejemplo04 1017.
  4. lo siguiente es escribir lo que hiciste y todo lo que dice la actividad, no olvides ponerle fotos para que sea mas dinamico y llame mas la atención, esto se puede hacer en la pequeña barra de arriba en donde esta un simbolo de un rectangulo con unas montañitas, ahi le picas, te sale una ventana, seleccionas la foto la subes y ya
  5. al final, para que ya sea publicado le picas abajo donde dice “publish” y tu tarea estara publicada

Reading and writing of files in Python

For reading and writing of files in python, the first thing you need to do is to get a file object, using the “open” function.

The open function has two parameter, the first one is the name of the file that we are creating and the other parameter is going to check if you are going to read(r) or write(w) the file. Now to write inside the file you need to write the name of the object we just created followed by a dot with the word “write” adn you open parenthesis where you are going to write the text.It is important to point out that the end line is given by “/n”. To save it we just have to close our object.

this is the syntax: file = open(“newfile.txt”, “w”)

                                           file.write(“hello worldn”)

                                           file.write(“this is another linen”)

                                           file.close() 

the object name is file and the text file is example.

Now we know how to use write(), I can explain read().

read() is used for reading the text file. The syntax is very simple like with the write() method, just where we wrote “w” now we have to write “r”.

this is the syntax of this:

                                              file = open(‘newfile.txt’, ‘r’)

                                              print file.read()

                                              file.close()

In this example it shows us the two parameters, the first one tells us what the text file is going to open and the second parameter tells us what is going to do. In this case “r” means that is going to read. Print means that when you are in the terminal, it will print the text that is in the file. In this case it will print:

                                              hello world 
                                              this is another line

We can also specify how many characters the string should return, by using
file.read(n), where “n” determines the number of characters.

This reads the first 5 characters of data and returns it as a string.

In this case, it will print : hello

I learned all this stuff on this web page, you may want to check it out:  http://www.pythonforbeginners.com/files/reading-and-writing-files-in-python

30

1014

Reading and writing of files in Python

                                                                                                                     @PablO_CVi

For reading and writing of files in python, the first step is to get a file object, and how we do this? well using the open” function.

The open function has two parameter, the first one is the name of the file that we are creating and the other parameter is going to check if you are going to read(r) or write(w) the file. Now for write inside of the file.write the name of the object we created followed by a dot with the word “write” adn you open parenthesis where you are going to write the text.Also is important to mark that the end line character is given by “/n”.And for save it we have to close our object.

this is the syntax: file = open(“newfile.txt”, “w”)

                                           file.write(“hello world in the new filen”)

                                           file.write(“and another linen”)

                                           file.close() 

the object name is file and the text file is example.

Now we know how to use write(), I can explain read().

usisng read() is use it for read the text file. the syntax is very simple like in write() method, just where we wrote “w” now we have to write “r”.

this is the syntax of this:

                                              file = open(‘newfile.txt’, ‘r’)

                                              print file.read()

                                              file.close()

In this example show us the two parameters, the first one tell us what text file is going to open and the second parameter tell us what is going to do, in this case “r” means that is going to read.And print mean that when you are in the terminal will print the text that is in the file. In this case it will print:

                                              hello world in the new file
                                              and another line

We can also specify how many characters the string should return, by using
file.read(n), where “n” determines number of characters.

This reads the first 5 characters of data and returns it as a string.

this will print : hello

I have learned all of these here: http://www.pythonforbeginners.com/files/reading-and-writing-files-in-python.

Use of Recursion for Repetitive Algorithms

In some cases we may see that in order to compute a given problem we need to do the same procedure several times, which may turn our source code into a nightmare, making it very very long and very easy to get lost into. So for this cases the use of recursion is very important. 

Recursion is a way of programming in wich you use the same function in a function. Yeah, that’s right you can actually make a function call inside itself. The most common example of recursion is the factorial fuction. The factorial function has a definition that is recursive itself. When you want to compute the factorial of a number you can actually define it as the number times the factorial of the number before it. 

Let’s make the example a little easier to understand:

def factorial(n):

      if n == 1: 

            return 1

      else:

           return n * factorial(n-1)

In this case we can see that the factorial function has a factorial function inside it. This helps us recalculate the factorial many many times, until the n takes the value of 1 which is the smallest factorial. So if we want the factorial of 4, we will calculate the factorial of 3, 2 and 1 to help us calculate it.

Recursion is very important to help us simplify problems and give a more cleaner estructurated solution, instead of having chunks and chunks of code for solving the same problem for different scenarios.

The correct usage of rescursion is very important when programming. The usage of functions is other way to simplify some very complex programs. Many times when you see that your main is a giant block of code you should try and see that much of it can be redefined using functions, where much of those lines can become just some function calls.

This is for my  of my