text:
namespace base {
namespace debug {

namespace {

constexpr uint64_t kMaxOffset = std::numeric_limits<uint64_t>::max();

// These numbers are suitable for most compilation units for chrome and
// content_shell. If a compilation unit has bigger number of directories or
// filenames, the additional directories/filenames will be ignored, and the
// stack frames pointing to these directories/filenames will not get line
// numbers. We can't set these numbers too big because they affect the size of
// ProgramInfo which is allocated in the stack.
constexpr int kMaxDirectories = 128;
constexpr size_t kMaxFilenames = 512;

// DWARF-4 line number program header, section 6.2.4
struct ProgramInfo {
  uint64_t header_length;
  uint64_t start_offset;
  uint64_t end_offset;
  uint8_t minimum_instruction_length;
  uint8_t maximum_operations_per_instruction;
  uint8_t default_is_stmt;
  int8_t line_base;
  uint8_t line_range;
  uint8_t opcode_base;
  uint8_t standard_opcode_lengths[256];
  uint8_t include_directories_table_offset;
  uint8_t file_names_table_offset;

  // Store the directories as offsets.
  int num_directories = 1;
  uint64_t directory_offsets[kMaxDirectories];
  uint64_t directory_sizes[kMaxDirectories];

  // Store the file number table offsets.
  mutable unsigned int num_filenames = 1;
  mutable uint64_t filename_offsets[kMaxFilenames];
  mutable uint8_t filename_dirs[kMaxFilenames];

  unsigned int OpcodeToAdvance(uint8_t adjusted_opcode) const {
    // Special opcodes advance line numbers by an amount based on line_range
    // and opcode_base. This calculation is taken from 6.2.5.1.
    return static_cast<unsigned int>(adjusted_opcode) / line_range;
  }
};

// DWARF-4 line number program registers, section 6.2.2
struct LineNumberRegisters {
  // During the line number program evaluation, some instructions perform a
  // "commit" which is when the registers have finished calculating a new row in
  // the line-number table. This callback is executed and can be viewed as a
  // iterator over all rows in the line number table.
  class OnCommit {
   public:
    virtual void Do(LineNumberRegisters* registers) = 0;
  };

  raw_ptr<OnCommit> on_commit;
  LineNumberRegisters(ProgramInfo info, OnCommit* on_commit)
      : on_commit(on_commit), is_stmt(info.default_is_stmt) {}

  // Current program counter.
  uintptr_t address = 0;

  // For VLIW architectures, the index of the operation in the VLIW instruction.
  unsigned int op_index = 0;

  // Identifies the source file relating to the address in the DWARF File name
  // table.
  uint64_t file = 0;

  // Identifies the line number. Starts at 1. Can become 0 if instruction does
  // not match any line in the file.
  uint64_t line = 1;

  // Identifies the column within the source line. Starts at 1 though "0"
  // also means "left edge" of the line.
  uint64_t column = 0;

  // Boolean determining if this is a recommended spot for a breakpoint.
  // Should be initialized by the program header.
  bool is_stmt = false;

  // Indicates start of a basic block.
  bool basic_block = false;

  // Indicates first byte after a sequence of machine instructions.
  bool end_sequence = false;

  // Indicates this may be where execution should stop if trying to break for
  // entering a function.
  bool prologue_end = false;

  // Indicates this may be where execution should stop if trying to break for
  // exiting a function.
  bool epilogue_begin = false;

  // Identifier for the instruction set of the current address.
  uint64_t isa = 0;

  // Identifies which block the current instruction belongs to.
  uint64_t discriminator = 0;

  // Values from the previously committed line. See OnCommit interface for more
  // details. This conceptually should be a copy of the whole
  // LineNumberRegisters but since only 4 pieces of data are needed, hacking
  // it inline was easier.
  uintptr_t last_address = 0;
  uint64_t last_file = 0;
  uint64_t last_line = 0;
  uint64_t last_column = 0;

  // This is the magical calculation for decompressing the line-number
  // information. The `program_info` provides the parameters for the formula
  // and the `op_advance` is the input value. See DWARF-4 sections 6.2.5.1 for
  // the formula.
  void OpAdvance(const ProgramInfo* program_info, uint64_t op_advance) {
    address += program_info->minimum_instruction_length *
               ((op_index + op_advance) /
                program_info->maximum_operations_per_instruction);

    op_index = (op_index + op_advance) %
               program_info->maximum_operations_per_instruction;
  }

  // Committing a line means the calculation has landed on a stable set of
  // values that represent an actual entry in the line number table.
  void CommitLine() {
    on_commit->Do(this);

    // Inlined or compiler generator code may have line number 0 which isn't
    // useful to the user. Better to go up one line number.
    if (line != 0) {
      last_address = address;
      last_file = file;
      last_column = column;
      last_line = line;
    }
  }
};

struct LineNumberInfo {
  uint64_t pc = 0;
  uint64_t line = 0;
  uint64_t column = 0;

