text:
class AsmOffsets
{
    static_assert(sizeof(Thread::m_rgbAllocContextBuffer) >= sizeof(gc_alloc_context), "Thread::m_rgbAllocContextBuffer is not big enough to hold a gc_alloc_context");

    // Some assembly helpers for arrays and strings are shared and use the fact that arrays and strings have similar layouts)
    static_assert(offsetof(Array, m_Length) == offsetof(String, m_Length), "The length field of String and Array have different offsets");
    static_assert(sizeof(((Array*)0)->m_Length) == sizeof(((String*)0)->m_Length), "The length field of String and Array have different sizes");

#define PLAT_ASM_OFFSET(offset, cls, member) \
    static_assert((offsetof(cls, member) == 0x##offset) || (offsetof(cls, member) > 0x##offset), "Bad asm offset for '" #cls "." #member "', the actual offset is smaller than 0x" #offset "."); \
    static_assert((offsetof(cls, member) == 0x##offset) || (offsetof(cls, member) < 0x##offset), "Bad asm offset for '" #cls "." #member "', the actual offset is larger than 0x" #offset ".");

#define PLAT_ASM_SIZEOF(size,   cls        ) \
    static_assert((sizeof(cls) == 0x##size) || (sizeof(cls) > 0x##size), "Bad asm size for '" #cls "', the actual size is smaller than 0x" #size "."); \
    static_assert((sizeof(cls) == 0x##size) || (sizeof(cls) < 0x##size), "Bad asm size for '" #cls "', the actual size is larger than 0x" #size ".");

#define PLAT_ASM_CONST(constant, expr) \
    static_assert(((expr) == 0x##constant) || ((expr) > 0x##constant), "Bad asm constant for '" #expr "', the actual value is smaller than 0x" #constant "."); \
    static_assert(((expr) == 0x##constant) || ((expr) < 0x##constant), "Bad asm constant for '" #expr "', the actual value is larger than 0x" #constant ".");

#include "AsmOffsets.h"

};

#ifdef _MSC_VER
namespace { char WorkaroundLNK4221Warning; };
#endif


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
-->
<!DOCTYPE Test SYSTEM "test.dtd">
<Test
	ID="S_SoftReferenceTest_03"
	date-of-creation="2005-08-16"
	timeout="5"
	>
    <!--
    Author:  Alexander V. Esin
    Version: $Revision: 1.3 $
    -->
		<Copyright value="apache"/>
		<Author value="Alexander V. Esin"/>
		<APITestDescription>
			<TestedClass name="java.lang.ref.SoftReference"/>
			<TestedMethod name="public SoftReference(T referent)"/>
			<TestedMethod name="public T get()"/>

			<TestedClass name="java.lang.Throwable"/>
			<TestedMethod name="public String toString()"/>

			<Description>
				This tests SoftReference. 1.Create Objecs in a loop. Put into SoftReference by invoking ctor with 1 argument. 2.Create byte array and allocate a lost of memory in order to throw OutOfMemoryError. 3.Check if all SoftReferences' referents are cleared after exception thrown.
			</Description>
		</APITestDescription>

		<Keyword name="stress"/>
		<Source name="S_SoftReferenceTest_03.java"/>
		<Modification date="2005-08-16" author="Alexander V. Esin"/>

		<Runner ID="Runtime">
			<Param name="toRun" value="org.apache.harmony.test.stress.api.java.lang.ref.S_SoftReferenceTest_03.S_SoftReferenceTest_03"></Param>
		</Runner>
</Test>

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="Como configurar as chaves ssh para acessar seus servidores de forma mais segura">
  <meta name="generator" content="Hugo 0.25.1" />

  <title>SSH sem Senha · Cesar Gimenes</title>

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/pure-min.css">

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/grids-responsive-min.css">

  <link rel="stylesheet" href="http://crg.eti.br/css/side-menu.css">

  <link rel="stylesheet" href="http://crg.eti.br/css/blackburn.css">

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

  <link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet" type="text/css">

  <link rel="alternate" type="application/rss+xml" title="Cesar Gimenes" href="http://crg.eti.br/index.xml" />

  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/styles/default.min.css">

  <link rel="shortcut icon" href="http://crg.eti.br/img/favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon" href="http://crg.eti.br/img/apple-touch-icon.png" />
<link rel="apple-touch-icon" sizes="57x57" href="http://crg.eti.br/img/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="72x72" href="http://crg.eti.br/img/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="76x76" href="http://crg.eti.br/img/apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon" sizes="114x114" href="http://crg.eti.br/img/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon" sizes="120x120" href="http://crg.eti.br/img/apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon" sizes="144x144" href="http://crg.eti.br/img/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon" sizes="152x152" href="http://crg.eti.br/img/apple-touch-icon-152x152.png" />

  CRG

          Posts

          Sobre

          Taglines

          Home

      RSS

      Twitter

      Facebook

      Instagram

      LinkedIn

      GitHub

    Copyright (c) 2016, Cesar Gimenes; all rights reserved.

SSH sem Senha

Como configurar as chaves ssh para acessar seus servidores de forma mais segura

    <time>2016-07-02 08:19</time>

      Segurança

Acessar servidores via ssh usando um conjunto de chaves publica/privada é mais seguro e pratico principalmente alem de facilitar a automação de várias tarefas.

Criando as chaves

Primeiro crie as chaves com o seguinte comando:

mkdir ~/.ssh
ssh-keygen

Você só precisa fazer isso uma vez na maquina cliente.

Copiando a chave publica para o servidor

É necessário copiar a chave que acabamos de gerar para o arquivo ~/.ssh/authorized_keys no servidor. Uma forma fácil de fazer isso é usando o próprio SSH como no comando abaixo.

cat ~/.ssh/id_rsa.pub |
ssh voce@exemplo.com.br 'mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys'

Com isso criamos o diretório ~/.ssh no servidor caso ele já não existe e copiamos a chave para lá no arquivo ~/.ssh/authorized_keys, e essa foi a ultima vez que você precisou entrar com a senha. :D

Ainda mais pratico

Você pode parar no comando anterior, o servidor já esta aceitando suas conexões ssh sem pedir a senha porque estamos usando um conjunto de chaves publica/privada. Mas podemos tornar as coisas ainda mais fáceis.

Edite o arquivo ~/.ssh/config como no exemplo abaixo.

Host *
    ServerAliveInterval 240
    ConnectTimeout 0

Host exemplo
    HostName exemplo.com.br
    Port 22
    User voce
    ServerAliveInterval 100

Com isso você esta configurando o ssh para não desconectar por inatividade o que ajuda bastante quando se esta programando e é preciso ficar muito tempo indo e voltando entre seu terminal e outras ferramentas. Também estamos configurando o nome do usuário, a porta e um apelido para o servidor, dessa forma no lugar de digitar ssh voce@exemplo.com.br basta digitar ssh exemplo. Essa pequena economia de teclas faz toda diferença e também previne erros.

Segurança

Esse tipo de configuração é mais segura que usar apenas uma senha desde que você cuide bem do seu conjunto de chaves.

      HTTPS com Golang no Linux

      IPFS com Intel Edison

Please enable JavaScript to view the comments powered by Disqus.
comments powered by Disqus


text:
import { h, VNode } from "preact"
import { html } from "htm/preact"

import { box_double } from "../../../../../z_vendor/getto-css/preact/design/box"
import {
    field,
    label_password,
    label_password_fill,
    label_password_large,
    label_password_small,
    label_password_xLarge,
} from "../../../../../z_vendor/getto-css/preact/design/form"

import { FormProps } from "./container"
import { FormFooterComponent } from "./form_footer"

type Props = FormProps
export function PasswordBoxComponent(props: Props): VNode {
    const { action: component } = props

    function onInput() {
        component.inputValidValue(null)
    }

    return box_double({
        title: "password box",
        body: [
            field({
                title: "small",
                body: label_password_small(html`<input type="password" onInput=${onInput} />`),
                help: [],
            }),
            field({
                title: "default",
                body: label_password(html`<input type="password" onInput=${onInput} />`),
                help: [],
            }),
            field({
                title: "large",
                body: label_password_large(html`<input type="password" onInput=${onInput} />`),
                help: [],
            }),
            field({
                title: "extra large",
                body: label_password_xLarge(html`<input type="password" onInput=${onInput} />`),
                help: [],
            }),
            field({
                title: "fill",
                body: label_password_fill(html`<input type="password" onInput=${onInput} />`),
                help: [],
            }),
        ],
        footer: h(FormFooterComponent, props),
    })
}


text:
package com.facebook.drawee.drawable;

import android.annotation.TargetApi;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.os.Build;
import com.facebook.common.internal.Preconditions;
import javax.annotation.Nullable;

/**
 * A Drawable that contains an array of other Drawables (layers). These are drawn in array order,
 * so the element with the largest index will be drawn on top.
 *
 * <p>Similar to android's LayerDrawable but it doesn't support adding/removing layers dynamically.
 */
public class ArrayDrawable extends Drawable
    implements Drawable.Callback, TransformCallback, TransformAwareDrawable {

  private TransformCallback mTransformCallback;

  private final DrawableProperties mDrawableProperties = new DrawableProperties();

  // layers
  private final Drawable[] mLayers;
  // drawable parents for the layers (lazily created)
  private final DrawableParent[] mDrawableParents;

  // temp rect to avoid allocations
  private final Rect mTmpRect = new Rect();

  // Whether the drawable is stateful or not
  private boolean mIsStateful = false;
  private boolean mIsStatefulCalculated = false;

  private boolean mIsMutated = false;

  /**
   * Constructs a new layer drawable.
   * @param layers the layers that this drawable displays
   */
  public ArrayDrawable(Drawable[] layers) {
    Preconditions.checkNotNull(layers);
    mLayers = layers;
    for (int i = 0; i < mLayers.length; i++) {
      DrawableUtils.setCallbacks(mLayers[i], this, this);
    }
    mDrawableParents = new DrawableParent[mLayers.length];
  }

  /**
   * Gets the number of layers.
   * @return number of layers
   */
  public int getNumberOfLayers() {
    return mLayers.length;
  }

  /**
   * Gets the drawable at the specified index.
   * @param index index of drawable to get
   * @return drawable at the specified index
   */
  @Nullable
  public Drawable getDrawable(int index) {
    Preconditions.checkArgument(index >= 0);
    Preconditions.checkArgument(index < mLayers.length);
    return mLayers[index];
  }

  /** Sets a new drawable at the specified index, and return the previous drawable, if any. */
  @Nullable
  public Drawable setDrawable(int index, @Nullable Drawable drawable) {
    Preconditions.checkArgument(index >= 0);
    Preconditions.checkArgument(index < mLayers.length);
    final Drawable oldDrawable = mLayers[index];
    if (drawable != oldDrawable) {
      if (drawable != null && mIsMutated) {
        drawable.mutate();
      }

      DrawableUtils.setCallbacks(mLayers[index], null, null);
      DrawableUtils.setCallbacks(drawable, null, null);
      DrawableUtils.setDrawableProperties(drawable, mDrawableProperties);
      DrawableUtils.copyProperties(drawable, this);
      DrawableUtils.setCallbacks(drawable, this, this);
      mIsStatefulCalculated = false;
      mLayers[index] = drawable;
      invalidateSelf();
    }
    return oldDrawable;
  }

  @Override
  public int getIntrinsicWidth() {
    int width = -1;
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null) {
        width = Math.max(width, drawable.getIntrinsicWidth());
      }
    }
    return width > 0 ? width : -1;
  }

  @Override
  public int getIntrinsicHeight() {
    int height = -1;
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null) {
        height = Math.max(height, drawable.getIntrinsicHeight());
      }
    }
    return height > 0 ? height : -1;
  }

  @Override
  protected void onBoundsChange(Rect bounds) {
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null) {
        drawable.setBounds(bounds);
      }
    }
  }

  @Override
  public boolean isStateful() {
    if (!mIsStatefulCalculated) {
      mIsStateful = false;
      for (int i = 0; i < mLayers.length; i++) {
        Drawable drawable = mLayers[i];
        mIsStateful |= drawable != null && drawable.isStateful();
      }
      mIsStatefulCalculated = true;
    }
    return mIsStateful;
  }

  @Override
  protected boolean onStateChange(int[] state) {
    boolean stateChanged = false;
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null && drawable.setState(state)) {
        stateChanged = true;
      }
    }
    return stateChanged;
  }

  @Override
  protected boolean onLevelChange(int level) {
    boolean levelChanged = false;
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null && drawable.setLevel(level)) {
        levelChanged = true;
      }
    }
    return levelChanged;
  }

  @Override
  public void draw(Canvas canvas) {
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null) {
        drawable.draw(canvas);
      }
    }
  }

