Noutați

Is WebAssembly really faster than JavaScript? A hands-on experiment!

WebAssembly is a low-level language with a compact binary format that runs with near-native performance. Free Pascal offers, since some time, a way to compile Pascal to WebAssembly and integrate these modules inside your web applications. So, of course we had to experiment with it, to see if it lives up to the hype. It is important to know that, while WebAssembly is fast and very compact, it is very low level. WebAssembly has no direct connection to the browser DOM and communication between JavaScript and WebAssembly is limited to arrays of bytes, integer and float values. Fortunately, you can allocate memory for the WebAssembly module and use this to read/write more complex data. But all the interfacing that is needed for this (and for accessing the DOM) is something that you’ll need to write yourself.  Image Processing For our experiment we’ve created an image processing application as this typically involves heavy data processing. You can watch a live demo of the application here. You can upload an image and use different filters on it. You can use the toggle switch to choose between pure JavaScript or WebAssembly to process the image and see for yourself how much faster WebAssembly is.  The first test only took the processing of the image in account, and not the reading & writing of data. As you can see in the graph, in this test, WebAssembly is about 3 times as fast.  For the second test, we timed the full function. This included writing and reading from WebAssembly. And even then, WebAssembly is about 1.5 times faster than JavaScript.  Conclusion JavaScript is much slower than WebAssembly when processing of large amounts of data is involved. For small tasks, JavaScript might still be the way to go, as the difference is neglectable. For resource-intensive tasks, like video editing and advanced image processing,  WebAssembly is the way to go. These tasks require a lot of computing and that is where WebAssembly shines, performing at near native speed.  Source code You can download the demo project source code here. This includes the TMS WEB Core web client application as well as the source code of the Pascal based image processing to be compiled to a WebAssembly module. We have shipped a pre-compiled WebAssembly file in the project so that you don’t have to compile it yourself. But if you want to compile or write your own WebAssembly modules you’ll need to install the FPC team Object Pascal to WebAssembly compiler. You can find the installation guide for the compiler here.  

Read More

Create React App: It’s Not As Difficult As You Think

