net

TwitterFacebook
Get flash to fully experience Pearltrees
Norwegian Rubyist August Lilleaas has been busy putting together a ton of examples of using the Net::HTTP Ruby library that comes with most Ruby distributions. I asked him if it'd be okay to put some of them directly on Ruby Inside for reference purposes and he said "No problem!" It's worth noting that Net::HTTP has been superseded in many areas by libraries like John Nunemaker's HTTParty and Paul DIx's high performance Typhoeus , but as part of the standard library, Net::HTTP is still a popular option though it doesn't have the easiest API to remember.

Net::HTTP Cheat Sheet

http://www.rubyinside.com/nethttp-cheat-sheet-2940.html
http://blog.benstrong.com/2010/11/google-and-microsoft-cheat-on-slow.html A Quest for Speed I decided a couple of weeks ago that I wanted to build an app, most likely a web app. Being a premature optimizer by nature, my first order of business (after deciding I need to l earn to draw ) was to find the absolute fastest way to serve up a web page. The Google home page is the fastest-loading page I know of, so I thought a good place to start would be to figure out how they do it and then replicate their strategy. The full story of my search is below, but the short version is that to match Google's page load times you have to cheat on the tcp slow-start algorithm.

Ben Strong's Blog: Google and Microsoft Cheat on Slow-Start. Should You?

HTTP cookies, or how not to design protocols

For as long as I remember, HTTP cookies have been vilified as a grave threat to the privacy of online browsing; wrongly so . That said, the mechanism itself is a very interesting cautionary tale for security engineers - and that will be the theme of today's feature. Cookies were devised by Lou Montulli , a Netscape engineer, somewhere in 1994. Lou outlined his original design in a minimalistic, four-page proposal posted on netscape.com; based on that specification, the implementation shipped in their browser several months later - and other vendors were quick to follow. It wasn't until 1997 that the first reasonably detailed specification of the mechanism has been attempted: RFC 2109 . http://lcamtuf.blogspot.com/2010/10/http-cookies-or-how-not-to-design.html
http://nodejs.org/

node.js

var net = require ( 'net' ); var server = net . createServer ( function ( socket ) { socket . write ( 'Echo server \r\n ' ); socket . pipe ( socket ); } ); server . listen ( 1337 , '127.0.0.1' ); A guided introduction to Node
for Web Authors and Webmasters This is an informational document. Although technical in nature, it attempts to make the concepts involved understandable and applicable in real-world situations. Because of this, some aspects of the material are simplified or omitted, for the sake of clarity. http://www.mnot.net/cache_docs/#WHY

Caching Tutorial for Web Authors and Webmasters

HTTParty by John Nunemaker

http://httparty.rubyforge.org/ class Twitter include HTTParty base_uri 'twitter.com' basic_auth 'username', 'password' end Twitter.post('/statuses/update.json', :query => {:status => "It's an HTTParty and everyone is invited!"}) That is really it! The object returned is a ruby hash that is decoded from Twitter's json response. JSON parsing is used because of the .json extension in the path of the request. You can also explicitly set a format (see the examples).
.NET Feature Articles Dino Esposito states that, compared with writing iOS and Android applications, developing applications for Windows Phone is much easier. If you're coming to Windows Phone with a .NET background, you will feel right at home LINQ queries execute when you iterate over results, and they execute sequentially. With PLINQ, the iterations are performed in parallel, as tasks are scheduled on threads running in the .NET Framework 4 thread pool ASP.NET 4 provides support for cache extensibility through a provider model that you can write yourself.

Enabling HTTP Compression in IIS 6.0

http://dotnetjunkies.com/Article/16267D49-4C6E-4063-AB12-853761D31E66.dcik
http://www.juretta.com/log/2006/08/13/ruby_net_http_and_open-uri/ August 13, 2006 Ruby has different libraries that provide higher-level access to network protocols such as FTP, HTTP or HTTPS. This article shows how to use the net::http, net::https, open-uri and the rio library.

Ruby: Net::Http and open-uri - juretta.com