  @Override
  public boolean getPadding(Rect padding) {
    padding.left = 0;
    padding.top = 0;
    padding.right = 0;
    padding.bottom = 0;
    final Rect rect = mTmpRect;
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null) {
        drawable.getPadding(rect);
        padding.left = Math.max(padding.left, rect.left);
        padding.top = Math.max(padding.top, rect.top);
        padding.right = Math.max(padding.right, rect.right);
        padding.bottom = Math.max(padding.bottom, rect.bottom);
      }
    }
    return true;
  }

  @Override
  public Drawable mutate() {
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null) {
        drawable.mutate();
      }
    }
    mIsMutated = true;
    return this;
  }

  @Override
  public int getOpacity() {
    if (mLayers.length == 0) {
      return PixelFormat.TRANSPARENT;
    }
    int opacity = PixelFormat.OPAQUE;
    for (int i = 1; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null) {
        opacity = Drawable.resolveOpacity(opacity, drawable.getOpacity());
      }
    }
    return opacity;
  }

  @Override
  public void setAlpha(int alpha) {
    mDrawableProperties.setAlpha(alpha);
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null) {
        drawable.setAlpha(alpha);
      }
    }
  }

  @Override
  public void setColorFilter(ColorFilter colorFilter) {
    mDrawableProperties.setColorFilter(colorFilter);
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null) {
        drawable.setColorFilter(colorFilter);
      }
    }
  }

  @Override
  public void setDither(boolean dither) {
    mDrawableProperties.setDither(dither);
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null) {
        drawable.setDither(dither);
      }
    }
  }

  @Override
  public void setFilterBitmap(boolean filterBitmap) {
    mDrawableProperties.setFilterBitmap(filterBitmap);
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null) {
        drawable.setFilterBitmap(filterBitmap);
      }
    }
  }

  @Override
  public boolean setVisible(boolean visible, boolean restart) {
    boolean changed = super.setVisible(visible, restart);
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null) {
        drawable.setVisible(visible, restart);
      }
    }
    return changed;
  }

  /**
   * Gets the {@code DrawableParent} for index.
   */
  public DrawableParent getDrawableParentForIndex(int index) {
    Preconditions.checkArgument(index >= 0);
    Preconditions.checkArgument(index < mDrawableParents.length);
    if (mDrawableParents[index] == null) {
      mDrawableParents[index] = createDrawableParentForIndex(index);
    }
    return mDrawableParents[index];
  }

  private DrawableParent createDrawableParentForIndex(final int index) {
    return new DrawableParent() {
      @Override
      public Drawable setDrawable(Drawable newDrawable) {
        return ArrayDrawable.this.setDrawable(index, newDrawable);
      }

      @Override
      public Drawable getDrawable() {
        return ArrayDrawable.this.getDrawable(index);
      }
    };
  }

  /**
   * Drawable.Callback methods
   */

  @Override
  public void invalidateDrawable(Drawable who) {
    invalidateSelf();
  }

  @Override
  public void scheduleDrawable(Drawable who, Runnable what, long when) {
    scheduleSelf(what, when);
  }

  @Override
  public void unscheduleDrawable(Drawable who, Runnable what) {
    unscheduleSelf(what);
  }

  /**
   * TransformationCallbackSetter method
   */
  @Override
  public void setTransformCallback(TransformCallback transformCallback) {
    mTransformCallback = transformCallback;
  }

  /**
   * TransformationCallback methods
   */

  @Override
  public void getTransform(Matrix transform) {
    if (mTransformCallback != null) {
      mTransformCallback.getTransform(transform);
    } else {
      transform.reset();
    }
  }

  @Override
  public void getRootBounds(RectF bounds) {
    if (mTransformCallback != null) {
      mTransformCallback.getRootBounds(bounds);
    } else {
      bounds.set(getBounds());
    }
  }

  @Override
  @TargetApi(Build.VERSION_CODES.LOLLIPOP)
  public void setHotspot(float x, float y) {
    for (int i = 0; i < mLayers.length; i++) {
      Drawable drawable = mLayers[i];
      if (drawable != null) {
        drawable.setHotspot(x, y);
      }
    }
  }
}


text:
#include "config.h"
#include "RSS20Parser.h"

#include "BlackBerryPlatformAssert.h"
#include "libxml/parser.h"
#include "libxml/xmlwriter.h"

namespace WebCore {

RSS20Parser::RSS20Parser()
{
}

bool RSS20Parser::parseBuffer(const char* buffer, int length, const char* url, const char* encoding)
{
    return parseXmlDoc(xmlReadMemory(buffer, length, url, encoding, XML_PARSE_NOBLANKS | XML_PARSE_NONET));
}

bool RSS20Parser::parseXmlDoc(xmlDocPtr doc)
{
    if (!doc)
        return false;

    xmlNode* node = xmlDocGetRootElement(doc);
    if (!node) {
        xmlFreeDoc(doc);
        return false;
    }

    for (; node; node = node->next) {
        String name(reinterpret_cast<const char*>(node->name));
        name.makeLower();

        if (name == "rss") {
            xmlNode* channel = node->children;
            if (channel->type == XML_ELEMENT_NODE) {
                name = reinterpret_cast<const char*>(channel->name);
                name.makeLower();
                if (name == "channel")
                    m_root = parseFeed(channel->children);
            }
            break;
        }
    }

    xmlFreeDoc(doc);

    return m_root;
}

bool RSS20Parser::parseItemBaseAttribute(RSSItemBase* item, const String& name, xmlNode* node)
{
    if (name == "link")
        item->m_link = textFromXMLNode(node);
    else if (name == "title")
        item->m_title = textFromXMLNode(node);
    else if (name == "description")
        item->m_description = textFromXMLNode(node);
    else if (name == "pubdate")
        item->m_pubDate = textFromXMLNode(node);
    else
        return false;

    return true;
}

RSSItem* RSS20Parser::parseItem(xmlNode* node)
{
    BLACKBERRY_ASSERT(node);

    RSSItem* item = new RSSItem();

    for (; node; node = node->next) {
        String name(reinterpret_cast<const char*>(node->name));
        name.makeLower();

        if (parseItemBaseAttribute(item, name, node))
            continue;

        if (name == "author")
            item->m_author = textFromXMLNode(node);
        else if (name == "creator") {
            if (item->m_author.isEmpty())
                item->m_author = textFromXMLNode(node);
        } else if (name == "category")
            item->m_categories.append(textFromXMLNode(node));
        else if (name == "comments")
            item->m_comments = textFromXMLNode(node);
        else if (name == "enclosure") {
            // Right now we assume there is only one enclosure per item, and we handle only
            // the first enclosure if there are multiple ones.
            // Reference: http://www.rssboard.org/rss-profile#element-channel-item-enclosure
            if (!item->m_enclosure)
                item->m_enclosure = parseEnclosure(node);
        }
    }

    return item;
}

RSSFeed* RSS20Parser::parseFeed(xmlNode* node)
{
    BLACKBERRY_ASSERT(node);

    RSSFeed* feed = new RSSFeed();

    for (; node; node = node->next) {
        String name(reinterpret_cast<const char*>(node->name));
        name.makeLower();

        if (parseItemBaseAttribute(feed, name, node))
            continue;

        if (name == "item")
            feed->m_items.append(parseItem(node->children));
        else if (name == "language")
            feed->m_language = textFromXMLNode(node);
        else if (name == "ttl")
            feed->m_ttl = textFromXMLNode(node);
    }

    return feed;
}

RSSEnclosure* RSS20Parser::parseEnclosure(xmlNode* node)
{
    BLACKBERRY_ASSERT(node);

    RSSEnclosure* enclosure = new RSSEnclosure();

    for (xmlAttr* attr = node->properties; attr; attr = attr->next) {
        String name(reinterpret_cast<const char*>(attr->name));
        name.makeLower();

        if (name == "url")
            enclosure->m_url = textFromXMLAttr(attr);
        else if (name == "type")
            enclosure->m_type = textFromXMLAttr(attr);
        else if (name == "length")
            enclosure->m_length = textFromXMLAttr(attr);
    }

    return enclosure;
}

} // namespace WebCore


