

mikerabat
Members-
Content Count
45 -
Joined
-
Last visited
-
Days Won
1
mikerabat last won the day on December 19 2018
mikerabat had the most liked content!
Community Reputation
27 ExcellentRecent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
I had recently a similar problem! Random access violation although I thought my code was clean.... My code was clean the problem actually was that the toast notification did something similar as Application.ProcessMessages! During the show or hide functions the Delphi message pump was active and if there were messages left that invoked the toast notification to change I ran into access violations on the Microsoft implementation side! So for a certain time one needs to process messages but make sure that nothing is called on the tost notification side for about 50 to 200ms.... Here my original problem:
-
Best Practices for Secure Authentication in Delphi REST Applications
mikerabat replied to nolanmaris's topic in Network, Cloud and Web
You can use Webauthn/Passkeys/Fido2 keys . The only thing stored on the server would be a publik key that has been created on the client device! So... no need to store passwords on the server side 😉 I got the webauthn api and a wrapper for the yubiko fido2.dll here. https://github.com/mikerabat/DelphiFido2 and a (not so practical but good enough for me) example on how to use a passkey from the iphone here: https://github.com/mikerabat/fronius -
I didn't knew that this would trigger such a response gg Hi Stephan! Will there be some code to examine 😉 Quite good numbers 🙂 !!
-
Tried to create a SIMD (AVX2 based) Quicksort: https://github.com/mikerabat/SimdQSort For anyone who is interested... It supports Int32, Int64, Single and Double Array sorting - no custom struct size nor user defined compare procs. Speedup for large random arrays is up to 3.5 🙂
-
As I see that this is the same mechanism just not in the main thread.
-
Thanks for the suggestion. I'll try that one though I think it will not solve our problem in the first place - we already use the TTrayIcon component that allows to show balloon hints in the tray. BUT... (there is always a but..) we have a hard time to cancel the hints if they occure in a rapid way. That was no problem in winxp and win7 - there it worked well - but on newer OS's the tray does not cancel properly but rather shows the hint for a few seconds. This is quite annyoing for users since all the action has already been done and the hints still pop up. Note that we do not know in beforehand how long the hints are shown - sometimes it takes long (depeding on the amount of data transferred) sometimes it is fast... The newer toast notifications seem to resolve that problem but have this other nasty problem ... Anyhow I think the last change did the trick...
-
I implemented a a timer and posting messages. If we catch a reentrance call I setup a timer that tries again in 50ms - that seems to fix the problem... notifyImpl.pas trayNotifications.dpr
-
Following problem: Our main platform for developing our applications is still D2010 (don't ask why..). One of our applications we develop used to use the standard tray icon ballon hints which have a few problems on newer platforms - win 11 especially. So.. the task is to use the toast notification component from D11. To do that I ccreated a small dll that exports a function returning an interface that handles the notification - basically show and cancel the hint. There are some events that may happen in a rapid timing. I carefully designed the dll such that the notifications are only shown and hidden in the main thread. The problem is that I encounter sometimes nasty access violations that I cannot account for... Here is my theory: Showing and hiding toast notifications through the winrt api somehow invokes something like Application.processmessages - I can confirm that during the hide call the show call is reentered (since I put something from a thread in the message queue that triggers a balloon hint to be shown) so either the show call or the hide call result in a nasty AV. (one call on the toastnotification center is not finished and the next one is already there...) I tried to "wait" for the call to be finished but spin waiting blocks the notification stuff too and I actually do not want to have another handler implemented in the d2010 app.... Has anyone experienced something like this (aka is there an easy solution) Could a queue be a solution -> the main app just queues the call an in a message pump (wndproc of an allochwnd call) I handle it myself? Any chance that some winrt init call is missing or can be done different such that it does not show that behaviour? Attached the two files that account for the dll kind regards Mike notifyImpl.pas trayNotifications.dpr
-
Double, default value
mikerabat replied to Skrim's topic in Algorithms, Data Structures and Class Design
This not entirely correct - all basic types aren't. Strings, interfaces and dynamic arrays are initialized to nil. -
Intel Simd-sort library
mikerabat replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
I'm not sure about exactly this library but some predecessors indeed were able to sort pointer list whereas the "key" is a float/int 32/64 . The key can be specified as an "offset" to the starting address -> this allows to sort pointers to records/classes.... at least that is the way they do it in "Fast quicksort Implementation using AVX Instructions" The definitions in the library for AVX512 are actually using arrays of templates so I guess that means that you can sort records right not only Double/float... ? This problem is solved by an algorithm that allows to extract the kth largest element (not only the median) -> basically it does the partitioning of quicksort but does not sort hte "unnecessary" half. That in fact allows to pick the median in O(n) (roughly) time.... And if you want to go fancy you can do a rolling median over an array of doubles. The algorithm can be found here: https://github.com/mikerabat/mrmath/blob/master/RollingMedMean.pas -
@David Heffernan That would be against the direction I develop here - first I need the working ASM 😉 then the tool can use the disassembly to create the db instructions....
-
Thanks for the input - I will beef up the tool to get at least the else part aligned on the right side 😉 that really looks nicer.
-
Jus FYI: That is intentional - the left side shall show the original assembler call the right side the DB translation -> my tool, that derrives the DB statements from the assembler code does a line by line comparison.
-
I just released an assembler optimzed (AVX2 set) Base64 encoding/decoding unit. check it out under https://github.com/mikerabat/fastbase64/ My reference implementation achieves up to 10 times speedup against the reference Indy implementation. Let me know what you think or if you encounter some errors...
-
That is actually interesting... If I use the same settings I got a different result (aka the annoying one). (sorry I cannot create such a neat little video 🙂 ) I'll check if GExperts or DDevextension interfere here...