text:
namespace v8 {
namespace internal {
namespace compiler {

#define __ masm()->

#define kScratchReg r9

// Adds Arm-specific methods to convert InstructionOperands.
class ArmOperandConverter FINAL : public InstructionOperandConverter {
 public:
  ArmOperandConverter(CodeGenerator* gen, Instruction* instr)
      : InstructionOperandConverter(gen, instr) {}

  SwVfpRegister OutputFloat32Register(int index = 0) {
    return ToFloat32Register(instr_->OutputAt(index));
  }

  SwVfpRegister InputFloat32Register(int index) {
    return ToFloat32Register(instr_->InputAt(index));
  }

  SwVfpRegister ToFloat32Register(InstructionOperand* op) {
    return ToFloat64Register(op).low();
  }

  LowDwVfpRegister OutputFloat64Register(int index = 0) {
    return ToFloat64Register(instr_->OutputAt(index));
  }

  LowDwVfpRegister InputFloat64Register(int index) {
    return ToFloat64Register(instr_->InputAt(index));
  }

  LowDwVfpRegister ToFloat64Register(InstructionOperand* op) {
    return LowDwVfpRegister::from_code(ToDoubleRegister(op).code());
  }

  SBit OutputSBit() const {
    switch (instr_->flags_mode()) {
      case kFlags_branch:
      case kFlags_set:
        return SetCC;
      case kFlags_none:
        return LeaveCC;
    }
    UNREACHABLE();
    return LeaveCC;
  }

  Operand InputImmediate(int index) {
    Constant constant = ToConstant(instr_->InputAt(index));
    switch (constant.type()) {
      case Constant::kInt32:
        return Operand(constant.ToInt32());
      case Constant::kFloat32:
        return Operand(
            isolate()->factory()->NewNumber(constant.ToFloat32(), TENURED));
      case Constant::kFloat64:
        return Operand(
            isolate()->factory()->NewNumber(constant.ToFloat64(), TENURED));
      case Constant::kInt64:
      case Constant::kExternalReference:
      case Constant::kHeapObject:
      case Constant::kRpoNumber:
        break;
    }
    UNREACHABLE();
    return Operand::Zero();
  }

  Operand InputOperand2(int first_index) {
    const int index = first_index;
    switch (AddressingModeField::decode(instr_->opcode())) {
      case kMode_None:
      case kMode_Offset_RI:
      case kMode_Offset_RR:
        break;
      case kMode_Operand2_I:
        return InputImmediate(index + 0);
      case kMode_Operand2_R:
        return Operand(InputRegister(index + 0));
      case kMode_Operand2_R_ASR_I:
        return Operand(InputRegister(index + 0), ASR, InputInt5(index + 1));
      case kMode_Operand2_R_ASR_R:
        return Operand(InputRegister(index + 0), ASR, InputRegister(index + 1));
      case kMode_Operand2_R_LSL_I:
        return Operand(InputRegister(index + 0), LSL, InputInt5(index + 1));
      case kMode_Operand2_R_LSL_R:
        return Operand(InputRegister(index + 0), LSL, InputRegister(index + 1));
      case kMode_Operand2_R_LSR_I:
        return Operand(InputRegister(index + 0), LSR, InputInt5(index + 1));
      case kMode_Operand2_R_LSR_R:
        return Operand(InputRegister(index + 0), LSR, InputRegister(index + 1));
      case kMode_Operand2_R_ROR_I:
        return Operand(InputRegister(index + 0), ROR, InputInt5(index + 1));
      case kMode_Operand2_R_ROR_R:
        return Operand(InputRegister(index + 0), ROR, InputRegister(index + 1));
    }
    UNREACHABLE();
    return Operand::Zero();
  }

  MemOperand InputOffset(int* first_index) {
    const int index = *first_index;
    switch (AddressingModeField::decode(instr_->opcode())) {
      case kMode_None:
      case kMode_Operand2_I:
      case kMode_Operand2_R:
      case kMode_Operand2_R_ASR_I:
      case kMode_Operand2_R_ASR_R:
      case kMode_Operand2_R_LSL_I:
      case kMode_Operand2_R_LSL_R:
      case kMode_Operand2_R_LSR_I:
      case kMode_Operand2_R_LSR_R:
      case kMode_Operand2_R_ROR_I:
      case kMode_Operand2_R_ROR_R:
        break;
      case kMode_Offset_RI:
        *first_index += 2;
        return MemOperand(InputRegister(index + 0), InputInt32(index + 1));
      case kMode_Offset_RR:
        *first_index += 2;
        return MemOperand(InputRegister(index + 0), InputRegister(index + 1));
    }
    UNREACHABLE();
    return MemOperand(r0);
  }

  MemOperand InputOffset(int first_index = 0) {
    return InputOffset(&first_index);
  }

  MemOperand ToMemOperand(InstructionOperand* op) const {
    DCHECK(op != NULL);
    DCHECK(!op->IsRegister());
    DCHECK(!op->IsDoubleRegister());
    DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot());
    // The linkage computes where all spill slots are located.
    FrameOffset offset = linkage()->GetFrameOffset(op->index(), frame(), 0);
    return MemOperand(offset.from_stack_pointer() ? sp : fp, offset.offset());
  }
};

namespace {

class OutOfLineLoadFloat32 FINAL : public OutOfLineCode {
 public:
  OutOfLineLoadFloat32(CodeGenerator* gen, SwVfpRegister result)
      : OutOfLineCode(gen), result_(result) {}

  void Generate() FINAL {
    __ vmov(result_, std::numeric_limits<float>::quiet_NaN());
  }

 private:
  SwVfpRegister const result_;
};

class OutOfLineLoadFloat64 FINAL : public OutOfLineCode {
 public:
  OutOfLineLoadFloat64(CodeGenerator* gen, DwVfpRegister result)
      : OutOfLineCode(gen), result_(result) {}

  void Generate() FINAL {
    __ vmov(result_, std::numeric_limits<double>::quiet_NaN(), kScratchReg);
  }

 private:
  DwVfpRegister const result_;
};

class OutOfLineLoadInteger FINAL : public OutOfLineCode {
 public:
  OutOfLineLoadInteger(CodeGenerator* gen, Register result)
      : OutOfLineCode(gen), result_(result) {}

  void Generate() FINAL { __ mov(result_, Operand::Zero()); }

