- 1
<a title="Главная" href="http://<?php echo $_SERVER['HTTP_HOST'].str_replace('\\', '', dirname($_SERVER['PHP_SELF'])); ?>">Главная</a>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+167
<a title="Главная" href="http://<?php echo $_SERVER['HTTP_HOST'].str_replace('\\', '', dirname($_SERVER['PHP_SELF'])); ?>">Главная</a>
нашел в одном проекте, я бы и не смог до такого додуматься
+158
{|if $message=="ok"|}
<div style="text-align: center; padding:10px; margin:10px; color: white; font-weight: bold; background-color: green;">Your message has successfully been added.</div>
{|/if|}
{|if $message=="error"|}
<div style="text-align: center; padding:10px; margin:10px; color: white; font-weight: bold; background-color: red;">Mistake. You filled out the wrong form.</div>
{|/if|}
Красивое использование CSS.
+147
GOVNOREGER© для govnokod.ru
http://slil.ru/31180342
+165
return $result_rows;
mysql_close($external_db);
+134
-module(common_io).
-export([read_utf8/2, default_fallback/1]).
default_fallback(<<Data>>)->
erlang:display(Data).
read_utf8(Collected, <<Utf8Char/utf8>>, _CallAfter)->
lists:append(Collected, [Utf8Char]);
read_utf8(Collected, <<Utf8Char/utf8, Data/binary>>, CallAfter)->
lists:append([Collected, [Utf8Char], read_utf8(Data, CallAfter)]);
read_utf8(Collected, <<Data/binary>>, CallAfter)->
CallAfter(Data),
Collected;
read_utf8(Collected, <<>>, _CallAfter)->
Collected.
read_utf8(<<>>, _CallAfter)->
[];
read_utf8(<<Utf8Char/utf8>>, _CallAfter)->
[Utf8Char];
read_utf8(<<Data/binary>>, CallAfter)->
read_utf8([], Data, CallAfter).
Первый раз в жизни пишу что-то на Эрланге. Чует сердце, что что-то тут не так...
+83
Float.parseFloat(obj.getPrice() + ""));
// int obj.getPrice()
int to float
+82
//request reading
String allData = "";
try {
int data = input.read();
while (true) {
allData += (char) data;
if (input.available() < 1) {
break;
}
data = input.read();
}
} catch (IOException ex) {
Logger.getLogger(HttpProtocolProcessor.class.getName()).log(Level.SEVERE,
"Problems occured while reading the stream.", ex);
}
Прямо свежего наклада. Вот таким вот нетривиальным способом член команды читает из InputStream'a всё в одну строку. Он не только читает по байтно, но еще и для каждого байта создаёт новую строку. О мой боже. Т_Т.
+164
//----------------------------------------------------------------------------
void TChimesMinigame::InventoryEndDrag(str aId)
{
TSceneObject * drag_object = getScene(1)->FindObject(aId);
if (!drag_object)
{
iInventory->CheckEndDrag(NULL);
return;
}
iInventory->CheckEndDrag(NULL);
}
//----------------------------------------------------------------------------
+116
IList<Hashtable> records = crit.List<Hashtable>();
Guid[] personsId = records.Select(item => (Guid)item["PersonID"]).Distinct().ToArray();
List<EmployeeData> empDatas = new List<EmployeeData>();
foreach(Guid personId in personsId) {
IEnumerable<Hashtable> employeeRecords = records.Where(item => (Guid)item["PersonID"] == personId);
Hashtable employeeRecord = employeeRecords.FirstOrDefault(item => !(bool)item["IsLoad"] || (DateTime)item["EventDate"] == employeeRecords.Max(unit => (DateTime)unit["EventDate"]));
Hashtable employeeRecordAddition = new GenericNHibernateDao<BaseDocument>().CreateCriteria()
.CreateAlias("Department", "department")
.CreateAlias("Employee", "employee")
.CreateAlias("WorkDescription.Schedule", "schedule", JoinType.LeftOuterJoin)
.CreateAlias("WorkDescription.EmployeeApperance", "employeeApperance", JoinType.LeftOuterJoin)
.Add(Restrictions.Eq("EmployeeStamp.TabNo", employeeRecord["TabNo"]))
.Add(Restrictions.Eq("IsHalf", false))
...
}
No comments %)
+167
/* DO NOT UNCOMMENT THIS CODE AGAIN. THIS IS THE 3rd TIME I'VE HAD TO REMOVE THIS.
if($("form#purchase_form").length) {
var currentPaymentValue = $("input[name='paymentFormOverride']:checked", "#purchase_form").val();
if (currentPaymentValue == 'cc')
$("#pp_payment_method").click(function(){paymentRedirect('pp')});
else
$("#cc_payment_method").click(function(){paymentRedirect('cc')});
}
*/
Чоткая обратная связь :))