- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
$(function(){
oCatalog=new Catalog();
});
Catalog = function (){
function test (data){
alert(data);
}
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+145
$(function(){
oCatalog=new Catalog();
});
Catalog = function (){
function test (data){
alert(data);
}
}
+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
// The future of the C# or ...
// Why waste time on trifles, teaching programmers the subtleties of programming !? :)
//...
CComboBox cb = new Windows7(Windows7Type::wt_combobox);
for( int i = 0; i < strArray.length(); i++ ) {
CComboBoxItem item = new Windows7(Windows7Type::wt_combobox_item, strArr[i]);
cb.Add(item);
}
+145
/**
* Получаем права на объект.
*
* @param string $fullHref
* @param string $method
* @param string $params
* @param string $type
* @return object $this
* @access public
*/
public function getPermsHref( $object, $method = '*', $params = false, $type = 'module', $url = false )
{
$registr = URegistry::getInstance();
$sql = $registr->SQuery->getAcl();
if ( $type == 'url' && $url )
{
$sql['where'] = "`o`.`type` = 'url' and `o`.`href` = '".$url."'";
$ac_type = 'url';
}
elseif ( $type == 'module' )
{
$sql['where'] = "(`o`.`type` = 'module') and `o`.`name` = '".$object."'";
if ( $method != '*' )
$sql['where'] .= ' or `o`.`href` = "'.$object.'/'.$method.'"';
$ac_type = 'module';
}
else
{
//TODO:wtf?
}
$registr->db->build_query($sql)->safe_sql($ac_type, $this->gid)->exec();
$perms = $registr->db->fetch_object();
if ( !$perms || !$perms->permission || !$perms->groupid )
throw new NotFoundObject();
$this->perms = $perms->permission;
$this->groupObject = explode(',', $perms->groupid);
$this->priv_lengh = strlen($perms->permission);
return $this;
}
/**
* Проверка прав на объект
*
* @param mixed $priv
* @return array
* @access public
*/
public function checkPremsObject( $priv = false )
{
$pruf = array();
$priv = empty($priv) ? $this->perms : $priv;
if ( $this->priv_lengh <= 0 or !in_array($this->gid, $this->groupObject) )
return false;
for ( $gi = 0; $gi < $this->priv_lengh; $gi++ )
{
if ( in_array($priv[$gi], $this->privileges['read']) ) $pruf['read'] = true;
if ( in_array($priv[$gi], $this->privileges['write']) ) $pruf['write'] = true;
if ( in_array($priv[$gi], $this->privileges['delete']) ) $pruf['delete'] = true;
}
return $pruf;
}
Проверка прав.
Что скажите?
+145
{
float y,a,b;
int x;
a=StrToFloat(Edit1->Text);
b=StrToFloat(Edit2->Text);
for (x=1;x<=10;x+=2);
{
y=x*x/(a+b);
Memo1->Lines->Add("x="+FloatToStr(x)+"\ty="+FloatToStr(y));
}
}
программа вычисления функции , при изменении Х от 1 до 10 .
+145
switch ($_GET['otdel']) {
case null:
echo "Название отдела №1";
$_GET['otdel'] = 1;
break;
case 1:
echo "Название отдела №1";
break;
case 11:
// и так далее
Отдел по умолчанию.
Вариантов написать толково - тьма. Попробуем?
+145
<tr>
<td><td><td><td><td><td><td><td>
</td></td></td></td></td></td></td></td>
</tr>
взялся за реконструкцию одного проекта... там есть сводная таблица и она должна быть разделена на 10 частей по вертикали... Предыдущий программист реализовал разделитель так...
+145
foreach($new as $key => $value)
{
$config[$key] = $value;
}
+145
/*Выпадающее меню - рассчитывание координат и выполнение определенных действий при определенных координатах курсора*/
//document.onmousemove = function(e){
// var mCur = mousePageXY(e);
//}
//function mousePageXY(e)
//{
// var x = 0, y = 0;
//
// if (!e) e = window.event;
//
// if (e.pageX || e.pageY)
// {
// x = e.pageX;
// y = e.pageY;
// }
//
// else if (e.clientX || e.clientY)
// {
// x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
// y = e.clientY + (document.documentElement.scrollTop || document.body.scrollTop) - document.documentElement.clientTop;
// }
// if ((((screen.width/2-491)>x)||(screen.width/2+409<x))||((screen.width/2-491<x)&&(y<125)&&((screen.width/2-274)>x))||(y>170+height)||(((screen.width/2-274)<x)&&(y<173))) {
// document.getElementById("menu").style.display = 'none'
// }
// return {
// "x":x,
// "y":y
// };
//}
+145
private TaskScheduler scheduler;
protected TaskScheduler() {
}
public final TaskScheduler getScheduler() {
if (this.scheduler == null) {
this.scheduler = new TaskScheduler();
}
return this.scheduler;
}
мелочь, а смешно получилось ))