text:
package net.anotheria.moskito.webui.journey.api;

import net.anotheria.anoplass.api.APIException;
import net.anotheria.anoplass.api.APIInitException;
import net.anotheria.moskito.core.journey.Journey;
import net.anotheria.moskito.core.journey.JourneyManager;
import net.anotheria.moskito.core.journey.JourneyManagerFactory;
import net.anotheria.moskito.core.journey.NoSuchJourneyException;
import net.anotheria.moskito.webui.shared.api.AbstractMoskitoAPIImpl;
import net.anotheria.util.NumberUtils;

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

/**
 * TODO comment this class
 *
 * @author lrosenberg
 * @since 14.02.13 10:00
 */
public class JourneyAPIImpl extends AbstractMoskitoAPIImpl implements  JourneyAPI {

	private JourneyManager journeyManager;

	@Override
	public void init() throws APIInitException {
		super.init();
		journeyManager = JourneyManagerFactory.getJourneyManager();
	}

	@Override
	public List<JourneyListItemAO> getJourneys() throws APIException {
		List<Journey> journeys = journeyManager.getJourneys();
		List<JourneyListItemAO> beans = new ArrayList<JourneyListItemAO>(journeys.size());

		for (Journey j : journeys){
			JourneyListItemAO bean = new JourneyListItemAO();

			bean.setName(j.getName());
			bean.setActive(j.isActive());
			bean.setCreated(NumberUtils.makeISO8601TimestampString(j.getCreatedTimestamp()));
			bean.setLastActivity(NumberUtils.makeISO8601TimestampString(j.getLastActivityTimestamp()));
			bean.setNumberOfCalls(j.getTracedCalls().size());
			beans.add(bean);
		}

		return beans;
	}

	@Override
	public Journey getJourney(String name) throws APIException {
		try{
			return journeyManager.getJourney(name);
		}catch(NoSuchJourneyException e){
			throw new APIException("Journey not found.");
		}
	}
}


text:
class Event < ActiveRecord::Base
  store_accessor :speaker_notification_emails, :accept
  store_accessor :speaker_notification_emails, :reject
  store_accessor :speaker_notification_emails, :waitlist

  has_many :participants, dependent: :destroy
  has_many :proposals,    dependent: :destroy
  has_many :speakers,     through: :proposals
  has_many :rooms,        dependent: :destroy
  has_many :tracks,       dependent: :destroy
  has_many :sessions,       dependent: :destroy
  has_many :taggings, through: :proposals
  has_many :ratings, through: :proposals
  has_many :participant_invitations

  serialize :proposal_tags, Array
  serialize :review_tags, Array

  scope :recent, -> { order('name ASC') }
  scope :live, -> { where("state = 'open' and (closes_at is null or closes_at > ?)", Time.current).order('closes_at ASC') }

  validates :name, :contact_email, presence: true
  validates :slug, presence: true, uniqueness: true

  before_validation :generate_slug

  def valid_proposal_tags
    proposal_tags.join(', ')
  end

  def valid_proposal_tags=(tags_string)
    self.proposal_tags = Tagging.tags_string_to_array(tags_string)
  end

  def valid_review_tags
    review_tags.join(', ')
  end

  def valid_review_tags=(tags_string)
    self.review_tags = Tagging.tags_string_to_array(tags_string)
  end

  def generate_slug
    self.slug = name.parameterize if slug.blank?
  end

  def to_s
    name
  end

  def open?
    state == 'open' && (closes_at.nil? || closes_at > Time.current)
  end

  def closed?
    ! open?
  end

  def past_open?
    state == 'open' && closes_at < Time.current
  end

  def unmet_requirements_for_scheduling
    missing_prereqs = []

    missing_prereqs << "Event must have a start date" unless start_date
    missing_prereqs << "Event must have a end date" unless end_date

    unless rooms.size > 0
      missing_prereqs << "Event must have at least one room"
    end

    missing_prereqs
  end

  def archive
    if current?
      update_attribute(:archived, true)
    end
  end

  def unarchive
    if archived?
      update_attribute(:archived, false)
    end
  end

  def current?
    ! archived?
  end

  def cfp_opens
    opens_at && opens_at.to_s(:long_with_zone)
  end

  def cfp_closes
    closes_at && closes_at.to_s(:long_with_zone)
  end
end

# == Schema Information
#
# Table name: events
#
#  id                          :integer          not null, primary key
#  name                        :string(255)
#  slug                        :string(255)
#  url                         :string(255)
#  contact_email               :string(255)
#  state                       :string(255)      default("closed")
#  opens_at                    :datetime
#  closes_at                   :datetime
#  start_date                  :datetime
#  end_date                    :datetime
#  proposal_tags               :text
#  review_tags                 :text
#  guidelines                  :text
#  policies                    :text
#  speaker_notification_emails :hstore           default({"accept"=>"", "reject"=>"", "waitlist"=>""})
#  created_at                  :datetime
#  updated_at                  :datetime
#  archived                    :boolean          default(FALSE)
#
# Indexes
#
#  index_events_on_slug  (slug)
#

redpajama_set_name: RedPajamaGithub


text:
#include <QTreeWidgetItem>
#include <QMessageBox>
#include <QSpacerItem>
#include <QComboBox>
#include <QLineEdit>
#include <QSpinBox>
#include <QLabel>
#include <QDebug>

#include "configureartnet.h"
#include "artnetplugin.h"

#define KNodesColumnIP          0
#define KNodesColumnShortName   1
#define KNodesColumnLongName    2

#define KMapColumnInterface     0
#define KMapColumnUniverse      1
#define KMapColumnIPAddress     2
#define KMapColumnArtNetUni     3
#define KMapColumnTransmitMode  4

#define PROP_UNIVERSE (Qt::UserRole + 0)
#define PROP_LINE (Qt::UserRole + 1)
#define PROP_TYPE (Qt::UserRole + 2)

// ArtNet universe is a 15bit value
#define ARTNET_UNIVERSE_MAX 0x7fff

/*****************************************************************************
 * Initialization
 *****************************************************************************/

ConfigureArtNet::ConfigureArtNet(ArtNetPlugin* plugin, QWidget* parent)
        : QDialog(parent)
{
    Q_ASSERT(plugin != NULL);
    m_plugin = plugin;

    /* Setup UI controls */
    setupUi(this);

    fillNodesTree();
    fillMappingTree();
}

void ConfigureArtNet::fillNodesTree()
{
    ArtNetController *prevController = NULL;

    QList<ArtNetIO> IOmap = m_plugin->getIOMapping();

    for (int i = 0; i < IOmap.length(); i++)
    {
        ArtNetController *controller = IOmap.at(i).controller;

        if (controller != NULL && controller != prevController)
        {
            QTreeWidgetItem* pitem = new QTreeWidgetItem(m_nodesTree);
            pitem->setText(KNodesColumnIP, tr("%1 nodes").arg(controller->getNetworkIP()));
            QHash<QHostAddress, ArtNetNodeInfo> nodesList = controller->getNodesList();
            QHashIterator<QHostAddress, ArtNetNodeInfo> it(nodesList);
            while (it.hasNext())
            {
                it.next();
                QTreeWidgetItem* nitem = new QTreeWidgetItem(pitem);
                ArtNetNodeInfo nInfo = it.value();
                nitem->setText(KNodesColumnIP, it.key().toString());
                nitem->setText(KNodesColumnShortName, nInfo.shortName);
                nitem->setText(KNodesColumnLongName, nInfo.longName);
            }
            prevController = controller;
        }
    }

    m_nodesTree->header()->resizeSections(QHeaderView::ResizeToContents);
}

void ConfigureArtNet::fillMappingTree()
{
    QTreeWidgetItem* inputItem = NULL;
    QTreeWidgetItem* outputItem = NULL;

    QList<ArtNetIO> IOmap = m_plugin->getIOMapping();
    foreach(ArtNetIO io, IOmap)
    {
        if (io.controller == NULL)
            continue;

        ArtNetController *controller = io.controller;
        if (controller == NULL)
            continue;

        qDebug() << "[ArtNet] controller IP" << controller->getNetworkIP() << "type:" << controller->type();
        if ((controller->type() & ArtNetController::Input) && inputItem == NULL)
        {
            inputItem = new QTreeWidgetItem(m_uniMapTree);
            inputItem->setText(KMapColumnInterface, tr("Inputs"));
            inputItem->setExpanded(true);
        }
        if ((controller->type() & ArtNetController::Output) && outputItem == NULL)
        {
            outputItem = new QTreeWidgetItem(m_uniMapTree);
            outputItem->setText(KMapColumnInterface, tr("Outputs"));
            outputItem->setExpanded(true);
        }
        foreach(quint32 universe, controller->universesList())
        {
            UniverseInfo *info = controller->getUniverseInfo(universe);

            if (info->type & ArtNetController::Input)
            {
                QTreeWidgetItem *item = new QTreeWidgetItem(inputItem);
                item->setData(KMapColumnInterface, PROP_UNIVERSE, universe);
                item->setData(KMapColumnInterface, PROP_LINE, controller->line());
                item->setData(KMapColumnInterface, PROP_TYPE, ArtNetController::Input);

                item->setText(KMapColumnInterface, io.address.broadcast().toString());
                item->setText(KMapColumnUniverse, QString::number(universe + 1));
                item->setTextAlignment(KMapColumnUniverse, Qt::AlignHCenter | Qt::AlignVCenter);

                QSpinBox *spin = new QSpinBox(this);
                spin->setRange(0, ARTNET_UNIVERSE_MAX);
                spin->setValue(info->inputUniverse);
                m_uniMapTree->setItemWidget(item, KMapColumnArtNetUni, spin);
            }
            if (info->type & ArtNetController::Output)
            {
                QTreeWidgetItem *item = new QTreeWidgetItem(outputItem);
                item->setData(KMapColumnInterface, PROP_UNIVERSE, universe);
                item->setData(KMapColumnInterface, PROP_LINE, controller->line());
                item->setData(KMapColumnInterface, PROP_TYPE, ArtNetController::Output);

                item->setText(KMapColumnInterface, controller->getNetworkIP());
                item->setText(KMapColumnUniverse, QString::number(universe + 1));
                item->setTextAlignment(KMapColumnUniverse, Qt::AlignHCenter | Qt::AlignVCenter);

                if (info->outputAddress == QHostAddress::LocalHost)
                {
                    // localhost (127.0.0.1) do not need broadcast or anything else
                    item->setText(KMapColumnIPAddress, info->outputAddress.toString());
                }
                else
                {
                    QWidget *IPwidget = new QLineEdit(info->outputAddress.toString());
                    m_uniMapTree->setItemWidget(item, KMapColumnIPAddress, IPwidget);
                }

                QSpinBox *spin = new QSpinBox(this);
                spin->setRange(0, ARTNET_UNIVERSE_MAX);
                spin->setValue(info->outputUniverse);
                m_uniMapTree->setItemWidget(item, KMapColumnArtNetUni, spin);

                QComboBox *combo = new QComboBox(this);
                combo->addItem(tr("Full"));
                combo->addItem(tr("Partial"));
                if (info->outputTransmissionMode == ArtNetController::Partial)
                    combo->setCurrentIndex(1);
                m_uniMapTree->setItemWidget(item, KMapColumnTransmitMode, combo);
            }
        }
    }

    m_uniMapTree->header()->resizeSections(QHeaderView::ResizeToContents);
}

void ConfigureArtNet::showIPAlert(QString ip)
{
    QMessageBox::critical(this, tr("Invalid IP"), tr("%1 is not a valid IP.\nPlease fix it before confirming.").arg(ip));
}

ConfigureArtNet::~ConfigureArtNet()
{
}

/*****************************************************************************
 * Dialog actions
 *****************************************************************************/

