Tutorial by Examples: and

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...
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...
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...
Android Activity package com.example.myapp; import android.os.Bundle; import android.app.Activity; import android.webkit.WebView; public class WebViewActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceSta...
The GNU gprof profiler, gprof, allows you to profile your code. To use it, you need to perform the following steps: Build the application with settings for generating profiling information Generate profiling information by running the built application View the generated profiling inf...
The QueryClose event is raised whenever a form is about to be closed, whether it's via user action or programmatically. The CloseMode parameter contains a VbQueryClose enum value that indicates how the form was closed: ConstantDescriptionValuevbFormControlMenuForm is closing in response to user act...
Here are simplified steps (based on the official documentation) required to create a Firebase project and connect it with an Android app. Add Firebase to your app Create a Firebase project in the Firebase console and click Create New Project. Click Add Firebase to your Android app and fol...
To create a custom standalone Gradle plug-in using java (you can also use Groovy) you have to create a structure like this: plugin |-- build.gradle |-- settings.gradle |-- src |-- main | |-- java | |-- resources | |-- META-INF | |-- gradle-plugins ...
After installing a Java SDK, it is advisable to check that it is ready to use. You can do this by running these two commands, using your normal user account: $ java -version $ javac -version These commands print out the version information for the JRE and JDK (respectively) that are on your sh...
boost::program_options::notify can be used to report any errors in the paramters passing #include <boost/program_options.hpp> #include <string> #include <iostream> int main(int argc, char** argv) { namespace po = boost::program_options; po::variables_map vm; po::op...
When writing wrappers for unmanaged resources, you should subclass SafeHandle rather than trying to implement IDisposable and a finalizer yourself. Your SafeHandle subclass should be as small and simple as possible to minimize the chance of a handle leak. This likely means that your SafeHandle imple...
1-You need to connect your device to your computer via USB cable. Make sure USB debugging is working. You can check if it shows up when running adb devices(or tns device). 2-Run adb tcpip 5555 3-Disconnect your device (remove the USB cable). 4-Go to the Settings -> About phone -> Status...
Create new patches with hg qnew patch-name and then update them with new changes with hg qrefresh: hg qnew myFirstPatch // Creates a new patch called "myFirstPatch" ... // Edit some files hg qrefresh // Updates "myFirstPatch" with changes hg qnew ...
Pushing a patch applies the patch to the repository while poping a patch unapplies the patch from the repository. Pop the current patch off the queue with hg qpop and push it back onto the queue with hg qpush: hg qpop hg qpush Pop all patches: hg qpop -a PUsh all patches: hg qpush -a ...
qnew: create a new patch qpop: pop the current patch off the stack qpush: push the next patch onto the stack qrefresh: update the current patch qapplied: print the patches already applied qseries: print the entire series file qfinish: move applied patches into repository history qdelete: re...
If we want to test JavaScript on a website, we'll need to use something a bit more powerful than Goutte (which is just cURL via Guzzle). There are a couple of options such as ZombieJS, Selenium and Sahi. For this example I'll use Selenium. First you'll need to install the drivers for Mink: $ compo...
Django 1.10 introduced a new middleware style where process_request and process_response are merged together. In this new style, a middleware is a callable that returns another callable. Well, actually the former is a middleware factory and the latter is the actual middleware. The middleware facto...
The latest version of the Oracle Java style guide mandates that the "then" and "else" statements in an if statement should always be enclosed in "braces" or "curly brackets". Similar rules apply to the bodies of various loop statements. if (a) { //...
Documenting your work Remember what you've done and retain long outputs which can't be kept in WinDbg's buffer. It's always good to have a log available for reproducing debugging steps, e.g. to ask questions on Stack Overflow. CommandPurpose.logopencreate a log file.logcloseclose the log file.dump...

Page 84 of 153