SEO: Using Local Webhost
Source:Open Clip Art Using Under Public Domain Attribution
Recently, I moved my blog about Brisbane Life from a US hosting to a Aussie Hosting. There are a number of good reasons to use a local web host. Firstly, the most of readers are from Brisbane. The aussie local hosting can give me a better performance. Loading the pages from a local is much faster than over the pacific ocean. Secondly, that is for a SEO. If my users is using any local version search engines , such Yahoo Australia and Google Australia. They will list all pages from australia in the top. This will give me a better result. Thus, finally, we moved that blog into a local web host.
iOS: Print "%" in Label
'%' is a function word in Objective C, such as '%d" to print a number, How to print a '%' in a string? that is easy, just '%%'
Code
self.txtPercent.text= [NSString stringWithFormat:@"%d%%", (int)sender.value]; |
SEO Tips: Let everyone know about your website
Source:Open Clip Art Using Under Public Domain Attribution
Submitting your website to the search engines and even buying CPC services are not enough for SEO. If you want your website to become popular, please don't be shy. You have to let everyone know about your website:
- You need to talk to you about websites, even you should send an email to them, but please do not spam yours friends, I only sent those emails to the closet friends. I know they are happy about the news of my company website.
- You need to post the link your facebook and twitter, any social media you are using.
- If you are a member of some forums or facebook group, please post your website link to there too.
Please bring the website into your personal network(both virtual and physical)!
WPF:Show and Hide Button
In Winform, to show and hide button is easy. There is a property calls visible in Button class. You just need to set it to be True and Hide. That is a simple bool type. In WPF, that is simple too, but that is not a simple bool type. That is Visibility Type.
You just need to do that:
Show:
Code
btnMax.Visibility= System.Windows.Visibility.Visible; |
Hide:
Code
btnMax.Visibility= System.Windows.Visibility.Hidden; |
WPF: How to access a control in style
Source:Open Clip Art Using Under Public Domain Attribution
I got a control in style template at one of my custom controls, Like this:
<Style TargetType="{x:Type advgenControls:CollapsibleControl}" x:Key="LeftPanel">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type advgenControls:CollapsibleControl}">
<Grid>
<ContentPresenter x:Name="PART_ContentPresenter"/>
<ResizeGrip Grid.Row="1" HorizontalAlignment="Stretch" Width="Auto" Height="Auto" HorizontalContentAlignment="Right" Margin="0,0,2,2"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
I just want to call that "PART_ContentPresenter". But that is xaml living in resources.
That is easy I can use GetTemplateChild("PART_ContentPresenter" ) and call at the OnApplyTemplate(). Please remember don't use it at OnInitialized(EventArgs e). At that time, styles has not loaded yet, you get a null object.:
Code
public override void OnApplyTemplate() | |
{ | |
base.OnApplyTemplate(); | |
if (this.IsInitialized) | |
{ | |
ContentPresenter cp = GetTemplateChild("PART_ContentPresenter" ) as ContentPresenter; | |
if(sections.Count >0){ | |
cp.Content = sections[0]; | |
} | |
} | |
} |