To allow multiple user registration on Ejabberd server, we need to configure file ejabberd.yml in Ejabberd latest versions. Configure ejabberd.yml like:
in access_rules: add
register:
- allow
register_from:
- allow
registration_timeout:
- infinity
mod_register:
acc...
Link function is best way in custom directives to manipulate DOM.
It takes three attributes as input (scope, element, attribute) in sequence
scope: its local scope object of directive.
element: html element on which directive is used.
attribute: it gives access to all attributes used in element ...
Generally tf.gather gives you access to elements in the first dimension of a tensor (e.g. rows 1, 3 and 7 in a 2-dimensional Tensor). If you need access to any other dimension than the first one, or if you don't need the whole slice, but e.g. only the 5th entry in the 1st, 3rd and 7th row, you are b...
navigator.mediaDevices is the common method adapted in Chrome and FF to getUserMedia as of now.
A promised based call back which returns local stream on success
navigator.mediaDevices.getUserMedia({ audio: true, video: true })
.then(stream => {
// attach this stream to window obje...
A Java 8 compatibility kit for Scala.
Most examples are copied from Readme
Converters between scala.FunctionN and java.util.function
import java.util.function._
import scala.compat.java8.FunctionConverters._
val foo: Int => Boolean = i => i > 7
def testBig(ip: IntPredicate) = ip.tes...
Sometimes Android's logcat is running infinitely with errors coming from some process not own by you, draining battery or just making it hard to debug your code.
A convenient way to fix the problem without restarting the device is to locate and kill the process causing the problem.
From Logcat
03...
You can use Scan or TryScan methods to look for specific messages in the queue and process them regardless of how many messages are before them. Both methods look at the messages in the queue in the order they arrived and will look for a specified message (up until optional timeout). In case there i...
To count the occurences of a value in a numpy array. This will work:
>>> import numpy as np
>>> a=np.array([0,3,4,3,5,4,7])
>>> print np.sum(a==3)
2
The logic is that the boolean statement produces a array where all occurences of the requested values are 1 and all o...
You can use cell references without row numbers.
For instance, the formula =sum(C:C) will add up all the values in column C of the active sheet. This is helpful when you are adding and removing rows but don't want to update your formulas each time.
There are some instances when using this whole co...
The following VHDL model drives signal s from two different processes. As the type of s is bit, an unresolved type, this is not allowed.
-- File md.vhd
entity md is
end entity md;
architecture arc of md is
signal s: bit;
begin
p1: process
begin
s <= '0';
wait;
e...
Processing Field collection items with Rules is fun, really! Have a look at this Rule (in Rules export format):
{ "rules_calculate_sum_of_prices_in_all_field_collection_items" : {
"LABEL" : "Calculate sum of prices in all field collection items",
"PLUGIN...
Keychain allows to save items with special SecAccessControl attribute which will allow to get item from Keychain only after user will be authenticated with Touch ID (or passcode if such fallback is allowed). App is only notified whether the authentication was successful or not, whole UI is managed b...
strComputer = "."
instances = 0
processName = "chrome.exe"
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery("Select * from Win32_Process")
For Each objProcess in colP...
One of the most critical parts of dealing with NMS code is being able to support mulitple Minecraft versions. There are numerous ways to do this, but a simple solution is to use this code to store the version as a public static field:
public static final String NMS_VERSION = Bukkit.getServer().getC...
This will be our example data frame:
df = pd.DataFrame({"color": ['red', 'blue', 'red', 'blue']},
index=[True, False, True, False])
color
True red
False blue
True red
False blue
Accessing with .loc
df.loc[True]
color
True red
True red
...
DB backup
Database backup is a must before starting any Dynamics CRM upgrade process. This is mandatory as to always have the option to rollback in case of any major roadblock.
Wrong Estimation
DO NOT underestimate the work involved in a CRM Upgrade process.
Audit your current Microsoft Dynamics...
public class NetworkConnection : IDisposable
{
string _networkName;
public NetworkConnection(string networkName,
NetworkCredential credentials)
{
_networkName = networkName;
var netResource = new NetResource()
{...
Weak references are... references, to other objects (aka "targets"), but "weak" as they do not prevent those objects from being garbage-collected. In other words, weak references do not count when the Garbage Collector evaluates objects as "live" or "dead".
T...