void ConfigureArtNet::accept()
{
    for(int i = 0; i < m_uniMapTree->topLevelItemCount(); i++)
    {
        QTreeWidgetItem *topItem = m_uniMapTree->topLevelItem(i);
        for(int c = 0; c < topItem->childCount(); c++)
        {
            QTreeWidgetItem *item = topItem->child(c);
            if (item->data(KMapColumnInterface, PROP_UNIVERSE).isValid() == false)
                continue;

            quint32 universe = item->data(KMapColumnInterface, PROP_UNIVERSE).toUInt();
            quint32 line = item->data(KMapColumnInterface, PROP_LINE).toUInt();
            ArtNetController::Type type = ArtNetController::Type(item->data(KMapColumnInterface, PROP_TYPE).toInt());
            QLCIOPlugin::Capability cap = QLCIOPlugin::Input;
            if (type == ArtNetController::Output)
                cap = QLCIOPlugin::Output;

            QLineEdit *ipEdit = qobject_cast<QLineEdit*>(m_uniMapTree->itemWidget(item, KMapColumnIPAddress));
            if (ipEdit != NULL)
            {
                Q_ASSERT(cap == QLCIOPlugin::Output);
                QHostAddress newHostAddress(ipEdit->text());
                if (newHostAddress.isNull() && ipEdit->text().size() > 0)
                {
                    showIPAlert(ipEdit->text());
                    return;
                }

                //qDebug() << "IPchanged = " << IPChanged;
                m_plugin->setParameter(universe, line, cap, ARTNET_OUTPUTIP, newHostAddress.toString());
            }

            QSpinBox *spin = qobject_cast<QSpinBox*>(m_uniMapTree->itemWidget(item, KMapColumnArtNetUni));
            Q_ASSERT(spin != NULL);

            m_plugin->setParameter(universe, line, cap, (cap == QLCIOPlugin::Output ? ARTNET_OUTPUTUNI : ARTNET_INPUTUNI), spin->value());

            QComboBox *combo = qobject_cast<QComboBox*>(m_uniMapTree->itemWidget(item, KMapColumnTransmitMode));
            if (combo != NULL)
            {
                ArtNetController::TransmissionMode transmissionMode;
                if (combo->currentIndex() == 0)
                    transmissionMode = ArtNetController::Full;
                else
                    transmissionMode = ArtNetController::Partial;

                m_plugin->setParameter(universe, line, cap, ARTNET_TRANSMITMODE,
                        ArtNetController::transmissionModeToString(transmissionMode));
            }
        }
    }

    QDialog::accept();
}

int ConfigureArtNet::exec()
{
    return QDialog::exec();
}


text:
{% load feature_tag %}
{% load i18n %}
{{ user.get_profile }}
{% trans "Profile" %}
{% trans "Labs" %}
{% if user.is_staff %}
    {% trans "Admin" %}
{% endif %}
{% trans "Sign out" %}


text:
#include "types.h"

#include "defs.h"

#include "param.h"
#include "mmu.h"
#include "x86.h"
#include "proc.h"
#include "spinlock.h"

//***************************************************************************
// Prelude
//***************************************************************************

//***************************************************************************
// Globals
//***************************************************************************

struct spinlock proc_table_lock;

struct proc proc[NPROC];
static struct proc *initproc;

int nextpid = 1;

extern void forkret(void);
extern void forkret1(struct trapframe*);

//***************************************************************************
// Initialisation
//***************************************************************************

void
pinit(void)
{
  int i;
  initlock(&proc_table_lock, "proc_table");

  //pad: the memset 0 for the bss would also implicitly reset
  // all the proc[] fields, and because UNUSED was 0, all
  // process entries were correctly set. If UNUSED is not 0 then
  // need the following more explicit code:
  acquire(&proc_table_lock);
  for(i = 0; i < NPROC; i++) {
    proc[i].state = UNUSED;
  }
  release(&proc_table_lock);

}

//***************************************************************************
// Other
//***************************************************************************

// Look in the process table for an UNUSED proc.
// If found, change state to EMBRYO and return it.
// Otherwise return 0.
static struct proc*
allocproc(void)
{
  int i;
  struct proc *p;

  acquire(&proc_table_lock);
  for(i = 0; i < NPROC; i++){
    p = &proc[i];
    if(p->state == UNUSED){
      p->state = EMBRYO;
      p->pid = nextpid++;
      release(&proc_table_lock);
      return p;
    }
  }
  release(&proc_table_lock);
  return 0;
}

// Grow current process's memory by n bytes.
// Return old size on success, -1 on failure.
int
growproc(int n)
{
  char *newmem, *oldmem;

  newmem = kalloc(cp->sz + n);
  if(newmem == 0)
    return -1;
  kmemmove(newmem, cp->mem, cp->sz);
  kmemset(newmem + cp->sz, 0, n);
  oldmem = cp->mem;
  cp->mem = newmem;
  kfree(oldmem, cp->sz);
  cp->sz += n;
  setupsegs(cp);
  return cp->sz - n;
}

// Set up CPU's segment descriptors and task state for a given process.
// If p==0, set up for "idle" state for when scheduler() is running.
void
setupsegs(struct proc *p)
{
  struct cpu *c;

  pushcli();
  c = &cpus[cpu()];
  c->ts.ss0 = SEG_KDATA << 3;
  if(p)
    c->ts.esp0 = (uint)(p->kstack + KSTACKSIZE);
  else
    c->ts.esp0 = 0xffffffff;

  c->gdt[0] = SEG_NULL;
  c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0x100000 + 64*1024-1, 0);
  c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
  c->gdt[SEG_TSS] = SEG16(STS_T32A, (uint)&c->ts, sizeof(c->ts)-1, 0);
  c->gdt[SEG_TSS].s = 0;
  if(p){
    c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, (uint)p->mem, p->sz-1, DPL_USER);
    c->gdt[SEG_UDATA] = SEG(STA_W, (uint)p->mem, p->sz-1, DPL_USER);
  } else {
    c->gdt[SEG_UCODE] = SEG_NULL;
    c->gdt[SEG_UDATA] = SEG_NULL;
  }

  lgdt(c->gdt, sizeof(c->gdt));
  ltr(SEG_TSS << 3);
  popcli();
}

// Create a new process copying p as the parent.
// Sets up stack to return as if from system call.
// Caller must set state of returned proc to RUNNABLE.
struct proc*
copyproc(struct proc *p)
{
  int i;
  struct proc *np;

  // Allocate process.
  if((np = allocproc()) == 0)
    return 0;

  // Allocate kernel stack.
  if((np->kstack = kalloc(KSTACKSIZE)) == 0){
    np->state = UNUSED;
    return 0;
  }
  np->tf = (struct trapframe*)(np->kstack + KSTACKSIZE) - 1;

  if(p){  // Copy process state from p.
    np->parent = p;
    kmemmove(np->tf, p->tf, sizeof(*np->tf));

    np->sz = p->sz;
    if((np->mem = kalloc(np->sz)) == 0){
      kfree(np->kstack, KSTACKSIZE);
      np->kstack = 0;
      np->state = UNUSED;
      return 0;
    }
    kmemmove(np->mem, p->mem, np->sz);

    for(i = 0; i < NOFILE; i++)
      if(p->ofile[i])
        np->ofile[i] = filedup(p->ofile[i]);
    np->cwd = idup(p->cwd);
  }

  // Set up new context to start executing at forkret (see below).
  kmemset(&np->context, 0, sizeof(np->context));
  np->context.eip = (uint)forkret;
  np->context.esp = (uint)np->tf;

  // Clear %eax so that fork system call returns 0 in child.
  np->tf->eax = 0;
  return np;
}

//***************************************************************************
// Initialisation process
//***************************************************************************

// Set up first user process.
void
userinit(void)
{
  struct proc *p;
  extern uchar _binary_initcode_start[], _binary_initcode_size[];

  p = copyproc(NULL);
  p->sz = PAGE;
  p->mem = kalloc(p->sz);
  p->cwd = namei("/");
  kmemset(p->tf, 0, sizeof(*p->tf));
  p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
  p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
  p->tf->es = p->tf->ds;
  p->tf->ss = p->tf->ds;
  p->tf->eflags = FL_IF;
  p->tf->esp = p->sz;

  // Make return address readable; needed for some gcc.
  p->tf->esp -= 4;
  *(uint*)(p->mem + p->tf->esp) = 0xefefefef;

  // On entry to user space, start executing at beginning of initcode.S.
  // pad: cf ld -Ttext 0  for initcode
  p->tf->eip = 0;
  kmemmove(p->mem, _binary_initcode_start, (int)_binary_initcode_size);
  ksafestrcpy(p->name, "initcode", sizeof(p->name));
  p->state = RUNNABLE;

  initproc = p;
}

//***************************************************************************
// Other
//***************************************************************************

// Return currently running process.  aliased via proc.h macro  cp
struct proc*
curproc(void)
{
  struct proc *p;

  pushcli();
  p = cpus[cpu()].curproc;
  popcli();
  return p;
}

// Per-CPU process scheduler.
// Each CPU calls scheduler() after setting itself up.
// Scheduler never returns.  It loops, doing:
//  - choose a process to run
//  - swtch to start running that process
//  - eventually that process transfers control
//      via swtch back to the scheduler.
void
scheduler(void)
{
  struct proc *p;
  struct cpu *c;
  int i;

  c = &cpus[cpu()];
  for(;;){
    // Enable interrupts on this processor.
    sti();

    // Loop over process table looking for process to run.
    acquire(&proc_table_lock);
    for(i = 0; i < NPROC; i++){
      p = &proc[i];
      if(p->state != RUNNABLE)
        continue;

      // Switch to chosen process.  It is the process's job
      // to release proc_table_lock and then reacquire it
      // before jumping back to us.
      c->curproc = p;
      setupsegs(p);
      p->state = RUNNING;

      // !!! SWITCHING !!!
      swtch(&c->context, &p->context);

      // Process is done running for now.
      // It should have changed its p->state before coming back.
      c->curproc = 0;
      setupsegs(0);
    }
    release(&proc_table_lock);

  }
}

// Enter scheduler.  Must already hold proc_table_lock
// and have changed curproc[cpu()]->state.
void
sched(void)
{
  if(read_eflags()&FL_IF)
    panic("sched interruptible");
  if(cp->state == RUNNING)
    panic("sched running");
  if(!holding(&proc_table_lock))
    panic("sched proc_table_lock");
  if(cpus[cpu()].ncli != 1)
    panic("sched locks");

  swtch(&cp->context, &cpus[cpu()].context);
}

// Give up the CPU for one scheduling round.
void
yield(void)
{
  acquire(&proc_table_lock);
  cp->state = RUNNABLE;
  sched();
  release(&proc_table_lock);
}

// A fork child's very first scheduling by scheduler()
// will swtch here.  "Return" to user space.
void
forkret(void)
{
  // Still holding proc_table_lock from scheduler.
  release(&proc_table_lock);

  // Jump into assembly, never to return.
  forkret1(cp->tf);
}

// Atomically release lock and sleep on chan.
// Reacquires lock when reawakened.
void
ksleep(void *chan, struct spinlock *lk)
{
  if(cp == 0)
    panic("sleep");

  if(lk == 0)
    panic("sleep without lk");

  // Must acquire proc_table_lock in order to
  // change p->state and then call sched.
  // Once we hold proc_table_lock, we can be
  // guaranteed that we won't miss any wakeup
  // (wakeup runs with proc_table_lock locked),
  // so it's okay to release lk.
  if(lk != &proc_table_lock){
    acquire(&proc_table_lock);
    release(lk);
  }

  // Go to sleep.
  cp->chan = chan;
  cp->state = SLEEPING;
  sched();

  // Tidy up.
  cp->chan = 0;

  // Reacquire original lock.
  if(lk != &proc_table_lock){
    release(&proc_table_lock);
    acquire(lk);
  }
}

