To get Unix Epoch Time, use the constant timeIntervalSince1970:
Swift
let date = NSDate() // current date
let unixtime = date.timeIntervalSince1970
Objective-C
NSDate *date = [NSDate date]; // current date
int unixtime = [date timeIntervalSince1970];
Uppercase and lowercase letters of the alphabet are equivalent in the
Fortran character set. In other words, Fortran is case insensitive. This behavior is in contrast with case-sensitive languages, such as C++ and many others.
As a consequence, the variables a and A are the same variable. In princ...
Let's say we want to replace only numbers with 2 digits: regular expression will find them with (\d\d)
SELECT REGEXP_REPLACE ('2, 5, and 10 are numbers in this example', '(\d\d)', '#')
FROM dual;
Results in:
'2, 5, and # are numbers in this example'
If I want to swap parts of the text, I us...
Let's say you have an object like this:
var myObject = {
name: 'Peter'
}
Later in your code, you try to access myObject.name and you get George instead of Peter. You start wondering who changed it and where exactly it was changed. There is a way to place a debugger (or something else) on e...
Use Nested Loops.
Usage : use_nl(A B)
This hint will ask the engine to use nested loop method to join the tables A and B. That is row by row comparison. The hint does not force the order of the join, just asks for NL.
SELECT /*+use_nl(e d)*/ *
FROM Employees E
JOIN Departments D on E.Department...
"Use DIRECT PATH method for inserting new rows".
The APPEND hint instructs the engine to use direct path load. This means that the engine will not use a conventional insert using memory structures and standard locks, but will write directly to the tablespace the data. Always creates new b...
Sample Data:
CREATE TABLE table_name ( id, list ) AS
SELECT 1, 'a,b,c,d' FROM DUAL UNION ALL -- Multiple items in the list
SELECT 2, 'e' FROM DUAL UNION ALL -- Single item in the list
SELECT 3, NULL FROM DUAL UNION ALL -- NULL list
SELECT 4, 'f,,g' FROM DUAL; -- NULL item...
Sample Data:
CREATE TABLE table_name ( id, list ) AS
SELECT 1, 'a,b,c,d' FROM DUAL UNION ALL -- Multiple items in the list
SELECT 2, 'e' FROM DUAL UNION ALL -- Single item in the list
SELECT 3, NULL FROM DUAL UNION ALL -- NULL list
SELECT 4, 'f,,g' FROM DUAL; -- NULL item...
Sample Data:
CREATE TABLE table_name ( id, list ) AS
SELECT 1, 'a,b,c,d' FROM DUAL UNION ALL -- Multiple items in the list
SELECT 2, 'e' FROM DUAL UNION ALL -- Single item in the list
SELECT 3, NULL FROM DUAL UNION ALL -- NULL list
SELECT 4, 'f,,g' FROM DUAL; -- NULL item...
User can add custom route, mapping an URL to a specific action in a controller. This is used for search engine optimization purpose and make URLs readable.
routes.MapRoute(
name: "AboutUsAspx", // Route name
url: "AboutUs.aspx", // URL with parameters
defaults: new { c...
Often people try to index some content and then find it. If they cannot see the expected result, they try to troubleshoot the whole end-to-end process. The better way is to see whether the content actually indexed in the expected fields. This way it splits the problem into two: indexing and searchin...
You can implement the swipe-to-dismiss and drag-and-drop features with the RecyclerView without using 3rd party libraries.
Just use the ItemTouchHelper class included in the RecyclerView support library.
Instantiate the ItemTouchHelper with the SimpleCallback callback and depending on which functi...
var dict = ["name": "John", "surname": "Doe"]
// Set the element with key: 'name' to 'Jane'
dict["name"] = "Jane"
print(dict)
using System.Net;
using System.IO;
...
string requestUrl = "https://www.example.com/submit.html";
HttpWebRequest request = HttpWebRequest.CreateHttp(requestUrl);
request.Method = "POST";
// Optionally, set properties of the HttpWebRequest, such as:
request.AutomaticD...
using System.Net;
using System.IO;
...
string requestUrl = "https://www.example.com/page.html";
HttpWebRequest request = HttpWebRequest.CreateHttp(requestUrl);
// Optionally, set properties of the HttpWebRequest, such as:
request.AutomaticDecompression = DecompressionMethods.GZ...