Tutorial by Examples: and

If you try to submit tasks to a shutdown Executor or the queue is saturated (only possible with bounded ones) and maximum number of Threads has been reached, RejectedExecutionHandler.rejectedExecution(Runnable, ThreadPoolExecutor) will be called. The default behavior is that you'll get a Rej...
Functions which return a character vector Base R has two functions for invoking a system command. Both require an additional parameter to capture the output of the system command. system("top -a -b -n 1", intern = TRUE) system2("top", "-a -b -n 1", stdout = TRUE) ...
The advantages of using Session State are 1)Better security 2)Reduced bandwidth The disadvantages of using Session state are 1)More resource consumption of server. 2)Extra code/care if a Web farm is used(we will discuss this shortly) **Session State Modes** ...
To convert String to and from Data / NSData we need to encode this string with a specific encoding. The most famous one is UTF-8 which is an 8-bit representation of Unicode characters, suitable for transmission or storage by ASCII-based systems. Here is a list of all available String Encodings Stri...
public void ConfigureServices(IServiceCollection services) { services.AddCors(o => o.AddPolicy("MyPolicy", builder => { builder.AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader(); })); // ... } public void Configur...
public void ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddCors(); services.ConfigureCors(options => options.AddPolicy("AllowSpecific", p => p.WithOrigins("http://localhost:1233") ...
[MaxLength(int)] attribute can be applied to a string or array type property of a domain class. Entity Framework will set the size of a column to the specified value. using System.ComponentModel.DataAnnotations; public class Person { public int PersonID { get; set; } [MinLength(...
Title This band is showed once at the beginning of the report. It can be used as first page by setting the attribute isTitleNewPage="true" Page Header This appears at the beginning of each page excluding first page if Title band is used and last page if Summary band is used with setting...
Base plot install.packages('survminer') source("https://bioconductor.org/biocLite.R") biocLite("RTCGA.clinical") # data for examples library(RTCGA.clinical) survivalTCGA(BRCA.clinical, OV.clinical, extract.cols = "admin.disease_code") -> BRCAOV.sur...
In order to create a hotkey or hotstring that only triggers when certain windows are active or exist, you can put one or several of the following directives before the hotkey definition: #IfWinActive [, WinTitle, WinText] #IfWinExist [, WinTitle, WinText] #IfWinNotActive [, WinTitle, WinText] #I...
Alerts and errors are nearly the simplest of all Meteor component patterns. They're so simple, in fact, that they barely register as a pattern in of themselves. Instead of adding FlashAlert modules or patterns, all you really need to do is style a Handlebar template appropriate, add a helper, and wi...
var alphabet:Array = [ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S...
A lot of the value from local JVM unit tests comes from the way you design your application. You have to design it in such a way where you can decouple your business logic from your Android Components. Here is an example of such a way using the Model-View-Presenter pattern. Lets practice this out by...
Given this function: annualSalaryCalc :: (RealFloat a) => a -> a -> String annualSalaryCalc hourlyRate weekHoursOfWork | hourlyRate * (weekHoursOfWork * 52) <= 40000 = "Poor child, try to get another job" | hourlyRate * (weekHoursOfWork * 52) <= 120000 = "Money...
To enable or disable a BroadcastReceiver, we need to get a reference to the PackageManager and we need a ComponentName object containing the class of the receiver we want to enable/disable: ComponentName componentName = new ComponentName(context, MyBroadcastReceiver.class); PackageManager packageM...
CoffeeScript is a scripting language that compiles into JavaScript. Any code written in CoffeeScript can be translated into JavaScript with a one-to-one matching. CoffeeScript can be easily installed with npm: $ mkdir coffee && cd coffee $ npm install -g coffee-script The -g flag will ...
To list all available schemes for the project in your current directory xcodebuild -list Optionally you can pass a path to a project or workspace file xcodebuild -list -workspace ./MyApp.xcworkspace xcodebuild -list -project ./MyApp.xcodeproj Example output Information about project "...
public void MoveToStateAndExecuteActions(Item item, ID workflowStateId) { Sitecore.Workflows.IWorkflowProvider workflowProvider = Item.Database.WorkflowProvider; Sitecore.Workflows.IWorkflow workflow = workflowProvider.GetWorkflow(item); // if item is in any workflow if (workf...
Thanks to this great post If we want to mimic the Sitecore UI behavior and execute the command which will change the workflow state, we need to use WorkflowProvider to get an instance of the workflow assigned to the given item and call Execute method with a chosen command ID. This will fire all the...
using System; public class Program { public static void Main() { var date = new DateTime(2016,12,31); Console.WriteLine(date.ToString()); //Outputs: 12/31/2016 12:00:00 AM Console.WriteLine(date.ToShortDateString()); //Out...

Page 63 of 153