text:
package net.sf.jabref.gui.shared;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.KeyStroke;
import javax.swing.border.EmptyBorder;

import net.sf.jabref.gui.help.HelpAction;
import net.sf.jabref.logic.help.HelpFile;
import net.sf.jabref.logic.l10n.Localization;

public class MigrationHelpDialog extends JDialog {

    public MigrationHelpDialog(ConnectToSharedDatabaseDialog openSharedDatabaseDialog) {
        super(openSharedDatabaseDialog, Localization.lang("Migration help information"));
        setModal(true);

        String migrationMessage = Localization
                .lang("Entered database has obsolete structure and is no longer supported.");
        JLabel migrationLabel = new JLabel(migrationMessage);
        migrationLabel.setAlignmentX(Component.LEFT_ALIGNMENT);

        String helpMessage = Localization.lang("Click here to learn about the migration of pre-3.6 databases.");
        JLabel helpLabel = new HelpAction(HelpFile.SQL_DATABASE_MIGRATION).getHelpLabel(helpMessage);
        helpLabel.setAlignmentX(Component.LEFT_ALIGNMENT);

        String informationMessage = Localization.lang("However, a new database was created alongside the pre-3.6 one.");
        JLabel informationLabel = new JLabel(informationMessage);
        informationLabel.setAlignmentX(Component.LEFT_ALIGNMENT);

        Action openAction = new AbstractAction() {

            @Override
            public void actionPerformed(ActionEvent e) {
                openSharedDatabaseDialog.openSharedDatabase();
            }
        };

        JButton okButton = new JButton(Localization.lang("OK"));
        okButton.addActionListener(openAction);
        okButton.setAlignmentX(Component.CENTER_ALIGNMENT);
        okButton.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
                "Enter_pressed");
        okButton.getActionMap().put("Enter_pressed", openAction);

        JPanel buttonPanel = new JPanel();
        buttonPanel.add(okButton, BorderLayout.CENTER);

        JPanel contentPanel = new JPanel();
        contentPanel.setBorder(new EmptyBorder(9, 9, 9, 9));
        contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.Y_AXIS));

        contentPanel.add(migrationLabel);
        contentPanel.add(Box.createRigidArea(new Dimension(0, 10)));
        contentPanel.add(helpLabel);
        contentPanel.add(Box.createRigidArea(new Dimension(0, 10)));
        contentPanel.add(informationLabel);
        contentPanel.add(Box.createRigidArea(new Dimension(0, 20)));
        contentPanel.add(buttonPanel);

        add(contentPanel);

        setResizable(false);
        pack();
        setLocationRelativeTo(openSharedDatabaseDialog);
    }
}


text: {{ partial "amp/facebook" .Params }}


text:
<?php

namespace server\socket\manager;

class exception extends \runtimeException implements \server\exception {}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Hedwigia 2: 60 (1862)

#### Original name
Hantzschia Auersw.

### Remarks
null


text:
using System;
using System.Reflection;

namespace Light.DataCore
{
	abstract class DynamicFieldMapping : FieldMapping
	{
		public static DynamicFieldMapping CreateDynmaicFieldMapping (PropertyInfo property, DynamicCustomMapping mapping)
		{
			DynamicFieldMapping fieldMapping;
			Type type = property.PropertyType;
			TypeInfo typeInfo = type.GetTypeInfo();
			string fieldName = property.Name;
			if (typeInfo.IsGenericType) {
				Type frameType = type.GetGenericTypeDefinition ();
				if (frameType.FullName == "System.Nullable`1") {
					Type [] arguments = type.GetGenericArguments ();
					type = arguments [0];
					typeInfo = type.GetTypeInfo();
				}
			}

			if (type.IsArray) {
				throw new LightDataException(string.Format(SR.DataMappingUnsupportFieldType, property.DeclaringType, property.Name, type));
			}
			else if (type.IsGenericParameter || typeInfo.IsGenericTypeDefinition) {
				throw new LightDataException(string.Format(SR.DataMappingUnsupportFieldType, property.DeclaringType, property.Name, type));
			}
			else if (typeInfo.IsEnum) {
				DynamicEnumFieldMapping enumFieldMapping = new DynamicEnumFieldMapping (type, fieldName, mapping);
				fieldMapping = enumFieldMapping;
			}
			else {
				TypeCode code = Type.GetTypeCode (type);
				switch (code) {
				case TypeCode.Empty:
				case TypeCode.Object:
					throw new LightDataException(string.Format(SR.DataMappingUnsupportFieldType, property.DeclaringType, property.Name, type));
				default:
					DynamicPrimitiveFieldMapping primitiveFieldMapping = new DynamicPrimitiveFieldMapping (type, fieldName, mapping);
					fieldMapping = primitiveFieldMapping;
					break;
				}
			}
			return fieldMapping;
		}

		protected DynamicFieldMapping (Type type, string fieldName, DynamicCustomMapping mapping, bool isNullable)
			: base (type, fieldName, fieldName, mapping, isNullable, null)
		{

		}
	}
}


text:
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html

#include "intltest.h"
#include "unicode/locid.h"

/**
 * Tests for the Locale class
 **/
class LocaleTest: public IntlTest {
public:
    LocaleTest();
    virtual ~LocaleTest();

    void runIndexedTest( int32_t index, UBool exec, const char* &name, char* par = NULL );

    /**
     * Test methods to set and get data fields
     **/
    void TestBasicGetters(void);
    /**
     * Test methods to set and get data fields
     **/
    void TestParallelAPIValues(void);
    /**
     * Use Locale to access Resource file data and compare against expected values
     **/
    void TestSimpleResourceInfo(void);
    /**
     * Use Locale to access Resource file display names and compare against expected values
     **/
    void TestDisplayNames(void);
    /**
     * Test methods for basic object behaviour
     **/
    void TestSimpleObjectStuff(void);
    /**
     * Test methods for POSIX parsing behavior
     **/
    void TestPOSIXParsing(void);
    /**
     * Test Locale::getAvailableLocales
     **/
    void TestGetAvailableLocales(void);
    /**
     * Test methods to set and access a custom data directory
     **/
    void TestDataDirectory(void);

    void TestISO3Fallback(void);
    void TestGetLangsAndCountries(void);
    void TestSimpleDisplayNames(void);
    void TestUninstalledISO3Names(void);
    void TestAtypicalLocales(void);
#if !UCONFIG_NO_FORMATTING
    void TestThaiCurrencyFormat(void);
    void TestEuroSupport(void);
#endif
    void TestToString(void);
#if !UCONFIG_NO_FORMATTING
    void Test4139940(void);
    void Test4143951(void);
#endif
    void Test4147315(void);
    void Test4147317(void);
    void Test4147552(void);

    void TestVariantParsing(void);

   /* Test getting keyword enumeratin */
   void TestKeywordVariants(void);

   /* Test getting keyword values */
   void TestKeywordVariantParsing(void);

   /* Test setting keyword values */
   void TestSetKeywordValue(void);

   /* Test getting the locale base name */
   void TestGetBaseName(void);

#if !UCONFIG_NO_FORMATTING
    void Test4105828(void) ;
#endif

    void TestSetIsBogus(void);

    void TestGetLocale(void);

    void TestVariantWithOutCountry(void);

    void TestCanonicalization(void);

#if !UCONFIG_NO_FORMATTING
    static UDate date(int32_t y, int32_t m, int32_t d, int32_t hr = 0, int32_t min = 0, int32_t sec = 0);
#endif

    void TestCurrencyByDate(void);

    void TestGetVariantWithKeywords(void);
    void TestIsRightToLeft();
    void TestBug11421();

private:
    void _checklocs(const char* label,
                    const char* req,
                    const Locale& validLoc,
                    const Locale& actualLoc,
                    const char* expReqValid="gt",
                    const char* expValidActual="ge");

    /**
     * routine to perform subtests, used by TestDisplayNames
     **/
    void doTestDisplayNames(Locale& inLocale, int32_t compareIndex);
    /**
     * additional intialization for datatables storing expected values
     **/
    void setUpDataTable(void);

    UnicodeString** dataTable;

    enum {
        ENGLISH = 0,
        FRENCH = 1,
        CROATIAN = 2,
        GREEK = 3,
        NORWEGIAN = 4,
        ITALIAN = 5,
        XX = 6,
        CHINESE = 7,
        MAX_LOCALES = 7
    };

    enum {
        LANG = 0,
        SCRIPT,
        CTRY,
        VAR,
        NAME,
        LANG3,
        CTRY3,
        LCID,
        DLANG_EN,
        DSCRIPT_EN,
        DCTRY_EN,
        DVAR_EN,
        DNAME_EN,
        DLANG_FR,
        DSCRIPT_FR,
        DCTRY_FR,
        DVAR_FR,
        DNAME_FR,
        DLANG_CA,
        DSCRIPT_CA,
        DCTRY_CA,
        DVAR_CA,
        DNAME_CA,
        DLANG_EL,
        DSCRIPT_EL,
        DCTRY_EL,
        DVAR_EL,
        DNAME_EL,
        DLANG_NO,
        DSCRIPT_NO,
        DCTRY_NO,
        DVAR_NO,
        DNAME_NO
    };

#if !UCONFIG_NO_COLLATION
    /**
     * Check on registered collators.
     * @param expectExtra if non-null, the locale ID of an 'extra' locale that is registered.
     */
    void checkRegisteredCollators(const char *expectExtra = NULL);
#endif
};


