- 1
- 2
- 3
- 4
- 5
- 6
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
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+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?")
+139
Представляю Вашему вниманию новейший минусатор: http://rghost.ru/54852059
Исправлены многие ошибки предыдущих версий. Не побрезгуйте, родимые!..
Новейший минусатор для творения непотребностей с рейтингом.
+96
Var
h : THandle;
procedure TMain.FormCreate(Sender: TObject);
begin
begin
h := CreateMutex(nil, True, PChar(ExtractFileName(Application.ExeName)));
if WaitForSingleObject(h, 0)<>0 then
begin
ShowMessage(‘Программа уже запущена!’);
Application.Terminate;
CloseHandle(h);
end;
end;
http://moron.1side.ru/programmirovanie/delphi/zapret-povtornogo-zapuska-programmy.php
+17
cKeyCfg::types_t cConfiguration::SearchInType(string type)
{
CTint i = 0;
const CTbyte * types[] = { "S", "D" };
for(i = 0; i < sizeof(types)/sizeof(types[0]); i++) {
if ( strcmp(type.c_str(),types[i]) == 0) {
switch (i) {
case 0: // Is string
return cKeyCfg::stringa;
case 1: // Is decimal
return cKeyCfg::decimale;
default: //Default value VT_BSTR
return cKeyCfg::unknow;
}
}
}
return cKeyCfg::unknow;
}
сделано на родине Fiat'а.
+134
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ConnectToTenderGov
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Connect connect = new Connect();
webBrowser1.Navigate("https://tender.me.gov.ua/EDZFrontOffice/menu/ru/");
while (webBrowser1.ReadyState != WebBrowserReadyState.Complete)
Application.DoEvents();
webBrowser1.Document.GetElementById("login:login").SetAttribute("value", "***@***.com");
webBrowser1.Document.GetElementById("login:password").SetAttribute("value", "***");
webBrowser1.ScriptErrorsSuppressed = true;
webBrowser1.Document.GetElementById("login:loginButtonPopup").InvokeMember("click");
}
}
}
Пытался реализовать модуль авторизации, требование - должны были использоваться cookie.