Search found 2947 matches

by Tourist Trap
Oct 22, 2020 12:07
Forum: Beginners
Topic: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13942

Re: [help] converting code from python to FB

hi Tourist Trap... as for the datasets i have been given an OOP code that loads the data in CVS files... Ok. That's great job. But it won't help dealing with translating the Python code. Once we have this first one in freebasic form, dealing with the CSV is something else. Of course we could do all...
by Tourist Trap
Oct 22, 2020 11:00
Forum: Beginners
Topic: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13942

Re: [help] converting code from python to FB

So first thing first. The program starts here: 'python dataset = [[1, 1], [2, 3], [4, 3], [3, 2], [5, 5]] If we want to keep it close to Python we can translate to this: 'base 0 array assumed #define definedataset(rowcount, init...) dim datasetdefined(rowcount - 1 ,1) as double = init #define datase...
by Tourist Trap
Oct 22, 2020 9:52
Forum: Documentation
Topic: Basic-Macros in fbc 1.08
Replies: 61
Views: 13101

Re: Basic-Macros in fbc 1.08

Hello, I read the whole topic and didn't find if we can now ask a macro to remove a loop in this kind of cases where we are declaring a UDT serially: #macro LoopBuildT(n) for i as integer = 1 to n type T##n declare constructor() as integer fi end type next i #endMacro LoopBuildT(5) 'C:\Program Files...
by Tourist Trap
Oct 21, 2020 13:49
Forum: Beginners
Topic: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13942

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: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13942

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: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13942

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: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13942

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:53
Forum: General
Topic: paper backup
Replies: 3
Views: 647

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: 37
Views: 7147

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: 926

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: 5
Views: 1628

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: 2241

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: 2241

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: 2241

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://*.*" ...