text:
namespace MazeApp
{
    partial class Form
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.menuStrip1 = new System.Windows.Forms.MenuStrip();
            this.mazeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.generateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.statusStrip1 = new System.Windows.Forms.StatusStrip();
            this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
            this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
            this.toolStripStatusLabel3 = new System.Windows.Forms.ToolStripStatusLabel();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.detectEdgesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
            this.offToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
            this.slowToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.fastToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.menuStrip1.SuspendLayout();
            this.statusStrip1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.SuspendLayout();
            //
            // menuStrip1
            //
            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.mazeToolStripMenuItem,
            this.toolStripMenuItem1});
            this.menuStrip1.Location = new System.Drawing.Point(0, 0);
            this.menuStrip1.Name = "menuStrip1";
            this.menuStrip1.Size = new System.Drawing.Size(727, 24);
            this.menuStrip1.TabIndex = 0;
            this.menuStrip1.Text = "menuStrip1";
            //
            // mazeToolStripMenuItem
            //
            this.mazeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.generateToolStripMenuItem,
            this.detectEdgesToolStripMenuItem,
            this.toolStripSeparator1,
            this.saveAsToolStripMenuItem});
            this.mazeToolStripMenuItem.Name = "mazeToolStripMenuItem";
            this.mazeToolStripMenuItem.Size = new System.Drawing.Size(47, 20);
            this.mazeToolStripMenuItem.Text = "Maze";
            //
            // generateToolStripMenuItem
            //
            this.generateToolStripMenuItem.Name = "generateToolStripMenuItem";
            this.generateToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.generateToolStripMenuItem.Text = "Generate";
            this.generateToolStripMenuItem.Click += new System.EventHandler(this.generateToolStripMenuItem_Click);
            //
            // statusStrip1
            //
            this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.toolStripStatusLabel1,
            this.toolStripStatusLabel2,
            this.toolStripStatusLabel3});
            this.statusStrip1.Location = new System.Drawing.Point(0, 523);
            this.statusStrip1.Name = "statusStrip1";
            this.statusStrip1.Size = new System.Drawing.Size(727, 22);
            this.statusStrip1.TabIndex = 1;
            this.statusStrip1.Text = "statusStrip1";
            //
            // toolStripStatusLabel1
            //
            this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
            this.toolStripStatusLabel1.Size = new System.Drawing.Size(118, 17);
            this.toolStripStatusLabel1.Text = "toolStripStatusLabel1";
            //
            // toolStripStatusLabel2
            //
            this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
            this.toolStripStatusLabel2.Size = new System.Drawing.Size(476, 17);
            this.toolStripStatusLabel2.Spring = true;
            this.toolStripStatusLabel2.Text = "toolStripStatusLabel2";
            //
            // toolStripStatusLabel3
            //
            this.toolStripStatusLabel3.Name = "toolStripStatusLabel3";
            this.toolStripStatusLabel3.Size = new System.Drawing.Size(118, 17);
            this.toolStripStatusLabel3.Text = "toolStripStatusLabel3";
            //
            // pictureBox1
            //
            this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pictureBox1.Location = new System.Drawing.Point(0, 24);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(727, 499);
            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
            this.pictureBox1.TabIndex = 2;
            this.pictureBox1.TabStop = false;
            //
            // detectEdgesToolStripMenuItem
            //
            this.detectEdgesToolStripMenuItem.Name = "detectEdgesToolStripMenuItem";
            this.detectEdgesToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.detectEdgesToolStripMenuItem.Text = "Detect edges";
            this.detectEdgesToolStripMenuItem.Click += new System.EventHandler(this.detectEdgesToolStripMenuItem_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
            //
            // saveAsToolStripMenuItem
            //
            this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
            this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.saveAsToolStripMenuItem.Text = "Save as...";
            this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click);
            //
            // toolStripMenuItem1
            //
            this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.offToolStripMenuItem,
            this.toolStripSeparator2,
            this.slowToolStripMenuItem,
            this.fastToolStripMenuItem});
            this.toolStripMenuItem1.Name = "toolStripMenuItem1";
            this.toolStripMenuItem1.Size = new System.Drawing.Size(51, 20);
            this.toolStripMenuItem1.Text = "Speed";
            //
            // offToolStripMenuItem
            //
            this.offToolStripMenuItem.Name = "offToolStripMenuItem";
            this.offToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.offToolStripMenuItem.Text = "Off";
            this.offToolStripMenuItem.Click += new System.EventHandler(this.offToolStripMenuItem_Click);
            //
            // toolStripSeparator2
            //
            this.toolStripSeparator2.Name = "toolStripSeparator2";
            this.toolStripSeparator2.Size = new System.Drawing.Size(149, 6);
            //
            // slowToolStripMenuItem
            //
            this.slowToolStripMenuItem.Name = "slowToolStripMenuItem";
            this.slowToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.slowToolStripMenuItem.Text = "Slow";
            this.slowToolStripMenuItem.Click += new System.EventHandler(this.slowToolStripMenuItem_Click);
            //
            // fastToolStripMenuItem
            //
            this.fastToolStripMenuItem.Checked = true;
            this.fastToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
            this.fastToolStripMenuItem.Name = "fastToolStripMenuItem";
            this.fastToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.fastToolStripMenuItem.Text = "Fast";
            this.fastToolStripMenuItem.Click += new System.EventHandler(this.fastToolStripMenuItem_Click);
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(727, 545);
            this.Controls.Add(this.pictureBox1);
            this.Controls.Add(this.statusStrip1);
            this.Controls.Add(this.menuStrip1);
            this.MainMenuStrip = this.menuStrip1;
            this.Name = "Form1";
            this.Text = "Maze generator";
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            this.statusStrip1.ResumeLayout(false);
            this.statusStrip1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.MenuStrip menuStrip1;
        private System.Windows.Forms.ToolStripMenuItem mazeToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem generateToolStripMenuItem;
        private System.Windows.Forms.StatusStrip statusStrip1;
        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2;
        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel3;
        private System.Windows.Forms.PictureBox pictureBox1;
        private System.Windows.Forms.ToolStripMenuItem detectEdgesToolStripMenuItem;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
        private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1;
        private System.Windows.Forms.ToolStripMenuItem offToolStripMenuItem;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
        private System.Windows.Forms.ToolStripMenuItem slowToolStripMenuItem;
        private System.Windows.Forms.ToolStripMenuItem fastToolStripMenuItem;
    }
}


text:
package com.pedromassango.programmers.presentation.adapters.holders;

import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.pedromassango.programmers.R;
import com.pedromassango.programmers.data.NotificationRepository;
import com.pedromassango.programmers.data.Transations;
import com.pedromassango.programmers.extras.CategoriesUtils;
import com.pedromassango.programmers.extras.Constants;
import com.pedromassango.programmers.extras.IntentUtils;
import com.pedromassango.programmers.interfaces.Callbacks;
import com.pedromassango.programmers.interfaces.IDeleteListener;
import com.pedromassango.programmers.models.Notification;
import com.pedromassango.programmers.extras.Util;
import com.pedromassango.programmers.presentation.comments.activity.CommentsActivity;

/**
 * Created by Pedro Massango on 14/06/2017 at 18:58.
 */

public class NotificationVH extends RecyclerView.ViewHolder {

    private final TextView tvDate;
    private final TextView tvDescription;

    public NotificationVH(View view) {
        super(view);
        tvDate = view.findViewById(R.id.tv_date);
        tvDescription = view.findViewById(R.id.tv_description);
    }

    public void bindViews(final Notification notification,
                          final Activity activity,
                          final Callbacks.IDeleteListener<Notification> iDeleteListener) {

        tvDate.setText(Util.getTimeAgo(notification.getTimestamp()));

        final String notificationDescription =
                String.format("%s %s", notification.getAuthor(), activity.getString(R.string.notification_current_user_text));
        tvDescription.setText(String.valueOf(notificationDescription));

        // For delete action
        itemView.findViewById(R.id.root_view)
                .setOnLongClickListener(new View.OnLongClickListener() {
            @Override
            public boolean onLongClick(View v) {
                showDialogActions( activity,notification, iDeleteListener);
                return false;
            }
        });

        // Notification clicked
        itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Bundle b = new Bundle();
                b.putString(Constants.EXTRA_POST_ID, notification.getPostId());

                IntentUtils.startActivity(activity, b, CommentsActivity.class);
            }
        });
    }

    private void showDialogActions(final Context context, final Notification notification,
                                   final Callbacks.IDeleteListener<Notification> deleteListener) {

        // Check to handle witch message we need to show
        CharSequence[] actions = {context.getString(R.string.action_delete)};

        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setCancelable(true)
                .setItems(actions, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {

                        deleteListener.delete(notification);
                    }
                });

        builder.create()
                .show();
    }
}


