Tutorial by Examples: dis

A common usecase is to discard certain rest-calls, that are not needed any more after certain user-inputs. The most prominent example would be, when a user uses some search-function, makes a request, makes another request and for some reason the first request arrives after the second request and the...
What is Concurrency? Doing multiple things at the same time. Taking advantage of number of cores available in multicore CPUs. Running multiple programs in parallel. Objectives of Concurrency Running program in background without hogging CPU. Define Tasks, Define Rules and let...
If our component is not ready and waiting for data from server, then we can add loader using *ngIf. Steps: First declare a boolean: loading: boolean = false; Next, in your component add a lifecycle hook called ngOnInit ngOnInit() { this.loading = true; } and after you get complete dat...
This example will register an vuex module dynamically for storing custom notifications that can automatically dismissed notifications.js resolve vuex store and define some constants //Vuex store previously configured on other side import _store from 'path/to/store'; //Notification default dur...
Web Forms: Complex Page Life Cycle, whenever a Request is made to the server there are at least 5 methods to execute previous to the event handler. Dificult to work with Client-Side frameworks like JQuery or Angular. Hard to work with Asyncronous Javascript and XML (AJAX) Viewstate handling T...
To leverage distributed cache, you'll have to reference one of the available implementations : Redis Sql server For instance you'll register Redis implemention as follows : public void ConfigureServices(IServiceCollection services) { services.AddDistributedRedisCache(options => ...
There are cases when you need to change Display Name of column in a list view e.g. Column Name showing in the view is "IsApprovalNeeded" and you want to appear as "Is Approval Needed?". You can, of course change the display name of a column by changing the column title in list ...
Note: This only works for the built-in keyboard provided by iOS SWIFT: In order for the view of a UIViewController to increase the origin of the frame when it is presented and decrease it when it is hidden, add the following functions to your class: func keyboardWillShow(notification: NSNotificat...
The PERCENT_RANK function calculates the ranking of a row relative to the row set. The percentage is based on the number of rows in the group that have a lower value than the current row. The first value in the result set always has a percent rank of zero. The value for the highest-ranked – or last...
The PERCENTILE_DISC function lists the value of the first entry where the cumulative distribution is higher than the percentile that you provide using the numeric_literal parameter. The values are grouped by rowset or partition, as specified by the WITHIN GROUP clause. The PERCENTILE_CONT functi...
Generally you should always define all variable and parameters as NO-UNDO unless you really need to. DEFINE VARIABLE cString AS CHARACTER NO-UNDO. cString = "HELLO". DISPLAY cString.
Let's consider the below snippet, Get-ChildItem -Path C:\MyFolder | Select-Object Name, CreationTime, Length It simply output the folder content with the selected properties. Something like, What if I want to display the file size in KB ? This is where calcualted properties comes handy. Get-...
First create a disposable class: public class MyDisposableHelper: IDisposable { private bool _disposed; private readonly ViewContext _viewContext; public MyDisposableHelper(ViewContext viewContext) { if (viewContext == null) { throw ne...
The creators of Swift have put a lot of attention into making the language expressive and error handling is exactly that, expressive. If you try to invoke a function that can throw an error, the function call needs to be preceded by the try keyword. The try keyword isn't magical. All it does, is mak...
To get general statistics about main components of Linux family of stat commands are extremely useful CPU To get processors related statistics you can use mpstat command but with some options it will provide better visibility: $ mpstat 2 10 Memory We all know command free to show amount of (r...
DispatchGroup allows for aggregate synchronization of work. You can use them to submit multiple different work items and track when they all complete, even though they might run on different queues. This behavior can be helpful when progress can’t be made until all of the specified tasks are c...
DispatchSemaphore provides an efficient implementation of a traditional counting semaphore, which can be used to control access to a resource across multiple execution contexts. A scenario for when to use a semaphore could be if you are doing some file reading/writing, if multiple tasks are t...
Swift 3 Serial Queue func serialQueues () { let serialQueue = DispatchQueue(label: "com.example.serial") //default queue type is a serial queue let start = Date () for i in 0...3 { //launch a bunch of tasks serialQueue.a...
Abstract Class : package base; /* Abstract classes cannot be instantiated, but they can be subclassed */ public abstract class ClsVirusScanner { //With One Abstract method public abstract void fnStartScan(); protected void fnCheckForUpdateVersion(){ System....
General Properties: An Azimuthal Equidistant projection is best recognized when used in polar areas. It is used in the UN's emblem. From the center point, angle and distance are preserved. But the projection will distort shape and area to achieve this, especially as one moves further from the cente...

Page 15 of 18