// Wake up all processes sleeping on chan.
// Proc_table_lock must be held.
static void
wakeup1(void *chan)
{
  struct proc *p;

  for(p = proc; p < &proc[NPROC]; p++)
    if(p->state == SLEEPING && p->chan == chan)
      p->state = RUNNABLE;
}

// Wake up all processes sleeping on chan.
// Proc_table_lock is acquired and released.
void
wakeup(void *chan)
{
  acquire(&proc_table_lock);
  wakeup1(chan);
  release(&proc_table_lock);
}

// Kill the process with the given pid.
// Process won't actually exit until it returns
// to user space (see trap in trap.c).
int
kkill(int pid)
{
  struct proc *p;

  acquire(&proc_table_lock);
  for(p = proc; p < &proc[NPROC]; p++){
    if(p->pid == pid){
      p->killed = 1;
      // Wake process from sleep if necessary.
      if(p->state == SLEEPING)
        p->state = RUNNABLE;
      release(&proc_table_lock);
      return 0;
    }
  }
  release(&proc_table_lock);
  return -1;
}

// Exit the current process.  Does not return.
// Exited processes remain in the zombie state
// until their parent calls wait() to find out they exited.
void
kexit(void)
{
  struct proc *p;
  int fd;

  if(cp == initproc)
    panic("init exiting");

  // Close all open files.
  for(fd = 0; fd < NOFILE; fd++){
    if(cp->ofile[fd]){
      fileclose(cp->ofile[fd]);
      cp->ofile[fd] = 0;
    }
  }

  iput(cp->cwd);
  cp->cwd = 0;

  acquire(&proc_table_lock);

  // Parent might be sleeping in wait().
  wakeup1(cp->parent);

  // Pass abandoned children to init.
  for(p = proc; p < &proc[NPROC]; p++){
    if(p->parent == cp){
      p->parent = initproc;
      if(p->state == ZOMBIE)
        wakeup1(initproc);
    }
  }

  // Jump into the scheduler, never to return.
  cp->killed = 0;
  cp->state = ZOMBIE;
  sched();
  panic("zombie exit");
}

// Wait for a child process to exit and return its pid.
// Return -1 if this process has no children.
int
kwait(void)
{
  struct proc *p;
  int i, havekids, pid;

  acquire(&proc_table_lock);
  for(;;){
    // Scan through table looking for zombie children.
    havekids = 0;
    for(i = 0; i < NPROC; i++){
      p = &proc[i];
      if(p->state == UNUSED)
        continue;
      if(p->parent == cp){
        if(p->state == ZOMBIE){
          // Found one.
          kfree(p->mem, p->sz);
          kfree(p->kstack, KSTACKSIZE);
          pid = p->pid;
          p->state = UNUSED;
          p->pid = 0;
          p->parent = 0;
          p->name[0] = 0;
          release(&proc_table_lock);
          return pid;
        }
        havekids = 1;
      }
    }

    // No point waiting if we don't have any children.
    if(!havekids || cp->killed){
      release(&proc_table_lock);
      return -1;
    }

    // Wait for children to exit.  (See wakeup1 call in proc_exit.)
    ksleep(cp, &proc_table_lock);
  }
}

//***************************************************************************
// Debugging
//***************************************************************************

// Print a process listing to console.  For debugging.
// Runs when user types ^P on console.
// No lock to avoid wedging a stuck machine further.
void
procdump(void)
{
  static char *states[] = {
  [UNUSED]    = "unused",
  [EMBRYO]    = "embryo",
  [SLEEPING]  = "sleep ",
  [RUNNABLE]  = "runble",
  [RUNNING]   = "run   ",
  [ZOMBIE]    = "zombie"
  };
  int i, j;
  struct proc *p;
  char *state;
  uint pc[10];

  for(i = 0; i < NPROC; i++){
    p = &proc[i];
    if(p->state == UNUSED)
      continue;
    if(/*p->state >= 0 && */p->state < NELEM(states) && states[p->state])
      state = states[p->state];
    else
      state = "???";
    cprintf("%d %s %s", p->pid, state, p->name);
    if(p->state == SLEEPING){
      getcallerpcs((uint*)p->context.ebp+2, pc);
      for(j=0; j<10 && pc[j] != 0; j++)
        cprintf(" %p", pc[j]);
    }
    cprintf("\n");
  }
}


text:
'use strict';

exports.__esModule = true;

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };

var _hasOwn = require('has-own');

var _hasOwn2 = _interopRequireDefault(_hasOwn);

var _postcss = require('postcss');

var _postcssValueParser = require('postcss-value-parser');

var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function canonical(obj) {
    return function recurse(key) {
        if ((0, _hasOwn2.default)(key, obj) && obj[key] !== key) {
            return recurse(obj[key]);
        }
        return key;
    };
}

function sameParent(ruleA, ruleB) {
    var hasParent = ruleA.parent && ruleB.parent;
    var sameType = hasParent && ruleA.parent.type === ruleB.parent.type;
    // If an at rule, ensure that the parameters are the same
    if (hasParent && ruleA.parent.type !== 'root' && ruleB.parent.type !== 'root') {
        sameType = sameType && ruleA.parent.params === ruleB.parent.params && ruleA.parent.name === ruleB.parent.name;
    }
    return hasParent ? sameType : true;
}

function mergeAtRules(css, pairs) {
    pairs.forEach(function (pair) {
        pair.cache = [];
        pair.replacements = [];
        pair.decls = [];
    });

    var relevant = void 0;

    css.walk(function (node) {
        if (node.type === 'atrule') {
            relevant = pairs.filter(function (pair) {
                return pair.atrule.test(node.name);
            })[0];
            if (!relevant) {
                return;
            }
            if (relevant.cache.length < 1) {
                relevant.cache.push(node);
                return;
            } else {
                var _ret = function () {
                    var toString = node.nodes.toString();
                    relevant.cache.forEach(function (cached) {
                        if (cached.name === node.name && sameParent(cached, node) && cached.nodes.toString() === toString) {
                            cached.remove();
                            relevant.replacements[cached.params] = node.params;
                        }
                    });
                    relevant.cache.push(node);
                    return {
                        v: void 0
                    };
                }();

                if ((typeof _ret === 'undefined' ? 'undefined' : _typeof(_ret)) === "object") return _ret.v;
            }
        }
        if (node.type === 'decl') {
            relevant = pairs.filter(function (pair) {
                return pair.decl.test(node.prop);
            })[0];
            if (!relevant) {
                return;
            }
            relevant.decls.push(node);
        }
    });

    pairs.forEach(function (pair) {
        var canon = canonical(pair.replacements);
        pair.decls.forEach(function (decl) {
            decl.value = (0, _postcssValueParser2.default)(decl.value).walk(function (node) {
                if (node.type === 'word') {
                    node.value = canon(node.value);
                }
                if (node.type === 'space') {
                    node.value = ' ';
                }
                if (node.type === 'div') {
                    node.before = node.after = '';
                }
            }).toString();
        });
    });
}

exports.default = (0, _postcss.plugin)('postcss-merge-idents', function () {
    return function (css) {
        mergeAtRules(css, [{
            atrule: /keyframes/,
            decl: /animation/
        }, {
            atrule: /counter-style/,
            decl: /(list-style|system)/
        }]);
    };
});
module.exports = exports['default'];


text:
<!DOCTYPE html>

		<title>Opularity | TOR</title>
		<link href="Resources/css/bootstrap.css" rel='stylesheet' type='text/css' />

		<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">

		<link href="Resources/css/style.css" rel='stylesheet' type='text/css' />

		<link href="Resources/css/bootstrap-social.css" rel='stylesheet' type='text/css' />

		<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800' rel='stylesheet' type='text/css'>

		<meta name="viewport" content="width=device-width, initial-scale=1">

		<link rel="stylesheet" id="font-awesome-css" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" type="text/css" media="screen">

		<link rel="stylesheet" href="Resources/css/scroll.css" type="text/css">

Home

Introduction

Tutorials

Resources

						</script>

								title.


text: cookbook_path ["c:/temp_dvd/cookbooks"]


text:
The Coming Wave

      Saturday May 11th | 5:30 PM - 10:00 PM | McNamera Alumni Center

        We are surrounded by thousands of cultures, emerging technologies, and ideas. The next generation of thinking, acting, and learning is upon us.
        TEDxUMN's 2019 conference brings The Coming Wave of innovation and cultural change to the forefront of discourse with the aim of bringing the diverse Twin Cities community together.
         Regardless of our color, creed, religion, race, or orientation, The Coming Wave will wash over all of us.

    View Details
    Purchase Tickets


text:
from __future__ import absolute_import, unicode_literals

import inspect

def _user_attributes(cls):
    defaults = dir(type(str('defaults'), (object,), {}))  # gives all inbuilt attrs
    return [
        item[0] for item in inspect.getmembers(cls) if item[0] not in defaults]

def choices(cls):
    """
    Decorator to set `CHOICES` and other attributes
    """
    _choices = []
    for attr in _user_attributes(cls):
        val = getattr(cls, attr)
        setattr(cls, attr[1:], val[0])
        _choices.append((val[0], val[1]))
    setattr(cls, 'CHOICES', tuple(_choices))
    return cls

@choices
class ConferenceStatus:
    _ACCEPTING_CFP = [1, "Accepting Proposals"]
    _CLOSED_CFP = [2, "Proposal submission closed"]
    _ACCEPTING_VOTES = [3, "Accepting Votes"]
    _SCHEDULE_PUBLISHED = [4, "Schedule Published"]

@choices
class ProposalStatus:
    _DRAFT = [1, "Draft"]
    _PUBLIC = [2, "Public"]
    _CANCELLED = [3, "Cancelled"]

@choices
class ProposalReviewStatus:
    _YET_TO_BE_REVIEWED = [1, "Yet to be reviewed"]
    _SELECTED = [2, "Selected"]
    _REJECTED = [3, "Rejected"]
    _ON_HOLD = [4, "On hold"]
    _WAIT_LISTED = [5, "Wait-listed"]

@choices
class ProposalTargetAudience:
    _BEGINNER = [1, "Beginner"]
    _INTERMEDIATE = [2, "Intermediate"]
    _ADVANCED = [3, "Advanced"]

@choices
class ProposalUserVoteRole:
    _PUBLIC = [1, "Public"]
    _REVIEWER = [2, "Reviewer"]

@choices
class ProposalReviewVote:
    _MUST_HAVE = [2, "Must have"]
    _GOOD = [1, "Good"]
    _NOT_BAD = [0, "Not Bad"]
    _NOT_ALLOWED = [-1, "Shouldn't be allowed"]

# FIXME: `ProposalReviewerComment` should be Boolean
@choices
class ProposalReviewerComment:
    _COMMENTED = ['True', 'Yes']
    _NOT_COMMENTED = ['False', 'No']


text:
import '@/utils/base';
import '@/login.scss';

const test = () => {
    console.log(Alpine.version);
    console.log(jQuery.fn.jquery);
    console.log(2);
}

test();


text:
package com.obsidian.compiler.StaticCodeAnalyzer.Errors;

import com.obsidian.compiler.Lava.LvRangeInFile;
import com.obsidian.compiler.StaticCodeAnalyzer.ScaErrorSource;

/**
 * Created by Jonathon on 5/28/2017.
 */
public class ConditionIsKnownAtCompileTimeWarning extends CompileWarning {

	LvRangeInFile source;
	boolean knownValue;