  // Offsets here are to the file table and directory table arrays inside the
  // ProgramInfo.
  uint64_t module_dir_offset = 0;
  uint64_t dir_size = 0;
  uint64_t module_filename_offset = 0;
};

// Evaluates a Line Number Program as defined by the rules in section 6.2.5.
void EvaluateLineNumberProgram(const int fd,
                               LineNumberInfo* info,
                               uint64_t base_address,
                               uint64_t start,
                               const ProgramInfo& program_info) {
  BufferedDwarfReader reader(fd, start);
  uint64_t module_relative_pc = info->pc - base_address;

  // Helper that records the line-number table entry corresponding with the
  // `module_relative_pc`. This is the thing that actually finds the line
  // number for an address.
  struct OnCommitImpl : public LineNumberRegisters::OnCommit {
   private:
    raw_ptr<LineNumberInfo> info;
    uint64_t module_relative_pc;
    const raw_ref<const ProgramInfo> program_info;

   public:
    OnCommitImpl(LineNumberInfo* info,
                 uint64_t module_relative_pc,
                 const ProgramInfo& program_info)
        : info(info),
          module_relative_pc(module_relative_pc),
          program_info(program_info) {}

    void Do(LineNumberRegisters* registers) override {
      // When a line is committed, the program counter needs to check if it is
      // in the [last_address, cur_addres) range. If yes, then the line pertains
      // to the program counter.
      if (registers->last_address == 0) {
        // This is the first table entry so by definition, nothing is in its
        // range.
        return;
      }

      // If module_relative_pc is out of range, skip.
      if (module_relative_pc < registers->last_address ||
          module_relative_pc >= registers->address)
        return;

      if (registers->last_file < program_info->num_filenames) {
        info->line = registers->last_line;
        info->column = registers->last_column;

        // Since DW_AT_name in the compile_unit is optional, it may be empty. If
        // it is, guess that the file in entry 1 is the name. This does not
        // follow spec, but seems to be common behavior. See the following LLVM
        // bug for more info: https://reviews.llvm.org/D11003
        if (registers->last_file == 0 &&
            program_info->filename_offsets[0] == 0 &&
            1 < program_info->num_filenames) {
          program_info->filename_offsets[0] = program_info->filename_offsets[1];
          program_info->filename_dirs[0] = program_info->filename_dirs[1];
        }

        if (registers->last_file < kMaxFilenames) {
          info->module_filename_offset =
              program_info->filename_offsets[registers->last_file];

          uint8_t dir = program_info->filename_dirs[registers->last_file];
          info->module_dir_offset = program_info->directory_offsets[dir];
          info->dir_size = program_info->directory_sizes[dir];
        }
      }
    }
  } on_commit(info, module_relative_pc, program_info);

  LineNumberRegisters registers(program_info, &on_commit);

  // Special opcode range is [program_info.opcode_base, 255].
  // Lines can be max incremented by [line_base + line range - 1].
  // opcode = (desired line increment - line_base) + (line_range * operation
  // advance) + opcode_base.
  uint8_t opcode;
  while (reader.position() < program_info.end_offset && info->line == 0) {
    if (!reader.ReadInt8(opcode))
      return;

    // It's SPECIAL OPCODE TIME!. They're so special that they make up the
    // vast majority of the opcodes and are the first thing described in the
    // documentation.
    //
    // See DWARF-4 spec 6.2.5.1.
    if (opcode >= program_info.opcode_base) {
      uint8_t adjusted_opcode = opcode - program_info.opcode_base;
      registers.OpAdvance(&program_info,
                          program_info.OpcodeToAdvance(adjusted_opcode));
      const int line_adjust =
          program_info.line_base + (adjusted_opcode % program_info.line_range);
      if (line_adjust < 0) {
        if (static_cast<uint64_t>(-line_adjust) > registers.line)
          return;
        registers.line -= static_cast<uint64_t>(-line_adjust);
      } else {
        registers.line += static_cast<uint64_t>(line_adjust);
      }
      registers.basic_block = false;
      registers.prologue_end = false;
      registers.epilogue_begin = false;
      registers.discriminator = 0;
      registers.CommitLine();
    } else {
      // Standard opcodes
      switch (opcode) {
        case 0: {
          // Extended opcode.
          uint64_t extended_opcode;
          uint64_t extended_opcode_length;
          if (!reader.ReadLeb128(extended_opcode_length))
            return;
          uint64_t next_opcode = reader.position() + extended_opcode_length;
          if (!reader.ReadLeb128(extended_opcode))
            return;
          switch (extended_opcode) {
            case 1: {
              // DW_LNE_end_sequence
              registers.end_sequence = true;
              registers.CommitLine();
              registers = LineNumberRegisters(program_info, &on_commit);
              break;
            }

            case 2: {
              // DW_LNE_set_address
              uint32_t value;
              if (!reader.ReadInt32(value))
                return;
              registers.address = value;
              registers.op_index = 0;
              break;
            }

            case 3: {
              // DW_LNE_define_file
              //
              // This should only get used if the filename table itself is null.
              // Record the module offset for the string and then drop the data.
              uint64_t filename_offset = reader.position();
              reader.ReadCString(program_info.end_offset, nullptr, 0);

              // dir index
              uint64_t value;
              if (!reader.ReadLeb128(value))
                return;
              size_t cur_filename = program_info.num_filenames;
              if (cur_filename < kMaxFilenames && value < kMaxDirectories) {
                ++program_info.num_filenames;
                // Store the offset from the start of file and skip the data to
                // save memory.
                program_info.filename_offsets[cur_filename] = filename_offset;
                program_info.filename_dirs[cur_filename] =
                    static_cast<uint8_t>(value);
              }

              // modification time
              if (!reader.ReadLeb128(value))
                return;

              // source file length
              if (!reader.ReadLeb128(value))
                return;
              break;
            }

            case 4: {
              // DW_LNE_set_discriminator
              uint64_t value;
              if (!reader.ReadLeb128(value))
                return;
              registers.discriminator = value;
              break;
            }

            default:
              abort();
          }

          // Skip any padding bytes in extended opcode.
          reader.set_position(next_opcode);
          break;
        }

        case 1: {
          // DW_LNS_copy. This commits the registers to the line number table.
          registers.CommitLine();
          registers.discriminator = 0;
          registers.basic_block = false;
          registers.prologue_end = false;
          registers.epilogue_begin = false;
          break;
        }

        case 2: {
          // DW_LNS_advance_pc
          uint64_t op_advance;
          if (!reader.ReadLeb128(op_advance))
            return;
          registers.OpAdvance(&program_info, op_advance);
          break;
        }

        case 3: {
          // DW_LNS_advance_line
          int64_t line_advance;
          if (!reader.ReadLeb128(line_advance))
            return;
          if (line_advance < 0) {
            if (static_cast<uint64_t>(-line_advance) > registers.line)
              return;
            registers.line -= static_cast<uint64_t>(-line_advance);
          } else {
            registers.line += static_cast<uint64_t>(line_advance);
          }
          break;
        }

        case 4: {
          // DW_LNS_set_file
          uint64_t value;
          if (!reader.ReadLeb128(value))
            return;
          registers.file = value;
          break;
        }

        case 5: {
          // DW_LNS_set_column
          uint64_t value;
          if (!reader.ReadLeb128(value))
            return;
          registers.column = value;
          break;
        }

        case 6:
          // DW_LNS_negate_stmt
          registers.is_stmt = !registers.is_stmt;
          break;

        case 7:
          // DW_LNS_set_basic_block
          registers.basic_block = true;
          break;

        case 8:
          // DW_LNS_const_add_pc
          registers.OpAdvance(
              &program_info,
              program_info.OpcodeToAdvance(255 - program_info.opcode_base));
          break;

        case 9: {
          // DW_LNS_fixed_advance_pc
          uint16_t value;
          if (!reader.ReadInt16(value))
            return;
          registers.address += value;
          registers.op_index = 0;
          break;
        }

        case 10:
          // DW_LNS_set_prologue_end
          registers.prologue_end = true;
          break;

        case 11:
          // DW_LNS_set_epilogue_begin
          registers.epilogue_begin = true;
          break;

        case 12: {
          // DW_LNS_set_isa
          uint64_t value;
          if (!reader.ReadLeb128(value))
            return;
          registers.isa = value;
          break;
        }

        default:
          abort();
      }
    }
  }
}

// Parses a 32-bit DWARF-4 line number program header per section 6.2.4.
// `cu_name_offset` is the module offset for the 0th entry of the file table.
bool ParseDwarf4ProgramInfo(BufferedDwarfReader* reader,
                            bool is_64bit,
                            uint64_t cu_name_offset,
                            ProgramInfo* program_info) {
  if (!reader->ReadOffset(is_64bit, program_info->header_length))
    return false;
  program_info->start_offset = reader->position() + program_info->header_length;

  if (!reader->ReadInt8(program_info->minimum_instruction_length) ||
      !reader->ReadInt8(program_info->maximum_operations_per_instruction) ||
      !reader->ReadInt8(program_info->default_is_stmt) ||
      !reader->ReadInt8(program_info->line_base) ||
      !reader->ReadInt8(program_info->line_range) ||
      !reader->ReadInt8(program_info->opcode_base)) {
    return false;
  }

  for (int i = 0; i < (program_info->opcode_base - 1); i++) {
    if (!reader->ReadInt8(program_info->standard_opcode_lengths[i]))
      return false;
  }

  // Table ends with a single null line. This basically means search for 2
  // contiguous empty bytes.
  uint8_t last = 0, cur = 0;
  for (;;) {
    // Read a byte.
    last = cur;
    if (!reader->ReadInt8(cur))
      return false;

    if (last == 0 && cur == 0) {
      // We're at the last entry where it's a double null.
      break;
    }

    // Read in all of the filename.
    int cur_dir = program_info->num_directories;
    if (cur_dir < kMaxDirectories) {
      ++program_info->num_directories;
      // "-1" is because we have already read the first byte above.
      program_info->directory_offsets[cur_dir] = reader->position() - 1;
      program_info->directory_sizes[cur_dir] = 1;
    }
    do {
      if (!reader->ReadInt8(cur))
        return false;
      if (cur_dir < kMaxDirectories)
        ++program_info->directory_sizes[cur_dir];
    } while (cur != '\0');
  }

  // Read filename table line-by-line.
  last = 0;
  cur = 0;
  for (;;) {
    // Read a byte.
    last = cur;
    if (!reader->ReadInt8(cur))
      return false;

    if (last == 0 && cur == 0) {
      // We're at the last entry where it's a double null.
      break;
    }

    // Read in all of the filename. "-1" is because we have already read the
    // first byte of the filename above.
    uint64_t filename_offset = reader->position() - 1;
    do {
      if (!reader->ReadInt8(cur))
        return false;
    } while (cur != '\0');

    uint64_t value;

    // Dir index
    if (!reader->ReadLeb128(value))
      return false;
    size_t cur_filename = program_info->num_filenames;
    if (cur_filename < kMaxFilenames && value < kMaxDirectories) {
      ++program_info->num_filenames;
      program_info->filename_offsets[cur_filename] = filename_offset;
      program_info->filename_dirs[cur_filename] = static_cast<uint8_t>(value);
    }

    // Modification time
    if (!reader->ReadLeb128(value))
      return false;

    // Bytes in file.
    if (!reader->ReadLeb128(value))
      return false;
  }

  // Set up the 0th filename.
  program_info->filename_offsets[0] = cu_name_offset;
  program_info->filename_dirs[0] = 0;
  program_info->directory_offsets[0] = 0;

  return true;
}

// Returns the offset of the next byte to read.
// `program_info.program_end` is guaranteed to be initlialized to either
// `kMaxOffset` if the program length could not be processed, or to
// the byte after the end of this program.
bool ReadProgramInfo(const int fd,
                     uint64_t start,
                     uint64_t cu_name_offset,
                     ProgramInfo* program_info) {
  BufferedDwarfReader reader(fd, start);
  program_info->end_offset = kMaxOffset;

  // Note that 64-bit dwarf does NOT imply a 64-bit binary and vice-versa. In
  // fact many 64-bit binaries use 32-bit dwarf encoding.
  bool is_64bit = false;
  uint64_t data_length;
  if (!reader.ReadInitialLength(is_64bit, data_length)) {
    return false;
  }

  // Set the program end. This allows the search to recover by skipping an
  // unparsable program.
  program_info->end_offset = reader.position() + data_length;

  uint16_t version;
  if (!reader.ReadInt16(version)) {
    return false;
  }

  if (version == 4) {
    return ParseDwarf4ProgramInfo(&reader, is_64bit, cu_name_offset,
                                  program_info);
  }

  // Currently does not support other DWARF versions.
  return false;
}

// Attempts to find line-number info for all of |info|. Returns the number of
// entries that do not have info yet.
uint64_t GetLineNumbersInProgram(const int fd,
                                 LineNumberInfo* info,
                                 uint64_t base_address,
                                 uint64_t start,
                                 uint64_t cu_name_offset) {
  // Open the program.
  ProgramInfo program_info;
  if (ReadProgramInfo(fd, start, cu_name_offset, &program_info)) {
    EvaluateLineNumberProgram(fd, info, base_address, program_info.start_offset,
                              program_info);
  }

  return program_info.end_offset;
}

// Scans the .debug_abbrev entry until it finds the Attribute List matching the
// `wanted_abbreviation_code`. This is called when parsing a DIE in .debug_info.
bool AdvancedReaderToAttributeList(BufferedDwarfReader& reader,
                                   uint64_t table_end,
                                   uint64_t wanted_abbreviation_code,
                                   uint64_t& tag,
                                   bool& has_children) {
  // Abbreviation Table entries are:
  //   LEB128 - abbreviation code
  //   LEB128 - the entry's tag
  //   1 byte - DW_CHILDREN_yes or DW_CHILDREN_no for if entry has children.
  //   [LEB128, LEB128] -- repeated set of attribute + form values in LEB128
  //   [0, 0] -- null entry terminating list is 2 LEB128 0s.
  while (reader.position() < table_end) {
    uint64_t abbreviation_code;
    if (!reader.ReadLeb128(abbreviation_code)) {
      return false;
    }

    if (!reader.ReadLeb128(tag)) {
      return false;
    }

    uint8_t raw_has_children;
    if (!reader.ReadInt8(raw_has_children)) {
      return false;
    }
    if (raw_has_children == 0) {
      has_children = false;
    } else if (raw_has_children == 1) {
      has_children = true;
    } else {
      return false;
    }

    if (abbreviation_code == wanted_abbreviation_code) {
      return true;
    }

    // Incorrect Abbreviation entry. Skip all of its attributes.
    uint64_t attr;
    uint64_t form;
    do {
      if (!reader.ReadLeb128(attr) || !reader.ReadLeb128(form)) {
        return false;
      }
    } while (attr != 0 || form != 0);
  }

  return false;
}

// This reads through a .debug_info compile unit entry to try and extract
// the `cu_name_offset` as well as the `debug_line_offset` (offset into the
// .debug_lines table` corresponding to `pc`.
//
// The .debug_info sections are a packed set of bytes whose format is defined
// by a corresponding .debug_abbrev entry. Basically .debug_abbrev describes
// a struct and .debug_info has a header that tells which struct it is followed
// by a bunch of bytes.
//
// The control flow is to find the .debug_abbrev entry for each .debug_info
// entry, then walk through the .debug_abbrev entry to parse the bytes of the
// .debug_info entry. A successful parse calculates the address range that the
// .debug_info entry covers. When that is retrieved, `pc` can be compared to
// the range and a corresponding .debug_info can be found.
//
// The `debug_info_start` be the start of the whole .debug_info section or an
// offset into the section if it was known ahead of time (perhaps by consulting
// .debug_aranges).
//
// To fully interpret this data, the .debug_ranges and .debug_str sections
// also need to be interpreted.
bool GetCompileUnitName(int fd,
                        uint64_t debug_info_start,
                        uint64_t debug_info_end,
                        uint64_t pc,
                        uint64_t module_base_address,
                        uint64_t* debug_line_offset,
                        uint64_t* cu_name_offset) {
  // Ensure defined `cu_name_offset` in case DW_AT_name is missing.
  *cu_name_offset = 0;

  // Open .debug_info and .debug_abbrev as both are needed to find the
  // DW_AT_name for the DW_TAG_compile_unit or DW_TAG_partial_unit
  // corresponding to the given address.

  ElfW(Shdr) debug_abbrev;
  constexpr static char kDebugAbbrevSectionName[] = ".debug_abbrev";
  if (!google::GetSectionHeaderByName(fd, kDebugAbbrevSectionName,
                                      sizeof(kDebugAbbrevSectionName),
                                      &debug_abbrev)) {
    return false;
  }
  uint64_t debug_abbrev_end = debug_abbrev.sh_offset + debug_abbrev.sh_size;

  ElfW(Shdr) debug_str;
  constexpr static char kDebugStrSectionName[] = ".debug_str";
  if (!google::GetSectionHeaderByName(
          fd, kDebugStrSectionName, sizeof(kDebugStrSectionName), &debug_str)) {
    return false;
  }
  uint64_t debug_str_end = debug_str.sh_offset + debug_str.sh_size;

  ElfW(Shdr) debug_ranges;
  constexpr static char kDebugRangesSectionName[] = ".debug_ranges";
  if (!google::GetSectionHeaderByName(fd, kDebugRangesSectionName,
                                      sizeof(kDebugRangesSectionName),
                                      &debug_ranges)) {
    return false;
  }
  uint64_t debug_ranges_end = debug_ranges.sh_offset + debug_ranges.sh_size;

  // Iterate Compile Units.
  uint64_t next_compilation_unit = kMaxOffset;
  for (BufferedDwarfReader reader(fd, debug_info_start);
       reader.position() < debug_info_end;
       reader.set_position(next_compilation_unit)) {
    bool is_64bit;
    uint64_t length;
    uint16_t dwarf_version;
    uint64_t abbrev_offset;
    uint8_t address_size;
    if (!reader.ReadCommonHeader(is_64bit, length, dwarf_version, abbrev_offset,
                                 address_size, next_compilation_unit)) {
      return false;
    }

    // Compilation Unit Header parsed. Now read the first tag which is either a
    // DW_TAG_compile_unit or DW_TAG_partial_unit. The entry type is designated
    // by a LEB128 number that needs to be cross-referenced in the abbreviations
    // table to understand the format of the rest of the entry.
    uint64_t abbreviation_code;
    if (!reader.ReadLeb128(abbreviation_code)) {
      return false;
    }

    // Find entry in the abbreviation table.
    BufferedDwarfReader abbrev_reader(fd,
                                      debug_abbrev.sh_offset + abbrev_offset);
    uint64_t tag;
    bool has_children;
    AdvancedReaderToAttributeList(abbrev_reader, debug_abbrev_end,
                                  abbreviation_code, tag, has_children);

    // Ignore if it has children.
    static constexpr int kDW_TAG_compile_unit = 0x11;
    static constexpr int kDW_TAG_partial_unit = 0x3c;
    if (tag != kDW_TAG_compile_unit && tag != kDW_TAG_partial_unit) {
      return false;
    }

    // Use table to parse the name, high, and low attributes.
    static constexpr int kDW_AT_name = 0x3;        // string
    static constexpr int kDW_AT_stmt_list = 0x10;  // lineptr
    static constexpr int kDW_AT_low_pc = 0x11;     // address
    static constexpr int kDW_AT_high_pc = 0x12;    // address, constant
    static constexpr int kDW_AT_ranges = 0x55;     // rangelistptr
    uint64_t attr;
    uint64_t form;
    uint64_t low_pc = 0;
    uint64_t high_pc = 0;
    bool high_pc_is_offset = false;
    bool is_found_in_range = false;
    do {
      if (!abbrev_reader.ReadLeb128(attr)) {
        return false;
      }
      if (!abbrev_reader.ReadLeb128(form)) {
        return false;
      }
      // Table from 7.5.4, Figure 20.
      enum Form {
        kDW_FORM_addr = 0x01,
        kDW_FORM_block2 = 0x03,
        kDW_FORM_block4 = 0x04,
        kDW_FORM_data2 = 0x05,
        kDW_FORM_data4 = 0x06,
        kDW_FORM_data8 = 0x07,
        kDW_FORM_string = 0x08,
        kDW_FORM_block = 0x09,
        kDW_FORM_block1 = 0x0a,
        kDW_FORM_data1 = 0x0b,
        kDW_FORM_flag = 0x0c,
        kDW_FORM_sdata = 0x0d,
        kDW_FORM_strp = 0x0e,
        kDW_FORM_udata = 0x0f,
        kDW_FORM_ref_addr = 0x10,
        kDW_FORM_ref1 = 0x11,
        kDW_FORM_ref2 = 0x12,
        kDW_FORM_ref4 = 0x13,
        kDW_FORM_ref8 = 0x14,
        kDW_FORM_ref_udata = 0x15,
        kDW_FORM_ref_indrect = 0x16,
        kDW_FORM_sec_offset = 0x17,
        kDW_FORM_exprloc = 0x18,
        kDW_FORM_flag_present = 0x19,
        kDW_FORM_ref_sig8 = 0x20,
      };

      switch (form) {
        case kDW_FORM_string: {
          // Read the value into if necessary `out`
          if (attr == kDW_AT_name) {
            *cu_name_offset = reader.position();
          }
          if (!reader.ReadCString(debug_info_end, nullptr, 0)) {
            return false;
          }
        } break;

        case kDW_FORM_strp: {
          uint64_t strp_offset;
          if (!reader.ReadOffset(is_64bit, strp_offset)) {
            return false;
          }

          if (attr == kDW_AT_name) {
            uint64_t pos = debug_str.sh_offset + strp_offset;
            if (pos >= debug_str_end) {
              return false;
            }
            *cu_name_offset = pos;
          }
        } break;

        case kDW_FORM_addr: {
          uint64_t address;
          if (!reader.ReadAddress(address_size, address)) {
            return false;
          }

          if (attr == kDW_AT_low_pc) {
            low_pc = address;
          } else if (attr == kDW_AT_high_pc) {
            high_pc_is_offset = false;
            high_pc = address;
          }
        } break;

        case kDW_FORM_data1: {
          uint8_t data;
          if (!reader.ReadInt8(data)) {
            return false;
          }
          if (attr == kDW_AT_high_pc) {
            high_pc_is_offset = true;
            high_pc = data;
          }
        } break;

        case kDW_FORM_data2: {
          uint16_t data;
          if (!reader.ReadInt16(data)) {
            return false;
          }
          if (attr == kDW_AT_high_pc) {
            high_pc_is_offset = true;
            high_pc = data;
          }
        } break;

        case kDW_FORM_data4: {
          uint32_t data;
          if (!reader.ReadInt32(data)) {
            return false;
          }
          if (attr == kDW_AT_high_pc) {
            high_pc_is_offset = true;
            high_pc = data;
          }
        } break;

        case kDW_FORM_data8: {
          uint64_t data;
          if (!reader.ReadInt64(data)) {
            return false;
          }
          if (attr == kDW_AT_high_pc) {
            high_pc_is_offset = true;
            high_pc = data;
          }
        } break;

        case kDW_FORM_sdata: {
          int64_t data;
          if (!reader.ReadLeb128(data)) {
            return false;
          }
          if (attr == kDW_AT_high_pc) {
            high_pc_is_offset = true;
            high_pc = static_cast<uint64_t>(data);
          }
        } break;

        case kDW_FORM_udata: {
          uint64_t data;
          if (!reader.ReadLeb128(data)) {
            return false;
          }
          if (attr == kDW_AT_high_pc) {
            high_pc_is_offset = true;
            high_pc = data;
          }
        } break;

        case kDW_FORM_ref_addr:
        case kDW_FORM_sec_offset: {
          uint64_t value;
          if (!reader.ReadOffset(is_64bit, value)) {
            return false;
          }

          if (attr == kDW_AT_ranges) {
            uint64_t current_base_address = module_base_address;
            BufferedDwarfReader ranges_reader(fd,
                                              debug_ranges.sh_offset + value);

            while (ranges_reader.position() < debug_ranges_end) {
              // Ranges are 2 addresses in size.
              uint64_t range_start;
              uint64_t range_end;
              if (!ranges_reader.ReadAddress(address_size, range_start)) {
                return false;
              }
              if (!ranges_reader.ReadAddress(address_size, range_end)) {
                return false;
              }
              uint64_t relative_pc = pc - current_base_address;

              if (range_start == 0 && range_end == 0) {
                if (!is_found_in_range) {
                  // Time to go to the next iteration.
                  goto next_cu;
                }
                break;
              } else if (((address_size == 4) &&
                          (range_start == 0xffffffffUL)) ||
                         ((address_size == 8) &&
                          (range_start == 0xffffffffffffffffULL))) {
                // Check if this is a new base add value. 2.17.3
                current_base_address = range_end;
              } else {
                if (relative_pc >= range_start && relative_pc < range_end) {
                  is_found_in_range = true;
                  break;
                }
              }
            }
          } else if (attr == kDW_AT_stmt_list) {
            *debug_line_offset = value;
          }
        } break;

        case kDW_FORM_flag:
        case kDW_FORM_ref1:
        case kDW_FORM_block1: {
          uint8_t dummy;
          if (!reader.ReadInt8(dummy)) {
            return false;
          }
        } break;

        case kDW_FORM_ref2:
        case kDW_FORM_block2: {
          uint16_t dummy;
          if (!reader.ReadInt16(dummy)) {
            return false;
          }
        } break;

        case kDW_FORM_ref4:
        case kDW_FORM_block4: {
          uint32_t dummy;
          if (!reader.ReadInt32(dummy)) {
            return false;
          }
        } break;

        case kDW_FORM_ref8: {
          uint64_t dummy;
          if (!reader.ReadInt64(dummy)) {
            return false;
          }
        } break;

        case kDW_FORM_ref_udata:
        case kDW_FORM_block: {
          uint64_t dummy;
          if (!reader.ReadLeb128(dummy)) {
            return false;
          }
        } break;

        case kDW_FORM_exprloc: {
          uint64_t value;
          if (!reader.ReadLeb128(value)) {
            return false;
          }
          reader.set_position(reader.position() + value);
        } break;
      }
    } while (attr != 0 || form != 0);

    // Because attributes can be in any order, most of the computations (minus
    // checking range list entries) cannot happen until everything is parsed for
    // the one .debug_info entry. Do the analysis here.
    if (is_found_in_range) {
      // Well formed compile_unit and partial_unit tags either have a
      // DT_AT_ranges entry or an DT_AT_low_pc entiry. If is_found_in_range
      // matched as true, then this entry matches the given pc.
      return true;
    }

    // If high_pc_is_offset is 0, it was never found in the DIE. This indicates
    // a single address entry. Only look at the low_pc.
    {
      uint64_t module_relative_pc = pc - module_base_address;
      if (high_pc == 0 && module_relative_pc != low_pc) {
        goto next_cu;
      }

      // Otherwise this is a contiguous range DIE. Normalize the meaning of the
      // high_pc field and check if it contains the pc.
      if (high_pc_is_offset) {
        high_pc = low_pc + high_pc;
        high_pc_is_offset = false;
      }

      if (module_relative_pc >= low_pc && module_relative_pc < high_pc) {
        return true;
      }
    }

    // Not found.
  next_cu:;
  }
  return false;
}

// Thin wrapper over `GetCompileUnitName` that opens the .debug_info section.
bool ReadCompileUnit(int fd,
                     uint64_t pc,
                     uint64_t cu_offset,
                     uint64_t base_address,
                     uint64_t* debug_line_offset,
                     uint64_t* cu_name_offset) {
  if (cu_offset == 0) {
    return false;
  }

  ElfW(Shdr) debug_info;
  constexpr static char kDebugInfoSectionName[] = ".debug_info";
  if (!google::GetSectionHeaderByName(fd, kDebugInfoSectionName,
                                      sizeof(kDebugInfoSectionName),
                                      &debug_info)) {
    return false;
  }
  uint64_t debug_info_end = debug_info.sh_offset + debug_info.sh_size;

  return GetCompileUnitName(fd, debug_info.sh_offset + cu_offset,
                            debug_info_end, pc, base_address, debug_line_offset,
                            cu_name_offset);
}

// Takes the information from `info` and renders the data located in the
// object file `fd` into `out`.  The format looks like:
//
//   [../path/to/foo.cc:10:40]
//
// which would indicate line 10 column 40 in  ../path/to/foo.cc
void SerializeLineNumberInfoToString(int fd,
                                     const LineNumberInfo& info,
                                     char* out,
                                     size_t out_size) {
  size_t out_pos = 0;
  if (info.module_filename_offset) {
    BufferedDwarfReader reader(fd, info.module_dir_offset);
    if (info.module_dir_offset != 0) {
      out_pos +=
          reader.ReadCString(kMaxOffset, out + out_pos, out_size - out_pos);
      out[out_pos - 1] = '/';
    }

    reader.set_position(info.module_filename_offset);
    out_pos +=
        reader.ReadCString(kMaxOffset, out + out_pos, out_size - out_pos);
  } else {
    out[out_pos++] = '\0';
  }

  out[out_pos - 1] = ':';
  char* tmp = internal::itoa_r(static_cast<intptr_t>(info.line), out + out_pos,
                               out_size - out_pos, 10, 0);
  out_pos += strlen(tmp) + 1;
  out[out_pos - 1] = ':';
  tmp = internal::itoa_r(static_cast<intptr_t>(info.column), out + out_pos,
                         out_size - out_pos, 10, 0);
  out_pos += strlen(tmp) + 1;
}

// Reads the Line Number info for a compile unit.
bool GetLineNumberInfoFromObject(int fd,
                                 uint64_t pc,
                                 uint64_t cu_offset,
                                 uint64_t base_address,
                                 char* out,
                                 size_t out_size) {
  uint64_t cu_name_offset;
  uint64_t debug_line_offset;
  if (!ReadCompileUnit(fd, pc, cu_offset, base_address, &debug_line_offset,
                       &cu_name_offset)) {
    return false;
  }

  ElfW(Shdr) debug_line;
  constexpr static char kDebugLineSectionName[] = ".debug_line";
  if (!google::GetSectionHeaderByName(fd, kDebugLineSectionName,
                                      sizeof(kDebugLineSectionName),
                                      &debug_line)) {
    return false;
  }

  LineNumberInfo info;
  info.pc = pc;
  uint64_t line_info_program_offset = debug_line.sh_offset + debug_line_offset;
  GetLineNumbersInProgram(fd, &info, base_address, line_info_program_offset,
                          cu_name_offset);

  if (info.line == 0) {
    // No matching line number or filename found.
    return false;
  }

  SerializeLineNumberInfoToString(fd, info, out, out_size);

  return true;
}

struct FrameInfo {
  uint64_t* cu_offset;
  uintptr_t pc;
};

// Returns the number of frames still missing info.
//
// The aranges table is a mapping of ranges to compilation units. Given an array
// of `frame_info`, this finds the compile units for each of the frames doing
// only one pass over the table. It does not preserve the order of `frame_info`.
//
// The main benefit of this function is preserving the single pass through the
// table which is important for performance.
size_t ProcessFlatArangeSet(BufferedDwarfReader* reader,
                            uint64_t next_set,
                            uint8_t address_size,
                            uint64_t base_address,
                            uint64_t cu_offset,
                            FrameInfo* frame_info,
                            size_t num_frames) {
  size_t unsorted_start = 0;
  while (unsorted_start < num_frames && reader->position() < next_set) {
    uint64_t start;
    uint64_t length;
    if (!reader->ReadAddress(address_size, start)) {
      break;
    }
    if (!reader->ReadAddress(address_size, length)) {
      break;
    }
    uint64_t end = start + length;
    for (size_t i = unsorted_start; i < num_frames; ++i) {
      uint64_t module_relative_pc = frame_info[i].pc - base_address;
      if (start <= module_relative_pc && module_relative_pc < end) {
        *frame_info[i].cu_offset = cu_offset;
        if (i != unsorted_start) {
          // Move to sorted section.
          std::swap(frame_info[i], frame_info[unsorted_start]);
        }
        unsorted_start++;
      }
    }
  }

  return unsorted_start;
}

// This is a pre-step that uses the .debug_aranges table to find all the compile
// units for a given set of frames. This allows code to avoid iterating over
// all compile units at a later step in the symbolization process.
void PopulateCompileUnitOffsets(int fd,
                                FrameInfo* frame_info,
                                size_t num_frames,
                                uint64_t base_address) {
  ElfW(Shdr) debug_aranges;
  constexpr static char kDebugArangesSectionName[] = ".debug_aranges";
  if (!google::GetSectionHeaderByName(fd, kDebugArangesSectionName,
                                      sizeof(kDebugArangesSectionName),
                                      &debug_aranges)) {
    return;
  }
  uint64_t debug_aranges_end = debug_aranges.sh_offset + debug_aranges.sh_size;
  uint64_t next_arange_set = kMaxOffset;
  size_t unsorted_start = 0;
  for (BufferedDwarfReader reader(fd, debug_aranges.sh_offset);
       unsorted_start < num_frames && reader.position() < debug_aranges_end;
       reader.set_position(next_arange_set)) {
    bool is_64bit;
    uint64_t length;
    uint16_t arange_version;
    uint64_t debug_info_offset;
    uint8_t address_size;
    if (!reader.ReadCommonHeader(is_64bit, length, arange_version,
                                 debug_info_offset, address_size,
                                 next_arange_set)) {
      return;
    }

    uint8_t segment_size;
    if (!reader.ReadInt8(segment_size)) {
      return;
    }

    if (segment_size != 0) {
      // Only flat namespaces are supported.
      return;
    }

    // The tuple list is aligned, to a multiple of the tuple-size after the
    // section sstart. Because this code only supports flat address spaces, this
    // means 2*address_size.
    while (((reader.position() - debug_aranges.sh_offset) %
            (2 * address_size)) != 0) {
      uint8_t dummy;
      if (!reader.ReadInt8(dummy)) {
        return;
      }
    }
    unsorted_start += ProcessFlatArangeSet(
        &reader, next_arange_set, address_size, base_address, debug_info_offset,
        &frame_info[unsorted_start], num_frames - unsorted_start);
  }
}

}  // namespace

bool GetDwarfSourceLineNumber(void* pc,
                              uintptr_t cu_offset,
                              char* out,
                              size_t out_size) {
  uint64_t pc0 = reinterpret_cast<uint64_t>(pc);
  uint64_t object_start_address = 0;
  uint64_t object_base_address = 0;

  google::FileDescriptor object_fd(google::FileDescriptor(
      google::OpenObjectFileContainingPcAndGetStartAddress(
          pc0, object_start_address, object_base_address, nullptr, 0)));

  if (!object_fd.get()) {
    return false;
  }

  if (!GetLineNumberInfoFromObject(object_fd.get(), pc0, cu_offset,
                                   object_base_address, out, out_size)) {
    return false;
  }

  return true;
}

void GetDwarfCompileUnitOffsets(void* const* trace,
                                uint64_t* cu_offsets,
                                size_t num_frames) {
  // Ensure `cu_offsets` always has a known state.
  memset(cu_offsets, 0, sizeof(uint64_t) * num_frames);

  FrameInfo* frame_info =
      static_cast<FrameInfo*>(alloca(sizeof(FrameInfo) * num_frames));
  for (size_t i = 0; i < num_frames; i++) {
    // The `cu_offset` also encodes the original sort order.
    frame_info[i].cu_offset = &cu_offsets[i];
    frame_info[i].pc = reinterpret_cast<uintptr_t>(trace[i]);
  }
  auto pc_comparator = [](const FrameInfo& lhs, const FrameInfo& rhs) {
    return lhs.pc < rhs.pc;
  };

  // Use heapsort to avoid recursion in a signal handler.
  std::make_heap(&frame_info[0], &frame_info[num_frames - 1], pc_comparator);
  std::sort_heap(&frame_info[0], &frame_info[num_frames - 1], pc_comparator);

  // Walk the frame_info one compilation unit at a time.
  for (size_t cur_frame = 0; cur_frame < num_frames; ++cur_frame) {
    uint64_t object_start_address = 0;
    uint64_t object_base_address = 0;
    google::FileDescriptor object_fd(google::FileDescriptor(
        google::OpenObjectFileContainingPcAndGetStartAddress(
            frame_info[cur_frame].pc, object_start_address, object_base_address,
            nullptr, 0)));

    // TODO(https://crbug.com/1335630): Consider exposing the end address so a
    // range of frames can be bulk-populated. This was originally implemented,
    // but line number symbolization is currently broken by default (and also
    // broken in sandboxed processes). The various issues will be addressed
    // incrementally in follow-up patches, and the optimization here restored if
    // needed.

    PopulateCompileUnitOffsets(object_fd.get(), &frame_info[cur_frame], 1,
                               object_base_address);
  }
}

}  // namespace debug
}  // namespace base

