Tutorial by Examples: l

You can test sending messages using the FCM REST API by sending a request through cURL. curl --header "Authorization: key=<API_KEY>" \ --header Content-Type:"application/json" \ https://fcm.googleapis.com/fcm/send \ -d "{\"registration_ids...
How do you detect them? If the same variable/resource/memory location is accessible by multiple threads and at least of the thread is changing the value of variable/resource/memory location, then Race Condition can occurred. Because if a thread is changing the value of variable/resource/memory ...
Overview Openssl consists of 2 libraries: libcrypto and libssl. Before openssl API can be used in an application, mandatory initialization procedures are expected to be performed. Once application is done with openssl related work, it is expected to cleanup allocated resources. Code below does com...
iOS 10 Now Requires User Permission to Access Media Library, Photos, Camera and other Hardware like these. The solution for this is to add their keys into info.plist with description for user that how we are using their data , iOS already required permissions to access microphone, camera, and m...
From Xcode menu open: Product > Scheme > Edit Scheme. On your Environment Variables set OS_ACTIVITY_MODE = disable
SELECT item.item_id, uses.category, /* nonstandard */ COUNT(*) number_of_uses FROM item JOIN uses ON item.item_id, uses.item_id GROUP BY item.item_id will show the rows in a table called item, and show the count of related rows in a table called uses. It will also show the va...
Sometimes a query looks like this, with a * in the SELECT clause. SELECT item.*, /* nonstandard */ COUNT(*) number_of_uses FROM item JOIN uses ON item.item_id, uses.item_id GROUP BY item.item_id Such a query needs to be refactored to comply with the ONLY_FULL_GROUP_BY sta...
A very easy way to connect to an ORACLE database is by using oracledb module. This module handles the connection between your Node.js app and Oracle server. You can install it like any other module: npm install oracledb Now you have to create an ORACLE connection, which you can later query. co...
To simplify your querying from ORACLE-DB, you may want to call your query like this: const oracle = require('./oracle.js'); const sql = "select 'test' as c1, 'oracle' as c2 from dual"; oracle.queryObject(sql, {}, {}) .then(function(result) { console.log(result.rows[0]['C...
It is sometimes easiest to just declare a global of type any, especially in simple projects. If jQuery didn't have type declarations (it does), you could put declare var $: any; Now any use of $ will be typed any.
For more complicated projects, or in cases where you intend to gradually type a dependency, it may be cleaner to create a module. Using JQuery (although it does have typings available) as an example: // place in jquery.d.ts declare let $: any; export default $; And then in any file in your pr...
If you just want to indicate the intent of an import (so you don't want to declare a global) but don't wish to bother with any explicit definitions, you can import an ambient module. // in a declarations file (like declarations.d.ts) declare module "jquery"; // note that there are no ...
Use a <template> element to design a HTML template that you can then reuse in your code. <template id="Template1"> Hello, World ! <template> <div id="Target1"></div> <script> Target1.appendChild( Template1.content.cloneNode( tr...
Create a new HTML tag named <hello-world> that will display "Hello, World!": <script> //define a class extending HTMLElement class HelloWorld extends HTMLElement { connectedCallback () { this.innerHTML = 'Hello, World!' } } //register the new custom elem...
Add a Shadow DOM to a div that will display "Hello, World!" instead of its initial content. <div id="Div1">intial content</div> <script> var shadow = Div1.attachShadow( { mode: 'open' } ) shadow.innerHTML = "Hello, World!" </script>...
Import an HTML file that will add a div with "Hello, World!" at the end of the main document's DOM tree. Imported file hello.html: <script> var div = document.createElement( 'div' ) div.innerHTML = 'Hello, World!' document.body.appendChild( div ) </script> Mai...
This example combines Custom Element, Template, Shadow DOM and HTML Import to display a the "Hello, World!" string in HTML. In file hello-world.html: <!-- 1. Define the template --> <template> Hello, World! </template> <script> var template = document....
In lua, the logical operators and and or returns one of the operands as the result instead of a boolean result. As a consequence, this mechanism can be exploited to emulate the behavior of the ternary operator despite lua not having a 'real' ternary operator in the language. Syntax condition and...
NSMutableArray *array = [NSMutableArray arrayWithObjects:@"Ken", @"Tim", @"Chris", @"Steve",@"Charlie",@"Melissa", nil]; NSPredicate *bPredicate = [NSPredicate predicateWithFormat:@"SELF beginswith[c] 'c'"]; NSArray ...
String and character literals provide an escape mechanism that allows express character codes that would otherwise not be allowed in the literal. An escape sequence consists of a backslash character (\) followed by one ore more other characters. The same sequences are valid in both character an st...

Page 678 of 861