- 1
- 2
- 3
- 4
function refreshPage() {
//alert(document.location);
document.location = document.location;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 1419
+146
function refreshPage() {
//alert(document.location);
document.location = document.location;
}
Стырена с моего мира mail.ru
+131.8
class Par_host_port
{
private:
std::string vdata;
public:
//...
char* get () { return (char*)vdata.c_str (); }
};
char const* превращается... Превращается char const*... В char*!
−131.5
SELECT [Worker_list].[Id] ,
[Worker_list.Post_adress] ,
[Worker_list.Ident_fiscal] ,
[Worker_list.VacationDay] ,
[Worker_list].[Name_worker] ,
[Worker_list].[Name] ,
[Worker_list].[Firstname] ,
[Worker_list].[Middlenamme] ,
[Worker_list].[Табельний номер] ,
[Worker_list].[workfrom] AS workfromtable,
(SELECT MIN([time_list].[begin_date])
FROM [time_list]
WHERE [time_list].[worker]=[worker_list].[id]
) AS accountfrom,
IIF
(
ISNULL([workfromtable]),[accountfrom],[workfromtable]
) AS workfrom ,
[Worker_list].[startstockdate] AS startstockdatetable,
IIF
(
ISNULL([startstockdatetable]),[accountfrom],[startstockdatetable]
) AS startstockdate ,
[Worker_list].[startaccrualday] AS startaccrualdaytable,
[Worker_list].[startusedday] AS startuseddaytable ,
IIF
(
ISNULL([startaccrualdaytable]),0,[startaccrualdaytable]
) AS Startaccrualday,
IIF
(
ISNULL([startuseddaytable]),0,[startuseddaytable]
) AS startusedday,
(SELECT MIN([calendar_all].[Дата])
FROM calendar_all
) AS Todayis ,
SUM(DATEDIFF("d",[Chas]![Date Begin],DATEADD("d",1,[Chas]![Date end]))) AS UsedDayAfterTable,
IIF
(
ISNULL([useddayaftertable]),0,[useddayaftertable]
) AS UsedDayAfter,
(SELECT SUM (DATEDIFF("d",Chas.[Date Begin], DATEADD("d",1,Chas.[Date End])))
FROM Worker_list AS Worker_list_1
INNER JOIN (Reason_list
INNER JOIN Chas
ON Reason_list.Id = Chas.Reason)
ON Worker_list_1.Id = Chas.Worker
WHERE Reason_list.List =0
AND Worker_list.Id =Worker_List_1.Id
AND chas.[date end] <=
(SELECT MIN([calendar_all].[Дата])
FROM calendar_all
)
) AS timelossafterbeforetable,
(SELECT SUM (DATEDIFF("d",Chas.[Date Begin], DATEADD("d",1,
(SELECT MIN([calendar_all].[Дата])
FROM calendar_all
))))
FROM Worker_list AS Worker_list_1
INNER JOIN (Reason_list
INNER JOIN Chas
ON Reason_list.Id = Chas.Reason)
ON Worker_list_1.Id = Chas.Worker
WHERE Reason_list.List =0
AND Worker_list.Id =Worker_List_1.Id
AND chas.[date begin] <
(SELECT MIN([calendar_all].[Дата])
FROM calendar_all
)
AND chas.[date end] >
(SELECT MIN([calendar_all].[Дата])
FROM calendar_all
)
) AS timelossaftertable,
IIF
(
ISNULL([timelossafterbeforetable]),0,[timelossafterbeforetable]
) AS timelossafterbefore,
IIF
(
ISNULL([timelossaftertable]),0,[timelossaftertable]
) AS timelossafter,
DATEDIFF("d",[startstockdate],[todayis])-[timelossafterbefore]-[timelossafter] AS workoffafter ,
INT([workoffafter] /365*
IIF
(
ISNULL([Worker_list].[VacationDay]),GetVacationDayCount(),[Worker_list].[VacationDay]
)
) AS accrualdayafter,
DATEDIFF("d",[workfrom],[todayis]) AS workoffall ,
[Startaccrualday] -[startusedday]+[accrualdayafter] AS accrualdayall ,
[accrualdayafter] +[startaccrualday] AS accrualday ,
[startusedday] +[useddayafter]-StateHoliDay AS usedday ,
[accrualday] -[usedday] AS unusedday ,
DATEADD("d",INT([usedday]/
IIF
(
ISNULL([Worker_list].[VacationDay]),GetVacationDayCount(),[Worker_list].[VacationDay]
)
*365)+[timelossafterbefore]+[timelossafter],[workfrom]) AS Usedto,
Запрос количества оставшихся отпусков в кадровой программе
+147
// (C) Cody Mays <[email protected]> All Rights Reserved. BSD License
require_once('Auth/OpenID/DatabaseConnection.php');
require_once("Auth/OpenID/FileStore.php");
class OpenIDSystem
{
private $consumer;
private $response;
private $callbacks;
public function __construct()
{
$this->consumer = false;
$this->response = false;
$this->callbacks = false;
}
один из кандидатов на роль либы для работы с openID
+152
function allowCheckout(enable) {
if (enable)
$("#btnMakeOrder").removeAttr("enabled");
else
$("#btnMakeOrder").removeAttr("disabled");
}
Код, который написал бельгийский Software Architect, пришедший из мира C++ говонокодинга.
Дальше будет...
+149
<xsl:template match="/ | @* | node()">
<xsl:if test="local-name()='item'">
<itemname>
<xsl:value-of select="node()"/>
</itemname>
</xsl:if>
<xsl:if test="local-name()!='item'">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:if>
</xsl:template>
+149
<xsl:template match="/ | @* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
+148
<xsl:template name="a">
<xsl:for-each select="//item">
<megaitem>
<xsl:value-of select="node()"/>
</megaitem>
</xsl:for-each>
</xsl:template>
+144
<?php
/**
* @author Mr. Roman Dunhill
* @copyright 2009
*/
$map_height = 301;
$map_weight = 518;
$map = imagecreate($map_weight, $map_height);
$grassimg = imagecreatefrompng("images/grass.png");
$grass_height = imagesy($grassimg);
$grass_width = imagesx($grassimg);
$start_point1 = ($map_height / 2) - ($grass_height / 2);
$transparent = imagecolorat($grassimg, 1, 1);
imagecolortransparent($grassimg, $transparent);
for($i = 0; $i < 7; $i++)
{
imagecopy($map, $grassimg, ($grass_width * $i), $start_point1, 0, 0, $grass_width, $grass_height);
}
$start_point2 = ($map_height / 2) - $grass_height;
for($i = 0; $i < 6; $i++)
{
imagecopy($map, $grassimg, (($grass_width * $i) + ($grass_width / 2)), $start_point2, 0, 0, $grass_width, $grass_height);
}
header('Content-Type: image/png');
imagepng($map);
?>
−859
49512
select * from dual