Tutorial by Examples: app

This is the typical approach for novice developers building SQL action queries. They are vulnerable to the Bobby Tables type SQL Injection attacks. Dim strSQL As String strSQL = "INSERT INTO Employees chrFirstName, chrLastName, chrPhone " _ & "VALUES ('" & M...
This approach will prevent a user from embedding a second SQL statement in their input for execution. Dim strSQL As String Dim db As DAO.Database Dim qdf As DAO.QueryDef strSQL = "PARAMETERS [FirstName] Text(255), [LastName] Text(255), [Phone] Text(255); " _ & "INS...
In this example, we create an empty index (we index no documents in it) by defining its mapping. First, we create an ElasticSearch instance and we then define the mapping of our choice. Next, we check if the index exists and if not, we create it by specifying the index and body parameters that cont...
public static void applyFontToMenu(Menu m, Context mContext){ for(int i=0;i<m.size();i++) { applyFontToMenuItem(m.getItem(i),mContext); } } public static void applyFontToMenuItem(MenuItem mi, Context mContext) { if(mi.hasSubMenu()) for(int i=0;i<mi.getSubMenu...
<!-- All boilerplate for now --> <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Application.Resources> </Application.Reso...
import sys from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtGui import QIcon class Example(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): self.setGeometry(300, 30...
Sometimes, you need to output to more than one index in ElasticSearch, or have a custom mapping you want to apply to new indices as they roll in. There are two ways to apply a custom mapping. One way, is to upload an ElasticSearch template. See the ElasticSearch documentation for that. The other ...
You can customize the appearance of the TextInputLayout and its embedded EditTextby defining custom styles in your styles.xml. The defined styles can either be added as styles or themes to your TextInputLayout. Example for customizing the hint appearance: styles.xml: <!--Floating label text st...
To deploy an Ember application simply transfer the output from ember build to a web server. This can be done with standard Unix file transfer tools such as rsync or scp. There are also services that will let you deploy easily. ember build scp -r dist/* myserver.com:/var/www/public/ normally we ...
Swift Playgrounds app is a great way to get started coding Swift on the go. To use it: 1- Download Swift Playgrounds for iPad from App Store. 2- Open the app. 3- In the My Playgrounds tab, tap + on the top left corner and then select Blank template. 4- Enter your code. 5- Tap Run My Code to r...
Sample Data: CREATE TABLE table_name ( id, list ) AS SELECT 1, 'a,b,c,d' FROM DUAL UNION ALL -- Multiple items in the list SELECT 2, 'e' FROM DUAL UNION ALL -- Single item in the list SELECT 3, NULL FROM DUAL UNION ALL -- NULL list SELECT 4, 'f,,g' FROM DUAL; -- NULL item...
This example is a very simple Spring Boot application. Maven Dependencies At first add the following dependencies to your project. Spring Initializr is recommended when you create a new project. <parent> <groupId>org.springframework.boot</groupId> <artifactId>spr...
Objectives: Using the Spring CLI, we will create a new Spring Boot application to be deployed to Elastic Beanstalk. We will edit the generated Spring Boot application so that it will: Create a jar named aws-eb-demo.jar. Listen on port 5000. Include a single web page named index.html. ...
Suppose we'd like to wrap the Google Maps JavaScript API google.maps: @JS('google.maps') library maps; import "package:js/js.dart"; @JS() class Map { external Map(Location location); external Location getLocation(); } We now have the Map Dart class which corresponds to t...
Suppose we want to write a constraint which matches a number, but approximatively. Say, you are supposed to have 95 people in a survey, but 93 or 96 will do as well. We can write a custom constraint of the form: public class AlmostEqualToConstraint : Constraint { readonly int _expected; ...
JS es6 (also known as es2015) is a set of new features to JS language aim to make it more intuitive when using OOP or while facing modern development tasks. Prerequisites: Check out the new es6 features at http://es6-features.org - it may clarify to you if you really intend to use it on your n...
Firebase handles notifications differently when the app is in background (killed process) and when in foreground (active). When your app is in the background, notification messages are displayed in the system tray, and onMessageReceived is not called. For notification messages with a data payload...
Once we have an image ready, we can start and serve the same. In order to create a container from the image, use docker run -p 80:80 -d <Image name> In the command above -p 80:80 would forward port 80 of your server to port 80 of the container. The flag -d tells that the container should r...
Application visits are initiated by clicking a Turbolinks-enabled link, or programmatically by calling Turbolinks.visit(location) By default, the visit function uses the 'advance' action. More understandably, the default behavior for the visit function is to advance to the page indicated by the ...
For this example we will use the Live Test RavenDB instance. We will build a simple console app here which demonstrates the most basic operations: Creation Retrieval by Id Querying Updating Deletion Begin by creating a new Visual Studio solution and add a Console Application project to it...

Page 27 of 33