Tutorial by Examples

In PCRE, matched groups used for backreferences before a recursion are kept in the recursion. But after the recursion they all reset to what they were before entering it. In other words, matched groups in the recursion are all forgotten. For example: (?J)(?(DEFINE)(\g{a}(?<a>b)\g{a}))(?<a...
In PCRE, it doesn't trackback after the first match for a recursion is found. So (?(DEFINE)(aaa|aa|a))(?1)ab doesn't match aab because after it matched aa in the recursion, it never try again to match only a.
the steps in this example will use the following project structure as a demonstration and we intend to export it to the "GHTuts" Repository [Note that the Repo doesn't exist yet on github] but leave the "SensitiveProject" without publish as it contains some passwords, keys, et...
Prerequisite steps: Install Java at your machine Visit neo4j website and click the link "Download Community Edition" or visit directly the download link. Unzip the .tar downloaded file in your home directory Start Neo4j from console (headless, without web server) Visit the sub-d...
C++14 Those following complex user literals are declared in the namespace std::literals::complex_literals, where both literals and complex_literals are inline namespaces. Access to these operators can be gained with using namespace std::literals, using namespace std::complex_literals, and using nam...
This is our buffer: void write_buffer(size_t size, char ** buffer) { char * buf = *buffer; size_t iter; for(iter = 0; iter < size; iter++) { putc(*(buf + iter)); } } The cursor is at [1][1] ([line][col]). Move the cursor to the curl bracket of the for loop...
The common idiom for loading shared library files in Java is the following : public class ClassWithNativeMethods { static { System.loadLibrary("Example"); } public native void someNativeMethod(String arg); ... Calls to System.loadLibrary are almost always...
Quite often you have a file which was edited within DOS or Windows and you are viewing it under UNIX. This can look like the following when you view the file with vi. First line of file^M Next Line^M And another^M If you wish to remove the ^M, it can be that you delete each ^M by hand. Alter...
Download and install the latest Eclipse IDE Install Eclipse one of two ways: Eclipse Installer Download the zip for your favorite package If you don't already have a preferred Eclipse package, Eclipse for JavaScript Developers is recommended Install SuiteCloud IDE plugin Once i...
Timers are used to perform tasks at specific intervals of time (Do X every Y seconds) Below is an example of creating a new instance of a Timer. NOTE: This applies to Timers using WinForms. If using WPF, you may want to look into DispatcherTimer using System.Windows.Forms; //Timers use the Wi...
All actions performed in a timer are handled in the "Tick" event. public partial class Form1 : Form { Timer myTimer = new Timer(); public Form1() { InitializeComponent(); myTimer.Tick += myTimer_Tick; //assign the event handler named "myT...
public partial class Form1 : Form { Timer myTimer = new Timer(); int timeLeft = 10; public Form1() { InitializeComponent(); //set properties for the Timer myTimer.Interval = 1000; myTimer.Enabled = tru...
Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\stack\index.php on line 4 If you get an error like this (or sometimes unexpected $end, depending on PHP version), you will need to make sure that you've matched up all inverted commas, all parentheses, all curly braces, all brac...
If you get an error like this: Fatal error: Call to a member function fetch_assoc() on boolean in C:\xampp\htdocs\stack\index.php on line 7 Other variations include something along the lines of: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given... These errors mean that t...
This will only install PHP. If you wish to serve a PHP file to the web you will also need to install a web-server such as Apache, Nginx, or use PHP's built in web-server (php version 5.4+). If you are in a Ubuntu version below 16.04 and want to use PHP 7 anyway, you can add Ondrej's PPA repo...
You can use NLTK (especially, the nltk.tokenize package) to perform sentence boundary detection: import nltk text = "This is a test. Let's try this sentence boundary detector." text_output = nltk.tokenize.sent_tokenize(text) print('text_output: {0}'.format(text_output)) Output: tex...
You first need to run a Stanford CoreNLP server: java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 50000 Here is a code snippet showing how to pass data to the Stanford CoreNLP server, using the pycorenlp Python package. from pycorenlp import Stanf...
Simple Assignment = is a simple assignment. It creates a new local variable if the variable was not previously referenced. x = 3 y = 4 + 5 puts "x is #{x}, y is #{y}" This will output: x is 3, y is 9 Parallel Assignment Variables can also be assigned in parallel, e.g. x, y = 3,...
My first Wicket setup, app showing Hello World on home screen: import org.apache.wicket.protocol.http.WebApplication; public class HelloWorldApplication extends WebApplication { public HelloWorldApplication() { } @Override public Class getHomePage() { retur...
A type class is simply a trait with one or more type parameters: trait Show[A] { def show(a: A): String } Instead of extending a type class, an implicit instance of the type class is provided for each supported type. Placing these implementations in the companion object of the type class all...

Page 512 of 1336