#else  // USE_SYMBOLIZE

#include <cstring>

namespace base {
namespace debug {

bool GetDwarfSourceLineNumber(void* pc,
                              uintptr_t cu_offset,
                              char* out,
                              size_t out_size) {
  return false;
}

void GetDwarfCompileUnitOffsets(void* const* trace,
                                uint64_t* cu_offsets,
                                size_t num_frames) {
  // Provide defined values even in the stub.
  memset(cu_offsets, 0, sizeof(cu_offsets) * num_frames);
}

}  // namespace debug
}  // namespace base

#endif

redpajama_set_name: RedPajamaGithub


text:
NCAA: Fate of Season 95 up to Policy Board -- Cayco
Camille B. Naredo, ABS-CBN News
Posted at Mar 15 2020 02:39 PM
MANILA -- The decision to cancel the rest of the NCAA's 95th season is squarely in the hands of the Policy Board, says NCAA Management Committee Chairman Peter Cayco of Arellano University.
The Management Committee last week had announced that it is suspending all events until further notice, as a precautionary measure against the novel coronavirus (COVID-19) outbreak in the country.
However, the outright cancellation of the rest of the season is not in their hands.
"We proposed to the Policy Board to cancel na the rest of the season," Cayco said in an interview on DZMM's "Fast Break" on Saturday afternoon.
"We're still awaiting approval," he added. "In the meantime, we were overtaken by the declaration of the lockdown."
READ: UAAP working on alternative formats for collegiate events
Malacañang on Saturday released "stringent social distancing guidelines," which came after President Rodrigo Duterte announced on Thursday night that Metro Manila will be placed under "community quarantine." Among the crucial points of the guidelines is that mass gatherings -- including sporting events -- are strictly prohibited.
The community quarantine is from March 15 to April 14.
"We still have enough time to contemplate what to do," said Cayco. "But for us in the management committee, we have decided to recommend for a cancellation of the rest of the season, because it will eat up into Season 96."
The NCAA Policy Board, composed of the leaders of the universities and colleges, has yet to announce its decision regarding the Management Committee's recommendation.
As it stands, among the NCAA events that are on-going or yet to start are volleyball, beach volleyball, football, and athletics.
As of Saturday night, the Department of Health has declared 111 cases of COVID-19 in the Philippines, with eight deaths.
(For more sports coverage, visit the ABS-CBN Sports website).
NCAA, NCAA Season 95, Peter Cayco, coronavirus, COVID-19, COVID-19 sports
Read More: NCAA NCAA Season 95 Peter Cayco coronavirus COVID-19 COVID-19 sports

