khushal999p

Stories submitted by friends of khushal999p

MemoryStream Multiplexer - Write and Read from many threads (omaralzabir.com)

submitted by oazabiroazabir(1805) 1 month, 23 days ago

Here’s an implementation of MemoryStream like buffer manager where one thread can write and many threads can read simultaneously. Each reading thread gets its own reader and can read from the shared stream on its own without blocking write operation or other parallel read operations. It supports blocking Read call so that reader threads can call Read(…) and wait until some data is available, exactly the same way you would expect a Stream to behave. read more...

add a comment |category: |Views: 8

tags: another

Cache WCF Javascript Proxy on Browser(omaralzabir.com)

submitted by oazabiroazabir(1805) 1 month, 23 days ago

When you use WCF services from Javascript, you have to generate the Javascript proxies by hitting the Service.svc/js. If you have five WCF services, then it means five javascripts to download. As browsers download javascripts synchronously, one after another, it adds latency to page load and slows down page rendering performance. Moreover, the same WCF service proxy is downloaded from every page, because the generated javascript file is not cached on browser. Here is a solution that will ensure the generated Javascript proxies are cached on browser and when there is a hit on the service, it will respond with HTTP 304 if the Service.svc file has not changed. read more...

add a comment |category: |Views: 5

tags: another

Prevent ASP.NET cookies from being sent on every css, js, img request(omaralzabir.com)

submitted by oazabiroazabir(1805) 7 months, 12 days ago

ASP.NET generates some large cookies if you are using ASP.NET membership provider. Especially if you are using the Anonymous provider, then a typical site will send 517 bytes of cookie on every css, js, image request. That's 60 GB worth useless upload for 1M page view. See how to prevent this. read more...

2 comments |category: |Views: 30

tags: another

Tweaking WCF to build highly scalable async REST API(www.codeproject.com)

submitted by oazabiroazabir(1805) 9 months, 26 days ago

You can build async REST API using WCF but due to some bug in WCF implementation it does not scale as you would want it to. Here's my journey with Microsoft's WCF team to explore the problem and find the right fix. read more...

add a comment |category: |Views: 6

tags: another

Build truly RESTful API and website using same ASP.NET MVC code(www.codeproject.com)

submitted by oazabiroazabir(1805) 9 months, 27 days ago

Usually we create separate controllers or WCF service layer to deal with API part of the website but I will show you how you can create both RESTful website and API using the same controller code working over the exact same URL that a browser can use to browse through the website and a client application can do CRUD over. read more...

add a comment |category: |Views: 6

tags: another

How to Securely Verify and Validate Image Uploads in ASP.NET and ASP.N(www.aaronstannard.com)

submitted by AarononthewebAaronontheweb(1140) 11 months, 2 days ago

How do you verify that content that your users are uploading to your ASP.NET site are just harmless images and not something malicious? Use GDI+ to validate that images are images and nothing else! read more...

add a comment |category: |Views: 23

tags: another

Automatic JS, CSS versioning to force update browser cache(omaralzabir.com)

submitted by oazabiroazabir(1805) 11 months, 28 days ago

When you update javascript or css files that are already cached in users’ browsers, most likely many users won’t get that for some time because of the caching at the browser or intermediate proxy(s). You need some way to force browser and proxy(s) to download latest files. Here's an HttpFilter that will automatically generate new URL for changed files. read more...

add a comment |category: |Views: 37

tags: another

WCF does not support compression out of the box, so fix it(omaralzabir.com)

submitted by oazabiroazabir(1805) 1 year, 3 months ago

WCF does not support compression over IIS. Even IIS does not support compression of SOAP messages by default. Learn how to fix both. read more...

add a comment |category: |Views: 1

tags: another

Safely deploying changes to production server(omaralzabir.com)

submitted by oazabiroazabir(1805) 1 year, 3 months ago

When you deploy incremental changes on a production server, which is running and live all the time, you some times see error messages like “Compiler Error Message: The Type ‘XXX’ exists in both…”. Sometimes you find Application_Start event not firing although you shipped a new class, dll or web.config. Sometimes you find static variables not getting initialized and so on. There are so many weird things happen on webservers when you incrementally deploy changes to the server and the server has been up and running for several weeks. Learn how to safely deploy and automate server restart, cleanup, start, warmup procedures. read more...