	public ConditionIsKnownAtCompileTimeWarning(LvRangeInFile source, boolean value) {
		super();
		this.source = source;
		this.knownValue = value;
	}

	@Override
	public String getTitle() {
		return "Condition is always " + (this.knownValue ? "true" : "false");
	}

	@Override
	public ScaErrorSource getFirstSource() {
		return new ScaErrorSource(this.source, this.getTitle());
	}

}


text:
A http client mock for unit tests. All mocked http methods (like e.g. `get`, `post` or `put`) are being
spied on.

### Parameters
- **q {$q}**: a promise library conforming to AngularJS's `$q`

## HttpMock#history {Array}
A list of all http activities that took place so far. Each entry is a string consisting of the http
method, a boolean flag indicating whether the request could be handled successfully, the requested
url and the time stamp of the request. Use this for debugging purposes in your test case only.

## HttpMock#responseMap {Object}
A map of http methods to maps of urls to the mocked response objects.

## HttpMock#reset()
Resets the http mock by deleting all response mocks and the history recorded so far.

## HttpMock#setHttpResponse( method, uri, response )
Sets a new mocked http response. If a response for the given method / uri combination already exists,
it will be overwritten. If `response` is `null`, the entry is deleted. Use this method instead of
`respondWith`, if a more sophisticated response should be simulated or failed requests using a status
code of `404` for example.

### Parameters
- **method {String}**: the http method to mock

- **uri {String}**: the uri to mock the response for

- **response {Object}**: the response object, probably with `status`, `data` and `headers` fields

## HttpMock#respondWith( [optionalMethod], uri, data )
Sets a response for a status code of `200` without any headers. Thus only the `data` field must be
given for the response. If `data` is `null`, the entry is deleted.

### Parameters
- **_optionalMethod_ {String}**: the http method to use. If omitted, `GET` is assumed

- **uri {String}**: the uri to mock the response for

- **data {Object}**: the payload of the response


text:
<?php
	session_start();
	$conn = new mysqli('localhost','viral','viral','student');
	$user_check = $_SESSION['login_user'];
	$sql="select * from student.admin where username='$user_check'";

	$result = $conn ->query($sql);
	$row = $result ->fetch_assoc();
	$login_session =$row['username'];
	if(!isset($login_session))
	{
		$conn->close();
		session_destroy();
		header('Location:/Project/login.php'); // Redirecting To Home Page
	}
?>


text:
using System;
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;

namespace Iodine.Runtime
{
    [BuiltinDocString (
        "Provides a portable way for interacting with the host operating system"
    )]
    [IodineBuiltinModule ("os")]
    public class OSModule : IodineModule
    {

        public OSModule ()
            : base ("os")
        {
            SetAttribute ("USER_DIR", new IodineString (
                Environment.GetFolderPath (Environment.SpecialFolder.UserProfile))
            );
            SetAttribute ("ENV_SEP", new IodineString (Path.PathSeparator.ToString ()));
            SetAttribute ("SEEK_SET", new IodineInteger (IodineStream.SEEK_SET));
            SetAttribute ("SEEK_CUR", new IodineInteger (IodineStream.SEEK_CUR));
            SetAttribute ("SEEK_END", new IodineInteger (IodineStream.SEEK_END));

            SetAttribute ("call", new BuiltinMethodCallback (Call, this));
            SetAttribute ("putenv", new BuiltinMethodCallback (SetEnv, this));
            SetAttribute ("getenv", new BuiltinMethodCallback (GetEnv, this));
            SetAttribute ("getcwd", new BuiltinMethodCallback (GetCwd, this));
            SetAttribute ("setcwd", new BuiltinMethodCallback (SetCwd, this));
            SetAttribute ("getlogin", new BuiltinMethodCallback (GetUsername, this));
            SetAttribute ("system", new BuiltinMethodCallback (System, this));
            SetAttribute ("unlink", new BuiltinMethodCallback (Unlink, this));
            SetAttribute ("mkdir", new BuiltinMethodCallback (Mkdir, this));
            SetAttribute ("rmdir", new BuiltinMethodCallback (Rmdir, this));
            SetAttribute ("rmtree", new BuiltinMethodCallback (Rmtree, this));
            SetAttribute ("list", new BuiltinMethodCallback (List, this));
        }

        [BuiltinDocString (
            "Executes program, waiting for it to exit and returning its exit code.",
            "@param executable The executable to run.",
            "@optional args Command line arguments.",
            "@optional useShell Should the OS shell be used to invoke the executable."
        )]
        IodineObject Call (VirtualMachine vm, IodineObject self, IodineObject [] args)
        {
            if (args.Length < 1) {
                vm.RaiseException (new IodineArgumentException (1));
                return null;
            }

            var program = args [0] as IodineString;

            string arguments = "";

            bool useShell = false;

            if (program == null) {
                vm.RaiseException (new IodineTypeException ("Str"));
                return null;
            }

            if (args.Length > 1) {

                var argObj = args [1] as IodineString;

                if (argObj == null) {
                    vm.RaiseException (new IodineTypeException ("Str"));
                    return null;
                }

                arguments = argObj.Value;
            }

            if (args.Length > 2) {
                var useShellObj = args [1] as IodineBool;

                if (useShellObj == null) {
                    vm.RaiseException (new IodineTypeException ("Bool"));
                    return null;
                }

                useShell = useShellObj.Value;
            }

            var info = new ProcessStartInfo ();
            info.FileName = program.Value;
            info.Arguments = arguments;
            info.UseShellExecute = useShell;

            var proc = Process.Start (info);

            proc.WaitForExit ();

            return new IodineInteger (proc.ExitCode);

        }

        [BuiltinDocString ("Returns the login name of the current user.")]
        IodineObject GetUsername (VirtualMachine vm, IodineObject self, IodineObject [] args)
        {
            return new IodineString (Environment.UserName);
        }

        [BuiltinDocString ("Returns the current working directory.")]
        IodineObject GetCwd (VirtualMachine vm, IodineObject self, IodineObject [] args)
        {
            return new IodineString (Environment.CurrentDirectory);
        }

        [BuiltinDocString (
            "Sets the current working directory.",
            "@param cwd The new current working directory."
        )]
        IodineObject SetCwd (VirtualMachine vm, IodineObject self, IodineObject [] args)
        {
            if (args.Length <= 0) {
                vm.RaiseException (new IodineArgumentException (1));
                return null;
            }

            var cwd = args [0] as IodineString;

            if (cwd == null) {
                vm.RaiseException (new IodineTypeException ("Str"));
                return null;
            }

            Environment.CurrentDirectory = args [0].ToString ();
            return null;
        }

        [BuiltinDocString (
            "Returns the value of an environmental variable.",
            "@param env The name of the environmental variable."
        )]
        IodineObject GetEnv (VirtualMachine vm, IodineObject self, IodineObject [] args)
        {
            if (args.Length <= 0) {
                vm.RaiseException (new IodineArgumentException (1));
                return null;
            }

            var str = args [0] as IodineString;

            if (str == null) {
                vm.RaiseException (new IodineTypeException ("Str"));
                return null;
            }

            if (Environment.GetEnvironmentVariable (str.Value) != null) {
                return new IodineString (Environment.GetEnvironmentVariable (str.Value));
            }

            return null;
        }

        [BuiltinDocString (
            "Sets an environmental variable to a specified value",
            "@param env The name of the environmental variable.",
            "@param value The value to set the environmental variable."
        )]
        IodineObject SetEnv (VirtualMachine vm, IodineObject self, IodineObject [] args)
        {
            if (args.Length < 2) {
                vm.RaiseException (new IodineArgumentException (2));
            }

            var str = args [0] as IodineString;

            if (str == null) {
                vm.RaiseException (new IodineTypeException ("Str"));
                return null;
            }

            Environment.SetEnvironmentVariable (str.Value, args [1].ToString (), EnvironmentVariableTarget.User);
            return null;
        }

        [BuiltinDocString (
            "Executes a command using the default shell.",
            "@param commmand Command to run."
        )]
        IodineObject System (VirtualMachine vm, IodineObject self, IodineObject [] args)
        {
            if (args.Length < 1) {
                vm.RaiseException (new IodineArgumentException (1));
                return null;
            }

            var command = args [0] as IodineString;

            if (command == null) {
                vm.RaiseException (new IodineTypeException ("Str"));
                return null;
            }

            bool isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT
                             || Environment.OSVersion.Platform == PlatformID.Win32S
                             || Environment.OSVersion.Platform == PlatformID.Win32Windows
                             || Environment.OSVersion.Platform == PlatformID.WinCE
                             || Environment.OSVersion.Platform == PlatformID.Xbox;

            Process proc = null;

            if (isWindows) {
                proc = PsUtilsModule.Popen_Win32 (command.Value, false, false);
            } else {
                proc = PsUtilsModule.Popen_Unix (command.Value, false, false);
            }

            proc.Start ();

            proc.WaitForExit ();

            return new IodineInteger (proc.ExitCode);
        }

        [BuiltinDocString (
            "Removes a file from the filesystem.",
            "@param path The file to delete."
        )]
        IodineObject Unlink (VirtualMachine vm, IodineObject self, IodineObject [] args)
        {
            if (args.Length <= 0) {
                vm.RaiseException (new IodineArgumentException (1));
                return null;
            }

            var fileString = args [0] as IodineString;

            if (fileString == null) {
                vm.RaiseException (new IodineTypeException ("Str"));
                return null;
            }

            if (File.Exists (fileString.Value)) {
                File.Delete (fileString.Value);
            } else {
                vm.RaiseException (new IodineIOException ("File not found!"));
                return null;
            }
            return null;
        }

        [BuiltinDocString (
            "Creates a new directory.",
            "@param path The directory to create."
        )]
        IodineObject Mkdir (VirtualMachine vm, IodineObject self, IodineObject [] args)
        {
            if (args.Length <= 0) {
                vm.RaiseException (new IodineArgumentException (1));
                return null;
            }

            if (!(args [0] is IodineString)) {
                vm.RaiseException (new IodineTypeException ("Str"));
                return null;
            }
            Directory.CreateDirectory (args [0].ToString ());
            return null;
        }

        [BuiltinDocString (
            "Removes an empty directory.",
            "@param path The directory to remove."
        )]
        IodineObject Rmdir (VirtualMachine vm, IodineObject self, IodineObject [] args)
        {
            if (args.Length <= 0) {
                vm.RaiseException (new IodineArgumentException (1));
                return null;
            }

            var path = args [0] as IodineString;

            if (path == null) {
                vm.RaiseException (new IodineTypeException ("Str"));
                return null;
            }

            if (!Directory.Exists (path.Value)) {
                vm.RaiseException (new IodineIOException ("Directory '" + args [0].ToString () +
                "' does not exist!"
                ));
                return null;
            }

            Directory.Delete (path.Value);

            return null;
        }

        [BuiltinDocString (
            "Removes an directory, deleting all subfiles.",
            "@param path The directory to remove."
        )]
        IodineObject Rmtree (VirtualMachine vm, IodineObject self, IodineObject [] args)
        {
            if (args.Length <= 0) {
                vm.RaiseException (new IodineArgumentException (1));
                return null;
            }

            var path = args [0] as IodineString;

            if (path == null) {
                vm.RaiseException (new IodineTypeException ("Str"));
                return null;
            }

            if (!Directory.Exists (path.Value)) {
                vm.RaiseException (new IodineIOException ("Directory '" + args [0].ToString () +
                "' does not exist!"
                ));
                return null;
            }

            RemoveRecursive (path.Value);

            return null;
        }

