- 1
- 2
- 3
- 4
- 5
if (sdk.Name.ToLower().Contains("Windows Phone"))
{
WP7SDK = sdk;
break;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+139
if (sdk.Name.ToLower().Contains("Windows Phone"))
{
WP7SDK = sdk;
break;
}
Быстро написал, потом когда пересматривал обнаружил
+145
<?xml version="1.0"?>
-<DocumentElement>
<o2p time="27.10.2011 8:00:38"/>
<o2p timecreate="26.10.2011 22:43:17"/>
<o2p di="0.0000" g="" d="" dv="0.0000" i="8751" q="4.0000" c="C3212"/>
<o2p di="0.0000" g="" d="" dv="0.0000" i="8751" q="2.0000" c="C3213"/>
...
после обновления ПО в файлах выгрузки добавились строки 3-4
+135
static void Main(string[] args)
{
string[] indiaCityVisit = {
"Delhi", "Jodhpur", "Mumbai", "Pune", "Agra",
"Shimla", "Bengaluru", "Mysore", "Ooty",
"Jaipur", "Nagpur", "Amritsar", "Hyderabad",
"Goa", "Ahmedabad" };
string cities = String.Join(",", indiaCityVisit
.Select(s => s.ToString())
.ToArray());
Console.WriteLine(cities);
Console.ReadLine();
}
http://www.devcurry.com/2010/12/convert-string-array-into-string-c-linq.html
Индусы такие индусы
+124
private bool IsDigit(char c)
{
if (digitInIndicatorList.Contains(c))
{
return true;
}
return false;
}
readonly static List<char> digitInIndicatorList = new List<char>() { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
Неустаревающая классика...
+118
if (true)
{
full_result_list = this.FullTextSearch(list_without_uss, this.CountOfDocs);
foreach (SearchResultItem add_item in full_result_list)
{
SearchResultItem find_item = (SearchResultItem)result_list.Find(it => ((it.DocId == add_item.DocId) && (it.ModId == add_item.ModId)));
if (find_item != null)
{
// find_item.Relev += add_item.Relev;
}
else
{
result_list.Add(add_item);
}
}
}
Просто фейерично!
+128
public class BusinessUnitDetail
{
public string Description { get; set; }
}
...
[TestMethod]
public void DescriptionTest()
{
BusinessUnitDetail target = new BusinessUnitDetail();
string expected = "test test test\n test";
string actual;
target.Description = expected;
actual = target.Description;
Assert.AreEqual(expected, actual);
}
беспощадная проверка всего и вся
+116
<Grid Grid.Row="2" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<ContentPresenter Grid.Row="0" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[0]}"/>
<ContentPresenter Grid.Row="0" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[1]}"/>
<ContentPresenter Grid.Row="0" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[2]}"/>
<ContentPresenter Grid.Row="1" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[3]}"/>
<ContentPresenter Grid.Row="1" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[4]}"/>
<ContentPresenter Grid.Row="1" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[5]}"/>
<ContentPresenter Grid.Row="2" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[6]}"/>
<ContentPresenter Grid.Row="2" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[7]}"/>
<ContentPresenter Grid.Row="2" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[8]}"/>
<ContentPresenter Grid.Row="3" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[9]}"/>
<ContentPresenter Grid.Row="3" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[10]}"/>
<ContentPresenter Grid.Row="3" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[11]}"/>
<ContentPresenter Grid.Row="4" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[12]}"/>
<ContentPresenter Grid.Row="4" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[13]}"/>
<ContentPresenter Grid.Row="4" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[14]}"/>
<ContentPresenter Grid.Row="5" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[15]}"/>
<ContentPresenter Grid.Row="5" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[16]}"/>
<ContentPresenter Grid.Row="5" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[17]}"/>
<ContentPresenter Grid.Row="6" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[18]}"/>
<ContentPresenter Grid.Row="6" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[19]}"/>
<ContentPresenter Grid.Row="6" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[20]}"/>
</Grid>
+118
if (mainWareHouseId.HasValue && mainWareHouseId.Value.ToString() == this._locationList.SelectedValue)
{
return false;
}
else
{
return location == null ? true : !location.RegionalFulfillment;
}
+952
namespace AppendStrinAtBegin
{
class Program
{
static void ProcessDirectory(string path, string fileMask, Action<string> action)
{
Directory.EnumerateFiles(path, fileMask).ToList().ForEach(action);
Directory.EnumerateDirectories(path).ToList().ForEach
(
subDirectory => ProcessDirectory(subDirectory, fileMask, action)
);
}
static void Main(string[] args)
{
Console.WriteLine("Path FileMask AppendedString");
if (args.Length < 3)
return;
var appendedString = args.Skip(2).Aggregate((workingSentence, next) => workingSentence+ " " +next);
ProcessDirectory(args[0], args[1], (file) => ProcessFile(file, appendedString));
Console.WriteLine("Gun done");
}
static void ProcessFile(string file, string appendedStringAtBegin)
{
var fileLines = File.ReadAllLines(file, Encoding.GetEncoding(1251));
var fileResulted = fileLines.ToList();
fileResulted.Insert(0, appendedStringAtBegin);
File.WriteAllLines(file, fileResulted, Encoding.GetEncoding(1251));
}
}
}
+122
for (int y = 0; y < bmp.Height; y++)
{
for (int x = 0; x < bmp.Width; x++)
{
Color col = bmp.GetPixel(x, y);
col = Color.FromArgb((col.R + col.G + col.B) / 3,
(col.R + col.G + col.B) / 3,
(col.R + col.G + col.B) / 3);
int rValue = int.Parse(col.R.ToString());
html.Append(getGrayShade(rValue));
if (x == bmp.Width - 1)
html.Append("<br/&rt");
}
}
Нашел проект на codeproject, для конвертации изображения в аscii-art