The RelayCommand implements the ICommand interface and can therefore be used to bind to Commands in XAML (as the Command property of the Button element)
The constructor takes two arguments; the first is an Action which will be executed if ICommand.Execute is called (e.g. the user clicks on the butt...
The RelayCommand<T> is similar to the RelayCommand, but allows to directly pass an object to the command. It implements the ICommand interface and can therefore be used to bind to Commands in XAML (e.g. as the Command property of the Button element). You can then use the CommandParameter prope...
The ObservableObject class contains some helpful methods to help with the MVVM pattern.
The RaisePropertyChanged provides a compile safe method to raise property changed events.
It can be called with
RaisePropertyChanged(() => MyProperty);
The Set method can be used in the property setter t...
ViewModelBase extends ObservableObject and adds some methods useful for viewmodels.
The property IsInDesignMode or IsInDesignModeStatic allows to determine if the code is executed in the design mode (in Visual Studio Design View) or not. The two properties are exactly the same.
Tables are most easily included with the DT package, which is an R interface to the JavaScript library DataTables.
library(shiny)
library(DT)
ui <- fluidPage(
dataTableOutput('myTable')
)
server <- function(input, output, session){
output$myTable <- renderDataTable({
dat...
reactiveValues can be used to store objects, to which other expressions can take a dependency.
In the example below, a reactiveValues object is initialized with value "No text has been submitted yet.". A separate observer is created to update the reactiveValues object whenever the submit ...
Valgrind is GPLv2-licensed collection of dynamic analysis tools, which uses binary instrumentation (dynamic recompilation). Six tools are included to detect memory management (Memcheck) and threading errors (Helgrind and DRD), to generate call-graph and profile programs (with optional cache and bran...
One can use the command-line launching facility is when one wants to customize some aspects of the way MySQL Workbench operates.
MySQL Workbench has the following common command line options:
--admin instance - Launch MySQL Workbench and load the server instance specified.
--query connection - ...
Here we first fetch our parent product and the we will get all children products that this parent have.
<?php
namespace Test\Test\Controller\Test;
use Magento\Framework\App\Action\Context;
class Products extends \Magento\Framework\App\Action\Action
{
public function __cons...
EPPlus also supports the ability to insert text in a cell using the Insert() method. For example:
var file = new FileInfo(filePath);
using (var p = new ExcelPackage(file))
{
var wb = p.Workbook;
var ws = wb.Worksheets.FirstOrDefault() ?? wb.Worksheets.Add("Sheet1");
var...
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var firstTabNavigationController : UINavigationController!
var secondTabNavigationControoller : UINavigationController!
var thirdTabNavigationController : UINavigationController!
var fourth...
Aggregating with dplyr is easy! You can use the group_by() and the summarize() functions for this. Some examples are given below.
CODE:
# Aggregating with dplyr
library(dplyr)
df = data.frame(group=c("Group 1","Group 1","Group 2","Group 2","Group 2&...
Sometimes the download takes longer than the cell is being displayed. In this case it can happen, that the downloaded image is shown in the wrong cell. To fix this we can not use the UIImageView Extension.
We still will be using Alamofire however we will use the completion handler to display the im...
Use .outerHTML to get the HTML
Here is a code sample to get the entire HTML of the website
private async void GetHTMLAsync()
{
var siteHtML = await webView.InvokeScriptAsync("eval", new string[] { "document.documentElement.outerHTML;" });
}
Use .click() to simulate click
Here is a code sample to click search button on Bing website
private async void SimulateClickAsync()
{
var functionString = string.Format(@"document.getElementsByClassName('b_searchboxSubmit')[0].click();");
await webView.InvokeScriptAsync("...
I have read and watched a lot of different Dagger2 tutorials but most of them are too long or hard to understand so I decided to write a new simple and short tutorial for Dagger2, I hope you like it.
Why we need it?
Simplifies access to shared instances: It provides a simple way to obtain refere...
var myVariable = "This is a variable!";
This is an example of defining variables. This variable is called a "string" because it has ASCII characters (A-Z, 0-9, !@#$, etc.)