redpajama_set_name: RedPajamaCommonCrawl


We know our clients value long-term partnerships with their supply chain, and for us, understanding their goals and challenges is key to ensuring they get the right products at the right time. We do this by focusing on the person, not the product, and finding solutions unique to them.
From same day delivery to bespoke branding services, and site audits to product demonstrations; take a look at our brochure to find out more about the services we offer in order to deliver safety products, site welfare and site equipment to construction sites.


text:
package pl.chormon.ultimatelib.utils;

import java.util.Iterator;
import java.util.List;

/**
 *
 * @author Chormon
 */
public class StringUtils {

    public static String implode (List strings, String separator) {
        StringBuilder sb = new StringBuilder();
        Iterator ite = strings.iterator();
        while(ite.hasNext()) {
            sb.append(ite.next().toString());
            if(ite.hasNext())
                sb.append(separator);
        }
        return sb.toString();
    }

    public static boolean containsIgnoreCase(List<String> strings, String str) {
        for(String string : strings) {
            if(string.equalsIgnoreCase(str)) {
                return true;
            }
        }
        return false;
    }

    public static String milisecondsToTime(int miliseconds) {
        String sec = "";
        if(miliseconds / 1000 > 0) sec = secondsToTime(miliseconds/1000);
        miliseconds %= 1000;

        StringBuilder sb = new StringBuilder();
        if(!sec.equals("")) sb.append(sec);
        if(miliseconds > 0) sb.append(miliseconds).append(" milisekund");
        return sb.toString();
    }