        /*
         * Recurisively remove a directory
         */
        static bool RemoveRecursive (string target)
        {
            var dir = new DirectoryInfo (target);
            var dirs = dir.GetDirectories ();

            if (!dir.Exists) {
                return false;
            }

            var files = dir.GetFiles ();
            foreach (FileInfo file in files) {
                var temppath = Path.Combine (target, file.Name);
                File.Delete (temppath);
            }

            foreach (DirectoryInfo subdir in dirs) {
                var temppath = Path.Combine (target, subdir.Name);
                RemoveRecursive (temppath);
            }
            Directory.Delete (target);
            return true;
        }

        [BuiltinDocString (
            "Returns a list of all subfiles in a directory.",
            "@param path The directory to list."
        )]
        IodineObject List (VirtualMachine vm, IodineObject self, IodineObject [] args)
        {
            if (args.Length < 1) {
                vm.RaiseException (new IodineArgumentException (1));
                return null;
            }

            var dir = args [0] as IodineString;

            if (dir == null) {
                vm.RaiseException (new IodineTypeException ("Str"));
                return null;
            }

            if (!Directory.Exists (dir.Value)) {
                vm.RaiseException (new IodineIOException ("Directory does not exist"));
                return null;
            }

            var items = new List<string> ();

            items.AddRange (Directory.GetFiles (dir.Value));
            items.AddRange (Directory.GetDirectories (dir.Value));

            var retList = new IodineList (new IodineObject [] { });

            items.ForEach (p => retList.Add (new IodineString (p)));

            return retList;
        }
    }
}


text:
source venv/bin/activate

# clone the latest code
git clone https://github.com/F5Networks/aws-deployments.git

# change into the directory
cd aws-deployments

# install the latest python module requirements
pip install -r requirements.txt

# copy over the basic setup files
cp ./build/files/.f5aws ~/
cp -r ./build/files/.aws ~/

# setup the bash file for first login
if ! egrep activate ~/.bash_profile ; then echo 'source venv/bin/activate' >> ~/.bash_profile; fi
if ! egrep aws-deployments ~/.bash_profile ; then echo 'cd aws-deployments' >> ~/.bash_profile; fi

# attempt to set working directory in .f5aws to logged in user
sed -i.bak "s/home\/ubuntu/home\/`whoami`/" ~/.f5aws

# Clean up permissions
sudo chown -R ubuntu.ubuntu ~/.*
sudo chown -R ubuntu.ubuntu ~/*


text:
package com.spectralogic.ds3autogen.java.models;

public class CustomCommand extends Command {

    private final String customBody;

    public CustomCommand(
            final String name,
            final String requestName,
            final String responseName,
            final AnnotationInfo annotationInfo,
            final String customBody) {
        super(name, requestName, responseName, annotationInfo);
        this.customBody = customBody;
    }

    public String getCustomBody() {
        return customBody;
    }
}


text:
var path = require('path');
var webpack = require('webpack');

module.exports = {
  devtool: 'eval',
  entry: [
    'webpack-dev-server/client?http://localhost:3000',
    'webpack/hot/only-dev-server',
    './src/index'
  ],
  output: {
    path: path.join(__dirname, 'dist'),
    filename: 'bundle.js',
    publicPath: '/static/'
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin()
  ],
  module: {
    loaders: [{
      test: /\.js$/,
      loaders: ['react-hot', 'babel'],
      include: path.join(__dirname, 'src')
    },{
      test: /\.css$/,
      loaders: 'style-loader!css-loader'
    }]
  }
};


text:
package org.apache.kafka.streams.state.internals;

import org.apache.kafka.common.utils.Bytes;
import org.apache.kafka.streams.KeyValue;
import org.apache.kafka.streams.state.KeyValueIterator;

/**
 * Merges two iterators. Assumes each of them is sorted by key
 *
 */
class MergedSortedCacheKeyValueBytesStoreIterator extends AbstractMergedSortedCacheStoreIterator<Bytes, Bytes, byte[], byte[]> {

    MergedSortedCacheKeyValueBytesStoreIterator(final PeekingKeyValueIterator<Bytes, LRUCacheEntry> cacheIterator,
                                                final KeyValueIterator<Bytes, byte[]> storeIterator) {
        super(cacheIterator, storeIterator);
    }

    @Override
    public KeyValue<Bytes, byte[]> deserializeStorePair(final KeyValue<Bytes, byte[]> pair) {
        return pair;
    }

    @Override
    Bytes deserializeCacheKey(final Bytes cacheKey) {
        return cacheKey;
    }

    @Override
    byte[] deserializeCacheValue(final LRUCacheEntry cacheEntry) {
        return cacheEntry.value;
    }

    @Override
    public Bytes deserializeStoreKey(final Bytes key) {
        return key;
    }

    @Override
    public int compare(final Bytes cacheKey, final Bytes storeKey) {
        return cacheKey.compareTo(storeKey);
    }
}


text:
.class Lcom/quizup/core/activities/TopicActivity$1;
.super Lo/ᵈ;
.source ""

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/quizup/core/activities/TopicActivity;->buildTopics()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/quizup/core/activities/TopicActivity;

# direct methods
.method constructor <init>(Lcom/quizup/core/activities/TopicActivity;J)V
    .locals 0

    .line 108
    iput-object p1, p0, Lcom/quizup/core/activities/TopicActivity$1;->this$0:Lcom/quizup/core/activities/TopicActivity;

    invoke-direct {p0, p2, p3}, Lo/ᵈ;-><init>(J)V

    return-void
.end method

