text:
#ifndef JNI_UTILS_HPP
#define JNI_UTILS_HPP

// Method ID for the java.lang.Object class
extern jmethodID Object_getClass; // ()Ljava/lang/Class;

// Method IDs for the java.lang.Class class
extern jmethodID Class_getComponentType; // ()Ljava/lang/Class;
extern jmethodID Class_newInstance; // ()Ljava/lang/Object;

// Method ID for java.lang.String#getBytes
extern jmethodID String_getBytes; // ()[B

// Method IDs for the java.nio.Buffer class
extern jmethodID Buffer_isDirect; // ()Z
extern jmethodID Buffer_hasArray; // ()Z
extern jmethodID Buffer_array; // ()Ljava/lang/Object;

int initJNIUtils(JNIEnv *env);

bool init(JNIEnv *env, jclass cls, jfieldID& field, const char *name, const char *signature);
bool init(JNIEnv *env, jclass cls, jmethodID& method, const char *name, const char *signature);
bool init(JNIEnv *env, jclass& cls, const char *name);
bool init(JNIEnv *env, const char *className, jclass &globalCls, jmethodID &constructor);

void ThrowByName(JNIEnv *env, const char *name, const char *msg);

bool set(JNIEnv *env, jintArray ja, int index, long value);
bool set(JNIEnv *env, jlongArray ja, int index, long value);
bool set(JNIEnv *env, jfloatArray ja, int index, float value);
char *convertString(JNIEnv *env, jstring js, int *length=NULL);
size_t* convertArray(JNIEnv *env, jlongArray array);

#endif // JNI_UTILS_HPP


text:
#ifndef ART_RUNTIME_DEX_INSTRUCTION_H_
#define ART_RUNTIME_DEX_INSTRUCTION_H_

#include "base/logging.h"
#include "base/macros.h"
#include "globals.h"

typedef uint8_t uint4_t;
typedef int8_t int4_t;

namespace art {

class DexFile;

enum {
  kNumPackedOpcodes = 0x100
};

class Instruction {
 public:
  // NOP-encoded switch-statement signatures.
  enum {
    kPackedSwitchSignature = 0x0100,
    kSparseSwitchSignature = 0x0200,
    kArrayDataSignature = 0x0300,
  };

  struct PACKED(4) PackedSwitchPayload {
    const uint16_t ident;
    const uint16_t case_count;
    const int32_t first_key;
    const int32_t targets[];

   private:
    DISALLOW_COPY_AND_ASSIGN(PackedSwitchPayload);
  };

  struct PACKED(4) SparseSwitchPayload {
    const uint16_t ident;
    const uint16_t case_count;
    const int32_t keys_and_targets[];

   public:
    const int32_t* GetKeys() const {
      return keys_and_targets;
    }

    const int32_t* GetTargets() const {
      return keys_and_targets + case_count;
    }

   private:
    DISALLOW_COPY_AND_ASSIGN(SparseSwitchPayload);
  };

  struct PACKED(4) ArrayDataPayload {
    const uint16_t ident;
    const uint16_t element_width;
    const uint32_t element_count;
    const uint8_t data[];

   private:
    DISALLOW_COPY_AND_ASSIGN(ArrayDataPayload);
  };

  // TODO: the code layout below is deliberate to avoid this enum being picked up by
  //       generate-operator-out.py.
  enum Code
  {  // NOLINT(whitespace/braces)
#define INSTRUCTION_ENUM(opcode, cname, p, f, r, i, a, v) cname = opcode,
#include "dex_instruction_list.h"
    DEX_INSTRUCTION_LIST(INSTRUCTION_ENUM)
#undef DEX_INSTRUCTION_LIST
#undef INSTRUCTION_ENUM
  };

  enum Format {
    k10x,  // op
    k12x,  // op vA, vB
    k11n,  // op vA, #+B
    k11x,  // op vAA
    k10t,  // op +AA
    k20t,  // op +AAAA
    k22x,  // op vAA, vBBBB
    k21t,  // op vAA, +BBBB
    k21s,  // op vAA, #+BBBB
    k21h,  // op vAA, #+BBBB00000[00000000]
    k21c,  // op vAA, thing@BBBB
    k23x,  // op vAA, vBB, vCC
    k22b,  // op vAA, vBB, #+CC
    k22t,  // op vA, vB, +CCCC
    k22s,  // op vA, vB, #+CCCC
    k22c,  // op vA, vB, thing@CCCC
    k32x,  // op vAAAA, vBBBB
    k30t,  // op +AAAAAAAA
    k31t,  // op vAA, +BBBBBBBB
    k31i,  // op vAA, #+BBBBBBBB
    k31c,  // op vAA, thing@BBBBBBBB
    k35c,  // op {vC, vD, vE, vF, vG}, thing@BBBB (B: count, A: vG)
    k3rc,  // op {vCCCC .. v(CCCC+AA-1)}, meth@BBBB
    k51l,  // op vAA, #+BBBBBBBBBBBBBBBB
  };

  enum Flags {
    kBranch   = 0x01,  // conditional or unconditional branch
    kContinue = 0x02,  // flow can continue to next statement
    kSwitch   = 0x04,  // switch statement
    kThrow    = 0x08,  // could cause an exception to be thrown
    kReturn   = 0x10,  // returns, no additional statements
    kInvoke   = 0x20,  // a flavor of invoke
    kUnconditional = 0x40,  // unconditional branch
  };

  enum VerifyFlag {
    kVerifyNone            = 0x00000,
    kVerifyRegA            = 0x00001,
    kVerifyRegAWide        = 0x00002,
    kVerifyRegB            = 0x00004,
    kVerifyRegBField       = 0x00008,
    kVerifyRegBMethod      = 0x00010,
    kVerifyRegBNewInstance = 0x00020,
    kVerifyRegBString      = 0x00040,
    kVerifyRegBType        = 0x00080,
    kVerifyRegBWide        = 0x00100,
    kVerifyRegC            = 0x00200,
    kVerifyRegCField       = 0x00400,
    kVerifyRegCNewArray    = 0x00800,
    kVerifyRegCType        = 0x01000,
    kVerifyRegCWide        = 0x02000,
    kVerifyArrayData       = 0x04000,
    kVerifyBranchTarget    = 0x08000,
    kVerifySwitchTargets   = 0x10000,
    kVerifyVarArg          = 0x20000,
    kVerifyVarArgRange     = 0x40000,
    kVerifyError           = 0x80000,
  };

  // Decodes this instruction, populating its arguments.
  void Decode(uint32_t &vA, uint32_t &vB, uint64_t &vB_wide, uint32_t &vC, uint32_t arg[]) const;

  // Returns the size (in 2 byte code units) of this instruction.
  size_t SizeInCodeUnits() const {
    int result = kInstructionSizeInCodeUnits[Opcode()];
    if (UNLIKELY(result < 0)) {
      return SizeInCodeUnitsComplexOpcode();
    } else {
      return static_cast<size_t>(result);
    }
  }

  // Reads an instruction out of the stream at the specified address.
  static const Instruction* At(const uint16_t* code) {
    DCHECK(code != NULL);
    return reinterpret_cast<const Instruction*>(code);
  }

  // Reads an instruction out of the stream from the current address plus an offset.
  const Instruction* RelativeAt(int32_t offset) const {
    return At(reinterpret_cast<const uint16_t*>(this) + offset);
  }

  // Returns a pointer to the next instruction in the stream.
  const Instruction* Next() const {
    return RelativeAt(SizeInCodeUnits());
  }

  // Returns a pointer to the instruction after this 1xx instruction in the stream.
  const Instruction* Next_1xx() const {
    DCHECK(FormatOf(Opcode()) >= k10x && FormatOf(Opcode()) <= k10t);
    return RelativeAt(1);
  }

  // Returns a pointer to the instruction after this 2xx instruction in the stream.
  const Instruction* Next_2xx() const {
    DCHECK(FormatOf(Opcode()) >= k20t && FormatOf(Opcode()) <= k22c);
    return RelativeAt(2);
  }

  // Returns a pointer to the instruction after this 3xx instruction in the stream.
  const Instruction* Next_3xx() const {
    DCHECK(FormatOf(Opcode()) >= k32x && FormatOf(Opcode()) <= k3rc);
    return RelativeAt(3);
  }

  // Returns a pointer to the instruction after this 51l instruction in the stream.
  const Instruction* Next_51l() const {
    DCHECK(FormatOf(Opcode()) == k51l);
    return RelativeAt(5);
  }

  // Returns the name of this instruction's opcode.
  const char* Name() const {
    return Instruction::Name(Opcode());
  }

  // Returns the name of the given opcode.
  static const char* Name(Code opcode) {
    return kInstructionNames[opcode];
  }

  // VRegA
  bool HasVRegA() const;
  int32_t VRegA() const;
  int8_t VRegA_10t() const;
  uint8_t VRegA_10x() const;
  uint4_t VRegA_11n() const;
  uint8_t VRegA_11x() const;
  uint4_t VRegA_12x() const;
  int16_t VRegA_20t() const;
  uint8_t VRegA_21c() const;
  uint8_t VRegA_21h() const;
  uint8_t VRegA_21s() const;
  uint8_t VRegA_21t() const;
  uint8_t VRegA_22b() const;
  uint4_t VRegA_22c() const;
  uint4_t VRegA_22s() const;
  uint4_t VRegA_22t() const;
  uint8_t VRegA_22x() const;
  uint8_t VRegA_23x() const;
  int32_t VRegA_30t() const;
  uint8_t VRegA_31c() const;
  uint8_t VRegA_31i() const;
  uint8_t VRegA_31t() const;
  uint16_t VRegA_32x() const;
  uint4_t VRegA_35c() const;
  uint8_t VRegA_3rc() const;
  uint8_t VRegA_51l() const;

  // VRegB
  bool HasVRegB() const;
  int32_t VRegB() const;
  int4_t VRegB_11n() const;
  uint4_t VRegB_12x() const;
  uint16_t VRegB_21c() const;
  uint16_t VRegB_21h() const;
  int16_t VRegB_21s() const;
  int16_t VRegB_21t() const;
  uint8_t VRegB_22b() const;
  uint4_t VRegB_22c() const;
  uint4_t VRegB_22s() const;
  uint4_t VRegB_22t() const;
  uint16_t VRegB_22x() const;
  uint8_t VRegB_23x() const;
  uint32_t VRegB_31c() const;
  int32_t VRegB_31i() const;
  int32_t VRegB_31t() const;
  uint16_t VRegB_32x() const;
  uint16_t VRegB_35c() const;
  uint16_t VRegB_3rc() const;
  uint64_t VRegB_51l() const;  // vB_wide

