text:
// Copyright (c) 2011-2015 The Bitcoin Core developers
// Copyright (c) 2015-2017 The Bitcoin Unlimited developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "util.h"

#include "clientversion.h"
#include "primitives/transaction.h"
#include "random.h"
#include "sync.h"
#include "test/test_bitcoin.h"
#include "utilmoneystr.h"
#include "utilstrencodings.h"

#include <stdint.h>
#include <vector>

#include <boost/test/unit_test.hpp>

using namespace std;

BOOST_FIXTURE_TEST_SUITE(util_tests, BasicTestingSetup)

BOOST_AUTO_TEST_CASE(util_criticalsection)
{
    CCriticalSection cs;

    do
    {
        LOCK(cs);
        break;

        BOOST_ERROR("break was swallowed!");
    } while (0);

    do
    {
        TRY_LOCK(cs, lockTest);
        if (lockTest)
            break;

        BOOST_ERROR("break was swallowed!");
    } while (0);
}

static volatile int critVal = 0;
static volatile int readVal = 0;
static volatile bool threadExited = false;
static volatile bool threadStarted = false;
void ThreadSharedCritTest(CSharedCriticalSection *cs)
{
    threadStarted = true;
    READLOCK(*cs);
    readVal = critVal;

    threadExited = true;
}

BOOST_AUTO_TEST_CASE(util_sharedcriticalsection)
{
    CSharedCriticalSection cs;

    do
    {
        READLOCK(cs);
        break;

        BOOST_ERROR("break was swallowed!");
    } while (0);

    do
    {
        WRITELOCK(cs);
        break;

        BOOST_ERROR("break was swallowed!");
    } while (0);

    { // If the read lock does not allow simultaneous locking, this code will hang in the join_all
        boost::thread_group thrds;
        READLOCK(cs);
        thrds.create_thread(boost::bind(ThreadSharedCritTest, &cs));
        thrds.join_all();
    }

    { // Ensure that the exclusive lock works
        threadStarted = false;
        threadExited = false;
        readVal = 0;
        critVal = 1;
        boost::thread_group thrds;
        {
            WRITELOCK(cs);
            thrds.create_thread(boost::bind(ThreadSharedCritTest, &cs));
            MilliSleep(250); // give thread a chance to run.
            BOOST_CHECK(threadStarted == true);
            BOOST_CHECK(threadExited == false);
            critVal = 2;
        }
        // Now the write lock is released so the thread should read the value.
        thrds.join_all();
        BOOST_CHECK(threadExited == true);
        BOOST_CHECK(readVal == 2);
    }
}

void ThreadCorralTest(CThreadCorral *c, int region, int *readVal, int setVal)
{
    CORRAL(*c, region);
    *readVal = critVal;
    if (setVal != 0)
        critVal = setVal;
}

BOOST_AUTO_TEST_CASE(util_threadcorral)
{
    CThreadCorral corral;

    { // ensure that regions lock out other regions, but not the current region.
        boost::thread_group thrds;
        int readVals[3] = {0, 0, 0};
        {
            CORRAL(corral, 1);
            critVal = 1;
            thrds.create_thread(boost::bind(ThreadCorralTest, &corral, 0, &readVals[0], 4));
            thrds.create_thread(boost::bind(ThreadCorralTest, &corral, 1, &readVals[1], 0));
            MilliSleep(500); // Thread 1 should run now because there is no higher region waiting.
            thrds.create_thread(boost::bind(ThreadCorralTest, &corral, 2, &readVals[2], 3));
            MilliSleep(500); // give threads a chance to run (if they are going to).
            critVal = 2;
        }
        MilliSleep(1000); // give threads a chance to run (if they are going to).
        BOOST_CHECK(readVals[1] == 1); // since region 1 was active, thread 1 should have run right away
        BOOST_CHECK(readVals[2] == 2); // After release, region 2 should have run since its higher priority
        BOOST_CHECK(readVals[0] == 3); // Finally, region 0 should have run (and gotten the value set by region 2)
    }
}

static const unsigned char ParseHex_expected[65] = {0x04, 0x67, 0x8a, 0xfd, 0xb0, 0xfe, 0x55, 0x48, 0x27, 0x19, 0x67,
    0xf1, 0xa6, 0x71, 0x30, 0xb7, 0x10, 0x5c, 0xd6, 0xa8, 0x28, 0xe0, 0x39, 0x09, 0xa6, 0x79, 0x62, 0xe0, 0xea, 0x1f,
    0x61, 0xde, 0xb6, 0x49, 0xf6, 0xbc, 0x3f, 0x4c, 0xef, 0x38, 0xc4, 0xf3, 0x55, 0x04, 0xe5, 0x1e, 0xc1, 0x12, 0xde,
    0x5c, 0x38, 0x4d, 0xf7, 0xba, 0x0b, 0x8d, 0x57, 0x8a, 0x4c, 0x70, 0x2b, 0x6b, 0xf1, 0x1d, 0x5f};

BOOST_AUTO_TEST_CASE(util_DbgAssert)
{
#ifndef DEBUG_ASSERTION
    int i = 0;
    bool savedVal = fPrintToConsole;
    fPrintToConsole = true;
    DbgAssert(1, i = 1);
    BOOST_CHECK(i == 0);
    DbgAssert(0, i = 1);
    BOOST_CHECK(i == 1);
    fPrintToConsole = savedVal;
#endif
}

BOOST_AUTO_TEST_CASE(util_ParseHex)
{
    std::vector<unsigned char> result;
    std::vector<unsigned char> expected(ParseHex_expected, ParseHex_expected + sizeof(ParseHex_expected));
    // Basic test vector
    result = ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112"
                      "de5c384df7ba0b8d578a4c702b6bf11d5f");
    BOOST_CHECK_EQUAL_COLLECTIONS(result.begin(), result.end(), expected.begin(), expected.end());

    // Spaces between bytes must be supported
    result = ParseHex("12 34 56 78");
    BOOST_CHECK(result.size() == 4 && result[0] == 0x12 && result[1] == 0x34 && result[2] == 0x56 && result[3] == 0x78);

    // Stop parsing at invalid value
    result = ParseHex("1234 invalid 1234");
    BOOST_CHECK(result.size() == 2 && result[0] == 0x12 && result[1] == 0x34);
}

BOOST_AUTO_TEST_CASE(util_HexStr)
{
    BOOST_CHECK_EQUAL(HexStr(ParseHex_expected, ParseHex_expected + sizeof(ParseHex_expected)),
        "04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b"
        "8d578a4c702b6bf11d5f");

    BOOST_CHECK_EQUAL(HexStr(ParseHex_expected, ParseHex_expected + 5, true), "04 67 8a fd b0");

    BOOST_CHECK_EQUAL(HexStr(ParseHex_expected, ParseHex_expected, true), "");

    std::vector<unsigned char> ParseHex_vec(ParseHex_expected, ParseHex_expected + 5);

    BOOST_CHECK_EQUAL(HexStr(ParseHex_vec, true), "04 67 8a fd b0");
}

BOOST_AUTO_TEST_CASE(util_DateTimeStrFormat)
{
    BOOST_CHECK_EQUAL(DateTimeStrFormat("%Y-%m-%d %H:%M:%S", 0), "1970-01-01 00:00:00");
    BOOST_CHECK_EQUAL(DateTimeStrFormat("%Y-%m-%d %H:%M:%S", 0x7FFFFFFF), "2038-01-19 03:14:07");
    BOOST_CHECK_EQUAL(DateTimeStrFormat("%Y-%m-%d %H:%M:%S", 1317425777), "2011-09-30 23:36:17");
    BOOST_CHECK_EQUAL(DateTimeStrFormat("%Y-%m-%d %H:%M", 1317425777), "2011-09-30 23:36");
    BOOST_CHECK_EQUAL(DateTimeStrFormat("%a, %d %b %Y %H:%M:%S +0000", 1317425777), "Fri, 30 Sep 2011 23:36:17 +0000");
}

BOOST_AUTO_TEST_CASE(util_ParseParameters)
{
    const char *argv_test[] = {
        "-ignored", "-reindex", "-txindex", "-connect=argument", "-connect=multiple", "f", "-d=e"};

    ParseParameters(0, (char **)argv_test, AllowedArgs::Bitcoind());
    BOOST_CHECK(mapArgs.empty() && mapMultiArgs.empty());

    ParseParameters(1, (char **)argv_test, AllowedArgs::Bitcoind());
    BOOST_CHECK(mapArgs.empty() && mapMultiArgs.empty());

    ParseParameters(5, (char **)argv_test, AllowedArgs::Bitcoind());
    // expectation: -ignored is ignored (program name argument),
    // -reindex, -txindex and -connect end up in map, -d ignored because it is after
    // a non-option argument (non-GNU option parsing)
    BOOST_CHECK(mapArgs.size() == 3 && mapMultiArgs.size() == 3);
    BOOST_CHECK(mapArgs.count("-reindex") && mapArgs.count("-txindex") && mapArgs.count("-connect") &&
                !mapArgs.count("f") && !mapArgs.count("-d"));
    BOOST_CHECK(mapMultiArgs.count("-reindex") && mapMultiArgs.count("-txindex") && mapMultiArgs.count("-connect") &&
                !mapMultiArgs.count("f") && !mapMultiArgs.count("-d"));

    BOOST_CHECK(mapArgs["-reindex"] == "" && mapArgs["-connect"] == "multiple");
    BOOST_CHECK(mapMultiArgs["-connect"].size() == 2);
}

BOOST_AUTO_TEST_CASE(util_GetArg)
{
    mapArgs.clear();
    mapArgs["strtest1"] = "string...";
    // strtest2 undefined on purpose
    mapArgs["inttest1"] = "12345";
    mapArgs["inttest2"] = "81985529216486895";
    // inttest3 undefined on purpose
    mapArgs["booltest1"] = "";
    // booltest2 undefined on purpose
    mapArgs["booltest3"] = "0";
    mapArgs["booltest4"] = "1";

    BOOST_CHECK_EQUAL(GetArg("strtest1", "default"), "string...");
    BOOST_CHECK_EQUAL(GetArg("strtest2", "default"), "default");
    BOOST_CHECK_EQUAL(GetArg("inttest1", -1), 12345);
    BOOST_CHECK_EQUAL(GetArg("inttest2", -1), 81985529216486895LL);
    BOOST_CHECK_EQUAL(GetArg("inttest3", -1), -1);
    BOOST_CHECK_EQUAL(GetBoolArg("booltest1", false), true);
    BOOST_CHECK_EQUAL(GetBoolArg("booltest2", false), false);
    BOOST_CHECK_EQUAL(GetBoolArg("booltest3", false), false);
    BOOST_CHECK_EQUAL(GetBoolArg("booltest4", false), true);
}

BOOST_AUTO_TEST_CASE(util_FormatMoney)
{
    BOOST_CHECK_EQUAL(FormatMoney(0), "0.00");
    BOOST_CHECK_EQUAL(FormatMoney((COIN / 10000) * 123456789), "12345.6789");
    BOOST_CHECK_EQUAL(FormatMoney(-COIN), "-1.00");

    BOOST_CHECK_EQUAL(FormatMoney(COIN * 100000000), "100000000.00");
    BOOST_CHECK_EQUAL(FormatMoney(COIN * 10000000), "10000000.00");
    BOOST_CHECK_EQUAL(FormatMoney(COIN * 1000000), "1000000.00");
    BOOST_CHECK_EQUAL(FormatMoney(COIN * 100000), "100000.00");
    BOOST_CHECK_EQUAL(FormatMoney(COIN * 10000), "10000.00");
    BOOST_CHECK_EQUAL(FormatMoney(COIN * 1000), "1000.00");
    BOOST_CHECK_EQUAL(FormatMoney(COIN * 100), "100.00");
    BOOST_CHECK_EQUAL(FormatMoney(COIN * 10), "10.00");
    BOOST_CHECK_EQUAL(FormatMoney(COIN), "1.00");
    BOOST_CHECK_EQUAL(FormatMoney(COIN / 10), "0.10");
    BOOST_CHECK_EQUAL(FormatMoney(COIN / 100), "0.01");
    BOOST_CHECK_EQUAL(FormatMoney(COIN / 1000), "0.001");
    BOOST_CHECK_EQUAL(FormatMoney(COIN / 10000), "0.0001");
    BOOST_CHECK_EQUAL(FormatMoney(COIN / 100000), "0.00001");
    BOOST_CHECK_EQUAL(FormatMoney(COIN / 1000000), "0.000001");
    BOOST_CHECK_EQUAL(FormatMoney(COIN / 10000000), "0.0000001");
    BOOST_CHECK_EQUAL(FormatMoney(COIN / 100000000), "0.00000001");
}

