Tutorial by Examples: c

1)First go through Paypal Developer web site and create an application. 2)Now open your manifest file and give the below permissions <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"...
Preemptive basic authentication is the practice of sending http basic authentication credentials (username and password) before a server replies with a 401 response asking for them. This can save a request round trip when consuming REST apis which are known to require basic authentication. As descr...
Using HttpClient as RestTemplate's underlying implementation to create HTTP requests allows for automatic handling of basic authentication requests (an http 401 response) when interacting with APIs. This example shows how to configure a RestTemplate to achieve this. // The credentials are stored he...
Phalcon uses db service by default to obtain connection to databases. Assuming you have an conguration file with database field set up, you can include or autoload following code to obtain connection with database for your project: $di->set('db', function () use ($config) { $dbconf = $conf...
Phalcon builds up some information about tables it is using, so it is possible to validate data being inserted to them without implementing everything by hand. Those are meta data for models. To speed up and prevent Phalcon from building Meta Data every time page is refreshed, it is possible to cach...
Assume that we have a system that sends out daily reports over email in the form of attached CSV files and that we want to access these. function getCsvFromGmail() { // Get the newest Gmail thread based on sender and subject var gmailThread = GmailApp.search("from:[email protected] sub...
Using core debugger Node.js provides a build in non graphical debugging utility. To start the build in the debugger, start the application with this command: node debug filename.js Consider the following simple Node.js application contained in the debugDemo.js 'use strict'; function addTwoN...
The main reason that Nightwatch is so powerful, is because of it's excellent configuration file. Unlike most other testing frameworks, Nightwatch is fully configurable and customizable to different environments and technology stacks. .meteor/nightwatch.json The following configuration file is for...
In the root of your application should be a package.json file, where you can define scripts and devDependencies. { "name": "myapp", "version": "1.0.0", "scripts": { "start": "meteor --settings settings-development.json&q...
A basic Nightwatch installation for Meteor will have the following directories and files installed. /myapp /myapp/.meteor/nightwatch.json /client/main.html /client/main.js /client/main.css /tests /tests/nightwatch /tests/nightwatch/assertions /tests/nightwatch/commands /tests/nightwatch/da...
Helpers should extend from Mage_Core_Helper_Abstract: # File: app/code/local/Vendor/Package/Helper/Data.php class Vendor_Package_Helper_Data extends Mage_Core_Helper_Abstract { public function multiply($a, $b) { return $a * $b; } } To be able to access is via Mage::hel...
Use the annotation @FixMethodOrder with the method sorter MethodSorters.NAME_ASCENDING. This will run all tests within the class in a deterministic and predictable order. The implementation compares the method names and in the case of a tie, it compares the methods' toString(). Code Segment Below T...
Radio Buttons allow you to let the user choose one element of those given. There are two ways to declare a RadioButton with a text besides it. Either by using the default constructor RadioButton() and setting the text with the setText(String) method or by using the other constructor RadioButton(Stri...
Let's say the second RadioButton out of three is pre-selected with setSelected(Boolean), the focus is still at the first RadioButton by default. To change this use the requestFocus() method. radioButton2.setSelected(true); radioButton2.requestFocus();
Sometimes we need a visual hint to indicate the return status of previous command. The following snippet make put it at the head of the PS1. Note that the __stat() function should be called every time a new PS1 is generated, or else it would stick to the return status of last command of your .bashr...
Open Storyboard where you have your ViewController with TableView: Add prototype cell (if there is no cell added before): Customize cell as you want (in my case there is custom UIImage and Label): Remember to set height of the cell. To do it select your whole TableView and from the Properties...
[root@localhost ~]# docker run -it -v /data --name=vol3 8251da35e7a7 /bin/bash root@d87bf9607836:/# cd /data/ root@d87bf9607836:/data# touch abc{1..10} root@d87bf9607836:/data# ls abc1 abc10 abc2 abc3 abc4 abc5 abc6 abc7 abc8 abc9
[root@localhost ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d87bf9607836 8251da35e7a7 "/bin/bash" About a minute ago Up 31 seconds vol3 [r...
[root@localhost ~]# docker inspect d87bf9607836 "Mounts": [ { "Name": "cdf78fbf79a7c9363948e133abe4c572734cd788c95d36edea0448094ec9121c", "Source": "/var/lib/docker/volumes/cdf78fbf79a7c9363948e133abe4c572734cd788c95d36edea0448094ec9121c/_data&quot...
[root@localhost ~]# docker run -it --volumes-from vol3 8251da35e7a7 /bin/bash root@ef2f5cc545be:/# ls bin boot data dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var root@ef2f5cc545be:/# ls /data abc1 abc10 abc2 abc3 abc4 abc5 abc6 abc7...

Page 506 of 826