This uses the SwiftyDropbox library to upload a file from a NSFileHandle to the Dropbox account using upload sessions, handling every error case:
import UIKit
import SwiftyDropbox
class ViewController: UIViewController {
// filled in later in doUpload:
var fileHandle : NSFileHandle?...
import curses
import traceback
try:
# -- Initialize --
stdscr = curses.initscr() # initialize curses screen
curses.noecho() # turn off auto echoing of keypress on to screen
curses.cbreak() # enter break mode where pressing Enter key
...
Your app can't access your reminders and your calendar without permission. Instead, it must show an alert to user, requesting him/her to grant access to events for the app.
To get started, import the EventKit framework:
Swift
import EventKit
Objective-C
#import <EventKit/EventKit.h>
...
BEGIN TRY -- start error handling
BEGIN TRANSACTION; -- from here on transactions (modifictions) are not final
-- start your statement(s)
select 42/0 as ANSWER -- simple SQL Query with an error
-- end your statement(s)
COMMIT TRANSACTION; -- finalize all transa...
Sometimes we have another editor somewhere else instead of TinyMCE (Wordpress Default Editor). That happen when we are creating our own Theme, Plugin or something specific; and we need to write and manipulate a type of post and save it into our WP Database.
So, if you are on that situation, you can...
SELECT 1,22,44
UNION
SELECT 2,33,55
SELECT 1,22,44
UNION
SELECT 2,33,55
UNION
SELECT 2,33,55
The result is the same as above.
use UNION ALL
when
SELECT 1,22,44
UNION
SELECT 2,33,55
UNION ALL
SELECT 2,33,55
The correct invocation of helper modules and functions can be intimidating because
these are generated dynamically (e.g., when creating a new project or adding a new resource)
they are not documented explicitly (e.g., MyApp.ErrorHelpers.error_tag)
the documentation does not cover all examples (...
To integrate Siri capabilities in your app, you should add an extensions as you would do while creating an iOS 10 Widget (old Today View Extension) or a custom keyboard.
Adding capability
1- In the project settings, select your iOS app target and go to Capabilities tab
2- Enable the Siri capabili...
The push notification plugin requires an init an initialization which tells the plugin to start running using the sender id provided.
let push = Push.init({
android: {
senderID: "------------",
},
ios: {
alert: "true",
badge: tru...
The registration step registers the app with the device's system and returns a registration id
import { Push, RegistrationEventResponse} from "ionic-native";
//the push element is created in the initialization example
push.on("registration", async (response:...
To receive push notifications we are supposed to tell the plugin to listen to incoming push notifications. This step is done after initialization & registration
import { Push, NotificationEventResponse} from "ionic-native";
//the push element is created in the initial...
DASH is the most widely deployed adaptive streaming technology in modern solutions, used to deliver video in a wide variety of scenarios. The best way to understand DASH presentations is to observe the network activity that takes place during playback.
This example uses Fiddler to capture and analy...
Mongoose connect has 3 parameters, uri, options, and the callback function. To use them see sample below.
var mongoose = require('mongoose');
var uri = 'mongodb://localhost:27017/DBNAME';
var options = {
user: 'user1',
pass: 'pass'
}
mongoose.connect(uri, options, function(err){...
There exist cases in which it is necessary to put data of different types together. In Azure ML for example, it is necessary to pass informations from a R script module to another one exclusively throught dataframes.
Suppose we have a dataframe and a number:
> df
name height team...
By default, all the controllers you generate with Symfony's built-in generate:controller command will make use of Symfony annotations for routing:
namespace AppBundle\Controller;
// You have to add a use statement for the annotation
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
...
@IBAction func axisChange(sender: UISwitch) {
UIView.animateWithDuration(1.0) {
self.updateConstraintsForAxis()
}
}
The updateConstraintForAxis function just sets the axis of the stack view containing the two image views:
private func updateConstraintsForAxis() {
if (axi...
Recursive use of make means using make as a command within a makefile. This technique is useful when a large project contains sub-directories, each having their respective makefiles. The following example will help understand advantage of using .PHONY with recursive make.
/main
|_ Makefile
...
In this example I define two custom function.
1 - countryFilter function get's the country short code as input and return the country full name.
2 - _countPrinterTasks is used to calculate the no of tasks assigned to a particular user.
<?php
namespace DashboardBundle\Twig\Extension;
use ...