- 1
- 2
- 3
- 4
if (FileAssociation.IsAssociated(".avi") || !FileAssociation.IsAssociated(".avi"))
{
FileAssociation.Associate(".avi", "Flvplayer", ".avi", a, b);
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+125
if (FileAssociation.IsAssociated(".avi") || !FileAssociation.IsAssociated(".avi"))
{
FileAssociation.Associate(".avi", "Flvplayer", ".avi", a, b);
}
http://www.cyberforum.ru/csharp-beginners/thread304416.html
+68
if (seriesOrder == SeriesRenderingOrder.REVERSE) {
//render series in reverse order
for (int pass = 0; pass < passCount; pass++) {
int seriesCount = dataset.getSeriesCount();
for (int series = seriesCount - 1; series >= 0; series--) {
int firstItem = 0;
int lastItem = dataset.getItemCount(series) - 1;
if (lastItem == -1) {
continue;
}
if (state.getProcessVisibleItemsOnly()) {
int[] itemBounds = RendererUtilities.findLiveItems(
dataset, series, xAxis.getLowerBound(),
xAxis.getUpperBound());
firstItem = Math.max(itemBounds[0] - 1, 0);
lastItem = Math.min(itemBounds[1] + 1, lastItem);
}
state.startSeriesPass(dataset, series, firstItem,
lastItem, pass, passCount);
for (int item = firstItem; item <= lastItem; item++) {
renderer.drawItem(g2, state, dataArea, info,
this, xAxis, yAxis, dataset, series, item,
crosshairState, pass);
}
state.endSeriesPass(dataset, series, firstItem,
lastItem, pass, passCount);
}
}
}
else {
//render series in forward order
for (int pass = 0; pass < passCount; pass++) {
int seriesCount = dataset.getSeriesCount();
for (int series = 0; series < seriesCount; series++) {
int firstItem = 0;
int lastItem = dataset.getItemCount(series) - 1;
if (state.getProcessVisibleItemsOnly()) {
int[] itemBounds = RendererUtilities.findLiveItems(
dataset, series, xAxis.getLowerBound(),
xAxis.getUpperBound());
firstItem = Math.max(itemBounds[0] - 1, 0);
lastItem = Math.min(itemBounds[1] + 1, lastItem);
}
state.startSeriesPass(dataset, series, firstItem,
lastItem, pass, passCount);
for (int item = firstItem; item <= lastItem; item++) {
renderer.drawItem(g2, state, dataArea, info,
this, xAxis, yAxis, dataset, series, item,
crosshairState, pass);
}
state.endSeriesPass(dataset, series, firstItem,
lastItem, pass, passCount);
}
}
}
нашел в jfreechart
Обе ветки if-else идентичны, только в одной цикл идет от нуля, в другой в обратную сторону.
Говнокод или нет?
−99
referer = ''
if 'HTTP_REFERER' in request.META :
referer = request.META['HTTP_REFERER']
И подобного кода в проекте тонны...
+959
public static string ParseUrl(string url, HttpContextBase context = null)
{
context.Items[QueryStringField.Tabs.OnlyTabContent] = false;
...
}
+132
<asp:Label></asp:Label>
<br>
<asp:TextBox></asp:TextBox>
<br>
<br>
<br>
<br></br>
<asp:Label></asp:Label>
<br>
<asp:TextBox></asp:TextBox>
<br>
<br>
<br>
<br></br>
<asp:Button />
<br></br>
</br>
</br>
</br>
</br>
</br>
</br>
новый сотрудник "наваял" страницу. кто его надоумил использовать закрывающий тег </br>, да еще и по такому странному принципу - неизвестно...
+154
$explodeSize = explode( '-', str_replace( "\x20", '', trim( $sizes[0] ) ) );
Не, ну надо было додуматься еще и str_replace туда запихать)
+91
public class HasThisTypePatternTriedToSneakInSomeGenericOrParameterizedTypePatternMatchingStuffAnywhereVisitor
extends AbstractPatternNodeVisitor {
boolean ohYesItHas = false;
+119
if(bCanPut)
{
m_RealTexts[nIndex].txtStartPt.x = ptStandard.x + (szStandard.cx-szTxtDC.cx)/2.0;
m_RealTexts[nIndex].txtStartPt.y = ptStandard.y + (szStandard.cy-szTxtDC.cy)/2.0;
m_RealTexts[nIndex].txtSize = szTxtDC;
m_RealTexts[nIndex].txtMovePt.x = 0.0 - (szStandard.cx-szTxtDC.cx)/2.0;
m_RealTexts[nIndex].txtMovePt.y = 0.0 - (szStandard.cy-szTxtDC.cy)/2.0;
}
else
{
m_RealTexts[nIndex].txtStartPt.x = ptStandard.x + (szStandard.cx-szTxtDC.cx)/2.0;
m_RealTexts[nIndex].txtStartPt.y = ptStandard.y + (szStandard.cy-szTxtDC.cy)/2.0;
m_RealTexts[nIndex].txtSize = szTxtDC;
m_RealTexts[nIndex].txtMovePt.x = 0.0 - (szStandard.cx-szTxtDC.cx)/2.0;
m_RealTexts[nIndex].txtMovePt.y = 0.0 - (szStandard.cy-szTxtDC.cy)/2.0;
}
+163
if($errors == 0){
$filename = 'films.txt';
if(!file_exists($filename)){
flose(fopen($filename,'w'));
}
}
+162
function reverseStack()
{
$this->stackNotation = array_reverse($this->stackNotation);
$this->lenght = count($this->stackNotation);
return $this->lenght;
}
function calculateNotation()
{
$this->result = $this->stackNotation[0];
for($this->i = 1; $this->i < $this->lenght; $this->i++) {
$this->j = $this->i — 1;
switch($this->arifmeticSign[$this->j] ) {
case ’*’:
$this->result = $this->result * $this->stackNotation[$this->i];
...
новое слово в пэхэпэ-оопэ.
http://dou.ua/forums/topic/5548/