Tampilkan postingan dengan label Tricks. Tampilkan semua postingan
Tampilkan postingan dengan label Tricks. Tampilkan semua postingan

Minggu, 02 Januari 2011

Tips and Tricks for Silverlight Developers.

wanted to create a series of blog post that gets right to the point and is aimed specifically at Silverlight Developers. The most important things I want this series to answer is :
  • What is it? 
  • Why do I care?
  • How do I do it?
I hope that you enjoy this series. Let’s get started:
Tip/Trick #16)
What is it? Find out version information about Silverlight and which WebKit it is using by going to http://issilverlightinstalled.com/scriptverify/.
Why do I care? I’ve had those users that its just easier to give them a site and say copy/paste the line that says User Agent in order to troubleshoot a Silverlight problem. I’ve also been debugging my own Silverlight applications and needed an easy way to determine if the plugin is disabled or not.
How do I do it: Simply navigate to http://issilverlightinstalled.com/scriptverify/ and hit the Verify button. An example screenshot is located below:
Results from Chrome 7
image
Results from Internet Explorer 8 (With Silverlight Disabled)
image
Tip/Trick #17)
What is it? Use Lambdas whenever you can.
Why do I care?  It is my personal opinion that code is easier to read using Lambdas after you get past the syntax.
How do I do it: For example: You may write code like the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
    //Check and see if we have a newer .XAP file on the server
    Application.Current.CheckAndDownloadUpdateAsync();
    Application.Current.CheckAndDownloadUpdateCompleted += new CheckAndDownloadUpdateCompletedEventHandler(Current_CheckAndDownloadUpdateCompleted);
 
}
 
void Current_CheckAndDownloadUpdateCompleted(object sender, CheckAndDownloadUpdateCompletedEventArgs e)
{
    if (e.UpdateAvailable)
    {
 
        MessageBox.Show(
            "An update has been installed. To see the updates please exit and restart the application");
    }
}
To me this style forces me to look for the other Method to see what the code is actually doing. The style located below is much easier to read in my opinion and does the exact same thing.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
    //Check and see if we have a newer .XAP file on the server
    Application.Current.CheckAndDownloadUpdateAsync();
    Application.Current.CheckAndDownloadUpdateCompleted += (s, e) =>
    {
        if (e.UpdateAvailable)
        {
 
            MessageBox.Show(
                "An update has been installed. To see the updates please exit and restart the application");
        }
    };
 
}
Tip/Trick #18)
What is it? Prevent development Web Service references from breaking when Visual Studio auto generates a new port number.
Why do I care?  We have all been there, we are developing a Silverlight Application and all of a sudden our development web services break. We check and find out that the local port number that Visual Studio assigned has changed and now we need up to update all of our service references. We need a way to stop this.
How do I do it: This can actually be prevented with just a few mouse click. Right click on your web solution and goto properties. Click the tab that says, Web. You just need to click the radio button and specify a port number. Now you won’t be bothered with that anymore.
image
Tip/Trick #19)
What is it? You can disable the Close Button a ChildWindow.
Why do I care?  I wouldn’t blog about it if I hadn’t seen it. Devs trying to override keystrokes to prevent users from closing a Child Window.
How do I do it: A property exist on the ChildWindow called “HasCloseButton”, you simply change that to false and your close button is gone. You can delete the “Cancel” button and add some logic to the OK button if you want the user to respond before proceeding.
image
image
Tip/Trick #20)
What is it? Cleanup your XAML.
Why do I care?  By removing unneeded namespaces, not naming all of your controls and getting rid of designer markup you can improve code quality and readability.
How do I do it: (This is a 3 in one tip)
Remove unused Designer markup:
1)
Have you ever wondered what the following code snippet does?
1
2
3
4
mc:Ignorable="d"
d:DesignWidth="640" d:DesignHeight="480"
This code is telling the designer to do something special with this page in “Design mode” Specifically the width and the height of the page. When its running in the browser it will not use this information and it is actually ignored by the XAML parser. In other words, if you don’t need it then delete it.
2)
If you are not using a namespace then remove it. In the code sample below, I am using Resharper which will tell me the ones that I’m not using by the grayed out line below. If you don’t have resharper you can look in your XAML and manually remove the unneeded namespaces.
image
3)
Don’t name an control unless you actually need to refer to it in procedural code. If you name a control you will take a slight performance hit that is totally unnecessary if its not being called.
1
<TextBlock Height="23" Text="TextBlock" />

