text:
local runtests = false
if not cutorch then
   require 'cutorch'
   runtests = true
end
local tester
local test = {}
local msize = 100
local minsize = 100
local maxsize = 1000
local minvalue = 2
local maxvalue = 20
local nloop = 100
local times = {}

--e.g. unit test cmd: th -lcutorch -e "cutorch.test{'view','viewAs'}"

local function isEqual(a, b, tolerance, ...)
   if a == nil and b == nil then return true end
   if a == nil and b ~= nil then return false end
   if a ~= nil and b == nil then return false end
   if torch.type(b) ~= torch.type(a) then
      b = b:typeAs(a) -- TODO: remove the need for this (a-b doesnt work for bytetensor, cudatensor pairs)
   end
   local diff = a-b
   tolerance = tolerance or 0.000001
   if type(a) == 'number' then
      return math.abs(diff) < tolerance
   else
      if torch.type(diff) ~= 'torch.FloatTensor' then
         diff = diff:float() -- TODO: remove the need for this (byteTensor and abs)
      end
      return diff:abs():max() < tolerance
   end
end

local function compareFloatAndCuda(x, fn, ...)
   local x_cpu    = x:float()
   local x_cuda   = x_cpu:cuda()
   local res1_cpu, res2_cpu, res3_cpu, res4_cpu
   local res1_cuda, res2_cuda, res3_cuda, res4_cuda
   if type(fn) == 'string' then
      tester:assertne(x_cuda[fn], nil,
         string.format("Missing function CudaTensor.%s", fn))
      res1_cpu, res2_cpu, res3_cpu, res4_cpu  = x_cpu[fn](x_cpu, ...)
      res1_cuda, res2_cuda, res3_cuda, res4_cuda = x_cuda[fn](x_cuda, ...)
   elseif type(fn) == 'function' then
      res1_cpu, res2_cpu, res3_cpu, res4_cpu  = fn(x_cpu, ...)
      res1_cuda, res2_cuda, res3_cuda, res4_cuda = fn(x_cuda, ...)
   else
      error("Incorrect function type")
   end
   local tolerance = 1e-5
   tester:assert(isEqual(res1_cpu, res1_cuda, tolerance),
      string.format("Divergent results between CPU and CUDA for function '%s'", tostring(fn)))
   tester:assert(isEqual(res2_cpu, res2_cuda, tolerance),
                 string.format("Divergent results between CPU and CUDA for function '%s'", tostring(fn)))
   tester:assert(isEqual(res3_cpu, res3_cuda, tolerance),
                 string.format("Divergent results between CPU and CUDA for function '%s'", tostring(fn)))
   tester:assert(isEqual(res4_cpu, res4_cuda, tolerance),
                 string.format("Divergent results between CPU and CUDA for function '%s'", tostring(fn)))
end

local function compareFloatAndCudaTensorArgs(x, fn, ...)
   local x_cpu = x:float()
   local x_cuda = x_cpu:cuda()
   local res1_cpu, res2_cpu, res3_cpu, res4_cpu
   local res1_cuda, res2_cuda, res3_cuda, res4_cuda
   -- Transformation of args
   local tranform_args = function(t, type)
      for k,v in pairs(t) do
         local v_type = torch.Tensor.type(v)
         if v_type == 'torch.FloatTensor' or v_type == 'torch.CudaTensor' or v_type == 'torch.DoubleTensor' then
            t[k] = v:type(type)
         end
      end
      return t
   end
   local cpu_args = tranform_args({...}, 'torch.FloatTensor')
   local cuda_args = tranform_args({...}, 'torch.CudaTensor')
   if type(fn) == 'string' then
      tester:assertne(x_cuda[fn], nil,
         string.format("Missing function CudaTensor.%s", fn))
      res1_cpu, res2_cpu, res3_cpu, res4_cpu  = x_cpu[fn](x_cpu, unpack(cpu_args))
      res1_cuda, res2_cuda, res3_cuda, res4_cuda = x_cuda[fn](x_cuda, unpack(cuda_args))
   elseif type(fn) == 'function' then
      res1_cpu, res2_cpu, res3_cpu, res4_cpu  = fn(x_cpu, unpack(cpu_args))
      res1_cuda, res2_cuda, res3_cuda, res4_cuda = fn(x_cuda, unpack(cuda_args))
   else
      error("Incorrect function type")
   end
   local tolerance = 1e-5
   tester:assert(isEqual(res1_cpu, res1_cuda, tolerance),
                 string.format("Divergent results between CPU and CUDA for function '%s'", fn))
   tester:assert(isEqual(res2_cpu, res2_cuda, tolerance),
                 string.format("Divergent results between CPU and CUDA for function '%s'", fn))
   tester:assert(isEqual(res3_cpu, res3_cuda, tolerance),
                 string.format("Divergent results between CPU and CUDA for function '%s'", fn))
   tester:assert(isEqual(res4_cpu, res4_cuda, tolerance),
                 string.format("Divergent results between CPU and CUDA for function '%s'", fn))
end

function test.squeeze()
   local sz = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz, 1, sz, 1)
   compareFloatAndCuda(x, 'squeeze')

   local y = x:cuda():squeeze()
   tester:assert(y:dim() == 2, "squeeze err")

   x = torch.FloatTensor():rand(sz, 1, 1, sz)
   compareFloatAndCuda(x, 'squeeze', 2)

   local y = x:cuda():squeeze(2)
   tester:assert(y:dim() == 3, "squeeze1d err")
end

function test.expand()
   local sz = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz, 1)
   compareFloatAndCuda(x, 'expand', sz, sz)

   x = torch.FloatTensor():rand(1, sz)
   compareFloatAndCuda(x, 'expand', sz, sz)
end

function test.view()
   local sz = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz, 3)
   compareFloatAndCuda(x, 'view', sz, 3, 1)
end

function test.viewAs()
   local sz = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz, 3)
   local y = torch.FloatTensor():rand(sz, 3, 1)
   compareFloatAndCudaTensorArgs(x, 'viewAs', y)
end

function test.repeatTensor()
   local sz = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz, 3)
   compareFloatAndCuda(x, 'repeatTensor', sz, 2)
end

