-
Лучший говнокод
- В номинации:
-
- За время:
-
-
−1
- 1
- 2
- 3
- 4
- 5
- 6
- 7
private bool IsDriverSuccessfullyInstalled(DriverInfo di, string historyDriverVersion, string historyPackageVersion)
{
bool flag = false;
if (!string.IsNullOrWhiteSpace(di.VersionAfterInstallation) && !string.IsNullOrWhiteSpace(di.VersionAfterInstallation) && new Version(di.VersionAfterInstallation).CompareTo(new Version(di.VersionBeforeInstallation)) >= 0)
flag = true;
return flag;
}
При попытке поставить драйвер интеловской видюхи инсталлер вывалился с ArgumentNullException. Декомпильнул его и увидел вот это.
Копипаста головного мозга.
yamamoto,
13 Февраля 2016
-
−2
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Collections.ObjectModel;
using System.Linq;
namespace DemoFeb2014.DataContexts
{
using System;
using System.Collections.Generic;
public partial class Author
{
....
public ICollection<Tuple<MusicalWork, string>> Author2MusicalWorkParsed
{
get
{
...
}
}
}
}
Спасибо коллегам! Благодаря только им можно потратить полчаса времени на розыск коммита в котором пропал метод Author2MusicalWorkParsed и выяснения причин того, почему же он пропал...
Видимо комментарии в начале файла недостаточно "жирные".
leon_mz,
12 Февраля 2016
-
+2
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
<td>Текущий статус</td>
<td><select name="nStatus" size="1" disabled>
<option value="0" <?if ($row[nStatus] == '0') { echo 'SELECTED'; }?>>Cоздан</option>
<option value="1" <?if ($row[nStatus] == '1') { echo 'SELECTED'; }?>>Продан</option>
<option value="2" <?if ($row[nStatus] == '2') { echo 'SELECTED'; }?>>Тестируется</option>
<option value="3" <?if ($row[nStatus] == '3') { echo 'SELECTED'; }?>>Бесплатная работа</option>
<option value="4" <?if ($row[nStatus] == '4') { echo 'SELECTED'; }?>>Эксплуатация</option>
<option value="5" <?if ($row[nStatus] == '5') { echo 'SELECTED'; }?>>Заблокирован</option>
<option value="7" <?if ($row[nStatus] == '7') { echo 'SELECTED'; }?>>Приостановлен</option>
<option value="6" <?if ($row[nStatus] == '6') { echo 'SELECTED'; }?>>Отключен</option>
</select></td>
grieverrr,
11 Февраля 2016
-
−1
- 1
http://i.imgur.com/xzte9cX.png
Я.. я не могу просто взять и скопировать этот код сюда. Посмотрите сами...
mikamika83,
06 Февраля 2016
-
+4
- 1
- 2
- 3
- 4
- 5
check_p = (p)->
if p && p.p
"?p=#{p.p}"
else
''
Не знаю, зачем это нужно и что оно делает
Sandwich,
04 Февраля 2016
-
+2
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
public static string _GetValueFromConfigFile(string sKey)
{
string sReturnValue = _scNullString;
string filePath = System.IO.Directory.GetCurrentDirectory() + @"\App.config";
// FOR TDOCS
//string filePath = @"D:\hosting\4856094\html\Bin\App.config";
XmlDocument doc = new XmlDocument();
XmlNode rootNode;
XmlNode xmlNode;
try
{
doc.Load(filePath);
rootNode = doc.DocumentElement;
xmlNode = rootNode.SelectSingleNode("descendant::add[@key='" + sKey + "']");
if (xmlNode != null) sReturnValue = xmlNode.Attributes["value"].Value;
return sReturnValue;
//return "";
}
catch// (Exception Ex)
{
//_ErrorDetail = Ex.Message;
return _scNullString;
}
}
Very helpful method to get data from app.config :)
Жаль что для web не работает :(
Note:
public const string _scNullString = "";
iec,
02 Декабря 2015
-
+7
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
<?php
$a=$_POST['a'];
$b=$_POST['b'];
$c=$_POST['c'];
if $_POST['a']*x*2+$_POST['b']*x+$_POST['c']
{
else $y=$_POST['b']*2-4*$_POST['a']*$_POST['c'];
nl2br('</n>')
echo $y;
$k1=$_POST['b']+$y/2*$_POST['a'];
nl2br('</n>')
echo $k1;
$k2=$_POST['b']-$y/2*$_POST['a'];
nl2br('</n>')
echo $k2;
}
echo $k1;
echo $k2;
?>
http://www.cyberforum.ru/php/thread1589333.html
wiox,
22 Ноября 2015
-
+2
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
public static byte[] HMACSHA256(ProtectedData key, byte[] data)
{
using (var _key = key.Get())
using (var hmac = new HMACSHA256(_key))
return hmac.ComputeHash(data);
}
public static byte[] HMACSHA256(ProtectedData key, Stream stream)
{
using (var _key = key.Get())
using (var hmac = new HMACSHA256(_key))
return hmac.ComputeHash(stream);
}
public static byte[] HMACSHA256(byte[] key, byte[] data)
{
using (var hmac = new HMACSHA256(key))
return hmac.ComputeHash(data);
}
public static byte[] HMACSHA256(byte[] key, Stream stream)
{
using (var hmac = new HMACSHA256(key))
return hmac.ComputeHash(stream);
}
public static byte[] MD5(byte[] data)
{
using (var h = System.Security.Cryptography.MD5.Create())
{ return h.ComputeHash(data); }
}
public static byte[] MD5(Stream stream)
{
using (var h = System.Security.Cryptography.MD5.Create())
{ return h.ComputeHash(stream); }
}
public static byte[] SHA1(byte[] data)
{
using (var h = System.Security.Cryptography.SHA1.Create())
return h.ComputeHash(data);
}
public static byte[] SHA1(Stream stream)
{
using (var h = System.Security.Cryptography.SHA1.Create())
return h.ComputeHash(stream);
}
public static byte[] SHA256(byte[] data)
{
using (var h = System.Security.Cryptography.SHA256.Create())
return h.ComputeHash(data);
}
public static byte[] SHA256(Stream stream)
{
using (var h = System.Security.Cryptography.SHA256.Create())
return h.ComputeHash(stream);
}
public static byte[] SHA384(byte[] data)
{
using (var h = System.Security.Cryptography.SHA384.Create())
return h.ComputeHash(data);
}
public static byte[] SHA384(Stream stream)
{
using (var h = System.Security.Cryptography.SHA384.Create())
return h.ComputeHash(stream);
}
public static byte[] SHA512(byte[] data)
{
using (var h = System.Security.Cryptography.SHA512.Create())
return h.ComputeHash(data);
}
public static byte[] SHA512(Stream stream)
{
using (var h = System.Security.Cryptography.SHA512.Create())
return h.ComputeHash(stream);
}
Психанул
yourmom,
20 Ноября 2015
-
+3
- 1
- 2
$xml = simplexml_load_string($Result);
$xml_array = unserialize(serialize(json_decode(json_encode((array) $xml), 1)));
Ребята, объясните, что это?!
bot,
18 Ноября 2015
-
+3
- 1
- 2
- 3
- 4
$namespaces = array('top' => 1, 'left' => 2, 'right' => 3, 'bottom' => 4);
if (!is_int($namespace))
$namespace = $namespaces[$namespace];
Код должен по логике определять положение меню....
StTv,
28 Октября 2015