text:
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License.  You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied.  See the License for the
// specific language governing permissions and limitations
// under the License.

#include "arrow/ipc/writer.h"

#include <algorithm>
#include <cstdint>
#include <cstring>
#include <limits>
#include <sstream>
#include <vector>

#include "arrow/array.h"
#include "arrow/buffer.h"
#include "arrow/extension_type.h"
#include "arrow/io/interfaces.h"
#include "arrow/io/memory.h"
#include "arrow/ipc/dictionary.h"
#include "arrow/ipc/message.h"
#include "arrow/ipc/metadata-internal.h"
#include "arrow/ipc/util.h"
#include "arrow/memory_pool.h"
#include "arrow/record_batch.h"
#include "arrow/sparse_tensor.h"
#include "arrow/status.h"
#include "arrow/table.h"
#include "arrow/tensor.h"
#include "arrow/type.h"
#include "arrow/util/bit-util.h"
#include "arrow/util/checked_cast.h"
#include "arrow/util/logging.h"
#include "arrow/visitor.h"

namespace arrow {

using internal::checked_cast;
using internal::CopyBitmap;

namespace ipc {

using internal::FileBlock;
using internal::kArrowMagicBytes;

// ----------------------------------------------------------------------
// Record batch write path

static inline Status GetTruncatedBitmap(int64_t offset, int64_t length,
                                        const std::shared_ptr<Buffer> input,
                                        MemoryPool* pool,
                                        std::shared_ptr<Buffer>* buffer) {
  if (!input) {
    *buffer = input;
    return Status::OK();
  }
  int64_t min_length = PaddedLength(BitUtil::BytesForBits(length));
  if (offset != 0 || min_length < input->size()) {
    // With a sliced array / non-zero offset, we must copy the bitmap
    RETURN_NOT_OK(CopyBitmap(pool, input->data(), offset, length, buffer));
  } else {
    *buffer = input;
  }
  return Status::OK();
}

template <typename T>
inline Status GetTruncatedBuffer(int64_t offset, int64_t length,
                                 const std::shared_ptr<Buffer> input, MemoryPool* pool,
                                 std::shared_ptr<Buffer>* buffer) {
  if (!input) {
    *buffer = input;
    return Status::OK();
  }
  int32_t byte_width = static_cast<int32_t>(sizeof(T));
  int64_t padded_length = PaddedLength(length * byte_width);
  if (offset != 0 || padded_length < input->size()) {
    *buffer =
        SliceBuffer(input, offset * byte_width, std::min(padded_length, input->size()));
  } else {
    *buffer = input;
  }
  return Status::OK();
}

static inline bool NeedTruncate(int64_t offset, const Buffer* buffer,
                                int64_t min_length) {
  // buffer can be NULL
  if (buffer == nullptr) {
    return false;
  }
  return offset != 0 || min_length < buffer->size();
}

namespace internal {

class RecordBatchSerializer : public ArrayVisitor {
 public:
  RecordBatchSerializer(MemoryPool* pool, int64_t buffer_start_offset,
                        int max_recursion_depth, bool allow_64bit, IpcPayload* out)
      : out_(out),
        pool_(pool),
        max_recursion_depth_(max_recursion_depth),
        buffer_start_offset_(buffer_start_offset),
        allow_64bit_(allow_64bit) {
    DCHECK_GT(max_recursion_depth, 0);
  }

  ~RecordBatchSerializer() override = default;

  Status VisitArray(const Array& arr) {
    if (max_recursion_depth_ <= 0) {
      return Status::Invalid("Max recursion depth reached");
    }

    if (!allow_64bit_ && arr.length() > std::numeric_limits<int32_t>::max()) {
      return Status::CapacityError("Cannot write arrays larger than 2^31 - 1 in length");
    }

    // push back all common elements
    field_nodes_.push_back({arr.length(), arr.null_count(), 0});

    if (arr.null_count() > 0) {
      std::shared_ptr<Buffer> bitmap;
      RETURN_NOT_OK(GetTruncatedBitmap(arr.offset(), arr.length(), arr.null_bitmap(),
                                       pool_, &bitmap));
      out_->body_buffers.emplace_back(bitmap);
    } else {
      // Push a dummy zero-length buffer, not to be copied
      out_->body_buffers.emplace_back(std::make_shared<Buffer>(nullptr, 0));
    }
    return arr.Accept(this);
  }

  // Override this for writing dictionary metadata
  virtual Status SerializeMetadata(int64_t num_rows) {
    return WriteRecordBatchMessage(num_rows, out_->body_length, field_nodes_,
                                   buffer_meta_, &out_->metadata);
  }

  Status Assemble(const RecordBatch& batch) {
    if (field_nodes_.size() > 0) {
      field_nodes_.clear();
      buffer_meta_.clear();
      out_->body_buffers.clear();
    }

    // Perform depth-first traversal of the row-batch
    for (int i = 0; i < batch.num_columns(); ++i) {
      RETURN_NOT_OK(VisitArray(*batch.column(i)));
    }

    // The position for the start of a buffer relative to the passed frame of
    // reference. May be 0 or some other position in an address space
    int64_t offset = buffer_start_offset_;

    buffer_meta_.reserve(out_->body_buffers.size());

    // Construct the buffer metadata for the record batch header
    for (size_t i = 0; i < out_->body_buffers.size(); ++i) {
      const Buffer* buffer = out_->body_buffers[i].get();
      int64_t size = 0;
      int64_t padding = 0;

      // The buffer might be null if we are handling zero row lengths.
      if (buffer) {
        size = buffer->size();
        padding = BitUtil::RoundUpToMultipleOf8(size) - size;
      }

      buffer_meta_.push_back({offset, size + padding});
      offset += size + padding;
    }

    out_->body_length = offset - buffer_start_offset_;
    DCHECK(BitUtil::IsMultipleOf8(out_->body_length));

    // Now that we have computed the locations of all of the buffers in shared
    // memory, the data header can be converted to a flatbuffer and written out
    //
    // Note: The memory written here is prefixed by the size of the flatbuffer
    // itself as an int32_t.
    return SerializeMetadata(batch.num_rows());
  }

 protected:
  template <typename ArrayType>
  Status VisitFixedWidth(const ArrayType& array) {
    std::shared_ptr<Buffer> data = array.values();

    const auto& fw_type = checked_cast<const FixedWidthType&>(*array.type());
    const int64_t type_width = fw_type.bit_width() / 8;
    int64_t min_length = PaddedLength(array.length() * type_width);

    if (NeedTruncate(array.offset(), data.get(), min_length)) {
      // Non-zero offset, slice the buffer
      const int64_t byte_offset = array.offset() * type_width;

      // Send padding if it's available
      const int64_t buffer_length =
          std::min(BitUtil::RoundUpToMultipleOf8(array.length() * type_width),
                   data->size() - byte_offset);
      data = SliceBuffer(data, byte_offset, buffer_length);
    }
    out_->body_buffers.emplace_back(data);
    return Status::OK();
  }

  template <typename ArrayType>
  Status GetZeroBasedValueOffsets(const ArrayType& array,
                                  std::shared_ptr<Buffer>* value_offsets) {
    // Share slicing logic between ListArray and BinaryArray

    auto offsets = array.value_offsets();

    if (array.offset() != 0) {
      // If we have a non-zero offset, then the value offsets do not start at
      // zero. We must a) create a new offsets array with shifted offsets and
      // b) slice the values array accordingly

      std::shared_ptr<Buffer> shifted_offsets;
      RETURN_NOT_OK(AllocateBuffer(pool_, sizeof(int32_t) * (array.length() + 1),
                                   &shifted_offsets));

      int32_t* dest_offsets = reinterpret_cast<int32_t*>(shifted_offsets->mutable_data());
      const int32_t start_offset = array.value_offset(0);

      for (int i = 0; i < array.length(); ++i) {
        dest_offsets[i] = array.value_offset(i) - start_offset;
      }
      // Final offset
      dest_offsets[array.length()] = array.value_offset(array.length()) - start_offset;
      offsets = shifted_offsets;
    }

    *value_offsets = offsets;
    return Status::OK();
  }

  Status VisitBinary(const BinaryArray& array) {
    std::shared_ptr<Buffer> value_offsets;
    RETURN_NOT_OK(GetZeroBasedValueOffsets<BinaryArray>(array, &value_offsets));
    auto data = array.value_data();

    int64_t total_data_bytes = 0;
    if (value_offsets) {
      total_data_bytes = array.value_offset(array.length()) - array.value_offset(0);
    }
    if (NeedTruncate(array.offset(), data.get(), total_data_bytes)) {
      // Slice the data buffer to include only the range we need now
      const int64_t start_offset = array.value_offset(0);
      const int64_t slice_length =
          std::min(PaddedLength(total_data_bytes), data->size() - start_offset);
      data = SliceBuffer(data, start_offset, slice_length);
    }

    out_->body_buffers.emplace_back(value_offsets);
    out_->body_buffers.emplace_back(data);
    return Status::OK();
  }

  Status Visit(const BooleanArray& array) override {
    std::shared_ptr<Buffer> data;
    RETURN_NOT_OK(
        GetTruncatedBitmap(array.offset(), array.length(), array.values(), pool_, &data));
    out_->body_buffers.emplace_back(data);
    return Status::OK();
  }

  Status Visit(const NullArray& array) override {
    out_->body_buffers.emplace_back(nullptr);
    return Status::OK();
  }

#define VISIT_FIXED_WIDTH(TYPE) \
  Status Visit(const TYPE& array) override { return VisitFixedWidth<TYPE>(array); }

  VISIT_FIXED_WIDTH(Int8Array)
  VISIT_FIXED_WIDTH(Int16Array)
  VISIT_FIXED_WIDTH(Int32Array)
  VISIT_FIXED_WIDTH(Int64Array)
  VISIT_FIXED_WIDTH(UInt8Array)
  VISIT_FIXED_WIDTH(UInt16Array)
  VISIT_FIXED_WIDTH(UInt32Array)
  VISIT_FIXED_WIDTH(UInt64Array)
  VISIT_FIXED_WIDTH(HalfFloatArray)
  VISIT_FIXED_WIDTH(FloatArray)
  VISIT_FIXED_WIDTH(DoubleArray)
  VISIT_FIXED_WIDTH(Date32Array)
  VISIT_FIXED_WIDTH(Date64Array)
  VISIT_FIXED_WIDTH(TimestampArray)
  VISIT_FIXED_WIDTH(Time32Array)
  VISIT_FIXED_WIDTH(Time64Array)
  VISIT_FIXED_WIDTH(FixedSizeBinaryArray)
  VISIT_FIXED_WIDTH(Decimal128Array)

#undef VISIT_FIXED_WIDTH

  Status Visit(const StringArray& array) override { return VisitBinary(array); }

  Status Visit(const BinaryArray& array) override { return VisitBinary(array); }

  Status Visit(const ListArray& array) override {
    std::shared_ptr<Buffer> value_offsets;
    RETURN_NOT_OK(GetZeroBasedValueOffsets<ListArray>(array, &value_offsets));
    out_->body_buffers.emplace_back(value_offsets);

    --max_recursion_depth_;
    std::shared_ptr<Array> values = array.values();

    int32_t values_offset = 0;
    int32_t values_length = 0;
    if (value_offsets) {
      values_offset = array.value_offset(0);
      values_length = array.value_offset(array.length()) - values_offset;
    }

    if (array.offset() != 0 || values_length < values->length()) {
      // Must also slice the values
      values = values->Slice(values_offset, values_length);
    }
    RETURN_NOT_OK(VisitArray(*values));
    ++max_recursion_depth_;
    return Status::OK();
  }

  Status Visit(const StructArray& array) override {
    --max_recursion_depth_;
    for (int i = 0; i < array.num_fields(); ++i) {
      std::shared_ptr<Array> field = array.field(i);
      RETURN_NOT_OK(VisitArray(*field));
    }
    ++max_recursion_depth_;
    return Status::OK();
  }

