This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void TestTurkishStringCompare() | |
{ | |
const string lowerCharacters = "abcdefghijklmnopqrstuvwxyz"; | |
const string upperCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
var turkishCulture = CultureInfo.GetCultureInfo("tr-TR"); | |
var upper = lowerCharacters.ToUpper(turkishCulture); | |
var lower = upperCharacters.ToLower(turkishCulture); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Main() | |
{ | |
const string lowerCharacters = "abcdefghijklmnopqrstuvwxyz"; | |
const string upperCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures); | |
foreach (var culture in cultures) | |
{ | |
var upper = lowerCharacters.ToUpper(culture); | |
var lower = upperCharacters.ToLower(culture); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static T AppSetting<T>(this string key) | |
{ | |
var value = default(T); | |
if (ConfigurationManager.AppSettings[key] != null) | |
{ | |
var converter = TypeDescriptor.GetConverter(typeof (T)); | |
value = (T)converter.ConvertFrom(ConfigurationManager.AppSettings[key]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<IEnumerable<T>> Permute<T>(this IList<T> v) | |
{ | |
ICollection<IList<T>> result = new List<IList<T>>(); | |
Permute(v, v.Count, result); | |
return result; | |
} | |
private static void Permute<T>(IList<T> v, int n, ICollection<IList<T>> result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IEnumerable<IList<char>> CombineWithRepetitions(this IEnumerable<char> input, int take) | |
{ | |
ICollection<IList<char>> output = new Collection<IList<char>>(); | |
IList<char> item = new char[take]; | |
CombineWithRepetitions(output, input, item, 0); | |
return output; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
distinct comment_author, comment_author_email | |
FROM | |
wp_comments | |
INNER JOIN | |
wp_posts | |
ON | |
comment_post_ID = id | |
WHERE | |
post_title = 'Herbstcampus 2013: Teilnahme und Ticketverlosung' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void ApplyFormatting(int rows, int columns) | |
{ | |
// Complete surrounding borders of the gray box. | |
Range[Cells[1, 1], Cells[rows, columns]].Interior.Color = Color.LightGray; | |
Range[Cells[1, 1], Cells[rows, columns]].Borders[XlBordersIndex.xlEdgeTop].LineStyle = XlLineStyle.xlContinuous; | |
Range[Cells[1, 1], Cells[rows, columns]].Borders[XlBordersIndex.xlEdgeLeft].LineStyle = XlLineStyle.xlContinuous; | |
Range[Cells[1, 1], Cells[rows, columns]].Borders[XlBordersIndex.xlEdgeBottom].LineStyle = XlLineStyle.xlContinuous; | |
Range[Cells[1, 1], Cells[rows, columns]].Borders[XlBordersIndex.xlEdgeRight].LineStyle = XlLineStyle.xlContinuous; | |
// Set all column width to 2.14. That's a nice looking width. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void CalculateBirthdays(int rows, int columns) | |
{ | |
var days = 1; | |
var years = 1; | |
for (var row = 1; row <= rows; row++) | |
{ | |
for (var column = 1; column <= columns; column++) | |
{ | |
var cell = Cells[row, column] as Range; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void MarkKinderkarden(int fromYear, int toYear) | |
{ | |
MarkRange(fromYear, toYear, Color.SteelBlue); | |
} | |
private void MarkRange(int fromYear, int toYear, Color color) | |
{ | |
var dayStart = fromYear*365; | |
var dayEnd = toYear*365; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[diff] | |
tool = wdiff | |
[difftool "wdiff"] | |
cmd="wscript.exe \"c:\\Program Files\\TortoiseGit\\Diff-Scripts\\diff-doc.js\" \"$LOCAL\" \"`pwd`/$REMOTE\"" |
OlderNewer