text:
[![Dependency Status](https://david-dm.org/pdesterlich/moorea-mongoose-slugin.svg?theme=shields.io)](https://david-dm.org/pdesterlich/moorea-mongoose-slugin) [![devDependency Status](https://david-dm.org/pdesterlich/moorea-mongoose-slugin/dev-status.svg?theme=shields.io)](https://david-dm.org/pdesterlich/moorea-mongoose-slugin#info=devDependencies)

Unique URL-friendly slugs plugin for mongoose that is lightweight, concurrency safe, but also follows the normal mongoose plugin pattern. Unlike some of the other offerings in NPM, this one also requires minimal effort on your part by using the standard mongoose plugin syntax.

based on Paul Vencill's [slugin](https://github.com/pvencill/slugin) plugin

## Getting started
Install the plugin with npm:

```sh
npm install moorea-mongoose-slugin
```

Add the plugin to your schema:

```javascript
var slugin = require('moorea-mongoose-slugin');

// Your awesome schema building here

YourSchema.plugin(slugin);
```

That's it!  Slugin overrides the built-in `document.save` function to catch the mongodb duplicate key error and appends (or updates) an iterator on the end of the slug to ensure the slug is unique without requiring the user to update it.  By default it keys off the `title` property in your document, but you can override that in the options.  For example if you save three blog posts all with the title 'Winter is Coming', you'll get three slugs that are different from each other by the number at the end (or lack thereof):

```
winter-is-coming // first one
winter-is-coming-5 // second one got a random number '5' assigned to it
winter-is-coming-8  // third one got a random number '3' added to the previously largest number '5'
```

Why the random numbers?  Well, I decided that for a few edge cases if you had two docs try to save at the exact same time with the exact same title, you could wind up with infinite flapping as each increments by 1, so to be safe we increment by a random number between 1 and 10 instead.

## API
### slugin(schema,options)
In most cases you'll use the Schema syntax of YourSchema.plugin(slugin, options) instead.  Options are, as one would expect, optional.

* `slugName` - What property you want created on your schema to store the completed slug.  Defaults to 'slug'.  Also creates a pair of properties to hold the string and numeric parts of the slug for more efficient querying. Those will be {slugName}_base and {slugName}_it respectively.
* `source` - The property or properties on your schema that you want to use as the source of the slug. Can be a string property name or array of properties. Defaults to 'title'.
* `modelName` - The name you use to store your schema in mongoose when you call mongoose.model('modelName', schema). Defaults to pascal-casing the mongodb collection name for your model (e.g. the mongodb collection name "posts" will be interpreted as a modelName 'Posts').


text:
package cai.flow.collector;

import java.util.Enumeration;
import java.util.Vector;

import cai.flow.packets.FlowPacket;
import cai.flow.struct.Scheme_DataProtocol;
import cai.sql.SQL;

public class Scheme_AggregatorProtocol extends Scheme_Aggregator {
	/**
	 *
	 */
	private static final long serialVersionUID = -2504483711313062173L;

	public Scheme_AggregatorProtocol(SQL sql, long interval) {
		super(sql, "Protocol", interval);
	}

	public void add(FlowPacket packet) {
		Vector v = packet.getProtocolVector();

		if (v == null)
			return;

		for (Enumeration f = v.elements(); f.hasMoreElements();)
			add(new Scheme_ItemProtocol((Scheme_DataProtocol) f.nextElement()));
	}

}


text:
import * as React from 'react';

let shell: Electron.Shell = (window as any).require('electron').remote.shell;

export
namespace ServerError {
    export
    interface Props {
        launchFromPath: () => void;
    }
}

export
function ServerError(props: ServerError.Props) {
    return (

Jupyter Server Not Found

We were unable to launch a Jupyter server, which is a prerequisite for JupyterLab Native. If Jupyter is already installed, but it is not in your PATH, specify its location below. Otherwise, try installing or updating Jupyter. The Jupyter notebook version must be 4.3.0 or greater.

                    <button className='jpe-ServerError-btn' onClick={props.launchFromPath}>CHOOSE PATH</button>
                    <button className='jpe-ServerError-btn' onClick={() => {
                        shell.openExternal('https://www.jupyter.org/install.html');
                    }}>INSTALL JUPYTER</button>

    );
}


text:
{% extends "pages/base.html" %}

{% block title %}
    About
{% endblock %}

{% block headline %}
    About
{% endblock %}

{% block breadcrumb %}

About

{% endblock %}

{% block content %}

what is reSRC

reSRC stands for resource. It came to birth because I could not find a website displaying both quality curated lists and tag-sorted links.

Whenever I found an interesting article or a tutorial on subject I wanted to investigate, I ended up bookmarking it, together with curated lists laying here and there.

Programmers sometimes need lists of links on a specific programming topic, be it a technology, a framework, a language, ...

On reSRC, you are free to create your own lists or to pull the list you already have on GitHub or anywhere else. But most of you will probably be more interested by discovering great resources from great lists. Or by reSRC's tagged links database. Try Python+TDD or Ruby+Book. And of course, the meta-tag : Haskell+resource

about reSRC

reSRC is being developed by victor felder and martin maillard. Backend is Django, frontend is Zurb Foundation.

contact:

browser button

Add a <acronym title="resource" style="text-transform: none">reSRC</acronym> in one click using our bookmarklet !

For Chrome, Chromium, Firefox, Opera, drag and drop this button to your bookmarks. For Internet Explorer, right-click the button and add to your bookmarks.

Add reSRC

{% endblock %}


text:
<?xml version="1.0"?>
<!--

-->
<config>
    <menu>
         <promo>
            <children>
                <quote translate="title" module="salesrule">
                    <title>Shopping Cart Price Rules</title>
                    <action>adminhtml/promo_quote/</action>
                    <depends><module>Mage_Sales</module></depends>
                </quote>
            </children>
         </promo>
    </menu>
    <acl>
        <resources>
            <admin>
                <children>
                    <promo>
                        <children>
                            <quote translate="title" module="salesrule">
                                <title>Shopping Cart Price Rules</title>
                            </quote>
                        </children>
                    </promo>
                   <system>
                       <children>
                           <config>
                               <children>
                                   <promo translate="title" module="salesrule">
                                       <title>Shopping Cart Price Rules</title>
                                   </promo>
                               </children>
                           </config>
                       </children>
                   </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>


text:
System.register(['../../object-helper'], function (_export) {
  'use strict';

  var objectHelper, startsWithFilterStrategy;
  return {
    setters: [function (_objectHelper) {
      objectHelper = _objectHelper['default'];
    }],
    execute: function () {
      startsWithFilterStrategy = {
        apply: function apply(items, filter) {
          var filteredItems = items.slice(0);
          for (var i = filteredItems.length - 1; i > -1; i--) {
            if (!startsWithFilterStrategy.matchesFilter(filteredItems[i], filter)) {
              filteredItems.splice(i, 1);
            }
          }
          return filteredItems;
        },

        matchesFilter: function matchesFilter(item, filter) {
          var bindingObject = objectHelper.getDeepestObjectFromPath(item, filter.property);
          var bindingProperty = objectHelper.getDeepestPropertyFromPath(filter.property);

          var property = (bindingObject[bindingProperty] + '').toString().toLowerCase();
          return property.startsWith(filter.value.toString().toLowerCase());
        }
      };

      _export('default', startsWithFilterStrategy);
    }
  };
});


text:
<?php

//no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.application.component.view');

class JboloViewcp extends JViewLegacy
{
	function display($tpl = null)
	{
		//get model
		$model=$this->getModel();
		//use model functions
		$this->nodeTypesArray=$model->getNodeTypesArray();
		$this->messageTypesArray=$model->getMessageTypesArray();
		$this->messagesPerDayArray=$model->getMessagesPerDayArray();

		//get installed version from xml file
		$xml=JFactory::getXML(JPATH_COMPONENT.DS.'jbolo.xml');
		$version=(string)$xml->version;
		$this->version=$version;

		//set toolbar
		$this->_setToolBar();
		parent::display($tpl);
	}

	function _setToolBar()
	{
		JToolBarHelper::title(JText::_('COM_JBOLO_MENU_JBOLO').' - '.JText::_('COM_JBOLO_MENU_CP'),'jbolo.png');
		JToolBarHelper::preferences('com_jbolo', 550, 875);
	}
}
?>


text:
package com.opengamma.sdk.margin;

import java.util.HashSet;
import java.util.Set;

/**
 * The type of margin calculation to perform.
 *
 * @deprecated Conceptually replaced by {@link MarginCalcType}
 */
@Deprecated
public enum MarginCalcRequestType {

  /**
   * Parse and summarize the inputs, performing no margin calculation.
   *

   * Portfolio summary and parsing errors will be returned.
   */
  PARSE_INPUTS,
  /**
   * Perform a standard margin calculation for the inputs.
   *

   * Margin, parsing errors and calculation errors will be returned.
   */
  STANDARD,
  /**
   * Perform a full margin calculation for the inputs.
   *

   * Margin, portfolio summary, parsing errors and calculation errors will be returned.
   */
  FULL;

  // converts the type to MarginCalcType
  Set<MarginCalcType> toCalculationTypes() {
    HashSet<MarginCalcType> types = new HashSet<>();
    if (this == MarginCalcRequestType.PARSE_INPUTS || this == MarginCalcRequestType.FULL) {
      types.add(MarginCalcType.PORTFOLIO_SUMMARY);
    }
    if (this == MarginCalcRequestType.STANDARD || this == MarginCalcRequestType.FULL) {
      types.add(MarginCalcType.MARGIN);
    }
    return types;
  }

}


text:
namespace peloton {
namespace codegen {

//===----------------------------------------------------------------------===//
// Setup the aggregation storage format given the aggregates the caller wants to
// store.
//===----------------------------------------------------------------------===//
void Aggregation::Setup(
    CodeGen &codegen,
    const std::vector<planner::AggregatePlan::AggTerm> &aggregates) {
  // Collect the types so we can configure the updateable storage's format
  bool needs_group_count = false;
  bool tracks_group_count = false;
  for (uint32_t i = 0; i < aggregates.size(); i++) {
    const auto agg_term = aggregates[i];
    // Defense > Offense ?
    PL_ASSERT(agg_term.agg_ai.type != type::Type::TypeId::INVALID);

    needs_group_count |= agg_term.aggtype == ExpressionType::AGGREGATE_AVG;
    tracks_group_count |=
        agg_term.aggtype == ExpressionType::AGGREGATE_COUNT_STAR;
  }

  // Add the count(*) aggregate first, if we need to
  if (tracks_group_count || needs_group_count) {
    uint32_t storage_pos = storage_.AddType(type::Type::TypeId::BIGINT);
    AggregateInfo count_agg{
        ExpressionType::AGGREGATE_COUNT_STAR, type::Type::TypeId::BIGINT,
        std::numeric_limits<uint32_t>::max(), storage_pos, true};
    aggregate_infos_.push_back(count_agg);
  }

  // Add the rest
  for (uint32_t source_idx = 0; source_idx < aggregates.size(); source_idx++) {
    const auto agg_term = aggregates[source_idx];
    switch (agg_term.aggtype) {
      case ExpressionType::AGGREGATE_COUNT: {
        // We're counting instances ... use BIGINT for the count
        const auto count_type = type::Type::TypeId::BIGINT;
        uint32_t storage_pos = storage_.AddType(count_type);
        AggregateInfo aggregate_info{agg_term.aggtype, count_type, source_idx,
                                     storage_pos, false};
        aggregate_infos_.push_back(aggregate_info);
        break;
      }
      case ExpressionType::AGGREGATE_SUM:
      case ExpressionType::AGGREGATE_MIN:
      case ExpressionType::AGGREGATE_MAX: {
        // Count() - to check whether there is no item at all
        uint32_t count_storage_pos =
            storage_.AddType(type::Type::TypeId::BIGINT);
        AggregateInfo count_agg{ExpressionType::AGGREGATE_COUNT,
                                type::Type::TypeId::BIGINT, source_idx,
                                count_storage_pos, true};
        aggregate_infos_.push_back(count_agg);

        // Regular
        const auto value_type = agg_term.expression->GetValueType();
        uint32_t storage_pos = storage_.AddType(value_type);
        AggregateInfo aggregate_info{agg_term.aggtype, value_type, source_idx,
                                     storage_pos, false};
        aggregate_infos_.push_back(aggregate_info);
        break;
      }
      case ExpressionType::AGGREGATE_AVG: {
        // We decompose averages (i.e., AVG(c)) into COUNT(c) and SUM(c)

        // SUM() - the type must match the type of the expression
        PL_ASSERT(agg_term.expression != nullptr);
        const auto sum_type = agg_term.expression->GetValueType();
        uint32_t sum_storage_pos = storage_.AddType(sum_type);
        AggregateInfo sum_agg{ExpressionType::AGGREGATE_SUM, sum_type,
                              source_idx, sum_storage_pos, true};
        aggregate_infos_.push_back(sum_agg);

        // COUNT() - can use big integer since we're counting instances
        uint32_t count_storage_pos =
            storage_.AddType(type::Type::TypeId::BIGINT);
        AggregateInfo count_agg{ExpressionType::AGGREGATE_COUNT,
                                type::Type::TypeId::BIGINT, source_idx,
                                count_storage_pos, true};
        aggregate_infos_.push_back(count_agg);

        // AVG()
        // TODO: Is this always double?
        AggregateInfo avg_agg{agg_term.aggtype, type::Type::TypeId::DECIMAL,
                              source_idx, std::numeric_limits<uint32_t>::max(),
                              false};
        aggregate_infos_.push_back(avg_agg);
        break;
      }
      case ExpressionType::AGGREGATE_COUNT_STAR: {
        // count(*)'s are always stored in the first slot, reference that here
        // NOTE: We've already added the count(*) to the storage format above,
        //       don't do it here
        PL_ASSERT(tracks_group_count);
        AggregateInfo count_agg{agg_term.aggtype, type::Type::TypeId::BIGINT,
                                source_idx, 0, false};
        aggregate_infos_.push_back(count_agg);
        break;
      }
      default: {
        std::string message = StringUtil::Format(
            "Unexpected aggregate type [%s] when preparing aggregator",
            ExpressionTypeToString(agg_term.aggtype).c_str());
        LOG_ERROR("%s", message.c_str());
        throw Exception{EXCEPTION_TYPE_UNKNOWN_TYPE, message};
      }
    }
  }

  // Finalize the storage format
  storage_.Finalize(codegen);
}

// Create the initial values of all aggregates based on the the provided values
void Aggregation::CreateInitialValues(
    CodeGen &codegen, llvm::Value *storage_space,
    const std::vector<codegen::Value> &initial) const {
  // TODO: Handle null
  for (size_t i = 0; i < aggregate_infos_.size(); i++) {
    const auto &aggregate_info = aggregate_infos_[i];
    switch (aggregate_info.aggregate_type) {
      case ExpressionType::AGGREGATE_SUM:
      case ExpressionType::AGGREGATE_MIN:
      case ExpressionType::AGGREGATE_MAX: {
        // For the above aggregations, the initial value is the attribute value
        uint32_t val_source = aggregate_info.source_index;
        storage_.SetValueAt(codegen, storage_space,
                            aggregate_info.storage_index, initial[val_source]);
        break;
      }
      case ExpressionType::AGGREGATE_COUNT:
      case ExpressionType::AGGREGATE_COUNT_STAR: {
        // TODO: Count(col) needs to check for null values
        // This aggregate should be moved to the front of the storage area
        storage_.SetValueAt(
            codegen, storage_space, aggregate_info.storage_index,
            codegen::Value{type::Type::TypeId::BIGINT, codegen.Const64(1)});
        break;
      }
      case ExpressionType::AGGREGATE_AVG: {
        // AVG() aggregates aren't physically stored
        break;
      }
      default: {
        std::string message = StringUtil::Format(
            "Unexpected aggregate type [%s] when creating initial values",
            ExpressionTypeToString(aggregate_info.aggregate_type).c_str());
        LOG_ERROR("%s", message.c_str());
        throw Exception{EXCEPTION_TYPE_UNKNOWN_TYPE, message};
      }
    }
  }
}

//===----------------------------------------------------------------------===//
// Advance each of the aggregates stored in the provided storage space. We
// use the storage format class to determine the location of each of the
// aggregates. Then, depending on the type of aggregation, we advance of their
// values, populating the provided next_vals vector with their new values.
//===----------------------------------------------------------------------===//
void Aggregation::AdvanceValues(
    CodeGen &codegen, llvm::Value *storage_space,
    const std::vector<codegen::Value> &next_vals) const {
  // TODO: Handle null
  for (const auto &aggregate_info : aggregate_infos_) {
    // Loop over all aggregates, advancing each
    uint32_t source = aggregate_info.source_index;
    codegen::Value next;
    switch (aggregate_info.aggregate_type) {
      case ExpressionType::AGGREGATE_SUM: {
        PL_ASSERT(source < std::numeric_limits<uint32_t>::max());
        auto curr = storage_.GetValueAt(codegen, storage_space,
                                        aggregate_info.storage_index);
        next = curr.Add(codegen, next_vals[source]);
        break;
      }
      case ExpressionType::AGGREGATE_MIN: {
        PL_ASSERT(source < std::numeric_limits<uint32_t>::max());
        auto curr = storage_.GetValueAt(codegen, storage_space,
                                        aggregate_info.storage_index);
        next = curr.Min(codegen, next_vals[source]);
        break;
      }
      case ExpressionType::AGGREGATE_MAX: {
        PL_ASSERT(source < std::numeric_limits<uint32_t>::max());
        auto curr = storage_.GetValueAt(codegen, storage_space,
                                        aggregate_info.storage_index);
        next = curr.Max(codegen, next_vals[source]);
        break;
      }
      case ExpressionType::AGGREGATE_COUNT: {
        PL_ASSERT(source < std::numeric_limits<uint32_t>::max());
        auto curr = storage_.GetValueAt(codegen, storage_space,
                                        aggregate_info.storage_index);
        auto delta = Value{type::Type::TypeId::BIGINT, codegen.Const64(1)};
        next = curr.Add(codegen, delta);
        break;
      }
      case ExpressionType::AGGREGATE_COUNT_STAR: {
        // COUNT(*) is always stored first with a source equal to INT_MAX. All
        // other COUNT(*)'s refer to that one.
        if (source != std::numeric_limits<uint32_t>::max()) {
          continue;
        }
        auto curr = storage_.GetValueAt(codegen, storage_space,
                                        aggregate_info.storage_index);
        auto delta = Value{type::Type::TypeId::BIGINT, codegen.Const64(1)};
        next = curr.Add(codegen, delta);
        break;
      }
      case ExpressionType::AGGREGATE_AVG: {
        // AVG() aggregates aren't physically stored
        continue;
      }
      default: {
        std::string message = StringUtil::Format(
            "Unexpected aggregate type [%s] when advancing aggregator",
            ExpressionTypeToString(aggregate_info.aggregate_type).c_str());
        LOG_ERROR("%s", message.c_str());
        throw Exception{EXCEPTION_TYPE_UNKNOWN_TYPE, message};
      }
    }

    // StoreValue the next value in the appropriate slot
    PL_ASSERT(next.GetType() != type::Type::TypeId::INVALID);
    storage_.SetValueAt(codegen, storage_space, aggregate_info.storage_index,
                        next);
  }
}

//===----------------------------------------------------------------------===//
// This function will finalize the aggregates stored in the provided storage
// space.  Finalization essentially means computing the final values of the
// aggregates. This is only really necessary for averages. Either way, we
// populate the final_vals vector with the final values of all the aggregates.
//===----------------------------------------------------------------------===//
void Aggregation::FinalizeValues(
    CodeGen &codegen, llvm::Value *storage_space,
    std::vector<codegen::Value> &final_vals) const {
  // Collect all final values into this map. We need this because some
  // aggregates are derived from other component aggregates.
  std::map<std::pair<uint32_t, ExpressionType>, codegen::Value> vals;

  for (const auto &aggregate_info : aggregate_infos_) {
    uint32_t source = aggregate_info.source_index;
    ExpressionType agg_type = aggregate_info.aggregate_type;
    switch (agg_type) {
      case ExpressionType::AGGREGATE_COUNT: {
        codegen::Value final_val = storage_.GetValueAt(
            codegen, storage_space, aggregate_info.storage_index);
        vals[std::make_pair(source, agg_type)] = final_val;
        if (!aggregate_info.is_internal) {
          final_vals.push_back(final_val);
        }
        break;
      }
      case ExpressionType::AGGREGATE_SUM:
      case ExpressionType::AGGREGATE_MIN:
      case ExpressionType::AGGREGATE_MAX: {
        codegen::Value count = vals[{source, ExpressionType::AGGREGATE_COUNT}];
        codegen::Value final_calc = storage_.GetValueAt(
            codegen, storage_space, aggregate_info.storage_index);

        vals[std::make_pair(source, agg_type)] = final_calc;
        if (!aggregate_info.is_internal) {
          // Empty check
          codegen::Value zero{type::Type::TypeId::INTEGER, codegen.Const32(0)};
          codegen::Value zero_count = count.CompareEq(codegen, zero);

          codegen::Value final_null;
          If check_count{codegen, zero_count.GetValue()};
          {
            final_null = Type::GetNullValue(codegen, final_calc.GetType());
          }
          check_count.EndIf();
          auto final_val = check_count.BuildPHI(final_null, final_calc);
          final_vals.push_back(final_val);
        }
        break;
      }
      case ExpressionType::AGGREGATE_AVG: {
        // Find the sum and count for this aggregate
        codegen::Value count = vals[{source, ExpressionType::AGGREGATE_COUNT}];
        count = count.CastTo(codegen, type::Type::TypeId::DECIMAL);

        codegen::Value sum = vals[{source, ExpressionType::AGGREGATE_SUM}];
        sum = sum.CastTo(codegen, type::Type::TypeId::DECIMAL);

        codegen::Value final_val =
            sum.Div(codegen, count, Value::OnError::ReturnNull);

        vals[std::make_pair(source, agg_type)] = final_val;
        final_vals.push_back(final_val);
        break;
      }
      case ExpressionType::AGGREGATE_COUNT_STAR: {
        if (source != std::numeric_limits<uint32_t>::max()) {
          PL_ASSERT(!aggregate_info.is_internal);
          uint32_t count_source = std::numeric_limits<uint32_t>::max();
          final_vals.push_back(vals[std::make_pair(count_source, agg_type)]);
        } else {
          PL_ASSERT(aggregate_info.is_internal);
          codegen::Value final_val = storage_.GetValueAt(
              codegen, storage_space, aggregate_info.storage_index);
          vals[std::make_pair(source, agg_type)] = final_val;
        }
        break;
      }
      default: {
        std::string message = StringUtil::Format(
            "Unexpected aggregate type [%s] when finalizing aggregator",
            ExpressionTypeToString(agg_type).c_str());
        LOG_ERROR("%s", message.c_str());
        throw Exception{EXCEPTION_TYPE_UNKNOWN_TYPE, message};
      }
    }
  }
}

}  // namespace codegen
}  // namespace peloton


text:
struct _SiiOsTaskInfo_t;
#define OS_CURRENT_TASK    ((struct _SiiOsTaskInfo_t *) 0)
typedef struct _SiiOsSemInfo_t *SiiOsSemaphore_t;
typedef struct _SiiOsQueueInfo_t *SiiOsQueue_t;
typedef struct _SiiOsTaskInfo_t *SiiOsTask_t;
typedef struct {
	struct timeval theTime;
} SiiOsTime_t;
typedef struct _SiiOsTimerInfo_t *SiiOsTimer_t;
#endif


text:
using System;
using System.ComponentModel;
using System.Diagnostics;
using PS.Build.Essentials.Extensions;
using PS.Build.Extensions;
using PS.Build.Services;
using PS.Build.Types;

namespace PS.Build.Essentials.Attributes
{
    /// <summary>
    ///     Starts the process resource that is specified by the parameter containing process start information (for example,
    ///     the file name of the process to start) and associates the resource with a new Process component.
    ///     <see cref="https://msdn.microsoft.com/en-us/library/0w4h05yb(v=vs.110).aspx" />
    /// </summary>
    [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
    [Designer("PS.Build.Adaptation")]
    public class ExecuteProcessAttribute : Attribute
    {
        #region Constructors

        public ExecuteProcessAttribute(string filename)
        {
            if (filename == null) throw new ArgumentNullException("filename");
            Filename = filename;

            CreateNoWindow = true;
            WindowStyle = ProcessWindowStyle.Hidden;
            WaitForProcessExit = true;
            BuildStep = BuildStep.PostBuild;
        }

        #endregion

        #region Properties

        /// <summary>
        ///     Gets or sets the set of command-line arguments to use when starting the application.
        /// </summary>
        public string Arguments { get; set; }

        /// <summary>
        ///     Gets or sets a value indicating whether to start the process.
        /// </summary>
        public BuildStep BuildStep { get; set; }

        /// <summary>
        ///     Gets or sets a value indicating whether to start the process in a new window.
        /// </summary>
        public bool CreateNoWindow { get; set; }

        /// <summary>
        ///     Gets or sets a value that identifies the domain to use when starting the process.
        /// </summary>
        public string Domain { get; set; }

        /// <summary>
        ///     Gets the environment variables that apply to this process and its child processes. Semicolon separated pairs of key
        ///     and value.
        /// </summary>
        /// <example>
        ///     Variable1=Value1;Variable2=42
        /// </example>
        public string Environment { get; set; }

        /// <summary>
        ///     Gets the application or document to start.
        /// </summary>
        public string Filename { get; protected set; }

        /// <summary>
        ///     Gets or sets a secure string that contains the user password to use when starting the process.
        /// </summary>
        public string Password { get; set; }

        /// <summary>
        ///     Gets or sets the user name to be used when starting the process.
        /// </summary>
        public string Username { get; set; }

        /// <summary>
        ///     Gets or sets a value indicating whether to use the operating system shell to start the process.
        /// </summary>
        public bool UseShellExecute { get; set; }

        /// <summary>
        ///     Gets or sets option to wait process exit
        /// </summary>
        public bool WaitForProcessExit { get; set; }

        /// <summary>
        ///     Gets or sets the window state to use when the process is started.
        /// </summary>
        public ProcessWindowStyle WindowStyle { get; set; }

        /// <summary>
        ///     When the UseShellExecute property is false, gets or sets the working directory for the process to be started. When
        ///     UseShellExecute is true, gets or sets the directory that contains the process to be started.
        /// </summary>
        public string WorkingDirectory { get; set; }

        #endregion

        #region Members

        protected virtual void StartProcess(IServiceProvider provider)
        {
            var logger = provider.GetService<ILogger>();
            var macroResolver = provider.GetService<IMacroResolver>();
            try
            {
                var startInfo = new ProcessStartInfo
                {
                    Arguments = macroResolver.Resolve(Arguments),
                    CreateNoWindow = CreateNoWindow,
                    Domain = Domain,
                    FileName = macroResolver.Resolve(Filename),
                    Password = Password.ToSecureString(),
                    UserName = Username,
                    UseShellExecute = UseShellExecute,
                    WindowStyle = WindowStyle,
                    WorkingDirectory = macroResolver.Resolve(WorkingDirectory),
                    RedirectStandardOutput = true,
                    RedirectStandardError = true
                };

                foreach (var pair in (Environment ?? string.Empty).Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    var keyValue = pair.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                    if (keyValue.Length != 2)
                    {
                        logger.Error("Environment variable: " + keyValue + " invalid");
                        return;
                    }
                    startInfo.EnvironmentVariables.Add(macroResolver.Resolve(keyValue[0]),
                                                       macroResolver.Resolve(keyValue[1]));
                }

                var process = new Process
                {
                    StartInfo = startInfo
                };

                process.OutputDataReceived += (sender, args) =>
                {
                    if (!string.IsNullOrEmpty(args.Data)) logger.Info(args.Data);
                };
                process.ErrorDataReceived += (sender, args) =>
                {
                    if (!string.IsNullOrEmpty(args.Data)) logger.Error(args.Data);
                };
                process.Start();
                process.BeginOutputReadLine();
                process.BeginErrorReadLine();

                if (WaitForProcessExit) process.WaitForExit();
            }
            catch (Exception e)
            {
                logger.Error("Process execution failed. Details: " + e.GetBaseException().Message);
            }
        }

        private void PostBuild(IServiceProvider provider)
        {
            if (BuildStep.HasFlag(BuildStep.PostBuild)) StartProcess(provider);
        }

        private void PreBuild(IServiceProvider provider)
        {
            if (BuildStep.HasFlag(BuildStep.PreBuild)) StartProcess(provider);
        }

        #endregion
    }
}


text:
/*
    Point of Sale System Project
    Authors: Clayton Barber, Brandon Barton, Declan Brennan, Maximilian Hasselbusch, Eric Metcalf
    Last Updated: 20 November 2015
 */
package pos;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.PrintStream;
import javax.swing.*;

public class CashorCredit extends javax.swing.JFrame {

    PrintStream ps;
    Sale s;
    SysFrame sysf;

    /**
     * Creates new form AddItem
     */
    public CashorCredit(Sale s, PrintStream ps, SysFrame sysf) {
        super("CashorCredit");
        this.ps = ps;
        this.s = s;
        this.sysf = sysf;
        initComponents();
        this.setLocationRelativeTo(null);
        this.setVisible(true);
        this.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                s.printRecipt();
                dispose();
            }
        });
        //this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        Cancel = new javax.swing.JButton();
        OK = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        //setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setAlwaysOnTop(true);

        jPanel1.setBackground(new java.awt.Color(0, 0, 255));

        Cancel.setText("Cash");
        Cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CancelActionPerformed(evt);
            }
        });

        OK.setText("Credit");
        OK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                OKActionPerformed(evt);
            }
        });

        jLabel1.setText("Cash or Credit?");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(49, 49, 49)
                .addComponent(jLabel1)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(Cancel, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(OK, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(Cancel)
                    .addComponent(OK))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void CancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CancelActionPerformed
        if(s.finalVerify()){
            sysf.setOutputText("Sale completed with cash, ready for next sale.\n");
            s.commitSale("Cash");
            this.dispose();
        }
        else{
            ErrorDiaglog ed = new ErrorDiaglog();
            dispose();
        }
    }//GEN-LAST:event_CancelActionPerformed

    private void OKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_OKActionPerformed
        //this.dispose();
        //Getccn gccn = new Getccn(s, ps, sysf);
    }//GEN-LAST:event_OKActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Cancel;
    private javax.swing.JButton OK;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables

    public class ErrorDiaglog extends JDialog {
        JButton ok = new JButton("Okay");
        JPanel buttHolder = new JPanel();
        JTextArea errMsg = new JTextArea("One or more items are no longer available for sale. Please Resubmit.");
        ErrorDiaglog(){
            setBounds(500, 200, 400, 100);
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    dispose();
                    s.l = null;
                    s.printRecipt();
                    s = null;
                }
            });
            ok.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent ae) {
                    dispose();
                    s.l = null;
                    s.printRecipt();
                    s = null;
                }
            });
            buttHolder.add(ok);
            getContentPane().add(buttHolder, BorderLayout.SOUTH);
            getContentPane().add(errMsg, BorderLayout.CENTER);
            setVisible(true);
        }
    }
}


