-
Content Count
332 -
Joined
-
Last visited
-
Days Won
5
Everything posted by John Kouraklis
-
You can also create a FormBase, add the stylebook and then inherit all other forms from this one.
-
How to manage Active Directory and Other User Directories
John Kouraklis posted a topic in General Help
Hi people, I'd like some help about user management servers and how they are used in apps. This is a general question that applies to getting access to users either via Active Directory or FB contacts or Google contacts, etc. Say I have a connection to FB or to active Directory and people login in my app using FB or AD credentials. Now, all my users exist on FB or on AD In my app, users do stuff and therefore I need to keep some data as well. So, this means I need to replicate and keep a sunchronised copy of the user database. Is this how it should work? What's the common practice here? Thanks -
How to iterate a TDictionary using RTTI and TValue
John Kouraklis replied to John Kouraklis's topic in Delphi IDE and APIs
Thanks Remy--Always good to learn -
How to iterate a TDictionary using RTTI and TValue
John Kouraklis replied to John Kouraklis's topic in Delphi IDE and APIs
Remy, thanks for the explanation and for sharing your knowledge π. I admit that even if I had gone all the way down to retrieve the enumerators I would never have thought to Invoke them. I use 10.3.3 and the first instance of TKey in System.Generics.Collections is this: ------> This is line 748 (*$HPPEMIT END OPENNAMESPACE*) (*$HPPEMIT END ' template<typename TKey, typename TValue>'*) (*$HPPEMIT END ' inline __fastcall TPair__2<TKey, TValue>::TPair__2(const TKey AKey, const TValue AValue) :'*) (*$HPPEMIT END ' Key(AKey), Value(AValue)'*) (*$HPPEMIT END ' {}'*) (*$HPPEMIT END CLOSENAMESPACE*) [HPPGEN(HPPGenAttribute.mkNonPackage)] TPair<TKey,TValue> = record Key: TKey; Value: TValue; constructor Create(const AKey: TKey; const AValue: TValue); end; // Hash table using linear probing TDictionary<TKey,TValue> = class(TEnumerable<TPair<TKey,TValue>>) private type TItem = record HashCode: Integer; Key: TKey; Value: TValue; end; TItemArray = array of TItem; -
How to iterate a TDictionary using RTTI and TValue
John Kouraklis replied to John Kouraklis's topic in Delphi IDE and APIs
@Remy Lebeau Wow....Amazing and complicated stuff. So I really need to drill down to the enumerator to get hold of the pairs. Thanks a lot for this!!! You mentioned that it might be unreliable to do this with generics. Do you think the app may crash for more complex dictionaries? Because it doesn't exist. For a dictionary, TKey and TValue are Generic parameters of the TDictionary class. They are not standalone concrete types, like you are thinking of. And out of curiosity, how does the compiler recognise TKey then? It must be from the HPPEMIT directive, right? -
How to iterate a TDictionary using RTTI and TValue
John Kouraklis replied to John Kouraklis's topic in Delphi IDE and APIs
The whole code is part of a serialiser, so the dictionary type is unknown to the RTTI code. In the code above, I replaced TKey with string because I couldn't find the declaration of TKey. -
How to iterate a TDictionary using RTTI and TValue
John Kouraklis replied to John Kouraklis's topic in Delphi IDE and APIs
Ok, now the more important problem as stated in the beginning. In this code, genDict throws an exception although propValue is correct program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.Generics.Collections, System.Rtti; type TObjDic = TObjectDictionary<string, string>; TMClass = class private fMC: TObjDic; public constructor Create; destructor Destroy; override; property MC: TObjDic read fMC write fMC; end; constructor TMClass.Create; begin inherited; fMC:=TObjDic.create; end; destructor TMClass.Destroy; begin fMC.Free; inherited; end; var mc: TMClass; ctx: TRttiContext; rType: TRttiType; rProp: TRttiProperty; propValue: TValue; genDict: TObjectDictionary<string, TValue>; begin mc:=TMClass.Create; rType := ctx.GetType(mc.ClassInfo); rProp:=rType.GetProperty('MC'); // In this code, this may seem redundant but I use this code is part of // bigger codebase propValue:=rProp.GetValue(mc); genDict:=nil; genDict:=propvalue.AsObject as TObjectDictionary<string, TValue>; if Assigned(genDict) then begin for var str in genDict.Keys do begin // For demo var f:=str; end; genDict.Free; end; mc.Free; end. -
How to iterate a TDictionary using RTTI and TValue
John Kouraklis replied to John Kouraklis's topic in Delphi IDE and APIs
I found out that TKey in my code is declared (for unexplained reasons) in Data.DBXCommon with is irrelevant. Maybe that is the cause of the AVs I get. But now I don't seem to be able to declare TKey as data type although I include System.Generics.Collections. How do I declare it in a unit? It is originally declared using $HPPEMIT (Generics.Collections, line 750) -
How to iterate a TDictionary using RTTI and TValue
John Kouraklis replied to John Kouraklis's topic in Delphi IDE and APIs
Hi Remy, I tried that (.AsType....) before as well; I run to the same problem of using TKey which is an abstract class although I can see in the debugger that the object points to the content of the dictionary.] -
Amazing! Do you use any libraries on FMX for the GUI? Looks very responsive
-
LiveBindings and evaluating logical expressions
John Kouraklis posted a topic in RTL and Delphi Object Pascal
Hi all, I am fiddling with LiveBindings Expression engine and I know how to evaluate expressions, use objects, add custom functions. What I am struggling though is to evaluate logical expressions. For example this type: (3=5) and 8 Anyone knows how to do this? Thanks -
LiveBindings and evaluating logical expressions
John Kouraklis replied to John Kouraklis's topic in RTL and Delphi Object Pascal
@ErikB Hi Erik, just saw your reply. I will have a look at the link; thanks. Yes; I remember. It was a pleasure meeting you. Regards John -
Advertising supported delphi desktop application
John Kouraklis replied to Yaron's topic in General Help
I researched a lot this because I wanted to include ads in my desktop app as well. The bottom line is that all the content publishers support only mobile apps. I have seen the link you give before but I am unclear as to whether it works. I doubt TBH. Google ads does not allow desktop apps indeed and they ban your account even if you "fake" a website withing a browser component. I have a app on my desktop (TuneIn) that shows ads from google. In earlier versions, they were using Taboola but now they moved to Google Ads. When I was reaching out people from the ad networks, they all told me that the app is using a few google accounts and cycles them so detection is avoided. They also said that eventually google will figure it. If you download the app, you can click and drag and select all the components in the window; pretty much what you do in a web page. This makes me think that the app is written with some sort of web framework and is mocking a website and thus the ads show normally. One of those people I talked to said that in general revenue from ads in desktop apps is extremely low which in practice makes it a worthless choice unless you have 4-5 million downloads. He suggested to consider other forms of licensing, like freemium, etc. -
Hi all, diving into the world of microservices in Delphi. Here we go: www.kouraklis.com/2020/01/microservices-in-delphi-part-1/ Thanks
-
Pimlico: Microservices in Delphi - Part 1
John Kouraklis replied to John Kouraklis's topic in I made this
Friends also give the option to friends to use or not Synchronize π -
Hi, I had icons assigned to one of my projects and now all of the sudden delphi doesn't use them. Instead, when the FMX app runs I see the generic icon from windows. When I go to App Options, my icons appear there. Then, I click on Default, the icons change in the Options dialog but again not used when I execute the app I get the generic icon again. I've checked the .dprog file and deleted the entries with icons and reassigned them in the IDE. Sadly I can't seem to be able to assign icons to the app.
-
Hi, I would like to show some ads in an FMX application. I checked TBannerAd but it seems to work only on Android and iOS. I'd like to show ads on Win and Mac as well. What are the options? Has anyone used TBannerAd? What's the experience? I tried to run the demo that comes with Delphi but in complains that "Java class JAdSize could not be found". I am trying it on Android Nouget. Thanks
-
Hi again, anyone might have a fresh piece of advice to share since I posted it? Thanks
-
By any chance, does anyone know how to restore windows store? I had this idea to get rid of all the unnecessary apps that come with windows and I removed them and windows store from Win 10 via PowerShell. Now, Windows consumes 100% CPU and I can see that processes like wsappx and the like get stuck so I assume that totally removing windows store is not a good idea at all. I tried to reinstall it via PowerShell, Creator Disk to fix Windows Installation and other methods but no luck at all. Before I do a clean installation maybe someone has a tip on this? Thanks
-
@Kas Ob. Yeah...there must be something seriously wrong. I tried the app you sent but it says that win store repair is disabled because win store frequent changes I then downloaded an updated win store repair wizard I found online and it is asking me to login to my email account. But when I try to add an email account the popup window shuts down. So the whole installation is damaged. I will not avoid a clean install. The only thing I am bored of is the installation of all delphi packages Gkrrr....10.4 is far, right π
-
Neither sfc nor dism fixed anything although they said they completed successfully. wsreset sadly fails. I've tried many times before. It says "You'll need a new app to open this ms-window-store link" That's why I believe I need a fresh installation
-
@Kas Ob. I think I tried DISM before but I get some errors saying that the manifest files are not correct. I will try sfc Thanks
-
Well, the experiment was 1 year ago and I recently concluded that this must be the reason windows eat CPU load.... Sadly, no backups are avail.
-
Apple Pay / Google Pay - get card token for PayLane
John Kouraklis replied to a topic in Cross-platform
I have the impression that you can get the tokens from paylane. Other APIs have an endpoint. Maybe you can ask them -
Apple Pay / Google Pay - get card token for PayLane
John Kouraklis replied to a topic in Cross-platform
@TomDevOps Have a look at the parts about tokens in this guide: https://epayments-api.developer-ingenico.com/c2sapi/v1/en_US/index.html?paymentPlatform=ALL Maybe it helps