Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: how to change the color font and background of a button
« Last post by cdbc on Today at 12:02:27 pm »
Hi
To add to @KodeZwerg's statement above, here's a screenshot of an app under development, where all the buttons are made with TPanels...
As a bonus i've attached the source aswell  :D
Regards Benny
2
Hello,

Thank you for the response. I have updated the code and you'll find the screenshot attached. In my program, the font can be chosen by the user. In the pictures above, I used Arial as well.

Regarding setting the line distance, you can use TextMultiline function and specify the paragraph spacing. However this is applied when encountering end of line characters, not when the text is over the width of the rectangle and wraps. I've added an example in the code above.
That's already good! Would it also be possible to measure the height of such a TextBox created with Multiline?

Otherwise a feature to specify line spacing in general could be added.
That would be great! Especially if it would be possible to set the line distance and paragraph distance separately.
3
My guess is that the correct fix is the following:

Code: Pascal  [Select][+][-]
  1.     function RoundExDouble(x: Double): Double;
  2.     begin
  3.       x := x * 10; // in two steps to call the proper Ceil(double) overload
  4.       Result := Ceil(x) / 10;
  5.     end;

A cleaner approach would be to stay away from "currency" here, which is confusing, and works by chance.
4
Graphics / Re: STARS and Regular POLYGONS: Zorder type bug!
« Last post by KodeZwerg on Today at 11:13:35 am »
I have not downloaded your source, just watched images, this would be my way to control the drawing including z-order:
As always I would draw internal on a TBitmap :-D
Offer to set background color somewhere.
Offer to choose (inner/outer) color somewhere.
Offer to choose element style (star/polygon/whatever) somewhere.
Realize drawing by using an array of TShapes, the index will be than the z-order.
That way you could add drag/drop support for elements or tweak the z-order by moving the indexes.
Finally draw the array to TBitmap and assign it to whatever control you are painting onto.
5
General / Re: Free AI to use in local
« Last post by Thaddy on Today at 11:05:25 am »
BTW I am willing to share my code, but that is basically the same as one of schuler's examples. The data would be useless to others because it is trained based on data for my particular household.
OTOH I'll see if I can create some examples for fuzzy logic. That is much less data intensive and a good introduction to a form of AI that many people can start using right away.
scores:
cat                100% out of 1
me                100% out of 1
dogs               90% out of 2
female voices   88% out of 3

rates                92.0% from about 350 samples times 7.
Raw sample data at 48000 hz is about 2GB
4096 point fft's on the raw data makes up the rest.
The fft's are the data for the model, but it should be possible to train the model on the raw data at the cost of quite a lot more samples and longer processing time. have not tried that yet.
6
General / Re: Free AI to use in local
« Last post by cdbc on Today at 10:57:46 am »
Hi
There's this https://github.com/PassByYou888/Z-AI1.4
You'll have to translate texts from chinese, but afaics it's written in Delphi...
Maybe, just maybe it could be something to work with...
The Author was on this forum once to announce it, one could probably contact him/her, I dunno...
Regards Benny
7
General / Re: Free AI to use in local
« Last post by Thaddy on Today at 10:55:29 am »
Hi,

@BSaidus

First, you need to define what type of AI you want to use.
Correct
Quote
If you're thinking of creating a system comparable to ChatGPT, then you're going to need a big computer, with one or more NVIDIA power cards, lots of memory and hard disk, and a lot of free time to train your model, not to mention data collection.
You greatly under-estimate the hardware requirements here.
Quote
Training a model from a dataset can take hours or even days.
years. but the better part of data collection can be automated.
Quote
Most AI programs are written in Python and call libraries written in C and C++, and are more suited to the Linux world
You mean python is used as an interface? I have done the same for chatGPT, remember.
That is not written in python... interfacing can be done in any lightweight language. True AI can not be written in python, it simply does not have the speed or capabilities.
Quote
The only 2 exceptions, as far as I know, are schuler's CAI, written in Pascal and allowing graphics acceleration thanks to OpenCL and Darknet/Yolo (specialized in fast object detection)
there are many more using opencl, I know of hundreds, many on github.
Quote
So, I advise first, if you want to use the Pascal, to take a look at the excellent work of Joao-Paulo Schuler (CAI) and try his examples.
I could not agree more AND you would be capable of achieving professional results, because that is professionaly written top notch code.
Quote
Now, it is also possible to create a GUI in Pascal for an existing AI program and call it from the GUI.

I did it for Yolo/Darknet.

But the first thing to do is to define what your AI is going to be used for.

B->
Nice!
8
General / Re: how to change the color font and background of a button
« Last post by KodeZwerg on Today at 10:54:26 am »
As an alternate approach that does not need to install any third party you can tweak a panel in whatever way you like to simulate a button.
(OnClick would be just one of the events, OnEnter OnExit OnMouseEnter OnMouseLeave to show some hover over effect)
It would need some time to figure out all the possibilities but once mastered its quit a cool replacement.
9
LCL / Re: Using KeyPress event, how to get subsequent key presses?
« Last post by KodeZwerg on Today at 10:44:31 am »
I also suggest KeyUp event for logging a released key, if its just pure character keys you are hunting at, eg for some undo, you could also use OnChange from TMemo by logging position and the change, ie insert/remove/replace action ...
10
General / Re: Free AI to use in local
« Last post by Dzandaa on Today at 10:40:01 am »
Hi,

@BSaidus

First, you need to define what type of AI you want to use.

If you're thinking of creating a system comparable to ChatGPT, then you're going to need a big computer, with one or more NVIDIA power cards, lots of memory and hard disk, and a lot of free time to train your model, not to mention data collection.

Training a model from a dataset can take hours or even days.

Most AI programs are written in Python and call libraries written in C and C++, and are more suited to the Linux world

The only 2 exceptions, as far as I know, are schuler's CAI, written in Pascal and allowing graphics acceleration thanks to OpenCL and Darknet/Yolo (specialized in fast object detection)

So, I advise first, if you want to use the Pascal, to take a look at the excellent work of Joao-Paulo Schuler (CAI) and try his examples.

Now, it is also possible to create a GUI in Pascal for an existing AI program and call it from the GUI.

I did it for Yolo/Darknet.

But the first thing to do is to define what your AI is going to be used for.

B->

Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018