Search found 155 matches

by kvitaliy
Thu Nov 18, 2021 10:10 am
Forum: Tricks 'n' Tips
Topic: Uniformly distributed random permutations
Replies: 11
Views: 5118

Re: Uniformly distributed random permutations

RandomizeArray gives a similar result:

Code: Select all

;-- Demo
Define ret$, i, n=4

Dim a(n-1)
For i = 0 To n-1
   a(i) = i
Next

;Shuffle(a())
RandomizeArray(a())

ret$ = Str(a(0))
For i = 1 To n-1
   ret$ + "," + Str(a(i))
Next
Debug ret$
by kvitaliy
Fri Oct 23, 2020 8:17 am
Forum: Off Topic
Topic: Speed of Basic
Replies: 5
Views: 3452

Re: Speed of Basic

little ARM computer
ARM computer costing over $ 100!
480 Mgz offer us in 2020 :D

Compare the Meizu M8c smartphone with 2GB RAM and 16GB ROM, Snapdragon 425 processor and 5.45 '' HD + display.
Snapdragon 425, it uses 8 processor cores with a clock speed of no more than 1400 MHz .
For photo and ...
by kvitaliy
Fri Oct 16, 2020 11:11 am
Forum: Tricks 'n' Tips
Topic: Time when the file was compiled
Replies: 6
Views: 2554

Re: Time when the file was compiled

BarryG wrote:Is this reliable? Both files below exist on my PC but look at the return values. One is all zeros, and the other is in the future (year 2022)
There is no guarantee for other files.
But you will definitely define the files compiled by PureBasic!
by kvitaliy
Fri Oct 16, 2020 7:19 am
Forum: Tricks 'n' Tips
Topic: Time when the file was compiled
Replies: 6
Views: 2554

Time when the file was compiled

There are no checks For the validity of the exe file!

Procedure.s Time_Date_Stamp(FileExe.s)
If ReadFile(0, FileExe)
FileSeek(0,60) ; IMAGE_NT_SIGNATURE
FileSeek(0,ReadCharacter(0)+8) ; TimeDateStamp
ProcedureReturn FormatDate("%dd/%mm/%yyyy %hh:%ii:%ss",ReadLong(0)) + " (GMT)"
EndIf ...
by kvitaliy
Fri Oct 02, 2020 12:49 pm
Forum: Tricks 'n' Tips
Topic: Does a string contain only alphabetical characters?
Replies: 8
Views: 3045

Re: Does a string contain only alphabetical characters?

Marc56us wrote:The RegEx version
Excellent! It also works in Russian.
1 - qwertyйцукенQWERTYЙЦУКЕН
by kvitaliy
Tue Sep 29, 2020 7:34 pm
Forum: Tricks 'n' Tips
Topic: Does a string contain only alphabetical characters?
Replies: 8
Views: 3045

Re: Does a string contain only alphabetical characters?

Are there only English strings?

Code: Select all

a$ = "Anfängerfragen" ; German
Debug "String "+ a$ + " returns " + IsStrAlpha(@a$)

a$="expérience " ; French
Debug "String "+ a$ + " returns " + IsStrAlpha(@a$)
by kvitaliy
Mon Sep 07, 2020 6:31 pm
Forum: Tricks 'n' Tips
Topic: Self Virus Check / Exec Alteration
Replies: 20
Views: 7374

Re: Self Virus Check / Exec Alteration

J. Baker wrote:As Paul pointed out in another post (different topic), a "=" or "<>" can easily be changed in a hex editor, etc.
The virus will not use hex editor, and will not change "=" to "<>" :lol:
A hacker will crack any code if needed.
by kvitaliy
Mon Sep 07, 2020 5:22 pm
Forum: Tricks 'n' Tips
Topic: Self Virus Check / Exec Alteration
Replies: 20
Views: 7374

Re: Self Virus Check / Exec Alteration


Well, if I put that text file in the Linker and try to create executable, I get the message :
POLINK Fatal Error : File not found 'szFullPath.s=ProgramFilename()'.
So, what am I doing wrong then ?

Thanks.
The text file must contain 1 line:
/RELEASE

And you must embed this code into your program ...
by kvitaliy
Sat Sep 05, 2020 6:22 pm
Forum: Tricks 'n' Tips
Topic: Self Virus Check / Exec Alteration
Replies: 20
Views: 7374

Re: Self Virus Check / Exec Alteration

Standard way for Windows using the API MapFileAndCheckSum
Protection will work even if you change 1 bit!

szFullPath.s=ProgramFilename()
dwFileChecksum.l = 0: dwRealChecksum.l = 0
sz.s = "Hello" ; replace at least 1 character in EXE
MapFileAndCheckSum_(@szFullPath, @dwFileChecksum, @dwRealChecksum ...
by kvitaliy
Wed Nov 27, 2019 12:03 pm
Forum: Tricks 'n' Tips
Topic: NVIDIA Management Library (NVML) and PureBasic
Replies: 9
Views: 3610

Re: NVIDIA Management Library (NVML) and PureBasic

CELTIC88 wrote:i have temperature 55 c ? it's normal?
GeForce GTX 1080
idle temperature = 42
permissible temperature = 60-84
maximum temperature = 94
by kvitaliy
Wed Nov 27, 2019 11:37 am
Forum: Tricks 'n' Tips
Topic: NVIDIA Management Library (NVML) and PureBasic
Replies: 9
Views: 3610

Re: NVIDIA Management Library (NVML) and PureBasic

infratec wrote:Have you download the dll :?:
The runtime version of NVML ships with the NVIDIA display driver,
usually in "C:\Program Files\NVIDIA Corporation\NVSMI\nvml.dll"
by kvitaliy
Wed Nov 27, 2019 11:33 am
Forum: Tricks 'n' Tips
Topic: NVIDIA Management Library (NVML) and PureBasic
Replies: 9
Views: 3610

Re: NVIDIA Management Library (NVML) and PureBasic

CELTIC88 wrote:interesting
i have an error
PureBasic compiler x64?
check GPU_count, GPU_Handle values.
by kvitaliy
Wed Nov 27, 2019 10:26 am
Forum: Tricks 'n' Tips
Topic: NVIDIA Management Library (NVML) and PureBasic
Replies: 9
Views: 3610

NVIDIA Management Library (NVML) and PureBasic

A C-based API for monitoring and managing various states of the NVIDIA GPU devices. It provides a direct access to the queries and commands exposed via nvidia-smi. The runtime version of NVML ships with the NVIDIA display driver, and the SDK provides the appropriate header, stub libraries and sample ...
by kvitaliy
Thu Aug 01, 2019 4:05 am
Forum: Announcement
Topic: [ENGINE] 2D Engine Nautilus (Win x86 & x64)
Replies: 48
Views: 26736

Re: [ENGINE] 2D Engine Nautilus (Win)

Mijikai wrote:Version 1.00 :)

Finally :D
No link to the final version?
by kvitaliy
Tue Apr 23, 2019 4:29 am
Forum: Applications - Feedback and Discussion
Topic: Module: Automatic image upload to ImgBB.com
Replies: 5
Views: 5688

Re: Module: Automatic image upload to ImgBB.com

Works great!
Thanks for sharing!