Make your own eBooks

Use our Remix App to mix & match content. In minutes make your own course packs, training bundles, custom travel guides, you name it. Even add your own title & cover.


Slices & Articles Get by the slice or add to your own ebook

Medium 9780596003111

15. A Web Spider in One Line

Jon Orwant O'Reilly Media ePub

One day, someone on the IRC #perl channel was asking some confused questions. We finally managed to figure out that he was trying to write a web robot, or spider, in Perl. Which is a grand idea, except that:

Perfectly good spiders have already been written and are freely available at

A Perl-based web spider is probably not an ideal project for novice Perl programmers. They should work their way up to it.

Having said that, I immediately pictured a one-line Perl robot. It wouldnt do much, but it would be amusing. After a few abortive attempts, I ended up with this monster, which requires Perl 5.005. Ive split it onto separate lines for easier reading.

I actually edited this on a single line; I use shell-mode inside of Emacs, so it wasnt that much of a terror. Heres the one-line version.

After getting an ego-raising chorus of groans from the hapless onlookers in #perl, I thought Id try to identify some cute things I did with this code that might actually be instructive to TPJ readers.

See All Chapters
Medium 9780596009878

26. Introduction to JavaScript

Jennifer Niederst Robbins O'Reilly Media ePub

A web page that is semantically marked up and beautifully designed (with CSS, of course) is wonderful, but to really make it an experience, it needs some interactivity. This is what we call the "behavior layer" and, in most cases, it is made possible through use of a technology called JavaScript . This chapter will walk you through a little history of the JavaScript language and then discuss the basic building blocks of modern JavaScript.

JavaScript is an object- and prototype-based programming language that got its start in 1995 as the creation of Brendan Eich at Netscape. It was originally named "Mocha" and then "LiveScript" before being confusingly re-christened JavaScript in conjunction with its release in Netscape Navigator 2.0 Beta 3 in December of 1995.

It is important to note that JavaScript is not Java. Both are similar to the C programming language and share a similar syntax, but that is pretty much where their similarity ends. The Java programming language was creating quite a stir in the computer world when Netscape was readying LiveScript for release, and, somehow, the decision was made to rename the language JavaScript to cash in on some of the buzz. Unfortunately, it did more to confuse the programming world than it did to improve the popularity of JavaScript.

See All Chapters
Medium 9780596802356

7. Guesstimation and the Back of the Envelope

Philipp K. Janert O'Reilly Media ePub


Yes, I know its lame to make the reader do jotem-dotem exercises, and the question is old anyway, but please make the effort to come up with a number. I am trying to make a point here.

Done? Goodthen, tell me, what is the margin of error in your result? How many balls, plus or minus, do you think the room might accommodate as well? Again, numbers, please! Look at the margin of error: can you justify it, or did you just pull some numbers out of thin air to get me off your back? And if you found an argument to base your estimate on: does the result seem right to you? Too large, too small?

Finally, can you state the assumptions you made when answering the first two questions? What did or did you not take into account? Did you take the furniture out or not? Did you look up the size of a Ping-Pong ball, or did you guess it? Did you take into account different ways to pack spheres? Which of these assumptions has the largest effect on the result? Continue on a second sheet of paper if you need more space for your answer.

See All Chapters
Medium 9781591201489

3. Fueling Muscles Before and During Exercise

Ivy Ph.D., John Basic Health Publications ePub


he need to control body temperature and to supply adequate amounts of ATP to working muscles during exercise results in a number of physiological and metabolic changes that can lead to a decline in performance and eventually fatigue. As discussed in this chapter, the severity of these changes can be reduced with appropriate nutrient supplementation.


For most athletes, their workout begins when they start stretching. However, by redefining when your workout begins, you can jump-start the refueling process. Nutrients and fluids consumed in the thirty-minute period prior to your exercise can deliver big benefits.

Because of the immediate and dramatic effects of dehydration on sports performance, we recommend that athletes consume 1420 ounces of water or electrolyte solution thirty minutes before prolonged intense exercise in the heat. Consumption of fluids during this time will delay the development of dehydration, speed the onset of sweating, and cause a smaller rise in body temperature. Electrolyte solutions are preferred over pure water because the addition of electrolytes prevents the excretion of water through the kidneys. By consuming a drink with electrolytes, your body retains the fluid you need, thereby avoiding the frequent and annoying need to urinate during exercise or competition.

See All Chapters
Medium 9780982702970

10    Fostering Collective Efficacy

Richard DuFour Solution Tree Press ePub

Fostering Collective Efficacy

We began this book asking readers to consider an important question, What is the role of the principal? We have argued that the primary responsibility of the principal is to lead a collective effort to create a professional learning community that ensures high levels of learning for students through recursive processes that promote adult learning. We have attempted to offer specific, practical, and actionable steps principals can take to fulfill that role.

We conclude with another question, Do you believe in your ability to fulfill this role and the collective ability of your staff to create such a school? In essence, we are asking, “Do you believe you can make a difference?” The answer to this question will have an enormous impact on your effectiveness as a principal. As Kouzes and Posner (2010) write,

Everything you will ever do as a leader is based on one audacious assumption. It’s the assumption that you matter. Before you can lead others, you have to lead yourself and believe that you can have a positive impact on others. You have to believe that your words can inspire and your actions can move others. You have to believe that what you do counts for something. If you don’t, you won’t even try. Leadership begins with you. The Truth Is That You Make a Difference. (p. 1)

See All Chapters

See All Slices