add a comment |category: |Views: 4

tags: another

How to Use Remote Validation in ASP.NET MVC3(www.aaronstannard.com)

submitted by AarononthewebAaronontheweb(1140) 1 year, 5 months ago

Remote validation is brand new as of ASP.NET MVC3 RC, and it's a powerful feature for remotely validating user input against your data repositories in real-time, and it doesn't require developers to program ANY jQuery whatsoever. read more...

add a comment |category: |Views: 31

tags: another

Quick ways to boost performance and scalability of ASP.NET, WCF and De(omaralzabir.com)

submitted by oazabiroazabir(1805) 1 year, 5 months ago

By tweaking system.net changes, you can increase the number of parallel calls that can be made from the services hosted on your servers as well as on desktop computers and thus increase scalability. By changing WCF throttling config you can increase number of simultaneous calls WCF can accept and thus make most use of your hardware power. By changing ASP.NET process model, you can increase number of concurrent requests that can be served by your website. And finally by turning on IIS caching and dynamic compression, you can dramatically increase the page download speed on browsers and and overall responsiveness of your applications. read more...

add a comment |category: |Views: 10

tags: another

Dynamically set WCF Endpoint in Silverlight(omaralzabir.com)

submitted by oazabiroazabir(1805) 1 year, 5 months ago

When you add a WCF service reference to a Silverlight Application, it generates the ServiceReference.ClientConfig file where the URL of the WCF endpoint is defined. When you add the WCF service reference on a development computer, the endpoint URL is on localhost. But when you deploy the Silverlight client and the WCF service on a production server, the endpoint URL no longer is on localhost instead on some domain. As a result, the Silverlight application fails to call the WCF services. You have to manually change the endpoint URL on the Silverlight config file to match the production URL before deploying live. See how to automate this. read more...

add a comment |category: |Views: 42

tags: another

Ten Caching mistakes that break your app(omaralzabir.com)

submitted by oazabiroazabir(1805) 1 year, 7 months ago

Caching frequently used objects, that are expensive to fetch from the source, makes application perform faster under high load. It helps scale an application under concurrent requests. But some hard to notice mistakes can lead the application to suffer under high load, let alone making it perform better, especially when you are using distributed caching where there’s separate cache server or cache application that stores the items. Moreover, code that works fine using in-memory cache can fail when the cache is made out-of-process. Here I will show you some common distributed caching mistakes that will help you make better decision when to cache and when not to cache. read more...

add a comment |category: |Views: 189

tags: another

How to make screencasts in animated GIF for free(omaralzabir.com)

submitted by oazabiroazabir(1805) 1 year, 8 months ago

I have been using animated GIFs to show short screencasts in my blogs and articles. Animated GIF is supported by all browsers and supports virtually any website in the world where even Flash is blocked. A picture is worth a thousand words, and an animation is worth a thousand multiplied by [frames in animation] words. So, I have been looking for a complete free solution to capturing screencasts and then converting it to animated GIF and then heavily compressing it. read more...

add a comment |category: |Views: 3

tags: another

Building High Performance Queue in Database for Orders, Tasks, ...(omaralzabir.com)

submitted by oazabiroazabir(1805) 1 year, 8 months ago

Queue is a widely used data structure that sometimes have to be created in a database instead of using specialized queue technologies like MSMQ. Running a high performance and highly scalable queue using database technologies is a big challenge and it’s hard to maintain when the queue starts to get millions of rows queued and dequeued per day. Let me show you some common design mistakes made in designing Queue-like tables and how to get maximum performance and scalability from a queue implemented using simple database features. read more...

add a comment |category: |Views: 37

tags: another

Exporting normalized relational data from database to flat file(omaralzabir.com)

submitted by oazabiroazabir(1805) 1 year, 8 months ago

Sometimes you need to export relational normalized data into flat files where a single row comes from various tables. For example, say you want to export all customer records along with their work and home address, and primary phone number in a single row. But the address and contact information are coming from different tables and there can be multiple rows in those table for a single customer. Sometimes there can be no row available in address/phone table for a customer. In such a case, neither INNER JOIN, nor LEFT JOIN/OUTER JOIN will work. How do you do it? Solution is to use OUTER APPLY. read more...

add a comment |category: |Views: 6

tags: another