  // VRegC
  bool HasVRegC() const;
  int32_t VRegC() const;
  int8_t VRegC_22b() const;
  uint16_t VRegC_22c() const;
  int16_t VRegC_22s() const;
  int16_t VRegC_22t() const;
  uint8_t VRegC_23x() const;
  uint4_t VRegC_35c() const;
  uint16_t VRegC_3rc() const;

  // Fills the given array with the 'arg' array of the instruction.
  void GetArgs(uint32_t args[5]) const;

  // Returns the opcode field of the instruction.
  Code Opcode() const {
    return static_cast<Code>(Fetch16(0) & 0xFF);
  }

  void SetOpcode(Code opcode) {
    DCHECK_LT(static_cast<uint16_t>(opcode), 256u);
    uint16_t* insns = reinterpret_cast<uint16_t*>(this);
    insns[0] = (insns[0] & 0xff00) | static_cast<uint16_t>(opcode);
  }

  void SetVRegA_10x(uint8_t val) {
    DCHECK(FormatOf(Opcode()) == k10x);
    uint16_t* insns = reinterpret_cast<uint16_t*>(this);
    insns[0] = (val << 8) | (insns[0] & 0x00ff);
  }

  void SetVRegB_3rc(uint16_t val) {
    DCHECK(FormatOf(Opcode()) == k3rc);
    uint16_t* insns = reinterpret_cast<uint16_t*>(this);
    insns[1] = val;
  }

  void SetVRegB_35c(uint16_t val) {
    DCHECK(FormatOf(Opcode()) == k35c);
    uint16_t* insns = reinterpret_cast<uint16_t*>(this);
    insns[1] = val;
  }

  void SetVRegC_22c(uint16_t val) {
    DCHECK(FormatOf(Opcode()) == k22c);
    uint16_t* insns = reinterpret_cast<uint16_t*>(this);
    insns[1] = val;
  }

  // Returns the format of the given opcode.
  static Format FormatOf(Code opcode) {
    return kInstructionFormats[opcode];
  }

  // Returns the flags for the given opcode.
  static int FlagsOf(Code opcode) {
    return kInstructionFlags[opcode];
  }

  // Returns true if this instruction is a branch.
  bool IsBranch() const {
    return (kInstructionFlags[Opcode()] & kBranch) != 0;
  }

  // Returns true if this instruction is a unconditional branch.
  bool IsUnconditional() const {
    return (kInstructionFlags[Opcode()] & kUnconditional) != 0;
  }

  // Returns the branch offset if this instruction is a branch.
  int32_t GetTargetOffset() const;

  // Returns true if the instruction allows control flow to go to the following instruction.
  bool CanFlowThrough() const;

  // Returns true if this instruction is a switch.
  bool IsSwitch() const {
    return (kInstructionFlags[Opcode()] & kSwitch) != 0;
  }

  // Returns true if this instruction can throw.
  bool IsThrow() const {
    return (kInstructionFlags[Opcode()] & kThrow) != 0;
  }

  // Determine if the instruction is any of 'return' instructions.
  bool IsReturn() const {
    return (kInstructionFlags[Opcode()] & kReturn) != 0;
  }

  // Determine if this instruction ends execution of its basic block.
  bool IsBasicBlockEnd() const {
    return IsBranch() || IsReturn() || Opcode() == THROW;
  }

  // Determine if this instruction is an invoke.
  bool IsInvoke() const {
    return (kInstructionFlags[Opcode()] & kInvoke) != 0;
  }

  int GetVerifyTypeArgumentA() const {
    return (kInstructionVerifyFlags[Opcode()] & (kVerifyRegA | kVerifyRegAWide));
  }

  int GetVerifyTypeArgumentB() const {
    return (kInstructionVerifyFlags[Opcode()] & (kVerifyRegB | kVerifyRegBField | kVerifyRegBMethod |
             kVerifyRegBNewInstance | kVerifyRegBString | kVerifyRegBType | kVerifyRegBWide));
  }

  int GetVerifyTypeArgumentC() const {
    return (kInstructionVerifyFlags[Opcode()] & (kVerifyRegC | kVerifyRegCField |
             kVerifyRegCNewArray | kVerifyRegCType | kVerifyRegCWide));
  }

  int GetVerifyExtraFlags() const {
    return (kInstructionVerifyFlags[Opcode()] & (kVerifyArrayData | kVerifyBranchTarget |
             kVerifySwitchTargets | kVerifyVarArg | kVerifyVarArgRange | kVerifyError));
  }

  // Get the dex PC of this instruction as a offset in code units from the beginning of insns.
  uint32_t GetDexPc(const uint16_t* insns) const {
    return (reinterpret_cast<const uint16_t*>(this) - insns);
  }

  // Dump decoded version of instruction
  std::string DumpString(const DexFile*) const;

  // Dump code_units worth of this instruction, padding to code_units for shorter instructions
  std::string DumpHex(size_t code_units) const;

 private:
  size_t SizeInCodeUnitsComplexOpcode() const;

  uint16_t Fetch16(size_t offset) const {
    const uint16_t* insns = reinterpret_cast<const uint16_t*>(this);
    return insns[offset];
  }

  uint32_t Fetch32(size_t offset) const {
    return (Fetch16(offset) | ((uint32_t) Fetch16(offset + 1) << 16));
  }

  uint4_t InstA() const {
    return static_cast<uint4_t>((Fetch16(0) >> 8) & 0x0f);
  }

  uint4_t InstB() const {
    return static_cast<uint4_t>(Fetch16(0) >> 12);
  }

  uint8_t InstAA() const {
    return static_cast<uint8_t>(Fetch16(0) >> 8);
  }

  static const char* const kInstructionNames[];
  static Format const kInstructionFormats[];
  static int const kInstructionFlags[];
  static int const kInstructionVerifyFlags[];
  static int const kInstructionSizeInCodeUnits[];
  DISALLOW_IMPLICIT_CONSTRUCTORS(Instruction);
};
std::ostream& operator<<(std::ostream& os, const Instruction::Code& code);
std::ostream& operator<<(std::ostream& os, const Instruction::Format& format);
std::ostream& operator<<(std::ostream& os, const Instruction::Flags& flags);
std::ostream& operator<<(std::ostream& os, const Instruction::VerifyFlag& vflags);

/*
 * Holds the contents of a decoded instruction.
 */
struct DecodedInstruction {
  uint32_t vA;
  uint32_t vB;
  uint64_t vB_wide;        /* for k51l */
  uint32_t vC;
  uint32_t arg[5];         /* vC/D/E/F/G in invoke or filled-new-array */
  Instruction::Code opcode;

  explicit DecodedInstruction(const Instruction* inst) {
    inst->Decode(vA, vB, vB_wide, vC, arg);
    opcode = inst->Opcode();
  }
};

}  // namespace art

#endif  // ART_RUNTIME_DEX_INSTRUCTION_H_

redpajama_set_name: RedPajamaGithub


text:
var answerService = angular.module('answerService', [])

// super simple service
// each function returns a promise object
answerService.factory('Answers', ['$http',function($http) {
    return {
        get : function(question_id) {
            console.log("service get answer called.");
            return $http.put('/api/answers/' + question_id);
        },
        getOne : function(id) {
            return $http.put('/api/answer/' + id);
        },
        create : function(question_id, answerData) {
            return $http.post('/api/answers/' + question_id, answerData);
        },
        delete : function(id) {
            return $http.delete('/api/answers/' + id);
        },
        upVote : function(id) {
            return $http.put('/api/upvote/' + id);
        },
        upVoteOne : function(id) {
            return $http.put('/api/upvote_one/' + id);
        }
    }
}]);


text:
context('User Groups', () => {

  beforeEach(() => {
    cy.umbracoLogin(Cypress.env('username'), Cypress.env('password'));
  });

  it('Create user group', () => {
    const name = "Test Group";

    cy.umbracoEnsureUserGroupNameNotExists(name);

    cy.umbracoSection('users');
    cy.get('[data-element="sub-view-userGroups"]').click();

    cy.umbracoButtonByLabelKey("actions_createGroup").click();

    //Type name
    cy.umbracoEditorHeaderName(name);

    // Assign sections
    cy.get('.umb-box:nth-child(1) .umb-property:nth-child(1) localize').click();
    cy.get('.umb-tree-item__inner').click({multiple:true, timeout: 10000});
    cy.get('.btn-success').last().click();

    // Save
    cy.get('.btn-success').click();

    //Assert
    cy.umbracoSuccessNotification().should('be.visible');

    //Clean up
    cy.umbracoEnsureUserGroupNameNotExists(name);
   });

});


text:
#ifndef FileSystemCallbacks_h
#define FileSystemCallbacks_h

#if ENABLE(FILE_SYSTEM)

#include "AsyncFileSystemCallbacks.h"
#include "PlatformString.h"
#include <wtf/PassRefPtr.h>
#include <wtf/Vector.h>

namespace WebCore {

class AsyncFileWriter;
class DOMFileSystemBase;
class DirectoryReaderBase;
class EntriesCallback;
class EntryArray;
class EntryCallback;
class ErrorCallback;
struct FileMetadata;
class FileSystemCallback;
class FileWriterBase;
class FileWriterBaseCallback;
class MetadataCallback;
class ScriptExecutionContext;
class VoidCallback;

class FileSystemCallbacksBase : public AsyncFileSystemCallbacks {
public:
    virtual ~FileSystemCallbacksBase();

    // For EntryCallbacks and VoidCallbacks.
    virtual void didSucceed();

    // For FileSystemCallbacks.
    virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>);

    // For MetadataCallbacks.
    virtual void didReadMetadata(const FileMetadata&);

    // For EntriesCallbacks. didReadDirectoryEntry is called each time the API reads an entry, and didReadDirectoryDone is called when a chunk of entries have been read (i.e. good time to call back to the application).  If hasMore is true there can be more chunks.
    virtual void didReadDirectoryEntry(const String& name, bool isDirectory);
    virtual void didReadDirectoryEntries(bool hasMore);

