Jump to content

staticwater

Active Members
  • Posts

    316
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by staticwater

  1. "La steaua" nu Luceafarul! Poezii Romanesti
  2. Cine sunt useri de incredere? I want to see names! Uploadeaza undeva programul pe care l-ai rulat.
  3. staticwater

    Blue dot

  4. P(Success) P(Success) P(Success)=p*p*p - good catch! Bravo!
  5. Ieri m-am grabit un pic(era tarziu), azi revin cu o explicatie mai detaliata: Sa notam cu: P(Success) - probabilitatea de a da cos P(Fail) - probabilitatea de a da pe langa Putem sa scriem: P(Success) = p unde 0 <= p <= 1 P(Fail) = 1 - P(Success) Ex: (pt. cei care n-au treaba cu matematica) Daca probabilitatea sa dai cos este de 0,8(80%), probabilitatea sa dai pe langa este de: 1-0,8 = 0,2(100% - 80% = 20%) 1. P(1) - probabilitatea sa dai cos dintr-o lovitura P(1) = P(Success) = p 2. P(2/3) - probabilitatea sa dai cos de 2 ori din 3 Sunt 3 posibilitati sa dai cos(2/3): P(Success) P(Success) P(Fail) = p*p*(1 - p) P(Success) P(Fail) P(Success) = p*(1 - p)*p P(Fail) P(Success) P(Success) = (1 - p)*p*p _______________________________________________________________ In total: P(2/3) = 3*p*p*(p - 1) Concluzie: Pt. ca p < 1 ==> P(1) > P(2/3) Ex1: p =1/2 P(1) = 1/2 = 0.5 P(2) = 3*1/2*1/2*(1 - 1/2)= 3/8 = 0.375 Ex1: p =3/4 P(1) = 3/4 = 0.75 P(2) = 3*3/4*3/4*(1 - 3/4) = 27/64 = 0.42
  6. This is a no-brainer: P(1) = p P(2) =3*p*p*(1 -p) p <= 1 ==> P(1) > P(2) //LE: nu e chiar asa de simplu
  7. Don't ask how old I am, I'm old as hell Lucrez aproape de 20 ani ca programator, cu toate ca n-am terminat facultatea de informatica, la vremea respectiva nu era la moda informatica(matematica-fizica ; -14 ani Delphi combinat cu c++(GUI->delphi, hard stuff->c, c++) -5 ani c# M-am saturat...vreau sa ma las de programare, o sa intelegeri si voi dupa 20 ani.
  8. Daca vrei un multiplatform RAD, solutia e Lazarus. Lazarus http://wiki.lazarus.freepascal.org/Screenshots Lazarus PS: Imi place si QTCreator!
  9. @blueray Stiu ce e MVVM. Pattern-ul a fost creat de microsoft si cel mai mult e folosit in aplicatii .net.
  10. Eu zic ca cel mai important design pattern e sa nu cazi in capcana paternurilor de design. Mai astept si alte pareri...
  11. @skull M-am uitat la profilul tau. Ai 21 de ani. Ori esti foarte talentat, ori pinocchio cu nasul mare. Choose one...
  12. @blueray C# ?
  13. Intrebare pentru programatori avansati(va rog sa-mi raspundeti sincer, fara google): How many design patterns do you know(use)?
  14. @Dar la un Stokes te bagi? 6.49 ii) Prea usor! Nu ma bag, pana ce nu vad o ecuatie integro-differentiala.
  15. Lol. Macar propune si tu o ecuatie diferentiala, neomogena de ordinul 2(at least), preferabil partiala...si atunci ma bag si eu.
  16. Nu va mai cacati pe voi! A fost un experiment social, facut de un retardat. The whole story: CE A P??IT un b?rbat din Secuime care a cerut p?ine ?n limba rom?n? | REALITATEA .NET Ce se ?nt?mpl? c?nd ceri p?ine ?n ungure?te la Cluj? T?n?rul din Secuime, un nou experiment | REALITATEA .NET
  17. Iar vb. aiurea pe forum! Nimic nu e pierdut @ovidelu47. Acceseaza recovery console(vezi google), dupa care cu ajutorul comenzii expand copiaza fisierul sters de pe hard.
  18. Nu ma bag in cearta voastra, pur si simplu nu ma intereseaza, dar cum poti coda un malware in .net? Ai zis ca programul blocheaza sistemul, in schimb sitemul(XP) a "blocat" programul tau: "To run this application you first must install the following version of .net 4.0.3" This is the goof of all time! //Edit: @cross Te-ai suparat degeaba. Retardism...lol.
  19. @CarcotasulSef You got to get laid, big time!
  20. The good old delphi... Link proiect: http://rapidshare.com/share/A6C3EA1ED588D085902E300DF8AA1ADA unit fVectorUnit; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls, Menus; type TfVector = class(TForm) mm: TMainMenu; Fiseire1: TMenuItem; Deschidere1: TMenuItem; ParasireAplicatie1: TMenuItem; Vizualizare1: TMenuItem; Calcul1: TMenuItem; Calculeaza1: TMenuItem; Vizualizarevector1: TMenuItem; reVector: TRichEdit; OD: TOpenDialog; procedure Deschidere1Click(Sender: TObject); procedure ParasireAplicatie1Click(Sender: TObject); procedure Vizualizarevector1Click(Sender: TObject); procedure Calculeaza1Click(Sender: TObject); private { Private declarations } public Vector: array of real; { Public declarations } end; var fVector: TfVector; implementation uses fMinMaxUnit; {$R *.dfm} procedure TfVector.Deschidere1Click(Sender: TObject); var List: TStringList; I: Integer; begin OD.InitialDir := ExtractFilePath(Application.ExeName); if OD.Execute then begin List := TStringList.Create; try List.LoadFromFile(OD.FileName); SetLength(Vector, List.Count); for I := 0 to High(Vector) do begin try Vector[I] := StrToFloat(List.Strings[I]) except MessageDlg('Date invalide!', mtError, [mbOk], 0); Vector := nil; Break; end; end; finally List.Free; end; end; end; procedure TfVector.ParasireAplicatie1Click(Sender: TObject); begin if MessageDlg('Sigur doriti sa parasiti aplicatia?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then Application.Terminate; end; procedure TfVector.Vizualizarevector1Click(Sender: TObject); var I: Integer; begin if Length(Vector) = 0 then begin MessageDlg('Baza de date nu a fost incarcata!', mtInformation, [mbOk], 0); Exit; end; for I := 0 to High(Vector) do reVector.Lines.Add('v[' + IntToStr(I) + ']='+ FloatToStrF(Vector[I], ffFixed, 3, 3)) end; procedure TfVector.Calculeaza1Click(Sender: TObject); begin if Length(Vector) = 0 then begin MessageDlg('Baza de date nu a fost incarcata!', mtInformation, [mbOk], 0); Exit; end; fMinMax.ShowModal; end; end. unit fMinMaxUnit; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TfMinMax = class(TForm) rbMin: TRadioButton; rbMax: TRadioButton; bCalc: TButton; bClose: TButton; procedure bCloseClick(Sender: TObject); procedure bCalcClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var fMinMax: TfMinMax; implementation uses fVectorUnit; {$R *.dfm} function MaxVector: real; var I: Integer; M: real; begin M := fVector.Vector[Low(fVector.Vector)]; for I := 1 to High(fVector.Vector) do if fVector.Vector[I] > M then M := fVector.Vector[I]; Result := M; end; function MinVector: real; var I: Integer; M: real; begin M := fVector.Vector[Low(fVector.Vector)]; for I := 1 to High(fVector.Vector) do if fVector.Vector[I] < M then M := fVector.Vector[I]; Result := M; end; procedure TfMinMax.bCalcClick(Sender: TObject); var MinMax: real; I: Integer; begin if rbMin.Checked then MessageDlg('Elementul minim: ' + FloatToStrF(MinVector, ffFixed, 3, 3), mtInformation, [mbOk], 0) else MessageDlg('Elementul maxim: ' + FloatToStrF(MaxVector, ffFixed, 3, 3), mtInformation, [mbOk], 0) end; procedure TfMinMax.bCloseClick(Sender: TObject); begin Close; end; end.
  21. N-am unit complet. Am scris o functie si o procedura care citeste/scrie din registry! uses Registry; function ReadSerialFromRegistry: String; var Registry: TRegistry; begin Result := ''; Registry := TRegistry.Create; try with Registry do begin RootKey := HKEY_CURRENT_USER; Access := KEY_READ; if OpenKey('\Software\EHDSoftware', False) then begin Result := ReadString('Serial'); CloseKey; end; end; finally Registry.free; end; end; function WriteSerialToRegistry(Serial: String): Boolean; var Registry: TRegistry; begin Result := False; Registry := TRegistry.Create; try with Registry do begin RootKey := HKEY_CURRENT_USER; Access := KEY_ALL_ACCESS; if OpenKey('\Software\EHDSoftware', True) then begin try WriteString('Serial', Serial); Result := True; except end; CloseKey; end; end; finally Registry.free; end; end; procedure TForm1.Button3Click(Sender: TObject); begin if (Edit2.Text = (Label1.Caption)) then begin Button1.Visible := True WriteSerialToRegistry(Label1.Caption); end else ShowMessage('Cod Invalid'); //..... end; procedure TForm1.FormCreate(Sender: TObject); var Serial: String; begin Serial := ReadSerialFromRegistry; //... end; Prima data ar trebui sa faci programe mai simple. Eu te ajut cu cea mai mare placere, dar nu cred ca ai cunostinitele necesare(deocamdata).
  22. function ReadSerialFromRegistry: String; var Registry: TRegistry; begin Result := ''; Registry := TRegistry.Create; try with Registry do begin RootKey := HKEY_CURRENT_USER; Access := KEY_READ; if OpenKey('\Software\EHDSoftware', False) then begin Result := ReadString('Serial'); CloseKey; end; end; finally Registry.free; end; end; function WriteSerialToRegistry(Serial: String): Boolean; var Registry: TRegistry; begin Result := False; Registry := TRegistry.Create; try with Registry do begin RootKey := HKEY_CURRENT_USER; Access := KEY_ALL_ACCESS; if OpenKey('\Software\EHDSoftware', True) then begin try WriteString('Serial', Serial); Result := True; except end; CloseKey; end; end; finally Registry.free; end; end; Usage: procedure TForm1.FormCreate(Sender: TObject); begin var Serial: String; begin Serial := ReadSerialFromRegistry; if Serial <> '' then MessageDlg('The serial number is: ' + Serial , mtInformation, [mbOk], 0) else MessageDlg('Cannot read serial number from regitry!', mtError, [mbOk], 0) end; procedure TForm1.Button1Click(Sender: TObject); var Serial: String; begin //... Serial := '9005eefa-dad1-53b4-baab-56ecfbf9d55c'; if WriteSerialToRegistry(Serial) then MessageDlg('Successfully completed!', mtInformation, [mbOk], 0) else MessageDlg('Cannot write serial number to regitry!', mtError, [mbOk], 0) end;
  23. Server is a PC on steroids!
  24. wtf? elaborate...ce ai vrut sa zici?
×
×
  • Create New...