  Status Visit(const UnionArray& array) override {
    const int64_t offset = array.offset();
    const int64_t length = array.length();

    std::shared_ptr<Buffer> type_ids;
    RETURN_NOT_OK(GetTruncatedBuffer<UnionArray::type_id_t>(
        offset, length, array.type_ids(), pool_, &type_ids));
    out_->body_buffers.emplace_back(type_ids);

    --max_recursion_depth_;
    if (array.mode() == UnionMode::DENSE) {
      const auto& type = checked_cast<const UnionType&>(*array.type());

      std::shared_ptr<Buffer> value_offsets;
      RETURN_NOT_OK(GetTruncatedBuffer<int32_t>(offset, length, array.value_offsets(),
                                                pool_, &value_offsets));

      // The Union type codes are not necessary 0-indexed
      uint8_t max_code = 0;
      for (uint8_t code : type.type_codes()) {
        if (code > max_code) {
          max_code = code;
        }
      }

      // Allocate an array of child offsets. Set all to -1 to indicate that we
      // haven't observed a first occurrence of a particular child yet
      std::vector<int32_t> child_offsets(max_code + 1, -1);
      std::vector<int32_t> child_lengths(max_code + 1, 0);

      if (offset != 0) {
        // This is an unpleasant case. Because the offsets are different for
        // each child array, when we have a sliced array, we need to "rebase"
        // the value_offsets for each array

        const int32_t* unshifted_offsets = array.raw_value_offsets();
        const uint8_t* type_ids = array.raw_type_ids();

        // Allocate the shifted offsets
        std::shared_ptr<Buffer> shifted_offsets_buffer;
        RETURN_NOT_OK(
            AllocateBuffer(pool_, length * sizeof(int32_t), &shifted_offsets_buffer));
        int32_t* shifted_offsets =
            reinterpret_cast<int32_t*>(shifted_offsets_buffer->mutable_data());

        // Offsets may not be ascending, so we need to find out the start offset
        // for each child
        for (int64_t i = 0; i < length; ++i) {
          const uint8_t code = type_ids[i];
          if (child_offsets[code] == -1) {
            child_offsets[code] = unshifted_offsets[i];
          } else {
            child_offsets[code] = std::min(child_offsets[code], unshifted_offsets[i]);
          }
        }

        // Now compute shifted offsets by subtracting child offset
        for (int64_t i = 0; i < length; ++i) {
          const uint8_t code = type_ids[i];
          shifted_offsets[i] = unshifted_offsets[i] - child_offsets[code];
          // Update the child length to account for observed value
          child_lengths[code] = std::max(child_lengths[code], shifted_offsets[i] + 1);
        }

        value_offsets = shifted_offsets_buffer;
      }
      out_->body_buffers.emplace_back(value_offsets);

      // Visit children and slice accordingly
      for (int i = 0; i < type.num_children(); ++i) {
        std::shared_ptr<Array> child = array.child(i);

        // TODO: ARROW-809, for sliced unions, tricky to know how much to
        // truncate the children. For now, we are truncating the children to be
        // no longer than the parent union.
        if (offset != 0) {
          const uint8_t code = type.type_codes()[i];
          const int64_t child_offset = child_offsets[code];
          const int64_t child_length = child_lengths[code];

          if (child_offset > 0) {
            child = child->Slice(child_offset, child_length);
          } else if (child_length < child->length()) {
            // This case includes when child is not encountered at all
            child = child->Slice(0, child_length);
          }
        }
        RETURN_NOT_OK(VisitArray(*child));
      }
    } else {
      for (int i = 0; i < array.num_fields(); ++i) {
        // Sparse union, slicing is done for us by child()
        RETURN_NOT_OK(VisitArray(*array.child(i)));
      }
    }
    ++max_recursion_depth_;
    return Status::OK();
  }

  Status Visit(const DictionaryArray& array) override {
    // Dictionary written out separately. Slice offset contained in the indices
    return array.indices()->Accept(this);
  }

  Status Visit(const ExtensionArray& array) override {
    return array.storage()->Accept(this);
  }

  // Destination for output buffers
  IpcPayload* out_;

  // In some cases, intermediate buffers may need to be allocated (with sliced arrays)
  MemoryPool* pool_;

  std::vector<internal::FieldMetadata> field_nodes_;
  std::vector<internal::BufferMetadata> buffer_meta_;

  int64_t max_recursion_depth_;
  int64_t buffer_start_offset_;
  bool allow_64bit_;
};

class DictionaryWriter : public RecordBatchSerializer {
 public:
  DictionaryWriter(int64_t dictionary_id, MemoryPool* pool, int64_t buffer_start_offset,
                   int max_recursion_depth, bool allow_64bit, IpcPayload* out)
      : RecordBatchSerializer(pool, buffer_start_offset, max_recursion_depth, allow_64bit,
                              out),
        dictionary_id_(dictionary_id) {}

  Status SerializeMetadata(int64_t num_rows) override {
    return WriteDictionaryMessage(dictionary_id_, num_rows, out_->body_length,
                                  field_nodes_, buffer_meta_, &out_->metadata);
  }

  Status Assemble(const std::shared_ptr<Array>& dictionary) {
    // Make a dummy record batch. A bit tedious as we have to make a schema
    auto schema = arrow::schema({arrow::field("dictionary", dictionary->type())});
    auto batch = RecordBatch::Make(schema, dictionary->length(), {dictionary});
    return RecordBatchSerializer::Assemble(*batch);
  }

 private:
  int64_t dictionary_id_;
};

Status WriteIpcPayload(const IpcPayload& payload, io::OutputStream* dst,
                       int32_t* metadata_length) {
  RETURN_NOT_OK(internal::WriteMessage(*payload.metadata, kArrowIpcAlignment, dst,
                                       metadata_length));

#ifndef NDEBUG
  RETURN_NOT_OK(CheckAligned(dst));
#endif

  // Now write the buffers
  for (size_t i = 0; i < payload.body_buffers.size(); ++i) {
    const Buffer* buffer = payload.body_buffers[i].get();
    int64_t size = 0;
    int64_t padding = 0;

    // The buffer might be null if we are handling zero row lengths.
    if (buffer) {
      size = buffer->size();
      padding = BitUtil::RoundUpToMultipleOf8(size) - size;
    }

    if (size > 0) {
      RETURN_NOT_OK(dst->Write(buffer->data(), size));
    }

    if (padding > 0) {
      RETURN_NOT_OK(dst->Write(kPaddingBytes, padding));
    }
  }

#ifndef NDEBUG
  RETURN_NOT_OK(CheckAligned(dst));
#endif

  return Status::OK();
}

Status GetSchemaPayload(const Schema& schema, MemoryPool* pool,
                        DictionaryMemo* dictionary_memo, IpcPayload* out) {
  out->type = Message::Type::SCHEMA;
  out->body_buffers.clear();
  out->body_length = 0;
  RETURN_NOT_OK(SerializeSchema(schema, pool, &out->metadata));
  return WriteSchemaMessage(schema, dictionary_memo, &out->metadata);
}

Status GetRecordBatchPayload(const RecordBatch& batch, MemoryPool* pool,
                             IpcPayload* out) {
  RecordBatchSerializer writer(pool, 0, kMaxNestingDepth, true, out);
  return writer.Assemble(batch);
}

}  // namespace internal

Status WriteRecordBatch(const RecordBatch& batch, int64_t buffer_start_offset,
                        io::OutputStream* dst, int32_t* metadata_length,
                        int64_t* body_length, MemoryPool* pool, int max_recursion_depth,
                        bool allow_64bit) {
  internal::IpcPayload payload;
  internal::RecordBatchSerializer writer(pool, buffer_start_offset, max_recursion_depth,
                                         allow_64bit, &payload);
  RETURN_NOT_OK(writer.Assemble(batch));

  // TODO(wesm): it's a rough edge that the metadata and body length here are
  // computed separately

  // The body size is computed in the payload
  *body_length = payload.body_length;

  return internal::WriteIpcPayload(payload, dst, metadata_length);
}

Status WriteRecordBatchStream(const std::vector<std::shared_ptr<RecordBatch>>& batches,
                              io::OutputStream* dst) {
  std::shared_ptr<RecordBatchWriter> writer;
  RETURN_NOT_OK(RecordBatchStreamWriter::Open(dst, batches[0]->schema(), &writer));
  for (const auto& batch : batches) {
    // allow sizes > INT32_MAX
    DCHECK(batch->schema()->Equals(*batches[0]->schema())) << "Schemas unequal";
    RETURN_NOT_OK(writer->WriteRecordBatch(*batch, true));
  }
  RETURN_NOT_OK(writer->Close());
  return Status::OK();
}

Status WriteLargeRecordBatch(const RecordBatch& batch, int64_t buffer_start_offset,
                             io::OutputStream* dst, int32_t* metadata_length,
                             int64_t* body_length, MemoryPool* pool) {
  return WriteRecordBatch(batch, buffer_start_offset, dst, metadata_length, body_length,
                          pool, kMaxNestingDepth, true);
}

namespace {

Status WriteTensorHeader(const Tensor& tensor, io::OutputStream* dst,
                         int32_t* metadata_length) {
  std::shared_ptr<Buffer> metadata;
  RETURN_NOT_OK(internal::WriteTensorMessage(tensor, 0, &metadata));
  return internal::WriteMessage(*metadata, kTensorAlignment, dst, metadata_length);
}

Status WriteStridedTensorData(int dim_index, int64_t offset, int elem_size,
                              const Tensor& tensor, uint8_t* scratch_space,
                              io::OutputStream* dst) {
  if (dim_index == tensor.ndim() - 1) {
    const uint8_t* data_ptr = tensor.raw_data() + offset;
    const int64_t stride = tensor.strides()[dim_index];
    for (int64_t i = 0; i < tensor.shape()[dim_index]; ++i) {
      memcpy(scratch_space + i * elem_size, data_ptr, elem_size);
      data_ptr += stride;
    }
    return dst->Write(scratch_space, elem_size * tensor.shape()[dim_index]);
  }
  for (int64_t i = 0; i < tensor.shape()[dim_index]; ++i) {
    RETURN_NOT_OK(WriteStridedTensorData(dim_index + 1, offset, elem_size, tensor,
                                         scratch_space, dst));
    offset += tensor.strides()[dim_index];
  }
  return Status::OK();
}

Status GetContiguousTensor(const Tensor& tensor, MemoryPool* pool,
                           std::unique_ptr<Tensor>* out) {
  const auto& type = checked_cast<const FixedWidthType&>(*tensor.type());
  const int elem_size = type.bit_width() / 8;

  std::shared_ptr<Buffer> scratch_space;
  RETURN_NOT_OK(AllocateBuffer(pool, tensor.shape()[tensor.ndim() - 1] * elem_size,
                               &scratch_space));

  std::shared_ptr<ResizableBuffer> contiguous_data;
  RETURN_NOT_OK(
      AllocateResizableBuffer(pool, tensor.size() * elem_size, &contiguous_data));

  io::BufferOutputStream stream(contiguous_data);
  RETURN_NOT_OK(WriteStridedTensorData(0, 0, elem_size, tensor,
                                       scratch_space->mutable_data(), &stream));

  out->reset(new Tensor(tensor.type(), contiguous_data, tensor.shape()));

  return Status::OK();
}

}  // namespace

Status WriteTensor(const Tensor& tensor, io::OutputStream* dst, int32_t* metadata_length,
                   int64_t* body_length) {
  const auto& type = checked_cast<const FixedWidthType&>(*tensor.type());
  const int elem_size = type.bit_width() / 8;

  *body_length = tensor.size() * elem_size;

  // Tensor metadata accounts for padding
  if (tensor.is_contiguous()) {
    RETURN_NOT_OK(WriteTensorHeader(tensor, dst, metadata_length));
    auto data = tensor.data();
    if (data && data->data()) {
      RETURN_NOT_OK(dst->Write(data->data(), *body_length));
    } else {
      *body_length = 0;
    }
  } else {
    // The tensor written is made contiguous
    Tensor dummy(tensor.type(), nullptr, tensor.shape());
    RETURN_NOT_OK(WriteTensorHeader(dummy, dst, metadata_length));

    // TODO(wesm): Do we care enough about this temporary allocation to pass in
    // a MemoryPool to this function?
    std::shared_ptr<Buffer> scratch_space;
    RETURN_NOT_OK(
        AllocateBuffer(tensor.shape()[tensor.ndim() - 1] * elem_size, &scratch_space));

    RETURN_NOT_OK(WriteStridedTensorData(0, 0, elem_size, tensor,
                                         scratch_space->mutable_data(), dst));
  }

  return Status::OK();
}

Status GetTensorMessage(const Tensor& tensor, MemoryPool* pool,
                        std::unique_ptr<Message>* out) {
  const Tensor* tensor_to_write = &tensor;
  std::unique_ptr<Tensor> temp_tensor;

  if (!tensor.is_contiguous()) {
    RETURN_NOT_OK(GetContiguousTensor(tensor, pool, &temp_tensor));
    tensor_to_write = temp_tensor.get();
  }

  std::shared_ptr<Buffer> metadata;
  RETURN_NOT_OK(internal::WriteTensorMessage(*tensor_to_write, 0, &metadata));
  out->reset(new Message(metadata, tensor_to_write->data()));
  return Status::OK();
}

namespace internal {

class SparseTensorSerializer {
 public:
  SparseTensorSerializer(int64_t buffer_start_offset, IpcPayload* out)
      : out_(out), buffer_start_offset_(buffer_start_offset) {}

