Suppose we have container "CustomersContainer" which connects a "Customers" dumb component to the Redux store.
In index.js:
import { Component }, React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-redux';
import { createStore } from 'redu...
In this example we use a parameter in the route to specify the page number. We set a default of 1 in the function parameter page=1. We have a User object in the database and we query it, ordering in descending order, showing latest users first. We then use the paginate method of the query object in ...
I find that the examples in the docker inspect documentation seem magic, but do not explain much.
Docker inspect is important because it is the clean way to extract information from a running container
docker inspect -f ... container_id
(or all running container)
docker inspect -f ... $(docker p...
Suppose you are searching for a Title Case pattern in a large text file and you want to edit a incorrect regular expression:
First, go into Ex mode by typing q:
You will now see all the commands that you typed in commandline mode, press j to go the regular expression you want to edit (/\v[A-Z]\w...
Often you will want to have an input box that takes numbers only. Again by deriving from the standard controls this is easily achieved, for example:
using System;
using System.Windows.Forms;
using System.Globalization;
namespace StackOverflowDocumentation
{
public class SONumberBox : SO...
Here is our function to create a simple ajax call written in vanilla javascript (not es2015):
function ajax(url, callback) {
var xhr;
if(typeof XMLHttpRequest !== 'undefined') xhr = new XMLHttpRequest();
else {
var versions = ["MSXML2.XmlHttp.5.0",
...
There is this thing called Zalgo Text which pushes this to the extreme. Here is the first grapheme cluster of the example. It consists of 15 code points: the Latin letter H and 14 combining marks.
H̡̫̤̤̣͉̤ͭ̓̓̇͗̎̀
Although this doesn't show up in normal text, it shows that a “character” r...
User defined table functions represented by org.apache.hadoop.hive.ql.udf.generic.GenericUDTF interface. This function allows to output multiple rows and multiple columns for a single input.
We have to overwrite below methods :
1.we specify input and output parameters
abstract StructObjectInspe...
This custom UserControl will appear as a regular combobox, but unlike the built-in ComboBox object, it can show the user a default string of text if they have not made a selection yet.
In order to accomplish this, our UserControl will be made up of two Controls. Obviously we need an actual ComboBox...
[TestCase(0, 0, 0)]
[TestCase(34, 25, 59)]
[TestCase(-1250, 10000, 8750)]
public void AddNumbersTest(int a, int b, int expected)
{
// Act
int result = a + b;
// Assert
Assert.That(result, Is.EqualTo(expected));
}
This can be done in 3 steps :
You must define an elixir module which use Ecto.Repo and register your app as an otp_app.
defmodule Repo do
use Ecto.Repo, otp_app: :custom_app
end
You must also define some config for the Repo which will allow you to connect to the database. Here is an...
After a statement was executed, a call to sqlite3_reset() brings it back into the original state so that it can be re-executed.
Typically, while the statement itself stays the same, the parameters are changed:
const char *sql = "INSERT INTO MyTable(ID, Name) VALUES (?, ?)";
sqlite3_stmt...
/// <summary>
/// Overrides the onDisconnected function and sets the user object to offline, this can be checked when other players interacts with them...
/// </summary>
/// <param name="stopCalled"></param>
/// <returns></returns>...