    // For createFileWriter.
    virtual void didCreateFileWriter(PassOwnPtr<AsyncFileWriter>, long long length);

    // For ErrorCallback.
    virtual void didFail(int code);

protected:
    FileSystemCallbacksBase(PassRefPtr<ErrorCallback> errorCallback);
    RefPtr<ErrorCallback> m_errorCallback;
};

// Subclasses ----------------------------------------------------------------

class EntryCallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<EntryCallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
    virtual void didSucceed();

private:
    EntryCallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DOMFileSystemBase>, const String& expectedPath, bool isDirectory);
    RefPtr<EntryCallback> m_successCallback;
    RefPtr<DOMFileSystemBase> m_fileSystem;
    String m_expectedPath;
    bool m_isDirectory;
};

class EntriesCallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<EntriesCallbacks> create(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
    virtual void didReadDirectoryEntry(const String& name, bool isDirectory);
    virtual void didReadDirectoryEntries(bool hasMore);

private:
    EntriesCallbacks(PassRefPtr<EntriesCallback>, PassRefPtr<ErrorCallback>, PassRefPtr<DirectoryReaderBase>, const String& basePath);
    RefPtr<EntriesCallback> m_successCallback;
    RefPtr<DirectoryReaderBase> m_directoryReader;
    String m_basePath;
    RefPtr<EntryArray> m_entries;
};

class FileSystemCallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<FileSystemCallbacks> create(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*);
    virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>);

private:
    FileSystemCallbacks(PassRefPtr<FileSystemCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*);
    RefPtr<FileSystemCallback> m_successCallback;
    RefPtr<ScriptExecutionContext> m_scriptExecutionContext;
};

class ResolveURICallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<ResolveURICallbacks> create(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*, const String& filePath);
    virtual void didOpenFileSystem(const String& name, PassOwnPtr<AsyncFileSystem>);

private:
    ResolveURICallbacks(PassRefPtr<EntryCallback>, PassRefPtr<ErrorCallback>, ScriptExecutionContext*, const String& filePath);
    RefPtr<EntryCallback> m_successCallback;
    RefPtr<ScriptExecutionContext> m_scriptExecutionContext;
    String m_filePath;
};

class MetadataCallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<MetadataCallbacks> create(PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>);
    virtual void didReadMetadata(const FileMetadata&);

private:
    MetadataCallbacks(PassRefPtr<MetadataCallback>, PassRefPtr<ErrorCallback>);
    RefPtr<MetadataCallback> m_successCallback;
};

class FileWriterBaseCallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<FileWriterBaseCallbacks> create(PassRefPtr<FileWriterBase>, PassRefPtr<FileWriterBaseCallback>, PassRefPtr<ErrorCallback>);
    virtual void didCreateFileWriter(PassOwnPtr<AsyncFileWriter>, long long length);

private:
    FileWriterBaseCallbacks(PassRefPtr<FileWriterBase>, PassRefPtr<FileWriterBaseCallback>, PassRefPtr<ErrorCallback>);
    RefPtr<FileWriterBase> m_fileWriter;
    RefPtr<FileWriterBaseCallback> m_successCallback;
};

class VoidCallbacks : public FileSystemCallbacksBase {
public:
    static PassOwnPtr<VoidCallbacks> create(PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>);
    virtual void didSucceed();

private:
    VoidCallbacks(PassRefPtr<VoidCallback>, PassRefPtr<ErrorCallback>);
    RefPtr<VoidCallback> m_successCallback;
};

} // namespace

#endif // ENABLE(FILE_SYSTEM)

#endif // FileSystemCallbacks_h


text:
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij;

import com.intellij.openapi.diagnostic.ErrorReportSubmitter;
import com.intellij.openapi.extensions.ExtensionPointName;
import org.jetbrains.annotations.NonNls;

/**
 * Extension points provided by IDEA core are listed here.
 */
public interface ExtensionPoints extends ToolExtensionPoints {
  /**
   * This extension point should be used instead of former application-components, project-components, module-components.
   * Extension declaration sample is as follows:
   *

   * <extensions xmlns="com.intellij">
   *   <component area="IDEA_PROJECT">
   *     <implementation>my.plugin.package.MyProjectComponent</implementation>
   *   </component>
   * </extensions>
   *

   *

   * Possible registration areas are IDEA_PROJECT, MODULE_PROJECT which stand for ProjectComponent and ModuleComponent correspondingly.
   * If area attribute is omitted the component will be registered in root area which corresponds to application component.
   */
  @NonNls
  String COMPONENT = "com.intellij.component";

  /**
   * This extension point allows a plugin vendor to provide the user ability to report fatal errors (aka exceptions) that happened in
   * their plugin code.
   * Extension declaration sample is as follows:
   *

   * <extensions xmlns="com.intellij">
   *   <errorHandler implementation="my.plugin.package.MyErrorHandler"/>
   * </extensions>
   *

   * my.plugin.package.MyErrorHandler class must implement {@link ErrorReportSubmitter} abstract class.
   */
  @NonNls
  String ERROR_HANDLER = "com.intellij.errorHandler";

  ExtensionPointName<ErrorReportSubmitter> ERROR_HANDLER_EP = ExtensionPointName.create(ERROR_HANDLER);

  /**
   * This extension point allows a plugin vendor to provide patches to junit run/debug configurations
   * Extension declaration sample is as follows:
   *

   * <extensions xmlns="com.intellij">
   *   <junitPatcher implementation="my.plugin.package.MyJUnitPatcher"/>
   * </extensions>
   *

   * my.plugin.package.MyJUnitPatcher class must implement {@link com.intellij.execution.JUnitPatcher} abstract class.
   */
  @NonNls
  String JUNIT_PATCHER = "com.intellij.junitPatcher";

  /**
   * This extensions allows to run custom [command-line] application based on IDEA platform
   *

   * <extensions xmlns="com.intellij">
   *   <applicationStarter implementation="my.plugin.package.MyApplicationStarter"/>
   * </extensions>
   *

   * my.plugin.package.MyApplicationStarter class must implement {@link com.intellij.openapi.application.ApplicationStarter} interface.
   */
  @NonNls
  String APPLICATION_STARTER = "com.intellij.appStarter";

  @NonNls
  String ANT_BUILD_GEN = "com.intellij.antBuildGen";

  /**
   * Ant custom compiler extension point
   */
  @NonNls
  String ANT_CUSTOM_COMPILER = "com.intellij.antCustomCompiler";
}


text:
package walkingdevs.http;

import walkingdevs.exceptions.Try;

import java.net.InetAddress;

class HostImpl implements Host {
    public InetAddress inet() {
        return inetAddress;
    }

    HostImpl(String host) {
        inetAddress = Try.mk(() -> InetAddress.getByName(host)).Do();
    }
    private final InetAddress inetAddress;
}


text:
package main

import (
	"bytes"
)

func newDeclArea(parent *declArea) *declArea {
	return &declArea{
		nameIdx: map[string]int{},
		parent:  parent,
	}
}

type declCodeTD struct {
	VarName string
	Code    *bytes.Buffer
}

type declArea struct {
	parent  *declArea
	nameIdx map[string]int
	decls   []declCodeTD
}

// declare adds a declaration to the declaration area,
// add a new number suffix to it if the name is already taken,
// returns the new valid name and the buffer for the new variable's code content
func (z *declArea) declare(varName string) (string, *bytes.Buffer) {
	if z.parent != nil {
		z.nameIdx[varName] += z.parent.nameIdx[varName]
	}

	z.nameIdx[varName]++

	var buf bytes.Buffer
	newVarName := sfmt("%v%v", varName, z.nameIdx[varName])
	z.decls = append(z.decls, declCodeTD{
		VarName: newVarName,
		Code:    &buf,
	})

	return newVarName, &buf

}

// code returns the accumulated code content of all the variables
func (z *declArea) code() *bytes.Buffer {
	buf, err := execTplBuf(varDeclTpl, varDeclTD{
		Vars: z.decls,
	})

	if err != nil {
		panic(err)
	}

	return buf
}


text:
package com.google.template.soy.jbcsrc;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.template.soy.data.SoyValueHelper.EMPTY_DICT;

import com.google.common.base.Joiner;
import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
import com.google.common.truth.FailureStrategy;
import com.google.common.truth.Subject;
import com.google.common.truth.SubjectFactory;
import com.google.common.truth.Truth;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Provider;
import com.google.inject.Provides;
import com.google.template.soy.SoyFileSetParserBuilder;
import com.google.template.soy.SoyModule;
import com.google.template.soy.data.SoyRecord;
import com.google.template.soy.data.SoyValueConverter;
import com.google.template.soy.data.SoyValueHelper;
import com.google.template.soy.error.ExplodingErrorReporter;
import com.google.template.soy.exprtree.FunctionNode;
import com.google.template.soy.jbcsrc.TemplateTester.CompiledTemplateSubject;
import com.google.template.soy.jbcsrc.api.AdvisingStringBuilder;
import com.google.template.soy.jbcsrc.api.RenderResult;
import com.google.template.soy.jbcsrc.shared.CompiledTemplate;
import com.google.template.soy.jbcsrc.shared.CompiledTemplates;
import com.google.template.soy.jbcsrc.shared.RenderContext;
import com.google.template.soy.msgs.SoyMsgBundle;
import com.google.template.soy.shared.SoyCssRenamingMap;
import com.google.template.soy.shared.SoyIdRenamingMap;
import com.google.template.soy.shared.restricted.SoyFunction;
import com.google.template.soy.shared.restricted.SoyJavaFunction;
import com.google.template.soy.shared.restricted.SoyJavaPrintDirective;
import com.google.template.soy.soytree.SoyFileSetNode;
import com.google.template.soy.soytree.SoytreeUtils;
import com.google.template.soy.soytree.TemplateRegistry;
import com.google.template.soy.types.SoyTypeRegistry;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * Utilities for testing compiled soy templates.
 */