# virtual methods
.method public textChanged(Ljava/lang/String;)V
    .locals 6

    .line 112
    invoke-virtual {p1}, Ljava/lang/String;->isEmpty()Z

    move-result v0

    if-nez v0, :cond_0

    invoke-virtual {p1}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 114
    :cond_0
    iget-object v0, p0, Lcom/quizup/core/activities/TopicActivity$1;->this$0:Lcom/quizup/core/activities/TopicActivity;

    iget-object v1, p0, Lcom/quizup/core/activities/TopicActivity$1;->this$0:Lcom/quizup/core/activities/TopicActivity;

    #getter for: Lcom/quizup/core/activities/TopicActivity;->currentTopic:Lo/Ĭ;
    invoke-static {v1}, Lcom/quizup/core/activities/TopicActivity;->access$000(Lcom/quizup/core/activities/TopicActivity;)Lo/Ĭ;

    move-result-object p1

    new-instance v1, Ljava/util/ArrayList;

    iget-object v2, p1, Lo/Ĭ;->ˊ:Ljava/util/ArrayList;

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

    #calls: Lcom/quizup/core/activities/TopicActivity;->setTopics(Ljava/util/List;)V
    invoke-static {v0, v1}, Lcom/quizup/core/activities/TopicActivity;->access$100(Lcom/quizup/core/activities/TopicActivity;Ljava/util/List;)V

    return-void

    .line 118
    :cond_1
    sget-object v0, Lcom/quizup/core/QuizApplication;->ˊ:Lcom/quizup/core/QuizApplication;

    iget-object v3, v0, Lcom/quizup/core/QuizApplication;->ᐝ:Lo/ȓ;

    new-instance v0, Ljava/util/ArrayList;

    iget-object v1, v3, Lo/ȓ;->ˋ:Ljava/util/HashMap;

    invoke-interface {v1}, Ljava/util/Map;->values()Ljava/util/Collection;

    move-result-object v1

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

    move-object v3, v0

    .line 119
    new-instance v4, Ljava/util/ArrayList;

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

    .line 120
    invoke-virtual {p1}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object p1

    .line 122
    invoke-interface {v3}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_0
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_3

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lo/į;

    .line 124
    move-object v5, v0

    iget-object v0, v0, Lo/į;->ˑ:Ljava/lang/String;

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

    move-result-object v0

    invoke-virtual {v0, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v0

    if-eqz v0, :cond_2

    .line 126
    invoke-interface {v4, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 128
    :cond_2
    goto :goto_0

    .line 130
    :cond_3
    invoke-static {v4}, Ljava/util/Collections;->sort(Ljava/util/List;)V

    .line 131
    iget-object v0, p0, Lcom/quizup/core/activities/TopicActivity$1;->this$0:Lcom/quizup/core/activities/TopicActivity;

    #getter for: Lcom/quizup/core/activities/TopicActivity;->adapter:Lo/ڍ;
    invoke-static {v0}, Lcom/quizup/core/activities/TopicActivity;->access$200(Lcom/quizup/core/activities/TopicActivity;)Lo/ڍ;

    move-result-object v0

    invoke-virtual {v0, v4}, Lo/ڍ;->ˊ(Ljava/util/ArrayList;)V

    .line 133
    return-void
.end method


text: define({widgetLabel:"Schuifregelaar tijd"});


text:
package org.drools.guvnor.client.rulefloweditor;

import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;

public class RuleFlowRoundPanel extends RuleFlowRoundedPanel {

    /**
     * Lookup table for corner border width
     */
    private final static String[] CORNERBORDER = {"1px", "1px", "1px", "1px", "1px", "1px", "1px", "2px", "2px", "2px", "3px", "3px", "2px", "2px", "4px", "1px"};

    /**
     * Lookup table for corner height
     */
    private final static String[] CORNERHEIGHT = {"1px", "2px", "2px", "1px", "1px", "1px", "1px", "1px", "1px", "1px", "1px", "1px", "1px", "1px", "1px", "1px"};

    private final static String[] CORNERMARGIN = {"1px", "1px", "1px", "2px", "2px", "3px", "4px", "5px", "6px", "8px", "9px", "11px", "14px", "16px", "18px", "22px"};

    public RuleFlowRoundPanel(int cornerHeight) {
        //        super( ALL,
        //               cornerHeight );
        super( ALL,
               9 );
    }

    protected Element addLine(int corner,
                              int heightIndex) {
        String margin = "0 " + RuleFlowRoundPanel.CORNERMARGIN[heightIndex];

        Element div = DOM.createDiv();

        DOM.setStyleAttribute( div,
                               "fontSize",
                               "0px" );
        DOM.setStyleAttribute( div,
                               "height",
                               RuleFlowRoundPanel.CORNERHEIGHT[heightIndex] );
        DOM.setStyleAttribute( div,
                               "borderWidth",
                               "0 " + RuleFlowRoundPanel.CORNERBORDER[heightIndex] );
        DOM.setStyleAttribute( div,
                               "lineHeight",
                               RuleFlowRoundPanel.CORNERHEIGHT[heightIndex] );
        DOM.setStyleAttribute( div,
                               "margin",
                               margin );
        DOM.setInnerHTML( div,
                          " " );
        DOM.appendChild( getElement(), // body
                         div );

        return div;
    }
}


text:
require('dotenv').config()
const fs = require('fs')
const webpack = require('webpack')
const config = require('./webpack.config')
const clientConfig = require('../config/client')
const WebpackDevServer = require('webpack-dev-server')
const devPort = clientConfig.devPort

config.entry.app.unshift(`webpack-dev-server/client?http://localhost:${devPort}/`)

const wdsConfig = {
  stats: { colors: true },
  hot: true
}

let https = false
const keyPath = process.env.HTTPS_KEY
const certPath = process.env.HTTPS_CERT // HTTPS_CA not needed

if (keyPath && certPath) {
  https = true
  wdsConfig.https = {
    key: fs.readFileSync(process.env.HTTPS_KEY),
    cert: fs.readFileSync(process.env.HTTPS_CERT)
  }
}

const devServer = new WebpackDevServer(webpack(config), wdsConfig)

console.log(`Webpack dev server listening on ${devPort}, ${https ? 'https' : 'http'}`)
devServer.listen(devPort, 'localhost')


text:
#ifndef __POK_USER_GENERATED_DEPLOYMENT_H_
#define __POK_USER_GENERATED_DEPLOYMENT_H_

#define POK_NEEDS_TIME 1
#define POK_NEEDS_THREADS 2

#define POK_NEEDS_PARTITIONS 1
#define POK_NEEDS_SCHED 1
#define POK_NEEDS_DEBUG 1
#define POK_NEEDS_CONSOLE 1

#define POK_NEEDS_MIDDLEWARE 1
#define POK_NEEDS_BLACKBOARDS 1

#define POK_CONFIG_NB_BLACKBOARDS 1

#define POK_CONFIG_NB_THREADS 2

#endif


text:
#pragma once
#include <aws/wisdom/ConnectWisdomService_EXPORTS.h>
#include <aws/wisdom/ConnectWisdomServiceRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <utility>

namespace Aws
{
namespace ConnectWisdomService
{
namespace Model
{

  /**
   */
  class AWS_CONNECTWISDOMSERVICE_API UpdateContentRequest : public ConnectWisdomServiceRequest
  {
  public:
    UpdateContentRequest();

    // Service request name is the Operation name which will send this request out,
    // each operation should has unique request name, so that we can get operation's name from this request.
    // Note: this is not true for response, multiple operations may have the same response name,
    // so we can not get operation's name from response.
    inline virtual const char* GetServiceRequestName() const override { return "UpdateContent"; }

    Aws::String SerializePayload() const override;

    /**
     *
The identifier of the content. Can be either the ID or the ARN. URLs cannot
     * contain the ARN.

     */
    inline const Aws::String& GetContentId() const{ return m_contentId; }

    /**
     *
The identifier of the content. Can be either the ID or the ARN. URLs cannot
     * contain the ARN.

     */
    inline bool ContentIdHasBeenSet() const { return m_contentIdHasBeenSet; }

    /**
     *
The identifier of the content. Can be either the ID or the ARN. URLs cannot
     * contain the ARN.

     */
    inline void SetContentId(const Aws::String& value) { m_contentIdHasBeenSet = true; m_contentId = value; }

    /**
     *
The identifier of the content. Can be either the ID or the ARN. URLs cannot
     * contain the ARN.

     */
    inline void SetContentId(Aws::String&& value) { m_contentIdHasBeenSet = true; m_contentId = std::move(value); }

    /**
     *
The identifier of the content. Can be either the ID or the ARN. URLs cannot
     * contain the ARN.

     */
    inline void SetContentId(const char* value) { m_contentIdHasBeenSet = true; m_contentId.assign(value); }

    /**
     *
The identifier of the content. Can be either the ID or the ARN. URLs cannot
     * contain the ARN.

     */
    inline UpdateContentRequest& WithContentId(const Aws::String& value) { SetContentId(value); return *this;}

    /**
     *
The identifier of the content. Can be either the ID or the ARN. URLs cannot
     * contain the ARN.

     */
    inline UpdateContentRequest& WithContentId(Aws::String&& value) { SetContentId(std::move(value)); return *this;}

    /**
     *
The identifier of the content. Can be either the ID or the ARN. URLs cannot
     * contain the ARN.

     */
    inline UpdateContentRequest& WithContentId(const char* value) { SetContentId(value); return *this;}

    /**
     *
The identifier of the knowledge base. Can be either the ID or the ARN

     */
    inline const Aws::String& GetKnowledgeBaseId() const{ return m_knowledgeBaseId; }

    /**
     *
The identifier of the knowledge base. Can be either the ID or the ARN

     */
    inline bool KnowledgeBaseIdHasBeenSet() const { return m_knowledgeBaseIdHasBeenSet; }

    /**
     *
The identifier of the knowledge base. Can be either the ID or the ARN

     */
    inline void SetKnowledgeBaseId(const Aws::String& value) { m_knowledgeBaseIdHasBeenSet = true; m_knowledgeBaseId = value; }

    /**
     *
The identifier of the knowledge base. Can be either the ID or the ARN

     */
    inline void SetKnowledgeBaseId(Aws::String&& value) { m_knowledgeBaseIdHasBeenSet = true; m_knowledgeBaseId = std::move(value); }

    /**
     *
The identifier of the knowledge base. Can be either the ID or the ARN

     */
    inline void SetKnowledgeBaseId(const char* value) { m_knowledgeBaseIdHasBeenSet = true; m_knowledgeBaseId.assign(value); }

    /**
     *
The identifier of the knowledge base. Can be either the ID or the ARN

     */
    inline UpdateContentRequest& WithKnowledgeBaseId(const Aws::String& value) { SetKnowledgeBaseId(value); return *this;}

    /**
     *
The identifier of the knowledge base. Can be either the ID or the ARN

     */
    inline UpdateContentRequest& WithKnowledgeBaseId(Aws::String&& value) { SetKnowledgeBaseId(std::move(value)); return *this;}

    /**
     *
The identifier of the knowledge base. Can be either the ID or the ARN

     */
    inline UpdateContentRequest& WithKnowledgeBaseId(const char* value) { SetKnowledgeBaseId(value); return *this;}

    /**
     *
A key/value map to store attributes without affecting tagging or
     * recommendations. For example, when synchronizing data between an external system
     * and Wisdom, you can store an external version identifier as metadata to utilize
     * for determining drift.

     */
    inline const Aws::Map<Aws::String, Aws::String>& GetMetadata() const{ return m_metadata; }

    /**
     *
A key/value map to store attributes without affecting tagging or
     * recommendations. For example, when synchronizing data between an external system
     * and Wisdom, you can store an external version identifier as metadata to utilize
     * for determining drift.

     */
    inline bool MetadataHasBeenSet() const { return m_metadataHasBeenSet; }

    /**
     *
A key/value map to store attributes without affecting tagging or
     * recommendations. For example, when synchronizing data between an external system
     * and Wisdom, you can store an external version identifier as metadata to utilize
     * for determining drift.

     */
    inline void SetMetadata(const Aws::Map<Aws::String, Aws::String>& value) { m_metadataHasBeenSet = true; m_metadata = value; }

    /**
     *
A key/value map to store attributes without affecting tagging or
     * recommendations. For example, when synchronizing data between an external system
     * and Wisdom, you can store an external version identifier as metadata to utilize
     * for determining drift.

     */
    inline void SetMetadata(Aws::Map<Aws::String, Aws::String>&& value) { m_metadataHasBeenSet = true; m_metadata = std::move(value); }

    /**
     *
A key/value map to store attributes without affecting tagging or
     * recommendations. For example, when synchronizing data between an external system
     * and Wisdom, you can store an external version identifier as metadata to utilize
     * for determining drift.

     */
    inline UpdateContentRequest& WithMetadata(const Aws::Map<Aws::String, Aws::String>& value) { SetMetadata(value); return *this;}

    /**
     *
A key/value map to store attributes without affecting tagging or
     * recommendations. For example, when synchronizing data between an external system
     * and Wisdom, you can store an external version identifier as metadata to utilize
     * for determining drift.

     */
    inline UpdateContentRequest& WithMetadata(Aws::Map<Aws::String, Aws::String>&& value) { SetMetadata(std::move(value)); return *this;}

    /**
     *
A key/value map to store attributes without affecting tagging or
     * recommendations. For example, when synchronizing data between an external system
     * and Wisdom, you can store an external version identifier as metadata to utilize
     * for determining drift.

     */
    inline UpdateContentRequest& AddMetadata(const Aws::String& key, const Aws::String& value) { m_metadataHasBeenSet = true; m_metadata.emplace(key, value); return *this; }

    /**
     *
A key/value map to store attributes without affecting tagging or
     * recommendations. For example, when synchronizing data between an external system
     * and Wisdom, you can store an external version identifier as metadata to utilize
     * for determining drift.

     */
    inline UpdateContentRequest& AddMetadata(Aws::String&& key, const Aws::String& value) { m_metadataHasBeenSet = true; m_metadata.emplace(std::move(key), value); return *this; }

    /**
     *
A key/value map to store attributes without affecting tagging or
     * recommendations. For example, when synchronizing data between an external system
     * and Wisdom, you can store an external version identifier as metadata to utilize
     * for determining drift.

     */
    inline UpdateContentRequest& AddMetadata(const Aws::String& key, Aws::String&& value) { m_metadataHasBeenSet = true; m_metadata.emplace(key, std::move(value)); return *this; }

    /**
     *
A key/value map to store attributes without affecting tagging or
     * recommendations. For example, when synchronizing data between an external system
     * and Wisdom, you can store an external version identifier as metadata to utilize
     * for determining drift.

     */
    inline UpdateContentRequest& AddMetadata(Aws::String&& key, Aws::String&& value) { m_metadataHasBeenSet = true; m_metadata.emplace(std::move(key), std::move(value)); return *this; }

    /**
     *
A key/value map to store attributes without affecting tagging or
     * recommendations. For example, when synchronizing data between an external system
     * and Wisdom, you can store an external version identifier as metadata to utilize
     * for determining drift.

     */
    inline UpdateContentRequest& AddMetadata(const char* key, Aws::String&& value) { m_metadataHasBeenSet = true; m_metadata.emplace(key, std::move(value)); return *this; }

    /**
     *
A key/value map to store attributes without affecting tagging or
     * recommendations. For example, when synchronizing data between an external system
     * and Wisdom, you can store an external version identifier as metadata to utilize
     * for determining drift.

     */
    inline UpdateContentRequest& AddMetadata(Aws::String&& key, const char* value) { m_metadataHasBeenSet = true; m_metadata.emplace(std::move(key), value); return *this; }

    /**
     *
A key/value map to store attributes without affecting tagging or
     * recommendations. For example, when synchronizing data between an external system
     * and Wisdom, you can store an external version identifier as metadata to utilize
     * for determining drift.

     */
    inline UpdateContentRequest& AddMetadata(const char* key, const char* value) { m_metadataHasBeenSet = true; m_metadata.emplace(key, value); return *this; }

    /**
     *
The URI for the article. If the knowledge base has a templateUri, setting
     * this argument overrides it for this piece of content. To remove an existing
     * overrideLinkOurUri, exclude this argument and set
     * removeOverrideLinkOutUri to true.

     */
    inline const Aws::String& GetOverrideLinkOutUri() const{ return m_overrideLinkOutUri; }

    /**
     *
The URI for the article. If the knowledge base has a templateUri, setting
     * this argument overrides it for this piece of content. To remove an existing
     * overrideLinkOurUri, exclude this argument and set
     * removeOverrideLinkOutUri to true.

     */
    inline bool OverrideLinkOutUriHasBeenSet() const { return m_overrideLinkOutUriHasBeenSet; }

    /**
     *
The URI for the article. If the knowledge base has a templateUri, setting
     * this argument overrides it for this piece of content. To remove an existing
     * overrideLinkOurUri, exclude this argument and set
     * removeOverrideLinkOutUri to true.

     */
    inline void SetOverrideLinkOutUri(const Aws::String& value) { m_overrideLinkOutUriHasBeenSet = true; m_overrideLinkOutUri = value; }

    /**
     *
The URI for the article. If the knowledge base has a templateUri, setting
     * this argument overrides it for this piece of content. To remove an existing
     * overrideLinkOurUri, exclude this argument and set
     * removeOverrideLinkOutUri to true.

     */
    inline void SetOverrideLinkOutUri(Aws::String&& value) { m_overrideLinkOutUriHasBeenSet = true; m_overrideLinkOutUri = std::move(value); }

    /**
     *
The URI for the article. If the knowledge base has a templateUri, setting
     * this argument overrides it for this piece of content. To remove an existing
     * overrideLinkOurUri, exclude this argument and set
     * removeOverrideLinkOutUri to true.

     */
    inline void SetOverrideLinkOutUri(const char* value) { m_overrideLinkOutUriHasBeenSet = true; m_overrideLinkOutUri.assign(value); }

    /**
     *
The URI for the article. If the knowledge base has a templateUri, setting
     * this argument overrides it for this piece of content. To remove an existing
     * overrideLinkOurUri, exclude this argument and set
     * removeOverrideLinkOutUri to true.

     */
    inline UpdateContentRequest& WithOverrideLinkOutUri(const Aws::String& value) { SetOverrideLinkOutUri(value); return *this;}

    /**
     *
The URI for the article. If the knowledge base has a templateUri, setting
     * this argument overrides it for this piece of content. To remove an existing
     * overrideLinkOurUri, exclude this argument and set
     * removeOverrideLinkOutUri to true.

     */
    inline UpdateContentRequest& WithOverrideLinkOutUri(Aws::String&& value) { SetOverrideLinkOutUri(std::move(value)); return *this;}

    /**
     *
The URI for the article. If the knowledge base has a templateUri, setting
     * this argument overrides it for this piece of content. To remove an existing
     * overrideLinkOurUri, exclude this argument and set
     * removeOverrideLinkOutUri to true.

     */
    inline UpdateContentRequest& WithOverrideLinkOutUri(const char* value) { SetOverrideLinkOutUri(value); return *this;}

    /**
     *
Unset the existing overrideLinkOutUri if it exists.

     */
    inline bool GetRemoveOverrideLinkOutUri() const{ return m_removeOverrideLinkOutUri; }

    /**
     *
Unset the existing overrideLinkOutUri if it exists.

     */
    inline bool RemoveOverrideLinkOutUriHasBeenSet() const { return m_removeOverrideLinkOutUriHasBeenSet; }

    /**
     *
Unset the existing overrideLinkOutUri if it exists.

     */
    inline void SetRemoveOverrideLinkOutUri(bool value) { m_removeOverrideLinkOutUriHasBeenSet = true; m_removeOverrideLinkOutUri = value; }

    /**
     *
Unset the existing overrideLinkOutUri if it exists.

     */
    inline UpdateContentRequest& WithRemoveOverrideLinkOutUri(bool value) { SetRemoveOverrideLinkOutUri(value); return *this;}

    /**
     *
The revisionId of the content resource to update, taken from an
     * earlier call to GetContent, GetContentSummary,
     * SearchContent, or ListContents. If included, this
     * argument acts as an optimistic lock to ensure content was not modified since it
     * was last read. If it has been modified, this API throws a
     * PreconditionFailedException.

     */
    inline const Aws::String& GetRevisionId() const{ return m_revisionId; }

    /**
     *
The revisionId of the content resource to update, taken from an
     * earlier call to GetContent, GetContentSummary,
     * SearchContent, or ListContents. If included, this
     * argument acts as an optimistic lock to ensure content was not modified since it
     * was last read. If it has been modified, this API throws a
     * PreconditionFailedException.

     */
    inline bool RevisionIdHasBeenSet() const { return m_revisionIdHasBeenSet; }

    /**
     *
The revisionId of the content resource to update, taken from an
     * earlier call to GetContent, GetContentSummary,
     * SearchContent, or ListContents. If included, this
     * argument acts as an optimistic lock to ensure content was not modified since it
     * was last read. If it has been modified, this API throws a
     * PreconditionFailedException.

     */
    inline void SetRevisionId(const Aws::String& value) { m_revisionIdHasBeenSet = true; m_revisionId = value; }

    /**
     *
The revisionId of the content resource to update, taken from an
     * earlier call to GetContent, GetContentSummary,
     * SearchContent, or ListContents. If included, this
     * argument acts as an optimistic lock to ensure content was not modified since it
     * was last read. If it has been modified, this API throws a
     * PreconditionFailedException.

     */
    inline void SetRevisionId(Aws::String&& value) { m_revisionIdHasBeenSet = true; m_revisionId = std::move(value); }

    /**
     *
The revisionId of the content resource to update, taken from an
     * earlier call to GetContent, GetContentSummary,
     * SearchContent, or ListContents. If included, this
     * argument acts as an optimistic lock to ensure content was not modified since it
     * was last read. If it has been modified, this API throws a
     * PreconditionFailedException.

     */
    inline void SetRevisionId(const char* value) { m_revisionIdHasBeenSet = true; m_revisionId.assign(value); }

    /**
     *
The revisionId of the content resource to update, taken from an
     * earlier call to GetContent, GetContentSummary,
     * SearchContent, or ListContents. If included, this
     * argument acts as an optimistic lock to ensure content was not modified since it
     * was last read. If it has been modified, this API throws a
     * PreconditionFailedException.

     */
    inline UpdateContentRequest& WithRevisionId(const Aws::String& value) { SetRevisionId(value); return *this;}

    /**
     *
The revisionId of the content resource to update, taken from an
     * earlier call to GetContent, GetContentSummary,
     * SearchContent, or ListContents. If included, this
     * argument acts as an optimistic lock to ensure content was not modified since it
     * was last read. If it has been modified, this API throws a
     * PreconditionFailedException.

     */
    inline UpdateContentRequest& WithRevisionId(Aws::String&& value) { SetRevisionId(std::move(value)); return *this;}

    /**
     *
The revisionId of the content resource to update, taken from an
     * earlier call to GetContent, GetContentSummary,
     * SearchContent, or ListContents. If included, this
     * argument acts as an optimistic lock to ensure content was not modified since it
     * was last read. If it has been modified, this API throws a
     * PreconditionFailedException.

     */
    inline UpdateContentRequest& WithRevisionId(const char* value) { SetRevisionId(value); return *this;}

    /**
     *
The title of the content.

     */
    inline const Aws::String& GetTitle() const{ return m_title; }

    /**
     *
The title of the content.

     */
    inline bool TitleHasBeenSet() const { return m_titleHasBeenSet; }

    /**
     *
The title of the content.

     */
    inline void SetTitle(const Aws::String& value) { m_titleHasBeenSet = true; m_title = value; }

    /**
     *
The title of the content.

     */
    inline void SetTitle(Aws::String&& value) { m_titleHasBeenSet = true; m_title = std::move(value); }

    /**
     *
The title of the content.

     */
    inline void SetTitle(const char* value) { m_titleHasBeenSet = true; m_title.assign(value); }

    /**
     *
The title of the content.

     */
    inline UpdateContentRequest& WithTitle(const Aws::String& value) { SetTitle(value); return *this;}

    /**
     *
The title of the content.

     */
    inline UpdateContentRequest& WithTitle(Aws::String&& value) { SetTitle(std::move(value)); return *this;}

    /**
     *
The title of the content.

     */
    inline UpdateContentRequest& WithTitle(const char* value) { SetTitle(value); return *this;}

    /**
     *
A pointer to the uploaded asset. This value is returned by StartContentUpload.
     *

     */
    inline const Aws::String& GetUploadId() const{ return m_uploadId; }

    /**
     *
A pointer to the uploaded asset. This value is returned by StartContentUpload.
     *

     */
    inline bool UploadIdHasBeenSet() const { return m_uploadIdHasBeenSet; }

    /**
     *
A pointer to the uploaded asset. This value is returned by StartContentUpload.
     *

     */
    inline void SetUploadId(const Aws::String& value) { m_uploadIdHasBeenSet = true; m_uploadId = value; }

    /**
     *
A pointer to the uploaded asset. This value is returned by StartContentUpload.
     *

     */
    inline void SetUploadId(Aws::String&& value) { m_uploadIdHasBeenSet = true; m_uploadId = std::move(value); }

    /**
     *
A pointer to the uploaded asset. This value is returned by StartContentUpload.
     *

     */
    inline void SetUploadId(const char* value) { m_uploadIdHasBeenSet = true; m_uploadId.assign(value); }

    /**
     *
A pointer to the uploaded asset. This value is returned by StartContentUpload.
     *

     */
    inline UpdateContentRequest& WithUploadId(const Aws::String& value) { SetUploadId(value); return *this;}

    /**
     *
A pointer to the uploaded asset. This value is returned by StartContentUpload.
     *

     */
    inline UpdateContentRequest& WithUploadId(Aws::String&& value) { SetUploadId(std::move(value)); return *this;}

    /**
     *
A pointer to the uploaded asset. This value is returned by StartContentUpload.
     *

     */
    inline UpdateContentRequest& WithUploadId(const char* value) { SetUploadId(value); return *this;}

  private:

    Aws::String m_contentId;
    bool m_contentIdHasBeenSet;

    Aws::String m_knowledgeBaseId;
    bool m_knowledgeBaseIdHasBeenSet;

    Aws::Map<Aws::String, Aws::String> m_metadata;
    bool m_metadataHasBeenSet;

    Aws::String m_overrideLinkOutUri;
    bool m_overrideLinkOutUriHasBeenSet;

    bool m_removeOverrideLinkOutUri;
    bool m_removeOverrideLinkOutUriHasBeenSet;

    Aws::String m_revisionId;
    bool m_revisionIdHasBeenSet;

    Aws::String m_title;
    bool m_titleHasBeenSet;

    Aws::String m_uploadId;
    bool m_uploadIdHasBeenSet;
  };

} // namespace Model
} // namespace ConnectWisdomService
} // namespace Aws


text:
import * as nls from 'vs/nls';
import { onUnexpectedError } from 'vs/base/common/errors';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import Severity from 'vs/base/common/severity';
import { EXTENSION_IDENTIFIER_PATTERN } from 'vs/platform/extensionManagement/common/extensionManagement';
import { Extensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry';
import { Registry } from 'vs/platform/registry/common/platform';
import { IExtensionDescription, IMessage } from 'vs/workbench/services/extensions/common/extensions';

const hasOwnProperty = Object.hasOwnProperty;
const schemaRegistry = Registry.as<IJSONContributionRegistry>(Extensions.JSONContribution);

export class ExtensionMessageCollector {

	private readonly _messageHandler: (msg: IMessage) => void;
	private readonly _extension: IExtensionDescription;
	private readonly _extensionPointId: string;

	constructor(
		messageHandler: (msg: IMessage) => void,
		extension: IExtensionDescription,
		extensionPointId: string
	) {
		this._messageHandler = messageHandler;
		this._extension = extension;
		this._extensionPointId = extensionPointId;
	}

	private _msg(type: Severity, message: string): void {
		this._messageHandler({
			type: type,
			message: message,
			extensionId: this._extension.id,
			extensionPointId: this._extensionPointId
		});
	}

	public error(message: string): void {
		this._msg(Severity.Error, message);
	}

	public warn(message: string): void {
		this._msg(Severity.Warning, message);
	}

	public info(message: string): void {
		this._msg(Severity.Info, message);
	}
}

export interface IExtensionPointUser<T> {
	description: IExtensionDescription;
	value: T;
	collector: ExtensionMessageCollector;
}

export interface IExtensionPointHandler<T> {
	(extensions: IExtensionPointUser<T>[]): void;
}

export interface IExtensionPoint<T> {
	name: string;
	setHandler(handler: IExtensionPointHandler<T>): void;
}

export class ExtensionPoint<T> implements IExtensionPoint<T> {

	public readonly name: string;
	public readonly isDynamic: boolean;

	private _handler: IExtensionPointHandler<T> | null;
	private _handlerCalled: boolean;
	private _users: IExtensionPointUser<T>[] | null;

	constructor(name: string, isDynamic: boolean) {
		this.name = name;
		this.isDynamic = isDynamic;
		this._handler = null;
		this._handlerCalled = false;
		this._users = null;
	}

	setHandler(handler: IExtensionPointHandler<T>): void {
		if (this._handler !== null) {
			throw new Error('Handler already set!');
		}
		this._handler = handler;
		this._handle();
	}

	acceptUsers(users: IExtensionPointUser<T>[]): void {
		this._users = users;
		this._handle();
	}

	private _handle(): void {
		if (this._handler === null || this._users === null) {
			return;
		}

		let users = this._users;
		this._users = null;

		if (this._handlerCalled && !this.isDynamic) {
			throw new Error('The extension point is not dynamic!');
		}

		try {
			this._handlerCalled = true;
			this._handler(users);
		} catch (err) {
			onUnexpectedError(err);
		}
	}
}

const schemaId = 'vscode://schemas/vscode-extensions';
export const schema = {
	properties: {
		engines: {
			type: 'object',
			description: nls.localize('vscode.extension.engines', "Engine compatibility."),
			properties: {
				'vscode': {
					type: 'string',
					description: nls.localize('vscode.extension.engines.vscode', 'For VS Code extensions, specifies the VS Code version that the extension is compatible with. Cannot be *. For example: ^0.10.5 indicates compatibility with a minimum VS Code version of 0.10.5.'),
					default: '^1.22.0',
				}
			}
		},
		publisher: {
			description: nls.localize('vscode.extension.publisher', 'The publisher of the VS Code extension.'),
			type: 'string'
		},
		displayName: {
			description: nls.localize('vscode.extension.displayName', 'The display name for the extension used in the VS Code gallery.'),
			type: 'string'
		},
		categories: {
			description: nls.localize('vscode.extension.categories', 'The categories used by the VS Code gallery to categorize the extension.'),
			type: 'array',
			uniqueItems: true,
			items: {
				oneOf: [{
					type: 'string',
					enum: ['Programming Languages', 'Snippets', 'Linters', 'Themes', 'Debuggers', 'Other', 'Keymaps', 'Formatters', 'Extension Packs', 'SCM Providers', 'Azure', 'Language Packs'],
				},
				{
					type: 'string',
					const: 'Languages',
					deprecationMessage: nls.localize('vscode.extension.category.languages.deprecated', 'Use \'Programming  Languages\' instead'),
				}]
			}
		},
		galleryBanner: {
			type: 'object',
			description: nls.localize('vscode.extension.galleryBanner', 'Banner used in the VS Code marketplace.'),
			properties: {
				color: {
					description: nls.localize('vscode.extension.galleryBanner.color', 'The banner color on the VS Code marketplace page header.'),
					type: 'string'
				},
				theme: {
					description: nls.localize('vscode.extension.galleryBanner.theme', 'The color theme for the font used in the banner.'),
					type: 'string',
					enum: ['dark', 'light']
				}
			}
		},
		contributes: {
			description: nls.localize('vscode.extension.contributes', 'All contributions of the VS Code extension represented by this package.'),
			type: 'object',
			properties: {
				// extensions will fill in
			},
			default: {}
		},
		preview: {
			type: 'boolean',
			description: nls.localize('vscode.extension.preview', 'Sets the extension to be flagged as a Preview in the Marketplace.'),
		},
		activationEvents: {
			description: nls.localize('vscode.extension.activationEvents', 'Activation events for the VS Code extension.'),
			type: 'array',
			items: {
				type: 'string',
				defaultSnippets: [
					{
						label: 'onLanguage',
						description: nls.localize('vscode.extension.activationEvents.onLanguage', 'An activation event emitted whenever a file that resolves to the specified language gets opened.'),
						body: 'onLanguage:${1:languageId}'
					},
					{
						label: 'onCommand',
						description: nls.localize('vscode.extension.activationEvents.onCommand', 'An activation event emitted whenever the specified command gets invoked.'),
						body: 'onCommand:${2:commandId}'
					},
					{
						label: 'onDebug',
						description: nls.localize('vscode.extension.activationEvents.onDebug', 'An activation event emitted whenever a user is about to start debugging or about to setup debug configurations.'),
						body: 'onDebug'
					},
					{
						label: 'onDebugInitialConfigurations',
						description: nls.localize('vscode.extension.activationEvents.onDebugInitialConfigurations', 'An activation event emitted whenever a "launch.json" needs to be created (and all provideDebugConfigurations methods need to be called).'),
						body: 'onDebugInitialConfigurations'
					},
					{
						label: 'onDebugResolve',
						description: nls.localize('vscode.extension.activationEvents.onDebugResolve', 'An activation event emitted whenever a debug session with the specific type is about to be launched (and a corresponding resolveDebugConfiguration method needs to be called).'),
						body: 'onDebugResolve:${6:type}'
					},
					{
						label: 'onDebugAdapterProtocolTracker',
						description: nls.localize('vscode.extension.activationEvents.onDebugAdapterProtocolTracker', 'An activation event emitted whenever a debug session with the specific type is about to be launched and a debug protocol tracker might be needed.'),
						body: 'onDebugAdapterProtocolTracker:${6:type}'
					},
					{
						label: 'workspaceContains',
						description: nls.localize('vscode.extension.activationEvents.workspaceContains', 'An activation event emitted whenever a folder is opened that contains at least a file matching the specified glob pattern.'),
						body: 'workspaceContains:${4:filePattern}'
					},
					{
						label: 'onFileSystem',
						description: nls.localize('vscode.extension.activationEvents.onFileSystem', 'An activation event emitted whenever a file or folder is accessed with the given scheme.'),
						body: 'onFileSystem:${1:scheme}'
					},
					{
						label: 'onSearch',
						description: nls.localize('vscode.extension.activationEvents.onSearch', 'An activation event emitted whenever a search is started in the folder with the given scheme.'),
						body: 'onSearch:${7:scheme}'
					},
					{
						label: 'onView',
						body: 'onView:${5:viewId}',
						description: nls.localize('vscode.extension.activationEvents.onView', 'An activation event emitted whenever the specified view is expanded.'),
					},
					{
						label: 'onUri',
						body: 'onUri',
						description: nls.localize('vscode.extension.activationEvents.onUri', 'An activation event emitted whenever a system-wide Uri directed towards this extension is open.'),
					},
					{
						label: '*',
						description: nls.localize('vscode.extension.activationEvents.star', 'An activation event emitted on VS Code startup. To ensure a great end user experience, please use this activation event in your extension only when no other activation events combination works in your use-case.'),
						body: '*'
					}
				],
			}
		},
		badges: {
			type: 'array',
			description: nls.localize('vscode.extension.badges', 'Array of badges to display in the sidebar of the Marketplace\'s extension page.'),
			items: {
				type: 'object',
				required: ['url', 'href', 'description'],
				properties: {
					url: {
						type: 'string',
						description: nls.localize('vscode.extension.badges.url', 'Badge image URL.')
					},
					href: {
						type: 'string',
						description: nls.localize('vscode.extension.badges.href', 'Badge link.')
					},
					description: {
						type: 'string',
						description: nls.localize('vscode.extension.badges.description', 'Badge description.')
					}
				}
			}
		},
		markdown: {
			type: 'string',
			description: nls.localize('vscode.extension.markdown', "Controls the Markdown rendering engine used in the Marketplace. Either github (default) or standard."),
			enum: ['github', 'standard'],
			default: 'github'
		},
		qna: {
			default: 'marketplace',
			description: nls.localize('vscode.extension.qna', "Controls the Q&A link in the Marketplace. Set to marketplace to enable the default Marketplace Q & A site. Set to a string to provide the URL of a custom Q & A site. Set to false to disable Q & A altogether."),
			anyOf: [
				{
					type: ['string', 'boolean'],
					enum: ['marketplace', false]
				},
				{
					type: 'string'
				}
			]
		},
		extensionDependencies: {
			description: nls.localize('vscode.extension.extensionDependencies', 'Dependencies to other extensions. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp.'),
			type: 'array',
			uniqueItems: true,
			items: {
				type: 'string',
				pattern: EXTENSION_IDENTIFIER_PATTERN
			}
		},
		extensionPack: {
			description: nls.localize('vscode.extension.contributes.extensionPack', "A set of extensions that can be installed together. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp."),
			type: 'array',
			uniqueItems: true,
			items: {
				type: 'string',
				pattern: EXTENSION_IDENTIFIER_PATTERN
			}
		},
		scripts: {
			type: 'object',
			properties: {
				'vscode:prepublish': {
					description: nls.localize('vscode.extension.scripts.prepublish', 'Script executed before the package is published as a VS Code extension.'),
					type: 'string'
				},
				'vscode:uninstall': {
					description: nls.localize('vscode.extension.scripts.uninstall', 'Uninstall hook for VS Code extension. Script that gets executed when the extension is completely uninstalled from VS Code which is when VS Code is restarted (shutdown and start) after the extension is uninstalled. Only Node scripts are supported.'),
					type: 'string'
				}
			}
		},
		icon: {
			type: 'string',
			description: nls.localize('vscode.extension.icon', 'The path to a 128x128 pixel icon.')
		}
	}
};

export interface IExtensionPointDescriptor {
	isDynamic?: boolean;
	extensionPoint: string;
	deps?: IExtensionPoint<any>[];
	jsonSchema: IJSONSchema;
}

export class ExtensionsRegistryImpl {

	private _extensionPoints: { [extPoint: string]: ExtensionPoint<any>; };

	constructor() {
		this._extensionPoints = {};
	}

	public registerExtensionPoint<T>(desc: IExtensionPointDescriptor): IExtensionPoint<T> {
		if (hasOwnProperty.call(this._extensionPoints, desc.extensionPoint)) {
			throw new Error('Duplicate extension point: ' + desc.extensionPoint);
		}
		let result = new ExtensionPoint<T>(desc.extensionPoint, desc.isDynamic || false);
		this._extensionPoints[desc.extensionPoint] = result;

		schema.properties['contributes'].properties[desc.extensionPoint] = desc.jsonSchema;
		schemaRegistry.registerSchema(schemaId, schema);

		return result;
	}

	public getExtensionPoints(): ExtensionPoint<any>[] {
		return Object.keys(this._extensionPoints).map(point => this._extensionPoints[point]);
	}

	public getExtensionPointsMap(): { [extPoint: string]: ExtensionPoint<any>; } {
		return this._extensionPoints;
	}
}

const PRExtensions = {
	ExtensionsRegistry: 'ExtensionsRegistry'
};
Registry.add(PRExtensions.ExtensionsRegistry, new ExtensionsRegistryImpl());
export const ExtensionsRegistry: ExtensionsRegistryImpl = Registry.as(PRExtensions.ExtensionsRegistry);

schemaRegistry.registerSchema(schemaId, schema);


text:
import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
import { bindActionCreators } from 'redux'
import cx from 'classnames'
import * as PopupActions from '../../actions/popup'
import * as CombineActions from '../../actions/combine'
import { popupMethodToCode } from '../../utils/apicode'

class SelfArticleMenu extends Component {
  constructor(props) {
    super(props)
    this.deletePostPopup = this.deletePostPopup.bind(this)
    this.editformOpen = this.editformOpen.bind(this)
  }
  deletePostPopup(e) {
    // 若有 popup 的操作,都需要提供 popupCode
    const { id } = this.props
    const code = popupMethodToCode[e.target.className]
    const deletePostPopup = { code, id }
    this.props.popup.popupRequest(deletePostPopup)
  }
  editformOpen(e) {
    // edit 不會出現 popup,所以不需要提供 code
    const { id, title, content } = this.props
    this.props.combine.editformOpen({ id, title, content })
  }
  render() {
    const { show } = this.props
    return (

        Edit
        Delete

    )
  }
}

SelfArticleMenu.propTypes = {
  show: PropTypes.bool.isRequired,
  id: PropTypes.string.isRequired,
  title: PropTypes.string.isRequired,
  content: PropTypes.string.isRequired,
}

const mapDispatchToProps = (dispatch) => {
  return {
    popup: bindActionCreators(PopupActions, dispatch),
    combine: bindActionCreators(CombineActions, dispatch),
  }
}

export default connect(null, mapDispatchToProps)(SelfArticleMenu)