- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
#include <iostream>
using namespace std;
void main()
{
char U='#';
int K;
_asm
{
mov eax, 0
mov al, U
mov K,eax
}
cout<<K<<endl;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+168
#include <iostream>
using namespace std;
void main()
{
char U='#';
int K;
_asm
{
mov eax, 0
mov al, U
mov K,eax
}
cout<<K<<endl;
}
"Получение десятичного представления числа". C wasm.ru
+167
PopupWindow* GameLocations::getCurrentPopup()
{
if(m_curPopup != nullptr && m_curPopup->needsClose())
{
m_curPopup->onClose();
m_curPopup = nullptr;
m_walker->BeginWalk(m_graph->getClosestNode(m_currentLocationId));
}
return m_curPopup;
}
+114
if (defaultOrderType == OrderType.NoCharge || defaultOrderType == OrderType.Claims)
{
noChargeItemEntry.Style.Add(HtmlTextWriterStyle.Display, "block");
itemEntryPanel.Style.Add(HtmlTextWriterStyle.Display, "none");
items.Style.Add(HtmlTextWriterStyle.Display, "none");
}
else
{
noChargeItemEntry.Style.Add(HtmlTextWriterStyle.Display, "none");
itemEntryPanel.Style.Add(HtmlTextWriterStyle.Display, "block");
items.Style.Add(HtmlTextWriterStyle.Display, "block");
}
+116
// Method that returns anonymous type as object
object ReturnAnonymous() {
return new { City="Prague", Name="Tomas" };
}
void Main() {
// Get instance of anonymous type with 'City' and 'Name' properties
object o = ReturnAnonymous();
// This call to 'Cast' method converts first parameter (object) to the
// same type as the type of second parameter - which is in this case
// anonymous type with 'City' and 'Name' properties
var typed = Cast(o, new { City="", Name="" });
Console.WriteLine("{0}, {1}", typed.City, typed.Name)
}
// Cast method - thanks to type inference when calling methods it
// is possible to cast object to type without knowing the type name
T Cast<T>(object obj, T type) {
return (T)obj;
}
via http://social.msdn.microsoft.com/forums/en-US/linqprojectgeneral/thread/c1c179bb-ea88-4633-970a-947f0dd1e71f/
+119
http://rabota.1777.ru/one_rezume.php?job_rezume_id=33838&job_cat_id2=1&doljnost2=&pol2=&vozrast_ot2=21&vozrast_do2=21&obrazovanie2=&opit2=&plata2=&pajina=&new=&doljnost3=
Супер человек, всего 21 год, умеет все и деньги ему не нужны.
+165
/*
* Корректировка даты.
* если дата в будущем - то показываем сегодня.
*/
$row['created'] = ( strtotime( date("Y-m-d", strtotime($row['created'])) ) > strtotime( date("Y-m-d") ) )?
date("r")
: date("r", strtotime($row['created']));
4x4 off-road racing...
+161
<?
function save($author,$title,$pubyear,$price) {
$sql = "INSERT INTO catalog(author,title,pubyear,price)
VALUES('$author','$title',$pubyear,$price)";
mysql_query($sql) or die (mysql_error());
}
function selectAll() {
$sql = "SELECT * FROM catalog";
$result = mysql_query($sql) or die(mysql_error());
return $result;
}
+82
int cont = 1;
String d01 = turnsSubscribedByUsers.contains(cont++) ? "S" : "N";
String d02 = turnsSubscribedByUsers.contains(cont++) ? "S" : "N";
....
String d36 = turnsSubscribedByUsers.contains(cont++) ? "S" : "N";
...
os.write(d01.getBytes("UTF-8"));
os.write(d02.getBytes("UTF-8"));
...
os.write(d36.getBytes("UTF-8"));
Генерация какого-то файла :)
+161
function explode( delimiter, string ) { // Split a string by string
//
// + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + improved by: kenneth
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
var emptyArray = { 0: '' };
if ( arguments.length != 2
|| typeof arguments[0] == 'undefined'
|| typeof arguments[1] == 'undefined' )
{
return null;
}
if ( delimiter === ''
|| delimiter === false
|| delimiter === null )
{
return false;
}
if ( typeof delimiter == 'function'
|| typeof delimiter == 'object'
|| typeof string == 'function'
|| typeof string == 'object' )
{
return emptyArray;
}
if ( delimiter === true ) {
delimiter = '1';
}
return string.toString().split ( delimiter.toString() );
}
Из сборника JS-реализаций PHP функций : http://javascript.ru/php/explode
Сюда можно половину этого сборника постить.
+240
lea 0x0(%esi),%esi
sub $0x1,%eax
cmp $0xffffffff,%eax
je 0x8048e07
mov (%ecx,%eax,4),%esi
test %esi,%esi
je 0x8048df8
Чудеса оптимизации -О3 на gcc 4.4
(код в интелловской аннотации, сначала источник, потом назначение)