Tutorial by Examples: and

There are times when the framework's Random() class may not be considered random enough, given that it is based on a psuedo-random number generator. The framework's Crypto classes do, however, provide something more robust in the form of RNGCryptoServiceProvider. The following code samples demonstr...
Commands are used for handling Events in WPF while respecting the MVVM-Pattern. A normal EventHandler would look like this (located in Code-Behind): public MainWindow() { _dataGrid.CollectionChanged += DataGrid_CollectionChanged; } private void DataGrid_CollectionChanged(object sender, S...
Many modern Image Processing algorithms use patches are their basic element to work on. For instance one could denoise patches (See BM3D Algorithm). Yet when building the image form the processed patches we have many results for the same pixel. One way to deal with it is taking the average (Empir...
In this example we are going to implement spring-data-elasticsearch project to store POJO in elasticsearch. We will see a sample maven project which does the followings: Insert a Greeting(id, username, message) item on elasticsearch. Get All Greeting items which have been inserted. Update a Gr...
In this example we are going to see a maven based spring boot application which integrates spring-data-elasticsearch. Here, we will do the followings and see the respective code segments. Insert a Greeting(id, username, message) item on elasticsearch. Get all items from elasticsearch Update a s...
First of all, we will need to create our Dockerfile. A good example can be found on this blog by Nick Janetakis. This code contains the script that will be executed on our docker machine at the moment of start.For this reason, we are installing all the required libraries and ends with the start of ...
Create a tag: To create a tag on your current branch: git tag < tagname > This will create a local tag with the current state of the branch you are on. To create a tag with some commit: git tag tag-name commit-identifier This will create a local tag with the commit-identifier...
mView.afterMeasured { // inside this block the view is completely drawn // you can get view's height/width, it.height / it.width } Under the hood inline fun View.afterMeasured(crossinline f: View.() -> Unit) { viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlob...
Glide .with(context) .load(currentUrl) .into(new BitmapImageViewTarget(profilePicture) { @Override protected void setResource(Bitmap resource) { RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(context.g...
For very first step please make sure your java version is based on Oracle's JDK since the OpenJDP does not support JavaFX yet. So, go to the Oracle Java download page and download JDK suitable for your operating system and computer architecture. If you want to study Oracle's java examples, find th...
For connection, here is a snippet to help you understand: //Allows you to enumerate and communicate with connected USB devices. UsbManager mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE); //Explicitly asking for permission final String ACTION_USB_PERMISSION = "com.android.e...
Let's assume you got an html after selecting with soup.find('div', class_='base class'): from bs4 import BeautifulSoup soup = BeautifulSoup(SomePage, 'lxml') html = soup.find('div', class_='base class') print(html) <div class="base class"> <div>Sample text 1</div...
Let's consider situation when you parse number of pages and you want to collect value from element that's optional (can be presented on one page and can be absent on another) for a paticular page. Moreover the element itself, for example, is the most ordinary element on page, in other words no spec...
The npm scripts are commands that npm will run for you when called with the proper arguments. The power and sense of this is to NOT install the npm packages globally poluting your environment. The difference between pre-recognized and custom scripts relies on the run word between the tags, custom s...
JavaScript now have the Append and Prepend methods which was present in jQuery The main advantage of append and prepend is unlike appendChild and insertBefore, it can take any number of arguments either HTML element or plain text(which will be converted to text nodes). To append say 1 div, 1 text ...

Page 153 of 153