Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. There's a potential show-stopper for non-Windows platforms https://www.ideasawakened.com/post/rad-studio-10-4-2-is-great-but-here-are-some-notes
  3. KodeZwerg

    Update hidden file

    Thank you @Remy Lebeaueven if I dont understand why telling me. TStringList.SaveToFile() uses internal TFileStream.Create() with fmCreate flag where normal users have no access to. If you say my answer is wrong please explain to learn from. To make myself clear, my steps: 0. "Var VariableX: DWORD" 1. Get attributes "VariableX := GetFileAttributes(PChar(FileName))" 2. Set attributes to have write access "SetFileAttributes(PChar(FileName), FILE_ATTRIBUTE_NORMAL)" 3. Invoke "TSringList.SaveToFile(FileName)" 4. Restore SetFileAttributes(PChar(FileName), VariableX)" If I typed correct this is how it work, no? Missing things like checking for existance and that it is a file.
  4. Remy Lebeau

    Delphi 2006 Indy9 and Indy10 swtich

    Yes, you should be able to simply configure the project's search/library paths to point at the Indy 10 source folders rather than the Indy 9 source folders.
  5. Remy Lebeau

    Indy with Lazarus on Raspberry PI using IPV6 – problem

    That does not necessarily mean that is the interface's IP from the server's perspective for binding. That is just the IP that the LAN uses to reach the device. Do you get meaningful IPv6 addresses from Indy's GStack.GetLocalAddressList() method (not sure if it is implemented for Raspberry Pi)? Do you see that IP in the list?
  6. Today
  7. Attila Kovacs

    IDE Hang

    @FredS Oh, thx for saying, didn't know that there was a cut. I'll go with v14 too.
  8. Remy Lebeau

    Update hidden file

    From the CreateFile documentation: So, you don't have to actually remove the attributes, just match the existing attributes. Which FileCreate() can't do. But you could call CreateFile() directly, and then wrap the HANDLE in a THandleStream if needed.
  9. Hi, I have a simple pipeline, that takes in a list of 20 items, and has one stage. For each item, the stage waits 1 second, and then sends a message to the main UI, which will add the item to a Memo, and update a ProgressBar. The code is looking like this: procedure TForm1.AddDownloadItems; var DownloadItem: TDownloadItem; I: Integer; begin for I := 0 to 19 do begin DownloadItem := TDownloadItem.Create; DownloadItem.Id := I; FDownloadItems.Add(DownloadItem); end; end; procedure TForm1.Stage1(const input, output: IOmniBlockingCollection; const Task: IOmniTask); var Item: TDownloadItem; InputItem: TOmniValue; begin for InputItem in Input do begin Item := TDownloadItem(InputItem.AsObject); Sleep(1000); Task.Comm.Send(0, Item.Id); Output.Add(InputItem); end; end; procedure TForm1.UpdateProgress(const task: IOmniTaskControl; const msg: TOmniMessage); begin Inc(Progress); Memo1.Lines.Add(msg.MsgData.AsString); ProgressBar1.Position := Progress; end; procedure TForm1.GetDownloadsPipline; var Item: TDownloadItem; begin { ====== Start Pipeline ========= } Screen.Cursor := crHourGlass; StartTime := GetTickCount; FPipeline := Parallel.Pipeline .Stage(Stage1, Parallel.TaskConfig.OnMessage(UpdateProgress)).NumTasks(4) //Environment.Process.Affinity.Count) .OnStop( procedure begin PostMessage(Form1.Handle, WM_STOPPED, 0, 0); end) .Run; Self.AddDownloadItems; for Item in FDownloadItems do FPipeline.Input.Add(Item); FPipeline.Input.CompleteAdding; end; When the program runs, a few items get added to the Memo, and only afterwards the progressbar updates. This seems strange. I would expect the progress bar to update simultaneously with the memo. Please see attached video. Any ideas? Thanks pipeline_progress.mp4
  10. Lajos Juhász

    Update hidden file

    Please read the posts and think about them before you start a google search and copy some content that has nothing to do with the question and the thread you paste. So what is the relation with you stackoverflow post and System.SysUtils.FileCreate?!
  11. emailx45

    Update hidden file

    maybe help you https://stackoverflow.com/questions/13506986/how-to-make-files-really-hidden-in-a-directory hug
  12. emailx45

    10.4.2 issue maybe

    if not fouded, then, is not good installed in your IDE verify the BPL/DCP if is in the path of your IDE prefere install your components with "output" of BPL/DCP files to "PUBLIC\...\Embarcadero\nnn\BPL and DCP folders" - the IDE will go found it! the DCU, can be any folder where you have access! Norlmally, in same root of the *.pas files \<<platform = Win32, Win64, etc...>>\<<compilation mode = Debug or Release>>\*.dcu - this will be the path on IDE "PATHS" definition to Debug, for example if any exception on use or when close your app/project, verify if you component it's destroyed when end the task or if the "application" destroy it! the rest, is so much enigmatic question and info! hug
  13. FredS

    IDE Hang

    Installing MMX15 slowed down everything, had to manually change prior Delphi versions back to 14.. plus those new images aren't my taste to be polite 🙂
  14. emailx45

    Possible D10.4.2 issue..

    as I said in another post: if you use "SELF", use ONLY "caFree" if you use "APPLICATION", let for application this task if you use "NIL", YOU is the responsable to destroy it (any class not Interfaced) DONT MIX THE TECHnic's game!!! my tip: if you use "close your DataSets or some connection (???)" later close your "form", my preference always is: before create a form, try open the DataSets if ok, then create your forms --> if any code needs access yours tables, this will be the way ok for that! else, dont worry! if ok, use your form as you need when, all ended, close your DataSets "later"... when returned to procedure that call your form that way, if any error when using your form, then, it will not compromise the closing of the DataSets, of course, if you have protected your code in an appropriate way so as not to leak exceptions. Of course! my preference, if you would like to know (if not ok), is ALWAYS create on-the-fly forms with "nil" owner! then, any error, is mine! And I know that! procedure TfrmFormMain.mnuXXXXClick(Sender: TObject); //var // frmMyFormSecond: TfrmMyFormSecond; // this can be unnecessary, because you can use the "declaration" that is on "FormSecond" by default { unit uFormSecond; ... var frmMyFormSecond := TfrmMyFormSecond; } begin frmMyFormSecond := TfrmMyFormSecond.Create(nil); try frmFormReferees.ShowModal; // for FreeAndNil() use, or similar // if needs a "Show" (-> SELF), dont use "FreeAndNil() or similar" and, prefere use "caFree" on "OnClose event"!!! // dont MIX the two ways! for good control of your app! finally FreeAndNil(frmFormReferees); // or frmFormReferees.Free; frmFormReferees := nil; ect... end; end; hug
  15. To each his own. For single-exe projects it is a non-issue and I wouldn't bother either if my project consisted of only a handful of modules.
  16. emailx45

    Install flag to say it's for ALL USERS?

    not more than it should!!! Security is not for anyone, like me or anyother! but, as you said: "It's above my pay-grade." -- for me too! but will be good to know your tatic for do it in your pc... but as said: "I'm not screwing-up my personal machine trying to figure out a work-related problem!", for me too! So, let's leave this possible solution for the most suitable ones, after all they studied for it, and, they must be worth your monthly salary, right? No more, after one more "inEgmatic" question, and, some even more "inEgmatic" posts, we stop here! hug
  17. rudy999

    10.4.2 issue maybe

    in one of my applications there is a custom menu component -not TMenu i have been using it pre 10.4.2 in one application App A I am working on (so far), when I open up the project I get the message 'xx' component not found. --However it is installed (and in the pallette). If I open another application (not with this component) and add the menu vcl to this app and close this app and open up the first app then it appears again - no error message. HOWEVER when i close Delphi and re-open it and open App A - same error message until I run the excercise described above. I have not seen this before. (I have not yet checked other apps using this component since I just updated to 10.4.2) Any suggestions welcome. stay safe
  18. Yes, this is because I'm implementing common fast class for lookup-up data. And in this case, the searched values are always unique. So, I can exit asap. Well, I didn't really check what would happen with non-unique data, but I guess I lucked out with this.
  19. Aha, I assumed it's like OnClick assignment to event... the flow would go just to the assigned method.
  20. Since it is like you said, I do {$I includeme.inc} with above mentioned content straight after every 'unit xyz;' line of code (mostly just for libraries, executables only when it matters). Saves here and there some bytes, depending on used units.
  21. That is because technically what the compiler generates for line 93 is this: xComparison := function(const left, right: TDataLine): Integer begin Result := CompareIDs(left, right) end); When you put a breakpoint there you have them in multiple lines: one time it gets hit for the assignment to xComparison and all other times for the Result := CompareIDs
  22. Thanks, it makes sense. This jumping of debugger to the same line again and again, even though the flow should be past it, is something new to me. Cool stuff! 😉
  23. The main reason is in the very first sentence of my previous post. Also as you are so into benchmarking I suggest you make yourself familiar with profilers so you don't have to guess or ask others what is taking time as you can very well see for yourself.
  24. Well, no pain, no gain. Used to I also stripped every RTTI because I was annoyed of the binary sizes, but once you get hooked with RTTI and its benefits, there is no back. I can remember watching those code snippets and conversations back to the days on G+ and always thought, man, for WTF do they need that, they are crazy.
  25. I haven't ported the project group from XE to Sydney yet, for now the directive is needed for XE where it applies to all units that the compiler rebuilds. I just wish Embarcadero had optimized RTTI for size from the very beginning and given us the choice wether to use it at all. Having RTTI in your code offers possible attack vectors for reverse engineering etc.
  26. When I debug step by step, I see that the Comparison assignment to CompareIDs method is made on every binary search call, again and again!? I assumed if I move it before the actual call of BinarySearch method, it will assign and construct Comparer once and use it. But the debugger keeps jumping to the line to xComparison := CompareIDs; while doing binary search. I assume this is the cause for slower execution?
  27. Which does absolutely nothing since like XE7 or so when they fixed the $RTTI switch to be local to the current unit.
  1. Load more activity
×