public final class TemplateTester {
  private static final Injector INJECTOR =
      Guice.createInjector(
          new SoyModule(),
          new AbstractModule() {
            @Provides
            RenderContext.Builder provideContext(
                ImmutableMap<String, ? extends SoyFunction> functions,
                SoyValueHelper converter,
                ImmutableMap<String, ? extends SoyJavaPrintDirective> printDirectives) {
              @SuppressWarnings("unchecked")
              ImmutableMap<String, SoyJavaFunction> soyJavaFunctions =
                  ImmutableMap.copyOf(
                      (Map<String, SoyJavaFunction>)
                          Maps.filterValues(
                              functions, Predicates.instanceOf(SoyJavaFunction.class)));
              return new RenderContext.Builder()
                  .withSoyFunctions(soyJavaFunctions)
                  .withSoyPrintDirectives(printDirectives)
                  .withConverter(converter);
            }

            @Override
            protected void configure() {}
          });

  static final Provider<RenderContext.Builder> DEFAULT_CONTEXT_BUILDER =
      INJECTOR.getProvider(RenderContext.Builder.class);

  static RenderContext getDefaultContext(CompiledTemplates templates) {
    return getDefaultContext(templates, ImmutableSet.<String>of());
  }

  static RenderContext getDefaultContext(
      CompiledTemplates templates, ImmutableSet<String> activeDelPackages) {
    return DEFAULT_CONTEXT_BUILDER
        .get()
        .withActiveDelPackages(activeDelPackages)
        .withCompiledTemplates(templates)
        .build();
  }

  private static final SubjectFactory<CompiledTemplateSubject, String> FACTORY =
      new SubjectFactory<CompiledTemplateSubject, String>() {
        @Override public CompiledTemplateSubject getSubject(FailureStrategy fs, String that) {
          return new CompiledTemplateSubject(fs, that);
        }
      };

  /**
   * Returns a truth subject that can be used to assert on an template given the template body.
   *
   * <p>The given body lines are wrapped in a template called {@code ns.foo} that has no params.
   */
  public static CompiledTemplateSubject assertThatTemplateBody(String ...body) {
    String template = toTemplate(body);
    return assertThatFile(template);
  }

  static CompiledTemplateSubject assertThatFile(String ...template) {
    return Truth.assertAbout(FACTORY).that(Joiner.on('\n').join(template));
  }

  /**
   * Returns a {@link com.google.template.soy.jbcsrc.shared.CompiledTemplates} for the given
   * template body. Containing a single template {@code ns.foo} with the given body
   */
  public static CompiledTemplates compileTemplateBody(String... body) {
    return compileFile(toTemplate(body));
  }

  static SoyRecord asRecord(Map<String, ?> params) {
    return (SoyRecord) SoyValueHelper.UNCUSTOMIZED_INSTANCE.convert(params);
  }

  // TODO(lukes): add a fluent api for specifying all the parameters to render
  static final class CompiledTemplateSubject extends Subject<CompiledTemplateSubject, String> {
    private Iterable<ClassData> classData;
    private SoyMsgBundle msgBundle = SoyMsgBundle.EMPTY;
    private SoyTypeRegistry typeRegistry = new SoyTypeRegistry();
    private SoyValueConverter converter = SoyValueHelper.UNCUSTOMIZED_INSTANCE;
    private CompiledTemplate.Factory factory;
    private RenderContext defaultContext;
    private RenderContext.Builder defaultContextBuilder = DEFAULT_CONTEXT_BUILDER.get();
    private List<SoyFunction> soyFunctions = new ArrayList<>();

    private CompiledTemplateSubject(FailureStrategy failureStrategy, String subject) {
      super(failureStrategy, subject);
    }

    CompiledTemplateSubject withTypeRegistry(SoyTypeRegistry typeRegistry) {
      classData = null;
      factory = null;
      this.typeRegistry = typeRegistry;
      return this;
    }

    CompiledTemplateSubject withValueConverter(SoyValueConverter converter) {
      classData = null;
      factory = null;
      this.converter = converter;
      defaultContextBuilder.withConverter(converter);
      return this;
    }

    CompiledTemplateSubject withSoyFunction(SoyFunction soyFunction) {
      classData = null;
      factory = null;
      this.soyFunctions.add(checkNotNull(soyFunction));
      return this;
    }

    CompiledTemplateSubject withCssRenamingMap(SoyCssRenamingMap renamingMap) {
      this.defaultContextBuilder.withCssRenamingMap(renamingMap);
      return this;
    }

    CompiledTemplateSubject withXidRenamingMap(SoyIdRenamingMap renamingMap) {
      this.defaultContextBuilder.withXidRenamingMap(renamingMap);
      return this;
    }

    CompiledTemplateSubject withMessages(SoyMsgBundle bundle) {
      classData = null;
      factory = null;
      this.msgBundle = bundle;
      return this;
    }

    CompiledTemplateSubject logsOutput(String expected) {
      compile();
      return rendersAndLogs("", expected, EMPTY_DICT, EMPTY_DICT, defaultContext);
    }

    CompiledTemplateSubject rendersAs(String expected) {
      compile();
      return rendersAndLogs(expected, "", EMPTY_DICT, EMPTY_DICT, defaultContext);
    }

    CompiledTemplateSubject rendersAs(String expected, Map<String, ?> params) {
      compile();
      return rendersAndLogs(expected, "", asRecord(params), EMPTY_DICT, defaultContext);
    }

    CompiledTemplateSubject rendersAs(
        String expected, Map<String, ?> params, RenderContext context) {
      compile();
      return rendersAndLogs(expected, "", asRecord(params), EMPTY_DICT, context);
    }

    CompiledTemplateSubject rendersAs(String expected, Map<String, ?> params,  Map<String, ?> ij) {
      compile();
      return rendersAndLogs(expected, "", asRecord(params), asRecord(ij), defaultContext);
    }

    CompiledTemplateSubject rendersAs(String expected, RenderContext context) {
      compile();
      return rendersAndLogs(expected, "", EMPTY_DICT, EMPTY_DICT, context);
    }

    private SoyRecord asRecord(Map<String, ?> params) {
      return (SoyRecord) converter.convert(params);
    }

    private CompiledTemplateSubject rendersAndLogs(String expectedOutput, String expectedLogged,
        SoyRecord params, SoyRecord ij, RenderContext context) {
      CompiledTemplate template = factory.create(params, ij);
      AdvisingStringBuilder builder = new AdvisingStringBuilder();
      LogCapturer logOutput = new LogCapturer();
      RenderResult result;
      try (SystemOutRestorer restorer = logOutput.enter()) {
        result = template.render(builder, context);
      } catch (Throwable e) {
        failureStrategy.fail(String.format("Unexpected failure for %s", getDisplaySubject()), e);
        result = null;
      }
      if (result.type() != RenderResult.Type.DONE) {
        fail("renders to completion", result);
      }
      String output = builder.toString();
      if (!output.equals(expectedOutput)) {
        failWithBadResults("rendersAs", expectedOutput, "renders as", output);
      }
      if (!expectedLogged.equals(logOutput.toString())) {
        failWithBadResults("logs", expectedLogged, "logs", logOutput.toString());
      }
      return this;
    }

    @Override protected String getDisplaySubject() {
      if (classData == null) {
        // hasn't been compiled yet.  just use the source text
        return super.getDisplaySubject();
      }

      String customName = super.internalCustomName();
      return (customName != null ? customName : "")
          + " (<\n" + getSubject() + "\n Compiled as: \n"
          + Joiner.on('\n').join(classData) + "\n>)";
    }

    private void compile() {
      if (classData == null) {
        SoyFileSetParserBuilder builder = SoyFileSetParserBuilder.forFileContents(getSubject());
        for (SoyFunction function : soyFunctions) {
          builder.addSoyFunction(function);
        }
        SoyFileSetNode fileSet = builder.typeRegistry(typeRegistry).parse().fileSet();
        new UnsupportedFeatureReporter(ExplodingErrorReporter.get()).check(fileSet);
        // Clone the tree, there tend to be bugs in the AST clone implementations that don't show
        // up until development time when we do a lot of AST cloning, so clone here to try to flush
        // them out.
        fileSet = SoytreeUtils.cloneNode(fileSet);

        Map<String, SoyJavaFunction> functions = new LinkedHashMap<>();
        for (FunctionNode fnNode : SoytreeUtils.getAllNodesOfType(fileSet, FunctionNode.class)) {
          if (fnNode.getSoyFunction() instanceof SoyJavaFunction) {
            functions.put(fnNode.getFunctionName(), (SoyJavaFunction) fnNode.getSoyFunction());
          }
        }

        // N.B. we are reproducing some of BytecodeCompiler here to make it easier to look at
        // intermediate data structures.
        TemplateRegistry registry = new TemplateRegistry(fileSet, ExplodingErrorReporter.get());
        CompiledTemplateRegistry compilerRegistry = new CompiledTemplateRegistry(registry);
        String templateName = Iterables.getOnlyElement(registry.getBasicTemplatesMap().keySet());
        classData = new TemplateCompiler(
            compilerRegistry,
            compilerRegistry.getTemplateInfoByTemplateName(templateName)).compile();
        checkClasses(classData);
        CompiledTemplates compiledTemplates =
            new CompiledTemplates(
                compilerRegistry.getDelegateTemplateNames(), new MemoryClassLoader(classData));
        factory = compiledTemplates.getTemplateFactory(templateName);
        defaultContext =
            defaultContextBuilder
                .withCompiledTemplates(compiledTemplates)
                .withSoyFunctions(ImmutableMap.copyOf(functions))
                .withMessageBundle(msgBundle)
                .build();
      }
    }

    private static void checkClasses(Iterable<ClassData> classData2) {
      for (ClassData d : classData2) {
        d.checkClass();
      }
    }
  }

  private interface SystemOutRestorer extends AutoCloseable {
    @Override public void close();
  }

  private static final class LogCapturer {
    private final ByteArrayOutputStream logOutput;
    private final PrintStream stream;

    LogCapturer() {
      this.logOutput = new ByteArrayOutputStream();
      try {
        this.stream = new PrintStream(logOutput, true, StandardCharsets.UTF_8.name());
      } catch (UnsupportedEncodingException e) {
        throw new AssertionError("StandardCharsets must be supported", e);
      }
    }

