Tutorial by Examples

You can COPY table and paste it into a file. postgres=# select * from my_table; c1 | c2 | c3 ----+----+---- 1 | 1 | 1 2 | 2 | 2 3 | 3 | 3 4 | 4 | 4 5 | 5 | (5 rows) postgres=# copy my_table to '/home/postgres/my_table.txt' using delimiters '|' with null as 'null_s...
Suppose, that we have three users : The Administrator of the database > admin The application with a full access for her data > read_write The read only access > read_only With below queries, you can set access privileges on objects created in the future in specified schema. ALTER ...
If you're Using VueJS2 and like to use JSX along with it. In this case,to use the slot, the solution with example is below.We have to use this.$slots.default It's almost like this.props.children in React JS. Component.js : export default { render(h) { //eslint-disable-line return ( ...
Schema changes: You will need to define a new field type in your solr schema file and then you can create fields of that type. Example schema snippet: <!-- Source: solr/example/.../conf/schema.xml --> <?xml version="1.0" encoding="UTF-8" ?> <schema name="a...
Let's get some theoretical knowledge before moving to the example. There are three important terms being used here Analyzers, Tokenizers, and Filters. To create such custom field you will need to create an analyzer with one tokenizer and one or more filters. As mentioned here, you can have only one ...
Creating a connection According to PEP 249, the connection to a database should be established using a connect() constructor, which returns a Connection object. The arguments for this constructor are database dependent. Refer to the database specific topics for the relevant arguments. import MyDBA...
You can parse XML from a string or from a XML file 1. From a string $xml_obj = simplexml_load_string($string); 2. From a file $xml_obj = simplexml_load_file('books.xml'); Example of parsing Considering the following XML: <?xml version="1.0" encoding="UTF-8"?> &l...
You need to change price scope 'Global' to 'website' (Sysytem->Configuration->Catalog->Catalog->Price) $client = new SoapClient('http://your-web-site/api/soap/?wsdl'); $API_USER = 'your-api-user'; $API_KEY = 'your-api-key'; $session = $client->login($API_USER, $API_KEY); $result...
var x = 5; var str = "if (x == 5) {console.log('z is 42'); z = 42;} else z = 0; "; console.log("z is ", eval(str)); The use of eval is strongly discouraged. See the Remarks section for details.
Objective-C First go the Target->Capabilities and enable HealthKit. This would setup the info.plist entry. Make a new CocoaClass of type NSObject The filename I gave is GSHealthKitManager and the header file is as shown below GSHealthKitManager.h #import <Foundation/Foundation.h> #imp...
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { CommonModule } from '@angular/common'; import { AboutComponent } from './about.component'; @NgModule({ imports: [ CommonModule ], declarations: [ AboutComponent ], exports: [ AboutComponent ], schemas...
import { Component } from '@angular/core'; @Component({ selector: 'myapp-about', template: `<my-webcomponent></my-webcomponent>` }) export class AboutComponent { }
Installation $ npm install gulp-jslint --save-dev Usage In gulpfile.js add: var gulp = require('gulp'); var jslint = require('gulp-jslint'); gulp.task('lint', function(){ return gulp.src(['source.js']) .pipe(jslint({ /* this object represents the JSLint directives being passe...
Objective-C Create a new iOS project and add CoreSpotlight and MobileCoreServices framework to your project. Create the actual CSSearchableItem and associating the uniqueIdentifier, domainIdentifier and the attributeSet. Finally index the CSSearchableItem using [[CSSearchableIndex defaul...
Aggregation is used to perform complex data search operations in the mongo query which can't be done in normal "find" query. Create some dummy data: db.employees.insert({"name":"Adma","dept":"Admin","languages":["german","f...
This is an example code to create and execute the aggregate query in MongoDB using Spring Data. try { MongoClient mongo = new MongoClient(); DB db = mongo.getDB("so"); DBCollection coll = db.getCollection("employees"); //Equivalent to $m...
When defining a new trait it is possible to enforce that types wishing to implement this trait verify a number of constraints or bounds. Taking an example from the standard library, the DerefMut trait requires that a type first implement its sibling Deref trait: pub trait DerefMut: Deref { fn...
In this Example we are going to take a sqaure shaped line plotted using line and perform transformations on it. Then we are going to use the same tranformations but in different order and see how it influences the results. First we open a figure and set some initial parameters (square point coordin...
An easy way to get an input from a user is by using the prompt() method. Syntax prompt(text, [default]); text: The text displayed in the prompt box. default: A default value for the input field (optional). Examples var age = prompt("How old are you?"); console.log(age); // Pri...
import pygame file = 'some.mp3' pygame.init() pygame.mixer.init() pygame.mixer.music.load(file) pygame.mixer.music.play(-1) # If the loops is -1 then the music will repeat indefinitely.

Page 985 of 1336