Archive for April, 2008
Some Videos about Olympics and Tibet
Thursday, April 10th, 2008Steve Jobs Speaks out
Sunday, April 6th, 2008On what drives Apple employees
“We don’t get a chance to do that many things, and every one should be really excellent. Because this is our life. Life is brief, and then you die, you know? So this is what we’ve chosen to do with our life. We could be sitting in a monastery somewhere in Japan. We could be out sailing. Some of the [executive team] could be playing golf. They could be running other companies. And we’ve all chosen to do this with our lives. So it better be damn good. It better be worth it. And we think it is.”
On finding talent:
“When I hire somebody really senior, competence is the ante. They have to be really smart. But the real issue for me is, Are they going to fall in love with Apple? Because if they fall in love with Apple, everything else will take care of itself. They’ll want to do what’s best for Apple, not what’s best for them, what’s best for Steve, or anybody else.
“Recruiting is hard. It’s just finding the needles in the haystack. We do it ourselves and we spend a lot of time at it. I’ve participated in the hiring of maybe 5,000-plus people in my life. So I take it very seriously. You can’t know enough in a one-hour interview. So, in the end, it’s ultimately based on your gut. How do I feel about this person? What are they like when they’re challenged? Why are they here? I ask everybody that: ‘Why are you here?’ The answers themselves are not what you’re looking for. It’s the meta-data.”
Steve Jobs Commencement Speech
Sunday, April 6th, 2008I am honored to be with you today at your commencement from one of the finest universities in the world. I never graduated from college. Truth be told, this is the closest I’ve ever gotten to a college graduation. Today I want to tell you three stories from my life. That’s it. No big deal. Just three stories.
(more…)
ruby (6)
Friday, April 4th, 2008Output a file in Ruby:
Open and Write to the File in Ruby
Step 1:
Open the file you wish to output.
Step 2:
Use the File.open method and pass the filename and a “mode string.” The mode string should be either “w” or “a.”
Step 3:
Using “w” will delete all data already in the file. Using “a,” will append any data you write to the file to the end of that file.
Print Data
Step 1:
Print formatted data with the printf method. If you need to write a sequence of numbers or strings, the printf method and format strings are a powerful tool in Ruby.
Step 2:
Choose one of the many options that go beyond simply printing a string or integer. The argument to print is called a “format string.” It consists of the string you want printed, with a number of codes inside that will be expanded.
Step 3:
For example, using “This is a number: %d,” will print the string “This is a number: ” and then a decimal number.
(more…)
ruby (5)
Friday, April 4th, 2008Input file in Ruby:
Input a File
Step 1:
Identify the filename of the file you want and open it.
Step 2:
Determine whether you want to read from the file, write to the file or both. If you want to read a file, pass “r” as the second argument to File.open. If you want to write, pass “w”. To do both, pass “r+”.
Step 3:
Create a new File object with the File.open method and store the result in a variable:
f = File.open(”myfile.txt”, “r”)
Step 4:
Use one of a number of methods for reading and writing the file. To read each line in order, you can use the each_line method, which takes a block as an argument, enclosed in do…end keywords, or {…} braces. Reading a file this way is similar to iterating over an array:
f = File.open(”myfile.txt”, “r”)
f.each_line do|line|
puts “I read this line: #{line}”
end
Step 5:
Read individual strings for formatted data in a number of ways. After opening the file use the gets method to read a line and store the result in a variable:
f = File.open(”myfile.txt”, “r”)
line = f.gets
puts “The line I read is: #{line}”
(more…)