  ~SparseTensorSerializer() = default;

  Status VisitSparseIndex(const SparseIndex& sparse_index) {
    switch (sparse_index.format_id()) {
      case SparseTensorFormat::COO:
        RETURN_NOT_OK(
            VisitSparseCOOIndex(checked_cast<const SparseCOOIndex&>(sparse_index)));
        break;

      case SparseTensorFormat::CSR:
        RETURN_NOT_OK(
            VisitSparseCSRIndex(checked_cast<const SparseCSRIndex&>(sparse_index)));
        break;

      default:
        std::stringstream ss;
        ss << "Unable to convert type: " << sparse_index.ToString() << std::endl;
        return Status::NotImplemented(ss.str());
    }

    return Status::OK();
  }

  Status SerializeMetadata(const SparseTensor& sparse_tensor) {
    return WriteSparseTensorMessage(sparse_tensor, out_->body_length, buffer_meta_,
                                    &out_->metadata);
  }

  Status Assemble(const SparseTensor& sparse_tensor) {
    if (buffer_meta_.size() > 0) {
      buffer_meta_.clear();
      out_->body_buffers.clear();
    }

    RETURN_NOT_OK(VisitSparseIndex(*sparse_tensor.sparse_index()));
    out_->body_buffers.emplace_back(sparse_tensor.data());

    int64_t offset = buffer_start_offset_;
    buffer_meta_.reserve(out_->body_buffers.size());

    for (size_t i = 0; i < out_->body_buffers.size(); ++i) {
      const Buffer* buffer = out_->body_buffers[i].get();
      int64_t size = buffer->size();
      int64_t padding = BitUtil::RoundUpToMultipleOf8(size) - size;
      buffer_meta_.push_back({offset, size + padding});
      offset += size + padding;
    }

    out_->body_length = offset - buffer_start_offset_;
    DCHECK(BitUtil::IsMultipleOf8(out_->body_length));

    return SerializeMetadata(sparse_tensor);
  }

 private:
  Status VisitSparseCOOIndex(const SparseCOOIndex& sparse_index) {
    out_->body_buffers.emplace_back(sparse_index.indices()->data());
    return Status::OK();
  }

  Status VisitSparseCSRIndex(const SparseCSRIndex& sparse_index) {
    out_->body_buffers.emplace_back(sparse_index.indptr()->data());
    out_->body_buffers.emplace_back(sparse_index.indices()->data());
    return Status::OK();
  }

  IpcPayload* out_;

  std::vector<internal::BufferMetadata> buffer_meta_;

  int64_t buffer_start_offset_;
};

Status GetSparseTensorPayload(const SparseTensor& sparse_tensor, MemoryPool* pool,
                              IpcPayload* out) {
  SparseTensorSerializer writer(0, out);
  return writer.Assemble(sparse_tensor);
}

}  // namespace internal

Status WriteSparseTensor(const SparseTensor& sparse_tensor, io::OutputStream* dst,
                         int32_t* metadata_length, int64_t* body_length,
                         MemoryPool* pool) {
  internal::IpcPayload payload;
  internal::SparseTensorSerializer writer(0, &payload);
  RETURN_NOT_OK(writer.Assemble(sparse_tensor));

  *body_length = payload.body_length;
  return internal::WriteIpcPayload(payload, dst, metadata_length);
}

Status WriteDictionary(int64_t dictionary_id, const std::shared_ptr<Array>& dictionary,
                       int64_t buffer_start_offset, io::OutputStream* dst,
                       int32_t* metadata_length, int64_t* body_length, MemoryPool* pool) {
  internal::IpcPayload payload;
  internal::DictionaryWriter writer(dictionary_id, pool, buffer_start_offset,
                                    kMaxNestingDepth, true, &payload);
  RETURN_NOT_OK(writer.Assemble(dictionary));

  // The body size is computed in the payload
  *body_length = payload.body_length;
  return internal::WriteIpcPayload(payload, dst, metadata_length);
}

Status GetRecordBatchSize(const RecordBatch& batch, int64_t* size) {
  // emulates the behavior of Write without actually writing
  int32_t metadata_length = 0;
  int64_t body_length = 0;
  io::MockOutputStream dst;
  RETURN_NOT_OK(WriteRecordBatch(batch, 0, &dst, &metadata_length, &body_length,
                                 default_memory_pool(), kMaxNestingDepth, true));
  *size = dst.GetExtentBytesWritten();
  return Status::OK();
}

Status GetTensorSize(const Tensor& tensor, int64_t* size) {
  // emulates the behavior of Write without actually writing
  int32_t metadata_length = 0;
  int64_t body_length = 0;
  io::MockOutputStream dst;
  RETURN_NOT_OK(WriteTensor(tensor, &dst, &metadata_length, &body_length));
  *size = dst.GetExtentBytesWritten();
  return Status::OK();
}

// ----------------------------------------------------------------------

RecordBatchWriter::~RecordBatchWriter() {}

Status RecordBatchWriter::WriteTable(const Table& table, int64_t max_chunksize) {
  TableBatchReader reader(table);

  if (max_chunksize > 0) {
    reader.set_chunksize(max_chunksize);
  }

  std::shared_ptr<RecordBatch> batch;
  while (true) {
    RETURN_NOT_OK(reader.ReadNext(&batch));
    if (batch == nullptr) {
      break;
    }
    RETURN_NOT_OK(WriteRecordBatch(*batch, true));
  }

  return Status::OK();
}

Status RecordBatchWriter::WriteTable(const Table& table) { return WriteTable(table, -1); }

// ----------------------------------------------------------------------
// Stream writer implementation

class StreamBookKeeper {
 public:
  StreamBookKeeper() : sink_(nullptr), position_(-1) {}
  explicit StreamBookKeeper(io::OutputStream* sink) : sink_(sink), position_(-1) {}

  Status UpdatePosition() { return sink_->Tell(&position_); }

  Status UpdatePositionCheckAligned() {
    RETURN_NOT_OK(UpdatePosition());
    DCHECK_EQ(0, position_ % 8) << "Stream is not aligned";
    return Status::OK();
  }

  Status Align(int32_t alignment = kArrowIpcAlignment) {
    // Adds padding bytes if necessary to ensure all memory blocks are written on
    // 8-byte (or other alignment) boundaries.
    int64_t remainder = PaddedLength(position_, alignment) - position_;
    if (remainder > 0) {
      return Write(kPaddingBytes, remainder);
    }
    return Status::OK();
  }

  // Write data and update position
  Status Write(const void* data, int64_t nbytes) {
    RETURN_NOT_OK(sink_->Write(data, nbytes));
    position_ += nbytes;
    return Status::OK();
  }

 protected:
  io::OutputStream* sink_;
  int64_t position_;
};

class SchemaWriter : public StreamBookKeeper {
 public:
  SchemaWriter(const Schema& schema, DictionaryMemo* dictionary_memo, MemoryPool* pool,
               io::OutputStream* sink)
      : StreamBookKeeper(sink),
        pool_(pool),
        schema_(schema),
        dictionary_memo_(dictionary_memo) {}

  Status WriteSchema() {
#ifndef NDEBUG
    // Catch bug fixed in ARROW-3236
    RETURN_NOT_OK(UpdatePositionCheckAligned());
#endif

    std::shared_ptr<Buffer> schema_fb;
    RETURN_NOT_OK(internal::WriteSchemaMessage(schema_, dictionary_memo_, &schema_fb));

    int32_t metadata_length = 0;
    RETURN_NOT_OK(internal::WriteMessage(*schema_fb, 8, sink_, &metadata_length));
    RETURN_NOT_OK(UpdatePositionCheckAligned());
    return Status::OK();
  }

  Status WriteDictionaries(std::vector<FileBlock>* dictionaries) {
    const DictionaryMap& id_to_dictionary = dictionary_memo_->id_to_dictionary();

    dictionaries->resize(id_to_dictionary.size());

    // TODO(wesm): does sorting by id yield any benefit?
    int dict_index = 0;
    for (const auto& entry : id_to_dictionary) {
      FileBlock* block = &(*dictionaries)[dict_index++];

      block->offset = position_;

      // Frame of reference in file format is 0, see ARROW-384
      const int64_t buffer_start_offset = 0;
      RETURN_NOT_OK(WriteDictionary(entry.first, entry.second, buffer_start_offset, sink_,
                                    &block->metadata_length, &block->body_length, pool_));
      RETURN_NOT_OK(UpdatePositionCheckAligned());
    }

    return Status::OK();
  }

  Status Write(std::vector<FileBlock>* dictionaries) {
    RETURN_NOT_OK(WriteSchema());

    // If there are any dictionaries, write them as the next messages
    return WriteDictionaries(dictionaries);
  }

 private:
  MemoryPool* pool_;
  const Schema& schema_;
  DictionaryMemo* dictionary_memo_;
};

class RecordBatchStreamWriter::RecordBatchStreamWriterImpl : public StreamBookKeeper {
 public:
  RecordBatchStreamWriterImpl(io::OutputStream* sink,
                              const std::shared_ptr<Schema>& schema)
      : StreamBookKeeper(sink),
        schema_(schema),
        pool_(default_memory_pool()),
        started_(false) {}

  virtual ~RecordBatchStreamWriterImpl() = default;

  virtual Status Start() {
    SchemaWriter schema_writer(*schema_, &dictionary_memo_, pool_, sink_);
    RETURN_NOT_OK(schema_writer.Write(&dictionaries_));
    started_ = true;
    return Status::OK();
  }

  virtual Status Close() {
    // Write the schema if not already written
    // User is responsible for closing the OutputStream
    RETURN_NOT_OK(CheckStarted());

    // Write 0 EOS message
    const int32_t kEos = 0;
    return Write(&kEos, sizeof(int32_t));
  }

  Status CheckStarted() {
    if (!started_) {
      return Start();
    }
    return Status::OK();
  }

