- 1
- 2
- 3
- 4
- 5
case "exit":
unset($_SESSION["SITE_ADMIN"]);
header("location: {$_SERVER["PHP_SELF"]}");
die;
break;
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 161
+145
case "exit":
unset($_SESSION["SITE_ADMIN"]);
header("location: {$_SERVER["PHP_SELF"]}");
die;
break;
выход "по-мишустински"
не знаю как вам, а я словил лулзы
цопырайты уходят komprenda, он же "Istem"
+144
public static const INFINITY:int = 100000;
а вы говорите, что скорость света недостижима... Вон, мы даже уже бесконечность обозначили!
−103
package _3d
{
public class Vector extends Object
{
private var xx:Number;
public var z:Number;
private var L:Number;
private var zz:Number;
private var yy:Number;
private var c:Number;
public var x:Number;
public var y:Number;
private var s:Number;
public function Vector(param1:Number = 0, param2:Number = 0, param3:Number = 0)
{
x = param1;
y = param2;
z = param3;
return;
}// end function
public function mul(param1:Number) : void
{
x = x * param1;
y = y * param1;
z = z * param1;
return;
}// end function
public function normalize() : void
{
var _loc_1:* = length;
L = length;
if (_loc_1 > 0)
{
x = x / L;
y = y / L;
z = z / L;
}
return;
}// end function
public function revolutiony(param1:Number) : void
{
c = Math.cos(param1);
s = Math.sin(param1);
zz = z;
xx = x;
z = zz * c - xx * s;
x = zz * s + xx * c;
return;
}// end function
public function revolutionz(param1:Number) : void
{
c = Math.cos(param1);
s = Math.sin(param1);
xx = x;
yy = y;
x = xx * c - yy * s;
y = xx * s + yy * c;
return;
}// end function
public function toString() : String
{
return "(" + x + "," + y + "," + z + ")";
}// end function
public function clone() : Vector
{
return new Vector(x, y, z);
}// end function
public function revolutionx(param1:Number) : void
{
c = Math.cos(param1);
s = Math.sin(param1);
yy = y;
zz = z;
y = yy * c - zz * s;
z = yy * s + zz * c;
return;
}// end function
public function add(param1:Vector) : void
{
x = x + param1.x;
y = y + param1.y;
z = z + param1.z;
return;
}// end function
public function crossProduct(param1:Vector) : Vector
{
return new Vector(y * param1.z - z * param1.y, z * param1.x - x * param1.z, x * param1.y - y * param1.x);
}// end function
+145
package _3d
{
public class Matrix3d extends Object
{
public var _12:Number;
public var _11:Number;
public var _13:Number;
public var _14:Number;
public var _32:Number;
public var _41:Number;
public var _42:Number;
public var _21:Number;
public var _22:Number;
public var _23:Number;
public var _24:Number;
public var _43:Number;
public var _44:Number;
public var _34:Number;
public var _31:Number;
public var _33:Number;
public function Matrix3d(param1:Number = 1, param2:Number = 0, param3:Number = 0, param4:Number = 0, param5:Number = 0, param6:Number = 1, param7:Number = 0, param8:Number = 0, param9:Number = 0, param10:Number = 0, param11:Number = 1, param12:Number = 0, param13:Number = 0, param14:Number = 0, param15:Number = 0, param16:Number = 1)
{
_11 = param1;
_12 = param2;
_13 = param3;
_14 = param4;
_21 = param5;
_22 = param6;
_23 = param7;
_24 = param8;
_31 = param9;
_32 = param10;
_33 = param11;
_34 = param12;
_41 = param13;
_42 = param14;
_43 = param15;
_44 = param16;
return;
}// end function
public function toString() : String
{
return _11 + "," + _12 + "," + _13 + "," + _14 + "," + _21 + "," + _22 + "," + _23 + "," + _24 + "," + _31 + "," + _32 + "," + _33 + "," + _34 + "," + _41 + "," + _42 + "," + _43 + "," + _44;
}// end function
public static function product(param1:Matrix3d, param2:Matrix3d) : Matrix3d
{
return new Matrix3d(param1._11 * param2._11 + param1._12 * param2._21 + param1._13 * param2._31 + param1._14 * param2._41, param1._11 * param2._12 + param1._12 * param2._22 + param1._13 * param2._32 + param1._14 * param2._42, param1._11 * param2._13 + param1._12 * param2._23 + param1._13 * param2._33 + param1._14 * param2._43, param1._11 * param2._14 + param1._12 * param2._24 + param1._13 * param2._34 + param1._14 * param2._44, param1._21 * param2._11 + param1._22 * param2._21 + param1._23 * param2._31 + param1._24 * param2._41, param1._21 * param2._12 + param1._22 * param2._22 + param1._23 * param2._32 + param1._24 * param2._42, param1._21 * param2._13 + param1._22 * param2._23 + param1._23 * param2._33 + param1._24 * param2._43, param1._21 * param2._14 + param1._22 * param2._24 + param1._23 * param2._34 + param1._24 * param2._44, param1._31 * param2._11 + param1._32 * param2._21 + param1._33 * param2._31 + param1._34 * param2._41, param1._31 * param2._12 + param1._32 * param2._22 + param1._33 * param2._32 + param1._34 * param2._42, param1._31 * param2._13 + param1._32 * param2._23 + param1._33 * param2._33 + param1._34 * param2._43, param1._31 * param2._14 + param1._32 * param2._24 + param1._33 * param2._34 + param1._34 * param2._44, param1._41 * param2._11 + param1._42 * param2._21 + param1._43 * param2._31 + param1._44 * param2._41, param1._41 * param2._12 + param1._42 * param2._22 + param1._43 * param2._32 + param1._44 * param2._42, param1._41 * param2._13 + param1._42 * param2._23 + param1._43 * param2._33 + param1._44 * param2._43, param1._41 * param2._14 + param1._42 * param2._24 + param1._43 * param2._34 + param1._44 * param2._44);
}// end function
}
}
Matrix3d.as
ноу комментс: матрицо в 3д, экшон
+144
while(sizeof($data)>sizeof($head)) {
$data[sizeof($data)-2].=$data[sizeof($data)-1];
unset($data[sizeof($data)-1]);
}
кусочек моего скрипта разовой работы, накиданного на скорую руку(неудивительно, что он выполнялся 2 минуты).
думаю, всем понятен смысл этого кусочка = )
+145
function eval()
{
this.obj = eval(obj);
}
выкопал из сорцов игрушки...
+145
// где-то:
public boolean isLoaded() {
return (boolean) (this.sequencer.isOpen());
}
//там:
public boolean isOpen();
код к книжке
+68
if (url == null) {
throw new RuntimeException("Error reading resource " + url.getFile());
}
ха.
туториалы jogl
+145
/**
* Returns an array of all the objects currently registered
* as <code><em>Foo</em>Listener</code>s
* upon this <code>Component</code>.
* <code><em>Foo</em>Listener</code>s are registered using the
* <code>add<em>Foo</em>Listener</code> method.
*
* <p>
* You can specify the <code>listenerType</code> argument
* with a class literal, such as
* <code><em>Foo</em>Listener.class</code>.
* For example, you can query a
* <code>Component</code> <code>c</code>
* for its mouse listeners with the following code:
*
* <pre>MouseListener[] mls = (MouseListener[])(c.getListeners(MouseListener.class));</pre>
*
* If no such listeners exist, this method returns an empty array.
*
* @param listenerType the type of listeners requested; this parameter
* should specify an interface that descends from
* <code>java.util.EventListener</code>
* @return an array of all objects registered as
* <code><em>Foo</em>Listener</code>s on this component,
* or an empty array if no such listeners have been added
* @exception ClassCastException if <code>listenerType</code>
* doesn't specify a class or interface that implements
* <code>java.util.EventListener</code>
*
* @see #getComponentListeners
* @see #getFocusListeners
* @see #getHierarchyListeners
* @see #getHierarchyBoundsListeners
* @see #getKeyListeners
* @see #getMouseListeners
* @see #getMouseMotionListeners
* @see #getMouseWheelListeners
* @see #getInputMethodListeners
* @see #getPropertyChangeListeners
*
* @since 1.3
*/
public <T extends EventListener> T[] getListeners(Class<T> listenerType) {
EventListener l = null;
if (listenerType == ComponentListener.class) {
l = componentListener;
} else if (listenerType == FocusListener.class) {
l = focusListener;
} else if (listenerType == HierarchyListener.class) {
l = hierarchyListener;
} else if (listenerType == HierarchyBoundsListener.class) {
l = hierarchyBoundsListener;
} else if (listenerType == KeyListener.class) {
l = keyListener;
} else if (listenerType == MouseListener.class) {
l = mouseListener;
} else if (listenerType == MouseMotionListener.class) {
l = mouseMotionListener;
} else if (listenerType == MouseWheelListener.class) {
l = mouseWheelListener;
} else if (listenerType == InputMethodListener.class) {
l = inputMethodListener;
} else if (listenerType == PropertyChangeListener.class) {
return (T[])getPropertyChangeListeners();
}
return AWTEventMulticaster.getListeners(l, listenerType);
}
как вы думаете, что это? внутренности Java
java.awt.Component
+145
private TaskScheduler scheduler;
protected TaskScheduler() {
}
public final TaskScheduler getScheduler() {
if (this.scheduler == null) {
this.scheduler = new TaskScheduler();
}
return this.scheduler;
}
мелочь, а смешно получилось ))