It is simple to start using Redis using docker:
docker pull redis
docker run -p 6379:6379 --rm --name redis redis
Now you have running instance on port 6397
Attention: All data will be deleted, when Redis will be stopped.
To connect the redis-cli, start another docker:
docker run -it --link ...
import {User} from 'backend/user'; // import custom class
import {inject} from 'aurelia-framework'; // allows us to inject
@inject(User) // inject custom class
export class ProfileView {
constructor(user) { // use instance of custom class as a parameter to the constructor
this.user = us...
Entity falling distance is the distance the entity have fallen without reaching a block.
It can be used to calculate different damage from falling, or activating an effect after a big fall.
Retrieving the falling distance
float distanceFell = entity.getFallingDistance();
Setting the falling ...
Basic reading image from java
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.imgcodecs.Imgcodecs;
//Load native library
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
//Mat object used to host the image
Mat imageArray;
//Read image file from vile system
ima...
Redis has a Windows port provided by 'Microsoft Open Technologies'.
You can use the msi installer found on:
https://github.com/MSOpenTech/redis/releases
After installation completes you can see 'Redis' is a Windows service (and it's status should be "Started")
To write an 'Hello world'...
The IE=Edge meta tag is for telling the destination rendering engine to use the latest (edge) version of IE rendering engine, which enables responsive behavior in Windows phones.
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Occasionally this breaks images in Li...
Apple iOS 10 Mail doesn't always auto-scale non-responsive emails. The auto-scale meta tag can be used to disable auto-scale feature in iOS 10 Mail entirely.
<meta name="x-apple-disable-message-reformatting">
In order to create a scheduler,the entry needs to be created in
liferay-portlet.xml
provding scheduler class and trigger value for timing of scheduler triggering
<portlet-name>GetSetGo</portlet-name>
<icon>/icon.png</icon>
<scheduler-entry>
...
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...
# imports
import weka.classifiers.bayes.BayesNet as BayesNet
import weka.core.converters.ConverterUtils.DataSource as DS
import weka.gui.graphvisualizer.GraphVisualizer as GraphVisualizer
import javax.swing.JFrame as JFrame
import os
# load data
data = DS.read(os.environ.get("MOOC_DATA...
1. Go to File --> Settings (e.g. Ctrl+Alt+S ).
2. In the left-hand pane, select Plugins.
3. On the Plugins window, click "Install plugin from disk button".
4. Select the desired plugin from your local machine.
Click Apply button of the Settings/Preferences dialog.
O...
The cluster library contains the ruspini data - a standard set of data for illustrating cluster analysis.
library(cluster) ## to get the ruspini data
plot(ruspini, asp=1, pch=20) ## take a look at the data
hclust expects a distance matrix, not the original data. We ...
Let
df = pd.DataFrame({'col_1':['A','B','A','B','C'], 'col_2':[3,4,3,5,6]})
df
# Output:
# col_1 col_2
# 0 A 3
# 1 B 4
# 2 A 3
# 3 B 5
# 4 C 6
To get the distinct values in col_1 you can use Series.unique()
df['col_1'].unique()
# Output:
...
We now illustrate the functions dbinom,pbinom,qbinom and rbinom defined for Binomial distribution.
The dbinom() function gives the probabilities for various values of the binomial variable. Minimally it requires three arguments. The first argument for this function must be a vector of quantiles(the...
//Using File.WriteAllBytes
using (ExcelPackage excelPackage = new ExcelPackage())
{
//create a new Worksheet
ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets.Add("Sheet 1");
//add some text to cell A1
worksheet.Cells["A1"].Value = "My secon...
//Using File.WriteAllBytes
using (ExcelPackage excelPackage = new ExcelPackage())
{
//create a new Worksheet
ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets.Add("Sheet 1");
//add some text to cell A1
worksheet.Cells["A1"].Value = "My fourt...
To display current version, we can use VERSION from @angular/core package.
import { Component, VERSION } from '@angular/core';
@Component({
selector: 'my-app',
template: `<h1>Hello {{name}}</h1>
<h2>Current Version: {{ver}}</h2>
`,
})
export class AppCompone...