    public static String secondsToTime(int seconds) {
        if(seconds == 0) {
            return "0 sekund";
        }
        int minutes = seconds / 60;
        seconds %= 60;
        int hours = minutes / 60;
        minutes %= 60;
        int days = hours / 24;
        hours %= 24;
        StringBuilder sb = new StringBuilder();
        if(days > 0) sb.append(days).append(" dni ");
        if(hours > 0) sb.append(hours).append(" godzin ");
        if(minutes > 0) sb.append(minutes).append(" minut ");
        if(seconds > 0) sb.append(seconds).append(" sekund");
        return sb.toString();
    }

}


Buy Used 2004 Chrysler Sebring - SK Automarket Sales Ltd.
Trim: YOU WORK/YOU DRIVE! FINANCING FOR EVERYONE!
NICE CHRYSLER SEBRING IN GREAT SHAPE. FULL POWER GROUP. THROUGH THE SHOP, FULLY INSPECTED AND READY TO GO. FRESH OIL AND TONS OF BRAKE AND TIRE LIFE LEFT.


text:
Skip to content. Skip to more web exclusives. Skip to most popular. Skip to footer.
Telling the Forgotten Stories of American Education
Published Oct 31, 2012 8:00 AM
Mike Rose merges scholarship and storytelling to focus on the less-visible learners and the promise of second chances.
When your writing is compared to Walt Whitman, and your new book features endorsements by President Bill Clinton and "Dirty Jobs" executive producer Mike Rowe, you are more than an academic—you're an American original and a potent storyteller. Not surprisingly, Mike Rose M.A. '70, Ph.D. '81, acclaimed professor of education at the UCLA Graduate School of Education & Information Studies (GSE&IS) and author of Possible Lives and The Mind at Work, among others, is also a powerful public speaker.
Rose's singular take on teaching and learning focuses on the forgotten stories of American education: the blue-collar learners, the vocational school students, the kids struggling in mainstream academic settings, and the misguided and exclusionary conventional definitions of what is and isn't intelligence. And his writing merges world-class scholarship with detail-rich storytelling.
Both were on display at UCLA's Moore Hall recently, as Rose gave a reading of his newest book, Back to School: Why Everyone Deserves a Second Chance at Education, the kick-off event in GSE&IS' new Speaking of Education Lectures series. As was Rose's gentle sense of humor when he noted that "this speech is 42 minutes long. So at 21 minutes, you know you're on your way home."
The readings were linked by Rose's narrative thread of reflections on writing. He said "to write about education is to write about the human condition." And the passages from Back to School focused on a recurrent theme in his work, the promise of second chances in America, and the ability to reinvent ourselves, to better our condition, which Rose contends is "when we are at our best as a society."
For more on Mike Rose:
Working-Class Hero: Mike Rose
Rose diverged a bit by reading a passage from his bestselling Possible Lives, about his travels throughout the country to visit schools that work. The passage, about a first-grade classroom in Baltimore, displayed his flair for telling detail as he described the school: the "harshly sweet smell of disinfectant in the cafeteria" and the "squeak of stairs."
Detail was also evident as Rose read on from Back to School, describing his arrival on a Los Angeles community school campus "an hour after sunrise": an urban landscape populated by "a homeless man with a handwritten sign that reads 'Vietnam Vet'" amidst a "used car lot" and "boarded- up building." He watches as students coming "to or from work" stroll across the campus and wonders (he read) "what it is that pulls these students forward. The desire that gets them through the door."
"The hope and desire," Rose read, "are almost palpable."
Rose concluded the event with a passionate defense of these kinds of opportunities for people to experience a "vocationally oriented explosion of mind."
Learn more about Mike Rose and his work at http://mikerosebooks.blogspot.com/.
MORE WEB EXCLUSIVES
Hammer's American Cinematic Icon
The Power of Positive Change
UCLA Beach Volleyball Wins Second-Straight NCAA Title
Hearing the Past
More Exclusives »


