Search found 2947 matches

by Tourist Trap
Oct 23, 2020 18:41
Forum: Beginners
Topic: Control Slider
Replies: 4
Views: 1130

Re: Control Slider

Can someone help me with this uncertainty ...? Hi Gugutsu, you can easily find many sliders objects in various contexts if you type SLIDER in the search bar. For instance, I grabbed this from Albert that implements many win32 controls by the way: https://www.freebasic.net/forum/viewtopic.php?p=2295...
by Tourist Trap
Oct 23, 2020 16:49
Forum: Beginners
Topic: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13986

Re: [help] converting code from python to FB

But, for the case where the object is already constructed at the provided address, a simple pointer assignment is sufficient: dataset._p2ptr = @pp(0) ( 'dataset._p2ptr = new (@pp(0)) P2' (any)' is more complex but does nothing more) Hi fxm, ANY is mandatory here, otherwise NEW (@pp(0)) P2 clears th...
by Tourist Trap
Oct 23, 2020 16:39
Forum: Community Discussion
Topic: [solved] Simple math question ?
Replies: 10
Views: 1690

Re: [solved] Simple math question ?

That's not as trivial as I thought to visualise this stuff. Maybe by a plot in 3D such similar to as below.
Here is when x = n^2/2
Image
by Tourist Trap
Oct 23, 2020 14:28
Forum: Beginners
Topic: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13986

Re: [help] converting code from python to FB

For me, your code can at first be simply resume to: type P2 declare operator []( byval index As integer ) byref As double as double _d(1 to 2) end type operator P2.[]( byval index As integer ) byref As double return This._d(index) end operator dim as P2 pp(9) for i as integer = 0 to uBound(pp) pp(i...
by Tourist Trap
Oct 23, 2020 13:46
Forum: Community Discussion
Topic: [solved] Simple math question ?
Replies: 10
Views: 1690

Re: Simple math question ?

According to Maxima:
Image

More specifically for your x = 20000000 :
Image
by Tourist Trap
Oct 23, 2020 13:18
Forum: Beginners
Topic: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13986

Re: [help] converting code from python to FB

Ok, but under the hood, we can just use an array of Double (instead of an array of pointer + New/Delete), inducing a structure simpler than above, while keeping the same interfacing for user with square brackets. Thanks. Then I ended mixing the things up a little bit, this way : type P2 declare ope...
by Tourist Trap
Oct 22, 2020 16:41
Forum: Beginners
Topic: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13986

Re: [help] converting code from python to FB

Ok so this below is something that should work to get the square brackets instead of the rounded ones: type P2 declare constructor() declare destructor() declare operator []( byval index As integer ) byref As double as double ptr _dptr(1 to 2) end type constructor P2() this._dptr(1) = new double(1) ...
by Tourist Trap
Oct 22, 2020 15:07
Forum: Beginners
Topic: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13986

Re: [help] converting code from python to FB

hi tourist trap.. added you to the repository as collaborator check your e-mail :) ron77 Done, thanks. I'm right now looking at overloading the operator [ ] from inside a UDT. Maybe it will be the best way to mimic python syntax when passing and using the dataset variable. https://www.freebasic.net...
by Tourist Trap
Oct 22, 2020 14:44
Forum: Beginners
Topic: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13986

Re: [help] converting code from python to FB

ron77 wrote:do you have a github account and if so by what nick name?
Thanks. Then you can find my Github account under the name : @trapmania. Should be still alive.
by Tourist Trap
Oct 22, 2020 14:23
Forum: Beginners
Topic: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13986

Re: [help] converting code from python to FB

hi tourist trap... i've looked at the first draft code i was working on and i will now give here what i think we can extract from the old code to the new... i mean mostly equations function i have already successfully converted to FB... so here is what i got so far: 'fb code ' Calculate the mean va...
by Tourist Trap
Oct 22, 2020 13:49
Forum: Community Discussion
Topic: Introduction to Applied Linear Algebra – free ebook
Replies: 1
Views: 674

Re: Introduction to Applied Linear Algebra – free ebook

I was over at the RaspberryPI forum https://www.raspberrypi.org/forums/viewtopic.php?f=34&t=285336 and found this link http://vmls-book.stanford.edu/ looks interesting Very interesting, it comes with a companion book with examples coded in Python. https://ses.library.usyd.edu.au/bitstream/handl...
by Tourist Trap
Oct 22, 2020 13:39
Forum: Documentation
Topic: Basic-Macros in fbc 1.08
Replies: 61
Views: 13116

Re: Basic-Macros in fbc 1.08

If all class members are the same (and in a macro loop it would be the same) Hi Joshy, thanks. However I want the content to be able to also change when needed. Here is an example where the content changes along with the index. It's with namespaces but it's typically the same kind of issue. So this...
by Tourist Trap
Oct 22, 2020 12:52
Forum: Documentation
Topic: Basic-Macros in fbc 1.08
Replies: 61
Views: 13116

Re: Basic-Macros in fbc 1.08

I'm having a hard time figuring out what you want: - The Type is not declared serially. - A Type is declared once in the loop, with as typename "T" followed by "Asc(end_value)" - The error is that a Type declared in a local scope cannot have a member procedure. Sorry. I can make...
by Tourist Trap
Oct 22, 2020 12:40
Forum: Beginners
Topic: [SOLVED] turning working KNN code into a static library
Replies: 96
Views: 13986

Re: [help] converting code from python to FB

right now i'm only interested in translation the python code into FB and make it work - that's the MAIN GOUL of mine right now and i'm not strict about the ways of how to code it - i'm open to any suggestion or idea - even it i already have a half beaked code if some one or any one comes and says &...