A Cordova application runs as a website on a WebView component within the native mobile platform. Debugging a cordova application can therefore be done by utilizing your favourite browsers development tools. The following steps are needed to hook the application, running on the device, to the Chrome...
This method accepts a string as input, attempts to parse it into a DateTime, and returns a Boolean result indicating success or failure. If the call succeeds, the variable passed as the out parameter is populated with the parsed result.
If the parse fails, the variable passed as the out parameter i...
This method behaves as a combination of TryParse and ParseExact: It allows custom format(s) to be specified, and returns a Boolean result indicating success or failure rather than throwing an exception if the parse fails.
TryParseExact(string, string, IFormatProvider, DateTimeStyles, out DateTime)
...
The Replace function in SQL is used to update the content of a string. The function call is REPLACE( ) for MySQL, Oracle, and SQL Server. The syntax of the Replace function is:
REPLACE (str, find, repl)
The following example replaces occurrences of South with Southern in Employees table:
FirstN...
ABAP also offers the conventional WHILE-Loop which runs until the given expression evaluates to false. The system field sy-index will be increased for every loop step.
WHILE condition.
* do something
ENDWHILE
To break loops, the command EXIT can be used.
DO.
READ TABLE itab INDEX sy-index INTO DATA(wa).
IF sy-subrc <> 0.
EXIT. "Stop this loop if no element was found
ENDIF.
" some code
ENDDO.
To skip to the next loop step, the command CONTINUE can be u...
Enable and configure the experimental Gradle plugin to improve AndroidStudio's NDK support. Check that you fulfill the following requirements:
Gradle 2.10 (for this example)
Android NDK r10 or later
Android SDK with build tools v19.0.0 or later
Configure MyApp/build.gradle file
Edit the dep...
Iterate over JSONObject properties
JSONObject obj = new JSONObject("{\"isMarried\":\"true\", \"name\":\"Nikita\", \"age\":\"30\"}");
Iterator<String> keys = obj.keys();//all keys: isMarried, name & age
while (keys.has...
You can use method chaining while working with JSONObject and JSONArray.
JSONObject example
JSONObject obj = new JSONObject();//Initialize an empty JSON object
//Before: {}
obj.put("name","Nikita").put("age","30").put("isMarried","true"...
cycle is an infinite iterator.
>>> import itertools as it
>>> it.cycle('ABCD')
A B C D A B C D A B C D ...
Therefore, take care to give boundaries when using this to avoid an infinite loop. Example:
>>> # Iterate over each element in cycle for a fixed range
>&g...
When to use abstract classes: To implement the same or different behaviour among multiple related objects
When to use interfaces: to implement a contract by multiple unrelated objects
Abstract classes create "is a" relations while interfaces provide "has a" capability.
This c...
sudo apt-add-repository ppa:brightbox/ruby-ng
Hit Enter to confirm
sudo apt-get update
Then you can install your ruby version of choice (the ppa supports ruby2.0 ruby2.1 ruby2.2 ruby2.3 and legacy versions ruby1.8 ruby1.9.1) Don't forget to include the respective -dev package for your version. Ot...
Create Or Replace Function Generateguid
Return Char Is
V_Guid Char(40);
Begin
Select Substr(Sys_Guid(),1,8)||'-'||Substr(Sys_Guid(),9,4)||'-'
||Substr(Sys_Guid(),13,4)||'-'||Substr(Sys_Guid(),17,4)||'-'
||Substr(Sys_Guid(),21) Into V_Guid...
Disclaimer: In no way does this example advocate the use of singletons. Singletons are to be used with a lot of care.
In PHP there is quite a standard way of implementing a singleton:
public class Singleton {
private $instance;
private function __construct() { };
public function...
With implicit keys:
key: value
another key:
- some
- more
- values
[1, 2, 3]: last value, which has a flow style key
With implicit and explicit keys:
? key
: value
another key:
- some
- more
- values
? [1, 2, 3]
: last value, which has a flow style key
key, another ...
To see all the facts involving the le relation from the prelude:
Coq < Search le.
le_n: forall n : nat, n <= n
le_S: forall n m : nat, n <= m -> n <= S m
...
max_l: forall n m : nat, m <= n -> Nat.max n m = n
max_r: forall n m : nat, n <= m -> Nat.max n m = m
...
...
Search for all facts involving a pattern in an hypothesis or conclusion:
Coq < Search (_ + O).
plus_n_O: forall n : nat, n = n + 0
The _ character serves as a wildcard, it can be used multiple times:
Coq < Search (S _ <= _).
le_S_n: forall n m : nat, S n <= S m -> n <= m
le...
Session Types are a way to tell the compiler about the protocol you want to use to communicate between threads - not protocol as in HTTP or FTP, but the pattern of information flow between threads. This is useful since the compiler will now stop you from accidentally breaking your protocol and causi...