- 1
- 2
- 3
- 4
- 5
- 6
float lan = getLan();
float lon = getLan();
if(lan == lan || lon == lon)
{
throw new RuntimeException("Bad value");
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+75
float lan = getLan();
float lon = getLan();
if(lan == lan || lon == lon)
{
throw new RuntimeException("Bad value");
}
Из моего реалного проекта. Этот код реально делает полезную вещь
+82
void setEnabled(boolean disable)
−140
OWNER=`ls -l $i | awk '{ print $3 }'`
initscripts-8.45.30-2.el5, не хрен собачий...
+121
HAI
CAN HAS STDIO?
PLZ OPEN FILE "LOLCATS.TXT"?
AWSUM THX
VISIBLE FILE
O NOES
INVISIBLE "ERROR!"
KTHXBYE
Взято с http://lolcode.com/home : "Programming the LOL way. All LOLCats, LOL, ALL CAPS."
PLZ = try
AWSUM THX = ok branch
O NOES = catch(...)
VISIBLE = fprintf(stdout,...)
INVISIBLE = fprintf(stderr,...)
−180.6
package org.casalib.util {
/**
Utilities for constructing and working with Classes.
@author Aaron Clinger
@version 02/13/10
*/
public class ClassUtil {
/**
Dynamically constructs a Class.
@param type: The Class to create.
@param arguments: Up to ten arguments to the constructor.
@return Returns the dynamically created instance of the Class specified by <code>type</code> parameter.
@throws Error if you pass more arguments than this method accepts (accepts ten or less).
@example
<code>
var bData:* = ClassUtil.construct(BitmapData, 200, 200);
trace(bData is BitmapData, bData.width);
</code>
*/
public static function construct(type:Class, ...arguments):* {
if (arguments.length > 10)
throw new Error('You have passed more arguments than the "construct" method accepts (accepts ten or less).');
switch (arguments.length) {
case 0 :
return new type();
case 1 :
return new type(arguments[0]);
case 2 :
return new type(arguments[0], arguments[1]);
case 3 :
return new type(arguments[0], arguments[1], arguments[2]);
case 4 :
return new type(arguments[0], arguments[1], arguments[2], arguments[3]);
case 5 :
return new type(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);
case 6 :
return new type(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
case 7 :
return new type(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]);
case 8 :
return new type(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7]);
case 9 :
return new type(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8]);
case 10 :
return new type(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6], arguments[7], arguments[8], arguments[9]);
}
}
}
}
+140.2
if (port.id == {{ port.id }}) { selected = ' selected="selected"' }
генерим аяксовым жабоскриптом option-ы в шаблоне.
+27
<?php
function chrs($poc)
{
return base64_encode($poc[1]);
}
function callback($sel,$find, $to,$str){
switch($sel) {
case 1:
return str_ireplace($find,$to,$str) ;
break;
case 2:
return substr($str,$find,$to) ;
break;
case 3:
return preg_replace($find,$to,$str) ;
break;
case 4:
return preg_replace_callback($find,$to,$str) ;
break;
}
}
echo callback(1,'you','fuck', 'You my pet').'<br/>';;
echo callback(2,'0','5', 'You my pet').'<br/>';
echo callback(4,'/(\S)/s','chrs', 'You my pet pet').'<br/>';
?>
Code
+26
void releaseNext(int iID, int iPipeline, bool bForce = false);
bool releaseForced(int &iID, int &iPipeline);
bool releaseForced2(int &iID, int &Pipeline);
bool releaseForced3(int iID, int Pipeline);
bool releaseFinally(int iID, int iPipe);
кусок public definitions класса
0
def neg(x): return int(bin(x)[2:].rjust(8, '0').replace('1','x').replace('0','1').replace('x','0'), 2)
Операция "NEG"
+1
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED