Noutați

Flexible Multi-Tenancy REST Support Demo For RAD Server In Delphi

It requires InterBase to be installed on the machine or to connect to a remote server. Make sure that the server is running before you run the sample application. With Multi-Tenancy support, a single RAD Server instance with a single RAD Server database connection can support multiple isolated tenants. Each tenant has a unique set of RAD Server resources including Users, Groups, Installations, Edge Modules, and other data. All tenants have custom resources that are installed in the EMS Server. Also, as an administrator you can create new tenants, edit existing ones, add, edit, or delete details of your tenants, specify if the tenant is active, and delete the tenants that you do not need. Location You can find the RAD Server Overview Multi-tenant sample project at: Start | Programs | Embarcadero RAD Studio Sydney | Samples and then navigate to the following: Object PascalDataBaseEMSMulti-Tenancy Demo Subversion Repository: You can find Delphi code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version. Overview This sample application demonstrates RAD Server’s Multi-Tenancy support. RAD Server Overview is a turn-key application foundation for rapidly building and deploying services based applications. RAD Server enables developers to quickly build new application back-ends or migrate existing Delphi or C++ client/server business logic to a modern services based architecture that is open, stateless, secure and scalable. A single RAD Server Overview instance with a single RAD Server database connection can support multiple isolated tenants. This demo uses a chain of toy stores to highlight RAD Server’s multi-tenancy support where each store with its employees and goods is a tenant implementation. Using the RAD Server Multi-Tenant Application The sample application demonstrates a retail store deployment use case. Each store with its employees and goods is a tenant implementation. Employees There are two groups of users with different rights: Managers can add new store items, delete them, and edit the details of the existing ones while cashiers can only view the information about the existing goods. Neither employee can see the information about the other stores in the chain.   Description Now, let us have a look at the sample application. Store Log in Page To access store specific information, enter the following information on the Store Log in page: Toy Store: select a store from the list. Each store is a tenant implementation. Store password: enter the password. Tip: You can find credentials in the Readme.txt file provided with the sample application. Employee Log in Page On the Employee Log in page, each employee enters the following: Employee login Employee password Tip: You can find credentials in the Readme.txt file provided with the sample application. Store Items Page After logging in, each employee sees the store items screen. The screen is displayed in two different modes: edit or view only, and access depends on the employee’s position. This uses EMS groups (a feature of RAD Server) to define access rights. Managers can view, add, and delete the store items and edit the details. Cashiers can view the items’ details only. Please follow the link to the original post for more information: http://docwiki.embarcadero.com/CodeExamples/Sydney/en/EMS.Sample_RAD_Server_Multi-Tenant_Application Check out the full source code for the Multi-Tenancy REST Demo over on GitHub.

Read More

Learn How To Use Python Functions With Keyword Arguments In A Delphi Windows App

rocedure TForm1.Button1Click(Sender: TObject); var   P : Variant; begin   PythonEngine1.ExecStrings( Memo1.Lines );   P := MainModule.Person(‘John’, ‘Doe’);   Assert(P.first_name = ‘John’);   Assert(P.last_name = ‘Doe’);   Assert(VarIsNone(P.weight));   Assert(VarIsNone(P.height));   Assert(VarIsNone(P.age));   P := MainModule.Person(‘John’, ‘Doe’, weight := 70);   Assert(P.first_name = ‘John’);   Assert(P.last_name = ‘Doe’);   Assert(P.weight = 70);   Assert(VarIsNone(P.height));   Assert(VarIsNone(P.age));   P := MainModule.Person(‘John’, ‘Doe’, weight := 70, height := 172);   Assert(P.first_name = ‘John’);   Assert(P.last_name = ‘Doe’);   Assert(P.weight = 70);   Assert(P.height = 172);   Assert(VarIsNone(P.age));   P := MainModule.Person(‘John’, ‘Doe’, weight := 70, height := 172, age := 35);   Assert(P.first_name = ‘John’);   Assert(P.last_name = ‘Doe’);   Assert(P.weight = 70);   Assert(P.height = 172);   Assert(P.age = 35);   P := MainModule.Person(last_name := ‘Doe’, first_name := ‘John’, weight := 70, height := 172, age := 35);   Assert(P.first_name = ‘John’);   Assert(P.last_name = ‘Doe’);   Assert(P.weight = 70);   Assert(P.height = 172);   Assert(P.age = 35);   P := MainModule.Person(‘John’, ‘Doe’, 35, 172, 70);   Assert(P.first_name = ‘John’);   Assert(P.last_name = ‘Doe’);   Assert(P.weight = 70);   Assert(P.height = 172);   Assert(P.age = 35);   Memo2.Lines.Add(‘Success’) end;

Read More

Learn How To Solve The C++ SFINAE Problem For Expressions In Windows Development With C++ Builder

Substitution failure is not an error (SFINAE) refers to a situation in C++ where an invalid substitution of template parameters is not in itself an error. We’re talking here about something related to templates, template substitution rules and metaprogramming… A quick example: template struct A {}; char xxx(int); char xxx(float); template A f(T){} int main() { f(1); }   template <int I> struct A {};     char xxx(int);   char xxx(float);     template <class T> A<sizeof(xxx((T)0))> f(T){}     int main()   {     f(1);   } This example is rejected by all major compilers because template deduction/substitution has historically used a simplified model of semantic checking, i.e., the SFINAE rules (which are mostly about types), instead of full semantic checking. But in C++ 11, fully general expressions allowed, and that most errors in such expressions be treated as SFINAE failures rather than errors. There’s a continuum of errors, some errors being clearly SFINAE failures, and some clearly “real” errors, with lots of unclear cases in between. We decided it’s easier to write the definition by listing the errors that are not treated as SFINAE failures, and the list we came up with is as follows: errors that occur while processing some entity external to the expression, e.g., an instantiation of a template or the generation of the definition of an implicitly-declared copy constructor. errors due to implementation limits (it’s probably a category error to list these here, since they’re not errors in the normal sense, but we wanted to make it very clear that compilers don’t have to take steps to capture and recover from violations of implementation limits; such violations cause hard errors, compiler crashes, etc., the same as anywhere else in a program). errors due to access violations (this is a judgment call, but the philosophy of access has always been that it doesn’t affect visibility)Everything else produces a SFINAE failure rather than a hard error. At certain points in the template argument deduction process it is is necessary to take a function type that makes use of template parameters and replace those template parameters with the corresponding template arguments. This is done at the beginning of template argument deduction when any explicitly specified template arguments are substituted into the function type, and again at the end of template argument deduction when any template arguments that were deduced or obtained from default arguments are substituted. The substitution occurs in all types and expressions that are used in the function type and in template parameter declarations. The expressions include not only constant expressions such as those that appear in array bounds or as nontype template arguments but also general expressions (i.e., non-constant expressions) inside sizeof, decltype, and other contexts that allow non-constant expressions. [Note: The equivalent substitution in exception specifications is done only when the function is instantiated, at which point a program is ill-formed if the substitution results in an invalid type or expression.] For example, template auto f(T t1, T t2) -> decltype(t1 + t2); template <class T> auto f(T t1, T t2) -> decltype(t1 + t2); Head over and check out more information about SFINAE problems for expressions in Windows Development.

Read More

TMS WEB Core v1.6 beta in a nutshell (video)

Yesterday we announced the beta release for TMS WEB Core v1.6 Pesaro. Before moving to a final release of TMS WEB Core v1.6.0.0, we want to give our registered TMS ALL-ACCESS and TMS WEB Core users sufficient time to test the new version. Registered users can find the beta download now on the “My Products” page on our website. This beta version can be used from Delphi XE7 to Delphi 10.4 Sydney as well as Lazarus 2.0.10. At the same time our team is also working on bringing the pas2js v2.0 compiler to TMS WEB Core for Visual Studio Code. The stunning new pas2js v2.0 features are not only coming in Delphi but also in Visual Studio Code. Watch our colleague Holger Flick show the use of generics in a TMS WEB Core application in an internal beta of TMS WEB Core for Visual Studio Code that will soon also be coming to you. Dali’s words: “Have no fear of perfection, you will never reach it” are the motivating force and inspiration behind everything we do. So, here we literally follow up the video about generics in TMS WEB Core with code improvement suggestions that bring it one step closer to perfection: enumerators. Stay tuned for more updates!

Read More

TMS WEB Core v1.6 beta brings the pas2js v2.0 quantum leap

The past couple of months and especially weeks have been a nerve-racking ride! Nerve-racking because the scope of introducing the new pas2js v2.0 compiler in TMS WEB Core is huge. Our code library that works with TMS WEB Core and the pas2js compiler meanwhile got huge, so there is a lot of testing and polishing involved to ensure everything continues to work smoothly with the new compiler. But also nerve-racking because the new compiler offers so many exciting features we are eager to take advantage of.But well, we think we have reached the level of stability where we can offer a beta release for our TMS WEB Core users that should work smooth out of the box and ready to take advantage of the new amazing features! The new pas2js v2.0 compiler is nothing short of amazing and a quantum leap forward for Object Pascal developers to tackle the most challenging rich web client application developments! And it is not just the compiler itself, it is of course also the supporting RTL for features such as generics. What an honor and experience to work so closely together with the two masterminds of the project Mattias Gaertner and Michael Van Canneyt to bring TMS WEB Core with pas2js v2.0 to life. The list of new features in the pas2js v2.0 compiler is long and can be consulted in detail here but let me highlight the major new capabilities: Generics Attributes Class constructors Resource strings Async procedure decorator Await support JavaScript promises support Best of all, we expect the introduction of this huge step forward to be smooth. All our demos for example continue to work without changing any line of code. Unless you did perhaps very specific things directly with underlying JavaScript objects or event handlers, the new version should be fully backwards compatible. Before moving to a final release of TMS WEB Core v1.6.0.0, we want to give you, users of TMS ALL-ACCESS or TMS WEB Core sufficient time to test the new version, give your feedback, address issues in case these would arise. You can find the beta download now on the “My Products” page on your account on our website. This beta version can be used from Delphi XE7 to Delphi 10.4 Sydney as well as Lazarus 2.0.10. At the same time our team is feverishly working on bringing the pas2js v2.0 compiler also to TMS WEB Core for Visual Studio Code. The challenge is even bigger here as we need to test and validate everything on 3 different operating systems as you can use TMS WEB Core for Visual Studio Code directly on Windows, macOS and Linux to build Object Pascal based web client applications. Expect also here that a beta will follow shortly! Oh, and by the way, TMS WEB Core v1.6 will be get the name Pesaro. Pesaro is the town along the legendary Mille Miglia 1955 race after Rimini that was the name of version v1.5. So, our race with TMS WEB Core enjoys the beautiful scenery of Pesaro.

Read More

GXT 4.0.4 Patch Release is Available

December 8, 2020 | Kirti Joshi The Sencha team would like to announce the availability of GXT 4.0.4 software patch release for our customers on maintenance. This release addresses more than a dozen customer reported tickets spanning improvements in the grid component, layout, selection, and more. Review the full list in our GXT 4.0.4 Release Notes and download this latest release from the Sencha support portal. If you have any questions, get in touch with our support team.    Developing Apps in Java?   Then GXT might be the right choice for you! GXT is a comprehensive Java framework for building web apps using Google Web Toolkit. Easily write code in Java and compile it into highly optimized HTML5 code. Try GXT for Free The fully featured GXT is available for you to try for 30-days, free of charge! See how the complete library of 140+ UI components can speed your development cycles! Download GXT 30-day free trial

Read More

A Peek at the Many New and Exciting Data Grid Features in Ext JS 7.4

The entire Sencha team is hard at work getting Ext JS 7.4 release complete and in your hands. We plan to have this out pretty soon, but wanted to take this opportunity to provide you with the details of the several new features (yes, there are many, and you won’t be disappointed!) that the release brings.*Please note that features are not committed until completed and GA released.* So here we go … Ext JS 7.4 includes new Data Grid features and addresses some solid improvements and enhancements to both Classic and Modern Toolkits. Multi-level Grouping Group data on multiple levels with the advanced Multi-Grouping feature. Easily add one or more desired fields to the group and the Grid Panel can display the data based on that grouping. Here is an example of a header menu that allows users to change grouping on the fly. Multi-level Grouping for Ext JS Classic Toolkit   Multi-level Grouping for Ext JS Modern Toolkit   Grouping Panel The Grouping Panel allows users to drag-and-drop the desired columns to the grouping panel section. Use this feature to quickly perform operations such as sort, remove, move or change the order of the grouped fields. Grouping Panel for Ext JS Classic Toolkit   Grouping Panel for Ext JS Modern Toolkit   Summaries for Grid Groups and Total The new Grid Summary feature will allow users to define functions for aggregation such as Sum, Min, Max, Average, Count, and more for each column. The feature also allows users to set the position of the group summary for easy viewing.Available for Classic and Modern Toolkit   Filterbar We are adding a new docked bar under the grid headers which will allow the filtered fields and configurations for each column to be easily viewable. The feature will be present in both toolkits. New KitchenSink Examples We’ll be adding new Grid examples to demonstrate how to configure and use the cool new Grid features in Ext JS 7.4. Coming soon! Other Enhancements Ext JS 7.4 will address over a dozen other enhancements and improvements that will benefit all our users. We know you are eagerly waiting to try out these new enhancements. Our team is working hard to get these coveted Grid features to you.*Please note that features are not committed until completed and GA released.*Stay tuned for release updates coming soon! New Data Grid Examples In the meantime, check out this brand new collection of interactive Grid examples and see how you could use them to enhance your application. Grid Classic Examples                         Grid Modern Examples If you haven’t already, check out the performant Ext JS Grid in action with this Interactive Grid Performance Analyzer Haven’t tried Ext JS Data Grid yet? Try a 30-day free trial of Ext JS and check out the power and scalability of the Ext JS Grid for yourself. Ext JS trial is available via public npm or through an easy zip download. Get started and build your first app in 3 easy steps. Download Ext JS 30-day free trialGet a snapshot of the Grid FeaturesExplore More Learning Materials Lock in Your 7.4 Presale Discount Time is ticking, don’t wait to grab your presale discount. Contact your account manager to unlock you discount or get […]