function test.copyRandomizedTest()
   local maxSize = 1000000 -- 1M elements max
   local ndimInput = torch.random(10)
   local function randomSizeGenerator(ndimInput)
      local size = {}
      local totalSize = 1
      for i = 1, ndimInput do
         size[i] = torch.random(25)
         totalSize = totalSize * size[i]
      end
      return size, totalSize
   end
   local inputSize, nElem = randomSizeGenerator(ndimInput)
   local attemptsAtSizeGeneration = 1
   while nElem > maxSize do
      attemptsAtSizeGeneration = attemptsAtSizeGeneration + 1
      -- make atmost 100 attempts to generate sizes randomly.
      -- this guarantees that even in the worst case,
      -- this test does not run forever
      if attemptsAtSizeGeneration == 100 then
         inputSize = {1, 10, 100}
         break
      end
      inputSize, nElem = randomSizeGenerator(ndimInput)
   end

   -- http://rosettacode.org/wiki/Prime_decomposition#Lua
   local function IsPrime(n)
      if n <= 1 or (n ~= 2 and n % 2 == 0) then return false end
      for i = 3, math.sqrt(n), 2 do if n % i == 0 then return false end end
         return true
   end
   local function PrimeDecomposition(n)
      local f = {}
      if IsPrime(n) then f[1] = n; return f end
      local i = 2
      repeat
         while n % i == 0 do f[#f + 1] = i; n = n / i end
         repeat i = i + 1 until IsPrime( i )
      until n == 1
      return f
   end
   local function constructOutput(size)
      local outputSize = {}
      for i = 1, #size do outputSize[i] = size[i] end
      for i = 1, 10 do -- 10 randomizations
         -- pick an input dim
         local dim = torch.random(1, #size)
         -- factor it
         local factors = PrimeDecomposition(outputSize[dim])
         if #factors ~= 0 then
            -- remove one of the factors
            local factor = factors[torch.random(#factors)]
            local addNewDim = torch.random(1, 2)
            if addNewDim == 1 then -- add it as a new dimension
               outputSize[dim] = outputSize[dim] / factor
               -- where to insert new dimension
               local where = torch.random(1, #outputSize)
               local o = {}
               o[where] = factor
               local index = 1
               for j = 1, #outputSize + 1 do
                  if j == where then
                     o[j] = factor
                  else
                     o[j] = outputSize[index]
                     index = index + 1
                  end
               end
               outputSize = o
            else -- or multiply the factor to another dimension
               local where = torch.random(1, #outputSize)
               outputSize[dim] = outputSize[dim] / factor
               outputSize[where] = outputSize[where] * factor
            end
         end
      end
      return outputSize
   end
   local outputSize = constructOutput(inputSize)
   local nelem1 = 1
   local nelem2 = 1
   for i = 1, #inputSize do nelem1 = nelem1 * inputSize[i] end
   for i = 1, #outputSize do nelem2 = nelem2 * outputSize[i] end
   tester:assert(nelem1, nelem2, 'input and output sizes have to be the same')
   local input, output

   local function createHoledTensor(size)
      local osize = {}
      for i = 1, #size do osize[i] = size[i] end
      -- randomly inflate a few dimensions in osize
      for i = 1, 3 do
         local dim = torch.random(1,#osize)
         local add = torch.random(4, 15)
         osize[dim] = osize[dim] + add
      end
      local input = torch.FloatTensor(torch.LongStorage(osize))
      -- now extract the input of correct size from 'input'
      for i = 1, #size do
         if input:size(i) ~= size[i] then
            local bounds = torch.random(1, input:size(i) - size[i] + 1)
            input = input:narrow(i, bounds, size[i])
         end
      end
      return input
   end

   -- extract a sub-cube with probability 50%
   -- (to introduce unreachable storage locations)
   local holedInput = torch.random(1, 2)
   local holedOutput = torch.random(1, 2)
   if holedInput == 1 then
      input = createHoledTensor(inputSize)
   else
      input = torch.FloatTensor(torch.LongStorage(inputSize))
   end
   input:storage():fill(-150)
   input:copy(torch.linspace(1, input:nElement(), input:nElement()))

   if holedOutput == 1 then
      output = createHoledTensor(outputSize)
   else
      output = torch.FloatTensor(torch.LongStorage(outputSize))
   end

   output:storage():fill(-100)
   output:fill(-1)
   -- function to randomly transpose a tensor
   local function randomlyTranspose(input)
      local d1 = torch.random(1, input:dim())
      local d2 = torch.random(1, input:dim())
      if d1 ~= d2 then input = input:transpose(d1, d2) end
      return input
   end
   -- randomly transpose with 50% prob
   local transposeInput = torch.random(1, 2)
   local transposeOutput = torch.random(1, 2)
   if transposeInput == 1 then
      for i = 1, 10 do input = randomlyTranspose(input) end
   end
   if transposeOutput == 1 then
      for i = 1, 10 do output = randomlyTranspose(output) end
   end

   local input_tensor_float = input
   local output_tensor_float = output
   local input_storage_float = input:storage()
   local output_storage_float = output:storage()
   local input_storage_cuda =
      torch.CudaStorage(input_storage_float:size()):copy(input_storage_float)
   local output_storage_cuda =
      torch.CudaStorage(output_storage_float:size()):copy(output_storage_float)
   local input_tensor_cuda = torch.CudaTensor(input_storage_cuda,
                                          input_tensor_float:storageOffset(),
                                          input_tensor_float:size(),
                                          input_tensor_float:stride())
   local output_tensor_cuda = torch.CudaTensor(output_storage_cuda,
                                          output_tensor_float:storageOffset(),
                                          output_tensor_float:size(),
                                          output_tensor_float:stride())

   output_tensor_float:copy(input_tensor_float)
   output_tensor_cuda:copy(input_tensor_cuda)

   -- now compare output_storage_cuda and output_storage_float for exactness
   local flat_tensor_float = torch.FloatTensor(input_storage_float)
   local flat_storage_cuda =
      torch.FloatStorage(input_storage_cuda:size()):copy(input_storage_cuda)
   local flat_tensor_cuda = torch.FloatTensor(flat_storage_cuda)

   local err = (flat_tensor_float - flat_tensor_cuda):abs():max()
   if err ~= 0 then
      print('copyRandomizedTest failure input size: ', input:size())
      print('copyRandomizedTest failure input stride: ', input:stride())
      print('copyRandomizedTest failure output size: ', output:size())
      print('copyRandomizedTest failure output stride: ', output:stride())
   end
   tester:assert(err == 0, 'diverging input and output in copy test')
end

function test.copyNoncontiguous()
     local x = torch.FloatTensor():rand(1, 1)
     local f = function(src)
        return src.new(2, 2):copy(src:expand(2, 2))
     end
     compareFloatAndCuda(x, f)

   local sz = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz, 1)
   local f = function(src)
      return src.new(sz, sz):copy(src:expand(sz, sz))
   end
   compareFloatAndCuda(x, f)

   x = torch.FloatTensor():rand(sz, sz, 2)
   local f = function(src)
      return src.new(sz, sz):copy(src[{{},{},{2}}])
   end
   compareFloatAndCuda(x, f)

   x = torch.FloatTensor():rand(2, sz, sz)
   local f = function(src)
      return src.new(sz, sz):copy(src[{{2},{},{}}])
   end
   compareFloatAndCuda(x, f)

   x = torch.FloatTensor():rand(sz, 2, sz)
   local f = function(src)
      return src.new(sz, sz):copy(src[{{},{2},{}}])
   end
   compareFloatAndCuda(x, f)

   x = torch.FloatTensor():rand(sz, 2, sz)
   local f = function(src)
      return src.new(sz, 1, sz):copy(src[{{},{2},{}}])
   end
   compareFloatAndCuda(x, f)

   x = torch.FloatTensor():rand(sz, sz):transpose(1,2)
   local f = function(src)
      return src.new(sz, sz):copy(src)
   end
   compareFloatAndCuda(x, f)

   -- case for https://github.com/torch/cutorch/issues/90
   do
      local val = 1
      local ps = torch.LongStorage({4, 4, 4})
      local cube = torch.Tensor(ps):apply(
         function()
            val = val + 1
            return val
         end
                                     ):cuda()

      local ps = torch.LongStorage({4, 12})
      local x = torch.CudaTensor(ps):fill(-1)

      local l = 2
      local h = 1
      local w = 2

      x[{{1},{1,9}}]:copy(cube[l][{{h,h+2},{w,w+2}}])
      tester:assert((x[{1,{1,9}}]-cube[l][{{h,h+2},{w,w+2}}]):abs():max() == 0,
         'diverging input and output in copy test')
   end
end

function test.largeNoncontiguous()
   local x = torch.FloatTensor():randn(20, 1, 60, 60)
   local sz = math.floor(torch.uniform(maxsize, 2*maxsize))
   local f = function(src)
      return src.new(20, sz, 60, 60):copy(src:expand(20, sz, 60, 60))
   end
   compareFloatAndCuda(x, f)
end

function test.zero()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCudaTensorArgs(x, 'zero')
end

function test.fill()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   local v = torch.uniform()
   compareFloatAndCudaTensorArgs(x, 'fill', v)
end

function test.reshape()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))*2
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCudaTensorArgs(x, 'reshape', sz1/2, sz2*2)
end

function test.zeros()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local t = torch.getdefaulttensortype()
   torch.setdefaulttensortype('torch.CudaTensor')
   local x = torch.zeros(sz1, sz2)
   assert(x:sum() == 0)
   torch.setdefaulttensortype(t)
end

function test.ones()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local t = torch.getdefaulttensortype()
   torch.setdefaulttensortype('torch.CudaTensor')
   local x = torch.ones(sz1, sz2)
   assert(x:sum() == x:nElement())
   torch.setdefaulttensortype(t)
end

function test.add()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   local y = torch.FloatTensor():rand(sz1, sz2)
   local z = torch.FloatTensor():rand(sz1, sz2)
   local v = torch.uniform()
   compareFloatAndCudaTensorArgs(x, 'add', z)
   compareFloatAndCudaTensorArgs(x, 'add', z, v)
   compareFloatAndCudaTensorArgs(x, 'add', y, z)
   compareFloatAndCudaTensorArgs(x, 'add', y, v, z)
end

function test.cmul()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   local y = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCudaTensorArgs(x, 'cmul', y)
end

function test.cpow()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   local y = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCudaTensorArgs(x, 'cpow', y)
end

function test.cdiv()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   local y = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCudaTensorArgs(x, 'cdiv', y)
end

function test.cdiv3()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   local y = torch.FloatTensor():rand(sz1, sz2)
   local z = torch.FloatTensor(sz1, sz2)
   compareFloatAndCudaTensorArgs(z, 'cdiv', x, y)
end

function test.addcmul()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   local y = torch.FloatTensor():rand(sz1, sz2)
   local z = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCudaTensorArgs(x, 'addcmul', y, z)
   compareFloatAndCudaTensorArgs(x, 'addcmul', torch.uniform(), y, z)

   local r = torch.zeros(sz1, sz2)
   compareFloatAndCudaTensorArgs(r, 'addcmul', x, y, z)
   compareFloatAndCudaTensorArgs(r, 'addcmul', x, torch.uniform(), y, z)
end

function test.addcdiv()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   local y = torch.FloatTensor():rand(sz1, sz2)
   local z = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCudaTensorArgs(x, 'addcdiv', y, z)
   compareFloatAndCudaTensorArgs(x, 'addcdiv', torch.uniform(), y, z)

   local r = torch.zeros(sz1, sz2)
   compareFloatAndCudaTensorArgs(r, 'addcdiv', x, y, z)
   compareFloatAndCudaTensorArgs(r, 'addcdiv', x, torch.uniform(), y, z)
end

function test.logicalValue()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   local y = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCudaTensorArgs(x, 'gt', y, 0.3)
   compareFloatAndCuda(x, 'gt', 0.3)
end

function test.logicalTensor()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   local y = torch.FloatTensor():rand(sz1, sz2)
   local z = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCudaTensorArgs(x, 'gt', z)
   compareFloatAndCudaTensorArgs(x, 'gt', y, z)
end

function test.mean()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCuda(x, 'mean')
   compareFloatAndCuda(x, 'mean', 1)
   compareFloatAndCuda(x, 'mean', 2)
end

function test.max()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCuda(x, 'max')
   compareFloatAndCuda(x, 'max', 1)
   compareFloatAndCuda(x, 'max', 2)
end

function test.min()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCuda(x, 'min')
   compareFloatAndCuda(x, 'min', 1)
   compareFloatAndCuda(x, 'min', 2)
end

function test.sum()
   local minsize = 10
   local maxsize = 20
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCuda(x, 'sum')
   compareFloatAndCuda(x, 'sum', 1)
   compareFloatAndCuda(x, 'sum', 2)
end

function test.prod()
   local minsize = 10
   local maxsize = 20
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCuda(x, 'prod')
   compareFloatAndCuda(x, 'prod', 1)
   compareFloatAndCuda(x, 'prod', 2)
end

function test.round()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCuda(x, 'round')
end

function test.var()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCuda(x, 'var')
   compareFloatAndCuda(x, 'var', 1, true)
   compareFloatAndCuda(x, 'var', 1, false)
   compareFloatAndCuda(x, 'var', 2, true)
   compareFloatAndCuda(x, 'var', 2, false)
end

function test.std()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   compareFloatAndCuda(x, 'std')
   compareFloatAndCuda(x, 'std', 1, true)
   compareFloatAndCuda(x, 'std', 1, false)
   compareFloatAndCuda(x, 'std', 2, true)
   compareFloatAndCuda(x, 'std', 2, false)
end

-- Test element-wise unary operators with both one and two arguments.
local function testUnary1(fn)
   local function test()
      local sz1 = math.floor(torch.uniform(minsize,maxsize))
      local sz2 = math.floor(torch.uniform(minsize,maxsize))
      local x = torch.FloatTensor():rand(sz1, sz2)
      compareFloatAndCudaTensorArgs(x, fn)
   end
   return test
end

local function testUnary2(fn)
   local function test()
      local sz1 = math.floor(torch.uniform(minsize,maxsize))
      local sz2 = math.floor(torch.uniform(minsize,maxsize))
      local x = torch.FloatTensor():rand(sz1, sz2)
      local y = torch.FloatTensor()
      compareFloatAndCudaTensorArgs(y, fn, x)
   end
   return test
end

for _,name in ipairs({"log", "log1p", "exp",
                      "cos", "acos", "cosh",
                      "sin", "asin", "sinh",
                      "tan", "atan", "tanh",
                      "sqrt",
                      "ceil", "floor",
                      "abs", "sign"}) do

   test[name .. "1"] = testUnary1(name)
   test[name .. "2"] = testUnary2(name)

end

function test.atan2(fn)
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   local y = torch.FloatTensor():rand(sz1, sz2)
   local z = torch.FloatTensor()
   compareFloatAndCudaTensorArgs(z, 'atan2', x, y)
end

function test.pow1()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   local pow = torch.uniform(minvalue,maxvalue)
   compareFloatAndCudaTensorArgs(x, 'pow', pow)
end

function test.pow2()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)
   local y = torch.FloatTensor()
   local pow = torch.uniform(minvalue,maxvalue)
   compareFloatAndCudaTensorArgs(y, 'pow', x, pow)
end

function test.powExponentTensor()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local pow = torch.uniform(minvalue,maxvalue)
   local x = torch.FloatTensor():rand(sz1, sz2)
   local y = torch.FloatTensor()
   compareFloatAndCudaTensorArgs(y, 'pow', pow, x)
end

function test.clamp1()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2):mul(5):add(-2.5)
   local min_val = -1
   local max_val = 1
   x[1][1] = min_val - 1
   if sz2 >= 2 then
     x[1][2] = max_val + 1
   end
   compareFloatAndCudaTensorArgs(x, 'clamp', min_val, max_val)
end

function test.clamp2()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2):mul(5):add(-2.5)
   local min_val = -1
   local max_val = 1
   x[1][1] = min_val - 1
   if sz2 >= 2 then
     x[1][2] = max_val + 1
   end
   local y = torch.FloatTensor():resizeAs(x)
   compareFloatAndCudaTensorArgs(y, 'clamp', x, min_val, max_val)
end

function test.index()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local sz3 = math.floor(torch.uniform(10,20))
   local x = torch.FloatTensor():rand(sz1, sz2)

   local longIndex = torch.LongTensor{math.floor(torch.uniform(1, sz1)), math.floor(torch.uniform(1, sz1))}
   local index = 1
   compareFloatAndCuda(x, 'index', index, longIndex)

   index = 2
   longIndex =  torch.LongTensor{math.floor(torch.uniform(1, sz2)), math.floor(torch.uniform(1, sz2))}
   compareFloatAndCuda(x, 'index', index, longIndex)

   x = torch.FloatTensor():rand(sz1)
   index = 1
   longIndex = torch.LongTensor{math.floor(torch.uniform(1, sz1)), math.floor(torch.uniform(1, sz1))}
   compareFloatAndCuda(x, 'index', index, longIndex)

   x = torch.FloatTensor():rand(sz1,sz2,sz3)
   index = 3
   longIndex = torch.randperm(sz3):long()
   compareFloatAndCuda(x, 'index', index, longIndex)
end

function test.indexCopy()
   local sz1 = math.floor(torch.uniform(minsize,maxsize)) -- dim1
   local sz2 = math.floor(torch.uniform(minsize,maxsize)) -- dim2
   local x = torch.FloatTensor():rand(sz1, sz2) -- input

   -- Case 1: 2D tensor, indexCopy over first dimension, 2 indices
   -- choose two indices from the first dimension, i.e. [1,sz1]
   local longIndex = torch.LongTensor{math.floor(torch.uniform(1, sz1)), math.floor(torch.uniform(1, sz1))}
   local index = 1
   local src = torch.Tensor(2, sz2):uniform()
   compareFloatAndCudaTensorArgs(x, 'indexCopy', index, longIndex, src)

   -- Case 2: 2D tensor, indexCopy over second dimension, 2 indices
   index = 2
   longIndex =  torch.LongTensor{math.floor(torch.uniform(1, sz2)), math.floor(torch.uniform(1, sz2))}
   src = torch.Tensor(sz1, 2):uniform():cuda()
   compareFloatAndCudaTensorArgs(x, 'indexCopy', index, longIndex, src)

   -- Case 3: 1D tensor, indexCopy over 1st dimension, 2 indices
   x = torch.FloatTensor():rand(sz1)
   index = 1
   longIndex = torch.LongTensor{math.floor(torch.uniform(1, sz1)), math.floor(torch.uniform(1, sz1))}
   src = torch.Tensor(2):uniform()
   compareFloatAndCudaTensorArgs(x, 'indexCopy', index, longIndex, src)
end

function test.indexFill()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local x = torch.FloatTensor():rand(sz1, sz2)

   local longIndex = torch.LongTensor{math.floor(torch.uniform(1, sz1)), math.floor(torch.uniform(1, sz1))}
   local index = 1
   local val = torch.randn(1)[1]
   compareFloatAndCuda(x, 'indexFill', index, longIndex, val)

   index = 2
   longIndex =  torch.LongTensor{math.floor(torch.uniform(1, sz2)), math.floor(torch.uniform(1, sz2))}
   val = torch.randn(1)[1]
   compareFloatAndCuda(x, 'indexFill', index, longIndex, val)

   x = torch.FloatTensor():rand(sz1)
   index = 1
   longIndex = torch.LongTensor{math.floor(torch.uniform(1, sz1)), math.floor(torch.uniform(1, sz1))}
   val = torch.randn(1)[1]
   compareFloatAndCuda(x, 'indexFill', index, longIndex, val)
end

function test.renorm()
   local x = torch.randn(10,5):float()
   local maxnorm = x:norm(2,1):mean()

   compareFloatAndCuda(x, 'renorm', 2, 2, maxnorm)

   x = torch.randn(3,4,5)
   compareFloatAndCuda(x, 'renorm', 2, 2, maxnorm)

   x = torch.randn(3,4,5)
   compareFloatAndCuda(x, 'renorm', 3, 2, maxnorm)

   x = torch.randn(3,4,5,100)
   compareFloatAndCuda(x, 'renorm', 3, 2, maxnorm)

   x = torch.randn(3,4,5,100)
   compareFloatAndCuda(x, 'renorm', 4, 2, maxnorm)
end

function test.indexSelect()
   --  test for speed
   local n_row = math.random(minsize,maxsize)
   local n_col = math.random(minsize,maxsize)
   local n_idx = math.random(n_col)

   local x = torch.randn(n_row, n_col):float()
   local indices = torch.randperm(n_idx):long()
   local z = torch.FloatTensor()

   local tm = {}
   local title = string.format('indexSelect ')
   times[title] = tm

   z:index(x, 2, indices)
   local groundtruth = z:clone()
   local clock = torch.Timer()
   for i=1,nloop do
      z:index(x, 2, indices)
   end
   tm.cpu = clock:time().real

   x = x:cuda()
   z = torch.CudaTensor()

   z:index(x, 2, indices)
   local rescuda = z:clone():float()
   clock:reset()
   for i=1,nloop do
      z:index(x, 2, indices)
   end
   tm.gpu = clock:time().real

   tester:assertTensorEq(groundtruth, rescuda, 0.00001, "Error in indexSelect")
end

function test.addmv()
   --[[ Size ]]--
   local sizes = {
      {2,1},
      {1,2},
      {1,1},
      {3,4},
      {3,3},
      {15,18},
      {19,15}
   }
   for _, size in pairs(sizes) do
      local n, m = unpack(size)
      local c = torch.zeros(n)
      local a = torch.randn(n, m)
      local b = torch.randn(m)
      compareFloatAndCudaTensorArgs(c, 'addmv', torch.normal(), torch.normal(), a, b)
   end
end

function test.mv()
   --[[ Size ]]--
   local sizes = {
      {2,1},
      {1,2},
      {1,1},
      {3,4},
      {3,3},
      {15,18},
      {19,15}
   }
   for _, size in pairs(sizes) do
      local n, m = unpack(size)
      local c = torch.zeros(n)
      local a = torch.randn(n, m)
      local b = torch.randn(m)
      compareFloatAndCudaTensorArgs(c, 'mv', a, b)
   end
end

function test.addr()
   --[[ Size ]]--
   local sizes = {
      {2,1},
      {1,2},
      {1,1},
      {3,4},
      {3,3},
      {15,18},
      {19,15}
   }
   for _, size in pairs(sizes) do
      local n, m = unpack(size)
      local c = torch.zeros(n,m)
      local a = torch.randn(n)
      local b = torch.randn(m)
      compareFloatAndCudaTensorArgs(c, 'addr', torch.normal(), a, b)
   end
end

function test.addmm()
   --[[ Size ]]--
   local sizes = {
      {16, 3, 1},
      {1, 12, 1},
      {24, 23, 22},
      {1, 1, 1},
      {1, 1, 7},
      {12, 1, 12},
      {10, 10, 10},
   }
   for _, size in pairs(sizes) do
      local n, k, m = unpack(size)
      local c = torch.zeros(n, m)
      local a = torch.randn(n, k)
      local b = torch.randn(k, m)
      compareFloatAndCudaTensorArgs(c, 'addmm', torch.normal(), torch.normal(), a, b)
   end
end

function test.mm()
   --[[ Size ]]--
   local sizes = {
      {16, 3, 1},
      {1, 12, 1},
      {24, 23, 22},
      {1, 1, 1},
      {1, 1, 7},
      {12, 1, 12},
      {10, 10, 10},
   }
   for _, size in pairs(sizes) do
      local n, k, m = unpack(size)
      local c = torch.zeros(n, m)
      local a = torch.randn(n, k)
      local b = torch.randn(k, m)
      compareFloatAndCudaTensorArgs(c, 'mm', a, b)
   end
end

function test.baddbmm()
   local sizes = {
      {16, 3, 1, 4},
      {1, 12, 1, 7},
      {24, 23, 22, 21},
      {1, 1, 1, 1},
      {1, 1, 7, 4},
      {12, 1, 12, 1},
      {10, 10, 10, 10},
   }
   for _, size in pairs(sizes) do
      local b, n, k, m = unpack(size)
      local cs = torch.randn(b, n, m)
      local as = torch.randn(b, n, k)
      local bs = torch.randn(b, k, m)
      compareFloatAndCudaTensorArgs(cs, 'baddbmm', as, bs)
   end
end

function test.baddbmmTransposed()
   local b, n, k, m = 16, 3, 8, 4
   -- Can't use compareFloatAndCudaTensorArgs because the transposition will be
   -- lost when converting the tensor to a CudaTensor.
   local c_cpu = torch.randn(m, n, b)  -- First and last dimensions will be tranposed.
   local a_cpu = torch.randn(n, b, k)  -- First two dimensions will be transposed.
   local b_cpu = torch.randn(b, m, k)  -- Last two dimensions will be transposed.

   local c_cuda = c_cpu:cuda()
   local a_cuda = a_cpu:cuda()
   local b_cuda = b_cpu:cuda()

   c_cpu = c_cpu:transpose(1, 3)
   c_cuda = c_cuda:transpose(1, 3)
   a_cpu = a_cpu:transpose(1, 2)
   a_cuda = a_cuda:transpose(1, 2)
   b_cpu = b_cpu:transpose(2, 3)
   b_cuda = b_cuda:transpose(2, 3)

   c_cpu:baddbmm(a_cpu, b_cpu)
   c_cuda:baddbmm(a_cuda, b_cuda)

   tester:assert(isEqual(c_cpu, c_cuda, 1e-5),
                 string.format("Divergent results between CPU and CUDA for function 'bmm'"))
end

function test.bmm()
   local sizes = {
      {16, 3, 1, 4},
      {1, 12, 1, 7},
      {24, 23, 22, 21},
      {1, 1, 1, 1},
      {1, 1, 7, 4},
      {12, 1, 12, 1},
      {10, 10, 10, 10},
   }
   for _, size in pairs(sizes) do
      local b, n, k, m = unpack(size)
      local cs = torch.zeros(b, n, m)
      local as = torch.randn(b, n, k)
      local bs = torch.randn(b, k, m)
      compareFloatAndCudaTensorArgs(cs, 'bmm', as, bs)
   end
end

function test.bmmTransposed()
   local b, n, k, m = 16, 3, 8, 4
   -- Can't use compareFloatAndCudaTensorArgs because the transposition will be
   -- lost when converting the tensor to a CudaTensor.
   local c_cpu = torch.zeros(b, n, m)
   local a_cpu = torch.randn(b, k, n)  -- Last two dimensions will be transposed.
   local b_cpu = torch.randn(m, k, b)  -- First and last dimensions will be transposed.

   local c_cuda = c_cpu:cuda()
   local a_cuda = a_cpu:cuda()
   local b_cuda = b_cpu:cuda()

   a_cpu = a_cpu:transpose(2, 3)
   a_cuda = a_cuda:transpose(2, 3)
   b_cpu = b_cpu:transpose(1, 3)
   b_cuda = b_cuda:transpose(1, 3)

   c_cpu:bmm(a_cpu, b_cpu)
   c_cuda:bmm(a_cuda, b_cuda)

   tester:assert(isEqual(c_cpu, c_cuda, 1e-5),
                 string.format("Divergent results between CPU and CUDA for function 'bmm'"))
end

function test.ger()
   --[[ Size ]]--
   local sizes = {
      {16, 1},
      {1, 12},
      {24, 23},
      {1, 1},
      {33, 7},
      {12, 14},
      {10, 10},
   }
   for _, size in pairs(sizes) do
      local n, m = unpack(size)
      local c = torch.zeros(n, m)
      local a = torch.randn(n)
      local b = torch.randn(m)
      compareFloatAndCudaTensorArgs(c, 'ger', a, b)
   end
end

function test.isSameSizeAs()
   local t1 = torch.CudaTensor(3, 4, 9, 10)
   local t2 = torch.CudaTensor(3, 4)
   local t3 = torch.CudaTensor(1, 9, 3, 3)
   local t4 = torch.CudaTensor(3, 4, 9, 10)

   tester:assert(t1:isSameSizeAs(t2) == false, "wrong answer ")
   tester:assert(t1:isSameSizeAs(t3) == false, "wrong answer ")
   tester:assert(t1:isSameSizeAs(t4) == true, "wrong answer ")
end

-- Test random number generation.
local function checkIfUniformlyDistributed(t, min, max)
   tester:assertge(t:min(), min - 1e-6, "values are too low")
   tester:assertle(t:max(), max + 1e-6, "values are too high")
   tester:assertalmosteq(t:mean(), (min + max) / 2, 0.1, "mean is wrong")
end

function test.uniform()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local min = torch.uniform()
   local max = min + torch.uniform()
   local t = torch.CudaTensor(sz1, sz2)

   t:uniform(min, max)
   checkIfUniformlyDistributed(t, min, max)
end

function test.bernoulli()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local p = torch.uniform()
   local t = torch.CudaTensor(sz1, sz2)

   t:bernoulli(p)
   tester:assertalmosteq(t:mean(), p, 0.1, "mean is not equal to p")
   local f = t:float()
   tester:assertTensorEq(f:eq(1):add(f:eq(0)):float(),
                         torch.FloatTensor(sz1, sz2):fill(1),
                         1e-6,
                         "each value must be either 0 or 1")
end

function test.normal()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local mean, std = torch.uniform(), torch.uniform()
   local tolerance = 0.01
   local t = torch.CudaTensor(sz1, sz2)

   t:normal(mean, std)
   tester:assertalmosteq(t:mean(), mean, tolerance, "mean is wrong")
   tester:assertalmosteq(t:std(), std, tolerance, "standard deviation is wrong")
end

function test.logNormal()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local mean, std = torch.uniform(), torch.uniform()
   local tolerance = 0.01
   local t = torch.CudaTensor(sz1, sz2)

   t:logNormal(mean, std)
   local logt = t:log()
   tester:assertalmosteq(logt:mean(), mean, tolerance, "mean is wrong")
   tester:assertalmosteq(logt:std(), std, tolerance, "standard deviation is wrong")
end

function test.geometric()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local p = torch.uniform()
   local t = torch.CudaTensor(sz1, sz2)

   t:geometric(p)
   local u = torch.FloatTensor(sz1, sz2):fill(1) -
                 ((t:float() - 1) * math.log(p)):exp()
   checkIfUniformlyDistributed(u, 0, 1)
end

function test.exponential()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local lambda = torch.uniform()
   local t = torch.CudaTensor(sz1, sz2)

   t:exponential(lambda)
   local u = torch.FloatTensor(sz1, sz2):fill(1) -
                 (t:float() * -lambda):exp()
   checkIfUniformlyDistributed(u, 0, 1)
end

function test.cauchy()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local median, sigma = torch.uniform(), torch.uniform()
   local t = torch.CudaTensor(sz1, sz2)

   t:cauchy(median, sigma)
   local u = ((t:float() - median) / sigma):atan() / math.pi + 0.5
   checkIfUniformlyDistributed(u, 0, 1)
end

function test.random_seed()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local mean, std = torch.uniform(), torch.uniform()
   local tolerance = 0.01
   local t = torch.CudaTensor(sz1, sz2)
   local u = torch.CudaTensor(sz1, sz2)

   local seed = cutorch.seed()
   t:normal(mean, std)
   cutorch.manualSeed(seed)
   u:normal(mean, std)
   tester:assertTensorEq(t:float(), u:float(), 1e-6, "values not equal after resetting the seed")
end

function test.restore_rng()
   local sz1 = math.floor(torch.uniform(minsize,maxsize))
   local sz2 = math.floor(torch.uniform(minsize,maxsize))
   local mean, std = torch.uniform(), torch.uniform()
   local tolerance = 0.01
   local t = torch.CudaTensor(sz1, sz2)
   local u = torch.CudaTensor(sz1, sz2)

   local seed = cutorch.seed()
   local rng = cutorch.getRNGState()
   t:normal(mean, std)
   -- Change the seed so we can check that restoring the RNG state also restores the seed.
   cutorch.manualSeed(seed + 123)
   cutorch.setRNGState(rng)
   u:normal(mean, std)
   tester:assertTensorEq(t:float(), u:float(), 1e-6, "values not equal after restoring the RNG state")
   tester:asserteq(cutorch.initialSeed(), seed, "seed was not restored")
end

function test.multi_gpu_random()
   local rs = cutorch.getRNGState()
   cutorch.manualSeedAll(1) -- set all device seeds to be the same

   -- requires at least 2 devices
   local device_count = cutorch.getDeviceCount()
   if device_count < 2 then
      return
   end
   cutorch.setDevice(1)
   local n = 3
   local expected = torch.CudaTensor(n):uniform():float()
   for i = 2, device_count do
      cutorch.setDevice(i)
      local actual = torch.CudaTensor(n):uniform():float()
      assert(isEqual(expected, actual), "random tensors dont seem to be equal")
   end
   cutorch.setRNGState(rs) -- cleanup after yourself
end

function test.get_device()
    local device_count = cutorch.getDeviceCount()
    local tensors = { }
    for i = 1,device_count do
        table.insert(tensors, torch.Tensor():cuda())
    end
    -- Unallocated tensors are on device 0
    for i = 1,device_count do
        assert(tensors[i]:getDevice() == 0, "unallocated tensor does not have deviceID 0")
        -- Now allocate it
        cutorch.setDevice(i)
        tensors[i]:resize(1, 2, 3)
        assert(tensors[i]:getDevice() == i, "tensor does not have the correct deviceID")
    end
end

function test.reset_device()
   local sz = math.floor(torch.uniform(minsize,maxsize))

   cutorch.manualSeed(2384)
   local t = torch.CudaTensor(sz):normal()

   -- Create a CPU copy and destroy the GPU tensor because the GPU pointer will be invalidated by the reset.
   local tf = t:float()
   t = nil
   collectgarbage()

   -- After a device reset, the RNG state should have been reset to its initial state.
   cutorch.deviceReset()
   local u = torch.CudaTensor(sz):normal()

   tester:assertTensorEq(tf, u:float(), 1e-6, "values not equal after restoring the RNG state")
end

function cutorch.test(tests)
   math.randomseed(os.time())
   torch.manualSeed(os.time())
   cutorch.manualSeedAll(os.time())
   tester = torch.Tester()
   tester:add(test)
   tester:run(tests)
   print ''
   for module,tm in pairs(times) do
      print(module .. ': \t average speedup is ' .. (tm.cpu / (tm.gpu or 1e6)))
   end
end

if runtests then
   cutorch.test()
end

redpajama_set_name: RedPajamaGithub


text:
After Months of Protests, Duke University Removes White Supremacist's Name From Campus Building
Source: Julissa Catalan/DiversityInc
Recently Duke University President Richard H. Broadhead announced to student leaders that Aycock Hall—a building named in honor of white supremacist Charles Brantley Aycock—will be renamed.
The freshmen dorm, which has been known as Aycock Hall for over a century, will now go back to its original name of East Residence Hall—the name for the dorms back when Duke University was called Trinity College.
The news of this campus update comes after years of student protest, including a Duke Student Government resolution, which supports the name change. This was passed six months ago, and was backed by the DSG as well as the Black Student Alliance.
"The building was named early in the twentieth century on one view of history, and that view of history no longer prevails,"Brodhead said. "Given the circumstances, it seems a good time to change the name."
Charles Brantley Aycock was a leader of the white supremacy movement in the early 1900's when he was also a governor.
In fact, he was known as the "education governor," aiming to improve North Carolina's schools, which were then at a major decline.
By the end of his tenure, 690 new schools had been built—599 for whites and 91 for Blacks.
But more so, Aycock was known for his prominent role as a supremacy leader. According to historians—during Aycock's term—this included mass violence as well as voter intimidation and fraud. Blacks were given literacy tests prior to being allowed to vote.
According to vice president of government relations and public affairs, Michael Schoenfeld, the name change is effective immediately, adding that when the Class of 2018 receives their housing assignments this week, East Residence Hall will be listed rather than Aycock for the first time in more than a hundred years.
To read the article in its entirety visit DiversityInc.
AycockDukeWhite Supremacy

redpajama_set_name: RedPajamaCommonCrawl


Is your dog pulling on the leash practically pulling your arms out of their sockets? I see people walking their dogs, no their dogs are walking them, the dog pulling them all the way. If you let a dog pull on the leash he will think that is what he is supposed to do and keep doing it.
So how do you stop this behavior? First of all if your dog is grown, it might take some time. Ingrained habits take longer to unlearn. If you have more patience than your dog you will eventually be able to train your dog. The key is to be more stubborn, more determined than your dog. And know what to do along the way.
If pulling is something you don't like, then don't tolerate it even for a second. If your dog is pulling forward, either stop, or quickly turn a different way and say "this way" to get the dog going in a different direction. As he turns there will be a brief moment of slack in the leash. You can tell your dog "that's right" as this happens.
Now that you are headed in a different direction and your dog starts pulling again, quickly turn a different direction and say in a calm but affirmative voice "this way" and your dog will follow. Give an affirmative "that's right" when there is slack. If you can make this seem like a game for your dog, he will start paying attention to you and begin watching you to see if you are going to change direction.
To improve the conditions for you and your dog, giving him a longer time of good behavior and you more time to see what is coming and correct him before he hits the end of the leash ( which could be micro seconds on a six foot leash) use a long line. The long line will give you time to call out a change of direction before he gets to the end of the leash.
There is a whole lot more to be gained and more training available with a long line. Some dog trainers specialize in the use of a long line. Whatever method you use to teach your dog to stop pulling on the leash, make sure that you never let your dog do it in the first place, then he'll never be reinforced for doing something you find unpleasant.
John Spieser is the master of The Long Line Dog Training Method. Get his free audio where he talks about how he uses the long line with dogs and puppies. This will work with your neck strong dog or puppy if you stay consistent.
When we first get our new puppy or dog from rescue, we usually want to know what kind of training, if any, the dog knows. Sit is about the very first thing a dog learns so many dogs know this one, even puppies. But as we move through life with our dogs it is very useful for humans to be able to direct the dogs from one place to another. Wouldn't it be convenient if our dogs could change direction or wait for a few minutes while we made our way to the car, around the block or even in the house?
My dog trainer, John Spieser, says that the first two dog training commands he teaches a dog or a puppy are "wait" and "this way". Using these two commands he can get a dog to go just about anywhere he needs them to and keep him safe along the way.
The command "wait" is easy to teach your dog. For some reason, wait, feels temporary to a dog so he's more willing to wait then to have to "stay" somewhere for a long time. "Wait" is good for street corners. Tell your dog to wait at the corner while traffic passes. Or maybe your dog needs to wait while another dog, kids, bike or whatever passes by. Maybe you want him to wait for his food. Whatever the reason, the dog learns that it is only a temporary situation, soon to be followed by the release (which is rewarding) and possibly more positive stimulation.
The "this way" command is better than come. The recall or "come" command tends to get over used and dogs may get resentful after hearing it often. Using "this way" allows the dog to keep moving but in a different direction. If your dog is running away from you and doesn't respond to the typical recall command of "come", then try implementing "this way" into your training routine. A dog hears this as a chance to please and still keep moving. It's much less restrictive to the dog and it's really easy to teach this to a dog.
For more effective communication with your dog, try dog training commands that teach your dog how to move with you without being too restrictive. Consider making "wait" and "this way" a primary part of your repertoire. The two dog training commands that make the most sense are ones that give you a lot of versatility with your dog.
Get your dog or puppy moving where you want him using these two dog training commands. It stops pulling on the leash too. Listen in the free audio from my dog trainer John Spieser.
Is Dog Pulling on Leash a Problem for You?
Does your dog pulling on the leash on walks frustrate you and make you wish you didn't have to walk your dog? Did your dog come to you as an adult from a shelter? Then it is likely that you never had the chance to train the dog properly from the start, when he was a puppy.
If you got your dog as a puppy and didn't train him properly, it's likely you never knew the right way to train your dog. Don't worry. Old dogs can learn new tricks as long as you are willing to put the time in to train your dog the right way.
A dog pulling on a leash should never be tolerated. Once you have let a dog pull on the leash you've effectively trained him that pulling is OK. So every time you are walking your dog and he's pulling, you're saying to the dog this is what I expect. And the bad behavior gets reinforced.
Training a dog can be frustrating unless you have the right attitude. Patience is required. Standing in one spot and not moving forward while your dog pulls on the leash is perfectly acceptable. Don't reward your dog by moving forward when your dog is doing something you don't approve of.
Keep a positive attitude and realize this is what is required right now. Once your dog learns how to walk without pulling on the leash your walks can resume. And you'll be much happier. The sooner you don't give in to your dog's bad behavior, the sooner he will have no desire to keep it up. It won't get him anywhere, he'll figure out a new way to get what he wants, on your terms. Remember, dogs are smart.
When walking a dog on a leash, any tension in the leash is a sign that you need to address the dog with either a command or correction or both, carefully timed. One difficulty with using a short leash is that you don't have much time to give a verbal command before the dog reaches the end of a short leash. It's no wonder that so many dogs pull on a leash. The owners don't have time to correct them.
Another reason dogs don't get trained well is that when they are puppies, well meaning but uninformed adults let small children take the new puppy on a walk. With absolutely no dog training skills a kid basically drags a young puppy around on the leash teaching the dog that this is what it's supposed to be like. There is always supposed to be tension on my neck.
This is so unfair to the puppy. The puppy is getting nothing positive out of this experience and just ends up learning how to irritate its owners every time it goes for a much needed walk.
One technique that is very useful in training a dog to walk on a leash is by using a long line. The long line dog training method allows you time to give a verbal correction or command to your dog before he reaches the end of the leash. This technique is extremely useful when you need to make changes to an adult dog's behavior. An adult dog may run a lot faster than a puppy and get to the end of the leash or line quicker than a small puppy.
Training your dog properly to walk on a leash is something you need to do as a responsible pet owner. Dogs need to learn how to behave from humans if they want to survive in a human world.
You can learn about the long line dog training method and stop your dog pulling on the leash. You and your dog will walk in harmony after you learn the simple method discussed in this free audio.
There are probably as many dog training methods as there are dog trainers out in the world of dogs. Each dog trainer has a particular spin on dog training. Every dog trainer needs to motivate a dog in a way so that the dog behaves in a desired way.
So dog training methods are based in motivation of the dog. What motivates you the most? Is it when someone yells at you? Maybe you really appreciate this if it happens infrequently and right before your about to hit by a bus!
If someone yells at you all the time, chances are you're going to tune it out or normalize it in your head. It just won't matter, but it will still be pretty annoying. That's how I've seen it with dogs.
I have friends who (try to) motivate their dogs by yelling at them. No they SCREAM! at them. The dogs don't care any more. They've learned to tune it out.
I'm a proponent of sane living so I like it when I see a dog trainer talking peacefully to a dog. Seeing a dog responding to this kind of dog training method gives me hope for a saner world.
You can talk to you dog in a normal voice and expect response. Sometimes you'll need to increase your energy, but you know your dog will listen to you because that is something out of the ordinary and your dog is going to be surprised, if not curious.
Getting your dog's attention is a key part of the dog trainer's dog training method. How you choose to communicate with your dog speaks volumes about your relationship with your dog.


Providing the perfect mind-body exercise program for all Australians based on well-researched and tested guidelines from the best Sport Universities, Organisations and Professionals in China and Australia.
For all our latest information on workshops, retreat weekends, tours, special events and activities.
For all the latest studies and information relating to how Tai Chi and Qigong can benefit you now, and in to the future.
Read our latest news plus interesting articles on Health Benefits, Tai Chi Theory / Philosophy and more in our blog.
Everyone at JinLi is passionate about everything Tai Chi and Qigong. We want to share our knowledge and experience freely. If you have any questions at all please feel free to talk to us.
Lily & Tara at JinLi have played a critical role with my recovery from Lyme Disease. Since taking private lessons with Lily for tailored teachings for my health, my physical strength and energy levels have improved dramatically and continue to do so. What surprised me the most, is my confidence levels improving and connecting so strongly with Qigong and Tai Chi.
Tara is a wonderfully encouraging and positive teacher who really takes the time to support everyone who attends her classes. I enjoy the challenge of both Qigong and Tai Chi and feel relaxed yet energised after each class.
I was reflecting the other day that of the scores of teachers, of myriad subjects, that I've had in my life none has been better than you. So, please keep on doing what you're doing; you might just be the best thing tai chi has going for it outside China.
Tara is everything you could wish for in a tai chi master. She looks after the individual and the group. Tara is supportive, knowledgeable and always giving to her students. Take a class and find out.


text:
Nikolaj Ivanovič Seljavin (), ruski general, * 1774, † 1833.

Bil je eden izmed pomembnejših generalov, ki so se borili med Napoleonovo invazijo na Rusijo; posledično je bil njegov portret dodan v Vojaško galerijo Zimskega dvorca.

Življenje
Leta 1790 je kot vodnik vstopil v Jekaterinoslavski grenadirski polk in 19. februarja 1797 je bil kot podporočnik premeščen v Azovski mušketirski polk. V njegovi sestavi se je udeležil italijansko-švicarske kampanje. Bil je hudo ranjen, tako da so ga Francozi zajeli.

V ujetništvu je ostal pol leta, nato pa se je vrnil v polk; kot stotnik je bil nato premeščen v oskrbovalno službo. Udeležil se je tudi vojne tretje koalicije in rusko-švedske vojne (1808-09). 15. septembra 1811 je bil povišan v polkovnika.

Med patriotsko vojno je bil vodja izobraževanja v oskrbovalnem oddelku poveljnika 1. zahodne armade; decembra 1812 se je vrnil v aktivno vojaško službo kot v.d. načelnika generalštaba. Za zasluge pri pripravi bojnih načrtov je bil 4. oktobra 1813 povišan v generalmajorja. Po vojni se je vrnil v oskrbovalno službo.

22. avgusta 1826, na dan ustoličenja carja Nikolaja I., je bil povišan v generalporočnika. Leta 1826 je postal podpredsednik carske pisarne.

Viri in opombe

Glej tudi

 seznam ruskih generalov

Rojeni leta 1774
Umrli leta 1833
Ruski generali
Ruski plemiči
Generali Imperialne ruske kopenske vojske
Veterani finske vojne
Veterani Napoleonovih vojn
Veterani italijanske in švicarske ekspedicije (1799–1800)
Nosilci reda svete Ane
Nosilci reda svetega Jurija
Nosilci reda svetega Vladimirja
Nosilci reda rdečega orla
Nosilci Pour le Mérite
Nosilci reda Maksimilijana Jožefa
Nosilci reda črnega orla
Nosilci reda belega orla (Rusija)

redpajama_set_name: RedPajamaWikipedia


Welcome to Fuzion Fitness Brampton — everything you've ever wanted in a gym!
If you are looking for a health club in Brampton, you've found the right place. Our amazing facility is like no other, providing you with the best equipment and tools to reach your fitness goals. You can get in shape using our cardio equipment or build lean muscle by lifting weights in our strength training area.
We also offer a large class schedule, hot yoga, steam rooms, a ladies' only gym area, a juice and full coffee bar, personal training, and even a Styku 3D body scan as part of your membership. We truly believe that we are the best gym in Brampton, as we have competitive classes and amenities that no other gym can provide you. Did we mention we also have on-site childcare? That's just another amazing perk that makes us the gym for you.
Stop by out Fuzion Fitness location in Brampton today and let us show you why we are the gym for you.


We believe that prolonged time period partnership is really a result of top of the range, benefit added provider, prosperous knowledge and personal contact for 4g Antenna Placement , 4g antenna placement , gps antenna placement , the business has always been committed to supporting prospects to become the current market leader in their respective industries.
"It really is our responsibility to satisfy your requirements and competently serve you. Your fulfillment is our greatest reward. We're on the lookout forward in your go to for joint progress for 4g Antenna Placement , 4g antenna placement , gps antenna placement , We take measure at any price to attain essentially the most up-to-date gear and procedures. The packing of nominated brand is our a further distinguishing feature. The solutions to assure years of trouble-free service has attracted a great deal customers. The goods are obtainable in improved designs and richer variety they're produced scientifically of purely raw supplies. It accessible in a variety of designs and specifications for the selection. The newest forms are much far better than the previous one and they're extremely popular with several clients.


text:
Agriculture, EU, Europe, Finance & Investment, Food Manufacturing, Halal Integrity, Halal Trade, Middle East & Africa, Research, Shariah Issues, UK
UK: New think tank to develop Europe's halal economy
By Christopher Hamill-Stewart – Arab News
LONDON: A new think tank focused on developing Europe's halal economy promises to provide thought leadership, policy direction and professional development for the continent's growing Shariah-compliant economy.
"The halal economy has multiple facets including food, finance, tourism, fashion and more. However, the focus of this think tank will be the halal food and business sector, particularly Islamic finance," said the Halal Economy Think Tank, launched by the Bahrain Institute of Banking and Finance (BIBF) and Spain's San Telmo Business School.
"The first initiative the Halal Economy Think Tank will undertake would be aimed at food companies as well as entrepreneurs who want to tap into the ever-growing halal food market in Europe, through an executive program to be launched by the end of 2021."
Based in Seville and Malaga, Spain, the think tank's launch comes as competition in Europe's Islamic finance sector heats up.
Spurred in part by Brexit, European nations — including the UK, Ireland and Luxembourg — have increasingly been vying for the status of European hub of Islamic finance. Experts see no signs that this trend is abating.
"The Halal Economy Think Tank will also provide a series of policy papers on these issues, which will be issued by the BIBF Islamic Finance Centre given its considerable experience in this space as the oldest Islamic finance professional qualifications provider in the world," the think tank said.
Mujtaba Khalid, head of the Islamic Finance Centre and executive director of the think tank, told Arab News: "The Muslim population in Europe has grown steadily over the past 50 years, both in terms of numbers as well as net worth. This growth will pick up considerably over the coming years."
He added: "By 2050, Muslims will comprise roughly 14 percent of the total population of Europe. Couple this with the fact that the Muslim demographic in Europe is much younger, we see a big market opportunity in the European halal space."
The think tank's inaugural executive education program, focused on the halal food economy and due to launch in late 2021, "will enable agriculture and food entrepreneurs to leverage off this halal food business opportunity," Khalid said.
Not only will the think tank's launch develop the halal economy's policy and knowledge infrastructure in Europe, it will also facilitate the continued growth of Gulf-European ties.
Tens of billions' worth of euros are traded between the EU and Gulf Cooperation Council (GCC) member states every year.
In 2019, GCC countries exported over €40 billion ($47.5 billion) worth of goods to the EU, and imported over €70 billion worth.
Khalid said projects such as the Halal Economy Think Tank "definitely help facilitate both economic as well as people-to-people ties between the two regions. It's hoped that we can further increase such ties going forward."
Interview: Nigeria Needs to Develop its Halal Value Chain to…
UK: Halal Certification Europe (HCE)
Turkey: 'Islamic countries need to develop trade with each…
This entry was posted in Agriculture, EU, Europe, Finance & Investment, Food Manufacturing, Halal Integrity, Halal Trade, Middle East & Africa, Research, Shariah Issues, UK and tagged Halal Economy Think Tank.


Entrepreneurs stand out in a crowd. They like being their own boss. They think big, take risks and shrug off failure. When they feel stifled or bored, they either change their environment or leave. But do not let them go. Your organization needs them.
The entrepreneurs on your payroll are the pioneers who spark new enterprises, products, services and processes. They see opportunities that others miss and create value for everyone around them, including customers, employees, shareholders and communities. They are your most important edge in an era of increased global competition.
While some entrepreneurs prefer the freedom of starting their own companies, you have assets in your organization that can entice many to stay. Silicon Valley is famous for its startups, but entrepreneurship is a universal concept with applications in a number of domains. Existing organizations in the commercial, social and public sectors all show results when they invest in the development and retention of entrepreneurs. This rarely happens by accident or without support from the highest levels of management.
As organizations grow larger and stabilize, natural barriers to entrepreneurship emerge. I explore these barriers and offer solutions in my new book, Corporate Entrepreneurship: How to Create a Thriving Entrepreneurial Spirit Throughout Your Company (McGraw-Hill, Sept. 16, 2011), coauthored with Thunderbird School of Global Management researcher Claudine Kearney, Ph.D.
Corporate entrepreneurship, which also has been called "intrapreneurship" or "corporate venturing," involves overcoming the inertia, rigidity, rules and bureaucratic roadblocks that entrepreneurs hate. Companies such as Google, Unilever and American Greetings have shown that existing organizations can create work environments that reward innovation and keep entrepreneurs happy. To make this happen, senior managers must address key challenges in three areas: Corporate culture, communication and compensation.
Coming to work needs to be fun for entrepreneurs. They need flexibility to explore ideas, tackle challenges and make mistakes. Sometimes they need to stare out a window or go for a walk.
This is fine if they work for themselves, but corporate paychecks come with bottom line responsibility. Public companies must answer to shareholders, regulators and tax collectors. They must file forms and enforce policies. Freedom must have limits.
The key is compromise. American Greetings in Cleveland, Ohio, showed the right balance when it moved into the online greeting card business in the early 2000s. The company established a subsidiary for its online cards in a separate building on its main campus away from the formal offices.
Instead of a receptionist sitting behind a desk, guests today at AG Interactive find workers dressed in T-shirts working irregular hours, eating pizza and sometimes playing table tennis. The subsidiary operates within the corporate structure but rewards different types of behavior and outputs. As a result, innovation has flourished — along with market share. AG Interactive reported about 3.8 million online paid subscriptions in February 2011.
Managers who invest in this type of corporate culture find they can never return to the old way of doing business. Once their teams experience a model of controlled freedom, they get entrepreneurship in their blood and never want to change back.
Another key to keeping corporate entrepreneurs happy is to communicate the benefits your organization provides.
Entrepreneurs who operate in the corporate structure never will achieve the multimillion-dollar payoffs that come with breakthrough startups such as Facebook, but their chances for success rise dramatically when they tap into the marketing, finance and accounting resources available within your organization.
Corporate entrepreneurs need to understand this. You need them, but they need you.
About 70 percent of North American startups fail within five years when entrepreneurs operate on their own. Corporate ventures also fail, but shareholders carry the bulk of the risk. Paychecks continue coming every two weeks for corporate entrepreneurs regardless of results.
Corporations provide a safety net, structure and platform for experimentation. Managers who communicate this well can persuade many of their superstars to stay.
Another aspect of communication involves listening to the needs of your best employees when it comes to compensation. Entrepreneurs who pass up the prospect of a lucrative IPO or private equity buyout still need fair pay for the value they create within your organization.
Finding the right package can be tricky. Creative and responsive managers consider economic and noneconomic rewards.
Economic rewards start with base salary but also might include stock options, performance pay and other bonus systems. One benefit might include college tuition assistance for the entrepreneur's family — something that U.S. companies can structure as a charitable contribution.
On the noneconomic side managers might offer flexible hours, generous vacation time, project autonomy, support of various social initiatives, or even preferred parking in the company lot. Everything depends on the needs of each individual.
People are the most important asset of any organization. This is the hardest thing for competitors to replicate. Managers who take steps to keep their entrepreneurs happy give their organizations an edge. Working together, you can make the world a better place through the innovation that results.
Robert D. Hisrich, Ph.D., is the Garvin Professor of Global Entrepreneurship and Director of the Walker Center for Global Entrepreneurship at Thunderbird School of Global Management in Glendale, Arizona. He has authored or coauthored 26 books and more than 350 articles on entrepreneurship.
Hi Robert, Its not all true. More of abuse than the benefit. One odd person available MAYBE, is creating all this.
Robert, Its a Great compilation and theory submitteed, but the question is in a gambit of stars how to identify the pole star.... the real entreprenure! do you have an answer to that?


text:
Sammy L. Davis & Dixie
The WHVV Team
Vietnam 50th Gift
Register for the Gift
Donate for a WHVV Patch
HONOR ALL VETS
ENDLESS LOVE AND SECOND CHANCES, by Dixie Davis
Through unspeakable grief, they found an unbreakable connection—through their love, the joy of second chances. For Dixie and Sammy Davis, the road to each other's arms was paved with tragedy. But through their marriage, they each found a new beginning filled with blessings, joy, and hope—a testament to the power of love after loss.
In Endless Love and Second Chances, Dixie Davis, with Sherry Maves, describes the joys and heartbreak of Dixie's marriage with musician Tim "Doc Holiday" Taylor, tragically cut short by terminal cancer. Years later, Dixie makes an unexpected connection with mutual acquaintance Sammy Davis—one of seventy-seven living Medal of Honor recipients who has dedicated his life to spreading the values of "duty, honor, and country."
An inspirational love story of hope, faith, and redemption, this heartfelt memoir follows Dixie and Sammy as they both recover from the profound grief of losing their spouses to find the love and healing in each other that they needed to move on. As the couple continues to travel throughout the country in the name of veterans' awareness, this book pays a touching tribute to the difference they have made to each other—and to veterans everywhere.
YOU DON'T LOSE 'TIL YOU QUIT TRYING, by Sammy Lee Davis
On November 18th, 1967, Private First Class Davis's artillery unit was hit by a massive enemy offensive. At twenty-one years old, he resolved to face the onslaught and prepared to die. Soon he would have a perforated kidney, crushed ribs, a broken vertebra, his flesh ripped by beehive darts, a bullet in his thigh, and burns all over his body. Ignoring his injuries, he manned a two-ton Howitzer by himself, crossed a canal under heavy fire to rescue three wounded American soldiers, and kept fighting until the enemy retreated. His heroism that day earned him a Congressional Medal of Honor—the ceremony footage of which ended up being used in the movie Forrest Gump.
You Don't Lose 'Til You Quit Trying chronicles how his childhood in the American Heartland prepared him for the worst night of his life—and how that night set off a lifetime battling against debilitating injuries, the effects of Agent Orange and an America that was turning on its veterans.
But he also battled for his fellow veterans, speaking on their behalf for forty years to help heal the wounds and memorialize the brotherhood that war could forge. Readers will learn of Sammy Davis's extraordinary life—the courage, the pain, and the triumph.
Purchase Sammy's Book
Purchase Dixie's Book
Copyright © WELCOME HOME VIETNAM VETERANS | All Rights Reserved
P.O. Box 56034 Indianapolis IN 46256 US +1.3175495900


Lying at a strategic crossroads between Europe and Africa, Malta is a meeting point of cultures and languages at the heart of the Mediterranean. The Maltese archipelago consists of three main islands. Of the three islands Malta can be considered to be the hub of administrative and commercial activities. Gozo, the second largest island is more rural, characterized by fishing, tourism, crafts and agriculture. Comino is largely uninhabited.
Malta has friendly relationships with Mediterranean rim countries and with the countries representing the major investment markets worldwide. Through the bilateral agreements between Malta and the EU with third countries, and through Malta's traditional economic links, the country strengthens its position as a business location and financial centre in the wider Mediterranean region.
The Maltese economy has experienced a shift over the years. From a manufacturing based economy the islands have moved towards a more service-oriented industry. This sector has become the prime driver of economic growth. In the past few years steady growth has been registered in the provision and development of niche financial, ICT and tourism services. Malta is thus strengthening its position as a major hub for the provision of transshipment, financial services and Information and Communication Technology and pushing to become a leader in the region.
Malta has two official languages, Maltese and English. English is universally spoken and written and is the language of legislation, education and business. Malta has liberal economic policies and commitment to an open and competitive business environment. Malta is one of the EU's most open economies as it is a traditional trading nation that has been reliant on import and export. Malta has received international recognition for its EU compliant and sophisticated regulatory framework which is described as modern and in touch with today's operating environment. Malta has a strong, yet flexible, single regulatory body in the Malta Financial Services Authority (MFSA). The MFSA is responsible for all licensed financial services activity on the islands. The MFSA is structured in line with world best practice. Malta is a leading force in the development of regulatory policy and is fully involved with OECD, the EU and the Commonwealth in policy development. Being small and able to adapt quickly has given Malta a head start; while many other international centres have become crowded and expensive, Malta's advantage is available capacity, low costs and a prompt and efficient regulatory process. The framework conforms to all international standards yet flexible enough to allow a variety of structures to be formed, and bridging the gap between Continental European Roman law and Anglo-Saxon common law traditions.
Additional advantages include Malta's location as a Mediterranean hub with access to European, North African and Middle Eastern Markets, its European time-zone location, its multilingual workforce and its back office and IT capabilities.
A significant advantage of Malta is the ability of companies to redomicile themselves into the finance centre. Furthermore business set up in Malta benefit from a tax efficient environment. Investment funds are exempt from tax, while Malta's tax imputation system entitles operating companies to a 6/7th refund of a 35% corporate tax upon a divided distribution. Malta has double taxation treaties with over 60 countries, including most of the major European trading nations.


text:
US Democrats unveil carbon-neutral 'Green New Deal'
Congressional Democrats including Representative Alexandria Ocasio-Cortez and Senator Ed Markey have introduced a framework to battle climate change known as the "Green New Deal," which will promote clean energy programs across the United States
Congressional Democrats on Thursday unveiled an unprecedented plan to reverse climate change and eliminate all US carbon emissions within 10 years, by taking drastic steps that would require transformational action across the economy.
The "Green New Deal" introduced by liberal congresswoman Alexandria Ocasio-Cortez, a rising Democratic star in the House, and Senator Ed Markey is a dramatic, potentially unrealistic, statement of intent on a sustainable path forward.
"This is our first step," Ocasio-Cortez told reporters.
"Today is the day we choose to assert ourselves as a global leader in transitioning to 100 percent renewable energy and charting that path."
The plan does not detail exactly how America will wean itself off of fossil fuels, or how much the ambitious transformation will cost.
The Republican Party hammered the deal as a "socialist wish list" which could cost upwards of $2 trillion.
The non-binding resolution is effectively a blueprint of dramatic action—it proposes "upgrading all existing buildings" in the country, for example—that could be taken to address climate change.
It is already playing a role on the 2020 presidential campaign trail, with progressive Democratic hopefuls including Senators Kamala Harris and Elizabeth Warren expressing support.
"The green generation has risen up, and they are saying they want this issue solved," Markey said. "So this is going to enter the 2020 election cycle as one of the top two or three issues."
The ambitious goal, according to the measure, is to achieve "net-zero greenhouse gas emissions," in part by meeting 100 percent of the power demand through clean, renewable, and zero-emission energy sources.
House Speaker Nancy Pelosi, who appeared to brush off the resolution as a "green dream" the day before, welcomed the "enthusiasm" with which Democrats were engaging in pushing the framework.
The measure has dozens of sponsors, none of them Republican.
The goal to become carbon neutral within a decade will most likely prove exceedingly ambitious, given the oil and gas industry's deep entrenchment in the global economy.
One critical factor will be the buy-in of President Donald Trump, who pulled the US out of the Paris climate accord , as is seen by Democrats as the world's most prominent climate-change denier.
The Paris deal saw nations agree to limit global temperature rises this century to below two degrees Celsius (3.6 Fahrenheit), and under 1.5C if possible.
Failure to meet those goals, scientists have said, could result in irreversible sea level rise, disastrous droughts and higher temperatures.
World to miss 2020 climate 'turning point': analysis
Citation: US Democrats unveil carbon-neutral 'Green New Deal' (2019, February 7) retrieved 22 January 2020 from https://phys.org/news/2019-02-democrats-unveil-carbon-neutral-green.html
Earth's Oldest Impact Crater Identified
Australia's drought and bushfires, a personal view
Oldest material found on Earth?
Hydrogen in the gas grid
Complex Series of Geologic Processes Generated Seizmic Humming
Highest recorded temperature in a given year
More from Earth Sciences
Dutch lawmakers pass ambitious law to reduce emissions
Voters shrug as energized House Democrats vow action on climate
Germany will fail 2020 climate goals, now eyes 2030 target
EU sets goal to be 'climate neutral' by 2050
US mayors back plan for cities to use only renewable energy
Air pollution in New York City linked to wildfires hundreds of miles away
Urine fertilizer: 'Aging' effectively protects against transfer of antibiotic resistance
Emissions of potent greenhouse gas rises, contradicting reports of huge reductions
Preparing land for palm oil causes most climate damage


text:
michael mcgreevey wife
McGreevy finished first in his SEAL class. Michael McGreevy grew up in Portville, New York, a hamlet 80 miles south of Buffalo. [1] It starred Darren McGavin as the captain of a riverboat on the Mississippi River during the 1830s. In a 2015 interview, McGreevey confirmed the rumored friction between McGavin and his co-star Burt Reynolds: "They were just two very different personalities. Looking for something to watch? Michael McGreevey's first major role was as young cabin boy Chip Kessler in the 1959–61 TV series Riverboat. He played a young pioneer named Brownie Evans, who marries Sally Field's character. Michael ran track, and set a school record for the 800-meter run. It was his first job in Hollywood and Darren was a very polished actor. 4:13 AM PST In addition to his Disney roles, McGreevey appeared as guest star in numerous television series, such as The Virginian, Bonanza, and Route 66. Dad and I both knew a man named Alan Landsburg, who had done a lot of documentaries. B. Guthrie, Jr. novel. on Choose an adventure below and discover your next favorite movie or TV show. It is claimed that McGreevy who was just 18 when he met Schofield in 2004, had an unusually 'close working-relationship' with the 52 year old presenter but after they had a 'lovers bust up' the studio runner moved from This Morning to work with ITV on the show Loose Women. Keep your little bookworms engaged outside of the classroom with our selection of the very best literary adaptations. Michael McGreevey began his professional career at the age of seven, appearing in The Girl Most Likely (1957) with Jane Powell, the first of 18 films he would act in over the next 20 years. So, Mel was attached to direct it and we went into CBS and sold it right away as a three-hour special event movie. Michael McGreevey net worth is. He had been in Afghanistan since early April and is survived by his wife, Laura, and 14-month-old daughter, Molly, his mother Patricia Mackin and father Michael McGreevy Sr. "He died doing what he always wanted to do," said former Marine Captain. He is the son of Emmy Award-winning television and film screenwriter John McGreevey. I was very proud of that movie; it was very well done. Matthew Mcgreevy, Phillip Schofield Lovers Bust Up. He also starred opposite Sally Field, Kirk Douglas, Robert Mitchum, and Richard Widmark in the 1967 western The Way West, which was based on an A. He is the son of Emmy Award-winning television and film screenwriter John McGreevey. [7] In 2015, he co-wrote the feature-length documentary Earl Hamner Storyteller, which focused on the life and career of The Waltons creator Earl Hamner, Jr.[2], "An Interview with Michael McGreevey: The Actor-Writer Discusses Riverboat, Disney, the Fame TV Series, and The Waltons", "Michael McGreevey: A Local's 'Dramatic' Comeback", https://en.wikipedia.org/w/index.php?title=Michael_McGreevey&oldid=985063984, Creative Commons Attribution-ShareAlike License, Episode: "Texas John Slaughter: Frank Clell's in Town", Episode: "For Love of Willadean: A Taste of Melon", Episode: "A Place to Run, a Heart to Hide In", Episode: "The Wacky Zoo of Morgan City: Part 1", Episode: "Michael O'Hara the Fourth: Part 1", Epísode: "Such Dust as Dreams Are Made On", This page was last edited on 23 October 2020, at 18:57. [5], In 1978, after studying film at UCLA, Michael McGreevey collaborated with his father, John McGreevey, on the script for the 1978 made-for-TV movie Ruby and Oswald: "In reality, the movie, although it's called Ruby and Oswald, is a three-way depiction of those four days in Dallas where we cut back and forth between the documentary footage of Kennedy and the recreated story with Ruby and Oswald. The Computer Wore Tennis Shoes (1969)as R. Schuyler, Your email address will not be published. Michael McGreevey began his professional career at the age of seven, appearing in, Thu, Nov 05 In a picture, shared in a YouTube video in which the duo are primarily filmed smoking shisha, Schofield is seen posing alongside McGreevy and a whole array of children in school uniforms. STZENW (648), Thu, Nov 05 9:25 AM PST "[2], McGreevey subsequently wrote episodes of TV series such as The Waltons, Quincy, M.E., and Fame. Ken (segment "Love and the Unmarriage") / Steve (segment "Love and the High School Flop-Out"), TV Series supervising producer - 20 episodes, TV Series co-executive producer - 10 episodes, TV Series writer - 8 episodes, 1985 - 1987 teleplay by - 1 episode, 1986 written by - 1 episode, 1983, TV Series story - 1 episode, 1982 teleplay - 1 episode, 1982 writer - 1 episode, 1982, TV Series writer - 1 episode, 1981 teleplay - 1 episode, 1981, TV Series executive story editor - 21 episodes, 1985 - 1986 story editor - 4 episodes, 1984, Mowgli: The New Adventures of the Jungle Book, Outstanding Writing in Children's Programming. He eventually became a script editor and then creative consultant for Fame. Michael McGreevey (born February 7, 1948) is an American actor and screenwriter. What finally happened was that Burt left the show. Michael McGreevey (born February 7, 1948) is an American actor and screenwriter. I think that Burt was insecure. Your email address will not be published. I think Burt was a little jealous of Darren and they clashed quite a bit. He still says: "Don't tell people you were only 11 years old when we were on Riverboat.'"[2]. But I loved them both. on Retired school staff noted that Michael was the best they ever had. Darren was very much a father figure for me and Burt was like a big brother. Required fields are marked *.
Tequila Sunrise Solo Tab, Pure As The Driven Snow Lyrics Ballad Of Songbirds And Snakes, Will There Be A Wildling 2 Movie, Child Predator Discord Servers, Bunny Tattoo Meaning, John Mayhew Ron White, Hallie Jackson Age, Cva Optima V2 Lr Walmart, High School Musical Kahoot, The Dare Project Dailymotion, Below Deck Mediterranean Season 1 Episode 3, Ultipro Self Service Six Flags, Stalin And Lady Macbeth, Ffxiv Pixie Beast Tribe Ranks, L'oreal Infallible Fresh Wear Foundation Shade Finder, Alex Zurdo Wikipedia, Open Mma Tournaments Near Me, Essay On Importance Of Health, Vivere Hammock Instructions, Gacha Resort Lilith, Gregory Cole Jr, Dcc Annual Vol 1, Grade 8 History Unit, Susan Lapierre Wikipedia, Cheap Taxi Near Me, Synology Login Url, Ronnie Bass Jr, Vice Tool Price, Avatar Le Dernier Maitre De L'air Saison 1 Episode 1 Streaming, Film Matrix En Français, Venkateswara Ashtothram In Telugu, Michael Wincott 2019, Figure 8 Puffer Behavior, Jonathan Brandis Death Photos, Friesian Gelding Horse Adoption, Gun Fire Sound, Facebook Follow Up Interview After Onsite, Naval Ravikant Trump, Melissa Robin Schiff Related To Adam Schiff, Mca Class 2 Oral Questions, Les Fées Résumé, English Channel Depth, Battle Of The Bulge Full Movie Dailymotion, Blanche Bruce Accomplishments, Amy Robinson Cheo, La Costumbre Es Mas Fuerte Que El Amor En Ingles, Johannes Bartl Wiki, Jefferson Brown Spouse, Charles Dierkop Now, Avatar Drinking Game, Grey Wolf 19sm Reviews, Kumbaya Meaning In Hebrew, Wasaga Beach Jet Ski Rental, Read Bleach In Japanese, Scad Turner House, Infp Famous People, Yannis Pappas Wedding, Pig Intestine For Sale,


Australians have just been asked which professions they consider the most ethical and honest.
You guessed it: car salesmen are at the bottom of the list. They have held that position for more than 30 years. Scraping along the bottom with them are advertisers, real estate agents and state MPs.
The latest Roy Morgan "Image of Professions" survey asked respondents to rate or score people in various occupations for honesty and ethical standards.
And the results confirm our favourite prejudices.