Friday, February 25, 2011

pybiblio

Today i was about to star working on turning and old HTML to the HTML5 which is the new one. Wondering how to copy the file from the other user account to my account 
 cp -R ../../obp/public_html/pybiblio/ .
(cp) is for copy, the -R is to make sure  we copy the folder and if there is another folder it will copy also, the (../../) is the same like (home/public_html) and the obp/public_html/pybiblio/ . is from where we are coping the file and teh ( .) space dot is to copied to your account.

Working on this website will be a big proyect.

Thursday, February 24, 2011

Thursday

Today I learn a command for vim which is how to substitute a word for another word.

g/old_word/s//new_word/g

when you are editing a file and you have several words and they are the same and you don't want to change one by one this command is helpful. The (g) in the command above is (global) and the (s) is for (substitute) and the other (g) is to tell that you want to change that word all over the file you are editing.

Wednesday, February 23, 2011

Monday

Working on python3 today. After working in example  and type everything and I was ready to check out the application. Something when wrong with my command line but I cannot see it.
This is the command line.


After running the program I get this error:


 
I don't know why this is happing but I will go over this commands and try to find out what is going on.

Friday, February 18, 2011

Friday

Today I was working python lessons and I like this tutorial that help you to average a certain of number in this application I can put the many number. This is the application codes:

count = 0
usum = 0.0
number = 1

print("Enter 0 to exit the loop")
while number != 0:
    number = float(input("Enter a number: "))
    if number != 0:
        count = count + 1
        usum = usum + number
print("The average was:", usum / count)

I I don't understand why the exclamation (!) sing in the lines (while number != 0:) and (if number != 0:)

Thursday, February 17, 2011

Thursday

Working on the website and I note that my syntax wasn't on so I ask my teacher how to do it. He explain me how to do it.
When you are editing a file you press (Esc) then (:) and type syntax on.

Tuesday, February 15, 2011

Tuesday

Working in the examples I found an interesting one that is about the events and odds number which is this code.

number = float(input("Tell me a number: "))
if number % 2 == 0:
    print(int(number), "is even.")
elif number % 2 == 1:
    print(int(number), "is odd.")
else:
    print(number, "is very strangeris very stranger.")

This is a very interesting because if I put  number 2 this program will tell me if this is and even or odd number. This program will tell you any number you put in, even if the number is negative.

Monday, February 14, 2011

Monday

Working on a example of python3 I found  commands that make application that ask you for a  number. This add would ask to guess a number and depending on what you type it will said "That number is too big." or if the number is low "This number is too low."

Python3
Command line.

number = 200
guess = 0

while guess != number:
    guess = int(input ("Guess a number: "))
    if guess > number:
        print("That number is too high.")
    elif guess < number:
        print("That number is too low.")
    else:
        print("Just right")


If you see at the top of the command line where it said (number=200) this is the number that will give you a message saying "Just right".
Look if I put a number that is higher than 200.

 and now look if I put a lower number.


However look when I put the correct number which is 200.


 This application will ask you for a number until you get the right number and it will keep saying that the number is too high or low. This will depend on the number you put when it ask you.

Friday, February 11, 2011

Friday

I was working on python3 and I was stuck in an example  that I couldn't  understand but after reading the tutorial several times.
Here whats the commands lines:

a = 0
while a < 10:
    a = a + 1
    if a > 5:
        print(a, ">", 5)
    elif a <= 7:
        print(a, "<=", 7)
    else:
        print("Neither test was true")

Thursday, February 10, 2011

Python3

I was making my blog from yesterday because I don't know what happen to it that it didn't appear in my blog. Today I was just looking at the next coming examples of python3 and tomorrow I will move to the next lesson.
I couldn't have done  that much today because of the early release.

Feb/9/2011

I was working in a small application that ask you to enter a password bu the is a password that will be the correct take a look at the commands.

password = str()
while password != "unicorn":
    password = input("Put your Password: ")
print("Welcome in")



this will keep asking you about a password but if you don't know the password you will bot able to get in .
 I the second line of the command It said I you enter the password is "unicorn" you will get a message "Welcome in" . Some screen shot:




in this picture I type "lady" as a password and as you see it ask me for it, again.
Look if I type the password unicorn that is located in the second line of the application.




When I type the password "unicorn" it will said: Welcome in.

Tuesday, February 8, 2011

Infinite loops

Today working on the Example of python3 I found an interesting command which was Infinite loops.
 This is the command:
while 1 == 1:
    print("Help, I am stuck in a loop.")



This command will keep  printing "Help, I am stuck in a loop." because 1 is equal to 1, thats the first command where it said (while 1 == 1), then there was no way to stop it after I run it but I read the tutorial and found that with (Ctrl + c) this command will stop.

I am getting more interesting in Python.

 



Friday, February 4, 2011

HTML5 and Python3

Yesterday I was searching about HTML5  and I found this tutorial. This tutorial combine the HTML5 and CSS3. Today I was working on the website and creating a navigation and styling the website and here is my website but I'm just in the header section.
Also I was practicing python3  creating a new a file named Rate_times.py in this file will calculate time depending of the Rate and Distance you put and the result is the time.
Example:

Rate: 2
Distance: 20
Time: 10.0

This divide the Distance by Rate and the result is time. You can notice the division and the last command.

This is the Command .

print("Input a rate a distance")
rate = float(input("Rate: "))
distance = float(input("Distance: "))
print("Time: ", (distance / rate))

I was typing the other example in python but I couldn't finish but I will work on next week.

Here is a Screen shot of how it should look at the end.

Thursday, February 3, 2011

Back to Python3

Back to python3 just for today but I learn that (" ") will give me a space between characters.
Example:

>>>"This" + " " + "is" + " joined."

The result will be

>>>"This is joined."

This one of the things I learn today. Another thing I like was this command that will check if the sentences are the equal or the the same (==) this two equal signs in python are like saying that those two sentences are equal.
  
>>>"Hello, " + "World!" == "Hello, World!"

This command in python3 will prove that this two are the same and it will give me message like this.

>>>True

This was what I was working today.  Tomorrow I will go back to Google Sites to finish the calendar.

Wednesday, February 2, 2011

Working

I was working on a calendar today I notice something when I put the calendar to the website where is going to be. When I was making the calendar I put an event that was from 8:00 pm to 9:00 pm; however, when I Put the calendar on the website it show that the event was from 20:00 pm to 21:00 pm. Tomorrow I will try to find out why the calendar did this change.

Tuesday, February 1, 2011

Working

I was working on my Google Side when I get a good chance to used my skills. This chance was to create a calendar for and I found that every single time I get  out my Google Account  my calendar didn't show up and I looking at the calendar setting I found out that my calendar wasn't check to published and so that why it didn't show up.
Now you can check my calendar which doesn't have anything in but it works.