WCF POX, JSON and SOAP Coexist

By admin - Last updated: Monday, August 16, 2010

Sometimes, we want to make a service available in different protocols so that clients could have an option to choose one of their favorite methods to consume the web services. Here we are going to talk about how to make one WCF service available in POX(Plain Old XML as XML for short), JSON and SOAP [...]

Filed in WCF • Tags: , , , , , , , , ,

Windows Firewall opens a range of ports for Passive FTP server

By admin - Last updated: Friday, August 13, 2010

Windows Firewall opens a range of ports for Passive FTP server, you can not add a range on the UI easily, but you can do it in the command line like below. Run the command in the command prompt, e.g. high port range is from 41000 to 41100 FOR /L %P IN (41000,1,41100) DO netsh [...]

Filed in Security

SQL server 2008 SP1 Restart computer checks failed

By admin - Last updated: Tuesday, July 20, 2010

I was trying to install Biztalk server 2010 beta which requires SQL server 2008 SP1. At beginning of installing SQL server 2008 SP1, it says Restart computer required. It looks something has not been reset or cleared properly. After searching around, I realised that this could be caused by that some pending operations hasn’t been [...]

Filed in NotWorking • Tags: ,

VirtualPathProvider not working for static files under IIS 6

By admin - Last updated: Wednesday, June 30, 2010

If  you have come across embedding the css, javascript and aspx into a separate dll as resources and the website will resolve them by read out from resources by using the custom VirtualPathProvider. One of the ASP.NET plugin architectures used this method and it works quite well. During the development with visual studio built-in development server, everything [...]

Filed in NotWorking • Tags: ,

HTML generations, the way of the future web development.

By admin - Last updated: Saturday, June 26, 2010

1991 HTML 1994 HTML 2 1996 CSS 1 + JavaScript 1997 HTML 4 1998 CSS 2 2000 XHTML 1 2002 Tableless Web Design 2005 AJAX 2009 HTML 5 Some highlights from google Chrom HTML , (yes only some points). Some of them were actually presented in google gears. Web SQL Database You can create tables and CRUD the data. Web Worker Multiple threaded [...]

Filed in Web Application • Tags: ,

system.web HttpContextBase can not be found

By admin - Last updated: Thursday, June 24, 2010

Not only you need to reference System.Web but also reference System.Web.Abstractions

Filed in NotWorking • Tags:

iphone xcode: keyboard can not be dismissed

By admin - Last updated: Monday, June 7, 2010

Firstly, have you saved the interface builder explicitely after making changes for UITextFeild connection? Secondly, check if you have set the delegate of e.g. UITextField’s delegate attribute to the class containing the implementation of UITextFieldDelegate protocol. which will look like – (BOOL)textFieldShouldReturn:(UITextField *)theTextField {     if (theTextField == textField) {         [...]

Filed in iphone • Tags:

Random scripts

By admin - Last updated: Sunday, March 7, 2010

SQL transaction try catch template BEGIN TRY BEGIN TRAN – sql goes here COMMIT END TRY BEGIN CATCH SELECT ERROR_NUMBER() AS ErrorNumber ,ERROR_SEVERITY() AS ErrorSeverity ,ERROR_STATE() AS ErrorState ,ERROR_PROCEDURE() AS ErrorProcedure ,ERROR_LINE() AS ErrorLine ,ERROR_MESSAGE() AS ErrorMessage ROLLBACK END CATCH Very nice blog around WCF security http://www.leastprivilege.com Search object name within SQL database SELECT name [...]

Filed in Random

MSSQL : List all tables with size and row count

By admin - Last updated: Sunday, December 13, 2009

It comes to be very handy while analyzing the database tables. Here is a quick and dirty script lists all the tables and their rows counts, data size. DECLARE @table table(Id int IDENTITY(1,1) , Name varchar(256)) INSERT INTO @table SELECT b.name + ‘.’+ a.name FROM sys.tables a INNER JOIN sys.schemas b ON a.schema_id = b.schema_id [...]

Filed in SQL • Tags:

A simplest/dumbest CSharp IDE

By admin - Last updated: Sunday, November 29, 2009

The tiny WPF app (14k) has a textbox allows the input of the C# code, it compiles the code and execute the code after press F5 key. Here is what it looks like. No surprise. The main part which compiles the code at runtime is using CSharpCodeProvider from Microsoft.CSharp namespace. static CompilerResults Build(string code, IEnumerable<string> [...]

Filed in Random • Tags: ,

VS 2008 Project: Group/nest source code files

By admin - Last updated: Thursday, November 26, 2009

Like windows form project, the design code and source code are grouped together for the ease of code management. You can group any related files in to one expendable tree view. Before grouping After grouping That’s pretty handy aye! Unfortunately, there is no UI to do this. The only way I’ve found is to modify [...]

Filed in Random

C# Find All Derived Types From Assembly

By admin - Last updated: Sunday, November 15, 2009

I was always wondering if there is any method to find all derived types for the given type within an assembly. It would be handy to just pass either a class or an interface type and it will return me all its subs. I’ve come out with a method does that. It finds all the [...]

Filed in Code Notes • Tags: