- 1
- 2
private final String zeroValueString="0";
private final String sevenValueString="7";
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+81.3
private final String zeroValueString="0";
private final String sevenValueString="7";
Если б можно, то ещё б и hundredElevenValueString = "111"; впиндюрили бы
+155
void SimpleTest::testTrivial() {
wxTst::TempInteractive interactive;
wxTst::ModalDialogTimer timer(wxID_OK);
// *** Loop up top level containers ***
CPPUNIT_ASSERT_MESSAGE ("Application top window invalid",
wxTheApp->GetTopWindow () != NULL);
wxMDIParentFrame *topFrame =
dynamic_cast< wxMDIParentFrame * >(wxTheApp->GetTopWindow ());
CPPUNIT_ASSERT_MESSAGE ("Top window is not an MDI Parent frame",
topFrame != NULL);
wxMenuBar *menuBar = topFrame->GetMenuBar ();
CPPUNIT_ASSERT_MESSAGE ("Menubar not found", menuBar != NULL);
// interactive.ShowCurrentGui (_T(__FILE__), __LINE__);
// *** Check menu item ***
int platformMenuItemId = menuBar->FindMenuItem (_("Advanced"),
MC _T("Platform Specific Example"));
CPPUNIT_ASSERT_MESSAGE ("Menu item ID 'platformMenuItem' not found",
platformMenuItemId != wxNOT_FOUND);
wxMenuItem *platformMenuItem = menuBar->FindItem (
platformMenuItemId);
CPPUNIT_ASSERT_MESSAGE ("Menu item 'platformMenuItem' not found",
platformMenuItem != NULL);
wxTst::EventSimulationHelper::SelectMenuItem (
platformMenuItemId, topFrame);
wxTst::WxGuiTestHelper::FlushEventQueue ();
wxWindow* wdw = topFrame->FindWindow(_T("platform_child"));
if (wdw == NULL)
wdw = wxWindow::FindWindowByName(_T("platform_child"));
CPPUNIT_ASSERT_MESSAGE("First Child not found", wdw != NULL);
wxMDIChildFrame* child1 = dynamic_cast<wxMDIChildFrame*>(wdw);
CPPUNIT_ASSERT_MESSAGE("Window isn't an MDI Child", child1 != NULL);
wxTst::WxGuiTestHelper::FlushEventQueue ();
interactive.ShowCurrentGui (_T(__FILE__), __LINE__);
wxTst::EventSimulationHelper::SelectMenuItem (
platformMenuItemId, topFrame);
wxTst::WxGuiTestHelper::FlushEventQueue ();
// interactive.ShowCurrentGui (_T(__FILE__), __LINE__);
wxMDIChildFrame* child2 = topFrame->GetActiveChild();
CPPUNIT_ASSERT_MESSAGE("Second child not found", child2 != NULL);
CPPUNIT_ASSERT_MESSAGE("Second child same as first ", child2 != child1);
child2->Close();
int derived_toolMenuItemId = menuBar->FindMenuItem (_("Advanced"),
MC _T("Custom Class Example"));
CPPUNIT_ASSERT_MESSAGE ("Menu item ID 'derived_toolMenuItem' not found",
derived_toolMenuItemId != wxNOT_FOUND);
wxMenuItem *derived_toolMenuItem = menuBar->FindItem (
derived_toolMenuItemId);
CPPUNIT_ASSERT_MESSAGE ("Menu item 'derived_toolMenuItem' not found",
derived_toolMenuItem != NULL);
wxTst::EventSimulationHelper::SelectMenuItem (
derived_toolMenuItemId, topFrame);
wxTst::WxGuiTestHelper::FlushEventQueue ();
wxWindow *custom_child =
wxWindow::FindWindowByName (_T("custom_class_child"));
CPPUNIT_ASSERT_MESSAGE ("Container window for button 'wxID_OK' not found",
custom_child != NULL);
// interactive.ShowCurrentGui (_T(__FILE__), __LINE__);
wxWindow *wxID_OKWdw4 = custom_child->FindWindow (XRCID("wxID_OK"));
CPPUNIT_ASSERT_MESSAGE ("Window for button 'wxID_OK' not found",
wxID_OKWdw4 != NULL);
wxTst::EventSimulationHelper::ClickButton (wxID_OKWdw4->GetId (),
wxID_OKWdw4);
wxTst::WxGuiTestHelper::FlushEventQueue ();
CPPUNIT_ASSERT_MESSAGE("OK Button didn't hide Mac Specific Dialog",
custom_child->IsShown() == false);
}
Источник: метод примера из wxGuiTesting
+152
private event EventHandler<EventArgs> _DataChanged;
public event EventHandler<EventArgs> DataChanged
{
add { _DataChanged = value; }
remove { _DataChanged = null; }
}
+163.2
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</htm
Новый уникальный метод защиты директорий на сервере от сторонних посягательств... Использование .htacces, как видимо, уже не в моде..
В каждой "ЗАЩИЩЕННОЙ" папке лежит index.html файл с таким кодом....
+153
function db_encode_blob($data) {
return $data;
}
Drupal
+142
require_once ('../classes/class.partners.php');
ГовнокодЛайт:: наверное все так, по непонятным причинам???
Для чего в папке "classes" называть все файлы с "class."??
+145
function get_comments($ident,$id,$type,$feedback=false){
...
$tree_id = $id*10+$type;
...
$TL = TreeLoad(0,$tree_id,-1,$ident,$feedback);
Стыдно
+133.4
// parse from the uninstall, the actuall installation path
try {
int jarLoc = uninstallDir.indexOf("-jar");
String s = uninstallDir.substring(jarLoc + 5);
// turn it into a normalized file
int uniLoc = s.indexOf("uninstaller");
s = s.substring(1,uniLoc);
s = s.replace("\\", "/");
if(s.endsWith("/"))
s = s.substring(0,s.length()-1);
File f = new File(s);
if(!f.exists()) {
throw new Exception("installation directory does not exist: " + s);
}
return f;
}
catch(Exception e) {
throw new Exception("installation directory could not be parsed from: " + uninstallDir);
}
Typical code of one highly paid "tech expert" from USA
Exception handling makes me cry, this guy doesn't even now about any other exception classes
+89.9
static char DigitToChar(
int _Digit
)
{
switch (_Digit)
{
case 0: return '0';
case 1: return '1';
case 2: return '2';
case 3: return '3';
case 4: return '4';
case 5: return '5';
case 6: return '6';
case 7: return '7';
case 8: return '8';
case 9: return '9';
default: return ':';
}
}
в результате долгих размышлений всетаки заменили на return '0' + _Digit;
+35
<tr>
<td width="21"><a href="javascript:couleur(0);" onMouseOver="window.status='<?php echo __("noir")?>';return true;"><img name="cou0" src="<?php echo HTTP_CHAT?>images/noir-select.gif" width=21 height=21 border=0 alt=""></a></td>
<td width="21"><a href="javascript:couleur(1);" onMouseOver="window.status='<?php echo __("violet")?>';return true;"><img name="cou1" src="<?php echo HTTP_CHAT?>images/violet.gif" width=21 height=21 border=0 alt=""></a></td>
<td width="21"><a href="javascript:couleur(2);" onMouseOver="window.status='<?php echo __("bleu")?>';return true;"><img name="cou2" src="<?php echo HTTP_CHAT?>images/bleu.gif" width=21 height=21 border=0 alt=""></a></td>
<td width="21"><a href="javascript:couleur(3);" onMouseOver="window.status='<?php echo __("vert")?>';return true;"><img name="cou3" src="<?php echo HTTP_CHAT?>images/vert.gif" width=21 height=21 border=0 alt=""></a></td>
<td width="21"><a href="javascript:couleur(4);" onMouseOver="window.status='<?php echo __("rouge")?>';return true;"><img name="cou4" src="<?php echo HTTP_CHAT?>images/rouge.gif" width=21 height=21 border=0 alt=""></a></td>
<td width="21"><a href="javascript:couleur(5);" onMouseOver="window.status='<?php echo __("orange")?>';return true;"><img name="cou5" src="<?php echo HTTP_CHAT?>images/orange.gif" width=21 height=21 border=0 alt=""></a></td>
</tr>
маленький кусочек говна из большого куска французского движка