  Status WriteRecordBatch(const RecordBatch& batch, bool allow_64bit, FileBlock* block) {
    RETURN_NOT_OK(CheckStarted());
    RETURN_NOT_OK(UpdatePosition());

    block->offset = position_;

    // Frame of reference in file format is 0, see ARROW-384
    const int64_t buffer_start_offset = 0;
    RETURN_NOT_OK(arrow::ipc::WriteRecordBatch(
        batch, buffer_start_offset, sink_, &block->metadata_length, &block->body_length,
        pool_, kMaxNestingDepth, allow_64bit));
    RETURN_NOT_OK(UpdatePositionCheckAligned());

    return Status::OK();
  }

  Status WriteRecordBatch(const RecordBatch& batch, bool allow_64bit) {
    // Push an empty FileBlock. Can be written in the footer later
    if (!batch.schema()->Equals(*schema_, false /* check_metadata */)) {
      return Status::Invalid("Tried to write record batch with different schema");
    }

    record_batches_.push_back({0, 0, 0});
    return WriteRecordBatch(batch, allow_64bit,
                            &record_batches_[record_batches_.size() - 1]);
  }

  void set_memory_pool(MemoryPool* pool) { pool_ = pool; }

 protected:
  std::shared_ptr<Schema> schema_;
  MemoryPool* pool_;
  bool started_;

  // When writing out the schema, we keep track of all the dictionaries we
  // encounter, as they must be written out first in the stream
  DictionaryMemo dictionary_memo_;

  std::vector<FileBlock> dictionaries_;
  std::vector<FileBlock> record_batches_;
};

RecordBatchStreamWriter::RecordBatchStreamWriter() {}

RecordBatchStreamWriter::~RecordBatchStreamWriter() {}

Status RecordBatchStreamWriter::WriteRecordBatch(const RecordBatch& batch,
                                                 bool allow_64bit) {
  return impl_->WriteRecordBatch(batch, allow_64bit);
}

void RecordBatchStreamWriter::set_memory_pool(MemoryPool* pool) {
  impl_->set_memory_pool(pool);
}

Status RecordBatchStreamWriter::Open(io::OutputStream* sink,
                                     const std::shared_ptr<Schema>& schema,
                                     std::shared_ptr<RecordBatchWriter>* out) {
  // ctor is private
  auto result = std::shared_ptr<RecordBatchStreamWriter>(new RecordBatchStreamWriter());
  result->impl_.reset(new RecordBatchStreamWriterImpl(sink, schema));
  *out = result;
  return Status::OK();
}

Status RecordBatchStreamWriter::Close() { return impl_->Close(); }

// ----------------------------------------------------------------------
// File writer implementation

class RecordBatchFileWriter::RecordBatchFileWriterImpl
    : public RecordBatchStreamWriter::RecordBatchStreamWriterImpl {
 public:
  using BASE = RecordBatchStreamWriter::RecordBatchStreamWriterImpl;

  RecordBatchFileWriterImpl(io::OutputStream* sink, const std::shared_ptr<Schema>& schema)
      : BASE(sink, schema) {}

  Status Start() override {
    // ARROW-3236: The initial position -1 needs to be updated to the stream's
    // current position otherwise an incorrect amount of padding will be
    // written to new files.
    RETURN_NOT_OK(UpdatePosition());

    // It is only necessary to align to 8-byte boundary at the start of the file
    RETURN_NOT_OK(Write(kArrowMagicBytes, strlen(kArrowMagicBytes)));
    RETURN_NOT_OK(Align());

    // We write the schema at the start of the file (and the end). This also
    // writes all the dictionaries at the beginning of the file
    return BASE::Start();
  }

  Status Close() override {
    // Write the schema if not already written
    // User is responsible for closing the OutputStream
    RETURN_NOT_OK(CheckStarted());

    // Write metadata
    RETURN_NOT_OK(UpdatePosition());

    int64_t initial_position = position_;
    RETURN_NOT_OK(WriteFileFooter(*schema_, dictionaries_, record_batches_,
                                  &dictionary_memo_, sink_));
    RETURN_NOT_OK(UpdatePosition());

    // Write footer length
    int32_t footer_length = static_cast<int32_t>(position_ - initial_position);

    if (footer_length <= 0) {
      return Status::Invalid("Invalid file footer");
    }

    RETURN_NOT_OK(Write(&footer_length, sizeof(int32_t)));

    // Write magic bytes to end file
    return Write(kArrowMagicBytes, strlen(kArrowMagicBytes));
  }
};

RecordBatchFileWriter::RecordBatchFileWriter() {}

RecordBatchFileWriter::~RecordBatchFileWriter() {}

Status RecordBatchFileWriter::Open(io::OutputStream* sink,
                                   const std::shared_ptr<Schema>& schema,
                                   std::shared_ptr<RecordBatchWriter>* out) {
  // ctor is private
  auto result = std::shared_ptr<RecordBatchFileWriter>(new RecordBatchFileWriter());
  result->file_impl_.reset(new RecordBatchFileWriterImpl(sink, schema));
  *out = result;
  return Status::OK();
}

Status RecordBatchFileWriter::WriteRecordBatch(const RecordBatch& batch,
                                               bool allow_64bit) {
  return file_impl_->WriteRecordBatch(batch, allow_64bit);
}

Status RecordBatchFileWriter::Close() { return file_impl_->Close(); }

// ----------------------------------------------------------------------
// Serialization public APIs

Status SerializeRecordBatch(const RecordBatch& batch, MemoryPool* pool,
                            std::shared_ptr<Buffer>* out) {
  int64_t size = 0;
  RETURN_NOT_OK(GetRecordBatchSize(batch, &size));
  std::shared_ptr<Buffer> buffer;
  RETURN_NOT_OK(AllocateBuffer(pool, size, &buffer));

  io::FixedSizeBufferWriter stream(buffer);
  RETURN_NOT_OK(SerializeRecordBatch(batch, pool, &stream));
  *out = buffer;
  return Status::OK();
}

Status SerializeRecordBatch(const RecordBatch& batch, MemoryPool* pool,
                            io::OutputStream* out) {
  int32_t metadata_length = 0;
  int64_t body_length = 0;
  return WriteRecordBatch(batch, 0, out, &metadata_length, &body_length, pool,
                          kMaxNestingDepth, true);
}

Status SerializeSchema(const Schema& schema, MemoryPool* pool,
                       std::shared_ptr<Buffer>* out) {
  std::shared_ptr<io::BufferOutputStream> stream;
  RETURN_NOT_OK(io::BufferOutputStream::Create(1024, pool, &stream));

  DictionaryMemo memo;
  SchemaWriter schema_writer(schema, &memo, pool, stream.get());

  // Unused
  std::vector<FileBlock> dictionary_blocks;

  RETURN_NOT_OK(schema_writer.Write(&dictionary_blocks));
  return stream->Finish(out);
}

}  // namespace ipc
}  // namespace arrow

redpajama_set_name: RedPajamaGithub


Are poor communication skills damaging your relationships? I can help. I practice relationship counseling and marriage therapy in Newport Beach, CA., specializing in helping clients either individually or with their partner.
You will learn to feel more loved and cared about, to reduce resentment and appreciate the differences between you, to de-escalate the hostility in your arguments, to create more intimacy and increase your connection with your partner, to stop blaming your partner (and yourself), to understand each other better, and to really speak and listen well so BOTH of you can get what you want and need.
I also specialize in helping you rebuild trust after a major breach, such as infidelity. I know what a heart-breaking, gut- wrenching time this is in your life and will walk you through it in order to help you really heal. Couples can and do recover from an affair or other breach of trust, and can experience a relationship that is far healthier and loving than they have ever known.
I'm the author of an e-Book called "What You Are REALLY Arguing About" that reveals how I approach the first session with every new client and identifies the three most important areas where couples tend to struggle. It will show you how to assess your connection with your partner and how to figure out your relationship's strengths and weaknesses. You will also learn the true underlying concerns that fuel your arguments and how to determine what it is you are wanting and needing from your partner. You can find my e-Book at my website.
Communication issues, feeling lonely, disconnected, infidelity, betrayal and trust issues, strengthening the underlying couple friendship, new relationships, moving past a break-up, helping you learn to have good boundaries and stand up for yourself, getting your needs across to your partner, feeling OK with or without a relationship.
Therapy andor coaching can help individuals and couples gain perspective on their situation, communicate better, learn to empathize with each other instead of fighting, get the skills to really hear each other, to heal from small and large betrayals, and to feel more loved.
I am best at helping couples increase their connection, and communicate their wants and needs in an effective way. Good relationships are a balance of love, skill, and commitment. The love and commitment will see us through a majority of our issues, but we still need skills to keep the love alive. We never learned these skills anywhere! Let me coach you on a more effective way.


text:
Q: React Native: elevation (shadow) and transparency on button don't work together as needed I have an issue with displaying transparent button. I use elevation property as a shadow for android and while using transparency I get that unwanted effect of dublicacy. Any suggestions how would I use transparecy + shadow on android, other than 3rd party libs?
buttonStyle: {
  height: 80,
  width: 220,
  backgroundColor: 'rgba(255, 255, 255, 0.25)',
  justifyContent: 'center',
  alignItems: 'center',
  borderRadius: 20,
  elevation: 10,

},
Button display

A: Try this. I hope this is what you expect.

  backdrop: {
    paddingTop: 60,
    width: 320,
    height: 120
},

buttonTitle: { color: 'white', height: 40, textAlignVertical: 'center' },
buttonView: {
    backgroundColor: 'rgba(0,0,0,0)',
    margin: 10,
    elevation: 7,
},
button: {
    backgroundColor: '#623DEE50',
    alignItems: 'center',
    justifyContent: 'center',
}
   <ImageBackground
                                style={styles.backdrop}
                                source={{ uri: 'https://images.pexels.com/photos/255379/pexels-photo-255379.jpeg?w=940&h=650&auto=compress&cs=tinysrgb' }}>
                                <View style={styles.buttonView}>
                                    <View style={styles.button}>
                                        <Text style={styles.buttonTitle}>Button</Text>
                                    </View>
                                </View>
                            </ImageBackground>

redpajama_set_name: RedPajamaStackExchange


text:
Q: Discord bot won't turn on with node I am new to coding, and was trying to code a discord bot and when I tried to turn it on after using npm main.js I tried to use node ., the bot would not turn on and cmd would not react at all, this is the code I have at this time
const Discord = require('discord.js');

const client = new Discord.Client();

const prefix = '/'

client.once('ready', () => {
    console.log('BotMan 2 is online!')
});

client.on('message', message =>{
    if(/message.content.startswith(prefix) || message.author.bot) return;

    const args = message.content.slice(prefix.legnth).split(/ +/);
    const command = args.shift().toLowerCase();

    if(command === 'ping'){
        message.channel.send('pong!');
    }
});

-

client.login('tag(My tag was here I removed it)');