    SystemOutRestorer enter() {
      final PrintStream prevStream = System.out;
      System.setOut(stream);
      return new SystemOutRestorer() {
        @Override public void close() {
          System.setOut(prevStream);
        }
      };
    }

    @Override public String toString() {
      return new String(logOutput.toByteArray(), StandardCharsets.UTF_8);
    }
  }

  private static String toTemplate(String ...body) {
    StringBuilder builder = new StringBuilder();
    builder.append("{namespace ns autoescape=\"strict\"}\n")
        .append("{template .foo}\n");
    Joiner.on("\n").appendTo(builder, body);
    builder.append("\n{/template}\n");
    return builder.toString();
  }

  static CompiledTemplates compileFile(String ...fileBody) {
    String file = Joiner.on('\n').join(fileBody);
    return BytecodeCompiler.compile(
            SoyFileSetParserBuilder.forFileContents(file).parse().registry(),
            false,
            ExplodingErrorReporter.get())
        .get();
  }
}


text:
(function() {
    function initialize() {
        var map = new google.maps.Map(
            document.getElementById("map-canvas"),
            {
                center: routrMapCenter,
                zoom: 13
            });
        var lastPoint = new google.maps.Marker({
            position: routrMapCenter,
            map: map,
            title: routrLastTime
        });
        var infowindow = new google.maps.InfoWindow({
            content: "Point recorded at " + routrLastTime
        });
        google.maps.event.addListener(lastPoint, 'click', function() {
            infowindow.open(map, lastPoint);
        });

        var flightPath = new google.maps.Polyline({
            map: map,
            path: routrTrail,
            geodesic: true,
            strokeColor: '#00EE22',
            strokeOpacity: 0.8,
            strokeWeight: 3
        });

    }
    google.maps.event.addDomListener(window, 'load', initialize);
})();


text:
.. Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.

   Authors: Hervé Cauwelier <herve@itaapy.com>
            Jean-Marie Gouarné <jean-marie.gouarne@arsaperta.com>
            Luis Belmar-Letelier <luis@itaapy.com>

   This file is part of Lpod (see: http://lpod-project.org).
   Lpod is free software; you can redistribute it and/or modify it under
   the terms of either:

   a) the GNU General Public License as published by the Free Software
      Foundation, either version 3 of the License, or (at your option)
      any later version.
      Lpod 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 Lpod.  If not, see <http://www.gnu.org/licenses/>.

   b) 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

Application settings [todo]
================================

.. contents::
   :local:


text:
package org.apache.nifi.atlas.provenance.analyzer;

import org.apache.atlas.v1.model.instance.Referenceable;
import org.apache.nifi.atlas.provenance.AnalysisContext;
import org.apache.nifi.atlas.provenance.DataSetRefs;
import org.apache.nifi.atlas.provenance.NiFiProvenanceEventAnalyzer;
import org.apache.nifi.atlas.provenance.NiFiProvenanceEventAnalyzerFactory;
import org.apache.nifi.atlas.resolver.ClusterResolvers;
import org.apache.nifi.controller.status.ConnectionStatus;
import org.apache.nifi.provenance.ProvenanceEventRecord;
import org.apache.nifi.provenance.ProvenanceEventType;
import org.junit.Test;
import org.mockito.Mockito;

import java.util.ArrayList;
import java.util.List;

import static org.apache.nifi.atlas.NiFiTypes.ATTR_NAME;
import static org.apache.nifi.atlas.NiFiTypes.ATTR_QUALIFIED_NAME;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.matches;
import static org.mockito.Mockito.when;

public class TestUnknownDataSet {

    @Test
    public void testGenerateFlowFile() {
        final String processorName = "GenerateFlowFile";
        final String processorId = "processor-1234";
        final ProvenanceEventRecord record = Mockito.mock(ProvenanceEventRecord.class);
        when(record.getComponentType()).thenReturn(processorName);
        when(record.getComponentId()).thenReturn(processorId);
        when(record.getEventType()).thenReturn(ProvenanceEventType.CREATE);

        final ClusterResolvers clusterResolvers = Mockito.mock(ClusterResolvers.class);
        when(clusterResolvers.fromHostNames(matches(".+\\.example\\.com"))).thenReturn("cluster1");

        final List<ConnectionStatus> connections = new ArrayList<>();

        final AnalysisContext context = Mockito.mock(AnalysisContext.class);
        when(context.getClusterResolver()).thenReturn(clusterResolvers);
        when(context.findConnectionTo(processorId)).thenReturn(connections);
        when(context.getNiFiClusterName()).thenReturn("nifi-cluster");

        final NiFiProvenanceEventAnalyzer analyzer = NiFiProvenanceEventAnalyzerFactory.getAnalyzer(processorName, null, record.getEventType());
        assertNotNull(analyzer);

        final DataSetRefs refs = analyzer.analyze(context, record);
        assertEquals(1, refs.getInputs().size());
        assertEquals(0, refs.getOutputs().size());
        Referenceable ref = refs.getInputs().iterator().next();
        assertEquals("nifi_data", ref.getTypeName());
        assertEquals("GenerateFlowFile", ref.get(ATTR_NAME));
        assertEquals("processor-1234@nifi-cluster", ref.get(ATTR_QUALIFIED_NAME));
    }

    @Test
    public void testSomethingHavingIncomingConnection() {
        final String processorName = "SomeProcessor";
        final String processorId = "processor-1234";
        final ProvenanceEventRecord record = Mockito.mock(ProvenanceEventRecord.class);
        when(record.getComponentType()).thenReturn(processorName);
        when(record.getComponentId()).thenReturn(processorId);
        when(record.getEventType()).thenReturn(ProvenanceEventType.CREATE);

        final ClusterResolvers clusterResolvers = Mockito.mock(ClusterResolvers.class);
        when(clusterResolvers.fromHostNames(matches(".+\\.example\\.com"))).thenReturn("cluster1");

        final List<ConnectionStatus> connections = new ArrayList<>();
        // The content of connection is not important, just create an empty status.
        connections.add(new ConnectionStatus());

        final AnalysisContext context = Mockito.mock(AnalysisContext.class);
        when(context.getClusterResolver()).thenReturn(clusterResolvers);
        when(context.findConnectionTo(processorId)).thenReturn(connections);

        final NiFiProvenanceEventAnalyzer analyzer = NiFiProvenanceEventAnalyzerFactory.getAnalyzer(processorName, null, record.getEventType());
        assertNotNull(analyzer);

        final DataSetRefs refs = analyzer.analyze(context, record);
        assertNull("If the processor has incoming connections, no refs should be created", refs);
    }

}


text:
static SDL_Surface *screen;

bool init_window(const char* title, int width, int height)
{
	if (SDL_Init(SDL_INIT_EVERYTHING) == -1)
	{
		return false;
	}

	screen = SDL_SetVideoMode(width, height, 32, SDL_SWSURFACE);

	if (screen == NULL)
	{
		return false;
	}

	SDL_WM_SetCaption(title, NULL);

	return true;
}

void dispose_window(void)
{
	SDL_FreeSurface(screen);
}

SDL_Surface *get_screen(void)
{
	return screen;
}

void clear_screen(int r, int g, int b, int a)
{
	Uint32 col = SDL_MapRGBA(screen->format, r, g, b, a);

	SDL_FillRect(screen, NULL, col);
}

void apply_surface(int x, int y, SDL_Surface* source)
{
	SDL_Rect offset;

	offset.x = x;
	offset.y = y;

	SDL_BlitSurface(source, NULL, screen, &offset);
}

void flip_screen(void)
{
	SDL_Flip(screen);
}


text:
namespace aura {
class Window;
}

class ArcAppWindow;
class ArcAppWindowLauncherItemController;
class ChromeLauncherController;

class Profile;

class ArcAppWindowLauncherController : public AppWindowLauncherController,
                                       public aura::EnvObserver,
                                       public aura::WindowObserver,
                                       public ArcAppListPrefs::Observer,
                                       public arc::ArcSessionManager::Observer,
                                       public ArcAppWindowDelegate {
 public:
  explicit ArcAppWindowLauncherController(ChromeLauncherController* owner);
  ~ArcAppWindowLauncherController() override;

  // AppWindowLauncherController:
  void ActiveUserChanged(const std::string& user_email) override;
  void AdditionalUserAddedToSession(Profile* profile) override;

  // aura::EnvObserver:
  void OnWindowInitialized(aura::Window* window) override;

  // aura::WindowObserver:
  void OnWindowVisibilityChanged(aura::Window* window, bool visible) override;
  void OnWindowDestroying(aura::Window* window) override;

  // wm::ActivationChangeObserver:
  void OnWindowActivated(wm::ActivationChangeObserver::ActivationReason reason,
                         aura::Window* gained_active,
                         aura::Window* lost_active) override;

  // ArcAppListPrefs::Observer:
  void OnAppStatesChanged(const std::string& app_id,
                          const ArcAppListPrefs::AppInfo& app_info) override;
  void OnAppRemoved(const std::string& app_id) override;
  void OnTaskCreated(int task_id,
                     const std::string& package_name,
                     const std::string& activity,
                     const std::string& intent) override;
  void OnTaskDescriptionUpdated(
      int32_t task_id,
      const std::string& label,
      const std::vector<uint8_t>& icon_png_data) override;
  void OnTaskDestroyed(int task_id) override;
  void OnTaskSetActive(int32_t task_id) override;

  // ArcAppWindowDelegate:
  int GetActiveTaskId() const override;

  const std::vector<aura::Window*>& GetObservedWindows() {
    return observed_windows_;
  }

 private:
  class AppWindowInfo;

  using TaskIdToAppWindowInfo = std::map<int, std::unique_ptr<AppWindowInfo>>;

  // Maps shelf group id to controller. Shelf group id is optional parameter for
  // the Android task. If it is not set, app id is used instead.
  using ShelfGroupToAppControllerMap =
      std::map<arc::ArcAppShelfId, ArcAppWindowLauncherItemController*>;

  void StartObserving(Profile* profile);
  void StopObserving(Profile* profile);

  void RegisterApp(AppWindowInfo* app_window_info);
  void UnregisterApp(AppWindowInfo* app_window_info);
  void HandlePlayStoreLaunch(AppWindowInfo* app_window_info);

  AppWindowInfo* GetAppWindowInfoForTask(int task_id);
  ArcAppWindow* GetAppWindowForTask(int task_id);

  void AttachControllerToWindowIfNeeded(aura::Window* window);
  void AttachControllerToWindowsIfNeeded();
  ArcAppWindowLauncherItemController* AttachControllerToTask(
      int taskId,
      const AppWindowInfo& app_window_info);

  std::vector<int> GetTaskIdsForApp(const std::string& arc_app_id) const;

  // AppWindowLauncherController:
  AppWindowLauncherItemController* ControllerForWindow(
      aura::Window* window) override;
  void OnItemDelegateDiscarded(ash::ShelfItemDelegate* delegate) override;

  // arc::ArcSessionManager::Observer:
  void OnArcOptInManagementCheckStarted() override;
  void OnArcSessionStopped(arc::ArcStopReason stop_reason) override;

  int active_task_id_ = -1;
  TaskIdToAppWindowInfo task_id_to_app_window_info_;
  ShelfGroupToAppControllerMap app_shelf_group_to_controller_map_;
  std::vector<aura::Window*> observed_windows_;
  Profile* observed_profile_ = nullptr;

  // The time when the ARC OptIn management check was started. This happens
  // right after user agrees the ToS or in some cases for managed user when ARC
  // starts for the first time. OptIn management check is preceding step before
  // ARC container is actually started.
  base::Time opt_in_management_check_start_time_;

  DISALLOW_COPY_AND_ASSIGN(ArcAppWindowLauncherController);
};