text:
Collections of essays
Ahmet Altan
Turkish journalist and author (born 1950)
Ahmet Hüsrev Altan
(1950-03-02) March 2, 1950 (age 71)
Ankara, Turkey
Robert College
Ankara College
Editor-in-chief and lead columnist of Taraf (2007–2012)
Parent(s)
Çetin Altan (father)
Mehmet Altan (brother)
http://www.taraf.com.tr/ahmet-altan/
Ahmet Hüsrev Altan (born 2 March 1950) is a Turkish journalist and author. A working journalist for more than twenty years, he has served in all stages of the profession, from being a night shift reporter to editor in chief in various newspapers.
He was born 1950 in Ankara, Turkey to the notable journalist and writer Çetin Altan as the first of two sons. His brother Mehmet Altan is also a journalist, writer and university professor of political economy.
In addition to having written columns in several Turkish newspapers, including Hürriyet, Milliyet and Radikal, Altan has produced news programming for television.
He was fired from Milliyet after writing a column on 17 April 1995 titled "Atakürt", which presented an alternate history of Turkey as a Kurdish state ("Kürdiye") in which ethnic Turks are oppressed and forced to assimilate.[1][2]
In 2007 he became the founding editor-in-chief and lead columnist of Taraf, a daily Turkish newspaper, and remained in the position until his resignation in December 2012.
In September 2008, when Altan published an article titled "Oh, My Brother" dedicated to the victims of the Armenian genocide he was charged under Article 301 of the Turkish Penal Code for "denigrating Turkishness". The judicial claim was initiated by the far-right "Great Union Party."[3][4]
Altan, along with some of his Taraf associates, usually carried a firearm for self-protection.[5]
As the editor of Taraf, Altan was accused of working to silence allegations of the Gülen movement cheating in compulsory public servants' examinations in Turkey to further their power in the state.[6]
On December 14, 2012, Ahmet Altan resigned his post as editor-in-chief of Taraf. With him stepped down his assistant editor Yasemin Çongar, and Neşe Tüzel. The next day, the three departing journalists were joined by columnist Hadi Uluengin.[7]
Yasemin Çongar accepts the Geschwister Scholl Prize for Ahmet Altan.
During Turkey's media purge after the failed July 2016 coup d'état on September 23, 2016, Altan, was arrested. He is accused of sending "subliminal messages" to encourage 2016 Turkish coup d'état attempt planners.[8]
In September 2017, while banned from written communications, Altan produced an essay The Writer's Paradox in which he says: 'I am writing these words from a prison cell ... But wait. Before you start playing the drums of mercy for me listen to what I will tell you ... They may have the power to imprison me but no one has the power to keep me in prison. I am a writer.' The essay was published on 18 September 2017, on the eve of Altan's trial: in English by The Society of Authors (translated by Yasemin Çongar) and in the original Turkish by English PEN.[9][10][11]
As the trial began, many authors spoke out in support of Altan. Neil Gaiman said "I hope that everyone who can read, whatever their politics, reads Ahmet Altan's response to his imprisonment. Repressive regimes hope that if they lock up writers they are also locking up ideas. This will always fail." Joanne Harris said "Writers exist to question, to challenge, sometimes even to ridicule - the status quo. For a government to imprison a writer for doing this is to attack, not only freedom of speech, but freedom of the imagination. It is a backward, oppressive and ultimately futile gesture that can only lead to greater and more damaging social unrest."[12]
On 16 February 2018, Ahmet, along with his brother Mehmet Altan, was sentenced to life imprisonment.[13] From prison, he wrote notes he gave to his lawyers,[14] and published his memoirs under the title I Will Never See the World Again,[15] translated into English by Yasemin Çongar. The book was longlisted for the 2019 Baillie Gifford Prize for non-fiction [16] and is published in 17 countries around the world.[17] But it is not published in Turkish as Altan has concern about the safety of the publisher.[17]
On 4 November 2019 Altan was sentenced to 10 years and 6 months imprisonment by the court of cassation, but then the court ordered his release on probation.[18] On 12 November 2019 the police detained him again after a ruling reversing his release.[19]
On the 25 of November 2019, Altan was awarded the Geschwister Scholl Prize, a literary award of the Bavarian branch of the German Publishers and Booksellers Association.[20]
Altan was released from prison on 14 April 2021 after order by the Court of Cassation.[21]
1983, Akademi Bookstore Literature Awards, First Prize in the category of "Novel"[22]
1998, Yunus Nadi Literature Prize in the category of ''Novel''
2011, International Hrant Dink Award
2013, Turkish Publishers Association, Freedom of Thought and Expression Prize
2017, Istanbul Human Rights Association Ayşe Nur Zarakolu Freedom of Thought and Expression Prize
2019, Geschwister Scholl Preis[23]
I will never see the world again, (Other Press, 2019), translated by Yasemin Çongar[24]
Kılıç Yarası Gibi (1997, Can Yayınları), the first novel in the Ottoman Quartet. Published in English in a translation by Brendan Freely and Yelda Türedi as Like a Sword Wound (2018, Europa Editions)[25]
Dört Mevsim Sonbahar (Four Seasons of Autumn)
Yalnızlığın Özel Tarihi (A Private History of Loneliness)
Sudaki İz (Trace on the Water)
Aldatmak (Cheating)
İsyan Günlerinde Aşk (1998, Can Yayınları), the second novel in the Ottoman Quartet. Published in English in a translation by Brendan Freely and Yelda Türedi as Love in the Days of Rebellion (2020, Europa Editions)[26]
En Uzun Gece (The Longest Night)
Tehlikeli Masallar (Dangerous Tales)
Son Oyun (2013, Everest publications), translated into English by Alexander Dawe and published as Endgame in 2016
Ölmek Kolaydır Sevmekten (2015, Everest Yayinlari), the third novel in the Ottoman Quartet.[27]
Gece Yarısı Şarkıları (Midnight Songs)
İçimizde Bir Yer (Somewhere Inside Us)
Karanlıkta Sabah Kuşları (Morning Birds in Darkness)
Kristal Denizaltı (Crystal Submarine)
Ve Kırar Göğsüne Bastırırken (And He Breaks While Holding Down To His Chest)
^ Altan, Ahmet (1995-04-17). "Atakurd". Milliyet. Archived from the original on 2016-10-21. Retrieved 2009-01-02.
^ Hurriyet Daily News, 8 April 2013, Famous writer Ahmet Altan back with new book
^ A trial against the journalist who wrote about the Genocide Archived 2012-02-13 at the Wayback Machine, Azg daily, Sept. 2008.
^ Onderoglu, Erol (12 September 2008). "Writer And Journalist Ahmet Altan Charged With Insulting Turkish Nation". Bianet. Archived from the original on 13 September 2008. Retrieved 17 September 2008.
^ Hansen, Suzy (2009-01-02). "Eye of the storm". The National Newspaper. Abu Dhabi Media Company. Archived from the original on 2009-02-27. Retrieved 2009-01-02. Ahmet carries a gun. But he always carried a gun. Alev carries a gun. These guys like guns, it's not like they have to carry guns. But it also shows me that they feel more secure having a gun. They don't want a bodyguard after them all the time.
^ "Ahmet Altan Taraf'ın o manşetini savundu: Bu şifre palavra!". Medyafaresi.com. April 6, 2011. Archived from the original on May 13, 2019. Retrieved May 13, 2019.
^ "Taraf'ta istifa depremi". Hürriyet Gündem (in Turkish). 2012-12-15. Retrieved 2012-12-15.
^ "Ahmet Altan tutuklandı". NTV. 2016-09-23. Retrieved 2019-09-16.
^ On eve of trial, Ahmet Altan writes how imagination sustains him in Turkish jail, The Guardian, Alison Flood, 18 September 2017
^ "The Writer's Paradox | The Society of Authors". www.societyofauthors.org. Archived from the original on 2019-12-15. Retrieved 2019-09-17.
^ "Call for messages of support for Ahmet Altan | The Society of Authors". www.societyofauthors.org. Archived from the original on 2019-12-15. Retrieved 2019-09-17.
^ Shaheen, Kareem (2018-02-16). "Turkey sentences journalists to life in jail over coup attempt". The Guardian. ISSN 0261-3077. Retrieved 2019-01-18.
^ "I Will Never See the World Again by Ahmet Altan review – writing behind bars | Books | The Guardian".
^ "I Will Never See the World Again". Archived from the original on 2019-12-11. Retrieved 2019-09-17 – via www.otherpress.com.
^ Flood, Alison (2019-09-12). "Turkish author jailed for life nominated for £50,000 book award". The Guardian. ISSN 0261-3077. Retrieved 2019-11-30.
^ a b "Imprisoned Turkish journalist writes memoir on bits of paper and has it smuggled out | CBC Radio". CBC. Retrieved 2021-02-12.
^ "Verdict of Release for Ahmet Altan and Nazlı Ilıcak, Acquittal for Mehmet Altan". Binet. 4 November 2019. Retrieved 4 November 2019. [permanent dead link]
^ "Turkish Journalist Ahmet Altan detained days after release". Ahval. Archived from the original on 2019-12-10. Retrieved 2019-11-12.
^ "Geschwister-Scholl-Preis für Ahmet Altan | DW | 25.11.2019". DW.COM (in German). Retrieved 2019-11-26.
^ "Turkey releases writer Ahmet Altan after more than four years in prison". The Guardian. 14 April 2021. Retrieved 15 April 2021.
^ "Ahmet Altan - Official Site". Archived from the original on 2019-10-02. Retrieved 2019-10-02.
^ "Ahmet Altan: Inhaftierter türkischer Journalist bekommt Geschwister-Scholl-Preis" (in German). ISSN 0174-4909. Retrieved 2019-10-02.
^ 21 Books to Curl Up With This Fall , Newsweek
^ Altan, Ahmet. "Like a Sword Wound". www.europaeditions.com. Europa Editions. Retrieved 28 December 2020.
^ Altan, Ahmet. "Love in the Days of Rebellion". www.europaeditions.com. Europa Editions. Retrieved 28 December 2020.
^ Altan, Ahmet. "Ölmek Kolaydır Sevmekten". www.everestyayinlari.com. Everest Publications. Retrieved 28 December 2020.
Ahmet Altan'ın Eserlerinden örnekler, denemeleri, günlük fıkraları
Ahmet ALTAN Hakkında yazılan Polis Akademisi Bitirme Tezi
Gazetem Net'teki köşe yazıları
Hürriyet Gazetesindeki Köşe Yazıları
Biography of Ahmet Altan (in Turkish)
Aşık Mahzuni Şerif
Âşık Veysel Şatıroğlu
Dadaloğlu
Erzurumlu Emrah
Gevheri
Hacı Bektaş-ı Veli
Karacaoğlan
Kaygusuz Abdal
Nasreddin
Neşet Ertaş
Pir Sultan Abdal
Seyrani
Medieval and
Sultan Veled
Imadaddin Nasimi
Fuzûlî
Bâkî
Mihri Hatun
Sehi Bey
İsa Necati
Tâcîzâde Cafer Çelebi
Prizrenli Suzi Çelebi
Mesihi
Yahya bey Dukagjini
Nef'i
Nedîm
Şeyh Gâlib
Evliya Çelebi
Katib Çelebi
Khayālī Mehmed Bey
Ahdi of Baghdad
Latifî
Riyazi
Yirmisekiz Mehmed Çelebi
Fitnat Hanım
Ali Çelebi
Aşık Çelebi
Kınalızâde Hasan Çelebi
Ziya Pasha
Şemsettin Sami
Zafer Hanım
Ahmed Midhat Efendi
Tevfik Fikret
Cenâb Şehâbeddîn
Ömer Seyfettin
Mehmet Emin Yurdakul
Ali Canip Yöntem
Habib Esfahani
Muallim Naci
Fatma Aliye Topuz
Marjumak Ahmad
Republican era
Mehmet Fuat Köprülü
Cevat Şakir Kabaağaçlı
Ercüment Ekrem Talu
Nurullah Ataç
Peyami Safa
Murathan Mungan
Orhan Hançerlioğlu
Samim Kocagöz
Semiha Ayverdi
Tarık Buğra
Fakir Baykurt
Bilge Karasu
Tomris Uyar
Memduh Şevket Esendal
Kenan Hulusi Koray
Kemal Tahir
Haldun Taner
Nezihe Araz
Suut Kemal Yetkin
Cemil Meriç
Ruşen Eşref Ünaydın
Behçet Necatigil
Necati Cumalı
Ayfer Tunç
Ahmet Kutsi Tecer
Şevket Süreyya Aydemir
Nihâl Atsız
Orhan Şaik Gökyay
Orhan Veli Kanık
Oktay Rıfat Horozcu
Melih Cevdet Anday
Rıfat Ilgaz
Cemal Süreya
İlhan Berk
Edip Cansever
Ece Ayhan Çağlar
Sezai Karakoç
Tevfik Akdağ
Neyzen Tevfik
Yahya Kemal Beyatlı
Abdülhak Şinasi Hisar
Orhan Seyfi Orhon
Enis Behiç Koryürek
Halit Fahri Ozansoy
Yusuf Ziya Ortaç
Muammer Lütfi Bakşi
Necip Fazıl Kısakürek
Vasfi Mahir Kocayürek
Sabri Esat Siyavuşgil
Yaşar Nabi Nayır
Ahmet Muhip Dıranas
Ziya Osman Saba
Faik Baysal
Salah Birsel
Özdemir Asaf
N. Abbas Sayar
Can Yücel
Attilâ İlhan
Güven Turan
İsmet Özel
Cem Uzungüneş
Mehmet Altun
Mehmet Erte
Küçük İskender
Faruk Nafiz Çamlıbel
Fazıl Hüsnü Dağlarca
Yusuf Atılgan
Yılmaz Onay
Nihal Yeğinobalı
Turkey portal