BOOST_AUTO_TEST_CASE(util_ParseMoney)
{
    CAmount ret = 0;
    BOOST_CHECK(ParseMoney("0.0", ret));
    BOOST_CHECK_EQUAL(ret, 0);

    BOOST_CHECK(ParseMoney("12345.6789", ret));
    BOOST_CHECK_EQUAL(ret, (COIN / 10000) * 123456789);

    BOOST_CHECK(ParseMoney("100000000.00", ret));
    BOOST_CHECK_EQUAL(ret, COIN * 100000000);
    BOOST_CHECK(ParseMoney("10000000.00", ret));
    BOOST_CHECK_EQUAL(ret, COIN * 10000000);
    BOOST_CHECK(ParseMoney("1000000.00", ret));
    BOOST_CHECK_EQUAL(ret, COIN * 1000000);
    BOOST_CHECK(ParseMoney("100000.00", ret));
    BOOST_CHECK_EQUAL(ret, COIN * 100000);
    BOOST_CHECK(ParseMoney("10000.00", ret));
    BOOST_CHECK_EQUAL(ret, COIN * 10000);
    BOOST_CHECK(ParseMoney("1000.00", ret));
    BOOST_CHECK_EQUAL(ret, COIN * 1000);
    BOOST_CHECK(ParseMoney("100.00", ret));
    BOOST_CHECK_EQUAL(ret, COIN * 100);
    BOOST_CHECK(ParseMoney("10.00", ret));
    BOOST_CHECK_EQUAL(ret, COIN * 10);
    BOOST_CHECK(ParseMoney("1.00", ret));
    BOOST_CHECK_EQUAL(ret, COIN);
    BOOST_CHECK(ParseMoney("1", ret));
    BOOST_CHECK_EQUAL(ret, COIN);
    BOOST_CHECK(ParseMoney("0.1", ret));
    BOOST_CHECK_EQUAL(ret, COIN / 10);
    BOOST_CHECK(ParseMoney("0.01", ret));
    BOOST_CHECK_EQUAL(ret, COIN / 100);
    BOOST_CHECK(ParseMoney("0.001", ret));
    BOOST_CHECK_EQUAL(ret, COIN / 1000);
    BOOST_CHECK(ParseMoney("0.0001", ret));
    BOOST_CHECK_EQUAL(ret, COIN / 10000);
    BOOST_CHECK(ParseMoney("0.00001", ret));
    BOOST_CHECK_EQUAL(ret, COIN / 100000);
    BOOST_CHECK(ParseMoney("0.000001", ret));
    BOOST_CHECK_EQUAL(ret, COIN / 1000000);
    BOOST_CHECK(ParseMoney("0.0000001", ret));
    BOOST_CHECK_EQUAL(ret, COIN / 10000000);
    BOOST_CHECK(ParseMoney("0.00000001", ret));
    BOOST_CHECK_EQUAL(ret, COIN / 100000000);

    // Attempted 63 bit overflow should fail
    BOOST_CHECK(!ParseMoney("92233720368.54775808", ret));

    // Parsing negative amounts must fail
    BOOST_CHECK(!ParseMoney("-1", ret));
}

BOOST_AUTO_TEST_CASE(util_IsHex)
{
    BOOST_CHECK(IsHex("00"));
    BOOST_CHECK(IsHex("00112233445566778899aabbccddeeffAABBCCDDEEFF"));
    BOOST_CHECK(IsHex("ff"));
    BOOST_CHECK(IsHex("FF"));

    BOOST_CHECK(!IsHex(""));
    BOOST_CHECK(!IsHex("0"));
    BOOST_CHECK(!IsHex("a"));
    BOOST_CHECK(!IsHex("eleven"));
    BOOST_CHECK(!IsHex("00xx00"));
    BOOST_CHECK(!IsHex("0x0000"));
}

BOOST_AUTO_TEST_CASE(util_seed_insecure_rand)
{
    int i;
    int count = 0;

    seed_insecure_rand(true);

    for (int mod = 2; mod < 11; mod++)
    {
        int mask = 1;
        // Really rough binomal confidence approximation.
        int err = 30 * 10000. / mod * sqrt((1. / mod * (1 - 1. / mod)) / 10000.);
        // mask is 2^ceil(log2(mod))-1
        while (mask < mod - 1)
            mask = (mask << 1) + 1;

        count = 0;
        // How often does it get a zero from the uniform range [0,mod)?
        for (i = 0; i < 10000; i++)
        {
            uint32_t rval;
            do
            {
                rval = insecure_rand() & mask;
            } while (rval >= (uint32_t)mod);
            count += rval == 0;
        }
        BOOST_CHECK(count <= 10000 / mod + err);
        BOOST_CHECK(count >= 10000 / mod - err);
    }
}

BOOST_AUTO_TEST_CASE(util_TimingResistantEqual)
{
    BOOST_CHECK(TimingResistantEqual(std::string(""), std::string("")));
    BOOST_CHECK(!TimingResistantEqual(std::string("abc"), std::string("")));
    BOOST_CHECK(!TimingResistantEqual(std::string(""), std::string("abc")));
    BOOST_CHECK(!TimingResistantEqual(std::string("a"), std::string("aa")));
    BOOST_CHECK(!TimingResistantEqual(std::string("aa"), std::string("a")));
    BOOST_CHECK(TimingResistantEqual(std::string("abc"), std::string("abc")));
    BOOST_CHECK(!TimingResistantEqual(std::string("abc"), std::string("aba")));
}

/* Test strprintf formatting directives.
 * Put a string before and after to ensure sanity of element sizes on stack. */
#define B "check_prefix"
#define E "check_postfix"
BOOST_AUTO_TEST_CASE(strprintf_numbers)
{
    int64_t s64t = -9223372036854775807LL; /* signed 64 bit test value */
    uint64_t u64t = 18446744073709551615ULL; /* unsigned 64 bit test value */
    BOOST_CHECK(strprintf("%s %d %s", B, s64t, E) == B " -9223372036854775807 " E);
    BOOST_CHECK(strprintf("%s %u %s", B, u64t, E) == B " 18446744073709551615 " E);
    BOOST_CHECK(strprintf("%s %x %s", B, u64t, E) == B " ffffffffffffffff " E);

    size_t st = 12345678; /* unsigned size_t test value */
    ssize_t sst = -12345678; /* signed size_t test value */
    BOOST_CHECK(strprintf("%s %d %s", B, sst, E) == B " -12345678 " E);
    BOOST_CHECK(strprintf("%s %u %s", B, st, E) == B " 12345678 " E);
    BOOST_CHECK(strprintf("%s %x %s", B, st, E) == B " bc614e " E);

    ptrdiff_t pt = 87654321; /* positive ptrdiff_t test value */
    ptrdiff_t spt = -87654321; /* negative ptrdiff_t test value */
    BOOST_CHECK(strprintf("%s %d %s", B, spt, E) == B " -87654321 " E);
    BOOST_CHECK(strprintf("%s %u %s", B, pt, E) == B " 87654321 " E);
    BOOST_CHECK(strprintf("%s %x %s", B, pt, E) == B " 5397fb1 " E);
}
#undef B
#undef E

/* Check for mingw/wine issue #3494
 * Remove this test before time.ctime(0xffffffff) == 'Sun Feb  7 07:28:15 2106'
 */
BOOST_AUTO_TEST_CASE(gettime) { BOOST_CHECK((GetTime() & ~0xFFFFFFFFLL) == 0); }
BOOST_AUTO_TEST_CASE(test_ParseInt32)
{
    int32_t n;
    // Valid values
    BOOST_CHECK(ParseInt32("1234", NULL));
    BOOST_CHECK(ParseInt32("0", &n) && n == 0);
    BOOST_CHECK(ParseInt32("1234", &n) && n == 1234);
    BOOST_CHECK(ParseInt32("01234", &n) && n == 1234); // no octal
    BOOST_CHECK(ParseInt32("2147483647", &n) && n == 2147483647);
    BOOST_CHECK(ParseInt32("-2147483648", &n) && n == -2147483648);
    BOOST_CHECK(ParseInt32("-1234", &n) && n == -1234);
    // Invalid values
    BOOST_CHECK(!ParseInt32("", &n));
    BOOST_CHECK(!ParseInt32(" 1", &n)); // no padding inside
    BOOST_CHECK(!ParseInt32("1 ", &n));
    BOOST_CHECK(!ParseInt32("1a", &n));
    BOOST_CHECK(!ParseInt32("aap", &n));
    BOOST_CHECK(!ParseInt32("0x1", &n)); // no hex
    BOOST_CHECK(!ParseInt32("0x1", &n)); // no hex
    const char test_bytes[] = {'1', 0, '1'};
    std::string teststr(test_bytes, sizeof(test_bytes));
    BOOST_CHECK(!ParseInt32(teststr, &n)); // no embedded NULs
    // Overflow and underflow
    BOOST_CHECK(!ParseInt32("-2147483649", NULL));
    BOOST_CHECK(!ParseInt32("2147483648", NULL));
    BOOST_CHECK(!ParseInt32("-32482348723847471234", NULL));
    BOOST_CHECK(!ParseInt32("32482348723847471234", NULL));
}

BOOST_AUTO_TEST_CASE(test_ParseInt64)
{
    int64_t n;
    // Valid values
    BOOST_CHECK(ParseInt64("1234", NULL));
    BOOST_CHECK(ParseInt64("0", &n) && n == 0LL);
    BOOST_CHECK(ParseInt64("1234", &n) && n == 1234LL);
    BOOST_CHECK(ParseInt64("01234", &n) && n == 1234LL); // no octal
    BOOST_CHECK(ParseInt64("2147483647", &n) && n == 2147483647LL);
    BOOST_CHECK(ParseInt64("-2147483648", &n) && n == -2147483648LL);
    BOOST_CHECK(ParseInt64("9223372036854775807", &n) && n == (int64_t)9223372036854775807);
    BOOST_CHECK(ParseInt64("-9223372036854775808", &n) && n == (int64_t)-9223372036854775807 - 1);
    BOOST_CHECK(ParseInt64("-1234", &n) && n == -1234LL);
    // Invalid values
    BOOST_CHECK(!ParseInt64("", &n));
    BOOST_CHECK(!ParseInt64(" 1", &n)); // no padding inside
    BOOST_CHECK(!ParseInt64("1 ", &n));
    BOOST_CHECK(!ParseInt64("1a", &n));
    BOOST_CHECK(!ParseInt64("aap", &n));
    BOOST_CHECK(!ParseInt64("0x1", &n)); // no hex
    const char test_bytes[] = {'1', 0, '1'};
    std::string teststr(test_bytes, sizeof(test_bytes));
    BOOST_CHECK(!ParseInt64(teststr, &n)); // no embedded NULs
    // Overflow and underflow
    BOOST_CHECK(!ParseInt64("-9223372036854775809", NULL));
    BOOST_CHECK(!ParseInt64("9223372036854775808", NULL));
    BOOST_CHECK(!ParseInt64("-32482348723847471234", NULL));
    BOOST_CHECK(!ParseInt64("32482348723847471234", NULL));
}