#endif  // CHROME_BROWSER_UI_ASH_LAUNCHER_ARC_APP_WINDOW_LAUNCHER_CONTROLLER_H_


text:
package ssh

import (
	"reflect"
	"testing"

	"golang.org/x/crypto/ssh"
)

func TestPasswordKeyboardInteractive_Impl(t *testing.T) {
	var raw interface{}
	raw = PasswordKeyboardInteractive("foo")
	if _, ok := raw.(ssh.KeyboardInteractiveChallenge); !ok {
		t.Fatal("PasswordKeyboardInteractive must implement KeyboardInteractiveChallenge")
	}
}

func TestPasswordKeybardInteractive_Challenge(t *testing.T) {
	p := PasswordKeyboardInteractive("foo")
	result, err := p("foo", "bar", []string{"one", "two"}, nil)
	if err != nil {
		t.Fatalf("err not nil: %s", err)
	}

	if !reflect.DeepEqual(result, []string{"foo", "foo"}) {
		t.Fatalf("invalid password: %#v", result)
	}
}


text:
Clazz.declarePackage ("J.c");
Clazz.load (["java.lang.Enum"], "J.c.STR", null, function () {
c$ = Clazz.decorateAsClass (function () {
this.id = 0;
this.color = 0;
Clazz.instantialize (this, arguments);
}, J.c, "STR", Enum);
Clazz.makeConstructor (c$,
 function (id, color) {
this.id = id;
this.color = color;
}, "~N,~N");
Clazz.defineMethod (c$, "getId",
function () {
return this.id;
});
Clazz.defineMethod (c$, "getColor",
function () {
return this.color;
});
c$.getProteinStructureType = Clazz.defineMethod (c$, "getProteinStructureType",
function (name) {
for (var item, $item = 0, $$item = J.c.STR.values (); $item < $$item.length && ((item = $$item[$item]) || true); $item++) if (name.equalsIgnoreCase (item.name ())) return (item.isProtein () ? item : J.c.STR.NOT);

return J.c.STR.NOT;
}, "~S");
Clazz.defineMethod (c$, "getBioStructureTypeName",
function (isGeneric) {
return (this.id < 0 ? "" : isGeneric && this.isProtein () ? "protein" : this.name ());
}, "~B");
Clazz.defineMethod (c$, "isProtein",
 function () {
return this.id >= 0 && this.id <= 3 || this.id >= 7;
});
Clazz.defineEnumConstant (c$, "NOT", 0, [-1, 0xFF808080]);
Clazz.defineEnumConstant (c$, "NONE", 1, [0, 0xFFFFFFFF]);
Clazz.defineEnumConstant (c$, "TURN", 2, [1, 0xFF6080FF]);
Clazz.defineEnumConstant (c$, "SHEET", 3, [2, 0xFFFFC800]);
Clazz.defineEnumConstant (c$, "HELIX", 4, [3, 0xFFFF0080]);
Clazz.defineEnumConstant (c$, "DNA", 5, [4, 0xFFAE00FE]);
Clazz.defineEnumConstant (c$, "RNA", 6, [5, 0xFFFD0162]);
Clazz.defineEnumConstant (c$, "CARBOHYDRATE", 7, [6, 0xFFA6A6FA]);
Clazz.defineEnumConstant (c$, "HELIX310", 8, [7, 0xFFA00080]);
Clazz.defineEnumConstant (c$, "HELIXALPHA", 9, [8, 0xFFFF0080]);
Clazz.defineEnumConstant (c$, "HELIXPI", 10, [9, 0xFF600080]);
Clazz.defineEnumConstant (c$, "ANNOTATION", 11, [-2, 0]);
});


text:
package com.sulacosoft.bitcoindconnector4j;

import java.lang.reflect.Field;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;

import org.apache.commons.io.IOUtils;
import org.apache.http.HttpHost;
import org.apache.http.HttpStatus;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.AuthCache;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.impl.auth.BasicScheme;
import org.apache.http.impl.client.BasicAuthCache;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;

import com.google.gson.Gson;
import com.sulacosoft.bitcoindconnector4j.core.BitcoindConnector4JException;
import com.sulacosoft.bitcoindconnector4j.core.BitcoindException;
import com.sulacosoft.bitcoindconnector4j.core.HttpException;
import com.sulacosoft.bitcoindconnector4j.core.RPCErrorCode;
import com.sulacosoft.bitcoindconnector4j.response.BaseResponse;
import com.sulacosoft.bitcoindconnector4j.response.Error;
import com.sulacosoft.bitcoindconnector4j.response.Fallback;

/**
 *  @author Sebastian Dziak {@literal (sebastian.dziak@sulacosoft.com)}
 *  @author Nicola Atzei
 */
public class BitcoindApiHandler implements InvocationHandler {

	private static final String CHARACTER_ENCODING = "UTF-8";

	private String uri;
	private CloseableHttpClient httpClient;
	private HttpHost targetHost;
	private HttpClientContext context;
	private AtomicLong id = new AtomicLong(1L);

	public void setTimeout(long value, TimeUnit unit) {
		int timeout = (int) unit.toMillis(value);

		RequestConfig config = RequestConfig.custom()
				.setConnectTimeout(timeout)
				.setConnectionRequestTimeout(timeout)
				.setSocketTimeout(timeout).build();

		httpClient = HttpClientBuilder.create().setDefaultRequestConfig(config).build();
	}

	public BitcoindApiHandler(String host, int port, String protocol, String uri, String username, String password) {
		this.uri = uri;

		httpClient = HttpClients.createDefault();

		targetHost = new HttpHost(host, port, protocol);
		CredentialsProvider credsProvider = new BasicCredentialsProvider();
		credsProvider.setCredentials(new AuthScope(targetHost.getHostName(), targetHost.getPort()),
				new UsernamePasswordCredentials(username, password));

		AuthCache authCache = new BasicAuthCache();
		BasicScheme basicAuth = new BasicScheme();
		authCache.put(targetHost, basicAuth);

		context = HttpClientContext.create();
		context.setCredentialsProvider(credsProvider);
		context.setAuthCache(authCache);
	}

	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		String jsonRequest = String.format("{\"jsonrpc\": \"2.0\", \"method\": \"%s\", \"params\": [%s], \"id\": %s}",
				method.getName(), buildParamsString(args), id.getAndIncrement());

		HttpPost httpPost = new HttpPost(uri);
		httpPost.setEntity(new ByteArrayEntity(jsonRequest.getBytes(CHARACTER_ENCODING)));

		try (CloseableHttpResponse response = httpClient.execute(targetHost, httpPost, context);) {
			checkHttpErrors(response.getStatusLine().getStatusCode());
			String jsonResponse = IOUtils.toString(response.getEntity().getContent(), CHARACTER_ENCODING);
			BaseResponse jsonObject = new Gson().fromJson(jsonResponse, BaseResponse.class);

			Error error = jsonObject.getError();
			if (error != null)
				throw new BitcoindException(error.getMessage(), RPCErrorCode.fromCode(error.getCode()));

			try {
				return new Gson().fromJson(jsonObject.getResult(), method.getReturnType());
			}
			catch (RuntimeException e) {
				Class<?> returnType = method.getReturnType();
				for (Field f : returnType.getDeclaredFields()) {
					if (f.isAnnotationPresent(Fallback.class)) {
						Object obj = returnType.newInstance();
						f.setAccessible(true);
						f.set(obj, new Gson().fromJson(jsonObject.getResult(), f.getType()));
						return obj;
					}
				}
				throw e;
			}
		}
		catch(Exception e) {
			throw new BitcoindConnector4JException(e.getMessage(), -1);
		}
	}

	private String buildParamsString(Object[] args) {
		StringBuilder params = new StringBuilder();
		if (args != null && args.length > 0) {
			for (int i = 0; i < args.length; i++) {
				if (i > 0)
					params.append(",");
				Object arg = args[i];
				if (arg instanceof String)
					params.append(String.format("\"%s\"", arg));
				else
					params.append(String.format("%s", arg));
			}
		}
		return params.toString();
	}

	private void checkHttpErrors(int statusCode) throws HttpException {
		if (statusCode != HttpStatus.SC_OK && statusCode != HttpStatus.SC_INTERNAL_SERVER_ERROR) {
			if (statusCode == HttpStatus.SC_UNAUTHORIZED)
				throw new HttpException(String.format(
						"Bitcoind JSON-RPC HTTP error (Probably an incorrect username or password). HTTP Status-Code %s",
						statusCode), statusCode);
			else
				throw new HttpException(String.format("Bitcoind JSON-RPC HTTP error. HTTP Status-Code %s", statusCode),
						statusCode);
		}
	}
}


