−95
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
For x=1 to Len(content)
bs = Mid(content, x, 1)
If bs = "0" Or bs = "1" Or bs = "2" Or bs = "3" Or bs = "4" Or bs = "5" Or bs = "6" Or bs = "7" Or bs = "8" Or bs = "9"
If Not t1 = "."
d1+bs
ElseIf Not t2 = "."
d2+ bs
ElseIf Not t3 = "."
d3+ bs
ElseIf Not t4 = ":"
d4+ bs
Else
pp+ bs
EndIf
ElseIf bs = "."
If Not d1 = "" And d2 = ""
t1 = "."
ElseIf Not d2 = "" And d3 = ""
t2 = "."
ElseIf Not d3 = "" And d4 = ""
t3 = "."
ElseIf Not pp = ""
d1 = pp
d2 = ""
d3 = ""
d4 = ""
pp = ""
t1 = "."
t2 = ""
t3 = ""
t4 = ""
EndIf
Else
If Not d4 = "" And pp = ""
t4 = ":"
ElseIf Val(pp) > 79 And Val(pp) < 9000 And Val(d1) < 255 And Val(d2) < 255 And Val(d3) < 255 And Val(d4) < 255 And Val(d1) > 0 And Val(d2) > 0 And Val(d3) > 0 And Val(d4) > 0
p+ 1
prx = d1 + t1 + d2 + t2 + d3 + t3 + d4 + t4 + pp
If Not FindString(prx, "127.0.0.1", 1)
For r = 1 To ArraySize(prox())
g = 0
If prox(r) = prx
g = 1
EndIf
Next
If g = 0
prox(ArraySize(prox())) = prx
ReDim prox(ArraySize(prox())+1)
EndIf
EndIf
d1 = ""
d2 = ""
d3 = ""
d4 = ""
pp = ""
t1 = ""
t2 = ""
t3 = ""
t4 = ""
Else
d1 = ""
d2 = ""
d3 = ""
d4 = ""
pp = ""
t1 = ""
t2 = ""
t3 = ""
t4 = ""
EndIf
EndIf
Next x
=) это мой калл
суть: ищется посимвольным сравнениям прокси сервера формата n.n.n.n port и заполняется массив prox()
в 2000 году у PureBasic не было еще регулярок, а у меня знаний =)
даже сейчас удивляюсь что код тогда мной был написан за один раз и без комментариев 0_0 (d1,d2,d3,d4,pp,t1,t2,t3,t4.... жуть)
pbg,
29 Июня 2010
+162
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
class TWSpace: public Wtroka {
public:
inline TWSpace()
: Wtroka(CharToWide(" "))
{
}
};
static inline const Wtroka& Wspace() {
return *Singleton<TWSpace>();
}
const Wtroka& WSPACE = Wspace();
Пробел...
solarik,
29 Июня 2010
+165
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
once = true;
$(document).ready(function () {
$('#Town').change(function () {
if (once) {
if ($(this).val() != $("#TownName").val()) {
alert("При смене города произойдет потеря всех товаров в корзине");
once = false;
}
}
}
})
);
вместо
$('#Town').one('change', function() {})
nur,
29 Июня 2010
−151
- 1
- 2
- 3
- 4
- 5
- 6
- 7
try:
if respond[0] == 'command':
self.servercommands.append(respond)
else:
raise KeyError('Invalid type')
except (TypeError, IndexError, KeyError):
self.responds.append(respond)
roku,
29 Июня 2010
+173
- 1
javascript:for(i=0; i<=document.images.length; i++){document.images[i].width=height=0}
Безумное решение которое я нашел на форуме в локалке под лозунгом "Сэкономить на трафике" была ссылка с данным кодом.
pbg,
29 Июня 2010
+189
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
for (int y=0; y<height; ++y)
{
int x=0;
dstp[x] = (srcp[x+4]*678 + srcp[x+3]*3902 + srcp[x+2]*13618 + srcp[x+1]*28830 +
srcp[x]*18508 + 32768)>>16; ++x;
dstp[x] = (srcp[x+4]*678 + srcp[x+3]*3902 + srcp[x+2]*13618 +
(srcp[x-1]+srcp[x+1])*14415 + srcp[x]*18508 + 32768)>>16; ++x;
dstp[x] = (srcp[x+4]*678 + srcp[x+3]*3902 +
(srcp[x-2]+srcp[x+2])*6809 + (srcp[x-1]+srcp[x+1])*14415 +
srcp[x]*18508 + 32768)>>16; ++x;
dstp[x] = (srcp[x+4]*678 + (srcp[x-3]+srcp[x+3])*1951 +
(srcp[x-2]+srcp[x+2])*6809 + (srcp[x-1]+srcp[x+1])*14415 +
srcp[x]*18508 + 32768)>>16;
for (x=4; x<width-4; ++x)
{
dstp[x] = ((srcp[x-4]+srcp[x+4])*339 + (srcp[x-3]+srcp[x+3])*1951 +
(srcp[x-2]+srcp[x+2])*6809 + (srcp[x-1]+srcp[x+1])*14415 +
srcp[x]*18508 + 32768)>>16;
}
dstp[x] = (srcp[x-4]*678 + (srcp[x-3]+srcp[x+3])*1951 +
(srcp[x-2]+srcp[x+2])*6809 + (srcp[x-1]+srcp[x+1])*14415 +
srcp[x]*18508 + 32768)>>16; ++x;
dstp[x] = (srcp[x-4]*678 + srcp[x-3]*3902 +
(srcp[x-2]+srcp[x+2])*6809 + (srcp[x-1]+srcp[x+1])*14415 +
srcp[x]*18508 + 32768)>>16; ++x;
dstp[x] = (srcp[x-4]*678 + srcp[x+3]*3902 + srcp[x-2]*13618 +
(srcp[x-1]+srcp[x+1])*14415 + srcp[x]*18508 + 32768)>>16; ++x;
dstp[x] = (srcp[x-4]*678 + srcp[x-3]*3902 + srcp[x-2]*13618 +
srcp[x-1]*28830 + srcp[x]*18508 + 32768)>>16;
srcp += pitch;
dstp += pitch;
}
вот он - бесконстантый код
3.14159265,
29 Июня 2010
+75
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
String message = myObj.getMessage();
if (!message.equals("")) {
if (showDialog(s)) {
method1();
method2();
method3();
}
} else {
method1();
method2();
method3();
}
Пособие для не ленивых.
lotik,
29 Июня 2010
+164
- 1
- 2
- 3
- 4
- 5
- 6
function banByIP($ip) {
$result = mysql_query("SELECT * FROM `" . $GLOBALS['mysql_bans_table'] . "` WHERE `ip` = '" . mysql_real_escape_string($ip) . "' LIMIT 1");
while ($ban = mysql_fetch_assoc($result)) {
return $ban;
}
}
Из движка TinyIB.
telnet,
29 Июня 2010
+160
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
CBufferHandlerOfPrmtv::CBufferHandlerOfPrmtv
{
_ffInt = 0;
_ffInt = ~_ffInt;
_ffChar = 0;
_ffChar = ~_ffChar;
}
bool CBufferHandlerOfPrmtv::IsFF(unsigned int toCheck, unsigned int toCheckSz)
{
if(toCheckSz > sizeof(unsigned int)){
assert(!testPrmtvs);
return true;
}
if(!toCheckSz){
assert(!testPrmtvs);
return true;
}
return (memcmp(&toCheck, &_ffInt, toCheckSz) == 0);
}
разбирал щас говешки и вот такое увидел...
НАХЕРА ?!?!!?
PS: подскажу. метода проверяет число на 0xff.
kubrinsky,
28 Июня 2010
+141
- 1
- 2
- 3
if(i.ToString()==j.ToString())
{
//...
Из моей детсадовской лабы. С тех пор я профессионально вырос.
Wеbkill,
28 Июня 2010