text:
Artist mark cohen
Book Format Hardback / 304 pages / 241 x 267 mm
Published by University of Texas Press, October 2015
The career of American photographer Mark Cohen (1943) spans many decades, and comprises street photography, candid portraiture and straight photography. Now, a vast retrospective of his photography, spanning works produced from 1964 – 2013, has been compiled into a new book: Frame.
Cohen's work is predominately black and white imagery; in Frame there are 221 duotones, combined with a modest 36 colour photographs. Some of the pictures, though a minority, are even framed by his film's black border, indicating traces of the medium as well as emphasising the longevity of his un-reprocessed vision. While the images all maintain a certain American sensibility, a humbleness and street-savvy simplicity that comes across as simultaneously mundane and edgy, they reflect Cohen's travels across multiple countries: Spain, Ireland, England, Italy, Mexico, as well as America. Certain themes emerge from his work, spread across time and space, such as the buttons on an outer coat, the skinny legs of little children, the exhaustion of feet and shoes. His choice of subject matter is, as described by Jane Livingston in the book's accompanying essay, "consistently democratic".
Printed below each image is a caption, told in a language which is agonizingly literal, for example, 'Girl on Bike in Puddle, December 1973' and 'Two Guys' Shoes and Feet, August 18, 1973'. They seem more apt for a keyword description when trying to find an image in an archive, rather than something which adds to the viewing. On the contrary, considering the naming, choosing to print the captions below each image was a poor one, as it sometimes even takes away from any pleasure that might be gained from the visual discovery that happens when viewing, as in the case of the image named 'Girl's Face and "8," 1974'. Viewing this image on its own would give the viewer freedom to wander visually through the frame, and 'discover' the number 8 which appears in tiles on a stoop behind the girl's face. Instead, with the caption printed below… the viewing experience has been reduced to a Speak & Spell level of having the artist point out what he wants you to see and in what order. A little poetry gets lost.
With such a wide selection of images, covering nearly 50 years of photography, Frame provides a thorough review of Cohen's way of seeing. Dancing between attention to detail and observing a scene, his viewpoint reveals a fascination with certain colours and textures, and distinctly everyday people and objects. In each image, the thing which has caught his eye is unambiguous: we can see what drew him in. In this way, Frame illustrates the way in which a photographer isolates attention toward a subject by choosing what to include within the four boundaries of a frame.
Wing Ambulance: an Interview with Elena Chernyshova
Elena Chernyshova (b.1981, Russia) investigates the daily lives of communities in the context of environmental, political, and economic changes. For two winters already, she has been visiting the...
An Interview with Seif Kousmate
Seif Kousmate (b. 1989, Morocco) dedicated himself professionally to photography in 2016. Since then, he has been working on different projects concerned with social issues: slavery in Mauritania,...
Red Orange: An interview with Delaney Allen
tim van dijk
In the project Red Orange, Delaney Allen (United States) takes on the genre of American road trip photography, following the likes of great names such as William Eggleston and Walker Evans. GUP...

redpajama_set_name: RedPajamaCommonCrawl


text:
source venv/bin/activate
python scripts/unosat_analysis/


text:
Traditional Clothing of Cuban Women
Famous Cultural Festivals in Latin America
Types of Dance in Carnival in Trinidad
by Jaime Golden; Updated October 05, 2017
The Full Moon Festival in Thailand
Activities During Carnival in Panama
What Festival Is Celebrated in June in Ecuador?
The Sun God Festival of Cusco, Peru
The country of Trinidad and Tobago, an island in the southern Caribbean, is known for the lively events of Carnival, an annual celebration of life. Carnival involves dancers moving in circles throughout the villages in Trinidad. The dancers wear elaborate masks and costumes representing different characters and animals related to cultural beliefs of Trinidad. Carnival and its dances are steeped in African and Brazilian cultures.
Limbo Dance
The Limbo dance, also referred to as the "under the stick" dance, was first created as ritual dance performed at African wakes. It became a popular dance in Trinidad in the late 19th century and is believed to be a re-creation of going down on a slave ship. Slave ships were often very narrow and had low ceilings; therefore slaves needed to have both flexibility and dexterity to navigate through the ship. The limbo dance today involves a limbo dancer moving to a rhythmic beat and dancing under a stick. The dancer cannot knock the stick over or touch it with their body. This step is repeated over and over, with the stick being lowered one notch each time. This continues with all dancers in a group, until there is just one left who hasn't touched the stick, fallen or laid on the floor.
Calypso Dance
The Calypso is a Caribbean dance performed to traditional Calypso music. The name Calypso comes from the sea nymph who kept Odysseus trapped on her island for seven years. This dance is an interpretation of what a sea nymph would look like if she were trying to entice her prisoner and make him fall in love with her. The dance is similar to the Rumba and is danced to a 32-count beat. A drum is usually used for music and beat. Calypso dance involves rocking side to side, back and forth, twirling, moving hips back and forth, swinging arms, clapping hands and snapping fingers. Movements are repeated over and over several times, until the song is over. The steel drums are often the musical instrument of choice for the Calypso dance.
Kalinda Dance
Kalinda (or Calinda) is a traditional stick-fighting dance that is practiced during Trinadian carnivals. The Kalinda dance originated in the 19th century and involves two dancers who pretend to fight and joust with their sticks. They are accompanied by a drummer and a singer called a chantwell. The chantwell's main purpose is to talk trash to the opposing dancer/fighter. Kalinda is also a form of martial arts and is practiced in many countries around the world.
Youtube: Caribbean Drum & Dance - Calypso -rehearsal- fun class
tntisland.com: Limbo Dance
Jaime Golden attended the University of Portland and obtained a bachelor's degree in social work with a minor in English. She then attended Portland State University and received a Masters of Social Work in 2002. Golden started writing in college, with a focus on research and academic writing. She now focuses on content marketing, SEO marketing and Internet marketing.
trinidad et tobago image by pandore from Fotolia.com
Things to Do in Barranquilla, Colombia
Clubs in Seattle for 18 & Over
Famous Festivals and Traditions in Brazil
The Pirate Festival in St. Augustine, Florida


