Subscribe to Feed

 

When you upgrade your PHP version (Usually from PHP 5.2 to 5.3), you might see several “PHP Deprecated” error on the top of your page. Error seen are similar to

PHP Deprecated: Assigning the return value of new by reference is deprecated in C:\Inetpub\wwwroot\wordpress\wp-settings.php on line 512
PHP Deprecated: Assigning the return value of new by reference is deprecated in C:\Inetpub\wwwroot\wordpress\wp-settings.php on line 527
PHP Deprecated: Assigning the return value of new by reference is deprecated in C:\Inetpub\wwwroot\wordpress\wp-settings.php on line 534
PHP Deprecated: Assigning the return value of new by reference is deprecated in C:\Inetpub\wwwroot\wordpress\wp-settings.php on line 570
PHP Deprecated: Assigning the return value of new by reference is deprecated in C:\Inetpub\wwwroot\wordpress\wp-includes\cache.php on line 103

One easy way to fix this is updating your wp-config.php file

  • Go to your wordpess installation file
  • Open the wp-config.php file
  • enter “error_reporting(0);" right after the "<?php" line
  • save the file and voila, the warnings are gone from the website

For Godaddy hosting users

If you are seeing this error on your GoDaddy hosting account, here is how to fix this

  • Log in to your Account Manager.
  • From the My Products section, click Web Hosting.
  • Next to the hosting account you want to use, click Launch.
  • From the Content menu, select FTP* File manager
  • Click on the folder your wordpress is installed in
  • Select the checkbox right by the wp-settings folder
    and click edit button on the top
  • In the edit window, enter “error_reporting(0);" right ater the "<?php" line
  • Click save button and browse to your web page to see the warnings magically gone.

Hope this helps,

CTRL+F5

 

If you are trying to export a virtual machine in Hyper-V and realize that you are missing the export option in the Action menu, don’t worry. This is most probably because your VM is in a non exportable state. Meaning, you virtual machine in any state other than off or saved. Hyper-V will only be able to export a VM if it is in either off state or saved state.  To get the export option back, hit ’save’ and then wait for the export option to show up in a minute or two.

-Ctrl+F5

 

I liked this quote from the Netflix Technology blog. Very interesting approach to testing a large scale high availability system

One of the first systems our engineers built in AWS is called the Chaos Monkey. The Chaos Monkey’s job is to randomly kill instances and services within our architecture. If we aren’t constantly testing our ability to succeed despite failure, then it isn’t likely to work when it matters most - in the event of an unexpected outage.

 

WinDbg has a built in undocumented feature that can be very useful to remember commonly used WinDbg commands. In essence it will build you a personalized GUI cheat-sheet of your commonly used commands.

They command to generate this is “.cmdtree c:\temp\myCommands.txt” , myCommands.txt here is a test file with a list of commands. You have to manually populate this file with commands.

Steps:

  • Create Commands file
  • Open WinDbg
  • Open a dump file.
  • Load the symbols
  • then use above command

Example commands file:

image

 

-CTRL+F5

 

I would definitely start with Channel 9 videos. Videos are always better than reading to start with in my opinion. 

Here are several links that can help you get started.

Videos:

Windows Phone 7 Development for Absolute Beginners: http://channel9.msdn.com/Series/Windows-Phone-7-Development-for-Absolute-Beginners

Books:

Free Book and best one to start with: “Programming Windows Phone 7” available at http://www.charlespetzold.com/phone/

Decent Book: http://www.amazon.com/Windows-Phone-7-Plain-Simple/dp/0735643423

Links:

“Learning Resources”  section from http://msdn.microsoft.com/en-us/library/ff402535(VS.92).aspx 

 

And then practice writing apps with

101 Windows Phone 7 Apps

Volume 1: http://www.amazon.com/101-Windows-Phone-Apps-Developing/dp/0672335522/ref=sr_1_2?ie=UTF8&qid=1309816618&sr=1-2-spell

