- 1
- 2
- 3
- 4
- 5
public static java.sql.Date currentSQLDate() {
java.sql.Date result = null;
Date date = new Date();
return result;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+80
public static java.sql.Date currentSQLDate() {
java.sql.Date result = null;
Date date = new Date();
return result;
}
ох, ёптеть...
+151
function checked(obj) {
var undefined;
obj = '#'+obj;
if ($(obj+':checked').attr('id') == undefined) {
return 0;
}
else {
return 1;
}
}
можно встретить и такое
+137
private static string SimplifyPath(string path)
{
var dirs = path.Split("\\".ToCharArray());
var absolutePath = new List<string>();
foreach (var dir in dirs)
{
if (dir == "..")
{
absolutePath.RemoveAt(absolutePath.Count - 1);
continue;
}
absolutePath.Add(dir);
}
var result = string.Empty;
for (int i = 0; i < absolutePath.Count - 1; ++i)
{
result += absolutePath[i];
result += "\\";
}
result += absolutePath[absolutePath.Count - 1];
return result;
}
Path.GetFullPath? Нет, мы не ищем легких путей.
+134
public void Children_OnAdd(object sender, EventArgs e)
{
((MyEventArgs<Document>)e).D.Parent = this;
}
+164
var num = 3;
var x1 = Math.floor(Math.random()*num + 1);
var x2 = Math.floor(Math.random()*num + 1);
var x3 = Math.floor(Math.random()*num + 1);
var x4 = Math.floor(Math.random()*num + 1);
var x5 = Math.floor(Math.random()*num + 1);
var x6 = Math.floor(Math.random()*num + 1);
var x7 = Math.floor(Math.random()*num + 1);
var x8 = Math.floor(Math.random()*num + 1);
var x9 = Math.floor(Math.random()*num + 1);
var x10 = Math.floor(Math.random()*num + 1);
var x11 = Math.floor(Math.random()*num + 1);
var x12 = Math.floor(Math.random()*num + 1);
var x13 = Math.floor(Math.random()*num + 1);
var x14 = Math.floor(Math.random()*num + 1);
var x15 = Math.floor(Math.random()*num + 1);
var x16 = Math.floor(Math.random()*num + 1);
var i = 0;
while (true) {
x1 = Math.floor(Math.random()*num + 1);
x2 = Math.floor(Math.random()*num + 1);
x3 = Math.floor(Math.random()*num + 1);
x4 = Math.floor(Math.random()*num + 1);
x5 = Math.floor(Math.random()*num + 1);
x6 = Math.floor(Math.random()*num + 1);
x7 = Math.floor(Math.random()*num + 1);
x8 = Math.floor(Math.random()*num + 1);
x9 = Math.floor(Math.random()*num + 1);
x10 = Math.floor(Math.random()*num + 1);
x11 = Math.floor(Math.random()*num + 1);
x12 = Math.floor(Math.random()*num + 1);
x13 = Math.floor(Math.random()*num + 1);
x14 = Math.floor(Math.random()*num + 1);
x15 = Math.floor(Math.random()*num + 1);
x16 = Math.floor(Math.random()*num + 1);
if (x1 === x2){
if (x2 === x3) {
if(x4 === x5){
if (x5 === x6) {
if (x6 === x7){
if (x7 === x8){
if (x8 === x9){
if (x9 === x10){
if (x10 === x11){
if (x11 === x12){
if (x12 === x13){
if (x13 === x14){
if (x14 === x15){
if (x15 === x16){
if (x1 === x16){
document.write('<h3>ЧИСЛО x1 - ' + x1 + ' и x2 - ' + x2 + " x3 - " + x3 + " x4 - " + x4 + " x5 - " + x5 + " x6 - " + x6 + " x7 - " + x7 + " x8 - " + x8 + " x9 - " + x9 + " x10 - " + x10 + " x11 - " + x11 + " x12 - " + x12 + " x13 - " + x13 + " x14 - " + x14 + " x15 - " + x15 + " x16 - " + x16 + "<b> i= </b> " + i);
break;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}else{
i++;
document.write('<b>x1: </b>' + x1 + ' <b> x2: </b> ' + x2 + " x3 - " + x3 + " x4 - " + x4 + " x5 - " + x5 + " x6 - " + x6 + " x7 - " + x7 + " x8 - " + x8 + " x9 - " + x9 + " x10 - " + x10 + " x11 - " + x11 + " x12 - " + x12 + " x13 - " + x13 + " x14 - " + x14 + " x15 - " + x15 + " x16 - " + x16 + " - " + i + "<br>");}
}
Генерируем 16 чисел в диапазоне 1-3, условие такое, что они должны быть равными, пока они не равны выводим каждое значение числа, и вот что каждый раз в цикле (генерируем новые случайные числа, в этом же диапазоне)
+145
if (!$to && !$from)
{
$msgInstance->setStatus(1);
$msgInstance->setDeletedTo(1);
$msgInstance->setDeletedFrom(1);
$incomingL = -1;
$outcomingL = -1;
}
elseif (!$to){
$msgInstance->setStatus(1);
$msgInstance->setDeletedTo(1);
$incomingL = -1;
$outcomingL = 0;
}
elseif (!$from)
{
$msgInstance->setDeletedFrom(1);
$incomingL = 0;
$outcomingL = -1;
}
Оцените xD ;)
+116
<style type="text/css">
header
{
display: block;
}
header
{
clear: both;
height: 160px;
width: 100%;
background: url(/images/imges.jpg) no-repeat;
-moz-background-size: 100%;
-webkit-background-size: 100%;
-o-background-size: 100%;
background-size: 100% 100%;
background-position: center center;
}
.block1
{
height: 160px;
width: 20%;
}
.block2
{
height: 160px;
width: 15%;
}
.block3
{
height: 160px;
width: 30%;
}
.block4
{
height: 160px;
width: 15%;
}
.block5
{
height: 160px;
width: 20%;
}
table
{
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
</style>
<header>
<table>
<tr>
<td class="block1" onClick="document.location='/' " onmouseover ="this.style.cursor='pointer' " title= "Главная">
</td>
<td class="block2">
</td>
<td class="block3">
</td>
<td class="block4">
</td>
<td class="block5" onClick="document.location='/script/enter.php' " onmouseover ="this.style.cursor='pointer' " title= "Вход">
</td>
</tr>
</table>
</header>
Найдено на просторах интернета: обычная шапка сайта, ничего лишнего.
Код был нечитаемым - форматировал я. CSS, касаемо использованных тегов, вся.
+61
public void insert()
{
super.insert();
if (this.ItemId == "")
this = this;
}
нарочно не придумаешь
+140
string num = number.ToString();
num = num.Replace(',', '.');
string num2 = number2.ToString();
num2 = num2.Replace(',', '.');
int displace = 0;
int i = 0;
for (i = 0; i <= num.Length - 1; i++)
{
if (num.Substring(i, 1) != ".")
{
int curNum = Convert.ToInt16(num.Substring(i, 1));
Microsoft.Xna.Framework.Rectangle source = new Microsoft.Xna.Framework.Rectangle(curNum * 46, 0, 46, 64);
sb.Draw(numbers, new Microsoft.Xna.Framework.Rectangle((int)position.X + (i * 24), (int)position.Y - 5, (int)(46.0f * scale), (int)(64.0f * scale)), source, color);
}
else
{
Microsoft.Xna.Framework.Rectangle source = new Microsoft.Xna.Framework.Rectangle(10 * 46, 0, 46, 64);
sb.Draw(numbers, new Microsoft.Xna.Framework.Rectangle((int)position.X + (i * 24), (int)position.Y - 5, (int)(46.0f * scale), (int)(64.0f * scale)), source, color);
}
displace += (int)(46.0f * scale);
}
Microsoft.Xna.Framework.Rectangle src = new Microsoft.Xna.Framework.Rectangle(11 * 46, 0, 46, 64);
sb.Draw(numbers, new Microsoft.Xna.Framework.Rectangle((int)position.X + displace, (int)position.Y - 5, (int)(46.0f * scale), (int)(64.0f * scale)), src, color);
displace += (int)(46.0f * scale);
for (i = 0; i <= num2.Length - 1; i++)
{
if (num2.Substring(i, 1) != ".")
{
int curNum = Convert.ToInt16(num2.Substring(i, 1));
Microsoft.Xna.Framework.Rectangle source = new Microsoft.Xna.Framework.Rectangle(curNum * 46, 0, 46, 64);
sb.Draw(numbers, new Microsoft.Xna.Framework.Rectangle((int)position.X + (i * 24) + displace, (int)position.Y - 5, (int)(46.0f * scale), (int)(64.0f * scale)), source, color);
}
else
{
Microsoft.Xna.Framework.Rectangle source = new Microsoft.Xna.Framework.Rectangle(10 * 46, 0, 46, 64);
sb.Draw(numbers, new Microsoft.Xna.Framework.Rectangle((int)position.X + (i * 24) + displace, (int)position.Y - 5, (int)(46.0f * scale), (int)(64.0f * scale)), source, color);
}
}
Nuff said.
Как я тогда давным давно поленился импортировать неймспейс XNA - чёрт его знает.
+70
public static final void setManager(String name, MessageManager manager) {
if ("doc".equals(name)) {
doc = manager;
} else {
throw new RuntimeException("name is not 'doc' : " + name);
}
}
Просто эпично! Даже добавить нечего