Tutorial by Examples: sin

When you have an ajax call, it's extremely difficult to get a log from inside of the callback function. But if you enable the debugging define('WP_DEBUG', true); and then after that add ini_set('log_errors',TRUE); ini_set('error_reporting', E_ALL); ini_set('error_log', dirname(__FILE__) . '/e...
The jar command can be used to create a multi-release Jar containing two versions of the same class compiled for both Java 8 and Java 9, albeit with a warning telling that the classes are identical: C:\Users\manouti>jar --create --file MR.jar -C sampleproject-base demo --release 9 -C sampleproje...
Given the following multi-release Jar: jar root - demo - SampleClass.class - META-INF - versions - 9 - demo - SampleClass.class The following class prints the URL of the SampleClass: package demo; import java.net.URL; public class Main...
Parsing date is used when having an input typed as String and when it is needed to get it as a Date. The class TalendDate contains method TalendDate.parseDate("pattern","stringDate"). Pattern here is the input pattern, and not the expected output pattern. Usage : For an input...
Since Talend 6.3 , an option in tMap allows to automatically convert types. When activated, output pattern is used as the expected input pattern to automatically convert data. First, activate the option : Then modify output pattern, used as the input pattern :
math.js 'use strict'; const Promise = require('bluebird'); module.exports = { // example of a callback-only method callbackSum: function(a, b, callback) { if (typeof a !== 'number') return callback(new Error('"a" must be a number')); if (typeof b !== 'number...
To use sqlalchemy for database: from sqlalchemy import create_engine from sqlalchemy.engine.url import URL url = URL(drivername='mysql', username='user', password='passwd', host='host', database='db') engine = create_engine(url) # sqlalchemy eng...
SharePoint 2013: Access User Profile Service Data using JSOM in SharePoint 2013 ​ In this article, we will learn to manage or access User Profile Service(UPS) Application using JSOM (Javascript Object Model) and create a basic App. Before we start, lets go through basic UPS terminology first. Us...
Example using JsonCoverter to deserialize the runtime property from the api response into a Timespan Object in the Movies model JSON (http://www.omdbapi.com/?i=tt1663662) { Title: "Pacific Rim", Year: "2013", Rated: "PG-13", Released: "12 Jul ...
Add any JSR 303 implementation to your classpath. Popular one used is Hibernate validator from Hibernate. <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.2.0.Final</version> </dependen...
Referring to non-static members in initializer lists before the constructor has started executing can result in undefined behavior. This results since not all members are constructed at this time. From the standard draft: §12.7.1: For an object with a non-trivial constructor, referring to any no...
webpack-dev-server can proxy some requests to others servers. This might be useful for developing API client when you want to send requests to same domain. Proxy is configured via proxy parameter. Example configuration of dev server passing requests to /api to other service listening on port 8080 ...
We have a Student table with SubjectId. Here the requirement is to concatenate based on subjectId. All SQL Server versions create table #yourstudent (subjectid int, studentname varchar(10)) insert into #yourstudent (subjectid, studentname) values ( 1 ,'Mary' ) ,( 1 ,'John' ...
if (Patterns.EMAIL_ADDRESS.matcher(email).matches()){ Log.i("EmailCheck","It is valid"); }
Install msys2 (http://www.msys2.org/) Install the required prerequisites for Vala pacman -S mingw64/mingw-w64-x86_64-gcc pacman -S mingw64/mingw-w64-x86_64-pkg-config pacman -S mingw64/mingw-w64-x86_64-vala and all the additional packages your code requires, i.e. pacman -S mingw64/mi...
Many biological questions can be translated into a DNA sequencing problem. For instance, if you want to know the expression level of a gene you can: copy its mRNAs into complementary DNA molecules, sequence each of the resulting DNA molecules, map those sequences back to the reference genome, and th...
LRU Cache The following example code demonstrates a possible implementation of the LruCache class for caching images. private LruCache<String, Bitmap> mMemoryCache; Here string value is key for bitmap value. // Get max available VM memory, exceeding this amount will throw an // OutOfMem...
import {Http} from '@angular/http'; @Injectable() export class StudentService{ constructor(public http: Http){} getAllStudents(): Observable<Students[]>{ return this.http.get('assets/students.json') .map(res => res.json().data) } } notice ...
This example shows how you might handle users interacting with modals on a 1-1 basis. //client side function modals(socket) { this.sendModalOpen = (modalIdentifier) => { socket.emit('openedModal', { modal: modalIdentifier }); }; this.closeModa...
Sending The Request Header $uri = 'http://localhost/http.php'; $ch = curl_init($uri); curl_setopt_array($ch, array( CURLOPT_HTTPHEADER => array('X-User: admin', 'X-Authorization: 123456'), CURLOPT_RETURNTRANSFER =>true, CURLOPT_VERBOSE => 1 )); $out = curl_exec($ch...

Page 150 of 161