- 1
l.add_xpath('price', '//table[3]/tr/td[2]/table[1]/tr[1]/td[3]/table/tr[3]/td/table/tr[2]/td/text()', lambda x: '.'.join(x))
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
−102
l.add_xpath('price', '//table[3]/tr/td[2]/table[1]/tr[1]/td[3]/table/tr[3]/td/table/tr[2]/td/text()', lambda x: '.'.join(x))
+163
$message .= $value . '
';
\r\n ? неее, не слышал ....
+153
window.onload = function()
{
m1 = new Matrix('matrix1', 20, 20);
m1.create();
var square = new Square(1, 2, 'right');
square.create();
setInterval(square.move, 50);
}
function Square(row, col, course)
{
this.body = [row, col];
this.course = course;
var that = this; // <-- 100500 iopta !!!
this.create = function()
{
m1.setCell(that.body[0], that.body[1], true);
}
this.move = function()
{
var last_body = that.body;
switch(that.course)
{
case 'right':
that.body[1]++;
break;
case 'left':
break;
case 'down':
break;
case 'up':
break;
}
m1.setCell(last_body[0], last_body[1], false);
m1.setCell(that.body[0], that.body[1], true);
}
}
здесь вам не тут, понял, да !
+132
#include <stdio.h>
unsigned int mid (unsigned int a, unsigned int b)
{
if (a > b) {unsigned int c = a; a = b; b = c;}
for(; a < b; a--, b++) {;};
return a;
}
int main(void) {
printf("%u %u %u %u", mid(2,2), mid(3,2), mid(2,3), mid(3,3));
return 0;
}
Это я хочу найти середину. Где-то я туплю
+127
let inline id a = a
let inline const1 value _ = value
let inline applyNTimes f n s =
let fs = Seq.init n <| const1 f
let fa = Seq.fold (>>) id fs
fa s
+73
http://bnw.im/p/JCBN9N
https://bnw.im/u/j123123
+146
.text:08104D0B mov ebx, [ebp+arg_0]
.text:08104D0E mov ecx, [ebp+var_C]
.text:08104D11 mov eax, 51EB851Fh
.text:08104D16 imul ecx
.text:08104D18 sar edx, 4
.text:08104D1B mov eax, ecx
.text:08104D1D sar eax, 1Fh
.text:08104D20 sub edx, eax
.text:08104D22 mov [ebp+var_C], edx
.text:08104D25 mov ecx, [ebx+38h]
.text:08104D28 mov eax, 51EB851Fh
.text:08104D2D imul ecx
.text:08104D2F sar edx, 4
.text:08104D32 mov eax, ecx
.text:08104D34 sar eax, 1Fh
.text:08104D37 sub edx, eax
.text:08104D39 mov [ebx+38h], edx
.text:08104D3C cmp [ebp+var_C], 0
.text:08104D40 jg short loc_8104D55
.text:08104D42 mov [ebp+var_C], 1
.text:08104D49 nop
.text:08104D4A nop
.text:08104D4B nop
.text:08104D4C nop
.text:08104D4D nop
.text:08104D4E nop
.text:08104D4F nop
.text:08104D50 nop
.text:08104D51 nop
.text:08104D52 nop
.text:08104D53 nop
.text:08104D54 nop
.text:08104D55
.text:08104D55 loc_8104D55: ; CODE XREF: session_skill::StartSession(bool)+222j
.text:08104D55 mov eax, [ebp+arg_0]
.text:08104D58 cmp byte ptr [eax+29h], 0
.text:08104D5C jz short loc_8104D74
.text:08104D5E mov ebx, [ebp+arg_0]
.text:08104D61 sub esp, 0Ch
.text:08104D64 push offset g_timer
.text:08104D69 call _ZN5abase5timer8get_tickEv ; abase::timer::get_tick(void)
.text:08104D6E add esp, 10h
.text:08104D71 mov [ebx+40h], eax
.text:08104D74
.text:08104D74 loc_8104D74: ; CODE XREF: session_skill::StartSession(bool)+23Ej
.text:08104D74 sub esp, 0Ch
.text:08104D77 push [ebp+var_C]
.text:08104D7A push 0
.text:08104D7C push 14h
.text:08104D7E push offset g_timer
.text:08104D83 mov eax, [ebp+arg_0]
.text:08104D86 add eax, 10h
.text:08104D89 push eax
.text:08104D8A call _ZN5abase10timer_task8SetTimerERNS_5timerEiii ; abase::timer_task::SetTimer(abase::timer &,int,int,int)
.text:08104D8F add esp, 20h
.text:08104D92 sub esp, 8
.text:08104D95 sub esp, 4
.text:08104D98 push 18h ; size
.text:08104D9A call _ZN5abase12ASmallObjectnwEj ; abase::ASmallObject::operator new(uint)
.text:08104D9F add esp, 8
.text:08104DA2 mov [ebp+ptr], eax
.text:08104DA5 mov [ebp+var_19], 1
.text:08104DA9 sub esp, 8
.text:08104DAC push 0Dh
.text:08104DAE mov eax, [ebp+arg_0]
.text:08104DB1 push dword ptr [eax+8]
.text:08104DB4 mov eax, [ebp+arg_0]
.text:08104DB7 push dword ptr [eax+4]
.text:08104DBA push [ebp+ptr]
.text:08104DBD call _ZN22skill_interrupt_filterC1EP11gactive_impii ; skill_interrupt_filter::skill_interrupt_filter(gactive_imp *,int,int)
.text:08104DC2 add esp, 18h
.text:08104DC5 mov [ebp+var_19], 0
.text:08104DC9 mov eax, [ebp+ptr]
.text:08104DCC push eax
.text:08104DCD mov eax, [ebp+arg_0]
.text:08104DD0 mov eax, [eax+4]
.text:08104DD3 add eax, 100h
.text:08104DD8 push eax
.text:08104DD9 call _ZN10filter_man9AddFilterEP6filter ; filter_man::AddFilter(filter *)
.text:08104DDE add esp, 10h
.text:08104DE1 jmp short loc_8104E13
вот собсно
+143
if (result == true) {
return true;
}
else { return false; }
return false;
не баян, а классика
+126
printfn "%A" <| [1,2,3,4,5].Length
printfn "%A" <| [1..5].Length
F#
http://ideone.com/A2DZPr
+133
open System
let inline un激辛カレー<'a> (f:obj) (tuple:obj) =
match tuple with
| :? ('a * 'a * 'a) as tuple ->
let a , b , c = tuple
match f with
| :? ('a -> 'a -> 'a -> 'a) as f -> f a b c
| _ -> failwith "type did not matched! 3"
| :? ('a * 'a) as tuple ->
let a,b = tuple
match f with
| :? ('a -> 'a -> 'a) as f -> f a b
| _ -> failwith "type did not matched! 2"
| :? 'a as tuple ->
let a = tuple
match f with
| :? ('a -> 'a) as f -> f a
| _ -> failwith "type did not matched! 1"
| _ -> failwith "type did not matched! tuple"
printfn"%A"<| un激辛カレー<float> (fun x->x + 1.) 2.
printfn"%A"<| un激辛カレー<int> (+) (10,10)
printfn"%A"<| un激辛カレー<string> (fun (x:string) y z->x + y + z) ("How ","are ","you?")