text:
module Api
  class ServicesController < BaseController
    include Subcollections::ServiceDialogs
    include Subcollections::Tags
    include Subcollections::Vms
    include Subcollections::OrchestrationStacks

    def create_resource(_type, _id, data)
      validate_service_data(data)
      attributes = build_service_attributes(data)
      service    = collection_class(:services).create(attributes)
      validate_service(service)
      service
    end

    def edit_resource(type, id, data)
      attributes = build_service_attributes(data)
      super(type, id, attributes)
    end

    def add_resource_resource(type, id, data)
      raise "Must specify a service href or id to add_resource to" unless id
      svc = resource_search(id, type, collection_class(type))

      resource_type, resource = validate_resource(data)
      raise "Cannot assign #{resource_type} to #{service_ident(svc)}" unless resource.respond_to? :add_to_service

      resource.add_to_service(svc)
      action_result(true, "Assigned resource #{resource_type} id:#{resource.id} to #{service_ident(svc)}")
    rescue => err
      action_result(false, err.to_s)
    end

    def remove_resource_resource(type, id, data)
      raise 'Must specify a resource to remove_resource from' unless id
      svc = resource_search(id, type, collection_class(type))

      resource_type, resource = validate_resource(data)

      svc.remove_resource(resource)
      action_result(true, "Unassigned resource #{resource_type} id:#{resource.id} from #{service_ident(svc)}")
    rescue => err
      action_result(false, err.to_s)
    end

    def remove_all_resources_resource(type, id, _data)
      raise "Must specify a service href or id to remove resources from" unless id
      svc = resource_search(id, type, collection_class(type))
      svc.remove_all_resources
      action_result(true, "Removed all resources from #{service_ident(svc)}")
    rescue => err
      action_result(false, err.to_s)
    end

    def reconfigure_resource(type, id = nil, data = nil)
      raise BadRequestError, "Must specify an id for Reconfiguring a #{type} resource" unless id

      api_action(type, id) do |klass|
        svc = resource_search(id, type, klass)
        api_log_info("Reconfiguring #{service_ident(svc)}")

        result = validate_service_for_action(svc, "reconfigure")
        result = invoke_reconfigure_dialog(type, svc, data) if result[:success]
        result
      end
    end

    def start_resource(type, id = nil, _data = nil)
      raise BadRequestError, "Must specify an id for starting a #{type} resource" unless id

      api_action(type, id) do |klass|
        service = resource_search(id, type, klass)
        api_log_info("Starting #{service_ident(service)}")

        begin
          description = "#{service_ident(service)} starting"
          task_id = queue_object_action(service, description, :method_name => "start", :role => "ems_operations")
          action_result(true, description, :task_id => task_id)
        rescue => e
          action_result(false, e.to_s)
        end
      end
    end

    def stop_resource(type, id = nil, _data = nil)
      raise BadRequestError, "Must specify an id for starting a #{type} resource" unless id

      api_action(type, id) do |klass|
        service = resource_search(id, type, klass)
        api_log_info("Stopping #{service_ident(service)}")

        begin
          description = "#{service_ident(service)} stopping"
          task_id = queue_object_action(service, description, :method_name => "stop", :role => "ems_operations")
          action_result(true, description, :task_id => task_id)
        rescue => e
          action_result(false, e.to_s)
        end
      end
    end

    def suspend_resource(type, id = nil, _data = nil)
      raise BadRequestError, "Must specify an id for starting a #{type} resource" unless id

      api_action(type, id) do |klass|
        service = resource_search(id, type, klass)
        api_log_info("Suspending #{service_ident(service)}")

        begin
          description = "#{service_ident(service)} suspending"
          task_id = queue_object_action(service, description, :method_name => "suspend", :role => "ems_operations")
          action_result(true, description, :task_id => task_id)
        rescue => e
          action_result(false, e.to_s)
        end
      end
    end

    private

    def validate_resource(data)
      resource_href = data.fetch_path("resource", "href")
      raise "Must specify a resource reference" unless resource_href

      resource_type, resource_id = parse_href(resource_href)
      raise "Invalid resource href specified #{resource_href}" unless resource_type && resource_id

      resource = resource_search(resource_id, resource_type, collection_class(resource_type))
      [resource_type, resource]
    end

    def build_service_attributes(data)
      attributes                 = data.dup
      attributes['job_template'] = fetch_configuration_script(data['job_template']) if data['job_template']
      attributes['parent']       = fetch_service(data['parent_service']) if data['parent_service']
      if data['orchestration_manager']
        attributes['orchestration_manager'] = fetch_ext_management_system(data['orchestration_manager'])
      end
      if data['orchestration_template']
        attributes['orchestration_template'] = fetch_orchestration_template(data['orchestration_template'])
      end
      if data['job_options']
        # AnsibleTowerClient needs the keys to be symbols
        attributes['job_options'][:limit]      ||= data['job_options'].delete('limit')
        attributes['job_options'][:extra_vars] ||= data['job_options'].delete('extra_vars')
      end
      attributes.delete('parent_service')
      attributes
    end

    def validate_service_data(data)
      assert_id_not_specified(data, 'service')
    end

    def validate_service(service)
      if service.invalid?
        raise BadRequestError, "Failed to add new service -
            #{service.errors.full_messages.join(', ')}"
      end
    end

    def fetch_ext_management_system(data)
      orchestration_manager_id = parse_id(data, :providers)
      raise BadRequestError, 'Missing ExtManagementSystem identifier id' if orchestration_manager_id.nil?
      resource_search(orchestration_manager_id, :ext_management_systems, ExtManagementSystem)
    end

    def fetch_service(data)
      service_id = parse_id(data, :services)
      raise BadRequestError, 'Missing Service identifier id' if service_id.nil?
      resource_search(service_id, :services, Service)
    end

    def fetch_orchestration_template(data)
      orchestration_template_id = parse_id(data, :orchestration_templates)
      raise BadRequestError, 'Missing OrchestrationTemplate identifier id' if orchestration_template_id.nil?
      resource_search(orchestration_template_id, :orchestration_templates, OrchestrationTemplate)
    end

    def fetch_configuration_script(data)
      configuration_script_id = parse_id(data, :configuration_script)
      raise BadRequestError, 'Missing ConfigurationScript identifier id' if configuration_script_id.nil?
      resource_search(configuration_script_id, :configuration_scripts, ConfigurationScript)
    end

    def service_ident(svc)
      "Service id:#{svc.id} name:'#{svc.name}'"
    end

    def invoke_reconfigure_dialog(type, svc, data = {})
      result = begin
                 wf_result = submit_reconfigure_dialog(svc, data)
                 action_result(true, "#{service_ident(svc)} reconfiguring", :result => wf_result[:request])
               rescue => err
                 action_result(false, err.to_s)
               end
      add_href_to_result(result, type, svc.compressed_id)
      log_result(result)
      result
    end

    def submit_reconfigure_dialog(svc, data)
      ra = svc.reconfigure_resource_action
      wf = ResourceActionWorkflow.new({}, User.current_user, ra, :target => svc)
      data.each { |key, value| wf.set_value(key, value) } if data.present?
      wf_result = wf.submit_request
      raise StandardError, Array(wf_result[:errors]).join(", ") if wf_result[:errors].present?
      wf_result
    end

    def validate_service_for_action(svc, action)
      valid = svc.send("validate_#{action}")
      msg = valid ? "" : "Action #{action} is not available for #{service_ident(svc)}"
      action_result(valid, msg)
    end
  end
end


text:
var Promise = require('bluebird');
var bcrypt = Promise.promisifyAll(require('bcrypt'));
var mongoose = require('mongoose');
mongoose.Promise = Promise;

/**
 * Tabela no Banco de Dados - Usuário
 * @type {Mongoose#Schema}
 */
var UserSchema = mongoose.Schema({
  name: {
    type: String,
    require: true
  },
  username: {
    type: String,
    require: true,
    unique: true,
    index: true
  },
  password: {
    type: String,
    require: true
  },
  role: {
    type: String,
    default: 'public'
  }
});

/**
 * Criptografa a senha antes de salvar no banco
 * @param  {String} nome da funcao que será chamada antes
 * @param {Function} Callback
 */
UserSchema.pre('save', function(next) {
  var user = this;
  if (this.isModified('passport') || this.isNew) {
    bcrypt.genSaltAsync(10)
      .then(function(salt) {
        bcrypt.hashAsync(user.password, salt)
          .then(function(hash) {
            user.password = hash;
            next();
          }).catch(function(err) {
            return next(err);
          });
      })
      .catch(function(err) {
        return next(err);
      });
  }
});

/**
 * Compara a senha que está no banco, com a recebida
 * @param  {String} passw Senha digitada
 * @return {Promise} Resposta da Comparação
 */
UserSchema.methods.comparePassword = function(passw) {
  return bcrypt.compareAsync(passw, this.password)
    .then(function(isMatch) {
      if (isMatch) return isMatch;
      else throw 'Senha Incorreta!';
    }).catch(function(err) {
      throw err;
    });
};

mongoose.model('User', UserSchema);

///////////////////////////////////////////////////////////////////////////////// table

var TableSchema = mongoose.Schema({
  _id: Number,
  disponivel: {
    type: Boolean,
    default: true
  }
});

var model = mongoose.model('Table', TableSchema);


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tatabouf.Domain
{
    public class User
    {
        public int Id { get; set; }

        public string Name { get; set; }

        /// <summary>
        /// number of available seats in my car
        /// </summary>
        public short? AvailableSeats { get; set; }

        public DateTime InscriptionDate { get; set; }

        public DateTime? DepartureTime { get; set; }

        public string IpAddress { get; set; }

        public virtual byte Position
        {
            get
            {
                return Choices.Min(o => o.Place.Priority);
            }
        }

        /// <summary>
        /// user choices list
        /// </summary>
        public virtual ICollection<Choice> Choices { get; set; }

        public User()
        {
            InscriptionDate = DateTime.Now;
        }
    }
}


text:
package com.xeiam.xchange.bitcoinaverage.dto.marketdata;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Data object representing List of Tickers from BitcoinAverage
 */

public final class BitcoinAverageTickers {

  private Map<String, BitcoinAverageTicker> tickers = new HashMap<String, BitcoinAverageTicker>();
  private Date timestamp;

