All future posts and awesome projects will be available at:
danielmaksimovich.info
Sunday, November 8, 2015
Saturday, March 8, 2014
This Blog
I am a University Student at California - excited to become a good programmer.
This blog is meant for personal development, as well as a tool to help me see the progress I make learning programming. Every now and then, I''ll be posting snippets of code/program and discuss what I learned from it. Your free to join me if you'd like! :)
I also run a small music channel:
Inspired Music
This blog is meant for personal development, as well as a tool to help me see the progress I make learning programming. Every now and then, I''ll be posting snippets of code/program and discuss what I learned from it. Your free to join me if you'd like! :)
I also run a small music channel:
Inspired Music
Thursday, March 6, 2014
Graphing Module Python #2
In this version, I've changed the coordinate system, as well as adding lines to establish x and y-axes. I am trying to having the program draw a line from one point to the other, and ultimately have the graph resemble a more realistic portrayal of a graphing calculator (getting there at least).
Wednesday, March 5, 2014
Cheap Graphing Module built with Python
There were two main algorithms in this program that really defined the very core of what this program does (which is simply act like a graphing module in a graphing calculator). The first was range described by a function f(x). In this case, y was the changing variable, and based of each point in x, 'y' would change a certain amount e.g f(x) = tan(x), where f(x) would change based off each value of y. This was described through a for loop where each value of y would appended to a new list, and hence print the y coordinates.
The next challenge was the print each pair coordinate of x and y. I did this using another for loop that first linked the length of either x_value or y_value, and used the range command to interval each individual point for Point(x[i] and y[i]).
The next challenge was the print each pair coordinate of x and y. I did this using another for loop that first linked the length of either x_value or y_value, and used the range command to interval each individual point for Point(x[i] and y[i]).
Tuesday, March 4, 2014
Graphing the Line of Best Fit
There was a lot of information covered throughout this code. Here are some of the things I've learned:
- Setting win.setCoords(0,0,x,y) is what allows us to follow a coordinate system just like in the first quadrant of the classic graph interface.
- This project required gathering information only through the user clicking on the screen, and clicking 'Done' when he/she finishes. I've accomplished this with a very cool technique:
- While True, will continue through a infinite loop, and if the user clicks within the premise of the defined rectangles (in green), the while loop will 'break'. In any other case, each point should be conveniently drawn for the user as well as recorded for the regression line.
- Next, I've gone through a series of for loops that computed the sum of the recorded x and y values.
- One particular loop that I've learned was one that found the sum of the product of x(y).
- To do this, I've set one loop that follows through the length of either range x or y, and set to multiply the recorded values of x and y through slicing.
- Finally after formulating the slope of the line, and defining it's y-intercept, the challenge was to plot a line that extended through out the window, as shown below.
- The first point was simple, as it is merely the y int. In the second, I knew I had to extend x to the range of my defined window,(set through GraphWin); it's y-cord was based reletively on the ratio of slope 'm'(window) + P1
Sunday, March 2, 2014
Understanding Double For Loops
Here, is presented two for loops set with two arbitrary lists. The first loop essential controls the outcome of the other. However, every said number its respective for loop is used.
The process goes as follows:
The first loop is changing which the second loop remains consistent.
The process goes as follows:
The first loop is changing which the second loop remains consistent.
Saturday, March 1, 2014
Calculate the Area and Perimeter of any Rectangle
In this program I've learned to adjust the width of a program. The width could be incorporated in 'GraphWin'. Points could also become identified by creating a variable that logs the user to 'getMouse()', and follow through with a 'click'. Following this, we can identify each x and y coordinate by identifying said variable with 'getX()' and 'getY()' respectively.
Entry boxes are a nice way of outputing data. After defining a short algorithm that calculates the area nd perimeter of said 'rectangle', we can output the results graphically use an 'Entry' syntax. When creating an entry the first step would be to create a graphical interface for the entry box. This could be obtained with the syntax: 'Entry([Point(x,y)], [width])'. After setting this, we can place any reasonable text inside. We can do this with the sytax [variable].setText([variable]). I obtained a 'nontype' error when I set.Text in the entry [variable] draw in the window like this:
entry1 = Entry(Point(150, 40, 10)).draw(win)
I fixed this by changing it to the following:
entry1 = Entry(Point(150, 40), 10)
entry1.draw(win)
set.Text worked in the case above because there was a recognizable variable in which 'entry1' was set. In the case where it would drawn immediately, it was recognized as a 'drawing' feature.
Subscribe to:
Posts (Atom)