Search found 102 matches

by miskox
Wed Jul 23, 2025 4:40 pm
Forum: Game Programming
Topic: Magic 4x4
Replies: 78
Views: 7363

Re: Magic 4x4

Not finished yet. Very addictive.

Image

Maximum of 65536 reached.

Saso
by miskox
Wed Feb 19, 2025 7:01 pm
Forum: Coding Questions
Topic: I'm trying to run commands in the terminal and inject "pressing the R key" automatically, avoiding doing it manually.
Replies: 5
Views: 345

Re: I'm trying to run commands in the terminal and inject "pressing the R key" automatically, avoiding doing it manually

You can try something like this:

Code: Select all

@echo off
echo R|flutter run -d windows
Save this as .cmd/.bat and run from the command prompt to test. Then remove @echo off and change your code.

Saso
by miskox
Wed Jul 10, 2024 2:57 pm
Forum: Coding Questions
Topic: Help converting short p5.js program to Purebasic
Replies: 16
Views: 2547

Re: Help converting short p5.js program to Purebasic



Wouldn't this be faster:

M(x,y)=temp/d/d

No, the opposite.
A division is a lot slower as a multiplication.
If you are aiming for performance, try to avoid the division (and modulo) operator as much as possible.
In this case the M array is only 8x8 so it's not that important but if you would ...
by miskox
Tue Jul 09, 2024 6:22 pm
Forum: Coding Questions
Topic: Help converting short p5.js program to Purebasic
Replies: 16
Views: 2547

Re: Help converting short p5.js program to Purebasic

Just a side question:

Code: Select all

M(x,y)=temp/(d*d)
Wouldn't this be faster:

Code: Select all

M(x,y)=temp/d/d
Saso
by miskox
Sat Jul 06, 2024 8:36 pm
Forum: Coding Questions
Topic: Flush file to disk
Replies: 8
Views: 1631

Re: Flush file to disk

Update:

I did some more checks:

Test code:

EnableExplicit
Define.i counter
UsePNGImageEncoder()
For counter = 1 To 200
If CreateImage(0, 1180, 1650, 24, #White)
SaveImage(0,RSet(Str(counter),3,"0")+".png",#PB_ImagePlugin_PNG)
EndIf
Next counter
End


In compiler options: Windows executable ...
by miskox
Sat Jul 06, 2024 7:35 pm
Forum: Feature Requests and Wishlists
Topic: Week number in a Year
Replies: 3
Views: 1551

Week number in a Year

Date library has this (from the online help):

AddDate
ConvertDate
Date
DateUTC
Day
DayOfWeek
DayOfYear
FormatDate
Hour
Minute
Month
ParseDate
Second
Year

Maybe it would be nice to add a function to return week number in a year.
To also have a function to return working day number in a month/year ...
by miskox
Sat Jul 06, 2024 7:31 pm
Forum: Coding Questions
Topic: Flush file to disk
Replies: 8
Views: 1631

Re: Flush file to disk

Thank you all. It turns out I was too quick. When I ran the program from the IDE I thought that it was already finished but it was not. I am using Total Commander and not Windows Explorer so pressing Refresh slowly showed the files (didn't notice the red X that the program was still executing ...
by miskox
Fri Jul 05, 2024 4:31 pm
Forum: Coding Questions
Topic: Flush file to disk
Replies: 8
Views: 1631

Re: Flush file to disk

Thank you all.

I will use RASHAD's solution.

And to answer RASHAD's question:

You saved the images to where ?

FIles are saved to a folder. Program closes when all .png files are created (files are created in a second (not each file - all of them)) and then I have to wait for the OS to write ...
by miskox
Thu Jul 04, 2024 9:09 pm
Forum: Coding Questions
Topic: Flush file to disk
Replies: 8
Views: 1631

Flush file to disk

Hello all!

I create .png file with CreateImage and at the end I use SaveImage.

Program generates few hundred files in less than a second but then I have to wait for the files to be flushed to disk.

FlushFileBuffers can be used for files but not for images.

I want the program to end when ...
by miskox
Fri May 03, 2024 5:02 pm
Forum: General Discussion
Topic: Pre-occupy file space
Replies: 5
Views: 1128

Re: Pre-occupy file space

FSUTIL can do this. So there must be an API or something... I am not good at finding it.

https://learn.microsoft.com/en-us/windo ... sutil-file

Code: Select all

fsutil file createnew 'file_name' 'length'
Saso
by miskox
Fri May 03, 2024 4:35 pm
Forum: Coding Questions
Topic: Suitable fonts for DrawVectorText()?
Replies: 16
Views: 3707

Re: Suitable fonts for DrawVectorText()?

Just saw this topic and couldn't compile then and then I opened the documentation and it says there that PdfVectorOutput is only available on Linux and Mac. You mention fonts on Windows... so does these examples here work on Windows?

And then I saw that I am still using 6.03. Looks like I have to ...
by miskox
Fri Mar 01, 2024 6:42 pm
Forum: Coding Questions
Topic: Solve 1 Equation with 2 Unknowns
Replies: 23
Views: 3211

Re: Solve 1 Equation with 2 Unknowns

Little John wrote: Fri Mar 01, 2024 8:46 am 1) This equation also can be written like this:

Code: Select all

Y = 653184000 / (X * 499)
Or could be written as this:

Code: Select all

Y=653184000 / 499 / X
No. That's still just one of infinitely many solutions.
No. I think if

Code: Select all

X=0
then there is no solution (for Y=653184000 / 499 / X)

Saso
by miskox
Tue Jan 23, 2024 6:43 pm
Forum: General Discussion
Topic: Windows defender's false positives - again
Replies: 7
Views: 2054

Re: Windows defender's false positives - again

Virus total detects 4 threats: 6731a79a4e119283603a5fd94ab7dadb0e074d85b5b0f6cc09afc4c397f69eb1

Cynet Malicious (score: 100)
Microsoft Trojan:Win32/Wacatac.B!ml
Rising Trojan.Generic@AI.98 (RDML:63I3Nw4o6D3nwi3wUXZjKw)
SecureAge Malicious

It says that it contacts three IP addresses. I just open ...
by miskox
Tue Jan 23, 2024 5:48 pm
Forum: General Discussion
Topic: Windows defender's false positives - again
Replies: 7
Views: 2054

Windows defender's false positives - again

Windows Defender started to detect false positives in .exe files few days ago. Anyone else seen this?

Saso