Tutorial by Examples

#include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); /* example.com is redirected, so we tell libcurl to follow redirect...
There are two basic ways in which you can Insert a document Create a document, Then insert it var bucket = cluster.OpenBucket("default"); var document = new Document<dynamic> { Id = "doc_net", Content = new { name = &quo...
Welcome to the world of Graphs. If you have connected data then you might need one of the types of graphs to model those patterns. There are several things that can be done with Graphs like mapping traffic patterns, managing water distribution networks, social media analysis, etc... At it's heart ...
Some collection types can be initialized at the declaration time. For example, the following statement creates and initializes the numbers with some integers: List<int> numbers = new List<int>(){10, 9, 8, 7, 7, 6, 5, 10, 4, 3, 2, 1}; Internally, the C# compiler actually converts this...
All of these main method styles can also be used with varargs: package my.program fun main(vararg args: String) { println("Hello, world!") }
Apart from the Javadoc documentation code can be documented inline. Single Line comments are started by // and may be positioned after a statement on the same line, but not before. public void method() { //single line comment someMethodCall(); //single line comment after statement }...
NSData can be represented as hexadecimal string, similar to what it outputs in its description method. Swift extension NSData { func hexString() -> String { return UnsafeBufferPointer<UInt8>(start: UnsafePointer<UInt8>(bytes), count: length) .reduce(&quo...
Same as above in the FOR SYSTEM_TIME FROM <start_date_time>TO <end_date_time> description, except the table of rows returned includes rows that became active on the upper boundary defined by the <end_date_time> endpoint. SELECT * FROM Employee FOR SYSTEM_TIME BETWEEN '201...
Returns a table with the values for all row versions that were active within the specified time range, regardless of whether they started being active before the <start_date_time> parameter value for the FROM argument or ceased being active after the <end_date_time> parameter value for t...
Returns a table with the values for all row versions that were opened and closed within the specified time range defined by the two datetime values for the CONTAINED IN argument. Rows that became active exactly on the lower boundary or ceased being active exactly on the upper boundary are included. ...
Returns the union of rows that belong to the current and the history table. SELECT * FROM Employee FOR SYSTEM_TIME ALL
Creating a temporal table with a default history table is a convenient option when you want to control naming and still rely on system to create history table with default configuration. In the example below, a new system-versioned memory-optimized temporal table linked to a new disk-based history t...
The ng-list directive is used to convert a delimited string from a text input to an array of strings or vice versa. The ng-list directive uses a default delimiter of ", " (comma space). You can set the delimiter manually by assigning ng-list a delimeter like this ng-list="; ". ...
By adding a header with content type as JSON: <?php $result = array('menu1' => 'home', 'menu2' => 'code php', 'menu3' => 'about'); //return the json response : header('Content-Type: application/json'); // <-- header declaration echo json_encode($result, true); // <--- e...
C++17 Thanks to int std::uncaught_exceptions(), we can implement action which executes only on success (no thrown exception in scope). Previously bool std::uncaught_exception() just allows to detect if any stack unwinding is running. #include <exception> #include <iostream> templa...
C++17 Thanks to int std::uncaught_exceptions(), we can implement action which executes only on failure (thrown exception in scope). Previously bool std::uncaught_exception() just allows to detect if any stack unwinding is running. #include <exception> #include <iostream> template ...
As always, you need to make sure you have the required permissions. public class MainActivity extends AppCompatActivity implements LocationListener{ private LocationManager mLocationManager = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCr...
As always, you need to make sure you have the required permissions. public class MainActivity extends AppCompatActivity implements LocationListener{ private LocationManager mLocationManager = null; HandlerThread mLocationHandlerThread = null; Looper mLocationHandlerLooper = null; ...
As the characters/digits can be anywhere within the string, we require lookaheads. Lookaheads are of zero width meaning they do not consume any string. In simple words the position of checking resets to the original position after each condition of lookahead is met. Assumption :- Considering non-wo...
This can be done with a bit of modification in the above regex ^(?=.{10,}$)(?=(?:.*?[A-Z]){2})(?=.*?[a-z])(?=(?:.*?[0-9]){2}).*$ or ^(?=.{10,}$)(?=(?:.*[A-Z]){2})(?=.*[a-z])(?=(?:.*[0-9]){2}).* Let's see how a simple regex ^(?=(?:.*?[A-Z]){2}) works on string abcAdefD Image Credit :- ht...

Page 742 of 1336