Tutorial by Examples: dc

Viridis (named after the chromis viridis fish) is a recently developed color scheme for the Python library matplotlib (the video presentation by the link explains how the color scheme was developed and what are its main advantages). It is seamlessly ported to R. There are 4 variants of color scheme...
A controlled component is bound to a value and its changes get handled in code using event based callbacks. class CustomForm extends React.Component { constructor() { super(); this.state = { person: { firstName: '', lastName: '' } } } ...
Registering a custom post type does not mean it gets added to the main query automatically. You need to use pre_get_posts filter to add custom post types to main query. // Show posts of 'post' and 'book' custom post types on home page add_action( 'pre_get_posts', 'add_my_post_types_to_query' ); ...
You can add below hooks to add your own logo and link to replace default wordpress logo. To add custom logo function custom_login_logo() { echo '<style type="text/css"> h1 a { background-image: url('.get_bloginfo('template_directory').'/images/custom-logo.png) !important; backgro...
There are already implemented forms within Django to change the user password, one example being SetPasswordForm. There aren't, however, forms to modify the user e-mail and I think the following example is important to understand how to use a form correctly. The following example performs the foll...
Channel adapter is one of message endpoints in Spring Integration. It is used for unidirectional message flow. There are two types of channel adapter: Inbound Adapter: input side of the channel. Listen or actively read message. Outbound Adapter: output side of the channel. Send message to Java cla...
In the Spring Integration Reference Docuement, it says: The outbound Channel Adapter is the inverse of the inbound: its role is to handle a message and use it to execute a SQL query. The message payload and headers are available by default as input parameters to the query... Java code p...
This is just an extension on the sealed trait variant where a macro generates a set with all instances at compile time. This nicely omits the drawback that a developer can add a value to the enumeration but forget to add it to the allElements set. This variant especially becomes handy for large en...
One needs the predicted probabilities in order to calculate the ROC-AUC (area under the curve) score. The cross_val_predict uses the predict methods of classifiers. In order to be able to get the ROC-AUC score, one can simply subclass the classifier, overriding the predict method, so that it would a...
In Controller: $this->load->model('your_model'); $data['model'] = $this->your_model; In view: $model->your_method;
//fill column A with solid red color from hex worksheet.Column(1).Style.Fill.PatternType = ExcelFillStyle.Solid; worksheet.Column(1).Style.Fill.BackgroundColor.SetColor(ColorTranslator.FromHtml("#FF0000")); //fill row 4 with striped orange background worksheet.Row(4).Style.Fill.Patte...
The size of the content will be the same as that of its ScrollPane container. import javafx.scene.control.ScrollPane; //Import the ScrollPane import javafx.scene.control.ScrollPane.ScrollBarPolicy; //Import the ScrollBarPolicy import javafx.scene.layout.Pane; ScrollPane scrollpane; Pane con...
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...
This: class Villain(val minions: Map[String, Minion]) extends Dynamic { def applyDynamic(name: String)(jobs: Task*) = jobs.foreach(minions(name).do) def applyDynamicNamed(name: String)(jobs: (String, Task)*) = jobs.foreach { // If a parameter does not have a name, and is simply given, th...
At the end of the document add the following: \bibliographystyle{style} \bibliography{file location} Create a file with extension .bib and save the citation as follows: @inproceedings{citation_name, title={Paper Title}, author={List Authors}, pages={45--48}, year={2013}, organizat...
Required JARs on classpath: javax.money:money-api:1.0 (JSR354 money and currency api) org.javamoney:moneta:1.0 (Reference implementation) javax:annotation-api:1.2. (Common annotations used by reference implementation) // Let's create non-ISO currency, such as bitcoin // At first, t...
The static factory method is a variation of the factory method pattern. It is used to create objects without having to call the constructor yourself. When to use the Static Factory Method if you want to give a meaningfull name to the method that generates your object. if you want to avoid over...
import matplotlib.pyplot as plt import numpy as np # generate 101 x and y values between -10 and 10 x = np.linspace(-10, 10, 101) y = np.linspace(-10, 10, 101) # make X and Y matrices representing x and y values of 2d plane X, Y = np.meshgrid(x, y) # compute z value of a point as a fun...
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 => ...
When dealing with large configuration sets of value, it might become quite unhandy to load them one buy one. Option model which comes with asp.net offers a convenient way to map a section to a dotnet poco: For instance, one might hydrate StorageOptions directly from a configuration section b addin...

Page 22 of 28