Sabtu, 01 Januari 2011

Twin Tip Ski Tricks

Overview

The twin tip is a specialized model of the downhill ski. Freestyle riders prefer the twin tip design as it allows them to ride backwards. Unlike conventional models of alpine skis, the twin tip construction features an elevated tip on the front and back end. You can increase your bag of tricks with twin tip skiing maneuvers.

Spinning

Spinning remains one of the most basic twin tip techniques. Many skiers prefer to practice the spinning technique on inclined snow ramps. The twin tip enables you to land backwards after a 180- or 540-degree spin. Crouch down as you reach the top lip of the freestyle skiing ramp. Spin your shoulders while pointing the front tips of your skis in the direction of the rotation. When landing backwards, look over your shoulder to have a clear view of your skiing direction.


Tail Grab

The tail grab is a stylish twin tip skiing trick. Crouch down to lower your skiing stance as you begin to ride up the takeoff ramp. Extend your legs and jump vertically as you reach the top lip of the skiing ramp. Point the front tips of your skis towards the ground while extending your dominant hand behind you. The ABC-of-Skiing website recommends crossing your skis as you soar above the mountain slope. Use your right hand to grab the tail, or back tip, of your right ski.

Rail Slide

Many twin tip skiers enjoy riding in terrain parks. Freestyle terrain parks commonly feature circular and square shaped rails. Use your twin tip skis to slide across rails and ledges. Ski up to the rail with a moderate amount of speed. Extend your legs to jump above the freestyle rail. "Free Skier Magazine" recommends turning your skis until they remain perpendicular with the rail. Bend your knees as the twin tip skis slide across the top of the rail. Dismount in a forward or backwards skiing stance.

Back Flip

The lightweight construction of the twin tip skis allow you to perform a difficult trick known as the back flip. The back flip may seem intimidating at first as you will have to rotate upside down. Use a medium to large sized skiing ramp to learn the back flip. Approach the ramp with a comfortable amount of speed. Lean back while jumping off the top lip of the ramp. Tuck your knees to begin the backwards somersault. Watch the ground to spot your landing.

Tips and Tricks Friday

Today's tip is for antiquing.  Reading some forums this morning, and one question was on paint for antiquing.  What do you use?  Acrylics?  Wood stain?  Old English Furniture Polish?  (just kidding...although, if you wanted the doll to smell like Mom just cleaned house...)

I have discovered a favorite, that's not too messy, seems to last forever, dries matte, and is inexpensive: Water soluble oil paint. I bought it at Hobby Lobby--I'm sure you can get it, in several brands.  The one I got was Windsor Newton, in burnt umber.

To use it, I put the TINIEST amount down, depending of course on how much area you need to cover, and mix it with water!  That easy.  It takes some serious stirring to get the lumps dissolved, but it doesn't dry as fast as acrylics, which always had the tenancy--for me at least--to over-color the project.  If you want more, another coat does the trick, or a less diluted mix.

The next thing I plan to try is water-soluble oil pastels for coloring/painting faces & features.  Does anyone have experience using them?

Call Of Duty – Tips And Tricks When Playing Online

One of the factors why Call of Duty is very popular among hardcore gamers is because it enables the gamers to compete with other players through an open network. You’ll find a good deal of advantages of playing this game on the net and one is that you will be in a position to compete with more gamers without becoming limited by people who are near your place. As a gamer you’ll enjoy the beauty of this game more than what you expect with these few tips and tricks.
The first trick that you need to learn is to remember the locations of all your enemies. The players will generally commence in a specific place, and keeping in mind these locations will make it easier to get rid of the players faster. Use the Greenhorn Mode till you’re familiar with these locations and use this information as an advantage.
One more thing that you have to remember is to try and use pistol guns as often as you can. When you are exchanging fire with an enemy and your main weapon runs out of ammo. It’s much better to take out your pistol and use it rather than using up time reloading your main weapon. Pistols inflict less harm, but they’re a good deal faster compared to utilizing main weapons.
And finally, attempt to use as numerous gun combinations as possible. Try to test the best combinations that work for you. At all times maintain in thoughts that various players may require various combinations according to how they play the game. The efficiency of the weapon depends on how the player regulates the shots.
If you would like to discover more about the basic tips and tricks that will allow you to play Call of Duty on-line much better, attempt to go to gaming forums. This is a place where you can meet other CoD players who are exchanging info with other players about their newly gained information. You will find times when professional gamers invest time to post a very effective tip that you can use the next time you play the game.