background preloader

Web

Facebook Twitter

Restsharp + WebAPI + F# Self hosting WebApi. This is just a short howto as I think it might come handy, as I struggled a bit on some points.

self hosting WebApi

I needed a simple way to self-host a REST-like service (returning XML data) with fine control on the structure of the results. I had a look at Nancy and others but finally choose to use Microsofts WebApi as it’s fine for what I am trying to do. preparing the solution First thing to do is grab the nuget-package Microsoft.AspNet.WebApi.SelfHost. In addition I needed references to System.Xml as I want to use XmlDocument. helper class for XML content I want the replies to have content type text/xml (instead of application/xml) and the only way I found is to use a helper class: As you can see you create an instance of this given a XmlDocument and it just saves this to the output-stream using the right content-type (for me).

In addition I need the reply to have a XML declaration like <? The controller Nothing special here – a simple one like this will do: setting up the self-hosting remarks. Blog. Since our last post, we have been hard at work extending the basic functionality of WebSharper.UI.Next to include some higher-level things, in particular support for animation, and some functional abstractions which make creating single-page applications (SPAs) safer, easier, and more intuitive.

Blog

In this post, we'll talk a bit about some of the web abstractions we've added; Anton has written about the animation functionality here. For the uninitiated, WebSharper.UI.Next is our upcoming framework for creating rich single-page applications. By creating reactive variables, and views which allow these variables to be observed as and when they change, it is possible to create highly-reactive applications backed by a purely-functional model. You can see some examples of this framework at work here, and the GitHub repository showing the source code for the website here.

Flowlets In our small example, we first ask the user for some common information: in this case, a name and address. URL Routing. Setting culture on JQueryUI DatePicker. Inconsistently Insightful: Tragedy of the WebKit Commons. With Opera announcing that their future products will be based on WebKit, the Internet is abuzz with discussion about what that means and whether it's a good thing.

Inconsistently Insightful: Tragedy of the WebKit Commons

Looking at it as a jQuery developer, it's a good thing if it gets WebKit participants to fix bugs and update older implementations. I can't be optimistic without some evidence that things are really going to change. We don't know how many of Opera's core developers will move to WebKit development, but the press release isn't encouraging: "The shift to WebKit means more of our resources can be dedicated to developing new features and the user-friendly solutions. " I suspect they want some cost savings by eliminating Presto technical staff, or -- in the most optimistic case for their employees -- refocusing existing staff on the parts outside WebKit core that make browsers different. Opera did land their first WebKit patch so they wanted to make a statement that they weren't getting out of core browser development altogether. My Programming Heroes: Douglas Crockford.

JavaScript is a language that people would use without learning it first, which is by mistake that you would not make in other language – Douglas Crockford I’m a huge fan of Douglas Crockford, and that has a lot to do with how I learned JavaScript.

My Programming Heroes: Douglas Crockford

Like many web developers, I generally loathed JavaScript until jQuery came along, and then I suddenly thought I understood the language. It wasn’t until I had to write non-trivial applications in JavaScript that I truly began to notice the huge gaps in my education. With the rise of server-side JavaScript and the constant deluge of new interesting things happening in the JavaScript community, I felt that I needed to catch up, quickly. I needed a master to learn from, and Douglas Crockford was the master I chose. Who is this Douglas Crockford? Douglas Crockford discovered JSON, you know, the language that relegated XML to second-class status? YUI Library Lectures Volume 1 – The Early Years Chapter 2 – And Then There Was JavaScript Scene 6 – Loopage.

ASP.NET

W3Schools Online Web Tutorials.