text:
CKEDITOR.plugins.setLang( 'image', 'tr', {
	alertUrl: 'Lütfen resmin URL\'sini yazınız',
	alt: 'Alternatif Yazı',
	border: 'Kenar',
	btnUpload: 'Sunucuya Yolla',
	button2Img: 'Seçili resim butonunu basit resime çevirmek istermisiniz?',
	hSpace: 'Yatay Boşluk',
	img2Button: 'Seçili olan resimi, resimli butona çevirmek istermisiniz?',
	infoTab: 'Resim Bilgisi',
	linkTab: 'Köprü',
	lockRatio: 'Oranı Kilitle',
	menu: 'Resim Özellikleri',
	resetSize: 'Boyutu Başa Döndür',
	title: 'Resim Özellikleri',
	titleButton: 'Resimli Düğme Özellikleri',
	upload: 'Karşıya Yükle',
	urlMissing: 'Resmin URL kaynağı eksiktir.',
	vSpace: 'Dikey Boşluk',
	validateBorder: 'Çerçeve tam sayı olmalıdır.',
	validateHSpace: 'HSpace tam sayı olmalıdır.',
	validateVSpace: 'VSpace tam sayı olmalıdır.'
});


text:
"""Tests for the `MapFusion` optimization."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from absl.testing import parameterized

from tensorflow.python.data.experimental.ops import optimization
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.framework import test_util
from tensorflow.python.platform import test

def _map_fusion_test_cases():
  """Generates test cases for the MapFusion optimization."""

  identity = lambda x: x
  increment = lambda x: x + 1

  def increment_and_square(x):
    y = x + 1
    return y * y

  functions = [identity, increment, increment_and_square]
  tests = []
  for i, fun1 in enumerate(functions):
    for j, fun2 in enumerate(functions):
      tests.append((
          "Test{}{}".format(i, j),
          [fun1, fun2],
      ))
      for k, fun3 in enumerate(functions):
        tests.append((
            "Test{}{}{}".format(i, j, k),
            [fun1, fun2, fun3],
        ))

  swap = lambda x, n: (n, x)
  tests.append((
      "Swap1",
      [lambda x: (x, 42), swap],
  ))
  tests.append((
      "Swap2",
      [lambda x: (x, 42), swap, swap],
  ))
  return tuple(tests)

@test_util.run_all_in_graph_and_eager_modes
class MapFusionTest(test_base.DatasetTestBase, parameterized.TestCase):

  @parameterized.named_parameters(*_map_fusion_test_cases())
  def testMapFusion(self, functions):
    dataset = dataset_ops.Dataset.range(5).apply(
        optimization.assert_next(["Map", "MemoryCacheImpl"]))
    for function in functions:
      dataset = dataset.map(function)

    dataset = dataset.cache()
    options = dataset_ops.Options()
    options.experimental_map_fusion = True
    dataset = dataset.with_options(options)
    expected_output = []
    for x in range(5):
      r = x
      for function in functions:
        if isinstance(r, tuple):
          r = function(*r)  # Pass tuple as multiple arguments.
        else:
          r = function(r)
      expected_output.append(r)
    self.assertDatasetProduces(dataset, expected_output=expected_output)

if __name__ == "__main__":
  test.main()

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.teamcatalyst.checkmypet" >

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />

    <application
        android:name="MyApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".activities.CameraTestActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".activities.MainActivity" >
        </activity>
        <activity
            android:name=".activities.InfoActivity"
            android:label="@string/title_activity_info" >
        </activity>
    </application>

</manifest>


text:
<% if namespaced? -%>
require_dependency "<%= namespaced_file_path %>/application_controller"

<% end -%>
<% module_namespacing do -%>
class Admin::<%= controller_class_name %>Controller < AdminController

  # GET /admin<%= route_url %>
  # GET /admin<%= route_url %>.json
  def index
    @<%= plural_table_name %> = ::<%= orm_class.all(class_name) %>

    respond_to do |format|
      format.html # index.html.erb
      format.json { render <%= key_value :json, "@#{plural_table_name}" %> }
    end
  end

  # GET /admin<%= route_url %>/1
  # GET /admin<%= route_url %>/1.json
  def show
    @<%= singular_table_name %> = ::<%= orm_class.find(class_name, "params[:id]") %>

    respond_to do |format|
      format.html # show.html.erb
      format.json { render <%= key_value :json, "@#{singular_table_name}" %> }
    end
  end

  # GET /admin<%= route_url %>/new
  # GET /admin<%= route_url %>/new.json
  def new
    @<%= singular_table_name %> = ::<%= orm_class.build(class_name) %>

    respond_to do |format|
      format.html # new.html.erb
      format.json { render <%= key_value :json, "@#{singular_table_name}" %> }
    end
  end

  # GET /admin<%= route_url %>/1/edit
  def edit
    @<%= singular_table_name %> = ::<%= orm_class.find(class_name, "params[:id]") %>
  end

  # POST /admin<%= route_url %>
  # POST /admin<%= route_url %>.json
  def create
    @<%= singular_table_name %> = ::<%= orm_class.build(class_name, "params[:#{singular_table_name}], as: :admin") %>

    respond_to do |format|
      if @<%= orm_instance.save %>
        format.html { redirect_to admin_<%= singular_table_name %>_path(@<%= singular_table_name %>), <%= key_value :notice, "'#{human_name} was successfully created.'" %> }
      else
        format.html { render <%= key_value :action, '"new"' %> }
      end
    end
  end

  # PUT /admin<%= route_url %>/1
  # PUT /admin<%= route_url %>/1.json
  def update
    @<%= singular_table_name %> = ::<%= orm_class.find(class_name, "params[:id]") %>

    respond_to do |format|
      if @<%= orm_instance.update_attributes("params[:#{singular_table_name}], as: :admin") %>
        format.html { redirect_to admin_<%= singular_table_name %>_path(@<%= singular_table_name %>), <%= key_value :notice, "'#{human_name} was successfully updated.'" %> }
      else
        format.html { render <%= key_value :action, '"edit"' %> }
      end
    end
  end

  # DELETE /admin<%= route_url %>/1
  # DELETE /admin<%= route_url %>/1.json
  def destroy
    @<%= singular_table_name %> = ::<%= orm_class.find(class_name, "params[:id]") %>
    @<%= orm_instance.destroy %>

    respond_to do |format|
      format.html { redirect_to admin_<%= index_helper %>_url }
      format.json { head :no_content }
    end
  end
end
<% end -%>


text:
//               -- http/status_code.hpp --
//
//            Copyright (c) Darren Garvey 2007.
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//          http://www.boost.org/LICENSE_1_0.txt)
//
////////////////////////////////////////////////////////////////
#ifndef CGI_HTTP_STATUS_CODE_HPP_INCLUDED__
#define CGI_HTTP_STATUS_CODE_HPP_INCLUDED__

BOOST_CGI_NAMESPACE_BEGIN
 namespace common {
  namespace http {

    /// Standard HTTP status codes
    /**
     * See http://tools.ietf.org/html/rfc2616#section-10
     */
    enum status_code
    {
      /// Informational codes
      continue_                      = 100, // note the trailing underscore
      switching_protocols,
      processing,

      /// Success codes
      ok                             = 200,
      created,
      accepted,
      non_authorative_information,
      no_content,
      reset_content,
      partial_content,
      multi_status,

      /// Redirect codes
      multiple_choices               = 300,
      moved_permanently,
      found,
      see_other,
      not_modified,
      use_proxy,
      switch_proxy,
      temporary_redirect,

      /// Domain error codes
      bad_request                    = 400,
      unauthorized,
      payment_required,
      forbidden,
      not_found,
      method_not_allowed,
      not_acceptable,
      proxy_authentication_required,
      request_timeout,
      conflict,
      gone,
      length_required,
      precondition_failed,
      request_entity_too_large,
      request_uri_too_long,
      unsupported_media_type,
      request_range_not_satisfiable,
      expectation_failed,
      unprocessable_entity           = 422,
      locked,
      failed_dependency,
      unordered_collection,
      upgrade_required,
      retry_with                     = 449,

      /// Internal error codes
      internal_server_error          = 500,
      not_implemented,
      bad_gateway,
      service_unavailable,
      gateway_timeout,
      http_version_not_supported,
      insufficient_storage,
      bandwidth_limit_exceeded       = 509
    };

  } // namespace http
 } // namespace common

BOOST_CGI_NAMESPACE_END

namespace boost { namespace http {
  using namespace ::BOOST_CGI_NAMESPACE::common::http;
} } // namespace boost::http

#endif // CGI_HTTP_STATUS_CODE_HPP_INCLUDED__


text:
export * from "./DangerButton";
export { default } from "./DangerButton";


text:
using namespace llvm;

STATISTIC(NumAllocations, "Number of frame indices allocated into local block");
STATISTIC(NumBaseRegisters, "Number of virtual frame base registers allocated");
STATISTIC(NumReplacements, "Number of frame indices references replaced");

namespace {
  class FrameRef {
    MachineBasicBlock::iterator MI; // Instr referencing the frame
    int64_t LocalOffset;            // Local offset of the frame idx referenced
  public:
    FrameRef(MachineBasicBlock::iterator I, int64_t Offset) :
      MI(I), LocalOffset(Offset) {}
    bool operator<(const FrameRef &RHS) const {
      return LocalOffset < RHS.LocalOffset;
    }
    MachineBasicBlock::iterator getMachineInstr() { return MI; }
  };

  class LocalStackSlotPass: public MachineFunctionPass {
    SmallVector<int64_t,16> LocalOffsets;

    void AdjustStackOffset(MachineFrameInfo *MFI, int FrameIdx, int64_t &Offset,
                           bool StackGrowsDown, unsigned &MaxAlign);
    void calculateFrameObjectOffsets(MachineFunction &Fn);
    bool insertFrameReferenceRegisters(MachineFunction &Fn);
  public:
    static char ID; // Pass identification, replacement for typeid
    explicit LocalStackSlotPass() : MachineFunctionPass(ID) { }
    bool runOnMachineFunction(MachineFunction &MF);

    virtual void getAnalysisUsage(AnalysisUsage &AU) const {
      AU.setPreservesCFG();
      MachineFunctionPass::getAnalysisUsage(AU);
    }

  private:
  };
} // end anonymous namespace

char LocalStackSlotPass::ID = 0;
char &llvm::LocalStackSlotAllocationID = LocalStackSlotPass::ID;
INITIALIZE_PASS(LocalStackSlotPass, "localstackalloc",
                "Local Stack Slot Allocation", false, false)

bool LocalStackSlotPass::runOnMachineFunction(MachineFunction &MF) {
  MachineFrameInfo *MFI = MF.getFrameInfo();
  const TargetRegisterInfo *TRI = MF.getTarget().getRegisterInfo();
  unsigned LocalObjectCount = MFI->getObjectIndexEnd();

  // If the target doesn't want/need this pass, or if there are no locals
  // to consider, early exit.
  if (!TRI->requiresVirtualBaseRegisters(MF) || LocalObjectCount == 0)
    return true;

  // Make sure we have enough space to store the local offsets.
  LocalOffsets.resize(MFI->getObjectIndexEnd());

  // Lay out the local blob.
  calculateFrameObjectOffsets(MF);

  // Insert virtual base registers to resolve frame index references.
  bool UsedBaseRegs = insertFrameReferenceRegisters(MF);

  // Tell MFI whether any base registers were allocated. PEI will only
  // want to use the local block allocations from this pass if there were any.
  // Otherwise, PEI can do a bit better job of getting the alignment right
  // without a hole at the start since it knows the alignment of the stack
  // at the start of local allocation, and this pass doesn't.
  MFI->setUseLocalStackAllocationBlock(UsedBaseRegs);

  return true;
}

/// AdjustStackOffset - Helper function used to adjust the stack frame offset.
void LocalStackSlotPass::AdjustStackOffset(MachineFrameInfo *MFI,
                                           int FrameIdx, int64_t &Offset,
                                           bool StackGrowsDown,
                                           unsigned &MaxAlign) {
  // If the stack grows down, add the object size to find the lowest address.
  if (StackGrowsDown)
    Offset += MFI->getObjectSize(FrameIdx);

  unsigned Align = MFI->getObjectAlignment(FrameIdx);

  // If the alignment of this object is greater than that of the stack, then
  // increase the stack alignment to match.
  MaxAlign = std::max(MaxAlign, Align);

  // Adjust to alignment boundary.
  Offset = (Offset + Align - 1) / Align * Align;

  int64_t LocalOffset = StackGrowsDown ? -Offset : Offset;
  DEBUG(dbgs() << "Allocate FI(" << FrameIdx << ") to local offset "
        << LocalOffset << "\n");
  // Keep the offset available for base register allocation
  LocalOffsets[FrameIdx] = LocalOffset;
  // And tell MFI about it for PEI to use later
  MFI->mapLocalFrameObject(FrameIdx, LocalOffset);

  if (!StackGrowsDown)
    Offset += MFI->getObjectSize(FrameIdx);

  ++NumAllocations;
}

/// calculateFrameObjectOffsets - Calculate actual frame offsets for all of the
/// abstract stack objects.
///
void LocalStackSlotPass::calculateFrameObjectOffsets(MachineFunction &Fn) {
  // Loop over all of the stack objects, assigning sequential addresses...
  MachineFrameInfo *MFI = Fn.getFrameInfo();
  const TargetFrameLowering &TFI = *Fn.getTarget().getFrameLowering();
  bool StackGrowsDown =
    TFI.getStackGrowthDirection() == TargetFrameLowering::StackGrowsDown;
  int64_t Offset = 0;
  unsigned MaxAlign = 0;

  // Make sure that the stack protector comes before the local variables on the
  // stack.
  SmallSet<int, 16> LargeStackObjs;
  if (MFI->getStackProtectorIndex() >= 0) {
    AdjustStackOffset(MFI, MFI->getStackProtectorIndex(), Offset,
                      StackGrowsDown, MaxAlign);

    // Assign large stack objects first.
    for (unsigned i = 0, e = MFI->getObjectIndexEnd(); i != e; ++i) {
      if (MFI->isDeadObjectIndex(i))
        continue;
      if (MFI->getStackProtectorIndex() == (int)i)
        continue;
      if (!MFI->MayNeedStackProtector(i))
        continue;

      AdjustStackOffset(MFI, i, Offset, StackGrowsDown, MaxAlign);
      LargeStackObjs.insert(i);
    }
  }

  // Then assign frame offsets to stack objects that are not used to spill
  // callee saved registers.
  for (unsigned i = 0, e = MFI->getObjectIndexEnd(); i != e; ++i) {
    if (MFI->isDeadObjectIndex(i))
      continue;
    if (MFI->getStackProtectorIndex() == (int)i)
      continue;
    if (LargeStackObjs.count(i))
      continue;

    AdjustStackOffset(MFI, i, Offset, StackGrowsDown, MaxAlign);
  }

  // Remember how big this blob of stack space is
  MFI->setLocalFrameSize(Offset);
  MFI->setLocalFrameMaxAlign(MaxAlign);
}

static inline bool
lookupCandidateBaseReg(const SmallVector<std::pair<unsigned, int64_t>, 8> &Regs,
                       std::pair<unsigned, int64_t> &RegOffset,
                       int64_t FrameSizeAdjust,
                       int64_t LocalFrameOffset,
                       const MachineInstr *MI,
                       const TargetRegisterInfo *TRI) {
  unsigned e = Regs.size();
  for (unsigned i = 0; i < e; ++i) {
    RegOffset = Regs[i];
    // Check if the relative offset from the where the base register references
    // to the target address is in range for the instruction.
    int64_t Offset = FrameSizeAdjust + LocalFrameOffset - RegOffset.second;
    if (TRI->isFrameOffsetLegal(MI, Offset))
      return true;
  }
  return false;
}

bool LocalStackSlotPass::insertFrameReferenceRegisters(MachineFunction &Fn) {
  // Scan the function's instructions looking for frame index references.
  // For each, ask the target if it wants a virtual base register for it
  // based on what we can tell it about where the local will end up in the
  // stack frame. If it wants one, re-use a suitable one we've previously
  // allocated, or if there isn't one that fits the bill, allocate a new one
  // and ask the target to create a defining instruction for it.
  bool UsedBaseReg = false;

  MachineFrameInfo *MFI = Fn.getFrameInfo();
  const TargetRegisterInfo *TRI = Fn.getTarget().getRegisterInfo();
  const TargetFrameLowering &TFI = *Fn.getTarget().getFrameLowering();
  bool StackGrowsDown =
    TFI.getStackGrowthDirection() == TargetFrameLowering::StackGrowsDown;

  // Collect all of the instructions in the block that reference
  // a frame index. Also store the frame index referenced to ease later
  // lookup. (For any insn that has more than one FI reference, we arbitrarily
  // choose the first one).
  SmallVector<FrameRef, 64> FrameReferenceInsns;

  // A base register definition is a register + offset pair.
  SmallVector<std::pair<unsigned, int64_t>, 8> BaseRegisters;

  for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) {
    for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ++I) {
      MachineInstr *MI = I;

      // Debug value instructions can't be out of range, so they don't need
      // any updates.
      if (MI->isDebugValue())
        continue;

      // For now, allocate the base register(s) within the basic block
      // where they're used, and don't try to keep them around outside
      // of that. It may be beneficial to try sharing them more broadly
      // than that, but the increased register pressure makes that a
      // tricky thing to balance. Investigate if re-materializing these
      // becomes an issue.
      for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
        // Consider replacing all frame index operands that reference
        // an object allocated in the local block.
        if (MI->getOperand(i).isFI()) {
          // Don't try this with values not in the local block.
          if (!MFI->isObjectPreAllocated(MI->getOperand(i).getIndex()))
            break;
          FrameReferenceInsns.
            push_back(FrameRef(MI, LocalOffsets[MI->getOperand(i).getIndex()]));
          break;
        }
      }
    }
  }

  // Sort the frame references by local offset
  array_pod_sort(FrameReferenceInsns.begin(), FrameReferenceInsns.end());

  MachineBasicBlock *Entry = Fn.begin();

  // Loop through the frame references and allocate for them as necessary.
  for (int ref = 0, e = FrameReferenceInsns.size(); ref < e ; ++ref) {
    MachineBasicBlock::iterator I =
      FrameReferenceInsns[ref].getMachineInstr();
    MachineInstr *MI = I;
    for (unsigned idx = 0, e = MI->getNumOperands(); idx != e; ++idx) {
      // Consider replacing all frame index operands that reference
      // an object allocated in the local block.
      if (MI->getOperand(idx).isFI()) {
        int FrameIdx = MI->getOperand(idx).getIndex();

        assert(MFI->isObjectPreAllocated(FrameIdx) &&
               "Only pre-allocated locals expected!");

        DEBUG(dbgs() << "Considering: " << *MI);
        if (TRI->needsFrameBaseReg(MI, LocalOffsets[FrameIdx])) {
          unsigned BaseReg = 0;
          int64_t Offset = 0;
          int64_t FrameSizeAdjust =
            StackGrowsDown ? MFI->getLocalFrameSize() : 0;

          DEBUG(dbgs() << "  Replacing FI in: " << *MI);

          // If we have a suitable base register available, use it; otherwise
          // create a new one. Note that any offset encoded in the
          // instruction itself will be taken into account by the target,
          // so we don't have to adjust for it here when reusing a base
          // register.
          std::pair<unsigned, int64_t> RegOffset;
          if (lookupCandidateBaseReg(BaseRegisters, RegOffset,
                                     FrameSizeAdjust,
                                     LocalOffsets[FrameIdx],
                                     MI, TRI)) {
            DEBUG(dbgs() << "  Reusing base register " <<
                  RegOffset.first << "\n");
            // We found a register to reuse.
            BaseReg = RegOffset.first;
            Offset = FrameSizeAdjust + LocalOffsets[FrameIdx] -
              RegOffset.second;
          } else {
            // No previously defined register was in range, so create a
            // new one.
            int64_t InstrOffset = TRI->getFrameIndexInstrOffset(MI, idx);
            const MachineFunction *MF = MI->getParent()->getParent();
            const TargetRegisterClass *RC = TRI->getPointerRegClass(*MF);
            BaseReg = Fn.getRegInfo().createVirtualRegister(RC);

            DEBUG(dbgs() << "  Materializing base register " << BaseReg <<
                  " at frame local offset " <<
                  LocalOffsets[FrameIdx] + InstrOffset << "\n");

            // Tell the target to insert the instruction to initialize
            // the base register.
            //            MachineBasicBlock::iterator InsertionPt = Entry->begin();
            TRI->materializeFrameBaseRegister(Entry, BaseReg, FrameIdx,
                                              InstrOffset);

            // The base register already includes any offset specified
            // by the instruction, so account for that so it doesn't get
            // applied twice.
            Offset = -InstrOffset;

            int64_t BaseOffset = FrameSizeAdjust + LocalOffsets[FrameIdx] +
              InstrOffset;
            BaseRegisters.push_back(
              std::pair<unsigned, int64_t>(BaseReg, BaseOffset));
            ++NumBaseRegisters;
            UsedBaseReg = true;
          }
          assert(BaseReg != 0 && "Unable to allocate virtual base register!");

          // Modify the instruction to use the new base register rather
          // than the frame index operand.
          TRI->resolveFrameIndex(I, BaseReg, Offset);
          DEBUG(dbgs() << "Resolved: " << *MI);

          ++NumReplacements;
        }
      }
    }
  }
  return UsedBaseReg;
}


text:
const {
  isAuth,
  isAuthId,
  isString,
  newDataExists,
  hasChildren,
  validate
} = require('../../helpers/common');
const { ifCondition } = require('../..//helpers/conditions');

const isUserAndIsNotRemoving = ifCondition(
  newDataExists,
  isAuthId('$userId'),
  false
);

module.exports = {
  'users/$userId': {
    read: isAuth,
    write: isUserAndIsNotRemoving,
    validate: hasChildren(['firstName'])
  },
  'users/$userId/firstName': validate(isString),
  'users/$userId/$invalidProp': validate(false)
};


text:
.class public final Lcom/android/server/Watchdog$HandlerChecker;
.super Ljava/lang/Object;
.source "Watchdog.java"

# interfaces
.implements Ljava/lang/Runnable;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/server/Watchdog;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x11
    name = "HandlerChecker"
.end annotation

# instance fields
.field private mCompleted:Z

.field private mCurrentMonitor:Lcom/android/server/Watchdog$Monitor;

.field private final mHandler:Landroid/os/Handler;

.field private final mMonitors:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/android/server/Watchdog$Monitor;",
            ">;"
        }
    .end annotation
.end field

.field private final mName:Ljava/lang/String;

.field private mStartTime:J

.field private final mWaitMax:J

.field final synthetic this$0:Lcom/android/server/Watchdog;

# direct methods
.method constructor <init>(Lcom/android/server/Watchdog;Landroid/os/Handler;Ljava/lang/String;J)V
    .locals 2
    .param p1, "this$0"    # Lcom/android/server/Watchdog;
    .param p2, "handler"    # Landroid/os/Handler;
    .param p3, "name"    # Ljava/lang/String;
    .param p4, "waitMaxMillis"    # J

    .prologue
    .line 96
    iput-object p1, p0, Lcom/android/server/Watchdog$HandlerChecker;->this$0:Lcom/android/server/Watchdog;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 91
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/android/server/Watchdog$HandlerChecker;->mMonitors:Ljava/util/ArrayList;

    .line 97
    iput-object p2, p0, Lcom/android/server/Watchdog$HandlerChecker;->mHandler:Landroid/os/Handler;

    .line 98
    iput-object p3, p0, Lcom/android/server/Watchdog$HandlerChecker;->mName:Ljava/lang/String;

    .line 99
    iput-wide p4, p0, Lcom/android/server/Watchdog$HandlerChecker;->mWaitMax:J

    .line 100
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/android/server/Watchdog$HandlerChecker;->mCompleted:Z

    .line 96
    return-void
.end method

# virtual methods
.method public addMonitor(Lcom/android/server/Watchdog$Monitor;)V
    .locals 1
    .param p1, "monitor"    # Lcom/android/server/Watchdog$Monitor;

    .prologue
    .line 104
    iget-object v0, p0, Lcom/android/server/Watchdog$HandlerChecker;->mMonitors:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 103
    return-void
.end method

.method public describeBlockedStateLocked()Ljava/lang/String;
    .locals 2

    .prologue
    .line 157
    iget-object v0, p0, Lcom/android/server/Watchdog$HandlerChecker;->mCurrentMonitor:Lcom/android/server/Watchdog$Monitor;

    if-nez v0, :cond_0

    .line 158
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v1, "Blocked in handler on "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lcom/android/server/Watchdog$HandlerChecker;->mName:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v1, " ("

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {p0}, Lcom/android/server/Watchdog$HandlerChecker;->getThread()Ljava/lang/Thread;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Thread;->getName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string/jumbo v1, ")"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0

    .line 160
    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v1, "Blocked in monitor "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, p0, Lcom/android/server/Watchdog$HandlerChecker;->mCurrentMonitor:Lcom/android/server/Watchdog$Monitor;

    invoke-virtual {v1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 161
    const-string/jumbo v1, " on "

    .line 160
    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 161
    iget-object v1, p0, Lcom/android/server/Watchdog$HandlerChecker;->mName:Ljava/lang/String;

    .line 160
    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 161
    const-string/jumbo v1, " ("

    .line 160
    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 161
    invoke-virtual {p0}, Lcom/android/server/Watchdog$HandlerChecker;->getThread()Ljava/lang/Thread;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Thread;->getName()Ljava/lang/String;

    move-result-object v1

    .line 160
    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    .line 161
    const-string/jumbo v1, ")"

    .line 160
    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getCompletionStateLocked()I
    .locals 6

    .prologue
    .line 135
    iget-boolean v2, p0, Lcom/android/server/Watchdog$HandlerChecker;->mCompleted:Z

    if-eqz v2, :cond_0

    .line 136
    const/4 v2, 0x0

    return v2

    .line 138
    :cond_0
    invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

    move-result-wide v2

    iget-wide v4, p0, Lcom/android/server/Watchdog$HandlerChecker;->mStartTime:J

    sub-long v0, v2, v4

    .line 139
    .local v0, "latency":J
    iget-wide v2, p0, Lcom/android/server/Watchdog$HandlerChecker;->mWaitMax:J

    const-wide/16 v4, 0x2

    div-long/2addr v2, v4

    cmp-long v2, v0, v2

    if-gez v2, :cond_1

    .line 140
    const/4 v2, 0x1

    return v2

    .line 141
    :cond_1
    iget-wide v2, p0, Lcom/android/server/Watchdog$HandlerChecker;->mWaitMax:J

    cmp-long v2, v0, v2

    if-gez v2, :cond_2

    .line 142
    const/4 v2, 0x2

    return v2

    .line 145
    :cond_2
    const/4 v2, 0x3

    return v2
.end method

.method public getName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 153
    iget-object v0, p0, Lcom/android/server/Watchdog$HandlerChecker;->mName:Ljava/lang/String;

    return-object v0
.end method

.method public getThread()Ljava/lang/Thread;
    .locals 1

    .prologue
    .line 149
    iget-object v0, p0, Lcom/android/server/Watchdog$HandlerChecker;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Looper;->getThread()Ljava/lang/Thread;

    move-result-object v0

    return-object v0
.end method

.method public isOverdueLocked()Z
    .locals 8

    .prologue
    const/4 v0, 0x0

    .line 131
    iget-boolean v1, p0, Lcom/android/server/Watchdog$HandlerChecker;->mCompleted:Z

    if-nez v1, :cond_0

    invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

    move-result-wide v2

    iget-wide v4, p0, Lcom/android/server/Watchdog$HandlerChecker;->mStartTime:J

    iget-wide v6, p0, Lcom/android/server/Watchdog$HandlerChecker;->mWaitMax:J

    add-long/2addr v4, v6

    cmp-long v1, v2, v4

    if-lez v1, :cond_0

    const/4 v0, 0x1

    :cond_0
    return v0
.end method

.method public run()V
    .locals 4

    .prologue
    .line 167
    iget-object v2, p0, Lcom/android/server/Watchdog$HandlerChecker;->mMonitors:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v1

    .line 168
    .local v1, "size":I
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_0
    if-ge v0, v1, :cond_0

    .line 169
    iget-object v3, p0, Lcom/android/server/Watchdog$HandlerChecker;->this$0:Lcom/android/server/Watchdog;

    monitor-enter v3

    .line 170
    :try_start_0
    iget-object v2, p0, Lcom/android/server/Watchdog$HandlerChecker;->mMonitors:Ljava/util/ArrayList;

    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/android/server/Watchdog$Monitor;

    iput-object v2, p0, Lcom/android/server/Watchdog$HandlerChecker;->mCurrentMonitor:Lcom/android/server/Watchdog$Monitor;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit v3

    .line 172
    iget-object v2, p0, Lcom/android/server/Watchdog$HandlerChecker;->mCurrentMonitor:Lcom/android/server/Watchdog$Monitor;

    invoke-interface {v2}, Lcom/android/server/Watchdog$Monitor;->monitor()V

    .line 168
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 169
    :catchall_0
    move-exception v2

    monitor-exit v3

    throw v2

    .line 175
    :cond_0
    iget-object v3, p0, Lcom/android/server/Watchdog$HandlerChecker;->this$0:Lcom/android/server/Watchdog;

    monitor-enter v3

    .line 176
    const/4 v2, 0x1

    :try_start_1
    iput-boolean v2, p0, Lcom/android/server/Watchdog$HandlerChecker;->mCompleted:Z

    .line 177
    const/4 v2, 0x0

    iput-object v2, p0, Lcom/android/server/Watchdog$HandlerChecker;->mCurrentMonitor:Lcom/android/server/Watchdog$Monitor;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1

    monitor-exit v3

    .line 166
    return-void

    .line 175
    :catchall_1
    move-exception v2

    monitor-exit v3

    throw v2
.end method

.method public scheduleCheckLocked()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 108
    iget-object v0, p0, Lcom/android/server/Watchdog$HandlerChecker;->mMonitors:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/android/server/Watchdog$HandlerChecker;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0}, Landroid/os/Handler;->getLooper()Landroid/os/Looper;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/Looper;->getQueue()Landroid/os/MessageQueue;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/MessageQueue;->isPolling()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 115
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/android/server/Watchdog$HandlerChecker;->mCompleted:Z

    .line 116
    return-void

    .line 119
    :cond_0
    iget-boolean v0, p0, Lcom/android/server/Watchdog$HandlerChecker;->mCompleted:Z

    if-nez v0, :cond_1

    .line 121
    return-void

    .line 124
    :cond_1
    iput-boolean v1, p0, Lcom/android/server/Watchdog$HandlerChecker;->mCompleted:Z

    .line 125
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/android/server/Watchdog$HandlerChecker;->mCurrentMonitor:Lcom/android/server/Watchdog$Monitor;

    .line 126
    invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

    move-result-wide v0

    iput-wide v0, p0, Lcom/android/server/Watchdog$HandlerChecker;->mStartTime:J

    .line 127
    iget-object v0, p0, Lcom/android/server/Watchdog$HandlerChecker;->mHandler:Landroid/os/Handler;

    invoke-virtual {v0, p0}, Landroid/os/Handler;->postAtFrontOfQueue(Ljava/lang/Runnable;)Z

    .line 107
    return-void
.end method


text:
package priorities

import (
	"fmt"
	"math"

	"k8s.io/kubernetes/pkg/api"
	priorityutil "k8s.io/kubernetes/plugin/pkg/scheduler/algorithm/priorities/util"
	schedulerapi "k8s.io/kubernetes/plugin/pkg/scheduler/api"
	"k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache"

	"github.com/golang/glog"
)

// This is a reasonable size range of all container images. 90%ile of images on dockerhub drops into this range.
const (
	mb         int64 = 1024 * 1024
	minImgSize int64 = 23 * mb
	maxImgSize int64 = 1000 * mb
)

// Also used in most/least_requested nad metadata.
// TODO: despaghettify it
func getNonZeroRequests(pod *api.Pod) *schedulercache.Resource {
	result := &schedulercache.Resource{}
	for i := range pod.Spec.Containers {
		container := &pod.Spec.Containers[i]
		cpu, memory := priorityutil.GetNonzeroRequests(&container.Resources.Requests)
		result.MilliCPU += cpu
		result.Memory += memory
	}
	return result
}

func calculateBalancedResourceAllocation(pod *api.Pod, podRequests *schedulercache.Resource, nodeInfo *schedulercache.NodeInfo) (schedulerapi.HostPriority, error) {
	node := nodeInfo.Node()
	if node == nil {
		return schedulerapi.HostPriority{}, fmt.Errorf("node not found")
	}

	allocatableResources := nodeInfo.AllocatableResource()
	totalResources := *podRequests
	totalResources.MilliCPU += nodeInfo.NonZeroRequest().MilliCPU
	totalResources.Memory += nodeInfo.NonZeroRequest().Memory

	cpuFraction := fractionOfCapacity(totalResources.MilliCPU, allocatableResources.MilliCPU)
	memoryFraction := fractionOfCapacity(totalResources.Memory, allocatableResources.Memory)
	score := int(0)
	if cpuFraction >= 1 || memoryFraction >= 1 {
		// if requested >= capacity, the corresponding host should never be preferred.
		score = 0
	} else {
		// Upper and lower boundary of difference between cpuFraction and memoryFraction are -1 and 1
		// respectively. Multilying the absolute value of the difference by 10 scales the value to
		// 0-10 with 0 representing well balanced allocation and 10 poorly balanced. Subtracting it from
		// 10 leads to the score which also scales from 0 to 10 while 10 representing well balanced.
		diff := math.Abs(cpuFraction - memoryFraction)
		score = int(10 - diff*10)
	}
	if glog.V(10) {
		// We explicitly don't do glog.V(10).Infof() to avoid computing all the parameters if this is
		// not logged. There is visible performance gain from it.
		glog.V(10).Infof(
			"%v -> %v: Balanced Resource Allocation, capacity %d millicores %d memory bytes, total request %d millicores %d memory bytes, score %d",
			pod.Name, node.Name,
			allocatableResources.MilliCPU, allocatableResources.Memory,
			totalResources.MilliCPU, totalResources.Memory,
			score,
		)
	}

	return schedulerapi.HostPriority{
		Host:  node.Name,
		Score: score,
	}, nil
}

func fractionOfCapacity(requested, capacity int64) float64 {
	if capacity == 0 {
		return 1
	}
	return float64(requested) / float64(capacity)
}

// BalancedResourceAllocation favors nodes with balanced resource usage rate.
// BalancedResourceAllocation should **NOT** be used alone, and **MUST** be used together with LeastRequestedPriority.
// It calculates the difference between the cpu and memory fracion of capacity, and prioritizes the host based on how
// close the two metrics are to each other.
// Detail: score = 10 - abs(cpuFraction-memoryFraction)*10. The algorithm is partly inspired by:
// "Wei Huang et al. An Energy Efficient Virtual Machine Placement Algorithm with Balanced Resource Utilization"
func BalancedResourceAllocationMap(pod *api.Pod, meta interface{}, nodeInfo *schedulercache.NodeInfo) (schedulerapi.HostPriority, error) {
	var nonZeroRequest *schedulercache.Resource
	if priorityMeta, ok := meta.(*priorityMetadata); ok {
		nonZeroRequest = priorityMeta.nonZeroRequest
	} else {
		// We couldn't parse metadatat - fallback to computing it.
		nonZeroRequest = getNonZeroRequests(pod)
	}
	return calculateBalancedResourceAllocation(pod, nonZeroRequest, nodeInfo)
}


text:
* Android Nougat support
* Multi-window support (Android 7.0 and above)
* Minor launch time performance increase
* Russian translation (thanks to Aleksandr Loktionov)
* Japanese translation (thanks to naofum)

## Version 2.0.0 *(2015-10-05)*

* Android M support
* Complete rewrite of torch implementation
* Complete intra-app communication overhaul (increasing toggle speed)
* High quality image resources (dramatic increase for larger screens)
* Changed notification icons to white per design guidelines
* Dropped support for Android Froyo and Gingerbread (sorry)

## Version 1.1.1 *(2015-04-01)*

* Higher resolution images

## Version 1.1.0 *(2014-11-07)*

* Bug fixes and optimizations
* Improved RTL support
* Style updates based on Google's Material Design
* State-based summaries in Settings

## Version 1.0.2 *(2014-08-14)*

* Spanish language support

## Version 1.0.1 *(2014-06-19)*

* Minor optimizations

## Version 1.0.0 *(2014-02-12)*

* Initial release


text:
package biz.paluch.logging.gelf;

import static biz.paluch.logging.RuntimeContainerProperties.getProperty;

import java.io.IOException;
import java.io.InputStream;
import java.util.*;

import biz.paluch.logging.gelf.intern.Closer;

/**
 * Field with reference to the log event.
 *
 * @author Mark Paluch
 */
public class LogMessageField implements MessageField {

    public static final String VERBOSE_LOGGING_PROPERTY = "logstash-gelf.LogMessageField.verbose";

    private static final String DEFAULT_MAPPING = "default-logstash-fields.properties";
    private static final boolean VERBOSE_LOGGING = Boolean.parseBoolean(getProperty(VERBOSE_LOGGING_PROPERTY, "false"));

    /**
     * Named references to common log event fields.
     */
    public enum NamedLogField {
        Time("Time"), Severity("Severity"), ThreadName("Thread"), SourceClassName("SourceClassName"), SourceSimpleClassName(
                "SourceSimpleClassName"), SourceMethodName("SourceMethodName"), SourceLineNumber("SourceLineNumber"), Server(
                "Server"), LoggerName("LoggerName"), Marker("Marker"), NDC("NDC");

        private final String fieldName;

        NamedLogField(String fieldName) {
            this.fieldName = fieldName;
        }

        public String getFieldName() {
            return fieldName;
        }

        public static NamedLogField byName(String name) {
            for (NamedLogField namedLogField : values()) {
                if (namedLogField.name().equalsIgnoreCase(name)) {
                    return namedLogField;
                }
            }

            return null;
        }
    }

    private String name;
    private NamedLogField namedLogField;

    public LogMessageField(String name, NamedLogField namedLogField) {
        this.namedLogField = namedLogField;
        this.name = name;
    }

    public NamedLogField getNamedLogField() {
        return namedLogField;
    }

    @Override
    public String getName() {
        return name;
    }

    public static List<LogMessageField> getDefaultMapping(NamedLogField... supportedFields) {
        return getDefaultMapping(true, supportedFields);
    }

    public static List<LogMessageField> getDefaultMapping(boolean readFromDefaultsFile, NamedLogField... supportedFields) {

        List<LogMessageField> result = new ArrayList<>();
        List<NamedLogField> supportedLogFields = Arrays.asList(supportedFields);

        if (readFromDefaultsFile) {
            InputStream is = null;

            try {
                is = getStream();

                if (is == null) {
                    verboseLog("No " + DEFAULT_MAPPING + " resource present, using defaults");
                } else {
                    Properties p = new Properties();
                    p.load(is);

                    if (!p.isEmpty()) {
                        loadFields(p, result, supportedLogFields);
                    }
                }
            } catch (IOException e) {
                verboseLog("Could not parse " + DEFAULT_MAPPING + " resource, using defaults: " + e.getMessage());
            } finally {
                Closer.close(is);
            }
        }

        if (result.isEmpty()) {

            verboseLog("Default mapping is empty. Using " + NamedLogField.class.getName() + " fields");
            for (NamedLogField namedLogField : NamedLogField.values()) {
                if (supportedLogFields.contains(namedLogField)) {
                    result.add(new LogMessageField(namedLogField.fieldName, namedLogField));
                }
            }
        }

        verboseLog("Default field mapping: " + result);

        return result;
    }

    private static void verboseLog(String message) {
        if (VERBOSE_LOGGING) {
            System.out.println(message);
        }
    }

    private static void loadFields(Properties p, List<LogMessageField> result, List<NamedLogField> supportedLogFields) {
        for (Map.Entry<Object, Object> entry : p.entrySet()) {

            String targetName = entry.getKey().toString();
            String sourceFieldName = entry.getValue().toString();

            NamedLogField namedLogField = NamedLogField.byName(sourceFieldName);
            if (namedLogField != null && supportedLogFields.contains(namedLogField)) {
                result.add(new LogMessageField(targetName, namedLogField));
            }
        }
    }

    private static InputStream getStream() {

        Thread thread = Thread.currentThread();
        InputStream is = LogMessageField.class.getResourceAsStream(DEFAULT_MAPPING);
        if (is == null && thread.getContextClassLoader() != null) {
            is = thread.getContextClassLoader().getResourceAsStream(DEFAULT_MAPPING);
        }
        return is;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [name='").append(name).append('\'');
        sb.append(", namedLogField=").append(namedLogField);
        sb.append(']');
        return sb.toString();
    }
}


text:
"use strict";

const cloco_client_1 = require("./cloco-client");
const aes_encryptor_1 = require("./encryption/aes-encryptor");
function createClient(options) {
    return new cloco_client_1.ClocoClient(options);
}
exports.createClient = createClient;
function createAesEncryptor(encryptionKey) {
    return new aes_encryptor_1.AesEncryptor(encryptionKey);
}
exports.createAesEncryptor = createAesEncryptor;
var cloco_client_2 = require("./cloco-client");
exports.ClocoClient = cloco_client_2.ClocoClient;


text:
<?php

/*
 * This file is part of the godruoyi/ocr.
 *
 * (c) Godruoyi <gmail@godruoyi.com>
 *
 * This source file is subject to the MIT license that is bundled.
 */

namespace Godruoyi\OCR\Providers;

use Godruoyi\Container\ContainerInterface;
use Godruoyi\Container\ServiceProviderInterface;
use Psr\SimpleCache\CacheInterface;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Psr16Cache;

class CacheServiceProvider implements ServiceProviderInterface
{
    public function register(ContainerInterface $container)
    {
        $container->singleton('cache', function ($container) {
            return new Psr16Cache(new FilesystemAdapter('ocr.cache'));
        });

        $container->alias('cache', CacheInterface::class);
    }
}


text:
#ifndef __KNOR_HCLUST_ID_GENERATOR_HPP__
#define __KNOR_HCLUST_ID_GENERATOR_HPP__

#include <unordered_map>
#include <memory>
#include <stdexcept>
#include "io.hpp"

namespace knor {

struct split_id {
    unsigned first, second;
    split_id() { }

    split_id(unsigned _first, unsigned _second):
        first(_first), second(_second) {
    }
};

// Expected to be used as a Singleton class
class hclust_id_generator {
private:
    unsigned max_id;
    std::vector<unsigned> recycler;

    hclust_id_generator() : max_id(0) {
    }

public:
    typedef std::shared_ptr<hclust_id_generator> ptr;

    // Reclaim single IDs
    void reclaim_id(const unsigned id) {
        recycler.push_back(id);
    }

    const void print() const {
#ifndef BIND
        printf("Printing hclust_id_generator: Max ID: %u\n", max_id);
        printf("recycler: \n"); base::print(recycler);
#endif
    }

    static ptr create() {
        return ptr(new hclust_id_generator());
    };

    // Given a cluster id to which a node is assigned, get the split IDs
    split_id get_split_ids() {
        // Increments max_id
        unsigned l, r;
        if (recycler.size()) {
            l = recycler.back();
            recycler.pop_back();
        } else {
            l = ++max_id;
        }

        if (recycler.size()) {
            r = recycler.back();
            recycler.pop_back();
        } else {
            r = ++max_id;
        }
        return split_id(l, r);
    }
};
}
#endif


text:
import sys
import shutil
import datetime

from gui import GUI
from console import Console
from database import Database, Statistic
from price_calculator import PriceCalculator

class Screens:
    class Calculator:
        @staticmethod
        def ensure_settings(menu):
            while True:
                if not Database.settings.BREAD_PRICE.is_set():
                    Console.Messages.Predefined.missing_setting(
                        "Bread price"
                    )
                    menu.show_dialog(Screens.PriceSettings())
                    continue

                if not Database.settings.SAUSAGE_PRICE.is_set():
                    Console.Messages.Predefined.missing_setting(
                        "Sausage price"
                    )
                    menu.show_dialog(Screens.PriceSettings())
                    continue
                break

        @staticmethod
        def draw(menu):
            while True:
                Console.Output.header("Bratwurst Calculator!")
                print("NOTE: To return to the menu enter '-1'\n")

                Screens.Calculator.ensure_settings(menu)

                sausage_count = Console.Input.safe_int(
                    "Sausages Count: ", allow_no_input=True
                )

                if sausage_count == -1:
                    Console.Output.clear()
                    break

                bread_count = Console.Input.safe_int(
                    "Bread Count: ", allow_no_input=True
                )

                price = PriceCalculator.get_total(
                    sausage_count, bread_count
                )

                Console.Output.header("TOTAL PRICE")
                Console.PrettyPrint.currency(price)

                while True:
                    given = Console.Input.safe_float(
                        "\nGiven money: ", allow_no_input=True
                    )

                    if given is None:
                        Console.Output.clear()
                        break

                    return_money = PriceCalculator.get_return_money(
                        price, given
                    )

                    Console.Output.header("RETURN MONEY")

                    if return_money < 0:
                        print("WARNING: Not enought money!")

                    Console.PrettyPrint.currency(return_money)

                    Console.Output.header("RETURN MONEY FORMAT")

                    money_size_format = PriceCalculator.get_money_sizes(
                        return_money
                    )

                    if not money_size_format:
                        Console.PrettyPrint.dict(money_size_format)
                    else:
                        print("None :)")

                    try:
                        Database.statistics.publish(Statistic(
                            datetime.datetime.now(),
                            bread_count,
                            sausage_count,
                            price,
                            given
                        ))
                        print("\nSaved statistic to database! :)")
                    except Exception as e:
                        Console.Messages.error(
                            "Failed to save to the Database",
                            category="Statistics",
                            exception=e,
                        )

                    reenter_given_prompt = Console.Input.safe_string(
                        "...Continue..."
                    )

                    if reenter_given_prompt is not None:
                        continue
                    else:
                        Console.Output.clear()
                        break

    class Options:
        @staticmethod
        def draw(menu):
            while True:
                options = [
                    "Exit",
                    "Reset to Defaults",
                    "Nuke Database",
                    "Change Prices"
                ]

                options_box = GUI.Dialogs.OptionsBox(
                    "Choose a Setting you want to change",
                    options
                )

                Console.Messages.debug(
                    "Statistics DB path: " + Database.statistics.file_path
                )

                Console.Messages.debug(
                    "Settings DB path: " + Database.settings_db.file_path
                )

                menu.show_dialog(options_box)
                chosen = options_box.get_chosen()

                if chosen == options[0]:
                    break
                elif chosen == options[1]:
                    Database.settings_db.set_defaults()
                elif chosen == options[2]:
                    shutil.rmtree(Database.settings_db.file_folder)
                    Database.reload()
                    print("Nuked!")
                elif chosen == options[3]:
                    menu.show_dialog(Screens.PriceSettings())

    class PriceSettings:
        @staticmethod
        def draw(menu):
            while True:
                settings = {
                    "Bread price": {
                        "getter": (lambda: Database.settings.BREAD_PRICE.get(default="None")),
                        "setter": (lambda x: Database.settings.BREAD_PRICE.set(x)),
                        "input_fn": Console.Input.safe_float
                    },
                    "Sausage price": {
                        "getter": (lambda: Database.settings.SAUSAGE_PRICE.get(default="None")),
                        "setter": (lambda x: Database.settings.SAUSAGE_PRICE.set(x)),
                        "input_fn": Console.Input.safe_float,
                    }
                }

                options_box = GUI.Dialogs.OptionsBox(
                    "What to change?",
                    ["Exit"], [""]
                )

                for key in list(settings.keys()):
                    options_box.options.append(key)
                    options_box.extras.append(
                        " - Current: " + str(settings[key]["getter"]())
                    )

                menu.show_dialog(options_box)

                if options_box.get_chosen() == "Exit":
                    break

                setting = settings[options_box.get_chosen()]

                setting["setter"](
                    setting["input_fn"](
                        "Enter the new value for setting '" +
                        str(options_box.get_chosen()) + "': "
                    )
                )

    class Exit:
        @staticmethod
        def draw(menu):
            print("E X I T I N G - Bye :)")
            sys.exit()

    class ViewStatistics:
        @staticmethod
        def draw(menu):
            Console.Output.header("Statistics file content")
            for line in Database.statistics.read_all_lines():
                line = line.strip()
                print(line)

    class Router:
        @staticmethod
        def draw(menu):
            screens = {
                "Calculator": Screens.Calculator,
                "Settings": Screens.Options,
                "View Statistics": Screens.ViewStatistics,
                "Exit": Screens.Exit
            }

            options = list(screens.keys())
            options_box = GUI.Dialogs.OptionsBox(
                "Choose a Path!",
                options
            )

            while True:
                menu.show_dialog(options_box)

                current_screen = screens[options_box.get_chosen()]
                menu.show(current_screen)


text:
from flask import Flask, render_template, session, request, redirect
import random

app = Flask(__name__)
app.secret_key = 'my_secret_key'

@app.route('/')
def index():
    if not 'gold' in session:
        session['gold'] = 0
    if not 'activities' in session:
        session['activities'] = []
    return render_template('index.html')

@app.route('/process', methods = ['POST'])
def process():
    buildings = {
        'farm':random.randint(5,10),
        'casino':random.randint(-50,50),
        'cave':random.randint(0,30),
        'house':random.randint(0,5)
    }
    if request.form['building'] in buildings:
        print buildings[request.form['building']]
    return redirect('/')

if __name__ == '__main__':
  app.run(debug = True)

"""
Explain line 24!
When the user clicks the farm button,
the value of farm prints to your terminal.
Line 24 is how the information is gathered.
"""


text:
<?php

/* AgiBundle:Default/site:pdf.html.twig */
class __TwigTemplate_cd35d944d028f6896509f613c0326ffcf1ccfb2ddb7bae28c22a69db60342a9f extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        $__internal_61826a830123c12a3ed58c4446210a83e72eaa36d259a58fadc6a98510fda22c = $this->env->getExtension("Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension");
        $__internal_61826a830123c12a3ed58c4446210a83e72eaa36d259a58fadc6a98510fda22c->enter($__internal_61826a830123c12a3ed58c4446210a83e72eaa36d259a58fadc6a98510fda22c_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "AgiBundle:Default/site:pdf.html.twig"));

        $__internal_3039f648b9744c59746a0fb482e4b17f3eb79226d4f2f7e7c85856d6dc445242 = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension");
        $__internal_3039f648b9744c59746a0fb482e4b17f3eb79226d4f2f7e7c85856d6dc445242->enter($__internal_3039f648b9744c59746a0fb482e4b17f3eb79226d4f2f7e7c85856d6dc445242_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "AgiBundle:Default/site:pdf.html.twig"));

        // line 1
        echo "

<page backtop=\"0\" backright=\"0\" backbottom=\"0\" backleft=\"0\">

                env, $this->env->getExtension('Symfony\Bridge\Twig\Extension\AssetExtension')->getAssetUrl("img/logo1.png"), "html", null, true);
        echo "\">

        PLANNING DU ";
        // line 33
        echo twig_escape_filter($this->env, ($context["title"] ?? $this->getContext($context, "title")), "html", null, true);
        echo "

        Client:
        ";
        // line 38
        echo twig_escape_filter($this->env, $this->getAttribute(($context["site"] ?? $this->getContext($context, "site")), "nomSite", array()), "html", null, true);
        echo "

                Agent
                Début
                Fin
                Panier
                HJ
                HN
                TH
                HD
                HF

        ";
        // line 58
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["vacations"] ?? $this->getContext($context, "vacations")));
        foreach ($context['_seq'] as $context["_key"] => $context["v"]) {
            // line 59
            echo "
            ";
            // line 60
            if ((($this->env->getExtension('AgiBundle\Twig\Extension\DayByDateExtension')->isSaturday($this->getAttribute($context["v"], "heureFinVac", array())) == "6") || ($this->env->getExtension('AgiBundle\Twig\Extension\DayByDateExtension')->isSaturday($this->getAttribute($context["v"], "heureFinVac", array())) == "7"))) {
                // line 61
                echo "

            ";
            } elseif ((($this->env->getExtension('AgiBundle\Twig\Extension\DayByDateExtension')->isSaturday($this->getAttribute(            // line 62
$context["v"], "heureDebVac", array())) == "6") || ($this->env->getExtension('AgiBundle\Twig\Extension\DayByDateExtension')->isSaturday($this->getAttribute($context["v"], "heureDebVac", array())) == "7"))) {
                // line 63
                echo "

            ";
            } else {
                // line 65
                echo "

            ";
            }
            // line 67
            echo "
                ";
            // line 68
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($context["v"], "agent", array()), "nom", array()), "html", null, true);
            echo " ";
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($context["v"], "agent", array()), "prenom", array()), "html", null, true);
            echo "
                ";
            // line 69
            echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute($context["v"], "heureDebVac", array()), "d/m/Y H:i"), "html", null, true);
            echo "
                ";
            // line 70
            echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute($context["v"], "heureFinVac", array()), "d/m/Y H:i"), "html", null, true);
            echo "
                ";
            // line 71
            echo twig_escape_filter($this->env, $this->getAttribute($context["v"], "heurePanier", array()), "html", null, true);
            echo "
                ";
            // line 72
            echo twig_escape_filter($this->env, $this->getAttribute($context["v"], "heureJour", array()), "html", null, true);
            echo "
                ";
            // line 73
            echo twig_escape_filter($this->env, $this->getAttribute($context["v"], "heureNuit", array()), "html", null, true);
            echo "
                ";
            // line 74
            echo twig_escape_filter($this->env, $this->env->getExtension('AgiBundle\Twig\Extension\SumHeureExtension')->sumOfTwoTimes($this->getAttribute($context["v"], "heureJour", array()), $this->getAttribute($context["v"], "heureNuit", array())), "html", null, true);
            echo "
                ";
            // line 75
            echo twig_escape_filter($this->env, $this->getAttribute($context["v"], "heureDimanche", array()), "html", null, true);
            echo "
                ";
            // line 76
            echo twig_escape_filter($this->env, $this->getAttribute($context["v"], "heureFerie", array()), "html", null, true);
            echo "

        ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['v'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 79
        echo "

                TP: ";
        // line 84
        echo twig_escape_filter($this->env, ($context["thp"] ?? $this->getContext($context, "thp")), "html", null, true);
        echo "
                THJ: ";
        // line 85
        echo twig_escape_filter($this->env, ($context["thj"] ?? $this->getContext($context, "thj")), "html", null, true);
        echo "
                THN: ";
        // line 86
        echo twig_escape_filter($this->env, ($context["thn"] ?? $this->getContext($context, "thn")), "html", null, true);
        echo "
                THM: ";
        // line 87
        echo twig_escape_filter($this->env, $this->env->getExtension('AgiBundle\Twig\Extension\SumHeureExtension')->sumOfTwoTimes(($context["thj"] ?? $this->getContext($context, "thj")), ($context["thn"] ?? $this->getContext($context, "thn"))), "html", null, true);
        echo "
                THD: ";
        // line 88
        echo twig_escape_filter($this->env, ($context["thd"] ?? $this->getContext($context, "thd")), "html", null, true);
        echo "
                THF: ";
        // line 89
        echo twig_escape_filter($this->env, ($context["thf"] ?? $this->getContext($context, "thf")), "html", null, true);
        echo "

                Signature de la Direction
                Signature de l'agent

            Siège Social : 62 rue du Solayer – 63100 CLERMONT-FERRAND - Tel : 04.73.92.48.56 - Télécopie : 04.73.92.29.68

            N° d'autorisation CNAPS : AUT-063-2113-09-22-20140367933 ; Article L612-14 du code de la sécurité intérieure

            L'autorisation administrative préalable ne confère aucun caractère officiel à l'entreprise ou aux personnes qui en bénéficient.

</page>";

        $__internal_61826a830123c12a3ed58c4446210a83e72eaa36d259a58fadc6a98510fda22c->leave($__internal_61826a830123c12a3ed58c4446210a83e72eaa36d259a58fadc6a98510fda22c_prof);

        $__internal_3039f648b9744c59746a0fb482e4b17f3eb79226d4f2f7e7c85856d6dc445242->leave($__internal_3039f648b9744c59746a0fb482e4b17f3eb79226d4f2f7e7c85856d6dc445242_prof);

    }

    public function getTemplateName()
    {
        return "AgiBundle:Default/site:pdf.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  188 => 89,  184 => 88,  180 => 87,  176 => 86,  172 => 85,  168 => 84,  161 => 79,  152 => 76,  148 => 75,  144 => 74,  140 => 73,  136 => 72,  132 => 71,  128 => 70,  124 => 69,  118 => 68,  115 => 67,  111 => 65,  107 => 63,  105 => 62,  102 => 61,  100 => 60,  97 => 59,  93 => 58,  70 => 38,  62 => 33,  53 => 27,  25 => 1,);
    }

    /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
    public function getSource()
    {
        @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);

        return $this->getSourceContext()->getCode();
    }

    public function getSourceContext()
    {
        return new Twig_Source("

<page backtop=\"0\" backright=\"0\" backbottom=\"0\" backleft=\"0\">

        PLANNING DU {{ title }}

        Client:
        {{ site.nomSite }}

                Agent
                Début
                Fin
                Panier
                HJ
                HN
                TH
                HD
                HF

        {% for v in vacations %}

            {% if v.heureFinVac|dayByDate == \"6\" or v.heureFinVac|dayByDate == \"7\"  %}

            {% elseif v.heureDebVac|dayByDate == \"6\" or v.heureDebVac|dayByDate == \"7\"  %}

            {% else %}

            {% endif %}

                {{ v.agent.nom }} {{ v.agent.prenom }}
                {{ v.heureDebVac| date('d/m/Y H:i') }}
                {{ v.heureFinVac| date('d/m/Y H:i') }}
                {{ v.heurePanier }}
                {{ v.heureJour }}
                {{ v.heureNuit }}
                {{ v.heureJour|sumheure(v.heureNuit) }}
                {{ v.heureDimanche }}
                {{ v.heureFerie }}

        {% endfor %}

                TP: {{ thp }}
                THJ: {{ thj }}
                THN: {{ thn }}
                THM: {{ thj|sumheure(thn) }}
                THD: {{ thd }}
                THF: {{ thf }}

                Signature de la Direction
                Signature de l'agent

            Siège Social : 62 rue du Solayer – 63100 CLERMONT-FERRAND - Tel : 04.73.92.48.56 - Télécopie : 04.73.92.29.68

            N° d'autorisation CNAPS : AUT-063-2113-09-22-20140367933 ; Article L612-14 du code de la sécurité intérieure

            L'autorisation administrative préalable ne confère aucun caractère officiel à l'entreprise ou aux personnes qui en bénéficient.

</page>", "AgiBundle:Default/site:pdf.html.twig", "/Users/Rachid/SymfonyProjects/agi_protection/src/AgiBundle/Resources/views/Default/site/pdf.html.twig");
    }
}


text:
import IModifyVariables = require("./IModifyVariables");
import Variables = require("./Variables");

class ModifyVariables extends Variables implements IModifyVariables {
}

export = ModifyVariables;


text:
package apply

import (
	"context"
	"fmt"
	"os"
	"time"

	alphaprinterstable "github.com/GoogleContainerTools/kpt/internal/alpha/printers/table"
	"github.com/GoogleContainerTools/kpt/internal/cmdutil"
	"github.com/GoogleContainerTools/kpt/internal/docs/generated/livedocs"
	"github.com/GoogleContainerTools/kpt/internal/util/argutil"
	"github.com/GoogleContainerTools/kpt/internal/util/strings"
	"github.com/GoogleContainerTools/kpt/pkg/live"
	"github.com/GoogleContainerTools/kpt/pkg/status"
	"github.com/spf13/cobra"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
	"k8s.io/cli-runtime/pkg/genericclioptions"
	"k8s.io/kubectl/pkg/cmd/util"
	"sigs.k8s.io/cli-utils/cmd/flagutils"
	"sigs.k8s.io/cli-utils/pkg/apply"
	"sigs.k8s.io/cli-utils/pkg/common"
	"sigs.k8s.io/cli-utils/pkg/inventory"
	"sigs.k8s.io/cli-utils/pkg/printers"
	cliutilsprinter "sigs.k8s.io/cli-utils/pkg/printers/printer"
)

// NewRunner returns a command runner
func NewRunner(
	ctx context.Context,
	factory util.Factory,
	ioStreams genericclioptions.IOStreams,
	alpha bool,
) *Runner {
	r := &Runner{
		ctx:         ctx,
		ioStreams:   ioStreams,
		factory:     factory,
		applyRunner: runApply,
		alpha:       alpha,
	}
	c := &cobra.Command{
		Use:     "apply [PKG_PATH | -]",
		RunE:    r.runE,
		PreRunE: r.preRunE,
		Short:   livedocs.ApplyShort,
		Long:    livedocs.ApplyShort + "\n" + livedocs.ApplyLong,
		Example: livedocs.ApplyExamples,
	}
	r.Command = c

	c.Flags().BoolVar(&r.serverSideOptions.ServerSideApply, "server-side", false,
		"If true, apply merge patch is calculated on API server instead of client.")
	c.Flags().BoolVar(&r.serverSideOptions.ForceConflicts, "force-conflicts", false,
		"If true, overwrite applied fields on server if field manager conflict.")
	c.Flags().StringVar(&r.serverSideOptions.FieldManager, "field-manager", common.DefaultFieldManager,
		"The client owner of the fields being applied on the server-side.")
	c.Flags().StringVar(&r.output, "output", printers.DefaultPrinter(),
		fmt.Sprintf("Output format, must be one of %s", strings.JoinStringsWithQuotes(printers.SupportedPrinters())))
	c.Flags().DurationVar(&r.reconcileTimeout, "reconcile-timeout", time.Duration(0),
		"Timeout threshold for waiting for all resources to reach the Current status.")
	c.Flags().StringVar(&r.prunePropagationPolicyString, "prune-propagation-policy",
		"Background", "Propagation policy for pruning")
	c.Flags().DurationVar(&r.pruneTimeout, "prune-timeout", time.Duration(0),
		"Timeout threshold for waiting for all pruned resources to be deleted")
	c.Flags().StringVar(&r.inventoryPolicyString, flagutils.InventoryPolicyFlag, flagutils.InventoryPolicyStrict,
		"It determines the behavior when the resources don't belong to current inventory. Available options "+
			fmt.Sprintf("%q and %q.", flagutils.InventoryPolicyStrict, flagutils.InventoryPolicyAdopt))
	c.Flags().BoolVar(&r.installCRD, "install-resource-group", true,
		"If true, install the inventory ResourceGroup CRD before applying.")
	c.Flags().BoolVar(&r.dryRun, "dry-run", false,
		"dry-run apply for the resources in the package.")
	c.Flags().BoolVar(&r.printStatusEvents, "show-status-events", false,
		"Print status events (always enabled for table output)")
	return r
}

func NewCommand(ctx context.Context, factory util.Factory,
	ioStreams genericclioptions.IOStreams, alpha bool) *cobra.Command {
	return NewRunner(ctx, factory, ioStreams, alpha).Command
}

// Runner contains the run function
type Runner struct {
	ctx        context.Context
	alpha      bool
	Command    *cobra.Command
	PreProcess func(info inventory.Info, strategy common.DryRunStrategy) (inventory.Policy, error)
	ioStreams  genericclioptions.IOStreams
	factory    util.Factory

	installCRD                   bool
	serverSideOptions            common.ServerSideOptions
	output                       string
	reconcileTimeout             time.Duration
	prunePropagationPolicyString string
	pruneTimeout                 time.Duration
	inventoryPolicyString        string
	dryRun                       bool
	printStatusEvents            bool

	inventoryPolicy inventory.Policy
	prunePropPolicy metav1.DeletionPropagation

	applyRunner func(r *Runner, invInfo inventory.Info, objs []*unstructured.Unstructured,
		dryRunStrategy common.DryRunStrategy) error
}

func (r *Runner) preRunE(cmd *cobra.Command, _ []string) error {
	var err error
	r.prunePropPolicy, err = flagutils.ConvertPropagationPolicy(r.prunePropagationPolicyString)
	if err != nil {
		return err
	}

	r.inventoryPolicy, err = flagutils.ConvertInventoryPolicy(r.inventoryPolicyString)
	if err != nil {
		return err
	}

	if found := printers.ValidatePrinterType(r.output); !found {
		return fmt.Errorf("unknown output type %q", r.output)
	}

	// We default the install-resource-group flag to false if we are doing
	// dry-run, unless the user has explicitly used the install-resource-group flag.
	if r.dryRun && !cmd.Flags().Changed("install-resource-group") {
		r.installCRD = false
	}

	if !r.installCRD {
		err := cmdutil.VerifyResourceGroupCRD(r.factory)
		if err != nil {
			return err
		}
	}
	return nil
}

func (r *Runner) runE(c *cobra.Command, args []string) error {
	if len(args) == 0 {
		// default to the current working directory
		cwd, err := os.Getwd()
		if err != nil {
			return err
		}
		args = append(args, cwd)
	}
	path := args[0]
	var err error
	if args[0] != "-" {
		path, err = argutil.ResolveSymlink(r.ctx, path)
		if err != nil {
			return err
		}
	}

	objs, inv, err := live.Load(r.factory, path, c.InOrStdin())
	if err != nil {
		return err
	}

	// objs may contain kind List
	objs, err = live.Flatten(objs)
	if err != nil {
		return err
	}

	invInfo, err := live.ToInventoryInfo(inv)
	if err != nil {
		return err
	}

	dryRunStrategy := common.DryRunNone
	if r.dryRun {
		if r.serverSideOptions.ServerSideApply {
			dryRunStrategy = common.DryRunServer
		} else {
			dryRunStrategy = common.DryRunClient
		}
	}

	// TODO(mortent): Figure out if we can do this differently.
	if r.PreProcess != nil {
		r.inventoryPolicy, err = r.PreProcess(invInfo, dryRunStrategy)
		if err != nil {
			return err
		}
	}

	return r.applyRunner(r, invInfo, objs, dryRunStrategy)
}

func runApply(r *Runner, invInfo inventory.Info, objs []*unstructured.Unstructured,
	dryRunStrategy common.DryRunStrategy) error {
	if r.installCRD {
		f := r.factory
		// Install the ResourceGroup CRD if it is not already installed
		// or if the ResourceGroup CRD doesn't match the CRD in the
		// kpt binary.
		err := cmdutil.VerifyResourceGroupCRD(f)
		if err != nil {
			if err = cmdutil.InstallResourceGroupCRD(r.ctx, f); err != nil {
				return err
			}
		} else if !live.ResourceGroupCRDMatched(f) {
			if err = cmdutil.InstallResourceGroupCRD(r.ctx, f); err != nil {
				return &cmdutil.ResourceGroupCRDNotLatestError{
					Err: err,
				}
			}
		}
	}

	// Run the applier. It will return a channel where we can receive updates
	// to keep track of progress and any issues.
	invClient, err := inventory.NewClient(r.factory, live.WrapInventoryObj, live.InvToUnstructuredFunc, inventory.StatusPolicyAll, live.ResourceGroupGVK)
	if err != nil {
		return err
	}

	statusWatcher, err := status.NewStatusWatcher(r.factory)
	if err != nil {
		return err
	}

	applier, err := apply.NewApplierBuilder().
		WithFactory(r.factory).
		WithInventoryClient(invClient).
		WithStatusWatcher(statusWatcher).
		Build()
	if err != nil {
		return err
	}

	ch := applier.Run(r.ctx, invInfo, objs, apply.ApplierOptions{
		ServerSideOptions:      r.serverSideOptions,
		ReconcileTimeout:       r.reconcileTimeout,
		EmitStatusEvents:       true, // We are always waiting for reconcile.
		DryRunStrategy:         dryRunStrategy,
		PrunePropagationPolicy: r.prunePropPolicy,
		PruneTimeout:           r.pruneTimeout,
		InventoryPolicy:        r.inventoryPolicy,
	})

	// Print the preview strategy unless the output format is json.
	if dryRunStrategy.ClientOrServerDryRun() && r.output != printers.JSONPrinter {
		if dryRunStrategy.ServerDryRun() {
			fmt.Println("Dry-run strategy: server")
		} else {
			fmt.Println("Dry-run strategy: client")
		}
	}

	// The printer will print updates from the channel. It will block
	// until the channel is closed.
	var printer cliutilsprinter.Printer
	if r.alpha && r.output == printers.TablePrinter {
		printer = &alphaprinterstable.Printer{
			IOStreams: r.ioStreams,
		}
	} else {
		printer = printers.GetPrinter(r.output, r.ioStreams)
	}
	return printer.Print(ch, dryRunStrategy, r.printStatusEvents)
}


text:
package in_test

import (
	"io/ioutil"
	"os"
	"path/filepath"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"github.com/concourse/s3-resource"
	. "github.com/concourse/s3-resource/in"

	"github.com/concourse/s3-resource/fakes"
)

var _ = Describe("In Command", func() {
	Describe("running the command", func() {
		var (
			tmpPath string
			destDir string
			request InRequest

			s3client *fakes.FakeS3Client
			command  *InCommand
		)

		BeforeEach(func() {
			var err error
			tmpPath, err = ioutil.TempDir("", "in_command")
			Ω(err).ShouldNot(HaveOccurred())

			destDir = filepath.Join(tmpPath, "destination")
			request = InRequest{
				Source: s3resource.Source{
					Bucket: "bucket-name",
					Regexp: "files/a-file-(.*).tgz",
				},
				Version: s3resource.Version{
					Path: "files/a-file-1.3.tgz",
				},
			}

			s3client = &fakes.FakeS3Client{}
			command = NewInCommand(s3client)

			s3client.URLReturns("http://google.com")
		})

		AfterEach(func() {
			err := os.RemoveAll(tmpPath)
			Ω(err).ShouldNot(HaveOccurred())
		})

		It("creates the destination directory", func() {
			Ω(destDir).ShouldNot(ExistOnFilesystem())

			_, err := command.Run(destDir, request)
			Ω(err).ShouldNot(HaveOccurred())

			Ω(destDir).Should(ExistOnFilesystem())
		})

		Context("when there is no existing version in the request", func() {
			BeforeEach(func() {
				request.Version.Path = ""

				s3client.BucketFilesReturns([]string{
					"files/a-file-0.0.1.tgz",
					"files/a-file-3.53.tgz",
					"files/a-file-2.33.333.tgz",
					"files/a-file-2.4.3.tgz",
				}, nil)
			})

			It("scans the bucket for the latest file to download", func() {
				_, err := command.Run(destDir, request)
				Ω(err).ShouldNot(HaveOccurred())

				Ω(s3client.DownloadFileCallCount()).Should(Equal(1))
				bucketName, remotePath, localPath := s3client.DownloadFileArgsForCall(0)

				Ω(bucketName).Should(Equal("bucket-name"))
				Ω(remotePath).Should(Equal("files/a-file-3.53.tgz"))
				Ω(localPath).Should(Equal(filepath.Join(destDir, "a-file-3.53.tgz")))
			})

			Context("when using a CloudFront domain", func() {
				BeforeEach(func() {
					request.Source.CloudfrontURL = "https://1234567890.cloudfront.net"
				})

				It("creates a 'url' file that contains the URL including the CloudFront domain", func() {
					urlPath := filepath.Join(destDir, "url")
					Ω(urlPath).ShouldNot(ExistOnFilesystem())

					_, err := command.Run(destDir, request)
					Ω(err).ShouldNot(HaveOccurred())

					Ω(urlPath).Should(ExistOnFilesystem())
					contents, err := ioutil.ReadFile(urlPath)
					Ω(err).ShouldNot(HaveOccurred())
					Ω(string(contents)).Should(Equal("https://1234567890.cloudfront.net/files/a-file-3.53.tgz"))
				})
			})

			It("creates a 'url' file that contains the URL", func() {
				urlPath := filepath.Join(destDir, "url")
				Ω(urlPath).ShouldNot(ExistOnFilesystem())

				_, err := command.Run(destDir, request)
				Ω(err).ShouldNot(HaveOccurred())

				Ω(urlPath).Should(ExistOnFilesystem())
				contents, err := ioutil.ReadFile(urlPath)
				Ω(err).ShouldNot(HaveOccurred())
				Ω(string(contents)).Should(Equal("http://google.com"))

				bucketName, remotePath, private, versionID := s3client.URLArgsForCall(0)
				Ω(bucketName).Should(Equal("bucket-name"))
				Ω(remotePath).Should(Equal("files/a-file-3.53.tgz"))
				Ω(versionID).Should(BeEmpty())
				Ω(private).Should(Equal(false))
			})

			Context("when configured with private URLs", func() {
				BeforeEach(func() {
					request.Source.Private = true
				})

				It("creates a 'url' file that contains the private URL if told to do that", func() {
					urlPath := filepath.Join(destDir, "url")
					Ω(urlPath).ShouldNot(ExistOnFilesystem())

					_, err := command.Run(destDir, request)
					Ω(err).ShouldNot(HaveOccurred())

					Ω(urlPath).Should(ExistOnFilesystem())
					contents, err := ioutil.ReadFile(urlPath)
					Ω(err).ShouldNot(HaveOccurred())
					Ω(string(contents)).Should(Equal("http://google.com"))

					Ω(s3client.URLCallCount()).Should(Equal(1))
					bucketName, remotePath, private, versionID := s3client.URLArgsForCall(0)
					Ω(bucketName).Should(Equal("bucket-name"))
					Ω(remotePath).Should(Equal("files/a-file-3.53.tgz"))
					Ω(versionID).Should(BeEmpty())
					Ω(private).Should(Equal(true))
				})
			})

			It("creates a 'version' file that contains the latest version", func() {
				versionFile := filepath.Join(destDir, "version")
				Ω(versionFile).ShouldNot(ExistOnFilesystem())

				_, err := command.Run(destDir, request)
				Ω(err).ShouldNot(HaveOccurred())

				Ω(versionFile).Should(ExistOnFilesystem())
				contents, err := ioutil.ReadFile(versionFile)
				Ω(err).ShouldNot(HaveOccurred())
				Ω(string(contents)).Should(Equal("3.53"))
			})

			Context("when the regexp has no groups", func() {
				BeforeEach(func() {
					request.Source.Regexp = "files/a-file-.*.tgz"
				})

				It("returns an error when the regexp has no groups", func() {
					_, err := command.Run(destDir, request)
					Ω(err).Should(HaveOccurred())
				})
			})

			Describe("the response", func() {
				It("has a version that is the remote file path", func() {
					response, err := command.Run(destDir, request)
					Ω(err).ShouldNot(HaveOccurred())

					Ω(response.Version.Path).Should(Equal("files/a-file-3.53.tgz"))
				})

				It("has metadata about the file", func() {
					response, err := command.Run(destDir, request)
					Ω(err).ShouldNot(HaveOccurred())

					Ω(response.Metadata[0].Name).Should(Equal("filename"))
					Ω(response.Metadata[0].Value).Should(Equal("a-file-3.53.tgz"))

					Ω(response.Metadata[1].Name).Should(Equal("url"))
					Ω(response.Metadata[1].Value).Should(Equal("http://google.com"))
				})

				Context("when the output is private", func() {
					BeforeEach(func() {
						request.Source.Private = true
					})

					It("doesn't include the URL in the metadata", func() {
						response, err := command.Run(destDir, request)
						Ω(err).ShouldNot(HaveOccurred())

						Ω(response.Metadata).Should(HaveLen(1))
						Ω(response.Metadata[0].Name).ShouldNot(Equal("url"))
					})
				})
			})
		})

		Context("when there is an existing version in the request", func() {
			BeforeEach(func() {
				request.Version.Path = "files/a-file-1.3.tgz"
			})

			It("downloads the existing version of the file", func() {
				_, err := command.Run(destDir, request)
				Ω(err).ShouldNot(HaveOccurred())

				Ω(s3client.DownloadFileCallCount()).Should(Equal(1))
				bucketName, remotePath, localPath := s3client.DownloadFileArgsForCall(0)

				Ω(bucketName).Should(Equal("bucket-name"))
				Ω(remotePath).Should(Equal("files/a-file-1.3.tgz"))
				Ω(localPath).Should(Equal(filepath.Join(destDir, "a-file-1.3.tgz")))
			})

			It("creates a 'url' file that contains the URL", func() {
				urlPath := filepath.Join(destDir, "url")
				Ω(urlPath).ShouldNot(ExistOnFilesystem())

				_, err := command.Run(destDir, request)
				Ω(err).ShouldNot(HaveOccurred())

				Ω(urlPath).Should(ExistOnFilesystem())
				contents, err := ioutil.ReadFile(urlPath)
				Ω(err).ShouldNot(HaveOccurred())
				Ω(string(contents)).Should(Equal("http://google.com"))

				bucketName, remotePath, private, versionID := s3client.URLArgsForCall(0)
				Ω(bucketName).Should(Equal("bucket-name"))
				Ω(remotePath).Should(Equal("files/a-file-1.3.tgz"))
				Ω(private).Should(Equal(false))
				Ω(versionID).Should(BeEmpty())
			})

			Context("when configured with private URLs", func() {
				BeforeEach(func() {
					request.Source.Private = true
				})

				It("creates a 'url' file that contains the private URL if told to do that", func() {
					urlPath := filepath.Join(destDir, "url")
					Ω(urlPath).ShouldNot(ExistOnFilesystem())

					_, err := command.Run(destDir, request)
					Ω(err).ShouldNot(HaveOccurred())

					Ω(urlPath).Should(ExistOnFilesystem())
					contents, err := ioutil.ReadFile(urlPath)
					Ω(err).ShouldNot(HaveOccurred())
					Ω(string(contents)).Should(Equal("http://google.com"))

					Ω(s3client.URLCallCount()).Should(Equal(1))
					bucketName, remotePath, private, versionID := s3client.URLArgsForCall(0)
					Ω(bucketName).Should(Equal("bucket-name"))
					Ω(remotePath).Should(Equal("files/a-file-1.3.tgz"))
					Ω(private).Should(Equal(true))
					Ω(versionID).Should(BeEmpty())
				})
			})

			It("creates a 'version' file that contains the matched version", func() {
				versionFile := filepath.Join(destDir, "version")
				Ω(versionFile).ShouldNot(ExistOnFilesystem())

				_, err := command.Run(destDir, request)
				Ω(err).ShouldNot(HaveOccurred())

				Ω(versionFile).Should(ExistOnFilesystem())
				contents, err := ioutil.ReadFile(versionFile)
				Ω(err).ShouldNot(HaveOccurred())
				Ω(string(contents)).Should(Equal("1.3"))
			})

			Describe("the response", func() {
				It("has a version that is the remote file path", func() {
					response, err := command.Run(destDir, request)
					Ω(err).ShouldNot(HaveOccurred())

					Ω(response.Version.Path).Should(Equal("files/a-file-1.3.tgz"))
				})

				It("has metadata about the file", func() {
					response, err := command.Run(destDir, request)
					Ω(err).ShouldNot(HaveOccurred())

					Ω(response.Metadata[0].Name).Should(Equal("filename"))
					Ω(response.Metadata[0].Value).Should(Equal("a-file-1.3.tgz"))

					Ω(response.Metadata[1].Name).Should(Equal("url"))
					Ω(response.Metadata[1].Value).Should(Equal("http://google.com"))
				})

				Context("when the output is private", func() {
					BeforeEach(func() {
						request.Source.Private = true
					})

					It("doesn't include the URL in the metadata", func() {
						response, err := command.Run(destDir, request)
						Ω(err).ShouldNot(HaveOccurred())

						Ω(response.Metadata).Should(HaveLen(1))
						Ω(response.Metadata[0].Name).ShouldNot(Equal("url"))
					})
				})
			})
		})
	})
})


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get error number</title>

PDF_get_errmsg

PDF_get_font

PDF Functions

PHP Manual

PDF_get_errnum

(PECL pdflib >= 2.0.0)

PDF_get_errnum — Get error number

Description

    int PDF_get_errnum
     ( resource $pdfdoc
    )

   Gets the number of the last thrown exception or the reason for a failed
   function call.

PDF_get_errmsg

PDF_get_font

PDF Functions

PHP Manual


text:
Indizierung von MARC21-Daten und anschließende Filterung nach Kriterium zur Generierung eines Extractes - kurzum - ein Sieb zum Erstellen von bspw. Fachausschnitten

Dies ist ein Projekt der Universitätsbibliothek der Humboldt-Universität zu Berlin, welches im Rahmen der Fachinfomationsdienste (FID)gestarter wurde. Hiermit sollen möglichst alle deutschen Verbunddaten indizier- und damit durchsuchbar gemacht werden, um darüber spezifische Fachausschnitte für ein jeweiliges FID zu generieren.

## Dokumentation
[fachkatalog-dokumentation.pdf](https://github.com/UB-HU-Berlin/solr-marc-filter/blob/master/docu/fachkatalog-dokumentation.pdf) enthält die Dokumentation mit detaillierten Beispielen und Informationen, sowie ein Workaround zum Einrichten des Projekts.

## Abhängigkeiten

Diese Projekt benötigt bzw. ist abhängig von folgenden Komponenten (getestet)

- [Apache Solr](http://lucene.apache.org/solr/) v4.8.1
- [SolrMarc](https://code.google.com/p/solrmarc/source/checkout) SVN-Revision r1803
- Perl v5.8.9 mit folgenden Modulen
    - Apache::Solr
    - Archive::Extract
    - Config::INI
    - Data::Dumper
    - **Date::Simple**
    - HTTP::OAI
    - (JSON::Parse)
    - LWP::Simple
    - LWP::UserAgent
    - MARC::Batch
    - MARC::Field
    - MARC::File
    - ~~Net::SCP~~
    - ~~Net::SSH~~
    - **Net::OpenSSH**
    - Sys::Info
    - Text::Unidecode
    - Time::Piece
    - Try::Tiny
    - XML::Simple

## Struktur

- __./bin/__
    - enthält auführbare Bash-Skripte, die von Kommandozeile gerufen werden können
- __./data/__
    - enthält alle Cores (Verbünde), die in der Solr Instanz angezeigt, verwaltet und geupdatet werden
- __./docu/__
    - enthält die Dokumentation des Projekts als pdf mit detaillierten Erklärungen und den entsprechenden LaTex Resourcen
- __./etc/__
    - enthält wichtige Dateien wie die Konfigurationen der jeweiligen Cores und eine Datei mit der die jeweiligen Filter geschrieben werden können
- __./lib/__
    - enthält die jeweiligen Perl Skripte, die über die Bash-Skripte aufgerufen werden
- __./log/__
    - enthält eine globale log.txt in denen alle Änderungen/Updates/ usw. verzeichnet werden
    - enthält außerdem die jeweiligen Core-spezifischen Log-Dokumente, die angelegt werden, wenn die Core Daten initial in den Solr Index initialisiert werden
- __./results/__
    - enhält die Ergebnisse der Suche für die speziellen Filter sortiert nach Name des Filters bzw. Abfragezeitpunkt

-----------

Copyright 2015 University Library of Humboldt-Universität zu Berlin

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.


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Opegrapha rissoënsis Redinger

### Remarks
null


text:
package com.orientechnologies.orient.client.remote.message;

import com.orientechnologies.orient.client.remote.OBinaryResponse;
import com.orientechnologies.orient.client.remote.OStorageRemoteSession;
import com.orientechnologies.orient.core.serialization.serializer.record.ORecordSerializer;
import com.orientechnologies.orient.enterprise.channel.binary.OChannelDataInput;
import com.orientechnologies.orient.enterprise.channel.binary.OChannelDataOutput;
import java.io.IOException;

public final class OAddClusterResponse implements OBinaryResponse {
  private int clusterId;

  public OAddClusterResponse() {}

  public OAddClusterResponse(int num) {
    this.clusterId = num;
  }

  public void write(OChannelDataOutput channel, int protocolVersion, ORecordSerializer serializer)
      throws IOException {
    channel.writeShort((short) clusterId);
  }

  @Override
  public void read(OChannelDataInput network, OStorageRemoteSession session) throws IOException {
    this.clusterId = network.readShort();
  }

  public int getClusterId() {
    return clusterId;
  }
}


text:
from .redirect import ChannelRedirect

__red_end_user_data_statement__ = (
    "This cog does not persistently store data or metadata about users."
)

async def setup(bot):
    cog = ChannelRedirect(bot)
    bot.add_cog(cog)
    bot.before_invoke(cog.before_invoke_hook)


text:
/*
 * BJAF - Beetle J2EE Application Framework
 * 甲壳虫J2EE企业应用开发框架
 * 版权所有2003-2015 余浩东 (www.beetlesoft.net)
 *
 * 这是一个免费开源的软件,您必须在
 *<http://www.apache.org/licenses/LICENSE-2.0>
 *协议下合法使用、修改或重新发布。
 *
 * 感谢您使用、推广本框架,若有建议或问题,欢迎您和我联系。
 * 邮件: <yuhaodong@gmail.com/>.
 */
package com.beetle.framework.web.view;

import java.io.UnsupportedEncodingException;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.beetle.framework.web.common.CommonUtil;

/**
 *

 * Title: BeetleWeb
 *

 *
 *

 * Description: 视图助手类
 *
 *

 *
 *

 * Copyright: Copyright (c) 2005
 *

 *
 *

 * Company: 甲壳虫软件
 *
 *

 *
 * @author 余浩东(hdyu@beetlesoft.net)
 * @version 1.0
 */
public class ViewHelper {
	private HttpServletRequest request;

	public ViewHelper(HttpServletRequest request) {
		this.request = request;
		/*
		 * Object o = request.getAttribute("WEB_ENCODE_CHARSET"); if (o == null)
		 * { o = System.getProperty("file.encoding"); } try {
		 * this.request.setCharacterEncoding(o.toString()); } catch
		 * (UnsupportedEncodingException ex) { ex.printStackTrace(); }
		 */

	}

	/**
	 * 根据数据对象的标识获取数据对象
	 *
	 *
	 * @param dataId
	 *            String
	 * @return Object
	 */
	public Object getDataValue(String dataId) {
		return request.getAttribute(dataId);
	}

	public String getDataValueAsString(String dataId) {
		return (String) getDataValue(dataId);
	}

	public Integer getDataValueAsInteger(String dataId) {
		return (Integer) getDataValue(dataId);
	}

	public int getDataValueAsInt(String dataId) {
		return getDataValueAsInteger(dataId).intValue();
	}

	public long getDataValueAsLng(String dataId) {
		return getDataValueAsLong(dataId).longValue();
	}

	public Long getDataValueAsLong(String dataId) {
		return (Long) getDataValue(dataId);
	}

	public List<?> getDataValueAsList(String dataId) {
		return (List<?>) getDataValue(dataId);
	}

	public Map<?, ?> getDataValueAsMap(String dataId) {
		return (Map<?, ?>) getDataValue(dataId);
	}

	public Time getDataValueAsTime(String dataId) {
		return (Time) getDataValue(dataId);
	}

	public Double getDataValueAsDouble(String dataId) {
		return (Double) getDataValue(dataId);
	}

	public Float getDataValueAsFloat(String dataId) {
		return (Float) getDataValue(dataId);
	}

	public Character getDataValueAsCharacter(String dataId) {
		return (Character) getDataValue(dataId);
	}

	public char getDataValueAsChar(String dataId) {
		return getDataValueAsCharacter(dataId).charValue();
	}

	public float getDataValueAsFlt(String dataId) {
		return getDataValueAsFloat(dataId).floatValue();
	}

	public Boolean getDataValueAsBoolean(String dataId) {
		return (Boolean) getDataValue(dataId);
	}

	public boolean getDataValueAsBool(String dataId) {
		return getDataValueAsBoolean(dataId).booleanValue();
	}

	public double getDataValueAsDbl(String dataId) {
		return getDataValueAsDouble(dataId).doubleValue();
	}

	public java.util.Date getDataValueAsDate(String dataId) {
		return (java.util.Date) getDataValue(dataId);
	}

	public Timestamp getDataValueAsTimestamp(String dataId) {
		return (Timestamp) getDataValue(dataId);
	}

	public String dateFormat(java.util.Date date, String formatStr) {
		java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(
				formatStr);
		return sdf.format(date);
	}

	public String doubleFormat(double dbnum, String formatStr) {
		DecimalFormat df = new DecimalFormat(formatStr);
		return df.format(dbnum);
	}

	public String floatFormat(float flnum, String formatStr) {
		DecimalFormat df = new DecimalFormat(formatStr);
		return df.format(flnum);
	}

	public Enumeration<?> getDataValueNames() {
		return request.getAttributeNames();
	}

	/**
	 * 是否存在Session
	 *
	 * @return boolean
	 */
	public boolean existSession() {
		return request.getSession(false) != null;
	}

	/**
	 * 从request对象中返回页面参数
	 *
	 *
	 * @param paramName
	 *            String
	 * @return String
	 */
	public String getDataFromRequest(String paramName) {
		if (request.getMethod().toLowerCase().equals("get")) {
			String info = (String) request
					.getAttribute(CommonUtil.WEB_SERVER_INFO);
			if (info == null) {
				return request.getParameter(paramName);
			} else {
				if (info.indexOf("Tomcat") > 0) {
					String a = request.getParameter(paramName);
					try {
						if (a != null) {
							return new String(a.getBytes("8859_1"));
						} else {
							return a;
						}
					} catch (UnsupportedEncodingException ex) {
						return a;
					}
				}
			}
		}
		return request.getParameter(paramName);
	}

	/**
	 * 从Session获取对象
	 *
	 * @param valueName
	 *            String
	 * @return Object
	 */
	public Object getDataFromSession(String valueName) {
		HttpSession session = request.getSession(false);
		if (session == null) {
			return null;
		} else {
			return session.getAttribute(valueName);
		}
	}

}


text:
/******************************************************************************
 * @file audio.h
 *
 * This header file contains includes and function prototypes of the functions
 * defined in the 'audio.c' file.
 *
 * <pre>
 * MODIFICATION HISTORY:
 *
 * Ver   Who          Date     Changes
 * ----- ------------ -------- -----------------------------------------------
 * 1.00a Mihaita Nagy 04/06/12 First release
 *
 * </pre>
 *
 *****************************************************************************/

#ifndef AUDIO_H
#define AUDIO_H

#ifdef __cplusplus
extern "C" {
#endif

/***************************** Include Files *********************************/
#include <stdio.h>
#include <xil_io.h>
#include <xil_printf.h>
#include <xparameters.h>

/************************** Function Prototypes ******************************/
void AudioRecord(unsigned long u32MemOffset, unsigned long u32NrSamples);
void AudioPlay(unsigned long u32MemOffset, unsigned long u32NrSamples);

#ifdef __cplusplus
}
#endif

#endif