- 1
//так как в mysql есть ограничение на джойны (61), делаем следующим образом:...
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+147
//так как в mysql есть ограничение на джойны (61), делаем следующим образом:...
+161
QString str[5][5] = {"a", "b", "c", "d", "e",
"f", "g", "h", "i", "k",
"l", "m", "n", "o", "p",
"q", "r", "s", "t", "u",
"v", "w", "x", "y", "z"};
QString enc, text = ui->lineEdit->text();
int l = text.length();
QString tmp[1][8] = {"s", "o", "m", "e", "t", "e", "x", "t"};
for (int i = 0; i < 1; i++)
{
for (int j = 0; j < 9; j++)
{
for (int ix = 0; ix < 6; ix++)
{
for (int jx = 0; jx < 6; jx++)
{
if(tmp[i][j] == str[ix][jx])
enc = str[ix][jx + 1];
ui->lineEdit_2->setText(enc);
}
}
}
}
}
Такой-то квадрат Полибия!
+116
<Grid Grid.Row="2" Margin="5">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<ContentPresenter Grid.Row="0" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[0]}"/>
<ContentPresenter Grid.Row="0" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[1]}"/>
<ContentPresenter Grid.Row="0" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[2]}"/>
<ContentPresenter Grid.Row="1" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[3]}"/>
<ContentPresenter Grid.Row="1" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[4]}"/>
<ContentPresenter Grid.Row="1" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[5]}"/>
<ContentPresenter Grid.Row="2" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[6]}"/>
<ContentPresenter Grid.Row="2" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[7]}"/>
<ContentPresenter Grid.Row="2" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[8]}"/>
<ContentPresenter Grid.Row="3" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[9]}"/>
<ContentPresenter Grid.Row="3" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[10]}"/>
<ContentPresenter Grid.Row="3" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[11]}"/>
<ContentPresenter Grid.Row="4" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[12]}"/>
<ContentPresenter Grid.Row="4" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[13]}"/>
<ContentPresenter Grid.Row="4" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[14]}"/>
<ContentPresenter Grid.Row="5" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[15]}"/>
<ContentPresenter Grid.Row="5" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[16]}"/>
<ContentPresenter Grid.Row="5" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[17]}"/>
<ContentPresenter Grid.Row="6" Grid.Column="0" Content="{Binding ElementName=root,Path=Items[18]}"/>
<ContentPresenter Grid.Row="6" Grid.Column="1" Content="{Binding ElementName=root,Path=Items[19]}"/>
<ContentPresenter Grid.Row="6" Grid.Column="2" Content="{Binding ElementName=root,Path=Items[20]}"/>
</Grid>
−133
#!/bin/bash
ps -eo pid,ppid,comm > data
#treeNet[0]=1
depth=0
init=0
tree()
{
#echo $1
let depth=depth+1
treeNet[$depth]=1
for ((i=1;i<depth-1;i++))
do
# echo ${treeNet[$depth]}
if [[ ${treeNet[$i]} -eq 0 ]]
then
echo -n " "
fi
if [[ ${treeNet[$i]} -eq 1 ]]
then
echo -n "¦ "
fi
done
if [[ $init -ne 0 ]]
then
echo -n '¦====='
else
init=1
fi
#let depth=depth+1
# treeNet[depth]=1
#prints process name
echo $(cat data | awk '{ if ($1 == '$1') print $3}' )
#printing branches
local count=0 #amount of child branches
for i in $(cat data | awk ' {if ($2 == '$1' ) print $1 } ')
do
let count=count+1
#echo $i
done
#recursive call tree()
local n=0;
for child in $(cat data | awk ' {if ($2 == '$1' ) print $1 } ')
do
let n=n+1
# echo -n " # child no $n of $count depth $depth debug ${treeNet[1]} ${treeNet[2]} ${treeNet[3]} ${treeNet[4]}";
if [[ $n -eq $count ]]
then
#echo -n " last "
treeNet[$depth]=0
fi
# echo
# let n=n+1
tree $child
done
treeNet[$depth]=0
let depth=depth-1
return 0
}
tree 1
+248
Актуальна задача о двух стеках
push esp1
push esp2
Требуется реализация забывчивого стека
push 1 [1,2,3] -> [1,1,2]
+146
main(){}
Минимальная программа на Си.
−154
Исходные коды на 1С!
На джаву перейти мы рады,
Но не стерплю такой утраты,
Я снова перейду на 1С
А мой товарищ одинокий
Нам закодирует EE
Ну и кто сказал, что Маяковский умер?
+72
public EntityPlayerSP(Minecraft minecraft, World world, Session session, int i)
{
super(world);
field_35224_c = 0;
field_35221_d = 0;
field_21903_bJ = new MouseFilter();
field_21904_bK = new MouseFilter();
field_21902_bL = new MouseFilter();
mc = minecraft;
dimension = i;
if(session != null && session.username != null && session.username.length() > 0)
{
skinUrl = (new StringBuilder()).append("http://s3.amazonaws.com/MinecraftSkins/").append(session.username).append(".png").toString();
}
username = session.username;
}
Minecraft
+148
if(!count)
count=0;
switch(type){
case 'writing':
count++;
break;
case 'stopWriting':
count--;
break;
default:
return;
}
//Shit happens.
if(count<0)
count=0;
+156
function checksubmit(obj){
ds = obj.message.value;
while (ds.indexOf("[Результат выстрела.]") > -1) {
variant=7;
priz=Math.round(Math.random() * variant);
ds = ds.replace('[Результат выстрела.]',' [img]http://mystalker.at.ua/cub/cub'+priz+'.gif[/img] ');
} obj.message.value = ds; }
Тут больше доставляет описание чем код )))
Особенно "давно покрылся славой" и "Учесть,что скрипту более 4-х лет и он заслуживает уважения".
http://u.to/a6k6AQ