- 1
- 2
- 3
- 4
- 5
public static Boolean GetAttBool(XmlNode node, string attName)
{
long value = GetAttLong(node, attName);
return value == 1 ? true: false;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+128
public static Boolean GetAttBool(XmlNode node, string attName)
{
long value = GetAttLong(node, attName);
return value == 1 ? true: false;
}
+128
public class TDebug
{
public static void Assert(bool condition)
{
System.Diagnostics.Debug.Assert(condition);
#if DEBUG
if(!condition)
throw new Exception();
#endif
}
}
+128
//Hint: We have added one more overload to the method Load/LoadBinary/LoadSoap to achieve your requirement. Please refer the below code snippet.
Exception ex = null;
diagram1.LoadBinary(@"..\\..\\Basic Shapes.edp",out ex);
if (ex != null)
{
//Do your customization here
}
индусский обработчик исключений.
поддержка исключений в их компонент была добавлена по нашей просьбе.
+128
if ((((((X >= -7) && (X<= -6) & (Y!=2)) || (X<= -2) && (X>= -6) && (Y<=0) && (Y>= -1) && (Y== 0.25*X + 0.5) || (X+ -2)*(X+ -2) + (Y+2)*(Y+2)==4) && (X >= -2) && (X<=0) && (Y>=0) && (Y<=2)|| (((X*X)+(Y*Y)==4)) && ((X>=0) && (X<=2) && (Y>=0) && (Y<=2))) || ((Y==0.5*X-1) && (X>=2) && (Y<=3) & (Y!=0)))) Console.WriteLine("Принадлежит");
+128
<?xml version='1.0' encoding='utf-8'?>
<list>
<item id="8190" skillId="3603" name="Demonic Sword Zariche">
<dropRate val="1" /> <!-- 100000 for 100% -->
<duration val="300" /> <!-- in minutes -->
<durationLost val="3" /> <!-- in minutes -->
<disapearChance val="50" /> <!-- in % -->
<stageKills val="10" /> <!-- Integer -->
</item>
<item id="8689" skillId="3629" name="Blood Sword Akamanah">
<dropRate val="1" /> <!-- 100000 for 100% -->
<duration val="300" /> <!-- in minutes -->
<durationLost val="3" /> <!-- in minutes -->
<disapearChance val="50" /> <!-- in % -->
<stageKills val="10" /> <!-- Integer -->
</item>
</list>
Вот ХМЛ код , задроты Л2 поймут))
+128
int zerocheck(float a,float b,float c,int d){
if(a==0){
if(b==0){
if(c==0)return 0;
else return 1;
}else{
if(d==1){
y_1=c/b;
return 2;
}else{
y2=c/b;
return 2;
}
}
}else{
if(b==0){
if(d==1){
x1=c/a;
return 3;
}else{
x2=c/a;
return 3;
}
}else{
return 4;
}
}
}
int main() {
float a,b,c,d,e,f;
int ch1,ch2;
.....
ch1=zerocheck(a,b,c,1);
ch2=zerocheck(d,e,f,2);
if(ch1==1)printf("\nNo answer. 0*X + 0*Y = %f",c);
if(ch2==1)printf("\nNo answer. 0*X + 0*Y = %f",f);
if(ch1==0 && ch2==0)printf("\nAny variable is answer!");
if(ch1==0 && ch2==2)printf("\nX - any. Y = %f",y2);
if(ch1==0 && ch2==3)printf("\nX = %f. Y - any",x2);
if(ch1==0 && ch2==4)printf("\n%f*X + %f*Y = %f",d,e,f);
if(ch1==2 && ch2==0)printf("\nX - any. Y = %f",y_1);
if(ch1==2 && ch2==2){
if(y_1==y2)printf("\nX - any. Y = %f",y_1);
else printf("\nY1 (%f) != Y2 (%f)",y_1,y2);
}
if(ch1==2 && ch2==3)printf("\nX = %f. Y = %f",x2,y_1);
if(ch1==2 && ch2==4){
y2=y_1;
x2=(f-e*y2)/d;
printf("\nX = %f. Y = %f",x2,y_1);
}
if(ch1==3 && ch2==0)printf("\nX = %f. Y - any",x1);
if(ch1==3 && ch2==2)printf("\nX = %f. Y = %f",x1,y2);
if(ch1==3 && ch2==3){
if(x1==x2)printf("\nX = %f. Y - any",x1);
else printf("\nX1 (%f) != X2 (%f)",x1,x2);
}
if(ch1==3 && ch2==4){
x2=x1;
y2=(f-d*x2)/e;
printf("\nX = %f. Y = %f",x1,y2);
}
if(ch1==4 && ch2==0)printf("\n%f*X + %f*Y = %f",a,b,c);
if(ch1==4 && ch2==2){
y_1=y2;
x1=(c-b*y_1)/a;
printf("\nX = %f. Y = %f",x1,y2);
}
if(ch1==4 && ch2==3){
x1=x2;
y_1=(c-a*x1)/b;
printf("\nX = %f. Y = %f",x2,y_1);
}
if(ch1==4 && ch2==4){
if(a/b==d/e)printf("\nNo answer. Lines would be parallel or qeual.");
else{
x1=(b*f-c*e)/(d*b-a*e);
y_1=(c-a*x1)/b;
printf("\nX = %f. Y = %f",x1,y_1);
}
}
printf("\n");
print_lines();
return 0;
}
Hello, C!
+128
<?php
$TITLE = preg_replace("/^[\s\d]+/", "", @$TITLE? $TITLE : @$_REQUEST["TITLE"]);
$USE_HEAD = @$USE_HEAD? $USE_HEAD : @$_REQUEST["USE_HEAD"];
$ISMAIN = @$ISMAIN? $ISMAIN : @$_REQUEST["ISMAIN"];
?>
<html>
<head>
<title><?=strip_tags($TITLE)?></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<style type="text/css">
<!--
html, body { padding: 0px; margin: 0px; }
.menu { padding: 4px 10px 4px 10px; border-bottom: 3px double #999999; background: #FFFFFF; font-size: 85%; font-weight: bold; }
p { text-align: justify }
h1 { font-size: 150%; }
h2 { font-size: 130%; }
-->
</style>
</head>
<body bgcolor="white" text="#000000" link="#00639C" alink="#ffaa00" vlink="#00437C">
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top">
<td bgcolor="#DEDFDE" width="80%" style="border-right: 1px outset">
<?if ($USE_HEAD) {?>
<table class="menu" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<a href="http://localhost">localhost</a>
|
<a href=http://localhost/Tools/>Утилиты</a>
|
<a href=http://localhost/Docs/>Документация</a>
|
<a href=http://localhost/Test/>Тестирование</a>
</td>
<td align="right">
<a href="http://www.denwer.ru">Сайт Денвера</a>
|
<a href="http://faq.dklab.ru/denwer/">FAQ</a>
|
<a href="http://www.denwer.ru/dis/">Дистрибутивы</a>
|
<a href="http://forum.dklab.ru/denwer/">Пишите нам!</a>
</td>
</tr>
</table>
<?}?>
<div style="width=100%; padding: 0px 10px 4px 10px">
<?if (@$ISMAIN) {?>
<a href="http://www.denwer.ru"><script>
function setCookie(name, value, path, expires, domain, secure) {
var curCookie = name + "=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "; path=/") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
document.cookie = curCookie;
}
function getCookie(name) {
var prefix = name + "=";
var cookieStartIndex = document.cookie.indexOf(prefix);
if(cookieStartIndex == -1) return null;
var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length);
if(cookieEndIndex == -1) cookieEndIndex = document.cookie.length;
return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}
var c = (getCookie('vc') || 0);
setCookie('vc', parseInt(c) + 1, '/', new Date(new Date().getTime()+1000*3600*24*365*4));
document.write('<img width="73" height="94" style="float:right; margin:10px 0px 0px 10px" border=0 src="http://www.denwer.ru/logo.gif?' + c + '" />');
</script></a>
<?}?>
<h1 style="margin-top: 0.2em"><?=$TITLE?></h1>
котеров камлает донат.
возникла проблемка с похапэ. было мне слово, что в denwer всё работает. зато словил лулзов.
+128
include ("bd.php");// файл bd.php должен быть в той же папке, что и все остальные, если это не так, то просто измените путь
$result4 = mysql_query ("SELECT avatar FROM users WHERE activation='0' AND UNIX_TIMESTAMP() - UNIX_TIMESTAMP(date) > 3600");//извлекаем аватарки тех пользователей, которые в течении часа не активировали свой аккаунт. Следовательно их надо удалить из базы, а так же и файлы их аватарок
if (mysql_num_rows($result4) > 0) {
$myrow4 = mysql_fetch_array($result4);
do
{
//удаляем аватары в цикле, если они не стандартные
if ($myrow4['avatar'] == "avatars/net-avatara.jpg") {$a = "Ничего не делать";}
else {
unlink ($myrow4['avatar']);//удаляем файл
}
}
while($myrow4 = mysql_fetch_array($result4));
}
Вот как учат детей программировать там http://ruseller.com/lessons.php?rub=37&id=369
просто умер от этого while($myrow4 = mysql_fetch_array($result4));
+128
/********************************************************************
ОПЕРАЦИЯ ЛОГИЧЕСКОЕ ИСКЛЮЧАЮЩЕЕ ИЛИ
********************************************************************/
static inline bool XOR(bool lhs, bool rhs)
{
return (lhs && !rhs) || ( !lhs && rhs);
}
Человек не знал, что есть стандартный xor...
+127.8
int main()
{
if (2 * 2 != 4)
{
printf ("Плохой день!");
getch();
return 1;
}
...
}
А вдруг???