BOOST_AUTO_TEST_CASE(test_ParseDouble)
{
    double n;
    // Valid values
    BOOST_CHECK(ParseDouble("1234", NULL));
    BOOST_CHECK(ParseDouble("0", &n) && n == 0.0);
    BOOST_CHECK(ParseDouble("1234", &n) && n == 1234.0);
    BOOST_CHECK(ParseDouble("01234", &n) && n == 1234.0); // no octal
    BOOST_CHECK(ParseDouble("2147483647", &n) && n == 2147483647.0);
    BOOST_CHECK(ParseDouble("-2147483648", &n) && n == -2147483648.0);
    BOOST_CHECK(ParseDouble("-1234", &n) && n == -1234.0);
    BOOST_CHECK(ParseDouble("1e6", &n) && n == 1e6);
    BOOST_CHECK(ParseDouble("-1e6", &n) && n == -1e6);
    // Invalid values
    BOOST_CHECK(!ParseDouble("", &n));
    BOOST_CHECK(!ParseDouble(" 1", &n)); // no padding inside
    BOOST_CHECK(!ParseDouble("1 ", &n));
    BOOST_CHECK(!ParseDouble("1a", &n));
    BOOST_CHECK(!ParseDouble("aap", &n));
    BOOST_CHECK(!ParseDouble("0x1", &n)); // no hex
    const char test_bytes[] = {'1', 0, '1'};
    std::string teststr(test_bytes, sizeof(test_bytes));
    BOOST_CHECK(!ParseDouble(teststr, &n)); // no embedded NULs
    // Overflow and underflow
    BOOST_CHECK(!ParseDouble("-1e10000", NULL));
    BOOST_CHECK(!ParseDouble("1e10000", NULL));
}

BOOST_AUTO_TEST_CASE(test_FormatParagraph)
{
    BOOST_CHECK_EQUAL(FormatParagraph("", 79, 0), "");
    BOOST_CHECK_EQUAL(FormatParagraph("test", 79, 0), "test");
    BOOST_CHECK_EQUAL(FormatParagraph(" test", 79, 0), " test");
    BOOST_CHECK_EQUAL(FormatParagraph("test test", 79, 0), "test test");
    BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 0), "test\ntest");
    BOOST_CHECK_EQUAL(FormatParagraph("testerde test", 4, 0), "testerde\ntest");
    BOOST_CHECK_EQUAL(FormatParagraph("test test", 4, 4), "test\n    test");

    // Make sure we don't indent a fully-new line following a too-long line ending
    BOOST_CHECK_EQUAL(FormatParagraph("test test\nabc", 4, 4), "test\n    test\nabc");

    BOOST_CHECK_EQUAL(FormatParagraph("This_is_a_very_long_test_string_without_any_spaces_so_it_should_just_get_"
                                      "returned_as_is_despite_the_length until it gets here",
                          79),
        "This_is_a_very_long_test_string_without_any_spaces_so_it_should_just_get_returned_as_is_despite_the_"
        "length\nuntil it gets here");

    // Test wrap length is exact
    BOOST_CHECK_EQUAL(
        FormatParagraph(
            "a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de f g h i j k l m n o p", 79),
        "a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de\nf g h i j k l m n o p");
    BOOST_CHECK_EQUAL(
        FormatParagraph(
            "x\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de f g h i j k l m n o p",
            79),
        "x\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de\nf g h i j k l m n o p");
    // Indent should be included in length of lines
    BOOST_CHECK_EQUAL(
        FormatParagraph("x\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de f g h i j k "
                        "l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 a b c d e fg h i j k",
            79, 4),
        "x\na b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9 a b c de\n    f g h i j k l m n o p "
        "q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 a b c d e fg\n    h i j k");

    BOOST_CHECK_EQUAL(
        FormatParagraph("This is a very long test string. This is a second sentence in the very long test string.", 79),
        "This is a very long test string. This is a second sentence in the very long\ntest string.");
    BOOST_CHECK_EQUAL(FormatParagraph("This is a very long test string.\nThis is a second sentence in the very long "
                                      "test string. This is a third sentence in the very long test string.",
                          79),
        "This is a very long test string.\nThis is a second sentence in the very long test string. This is a "
        "third\nsentence in the very long test string.");
    BOOST_CHECK_EQUAL(FormatParagraph("This is a very long test string.\n\nThis is a second sentence in the very long "
                                      "test string. This is a third sentence in the very long test string.",
                          79),
        "This is a very long test string.\n\nThis is a second sentence in the very long test string. This is a "
        "third\nsentence in the very long test string.");
    BOOST_CHECK_EQUAL(FormatParagraph("Testing that normal newlines do not get indented.\nLike here.", 79),
        "Testing that normal newlines do not get indented.\nLike here.");
}

BOOST_AUTO_TEST_CASE(test_FormatSubVersion)
{
    std::vector<std::string> comments;
    comments.push_back(std::string("comment1"));
    std::vector<std::string> comments2;
    comments2.push_back(std::string("comment1"));
    // Semicolon is discouraged but not forbidden by BIP-0014
    comments2.push_back(
        SanitizeString(std::string("Comment2; .,_?@-; !\"#$%&'()*+/<=>[]\\^`{|}~"), SAFE_CHARS_UA_COMMENT));
    BOOST_CHECK_EQUAL(FormatSubVersion("Test", 99900, std::vector<std::string>()), std::string("/Test:0.9.99/"));
    BOOST_CHECK_EQUAL(FormatSubVersion("Test", 99900, comments), std::string("/Test:0.9.99(comment1)/"));
    BOOST_CHECK_EQUAL(
        FormatSubVersion("Test", 99900, comments2), std::string("/Test:0.9.99(comment1; Comment2; .,_?@-; )/"));
}

