Tutorial by Examples

You can concatenate strings separated by delimiter using the string_agg() function. If your individuals table is: NameAgeCountryAllie15USAAmanda14USAAlana20Russia You could write SELECT ... GROUP BY statement to get names from each country: SELECT string_agg(name, ', ') AS names, country FROM ...
Bash can easily create lists from alphanumeric characters. # list from a to z $ echo {a..z} a b c d e f g h i j k l m n o p q r s t u v w x y z # reverse from z to a $ echo {z..a} z y x w v u t s r q p o n m l k j i h g f e d c b a # digits $ echo {1..20} 1 2 3 4 5 6 7 8 9 10 11...
Sometimes it's useful to test private & protected methods as well as public ones. class Car { /** * @param mixed $argument * * @return mixed */ protected function drive($argument) { return $argument; } /** * @return bool *...
Selection with increasing scope This comes handy when you want to select a block to extract a variable / method etc, no need to do a precise bracket matching, just put the caret somewhere in the statement and keep doing this Windows: Ctrl + W OS X / macOS: Cmd + W Selection with decreasing scope...
A for-each loop in Less has the same key components as a for loop except for the following differences: A variable which contains the list of items that has to be iterated over. An extract() function to extract each item in the variable based on the loop's index. A length() function to calculat...
The only major differences between this and a regular TCP connection are the private Key and the public certificate that you’ll have to set into an option object. How to Create a Key and Certificate The first step in this security process is the creation of a private Key. And what is this private ...
SolrJ comes as part of the Solr distribution since Solr 1.x. The latest Solr version can be downloaded here. From Solr-6.3.0 that is the latest version available, we need to get the following libraries and add them to our build path: /dist/apache-solr-solrj-.jar /dist/solrj-lib/ Once we're done,...
CREATE TABLE users (username text, email text); CREATE TABLE simple_users () INHERITS (users); CREATE TABLE users_with_password (password text) INHERITS (users); Our three tables look like this: users ColumnTypeusernametextemailtext simple_users ColumnTypeusernametextemailtext users_with_p...
Let's create two simple tables: CREATE TABLE users (username text, email text); CREATE TABLE simple_users () INHERITS (users); Adding columns ALTER TABLE simple_users ADD COLUMN password text; simple_users ColumnTypeusernametextemailtextpasswordtext Adding the same column to the parent ta...
With AspNetCore you can develop the application on any platform including Mac,Linux,Window and Docker. Installation and SetUp Install visual Studio Code from here Add C# extesnion Install dot net core sdk. You can install from here Now you have all the tools available. To develop the applic...
While the String.Format() method is certainly useful in formatting data as strings, it may often be a bit overkill, especially when dealing with a single object as seen below : String.Format("{0:C}", money); // yields "$42.00" An easier approach might be to simply use the To...
public class AuthenticationHandler : DelegatingHandler { /// <summary> /// Holds request's header name which will contains token. /// </summary> private const string securityToken = "__RequestAuthToken"; /// <summary> ...
Spock framework information can be found at the Spock website. There are basically three ways to use Spock in Groovy as a dependency using the Grape dependency manager : Add the following to your groovy script. @Grab(group='org.spockframework', module='spock-core', version='1.1-groovy-2.4.1'...
Main process source code index.js: const {app, BrowserWindow, ipcMain} = require('electron') let win = null app.on('ready', () => { win = new BrowserWindow() win.loadURL(`file://${__dirname}/index.html`) win.webContents.openDevTools() win.on('closed', () => { win = null ...
After launching Visual Studio 2015, go to File → New → Project. In the New Project dialog box, browse in the templates tree to Visual C# → Windows → Universal and select Blank App (Universal Windows). Next, we need to fill the form to describe the Application: Name: this is the name of the appli...
The following example shows how to instantiate a class for logging via the ServiceLoader. Service package servicetest; import java.io.IOException; public interface Logger extends AutoCloseable { void log(String message) throws IOException; } Implementations of the service The...
JavaFX provides an easy way to internationalize your user interfaces. While creating a view from an FXML file you can provide the FXMLLoader with a resource bundle: Locale locale = new Locale("en", "UK"); ResourceBundle bundle = ResourceBundle.getBundle("strings", loc...
A Resource bundles contain locale-specific objects. You can pass the bundle to the FXMLLoader during its creation. The controller must implement Initializable interface and override initialize(URL location, ResourceBundle resources) method. The second parameter to this method is ResourceBundle which...
Apple introduced ATS with iOS 9 as a new security feature to improve privacy and security between apps and web services. ATS by default fails all non HTTPS requests. While this can be really nice for production environments, it can be a nuisance during testing. ATS is configured in the target's Inf...
Similar to enabling all HTTP content, all configuration happens under the App Transport Security Settings. Add the Exception Domains dictionary (NSExceptionDomains) to the top level ATS settings. For every domain, add a dictionary item to the Exception Domains, where the key is the domain in questi...

Page 757 of 1336