background preloader

JavaScript

Facebook Twitter

A Streaming Twitter Client. This excerpt is from the new book, ‘Sams Teach Yourself Node.js in 24 Hours’ authored by George Ornbo, published by Pearson/SAMS, Sept. 2012, ISBN 9780672335952, Copyright © 2013 by Pearson Education, Inc. For more info please visit the publisher site: www.informit.com/title/9780672335952 Receive data from Twitter’s streaming API Parse data received from Twitter’s streaming API Push third-party data out to clients in real-time Create a real-time graph Discover whether there is more love or hate in the world by using real-time data from Twitter Streaming APIs In Hour 13, "A Socket.IO Chat Server," you learned how to create a chat server with Socket.IO and Express. With Twitter’s standard API, the process for getting data is as follows: You open a connection to the API server.

With Twitter’s streaming API, the process is different: You open a connection to the API server. Streaming APIs allow data to be pushed from the service provider whenever new data is available. Signing Up for Twitter. LittleSmallscript. Little Smallscript is a dialect of Smalltalk that compiles into JavaScript. Hidden behind the huge Smalltalk Environment, Smalltalk always had a beautiful syntax that is fit for object oriented scripting. Little Smallscript is an attempt to let Smalltalk see the light of day again. (Although I've never written Smalltalk before ;p) The golden rule of LittleSmallscript is: "It's just JavaScript". Latest Version: 1.0.0 Language Reference blah blah blah Syntax LittleSmallscript has a minimum set of syntax that everyone can learn in a few minutes. A statement starts with an optional variable declaration. | message1 message2 numbers | var message1, message2, numbers; A statement body is made of one or more expressions separated by periods Assingnments can only appear at the start of an expression message1 := message2 := 'Hello, world!

'. Message1 = message2 = "Hello, world! " A message passing expression starts with a receiver followed by selector(s) and arguments Function Literals | counter | counter := 0. 2012/09/14/functional-programming/ JavaScript has two parents: Scheme and Self. We can thank Self for all of the object-orientedness of JavaScript and indeed we do in our code and our tutorials.

However, Scheme played just as important a role in the language’s design, and we would do ourselves ill to overlook JavaScript’s functional heritage. What exactly does it mean for JavaScript to be functional? “Functional” merely describes a collection of traits a given language may or may not have. A language like Haskell has all of them: immutable variables, pattern matching, first class functions, and others.

Some languages hardly have any, like C. While JavaScript certainly doesn’t have immutable variables or pattern matching it does have a strong emphasis on first class functions; mutating, combining, and using these function objects for cleaner and more succinct code is the purpose of this tutorial. Partial Application Composition Composition is an operation that produces a new function z by nesting functions f and g. Flipping. Know JavaScript.. use node.js server-side.

Node.js Introduction So this enables JavaScript to be used on server-side. All browsers have a JavaScript engine which nobody seems to have thought of making into a server-side engine which will allow JavaScript enthusiasts code on the server-side. Now node.js is popular, and Microsoft even supports node.js scripting on their Azure cloud systems (could help tap JavaScript coders to use Azure).

This article is to quickly dive into some examples of using node.js Hello World Type the below line in a text file, preferably named helloworld.js console.log('Hello world! ') and run it on the command line with node engine node c:\work\helloworld.js To do the above.. the pre-requisite is you have node.js installed.. What can we use node.js for In essence of JavaScript being very good for AJAX.. the same seems to be the most popular use of node.js as well.. making requests or serving requests.

We will create some examples of them. A Web request example Events handlers are wired, as below. (Another guess.. Or. Gridster.js. Add/Remove dynamic rows in HTML table. Nifty Javascript Hack : how to check if an element exists in the document | Enbake Consulting. Live examples.