 private:
  Register const result_;
};

}  // namespace

#define ASSEMBLE_CHECKED_LOAD_FLOAT(width)                           \
  do {                                                               \
    auto result = i.OutputFloat##width##Register();                  \
    auto offset = i.InputRegister(0);                                \
    if (instr->InputAt(1)->IsRegister()) {                           \
      __ cmp(offset, i.InputRegister(1));                            \
    } else {                                                         \
      __ cmp(offset, i.InputImmediate(1));                           \
    }                                                                \
    auto ool = new (zone()) OutOfLineLoadFloat##width(this, result); \
    __ b(hs, ool->entry());                                          \
    __ vldr(result, i.InputOffset(2));                               \
    __ bind(ool->exit());                                            \
    DCHECK_EQ(LeaveCC, i.OutputSBit());                              \
  } while (0)

#define ASSEMBLE_CHECKED_LOAD_INTEGER(asm_instr)                \
  do {                                                          \
    auto result = i.OutputRegister();                           \
    auto offset = i.InputRegister(0);                           \
    if (instr->InputAt(1)->IsRegister()) {                      \
      __ cmp(offset, i.InputRegister(1));                       \
    } else {                                                    \
      __ cmp(offset, i.InputImmediate(1));                      \
    }                                                           \
    auto ool = new (zone()) OutOfLineLoadInteger(this, result); \
    __ b(hs, ool->entry());                                     \
    __ asm_instr(result, i.InputOffset(2));                     \
    __ bind(ool->exit());                                       \
    DCHECK_EQ(LeaveCC, i.OutputSBit());                         \
  } while (0)

#define ASSEMBLE_CHECKED_STORE_FLOAT(width)        \
  do {                                             \
    auto offset = i.InputRegister(0);              \
    if (instr->InputAt(1)->IsRegister()) {         \
      __ cmp(offset, i.InputRegister(1));          \
    } else {                                       \
      __ cmp(offset, i.InputImmediate(1));         \
    }                                              \
    auto value = i.InputFloat##width##Register(2); \
    __ vstr(value, i.InputOffset(3), lo);          \
    DCHECK_EQ(LeaveCC, i.OutputSBit());            \
  } while (0)

#define ASSEMBLE_CHECKED_STORE_INTEGER(asm_instr) \
  do {                                            \
    auto offset = i.InputRegister(0);             \
    if (instr->InputAt(1)->IsRegister()) {        \
      __ cmp(offset, i.InputRegister(1));         \
    } else {                                      \
      __ cmp(offset, i.InputImmediate(1));        \
    }                                             \
    auto value = i.InputRegister(2);              \
    __ asm_instr(value, i.InputOffset(3), lo);    \
    DCHECK_EQ(LeaveCC, i.OutputSBit());           \
  } while (0)

// Assembles an instruction after register allocation, producing machine code.
void CodeGenerator::AssembleArchInstruction(Instruction* instr) {
  ArmOperandConverter i(this, instr);

  switch (ArchOpcodeField::decode(instr->opcode())) {
    case kArchCallCodeObject: {
      EnsureSpaceForLazyDeopt();
      if (instr->InputAt(0)->IsImmediate()) {
        __ Call(Handle<Code>::cast(i.InputHeapObject(0)),
                RelocInfo::CODE_TARGET);
      } else {
        __ add(ip, i.InputRegister(0),
               Operand(Code::kHeaderSize - kHeapObjectTag));
        __ Call(ip);
      }
      AddSafepointAndDeopt(instr);
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArchCallJSFunction: {
      EnsureSpaceForLazyDeopt();
      Register func = i.InputRegister(0);
      if (FLAG_debug_code) {
        // Check the function's context matches the context argument.
        __ ldr(kScratchReg, FieldMemOperand(func, JSFunction::kContextOffset));
        __ cmp(cp, kScratchReg);
        __ Assert(eq, kWrongFunctionContext);
      }
      __ ldr(ip, FieldMemOperand(func, JSFunction::kCodeEntryOffset));
      __ Call(ip);
      AddSafepointAndDeopt(instr);
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArchJmp:
      AssembleArchJump(i.InputRpo(0));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArchNop:
      // don't emit code for nops.
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArchRet:
      AssembleReturn();
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArchStackPointer:
      __ mov(i.OutputRegister(), sp);
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArchTruncateDoubleToI:
      __ TruncateDoubleToI(i.OutputRegister(), i.InputFloat64Register(0));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmAdd:
      __ add(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
             i.OutputSBit());
      break;
    case kArmAnd:
      __ and_(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
              i.OutputSBit());
      break;
    case kArmBic:
      __ bic(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
             i.OutputSBit());
      break;
    case kArmMul:
      __ mul(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
             i.OutputSBit());
      break;
    case kArmMla:
      __ mla(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
             i.InputRegister(2), i.OutputSBit());
      break;
    case kArmMls: {
      CpuFeatureScope scope(masm(), MLS);
      __ mls(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
             i.InputRegister(2));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmSmmul:
      __ smmul(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmSmmla:
      __ smmla(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
               i.InputRegister(2));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmUmull:
      __ umull(i.OutputRegister(0), i.OutputRegister(1), i.InputRegister(0),
               i.InputRegister(1), i.OutputSBit());
      break;
    case kArmSdiv: {
      CpuFeatureScope scope(masm(), SUDIV);
      __ sdiv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmUdiv: {
      CpuFeatureScope scope(masm(), SUDIV);
      __ udiv(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmMov:
      __ Move(i.OutputRegister(), i.InputOperand2(0), i.OutputSBit());
      break;
    case kArmMvn:
      __ mvn(i.OutputRegister(), i.InputOperand2(0), i.OutputSBit());
      break;
    case kArmOrr:
      __ orr(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
             i.OutputSBit());
      break;
    case kArmEor:
      __ eor(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
             i.OutputSBit());
      break;
    case kArmSub:
      __ sub(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
             i.OutputSBit());
      break;
    case kArmRsb:
      __ rsb(i.OutputRegister(), i.InputRegister(0), i.InputOperand2(1),
             i.OutputSBit());
      break;
    case kArmBfc: {
      CpuFeatureScope scope(masm(), ARMv7);
      __ bfc(i.OutputRegister(), i.InputInt8(1), i.InputInt8(2));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmUbfx: {
      CpuFeatureScope scope(masm(), ARMv7);
      __ ubfx(i.OutputRegister(), i.InputRegister(0), i.InputInt8(1),
              i.InputInt8(2));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmSxtb:
      __ sxtb(i.OutputRegister(), i.InputRegister(0), i.InputInt32(1));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmSxth:
      __ sxth(i.OutputRegister(), i.InputRegister(0), i.InputInt32(1));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmSxtab:
      __ sxtab(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
               i.InputInt32(2));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmSxtah:
      __ sxtah(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
               i.InputInt32(2));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmUxtb:
      __ uxtb(i.OutputRegister(), i.InputRegister(0), i.InputInt32(1));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmUxth:
      __ uxth(i.OutputRegister(), i.InputRegister(0), i.InputInt32(1));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmUxtab:
      __ uxtab(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
               i.InputInt32(2));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmUxtah:
      __ uxtah(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
               i.InputInt32(2));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmCmp:
      __ cmp(i.InputRegister(0), i.InputOperand2(1));
      DCHECK_EQ(SetCC, i.OutputSBit());
      break;
    case kArmCmn:
      __ cmn(i.InputRegister(0), i.InputOperand2(1));
      DCHECK_EQ(SetCC, i.OutputSBit());
      break;
    case kArmTst:
      __ tst(i.InputRegister(0), i.InputOperand2(1));
      DCHECK_EQ(SetCC, i.OutputSBit());
      break;
    case kArmTeq:
      __ teq(i.InputRegister(0), i.InputOperand2(1));
      DCHECK_EQ(SetCC, i.OutputSBit());
      break;
    case kArmVcmpF64:
      __ VFPCompareAndSetFlags(i.InputFloat64Register(0),
                               i.InputFloat64Register(1));
      DCHECK_EQ(SetCC, i.OutputSBit());
      break;
    case kArmVaddF64:
      __ vadd(i.OutputFloat64Register(), i.InputFloat64Register(0),
              i.InputFloat64Register(1));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmVsubF64:
      __ vsub(i.OutputFloat64Register(), i.InputFloat64Register(0),
              i.InputFloat64Register(1));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmVmulF64:
      __ vmul(i.OutputFloat64Register(), i.InputFloat64Register(0),
              i.InputFloat64Register(1));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmVmlaF64:
      __ vmla(i.OutputFloat64Register(), i.InputFloat64Register(1),
              i.InputFloat64Register(2));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmVmlsF64:
      __ vmls(i.OutputFloat64Register(), i.InputFloat64Register(1),
              i.InputFloat64Register(2));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmVdivF64:
      __ vdiv(i.OutputFloat64Register(), i.InputFloat64Register(0),
              i.InputFloat64Register(1));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmVmodF64: {
      // TODO(bmeurer): We should really get rid of this special instruction,
      // and generate a CallAddress instruction instead.
      FrameScope scope(masm(), StackFrame::MANUAL);
      __ PrepareCallCFunction(0, 2, kScratchReg);
      __ MovToFloatParameters(i.InputFloat64Register(0),
                              i.InputFloat64Register(1));
      __ CallCFunction(ExternalReference::mod_two_doubles_operation(isolate()),
                       0, 2);
      // Move the result in the double result register.
      __ MovFromFloatResult(i.OutputFloat64Register());
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmVsqrtF64:
      __ vsqrt(i.OutputFloat64Register(), i.InputFloat64Register(0));
      break;
    case kArmVfloorF64:
      __ vrintm(i.OutputFloat64Register(), i.InputFloat64Register(0));
      break;
    case kArmVceilF64:
      __ vrintp(i.OutputFloat64Register(), i.InputFloat64Register(0));
      break;
    case kArmVroundTruncateF64:
      __ vrintz(i.OutputFloat64Register(), i.InputFloat64Register(0));
      break;
    case kArmVroundTiesAwayF64:
      __ vrinta(i.OutputFloat64Register(), i.InputFloat64Register(0));
      break;
    case kArmVnegF64:
      __ vneg(i.OutputFloat64Register(), i.InputFloat64Register(0));
      break;
    case kArmVcvtF32F64: {
      __ vcvt_f32_f64(i.OutputFloat32Register(), i.InputFloat64Register(0));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmVcvtF64F32: {
      __ vcvt_f64_f32(i.OutputFloat64Register(), i.InputFloat32Register(0));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmVcvtF64S32: {
      SwVfpRegister scratch = kScratchDoubleReg.low();
      __ vmov(scratch, i.InputRegister(0));
      __ vcvt_f64_s32(i.OutputFloat64Register(), scratch);
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmVcvtF64U32: {
      SwVfpRegister scratch = kScratchDoubleReg.low();
      __ vmov(scratch, i.InputRegister(0));
      __ vcvt_f64_u32(i.OutputFloat64Register(), scratch);
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmVcvtS32F64: {
      SwVfpRegister scratch = kScratchDoubleReg.low();
      __ vcvt_s32_f64(scratch, i.InputFloat64Register(0));
      __ vmov(i.OutputRegister(), scratch);
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmVcvtU32F64: {
      SwVfpRegister scratch = kScratchDoubleReg.low();
      __ vcvt_u32_f64(scratch, i.InputFloat64Register(0));
      __ vmov(i.OutputRegister(), scratch);
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmLdrb:
      __ ldrb(i.OutputRegister(), i.InputOffset());
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmLdrsb:
      __ ldrsb(i.OutputRegister(), i.InputOffset());
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmStrb: {
      int index = 0;
      MemOperand operand = i.InputOffset(&index);
      __ strb(i.InputRegister(index), operand);
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmLdrh:
      __ ldrh(i.OutputRegister(), i.InputOffset());
      break;
    case kArmLdrsh:
      __ ldrsh(i.OutputRegister(), i.InputOffset());
      break;
    case kArmStrh: {
      int index = 0;
      MemOperand operand = i.InputOffset(&index);
      __ strh(i.InputRegister(index), operand);
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmLdr:
      __ ldr(i.OutputRegister(), i.InputOffset());
      break;
    case kArmStr: {
      int index = 0;
      MemOperand operand = i.InputOffset(&index);
      __ str(i.InputRegister(index), operand);
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmVldrF32: {
      __ vldr(i.OutputFloat32Register(), i.InputOffset());
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmVstrF32: {
      int index = 0;
      MemOperand operand = i.InputOffset(&index);
      __ vstr(i.InputFloat32Register(index), operand);
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmVldrF64:
      __ vldr(i.OutputFloat64Register(), i.InputOffset());
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmVstrF64: {
      int index = 0;
      MemOperand operand = i.InputOffset(&index);
      __ vstr(i.InputFloat64Register(index), operand);
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kArmPush:
      __ Push(i.InputRegister(0));
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    case kArmStoreWriteBarrier: {
      Register object = i.InputRegister(0);
      Register index = i.InputRegister(1);
      Register value = i.InputRegister(2);
      __ add(index, object, index);
      __ str(value, MemOperand(index));
      SaveFPRegsMode mode =
          frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
      LinkRegisterStatus lr_status = kLRHasNotBeenSaved;
      __ RecordWrite(object, index, value, lr_status, mode);
      DCHECK_EQ(LeaveCC, i.OutputSBit());
      break;
    }
    case kCheckedLoadInt8:
      ASSEMBLE_CHECKED_LOAD_INTEGER(ldrsb);
      break;
    case kCheckedLoadUint8:
      ASSEMBLE_CHECKED_LOAD_INTEGER(ldrb);
      break;
    case kCheckedLoadInt16:
      ASSEMBLE_CHECKED_LOAD_INTEGER(ldrsh);
      break;
    case kCheckedLoadUint16:
      ASSEMBLE_CHECKED_LOAD_INTEGER(ldrh);
      break;
    case kCheckedLoadWord32:
      ASSEMBLE_CHECKED_LOAD_INTEGER(ldr);
      break;
    case kCheckedLoadFloat32:
      ASSEMBLE_CHECKED_LOAD_FLOAT(32);
      break;
    case kCheckedLoadFloat64:
      ASSEMBLE_CHECKED_LOAD_FLOAT(64);
      break;
    case kCheckedStoreWord8:
      ASSEMBLE_CHECKED_STORE_INTEGER(strb);
      break;
    case kCheckedStoreWord16:
      ASSEMBLE_CHECKED_STORE_INTEGER(strh);
      break;
    case kCheckedStoreWord32:
      ASSEMBLE_CHECKED_STORE_INTEGER(str);
      break;
    case kCheckedStoreFloat32:
      ASSEMBLE_CHECKED_STORE_FLOAT(32);
      break;
    case kCheckedStoreFloat64:
      ASSEMBLE_CHECKED_STORE_FLOAT(64);
      break;
  }
}

// Assembles branches after an instruction.
void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) {
  ArmOperandConverter i(this, instr);
  Label* tlabel = branch->true_label;
  Label* flabel = branch->false_label;
  switch (branch->condition) {
    case kUnorderedEqual:
      // The "eq" condition will not catch the unordered case.
      // The jump/fall through to false label will be used if the comparison
      // was unordered.
    case kEqual:
      __ b(eq, tlabel);
      break;
    case kUnorderedNotEqual:
      // Unordered or not equal can be tested with "ne" condtion.
      // See ARMv7 manual A8.3 - Conditional execution.
    case kNotEqual:
      __ b(ne, tlabel);
      break;
    case kSignedLessThan:
      __ b(lt, tlabel);
      break;
    case kSignedGreaterThanOrEqual:
      __ b(ge, tlabel);
      break;
    case kSignedLessThanOrEqual:
      __ b(le, tlabel);
      break;
    case kSignedGreaterThan:
      __ b(gt, tlabel);
      break;
    case kUnorderedLessThan:
      // The "lo" condition will not catch the unordered case.
      // The jump/fall through to false label will be used if the comparison
      // was unordered.
    case kUnsignedLessThan:
      __ b(lo, tlabel);
      break;
    case kUnorderedGreaterThanOrEqual:
      // Unordered, greater than or equal can be tested with "hs" condtion.
      // See ARMv7 manual A8.3 - Conditional execution.
    case kUnsignedGreaterThanOrEqual:
      __ b(hs, tlabel);
      break;
    case kUnorderedLessThanOrEqual:
      // The "ls" condition will not catch the unordered case.
      // The jump/fall through to false label will be used if the comparison
      // was unordered.
    case kUnsignedLessThanOrEqual:
      __ b(ls, tlabel);
      break;
    case kUnorderedGreaterThan:
      // Unordered or greater than can be tested with "hi" condtion.
      // See ARMv7 manual A8.3 - Conditional execution.
    case kUnsignedGreaterThan:
      __ b(hi, tlabel);
      break;
    case kOverflow:
      __ b(vs, tlabel);
      break;
    case kNotOverflow:
      __ b(vc, tlabel);
      break;
  }
  if (!branch->fallthru) __ b(flabel);  // no fallthru to flabel.
}

void CodeGenerator::AssembleArchJump(BasicBlock::RpoNumber target) {
  if (!IsNextInAssemblyOrder(target)) __ b(GetLabel(target));
}

// Assembles boolean materializations after an instruction.
void CodeGenerator::AssembleArchBoolean(Instruction* instr,
                                        FlagsCondition condition) {
  ArmOperandConverter i(this, instr);
  Label done;

  // Materialize a full 32-bit 1 or 0 value. The result register is always the
  // last output of the instruction.
  Label check;
  DCHECK_NE(0, instr->OutputCount());
  Register reg = i.OutputRegister(instr->OutputCount() - 1);
  Condition cc = kNoCondition;
  switch (condition) {
    case kUnorderedEqual:
      __ b(vc, &check);
      __ mov(reg, Operand(0));
      __ b(&done);
    // Fall through.
    case kEqual:
      cc = eq;
      break;
    case kUnorderedNotEqual:
      __ b(vc, &check);
      __ mov(reg, Operand(1));
      __ b(&done);
    // Fall through.
    case kNotEqual:
      cc = ne;
      break;
    case kSignedLessThan:
      cc = lt;
      break;
    case kSignedGreaterThanOrEqual:
      cc = ge;
      break;
    case kSignedLessThanOrEqual:
      cc = le;
      break;
    case kSignedGreaterThan:
      cc = gt;
      break;
    case kUnorderedLessThan:
      __ b(vc, &check);
      __ mov(reg, Operand(0));
      __ b(&done);
    // Fall through.
    case kUnsignedLessThan:
      cc = lo;
      break;
    case kUnorderedGreaterThanOrEqual:
      __ b(vc, &check);
      __ mov(reg, Operand(1));
      __ b(&done);
    // Fall through.
    case kUnsignedGreaterThanOrEqual:
      cc = hs;
      break;
    case kUnorderedLessThanOrEqual:
      __ b(vc, &check);
      __ mov(reg, Operand(0));
      __ b(&done);
    // Fall through.
    case kUnsignedLessThanOrEqual:
      cc = ls;
      break;
    case kUnorderedGreaterThan:
      __ b(vc, &check);
      __ mov(reg, Operand(1));
      __ b(&done);
    // Fall through.
    case kUnsignedGreaterThan:
      cc = hi;
      break;
    case kOverflow:
      cc = vs;
      break;
    case kNotOverflow:
      cc = vc;
      break;
  }
  __ bind(&check);
  __ mov(reg, Operand(0));
  __ mov(reg, Operand(1), LeaveCC, cc);
  __ bind(&done);
}

void CodeGenerator::AssembleDeoptimizerCall(int deoptimization_id) {
  Address deopt_entry = Deoptimizer::GetDeoptimizationEntry(
      isolate(), deoptimization_id, Deoptimizer::LAZY);
  __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY);
}

void CodeGenerator::AssemblePrologue() {
  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
  if (descriptor->kind() == CallDescriptor::kCallAddress) {
    bool saved_pp;
    if (FLAG_enable_ool_constant_pool) {
      __ Push(lr, fp, pp);
      // Adjust FP to point to saved FP.
      __ sub(fp, sp, Operand(StandardFrameConstants::kConstantPoolOffset));
      saved_pp = true;
    } else {
      __ Push(lr, fp);
      __ mov(fp, sp);
      saved_pp = false;
    }
    const RegList saves = descriptor->CalleeSavedRegisters();
    if (saves != 0 || saved_pp) {
      // Save callee-saved registers.
      int register_save_area_size = saved_pp ? kPointerSize : 0;
      for (int i = Register::kNumRegisters - 1; i >= 0; i--) {
        if (!((1 << i) & saves)) continue;
        register_save_area_size += kPointerSize;
      }
      frame()->SetRegisterSaveAreaSize(register_save_area_size);
      __ stm(db_w, sp, saves);
    }
  } else if (descriptor->IsJSFunctionCall()) {
    CompilationInfo* info = this->info();
    __ Prologue(info->IsCodePreAgingActive());
    frame()->SetRegisterSaveAreaSize(
        StandardFrameConstants::kFixedFrameSizeFromFp);
  } else {
    __ StubPrologue();
    frame()->SetRegisterSaveAreaSize(
        StandardFrameConstants::kFixedFrameSizeFromFp);
  }
  int stack_slots = frame()->GetSpillSlotCount();
  if (stack_slots > 0) {
    __ sub(sp, sp, Operand(stack_slots * kPointerSize));
  }
}

void CodeGenerator::AssembleReturn() {
  CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
  if (descriptor->kind() == CallDescriptor::kCallAddress) {
    if (frame()->GetRegisterSaveAreaSize() > 0) {
      // Remove this frame's spill slots first.
      int stack_slots = frame()->GetSpillSlotCount();
      if (stack_slots > 0) {
        __ add(sp, sp, Operand(stack_slots * kPointerSize));
      }
      // Restore registers.
      const RegList saves = descriptor->CalleeSavedRegisters();
      if (saves != 0) {
        __ ldm(ia_w, sp, saves);
      }
    }
    __ LeaveFrame(StackFrame::MANUAL);
    __ Ret();
  } else {
    __ LeaveFrame(StackFrame::MANUAL);
    int pop_count = descriptor->IsJSFunctionCall()
                        ? static_cast<int>(descriptor->JSParameterCount())
                        : 0;
    __ Drop(pop_count);
    __ Ret();
  }
}

void CodeGenerator::AssembleMove(InstructionOperand* source,
                                 InstructionOperand* destination) {
  ArmOperandConverter g(this, NULL);
  // Dispatch on the source and destination operand kinds.  Not all
  // combinations are possible.
  if (source->IsRegister()) {
    DCHECK(destination->IsRegister() || destination->IsStackSlot());
    Register src = g.ToRegister(source);
    if (destination->IsRegister()) {
      __ mov(g.ToRegister(destination), src);
    } else {
      __ str(src, g.ToMemOperand(destination));
    }
  } else if (source->IsStackSlot()) {
    DCHECK(destination->IsRegister() || destination->IsStackSlot());
    MemOperand src = g.ToMemOperand(source);
    if (destination->IsRegister()) {
      __ ldr(g.ToRegister(destination), src);
    } else {
      Register temp = kScratchReg;
      __ ldr(temp, src);
      __ str(temp, g.ToMemOperand(destination));
    }
  } else if (source->IsConstant()) {
    Constant src = g.ToConstant(source);
    if (destination->IsRegister() || destination->IsStackSlot()) {
      Register dst =
          destination->IsRegister() ? g.ToRegister(destination) : kScratchReg;
      switch (src.type()) {
        case Constant::kInt32:
          __ mov(dst, Operand(src.ToInt32()));
          break;
        case Constant::kInt64:
          UNREACHABLE();
          break;
        case Constant::kFloat32:
          __ Move(dst,
                  isolate()->factory()->NewNumber(src.ToFloat32(), TENURED));
          break;
        case Constant::kFloat64:
          __ Move(dst,
                  isolate()->factory()->NewNumber(src.ToFloat64(), TENURED));
          break;
        case Constant::kExternalReference:
          __ mov(dst, Operand(src.ToExternalReference()));
          break;
        case Constant::kHeapObject:
          __ Move(dst, src.ToHeapObject());
          break;
        case Constant::kRpoNumber:
          UNREACHABLE();  // TODO(dcarney): loading RPO constants on arm.
          break;
      }
      if (destination->IsStackSlot()) __ str(dst, g.ToMemOperand(destination));
    } else if (src.type() == Constant::kFloat32) {
      if (destination->IsDoubleStackSlot()) {
        MemOperand dst = g.ToMemOperand(destination);
        __ mov(ip, Operand(bit_cast<int32_t>(src.ToFloat32())));
        __ str(ip, dst);
      } else {
        SwVfpRegister dst = g.ToFloat32Register(destination);
        __ vmov(dst, src.ToFloat32());
      }
    } else {
      DCHECK_EQ(Constant::kFloat64, src.type());
      DwVfpRegister dst = destination->IsDoubleRegister()
                              ? g.ToFloat64Register(destination)
                              : kScratchDoubleReg;
      __ vmov(dst, src.ToFloat64(), kScratchReg);
      if (destination->IsDoubleStackSlot()) {
        __ vstr(dst, g.ToMemOperand(destination));
      }
    }
  } else if (source->IsDoubleRegister()) {
    DwVfpRegister src = g.ToDoubleRegister(source);
    if (destination->IsDoubleRegister()) {
      DwVfpRegister dst = g.ToDoubleRegister(destination);
      __ Move(dst, src);
    } else {
      DCHECK(destination->IsDoubleStackSlot());
      __ vstr(src, g.ToMemOperand(destination));
    }
  } else if (source->IsDoubleStackSlot()) {
    DCHECK(destination->IsDoubleRegister() || destination->IsDoubleStackSlot());
    MemOperand src = g.ToMemOperand(source);
    if (destination->IsDoubleRegister()) {
      __ vldr(g.ToDoubleRegister(destination), src);
    } else {
      DwVfpRegister temp = kScratchDoubleReg;
      __ vldr(temp, src);
      __ vstr(temp, g.ToMemOperand(destination));
    }
  } else {
    UNREACHABLE();
  }
}

void CodeGenerator::AssembleSwap(InstructionOperand* source,
                                 InstructionOperand* destination) {
  ArmOperandConverter g(this, NULL);
  // Dispatch on the source and destination operand kinds.  Not all
  // combinations are possible.
  if (source->IsRegister()) {
    // Register-register.
    Register temp = kScratchReg;
    Register src = g.ToRegister(source);
    if (destination->IsRegister()) {
      Register dst = g.ToRegister(destination);
      __ Move(temp, src);
      __ Move(src, dst);
      __ Move(dst, temp);
    } else {
      DCHECK(destination->IsStackSlot());
      MemOperand dst = g.ToMemOperand(destination);
      __ mov(temp, src);
      __ ldr(src, dst);
      __ str(temp, dst);
    }
  } else if (source->IsStackSlot()) {
    DCHECK(destination->IsStackSlot());
    Register temp_0 = kScratchReg;
    SwVfpRegister temp_1 = kScratchDoubleReg.low();
    MemOperand src = g.ToMemOperand(source);
    MemOperand dst = g.ToMemOperand(destination);
    __ ldr(temp_0, src);
    __ vldr(temp_1, dst);
    __ str(temp_0, dst);
    __ vstr(temp_1, src);
  } else if (source->IsDoubleRegister()) {
    DwVfpRegister temp = kScratchDoubleReg;
    DwVfpRegister src = g.ToDoubleRegister(source);
    if (destination->IsDoubleRegister()) {
      DwVfpRegister dst = g.ToDoubleRegister(destination);
      __ Move(temp, src);
      __ Move(src, dst);
      __ Move(dst, temp);
    } else {
      DCHECK(destination->IsDoubleStackSlot());
      MemOperand dst = g.ToMemOperand(destination);
      __ Move(temp, src);
      __ vldr(src, dst);
      __ vstr(temp, dst);
    }
  } else if (source->IsDoubleStackSlot()) {
    DCHECK(destination->IsDoubleStackSlot());
    Register temp_0 = kScratchReg;
    DwVfpRegister temp_1 = kScratchDoubleReg;
    MemOperand src0 = g.ToMemOperand(source);
    MemOperand src1(src0.rn(), src0.offset() + kPointerSize);
    MemOperand dst0 = g.ToMemOperand(destination);
    MemOperand dst1(dst0.rn(), dst0.offset() + kPointerSize);
    __ vldr(temp_1, dst0);  // Save destination in temp_1.
    __ ldr(temp_0, src0);   // Then use temp_0 to copy source to destination.
    __ str(temp_0, dst0);
    __ ldr(temp_0, src1);
    __ str(temp_0, dst1);
    __ vstr(temp_1, src0);
  } else {
    // No other combinations are possible.
    UNREACHABLE();
  }
}

void CodeGenerator::AddNopForSmiCodeInlining() {
  // On 32-bit ARM we do not insert nops for inlined Smi code.
}

void CodeGenerator::EnsureSpaceForLazyDeopt() {
  int space_needed = Deoptimizer::patch_size();
  if (!info()->IsStub()) {
    // Ensure that we have enough space after the previous lazy-bailout
    // instruction for patching the code here.
    int current_pc = masm()->pc_offset();
    if (current_pc < last_lazy_deopt_pc_ + space_needed) {
      // Block literal pool emission for duration of padding.
      v8::internal::Assembler::BlockConstPoolScope block_const_pool(masm());
      int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc;
      DCHECK_EQ(0, padding_size % v8::internal::Assembler::kInstrSize);
      while (padding_size > 0) {
        __ nop();
        padding_size -= v8::internal::Assembler::kInstrSize;
      }
    }
  }
  MarkLazyDeoptSite();
}

#undef __

}  // namespace compiler
}  // namespace internal
}  // namespace v8


text:
.. include:: header.inc

====================
Advanced Facebook
====================

.. raw:: html
   :file: snippets/expert_warning.html

Linking Users with Facebook
---------------------------

When connecting users in your app to their Facebook account it is important to understand the distinction between READ permissions and WRITE permissions.

Facebook makes a clear distinction between those operations required READ access and those requiring WRITE (publish) access.

It is important to observe the following policy conventions from Facebook:

- READ permissions must be requested **BEFORE** WRITE permissions
- It is invalid to request READ permissions at the same time as WRITE permissions (this will cause an error)

The default behavior of the Socialize Action Bar means that Facebook permissions are requested in the correct order so you should not
need to worry if you are simply using the Action Bar, however if you want to perform any direct interaction with Facebook you will need to be mindful
of these rules.

By default Socialize requests no additional permissions for READ access, and requests the following permissions for WRITE access:

	"publish_actions"

When performing a direct Facebook operation you must first check to see whether the appropriate permissions have been linked:

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-14
	:end-before: end-snippet-14

If you want to include additional permissions not included in the default list you can just specify these as additional
parameters to the **isLinked** and **link** methods

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-15
	:end-before: end-snippet-15

If you already have Facebook integration in your app and do not wish to replace this with the Socialize implementation you
can still link the user to Facebook within Socialize by providing the user's Facebook auth token

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-1
	:end-before: end-snippet-1

Unlinking Users from Facebook
-----------------------------

To unlink a user from their Facebook account simple call **unlink**.  This call executes synchronously.

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-3
	:end-before: end-snippet-3

Posting to Facebook
-------------------
By default all actions created using the SDK will provide the end user with the opportunity to share their
action with Facebook (if Facebook has been configured) however it is also possible to manually post content to a user's
Facebook wall.

Posting Socialize Entities to Facebook
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The simplest and most effective use of Facebook within Socialize is to post entities.  This approach takes full advantage of
Socialize SmartDownloads as well as automatically supporting Facebook Open Graph which helps maximize the effectiveness of your social strategy.

To post an entity to a user's Facebook timeline simply call the **postEntity** method.

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-4
	:end-before: end-snippet-4

Posting Directly to Facebook
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want complete control over what is posted to Facebook, Socialize provides a simple interface to the Facebook Graph API.

Refer to the Facebook Graph API documentation for more specific implementation information

http://developers.facebook.com/docs/reference/api/

Executing a **POST**

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-5
	:end-before: end-snippet-5

If you want to take full advantage of Socialize SmartDownloads and post the auto-generated SmartDownload urls for your entity or app you can
do this by creating a simple share object without propagation first.

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-8
	:end-before: end-snippet-8

Executing a **GET**

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-6
	:end-before: end-snippet-6

Executing a **DELETE**

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-7
	:end-before: end-snippet-7

.. _open_graph:

Using Facebook Open Graph
-------------------------
From v2.3 onwards Socialize supports Facebook "like" Open Graph actions.  This means that when a user executes a "like" on Socialize and elects to
share this on Facebook it can be posted as an "Open Graph Like" in the user's Facebook Activity stream.

This behavior can be enabled via configuration in your **socialize.properties** file

.. raw:: html
   :file: snippets/facebook_og_like_notice.html

.. literalinclude:: snippets/props_fb_like.txt
   :language: properties

.. note:: If you are not already familiar with the Facebook Open Graph we recommend reviewing the `Facebook Documentation <https://developers.facebook.com/docs/opengraph/>`_ first

Configuring your Facebook App for Open Graph
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Before you are able to utilize Open Graph calls such as "like" you must first follow the Facebook Guidelines for approval of Open Graph actions.

This is detailed on the Facebook website here:

`Open Graph Approval Process <http://developers.facebook.com/docs/opengraph/opengraph-approval/>`_

The following steps apply to seeking approval for the in-built "like" action however the same approach can be followed for all Open Graph Actions.

Adding an Open Graph Action to your App
"""""""""""""""""""""""""""""""""""""""
In your app settings on Facebook, access the Open Graph section:

.. image:: images/fb_og_menu.png

You will be presented with the default configuration screen for Open Graph.  Click the **Create New Action Type** button and select the action to be added

.. image:: images/fb_og_page1.png

You will then be presented with a dialog in which your action can be selected.  Choose an appropriate action and click **Submit**

.. image:: images/fb_og_select_action.png

Once your action has been added you are ready to submit it for approval.  Click the **Submit** link.

.. image:: images/fb_og_page2.png

At this point you may encounter some validation errors.  The most common of which are:

.. image:: images/fb_og_error1.png

The **Publish Action** requirement is most easily satisfied by simply executing the same *curl* command provided by Facebook.

Click on the **Get Code** link next to your action and run the *curl* command you are provided from your terminal (command line) interface

.. image:: images/fb_og_curl.png

The final step in the approval process requires you to clarify with Facebook the exact purpose for your OG action.

.. image:: images/fb_og_error2.png

Socialize has prepared a standard response for you to use in this situation.  If you are using the Socialize UI features "out-of-the-box" (that is, without modification) then you
can simply refer to the content we have provided for you at:

http://blog.getsocialize.com/facebook-open-graph-review

If you have implemented your own UI and/or are calling the Socialize SDK directly through any other means we recommend you follow the guidelines established by Facebook for the approval of
Open Graph actions.

https://developers.facebook.com/docs/opengraph/checklist/

Using In Built Open Graph Actions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The in built OG actions provided by Facebook **require approval by Facebook** and there is a limited set of actions available and a corresponding limited set of object types.

The actions supported and the corresponding object types are as follows

+------------+-------------------+---------------+---------------+
| Action     | Path              | Object Types  | Parameter     |
+============+===================+===============+===============+
| like       | me/og.likes       | object        | object        |
+------------+-------------------+---------------+---------------+
| follow     | me/og.follows     | profile       | profile       |
+------------+-------------------+---------------+---------------+
| publish    | me/news.publishes | article       | article       |
+------------+-------------------+---------------+---------------+
| read       | me/news.reads     | article       | article       |
+------------+-------------------+---------------+---------------+
| watch      | me/video.watches  | video.movie   | movie         |
+------------+-------------------+---------------+---------------+
|            |                   | video.episode | movie         |
+------------+-------------------+---------------+---------------+
|            |                   | video.tv_show | movie         |
+------------+-------------------+---------------+---------------+
|            |                   | video.other   | movie         |
+------------+-------------------+---------------+---------------+

The Object Types specified in the Open Graph call **MUST** correspond to a valid *og:type* meta element in the HTML page that represents the object.

For example::

	<meta property="og:type" content="video.movie" />

Fortunately Socialize will **automatically generate OG tags** on your entity page, but you must specify the correct type on the entity object itself.

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-10
	:end-before: end-snippet-10

Once you have setup your Entity with the correct type you can force an Open Graph post by changing the PostData in the SocialNetworkListener.
Here's a complete example

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-13
	:end-before: end-snippet-13

The corresponding entity page on Socialize will automatically populate the required OG meta tags::

	<meta property="og:title" content="My Entity Name" />
	<meta property="og:description" content="...parsed from your URL..." />
	<meta property="og:image" content="...parsed from your URL..." />
	<meta property="og:type" content="video.movie" />
	<meta property="og:url" content="...the URL of this page..." />

.. raw:: html
   :file: snippets/open_graph_notice.html

If you don't have an actual URL for your entity you can setup the correct description, image etc by changing the meta data on your entity.

Refer to :ref:`entity_no_url` for more details on customizing the entity page.

Using Custom Open Graph Actions
"""""""""""""""""""""""""""""""
In addition to using the built-in Open Graph actions, you can also define your own.

For example an app that reviews restaurants may want to post the fact that a user "ate" a "meal" rather than simply saying a user "shared" a "link".

There is however a fairly lengthy setup process to correctly configure your application to handle custom OG actions.

We recommend reviewing the `Open Graph Tutorial <http://developers.facebook.com/docs/opengraph/tutorial/>`_ to understand how to configure your app for custom Open Graph actions.

Configuring Custom Open Graph Actions
+++++++++++++++++++++++++++++++++++++
Facebook Open Graph implements several security systems to ensure that owners of content are verified.  One such security measure ensures that websites housing information about custom OG types are registered
against the Facebook App to guarantee that 3rd party users cannot fraudulently represent custom types on external pages.

If you want to utilize custom open graph actions in your Socialize enabled app you must first configure your Facebook application to expect posts that refer to websites hosted by Socialize.

This consists of 3 simple steps:

#. Obtain your Socialize App Url from your dashboard at www.getsocialize.com
#. Nominate the Socialize App Url as your "Site URL" on Facebook
#. Add the **getsocialize.com** domain to your list of App Domains on Facebook.

.. image:: images/fb_og_config.png

You can obtain your Socialize App Url from the "SmartDownloads" section accessed from your dashboard at www.getsocialize.com

.. image:: images/app_url.png

Once you have configured your application to accept custom Open Graph actions you can post these actions to Facebook by changing the PostData in the SocialNetworkListener.

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-12
	:end-before: end-snippet-12

Posting Photos to Facebook
--------------------------

You can easily post photos to a user's Facebook Photo Album using the **post** method on **FacebookUtils**

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-9
	:end-before: end-snippet-9

Facebook Single Sign On (SSO)
-----------------------------

Some users have reported having problems with the Single Sign On implementation in the Facebook SDK.

If you have experienced problems with this (e.g. the "invalid_key" error), you can easily disable this feature in your **socialize.properties** file

.. literalinclude:: snippets/props_fb_sso.txt
   :language: properties

Or in code at runtime:

.. literalinclude:: ../../../../demo/src/com/socialize/demo/snippets/FacebookSnippets.java
	:start-after: begin-snippet-2
	:end-before: end-snippet-2

.. include:: footer.inc

redpajama_set_name: RedPajamaGithub


text:
using System;

namespace _04.Bubble_Sort
{
    public class Startup
    {
        public static void Main()
        {
            Bubble bubble = new Bubble(new int[] { 4, 51, 9, 42, 7 });
            Console.WriteLine(string.Join(", ", bubble.Sort()));
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>uk.ac.susx.tag</groupId>
    <artifactId>demographyframework</artifactId>
    <inceptionYear>2015</inceptionYear>
    <version>2.2.0</version>
    <packaging>jar</packaging>

    <parent>
        <version>1.0.3</version>
        <groupId>uk.ac.susx.tag</groupId>
        <artifactId>tag-dist</artifactId>
        <relativePath>../tag-dist</relativePath>
    </parent>

    <dependencies>
        <dependency>
            <groupId>net.sf.opencsv</groupId>
            <artifactId>opencsv</artifactId>
            <version>2.3</version>
        </dependency>
        <dependency>
            <!--Used for encoding objects as JSON strings. Used on tweets, and classifiers. See ModelState class and jsonhandling package.-->
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.2.4</version>
        </dependency>
        <dependency>
            <groupId>uk.ac.susx.tag</groupId>
            <artifactId>classificationframework</artifactId>
            <version>5.10.3</version>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-simple</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <!--Essential java utilities, including sorting and easy data structure creation-->
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>14.0.1</version>
        </dependency>

    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.17</version>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>1.6</version>
                <configuration>

                    <quiet>false</quiet>

                    <inceptionYear>${project.inceptionYear}</inceptionYear>
                    <organizationName>CASM Consulting</organizationName>
                    <licenseName>apache_v2</licenseName>
                    <roots>
                        <root>src</root>
                    </roots>

                    <includes>
                        <include>**/*.java</include>
                        <include>**/*.js</include>
                        <include>**/*.css</include>
                        <include>**/*.html</include>
                        <include>**/*.sql</include>
                        <include>**/*.py</include>
                    </includes>

                    <descriptionTemplate>${basedir}/src/license/desc.ftl</descriptionTemplate>

                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
/**
 * \file ssl_cookie.h
 *
 * \brief DTLS cookie callbacks implementation
 */
/*
 *  Copyright The Mbed TLS Contributors
 *  SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
 *
 *  This file is provided under the Apache License 2.0, or the
 *  GNU General Public License v2.0 or later.
 *
 *  **********
 *  Apache License 2.0:
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may
 *  not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 *  **********
 *
 *  **********
 *  GNU General Public License v2.0 or later:
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 *  **********
 */
#ifndef MBEDTLS_SSL_COOKIE_H
#define MBEDTLS_SSL_COOKIE_H

#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif

#include "ssl.h"

#if defined(MBEDTLS_THREADING_C)
#include "threading.h"
#endif

/**
 * \name SECTION: Module settings
 *
 * The configuration options you can set for this module are in this section.
 * Either change them in config.h or define them on the compiler command line.
 * \{
 */
#ifndef MBEDTLS_SSL_COOKIE_TIMEOUT
#define MBEDTLS_SSL_COOKIE_TIMEOUT     60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */
#endif

/* \} name SECTION: Module settings */

#ifdef __cplusplus
extern "C" {
#endif

/**
 * \brief          Context for the default cookie functions.
 */
typedef struct mbedtls_ssl_cookie_ctx
{
    mbedtls_md_context_t    hmac_ctx;   /*!< context for the HMAC portion   */
#if !defined(MBEDTLS_HAVE_TIME)
    unsigned long   serial;     /*!< serial number for expiration   */
#endif
    unsigned long   timeout;    /*!< timeout delay, in seconds if HAVE_TIME,
                                     or in number of tickets issued */

#if defined(MBEDTLS_THREADING_C)
    mbedtls_threading_mutex_t mutex;
#endif
} mbedtls_ssl_cookie_ctx;

/**
 * \brief          Initialize cookie context
 */
void mbedtls_ssl_cookie_init( mbedtls_ssl_cookie_ctx *ctx );

/**
 * \brief          Setup cookie context (generate keys)
 */
int mbedtls_ssl_cookie_setup( mbedtls_ssl_cookie_ctx *ctx,
                      int (*f_rng)(void *, unsigned char *, size_t),
                      void *p_rng );

/**
 * \brief          Set expiration delay for cookies
 *                 (Default MBEDTLS_SSL_COOKIE_TIMEOUT)
 *
 * \param ctx      Cookie contex
 * \param delay    Delay, in seconds if HAVE_TIME, or in number of cookies
 *                 issued in the meantime.
 *                 0 to disable expiration (NOT recommended)
 */
void mbedtls_ssl_cookie_set_timeout( mbedtls_ssl_cookie_ctx *ctx, unsigned long delay );

/**
 * \brief          Free cookie context
 */
void mbedtls_ssl_cookie_free( mbedtls_ssl_cookie_ctx *ctx );

/**
 * \brief          Generate cookie, see \c mbedtls_ssl_cookie_write_t
 */
mbedtls_ssl_cookie_write_t mbedtls_ssl_cookie_write;

/**
 * \brief          Verify cookie, see \c mbedtls_ssl_cookie_write_t
 */
mbedtls_ssl_cookie_check_t mbedtls_ssl_cookie_check;

#ifdef __cplusplus
}
#endif

#endif /* ssl_cookie.h */


text:
# Find Path and Library for AntTweakBar-Win32
FIND_PATH(IPP_INCLUDE_DIR ipp.h
	"C:/Program Files/Intel/Composer XE 2011 SP1/ipp/include"
	DOC "Path to Intel Parallel Primitives ipp headers"
	)
FIND_LIBRARY(IPP_LIBRARY
	NAMES ipps.lib
	PATHS "C:/Program Files/Intel/Composer XE 2011 SP1/ipp/lib/ia32"
	DOC "Path to the Intel Parallel Primitives ipp  win32 library"
	)


text:
package config;

/**
 * Created by Administrator on 2017/10/24.
 */
public class Config {
    public static String THINGSBOARD_URL = "39.104.84.131";
    public static int THINGSBOARD_PORT = 8080;
    public static String USER_NAME = "tenant@thingsboard.org";
    public static String PASSWORD = "tenant";
    //public static String ROCKETMQURL = "10.108.219.158:9876";

    public static String MQTT_BROKER = "tcp://10.108.218.64:1883";

    public static String TOPIC = "iotTest";
    public static String TAG = "iot";
    public static String REDISDEVICESKEY = "devices";
}


text:
package no.nordicsemi.puckcentral.adapters;

import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import org.droidparts.adapter.holder.ViewHolder;
import org.droidparts.annotation.inject.InjectView;

import no.nordicsemi.puckcentral.R;

public class TriggerViewHolder extends ViewHolder {

    @InjectView(id = R.id.tvTriggerName)
    public TextView mTvTriggerName;

    @InjectView(id = R.id.tvTriggerActions)
    public TextView mTvTriggerActions;

    @InjectView(id = R.id.btnRemoveRuleFromPuck)
    public Button mBtnRemoveRuleFromPuck;

    public TriggerViewHolder(View view) {
        super(view);
    }
}


text:
'use strict';

var chalk    = require('chalk');
var Task     = require('../models/task');
var Builder  = require('../models/builder');

module.exports = Task.extend({
  // Options: String outputPath
  run: function(options) {
    var ui        = this.ui;
    var analytics = this.analytics;

    ui.startProgress(chalk.green('Building'), chalk.green('.'));

    var builder = new Builder({
      ui: ui,
      outputPath: options.outputPath,
      environment: options.environment,
      project: this.project
    });

    var annotation = {
      type: 'initial',
      reason: 'build',
      primaryFile: null,
      changedFiles: []
    };

    return builder.build(null, annotation)
      .then(function(results) {
        var totalTime = results.totalTime / 1e6;

        analytics.track({
          name:    'ember build',
          message: totalTime + 'ms'
        });

        /*
         * We use the `rebuild` category in our analytics setup for both builds
         * and rebuilds. This is a bit confusing, but the actual thing we
         * delineate on in the reports is the `variable` value below. This is
         * used both here and in `lib/models/watcher.js`.
         */
        analytics.trackTiming({
          category: 'rebuild',
          variable: 'build time',
          label:    'broccoli build time',
          value:    parseInt(totalTime, 10)
        });
      })
      .finally(function() {
        ui.stopProgress();
        return builder.cleanup();
      })
      .then(function() {
        ui.writeLine(chalk.green('Built project successfully. Stored in "' +
          options.outputPath + '".'));
      })
      .catch(function(err) {
        ui.writeLine(chalk.red('Build failed.'));

        throw err;
      });
  }
});


text:
from os import path
from tardis.settings_changeme import *

# Database settings
DATABASES = {
    'default': {
        # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'ENGINE': 'django.db.backends.sqlite3',
        # Name of the database to use. For SQLite, it's the full path.
        'NAME': '/home/user/CoreTardis/tardis.sql',
        'USER': '',
        'PASSWORD': '',
        'HOST': '',
        'PORT': '',
    }
}

# Root URLs in HPCTardi
ROOT_URLCONF = 'tardis.apps.hpctardis.urls'

# extend template directory to TEMPLATE_DIRS
tmp = list(TEMPLATE_DIRS)
tmp.append(path.join(path.dirname(__file__),
                     'apps/hpctardis/publish/').replace('\\', '/'),
    )
tmp.append(path.join(path.dirname(__file__),
                     'tardis_portal/publish/').replace('\\', '/'),
    )
TEMPLATE_DIRS = tuple(tmp)

# Post Save Filters
tmp = list(POST_SAVE_FILTERS)
tmp.append(("tardis.apps.microtardis.filters.exiftags.make_filter", ["MICROSCOPY_EXIF","http://rmmf.isis.rmit.edu.au/schemas"]))
tmp.append(("tardis.apps.microtardis.filters.spctags.make_filter", ["EDAXGenesis_SPC","http://rmmf.isis.rmit.edu.au/schemas"]))
tmp.append(("tardis.apps.hpctardis.filters.metadata.make_filter", ["",""]))
POST_SAVE_FILTERS = tuple(tmp)

ADMIN_MEDIA_STATIC_DOC_ROOT = path.join(path.dirname(__file__),'../eggs/Django-1.3-py2.6.egg/django/contrib/admin/media/').replace('\\', '/')

STAGING_PATH = path.abspath('/home/user/dcweb.staging/').replace('\\', '/')
STAGING_PROTOCOL = 'localdb'

# Directory path for image thumbnails
THUMBNAILS_PATH = path.abspath(path.join(path.dirname(__file__),
    '../var/thumbnails/')).replace('\\', '/')

INSTALLED_APPS = (TARDIS_APP_ROOT+".hpctardis",) + INSTALLED_APPS

# Template loaders
TEMPLATE_LOADERS = (
    'tardis.apps.microtardis.templates.loaders.app_specific.Loader',
    'django.template.loaders.app_directories.Loader',
    'django.template.loaders.filesystem.Loader',
)

# HPCTardis Media
HPC_STATIC_URL_ROOT = '/static'
HPC_STATIC_DOC_ROOT = path.join(path.dirname(__file__),
                               'apps/hpctardis/static').replace('\\', '/')

# logging levels are: DEBUG, INFO, WARN, ERROR, CRITICAL
SYSTEM_LOG_LEVEL = 'INFO'
MODULE_LOG_LEVEL = 'INFO'

SYSTEM_LOG_FILENAME = '/var/www/tardis/request.log'
MODULE_LOG_FILENAME = '/var/www/tardis/tardis.log'

EMAIL_PORT = 587
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'eresearch.rmit@gmail.com'
EMAIL_HOST_PASSWORD = 'PASSWORD'
EMAIL_USE_TLS = True
EMAIL_LINK_HOST = "http://gaia1.isis.rmit.edu.au:8890"

# The anzsrc codes for subject for all collections
COLLECTION_SUBJECTS = ['0307','0204']
GROUP = "RMIT University"
GROUP_ADDRESS = "Applied Science, RMIT University, Melbourne VIC 3000, Australia"
ACCESS_RIGHTS= "Contact the researchers/parties associated with this dataset"
RIGHTS= "Terms and conditions applies as specified by the researchers"

PRIVATE_DATAFILES = True


text:
/*
 * SendTextAction.h
 *
 *  Created on: Jun 27, 2013
 *      Author: augcampos
 */

#ifndef SENDTEXTACTION_H_
#define SENDTEXTACTION_H_

#include "AbstractManagerAction.h"

namespace asteriskcpp {

    /**
     * Sends a text message to a given channel while in a call.
     * An active channel and a text message are required in order to success.

     * It is defined in main/manager.c.

     * Available since Asterisk 1.6.0
     *
     * @author Laureano
     * @version $Id$
     * @since 1.0.0
     */

    class SendTextAction : public AbstractManagerAction {
    public:

        /**
         * Creates a new empty SendTextAction.
         */
        SendTextAction();

        /**
         * Creates a new SendTextAction that sends the given message to the given channel.
         *
         * @param channel the name of the channel to send the message to.
         * @param message the message to send.
         */
        SendTextAction(const std::string& channel, const std::string& message);

        virtual ~SendTextAction();

        /**
         * Returns the name of the channel to send the message to.
         *
         * @return the name of the channel to send the message to.
         */
        const std::string& getChannel() const;

        /**
         * Sets the name of the channel to send the message to.
         *
         * @param channel the name of the channel to send the message to.
         */
        void setChannel(const std::string& channel);

        /**
         * Returns the message to send.
         *
         * @return the message to send.
         */
        const std::string& getMessage() const;

        void setMessage(const std::string& message);
    };

} //NAMESPACE

#endif /*SENDTEXTACTION_H_*/


text:
require File.expand_path('../application', __FILE__)

# Initialize the rails application
ElitistArmory::Application.initialize!


text:
import bpy

# Creates an operator. This operator moves the selected object
# one unity along the X axis.
class MoveOperator(bpy.types.Operator):
    bl_idname = "object.move_operator"
    bl_label = "Move Operator"

    def execute(self, context):
        context.active_object.location.x += 1.0
        # print output goes to the system console, not to the UI
        print("The active object was moved 1 unity along the X axis")
        return {'FINISHED'}

# Registers the operator
def register():
    bpy.utils.register_class(MoveOperator)

if __name__ == "__main__":
    register()

# Run the script to register it in Blender, then press space in the 3D view
# and search the operator in the text box. Click on it to execute. The selected
# object must move along the X axis.


text:
package kieker.common.record.flow.trace.concurrency.monitor;

import kieker.common.record.factory.IRecordFactory;
import kieker.common.record.io.IValueDeserializer;

/**
 * @author Jan Waller
 *
 * @since 1.8
 */
public final class MonitorEntryEventFactory implements IRecordFactory<MonitorEntryEvent> {

	@Override
	public MonitorEntryEvent create(final IValueDeserializer deserializer) {
		return new MonitorEntryEvent(deserializer);
	}

	@Override
	@Deprecated
	public MonitorEntryEvent create(final Object[] values) {
		return new MonitorEntryEvent(values);
	}

	public int getRecordSizeInBytes() {
		return MonitorEntryEvent.SIZE;
	}
}


text:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/assets/google-code-prettify/google-code-prettify/prettify.js"></script>
<script type="text/javascript" src="/assets/js/app.js"></script>


text:
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { PLAYLIST_DATA } from './playlist';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
  title = 'Stats Bar';
  playlist_data = PLAYLIST_DATA;
  items: { name: string, playlistId: string }[] = null;

  constructor(private router: Router) { }

  ngOnInit() {
    if (this.playlist_data.length > 0) {
      this.selectPlaylist(0); // Select first one
    }
  }

  selectPlaylist(index: number): void {
    this.items = this.playlist_data[index].items;
  }

  onItemChange(selectedItem: { value: string }): void {
    this.router.navigate(['/playlist', selectedItem.value])
  }

  onMenuClick(index: number): void {
    this.items = this.playlist_data[index].items;
  }

}


text:
#ifndef QUERY_TEST_H_
#define QUERY_TEST_H_

#include "base/logging.h"
#include <boost/assign/list_of.hpp>
#include <exception>
#include <boost/lexical_cast.hpp>
#include <boost/bind.hpp>
#include <boost/assign/list_of.hpp>
#include "base/task.h"
#include "base/parse_object.h"
#include "io/event_manager.h"
#include "sandesh/sandesh_types.h"
#include "sandesh/sandesh.h"
#include "sandesh/sandesh_session.h"
#include "query.h"
#include "cdb_if.h"

class CdbIfMock : public CdbIf {
public:
    CdbIfMock(boost::asio::io_service *ioservice,
            GenDb::GenDbIf::DbErrorHandler handler) :
        CdbIf(ioservice, handler, "127.0.0.1", 9160) { initialize_tables(); };
    ~CdbIfMock() { MessageTable.clear();}

    bool Db_Init();
    bool Db_AddSetTablespace(const std::string& tablespace,const std::string& replication_factor = "1");
    bool Db_GetMultiRow(std::map<std::string, std::vector<GenDb::ColElement> >& ret,
                const std::string& cfname, const std::vector<std::string>& key);

private:
    void initialize_tables();
    std::vector<std::map<std::string, std::string> > MessageTable;
    // return data for a particular MessageTable index
    bool Db_GetStringIndexRange(std::string index_field, std::vector<GenDb::Column>&,const GenDb::Cf&, const GenDb::ColumnRange&, const GenDb::RowKeyRange&);
};

#endif


text:
#include "config.h"

#if ENABLE(DEVICE_ORIENTATION)
#include "DeviceOrientationClientEfl.h"

#include "NotImplemented.h"

namespace WebCore {

DeviceOrientationClientEfl::DeviceOrientationClientEfl()
{
}

DeviceOrientationClientEfl::~DeviceOrientationClientEfl()
{
}

void DeviceOrientationClientEfl::deviceOrientationControllerDestroyed()
{
    delete this;
}

void DeviceOrientationClientEfl::setController(DeviceOrientationController* controller)
{
    m_controller = controller;
}

void DeviceOrientationClientEfl::startUpdating()
{
    notImplemented();
}

void DeviceOrientationClientEfl::stopUpdating()
{
    notImplemented();
}

DeviceOrientationData* DeviceOrientationClientEfl::lastOrientation() const
{
    notImplemented();
    return 0;
}

}
#endif


text:
grind.define_group("elementum", 11144)
grind.define_delimiter("elementum", [==[(\d{2}:\d{2}:\d{2})]==])
grind.define_format("elementum", "default", [==[(\[[A-Z]\])\s{1}([A-Za-z]+):\s{1}(.*)]==])
grind.define_extractor("elementum", "default",
  function(context, module, content, timestamp)
    print("\tContext: " .. context)
    print("\tModule: " .. module)
    print("\tMessage: " .. content)

    return {
      timestamp = timestamp,
      context = context,
      module = module
    }, content
  end
)


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/color_white">
    <!-- 正常组 -->
    <include layout="@layout/item_parent"/>
    <!-- 失效组 -->
    <include layout="@layout/item_parent_invalid"/>
</LinearLayout>


text:
import os
from . import FSQTestCase
from .internal import normalize
from . import constants as _test_c

# FROM PAPA-BEAR IMPORT THE FOLLOWING
from .. import path as _p, constants as _c, FSQPathError, FSQCoerceError

########## INTERNAL VALIDATION METHODS
def _valid_path(*args):
    return os.path.join(_c.FSQ_ROOT, *args)

########## EXPOSED TEST CASES
class TestPath(FSQTestCase):
    def _gammit(self, verifier, v_args, fn, *args):
        for i in _test_c.NORMAL + _test_c.NOT_NORMAL +\
                tuple([_test_c.NON_ASCII]):
            _test_c.COUNT += 1
            self.assertEquals(fn(i, *args), verifier(i, *v_args))
            # verify string coerce
            _test_c.COUNT += 1
            self.assertEquals(fn(i.encode('utf8'), *args), verifier(i,
                              *v_args))
        for i in _test_c.ILLEGAL_NAMES:
            _test_c.COUNT += 1
            self.assertRaises(FSQPathError, fn, i, *args)
        for i in _test_c.MODES:
            _test_c.COUNT += 1
            # verify integer coerce
            self.assertEquals(fn(i, *args), verifier(unicode(i), *v_args))
            _test_c.COUNT += 1
            # verify float coerce
            self.assertEquals(fn(float(i), *args), verifier(unicode(float(i)),
                              *v_args))

        _test_c.COUNT += 1
        # verify non-coercable char yields coerce-error
        self.assertRaises(FSQCoerceError, fn, _test_c.ILLEGAL_NAME, *args)

    def _second_level_test(self, fn, const, do_item=False):
        for root in ( _test_c.ROOT1, _test_c.ROOT2, ):
            _c.FSQ_ROOT = root
            for val in _test_c.NORMAL:
                setattr(_c, const, val)
                if do_item:
                    for item in _test_c.NORMAL:
                        self._gammit(_valid_path, [ val, item, ], fn, item)
                else:
                    self._gammit(_valid_path, [ val, ], fn)

        # verify failure on thing set to non-allowed name
        for val in _test_c.ILLEGAL_NAMES:
            normalize()
            setattr(_c, const, val)
            if do_item:
                self.assertRaises(FSQPathError, fn, *_test_c.NORMAL[:2])
                normalize()
                self.assertRaises(FSQPathError, fn, _test_c.NORMAL[0], val)
            else:
                self.assertRaises(FSQPathError, fn, _test_c.NORMAL[0])

        # verify illegal name for thing on non-coercable name
        normalize()
        setattr(_c, const, _test_c.ILLEGAL_NAME)
        if do_item:
            self.assertRaises(FSQCoerceError, fn, *_test_c.NORMAL[:2])
            normalize()
            self.assertRaises(FSQCoerceError, fn, _test_c.NORMAL[0],
                              _test_c.ILLEGAL_NAME)
        else:
            self.assertRaises(FSQCoerceError, fn, _test_c.NORMAL[0])

    def test_valid_name(self):
        self._gammit(lambda x:x, [], _p.valid_name)

    def test_base(self):
        for root in ( _test_c.ROOT1, _test_c.ROOT2, ):
            _c.FSQ_ROOT = root
            self._gammit(_valid_path, [], _p.base)

    def test_tmp(self):
        self._second_level_test(_p.tmp, 'FSQ_TMP')

    def test_queue(self):
        self._second_level_test(_p.queue, 'FSQ_QUEUE')

    def test_fail(self):
        self._second_level_test(_p.fail, 'FSQ_FAIL')

    def test_done(self):
        self._second_level_test(_p.done, 'FSQ_DONE')

    def test_down(self):
        self._second_level_test(_p.down, 'FSQ_DOWN')

    def test_trigger(self):
        self._second_level_test(_p.trigger, 'FSQ_TRIGGER')

    def test_item(self):
        self._second_level_test(_p.item, 'FSQ_QUEUE', do_item=True)


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="5sp"
        android:text="Are you sure you wish to logout?"/>

</LinearLayout>


text:
namespace chromeos {
namespace {

// The delay of triggering initialization of the device policy subsystem
// after the login screen is initialized. This makes sure that device policy
// network requests are made while the system is idle waiting for user input.
constexpr int64_t kPolicyServiceInitializationDelayMilliseconds = 100;

void ScheduleCompletionCallbacks(std::vector<base::OnceClosure>&& callbacks) {
  for (auto& callback : callbacks) {
    if (callback.is_null())
      continue;

    base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
                                                  std::move(callback));
  }
}

}  // namespace

LoginDisplayHostCommon::LoginDisplayHostCommon()
    : keep_alive_(KeepAliveOrigin::LOGIN_DISPLAY_HOST_WEBUI,
                  KeepAliveRestartOption::DISABLED) {
  // Close the login screen on NOTIFICATION_APP_TERMINATING (for the case where
  // shutdown occurs before login completes).
  registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING,
                 content::NotificationService::AllSources());
  BrowserList::AddObserver(this);
}

LoginDisplayHostCommon::~LoginDisplayHostCommon() {
  ScheduleCompletionCallbacks(std::move(completion_callbacks_));
}

void LoginDisplayHostCommon::BeforeSessionStart() {
  session_starting_ = true;
}

void LoginDisplayHostCommon::Finalize(base::OnceClosure completion_callback) {
  // If finalize is called twice the LoginDisplayHost instance will be deleted
  // multiple times.
  CHECK(!is_finalizing_);
  is_finalizing_ = true;

  completion_callbacks_.push_back(std::move(completion_callback));
  OnFinalize();
}

void LoginDisplayHostCommon::FinalizeImmediately() {
  CHECK(!is_finalizing_);
  CHECK(!shutting_down_);
  is_finalizing_ = true;
  shutting_down_ = true;
  OnFinalize();
  Cleanup();
  delete this;
}

AppLaunchController* LoginDisplayHostCommon::GetAppLaunchController() {
  return app_launch_controller_.get();
}

void LoginDisplayHostCommon::StartUserAdding(
    base::OnceClosure completion_callback) {
  completion_callbacks_.push_back(std::move(completion_callback));
  OnStartUserAdding();
}

void LoginDisplayHostCommon::StartSignInScreen() {
  PrewarmAuthentication();

  const user_manager::UserList& users =
      user_manager::UserManager::Get()->GetUsers();

  // Fix for users who updated device and thus never passed register screen.
  // If we already have users, we assume that it is not a second part of
  // OOBE. See http://crosbug.com/6289
  if (!StartupUtils::IsDeviceRegistered() && !users.empty()) {
    VLOG(1) << "Mark device registered because there are remembered users: "
            << users.size();
    StartupUtils::MarkDeviceRegistered(base::OnceClosure());
  }

  // Initiate device policy fetching.
  policy::BrowserPolicyConnectorChromeOS* connector =
      g_browser_process->platform_part()->browser_policy_connector_chromeos();
  connector->ScheduleServiceInitialization(
      kPolicyServiceInitializationDelayMilliseconds);

  // Inform wizard controller that login screen has started.
  // TODO(crbug.com/1064271): Move this to OnStartSignInScreen().
  if (WizardController::default_controller())
    WizardController::default_controller()->LoginScreenStarted();

  // Run UI-specific logic.
  OnStartSignInScreen();

  // Enable status area after starting sign-in screen, as it may depend on the
  // UI being visible.
  SetStatusAreaVisible(true);
}

void LoginDisplayHostCommon::PrewarmAuthentication() {
  auth_prewarmer_ = std::make_unique<AuthPrewarmer>();
  auth_prewarmer_->PrewarmAuthentication(base::BindOnce(
      &LoginDisplayHostCommon::OnAuthPrewarmDone, weak_factory_.GetWeakPtr()));
}

void LoginDisplayHostCommon::StartAppLaunch(const std::string& app_id,
                                            bool diagnostic_mode,
                                            bool is_auto_launch) {
  VLOG(1) << "Login >> start app launch.";
  SetStatusAreaVisible(false);

  // Wait for the |CrosSettings| to become either trusted or permanently
  // untrusted.
  const CrosSettingsProvider::TrustedStatus status =
      CrosSettings::Get()->PrepareTrustedValues(base::BindOnce(
          &LoginDisplayHostCommon::StartAppLaunch, weak_factory_.GetWeakPtr(),
          app_id, diagnostic_mode, is_auto_launch));
  if (status == CrosSettingsProvider::TEMPORARILY_UNTRUSTED)
    return;

  if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) {
    // If the |CrosSettings| are permanently untrusted, refuse to launch a
    // single-app kiosk mode session.
    LOG(ERROR) << "Login >> Refusing to launch single-app kiosk mode.";
    SetStatusAreaVisible(true);
    return;
  }

  if (system::DeviceDisablingManager::IsDeviceDisabledDuringNormalOperation()) {
    // If the device is disabled, bail out. A device disabled screen will be
    // shown by the DeviceDisablingManager.
    return;
  }

  OnStartAppLaunch();

  app_launch_controller_ = std::make_unique<AppLaunchController>(
      app_id, diagnostic_mode, this, GetOobeUI());

  app_launch_controller_->StartAppLaunch(is_auto_launch);
}

void LoginDisplayHostCommon::StartDemoAppLaunch() {
  VLOG(1) << "Login >> starting demo app.";
  SetStatusAreaVisible(false);

  demo_app_launcher_ = std::make_unique<DemoAppLauncher>();
  demo_app_launcher_->StartDemoAppLaunch();
}

void LoginDisplayHostCommon::StartArcKiosk(const AccountId& account_id) {
  VLOG(1) << "Login >> start ARC kiosk.";
  SetStatusAreaVisible(false);
  arc_kiosk_controller_ =
      std::make_unique<ArcKioskController>(this, GetOobeUI());
  arc_kiosk_controller_->StartArcKiosk(account_id);

  OnStartAppLaunch();
}

void LoginDisplayHostCommon::StartWebKiosk(const AccountId& account_id) {
  SetStatusAreaVisible(false);

  // Wait for the |CrosSettings| to become either trusted or permanently
  // untrusted.
  const CrosSettingsProvider::TrustedStatus status =
      CrosSettings::Get()->PrepareTrustedValues(
          base::BindOnce(&LoginDisplayHostCommon::StartWebKiosk,
                         weak_factory_.GetWeakPtr(), account_id));
  if (status == CrosSettingsProvider::TEMPORARILY_UNTRUSTED)
    return;

  if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) {
    // If the |CrosSettings| are permanently untrusted, refuse to launch a
    // single-app kiosk mode session.
    LOG(ERROR) << "Login >> Refusing to launch single-app kiosk mode.";
    SetStatusAreaVisible(true);
    return;
  }

  if (system::DeviceDisablingManager::IsDeviceDisabledDuringNormalOperation()) {
    // If the device is disabled, bail out. A device disabled screen will be
    // shown by the DeviceDisablingManager.
    return;
  }
  OnStartAppLaunch();

  web_kiosk_controller_ =
      std::make_unique<WebKioskController>(this, GetOobeUI());
  web_kiosk_controller_->StartWebKiosk(account_id);
}

void LoginDisplayHostCommon::CompleteLogin(const UserContext& user_context) {
  if (GetExistingUserController())
    GetExistingUserController()->CompleteLogin(user_context);
}

void LoginDisplayHostCommon::OnGaiaScreenReady() {
  if (GetExistingUserController()) {
    GetExistingUserController()->OnGaiaScreenReady();
  } else {
    // Used to debug crbug.com/902315. Feel free to remove after that is fixed.
    LOG(ERROR) << "OnGaiaScreenReady: there is no existing user controller";
  }
}

void LoginDisplayHostCommon::SetDisplayEmail(const std::string& email) {
  if (GetExistingUserController())
    GetExistingUserController()->SetDisplayEmail(email);
}

void LoginDisplayHostCommon::SetDisplayAndGivenName(
    const std::string& display_name,
    const std::string& given_name) {
  if (GetExistingUserController())
    GetExistingUserController()->SetDisplayAndGivenName(display_name,
                                                        given_name);
}

void LoginDisplayHostCommon::LoadWallpaper(const AccountId& account_id) {
  WallpaperControllerClient::Get()->ShowUserWallpaper(account_id);
}

void LoginDisplayHostCommon::LoadSigninWallpaper() {
  WallpaperControllerClient::Get()->ShowSigninWallpaper();
}

bool LoginDisplayHostCommon::IsUserWhitelisted(const AccountId& account_id) {
  if (!GetExistingUserController())
    return true;
  return GetExistingUserController()->IsUserWhitelisted(account_id);
}

void LoginDisplayHostCommon::CancelPasswordChangedFlow() {
  if (GetExistingUserController())
    GetExistingUserController()->CancelPasswordChangedFlow();

  OnCancelPasswordChangedFlow();
}

void LoginDisplayHostCommon::MigrateUserData(const std::string& old_password) {
  if (GetExistingUserController())
    GetExistingUserController()->MigrateUserData(old_password);
}

void LoginDisplayHostCommon::ResyncUserData() {
  if (GetExistingUserController())
    GetExistingUserController()->ResyncUserData();
}

void LoginDisplayHostCommon::OnBrowserAdded(Browser* browser) {
  // Browsers created before session start (windows opened by extensions, for
  // example) are ignored.
  if (session_starting_) {
    // OnBrowserAdded is called when the browser is created, but not shown yet.
    // Lock window has to be closed at this point so that a browser window
    // exists and the window can acquire input focus.
    OnBrowserCreated();
    registrar_.RemoveAll();
    BrowserList::RemoveObserver(this);
  }
}

void LoginDisplayHostCommon::Observe(
    int type,
    const content::NotificationSource& source,
    const content::NotificationDetails& details) {
  if (type == chrome::NOTIFICATION_APP_TERMINATING)
    ShutdownDisplayHost();
}

void LoginDisplayHostCommon::OnCancelPasswordChangedFlow() {}

void LoginDisplayHostCommon::OnAuthPrewarmDone() {
  auth_prewarmer_.reset();
}

void LoginDisplayHostCommon::ShutdownDisplayHost() {
  if (shutting_down_)
    return;
  shutting_down_ = true;

  Cleanup();
  base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
}

void LoginDisplayHostCommon::OnStartSignInScreenCommon() {
  kiosk_app_menu_controller_.SendKioskApps();
}

void LoginDisplayHostCommon::ShowGaiaDialogCommon(
    const AccountId& prefilled_account) {
  DCHECK(GetOobeUI());

  if (prefilled_account.is_valid()) {
    // Make sure gaia displays |account| if requested.
    if (!GetLoginDisplay()->delegate()->IsSigninInProgress()) {
      GetOobeUI()->GetView<GaiaScreenHandler>()->ShowGaiaAsync(
          prefilled_account);
    }
    LoadWallpaper(prefilled_account);
  } else {
    if (GetOobeUI()->current_screen() != GaiaView::kScreenId) {
      GetOobeUI()->GetView<GaiaScreenHandler>()->ShowGaiaAsync(
          EmptyAccountId());
    }
    LoadSigninWallpaper();
  }
}
void LoginDisplayHostCommon::Cleanup() {
  ProfileHelper::Get()->ClearSigninProfile(base::DoNothing());
  registrar_.RemoveAll();
  BrowserList::RemoveObserver(this);
}

}  // namespace chromeos


text:
package org.simpleframework.xml.core;

import java.io.IOException;
import java.io.InputStream;

public class Base64InputStream extends InputStream {

   private char[] encoded;
   private byte[] decoded;
   private byte[] temp;
   private int count;

   public Base64InputStream(String source) {
      this.encoded = source.toCharArray();
      this.temp = new byte[1];
   }

   @Override
   public int read() throws IOException {
      int count = read(temp);

      if(count == -1) {
         return -1;
      }
      return temp[0] & 0xff;
   }

   @Override
   public int read(byte[] array, int off, int len) throws IOException {
      if(decoded == null) {
         decoded = Base64Encoder.decode(encoded);
      }
      if(count >= decoded.length) {
         return -1;
      }
      int size = Math.min(len,  decoded.length - count);

      if(size > 0) {
         System.arraycopy(decoded, count, array, off, size);
         count += size;
      }
      return size;
    }

   @Override
   public String toString() {
      return new String(decoded);
   }
}


text:
package com.pablodomingos.classes.rps.servicos;

import java.time.LocalDateTime;
import com.pablodomingos.conversores.LocalDateTimeConversor;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamConverter;

@XStreamAlias("GerarNfseResposta")
public class GerarNFSeResposta {
  @XStreamAlias("xmlns")
  @XStreamAsAttribute
  private String xmlns = "http://www.abrasf.org.br/nfse.xsd";

  @XStreamAlias("NumeroLote")
  private Long numeroLote;

  @XStreamAlias("DataRecebimento")
  @XStreamConverter(LocalDateTimeConversor.class)
  private LocalDateTime dataRecebimento;

  @XStreamAlias("Protocolo")
  private String protocolo;

  @XStreamAlias("ListaMensagemRetorno")
  private ListaMensagemRetorno listaMensagemRetorno;

  public ListaMensagemRetorno getListaMensagemRetornoLote() {
    return listaMensagemRetornoLote;
  }

  public void setListaMensagemRetornoLote(ListaMensagemRetorno listaMensagemRetornoLote) {
    this.listaMensagemRetornoLote = listaMensagemRetornoLote;
  }

  @XStreamAlias("ListaMensagemRetornoLote")
  private ListaMensagemRetorno listaMensagemRetornoLote;

  @XStreamAlias("ListaNfse")
  private ListaNfse listaNfse;

  public Long getNumeroLote() {
    return numeroLote;
  }

  public void setNumeroLote(Long numeroLote) {
    this.numeroLote = numeroLote;
  }

  public LocalDateTime getDataRecebimento() {
    return dataRecebimento;
  }

  public void setDataRecebimento(LocalDateTime dataRecebimento) {
    this.dataRecebimento = dataRecebimento;
  }

  public String getProtocolo() {
    return protocolo;
  }

  public void setProtocolo(String protocolo) {
    this.protocolo = protocolo;
  }

  public String getXmlns() {
    return xmlns;
  }

  public void setXmlns(String xmlns) {
    this.xmlns = xmlns;
  }

  public ListaMensagemRetorno getListaMensagemRetorno() {
    return listaMensagemRetorno;
  }

  public void setListaMensagemRetorno(ListaMensagemRetorno listaMensagemRetorno) {
    this.listaMensagemRetorno = listaMensagemRetorno;
  }

  public ListaNfse getListaNfse() {
    return listaNfse;
  }

  public void setListaNfse(ListaNfse listaNfse) {
    this.listaNfse = listaNfse;
  }

  public static GerarNFSeResposta toPojo(String xml) {
    XStream xstream = new XStream();
    xstream.setMode(XStream.NO_REFERENCES);
    xstream.autodetectAnnotations(true);
    xstream.ignoreUnknownElements();
    xstream.alias("GerarNfseResposta", GerarNFSeResposta.class);
    xstream.alias("Nfse", NFSe.class);
    GerarNFSeResposta gerarNfseResposta = (GerarNFSeResposta) xstream.fromXML(xml);
    return gerarNfseResposta;
  }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:minWidth="30pt"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/result_date"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:padding="1pt"
            android:singleLine="false"
            android:textStyle="bold" />

        <TextView
            android:id="@+id/result_tester"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="top" />

    </LinearLayout>

    <TextView
        android:id="@+id/result_comment"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:padding="1pt" />

    <TextView
        android:id="@+id/result_result"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:minWidth="10pt"
        android:padding="1pt"
        android:textStyle="bold" />

</LinearLayout>


text:
require_relative 'git_hub_api'

module GitHubApi
  class Issue
    attr_accessor :comments, :number, :body, :author, :created_at

    def initialize(octokit_issue, repo)
      @repo       = repo
      @repo_name  = repo.fq_repo_name
      @title      = octokit_issue.title
      @body       = octokit_issue.body
      @number     = octokit_issue.number
      @author     = octokit_issue.user.login
      @created_at = octokit_issue.created_at
      @client     = repo.client
    end

    def comments
      @comments ||= begin
        @octokit_comments = GitHubApi.execute(@client, :issue_comments, @repo_name, @number)
        @octokit_comments.collect do |octokit_comment|
          Comment.new(octokit_comment, self, @repo)
        end
      end
      return @comments
    end

    def assign(user)
      update("assignee" => user)
    end

    def set_milestone(milestone)
      update("milestone" => @repo.milestones[milestone])
    end

    def add_comment(message)
      GitHubApi.execute(@client, :add_comment, @repo_name, @number, message)
    end

    def applied_label?(label_text)
      applied_labels.include?(label_text)
    end

    def add_labels(labels_input)
      labels = labels_input.collect(&:text)
      GitHubApi.execute(@client, :add_labels_to_an_issue, @repo_name, @number, labels)

      labels.each do |l|
        applied_labels[l] = Label.new(@repo, l, self)
      end
    end

    def remove_label(label_name)
      applied_labels.delete(label_name)
      GitHubApi.execute(@client, :remove_label, @repo_name, @number, label_name)
    end

    def applied_labels
      @applied_labels ||= begin
        results = GitHubApi.execute(@client, :labels_for_issue, @repo_name, @number)
        results.each_with_object({}) do |result, h|
          h[result.name] = Label.new(@repo, result.name, self)
        end
      end
    end

    private

    def update(options)
      GitHubApi.execute(@client, :update_issue, @repo_name, @number, @title, @body, options)
    end
  end
end