CDate()
CDate() converts something from any datatype to a Date datatype
Sub CDateExamples()
Dim sample As Date
' Converts a String representing a date and time to a Date
sample = CDate("September 11, 2001 12:34")
Debug.Print Format$(sample, "yyyy-mm-dd hh:nn:...
Server Syntax
var io = require('socket.io')(80);
io.on('connection', function (mysocket) {
//custom event called `private message`
mysocket.on('private message', function (from, msg) {
console.log('I received a private message by ', from, ' saying ', msg);
});
//internal `di...
Suppose we want to read and stack a bunch of similarly-formatted files. The quick solution is:
rbindlist(lapply(list.files(patt="csv$"), fread), id=TRUE)
We might not be satisfied with this for a couple reasons:
It might run into errors when reading with fread or when stacking with ...
Specifies custom foreign key name if a foreign key not following EF's convention is desired.
public class Person
{
public int IdAddress { get; set; }
[ForeignKey(nameof(IdAddress))]
public virtual Address HomeAddress { get; set; }
}
This can also be used when you have multipl...
Split vector of texts using one pattern:
stri_split_fixed(c("To be or not to be.", "This is very short sentence.")," ")
# [[1]]
# [1] "To" "be" "or" "not" "to" "be."
#
# [[2]]
# [1] "This" ...
This is an simple example to create a mysql server with docker
1.- create docker-compose.yml:
Note: If you want to use same container for all your projects, you should create a PATH in your HOME_PATH. If you want to create it for every project you could create a docker directory in your project.
...
Alert is a simple popup that displays a set of buttons and gets an result depending on the button the user clicked:
Example
This lets the user decide, if (s)he really wants to close the primary stage:
@Override
public void start(Stage primaryStage) {
Scene scene = new Scene(new Group(), 100...
/// <summary>
/// Converts a data type to another data type.
/// </summary>
public static class Cast
{
/// <summary>
/// Converts input to Type of default value or given as typeparam T
/// </summary>
/// <typepara...
/// <summary>
/// Read configuration values from app.config and convert to specified types
/// </summary>
public static class ConfigurationReader
{
/// <summary>
/// Get value from AppSettings by key, convert to Type of default value or typ...
[TestFixture]
public class UnitTest1
{
class Message
{
public string Text { get; } = "Hello World";
}
[Test]
public void HelloWorldTest()
{
// Act
var message = new Message();
// Assert
Assert.That(message.Tex...
You can wrap values into actions and pipe the result of one computation into another:
return :: Monad m => a -> m a
(>>=) :: Monad m => m a -> (a -> m b) -> m b
However, the definition of a Monad doesn’t guarantee the existence of a function of type Monad m => m a -&...
CoffeeScript allows to deconstruct objects and arrays when they are fed to functions as arguments.
A function that leverages deconstruction will specify in its signature all the fields that are expected within its body. When invoking such function, an object or array containing all the expected fie...
The unset command is used to remove one or more variables.
unset ?-nocomplain? ?--? ?name name name name?
Each name is a variable name specified in any of the ways acceptable to the set command.
If a name refers to an element of an array then that element is removed without affecting the rema...