background preloader

Json.NET

Json.NET

Creating high performance WCF services - Scott Weinstein on .Net I had a WCF service where I wanted to be able to support over a hundred concurrent users, and while most of the service methods had small payloads which returned quickly, the startup sequence needed to pull down 200,000 records. The out of the box WCF service had no ability to support this scenario, but with some effort I was able to squeeze orders of magnitude performance increases out of the service and hit the performance goal. Initially performance was abysmal and there was talk of ditching WCF entirely ( and as the one pushing WCF technology on the project this didn't seem like a career enhancing change ) Here's how performance was optimized. Use NetTCP binding This helps both throughput and the time it takes to open and close connectionsUse DataContract Serializer instead of XMLSerializerI started out using DataTables - POCO objects via Linq2Sql yielded a 6x increaseslow: [OperationContract] MyDataTable GetData(...) [OperationContract] Byte[] GetData( and the implementation to

Facebook Application Development | Facebook Pages | Facebook Connect HAProxy - The Reliable, High Performance TCP/HTTP Load Balancer Dan Rigsby » How to throttle a Wcf service, help prevent DoS attacks, and maintain Wcf scalability What can you do to prevent denial of service (DoS) attacks on your Wcf services? A DoS attack occurs when a flood of client requests come into a service and prevent legitimate requests from being made or slow down intended processing. At the same time, you need to be careful not to stranglehold legitimate requests and activity. Throttling Throttling is one mechanism that can be used to help mitigate the load from a DoS attack. Wcf handles throttling through the ServiceThrottlingBehavior class. or through the app.config: There are 3 properties supported on the ServiceThrottlingBehavior: MaxConcurrentCalls (default = 16) [Per-message] The maximum number of messages that can actively be processed. "The open operation did not complete within the allotted timeout of 00:00:59.9989999. You could set all the these values to Int32.Max. Recommendations: If your InstanceContext is set to "PerSession" you should set maxConcurrentCalls to be at least 25-30. Quotas

Facebook.NET Getting Started With The PayPal API Advertisement PayPal is the most popular platform for receiving online payments today. The ease of opening a PayPal account and receiving payments compared to opening a merchant account with a traditional payment gateway is probably the number one reason for its popularity, with a close second being the comprehensive API that PayPal provides for its payment services. In this post, I will break down some of the techniques and approaches to working with the PayPal API, in order to make integration and troubleshooting simpler and easier. Disclaimer: PayPal’s API is among the worst I’ve ever had to deal with. The Different Payment Options PayPal offers a variety of payment options, which might be confusing at first: Express Checkout The premier PayPal service. This list is not comprehensive, but it covers the main payment options (see the API documentation for more). Making API Requests PayPal supports two main formats over HTTP: NVP and SOAP. Requests are made over HTTPS. Express Checkout 1. 2.

GetType and TypeOf confusion - Joacim's view on stuff Both VB and C# have an operator called TypeOf (or typeof in C#) but they perform two completely different things. In VB there are also two kind of GetType() calls, the object.GetType() method which is part of the .Net framework and the VB language specific GetType() operator. Are you confused yet? Don’t worry, in this article I will try to explain the difference between these operators and the object.GetType() method. The TypeOf, typeof, GetType operators The VB TypeOf operator is used together with the Is keyword and is used for checking if an object is of a particular type. result = TypeOf x Is String If “x” above is a string then “result” would be True otherwise it is set to False. result = x is string; The typeof operator in C# on the other hand returns an instance of the System.Type class containing type declarations of the type you pass to it. Type t = typeof(string); The VB equivalent of the C# typeof operator is the GetType operator. Dim t As Type = GetType(String) Have fun!

How to Develop a Hit Facebook App: 29 Essential Tools and Tutorials - Software Developer Resources to help you build a successful Facebook app that users will love. Software Developer Editors "Wanted: Facebook App Developer" is one of the most popular programmer job-board postings of 2007. Seemingly everyone is trying to capitalize on the popularity of Facebook by developing their own integrated application in the hopes that it will go viral. Unfortunately, however, there still isn't a lot of good information available as to how to actually create a working Facebook app, not to mention a popular one. Related Articles: Introductory Links: The Basics Although Facebook's developer resources won't provide you with the depth of information needed to build something remarkable, it should be every new Facebook developer's first stop. 1. 2. 3. 4. 5. Tricks of the Trade Having covered the basics of Facebook app development and integration, you'll want to start creating more complex applications and achieving more seamless integration. 8. 9. 10. 12. Code Samples, Discussion and Forums

squid : Optimising Web Delivery elmah - Error Logging Modules and Handlers for ASP.NET ELMAH (Error Logging Modules and Handlers) is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application, or even all ASP.NET web applications on a machine, without any need for re-compilation or re-deployment. Once ELMAH has been dropped into a running web application and configured appropriately, you get the following facilities without changing a single line of your code: Logging of nearly all unhandled exceptions. A web page to remotely view the entire log of recoded exceptions. ELMAH 1.2 Service Pack (SP) 2 now available for download. More Features Log errors to several back-end storages: Supports ASP.NET 1.x, 2.0 and later versions. ELMAH in Action Following is a screenshot of Firefox displaying the error log page as provided by ELMAH: To learn more about ELMAH, see the MSDN article “Using HTTP Modules and Handlers to Create Pluggable ASP.NET Components” by Scott Mitchell and Atif Aziz.

Fun With WebMatrix Helpers in ASP.NET MVC 3 « .NET Web stuff, mostly. It’s nearly the weekend, and it’s been long week, so let’s have a bit of fun… So I take it you’ve all had a chance to look at WebMatrix? If you haven’t then you should really make the effort to have a play around with it. I will admit that I was a bit snobby about it when I first read about it, but it is actually a really great way to build small, simple web sites. For the uninitiated, here are a few useful links: You can install WebMatrix through the Web Platform Installer. Well, WebMatrix is built on ASP.NET, so it is actually a trivial task to add them to an ASP.NET MVC application. Getting Going There are loads of helpers available, today we are going to look at the Microsoft Web Helpers. Install-Package microsoft-web-helpers into the the Package Manager Console. Next you will need to add references to WebMatrix.Data and WebMatrix.WebData and set the “Copy Local” property to true for both of them. And that’s it! Gravatar @Gravatar.GetHtml("stevelydford@gmail.com") XBox Live GamerCard

How to call a Visual C# method asynchronously The Microsoft .NET Framework makes it easy to call functions asynchronously. Calling functions asynchronously causes the system to execute them in the background on a secondary thread while the calling function continues to do other work. In a typical (synchronous) function call, the function is executed right away on the same thread that made the call. The calling function waits for the call to complete and receives the results of the call before continuing. By contrast, when you make an asynchronous call, you retrieve the results of the asynchronous call later. This article demonstrates how to do this by using Visual C#. Requirements How To Make Asynchronous Calls Asynchronous calls are made by using delegates. BeginInvoke() is used to initiate the asynchronous call. The EndInvoke() function is used to retrieve the results of the asynchronous call. The following is an example of a delegate and its BeginInvoke() and EndInvoke() methods: Sample 1: Calling A Method Synchronously

Playing In PayPal's Sandbox Hello, is this thing on? Many of us who have, or are in the process of launching, e-commerce sites have wondered about this at one time or another. The most common way of finding out is to make a test purchase of $1 or less, to see if everything works. At about 35 cents a try (in PayPal fees), most people simply consider it a start up cost. But there is an alternative, that costs nothing to use; the PayPal Sandbox. With the sandbox you can simulate PayPal transactions, as many times as you want, without incurring any processing fees. Getting Started You will first need a PayPal sandbox account. Once you have completed the sign up and verification process, you should be able to log into your sandbox account. Test Accounts Test accounts are simulations of PayPal buyers and sellers. After your test accounts have been created, you can goto the “Test Accounts” section of the sandbox, select an account, and then click “Enter Sandbox Test Site.” Test Email Configuring Your Site Let’s Play!

Related: