Search found 2900 matches

by Tourist Trap
Oct 21, 2020 13:49
Forum: Beginners
Topic: [help] converting code from python to FB
Replies: 12
Views: 116

Re: [help] converting a functions from python to FB

like i keep saying any help will be greatly appreciated Hi, If it will be only about simple linear regression, you'll find good examples from dodicat (and maybe others) from this forum, done so in Freebasic. Myself I did this this way : 'linear regression UDT #include "fbgfx.bi" const as ...
by Tourist Trap
Oct 21, 2020 13:37
Forum: Beginners
Topic: [help] converting code from python to FB
Replies: 12
Views: 116

Re: [help] converting a functions from python to FB

i thank you gentlemen for your kind help Hi ron77, maybe you can tell us what exactly you try to implement. It may exist a basic version of your python program, or at least a C version. Python has very hi-level syntax (hidding all the real work under the hood) that makes it difficult to translate q...
by Tourist Trap
Oct 21, 2020 13:20
Forum: Beginners
Topic: [help] converting code from python to FB
Replies: 12
Views: 116

Re: [help] converting a function from python to FB

how do i continue? From my part, I don't understand why you replace your DATASET, that looks to be a matrix, by simply one 1-D array of X, and one 1-D array of Y. But I may be missing something? The most difficult stuff will be to convert the for...next loops of python in FB ones. Passing the funct...
by Tourist Trap
Oct 21, 2020 12:45
Forum: Beginners
Topic: [help] converting code from python to FB
Replies: 12
Views: 116

Re: [help] converting a function from python to FB

hello :-/ can you pass on a function as a parameter of another function in FB? Hi ron77. Answer is yes, as a pointer like in: https://www.freebasic.net/wiki/ProPgProcedurePointers In your example however, you will have to specify fully the signature of the "algorithm" function : algorithm...
by Tourist Trap
Oct 20, 2020 17:58
Forum: Tips and Tricks
Topic: The beauty / magic of math
Replies: 5
Views: 187

Re: The beauty / magic of math

Banana is math :)
by Tourist Trap
Oct 20, 2020 17:53
Forum: General
Topic: paper backup
Replies: 3
Views: 101

Re: paper backup

it took like a dozen tries with different settings but it works! :-) Funny stuff :) By the way I played half a summer with Ollydbg (years ago), trying to figure out how the score system in Restaurant Empire worked up. I failed for the most part, but it was a very interesting to play with this disas...
by Tourist Trap
Oct 18, 2020 14:09
Forum: Windows
Topic: Simple tutorial to create first Windows applications
Replies: 7
Views: 569

Re: Simple tutorial to create first Windows applications

jj2007 wrote:Btw which common controls version do you see? I get 6.16.

Just for info it's 5.82 here. Works fine whatever.
by Tourist Trap
Oct 18, 2020 9:54
Forum: Beginners
Topic: Path set with Setenviron() is temporary?
Replies: 4
Views: 173

Path set with Setenviron() is temporary?

Hi, I need to set some environnement path on win10. I'm not very comfortable at this kind of stuff. For this reason I would have a few questions: So first, if I use SetEnviron (https://www.freebasic.net/wiki/KeyPgSetenviron), will the new environnement variable be just temporary (and if so when will...
by Tourist Trap
Sep 20, 2020 18:38
Forum: Documentation
Topic: threadcreate()
Replies: 6
Views: 340

Re: threadcreate()

Hi, From my side, as far as I can read the doc, it seems quite clear to me. Even more if I take a look at the provided examples. They don't take a lot of care of the additionnal arguments coming after the @proc argument. In those examples those are either a 0 pointer, or just nothing... Sub mythread...
by Tourist Trap
Sep 20, 2020 17:38
Forum: General
Topic: Sorting Dir() result by date-time attribute
Replies: 18
Views: 386

Re: Sorting Dir() result by date-time attribute

The case is that I need a cross-platform safe way to list files (only the name + extension) sorted by date whether ascendent or descendent In this case it should be easy, since batch stuff on linux is far more convenient than on windows. I don't use linux however. You can use a preprocessor test to...
by Tourist Trap
Sep 20, 2020 14:11
Forum: General
Topic: Sorting Dir() result by date-time attribute
Replies: 18
Views: 386

Re: Sorting Dir() result by date-time attribute

In Windows I use this batch file which I call with SHELL and let me save the listing in a file in disk sorted by creation date @echo off setlocal set cnt=0 for /f "delims=" %%A in ('DIR %1 /B /L /O:-D /T:C %2') do ( echo %%A set /a "cnt+=1, 1/(cnt%%%3)" 2>nul || goto :break ) :b...
by Tourist Trap
Sep 20, 2020 12:40
Forum: General
Topic: Sorting Dir() result by date-time attribute
Replies: 18
Views: 386

Re: Sorting Dir() result by date-time attribute

Does anybody know a decent way to display the files correctly? I struggled also. Couldn't find the print using option to write a 0 when needed, so had to tweak everything by hand: #include "windows.bi" #include "crt/stdlib.bi" dim as const string searchDir = "C://*.*" ...
by Tourist Trap
Sep 20, 2020 10:26
Forum: General
Topic: Sorting Dir() result by date-time attribute
Replies: 18
Views: 386

Re: Sorting Dir() result by date-time attribute

The FILETIME member is already in the good numeric form? Welllllll... it's a QWORD. No problem in Assembly, but I can't speak for FB. It resembles vaguely a double, you could try that road ;-) QWORD seems to be a kind of 64bits storage in 4 (quad) parts holding 16bits. I'll take a look at it. About...
by Tourist Trap
Sep 20, 2020 9:45
Forum: General
Topic: Sorting Dir() result by date-time attribute
Replies: 18
Views: 386

Re: Sorting Dir() result by date-time attribute

With *.bas from my FB folder, I get a crash (FB GAS, also Gcc32). It runs fine with FB64, though. Thanks for pointing this out, I guess I've missed some cast between long and integer somewhere. - I used FB64. Besides, I wonder if wDayOfWeek will give you the desired result: that is 0=Sunday, 1=Mond...
by Tourist Trap
Sep 20, 2020 8:43
Forum: General
Topic: Sorting Dir() result by date-time attribute
Replies: 18
Views: 386

Re: Sorting Dir() result by date-time attribute

So you missed the most exciting part ;-) When it comes to Quicksort I leave it to dodicat :) edit: Ok you are right jj2007, job is unfinished so in an ultimate effort here is my try with the crt QSort in continuation of my previous snippet: #include "windows.bi" #include "crt/stdlib....

Go to advanced search