Developers often find creating React apps difficult due to a vast array of build tools along with a ton of configuration files and dependencies. React is a JavaScript library established by Facebook that is frequently referred to as a frontend JavaScript framework. In addition to this, it is a tool for creating user interface components. It is fascinating because instead of directly altering the browser’s DOM, React constructs a virtual DOM in memory and performs all necessary manipulations there before modifying the browser DOM. However, one disadvantage of working with React is that it lacks pre-built components. As a result, React developers must either create these components from scratch or rely on the community. One of the hassle-free ways to deal with the issues underlying React is to use Facebook’s command-line tool: create React app. But if you are in the search of a perfect solution to all of React’s problems, you are in the right place. Sencha’s GRUI is a revolutionary tool that features high performance bundled with 100+ data grid features that ensure faster creation of data-intensive web applications. Whether you are a complete newbie or a seasoned developer, GRUI by Sencha is going to be the only tool you’ll ever need to succeed in creating React apps. Read on to find out more about create React app, GRUI by Sencha, and what makes it the ideal companion for React developers. What is Create React App? Setting up build tools like Babel and Webpack is required while creating a React application. Because React’s JSX syntax is a language that the browser doesn’t comprehend, certain build tools are necessary. That’s where create React app comes in, it helps you create applications that are compliant and supported by React framework. The beauty of this tool lies in the fact that it allows you to focus all of your energy on building apps rather than on building configurations. This results in increased productivity and saves developers from needless hassle. How to Get Started with Building Your GRUI App? Building apps on GRUI by Sencha is a breeze. There is no need for additional plugins and Sencha’s GRUI integrates seamlessly within your existing framework. This process can be easily categorized into 5 small steps. npx create-react-app –template minimal my-app Run cd my-app Run npm add @sencha/sencha-grid Building your own component by loading up the pre-generated app component and replacing its app source with: import React from “react”;import { SenchaGrid, Column } from “@sencha/sencha-grid”;import “@sencha/sencha-grid/dist/themes/grui.css”; export default class App extends React.Component {render() {const data = [{ col1: “value1”, col2: “data1”, col3: 1.01 },{ col1: “value2”, col2: “data2”, col3: 1.02 },{ col1: “value3”, col2: “data3”, col3: 1.03 },]; return ();}} Initiating the app by running: npm startSetting license by visiting GRUI and finally adding:SenchaGrid.setLicense(“”) How Convenient is It to Create a Column Editor in Sencha’s GRUI? Sencha’s GRUI is a high-performance react grid for react applications that makes it dead easy to create a column editor. In addition to this, it features extensive documentation which makes it a child’s play to diagnose and troubleshoot problems during installation or integration.  In order to create a column editor you have to type in the following React typescript: /*** 1. Define the imports*/import React, { Component } from “react”;import EditorProps from “../EditorProps”;import IEditor from “./IEditor”; /*** 2. […]

Read More

Enterprise Ready React Data Grid | GRUI by Sencha

React is a popular open-source JavaScript library that allows you to build complex UIs using a component model. Those components are expressed using JSX, a React extension to JavaScript language syntax that helps structure component rendering using a familiar syntax. Fig. 1 Example Sencha grid using JSX Figure 1 is an example of a Sencha Grid for React being defined using JSX on the left.On the right, you see the rendered output of that JSX. It is a complex data grid that includes several columns, groupings, filtering, sorting, and various other features. Let us try and understand them in more detail. 1. What is Sencha’s Grid for React (GRUI)? What is new in the 1.1 release? In 2021, Sencha released version 1.0 of “Sencha Grid for React” (also called GRUI). It has all the power and capabilities of Sencha’s Ext Grid but has been rebuilt from the ground up. GRUI’s modernized code base is optimized for a very small footprint so that applications load quickly and seamlessly fit in with the rest of the npm React ecosystem; essentially, you install and get going. The idea was to make it as easy as possible to integrate Grid into your React applications. No other plugins or configuration were to be required. In the short amount of time since GRUI’s initial release, a lot of feedback has come in from our customers and early adopters. Hence, we released the second version of GRUI (version 1.1) with additional features. This release includes Tree Grid, a powerful grid capability that allows you to display hierarchical data. GRUI 1.1 can handle grouping, sorting, and filtering and has all the other Tree Grid capabilities that you have come to expect from the Ext version of the Sencha Grid. GRUI 1.1 also includes: locking grid, spreadsheet selection model, multi-level grouping, and several other filters and features. Additionally, an out-of-the-box Dark Theme is available with GRUI 1.1. 2. What is a typical React application with GRUI? Let’s learn more about GRUI by building a realistic React application. This simple example uses: Material UI, a very popular open-source component library for React FusionCharts, a commercial enterprise charting library GRUI, a commercial enterprise-grade data grid Fig.2 Example Sencha GRUI for REACT As shown in the above figure (Fig. 2), on the left-hand side we have the “VS” code, and on the right-hand side we have the sample application running in the browser. The stack used for building this application is: React 18 Material UI 5 FusionCharts and GRUI Grid 1.1 Fig. 3 – Example of FusionCharts integration to sample React Application Fig. 4 – Example of Tree Grid’s integration to sample React application 3. How can I recreate the sample? To briefly introduce the sample application, we created a simplified layout using Material UI with a tab panel. This includes: Big Data – a big-data grid from a Storybook example FusionCharts – example of a standard FusionCharts visualization Tree Grid + FusionCharts – Tree Grid integrated with FusionCharts and having them interact with each other Grid Flow Graph – a simpler grid with an interesting custom-column component that has a simple chart for each row Get access to an on-demand video for a step-by-step guide on how to create a complex React application here:SenchaCon 2022: Sencha’s Grid for Enterprise React Applications […]

Read More

How To Make A State-Of-The-Art Deep Learning App With Fastai

Did you know it’s easy to make use of some truly excellent Python libraries to super-charge your Delphi app development on Windows? Adding Python to your toolbox of Delphi code can enhance your app development, bringing in new capabilities which help you provide innovative and powerful solutions to your app’s users, which combine the best of Python with the supreme low-code and unparalleled power of native Windows development you get with Delphi. Are you looking for how to build a GUI for a powerful AI library? You can build a state-of-the-art deep learning solution with fastai on Delphi. This post will show you how to build a Delphi GUI app, dedicated to the fastai library. Watch this video by Jim McKeeth, as a comprehensive introduction about why you can love both Delphi and Python at the same time:   What is the fastai library? fastai is a deep learning library that provides practitioners with high-level components that can quickly and easily provide state-of-the-art results in standard deep learning domains and provides researchers with low-level components that can be mixed and matched to build new approaches. It aims to do both things without substantial compromises in ease of use, flexibility, or performance. fastai includes: A new type dispatch system for Python along with a semantic type hierarchy for tensors A GPU-optimized computer vision library that can be extended in pure Python An optimizer which refactors out the common functionality of modern optimizers into two basic pieces, allowing optimization algorithms to be implemented in 4–5 lines of code A novel 2-way callback system that can access any part of the data, model, or optimizer and change it at any point during training A new data block API And much more… And the best of it is, fastai is organized around two main design goals: to be approachable and rapidly productive, while also being deeply hackable and configurable. fastai is built on top of a hierarchy of lower-level APIs which provide composable building blocks. This way, a user wanting to rewrite part of the high-level API or add particular behavior to suit their needs does not have to learn how to use the lowest level. Hierarchy of fastai APIs.   How do I install the fastai Library? You can easily install fastai with pip: Or, if you are using Anaconda Python distribution, you can use this command to avoid complexities and conflicts between required libraries: conda install -c fastai -c pytorch -c anaconda -c conda-forge fastai gh anaconda conda install –c fastai –c pytorch –c anaconda –c conda–forge fastai gh anaconda   How do I build a Delphi GUI for the fastai library? The following is the user interface structure for our project: User interface structure for our fastai4D project. Here is the list of Components used in the fastai4D demo app: TPythonEngine TPythonModule TPythonType TPythonVersions TPythonGUIInputOutput TForm TMemo TOpenDialog TSaveDialog TSplitter TImage TPanel TLabel TComboBox TButton Navigate to the UnitFastai4D.pas, and add the following line to the FormCreate, to load our basic fastaiApp.py: Memo1.Lines.LoadFromFile(ExtractFilePath(ParamStr(0)) + ‘fastaiApp.py’); Memo1.Lines.LoadFromFile(ExtractFilePath(ParamStr(0)) + ‘fastaiApp.py’); You can seamlessly load the fastai app python file inside the UnitFastai4D.pas file. And make sure that the fastaiApp.py is in the same directory as our Fastai4D.exe or inside your Delphi project folder. You can change the “fastaiApp.py” with any fastai script you […]

Read More

Unity 2022.1 Tech Stream is now available

Your team’s needs are unique, and we want to give you an extensible Editor that can flex to your workflows, so everyone can work faster together. UI Toolkit is a unified solution for both authoring runtime UI and extending the Editor with custom tools. In 2022.1, we’ve added even more features for tool developers looking to customize the Editor for their teams with UI widgets and custom shapes. We’ve also added the TreeView with multi-column support, new vector drawing APIs to customize the UI element appearance, and we’re progressively making Property Drawers and Property Attributes available, starting with the most commonly used. Connect with us in the forums and let us know how we can help make UI Toolkit even better for you.   We’ve heard you tell us how important Splines are in our forums, and it’s one of the most requested features on our public roadmap.  “I have been researching spline tools… but I don’t know if any of them will provide exactly the functionality that I need and it would become quite costly to buy a bunch just to experiment. So a good built-in spline tool is incredibly important to my project.” In this release, a new Spline authoring framework is available as a package. It’s designed to create and manipulate Splines in-engine, above all by letting programmers extend functionality with tools and custom components such as instantiating geometry and moving along a Spline. It can also work alongside the new Edit modes, and edit Spline points and tangents using the standard editing tools and shortcuts. Keep letting us know what you think in our forums, and see what’s next on the roadmap. We’ve also improved the procedural creation of materials. For creators using code to generate materials, we extended the Material API to all material properties, now supporting keyword states, HDRP’s diffusion profiles and IES lights, enhancing procedural material usage in-Editor or at runtime. Finally, we’ve added a new API for Unity File System, enabling you to create tools for Asset Bundle visualization and analysis that help your team optimize performance. 

Read More

Skia4Delphi GUI Beauty Contest

TL;DR: Make a cool demo using Skia4Delphi and Delphi 11.1 Alexandria, post it on GitHub, be the envy of all your friends, and maybe win a prize! We all know Delphi is the best tool when it comes to making amazing GUI applications. Use Skia4Delphi to take it to the next level in this contest. Skia is a super powerful, high performance, open source, cross platform 2D graphics library. Thanks to Skia4Delphi you have full access to Skia’s amazing features. Combine that with Delphi 11.1 Alexandria and you can create amazingly beautiful applications on Windows, macOS, Linux, iOS, and Android, all with the same code base. Skia4Delphi works with VCL and FMX. With FMX, you can switch to Skia as your rendering engine to improve the performance of your FireMonkey application, and unlock smoother animations with a single line of code. uses System.StartUpCopy, FMX.Forms, Skia.FMX, Unit1 in ‘Unit1.pas’ {Form1}; {$R *.res} begin GlobalUseSkia := True; Application.Initialize; … uses   System.StartUpCopy,   FMX.Forms,   Skia.FMX,   Unit1 in ‘Unit1.pas’ {Form1};   {$R *.res}   begin   GlobalUseSkia := True;   Application.Initialize;   … Review the webinar, install Skia4Delphi, and impress the world with your creative genius! To explore the amazing potential of Skia4Delphi in your applications we are hosting a contest. The requirements are straightforward. Install Skia4Delphi – it is available via GetIt or on GitHub. Use Delphi 11.1 Alexandria to create or update a VCL or FMX application using Skia4Delphi. Record a short video demonstrating your application in action.  Post it on YouTube, Vimeo, or other video hosting platform. Capture a few screenshots of your beautiful user interface. Post your code on GitHub.  Include the images and a link to your video in the readme. Include an overview of your project, details on how to build it, a description of what it does, why’s it cool, and how Skia4Delphi makes it amazing in the readme.md!  Use the topic tags: Delphi, Skia, Skia4Delphi, and others (FMX, VCL, Android, etc.) as appropriate. Include links to this blog post, Skia4Delphi, and Delphi’s home page. Share your entry on social media, tagging Embarcadero on Twitter, Facebook, LinkedIn, etc. Fill out the official entry form. Stay tuned to this post and our blog for updates and more details. Prizes Grand Prize is an Apple M1 Mac Mini so you can take advantage of the great new support for Apple Silicon in Delphi 11 Alexandria.  We will feature some of the entries we like best in blog posts and social media. Other prizes may be added depending on the number of entries received. Rules You are free to use any other 3rd party libraries, components, etc., but don’t include that code on GitHub. Make sure you include links and details on where to get them in your description. Feel free to use external graphical resources to make your user interface look great. If your project is complicated to build then be sure to include a pre-built binary as a release.  Skia4Delphi doesn’t officially support C++Builder yet, but you are welcome to use C++Builder in this contest if you want to make it work. Yes, you need to post your code, but you can use any license you want. We recommend MIT or BSD, but the choice is yours. The video doesn’t need to be anything fancy, just show off your application in action. […]

Read More

Extend TMS WEB Core with JS Libraries with Andrew: FlatPickr

So far in this blog series, we’ve covered JS libraries that included Helpers, Tools, and Assets.  This time out, we’re going to dig into the first of many JS libraries that feature some sort of Control – a component or widget or element of some kind that can extend your TMS WEB Core project beyond what the standard components offer.  Our first control describes itself as “a lightweight and powerful datetime picker” and indeed it is!  It’s called FlatPickr and in this first part, we’ll cover how to get it up and running in your TMS WEB Core projects, with a few examples to show off its key features.  In part two, we’ll take a different approach by creating a TFlatPickr component that can then be added to the Delphi IDE Palette, making it even easier to use in your projects. Motivation TMS WEB Core comes with a datetime picker of course, the TWebDateTimePicker component.  And if you’re a fan of FNC components, there are the TTMSFNCDatePicker and TTMSFNCDateTimePicker components. And if you’re hunting around the Delphi IDE Palette, you’ll also run across a jQuery-based component called TWebJQXDateTimeInput. So plenty of options right off the bat.  But it would be hard to think of another class of component where people (like me!) have very strongly-held opinions on how they should look and work, and what kinds of options they absolutely need to have.  And that’s before we even get to the whole epic tale of date and time formats, something we’ll also be covering very shortly when we get to Luxon.  Also, datetime pickers hide away a surprising amount of complexity for something that, on the surface, appears to be very simple.  When it comes to choosing a datetime picker, here are some of the considerations that I have in mind. I would consider these to be “minimum requirements” rather than “nice-to-haves” for my projects. Your projects may have an entirely different set of priorities of course.  What is perhaps most important is that the same datetime picker component is used throughout a project, where possible. Week Numbers.  I work with many clients from the agriculture industry where week numbers are used all the time, probably more often than dates, in fact. Variations.  Sometimes it makes sense to display a full month calendar on the page. Maybe even two months.  Sometimes it is a drop-down.  Sometimes there’s also a time.  Sometimes there’s only a time.  Being able to use the same control in different variations helps with providing a consistent user experience and results in fewer headaches as a developer. Restrictions.  Having a start/end range for selectable dates is important, but it is often necessary to be able to provide a list of available dates to the component, and for the component to make it clear to the user which dates are available to be selected.  Selections.  The flexibility to be able to select an individual date, multiple dates, or a range is important, but making it simple is just as important. Themes.  The component has to fit in visually with the rest of the project.  My projects typically use CSS for theme work, so bonus points if it can be themed easily with CSS. But at the very list it should provide some options for the ubiquitous light and […]

Read More

How To Save Money On The Development Of An Application

Many people think application development is a huge task and that you have to spend a lot of money on the development of an application. However, the problem here is the inability of users to choose an ideal framework to support everything they need for the development. Using separate tools for each development task is what makes this process expensive. In this article, we will discuss how to save money on the development of an application regardless of its quality. Do you use pre-built UI components? Many JavaScript frameworks support component-based models. Unfortunately, the majority of them do not have any pre-built components. Therefore, JavaScript programmers have to either build components from the ground up or deal with components built by others. Sencha offers about 140 well-developed and tested UI components to speed up your development process. There, you can find all the necessary components to develop data-intensive online projects, including charts, exporters, grids, pivot grids, d3 adapters, and layouts. It saves money that needs to be spent on developers to build these components from scratch. Did you find an easy way to style the application? Styling the application is not an easy task for the developers. The reason is that they need to spend a considerable amount of time on manual coding to get the required format or style for the application. Apart from that, you will have to recruit separate designers to meet your requirements, which can be expensive. Sencha Themer provides you the ability to customize Ext JS, ExtAngular, as well as ExtReact applications and make them appear perfect. You can make your own themes with graphical tools rather than writing code. It’s simple to apply multiple color combos to different component states using the revolutionary color palette of Themer. The color palette depicts the base, text background, and font color with successively brighter and darker colors. Do you use the drag and drop option when it’s suitable? The drag and drop feature is one of the most powerful features to make the tasks of developers easier. Essentially, a drag operation is a click gesture on some UI element while the mouse button is held down and the mouse is moved. A drop operation occurs when the mouse button is released after the drag operation. Drag and drop functionality drastically reduces the time it takes to construct apps. It is done by replacing repeated lines of code with ready-to-use building pieces, such as react or the Angular components library. A smart drag-and-drop interface substantially decreases the learning curve when it comes to learning new technology. That’s a good thing when considering the quantity of different digital tools that many corporate personnel utilizes regularly. Sencha supports ‘Drag and Drop,’ making development easier and less time-consuming. It will also result in money savings. Do you have enough resources to quickly learn the framework you use? Learning new frameworks is not the easiest task. For example, Open-source frameworks don’t have dedicated teams to provide comprehensive documentation or learning materials. Therefore you have to go through various tutorials written by others, and ask questions on StackOverflow or Reddit to get your problems solved. When you use a product like sencha, they have very detailed documentation with step-by-step guides on everything from installation to deployment. Thus, sencha significantly reduces the time to […]

Read More

Highlights of Virtual SenchaCon 2022

On April 12, 2022, we held the third Virtual SenchaCon, featuring a number of discussions on a wide array of topics, ranging from Sencha’s latest product GRUI to Serverless for JS Devs.The company has been organizing the conference virtually since the beginning of the pandemic in 2020. Although last year’s con was held on two subsequent days, this year, the con was wrapped up in one day. A lot of things were discussed in these conferences, but one of the most vital sessions was conducted by Jason Cline, CTO of Celestial System. He defined in detail every aspect of Sencha’s latest product GRUI. The Sencha Con kicked off with an opening keynote from Kegan Blumenthal, General Manager of Sencha, himself. Let’s see what he said. Keynote Highlights Kegan Blumenthal, General Manager of Sencha, along with Sarina Dupont, and Eric Romoff, led the first session of SenchaCon 2022. In this session, Kegan shared the keynote and themes of the SenchaCon. Then, Sarina, Director, Product Management described the future road map, and Eric, Chief of Staff at Sencha, introduced us to the latest product of Sencha, which is GRUI. So let’s discuss the conference in more detail. Sencha Ext JS Explained by Kegan Kegan started the conference by describing the growth of Sencha over the past year. The company has expanded its community in that time and has also been recognized as a leader of G2 in the Across Community and User Ratings categories. According to Kegan, one of the key themes for Sencha in the year 2022 is to aim for low codes and high performance using low-code tooling. Kegan said, “Low code enables enterprises to create better experiences for the users with a low-code approach.” He also stated that the low-code approach would enable enterprises to create and deliver apps in record time. Low code also has the Architect feature, which is customizable and gives users drag-and-drop features. And using this, users can develop applications 20 times faster. The other key theme for Sencha 2022 was to focus more on the React community. The new grid component of Sencha, which is GRUI, is based on the XJS component and built from React. Kegan also shared the other solutions that support React, such as Froala, which is a rich-text editor; FusionCharts, a charting library; and Filestack, a file upload API. Later Kegan gave an overview of the evolution of JavaScript tooling. He emphasized that the Ext JS grid component is the number-one focus of Sencha. Sencha is doubling its efforts on the Ext JS data grid component to make it better. According to Kegan, the Ext JS UI library contains all the tools that users need to build an enterprise-level application. Considering the fact that app security has become a major concern among developers, Ext JS provides all the components built in house, reducing the scope for dependencies and vulnerabilities and thus making it a safer solution for app development. Other important news Kegan shared during the conference was that Ext JS OEM License is now rebranded as Ext JS Hub License. And at the end of his part of the conference, Kegan briefed attendees about the diversity of industries in which Sencha is growing, some Sencha case studies from the last year, a few white papers that Sencha published in […]

Read More

Get Jurassic with Loady Dungeons: The new UGS sample game

Addressables The Addressable Asset System provides an easy way to load assets by “address”. It handles asset management overhead by simplifying content pack creation and deployment. The Addressable Asset System uses asynchronous loading to support loading from any location with any collection of dependencies. Whether you are using direct references, traditional asset bundles, or resource folders, addressable assets provide a simpler way to make your game more dynamic. Loady Dungeons utilizes the addressables package to handle the asynchronous dynamic referencing of different scenes and hats, which is necessary for CCD to provide the online models and textures, as opposed to a fixed reference that requires a local version of the AssetBundles in order for the game to function. Cloud Content Delivery Built for game development, Cloud Content Delivery (CCD) is an end-to-end service for live game updates combining powerful asset management, cloud storage, and a reliable content delivery network (CDN). CCD allows us to implement new levels or hats for our main character on the fly and host that data on the cloud. This means users won’t have to deal with the increased install size of all the scenes and hats available downloaded locally to their device.  Only when the game requires that content does it get loaded dynamically and delivered. This drastically reduces the pain points of bloated install sizes and patch download sizes, which is particularly useful for mobile devices. Cloud Content Delivery also enables developers to easily manage seasonal content – for example, the winter and Halloween levels in Loady Dungeons can be timed to only be available during certain times of the year.  Hats like the bunny ears could also be timed for spring, and once those periods are past, that timed content can be easily removed from the client to keep a smaller install size.

Read More