Search found 48 matches

by Erich
Wed Nov 13, 2019 11:59 am
Forum: Off Topic
Topic: Oh crap... PB ransomware
Replies: 221
Views: 73838

Oh crap... PB ransomware

https://yro.slashdot.org/story/19/11/12/2158210/unusual-new-purelocker-ransomware-is-going-after-servers

To the guys who write these ransomware platforms, who are probably even on this forum somewhere: Could you not use languages like Go instead?

Now Purebasic programs will be flagged by Antivirus ...
by Erich
Fri Feb 23, 2018 7:04 pm
Forum: Coding Questions
Topic: Is SelectElement() "smart"?
Replies: 1
Views: 935

Is SelectElement() "smart"?

When I'm in the middle of a large list, is SelectElement() smart in the sense that it will go relative from the current element's Listindex back and forth through the list to reach the desired element? Or does it always go through the list from the start?
by Erich
Thu Feb 22, 2018 5:14 pm
Forum: Coding Questions
Topic: Worst Heisenbug ever? [solved]
Replies: 1
Views: 1125

Re: Worst Heisenbug ever?

Nevermind, I've updated from PB 5.61 to PB 5.62 and miraculously the memory leak seems to be gone. My day is saved! :mrgreen:
by Erich
Thu Feb 22, 2018 2:52 pm
Forum: Coding Questions
Topic: Worst Heisenbug ever? [solved]
Replies: 1
Views: 1125

Worst Heisenbug ever? [solved]

Okay, folks, I might have stumbled over the worst "Heisenbug" ever. I'm drawing text with graphics acceleration to ScreenOutput() in a screen obtained OpenWindowedScreen().

- it works fine if it's not in a DLL
- if it's in a DLL and loaded from that DLL, then any call to DrawText() in my Linux 64 ...
by Erich
Wed Feb 21, 2018 5:47 pm
Forum: Coding Questions
Topic: Detecting all keys in windowed screen
Replies: 3
Views: 1583

Re: Detecting all keys in windowed screen

For now I have resorted to using KeyboardReleased in combination with KeyboardInkey character-like keys but it means that there can be no key repeat after a key repeat interval, something which almost every normal OS text handling offers. :|

But I'm also worried about the codes themselves. What do ...
by Erich
Tue Feb 20, 2018 10:30 am
Forum: Coding Questions
Topic: Detecting all keys in windowed screen
Replies: 3
Views: 1583

Re: Detecting all keys in windowed screen

Sorry to bump my own thread, but even just knowing that it's not possible would be very useful to me. In my tests, TAB doesn't work at all, and no international characters when the keyboard is set to something else than QWERTY. Normal characters work with the international setting, e.g. German ...
by Erich
Sun Feb 18, 2018 1:48 am
Forum: Coding Questions
Topic: Detecting all keys in windowed screen
Replies: 3
Views: 1583

Detecting all keys in windowed screen

Hi! :D

I need to know whether it's possible to detect all keys that are pressed or released in a screen opened by OpenWindowedScreen, no matter what keyboard layout. Basically I need the same functionality as in a CanvasGadget with keyboard input enabled. This Gadget returns codes like 65362 for ...
by Erich
Thu Jan 14, 2016 9:53 am
Forum: Coding Questions
Topic: PokeQ problem, cannot find the error
Replies: 2
Views: 1016

Re: PokeQ problem, cannot find the error

Demivec wrote:You used the address of your structure and not its field's content.
Oh man, am I stupid! I've looked at it half a dozen times and didn't see that!

Thanks a lot!!! :D
by Erich
Wed Jan 13, 2016 10:30 pm
Forum: Coding Questions
Topic: PokeQ problem, cannot find the error
Replies: 2
Views: 1016

PokeQ problem, cannot find the error

I must have potatoes on my eyes as they say in some countries, because I cannot find the error in the code below. When I run this on my 64bit machine with Unicode enabled, PB 5.41LTS on Linux Mint 17.2, I get

0
Hello world!
Whatever
210453397503

But the numbers should be 42 and 6724, of course ...
by Erich
Wed Jan 06, 2016 11:21 am
Forum: Coding Questions
Topic: How to copy image into memory buffer regardless of encoding?
Replies: 5
Views: 3093

Re: How to copy image into memory buffer regardless of encod

Thanks folks, I've already found a workaround, and will also take a look at citystates method. :D

EncodeImage does not work for me because I don't know the encoding in advance. :?
Can you explain that you don't know the encoding in advance ?
Once an image has been loaded, there is no encoding ...
by Erich
Mon Jan 04, 2016 6:58 pm
Forum: Coding Questions
Topic: How to copy image into memory buffer regardless of encoding?
Replies: 5
Views: 3093

How to copy image into memory buffer regardless of encoding?

I need to get a memory buffer directly from an image, without saving the image to disk in between (would be too slow). Basically, the opposite of CatchImage. EncodeImage does not work for me because I don't know the encoding in advance.

Is there a way to do this for any image encoding on any ...
by Erich
Sat Jan 02, 2016 2:27 pm
Forum: Coding Questions
Topic: how to quickly find index of a word in middle of list
Replies: 19
Views: 3425

Re: how to quickly find index of a word in middle of list

If the list of 10,000 words is fixed in advance, you could create what's called a perfect hash function. This has no collisions at all. Then it all boils down to finding the string search algorithm that is optimal for 1kb strings.
by Erich
Sat Jan 02, 2016 2:01 pm
Forum: Coding Questions
Topic: Counting files in directory
Replies: 13
Views: 3339

Re: Counting files in directory

You might be correct, but I didn't any limits and there are plenty of folders on this disk. :)

Yes, the stack size is fairly large on most systems nowadays. It should be alright as long as you're aware of the limitation. Personally, I avoid recursion in languages with stack limit just to remain ...
by Erich
Fri Jan 01, 2016 2:24 pm
Forum: Coding Questions
Topic: Counting files in directory
Replies: 13
Views: 3339

Re: Counting files in directory

This may help...
Your directory traversal may be slightly faster but it will run out of stack space when there are many nested subdirectories.
by Erich
Fri Jan 01, 2016 1:13 pm
Forum: Coding Questions
Topic: Counting files in directory
Replies: 13
Views: 3339

Re: Counting files in directory

Thanks a lot, folks! I don't know where I got the idea from that there is an API for this on every platform, by now I believe that if there is a cached file count it is probably very filesystem-dependent and not easily accessible.

Here is what I'm using now (partly based on code by someone else ...