BOOST_AUTO_TEST_CASE(test_ParseFixedPoint)
{
    int64_t amount = 0;
    BOOST_CHECK(ParseFixedPoint("0", 8, &amount));
    BOOST_CHECK_EQUAL(amount, 0LL);
    BOOST_CHECK(ParseFixedPoint("1", 8, &amount));
    BOOST_CHECK_EQUAL(amount, 100000000LL);
    BOOST_CHECK(ParseFixedPoint("0.0", 8, &amount));
    BOOST_CHECK_EQUAL(amount, 0LL);
    BOOST_CHECK(ParseFixedPoint("-0.1", 8, &amount));
    BOOST_CHECK_EQUAL(amount, -10000000LL);
    BOOST_CHECK(ParseFixedPoint("1.1", 8, &amount));
    BOOST_CHECK_EQUAL(amount, 110000000LL);
    BOOST_CHECK(ParseFixedPoint("1.10000000000000000", 8, &amount));
    BOOST_CHECK_EQUAL(amount, 110000000LL);
    BOOST_CHECK(ParseFixedPoint("1.1e1", 8, &amount));
    BOOST_CHECK_EQUAL(amount, 1100000000LL);
    BOOST_CHECK(ParseFixedPoint("1.1e-1", 8, &amount));
    BOOST_CHECK_EQUAL(amount, 11000000LL);
    BOOST_CHECK(ParseFixedPoint("1000", 8, &amount));
    BOOST_CHECK_EQUAL(amount, 100000000000LL);
    BOOST_CHECK(ParseFixedPoint("-1000", 8, &amount));
    BOOST_CHECK_EQUAL(amount, -100000000000LL);
    BOOST_CHECK(ParseFixedPoint("0.00000001", 8, &amount));
    BOOST_CHECK_EQUAL(amount, 1LL);
    BOOST_CHECK(ParseFixedPoint("0.0000000100000000", 8, &amount));
    BOOST_CHECK_EQUAL(amount, 1LL);
    BOOST_CHECK(ParseFixedPoint("-0.00000001", 8, &amount));
    BOOST_CHECK_EQUAL(amount, -1LL);
    BOOST_CHECK(ParseFixedPoint("1000000000.00000001", 8, &amount));
    BOOST_CHECK_EQUAL(amount, 100000000000000001LL);
    BOOST_CHECK(ParseFixedPoint("9999999999.99999999", 8, &amount));
    BOOST_CHECK_EQUAL(amount, 999999999999999999LL);
    BOOST_CHECK(ParseFixedPoint("-9999999999.99999999", 8, &amount));
    BOOST_CHECK_EQUAL(amount, -999999999999999999LL);

    BOOST_CHECK(!ParseFixedPoint("", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("-", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("a-1000", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("-a1000", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("-1000a", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("-01000", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("00.1", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint(".1", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("--0.1", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("0.000000001", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("-0.000000001", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("0.00000001000000001", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("-10000000000.00000000", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("10000000000.00000000", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("-10000000000.00000001", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("10000000000.00000001", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("-10000000000.00000009", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("10000000000.00000009", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("-99999999999.99999999", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("99999909999.09999999", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("92233720368.54775807", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("92233720368.54775808", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("-92233720368.54775808", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("-92233720368.54775809", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("1.1e", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("1.1e-", 8, &amount));
    BOOST_CHECK(!ParseFixedPoint("1.", 8, &amount));
}

template <int F, int T>
static void CheckConvertBits(const std::vector<uint8_t> &in, const std::vector<uint8_t> &expected)
{
    std::vector<uint8_t> outpad;
    bool ret = ConvertBits<F, T, true>(outpad, in.begin(), in.end());
    BOOST_CHECK(ret);
    BOOST_CHECK(outpad == expected);

    const bool dopad = (in.size() * F) % T;
    std::vector<uint8_t> outnopad;
    ret = ConvertBits<F, T, false>(outnopad, in.begin(), in.end());
    BOOST_CHECK(ret != dopad);

    if (dopad)
    {
        // We should have skipped the last digit.
        outnopad.push_back(expected.back());
    }

    BOOST_CHECK(outnopad == expected);

    // Check the other way around.
    std::vector<uint8_t> orignopad;
    ret = ConvertBits<T, F, false>(orignopad, expected.begin(), expected.end());
    BOOST_CHECK(ret == !((expected.size() * T) % F));
    BOOST_CHECK(orignopad == in);

    // Check with padding. We may get an extra 0 in that case.
    std::vector<uint8_t> origpad;
    ret = ConvertBits<T, F, true>(origpad, expected.begin(), expected.end());
    BOOST_CHECK(ret);

    if (dopad)
    {
        BOOST_CHECK_EQUAL(origpad.back(), 0);
        origpad.pop_back();
    }

    BOOST_CHECK(origpad == in);
}

BOOST_AUTO_TEST_CASE(test_ConvertBits)
{
    CheckConvertBits<8, 5>({}, {});
    CheckConvertBits<8, 5>({0xff}, {0x1f, 0x1c});
    CheckConvertBits<8, 5>({0xff, 0xff}, {0x1f, 0x1f, 0x1f, 0x10});
    CheckConvertBits<8, 5>({0xff, 0xff, 0xff}, {0x1f, 0x1f, 0x1f, 0x1f, 0x1e});
    CheckConvertBits<8, 5>({0xff, 0xff, 0xff, 0xff}, {0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x18});
    CheckConvertBits<8, 5>({0xff, 0xff, 0xff, 0xff, 0xff}, {0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f});
    CheckConvertBits<8, 5>({0xff, 0xff, 0xff, 0xff, 0xff}, {0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f});
    CheckConvertBits<8, 5>({0xff, 0xff, 0xff, 0xff, 0xff}, {0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f});
    CheckConvertBits<8, 5>({0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef},
        {0x00, 0x04, 0x11, 0x14, 0x0a, 0x19, 0x1c, 0x09, 0x15, 0x0f, 0x06, 0x1e, 0x1e});
}

// Log tests:
bool TestSetLog(uint64_t categoriesExpected, const char *arg1, const char *arg2 = NULL)
{
    UniValue logargs(UniValue::VARR);
    bool ret = false;
    logargs.push_back(arg1);
    if (arg2 != NULL)
        logargs.push_back(arg2);

    setlog(logargs, false); // The function to be tested

    if (categoriesExpected == Logging::categoriesEnabled)
        ret = true;

    // LOGA("TestSetLog %s %s ret: %d\n", arg1, ((arg2 == NULL)?"":arg2),(int)ret);
    return ret;
}

bool IsStringTrueBadArgTest(const char *arg1)
{
    try
    {
        IsStringTrue(arg1);
    }
    catch (...)
    {
        return true; // If bad arg return true
    }
    return false;
}

BOOST_AUTO_TEST_CASE(util_Logging)
{
    {
        using namespace Logging;
        BOOST_CHECK_EQUAL(8, sizeof(categoriesEnabled));
        BOOST_CHECK_EQUAL(NONE, categoriesEnabled);
        LogToggleCategory(THN, true);
        BOOST_CHECK(LogAcceptCategory(THN));
        LogToggleCategory(THN, false);
        BOOST_CHECK(!LogAcceptCategory(THN));
        LogToggleCategory(THN, true);
        LogToggleCategory(NET, true);
        BOOST_CHECK(LogAcceptCategory(THN | NET));
        LogToggleCategory(ALL, true);
        BOOST_CHECK_EQUAL(ALL, categoriesEnabled);
        LogToggleCategory(ALL, false);
        BOOST_CHECK_EQUAL(NONE, categoriesEnabled);
        BOOST_CHECK_EQUAL(LogGetLabel(ADR), "ADR");
        BOOST_CHECK(TestSetLog(ALL, "all", "on"));
        BOOST_CHECK(TestSetLog(NONE, "all", "off"));
        BOOST_CHECK(TestSetLog(NONE, "tor"));
        BOOST_CHECK(TestSetLog(TOR, "tor", "on"));
        BOOST_CHECK(TestSetLog(NONE, "tor", "off"));
        BOOST_CHECK(!TestSetLog(TOR, "tor", "bad-arg"));
        BOOST_CHECK(TestSetLog(categoriesEnabled, "badcategory", "on"));
        LogToggleCategory(ALL, true);
        LOG(THN, "missing args %s %d\n");
        LOG(THN, "wrong order args %s %d\n", 3, "hello");
        LOG(THN, "null arg %s\n", NULL);
        BOOST_CHECK(IsStringTrue("true"));
        BOOST_CHECK(IsStringTrue("enable"));
        BOOST_CHECK(IsStringTrue("1"));
        BOOST_CHECK(IsStringTrue("on"));
        BOOST_CHECK(!IsStringTrue("false"));
        BOOST_CHECK(!IsStringTrue("disable"));
        BOOST_CHECK(!IsStringTrue("0"));
        BOOST_CHECK(!IsStringTrue("off"));
        BOOST_CHECK(IsStringTrueBadArgTest("bad"));
    }
}

BOOST_AUTO_TEST_SUITE_END()


text:
32788 Private Thomas Alexander McReynolds
Regiment/Service: 16th Battalion, Warwickshire Regiment (British Army)
Thomas Alexander McReynolds was the son of T.A. McReynolds, Kingsmills, Stewartstown. Thomas volunteered for service when war was declared having previously served with the North Irish Horse before the war. He enlisted with the Dragoon Guards and was sent to France in 1914 where he was wounded twice. He transferred to the Royal Warwickshire Regiment in the autumn of 1917 during the Third Battle of Ypres and shortly after joining he was reported missing during an advance at Polygon Wood, Belgium.
Cemetery: Tyne Cot Memorial
Zonnebeke, West-Vlaanderen,
Grave Ref: Panel 23-28-163a
CWGC Casualty 1634142
The Tyne Cot Memorial to the Missing forms the north-eastern boundary of Tyne Cot Cemetery, which is located 9 kilometres north east of Ieper town centre, on the Tynecotstraat, a road leading from the Zonnebeekseweg (N332). The names of those from United Kingdom units are inscribed on Panels arranged by Regiment under their respective Ranks. The names of those from New Zealand units are inscribed on panels within the New Zealand Memorial Apse located at the centre of the Memorial.
Local Memorial Details
No Memorial Name Townland
1 Kingsmills Orange Hall Roll of Honour WW1 Coagh
2 Coagh War Memorial Coagh
3 St Andrews Church Of Ireland Roll Of Honour Ardtrea
4 Coagh Soldiers and Sailors War Memorial 2013 - WW1- Panel 2 Coagh
Local Institute / Local Book Details
No Name Page
1 Cookstown War Dead Book WW1 224
1 1901 Census lists McReynolds family 1901 census lists Thomas Alex as age 8 at house 1 in Edernagh, Coagh, Tyrone
2 1911 Census lists McReynolds family 1911 census lists Thomas Alex as age 18 at house 1 in Edernagh, Coagh, Tyrone
3 Ardboe Gallery McReynolds' Mill, Edernagh, Kingsmill - 7 May 2015
4 Soldiers Died in the Great War Details of Private Thomas Alexander McReynolds

redpajama_set_name: RedPajamaCommonCrawl


40 point natural pulp board.
What better way to promote your company's branding than by giving away these Custom 40 Point Rectangle Pulp Board Coasters? Using a coaster will be beneficial to your furniture, protecting them now will make them last longer! And associating your logo to these items will make your audience constantly reminded about you in every use.


text:
Sector Profiles
Art, Design & Marketing
Commerce & Politics
Media & Hospitality
Sport, Music & Entertainment
Trades & Engineering
Career Quiz
NZ Careers Expo
Auckland Gallery
Christchurch Gallery
Hamilton Gallery
Wellington Gallery
About Jet
JETmag
Home Blog How staying active at uni has kept me sane
How staying active at uni has kept me sane
Applied for courses? Check. Hall of residence application? Check. Sign up for university sports team? Huh?
Congratulations, you've just come to the end of the exciting and emotional escapade we call high school. Now its time to think about the next step in your life journey, and you've chosen tertiary study. It's a stressful time for you soon-to-be freshers, as you settle into your new lifestyle as an adult in the real world. But if you can find a break from wading through the hundreds of emails from Sue in the enrolment department, you need to remember a very important part of university life – being active. As a graduating student I can tell you that the only thing that saved me from a mental breakdown at university is playing sport. It is estimated that around half of people who were involved with sports throughout school stop playing after they graduate. But sport is not something you grow out of. So why should you keep playing?
First of all, no, you are not too busy to join a sports team. I've heard this excuse time and time again. You're telling me you can't find one single hour free during the week to play a game of *insert sport here* with your friends? I have been in the same boat, I know it is a busy time. They say, "if you want something done, ask a busy person" and boy can I relate. Having spent the last three years balancing full time university study, a part time job and playing in three different university sports teams, I know a thing or two about time management, especially in first year. You're spending most of your time playing email ping pong with Sue from enrolment and Googling "how to avoid the fresher five", but there are so many benefits to playing sport at university that will make your entire experience so much better.
As much as your parents may be envisioning you holed up in the library from dawn til dusk like the model student they raised you to be, it will, without a doubt drive you insane. You are young, you need to look after yourself. Get outside, breathe the fresh air, feel the sun on your pale malnourished student skin. You can't study and expect to get good grades if your life doesn't have a good balance. It is recommended that an adult should do at least two and a half hours of exercise per week to stay healthy. If you're anything like me, when it comes to getting up and going to the gym I have just about the same amount of motivation as money in my bank account, aka very little. But a great way to get around this lack of drive to exercise is to join a sports team. This way, you get to be active with like minded people which will give you incentive to get up and moving.
I understand sport is not for everyone. At some stage in my life I had to give up my dream of becoming an Olympic water polo player. But once I accepted the fact that not being able to swim was a key issue holding me back, I realised that there actually are many more ways to stay active at uni. For those with moves like Jagger, you could try Zumba or other dance classes. If you're more about the gains you could hit the weights room for some quality time with the dumbbells. And for those of you who still yell Kobe when sinking a successful shot, you could join a social or competitive basketball league. Why not get out there and make some new friends doing something that is fun and keeping you healthy.
I may be biased, because I've always played sport. Why do I love it so much? I've made some fantastic friends, managed to stay healthy through my university life and had an excuse to wear activewear while doing very inactive things. You may still be on the fence, not entirely convinced that sport at university is for you. But I encourage you to get out and try sport even just once. You never know, you may find a hidden talent that you didn't know you had.
Victoria University of Wellington student and UTSNZ student rep Ellie McManaway is in her third and final year of a Bachelor of Arts majoring in Psychology with Criminology as a minor. During this time, Ellie has represented Victoria in four different codes at the national tertiary championships (netball, volleyball, 3×3 basketball, 5×5 basketball). Her prowess has extended to NZ age group representation too – in volleyball and basketball. Ellie has received a Victoria University Blues Award for her achievements and was awarded the TeamVic Netball Club Sportsperson of the Year last year.
Source: UTSNZ
fresher five
Previous articleForest development plan to bring more than 100 jobs to Rotorua
Next articleBlockbuster film highlights New Zealand's education strengths in creative arts
Blog: A letter to my Year 13 self
Blog: Why making international friendships will broaden your mind
Blog: Why I love being busy
What is Technovation?
Let's talk about veganism
Confessions of a nerd
Sign up to JETmag
Sign up to JETmag for updates and tips on Jobs, Education and Training!
By subscribing, you accept our website terms of use and Privacy policy.
JETmag - 12/07/2019
Fourth-year law student and blogger Samantha Mythen says you'll remember your final year of high school as one of the best years of your life.
Hitting the airwaves: The life of a radio host
Coffee: How much is too much?
Former students, parents angry after Government scraps unpaid NCEA fees
Five jobs that didn't exist 10 years ago
Why you should say yes yes yes to sexual violence prevention...
Student to probe labour shortages in agri-food sector
Should you include your hobbies on your CV?
Jobs, Education & Training
Work backwards! Choosing the degree course that's right for you
The beauty of earning while you're learning
JETmag Blog
© 2006 - 2019 NZME. Educational Media


With this motto in mind, we've got become certainly one of by far the most technologically innovative, cost-efficient, and price-competitive manufacturers for Polyglycolic Acid Suture, Polyester Suture, Nylon Monofilament Suture, Polypropylene Monofilament Suture you should send out email to us. We're looking forwards the opportunity to service you.
Our Surgical Sutures Products is good in quality and competitive in price. We are manufacturer and supplier Surgical Sutures Products following your specific requirement. We are looking forward to your E-mail and establishing cooperative relationship with you! We would provide professional Surgical Sutures with good services for you!


The Institution of Civil Engineers is an independent professional association for civil engineers and a charitable body in the United Kingdom.
Institution of Civil Engineers. Shaping the world. The best of civil engineering from the past 200 years, chosen by ICE members from around the world. With over 92,000 members worldwide, ICE supports civil engineers and technicians throughout their careers.
Information taken from the website of The Institure of Civil Engineers.


text:
David Sumrall accuses government of employing psychological warfare and torture against Trump supporters – Brighteon.TV
Stop Hate Awareness Program President and CEO David Sumrall accused the government of employing psychological warfare and torture against the supporters of former President Donald Trump who are being charged for their varying roles in the Capitol riot on Jan. 6.
As of the last count, a total of 638 people have been arrested and charged since the incident. The number of people charged in the so-called insurrection is expected to keep growing as Federal Bureau of Investigation (FBI) agents pore through video footage, social media posts, phone location data and tips from the public.
"The FBI is real. They've been to my house. They have my employee under house arrest," Sumrall told host Dan Happel of "Connecting the Dots" on Brighteon.TV.
"FBI agents come in with guns blazing, ready to shoot somebody. They're trying to get someone to snap. I have a story of one of the men that they arrested. They laid hands on his wife, trying to get to him, to incite him to do something so they can say 'see we got one of those crazy Trumpers.'"
The FBI is pursuing virtually every person who took part in the riot that left five people dead, including a Capitol police officer, and more than 100 other officers injured. Prosecutors have said that the riot also caused at least $1.5 million in damages to the historic building. (Related: The false and exaggerated claims still being spread about the Capitol riot.)
Sumrall said one of the people arrested by the FBI has cancer and can't get treatment inside prison. There's also a pregnant woman under house arrest. Some of the people arrested had been moved from state to state without informing their families and relatives.
"This is psychological warfare. This is torture," Sumrall said. "This is the system that we live in. This is nothing the people need to suffer through for standing up for their president."
Double standard of the law
Happel highlighted the injustice of it all by comparing the cases of Black Lives Matter (BLM) and Antifa rioters to the Trump supporters.
"The U.S. Attorney's Office and the Department of Justice dropped almost all the charges against BLM and Antifa rioters, who burned down cities and even killed people. And yet, at the same time, they made it very clear that they plan on pursing the so-called insurrection at the Capitol to full completion and prosecution." Happel said. "That is a double standard of the law. No question about it."
Sumrall called it a "travesty." He was there when things unfolded and was convinced that the demonstration had been infiltrated by agitators and posers from the left. (Related: VIDEO: Capitol Police removed barriers and allowed protesters to walk right into the Capitol.)
"It was a beautiful day. The most patriotic day, hands down, in my life. It was beautiful to see people come together peacefully to redress their grievances with their government. That's the point, that's the whole story," Sumrall said. "And then you got the bad guys that came in and really mucked it all up for everybody. They made us look bad. They did things for optic reasons."
But he knew the FBI would not take a closer look on that angle, or even consider it. "They don't want the truth. They just want to build a case to smear any conservative," Sumrall said.
The suspects in the riot at the Capitol are a varied group, including an ousted West Virginia lawmaker, several police officers and a left-wing activist from Utah. Most of the rioters were allowed to leave the crime scene, forcing investigators to conduct a national manhunt for the pro-Trump crowd that stormed the halls of Congress.
Just weeks after the riot, FBI officials said they had already been inundated with 140,000 videos and photos from members of the public. According to federal criminal code, seditious conspiracy means an effort to conspire to overthrow the U.S. government. The punishment is up to 20 years in prison.
Interestingly, only a few of the rioters facing federal charges came from pro-Trump strongholds. Based on the George Washington University extremism tracker, most of them came from districts that voted for President Joe Biden in last year's election.
It's all about the optics
With hundreds of additional investigations still ongoing, prosecutors are expected to bring more serious charges against some defendants who have already been charged, according to FBI Director Christopher Wray.
"This is far from over. And with each arrest and each case we bring, not only are we driving toward accountability for the attack but we're also learning more about what was out there beforehand so we can use that to get better moving forward," Wray said.
Sumrall has figured that out a long time ago. "They want the optics. They don't want this to go away," he said.
The charges against the suspects arrested to date fall into three broad categories. At one end of the spectrum are those accused of illegally entering the Capitol but not engaging in any violence. They face misdemeanor charges such as trespassing and disorderly conduct, both of which carry little to no jail time.
At the other end are the members of three far-right groups – the Oath Keepers, the Three Percenters and the Proud Boys – who had been accused of by prosecutors of having planned and coordinated their attack on the Capitol months in advance. They face multiple felony charges of conspiracy and other offenses.
The rest of the defendants face a combination of lesser misdemeanor charges and more serious felony charges of destruction of property and assaulting police officers.
Watch the full episode of "Connecting the Dots" with Dan Happel featuring David Sumrall here:
You can catch "Connecting the Dots" with Dan Happel live every Tuesday from 5-6 p.m. on Brighteon.TV.
Follow IdentityPolitics.news for more news and information related to partisan politics.
Insider.com
Tagged Under: antifa, Black Lives Matter, BLM, capitol, Capitol Police, Capitol riot, conspiracy, disorderly conduct, Donald Trump, FBI, felony, misdemeanor, national manhunt, Oath Keepers, Proud Boys, Psychological Warfare, Three Percenters, Torture, trespassing
Video footage shows "ballot traffickers" stuffing GA ballot boxes with backpacks full of ballots
Stew Peters mocks "perfect politician" Trey Gowdy – Brighteon.TV
Arizona Secretary of State candidate Mark Finchem demands state legislature DECERTIFY the 2020 election results based on tens of thousands of "ghost" votes
HUGE: Maricopa County volunteer Liz Harris says audit of 2020 election has turned up 176,000 "missing votes"
John Radell: America is "decisively engaged" – Brighteon.TV
Biden regime blamed for delaying private groups trying to evacuate U.S. citizens from Afghanistan: "This is zero place to be negotiating with American lives"
Bombshell: "Ballot traffickers" caught on video emptying backpacks of ballots into Georgia drop boxes in middle of night
ARMING THE ENEMY: Billions of dollars in U.S. military vehicles, weapons and gear left behind in Afghanistan
Biden knew Afghan military collapse was eminent: He told Afghan president that both needed to create "perception" Taliban wasn't winning "whether it's true or not"
Rand Paul says "Trump Derangement Syndrome" is driving leftist opposition to ivermectin
WATCHDOG: Wisc.'s 83K LOST ballots far exceed Biden's alleged victory margin
Gaetz Vindicated! Man criminally charged in $25 million extortion plot targeting congressman Matt Gaetz
Robert Kennedy Jr. blows whistle on Pfizer donating $1 million to Trump inaugural – see what happened following that (Video)
Biden may have brought terror cells to the U.S. as Americans were left behind in Afghanistan
House Democrats protecting Communist China by blocking declassification of COVID origins
Almost 15 million 2020 mail-in ballots unaccounted for
TREASON: Biden regime handed Taliban "kill list" of Americans remaining in Afghanistan, sparking new outrage amid Kabul massacre of U.S. troops
'70s Redux: Biden takes US back to runaway inflation, embarrassing embassy troop withdrawal
Obama ordered FBI, CDC to implement globalist 'health security agenda' shortly before leaving office


text:
Q: How to create new object in GWT by string class-name? My goal is to create a flexible application-> to extend the functionality of my web-application I only to add a position to the database and upload the missing class to the server.
I created dynamic menu in Java-GWT. I use MenuBar() and loops, all positions, wchich were taken from db (array, string).
Of course, 'end-option' in menu must do something, generally after clicking application will open i.e. FlowPanel with buttons, labels, textareas.
My idea was: using java reflection to add Command for all positions in menu.
Every Command take name of option (string), name is the same, like name of class -> next, after clicking I will automatically create object. Unfortunatelly Java Reflection don't work with GWT, so this way is not possible.
My question is:
How to create object, when I have class name in string? Or if my idea is wrong, maybye is other way to create flexible menu/program?

A: I thing, I found a small solution for this problem, but with another concept - only one class (and one interface); in this class I have one main method, which choose correct 'method to open'; in this example I check by int:
/-------------------------------------------/
Example loop in main part of program:
/-------------------------------------------/
(...)
MenuBar menu = new MenuBar(true);

    for (int k = 0; k < 5; k++) {
            int ii=k;
            menu.addItem(tekst + k, new Command() {

                @Override
                public void execute() {
                    ClassMetodInterface metoda = (ClassMetodInterface) GWT.create(Method2.class);
                    vPanel.clear(); //clearing before I open a new widget.

/*I sent int (easier to tests), but I can sent string[i] too*/
/* logging - instance of main class to communicate with 'subclasses', in my project necessery*/

                    vPanel.add(metoda.defaultMethod(ii, logging));
                }

            });
        }
(...)
/*-------------------------------------------*/
ClassMetodInterface, only for implementation class Method2 :
/*-------------------------------------------*/
    public interface ClassMetodInterface {
    Widget defaultMethod(int g, Logging logging);
}

/*-------------------------------------------*/
class Method2 with swich:
/*-------------------------------------------*/

public class Method2 implements ClassMetodInterface {

    public Widget zapisUsera(int g, Logging logging) {

        Logging logging;
        HorizontalPanel lPanel = new HorizontalPanel();

        switch(g) {
        case 1: {
            Window.alert("switch for test no:"+g);
            MenuWindow1(logging);

            break;

        }
        case 2:{
            Window.alert("switch for test no:"+g);
            break;
        }
        default:
            Window.alert("switch default - loop >2 && <1");
            break;
        }
        return lPanel;  //all methods will be void - they will be add widgets and Panels to lPanel

    }

    public Widget MenuWindow1(Logging logging) {
        this.logging = logging;

        lPanel.setBorderWidth(2);
        this.lPanel.setPixelSize(100, 50);
        Button b1 = new Button("test button, not used");
        lPanel.add(b1);

        Label lbl = new Label("label no "+logging.i);

        lPanel.add(lbl);
        Button addGlobal = new Button("+");
        Button removeGlobal = new Button("-");
        lPanel.add(addGlobal);
        addGlobal.addClickHandler(new addGlobal());
        removeGlobal.addClickHandler(new removeGlobal());
        lPanel.add(removeGlobal);

        return lPanel;

    }

//for tests communication with class, where I have menu and global variable
    public class addGlobal implements ClickHandler {

        @Override
        public void onClick(ClickEvent event) {
            logging.i++;
        }

    }

    public class removeGlobal implements ClickHandler {

        @Override
        public void onClick(ClickEvent event) {
            logging.i--;
        }

    }
}

It is not finished, but you can show main idea. If I need to add new options to menu, I will update db and replace one class for version with more methods.

redpajama_set_name: RedPajamaStackExchange


These days it seems like the concept of standing for something needs to be political in nature and have a good amount of anger behind it. Hopefully I'm wrong, and my perspective is clouded by all the angry or negative headlines floating across the bottom of the TV or in social media newsfeeds.
The truth is, we need to be passionate about what we stand for, and whatever it is that we do stand for, should be grounded in our personal faith and values, and with the stated goal of making the world around us a better place.
Today I don't want to talk about 'standing for something' in the sense of speaking out or against some 'thing' but rather what it is that you stand for as a person. When people see you and interact with you, who is it that they see? What adjectives would they use to describe you?
My hope is that they describe you in such a way that is in alignment with what you aspire to be at your core. Like anything though, ensuring we are living our values and showing up as our best selves is a process and a journey. So how do we get there?
This idea of standing for something hit me recently thanks to a bag of my old childhood stuff that my parents dropped off during one of their last visits.
The bag had all sorts of papers, trinkets and mementos from grade school through high school, and while rummaging through it I came across a scholarship essay I wrote in the 8th grade.
Without faith a man can't stand, but without values a man has nothing to stand for.
So what is it that we believe in?
What are those values that, at our core, define us?
And based upon that foundation what do we stand for?
The pace of society today feels, at times, impossible to keep up with. We are busy being busy and subject to the ever increasing number of distractions and talking heads telling us what we should like, think, feel, eat, wear, buy, or believe in.
Often in our attempt to 'keep up' we can lose our sense of identity. We forget who we are and who we want to be.
No matter what your faith or beliefs are, we all need to believe in something. Maybe it is God, or a higher power. Maybe we believe in ourselves or others. Perhaps we believe in a specific ideal or moral statute. Whatever it is, be clear on what your beliefs are and where they originate.
I don't want to begin to give guidance or advice on how to validate your belief system, but rather highlight the importance of knowing what it is and how it shows up in your life through the choices you make and your vision for the future.
Now that you have a solid understanding of your faith/belief system, it is time to start to dig into what we value in our life.
Create our reputation and legacy.
To help firm up our values, I want to give a few bits of general guidance along with some tools that will help us discern what we value – I'll also share my results from the two tools I reference below.
Understand the Non-Negotiables – If you want to confirm your core values, start by being aware of your thought pattern when making decisions or thinking through options. These guidelines or rules that you consciously or subconsciously run through will either give you hints or spell out what some of your personal and core values actually are… let's walk through some examples.
Refuse to lie to get ahead or stay out of trouble no matter what? Then honesty is a clear core value.
Driven to look at or do things differently for the sake of progress or creating something new? Then you value innovation.
Are you focused on being honest and having strong moral principles? Then integrity is a critical value.
Do you make sure you do what you say you will do, when you say you will do it? Then reliability is a core value.
The Mirror Effect – What you expect in others – Flipping my last point around, what are some of the attributes you look for in people on your team, or those you do business with?
What do you expect in the leaders, politicians or role-models that you look up to and support?
Likely, those attributes would and should be similar to your non-negotiables and speak to your core values and guiding principles.
Before I wrap up, I want to share two free tools that you can play around with to help you further dig into your value systems.
The majority of the results should help validate what you already know, and at the same time some of the results may surprise you. I've included my results following each of the tool descriptions so you know what to expect.
I was fortunate to be introduced to both of these tools by my professional coach. Both exercises were impactful for me, and I still reference the results during times of self-reflection or goal-setting, and I'm excited to share them with you.
WordClouds.com – Technically, this tool isn't specifically for uncovering values, however I'll provide you with the guidance I received from my coach which turned it into a values-focused tool for my purposes.
The exercise is to amass all of the written quotes, phrases, speeches, passages, etc. that most resonate with you for whatever reason. Whatever they are, they just feel good and speak to what you believe in.
A few words that stood out to me when I reviewed mine: Commitment, Excellence, Success, Dedication, Quality, Sacrifice, and Courage.
Check out the survey here. Once you are done, the results will be e-mailed to you for free.
Along with the chart, there is a breakdown of what the hourglass represents, what the positive or limiting values mean, along with next steps on how to further explore your identified set of values.
My hope is that after you take the time to confirm your faith / belief system, and solidify your values, that you not only reaffirm the strength that allows you to stand, but also have a renewed clarity and purpose towards what you stand for!
No matter what it is that each of us believes and values, let's make sure that it shows up in who we are, how we conduct ourselves, and in all that we strive to be and become – each and every day.
Make no apologies for who you are and all that goes into you being your very best self.
Live your life. Live your purpose. Stand for Something. Stand for Who You Are.
Discussion Question: What do you stand for, and how do you show up day in and day out? Are those two things in alignment? If not, what can you to make sure they do?


text:
South Africa, Zimbabwe Cooperate Against 'Regime Change'
Nov. 16 (EIRNS)—A statement released at a meeting of the joint South African-Zimbabwe Joint Permanent Commission on Defense and Security said the two countries will work together against the policy of "regime change" in the countries of southern Africa. Released yesterday, the statement said, "The commission resolved to exchange information on those forces, internal and external, which through misinformation and disinformation are bent on undermining the process."
The meeting was held in Vanderbijlpark, South Africa/ South African Defense Minister Mosiuoa Lekota said southern African countries faced a "very real challenge" of regime change encouraged by foreign powers, according to a SAPA release in yesterday's Mail and Guardian.
Zimbabwean Defense Minister Sydney Sekeramayi accused Britain of being the chief architect of the regime change policy against his country. He thanked South African President Thabo Mbeki for mediating the crisis between the ruling Zanu PF and the opposition Movement for a Democratic Change. "It would not come as a surprise if Britain, the chief architect of regime change agenda in Zimbabwe, makes a last ditch attempt at derailing the talks."
Lekota also called on the countries of the Southern African Development Community (SADC) to use their influence in the African Union to address the dangers of the newly established United States African military command, known as Africom.
"We also have to manage Africom, which threatens our sovereignty," Lekota said, and warned of the "growing danger" of private security companies. "This is a complex area because it's difficult to legislate against it. We need to share information so that we can at least keep an eye on what these companies are doing."


text:
A review of the History of People of Color on Cape Cod
Saturday, November 21 at 11:30 am
John Reed, currently the chair of the Zion Union Heritage Museum of Cape Cod, Hyannis, MA, leads our audience in a discussion of the struggles and achievements of People of Color in this historic region. He will show some of the newly produced documentary entitled Journeys in the Light: Untold Stories of Cape Cod.
(DVD cover art by Carl Lopes.)
The documentary, while addressing frankly such difficult topics as slavery here on Cape Cod during the Colonial Period, highlights the courageous individuals who led the fight for freedom, drove for education and economic progress, transformed oppression into brilliant forms of creative expression, served the country in every war, and came to excel in sports, entrepreneurship, teaching, the arts, community service, and various other professions here on the Cape and around the country.
John Reed has a Bachelor of Arts degree and a Masters of Education degree from the University of Massachusetts, Amherst. He has worked in the Barnstable Public schools as a social studies teacher and as the Equity/Attendance supervisor. He has been the president of the Cape Cod branch of the NAACP, Civil Rights trainer for the Town of Barnstable citizens' police academy, and a workshop facilitator for various district public schools on diversity training for students and staff.


This savings plan will save your back!
Believe it or not the amount of change in the picture weighs 2 pounds. This was the change in my change purse! Many times my purse feels like it is full of rocks and when I empty my change purse, it is significantly lighter. Today I decided to weigh the change just out of curiosity and was astonished to see it weighed 2 POUNDS! I kept the quarters ( you always need parking money) and put the rest in my big jug I keep spare change in.
Years ago, I had saved up half a Culligan bottle of change and when I rolled it up it came to $85 dollars. My son hated that I paid for gas and groceries for a week in rolls of pennies, nickels and dimes. Hey! Money is money as far as I am concerned and a little change adds up!
Typically men don't carry a lot of change because it affects the way their pants stay on. However, I have seen many women carrying a suitcase size purse (what do they have in there?!?!?) and can only imagine how much it weighs! Purse weight can really have an impact on your back, shoulder and neck, so check your change purse and walk a little lighter.


text:
Q: Named vector to list Is there a base function to transform a named vector (with some repeated labels) into a list with each entry being on of the labels instead of using this combination ? MWE:
> v = 1:10
> names(v) = sample(letters[1:5], 10, replace = T)
> lapply(lapply(split(as.list(v), names(v)), unlist), unname)
$c
[1] 4 5 9

$d
[1] 2 3 6 7 8

$e
[1]  1 10


In-depth news and analysis of the world's major shipping trade lanes including the trans-Atlantic, trans-Pacific, Asia-Europe and more.
Several variables can affect a trade lane's popularity — including its inclusion/discontinuance by an ocean carrier. The container line landscape is constantly evolving as market dynamics present new challenges to the industry.
The injection of vessels comes as demand growth of Asia-Europe westbound volume slows.
With 12 container terminals handling more than 16 million TEU per year, including 30,000 gate moves per day, Los Angeles-Long Beach is the nation's most complex port environment.
A new weekly container feeder service, launched by Aliança Navegação e Logistica in December, is attracting shippers in northern Brazil looking for a new connection to the port of Pecem's international and coastal services.
The annual survey of shipper views on the most important issues in the trans-Pacific trade.
How the reduced capacity meets slowing US import volume, which will be reflected in weekly spot rates, will give a preliminary picture of what to expect in supply and demand for the coming year.
"If a carrier comes with a 30-day transit and they suddenly change to 40 days, we need to know about it one month in advance," a shipper of medical products said.
Shippers can expect a far more aggressive approach to matching vessel supply with demand.
Increasing use of the available capacity in both directions and the impact of service shifts in 2018 could mean shippers find it more difficult to find carrier space for containers this year.
When imports increased strongly last summer, due in part to front-loading of shipments to get ahead of the Trump administration's tariffs on China, spot rates soared by more than $1,000 to each coast.
Here are a few certainties shippers and their transportation providers can bank on for 2019.
After a year of dismal schedule reliability, carriers have revised their networks in an attempt to improve service levels, but standing in the way are significant challenges.
Eastbound trans-Pacific spot rates fell for the fourth straight week.
After four straight months of declining demand growth on the westbound Asia-Europe trade, container volume has started to increase.
Ocean carriers will have even more reason to show trans-Pacific capacity discipline, if Sea-Intelligence's demand forecast proves to be accurate; however, a current container shipping trend may make that doubly hard.
Shipper demand for faster China-Europe alternatives to ocean freight is the driving force behind rising rail volume and the rapid development of new services on the intercontinental route, such as trucking.
The US imports surge from Asia since mid-summer is due largely to savvy capacity management by carriers individually and through vessel-sharing alliances. However, retailers' front-loading of imports to stay ahead of tariffs on mainland China led to an earlier-than-expected peak-shipping season this summer and now to fast-forwarding of spring merchandise.
Those who want to end the legal framework exempting liner shipping consortia from European Union antitrust rules say it would increase competition and therefore shipper choice. But this is an instance where the solution may ultimately lead to an outcome that's worse than the current condition.
Rising operating costs that are siphoning off profitability will see carriers having a much greater hold on capacity going into what is looking like a volatile 2019.
"There is no will or reason to merge the two companies. SM Line will continue to build its own business models and we will do our part to survive in the market independently," said SM Line CEO Kim during a meeting at the company's headquarters in Seoul.
Some are predicting a continuation of peak season-like conditions — marked by record high spot rates and space restrictions — not just through the end of the year but continuing until the Chinese New Year holiday beginning in early February.
Some are predicting a continuation of peak season-like conditions not just through the end of the year but continuing until the Chinese New Year holiday beginning in early February. Beyond that, two sector variables will determine the extent of anticipated first-quarter weakness in spot rates.
The Trump administration's initial 10 percent tariff on China prompted front-loading of holiday goods earlier this year. Now, the prospect of an additional 25 percent tariff on China on Jan. 1 is affecting spring shipments. Each is among the chief reasons trans-Pacific spot rates have maintained their strength.


text:
The Front Row Club
Unlimited Access to Music, Dance, Theater + Film
Be a Part of the Front Row Club
The exciting program exclusively available to Notre Dame students! Front Row Club members get unlimited access to any ticketed show or film at the Center (exclusions apply). Join now for only $60 per person per season.
It's as easy as 1-2-3!
1. Become a member. There are two membership options available. An INDIVIDUAL membership entitles you to 1 ticket per performance. A PLUS ONE membership entitles you to 2 tickets per performance.
2. See what's happening at the Center. Members will receive monthly email reminders of upcoming events and any exclusions that may apply.
3. Reserve your seat(s) to an upcoming film or performance. Tickets can be reserved online, by phone, or in person at the Ticket Office. You must be logged in to our website to reserve tickets using your Front Row Club membership.
Please allow up to 24 hours for membership to activate. For questions about the Front Row Club, contact the Ticket Office at 574-631-2800 or via email.
Front Row Club Events
Huw Lewis, organ Sunday, January 24, 2021 at 8:00 PM
BODYTRAFFIC January 29 - 30, 2021
The Clayton Brothers Quintet Friday, February 5, 2021 at 7:30 PM
Trike Theatre presents The True Story of the 3 Little Pigs! Saturday, February 6, 2021 at 11:00 AM
Lankum Friday, February 12, 2021 at 7:30 PM
Jennifer Koh, violin Sunday, February 14, 2021 at 4:00 PM
Irish Theatre of Chicago presents Marble February 19 - 20, 2021
Renée Anne Louprette, organ Sunday, February 28, 2021 at 4:00 PM
VIEW ALL RELATED EVENTS


text:
Culture & Society History
Politics & Government Biography
Active - 1978 - Present | Born - Oct 1, 1924 | Genres - Culture & Society, History
Filmography ↓
Other Appearances ↓
Biography by Nathan Southern
As the 39th President of the United States, James Earl Carter, Jr. served one term in office (1977-1981) that fell in between the presidencies of Gerald Ford and Ronald Reagan. A Georgia native, a lifelong Democrat, and an outspoken Southern Baptist, Carter's two most formidable accomplishments arguably lay in his foreign policy -- particularly the orchestration of the Menachem Begin/Anwar el-Sadat peace accords -- and the establishment of the Department of Energy. At the time of his defeat, many argued with great conviction that he had failed to solve the majority of the problems facing the nation throughout his term, yet his presidency received renewed attention during the 1990s and 2000s when political commentators (particularly those in Europe) began to reevaluate Carter's doings in an enthusiastic light.
Considerably active in his post-presidential life, Carter authored numerous tomes on such topics as the Middle East, aging, and his own Christian faith. He also established the social activist group Habitat for Humanity and mediated numerous international conflicts as an unofficial diplomat -- with astounding efficacy. In 2006, Oscar-winning filmmaker Jonathan Demme (Melvin and Howard) shot a critically acclaimed, favorable documentary portrait of the former president, Jimmy Carter Man from Plains; it reached American cinemas the following year.
Movie Highlights
See Full Filmography


Home > News > 15 transplant recipients connect through Fit for Life!
Melbourne's Fit for Life! walk through Melbourne coincided with the 2018 Transplantation Society of Australia and New Zealand (TSANZ) Conference and was led by Victoria's Fit for Life! Ambassadors, kidney recipient Linda Petrovski, and liver recipient Jennifer Dicker, along with Transplant Australia's Matty Hempstalk.
Fit for Life! Ambassadors, Jennifer Dicker and Linda Petrovski.
Fifteen transplant recipients and their partners, supporters, friends and family met on Saturday for a walk through the state capital of Victoria and the second-most populous city in Australia.
Brooke Huuskes, the chairperson of the Transplant Australia Victorian Committee, helped lead the charge.
Fit for Life!, which won two corporate social sustainability awards in 2017, is an initiative of the World Transplant Games Federation and proudly supported by Astellas. It aims to get more transplant recipients more active more often; has already broken a Guinness World Record, and connected transplant recipients across the world.
For more information on Fit for Life! Ambassadors, or the program itself, visit transplant.org.au or wtgf.org.
The next Fit for Life! walk will take place in Sydney, NSW on Sunday the 27th May and Sunday 3rd June in locations yet to be announced. Keep an eye out on the Transplant Australia and Australian Transplant Games Facebook pages for further announcements.
Photos by the amazing Nick Farley.


text:
Q: Creating a new column based on the condition of others Still very new to coding and R, I am working with some healthcare data in a data frame.  There are 3 outcomes that I am interested in - Mobilised_D1, Diet_D1 and Catheter_rm_D1.  I wish to create a fourth column called AnyTwo whereby if any 2 of the 3 outcomes are Y or all three outcomes are Y, then it will be T for AnyTwo.
I've managed to do this by using [] as below:
ERAS_limited[ERAS_limited$Mobilised_D1 == "Y" & ERAS_limited$Catheter_rm_D1 == "Y", "AnyTwo"] <- T
ERAS_limited[ERAS_limited$Diet_D1 == "Y" & ERAS_limited$Catheter_rm_D1 == "Y", "AnyTwo"] <- T
ERAS_limited[ERAS_limited$Diet_D1 == "Y" & ERAS_limited$Catheter_rm_D1 == "Y" & ERAS_limited$Mobilised_D1 == "Y", "AnyTwo"] <- T

dput(head(ERAS_limited))
structure(list(Mobilised_D1 = structure(c(2L, 2L, 1L, 1L, 1L,
2L), .Label = c("N", "Y"), class = "factor"), Diet_D1 = structure(c(2L,
2L, 2L, 2L, 1L, 2L), .Label = c("N", "Y"), class = "factor"),
    Catheter_rm_D1 = structure(c(2L, 2L, 1L, 1L, 1L, 2L), .Label = c("N",
    "Y"), class = "factor"), AnyTwo = c(TRUE, TRUE, FALSE, FALSE,
    FALSE, TRUE)), row.names = c(NA, 6L), class = "data.frame")```

However, I would be keen to see if there is a more elegant way of doing this e.g. by writing a loop for my own education and curiosity.

A: We can use rowSums to create the logical vector
library(dplyr)
ERAS_limited %>%
    mutate(AnyTwo = rowSums(.[-4] == "Y")  >= 2)

In base R, it would be
ERAS_limited$AnyTwo <- rowSums(ERAS_limited[-4]) == "Y") >= 2


March 9: Justice Department officials must give reports to Congress by certain dates on how the FBI is using the USA Patriot Act to search homes and secretly seize papers.
Bush's signing statement: The president can order Justice Department officials to withhold any information from Congress if he decides it could impair national security or executive branch operations.
Aug. 8: The Department of Energy, the Nuclear Regulatory Commission and its contractors may not fire or otherwise punish an employee whistle-blower who tells Congress about possible wrongdoing.
Bush's signing statement: The president or his appointees will determine whether employees of the Department of Energy and the Nuclear Regulatory Commission can give information to Congress.
Dec. 17: The new national intelligence director shall recruit and train women and minorities to be spies, analysts, and translators in order to ensure diversity in the intelligence community.
Oct. 29: Defense Department personnel are prohibited from interfering with the ability of military lawyers to give independent legal advice to their commanders.
Bush's signing statement: All military attorneys are bound to follow legal conclusions reached by the administration's lawyers in the Justice Department and the Pentagon when giving advice to their commanders.
Aug. 5: The military cannot add to its files any illegally gathered intelligence, including information obtained about Americans in violation of the Fourth Amendment's protection against unreasonable searches.
Bush's signing statement: Only the president, as commander in chief, can tell the military whether or not it can use any specific piece of intelligence.
Nov. 6, 2003: US officials in Iraq cannot prevent an inspector general for the Coalition Provisional Authority from carrying out any investigation. The inspector general must tell Congress if officials refuse to cooperate with his inquiries.
Bush's signing statement: The inspector general ''shall refrain" from investigating anything involving sensitive plans, intelligence, national security, or anything already being investigated by the Pentagon. The inspector cannot tell Congress anything if the president decides that disclosing the information would impair foreign relations, national security, or executive branch operations.
Nov. 5, 2002: Creates an Institute of Education Sciences whose director may conduct and publish research ''without the approval of the secretary [of education] or any other office of the department."
Bush's signing statement: The president has the power to control the actions of all executive branch officials, so ''the director of the Institute of Education Sciences shall [be] subject to the supervision and direction of the secretary of education."


My wife and I recently published a book on the largest prisoner of war camp for Confederates in the North. At one point, over 20,000 young men were incarcerated in the camp. Two other books have been published but they were highly bias and larger tomes. We wanted to write a shorter book for the general public to explain how and why the camp formed, what it was like to live and die there, and its aftermath. We also get into the Hammond General Hospital that was formed a year earlier. I will try into post portions of the book in future blogs.
My sixth book in the mapping series has been published! The Maps of Fredericksburg could be my best work yet, but then I say that about all of my books when they first appear.
I am finishing up the Maps of the Cavalry at Gettysburg and the Maps of Spotsylvania (including North Anna and Cold Harbor). More on these in future posts. The next new map project will be the Maps of the Petersburg/Appomattox Campaign. Oh, and I am working with Sean Chick on a Maps of the Shiloh Campaign. He is doing the text and I am completing the maps.
It's been while since I posted anything and lots has happened in my life. I retired in June, 2017 and my wife and I moved to Fairfield, PA a couple of months ago. Many may know it is just west of Gettysburg, which is bustling with all kinds of activities. I have been writing (will update that on a future post) and my wife has gained a studio behind our new home (which was built in 1871-72).
I am also a Gettysburg Licensed Historian, which means I give tours of the town. I am not thinking of becoming a Gettysburg Licensed Battlefield Guide anytime soon.
One more year to retirement! I hope to really ramp up my writing at that time. In the meantime, I am making some good progress on a variety of topics.
The Maps of the Wilderness Campaign continues to be well received.
My Maps of the Fredericksburg Campaign is now with Ted Savas with a 2017 possible release date. This is one of my favorite books of the series.
My Maps of the Spotsylvania Campaign, which is the second installment of the Overland Campaign series, is up to May 14 (Myer's Hill). I will end this one on May 20, 1864.
The Gettysburg Encyclopedia continues to prod along. I am finishing up about two dozen entries, and then it will be ready for editing. This will be a massive work.
Hope you all are enjoying this HOT summer.
My fifth map book is finally out: The Maps of the Wilderness. It follows in the footsteps of the Maps of First Bull Run, Maps of Antietam, Maps of Gettysburg, and Maps of Bristoe Station/Mine Run.
This one runs 324 pages and contains 24 maps sets with 120 original full-page color maps. The book begins with the armies in winter quarters. This section covers the changes in the armies, particularly the arrival of U.S. Grant. The action really begins on May 2, when Grant finalizes his plans for the Army of the Potomac.
The action covers the movement of the Union army through the Wilderness and Lee's response, leading to the early encounter on May 5. The fighting along the Orange Turnpike and the Orange Plank Road is covered in detail.
Then I cover the actions, or inactions, of the Confederates during the night of May 5-6. The latter opens with a massive attack along the Plank Road and this is detailed in many maps, as is the arrival of Longstreet's First Corps, its flank attack, and the final attacks on the Union works along Brock Road.
John Gordon's flank attack is also covered in some detail as it had so much potential and created so much havoc.
A number of cavalry actions are also covered in this volume. The book ends with the armies moving toward Spotsylvania Court House on May 7.
I believe that the book turned out quite well. In future posts I will detail specific sections of the book.
I have been remiss in not posting more frequently to this blog, but life keeps getting in the way. I am closing in on retirement within the next two years, so I should have more time to post.
I am happy to announce that my Maps of the Wilderness book is now at the printer and is slated to be out by January, 2016.
It was a very difficult book to write, as the actions were so confused and confusing. I think I did a pretty good job of accurately capturing the action. Several individuals really helped me in my endeavors, including Greg Mertz, Kris White, and Phill Greenwaldt.
After completing the Wilderness book, I got right to work on the Maps of the Fredericksburg Campaign, and I am pleased to report that it has also been completed. You probably won't see it until early 2017.
I have started my seventh map book…more on that one soon.
Many people ask me why I get up at 3:00 a.m. every morning to work on my Civil War map books. I can't really explain it, but I am on a mission to map every campaign in the Eastern Theater of the Civil War. I have a good start– four campaigns (First Bull Run, Antietam, Gettysburg, Bristoe/Mine Run) are published and one is with Ted Savas, my editor. The greatest satisfaction comes from meeting readers who have enjoyed/benefited from my efforts. Not so great are the individuals who want to nitpick about this topic or that. I never engage them, but merely smile and say that there are many different perspectives and no one will ever know for sure.
I walked the fields of Fredericksburg, Chancellorsville, the Wilderness, and Spotsylvania many times while mapping the campaigns of the Eastern Theater of the Civil War. Studying the Civil War is my passion and to date, I wrote ten books because of it. The time that I devote to my studies of the Civil War, however; is limited by my "day" job as President of the College of Southern Maryland. This also restricts the time I can devote to nonprofit organizations. I felt compelled to make the time when the opportunity was presented to become a member of the Central Virginia Battlefields Trust (CVBT) Board.
During battlefield visits, I am dismayed by the destruction of these sacred sites. Standing at the location of the mill race, now Kenwood Avenue in Fredericksburg, it is impossible to see the ground the men in blue traversed to ultimately be slaughtered before Marye's Heights. The town of Fredericksburg has changed over the years, as the ever growing population engulfed those sacred grounds. The same is true at the Wilderness battlefield, where a housing development around Grant Lake has sprung up on the ground that saw very heavy fighting during May 5 and 6, 1864. On May 5, Henry Heth's Division's left flank valiantly held off charge after charge of an overwhelming number of Union troops. Gen. Wadsworth's division traversed this ground on its journey to crush the Confederate defensive line on the early morning of May 6 and was the scene of heavy fighting as Longstreet's men appeared later that morning. Many other troops thrashed their way through the thickets here. However, access to these sacred grounds is barred because of the private residences that dot the landscape.
The heroic efforts of the Civil War Trust and the Gettysburg Foundation are celebrated for preserving historic sites. Less well-known is the CVBT, which concentrates its efforts in preserving the Fredericksburg-Chancellorsville- Wilderness- Spotsylvania battlefields. It is a big job as the population of Fredericksburg and its surrounding counties has increased 120 percent since 1970, four times the rate of growth of the rest of Virginia. The organization can count many successes over the years, including the preservation of over 1,000 acres of sacred land. They not only preserve the land itself but also act as advocates for battlefield preservation in general.
While the relationship between the Gettysburg Foundation and the rangers at the Gettysburg National Military Park are renowned and applauded, the relationship between the CVBT and the personnel at the Fredericksburg-Spotsylvania National Military Park complexes is equally strong. The synergy has helped strengthen both entities.
For me, writing a check is not enough. I need to give back to those men who made the ultimate sacrifice by contributing my time and knowledge. That's one of the reasons I write books and why I have decided to join a committed band of individuals who have such a passion for our nation's heritage. There is much more work to be done and it is my hope that more people will lend their support to this outstanding organization. Please take a moment to visit the CVBT website (http://www.cvbt.org).


text:
PIB Summaries 17 January 2022 | Legacy IAS
Home » PIB Summaries 17 January 2022 | Legacy IAS
PIB Summaries - January 2022
Election Commission of India
Charging Infrastructure for Electric Vehicles
Purple Revolution
Focus: GS II- Constitution
The Election Commission of India held separate virtual meetings with the Union Ministry of Health and Family Welfare; Chief Secretaries and Health Secretaries of Goa, Manipur, Punjab, Uttarakhand and Uttar Pradesh, as also the Chief Electoral Officers of these five poll going States.
After considering the present situation, facts and circumstances as also the inputs received in these meetings, the Commission has directed as follows:
No road show, Pad-yatra, cycle/bike/vehicle rally and procession shall be allowed till 22 January, 2022. Commission shall subsequently review the situation and issue further instructions accordingly.
No physical rally of Political parties or candidates (including probable) or any other group related to election shall be allowed till 22 January, 2022.
However, the Commission has granted relaxation for the political parties to the extent that indoor meetings of maximum of 300 persons or 50% of the capacity of the hall or the prescribed limit set by SDMA will be allowed.
Political parties shall ensure the compliance of COVID appropriate behaviour & guidelines and Model Code of Conduct at all occasions during the activities connected with elections.
All remaining restrictions as contained in the Revised Broad Guidelines for Conduct of Elections, 2022 issued on 8 January 2022 shall continue to operate.
About Election Commission of India
The Election Commission of India is an autonomous constitutional authority responsible for administering Union and State election processes in India.
The body administers elections to the Lok Sabha, Rajya Sabha, and State Legislative Assemblies in India, and the offices of the President and Vice President in the country.
It is the Commission that decides the election schedules for the conduct of elections, whether general elections or by-elections.
ECI decides on the location of polling stations, assignment of voters to the polling stations, location of counting centers, arrangements to be made in and around polling stations and counting centres and all allied matters.
In the performance of its functions, the Election Commission is insulated from executive interference.
Part XV of the Indian constitution deals with elections, and establishes a commission for these matters.
The Election Commission was established in accordance with the Constitution on 25th January 1950, hence it is a constitutional body. Article 324 to 329 of the constitution deals with powers, function, tenure, eligibility, etc., of the commission and the member.
Litigations against EC
The decisions of the Commission can be challenged in the High Court and the Supreme Court of India by appropriate petitions.
By long-standing convention and several judicial pronouncements, once the actual process of elections has started, the judiciary does not intervene in the actual conduct of the polls.
Structure of the Election Commission
Originally the commission had only one election commissioner but after the Election Commissioner Amendment Act 1989, it has been made a multi-member body.
The commission consists of one Chief Election Commissioner and two Election Commissioners.
The secretariat of the commission is located in New Delhi.
At the state level election commission is helped by Chief Electoral Officer who is an IAS rank Officer.
The President appoints Chief Election Commissioner and Election Commissioners.
They have a fixed tenure of six years, or up to the age of 65 years, whichever is earlier.
They enjoy the same status and receive salary and perks as available to Judges of the Supreme Court of India.
The Chief Election Commissioner can be removed from office only through a process of removal similar to that of a Supreme Court judge for by Parliament.
Issues with ECI
Flaws in the composition: The Constitution doesn't prescribe qualifications for members of the EC. They are not debarred from future appointments after retiring or resigning.
No security of tenure: Election commissioners aren't constitutionally protected with security of tenure.
Partisan role: The EC has come under the scanner like never before, with increasing incidents of breach of the Model Code of Conduct in the 2019 general elections.
Political favor: The opposition alleged that the ECI was favoring the ruling party by giving clean chit to the model code of conduct violations made by the PM.
Non-competence: Increased violence and electoral malpractices under influence of money have resulted in political criminalization, which ECI is unable to arrest.
Focus: GS-III: Industry and Infrastructure
The Union Ministry of Power has promulgated the revised consolidated Guidelines & Standards for Charging Infrastructure for Electric Vehicles (EV)
The objective is to enable a faster adoption of electric vehicles in India by ensuring safe, reliable, accessible and affordable Charging Infrastructure and eco-system.
This would also promote energy security and reduction of emission intensity of the country by promotion of entire EV ecosystem.
Electric Vehicles (EVs) and their need in India
An electric vehicle, uses one or more electric motors or traction motors for propulsion. An electric vehicle may be powered through self-contained battery, solar panels or an electric generator to convert fuel to electricity.
India has committed to cutting its GHG emissions intensity by 33% to 35% percent below 2005 levels by 2030 – replacing combustion engine vehicles with electric vehicles is a step in the right direction.
According to a recent study by WHO, India is home to 14 out of 20 most polluted cities in the world. EVs will help in tackling this problem by reducing local concentrations of pollutants in cities.
India imports oil to cover over 80 percent of its transport fuel. EVs can reduce dependence on imported crude oil promoting India's energy security.
It will encourage cutting edge technology in India through adoption, adaptation, and research and development. EVs manufacturing capacity will promote global scale and competitiveness.
The shift towards renewable energy sources has led to cost reduction from better electricity generating technologies. This has introduced the possibility of clean, low-carbon and inexpensive grids.
Advances in battery technology have led to higher energy densities, faster charging and reduced battery degradation from charging. Combined with the development of motors with higher rating and reliability, these improvements in battery chemistry have reduced costs and improved the performance and efficiency of electric vehicles.
Revised consolidated Guidelines & Standards for Charging Infrastructure for Electric Vehicles (EV):
These guidelines are exhaustive and include provisions for
a) Individual owners of Electric Vehicles
b) Public Charging Stations (PCS).
Central Nodal Agency: Bureau of Energy Efficiency (BEE) shall be the Central Nodal Agency for rollout of EV Public Charging Infrastructure
Any individual/entity is free to set up public charging stations without the requirement of a license provided that, such stations meet the technical, safety as well as performance standards and protocols laid down under the guidelines as well as norms/ standards/ specifications laid down by Ministry of Power, Bureau of Energy Efficiency (BEE) and Central Electricity Authority (CEA) from time to time.
Technology agnostic Charging Standards: The guidelines have been made further technology agnostic by providing for not only the prevailing international charging standards available in the market but also the new Indian charging standards.
Land at promotional rates for installation of PCS through a Revenue Sharing Model: In order to address the challenge of making a charging station financially viable in the period of growth of Electric Vehicles, a revenue sharing model has been put in place for land used for the same.
Timelines for providing connectivity for the installation of Public Charging Station (PCS) : Timelines have been prescribed as per the Electricity (Rights of Consumers). Accordingly, PCS shall be provided connection within seven days in metro cities, fifteen days in other municipal areas and thirty days in rural areas. Within these timelines the distribution licensees shall provide new connection or modify an existing connection.
Tariff for supply of electricity to EV Public Charging Stations: The tariff for supply of electricity to Public EV Charging Stations shall be a single part tariff and shall not exceed the "Average Cost of Supply" till 31st March, 2025. The same tariff shall be applicable for Battery Charging Station (BCS). The tariff applicable for domestic consumption shall be applicable for domestic charging.
State Governments to fix the ceiling of Service charges: As electricity is being provided at concessional rates and also considering the fact that subsidy is being provided by the Central/State Governments in many cases for setting up Public Charging Stations, the State Government shall fix the ceiling of Service Charges to be charged by such Charging Stations.
Open Access: Any Public Charging Station/ Chain of Charging Stations may obtain electricity from any generation company through open access.
Database of Public EV Charging Stations: Bureau of Energy Efficiency (BEE) shall create and maintain a national online database of all the Public Charging Stations in consultation with State Nodal Agencies (SNAs).
Network Service Providers: Public Charging Station will be required to tie up up with at least one online Network Service Providers (NSPs) to enable advance remote/online booking of charging slots by EV owners.
Location of Public Charging Stations: To alleviate the range anxiety of the potential EV owners, guidelines provides that at least one Charging Station shall be available in a grid of 3 Km X 3 Km. Further, one Charging Station shall be set up at every 25 Km on both sides of highways/roads. For long range EVs and/or heavy duty EVs like buses/trucks etc., there shall be at least one Fast Charging Station with Charging Infrastructure Specifications every 100 Kms, one on each side of the highways/road located preferably within/alongside the Public Charging Stations
Focus: Prelims, GS-III: Agriculture (Technological advancements related to Agriculture)
Union Minister of State (Independent Charge) Science & Technology, Minister of State Independent Charge) Earth Sciences; MoS PMO, Personnel, Public Grievances, Pensions, Atomic Energy and Space, said that "Purple Revolution" is Jammu & Kashmir's contribution to "Start-ups India", an initiative that was launched in 2016.
What is Purple Revolution (Under Aroma Mission)?
Under the Aroma mission – First-time farmers were given free lavender saplings and those who have cultivated lavender before were charged a nominal amount.
The Aroma mission aims to support domestic aromatic crop based agro economy by moving from imported aromatic oils to homegrown varieties.
Council of Scientific and Industrial Research (CSIR) and Indian Institute of Integrative Medicine, Jammu (IIIM Jammu), the two bodies are mainly responsible for making purple revolution under the Aroma Mission a success.
Apart from being in sync with government policy of doubling farm incomes by 2022, lavender cultivation also provided employment to the district's women farmers thus gave impetus to inclusive growth.
More about Aroma Mission
The CSIR Aroma Mission is envisaged to bring transformative change in the aroma sector through desired interventions in the areas of agriculture, processing and product development for fuelling the growth of aroma industry and rural employment.
The nodal laboratory is CSIR-Central Institute of Medicinal and Aromatic Plants (CSIR-CIMAP), Lucknow. The participating laboratories are CSIR-Institute of Himalayan Bioresource Technology (CSIR-IHBT), Palampur; CSIR-Indian Institute of Integrative Medicine (CSIR-IIIM), Jammu etc.
The mission will promote the cultivation of aromatic crops for essential oils that are in great demand by the aroma industry.
It is expected to enable Indian farmers and aroma industry to become global leaders in the production and export of some other essential oils on the pattern of menthol mint.
It aims to provide substantial benefits to the farmers in achieving higher profits, utilization of waste lands and protection of their crops from wild and grazing animals.
The scientific interventions made under the Aroma mission project would provide assured benefits to the growers of Vidarbha, Bundelkhand, Gujarat, Marathwada, Rajasthan, Andhra Pradesh, Odisha and other states where farmers are exposed to frequent episodes of weather extremes and account for maximum suicides.
Uses and Products of Lavender
Main product is Lavender oil which sells for at least Rs. 10,000 per litre.
Lavender water, which separates from lavender oil, is used to make incense sticks.
Hydrosol, which is formed after distillation from the flowers, is used to make soaps and room fresheners.