- 1
- 2
//_domain = url.match(/http\:\/\/(.*?)\/.*/is)[1]; не работает с https
_domain = url.substr(url.indexOf("://")+3).substr(0,url.substr(url.indexOf("://")+3).indexOf("/"));
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−453.9
//_domain = url.match(/http\:\/\/(.*?)\/.*/is)[1]; не работает с https
_domain = url.substr(url.indexOf("://")+3).substr(0,url.substr(url.indexOf("://")+3).indexOf("/"));
не работает никак
−452.5
z=1;
b1.onRelease = function() {
if(xo1._alpha!=100){
z+=1;
if(z>2){z=1}
xo1._alpha=100;
xo1.gotoAndStop(z);}
};
b2.onRelease = function() {
if(xo2._alpha!=100){
z+=1;
if(z>2){z=1}
xo2._alpha=100;
xo2.gotoAndStop(z);}
};
b3.onRelease = function() {
if(xo3._alpha!=100){
z+=1;
if(z>2){z=1}
xo3._alpha=100;
xo3.gotoAndStop(z);}
};
b4.onRelease = function() {
if(xo4._alpha!=100){
z+=1;
if(z>2){z=1}
xo4._alpha=100;
xo4.gotoAndStop(z);}
};
b5.onRelease = function() {
if(xo5._alpha!=100){
z+=1;
if(z>2){z=1}
xo5._alpha=100;
xo5.gotoAndStop(z);}
};
b6.onRelease = function() {
if(xo6._alpha!=100){
z+=1;
if(z>2){z=1}
xo6._alpha=100;
xo6.gotoAndStop(z);}
};
b7.onRelease = function() {
if(xo7._alpha!=100){
z+=1;
if(z>2){z=1}
xo7._alpha=100;
xo7.gotoAndStop(z);}
};
b8.onRelease = function() {
if(xo8._alpha!=100){
z+=1;
if(z>2){z=1}
xo8._alpha=100;
xo8.gotoAndStop(z);}
};
b9.onRelease = function() {
if(xo9._alpha!=100){
z+=1;
if(z>2){z=1}
xo9._alpha=100;
xo9.gotoAndStop(z);}
};
Интерфейс крестиков-ноликов на флеше, AS.
−593.8
Dim cr
Private Function click()
If cr = 0 Then
cr = 1
click = "X"
Else
cr = 0
click = "O"
End If
End Function
Private Sub CommandButton1_Click()
If CommandButton1.Caption = "" Then CommandButton1.Caption = click()
End Sub
Private Sub CommandButton10_Click()
cr = 0
CommandButton1.Caption = ""
CommandButton2.Caption = ""
CommandButton3.Caption = ""
CommandButton4.Caption = ""
CommandButton5.Caption = ""
CommandButton6.Caption = ""
CommandButton7.Caption = ""
CommandButton8.Caption = ""
CommandButton9.Caption = ""
End Sub
Private Sub CommandButton2_Click()
If CommandButton2.Caption = "" Then CommandButton2.Caption = click()
End Sub
Private Sub CommandButton3_Click()
If CommandButton3.Caption = "" Then CommandButton3.Caption = click()
End Sub
Private Sub CommandButton4_Click()
If CommandButton4.Caption = "" Then CommandButton4.Caption = click()
End Sub
Private Sub CommandButton5_Click()
If CommandButton5.Caption = "" Then CommandButton5.Caption = click()
End Sub
Private Sub CommandButton6_Click()
If CommandButton6.Caption = "" Then CommandButton6.Caption = click()
End Sub
Private Sub CommandButton7_Click()
If CommandButton7.Caption = "" Then CommandButton7.Caption = click()
End Sub
Private Sub CommandButton8_Click()
If CommandButton8.Caption = "" Then CommandButton8.Caption = click()
End Sub
Private Sub CommandButton9_Click()
If CommandButton9.Caption = "" Then CommandButton9.Caption = click()
End Sub
Крестики-нолики на Power Point за 2 минуты.
+44
document.getElementById(element.id).checked = true;
+23
if not MultiThread then
begin
GetName(@rec);
result:=rec.fname;
end
else
begin
hThread:=CreateThread(0,0,@GetName,@rec,0,tmp);
if WaitForSingleObject(hThread,100)=WAIT_TIMEOUT then
TerminateThread(hThread,0)
else
result:=rec.fname;
CloseHandle(hThread);
end;
Дельфисты - ущербные люди......
−229.2
try:
tray.pop_item('Note')
except:
pass
Этот код вытаскивает (вытаскивал) элемент из трея. На каждом кадре. %)
+3.4
try
{
...
if (obj == null)
{
LogManager.GetLogger("Log").Warn(msg);
throw new SoapException("Object not found", SoapException.ServerFaultCode);
}
}
catch (Exception ex)
{
LogManager.GetLogger("Log").Error(msg, ex);
throw new SoapException("Object not found, SoapException.ServerFaultCode, ex);
}
−60
if (!account_number.equals("") && cycleT != null) {
if (!account_number.equals(num)) {
doWrite(bufferedOut);
account_number = num;
cycleT = c;
vT = v;
} else if (!cycleT.equals(c)) {
doWrite(bufferedOut);
account_number = num;
cycleT = c;
vT = v;
} else if (vT != v) {
doWrite(bufferedOut);
account_number = num;
cycleT = c;
vT = v;
}
} else {
account_number = num;
cycleT = c;
vT = v;
}
−32
#define NULL 1
:) Из той же оперы, что и http://govnokod.ru/62
+29
int main ()
{{{
return 0;
}}}
Я любил делать так... От этого хуже работать не будет, но вызывает вопросительное выражение лица.