Vеrsette
Explore posts from serversDIAdiscord.js - Imagine an app
•Created by Vеrsette on 5/9/2024 in #djs-questions
Detecting user AFK channel switch
How can I detect a user being moved to an AFK channel by the server? It seems like it doesn't work the same way as if the user were to join the channel themselves
5 replies
✅ String search by user text input algorithm
I have a list of some objects that have a "name" string, what is the best way to search for an object by getting an input string from a textbox?
I tried sorting them by Levenshtein distance, but it doesn't really work that well when, for example, one string is shorter than other
What algorithms are standard?
I'm sure that there is a solution for this kind of thing as such "search by text input" is everywhere, but I couldn't find a good answer
10 replies
❔ 'System.ExecutionEngineException' occurred in WindowsBase.dll
My WPF project has a UI part that has bindings to DataContext of the Window, and this DataContext is a class that inherits
INotifyPropertyChanged
and updates it's properties in a while(true)
loop in a separate background thread with a small delay.
But when I hover my mouse over a certain custom control, it errors out with ExecutionEngineException
on it's function. When I remove the control, it errors out the same way on DragMove()
of the Window. And the only thing that fixes it is not starting the update thread, which means that the issue must be there, but what could it be?17 replies
Rotating image in 3D space
I have chose a library called Magick.NET (ImageMagick) for the image processing stuff, because it can run on Linux, etc
It has a method called Distort that can do pretty much what I need by using DistortMethod.Perspective
But the issue is that I want to input two angles (x and y rotation) for it to rotate the image plane, but this method accepts coordinates of a bounding box, and where to move them. It figures out the other stuff by itself.
My initial idea was to assume that if I move the top right and bottom right pixels to the top left and bottom left pixels, it would be a 360 degree rotation. But the issue with that is that the perspective stuff wouldn't work then, because it works with changing the Y value of the destination pixels too, and I have no idea how to figure out that value based on only input of 2 angles of rotation.
I would think that I probably have to do math stuff for that, but I have no idea where to take similar code from, or even what formula can be used for this.
2 replies
Capturing images from specific DirectX window
I want to capture images (pretty quickly, so pretty much like a video) from different applications, and some of them are DirectX, so using things like GDI+ won't work.
From reading a bit about it, I have found that I apparently can do it by using EasyHook and DLL injection, but hooking and DLL injection make me think about how would that work in videogames? Wouldn't an anticheat ban you for that?
Windows.Graphics.Capture seems to work, but I couldn't find a way to get images from it.
27 replies