text:
B'Day Anthology Video Album
B'Day Anthology Video Album is a video album, released by the American R&B singer-songwriter Beyoncé. It was released alongside B'Day Deluxe Edition on April 3, 2007.
1. "Beautiful Liar" (duet with Shakira) Jake Nava & Beyoncé 3:34
2. "Irreplaceable" Anthony Mandler 4:17
3. "Kitty Kat" (Intro) Melina Matsoukas & Beyoncé 1:03
4. "Green Light" Melina Matsoukas 3:31
5. "Upgrade U" (featuring Jay-Z) Melina Matsoukas & Beyoncé 4:38
6. "Flaws & All" Cliff Watts & Beyoncé 4:14
7. "Get Me Bodied" (Extended Mix) Anthony Mandler & Beyoncé 6:42
8. "Freakum Dress" Ray Kay & Beyoncé 3:21
9. "Suga Mama" Melina Matsoukas & Beyoncé 3:37
10. "Déjà vu" (featuring Jay-Z) Sophie Muller 4:06
11. "Ring the Alarm" Sophie Muller 3:33
12. "Listen" (Director's cut) Diane Martel 3:49
13. Credits N/A 0:51
Anthology Behind the Scenes/Credits Ed Burke 17:39
Dangerously in Love
B'Day
I Am... Sasha Fierce
Live albums and EPs
True Star: A Private Performance
Speak My Mind
Exclusive Bonus CD Sampler
Beyoncé The Ultimate Performer
Green Light: Freemasons EP
Irreemplazable
The Beyoncé Experience: Live
Beyoncé Karaoke Hits Vol. I
"Crazy in Love"
"What's It Gonna Be"
"Baby Boy"
"Me, Myself and I"
"Naughty Girl"
"Check on It"
"Déjà Vu"
"One Night Only"
"Ring the Alarm"
"Irreplaceable"
"Upgrade U"
"Listen"
"Beautiful Liar"
"Suga Mama"
"Get Me Bodied"
"Green Light"
"If I Were a Boy"
"Single Ladies (Put a Ring on It)"
"Halo"
"Ego"
"Sweet Dreams"
"Broken-Hearted Girl"
"Video Phone"
"Run the World (Girls)"
"Best Thing I Never Had"
"Countdown"
"Love on Top"
"End of Time"
"XO"
"Drunk in Love"
"Partition"
"Pretty Hurts"
"Flawless"
"7/11"
"Ring Off"
"Formation"
"Sorry"
"Hold Up"
"Sandcastles"
"Pray You Catch Me"
"All Night"
"Hollywood"
"Amor Gitano"
"Until the End of Time"
"Love in This Club Part II"
"Just Stand Up!"
"Telephone"
"Hymn for the Weekend"
"Runnin' (Lose It All)"
"Mi Gente (Remix)"
"Fighting Temptation"
"Summertime"
"Die with You"
Carmen: A Hip Hopera
Austin Powers in Goldmember
Cadillac Records
Pepsi Music 2004: Britney Exclusive
Retrieved from "https://wiki.kidzsearch.com/w/index.php?title=B%27Day_Anthology_Video_Album&oldid=4866100"
Beyoncé albums
This page was last changed on 14 August 2014, at 16:58.


The much-loved Australian brown paste will soon release a new range with Coeliac Australia's tick of approval.
Originally made with yeast extract and malt extract derived from barley (full of gluten), the brand has now found a gluten-free alternative to add to the concoction.
On Instagram, Vegemite boasted the new range will have "the same great taste", while being both gluten-free and FODMAP-friendly.
They haven't announced an exact hit-the-shelf date but they've promised it's"coming soon to a store near you".
Your morning menu can now offer a fully-gf Vegemite on toast. Get ready for the folate hit.


text:
Le barrage d'Argentat, également appelé barrage du Sablier, est un barrage français situé sur la Dordogne, deux kilomètres en amont de la ville d'Argentat, sur la commune d'Argentat-sur-Dordogne, dans le département de la Corrèze.

Généralités
Le barrage d'Argentat, construit entre 1954 et 1957, est utilisé pour produire de l'énergie à l'aide d'une centrale hydroélectrique.

Cet ouvrage de type « piles-usines » est formé de cinq piles creuses dont trois sont équipées d'un groupe hydro-électrique. Construit sous la direction d'André Borie, il est en béton et ses fondations s'enfoncent dans le granite. En ce lieu, le bassin versant de la Dordogne est de .

Sa retenue, longue d'environ huit kilomètres, commence juste en aval du barrage du Chastang. Établie à une altitude de , elle s'étend sur  et représente un volume de 7,2 millions de m. Elle reçoit également les eaux du Doustre et de la Glane. Outre la commune d'Argentat-sur-Dordogne, elle est bordée par celles de Saint-Martial-Entraygues et Saint-Martin-la-Méanne en rive droite, de Hautefage en rive gauche, et de Servières-le-Château sur les deux rives.

Dimensions
Le barrage d'Argentat est de dimensions modestes par rapport à celui du Chastang, 50 % plus long et dernier barrage majeur sur la Dordogne.

 Hauteur sur terrain naturel :
 Hauteur sur fondations :
 Longueur de crête :
 Largeur de la crête :
 Largeur à la base :
 Volume du barrage :

Galerie de photos

Notes et références

Annexes

Articles connexes
 Gorges de la Dordogne
 Hydroélectricité en France

Liens externes
 Intervention technique sur le barrage en août 2013

Massif central
Argentat
Argentat
Argentat
Barrage Argentat

redpajama_set_name: RedPajamaWikipedia


Most organizations are normally concerned with how the company will gain profit or attain a high level of performance by motivating the staff through the right kind of incentives. This is so because the effect or impacts of non-financial incentives are important for the employees and a critical issue in human resource management. The non-financial incentives are also called material rewards CITATION Nec081 \l 1033 (Neckermann, 2008). Due to the increase in global competition and a fast growing and changing business environment, organizations are concerned about how they work, frequent re-evaluation. Literature and studies on human resource management have always and continue to emphasize the importance of motivational programs including rewards and recognition, towards molding a productive workforce, competitiveness, and employee loyalty. There are many factors that affect employee performance like working conditions, worker and employer relationship, training and development opportunities, job security, and company's overall policies and procedures for rewarding employees. Among all those factors which affect employee performance, motivation that comes with incentives is of utmost importance. Improved performance is achieved through the employees in an organization CITATION Arm092 \l 1033 (Armstrong M. , 2009) and therefore, in the school context, teachers as employees are considered as an important asset for better performance. The effect of non-financial incentives has increased the efficiency level of employees, as some employees work better and feel comfortable when they are recognized by their top managers, it gives them a sense of belongings and it has been a major tool used by managers in retaining employees. Motivated employees work with enthusiastically and creatively towards accomplishment of the organization goals and objectives. The goals of the public sector are different from that of the private sector. In view of this, the public sector employees are to seek to maximize the social welfare of the people in the society. In other words, there should be a public service motivation so as to boost the morale of employees, creates a better relationship with their managers. When employees believe that they have the ability to participate in decisions, research suggests there will be a positive impact on the work environment CITATION Law081 \l 1033 (Lawler, 2008). Employee participation in decision making changes their perceptions and as a result leads to additional interactions with management and provides new opportunities for employees to develop trust in management. This means, the incentives directed towards the private sector employees will not apply to the public servants. However, even a high paying job can be overwhelming or downright awful if non-financial incentives are largely ignored. According to teachers' low wages is a matter of global concern. Around the world teachers are crying out for the resources they need to meet the needs of their students, their families and their communities. CITATION Mon081 \l 1033 (Mondy, 2008) claims that non-financial incentives can predict employee performance as the more challenging a goal is, the higher the performance level becomes and the higher the perceived satisfaction. CITATION Mon081 \l 1033 (Mondy, 2008) argues that an employee's performance is determined by the degree to which available non-financial incentives are attractive, so as efforts lead to higher levels of performance (first-level outcomes) which in turn, leads to second level outcomes (praise, friendship, wages). CITATION Arm092 \l 1033 (Armstrong M. , 2009) adds that creating a fun, challenging and empowered work environment in which individuals are able to use their abilities to do meaningful jobs for which they are shown appreciation is likely to be a more certain way to enhance motivation, commitment and performance.
There appears to be mounting concerns that unacceptably high proportions of teachers working in Ghana are poorly motivated due to combination of low morale and job satisfaction, poor incentives and inadequate controls and other behavioral sanctions. In any strategic study of an organization, work force is agreed to be one of the most important assets of an organization because the employees get every task done or executed. This implies that the success of an organization heavily depends on the performance or output of the employees in the organization. If the workforce is satisfied with their job as well as the organizational environment including its relationship with colleagues, compensation, and leadership they will be more committed to their organization as compared to when they are not satisfied. All organizations, whether public or private, need motivated employees to be effective and efficient in their functioning, in addition to the other factors. Employees who are motivated to work energetically and creatively toward the accomplishment of organizational goals are one of the most important inputs to organizational success. Consequently, the challenge for organizations is to ensure that their employees are highly motivated. Performance is said to be related with the concepts of motivation, opportunity and ability. Government or public workers especially teachers who are not given non-financial incentives tend to be de-motivated hence the provision of a lousy work. The Government of Ghana has not really carried out satisfactory surveys among the teachers although they are the most important resource in the organization. This is of great concern to a developing country since even in developed countries employees still work for long hours such as between eight hours to twelve hours a day. If the country is to develop, the employees in the public sector must be motivated to work for longer hours and prevent the high employee absenteeism, which is a product of de-motivation. According to U.S. department of Labour, 64% of Americans who leave their jobs say they do so because they don't feel appreciated. (Press, 2010) reports that almost 70% of people in the U.S say they receive no praise or recognition in the work place. (Mulwa, 2007) says that, although salary and benefits play a role in recruiting and retaining employees, people are looking for opportunities to learn new things/ the challenges for new responsibilities and the prospect of personal and professional growth through training.
There is hardly any study regarding to the use of non-financial incentives in the public sector organizations as compared to the private sector. For the past five years, minutes of PTA meetings of Dodowa government school at Dodowa, indicated that, employees of the school do not enjoy non-financial incentives, like recognition, training, good working conditions, just to mention but a few. Surprisingly, no event has been put in place for recognition as well as no avenue for training has been allocated for five years for the teachers in the school. This has killed the morale and making them feel unmotivated as other colleagues in different schools earn better. Hence, this study attempts to examine the relationship between non-financial incentives and its effect on organizational performance as teachers of Dodowa government school do not enjoy non-financial incentives as compared to other schools leading to de-motivation and teachers not putting in their maximum best when executing their task as teachers.
The objectives are grouped into two. They are the main and specific objectives.
The main objective of the study is to determine the effects of non-financial incentives on staff performance in the public school at the Shai Osudoku District.
To determine the current non-financial incentives practiced at the Dodowa government school in the Shai-Osudoku District to encourage higher employee performance.
To determine the extent to which employees are motivated through the non-financial incentives to perform high at the Dodowa government school in the Shai-Osudoku District.
To determine the effectiveness of non-financial incentives in improving employee performance at Dodowa government school in the Shai-Osudoku District.
What are the different forms of non-financial incentives in use at the Dodowa government school in the Shai-Osudoku district?
To what extent are employees motivated through non-financial incentives to perform higher at the Dodowa government school in the Shai-Osudoku district?
How effective is the non-financial incentive in improving employee performance at the Dodowa Government School in the Shai-Osudoku district?
The scope is based on geographical, time and content considerations. This study population is drawn from a sample number of a public school in the Shai-Osudoku district in Ghana. The study is restricted to non-financial incentives and teachers' performance. The study on non-financial incentives is restricted on three indicators of employee recognition, training and working conditions.
In view of the study objectives, findings of this study will have some practical relevance. The findings of the study will help the planners of Human Resource rewarding system on how to implement appropriate reward strategies within the organization to enhance work performance. Secondly, this study will help commercial teaching management to reflect more on the purpose and benefits of rewarding employees in line with work performance. Also, the findings of this research will add to the body of knowledge in the field of reward systems in the public sector, especially public schools on their suitability and adequacy of reward packages to be introduced to lift employees' performance. Reward systems should be designed in a way to provide the best ways or kinds of motivators according to the needs of the organization and its employees.
Reward management is known to be an area in Human Resource Management that deals with the strategies, policies and processes required to ensure the value of the employees and the contribution they make to achieve organizational and team goals and hence is recognized and awarded accordingly. Emphasis should be laid on the fact that reward management is not just about paying employees but equally concerned with non-financial incentives such as training, learning and development opportunities, good working conditions recognition and increased job responsibility.
This study is considered beneficial to head teachers by providing information on the factors that affect the performance of teachers in schools and help policy makers in general to assess the performance of head teachers for organizational ability and good management skills. Finally, the findings may be important to education training institutions when training head teachers in areas of educational administration, management and planning.
be applied in private schools. Also, the researcher did recommend for further study in that area. Limitations of the research design chosen are that it will be limited by finances and time duration to undertake this research. The study dealt with a small portion of non-financial because non-financial incentives were the most overlooked of all incentives hence worthwhile being explored on or studied.
The study is organized around five chapters. Chapter one is the general introduction to the study sub-divided into background of the study, statement of the problem, objectives of the study, research questions, limitations, scope of the study, significance and the organization of the study. Chapter two presents the literature review on the concepts and terminologies under consideration. It involves the review of the work of other researchers and authors. It deals with both theoretical and empirical literature. The third chapter deals with the method of study. It encompasses the variables of the study, the model specification and data sources. Chapter four discusses the estimation, analysis and interpretation of the results. Finally, chapter five outlines the summary of findings and conclusions of the study. Recommendations are also highlighted in this chapter.
The objective of this chapter is to review previous research on the impact of non-financial incentives on employee performance. The issues discussed include the theoretical foundations, the conceptual framework and the empirical literature reviewed.
2.1 In this chapter, a collection of interrelated concepts that will look at recent studies that have been carried out by others and other theories that seeks to have a direct relation with non-financial incentives.
2.1.1 The theories under the theory of non-financial incentives includes Maslow's hierarchy of needs, Hertzberg's two factor theory, Adams equity theory and Goal setting theory.
Many scholars have given their explanations and perceptions on how non-financial incentives can enable an organization achieve good staff performance. Prominent amongst these scholars is Maslow theory of Maslow's Hierarchy of needs. Human beings have an internal need pushing them towards self-actualization and personal superiority as stated by Maslow. Maslow came up with the view that there are five levels of needs, they include the basic needs (food shelter, and clothing), safety needs (health and safety of employees and family), social needs (good friendship, love and intimacy), self-esteem (valued by being recognized by others) and the top most level which is self-actualization (personal superiority). Once a need is satisfied at one stage of the hierarchy it influences the behavior of the individual. At such levels the individual will put forth a more powerful influence on his or her behavior for the need at the next level up the hierarchy. According to Maslow, physiological needs forms the basic needs for the survival of a person and this will include clothing, shelter, food, warmth and clothing. He argued that when people are hungry, do not have shelter or clothing, they are more motivated to fulfill this need because these needs become the major influence on their behavior. The hierarchical order implies that those needs in the higher levels (low prepotency) do not affect behavior towards work unless there is some degree of satisfaction of the lower needs (higher prepotency). This theory seems particularly relevant to teachers in developing countries because meeting the basic survival needs for food and shelter as well as security in conflict situations are major daily challenges for teachers. Maslow puts security needs on the second level and argues that they are the most essential for people at this level. This is expressed in the safety of the employee and family health. The third level of needs for Maslow is the social needs. When feeling secure and safe at work, employee's place job relations as their focus. Thus, they try to build up a good friendship, love and intimacy. The fourth level is self-esteem needs. At this level, individuals feel satisfied when they are recognized and valued by others. The topmost or last level of Maslow's hierarchy of needs is self-actualization. Intrinsic reward concerns with psychological development of employees (Williamson, Burnett & Bartol, 2009). This is because most teachers are empowered by certain elements, such as recognition and awarding them for the work they have done, in so doing they it will create a health competition between the teachers.
They say that money makes the world go around. However, this may not be true all the time, especially when you are talking about motivating your employees for a positive performance.
Based on Maslow's hierarchy of needs, wages are highly important and usually one of the common motivators. They satisfy the immediate necessities of men such as food, clothing, and shelter. But what is really essential are the needs found on the higher levels, and they are not associated with money CITATION Mic10 \l 1033 (Gabriel, 2010).
Satisfaction with a reward was found to be a function of how much is received and how much the individual feels should be received. If individuals receive less than they feel they should, they are dissatisfied. This study is concerned with the perception people have about how they are being treated compared to others. CITATION Arm06 \l 1033 (Armstrong, 2006) to be equitably dealt with is to be fairly treated in comparison with other group of people. The behavioral psychologist John S. Adams states in his theory that employees strive for equity between themselves and other workers. Equity is achieved when the ratio of employee outcomes over inputs is equal to other employee's outcomes over inputs. Equity involves feelings and participation and is always a comparative process. It is not synonymous with equality which means treating everyone the same since this would be inequitable if they deserve to be treated equitably and demotivated if they treated inequitably. Thus the feeling of satisfaction is influenced by comparisons with what happens to others. People tend to compare the efforts, skills, seniority and job performance with those of others. They then attempt to compare their inputs with the inputs of others relative to the rewards received.
Equity theory is relevant to teachers since employees (teachers) retention depends on levels of motivation in their workplace. Teachers quit teaching to look for other jobs that pay better and so there is need to provide incentives that are attractive to teacher with a view of motivating them to remain in the service. Working environment is a major challenge and teachers working in hardship zones characterized by water shortage, inadequate housing, long distances to and from workplace and inadequate health facilities are largely dissatisfied with their job.
Hertzberg's theory emphasizes mainly on the factors that satisfy or dissatisfy employees. In his theory which is the motivation-hygiene theory, he mentioned a number of key points that are similar to Maslow's hierarchy of needs. Hertzberg's two-factor theory divides motivation into two groups known as motivation factors and hygiene factors and the researcher provided a strong link between motivation and performance. The two-factor theory came about as a result of a five year research program on job attitudes initiated by a grant from the Buhl Foundation. During the first stage of the programme, Hertzberg and his colleagues conducted a comprehensive literature review of over 2000 writings published between 1900 and 1955. The literature yielded contradictory results and the research designs of the studies varied widely in quality and the methodologies based on their review in literature, they made core assumptions on which to base their hypothesis and research design. First, there was enough evidence to assume that there was some relationship between job attitudes and performance. Second, the characteristics of dissatisfied workers had been well-defined in the existing literature. Third the factors related to job attitudes had also been previously well-defined.
Herzberg suggested that certain extrinsic factors or hygiene, (those associated with the environment surrounding a job) only have the power to de-motivate while intrinsic factors (those associated with the job itself) have the power to energize or motivate behavior. According to Hertzberg, the motivating factors are the six job content factors that include; achievement, recognition, works itself, responsibility, advancement and possibility of growth. Hygiene factors are job context factors which include company policy, supervision, relationship with supervision, work conditions, relationship with peers, salary, personal life , relationship with subordinates, status and job security. Hygiene factors (often referred to as maintenance factors) lead to dissatisfaction with a job because of the need to avoid unpleasantness. They are referred to as hygiene factors because they can be avoided or prevented by the use of 'hygienic' methods. The important fact to remember is that attention to these hygiene factors prevents dissatisfaction but does not necessarily provide positive motivation.
CITATION kir13 \l 1033 (kiruja and Mukuru, 2013) argues that when institutional hygiene factors do not exist, (e.g. salary, job security etc.), employees are dissatisfied and if these factors exist it still does not mean that employees are motivated or satisfied. Supporting and recognizing employees' effort will help them to feel more valued within the organization as well as giving a sense of achievement and responsibility. If the employee does not feel some responsibility associated with a certain task or department, he or she will not feel like their efforts are worthwhile. Under Hertzberg's 1966 theory, workers who are satisfied with both motivational and hygiene factors would be top performers and those who are dissatisfied with both factors would be poor performers. There is a need for clarification on how satisfaction and motivation differ from each other. Job satisfaction is an emotional response accompanying actions or thoughts relating to work, whereas giving incentives is the process that activates behavior. As satisfaction is an attitude, it is possible for a worker to be satisfied with his job but not being motivated through incentives. Hence, motivation in the form of incentives and satisfaction are not synonymous with each other. It is vital to clarify that distinction between the concepts so that is easier to understand that motivation leads to satisfaction which untimely leads to enhanced performance. From philosophical perspective, it is Herzberg's position that it is the responsibility of society's dominant institutions to provide for the growth and well-being of people .In our society, one such dominant organization is the educational institutions. Therefore it is the responsibility of business and industry to provide the means for growth and self-actualization. Herzberg's theory is relevant in educational settings as hygiene factors have a statistical significance in affecting teachers' satisfaction and performance. The personality of the head teacher is a factor which controls the attitude of teachers and that the organizational climate of schools contributes to teacher satisfaction or dissatisfaction. Achievement and recognition are ranked first and second as factors contributing to good feelings about the job for a teacher.
The theory bases its proponents on CITATION Loc02 \l 1033 (Locke ; Latham, 2002) who state that performance is higher when individuals set specific goals. When goals are difficult but acceptable and when there is a feedback on performance. They reveal that goals have a pervasive influence on employee behavior and performance in organizations and management practice CITATION Loc02 \l 1033 (Locke ; Latham, 2002). They also argue that every organization seek high performance which can be attained by challenge and reachable goals. On the other hand, if the goal is too easy it will not bring out the desirable performance required by the organization to succeed CITATION Lun11 \l 1033 (Lunenburg, 2011). Goal setting is important because it increases the motivation to work and then increase the organizations performance. This is because employees feel more responsible when they set the goals with their managers. Their theory further suggests that the joint setting of objectives, feedback and involvement which are all part of a managerial approach can improve motivation. The theory places particular emphasis on goal-setting behavior and stipulates that the goals need to be clear, specific and achievable of they are to motivate (Kiruja ; Mukuru, 2013).
This section reviews have been undertaken in the area of non-financial incentives and its impact on employee performance.
Recognition refers to the general acknowledgement or confirmation of a given occurrence or performance CITATION APe08 \l 1033 (Petrescu ; Simon, 2008) . CITATION Man12 \l 1033 (Manzoor, 2012), studied the impact of employee motivation on organizational effectiveness in Pakistan. According to CITATION navon \l 1033 (Naveed, 2012), recognition and rewards have a direct impact on motivation of the employees and increase their efficiency. The researcher found out that recognition and empowerment increased employee motivation and hence their performance. Recognition plays an essential part in enhancing employee motivation towards organizational tasks. Appreciating the employees for their work and giving them participation in decision making. They will be internally satisfied with their job and organizational environment. Thus their enthusiasm and motivation towards accomplishment of tasks will definitely increase.
Employee recognition can be said to be seen as a timely, informed or formal acknowledgement of an individual's behavior and effort that directly supports the achievement and organizational goals and values and usually has been beyond normal expectation levels. It is therefore an employee's acknowledgement of an employee's accomplishment and effort towards the organization's goals. It concludes the act of giving special attention to employee's actions, efforts behavior or performance which can either physically or psychologically or both.
CITATION Sha11 \l 1033 (Shazia, Tayyaba & Belqees, 2011) investigated the efficacy of recognition based rewards on employees' motivation for them to be efficient and effective on the job as compared to usual incentives particularly the monetary ones. Their study also aimed to identify the roles of these rewards on employee retention as well as their long-term effectiveness within the organization.in their study they used closed ended questionnaires to show the relationship between recognition and efficiency of the organization. The study findings showed that there exist a positive correlation between recognition and employee motivation and performance. They concluded that such motivation arising out of recognition is not hierarchal. Majority of their respondents also showed a clear linkage between the employee motivation and performance.
CITATION Ala13 \l 1033 (Alam, Saaed, Sahabuddin ; Akter, 2013) conducted a study on the relationship between employee recognition and employee contribution in service industry in China. The researchers aimed at analyzing the impact of employees' recognition on their contribution to the organization. The study results showed that there is a positive relationship between employee performance and recognition.
CITATION Goh13 \l 1033 (Gohari , Ahmadloo, Bouroujeni & Hosseinipour, 2013), conducted a study on the relationship between rewards and employee performance in Malaysia. Their research focused on the relationship between intrinsic motivation factors such as recognition and extrinsic factors like salaries and bonuses on employees' performance of Persian Travel firms as the target sample. The findings showed that it is better to have good reward systems in the organization and evaluate it on employee performance.
In view of this the training and development brings more future opportunities for promotion. An involvement of employees in the training program and determining their training needs gives them ownership of the training process and add value to the performance.
In working conditions where employees are not provided with adequate resources, tools, training, software and supplies leads to de-motivation and lesser performance. The inefficient working conditions which include comfort issues like poor ventilation, seating, lightning and noise can cause anxiety and decrease the output, CITATION Hug07 \l 1033 (Huges, 2007). A healthy work place which is made by using ergonomic furniture and accessories, lightning and functional design will diminish distress and improve production. There should be enough supply of good protective clothing, drinking water, rest rooms, toilets, first aids facilities etc. both the management and employers should be safety conscious at all times and the organizations must respect minimum requirement of the factory. A study carried out by CITATION Ali13 \l 1033 (Ali & Adan, 2013), sought to investigate the effects of working conditions especially working hours and workload on employees' performance and whether there is a relationship between working conditions and employees performance manufacturing industry in Mogadishu, Somalia. The study found out that, in order to get better outcomes and increased performance, there should have been a better workplace environment since they are seen as boosting the employees and ultimately improving their performance. CITATION Ais13 \l 1033 (Aisha, Hardjomidjojo ; Yassierli, 2013) conducted a research on the effects of working ability, working condition, motivation and incentives on employee multi-dimensional performance in Indonesia. The results showed that working conditions, incentives and motivation had statistical significant effect on employee performance. The findings also revealed that workload, facilities and expectancy had a negative effect on employee performance. Meanwhile, working group, salary, job security, achievement, fairness and goals had a positive effect on employee performance. Also, the result showed that there is a significant effect between variables working conditions (workload and facilities) and performance (quality and quantity of work and level of attendance).