-
Content Count
311 -
Joined
-
Last visited
-
Days Won
1
Posts posted by Serge_G
-
-
2 hours ago, Stano said:no results can be displayed during editing.
2 hours ago, Brian Evans said:FireDac where it accessed by double left clicking or right clicking the component.
I didn't see it was ADOQuery until I zoom picture ! (I don't even understand how we can still use it, but I hate ADO for a long time now) Firedac is my prefered set of database components
- 1
-
-
4 hours ago, PenelopeSkye said:as soon as you close the form the edit box is on after updating it, not the entire app just the form, the text is saved to the database. I have been trying to simply understand how this is happening.
Clearly, you have a Datasource component with property AutoEdit set to True. So, when you change cuurent record, close table, etc. value of TDBEdit is "saved"
4 hours ago, PenelopeSkye said:I seriously doubt that this is enough info for anyone to go on, would you let me know what else you need?
Yes, but I have a crystal ball
4 hours ago, PenelopeSkye said:I have been requested to find out the user who is updating certain of those fields on the form.
The BeforePost event if you want to update the table i.e
procedure tb_dm_presentation_design_linksBeforePost(DataSet: TDataSet); begin tb_dm_presentation_design_links.FieldByName('LAST_UPDATE').asDateTime:=now; tb_dm_presentation_design_links.FieldByName('LAST_USER').asString:=mygetuserfunction; end;
The AfterPost event if you record changes in another table (using an insert Query)
procedure tb_dm_presentation_design_linksAfterPost(DataSet: TDataSet); begin // anAdoQuery.SQL.Text:='INSERT INTO TRACKS (USER,DATE_UPDATE) VALUES (:U,:D)'; // sorry not sure of syntax I am not fan of ADO anAdoQuery.Params.ParambyName('U').asString:=mygetuserfunction; anAdoQuery.Params.ParambyName('U').asDateTime:=now; anAdoQuery.ExecSQL; end;
Now if you want to track only a set of columns, BeforePost is the event where you can check CurValue and NewValue (well with ADO I am not sure).
if tb_dm_presentation_design_linkscust_upc.curvalue.asString<>tb_dm_presentation_design_linkscust_upc.Newvalue.asString then // insert query
N.B. Know that SGBDR (good ones) triggers can track this for you without Delphi code. But this SGBD you use, my crystal ball, don't show me🔮
P.S. As I remember, but never in more than 20 years, there is also an OnChange event for fields (if fields are defined, and that seems to be the fact tb_dm_presentation_design_linkscust_upc)
-
19 hours ago, Henry Olive said:If i uncheck TCP/IPv6 ( Just TCP/IPv4 checked ) then i cannot connect My App
Not really related to the question! Check in the file firebird.conf if IPv6V6Only is not set to 1 (around line 712)
Check also AuthServer and AuthClient values (chapter around line 397)
To have IP_V4 only I Found this explanation
QuoteThe systemd configuration files for firebird, firebird-classic@.service & firebird-classic.socket are located in /usr/lib/systemd/system.
#cat firebird-classic.socket
[Unit]
Description=Firebird Classic Activation Socket
[Socket]
ListenStream=3050
I changed the ListenStream to
ListenStream=0.0.0.0:3050
and restarted the service and now firebird is listening on 0.0.0.0:3050 and not :::3050, which means it is listening on IPV4 protocol.
But, systemd configuration files ⁉️ I don't think you will find them (this explanation was for CENTOS 7)
I don't think changing the RemoteServicePort value to 0.0.0.0:3050 (around line 667) should be a good idea, (idea I can't check), but you can have a try
Now, according to this https://www.firebirdsql.org/file/documentation/html/en/firebirddocs/isql/firebird-isql.html#isql-connect-connection-string-url
QuoteTCP/IP (first tries to connect using the IPv6 protocol, if it fails, then IPv4)
So if you use INET4 to connect to your database instead of INET you will certainly have IP_V4 address in your MON$ATTACHMENTS table.
How ? Certainly 2 ways
- modifying firebird.conf RemoteBindAddress (around line 725) setting it to INET4 but this should be restricting I think- by delphi code at connexion (depending on components used)
-
Hi,
You can backup your database even if there are users connected ("warm backup")
On 5/16/2022 at 2:27 PM, Henry Olive said:BackUp File's size same as actual database
Is that normal ( No compress ) ?
Yes
-
-
Reflexion 1- as I remember , FreeReport is an ancestor or fork of FastReport
Reflexion 2- BDE can still be installed (you have to download it from your registered product panel
-
16 hours ago, vfbb said:My Ubuntu is 20.04 too (although it should work on 18.04 too)
Hi, I report my success on my full Ubuntu PC upgraded to Ubuntu 20.4
I failed installation of 20.4 for WSL (not installation but XFCE4 don't work fine, no terminal !)
So I will still investigate about 18.04 version failure.
- 1
-
Hi Vincent,
Well I test with WSL and a full Ubuntu PC but always with 18.04,
12 hours ago, Vincent Gsell said:I had trouble on linux side - lib load issue
Have this one now !
12 hours ago, Vincent Gsell said:I remove completely older version of skia
I just done the update via getit in 3.40
I use the GitHub SKIA version installer (not the getit one).
OK so, next step for me : installing Ubuntu 20.04 (it's time 😉) first on my WSL.
- 1
-
Hi,
Freanch Delphi Entreprise 11.1 (patch 1 now) and Ubuntu 18.04 is my target.
19 hours ago, vfbb said:if you can run a blank fmx app on your Ubuntu,
Well, it's not a blank one (only a SkiaLabel added), I'll investigate further for this zlib1g-dev and test a blank project in debug mode.
Thanks
- 1
-
Hi,
Change the "Windows 10 Desktop" style to "Default". The best way to do that is to remove "Default" style and then rename "Windows 10 Desktop" to blank
-
Hi,
It worked as expected on Android, but I can't test on Ubuntu
I first have a problem of a lacking package I think it was zlib1g-dev, I install this one.But, if now I can deploy my project or the demo the program don't run. What did I miss ? Is there any doc/help for a "good" deployment ?
-
6 hours ago, sjordi said:Thanks Mr ListView specialist
Not so, but I try to be 😉
6 hours ago, sjordi said:Still in Arles here!
And did you finally find the Arlésienne
6 hours ago, sjordi said:I checked your demos and found a lot of ListView customization,
Yes, I don't remember where I was confronted to that checkbox. I think it was a question in www.developpez.net/forums and don't report it to my blog
6 hours ago, sjordi said:but didn't find one that check/unchecks when only the checkmark is clicked
Ah finally, I see where https://www.developpez.net/forums/blogs/138527-sergiomaster/b8177/fmx-selection-delements-tlistview/ I.3 part
The mayor part is here, but I skipped the OnclickEx part (sorry)
-
Ha, sorry to miss this one yesterday (still in Yeu).
I wrote something like that in my blog, in a tutorial or in a response in a forum, I don't remember exactly where, only the image I used for demo.
But, as I remember, I don't use positions but the ItemObject name
-
-
Hi
2 hours ago, Henry Olive said:CAST((10.00000 / 0.3048) * 14.7776 as NUMERIC (18,2))
Some useless .00000 here !
You have to learn about how Firebird do the job with scales don't remember where I read this in doc, but you can see here some instructions
So if you use the SQL you have, before casting, a 13 scaled variable !
SELECT CAST(10 / 0.3048* 14.7776 AS NUMERIC(13,2)) FROM RDB$DATABASE
This work also
-
Well, your SQL is the first and easy way to get the line with Firebird < 3.0
With Firebird 3+ perhaps a windows analytical function can be used
WITH C AS (SELECT CUSTNO,LAST(TDATE) OVER (ORDER BY TDATE) D FROM MYTABLE WHERE CUSTNO=:CUSTNO ) SELECT M.TDATE,M.AA,M.BB FROM MYTABLE M LEFT JOIN C ON C.CUSTNO=M.CUSTNO AND M.TDATE=C.D
But IMO, advantage is null, and if you have more than one line with CUSTNO,TDATE identical you will get more than one line
-
QuoteTools→ Options→ User interface → Form Designer → Device Manager
Or you can edit
DevicePresets.xml file
inC:\Users\<user_name>\AppData\Roaming\Embarcadero\BDS\22.0
But I think you have to restart your IDE to have changes applied
-
You're welcome
-
Not tested on 11.1 yet butI wrote this unit (for FMX)unit ImageUtils; interface uses System.SysUtils, System.UITypes, System.UIConsts , System.Math, System.Classes, FMX.Types, FMX.Graphics, FMX.Utils; type Talgorithm = (algnone,algluminosity,algaverage,alglightness, alpow); function ConvertToGrayscale(const aBitmap: TBitmap; const aMethod : TAlgorithm=algnone) : TBitmap; overload; function ConvertToGrayscale(const FileName : String; const aMethod : TAlgorithm=algnone) : TBitmap; overload; function ConvertToGrayscale(const aStream : TMemoryStream ; const aMethod : TAlgorithm=algnone) : TBitmap; overload; implementation function Colortogray(const aColor : Talphacolor; const aAlgo : TAlgorithm=algnone) : Talphacolor; var H,S,L : Single; C : TAlphacolorRec; gris : Integer; // https://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/ begin c.Color:=acolor; case aAlgo of algluminosity: gris:=Round((0.2126*c.R) + (0.7152*c.G) + (0.0722*C.B)); algaverage: gris := (c.R + c.G + c.B) div 3; alglightness: gris:=Round((maxvalue([TAlphacolorRec(aColor).R,TAlphacolorRec(aColor).G,TAlphacolorRec(aColor).B]) + minvalue([TAlphacolorRec(aColor).R,TAlphacolorRec(aColor).G,TAlphacolorRec(aColor).B])) / 2); alpow : gris:=round(power(( 0.2126*power(c.R,2.2)+0.7152*power(c.G,2.2)+0.0722*power(c.B,2.2)),1/2.2) ); else begin RGBToHSL(aColor,H,S,L); Exit(HSLtoRGB(0,0, L)); end; end; exit(Makecolor(gris,gris,gris)); end; function ConvertToGrayscale(const aBitmap: TBitmap; const aMethod : TAlgorithm=algnone): TBitmap; var X, Y: Integer; bd1, bd2: TBitmapData; p1, p2: PAlphaColorArray; begin Result := TBitmap.Create(Round(aBitmap.Width), Round(aBitmap.Height)); if (aBitmap.Map(TMapAccess.Read, bd1) and Result.Map(TMapAccess.Write, bd2)) then begin try for Y := 0 to (aBitmap.Height - 1) do begin p1 := PAlphaColorArray(bd1.GetScanline(Y)); p2 := PAlphaColorArray(bd2.GetScanline(Y)); for X := 0 to (aBitmap.Width - 1) do begin p2[X] := Colortogray(p1[X],aMethod); end; end; finally aBitmap.Unmap(bd1); Result.Unmap(bd2); end; end; end; function ConvertToGrayscale(const FileName : String; const aMethod : TAlgorithm=algnone): TBitmap; var X, Y: Integer; bd1 : TBitmapData; p1 : PAlphaColorArray; begin if not FileExists(FileName) then exit(nil); result:=TBitmap.CreateFromFile(FileName); if Result.Map(TMapAccess.ReadWrite, bd1) then begin try for Y := 0 to (Result.Height - 1) do begin p1 := PAlphaColorArray(bd1.GetScanline(Y)); for X := 0 to (Result.Width - 1) do begin p1[X] := Colortogray(p1[X],aMethod); end; end; finally Result.Unmap(bd1); end; end; end; function ConvertToGrayscale(const aStream : TMemoryStream ; const aMethod : TAlgorithm=algnone) : TBitmap; overload; var X, Y: Integer; bd1 : TBitmapData; p1 : PAlphaColorArray; begin if aStream.Size=0 then Exit(nil); aStream.Position:=0; result:=TBitmap.CreateFromStream(AStream); if Result.Map(TMapAccess.ReadWrite, bd1) then begin try for Y := 0 to (Result.Height - 1) do begin p1 := PAlphaColorArray(bd1.GetScanline(Y)); for X := 0 to (Result.Width - 1) do begin p1[X] := Colortogray(p1[X],aMethod); end; end; finally Result.Unmap(bd1); end; end; end; end.
as a quick test, left number is speed, effet is using Monochrome effect instead of function
try with TmonochromeEffect.Create(nil) do try ProcessEffect(nil,aBitmap, 0); finally Free; end; image6.Bitmap:=abitmap; finally aBitmap.Free; watch.Stop; lblEffet.Text:='Effet '+Watch.ElapsedMilliseconds.ToString; end;
-
Hum, take care, install is a bit buggy if you don't use the "standard" install path for Delphi
https://quality.embarcadero.com/browse/RSP-36785
installed you have to install the package dclbde280.bpl in the C:\Program Files (x86)\Embarcadero\Studio\22.0\bin
-
Forgot this one, better IMHO, for Firebird<3 using a CTE and JOIN
WITH c as (Select count(1) nb from appose) select c.nb,t.* from c full join appose t on 1=1
-
First what a strange query, a count without Grouping clause !
Try this (before fb 3, solution). Really disliking this "subselect" !
SELECT (SELECT COUNT(1) FROM ATABLE) AS TOT,DOCNO,DOCTYPE FROM ATABLE
Or use a window (analytical) function (here SUM(1) OVER () is the window function)
(Wow now FB3+ have analytical functions 😲)SELECT SUM(1) OVER () FULLCOUNT, DOCNO,DOCTYPE from ATABLE
- 1
-
FB-3 SELECT WHERE
in Databases
Posted · Edited by Serge_G
Hi,
- what is this X.INVRNO ? Your test table only contains INVNO column !
- use DateAdd Firebird function to compute your old date parameter
or
I am not fan of sub-querys I should certainly prefer a Delphi Code based (we are in a Delphi forum 😉) and a Firedac query with parameters and macro (for the in clause)
Ok, I change position of the IN clause to easily clear the clause but, you can modify SQL text to
* "inmacro" can be computed by a format,