Tutorial by Examples: and

Instead of specifying connection parameters like user and password (see a complete list here) in the URL or a separate parameters, you can pack them into a java.util.Properties object: /** * Connect to a PostgreSQL database. * @param url the JDBC URL to connect to. Must start with "jdbc:...
You can start Solr by running bin/solr from the Solr directory and this will start Solr in the background, listening on port 8983. $ bin/solr start To change the port Solr listens on, you can use the -p parameter when starting, such as: $ bin/solr start -p 8984 Since Solr is a server, it is more...
Rule of thumb: when garbage collection occurs, "live objects" are those still in use, while "dead objects" are those no longer used (any variable or field referencing them, if any, has gone out of scope before the collection occurs). In the following example (for convenience, Fi...
As Dispose() and finalizers are aimed to different purposes, a class managing external memory-heavy resources should implement both of them. The consequence is writing the class so that it handles well two possible scenarios: When only the finalizer is invoked When Dispose() is invoked first and...
Example of how to calculate the output shape and overcome the difficulties of using tf.nn.conv2d_transpose with unknown batch size (when input.get_shape() is (?, H, W, C) or (?, C, H, W)). def upconvolution (input, output_channel_size, filter_size_h, filter_size_w, stride_h, str...
The following code, inserted in your wp-config.php file, will log all errors, notices, and warnings to a file called debug.log in the wp-content directory. It will also hide the errors so they do not interrupt page generation. // Enable WP_DEBUG mode define( 'WP_DEBUG', true ); // Enable Debug...
Add the rx-android dependency as well as a current version of rx-java to the build.gradle. Because RxAndroid releases are few and far between, it is recommended you also explicitly depend on RxJava's latest version for bug fixes and new features. Rx1 compile 'io.reactivex:rxandroid:1.2.1' co...
Once you have installed Visual Studio from https://www.visualstudio.com/downloads/, start a new project. Select 'Windows Forms Application' from Visual Basic Tab. You can rename it here if you need to. Once you click 'OK', you will see this window: Click on the 'Toolbo...
Bridge Mode $ docker run –d –-name my_app -p 10000:80 image_name Note that we did not have to specify --net=bridge because this is the default working mode for docker. This allows to run multiple containers to run on same host without any assignment of dynamic port. So BRIDGE mode avoids the por...
Dialog dlg; DialogGroup dGrp; DialogField dfGender; dlg = new Dialog("Enum Dialog"); dGrp = dlg.addGroup("A Group"); dfGender = dlg.addField(enumStr(Gender), "Your Gender"); if (dlg.run()) { info(dfGender.value()); } Enums have to be wrapped inside a...
Dialog dlg; DialogGroup dGrp; DialogField dialogField; dlg = new Dialog("Evil Dialog"); dGrp = dlg.addGroup("A Group"); dialogField = dlg.addFieldValue(extendedTypeStr(NoYesId), NoYes::Yes, "I hereby sell my soul"); if (dlg.run()) { info(dialogField.valu...
Using yield break as opposed to break might not be as obvious as one may think. There are lot of bad examples on the Internet where the usage of the two is interchangeable and doesn't really demonstrate the difference. The confusing part is that both of the keywords (or key phrases) make sense only...
For this example, let's assume that the inputs have a dimensionality of (frames, channels, rows, columns), and the outputs have a dimensionality of (classes). from keras.applications.vgg16 import VGG16 from keras.models import Model from keras.layers import Dense, Input from keras.layers.pooling...
Now open the document using OpenXML, you must add an imagePart that references the picture object to the MainDocumentPart object by using a file stream, and get the ID of the image string temp; MainDocumentPart mainPart = document.MainDocumentPart; ImagePart ima...
Since you need to sort & rename the fields, the best option will be the Sort Component in the Data Flow task (like you mentioned) . If you only want to rename columns, then use the "Derived Column" component. The Sort component should look as follows: In my example, you can see the ...
Installation of a vmod requires an installed version of Varnish Cache, including the development files. Requirements can be found in the Varnish documentation. Source code is built with autotools: sudo apt-get install libvarnishapi-dev || sudo yum install varnish-libs-devel ./bootstrap # If run...
Configuration In the following paragraphs there wil be an example per browser for the configuration in Json and setup in C#. This example expects you to have all the drivers in your path variable and browsers installed. Microsoft Edge C# code to create a remote webdriver // Defining webdriver v...
Configuration In the following paragraphs there wil be an example per browser for the configuration in Json and setup in C#. This example expects you to have all the browsers installed and the drivers in your path variable Microsoft Edge C# code to create a remote webdriver // Defining webdrive...
MultiDex is a library in the Android APK that allows the app to have more than 65,536 methods. The Android APKs have Dalvik Executable files (.dex) that contain the generated bytecodes compiled from your Java code. Each .dex file can contain up to 65,536 methods (2^16). Android OS versions before ...
Pipes supports simple binary communication between a client and a server In this example: a client connects and sends a FirstMessage the server receives and answers DoSomething 0 the client receives and answers DoNothing step 2 and 3 are repeated indefinitely The command data type exchange...

Page 137 of 153