text: experimental, playin' with odt


text:
package org.apache.apex.malhar.lib.dimensions.aggregator;

public enum AggregatorTopBottomType
{
  TOPN,
  BOTTOMN;

}


text:
module Api
  module ChunksHelper
  end
end


text:
title: 'Lesson 6: CronTrigger'
---

CronTriggers are often more useful than SimpleTrigger, if you need a job-firing schedule that recurs based on calendar-like notions,
rather than on the exactly specified intervals of SimpleTrigger.

With CronTrigger, you can specify firing-schedules such as "every Friday at noon", or "every weekday and 9:30 am",
or even "every 5 minutes between 9:00 am and 10:00 am on every Monday, Wednesday and Friday".

Even so, like SimpleTrigger, CronTrigger has a startTime which specifies when the schedule is in force, and an (optional)
endTime that specifies when the schedule should be discontinued.

### Cron Expressions

_Cron-Expressions_ are used to configure instances of CronTrigger. Cron-Expressions are strings that are actually made up
of seven sub-expressions, that describe individual details of the schedule. These sub-expression are separated with white-space, and represent:

* 1. Seconds
* 2. Minutes
* 3. Hours
* 4. Day-of-Month
* 5. Month
* 6. Day-of-Week
* 7. Year (optional field)

An example of a complete cron-expression is the string "0 0 12 ? * WED" - which means "every Wednesday at 12:00 pm".

