Welcome to the Chickenfoot interactive tutorial. When you see text in a box like the one below, it is a piece of Chickenfoot code (which we call Chickenscratch) that can be executed from the Chickenfoot Script Editor. To introduce you to Chickenfoot, the interactive tutorial consists of a series of sample pages. Each sample page will show a real web site, such as Google, and a snippet of Chickenscratch to run on that web site. This will expose you to the various commands that are available in Chickenfoot. click("begin interactive tutorial")
With the advent of multi-core processors concurrent programming is becoming indispensable. Scala's primary concurrency construct is actors. Actors are basically concurrent processes that communicate by exchanging messages. Actors can also be seen as a form of active objects where invoking a method corresponds to sending a message. The Scala Actors library provides both asynchronous and synchronous message sends (the latter are implemented by exchanging several asynchronous messages). Moreover, actors may communicate using futures where requests are handled asynchronously, but return a representation (the future) that allows to await the reply. This tutorial is mainly designed as a walk-through of several complete example programs Our first example consists of two actors that exchange a bunch of messages and then terminate. The first actor sends "ping" messages to the second actor, which in turn sends "pong" messages back (for each received "ping" message one "pong" message).
That should be it. You now be able to boot up you Lift app, launch the Flex app, click the “Subscribe to ‘notifications’” to start the Notifier Actor and subscribe to the Consumer to the notifications destination. You should then see id number and the time in the text input field get automatically updated every 0.5 seconds. You can the click the “Unsubscribe from ‘notifications’” to stop the Notifier actor and the Consumer to unsubscribe from the notifications destination. Pretty exciting. With these three technologies it’s really easy to automatically push data from the server to the client in real time. This is obviously a trivial example, but I think it should be relatively straight forward to scale this approach up for more sophisticated apps.
For some reason, I suddenly felt like playing around with Scala for a couple of days, and having gotten over my perceived difficulty of the language vs Groovy, and after actually trying to write something in it - I really like it :) At first glance, advanced functional programming in Scala can look a little freaky to someone who’s only been writing Java for the last few years. But if you start slowly, it all slides into place. I started to get into it by reading this is a really good series of articles introducing the language What follows are two examples of Scala. The first, LoveGame is a demonstration of programming a simple algorithm in Scala along with a little comarpison with Java. The second is a little toying around i did with Scala to create a front end for JScience with the “Pimp my library” pattern.
emir burak In Informatics, there are two (related) meanings of the word "monad": * A triple (T,eta,mu) following some laws in category theory * A way of structuring functional programs The first meaning can probably not be described easily in natural language. Michael Arbib and Ernest Manes' "Arrows, Structure, Functors - The Categorical Imperative". describe them as (generalized monoids) in Section 10.2 and through adjointness to the forgetful functor from algebras to sets. That last connection basically makes everything that we can write down or model using abstract syntax / universal algebra a monad. The second view is described in Wadler's papers. I mention category theory because we can describe things that are not computations as monads. It also reminds us why a monad is a collection of things taken together. With the List example in mind, a potentially more revealing account on monads (aka triples) can be found in the free book Barr, Wells
Lex Spoon discusses the Scala programming language including the origin of Scala, the philosophy behind Scala, the Scala feature set, Object-Oriented and Functional programming in Scala, examples of Scala code, writing DSLs, how Scala is converted into Java, Scala performance, Abstract Data Types, unapply, actors and partial functions. Lex Spoon divides his time between two posts: he works at EPFL in Switzerland on the Scala team, and at IBM Research in New York on X10.
emir burak scala.xml (draft book, updated for Scala 2.6.1) I. Semistructured Syntax and Data 1. Introduction XML, Types and Objects 2. The scala.xml API Nodes and Attributes Elements and Text Embedded expressions Other nodes Matching XML Updates and Queries Names and Namespaces Sharing namespace nodes 3. XPath projection 4. XSLT style transformations 5. XQuery style querying 6. Loading and Saving XML The native Scala parser Pull parsing (experimental) II. Library 7. Overview 8. scala.xml runtime classes 9. Scala's XML syntax, formally 10. Interpretation of XML expressions and patterns
If Merb is a paragon of professionalism and class, Shoes is a monkey on LSD. Shoes, by why the lucky stiff, is an incredibly compact cross-platform GUI toolkit for Ruby, but it looks nothing like the other cross-platform toolkits out there. For one thing, it is lightweight. Shoes lets you build GUIs in Ruby whose code actually looks like Ruby, not XML or Java. We are going to build a pastebin as a repository for our own code snippets and pieces of text we want to save. We'll build a GUI frontend using Shoes, and connect it to a Merb backend that will handle the database. In fact, the basic proof of concept took the two of us about an hour to get working, and it took another hour to finish. Without further ado, we present our pastebin application, using Shoes and Merb, Shmerboes. Creating a Simple YAML-Based Web Service with Merb