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 9781449303518

1. MVC and Classes

Alex MacCaw O'Reilly Media ePub

JavaScript development has changed markedly from how it looked when it was first conceived. Its easy to forget how far the language has come from its initial implementation in Netscapes browser, to the powerful engines of today, such as Googles V8. Its been a rocky path involving renaming, merging, and the eventual standardization as ECMAScript. The capabilities we have today are beyond the wildest dreams of those early innovators.

Despite its success and popularity, JavaScript is still widely misunderstood. Few people know that its a powerful and dynamic object-oriented language. Theyre surprised to learn about some of its more advanced features, such as prototypal inheritance, modules, and namespaces. So, why is JavaScript so misunderstood?

Part of the reason is due to previous buggy JavaScript implementations, and part of it is due to the namethe Java prefix suggests its somehow related to Java; in reality, its a totally different language. However, I think the real reason is the way most developers are introduced to the language. With other languages, such as Python and Ruby, developers usually make a concerted effort to learn the language with the help of books, screencasts, and tutorials. Until recently, though, JavaScript wasnt given that endorsement. Developers would get requests to add a bit of form validationmaybe a lightbox or a photo galleryto existing code, often on a tight schedule. Theyd use scripts theyd find on the Internet, calling it a day with little understanding of the language behind it. After that basic exposure, some of them might even add JavaScript to their resumes.

See All Chapters
Medium 9780596000707

2. Regular Expressions


A regular expression, or regexp, is a way of describing a set of strings. Because regular expressions are such a fundamental part of awk programming, their format and use deserve a separate chapter.

A regular expression enclosed in slashes (/) is an awk pattern that matches every input record whose text belongs to that set. The simplest regular expression is a sequence of letters, numbers, or both. Such a regexp matches any string that contains that sequence. Thus, the regexp foo matches any string containing foo. Therefore, the pattern /foo/ matches any input record containing the three characters foo anywhere in the record. Other kinds of regexps let you specify more complicated classes of strings.

Initially, the examples in this chapter are simple. As we explain more about how regular expressions work, we will present more complicated instances.

See All Chapters
Medium 9781449311605

When Should the Authorization Code Flow Be Used?

Ryan Boyd O'Reilly Media ePub

In the Web Application flow (also known as the Authorization Code flow), the resource owner is first redirected by the application to the OAuth authorization server at the API provider. The authorization server checks to see if the user has an active session. If she does, the authorization server prompts her for access to the requested data. After she grants access, she is redirected back to the web application and an authorization code is included in the URL as the code query parameter:

Because the code is passed as a query parameter, the web browser sends it along to the web server that is acting as the OAuth client. This authorization code is then exchanged for an access token using a server-to-server call from the application to the authorization server. This access token is used by the client to make API calls.

Sound confusing? Figure2-1 shows the flow step-by-step, based on a diagram from the specification.

Figure2-1.Server-side Web Application flow: Step-by-step

See All Chapters
Medium 9780870819469

Chapter 2 High Country Years

James Fell University Press of Colorado ePub

EVER SINCE HIS FIRST ARRIVAL IN 1864, COLORADANS HAD FOL-lowed Hill’s activities with interest. He was respected as both a scientist and an entrepreneur, and people watched his efforts to find a solution to the riddle of the sulfurets. But when the news arrived that he was about to build a smelter, many were skeptical. James E. Lyon had just failed, and here was Professor Hill about to try the same method. The “process mania” had returned again, many thought.

Hill and his associates had no illusions about the speculative nature of the Boston and Colorado Smelting Company, and they laid careful plans. At meetings in New England, they decided to construct a small plant that would have two roasting furnaces and one smelting unit to produce copper matte. Though it would be small by Welsh standards, the furnaces would be the largest size in use, so that Hill could take advantage of the economies of scale, an important consideration in a high-cost mining region. But Hill and his colleagues decided not to erect a refinery, since the smelter would not produce enough matte to make separation economically feasible. Instead, they negotiated a contract with Vivian & Sons and prepared to ship the matte to Swansea. Clearly, Hill and his associates wished to conserve their limited capital resources and minimize whatever losses they would have to absorb if so speculative an enterprise should fail.1

See All Chapters
Medium 9780253356949

1 Telling the Story of a Hebrew City

Maoz Azaryahu Indiana University Press ePub

Tel-Aviv did not want to be a city. In fact, it was afraid to be a city. The fear arose from the anti-urban trend and the negative image of the city—“the dark city”—in the nineteenth century, as well as the Zionist concern that the city would attract most of the new immigrants and would compete with the agricultural settlements for resources. Only in the 1930s did Tel-Aviv realize that it was becoming a city after all.

What it really meant to be was a suburb, or a modern small town, but certainly not something on the order of the average European city. Even today, Tel-Aviv, with 390,000 residents, is certainly not a large city.

From the perspective of the world outside Europe, there is nothing special about the founding of Tel-Aviv one hundred years ago. During the nineteenth century, outside the continent, and especially in the United States, many cities were established, and not as a result of government initiative. Within Europe, however, the situation was different; the only new city in the last 200 years is Odessa, which was founded by the Czarist government at the end of the eighteenth century.1 Within Eretz-Israel the situation was also different. Tel-Aviv is the only new city since Ramle was established in 717 BCE by the Umayyad caliph Sulayman ibn Abd al-Malik. It is the first so-called “Jewish city” since King Herod built Caesarea in 20–10 BCE and Tiberias was founded by King Herod Antipas in 22–17 BCE. Thus Tel-Aviv was the first city founded in Eretz-Israel in 1,200 years, and it was the first Jewish city founded there in some 2,000 years.

See All Chapters

See All Slices