Individual sub-expressions can contain ranges and/or lists. For example, the day of week field in the previous (which reads "WED")
example could be replaces with "MON-FRI", "MON, WED, FRI", or even "MON-WED,SAT".

Wild-cards (the '*' character) can be used to say "every" possible value of this field. Therefore the '*' character in the
"Month" field of the previous example simply means "every month". A '*' in the Day-Of-Week field would obviously mean "every day of the week".

All of the fields have a set of valid values that can be specified. These values should be fairly obvious - such as the numbers
0 to 59 for seconds and minutes, and the values 0 to 23 for hours. Day-of-Month can be any value 0-31, but you need to be careful
about how many days are in a given month! Months can be specified as values between 0 and 11, or by using the strings
JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV and DEC. Days-of-Week can be specified as vaules between 1 and 7 (1 = Sunday)
or by using the strings SUN, MON, TUE, WED, THU, FRI and SAT.

The '/' character can be used to specify increments to values. For example, if you put '0/15' in the Minutes field, it means 'every 15 minutes,
starting at minute zero'. If you used '3/20' in the Minutes field, it would mean 'every 20 minutes during the hour,
starting at minute three' - or in other words it is the same as specifying '3,23,43' in the Minutes field.

The '?' character is allowed for the day-of-month and day-of-week fields. It is used to specify "no specific value".
This is useful when you need to specify something in one of the two fields, but not the other.
See the examples below (and CronTrigger API documentation) for clarification.