Read More

Easily Use A Popular Python Image Library In A Delphi Windows GUI App

procedure TForm1.Button2Click(Sender: TObject); var   _im : Variant;   _stream : TMemoryStream;   _dib : Variant;   pargs: PPyObject;   presult :PPyObject;   P : PAnsiChar;   Len : NativeInt; begin   if (Image1.Picture.Graphic = nil) or Image1.Picture.Graphic.Empty then     raise Exception.Create(‘You must first select an image’);   PythonEngine1.ExecStrings(Memo1.Lines);   _im := MainModule.ProcessImage(ImageToPyBytes(Image1.Picture.Graphic));   if not chkUseDC.Checked then   begin     // We have to call PyString_AsStringAndSize because the image may contain zeros     with GetPythonEngine do begin       pargs := MakePyTuple([ExtractPythonObjectFrom(_im)]);       try         presult := PyEval_CallObjectWithKeywords(             ExtractPythonObjectFrom(MainModule.ImageToBytes), pargs, nil);         try           if (P = nil) or (PyBytes_AsStringAndSize(presult, P, Len) 0) then begin             ShowMessage(‘This does not work and needs fixing’);             Abort;           end;         finally           Py_XDECREF(pResult);         end;       finally         Py_DECREF(pargs);       end;     end;       _stream := TMemoryStream.Create();     try       _stream.Write(P^, Len);       _stream.Position := 0;       Image1.Picture.Graphic.LoadFromStream(_stream);     finally       _stream.Free;     end;   end   else   begin     Image1.Picture.Bitmap.SetSize(Image1.Width, Image1.Height);     _dib := Import(‘PIL.ImageWin’).Dib(_im);     Image1.Picture.Bitmap.SetSize(Image1.Height, Image1.Width);     _dib.expose(NativeInt(Image1.Picture.Bitmap.Canvas.Handle));   end; end;

Read More

Stunning Cross-Platform FireMonkey App Profile Templates Available For Android And iOS From GetIt

This FireMonkey UI template includes three different designs for implementing an app profile screen in a multi-device application. As you can see, these are the app profile Delphi/C++ Builder FireMonkey samples. From these sample app profile demos, you can learn how to design and build beautiful responsive FireMonkey applications by just dragging and dropping the components. Sample features Available on Delphi and C++ Builder TFrame TLayout TRectangle  and other components You can download these samples from GetIt Package Manager Also, be sure to check out other FireMonkey and VCL sample applications on GetIt

Read More

Delphi and C++Builder 10.4.2 Beta Invite for Update Subscription Customers

We are pleased to invite all of our RAD Studio customers with an active subscription to the NDA beta program for Embarcadero’s 10.4.2 release of Delphi, C++Builder, and RAD Studio, codenamed “Hunter”. RAD Studio 10.4.2 builds on the great features introduced in RAD Studio 10.4 and 10.4.1, and adds new features and enhancements throughout the product.  To learn more about the capabilities we have planned for the 10.4.2 release, please refer to the RAD Studio November 2020 Roadmap PM Commentary blog post (please note that features mentioned in the blog post are not committed until completed and GA released). After you have joined the beta, you will receive additional documentation detailing the features of each beta build. How to join:  To participate in the beta, please provide your name and the email address associated with your Update Subscription (the email you used to register the product) using this form by Tuesday, December 15, 2020. Once you’ve provided your email address, you will receive a follow-up email in the second half of December with a link to electronically sign the Hunter Beta NDA. After signing the NDA, you will be provided with the information needed to participate in the 10.4.2 beta. Please note that 10.4.2 beta builds cannot be installed on the same machine as your current 10.4 or 10.4.1 Sydney installation (also, we generally recommend against installing beta versions on a production machine).   Not current on subscription but interested in joining the 10.4.2 beta? Contact your Embarcadero sales representative or reseller partner to renew your subscription and be invited to join the beta program. 

Read More