Today I released the version 1.1.0.0 of Bonobo Git Server for Windows. This version contains some new nice features that should make your git repository management more easier and fixes some essential bugs and errors. For the whole log of changes please checkout changelog.
Just be don’t rush and download the proper installation package for you. If you have already installed previous version of Bonobo Git Server you have to download the update package. Otherwise you can overwrite all your settings and records in database. If you are doing a clean install download installation package.
Let’s have a quick look at some of those new features.
- Chinese and Japanese Localization
- New extra settings for user and repository creation that enables or disables anonymous account creation or disables creation of repositories for normal users
- Reasonable error messages for git clients
And there are more fixes, improvements and features so don’t hesitate to download this new version of Bonobo Git Server for Windows.
Remember that you can find all new sources and packages on github and you are more than welcome to help with the future development. I hope that you have a good time using new version of this application!
Did you ever need combining multiple data converters in WPF? And why would you do such thing?
I often use BoolToVisibilityConverter. Its purpose is pretty straighforward. True value is converted to Visibility.Visible and false is converted to Visibility.Collapsed. But what if I need the oposite functionality, should I write another converter and call it BoolToVisibilityInverseConverter? If I had already written a NotConverter isn’t it a waste of time to do that?
The answer is yes and the solution is to combine these converters together using a composing converter.
[ContentProperty("Converters")]
public class ComposingConverter : IValueConverter
{
private readonly Collection<IValueConverter> _converters = new Collection<ValueConverter>();
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public Collection<IValueConverter> Converters
{
get { return _converters; }
}
public Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
{
for (int i = 0; i < _converters.Count; i++)
{
value = _converters[i].Convert(value, targetType, parameter, culture);
}
return value;
}
public Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture)
{
for (int i = _converters.Count - 1; i >= 0; i--)
{
value = _converters[i].ConvertBack(value, targetType, parameter, culture);
}
return value;
}
}
The usage in XAML is very simple and is ilustrated in the example belove.
<data:ComposingConverter x:Key="BooleanToVisibilityInverseConverter">
<data:NotConverter />
<data:BooleanToVisibilityConverter />
</data:ComposingConverter>
Elegant solution, don’t you think?
The concept of creating a maintainable web page is not some kind of voodoo magic but is pretty simple if you follow some basic rules. The process starts by creation of a content file with the text and all semantic tags which is also known as html file. Second step is defining view rules and it is done by creating cascading style sheets.
Content
When you want to create a good design you should start with creating content first. It helps you to see page as complex file and not just by some separated blocks. It also helps you to realize the semantic meanings of all markups. The first advice is to start html first. Second advice is to use your head and create the file as simple as it gets, by using proper tags for all elements, e.g. for address you will use address tag.
Form Tips
You should use same style for forms in your whole website. Styles should be clean and easy recognizable. The end user should not be thinking if this is a form or not.
Larger forms can be group into sets using fieldset tag. You should use this option if your form is long.
Use labels with correct for specification.
<fieldset>
<legend>Billing Address</legend>
<label for="billAddress">Address</label><input type="text" id="billAddress" name="billAddress" />
<label for="billCity">City</label><input type="text" id="billCity" name="billCity" />
<label for="billProvince">Province</label><input type="text" id="billProvince" name="billProvince" />
<label for="billPC">Postal Code</label><input type="text" id="billPC" name="billPC" />
</fieldset>
Doctype
Specify your doctype correctly. Doctype definition will affect browser rendering.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Use Various Tags
Don’t limit yourself with few tags you know. For various purposes there is a lot of various tags. You should know each of them and use them for their semantic purpose.
View
Current view of web page should be defined only in cascading style sheets. If you want to make any visual change on your site and you have to edit html file, you are doing it wrong.
Reset
When you start defining your view you should reset various browser definitions for html elements. It is preferred not to use global * selector but to reset tags manually. Here is a modified YUI Reset:
html { color: #000; background: #FFF; }
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td { margin: 0; padding: 0; }
table { border-collapse: collapse; border-spacing: 0; }
fieldset, img { border: 0; }
address, caption, cite, code, dfn,em, strong, th, var, optgroup { font-style: inherit; font-weight: inherit;}
del, ins { text-decoration: none;}
sup { vertical-align: baseline;}
sub { vertical-align: baseline;}
li { list-style: none;}
caption, th { text-align: left;}
h1, h2, h3, h4, h5, h6 { font-size: 100%; font-weight: normal;}
q:before, q:after { content: '';}
abbr, acronym {border: 0; font-variant: normal; }
legend { color: #000; }
input, button, textarea, select, optgroup, option { font-family: inherit; font-size: inherit; font-style: inherit; font-weight: inherit;}
input, button, textarea, select { *font-size: 100%;}
Specificity
Specificity tells you the importance of current style. You should never use the keyword !important and only use CSS identifiers hierarchy.
Specificity can be simply measured. The measure of specificity is computed by adding numbers for different identifiers and higher value wins. If two or more have the same value, last one wins.
Inline style is for 1000 points, id classification for 100, class and pseudo-class 10 and element or pseudo-element for 1. So in
body #content .data img:hover
the specificity value is 122. 100 for #content, .data and :hover for 20 and body and img for 2.
Typography
Proper definition of typography elements helps your readers to quicker and more comfortable reading of your page. Check this site for few tips how to handle vertical rhythm.
Mind the Mobile Devices and Printing
Define your style sheets for mobile devices and printing devices is very useful and it doesn’t cost you almost anything at all. All you need to do is to insert definition for this type:
<link rel="stylesheet" href="print.css" type="text/css" media="print" /> <link rel="stylesheet" href="mobile.css" type="text/css" media="handheld" />
Simple definition for print.css
* { background: transparent !important; color: #444 !important; text-shadow: none; }
a, a:visited { color: #444 !important; text-decoration: underline; }
a:after { content: " (" attr(href) ")"; }
abbr:after { content: " (" attr(title) ")"; }
.ir a:after { content: ""; } /* Don't show links for images */
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
img { page-break-inside: avoid; }
@page { margin: 0.5cm; }
p, h2, h3, h4, h5, h6 { orphans: 3; widows: 3; }
h2, h3, h4, h5, h6 { page-break-after: avoid; }
and here is an example style sheet for mobile devices:
* { float: none; font-size: 80%; background: #fff; color: #000;}