Volume 2: http://www.amazon.com/101-Windows-Phone-Apps-Developing/dp/0672335603/ref=sr_1_1?ie=UTF8&qid=1309816618&sr=1-1-spell

Oh and do not forget the “MS Patterns and Practices Windows phone Developer guide” at http://www.amazon.com/Windows-Phone-Developer-Guide-applications/dp/0735656096/ref=sr_1_45?ie=UTF8&qid=1309816346&sr=8-45

 

- CTRL+F5

 

In a .Net 4.0 or later web application you may receive an error similar to

The configuration section yoursection cannot be read because it is missing a section declaration

when you try to get the web configuration information using Microsoft.Web.Administration.ServerManager API even when your web.config file looks alright and you do declare “yoursection” in the .Net framework web.config file located at “C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config”.

This is because prior to calling GetWebConfiguration, you have to explicitly tell ServerManager to use the 4.0 Framework. For example, here is a sample code on how to do this..

ServerManager manager = new Microsoft.Web.Administration.ServerManager(true, null);
config.SetMetadata("defaultManagedRuntimeVersion", "4.0.30319");
Configuration config = manager.GetWebConfiguration("yoursite", "/");
 
Hope this helps,
CTRL+F5  

 

One of the caveats with using RenderControl to spit out the HTML content that an ASP.Net server control generates is that any server control that renders client side JavaScript raises a http exception when rendering the content of the control to a HtmlTextWriter. There are couple of ways you can bypass this in .Net. One of the easiest ways is to disable the html rendering verification on the server side by overriding the “VerifyRenderingInServerFrom” method of the page. Here is how you can do this.. (Add the below method to your code behind page)

 

C#
public override void VerifyRenderingInServerForm(Control control)
{
    return;
}

 

VB
Public Overrides Sub VerifyRenderingInServerForm(ByVal control As Control)
        Return
End Sub 

Usually you need to override this method when you receive an error similar to "of type ‘GridView’ must be placed inside a form tag with runat=server"

 

- CTRL+F5

 

On windows Phone, you can easily use templates to change the default UI for most of the controls. In this post, I am giving an example of how to change the color of a scroll bar in a list box. The template I provided here is extensive and can use used to change many things in the ListBox. In the below ControlTemplate for the ListBox, notice the ScrollBar’s and the BackGround property for the ScrollBars, Changing this to you preferred color will give the scroll bar in what ever color you like.

 

<ListBox x:Name="myListBox">
    <ControlTemplate TargetType="ScrollViewer">
        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="ScrollStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="00:00:00.5"/>
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Scrolling">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="VerticalScrollBar"/>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="HorizontalScrollBar"/>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="NotScrolling"/>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid Margin="{TemplateBinding Padding}">
                <ScrollContentPresenter x:Name="ScrollContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}"/>
                <ScrollBar x:Name="VerticalScrollBar" Background="Blue" HorizontalAlignment="Right" Height="Auto" IsHitTestVisible="False" IsTabStop="False" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Opacity="0" Orientation="Vertical" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{TemplateBinding VerticalOffset}" ViewportSize="{TemplateBinding ViewportHeight}" VerticalAlignment="Stretch" Width="5"/>
                <ScrollBar x:Name="HorizontalScrollBar" Background="Blue"  HorizontalAlignment="Stretch" Height="5" IsHitTestVisible="False" IsTabStop="False" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Opacity="0" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{TemplateBinding HorizontalOffset}" ViewportSize="{TemplateBinding ViewportWidth}" VerticalAlignment="Bottom" Width="Auto"/>
            </Grid>
        </Border>
    </ControlTemplate>
</ListBox>

 

Hope This helps,

CTRL+F5

 

 

The other day I was struggling to write a small LINQ query, and after searching for a while I found this awesome page on MSDN which has about 101 LINQ samples. The samples cover most of the basic LINQ stuff that one would need. Here is the location

101 LINQ Samples: @ http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx

 

-CTRL+F5

 

 

Subscribe to Feed

Categories

Links

Dev Jobs