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...
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...
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...
Let's say your launch activity is called MainActivity, in your app com.example.myapp.
In the manifest:
<activity
android:name=".MainActivity"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
...
Bridge pattern decouples abstraction from implementation so that both can vary independently. It has been achieved with composition rather than inheritance.
Bridge UML diagram from wikipedia:
You have four components in this pattern.
Abstraction: It defines an interface
RefinedAbstraction: It ...
If the value of the href-attribute begins with tel:, your device will dial the number when you click it. This works on mobile devices or on computers/tablets running software – like Skype or FaceTime – that can make phone calls.
<a href="tel:11234567890">Call us</a>
Most de...
java.lang.ref package provides reference-object classes, which support a limited degree of interaction with the garbage collector.
Java has four main different reference types. They are:
Strong Reference
Weak Reference
Soft Reference
Phantom Reference
1. Strong Reference
This is the usual...
When expecting someone to reproduce an R code that has random elements in it, the set.seed() function becomes very handy.
For example, these two lines will always produce different output (because that is the whole point of random number generators):
> sample(1:10,5)
[1] 6 9 2 7 10
>...
Be aware that Microsoft Excel 2013 (and higher) uses Single Document
Interface (SDI) and that Excel 2010 (And below) uses Multiple Document
Interfaces (MDI).
This implies that for Excel 2013 (SDI), each workbook in a single instance of Excel contains its own ribbon UI:
Conversely for Excel...
From the documentation :
In C#, arguments can be passed to parameters either by value or by
reference. Passing by reference enables function members, methods,
properties, indexers, operators, and constructors to change the value
of the parameters and have that change persist in the calling
e...