Brugmansia 'Inca Sun' has been gracing our entry garden across from the McSwain Center at the JC Raulston Arboretum for several years and we've been thoroughly impressed with its performance. Unlike most hardy angel's trumpets which need to reach about 4' or so before they begin flowering and then flower on and off in waves, 'Inca Sun' will begin flowering each year when the new stems reach about 2' tall and continue with a succession of blooms all summer. The large (to 1') yellow pendant flowers provide an intoxicating aroma in the garden especially as evening hits. Angel's trumpet likes plenty of sun and responds well to fertilizer and moisture so long as it does not have wet feet. Expect a well-established plant of 'Inca Sun' to grow to about 5' tall. In winter, the stems will be killed to the ground in temperate climates but will erupt in spring as the ground warms. It will naturally grow as a multi-stemmed plant, but it can be pruned to a single stem. It grows equally well in a container and can be a stunning patio tree but the pot will need to be moved indoors in winter.


I've had the pleasure of chatting online with a blogger named Bob Jones who is using my Web 2.0 WordPress theme on his month-old blog and have just been amazed at his success.
Some of his posts made it on Reddit, Digg, among others … and in one month's time as hit over 600K pageviews!
Summarizing his five keys, they are: Timing, Content, Exposure, Networking and Being Prepared.


text:
Lomas del Santo är en ort i Mexiko.   Den ligger i kommunen San Agustín de las Juntas och delstaten Oaxaca, i den sydöstra delen av landet,  km sydost om huvudstaden Mexico City. Lomas del Santo ligger  meter över havet och antalet invånare är .

Terrängen runt Lomas del Santo är kuperad österut, men västerut är den platt. Terrängen runt Lomas del Santo sluttar västerut. Den högsta punkten i närheten är  meter över havet,  km öster om Lomas del Santo. Runt Lomas del Santo är det ganska tätbefolkat, med  invånare per kvadratkilometer. Närmaste större samhälle är Oaxaca de Juárez,  km norr om Lomas del Santo. I omgivningarna runt Lomas del Santo växer huvudsakligen savannskog.

Årsmedeltemperaturen i trakten är  °C. Den varmaste månaden är april, då medeltemperaturen är  °C, och den kallaste är september, med  °C. Genomsnittlig årsnederbörd är  millimeter. Den regnigaste månaden är juni, med i genomsnitt  mm nederbörd, och den torraste är januari, med  mm nederbörd.

Kommentarer

Källor

Orter i Oaxaca

redpajama_set_name: RedPajamaWikipedia


text:
Háromszlécs (szlovákul Liptovské Sliače, korábban Tri-Sljáče) község Szlovákiában, a Zsolnai kerület Rózsahegyi járásában.

Fekvése
Rózsahegytől 6 km-re délkeletre, a Liptói-medence déli részén fekszik. Alsó- Közép- és Felsőszlécsből áll.

A település nevének változásai
 1251 – utraque Stelach (a latin utraque szó jelentése: mindkét)
 1252 – due ville Scelech
 1263 – Szelecz
 1535 – Tres possessiones Zlech
 1572 – Zlecz Superior, Zlecz Mediocris, Zlecz Inferior
 1773 – Sliače
 1786 – Oppidum Trium Slécsch
 1808 – Tri Sljáče
 1920 – Nižný, Prostredný és Vyšný Sliač, Tri Sliače
 1927 – Sliače; magyarul: Háromszlécs
 2001 – Liptovské Sliače

Története
Felsőszlécs felett neolit kori magaslati település nyomai és hallstatt kori urnasírok kerültek elő. A lausitzi kultúra népe erődítményt épített ide, mely egy nagyobb védelmi rendszer részét képezte. Az egykori erőd maradványait 1795-ben Révay János szepesi püspök és az 1825. évi egyházi vizitáció is megemlíti. A 9. század első felében szlávok telepedtek meg ezen a vidéken.

A település a 13. században tűnik fel az írott forrásokban. Alsó- és Középszlécset már 1251-ben említik a zniói premontrei kolostor birtokaként. Felsőszlécs pedig a 16. század első negyedében keletkezett, ekkor már a három rész egy falut alkotott és gyakorlatilag városként működött. Csak a 18. században kapott mezővárosi jogokat, vásártartással, hetipiaccal. Híres juhászai voltak, a fafaragás és sajtkészítés mesterei.

A 18. század végén Vályi András így ír róla: "Három Szlécs, Try Szliace, Trium Szlécs, A. F. és K. Szlécs. Három tót helységből épűltt Mezőváros Liptó Várm. földes Urok a' Tudományi Kintstár, az előtt a' Turóczi Jésuitáknak bírtokok vala, fekszenek Német Liptséhez nem meszsze, Vág vizének szomszédságában; Ispotállya is van az egygyiknek; földgyeik jók, vagyonnyaik külömbfélék, piatzok N. Liptsén, és Rozenbergán."

Fényes Elek 1851-ben kiadott geográfiai szótárában így ír a településről: "Szlécs, (Alsó- Felső- és Közép), tót m. v. Liptó vmegyében, 582 kath., 3 evang. lak. Kath. paroch. templom; országos vásárok. F. u. a religioi kincstár. – A savanyu viz F.-Szlécs falu határában van. Ut. p. Rosenberg."

A trianoni diktátumig Liptó vármegye Rózsahegyi járásához tartozott.

Népessége
1910-ben 1943, túlnyomórészt szlovák lakosa volt.

2001-ben 3830 lakosából 3792 szlovák volt.

2011-ben 3796 lakosából 3669 szlovák.

Nevezetességei
 Szent Simon és Júdásnak szentelt római katolikus temploma 1334 körül épült, tornya 17. századi. Falfestményei a 14–15. századból származnak, melyek közül a Segítő Szűzanya képe a szlovák ezer koronás bankjegyet díszítette.
 Új templomának alapkövét 1994-ben II. János Pál pápa áldotta meg.
 Határában mofettás melegforrás van enyhén szénsavas savanyúvízzel.
 A településnek gazdag népi hagyományai vannak, melyeket népi együttese ápol.

Jeles háromszlécsiek
Itt született 1863-ban Jozef Hanula festőművész.

Jegyzetek

Külső hivatkozások
 Hivatalos oldal
 Községinfó
 Háromszlécs Szlovákia térképén
 E-obce.sk

Haromszlecs
Liptó vármegye települései


text:
Watch CBS News Baltimore
CBS Baltimore App
Community MVP
WJZ and the Baltimore Banner
WJZ At 9
Terps
Nominate An MVP
Wes Moore reflects on historic election as Maryland's first Black governor
January 2, 2023 / 7:21 AM / CNN
Wes Moore reflects on historic victory as Maryland's first Black governor
Wes Moore reflects on historic victory as Maryland's first Black governor 00:55
(CNN) -- Wes Moore, the incoming governor of Maryland, reflected Sunday on the historic nature of his election as the state's first Black chief executive.
"It is remarkable," the Democrat said in an interview on CNN's "State of the Union" with Dana Bash, who pointed out that Maryland will also have a Black attorney general, treasurer and state House speaker. "I'm proud of the history that I'm going to make in this race of being the state's first Black governor."
"And also I'm proud of it because I know how complicated the racial history is in the state of Maryland and how complicated the racial history in the United States is," he said. "Maryland is the state of Harriet Tubman, and Frederick Douglass, and Thurgood Marshall, but I also know that the reason that I am now days away from becoming Maryland's 63rd governor, is not only because Black folks voted for me."
Moore, an Army veteran and former nonprofit executive, is only the third Black person to be elected governor in US history. He defeated Republican Dan Cox in November by 32 points in the deep-blue state.
Moore said people voted for him "not just because" they wanted to see him make history, "but because they knew that together, we could actually build a state that everyone could believe in and everyone could thrive in."
"I'm a patriot and I was raised by patriots," said Moore, who served in Afghanistan.
"Our country is worth fighting for, but fighting for your country does not mean hating half of the people in it," Moore said. "And when we talk about patriotism, it means an ability to be able to lift everyone up -- to fight for each other, to believe in each other -- to believe that our country is great because we are inclusive."
Moore will succeed Republican Gov. Larry Hogan, who was term-limited and has been a critic of the hard-right direction his party has taken in recent years.
"I appreciate the fact that the governor ... he was very against the MAGA movement from its inception -- for years," Moore told Bash. "He's been calling the MAGA movement dangerous, which it is ... and I thank him for that."
Moore also said he doesn't foresee a White house bid anytime soon, instead throwing his support behind President Joe Biden in 2024.
"I'm very excited for President Biden to run for reelection. We're going to support him. I'm thankful for the amount of times he's come to Maryland. We have a lot of partnerships we're going to get done," he said.
Moore pointed to work, wages, and wealth as three primary policy areas he wants to focus on in office.
"For work, it means we're going to have an education system that is going to teach our students how not just to be employees but how to be employers," he said, noting that he has pushed a "service year option" for every high school graduate in Maryland. If enacted, the state would be the first in the country to adopt such a program, which would provide job training and mentorship to young Marylanders.
"For wages, it means that we are going to ensure that people can have good wages again for the jobs that they have because we still have too many people in this state that are working jobs -- and in some cases -- multiple jobs -- and still living below a poverty line," he said.
Moore also said he wants Maryland to lead the nation in tackling the racial wealth gap and "making sure that people can own more than they owe."
The incoming governor said that the best way to pay for state programs without raising taxes is to stimulate economic growth by introducing more job skill training to place people who are unemployed in open positions and offer child care to working parents.
"We have a dynamic economy, we're just not preparing people to participate in that dynamic economy," he said.
When asked by Bash if he was confident in his ability to implement state programs without raising taxes, Moore said, "I'm very confident."
By Michelle Watson and Jack Forrest, CNN
First published on January 2, 2023 / 7:21 AM
The-CNN-Wire ™ © 2023 Cable News Network, Inc., a Warner Bros. Discovery Company. All rights reserved.
Public File for WJZ-TV


For 11 years, our partnership with (RED) has supported HIV/AIDS programs that provide counseling, testing, and medicine that prevents the transmission of HIV from a mother to her unborn child. So far, we've raised over $160 million through the sale of our (RED) products. Every purchase brings us a step closer to an AIDS‑free generation.


text:
Three Converted Wine Silos Add Living Space to a Waterfront Rooftop in Amsterdam
When big cities need to scrounge up developable land for their expanding populations, they often turn to underutilized industrial areas that occupy what would otherwise be prime real estate. In the Eastern port of Amsterdam, a new neighborhood called Cruquiuseiland is developing into a mixed urban quarter for living and working along the junction of two waterways.
For decades, this area has no longer served its purpose as a port system, since the waters are too shallow for modern ships. It grew derelict over time and felt disconnected from the community. Today, it's becoming a lively destination full of interesting architecture that combines older existing buildings with new construction. Project Harbour Club is one of those buildings, boasting three massive salvaged wine silos converted into rooftop homes as its defining feature.
Dutch firm LEVS architecten turned the original low-lying 1901 dock terminal facility and wine warehouse into a nightclub and restaurant that connects to a new six-story L-shaped residential building, which hugs it on two sides. The project offers 81 starter homes, three luxury townhouses, and five live/work homes, as well as the event spaces. Placing a booming club adjacent to housing might seem like poor planning, but the architects integrated a ton of soundproofing as well as buffer spaces in between, reducing vibrations and sound.
The architects explain that "the Harbour Club's new event space is located on the lower three floors on the Cruquiusweg. Using the box-in-a-box principle, the space has been completely disconnected from the other functions in the building in order to prevent noise nuisance. The box with its own foundation consists of a steel frame with precast concrete. Above it, houses with a through lounge float, supported by four 16-meter-long beams. A second, glass skin also forms a buffer zone and serves as a foyer."
During renovations to remove an adjacent 1990s industrial hall, the architects uncovered the original brick facade of the building, which lends a sense of age and texture to the restaurant along with the wine warehouse's old wooden beams. The preserved porthole-style windows enhance the building's connection to its shipping industry history. Planted with mossy sedum, the roof of this structure is now a shared outdoor space for residents of the building.
Naturally, those huge industrial wine silos are the star of the show. They once stored wine destined for the Dutch market, and they had to be decontaminated and lifted over a line of trees to be installed. "They have been preserved as icons of the island's history and have been given a new function as elevated luxury town houses," the architects add. "The three-story dwellings stand on a communal roof terrace in a green landscape. They are rotated slightly to provide the best possible view from the new panoramic window."
The residents of these luxury units might have the best views of all, but the "starter homes" definitely aren't bad, either. Some are studios set above the event hall, and others cantilever 16 feet over the old warehouse on the restaurant side. Their half-covered balconies offer privacy while overlooking the harbor and green roof.
"Harbour Club is a multi-level challenge: technically, programmatically, and architecturally," the architects say. "The combined necessities of affordable densification, restoration of monuments, [and] climate mitigation and adaptation need to be addressed simultaneously. Harbour Club is a contemporary answer, characterized by unconventional solutions."


text:
Linamar Partners With Roush And Ballard To Develop Fuel Cell Hybrid Electric Delivery Vans For CARB Program
By FuelCellsWorksMarch 31, 2021 4 min read (664 words)
March 31, 2021 | 4 min read
Companies collaborate on pilot program to increase zero-emissions capabilities for medium-duty vehicles
LIVONIA, Mich – Linamar Corporation (TSX: LNR) has entered the evaluation phase for the first Fuel Cell Electric Vehicle Delivery Vans in their technology contract with the Center for Transportation and the Environment (CTE). CTE is managing the Next Generation Fuel Cell Delivery Van Deployment Project for the California Air Resources Board (CARB), awarded to accelerate the adoption of clean freight transportation technologies. Linamar has partnered with Roush CleanTech and Ballard Power Systems to provide complete turn-key FCEV package delivery vans to UPS for an in-revenue service demonstration in California.
The CARB Project includes developing, validating and deploying four fuel cell hybrid electric delivery vans. This is part of California Climate Investments, a statewide initiative that puts billions of Cap-and-Trade dollars to work to reduce greenhouse gas emissions, strengthen the economy, and improve public health and the environment – particularly in disadvantaged communities.
"The strength of CTE's project lies in its team member experience with advanced vehicle manufacturing, utilization of proven, off-the-shelf components, participation of UPS as the fleet operator and deployment partner, and the propulsion system's commercialization potential," said Dan Raudebaugh, executive director of CTE, a non-profit, Atlanta-based organization that develops, promotes and implements advanced transportation technologies.
Over the past decade, Linamar has made a substantial investment in automotive and commercial vehicle eAxle design, development and testing at its Livonia, Michigan, McLaren Engineering operations, as well as its McLaren Engineering centers in Germany and China. This has resulted in a market leader position in integrated eAxle systems.
"Linamar is excited by the market opportunities in supplying electrified vehicles and has significantly increased its portfolio of products specific for an electric mobility future including full eAxle systems to power next generation vehicle propulsion systems," said Linamar CEO Linda Hasenfratz.
This second generation eAxle for Class 4-6 commercial vehicles is a key result of this investment, building upon the success of their earlier DOE program for a Class 6 HEV delivery vehicle. The new Gen 2.0 eAxle utilizes a robust beam axle design with low NVH helical gears, levering Linamar's world leading gear manufacturing expertise, and an integrated electric park lock. Its single-speed, single-motor design delivers 200kW and 11,400Nm to the rear axle for excellent startability and gradeability under rigorous real-world delivery conditions.
Roush CleanTech is a leader in advanced clean transportation solutions. Roush is supplying the overall vehicle and system design, integration, build and commissioning for the fuel cell electric vehicles. FCEVs are electric vehicles that use a fuel cell to power its onboard electric motor, generating electricity from the air and compressed hydrogen.
"Roush's expertise in clean mobility solutions is supported by decades of engineering, vehicle controls and integration experience with many of the major OEMs. Combine that with the fact that we have deployed more than 37,000 Ford medium-duty trucks and Blue Bird school buses featuring advanced technologies, such as propane autogas, and it provides fleets a comfort level in transitioning away from traditional fuels like diesel," said Todd Mouw, president of ROUSH CleanTech. "Our customers have accumulated well over 1 billion road miles, so we understand how to engineer, sell, service and support our customers through the complete asset lifecycle."
Other partners to CTE and Linamar include Ballard Power Systems, which supplies the fuel cell power technology, designed to integrate with the eAxle and battery systems in the Ford F-59 chassis to create the hydrogen-powered FCEV with 150 mile range based on targeted driving cycles.
Randy MacEwen, Ballard President and CEO noted, "Ballard's industry-leading experience in the manufacture of fuel cell systems for Medium- and Heavy-Duty Motive applications includes powering Fuel Cell Electric Vehicles for more than 75 million kilometers to date. Our high-performance fuel cell systems are designed to meet the demanding needs of commercial vehicles, including superior durability requirements for delivery vans. We are proud to be working with Linamar, Roush and CTE on this ground-breaking project for CARB."
The four FCEV delivery vans will be delivered by April of 2021.
Previous PostNel ASA: Receives Purchase Order from HTEC on Second H2Station™ Hydrogen Fueling Station in Canada
Next PostEuropean Hydrogen Fuel Cell Vans Will Hit the Streets by 2021, According to Stellantis


text:
Athletics – Day 2 wrap
"It means the world to me – it's hard to describe. I can now say I'm a Paralympic medallist."
That's how first-time Paralympic Games shot putter Claire Keefer described her breakthrough bronze medal on day two of competition at the Rio athletics stadium.
She wasn't alone in that kind of milestone. Vision-impaired sprinter Chad Perris was a fraction slow off the blocks but took it to the rest of the 100m T13 field and got himself on the podium for a bronze medal at his first Games.
"It was an awesome race. I was nervous behind the blocks but as soon as he said 'On your marks' you know what you have to do and the nerves go away," Perris said taking bronze behind Ireland's Jason Smyth and Namibia's Johannes Nambala.
"It was about executing my race which I've been working on the last three years.
"It all paid off with a massive PB (personal best time) and a bronze medal."
And he was able to share a piece of history with Smyth, who collected the T13 gold for a third time in a row after victories in Beijing and London.
"He's a legend. To share the track with him is an honour. To share the dias with him was all that and more," Perris said.
Keefer moved into silver medal position in the women's F41 shot put, for short stature athletes, with her opening throw of 8.16 metres. But was overtaken by Tunisian pair Samar Ben Koelleb (silver, 8.39m) and Raoua Tlili (gold, 10.19m).
"I wanted to get over 8 metres and I did that. A bronze medal I thought was a little out of reach, but surprise, surprise I've got one in my hand – a Paralympic medal at my first Paralympics.
"Let's see what I can do in four years time."
That's the aim for leg amputee Sarah Walsh, who finished 6th in the women's T44 long jump final, after holding bronze medal position midway through her six jumps.
"The whole experience was absolutely fantastic regardless. It was an incredible to represent my country," Walsh said, also a debutant at the 2016 Paralympics.
"It wasn't the greatest jump I've done but I couldn't be more proud. This makes me more eager to improve and be able to come back and jump bigger and better at Tokyo."
It was undeniably `debutants day' on Day 2 with a fourth final featuring a first-time Australian competitor in sprinter Ella Pardy 6th in the women's T38 100m cerebral palsy class.
"I felt fine before the race. I didn't get many nerves," she said.
"It's been a great experience. I want to do it all again."
Perris and Keefer's medals take the Australians' total to four bronze in track and field.
Team co-captain Kurt Fearnley would like to add to the total in Sunday morning's 5000m T54 wheelchair final, after winning his race in Friday night's heats.
Fearnley's heat was a lot slower than the first won by Switzerland's Marcel Hug.
"Time is irrelevant," the 35-year-old five-time Paralympian said, who won the 5000m gold in Athens.
"Four laps in and I was sitting wide to see if anyone wanted to pick up the pace. It was pretty tactical there for a bit."
But then Fearnley burst down the straight and in the final 20 metres overhauling Thailand's Rawat Tana.
"I was thinking 'Do I let him have it?'. Dawsie (coach Andrew Dawes) would have ripped me anyway as he doesn't like not pushing through to the finish."
Between now and Sunday's final he will enjoy a little family time with young son Harry and wife Sheridan, who have made the trip to see Fearnley compete in his last Paralympics.
He says he feel his racing level is right where he wants it to be.
"I'm into it… give me a sniff with a 100 metres to go and I'm there. I feel ready, aggressive, determined."
By Sascha Ryner


text:
Mechanisms for T-cell selective cytotoxicity of arabinosylguanine
Carlos O. Rodriguez, Christine M. Stellrecht, Varsha Gandhi
Nelarabine, prodrug of arabinosylguanine (ara-G), has demonstrated T-lymphoblastic antileukemic activity in cell lines and in the clinic. To investigate the mechanism for lineage-specific toxicity, the effects of ara-G were compared in CEM (T-lymphoblast), Raji (B-lymphoblast), and ML-1 (myeloid) cell lines. CEM cells were the most sensitive to ara-G-induced apoptosis and accumulated the highest levels of ara-G triphosphate (ara-GTP). However, compared with myeloid and B-lineage cell lines, CEM cells incorporated fewer ara-G molecules - which were at internucleotide positions in all 3 cell lines - into DNA. Ara-G induced an S-phase arrest in both Raji and ML-1, while in CEM the S-phase cells decreased with a concomitant increase in the sub-G 1 population. Within 3 hours of ara-G treatment, the levels of soluble Fas ligand (sFasL) in the medium increased significantly in CEM cultures. In parallel, an induction of FasL gene expression was observed by real-time reverse transcriptase-polymerase chain reaction (RT-PCR). Pretreatment of CEM cells with a Fas antagonistic antibody inhibited ara-G - mediated cell death. These results demonstrate that high ara-GTP accumulation in T cells results in an S phase-dependent apoptosis induced by ara-G incorporation into DNA, which may lead to a T cell-specific signal for the induction and liberation of sFasL. Subsequently, the sFasL induces an apoptotic response in neighboring non - S-phase cells. In contrast, myeloid and B cells accumulated lower levels of ara-GTP and arrested in S phase, blocking any apoptotic signaling.
https://doi.org/10.1182/blood-2003-01-0317
10.1182/blood-2003-01-0317
Dive into the research topics of 'Mechanisms for T-cell selective cytotoxicity of arabinosylguanine'. Together they form a unique fingerprint.
9-arabinofuranosylguanine Medicine & Life Sciences 100%
S Phase Medicine & Life Sciences 85%
Apoptotic Chemical Compounds 66%
Fas Ligand Protein Medicine & Life Sciences 63%
triphosphoric acid Medicine & Life Sciences 61%
Nelarabine Chemical Compounds 58%
Antileucemic Chemical Compounds 44%
Rodriguez, C. O., Stellrecht, C. M., & Gandhi, V. (2003). Mechanisms for T-cell selective cytotoxicity of arabinosylguanine. Blood, 102(5), 1842-1848. https://doi.org/10.1182/blood-2003-01-0317
Mechanisms for T-cell selective cytotoxicity of arabinosylguanine. / Rodriguez, Carlos O.; Stellrecht, Christine M.; Gandhi, Varsha.
In: Blood, Vol. 102, No. 5, 01.09.2003, p. 1842-1848.
Rodriguez, CO, Stellrecht, CM & Gandhi, V 2003, 'Mechanisms for T-cell selective cytotoxicity of arabinosylguanine', Blood, vol. 102, no. 5, pp. 1842-1848. https://doi.org/10.1182/blood-2003-01-0317
Rodriguez CO, Stellrecht CM, Gandhi V. Mechanisms for T-cell selective cytotoxicity of arabinosylguanine. Blood. 2003 Sep 1;102(5):1842-1848. https://doi.org/10.1182/blood-2003-01-0317
Rodriguez, Carlos O. ; Stellrecht, Christine M. ; Gandhi, Varsha. / Mechanisms for T-cell selective cytotoxicity of arabinosylguanine. In: Blood. 2003 ; Vol. 102, No. 5. pp. 1842-1848.
@article{236a28c40b924f5da0efd6f0036ffca2,
title = "Mechanisms for T-cell selective cytotoxicity of arabinosylguanine",
abstract = "Nelarabine, prodrug of arabinosylguanine (ara-G), has demonstrated T-lymphoblastic antileukemic activity in cell lines and in the clinic. To investigate the mechanism for lineage-specific toxicity, the effects of ara-G were compared in CEM (T-lymphoblast), Raji (B-lymphoblast), and ML-1 (myeloid) cell lines. CEM cells were the most sensitive to ara-G-induced apoptosis and accumulated the highest levels of ara-G triphosphate (ara-GTP). However, compared with myeloid and B-lineage cell lines, CEM cells incorporated fewer ara-G molecules - which were at internucleotide positions in all 3 cell lines - into DNA. Ara-G induced an S-phase arrest in both Raji and ML-1, while in CEM the S-phase cells decreased with a concomitant increase in the sub-G 1 population. Within 3 hours of ara-G treatment, the levels of soluble Fas ligand (sFasL) in the medium increased significantly in CEM cultures. In parallel, an induction of FasL gene expression was observed by real-time reverse transcriptase-polymerase chain reaction (RT-PCR). Pretreatment of CEM cells with a Fas antagonistic antibody inhibited ara-G - mediated cell death. These results demonstrate that high ara-GTP accumulation in T cells results in an S phase-dependent apoptosis induced by ara-G incorporation into DNA, which may lead to a T cell-specific signal for the induction and liberation of sFasL. Subsequently, the sFasL induces an apoptotic response in neighboring non - S-phase cells. In contrast, myeloid and B cells accumulated lower levels of ara-GTP and arrested in S phase, blocking any apoptotic signaling.",
author = "Rodriguez, {Carlos O.} and Stellrecht, {Christine M.} and Varsha Gandhi",
doi = "10.1182/blood-2003-01-0317",
journal = "Blood",
publisher = "American Society of Hematology",
T1 - Mechanisms for T-cell selective cytotoxicity of arabinosylguanine
AU - Rodriguez, Carlos O.
AU - Stellrecht, Christine M.
AU - Gandhi, Varsha
N2 - Nelarabine, prodrug of arabinosylguanine (ara-G), has demonstrated T-lymphoblastic antileukemic activity in cell lines and in the clinic. To investigate the mechanism for lineage-specific toxicity, the effects of ara-G were compared in CEM (T-lymphoblast), Raji (B-lymphoblast), and ML-1 (myeloid) cell lines. CEM cells were the most sensitive to ara-G-induced apoptosis and accumulated the highest levels of ara-G triphosphate (ara-GTP). However, compared with myeloid and B-lineage cell lines, CEM cells incorporated fewer ara-G molecules - which were at internucleotide positions in all 3 cell lines - into DNA. Ara-G induced an S-phase arrest in both Raji and ML-1, while in CEM the S-phase cells decreased with a concomitant increase in the sub-G 1 population. Within 3 hours of ara-G treatment, the levels of soluble Fas ligand (sFasL) in the medium increased significantly in CEM cultures. In parallel, an induction of FasL gene expression was observed by real-time reverse transcriptase-polymerase chain reaction (RT-PCR). Pretreatment of CEM cells with a Fas antagonistic antibody inhibited ara-G - mediated cell death. These results demonstrate that high ara-GTP accumulation in T cells results in an S phase-dependent apoptosis induced by ara-G incorporation into DNA, which may lead to a T cell-specific signal for the induction and liberation of sFasL. Subsequently, the sFasL induces an apoptotic response in neighboring non - S-phase cells. In contrast, myeloid and B cells accumulated lower levels of ara-GTP and arrested in S phase, blocking any apoptotic signaling.
AB - Nelarabine, prodrug of arabinosylguanine (ara-G), has demonstrated T-lymphoblastic antileukemic activity in cell lines and in the clinic. To investigate the mechanism for lineage-specific toxicity, the effects of ara-G were compared in CEM (T-lymphoblast), Raji (B-lymphoblast), and ML-1 (myeloid) cell lines. CEM cells were the most sensitive to ara-G-induced apoptosis and accumulated the highest levels of ara-G triphosphate (ara-GTP). However, compared with myeloid and B-lineage cell lines, CEM cells incorporated fewer ara-G molecules - which were at internucleotide positions in all 3 cell lines - into DNA. Ara-G induced an S-phase arrest in both Raji and ML-1, while in CEM the S-phase cells decreased with a concomitant increase in the sub-G 1 population. Within 3 hours of ara-G treatment, the levels of soluble Fas ligand (sFasL) in the medium increased significantly in CEM cultures. In parallel, an induction of FasL gene expression was observed by real-time reverse transcriptase-polymerase chain reaction (RT-PCR). Pretreatment of CEM cells with a Fas antagonistic antibody inhibited ara-G - mediated cell death. These results demonstrate that high ara-GTP accumulation in T cells results in an S phase-dependent apoptosis induced by ara-G incorporation into DNA, which may lead to a T cell-specific signal for the induction and liberation of sFasL. Subsequently, the sFasL induces an apoptotic response in neighboring non - S-phase cells. In contrast, myeloid and B cells accumulated lower levels of ara-GTP and arrested in S phase, blocking any apoptotic signaling.
U2 - 10.1182/blood-2003-01-0317
DO - 10.1182/blood-2003-01-0317
JO - Blood
JF - Blood


Sophia Smith's Instagram is full of gorgeous outfits which we would love to have in our own wardrobe. In honor of Sophia turning 24, we've picked 24 of our favorite outfits she's worn.
Let us know which outfit you'd love to add to your own wardrobe in the comments below or on @Fuzzable.
Is Cavo Tagoo Mykonos one the worlds most Instagram friendly hotel?


I am a somewhat indefatigable critic of the man who has earned my epithet, "insufferable," the New York Times's Frank Rich.
Rich recently held forth on the Armstrong Williams débacle and the coverage of same on the late CNN shout-fest, "Crossfire."
But there is nothing if not honor among bloviators. "On the left," as they say at "Crossfire," Paul Begala, a Democratic political consultant, offered condemnations of the Bush administration but had only soft questions and plaudits for Mr. Williams. Three times in scarcely as many minutes Mr. Begala congratulated his guest for being "a stand-up guy" simply for appearing in the show's purportedly hostile but entirely friendly confines. When Mr. Williams apologized for having crossed "some ethical lines," that was enough to earn Mr. Begala's benediction: "God bless you for that."
"On the right" was the columnist Robert Novak, who "in the interests of full disclosure" told the audience he is a "personal friend" of Mr. Williams, whom he "greatly" admires as "one of the foremost voices for conservatism in America." Needless to say, Mr. Novak didn't have any tough questions, either, but we should pause a moment to analyze this "Crossfire" co-host's disingenuous use of the term "full disclosure."
Rich buries the CBS scandal and the derelictions of the Times with a swift, mumbled aide, before going on to point out that "Crossfire" interviewed Williams, pelting him with marshmallows. He goes on to remark on other alleged conflicts of interest that don't amount to as much as he seems to think.
As much as it pains me, Frank is right on his basic point. Secret federal subsidies to journalists, even journalists of opinion, are shameful. The fact that Williams probably took the money to say things he would have said anyway does not exonerate him. If she takes money in exchange for sexual favors, a woman is no less a whore if she would have given it away for free.
And if Williams was wrong, the government was doubly wrong to pay secretly for an endorsement of a program. This is corruption worthy of Mexico's Partido Revolucionário Institucional or PRI. The fact that a Republican administraion is responsible doesn't make the events less shameful.
Even if he neglects the CBS scandal, Frank's fisking of "Crossfire" was righteous, and his indignation at the Williams débacle is righteous and justified. To their credit, plenty of conservative bloggers, notably Michelle Malkin, shared the indignation. Liberal candor about CBS was far rarer.
Sigh! Agreeing with Frank Rich was the right thing to do, but it sure ain't as much fun as lambasting him for his frequent museum-piece blue-state rants. I have no fear, though, that he'll take a glass of water and lapse into his usuable fiskable leftist self soon enough.


Educational and engaging, this dry-erase USA map is fabulous for kids decor, and great in a classroom! The clever kids map design boasts bold colors and easy-to-read state capitals, complete with fun symbols representing something special about each state! This kids USA dry erase map is 36" x 24". WallPops are repositionable and always removable.
This decal is 36" x 24"


text:
Earthquake breaking news, Minor World Earthquakes Magnitude -3.9
Minor earthquake, 3.2 mag has occurred near Tierras Nuevas Poniente in Puerto Rico
A minor earthquake with magnitude 3.2 (ml/mb) was detected on Thursday, 79 km N of Tierras Nuevas Poniente, Puerto Rico (49 miles). The epicenter of the earthquake was roughly 33 km (21 miles) below the earth's surface. Exact location of earthquake, longitude -66.533 West, latitude 19.1766 North, depth = 33 km. Id of earthquake: pr2020352000. Event ids that are associated: us7000crqs, pr2020352000. The temblor was picked up at 03:56:16 / 3:56 am (local time epicenter). Date and time of earthquake in UTC/GMT: 17/12/20 / 2020-12-17 03:56:16 / December 17, 2020 @ 3:56 am.
In the past 24 hours, there have been two, in the last 10 days thirteen, in the past 30 days twenty-three and in the last 365 days two hundred and sixty-two earthquakes of magnitude 3.0 or greater that was reported nearby. Earthquakes 3.0 to 4.0 are often felt, but only causes minor damage. Each year there are an estimated 130,000 minor quakes in the world.
Did you feel anything?
How did you react? Was there any damage to buildings? Leave a comment or report about shaking, activity and damage at your home, city and country. Read more about the earthquake, Location, Distances, Seismometer information, Date-Time, Parameters and details about this quake, reported near: 79 km N of Tierras Nuevas Poniente, Puerto Rico. This information comes from the USGS Earthquake Notification Service.
Puerto RicoTierras Nuevas Poniente
-66.533° West Decimal degrees longitude. Negative values for western longitudes.
33 km Depth of the event in kilometers.
79 km N of Tierras Nuevas Poniente, Puerto Rico Textual description of named geographic region near to the event. This may be a city name, or a Flinn-Engdahl Region name.
pr The ID of a data contributor. Identifies the network considered to be the preferred source of information for this event.
,us,pr, A comma-separated list of network contributors.
19 The total number of Number of seismic stations which reported P- and S-arrival times for this earthquake.
0.8589 Horizontal distance from the epicenter to the nearest station (in degrees).
257 The largest azimuthal gap between azimuthally adjacent stations (in degrees).
md The method or algorithm used to calculate the preferred magnitude for the event.
pr2020352000 Id of event.
2020352000 An identifying code assigned by, and unique from, the corresponding source for the event.
,us7000crqs,pr2020352000, A comma-separated list of event ids that are associated to an event.


Gordon–Haus jitter in telecom lines or in mode-locked lasers can be numerically simulated with the software RP Fiber Power. The results can be statistically processed, e.g. in order to obtain noise spectra.
Ask RP Photonics for advice on timing jitter, pulse propagation, or soliton effects. Extensive modeling software is available.
There are several mechanisms causing timing jitter of ultrashort pulses either during their generation in a mode-locked laser or during propagation in an optical fiber e.g. within an optical fiber communications system. In addition to a direct impact of various effects such as spontaneous emission on the pulse timing, jitter can also arise via coupling of other types of noise to the timing.
One of these coupling mechanisms is the Gordon–Haus effect . Here, fluctuations of the center frequency of the optical pulses are coupled to the timing via group velocity dispersion: a change in center frequency translates into a change in group velocity, which will subsequently affect the pulse timing.
More specifically, Gordon and Haus considered the noise in a fiber-optic link with periodically spaced fiber amplifiers. Here, the amplifiers, which were implicitly assumed to have a wavelength-independent gain, introduce quantum noise which shifts the optical center frequency by a random amount. In many subsequent amplifiers, the center frequency (and with it the group velocity) of each pulse undergoes a random walk, without any correlation between the center frequency changes of different pulses. Subsequently, the timing deviations of the pulses accumulate more and more. A central result is that the variance of the timing errors grows in proportion to the fiber losses per unit length, the third power of the transmission distance, and inversely to the square root of the optical energy per pulse. The whole analysis was actually based on the assumption of soliton pulse propagation, with reference to soliton perturbation theory; however, the basic results can be generalized for non-solitonic pulses.
Note that Gordon–Haus jitter in the originally considered situation becomes the dominant source of jitter for long-haul data transmission. This is due to the third-power dependence on length, which results from the unbounded drift of the center frequency. However, Gordon–Haus jitter can be effectively suppressed by using regularly spaced optical filters, or simply amplifiers with limited gain bandwidth, in order to eliminate this unbounded drift. The jitter performance may then be limited by other kinds of noise.
The term Gordon–Haus effect is often used in a more general way – essentially always when center frequency fluctuations couple to the timing via chromatic dispersion.
A coupling from center frequency fluctuations to the timing occurs also in every mode-locked laser – not only in mode-locked fiber lasers. Here, the center frequency can never undergo an unbounded drift, because the gain bandwidth of the gain medium is limited. Nevertheless, the effect on the timing can be significant [2, 6] – particularly at low noise frequencies and for short pulses (because the latter are less affected by the direct impact of spontaneous emission). Its strength depends on the chromatic dispersion and the gain bandwidth, and the statistics are different from those for unbounded drifts of the center frequency.


text:
News from BACP
13 May: Speaking to a counsellor online has been a lifeline during lockdown
Speaking to a counsellor online has been a lifeline during lockdown
Mum-of-two Kat shares her experience of how counselling has helped her
A mum of nine-month-old twins has told how speaking to a counsellor online has helped her cope with postnatal depression and the difficulties of life in lockdown.
Kat* said without the online sessions with her therapist she didn't think she'd have been able to cope with being stuck at home without being able to see family and friends for support.
She says being able to talk to a professional counsellor, who doesn't judge her, helps her explore her feelings and discuss practical steps she can take when she's struggling, has been crucial during these difficult and uncertain times.
"Before counselling, lockdown would have been my worst nightmare," said Kat.
Stressed and angry
"I couldn't imagine being stuck at home with the kids all day and not have family and friends round and all that extra help. I'd have been worried about what would have happened and that I'd have been stressed and angry all the time.
"But talking to a counsellor, and being able to continue these sessions online, has definitely helped."
After Kat's twin boys were born last year she struggled to cope. She was diagnosed with postnatal depression and took medication for a while.
"I really struggled from day one of having the twins. I was crying a lot. I wasn't coping at all," she said.
"I was getting angry and frustrated every time they cried.
"My doctor initially suggested therapy. But at that time I couldn't even picture getting out of the house or doing anything like that."
After a while, Kat went to a group session for women with postnatal depression. There, she was given the details of counsellor and BACP member Natasha Page, at This Is Me Counselling and Psychotherapy.
"By that point, I'd just started thinking that this was something I needed to get a hold of. I thought I'd give counselling a try."
Earlier this year, Kat started seeing the counsellor regularly.
"It's been really useful.
"I've found it good to talk about how I feel and not be judged. The biggest thing that had been weighing on my mind since having the boys had been those feelings of 'you're not meant to be feeling like this, 'you should be dealing with it', 'you can't be getting angry at babies'. To be able to have that non-judgmental chat about it all really helped."
Non-judgmental
Kat added: "It's definitely different talking to a counsellor, rather than a family member or friend. My family has just been so happy with the babies arriving. They've just wanted me to be happy and they don't really understand why I'm not.
"Some friends, I know they've struggled and I know they get how I've felt. But some mums just give you a look when you say how you feel and I think 'ooh I better not say any more'."
Kat said: "The practical help has been really useful too.
"We went through some different CBT techniques.
"I've been keeping a mood diary to see what really set me off. It triggered some interesting discussions. Things that I didn't think about such as how I interact with my parents or my partner. I hadn't thought about how to make just little changes in what I was doing and how it might help."
Counselling online
When the lockdown restrictions came into force because of coronavirus, Kat's sessions continued online, rather than face to face.
"We still see each other's faces," she said. "I dial in from home and am looking at her on my computer screen. I still see her well enough on there. We can still have a proper conversation. It still feels like we're making eye contact.
"My partner's in another room, looking after the kids, so he can't hear."
At her first online session, Kat's counsellor explained how the sessions would work and about the web platform they were using.
"I felt really secure as she explained the set up and said that no one could overhear us," said Kat.
Works really well
"It works really well as an approach."
She added she's found online counselling more convenient in terms of family life as well.
"It was handy to be able to meet face to face at the start and get to know her. But it did also make it a bit more difficult as it was time out of the house and I had to leave my partner with the kids.
"Now I'm at home. I'm not far away from the kids. It's easier.
"Like all appointments you just go for face to face. I just assumed that was the way I'd do it. Having done it online I wish I'd done that from the start."
Kat has also found that the time spent at home with just her partner and the babies has helped her focus on what she's found out and learnt during counselling.
"I think I've been lucky," she said. "Lockdown has given me a bit of time to work on the things that we've discussed.
Using techniques I've learnt
"I'm really managing to get hold of my anger and recognise that they are babies. They don't mean to annoy me.
"I'm using the techniques I've learnt from my counsellor to reason my way out of some of the feelings I've had, and to avoid getting into the place I was in before."
To find a counsellor or psychotherapist who works online visit our Therapist Directory.
*Not her real name.
Illustrations and graphics by Emily Catherine Illustration. www.emilycatherineillustration.com
Thinking about therapy?
If you're not sure whether therapy could help, what type of therapy you need, or how to find a safe and effective therapist, we'll help you find the information you need.
Online and phone counselling
What is online counselling? What is telephone or phone counselling? Our member Rakhi Chand explains how online and phone counselling work.
Coronavirus: Advice for the public
Advice on seeing a therapist during the pandemic, plus tips, advice and coping strategies from our members to help you through these uncertain times
This page was printed from https://www.bacp.co.uk/news/news-from-bacp/2020/13-may-speaking-to-a-counsellor-online-has-been-a-lifeline-during-lockdown/