Archives
-
Introduction to the Reactive Extensions for JavaScript – Conditionals
After spending the past couple of posts talking about how we integrate and why, let’s get back to the basic operators of the Reactive Extensions for JavaScript. This time, we’ll cover conditional logic that we can do with RxJS (which also applies to Rx.NET as well). With traditional LINQ, we have the Where operator which allows us to filter operations, but it doesn’t allow us to do one operation or another easily. Instead, the Reactive Extensions team has included two operators, If and Case which allow us some flexibility on how we want to execute conditional logic.
-
Introduction to the Reactive Extensions for JavaScript – MooTools Integration
In the previous post, I covered a bit about how we’ve integrated the Dojo Toolkit into the Reactive Extensions for JavaScript (RxJS) where we can leverage Dojo’s eventing and AJAX programming model. Following onto that post, I wanted to move onto a different framework and show how we integrated it into RxJS. This time, it’s MooTools up to the plate.
-
Introduction to the Reactive Extensions for JavaScript – Wrapping the Dojo API
Recently in some of the comments I’ve received (keep them coming BTW), I get questions about taking existing APIs and moving them towards using the Reactive Extensions for JavaScript (RxJS). How can we get away from constant callback hell and move towards composable asynchronous and event-based blocks instead? In this post, I’m going to walk through how we wrapped the Dojo Toolkit APIs to provide both event handling and AJAX functionality.
-
Talking Reactive Extensions
There has been a lot of movement around the Reactive Extensions lately and I thought I’d round them up for you in an easy to find location. Between the new release and various interviews, there’s a bit to cover.
-
Introduction to the Reactive Extensions for JavaScript – The Final Countdown Timer
In the previous couple of posts, I’ve talked about asynchronous method chaining and creating custom schedulers so I can repeatedly hit a data source for its data, transform it and then display the results. Instead of just setting a custom interval between the results and querying the system, so this time, I want to stick a timer where I can monitor the time between queries.
-
Introduction to the Reactive Extensions for JavaScript – Custom Schedulers
In the previous post, I talked a little bit about asynchronous method chaining and extending jQuery in a fluent style to fetch tweets from Twitter and append them to a given element. This time I want to expand upon that post, instead of taking only one tweet, I want to take one hundred of them and then cycle through each of them at a given interval. In order to do that, I must make use of something that I alluded to in earlier posts, and that is a custom scheduler.
-
Introduction to the Reactive Extensions for JavaScript – Async Method Chaining
Recently, there was a blog post by Dustin Diaz about method chaining over asynchronous operations. This topic, of course is near and dear to my heart as it strikes the exact chord of what the Reactive Extensions for JavaScript (RxJS) is trying to solve. The ability for us to take asynchronous operations and events and treat them as push collections, we are able to then compose functions together as if they were normal pull collections like arrays. In this post, I’ll walk through the example that was posted on Dustin’s site and show how it can be done using RxJS.
-
Introduction to the Reactive Extensions for JavaScript – Refactoring a Game
We’ve covered a lot of ground so far in this series including a lot of the combinators as well as the integration into third party libraries. Most of these examples have been from a green field mindset where we have an idea and then walk through how you would accomplish it using the Reactive Extensions for JavaScript (RxJS). This time, we’re going to take a game that’s already been written and take parts of it and migrate it to use RxJS.
-
Introduction to the Reactive Extensions for JavaScript – Going Parallel with ForkJoin
This past week there was a new release of the Reactive Extensions for JavaScript which includes many of the changes I’ve been talking about lately including the third-party library integration, aggregates and joins which I covered in the previous posts. This time, I’m going to look at how we can run some observable sequence using the fork/join pattern in JavaScript, to attain some cooperative multi-tasking.
-
[ANN] DC ALT.NET – 4/27/2010 – What has Mono done for the .NET developer lately?
As of late I haven’t posted the DC ALT.NET meetings here and instead have kept them to the Yahoo Groups mailing list. But this month’s topic is worth sharing in that we’re going to cover everything Mono related with a member of the Mono Team, Jackson Harper.
-
Introduction to the Reactive Extensions for JavaScript – New Release and Joins
This past week there was a new release of the Reactive Extensions for JavaScript which includes many of the changes I’ve been talking about lately including the third-party library integration, aggregates which I covered in the previous posts, and joins which is the subject of today’s post.
-
Introduction to the Reactive Extensions for JavaScript – Aggregation Part 2
So far we’ve come a long way in this series on the Reactive Extensions for JavaScript, starting with some of the basics, and then going deeper with composition with such things as the Bing Maps and Twitter Mashup, Drag and Drop, asynchronous programming among others. In the previous post, we talked about separating our concerns between the base functionality, DOM events and third-party library integration. This time, let’s follow onto our last post which started talking about the Aggregates library of the Reactive Extensions for JavaScript
-
Introduction to the Reactive Extensions for JavaScript – Aggregation Part 1
So far we’ve come a long way in this series on the Reactive Extensions for JavaScript, starting with some of the basics, and then going deeper with composition with such things as the Bing Maps and Twitter Mashup, Drag and Drop, asynchronous programming among others. In the previous post, we talked about separating our concerns between the base functionality, DOM events and third-party library integration. This time, let’s look at another separation which comes in the form of aggregates.
-
Introduction to the Reactive Extensions for JavaScript – A Separation of Concerns
So far we’ve come a long way in this series, starting with some of the basics, and then going deeper with composition with such things as the Bing Maps and Twitter Mashup, Drag and Drop, asynchronous programming among others. In the previous post, we covered a bit about jQuery AJAX integration into the Reactive Extensions for JavaScript. This time, we’re going to step back just a little bit to talk about de-cluttering the libraries and separating our concerns.
-
Introduction to the Reactive Extensions for JavaScript – Extending jQuery AJAX
So far we’ve come a long way in this series, starting with some of the basics, and then going deeper with composition with such things as the Bing Maps and Twitter Mashup, Drag and Drop, asynchronous programming among others.
-
Time Flies Like An Arrow in F# and the Reactive Extensions for .NET
In the past week, I had the pleasure of speaking on Reactive Programming in F# with Brian McNamara at a conference out in Seattle. The point of this talk was to cover the what and why of using F# in reactive programming on both the client and the server and showed quite a few examples. One of the samples Brian alluded to, the “Time Flies Like An Arrow” example, which is an example of having a stream of text, each character delayed behind the previous, follow the mouse around the screen. Brian’s version used a combination of both the asynchronous workflows which are a standard part of F#, as well as first class events/observables. For my version, I’m going to strictly use F# first class events and the integration with the Reactive Extensions for .NET to show you how it can be done.
-
Introduction to the Reactive Extensions for JavaScript – jQuery Live Event Integration
So far we’ve come a long way in this series, starting with some of the basics, and then going deeper with composition with such things as the Bing Maps and Twitter Mashup, Drag and Drop, asynchronous programming among others. One of the nicest aspects so far is the ease of integration into jQuery. For the first release, we have Observable.FromJQueryEvent, but we didn’t quite cover live events and the integration points that we can extend. Let’s cover that today and what is coming in a future release of the Reactive Extensions for JavaScript.
-
Introduction to the Reactive Extensions for JavaScript – Drag and Drop
We’ve covered a bit of ground in this series on the Reactive Extensions for JavaScript, covering the basics, jQuery integration, blocking to asynchronous and further composition. One way I’ve found to really get your hands dirty using this library is to take examples from other libraries and translate them into using our library of choice. In this case, I’m taking examples written in the Flapjax language, and translating them into the Reactive Extensions for JavaScript and jQuery.
-
The Reactive Extensions for JavaScript Released
The long awaited day has come as the Reactive Extensions for JavaScript have been released on DevLabs in conjunction with the talk given by Erik Meijer at Mix 2010. Jeff Van Gogh, one of the principal developers on this project has more details and a detailed look at the sample application of “Time Flies Like an Arrow”. I’d like to also give a detailed explanation of another sample application, the Bing Maps and Twitter mashup.
-
Introduction to the Reactive Extensions for JavaScript – Composing deeper
We’ve covered a bit of ground already in this series on the Reactive Extensions for JavaScript (RxJS) from the basic information, creating observers and observables, jQuery integration, composing asynchronous methods with callbacks and in the last post, turned blocking calls into asynchronous calls. Now that we have some more fundamental building blocks, let’s see what else we can do with it. Before moving to FlapJax examples, I want to revisit the Microsoft Translator to take a piece of text and translate into all languages except the currently detected.
-
Introduction to the Reactive Extensions for JavaScript – Wikipedia Lookup
We’ve covered a bit of ground already in this series on the Reactive Extensions for JavaScript (RxJS) from the basic information, creating observers and observables, jQuery integration, composing asynchronous methods with callbacks and in the last post, talking about turning blocking calls into asynchronous calls. Now that we have some more fundamental building blocks, let’s see what else we can do with it. Before I move into FlapJax examples translated to the Reactive Extensions for JavaScript, I want to first visit a basic autocomplete/lookup scenario in which we can query a data source as we type, as such sites as Bing, Google, Wikipedia and others do. In this example, we’ll use Wikipedia as the backend source for doing our autocomplete.
-
Introduction to the Reactive Extensions for JavaScript – From Blocking to Async
We’ve covered a bit of ground already in this series on the Reactive Extensions for JavaScript (RxJS) from the basic information, creating observers and observables, jQuery integration and in the last post talking about composing asynchronous methods with callbacks. Now that we have some more fundamental building blocks, let’s see what else we can do with it. Since we talked about asynchronous methods last time and making them composable, how about this time taking a method that is seemingly a blocking AJAX call and turn it into an asynchronous method? In this post, we’ll finish up the Microsoft Translator example by playing with the getLanguages and getLanguageNames methods and see what we can do with them.
-
Introduction to the Reactive Extensions for JavaScript – Composing Callbacks
So far in this series, we’ve covered some basic information about the Reactive Extensions for JavaScript (RxJS) including creating observables and creating observers as well as jQuery integration. Now that we have a foundation in some of the basic building blocks, let’s actually do something interesting with it. For example, how would we compose two AJAX calls together with callbacks? In this post, we’ll explore using the Bing Translator in combination with jQuery and the RxJS.
-
Introduction to the Reactive Extensions for JavaScript – jQuery Integration
So far in this series, we’ve discussed the intent of the Reactive Extensions for JavaScript (RxJS) and how to create the publishers (Observables) and subscribers (Observers). Along the way, we’ve talked a little about integration with other libraries such as jQuery (although we could talk about others) and since JavaScript developers tend to work in quite a few libraries, it’s best to see how we can fit RxJS in those solutions.
-
Introduction to the Reactive Extensions for JavaScript – Creating Observers
Looking back to the previous post, we covered how we create observable sequences, the producers of our data. We have quite a number of ways of creating these outside of events which we covered earlier. Now that we have these observable sequences, now what? We need to address the consumer side of this producer/consumer story in the form of an observer.
-
Introduction to the Reactive Extensions for JavaScript – Creating Observables
In the previous post, we covered a little about the Reactive Framework (Rx) for JavaScript. Since that time we’ve learned that Jeffrey Van Gogh will be attending the upcoming JSConf 2010 and hoping to bring along some Reactive Extensions for JavaScript for anyone who is interested.
-
Introduction to the Reactive Extensions to JavaScript
Readers of my blog probably know that I’m a bit into functional programming languages (F#, Erlang, Clojure, Haskell, etc) among other topics, but what you may not know is that I’m a huge JavaScript fan as well. Since I began in the industry (professionally anyways), I’ve been using JavaScript to knock out some pretty interesting solutions. Over the years, many people have tried to abstract over the language, taking such approaches as taking a statically typed language and compiling it to JavaScript, but when it comes down to it, I prefer dealing with the natural language of the web, which is HTML, CSS and native JavaScript.
-
[ANN] DC ALT.NET: 2/24 - Getting the Right System with George Dinwiddie
The next DC ALT.NET meeting is taking place on 2/24/2010 from 7-9PM. Stay tuned to the mailing list for more information as it becomes available. In this meeting, once again we have George Dinwiddie, to give a talk on talk in the language of the business and what tools along the way can help us. Below is a description of the event. We hope to see you there!
-
The F# PowerPack Released on CodePlex
As announced yesterday, the new February 2010 release of F# is out. For those using Visual Studio 2008 and Mono, you can pick up the download here. This release is much more of a stabilization release instead of adding a lot of features including improvements in tooling, the project system and so on.
-
Upcoming Release of F# 2.0
As you may have noticed with the recent release of the Visual Studio 2010 Release Candidate, that we are getting closer and closer to the first official release of the F# language. Shortly, there will be the standard zip/MSI file provided to those who are still running Visual Studio 2008 as well as Mono that I will post a link to when it becomes available. Dr. Brian McNamara of the F# team has a few goodies in his post here about the release here. Just as he asks for help with old blog posts that contain code that no longer works due to the language changes, I’ll ask the same of you all as well. If there are blog posts of mine out there that are seriously out of date, please do let me know.
-
F# and the Dynamic Lookup Operator ala C#
In the previous post, we covered various scenarios around how we’d make the syntax around using the MongoDB C# Driver a little nicer and less stringy. And before that we looked at using and abusing these so called dynamic lookup operators. In the F# language, we have the ability to define two “dynamic” operators, a get member operator denoted by the ( ? ), and the set member operator denoted by the ( ?<- ). The F# language and its associated libraries do not have an actual implementation of these operators, but instead allow you to implement them as you see fit. Previously, we tried two approaches…
-
Exploring MongoDB with F#
If you’ve been following me on Twitter, I’ve been digging a bit into MongoDB. When I was involved with the planning of NoSQLEast this past year, I sat down and used it in anger and was quite pleased with the results. Using it with a language which allows for quick prototyping such as F# has afforded me to get up and going on a project with very little effort. At some point, I don’t want to be bothered with having to go into another tool, create a schema, decide what data types, run migrations and all the fun things that come along with traditional RDBMS solutions. I just want a quick answer with the data I have. There was one issue of course that nagged me which was the ubiquitous use of strings for everything from databases, collections, and keys. With a language such as F#, could we do any better than this approach?
-
Using and Abusing the F# Dynamic Lookup Operator
Lately, I’ve been playing with such things as MongoDB using F# to rapidly prototype ideas. With that, I’ve tried to rid myself of magic strings by using the F# dynamic lookup operator. I’ll cover exactly what I’m doing in the next post when using MongoDB, but in this post I’d like to explore a little of what you could do with a little noticed dynamic lookup operator in F#.
-
A Kick in the Monads – Writer Edition
In the past couple of Monads posts, we’ve talked briefly about the State and Reader Monads and their potential uses and misuses. Before this series completes, I have a few more to cover including the Writer, Continuation and eventually Observable monad. Today, we’ll get started looking at the Writer Monad and what it can do for us.
-
A Kick in the Monads – Creating Extended Builders Part III
So far in this series, we’ve covered some of the methods you can implement for custom computation expressions (aka Monads) in F# such as bind and return, as well as exception and resource management. For the last part in the series, we’ll take a look at looping constructs. As we know, F# is a pragmatic multi-paradigm language which supports not only functional features, but imperative ones as well, which include mutability, looping constructs and so on. Just as regular F# supports for and while loops, we have the ability to take advantage of them as well inside of our computation expressions by implementing two methods. Let’s start with the while loop.
-
Much Ado About Monads – Creating Extended Builders Part II
In this series, we’ve looked custom computation expressions, what they are, how they are applicable to development and how we might implement them in F#. In the previous post, we went over some of the basic methods you can include on your custom computation expression to allow for a more rich programmatic model than the linear style provided via both Bind and Return.
-
Much Ado About Monads – Creating Extended Builders
In the past two posts in this series, we’ve covered both the State Monad and Reader Monad, not only the motivations, but how you would implement them in F#. With defining the Return and Bind methods on our computation expression builders, we’re able to do composable linear programming. But, what we lack is an imperative programming model on top to allow for such things as if statements, for and while loops, and try/catch or try/finally blocks. Luckily, there is a programmatic model to follow to make these things possible inside of our expressions. Let’s cover each of these functions in turn and see what each one does and in the process implement them for the Reader Monad.
-
[ANN] DC ALT.NET – 1/27/2010 - Clojure
The next meeting of DC ALT.NET will be held on January 27th from 7-9PM on Clojure with Craig Andera. Previously, he gave a talk about spending some time in Common Lisp and some of the lessons learned during his adventures. You may have noticed a lot of talk around this language, especially in the Java community. Where trends are concerned, momentum has shifted from Groovy to Scala and now to Clojure just in terms of sheer interest. It’s one that’s on the top of my list to dive deep into this year. So, what is it and what should we care?
-
Much Ado About Monads – Reader Edition
In the previous post, we talked a bit about the State Monad, what it is and how you could use it today in your F# application. But, with any new piece of information such as this, it should be taken in context, and there are other patterns as well when dealing with a multi-paradigm language such as F#. We also talked about how the State Monad might not have been the best choice for modeling our web scripting DSL as our browser state is encapsulated in the Browser class, and once it is set, it doesn’t change. With that, we could turn our eyes to using the Reader Monad as we read from our environment.