The 'L' character is allowed for the day-of-month and day-of-week fields. This character is short-hand for "last",
but it has different meaning in each of the two fields. For example, the value "L" in the day-of-month field means
"the last day of the month" - day 31 for January, day 28 for February on non-leap years. If used in the day-of-week field by itself,
it simply means "7" or "SAT". But if used in the day-of-week field after another value, it means "the last xxx day of the month" -
for example "6L" or "FRIL" both mean "the last friday of the month". When using the 'L' option, it is important not to specify lists,
or ranges of values, as you'll get confusing results.

The 'W' is used to specify the weekday (Monday-Friday) nearest the given day. As an example, if you were to specify "15W" as the value for the day-of-month field, the meaning is: "the nearest weekday to the 15th of the month".

The '#' is used to specify "the nth" XXX weekday of the month. For example, the value of "6#3" or "FRI#3" in the day-of-week field means "the third Friday of the month".

## Example Cron Expressions

Here are a few more examples of expressions and their meanings - you can find even more in the API documentation for CronTrigger

**CronTrigger Example 1 - an expression to create a trigger that simply fires every 5 minutes**

    "0 0/5 * * * ?"

**CronTrigger Example 2 - an expression to create a trigger that fires every 5 minutes, at 10 seconds after the minute (i.e. 10:00:10 am, 10:05:10 am, etc.).**

    "10 0/5 * * * ?"

**CronTrigger Example 3 - an expression to create a trigger that fires at 10:30, 11:30, 12:30, and 13:30, on every Wednesday and Friday.**

    "0 30 10-13 ? * WED,FRI"

**CronTrigger Example 4 - an expression to create a trigger that fires every half hour between the hours of 8 am and 10 am on the 5th and 20th of every month.
Note that the trigger will NOT fire at 10:00 am, just at 8:00, 8:30, 9:00 and 9:30**

    "0 0/30 8-9 5,20 * ?"

Note that some scheduling requirements are too complicated to express with a single trigger - such as "every 5 minutes between 9:00 am and 10:00 am,
and every 20 minutes between 1:00 pm and 10:00 pm". The solution in this scenario is to simply create two triggers, and register both of them to run the same job.

## Building CronTriggers

CronTrigger instances are built using **TriggerBuilder** (for the trigger's main properties) and **WithCronSchedule** extension method (for the CronTrigger-specific properties).

You can also use CronScheduleBuilder's static methods to create schedules.

**Build a trigger that will fire every other minute, between 8am and 5pm, every day:**

```csharp
trigger = TriggerBuilder.Create()
    .WithIdentity("trigger3", "group1")
    .WithCronSchedule("0 0/2 8-17 * * ?")
    .ForJob("myJob", "group1")
    .Build();
```

**Build a trigger that will fire daily at 10:42 am:**

```csharp
// we use CronScheduleBuilder's static helper methods here
trigger = TriggerBuilder.Create()
    .WithIdentity("trigger3", "group1")
    .WithSchedule(CronScheduleBuilder.DailyAtHourAndMinute(10, 42))
    .ForJob(myJobKey)
    .Build();
```

or -

```csharp
trigger = TriggerBuilder.Create()
    .WithIdentity("trigger3", "group1")
    .WithCronSchedule("0 42 10 * * ?")
    .ForJob("myJob", "group1")
    .Build();
```

**Build a trigger that will fire on Wednesdays at 10:42 am, in a TimeZone other than the system's default:**

```csharp
trigger = TriggerBuilder.Create()
    .WithIdentity("trigger3", "group1")
    .WithSchedule(CronScheduleBuilder
        .WeeklyOnDayAndHourAndMinute(DayOfWeek.Wednesday, 10, 42)
        .InTimeZone(TimeZoneInfo.FindSystemTimeZoneById("Central America Standard Time")))
    .ForJob(myJobKey)
    .Build();
```
or -

```csharp
trigger = TriggerBuilder.Create()
    .WithIdentity("trigger3", "group1")
    .WithCronSchedule("0 42 10 ? * WED", x => x
        .InTimeZone(TimeZoneInfo.FindSystemTimeZoneById("Central America Standard Time")))
    .ForJob(myJobKey)
    .Build();
```

## CronTrigger Misfire Instructions

The following instructions can be used to inform Quartz what it should do when a misfire occurs for CronTrigger.
(Misfire situations were introduced in the More About Triggers section of this tutorial). These instructions are defined in  as
constants (and API documentation has description for their behavior). The instructions include:

* MisfireInstruction.IgnoreMisfirePolicy
* MisfireInstruction.CronTrigger.DoNothing
* MisfireInstruction.CronTrigger.FireOnceNow

All triggers have the MisfireInstrution.SmartPolicy instruction available for use, and this instruction is also the default for all trigger types.
The 'smart policy' instruction is interpreted by CronTrigger as MisfireInstruction.CronTrigger.FireOnceNow. The API documentation for the
CronTrigger.UpdateAfterMisfire() method explains the exact details of this behavior.

When building CronTriggers, you specify the misfire instruction as part of the cron schedule (via WithCronSchedule extension method):

```csharp
trigger = TriggerBuilder.Create()
    .WithIdentity("trigger3", "group1")
    .WithCronSchedule("0 0/2 8-17 * * ?", x => x
        .WithMisfireHandlingInstructionFireAndProceed())
    .ForJob("myJob", "group1")
    .Build();
```


text:
class CheckBoundsObserver : public AbstractObserver
{
public:
	CheckBoundsObserver(std::string name, void(*f)(Sprite*, int, int), Sprite *s, int w, int h);
	virtual void Notify();

private:
	void(*func_) (Sprite*, int, int);
	Sprite *one;
	int w;
	int h;
};


text:
#ifndef _PROTON_STORE_H
#define _PROTON_STORE_H 1

#include "core/buffer.h"

typedef struct pni_store_t pni_store_t;
typedef struct pni_entry_t pni_entry_t;

pni_store_t *pni_store(void);
void pni_store_free(pni_store_t *store);
size_t pni_store_size(pni_store_t *store);
pni_entry_t *pni_store_put(pni_store_t *store, const char *address);
pni_entry_t *pni_store_get(pni_store_t *store, const char *address);

pn_buffer_t *pni_entry_bytes(pni_entry_t *entry);
pn_status_t pni_entry_get_status(pni_entry_t *entry);
void pni_entry_set_status(pni_entry_t *entry, pn_status_t status);
pn_delivery_t *pni_entry_get_delivery(pni_entry_t *entry);
void pni_entry_set_delivery(pni_entry_t *entry, pn_delivery_t *delivery);
void pni_entry_set_context(pni_entry_t *entry, void *context);
void *pni_entry_get_context(pni_entry_t *entry);
void pni_entry_updated(pni_entry_t *entry);
void pni_entry_free(pni_entry_t *entry);

pn_sequence_t pni_entry_track(pni_entry_t *entry);
pni_entry_t *pni_store_entry(pni_store_t *store, pn_sequence_t id);
int pni_store_update(pni_store_t *store, pn_sequence_t id, pn_status_t status,
                     int flags, bool settle, bool match);
int pni_store_get_window(pni_store_t *store);
void pni_store_set_window(pni_store_t *store, int window);

#endif /* store.h */


text:
package hi

import (
	"github.com/blevesearch/bleve/v2/analysis"
	"github.com/blevesearch/bleve/v2/registry"

	"github.com/blevesearch/bleve/v2/analysis/lang/in"
	"github.com/blevesearch/bleve/v2/analysis/token/lowercase"
	"github.com/blevesearch/bleve/v2/analysis/tokenizer/unicode"
)

const AnalyzerName = "hi"

func AnalyzerConstructor(config map[string]interface{}, cache *registry.Cache) (analysis.Analyzer, error) {
	tokenizer, err := cache.TokenizerNamed(unicode.Name)
	if err != nil {
		return nil, err
	}
	toLowerFilter, err := cache.TokenFilterNamed(lowercase.Name)
	if err != nil {
		return nil, err
	}
	indicNormalizeFilter, err := cache.TokenFilterNamed(in.NormalizeName)
	if err != nil {
		return nil, err
	}
	hindiNormalizeFilter, err := cache.TokenFilterNamed(NormalizeName)
	if err != nil {
		return nil, err
	}
	stopHiFilter, err := cache.TokenFilterNamed(StopName)
	if err != nil {
		return nil, err
	}
	stemmerHiFilter, err := cache.TokenFilterNamed(StemmerName)
	if err != nil {
		return nil, err
	}
	rv := analysis.DefaultAnalyzer{
		Tokenizer: tokenizer,
		TokenFilters: []analysis.TokenFilter{
			toLowerFilter,
			indicNormalizeFilter,
			hindiNormalizeFilter,
			stopHiFilter,
			stemmerHiFilter,
		},
	}
	return &rv, nil
}

func init() {
	registry.RegisterAnalyzer(AnalyzerName, AnalyzerConstructor)
}