  // Could alternatively add setters, but since these are mandatory
  public BitcoinAverageTickers(@JsonProperty("timestamp") String timestamp) {

    try {
      // Parse the timestamp into a Date object
      this.timestamp = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.getDefault()).parse(timestamp);
    } catch (Exception e) {
      this.timestamp = null;
    }
  }

  @JsonAnySetter
  public void setTickers(String name, BitcoinAverageTicker ticker) {

    this.tickers.put(name, ticker);
  }

  public Map<String, BitcoinAverageTicker> getTickers() {

    return tickers;
  }

  public Date getTimestamp() {

    return timestamp;
  }

  @Override
  public String toString() {

    return "BitcoinAverageTicker [tickers=" + tickers + ", timestamp=" + timestamp + "]";
  }

}


text:
package com.kitware.android.glass.sample.line.model;

/**
 * This class represents a point of interest that has geographical coordinates (latitude and
 * longitude) and a name that is displayed to the user.
 */
public class Place {

    private final double mLatitude;
    private final double mLongitude;
    private final String mName;

    /**
     * Initializes a new place with the specified coordinates and name.
     *
     * @param latitude the latitude of the place
     * @param longitude the longitude of the place
     * @param name the name of the place
     */
    public Place(double latitude, double longitude, String name) {
        mLatitude = latitude;
        mLongitude = longitude;
        mName = name;
    }

    /**
     * Gets the latitude of the place.
     *
     * @return the latitude of the place
     */
    public double getLatitude() {
        return mLatitude;
    }

    /**
     * Gets the longitude of the place.
     *
     * @return the longitude of the place
     */
    public double getLongitude() {
        return mLongitude;
    }

    /**
     * Gets the name of the place.
     *
     * @return the name of the place
     */
    public String getName() {
        return mName;
    }
}


text:
namespace clang {
namespace tooling {

class RefactoringOptionVisitor;
class RefactoringResultConsumer;
class RefactoringRuleContext;

struct RefactoringDescriptor {
  /// A unique identifier for the specific refactoring.
  StringRef Name;
  /// A human readable title for the refactoring.
  StringRef Title;
  /// A human readable description of what the refactoring does.
  StringRef Description;
};

/// A common refactoring action rule interface that defines the 'invoke'
/// function that performs the refactoring operation (either fully or
/// partially).
class RefactoringActionRuleBase {
public:
  virtual ~RefactoringActionRuleBase() {}

  /// Initiates and performs a specific refactoring action.
  ///
  /// The specific rule will invoke an appropriate \c handle method on a
  /// consumer to propagate the result of the refactoring action.
  virtual void invoke(RefactoringResultConsumer &Consumer,
                      RefactoringRuleContext &Context) = 0;

  /// Returns the structure that describes the refactoring.
  // static const RefactoringDescriptor &describe() = 0;
};

/// A refactoring action rule is a wrapper class around a specific refactoring
/// action rule (SourceChangeRefactoringRule, etc) that, in addition to invoking
/// the action, describes the requirements that determine when the action can be
/// initiated.
class RefactoringActionRule : public RefactoringActionRuleBase {
public:
  /// Returns true when the rule has a source selection requirement that has
  /// to be fulfilled before refactoring can be performed.
  virtual bool hasSelectionRequirement() = 0;

  /// Traverses each refactoring option used by the rule and invokes the
  /// \c visit callback in the consumer for each option.
  ///
  /// Options are visited in the order of use, e.g. if a rule has two
  /// requirements that use options, the options from the first requirement
  /// are visited before the options in the second requirement.
  virtual void visitRefactoringOptions(RefactoringOptionVisitor &Visitor) = 0;
};

} // end namespace tooling
} // end namespace clang

#endif // LLVM_CLANG_TOOLING_REFACTOR_REFACTORING_ACTION_RULE_H


text:
namespace Gu.Wpf.FlipView.Demo.ControlDemos
{
    using System.Windows.Controls;

    public partial class FlipViewDataTemplateView : UserControl
    {
        public FlipViewDataTemplateView()
        {
            this.InitializeComponent();
        }
    }
}


text:
Yelp
=================

Simple, promise-based, node module for interfacing with Yelp API v2.0.

### How to use

```javascript
var yelp = require("node-yelp");

var client = yelp.createClient({
  oauth: {
    "consumer_key": "xxxxxxxxxxxxxxxxxxxxxxxx",
    "consumer_secret": "xxxxxxxxxxxxxxxxxxxxxxxx",
    "token": "xxxxxxxxxxxxxxxxxxxxxxxx",
    "token_secret": "xxxxxxxxxxxxxxxxxxxxxxxx"
  },

  // Optional settings:
  httpClient: {
    maxSockets: 25  // ~> Default is 10
  }
});

client.search({
  term: "Café de la presse",
  location: "BELGIUM"
}).then(function (data) {
  var businesses = data.businesses;
  var location = data.region;

  // ...
});

client.business("grand-place-bruxelles-2", {
  cc: "US"
}).then(function (data) {
  // ...
});
```

### Error handling

Every error that comes from the module has an `id` property attached to it:

```javascript

var yelp = require("node-yelp");

client.search({
  term: "Café de la presse",
  location: "BELGIUM"
}).then(function (data) {
  // ..
}).catch(function (err) {
  if (err.type === yelp.errorTypes.areaTooLarge) {
    // ..
  } else if (err.type === yelp.errorTypes.unavailableForLocation) {
    // ..
  }
});
```

Types:

```javascript

var types = {
  unknown: "UNKNOWN",
  internal: "INTERNAL_ERROR",
  exceededRequests: "EXCEEDED_REQS",
  missingParameter: "MISSING_PARAMETER",
  invalidParameter: "INVALID_PARAMETER",
  invalidSignature: "INVALID_SIGNATURE",
  invalidCredentials: "INVALID_CREDENTIALS",
  invalidOAuthCredentials: "INVALID_OAUTH_CREDENTIALS",
  invalidOAuthUser: "INVALID_OAUTH_USER",
  accountUnconfirmed: "ACCOUNT_UNCONFIRMED",
  passwordTooLong: "PASSWORD_TOO_LONG",
  unavailableForLocation: "UNAVAILABLE_FOR_LOCATION",
  areaTooLarge: "AREA_TOO_LARGE",
  multipleLocations: "MULTIPLE_LOCATIONS",
  businessUnavailable: "BUSINESS_UNAVAILABLE",
  unspecifiedLocation: "UNSPECIFIED_LOCATION"
};

```

### Dependencies

* bluebird: `~2.2.2`
* request: `~2.40.0`

### LICENSE

MIT


text:
const char *packet_names[NUM_PACKAGE_TYPES] = {
  "PACKET_CS_LOGIN",
  "PACKET_CS_PING",
};

size_t packet_buf_length(int32_t packet_type) {
  size_t len = sizeof(int32_t);
  switch (packet_type) {
    case PACKET_CS_LOGIN:
      len += sizeof(struct packet_cs_login);
      break;
    case PACKET_CS_PING:
      len += sizeof(struct packet_cs_ping);
      break;
  }
  return len;
}

int32_t packet_get_type(void *data, size_t length) {
  assert(length >= sizeof(int32_t));
  return *(int32_t *)data;
}


text:
import Router from "react-router/lib/Router"
import Link from "react-router/lib/Link"
import IndexLink from "react-router/lib/IndexLink"
import IndexRedirect from "react-router/lib/IndexRedirect"
import IndexRoute from "react-router/lib/IndexRoute"
import Redirect from "react-router/lib/Redirect"
import Route from "react-router/lib/Route"
import History from "react-router/lib/History"
import Lifecycle from "react-router/lib/Lifecycle"
import RouteContext from "react-router/lib/RouteContext"
import browserHistory from "react-router/lib/browserHistory"
import hashHistory from "react-router/lib/hashHistory"
import useRoutes from "react-router/lib/useRoutes"
import { createRoutes } from "react-router/lib/RouteUtils"
import { formatPattern } from "react-router/lib/PatternUtils"
import RouterContext from "react-router/lib/RouterContext"
import PropTypes from "react-router/lib/PropTypes"
import match from "react-router/lib/match"
import useRouterHistory from "react-router/lib/useRouterHistory";
import createMemoryHistory from "react-router/lib/createMemoryHistory";
import withRouter from "react-router/lib/withRouter";
import applyRouterMiddleware from "react-router/lib/applyRouterMiddleware";

// PlainRoute is defined in the API documented at:
// https://github.com/rackt/react-router/blob/master/docs/API.md
// but not included in any of the .../lib modules above.
export type PlainRoute = ReactRouter.PlainRoute

// The following definitions are also very useful to export
// because by using these types lots of potential type errors
// can be exposed:
export type EnterHook = ReactRouter.EnterHook
export type LeaveHook = ReactRouter.LeaveHook
export type ParseQueryString = ReactRouter.ParseQueryString
export type RedirectFunction = ReactRouter.RedirectFunction
export type RouteComponentProps<P, R> = ReactRouter.RouteComponentProps<P, R>;
export type RouteHook = ReactRouter.RouteHook
export type StringifyQuery = ReactRouter.StringifyQuery
export type RouterListener = ReactRouter.RouterListener
export type RouterState = ReactRouter.RouterState
export type HistoryBase = ReactRouter.HistoryBase
export type RouterOnContext = ReactRouter.RouterOnContext
export type RouteProps = ReactRouter.RouteProps

interface routerRedux {
  routerStateReducer: Function,
  ReduxRouter: Function,
  reduxReactRouter: Function,
  isActive: Function,
  historyAPI: Function,
  push: Function,
  replace: Function,
  setState: Function,
  go: Function,
  goBack: Function,
  goForward: Function,
}

export const routerRedux: routerRedux;

export {
  Router,
  Link,
  IndexLink,
  IndexRedirect,
  IndexRoute,
  Redirect,
  Route,
  History,
  browserHistory,
  hashHistory,
  Lifecycle,
  RouteContext,
  useRoutes,
  createRoutes,
  formatPattern,
  RouterContext,
  PropTypes,
  match,
  useRouterHistory,
  createMemoryHistory,
  withRouter,
  applyRouterMiddleware
};

export default Router;


text:
// This file is automatically generated.

package adila.db;

/*
 * ZTE Racer
 *
 * DEVICE: mooncake
 * MODEL: ZTE-RACER
 */
final class mooncake_zte2dracer {
    public static final String DATA = "ZTE|Racer|";
}