- 1
- 2
var hgh = $(document).height() - 320 - 180 - 440;
$(".message-form").height( hgh );
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+160
var hgh = $(document).height() - 320 - 180 - 440;
$(".message-form").height( hgh );
шта?
+157
<?if ($_SERVER['REQUEST_URI'] == "/zakazat-semena"):?>
<?
$cont = str_replace("asd", "asdqwe", $content);
echo $cont;
?>
<?elseif($_SERVER['REQUEST_URI'] == "/map"): ?>
<?
$cont = str_replace('qwe', 'qweiop', $content);
echo $cont;
?>
<?else:?>
{content}
<?endif;?>
+72
public class Командир {
private String имя;
private ПоходНаГерманию поход;
public Командир(String имя) {
this.имя = имя;
поход = new ПоходНаГерманию();
}
public Богатство пойтиВпоход()
throws НеПолучилосьException {
return поход.сходить();
}
}
больше русской жабы тут http://www.spring-source.ru/docs_simple.php?type=manual&theme=docs_s imple&docs_simple=chap01_p03
+51
class CHECKSTRUCTURE_API GroupOfDocs : public std::unordered_multimap<std::string, std::shared_ptr<Doc> > // структура, которую клиент заполняет и передает в качестве входных и выходных данных для process. Ключом является имя файла
{
public:
#ifdef _DEBUG
virtual ~GroupOfDocs() {};
#endif
+97
using System;
using Microsoft.Win32;
namespace Reester
{
class Program
{
static void Main(string[] args)
{
RegCreatySubKey();
}
private static void RegCreatySubKey()
{
RegistryKey regKey = Registry.LocalMachine;
string[] shell = new[] { "SOFTWARE", "Microsoft", "Windows", "CurrentVersion", "Explorer", "CommandStore", "shell" };
string prog = "Programma";
1) using (regKey = Registry.LocalMachine.OpenSubKey(shell[0],true))// тут regKey равно{HKEY_LOCAL_MACHINE}
2) { //сдеть уже regKey равно {HKEY_LOCAL_MACHINE\SOFTWARE}
3) if (regKey != null)//и тут уже regkey равно Null.А дальше программа не идет.
{
using (regKey = Registry.LocalMachine.OpenSubKey(shell[1], true))
{
if (regKey != null)
{
using (regKey = Registry.LocalMachine.OpenSubKey(shell[2], true))
{
if (regKey != null)
{
using (regKey = Registry.LocalMachine.OpenSubKey(shell[3], true))
{
if (regKey != null)
{
using (regKey = Registry.LocalMachine.OpenSubKey(shell[4], true))
{
if (regKey != null)
{
using (regKey = Registry.LocalMachine.OpenSubKey(shell[5], true))
{
if (regKey != null)
{
using (regKey = Registry.LocalMachine.OpenSubKey(shell[6], true))
{
if (regKey != null)
{
regKey.CreateSubKey(prog);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
Работаем с реестром
+156
router.get('/', function(req, res){
apis.getApis(function (data, error) {
res.render('./documentation/index',
{
error: error,
apis: data
});
});
}
);
Сказали напилить на ноде сайтик, который генерит документацию из ответа сервера с API. Сижу и бомблю с количества лишних действий в контроллере из-за обязательных ФУНКЦИЙ ОБРАТНОГО ВЫЗОВА.
+164
$id = int(int(int(int(int(int(int(int(int(int(int(int(int(int(int($_POST["id"])))))))))))))));
Зачем??
+53
//
// 'compare_keywords()' - Compare two keywords...
//
extern "C" {
int
compare_keywords(const void *a,
const void *b) {
return (strcmp(*((const char **)a), *((const char **)b)));
}
}
+134
string pars_param(string data)
{
HtmlAgilityPack.HtmlDocument html = new HtmlAgilityPack.HtmlDocument();
html.LoadHtml(data);
HtmlNodeCollection qw = html.DocumentNode.SelectNodes(@"//input[@name=""k""]");
if (qw != null)
{
foreach (HtmlNode n in qw)
{
if (n.Attributes["value"] != null)
{
return n.Attributes["value"].Value;
}
}
}
}
Error 1 'trcli.Form1.pars_param(string)': not all code paths return a value D:\zMyDoc\igl\Documents\Visual Studio 2013\Projects\trcli\trcli\Form1.cs 651 16 trcli
не магу разобраться в своем говнокоде, не хочет возвращать n.Attributes["value"].Value
+160
// проверяем на дубли
$email_exists = $db->select('SELECT * FROM customers_info AS i LEFT JOIN customers AS c ON i.login = c.login WHERE deleted = "n" AND i.email LIKE ?', "%$email%")
|| $db->select('SELECT * FROM customers_info_inpr AS i LEFT JOIN customers AS c ON i.login = c.login WHERE deleted = "n" AND i.inpr_email LIKE ?', "%$email%")
|| $db->select('SELECT * FROM customers_info_org AS i LEFT JOIN customers AS c ON i.login = c.login WHERE deleted = "n" AND i.org_phone LIKE ?', "%$email%")
|| $db->select('SELECT * FROM customers_info_org AS i LEFT JOIN customers AS c ON i.login = c.login WHERE deleted = "n" AND i.contact_phone LIKE ?', "%$email%");
Всего лишь проверка на дубли =)