Error:There is a duplicate ‘system.web.extensions/scripting/scriptResourceHandler’ section defined


Error like this is usually occurs in IIS after deploying a working website (local).
In my case, this error usually comes in when I use a .Net Framework higher version in IIS than the .Net Framework I use in my website application. One of the solutions that I applied was to upgrade the .Net Framework in my apps to make the same as IIS.

No Comments


Error:provided as the Service attribute value in the ServiceHost directive could not be found.


You will encounter this type of error when running the wcf service in local machine, one of the reasons this error occurs is when you rename the .svc file. In order to solve this issue you also have to update its configuration in the web.config file in section, there you will see following sub elements that needs to update

<service name=”WCFStudy.Products.ProductsServiceImpl” behaviorConfiguration=”WCFStudy.Products.ProductsServiceImplBehavior“>

<endpoint address=”" binding=”wsHttpBinding” contract=”WCFStudy.Products.IProductService“>

<behavior name=”WCFStudy.Products.ProductsServiceImplBehavior“>

 

No Comments


Error:Windows Azure Tools: Failed to initialize Windows Azure storage emulator. Unable to start Development Storage. Failed to start Storage Emulator: the SQL Server instance ‘localhost\SQLExpress’ could not be found. Please configure the SQL Server instance for Storage Emulator using the ‘DSInit’ utility in the Windows Azure SDK.


To use SQL Server instead of SQL Server Express for Windows Azure storage:

    1. Click Start, point to All Programs, and then click Windows Azure SDK v1.4
    2. Right-click Windows Azure SDK Command Prompt, then click Run as Administrator
    3. In the Windows Azure SDK Command Prompt window, type the following command: DSInit /sqlInstance:<SQLServerInstance>

Note: >SQLServerInstance< is the name of the SQL Server instance without the (< >)’s
Note: You can also use the following command, which uses the default instance of SQL Server: DSInit /sqlInstance:.

No Comments


How to maintain aspx page position


When working with multiple forms in one page, sometimes you want to stay in the current position after submitting the form. To do this you have options;

  1. MaintainScrollPositionOnPostback set to true – you can set this in web.config to make all pages behave as you want it or you can plug it in the page level.
  2. You can use a javascript
        <script type="text/javascript">
            window.scrollTo = function( x,y ) {
                return true;
            }
        </script>

No Comments


How to get new image size in UIImageView


Sometime we need to know the new size of the image that’s being rendered in UIImageView with auto scaled applied. Here’s the computation

-(CGRect)frameForImage:(UIImage*)image inImageViewAspectFit:(UIImageView*)imageView
{
float imageRatio = image.size.width / image.size.height;

float viewRatio = imageView.frame.size.width / imageView.frame.size.height;

if(imageRatio < viewRatio)
{
float scale = imageView.frame.size.height / image.size.height;

float width = scale * image.size.width;

float topLeftX = (imageView.frame.size.width - width) * 0.5;

return CGRectMake(topLeftX, 0, width, imageView.frame.size.height);
}
else
{
float scale = imageView.frame.size.width / image.size.width;

float height = scale * image.size.height;

float topLeftY = (imageView.frame.size.height - height) * 0.5;

return CGRectMake(0, topLeftY, imageView.frame.size.width, height);
}

}

Source

No Comments


Xcode Installation Failed


Installing xcode4 on Mac OS X 10.6.7 or 10.6.8 would sometimes failed

To resolve this issue, just set your system time to January 1, 2011 or earlier, as the certificate that signed the package has expired.

Xcode Installation Failed.

No Comments


Warning: The serializable class does not declare a static final serialVersionUID field


When developing java application in eclipse you will probably see this warning. To remove this warning you have to add static variable inside your class.

Here’s an example;

private static final long serialVersionUID = 100L;

Reference 1

Reference 2

No Comments


How to debug windows service remotely in vb.net


To debug windows service application that was already installed on the server, you only have to run the VISUAL STUDIO REMOTE DEBUGGING MONITOR.

No Comments


How to restrict database access and terminate all active transactions and connection in SQL Server


You would apply the following command in order to restrict database access and terminate all active transaction and connection at the same time.

ALTER DATABASE [DatabaeName] SET RESTRICTED_USER WITH ROLLBACK IMMEDIATE

,

No Comments


Warning: Multiple build commands for output file /Users/


To solve this problem the following procedures will do it;

  1. Goto View->Navigators->Project
  2. Select the root node in the left treeview, then select the Project Name under TARGETS . see image below.
  3. Select Build Phases
  4. Delete the files in red under “Copy Bundle Resources”

XCode project tree

, ,

No Comments



SetPageWidth