Tutorial by Examples

In PubNub JavaScript v3, you could implement a unique callback for every channel that you subscribed to as long as you called the subscribe function for each channel and implemented the callback in that subscribe like this: var pubnub = new PubNub({ publishKey: "your-pub-key", s...
Ever wondered why you cannot use Assert.Equals() for both Nunit and MSTest. If you have not then maybe as a start you need to be aware that you cannot use this method. Instead you would use Assert.AreEqual() to compare two objects for equality. The reason here is very simple. Like any class the Ass...
Manually enabling menu items To manually control the enabled state of a menu items the menu that contains it must disable automatic enabling of its items Menus can turn off automatic enabling in one of two ways: In the Interface Builder In code menu.autoenablesItems = false Both of t...
Say you have the following model: public class foo { [Required] public string Email { get; set; } [Required] public string Password { get; set; } [Required] public string FullName { get; set; } } But you want to exclude FullName from the modelvalidation becaus...
When your Bluetooth LE Watcher's callback is triggered, the eventArgs include an RSSI value telling you the received signal strength (how strong the private async void OnAdvertisementReceived(BluetoothLEAdvertisementWatcher watcher, BluetoothLEAdvertisementReceivedEventArgs eventArgs) { // Th...
It is very common that during development, one may find very useful to lock/unlock the device screen during specific parts of the code. For instance, while showing a Dialog with information, the developer might want to lock the screen's rotation to prevent the dialog from being dismissed and the cu...
/** * @author piotrek1543 * * This example provides a specific UI testing problem and how it is already solved * with Google's Espresso. Notice that I used also Spoon framework, as Espresso * lacks of taking screenshots functionality. */ @RunWith(AndroidJUnit4.class) public class M...
It depends on kind of hosting that you have: If you have SSH console, then you can do it on hosting after step 2, if you haven't then do it locally: run command php app/console cache:clear --env=prod'. Suppose you have on you hosting folders youdomain/public_html, so in public_html m...
Suppose you have a table and you want to change one of this table primary id. you can use the following scrpit. primary ID here is "PK_S" begin for i in (select a.table_name, c.column_name from user_constraints a, user_cons_columns c where a.CONSTRAINT_TYPE...
Suppose you have the table T1 and it has relation with many tables and its primary key constraint name is "pk_t1" you want to disable these foreign keys you can use: Begin For I in (select table_name, constraint_name from user_constraint t where r_constraint_name='pk_t1') loop E...
As previous example, this script request elevation if needed. We ask the user for credentials avoiding the UAC prompt. @echo off cls & set "user=" & set "pass=" :: check if we have administrative access :: ----------------------------------------------------------...
Using the -a/--all flag will print all the available information about the kernel. $uname -a Linux hostname 3.13.0-88-generic #135-Ubuntu SMP Wed Jun 8 21:10:42 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux In this example, we see the kernel name, the hostname, the kernel release number, the kernel v...
let's assume we have three table which can be used for simple website with Tags. Fist table is for Posts. Second for Tags Third for Tags & Post relation fist table "videogame" idtitlereg_dateContent1BioShock Infinite2016-08-08.... "tags" table idname1yennefer2eliza...
Out line for details find a theme you like in the gallery install theme activate theme *need to add screen shots.
Express var express = require('express'); var app = express(); app.get('/', function (req, res) { res.send('Hello World!'); }); app.listen(3000, function () { console.log('Example app listening on port 3000!'); }); Koa var koa = require('koa'); var app = koa(); app.use(functi...
Commander.js var program = require('commander'); program .version('0.0.1') program .command('hi') .description('initialize project configuration') .action(function(){ console.log('Hi my Friend!!!'); }); program .command('bye [name]') .description('initialize pro...
trait PartialFunction[-A, +B] extends (A => B) Every single-argument PartialFunction is also a Function1. This is counter-intuitive in a formal mathematical sense, but better fits object oriented design. For this reason Function1 does not have to provide a constant true isDefinedAt method. To...
MongoDB supports secondary indexes. In Mongoose, we define these indexes within our schema. Defining indexes at schema level is necessary when we need to create compound indexes. Mongoose Connection var strConnection = 'mongodb://localhost:27017/dbName'; var db = mongoose.createConnection(strConn...
def hello puts "Hello readers" end hello # => "Hello readers" def hello puts "Hell riders" end hello # => "Hell riders"
puts "Hello readers".reverse # => "sredaer olleH" class String def reverse "Hell riders" end end puts "Hello readers".reverse # => "Hell riders"

Page 835 of 1336