text:
package org.dcm4chex.archive.util;

import java.io.BufferedInputStream;
import java.io.EOFException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteOrder;
import java.security.DigestInputStream;
import java.security.MessageDigest;
import java.util.Arrays;

import org.apache.log4j.Logger;
import org.dcm4che.data.Dataset;
import org.dcm4che.data.DcmObjectFactory;
import org.dcm4che.data.DcmParser;
import org.dcm4che.data.DcmParserFactory;
import org.dcm4che.data.FileFormat;
import org.dcm4che.dict.Tags;

import org.dcm4chex.archive.common.Availability;
import org.dcm4chex.archive.ejb.interfaces.MD5;
import org.dcm4chex.archive.ejb.jdbc.FileInfo;

/**
 * @author gunter.zeilinger@tiani.com
 * @version $Revision: 15092 $ $Date: 2011-03-12 06:28:20 +0800 (周六, 12 3月 2011) $
 * @since 19.09.2004
 *
 */
public class FileUtils {

    protected static final Logger log = Logger.getLogger(FileUtils.class);

    private static final int BUFFER_SIZE = 512;

    public static final long MEGA = 1000000L;

    public static final long GIGA = 1000000000L;

    public static final long MAX_TIMES_CREATE_FILE = 10;

    public static final long INTERVAL_CREATE_FILE = 250; // ms

    private static char[] HEX_DIGIT = { '0', '1', '2', '3', '4', '5', '6', '7',
            '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };

    public static String toHex(int val) {
        char[] ch8 = new char[8];
        for (int i = 8; --i >= 0; val >>= 4) {
            ch8[i] = HEX_DIGIT[val & 0xf];
        }
        return String.valueOf(ch8);
    }

    /**
     * Create a new file based on hash code, including the directory structure
     * if necessary. In case of collision, we will reset hashcode and try again.
     *
     * @param dir
     *            the directory where the new file will be created
     * @param hash
     *            the initial hash value
     * @return the file created successfully
     * @throws Exception
     */
    public static File createNewFile(File dir, int hash) throws Exception {
        File f = null;
        boolean success = false;
        Exception lastException = null;
        for (int i = 0; i < MAX_TIMES_CREATE_FILE && !success; i++) {
            // In UNIX, mkdirs and createNewFile can throw IOException
            // instead of nicely returning false
            try {
                if (!dir.exists()) {
                    success = dir.mkdirs();
                    if (!success)
                        throw new IOException("Directory creation failed: "
                                + dir.getCanonicalPath());
                }

                // Try to construct a new file name everytime
                f = new File(dir, toHex(hash++));

                success = f.createNewFile();

                if (i > 0)
                    log.info("file: " + dir.getCanonicalPath()
                            + " created successfully after retries: " + i);

                if (success)
                    return f;
                else
                    i--; // if not success, we should not increment i which is
                         // for exceptional retry
            } catch (Exception e) {
                if (lastException == null)
                    log.warn("failed to create file: " + dir.getCanonicalPath()
                            + " - retry: " + (i + 1) + " of "
                            + MAX_TIMES_CREATE_FILE + ". Will retry again.", e);
                else
                    log.warn("failed to create file: " + dir.getCanonicalPath()
                            + " - got the same exception as above - retry: "
                            + (i + 1) + " of " + MAX_TIMES_CREATE_FILE
                            + ". Will retry again");
                lastException = e;

                success = false;

                // Maybe other thread is trying to do the same thing
                // Let's wait for INTERVAL_CREATE_FILE ms - this rarely happens
                try {
                    Thread.sleep(INTERVAL_CREATE_FILE);
                } catch (InterruptedException e1) {
                }
            }
        }
        // Run out of retries, throw original exception
        throw lastException;
    }

    public static String slashify(File f) {
        return f.getPath().replace(File.separatorChar, '/');
    }

    public static File resolve(File f) {
        if (f.isAbsolute())
            return f;
        File serverHomeDir = new File(System.getProperty("jboss.server.home.dir"));
        return new File(serverHomeDir, f.getPath());
    }

    public static File toFile(String unixPath) {
        return resolve(new File(unixPath.replace('/', File.separatorChar)));
    }

    public static File toExistingFile(String unixPath)
            throws FileNotFoundException {
        File f = toFile(unixPath);
        if (!f.isFile()) {
            throw new FileNotFoundException(f.toString());
        }
        return f;
    }

    public static File toFile(String unixDirPath, String unixFilePath) {
        return resolve(new File(unixDirPath.replace('/', File.separatorChar),
                unixFilePath.replace('/', File.separatorChar)));
    }

    public static String formatSize(long size) {
        return (size == -1) ? "UNKNOWN" : (size < GIGA) ? ((float) size / MEGA)
                + "MB" : ((float) size / GIGA) + "GB";
    }

    public static long parseSize(String s, long minSize) {
        long u;
        if (s.endsWith("GB"))
            u = GIGA;
        else if (s.endsWith("MB"))
            u = MEGA;
        else
            throw new IllegalArgumentException(s);
        try {
            long size = (long) (Float
                    .parseFloat(s.substring(0, s.length() - 2)) * u);
            if (size >= minSize)
                return size;
        } catch (IllegalArgumentException e) {
        }
        throw new IllegalArgumentException(s);
    }

    public static boolean equalsPixelData(File f1, File f2) throws IOException {
        InputStream in1 = new BufferedInputStream(new FileInputStream(f1));
        try {
            InputStream in2 = new BufferedInputStream(new FileInputStream(f2));
            try {
                Dataset attrs = DcmObjectFactory.getInstance().newDataset();
                DcmParserFactory pf = DcmParserFactory.getInstance();
                DcmParser p1 = pf.newDcmParser(in1);
                DcmParser p2 = pf.newDcmParser(in2);
                p1.setDcmHandler(attrs.getDcmHandler());
                p1.parseDcmFile(FileFormat.DICOM_FILE, Tags.PixelData);
                p2.parseDcmFile(FileFormat.DICOM_FILE, Tags.PixelData);
                int samples = attrs.getInt(Tags.SamplesPerPixel, 1);
                int frames = attrs.getInt(Tags.NumberOfFrames, 1);
                int rows = attrs.getInt(Tags.Rows, 1);
                int columns = attrs.getInt(Tags.Columns, 1);
                int bitsAlloc = attrs.getInt(Tags.BitsAllocated, 8);
                int bitsStored = attrs.getInt(Tags.BitsStored, bitsAlloc);
                int frameLength = rows * columns * samples * bitsAlloc / 8;
                int pixelDataLength = frameLength * frames;
                if (pixelDataLength > p1.getReadLength()
                        || pixelDataLength > p2.getReadLength()) {
                    return false;
                }
                byte[] b1 = new byte[BUFFER_SIZE];
                byte[] b2 = new byte[BUFFER_SIZE];
                int[] mask = { 0xff, 0xff };
                int len, len2;
                if (bitsAlloc == 16 && bitsStored < 16) {
                    mask[p1.getDcmDecodeParam().byteOrder == ByteOrder.LITTLE_ENDIAN ? 1
                            : 0] = 0xff >>> (16 - bitsStored);
                }
                int pos = 0;
                while (pos < pixelDataLength) {
                    len = in1.read(b1, 0, Math.min(pixelDataLength - pos,
                            BUFFER_SIZE));
                    if (len < 0) // EOF
                        return false;
                    int off = 0;
                    while (off < len) {
                        off += len2 = in2.read(b2, off, len - off);
                        if (len2 < 0) // EOF
                            return false;
                    }
                    for (int i = 0; i < len; i++, pos++)
                        if (((b1[i] - b2[i]) & mask[pos & 1]) != 0)
                            return false;
                }
                return true;
            } finally {
                in2.close();
            }
        } finally {
            in1.close();
        }
    }

    public static int maxDiffPixelData(File f1, File f2) throws IOException {
        int maxDiff = 0;
        InputStream in1 = new BufferedInputStream(new FileInputStream(f1));
        try {
            InputStream in2 = new BufferedInputStream(new FileInputStream(f2));
            try {
                DcmObjectFactory df = DcmObjectFactory.getInstance();
                DcmParserFactory pf = DcmParserFactory.getInstance();
                Dataset attrs1 = df.newDataset();
                Dataset attrs2 = df.newDataset();
                DcmParser p1 = pf.newDcmParser(in1);
                DcmParser p2 = pf.newDcmParser(in2);
                p1.setDcmHandler(attrs1.getDcmHandler());
                p2.setDcmHandler(attrs2.getDcmHandler());
                p1.parseDcmFile(FileFormat.DICOM_FILE, Tags.PixelData);
                p2.parseDcmFile(FileFormat.DICOM_FILE, Tags.PixelData);
                int samples = attrs1.getInt(Tags.SamplesPerPixel, 1);
                int frames = attrs1.getInt(Tags.NumberOfFrames, 1);
                int rows = attrs1.getInt(Tags.Rows, 1);
                int columns = attrs1.getInt(Tags.Columns, 1);
                int bitsAlloc = attrs1.getInt(Tags.BitsAllocated, 8);
                int bitsStored = attrs1.getInt(Tags.BitsStored, bitsAlloc);
                int bitsStored2 = attrs2.getInt(Tags.BitsStored, bitsAlloc);
                int pixelRepresentation1 = attrs1.getInt(Tags.PixelRepresentation, 0);
                int pixelRepresentation2 = attrs2.getInt(Tags.PixelRepresentation, 0);
                int frameLength = rows * columns * samples * bitsAlloc / 8;
                int pixelDataLength = frameLength * frames;
                if (pixelDataLength > p1.getReadLength()
                        || pixelDataLength > p2.getReadLength()) {
                    return Integer.MAX_VALUE;
                }
                byte[] b1 = new byte[BUFFER_SIZE];
                byte[] b2 = new byte[BUFFER_SIZE];
                byte lsb1 = 0, lsb2 = 0;
                int w1, w2, len, len2;
                int bitmask1 = 0xffff >>> (bitsAlloc - bitsStored);
                int bitmask2 = 0xffff >>> (bitsAlloc - bitsStored2);
                int signed1 = pixelRepresentation1 != 0 ? (-1 & ~bitmask1)>>1 : 0;
                int signed2 = pixelRepresentation2 != 0 ? (-1 & ~bitmask2)>>1 : 0;
                int pos = 0;
                while (pos < pixelDataLength) {
                    len = in1.read(b1, 0, Math.min(pixelDataLength - pos,
                            BUFFER_SIZE));
                    if (len < 0) // EOF
                        return Integer.MAX_VALUE;
                    int off = 0;
                    while (off < len) {
                        off += len2 = in2.read(b2, off, len - off);
                        if (len2 < 0) // EOF
                            return Integer.MAX_VALUE;
                    }
                    if (bitsAlloc == 8)
                        for (int i = 0; i < len; i++, pos++)
                            maxDiff = Math.max(maxDiff,
                                    Math.abs((b1[i] & 0xff) - (b2[i] & 0xff)));
                    else {
                        for (int i = 0; i < len; i++, pos++)
                            // TODO assumes LE Byte Order
                            if ((pos & 1) == 0) {
                                lsb1 = b1[i];
                                lsb2 = b2[i];
                            } else {
                                if (((w1 = ((b1[i] << 8) | (lsb1 & 0xff)) & bitmask1) & signed1) != 0)
                                    w1 |= signed1;
                                if (((w2 = ((b2[i] << 8) | (lsb2 & 0xff)) & bitmask2) & signed2) != 0)
                                    w2 |= signed2;
                                maxDiff = Math.max(maxDiff, Math.abs(w1 - w2));
                            }

                    }
                }
                return maxDiff;
            } finally {
                in2.close();
            }
        } finally {
            in1.close();
        }
    }

    public static boolean delete(File file, boolean deleteEmptyParents) {
    	return delete(file, deleteEmptyParents, null);
    }

    /**
     *
     * @param file - the file to delete
     * @param deleteEmptyParents - removing empty parent folders flag
     * @param parentFolderToKeep - if deleteEmptyParents is true, this parameters shows the parent folder
     * where removing parents must stop
     * @return True, if the file has been successfully removed, otherwise returns false
     */
    public static boolean delete(File file, boolean deleteEmptyParents, String parentFolderToKeep) {
        log.info("M-DELETE file: " + file);
        if (!file.exists()) {
            log.warn("File: " + file + " was already deleted");
            return true;
        }
        if (!file.delete()) {
            log.warn("Failed to delete file: " + file);
            return false;
        }
        if (deleteEmptyParents) {
            File parentToKeep = null;
            if (parentFolderToKeep != null)
            	parentToKeep = toFile(parentFolderToKeep);

        	File parent = file.getParentFile();
            while (!parent.equals(parentToKeep) && parent.delete()){
                log.info("M-DELETE directory: " + parent);
                parent = parent.getParentFile();
            }
        }
        return true;
    }

    public static void verifyMD5(FileInfo info) throws Exception {
    	if (info.md5 == null || info.basedir == null
    			|| info.availability != Availability.ONLINE
    			|| info.basedir.startsWith("ftp://"))
    		return;
    	File file = FileUtils.toFile(info.basedir, info.fileID);
    	verifyMD5(file, info.md5);
    }

    public static void verifyMD5(File file, String originalMd5) throws Exception {
        log.info("M-READ file:" + file);
        MessageDigest md = MessageDigest.getInstance("MD5");

        BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));

        DigestInputStream dis = new DigestInputStream(in, md);
        try {
            DcmParser parser = DcmParserFactory.getInstance().newDcmParser(dis);
            parser.parseDcmFile(FileFormat.DICOM_FILE, Tags.PixelData);
            if ((parser.getReadTag() & 0xFFFFFFFFL) >= Tags.PixelData) {
                if (parser.getReadLength() == -1) {
                    while (parser.parseHeader() == Tags.Item) {
                        readOut(parser.getInputStream(), parser.getReadLength());
                    }
                }
                readOut(parser.getInputStream(), parser.getReadLength());
                parser.parseDataset(parser.getDcmDecodeParam(), -1);
            }
        } finally {
            try {
                dis.close();
            } catch (IOException ignore) {
            }
        }
        byte[] md5 = md.digest();
        if (!Arrays.equals(md5, MD5.toBytes(originalMd5))) {
        	log.error("MD5 for " + file.getAbsolutePath() + " is different that expected.  Has the file been changed or corrupted?");
            throw new IllegalStateException("MD5 mismatch");
        }
    }

    protected static void readOut(InputStream in, int len) throws IOException {
        int toRead = len;
        while (toRead-- > 0) {
            if (in.read() < 0) {
                throw new EOFException();
            }
        }
    }

}


text:
<!doctype html>

    <title>Code coverage report for dist/</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../prettify.css" />
    <link rel="stylesheet" href="../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">

      all files dist/

        65.03%
        Statements
        4996/7683

        50.39%
        Branches
        1829/3630

        64.02%
        Functions
        1080/1687

        63.25%
        Lines
        4474/7074

        1601 statements, 295 functions, 889 branches
        Ignored

   File

   Statements

   Branches

   Functions

   Lines

	angular-google-maps.js

	65.03%
	4996/7683
	50.39%
	1829/3630
	64.02%
	1080/1687
	63.25%
	4474/7074

  Code coverage
  generated by istanbul at Mon Sep 19 2016 21:26:26 GMT-0400 (EDT)

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>
<meta lang="en">

    <meta charset="UTF-8">
    <title></title>

    <link rel="stylesheet" type="text/css" href="css/main.css">
    <link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
    <link rel="stylesheet"
          type="text/css"
          href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.css">


text:
#calendar-main {width:68%;float:left;}
#calendar-sidebar {width:30%; float:right; padding-top: 0;}

/* [YYYY]-[MM]-[DD]T[hh]:[mm]-[hh] */

/*Button styling
===============================*/

a.btn { display:block; padding:4px; color:#fff; background:#225eaf; border:1px solid #dedede; font-size:9px;
text-transform:uppercase; text-align:center; text-decoration:none; }
a.btn:hover { color:#fff; background:#6a6a6a; border:1px solid #dedede; }

a.add { width:16px; height:16px; background:transparent url(../images/calendar__plus.png) 0 0 no-repeat; padding:0; border:0; text-indent:-9999em; }
a.add:hover { background:transparent url(../images/calendar__plus.png) 0 0 no-repeat; border:0; }

/*Top Heading
===============================*/
#topHeading { border-bottom:3px solid #6a6a6a; padding:12px 0 4px 0; }
#topHeading h2 {clear:both;}
#topHeading span { display:block; margin-top:12px;float:left; }
#topHeading span.feed { padding:3px 0 3px 20px;float:right; background:transparent url('../images/feed.png') left top no-repeat; }

/*Date Heading*/
#dateHeader {text-align:center; margin:8px 0 ; padding: 18px 0 16px 0; border-top:3px double #D4D4D4; border-bottom:3px double #D4D4D4;}
#dateHeader h3 {line-height: 0; margin: 0; padding:0;}

/*Month Navs
==============================*/
#monthNav { text-align:center; background: #dedede; padding:8px 0; margin:10px 0 22px; }
#monthNav a { width:20px;}
#monthNav h2 {cursor:pointer;}
#monthNav h2:hover {color:#aaa;}
#monthNav a:hover { }
#monthNav a.prev { float:left; }
#monthNav a.next { float:right; }
#monthNav h3 { padding:0; margin:0; font-size:18px; }

#monthSelect { background:#dedede; border:2px solid #c4c4c4; text-align:center; padding:10px; margin-top:10px; }
#monthSelect select { width:100%; }

/*Sort and View Type
==============================*/
#calView { border-bottom: 2px solid #dedede; }
#calView ul { display:inline; float:left; margin:8px 0 0 140px; }
#calView ul li { display:inline; margin:0; }
#calView ul li span { float:left; margin-right:8px; padding-bottom:6px; }

#calView ul li a { float:left; padding-bottom:3px; margin-left:5px; text-decoration:none; }
#calView ul li a:hover, #calView ul li a.active { border-bottom:3px solid #666; text-decoration:none; }
#calView ul li a:hover { border-color:#aaa; }

#calView ul li.more a, #calView ul li.less a { display:block; text-decoration:none; padding:0 0 3px; margin:0 5px 0 0; }
#calView ul li.more a.open, #calView ul li.less a.open { border-bottom:3px solid #666; }
#calView ul li span {font-weight:700;}
#calView h5 {float:right; display: inline; margin:7px 8px 0 0; padding: 0;}

/*Event Summary (single date)
==============================*/
.vevent { border-bottom: 1px solid #dedede; padding:10px 0; }

.vevent div.dates, .vevent div.details { float:left; }
.vevent ul.utility { float:right; }
.vevent div.dates { width:20%; margin-right:15px; }
.vevent div.details { width:54%; margin-right:0; padding-left:15px; border-left:1px solid #dedede; }
.vevent ul.utility { width:100px; margin:0; list-style:none; }
.vevent ul.utility li { list-style:none; margin:0 0 5px; }

.vevent dl.more-dates { margin:10px 0 0; }
.vevent dl.more-dates dt { font-weight:700; }

.vevent .summary { margin:0 0 5px; }
.vevent .location { text-transform:uppercase; font-size:11px; }
.vevent .description { margin:5px 0; clear:both; }

.vevent .dtstart { display:inline; font-weight:700; text-transform:uppercase; border:0; margin:0 0 10px; }
.vevent .dtend { display:inline; font-weight:700; border:0; }
.vevent h5 span.dtstart, .vevent h5 span.dtend {display: inline;}

.vevent dt span.dtstart, .vevent dt span.dtend { display:inline; }

.vevent dl, .vevent dt, .vevent dd { margin:0; }
.vevent dt { font-weight:700; clear:both; float:left; margin-bottom:4px; }
.vevent dd { float:left; }
.vevent h4.dates { font-size:12px; margin:5px 0; border-bottom:1px solid #ccc; width:30%; }

.vevent #eventImage img { float:right; }

/* Event Detail with Image*/
#eventImage { padding:5px; }

#Form_CalendarFilterForm {padding:0 10px;}
#Form_CalendarFilterForm fieldset {border:0;}
#Form_CalendarFilterForm div.field {padding:5px 0;}
#Form_CalendarFilterForm div.middleColumn {background:none;margin:0;padding:0;}
#Form_CalendarFilterForm label {display:block;margin:0;}
#Form_CalendarFilterForm div.field {width:216px;text-align:left;}
#Form_CalendarFilterForm select {width:auto;clear:both;}
#Form_CalendarFilterForm option {width:auto;padding:0 5px;}
#Form_CalendarFilterForm div.Actions {margin:0;text-align:left;}
#Form_CalendarFilterForm div.fieldgroup select {font-size:12px;font-weight:normal;}

#StartMonthStartDayStartYear div.fieldgroupField,
#StartDayStartMonthStartYear div.fieldgroupField {display:inline;}
#EndMonthEndDayEndYear div.fieldgroupField,
#EndDayEndMonthEndYear div.fieldgroupField {display:inline;}
#Form_CalendarFilterForm div.fieldgroup label {display:block;width:200px;border-bottom:1px solid #aaa;margin-bottom:5px;}

/* clearfix */
.clearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;}
.clearfix {display: inline-block;}
/* Hides from IE-mac \*/
* html .clearfix {height: 1%;}
.clearfix {display: block;}
/* End hide from IE-mac */


text:
create or replace view vw_ingredients
as
select * from ingredients;


text:
package com.google.inject;

import static com.google.common.base.Preconditions.checkState;

import com.google.inject.internal.Messages;
import com.google.inject.spi.Message;
import java.util.Collection;

/**
 * Thrown when a programming error such as a misplaced annotation, illegal binding, or unsupported
 * scope is found. Clients should catch this exception, log it, and stop execution.
 *
 * @author jessewilson@google.com (Jesse Wilson)
 * @since 2.0
 */
public final class ConfigurationException extends RuntimeException {

  private final com.google.common.collect.ImmutableSet<Message> messages;
  private Object partialValue = null;

  /** Creates a ConfigurationException containing {@code messages}. */
  public ConfigurationException(Iterable<Message> messages) {
    this.messages = com.google.common.collect.ImmutableSet.copyOf(messages);
    initCause(Messages.getOnlyCause(this.messages));
  }

  /** Returns a copy of this configuration exception with the specified partial value. */
  public ConfigurationException withPartialValue(Object partialValue) {
    checkState(this.partialValue == null,
        "Can't clobber existing partial value %s with %s", this.partialValue, partialValue);
    ConfigurationException result = new ConfigurationException(messages);
    result.partialValue = partialValue;
    return result;
  }

  /** Returns messages for the errors that caused this exception. */
  public Collection<Message> getErrorMessages() {
    return messages;
  }

  /**
   * Returns a value that was only partially computed due to this exception. The caller can use this
   * while collecting additional configuration problems.
   *
   * @return the partial value, or {@code null} if none was set. The type of the partial value is
   *     specified by the throwing method.
   */
  @SuppressWarnings({
    "unchecked",
    "TypeParameterUnusedInFormals"
  }) // this is *extremely* unsafe. We trust the caller here.
  public <E> E getPartialValue() {
    return (E) partialValue;
  }

  @Override public String getMessage() {
    return Messages.formatMessages("Guice configuration errors", messages);
  }

  private static final long serialVersionUID = 0;
}


text:
cask :v1 => 'glimmerblocker' do
  version '1.6.5'
  sha256 'bcb9f53c4eb33a907fdaa42b7e5deb5b48d2495269e8746206691b393e2db507'

  url "https://glimmerblocker.org/downloads/GlimmerBlocker-#{version}.dmg"
  appcast 'https://glimmerblocker.org/site/rss/sparkle-final.xml',
          :sha256 => 'fce1b515c7ee075a7ce56f91753ca292eb786cc32180f7d8eed4c521a2aa3a03'
  name 'GlimmerBlocker'
  homepage 'https://glimmerblocker.org/'
  license :unknown    # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder

  pkg 'GlimmerBlocker.pkg'

  uninstall :pkgutil   => 'org.glimmerblocker.pkg',
            :launchctl => [
                           'org.glimmerblocker.proxy',
                           'org.glimmerblocker.updater'
                          ],
            :delete    => '/Library/PreferencePanes/GlimmerBlocker.prefPane'

  zap       :delete    => [
                           '/Library/GlimmerBlocker',
                           '/Library/Logs/GlimmerBlocker'
                          ]

  caveats <<-EOS.undent
    You must deactivate GlimmerBlocker from the installed preference
    pane before uninstalling. See http://glimmerblocker.org/wiki/Uninstall.
  EOS
end


text:
package com.navercorp.pinpoint.web.dao.hbase;

import com.navercorp.pinpoint.common.hbase.HbaseColumnFamily;
import com.navercorp.pinpoint.common.hbase.TableDescriptor;
import com.navercorp.pinpoint.common.hbase.TableDescriptors;
import com.navercorp.pinpoint.common.hbase.TableNameProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Woonduk Kang(emeroad)
 */
@Configuration()
//@Import(TableDescriptors.class)
public class TableDescriptorConfig extends TableDescriptors {

    public TableDescriptorConfig(TableNameProvider tableNameProvider) {
        super(tableNameProvider);
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.AgentInfo> getAgentInfo() {
        return super.getAgentInfo();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.AgentEvent> getAgentEvent() {
        return super.getAgentEvent();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.AgentLifeCycleStatus> getAgentLifeCycleStatus() {
        return super.getAgentLifeCycleStatus();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.AgentStatStatistics> getAgentStatStatus() {
        return super.getAgentStatStatus();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.ApiMetadata> getApiMetadata() {
        return super.getApiMetadata();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.ApplicationIndex> getApplicationIndex() {
        return super.getApplicationIndex();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.ApplicationStatStatistics> getApplicationStatStatistics() {
        return super.getApplicationStatStatistics();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.ApplicationTraceIndexTrace> getApplicationTraceIndexTrace() {
        return super.getApplicationTraceIndexTrace();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.HostStatMap> getHostStatMap() {
        return super.getHostStatMap();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.CalleeStatMap> getCalleeStatMap() {
        return super.getCalleeStatMap();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.CallerStatMap> getCallerStatMap() {
        return super.getCallerStatMap();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.SelfStatMap> getSelfStatMap() {
        return super.getSelfStatMap();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.SqlMetadataV2> getSqlMetadataV2() {
        return super.getSqlMetadataV2();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.StringMetadataStr> getStringMetadataStr() {
        return super.getStringMetadataStr();
    }

    @Bean
    @Override
    public TableDescriptor<HbaseColumnFamily.Trace> getTrace() {
        return super.getTrace();
    }
}


text:
package com.alibaba.json.bvt.bug;

import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.TimeZone;

import com.alibaba.fastjson.parser.ParserConfig;
import org.junit.Assert;
import junit.framework.TestCase;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

public class Bug_for_lenolix_11 extends TestCase {
    protected void setUp() throws Exception {
        JSON.defaultTimeZone = TimeZone.getTimeZone("Asia/Shanghai");
        JSON.defaultLocale = Locale.CHINA;

        ParserConfig.global.addAccept("com.alibaba.json.bvt.bug.Bug_for_lenolix_11.");
    }

    public void test_for_objectKey() throws Exception {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd-yyyy", JSON.defaultLocale);
        simpleDateFormat.setTimeZone(JSON.defaultTimeZone);

        String simpleDateFormatJson = JSON.toJSONString(simpleDateFormat, SerializerFeature.WriteClassName,
                                                        SerializerFeature.WriteMapNullValue);

        System.out.println(simpleDateFormatJson);

        java.text.SimpleDateFormat format = (java.text.SimpleDateFormat) JSON.parse(simpleDateFormatJson);
        Assert.assertEquals("MM-dd-yyyy", format.toPattern());

    }

    public static class User {

        private int     id;
        private Boolean isBoy;
        private String  name;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public Boolean getIsBoy() {
            return isBoy;
        }

        public void setIsBoy(Boolean isBoy) {
            this.isBoy = isBoy;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

    }
}


text:
/**
 * All business logic is contained within the service layer.  It trades entity objects with the repositories and mode object with the controllers
 *

 *

 * Controller <--(model)--> Service <--(entity)--> Repository
 *
 * @since 1.0
 */
package com.codingrodent.microservice.template.service;


text:
require 'test_helper'

# NOTE: tests may fail randomly because Garanti returns random(!) responses for their test server
class RemoteGarantiTest < Test::Unit::TestCase

  def setup
    @gateway = GarantiGateway.new(fixtures(:garanti))

    @amount = 100 # 1 cents = 0.01$
    @declined_card = credit_card('4282209027132017')
    @credit_card = credit_card('4282209027132016', month: 5, year: 2018, verification_value: 358)

    @options = {
      :order_id => generate_unique_id,
      :billing_address => address,
      :description => 'Store Purchase'
    }
  end

  def teardown
    $KCODE = @original_kcode if @original_kcode
  end

  def test_successful_purchase
    assert response = @gateway.purchase(@amount, @credit_card, @options)
    assert_success response
    assert_equal 'Approved', response.message
  end

  def test_unsuccessful_purchase
    assert response = @gateway.purchase(@amount, @declined_card, @options)
    assert_failure response
    assert_match %r{Declined}, response.message
  end

  def test_authorize_and_capture
    amount = @amount
    assert auth = @gateway.authorize(amount, @credit_card, @options)
    assert_success auth
    assert_equal 'Approved', auth.message
    assert auth.authorization
    assert capture = @gateway.capture(amount, auth.authorization)
    assert_success capture
  end

  def test_failed_capture
    assert response = @gateway.capture(@amount, '')
    assert_failure response
    assert_match %r{Declined}, response.message
  end

  def test_invalid_login
    gateway = GarantiGateway.new(
                :login => 'PROVAUT',
                :terminal_id => '30691300',
                :merchant_id => '',
                :password => ''
              )
    assert response = gateway.purchase(@amount, @credit_card, @options)
    assert_failure response
    assert_equal '0651', response.params["reason_code"]
  end
end


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Mundo;

/**
 *
 * @author Nicolas
 */
public class PlaceType {

    public static String getPlacesTypesOfCity(String CITY) {
        return  " SELECT DISTINCT PLACE_TYPE FROM PLACE_TYPE PT" +
                " INNER JOIN PLACE P ON PT.PTYPE_ID = P.PTYPE_ID" +
                " INNER JOIN CITY C ON P.CITY_ID = C.CITY_ID " +
                " AND C.CITY_NAME = '" + CITY + "'";
    }

    public static String getAllPlaceTypes(){
        return  " SELECT DISTINCT PLACE_TYPE FROM PLACE_TYPE";
    }

}


text:
@implementation MDCCurvedCornerTreatment

- (instancetype)init {
  return [self initWithSize:CGSizeZero];
}

- (instancetype)initWithSize:(CGSize)size {
  if (self = [super init]) {
    _size = size;
  }
  return self;
}

- (MDCPathGenerator *)pathGeneratorForCornerWithAngle:(CGFloat)angle {
  return [self pathGeneratorForCornerWithAngle:angle andCurve:_size];
}

- (MDCPathGenerator *)pathGeneratorForCornerWithAngle:(CGFloat)angle forViewSize:(CGSize)viewSize {
  CGSize normalizedCurve =
      CGSizeMake(_size.width * viewSize.height, _size.height * viewSize.height);
  return [self pathGeneratorForCornerWithAngle:angle andCurve:normalizedCurve];
}

- (MDCPathGenerator *)pathGeneratorForCornerWithAngle:(CGFloat)angle andCurve:(CGSize)curve {
  MDCPathGenerator *path =
      [MDCPathGenerator pathGeneratorWithStartPoint:CGPointMake(0, curve.height)];
  [path addQuadCurveWithControlPoint:CGPointZero toPoint:CGPointMake(curve.width, 0)];
  return path;
}

- (id)copyWithZone:(NSZone *)zone {
  MDCCurvedCornerTreatment *copy = [super copyWithZone:zone];
  copy.size = _size;
  return copy;
}

- (BOOL)isEqual:(id)object {
  if (object == self) {
    return YES;
  } else if (![super isEqual:object]) {
    return NO;
  }
  if (!object || ![[object class] isEqual:[self class]]) {
    return NO;
  }
  MDCCurvedCornerTreatment *otherCurvedCorner = (MDCCurvedCornerTreatment *)object;
  return CGSizeEqualToSize(self.size, otherCurvedCorner.size);
}

- (NSUInteger)hash {
  return @(self.size.height).hash ^ @(self.size.width).hash ^ (NSUInteger)self.valueType;
}

@end


text:
package org.ggp.base.util.gdl.transforms;

import java.util.List;
import java.util.Set;

import org.ggp.base.util.concurrency.ConcurrencyUtils;
import org.ggp.base.util.gdl.grammar.GdlPool;
import org.ggp.base.util.gdl.grammar.GdlRule;
import org.ggp.base.util.gdl.grammar.GdlSentence;
import org.ggp.base.util.gdl.grammar.GdlTerm;
import org.ggp.base.util.gdl.grammar.GdlVariable;
import org.ggp.base.util.gdl.model.DependencyGraphs;
import org.ggp.base.util.gdl.model.SentenceDomainModel;
import org.ggp.base.util.gdl.model.SentenceForm;
import org.ggp.base.util.gdl.model.SentenceFormModel;
import org.ggp.base.util.prover.aima.AimaProver;
import org.ggp.base.util.reasoner.gdl.GdlChainingReasoner;
import org.ggp.base.util.reasoner.gdl.GdlSentenceSet;

import com.google.common.base.Predicates;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;

public class ConstantCheckerFactory {
	/**
	 * Precomputes the true sentences in every constant sentence form in the given
	 * sentence model and returns the results in the form of a ConstantChecker.
	 *
	 * The implementation uses a forward-chaining reasoner.
	 *
	 * For accurate results, the rules used should have had the {@link NewVariableConstrainer}
	 * transformation applied to them.
	 *
	 * On average, this approach is more efficient than {@link #createWithProver(SentenceFormModel)}.
	 */
	public static ImmutableConstantChecker createWithForwardChaining(SentenceDomainModel model) throws InterruptedException {
		GdlChainingReasoner reasoner = GdlChainingReasoner.create(model);
		GdlSentenceSet sentencesByForm = reasoner.getConstantSentences();
		addSentencesTrueByRulesDifferentially(sentencesByForm, model, reasoner);
		return ImmutableConstantChecker.create(model,
				Multimaps.filterKeys(sentencesByForm.getSentences(), Predicates.in(model.getConstantSentenceForms())));
	}

	private static void addSentencesTrueByRulesDifferentially(
			GdlSentenceSet sentencesByForm,
			SentenceDomainModel domainModel, GdlChainingReasoner reasoner) throws InterruptedException {
		SentenceFormModel model = domainModel;
		Set<SentenceForm> constantForms = model.getConstantSentenceForms();
		//Find the part of the dependency graph dealing only with the constant forms.
		Multimap<SentenceForm, SentenceForm> dependencySubgraph =
				Multimaps.filterKeys(model.getDependencyGraph(), Predicates.in(constantForms));
		dependencySubgraph = Multimaps.filterValues(model.getDependencyGraph(), Predicates.in(constantForms));
		dependencySubgraph = ImmutableMultimap.copyOf(dependencySubgraph);
		List<Set<SentenceForm>> ordering = DependencyGraphs.toposortSafe(constantForms, dependencySubgraph);

		for (Set<SentenceForm> stratum : ordering) {
			// One non-differential pass, collecting the changes
			GdlSentenceSet newlyTrueSentences = GdlSentenceSet.create();
			for (SentenceForm form : stratum) {
				for (GdlRule rule : model.getRules(form)) {
					GdlSentenceSet ruleResults =
							reasoner.getRuleResults(rule, domainModel, sentencesByForm);
					if (!reasoner.isSubsetOf(sentencesByForm, ruleResults)) {
						sentencesByForm = reasoner.getUnion(sentencesByForm, ruleResults);
						newlyTrueSentences = reasoner.getUnion(newlyTrueSentences, ruleResults);
					}
				}
			}

			// Now a lot of differential passes to deal with recursion efficiently
			boolean somethingChanged = true;
			while (somethingChanged) {
				somethingChanged = false;
				GdlSentenceSet newStuffInThisPass = GdlSentenceSet.create();
				for (SentenceForm form : stratum) {
					for (GdlRule rule : model.getRules(form)) {
						GdlSentenceSet ruleResults =
								reasoner.getRuleResultsForNewSentences(rule, domainModel, sentencesByForm,
										newlyTrueSentences);
						if (!reasoner.isSubsetOf(sentencesByForm, ruleResults)) {
							somethingChanged = true;
							newStuffInThisPass = reasoner.getUnion(newStuffInThisPass, ruleResults);
						}
					}
				}
				sentencesByForm = reasoner.getUnion(sentencesByForm, newStuffInThisPass);
				newlyTrueSentences = newStuffInThisPass;
			}
		}
	}

	/**
	 * Precomputes the true sentences in every constant sentence form in the given
	 * sentence model and returns the results in the form of a ConstantChecker.
	 *
	 * The implementation uses a backwards-chaining theorem prover.
	 *
	 * In most (but not all) cases, {@link #createWithForwardChaining(SentenceDomainModel)}
	 * is more efficient.
	 */
	public static ImmutableConstantChecker createWithProver(SentenceFormModel model) throws InterruptedException {
		Multimap<SentenceForm, GdlSentence> sentencesByForm = HashMultimap.create();
		addSentencesTrueByRules(sentencesByForm, model);
		return ImmutableConstantChecker.create(model, sentencesByForm);
	}

	private static void addSentencesTrueByRules(
			Multimap<SentenceForm, GdlSentence> sentencesByForm,
			SentenceFormModel model) throws InterruptedException {
		AimaProver prover = new AimaProver(model.getDescription());
		for (SentenceForm form : model.getConstantSentenceForms()) {
			GdlSentence query = form.getSentenceFromTuple(getVariablesTuple(form.getTupleSize()));
			for (GdlSentence result : prover.askAll(query, ImmutableSet.<GdlSentence>of())) {
				ConcurrencyUtils.checkForInterruption();
				//Variables may end up being replaced with functions, which is not
				//what we want here, so we have to double-check that the form is correct.
				if (form.matches(result)) {
					sentencesByForm.put(form, result);
				}
			}
		}
	}

	private static List<? extends GdlTerm> getVariablesTuple(int tupleSize) {
		List<GdlVariable> varsTuple = Lists.newArrayList();
		for (int i = 0; i < tupleSize; i++) {
			varsTuple.add(GdlPool.getVariable("?" + i));
		}
		return varsTuple;
	}
}


text:
#!/bin/sh

# Clean up the results directory
rm -rf results
mkdir results

#Synthesize the Wrapper Files

echo 'Synthesizing example design with XST';
xst -ifn xst.scr
cp police_exdes.ngc ./results/

# Copy the netlist generated by Coregen
echo 'Copying files from the netlist directory to the results directory'
cp ../../police.ngc results/

#  Copy the constraints files generated by Coregen
echo 'Copying files from constraints directory to results directory'
cp ../example_design/police_exdes.ucf results/

cd results

echo 'Running ngdbuild'
ngdbuild -p xc7a100t-csg324-1 police_exdes

echo 'Running map'
map police_exdes -o mapped.ncd -pr i

echo 'Running par'
par mapped.ncd routed.ncd

echo 'Running trce'
trce -e 10 routed.ncd mapped.pcf -o routed

echo 'Running design through bitgen'
bitgen -w routed -g UnconstrainedPins:Allow

echo 'Running netgen to create gate level Verilog model'
netgen -ofmt verilog -sim -tm police_exdes -pcf mapped.pcf -w -sdf_anno false routed.ncd routed.v


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>org.jboss.netty.channel.socket Class Hierarchy (Netty API Reference (3.10.1.Final))</title>
<meta name="date" content="2015-03-23">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package org.jboss.netty.channel.socket

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

org.jboss.netty.channel.DefaultChannelConfig (implements org.jboss.netty.channel.ChannelConfig)

org.jboss.netty.channel.socket.DefaultDatagramChannelConfig (implements org.jboss.netty.channel.socket.DatagramChannelConfig)

org.jboss.netty.channel.socket.DefaultSocketChannelConfig (implements org.jboss.netty.channel.socket.SocketChannelConfig)

org.jboss.netty.channel.DefaultChannelFuture (implements org.jboss.netty.channel.ChannelFuture)

org.jboss.netty.channel.socket.ChannelRunnableWrapper (implements java.lang.Runnable)

org.jboss.netty.channel.DefaultServerChannelConfig (implements org.jboss.netty.channel.ChannelConfig)

org.jboss.netty.channel.socket.DefaultServerSocketChannelConfig (implements org.jboss.netty.channel.socket.ServerSocketChannelConfig)

Interface Hierarchy

org.jboss.netty.channel.ChannelConfig

org.jboss.netty.channel.socket.DatagramChannelConfig

org.jboss.netty.channel.socket.ServerSocketChannelConfig

org.jboss.netty.channel.socket.SocketChannelConfig

java.lang.Comparable<T>

org.jboss.netty.channel.Channel

org.jboss.netty.channel.socket.DatagramChannel

org.jboss.netty.channel.ServerChannel

org.jboss.netty.channel.socket.ServerSocketChannel

org.jboss.netty.channel.socket.SocketChannel

org.jboss.netty.util.ExternalResourceReleasable

org.jboss.netty.channel.ChannelFactory

org.jboss.netty.channel.socket.ClientSocketChannelFactory

org.jboss.netty.channel.socket.DatagramChannelFactory

org.jboss.netty.channel.ServerChannelFactory

org.jboss.netty.channel.socket.ServerSocketChannelFactory

java.lang.Runnable

org.jboss.netty.channel.socket.Worker

Enum Hierarchy

java.lang.Object

java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)

org.jboss.netty.channel.socket.InternetProtocolFamily

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2008-2015 The Netty Project. All Rights Reserved.


text:
/* */
(function(process) {
  "use strict";
  var __extends = (this && this.__extends) || function(d, b) {
    for (var p in b)
      if (b.hasOwnProperty(p))
        d[p] = b[p];
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
  var isArray_1 = require('./util/isArray');
  var isObject_1 = require('./util/isObject');
  var isFunction_1 = require('./util/isFunction');
  var tryCatch_1 = require('./util/tryCatch');
  var errorObject_1 = require('./util/errorObject');
  var UnsubscriptionError_1 = require('./util/UnsubscriptionError');
  var Subscription = (function() {
    function Subscription(unsubscribe) {
      this.closed = false;
      if (unsubscribe) {
        this._unsubscribe = unsubscribe;
      }
    }
    Subscription.prototype.unsubscribe = function() {
      var hasErrors = false;
      var errors;
      if (this.closed) {
        return;
      }
      this.closed = true;
      var _a = this,
          _unsubscribe = _a._unsubscribe,
          _subscriptions = _a._subscriptions;
      this._subscriptions = null;
      if (isFunction_1.isFunction(_unsubscribe)) {
        var trial = tryCatch_1.tryCatch(_unsubscribe).call(this);
        if (trial === errorObject_1.errorObject) {
          hasErrors = true;
          errors = errors || (errorObject_1.errorObject.e instanceof UnsubscriptionError_1.UnsubscriptionError ? flattenUnsubscriptionErrors(errorObject_1.errorObject.e.errors) : [errorObject_1.errorObject.e]);
        }
      }
      if (isArray_1.isArray(_subscriptions)) {
        var index = -1;
        var len = _subscriptions.length;
        while (++index < len) {
          var sub = _subscriptions[index];
          if (isObject_1.isObject(sub)) {
            var trial = tryCatch_1.tryCatch(sub.unsubscribe).call(sub);
            if (trial === errorObject_1.errorObject) {
              hasErrors = true;
              errors = errors || [];
              var err = errorObject_1.errorObject.e;
              if (err instanceof UnsubscriptionError_1.UnsubscriptionError) {
                errors = errors.concat(flattenUnsubscriptionErrors(err.errors));
              } else {
                errors.push(err);
              }
            }
          }
        }
      }
      if (hasErrors) {
        throw new UnsubscriptionError_1.UnsubscriptionError(errors);
      }
    };
    Subscription.prototype.add = function(teardown) {
      if (!teardown || (teardown === Subscription.EMPTY)) {
        return Subscription.EMPTY;
      }
      if (teardown === this) {
        return this;
      }
      var sub = teardown;
      switch (typeof teardown) {
        case 'function':
          sub = new Subscription(teardown);
        case 'object':
          if (sub.closed || typeof sub.unsubscribe !== 'function') {
            return sub;
          } else if (this.closed) {
            sub.unsubscribe();
            return sub;
          }
          break;
        default:
          throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
      }
      var childSub = new ChildSubscription(sub, this);
      this._subscriptions = this._subscriptions || [];
      this._subscriptions.push(childSub);
      return childSub;
    };
    Subscription.prototype.remove = function(subscription) {
      if (subscription == null || (subscription === this) || (subscription === Subscription.EMPTY)) {
        return;
      }
      var subscriptions = this._subscriptions;
      if (subscriptions) {
        var subscriptionIndex = subscriptions.indexOf(subscription);
        if (subscriptionIndex !== -1) {
          subscriptions.splice(subscriptionIndex, 1);
        }
      }
    };
    Subscription.EMPTY = (function(empty) {
      empty.closed = true;
      return empty;
    }(new Subscription()));
    return Subscription;
  }());
  exports.Subscription = Subscription;
  var ChildSubscription = (function(_super) {
    __extends(ChildSubscription, _super);
    function ChildSubscription(_innerSub, _parent) {
      _super.call(this);
      this._innerSub = _innerSub;
      this._parent = _parent;
    }
    ChildSubscription.prototype._unsubscribe = function() {
      var _a = this,
          _innerSub = _a._innerSub,
          _parent = _a._parent;
      _parent.remove(this);
      _innerSub.unsubscribe();
    };
    return ChildSubscription;
  }(Subscription));
  exports.ChildSubscription = ChildSubscription;
  function flattenUnsubscriptionErrors(errors) {
    return errors.reduce(function(errs, err) {
      return errs.concat((err instanceof UnsubscriptionError_1.UnsubscriptionError) ? err.errors : err);
    }, []);
  }
})(require('process'));


text:
// <copyright file="ShippingAddressPageFillShippingBehaviour.cs" company="Automate The Planet Ltd.">
// Copyright 2021 Automate The Planet Ltd.
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
// <author>Anton Angelov</author>
// <site>http://automatetheplanet.com/</site>

using SpecflowBehavioursDesignPattern.Base;
using SpecflowBehavioursDesignPattern.Behaviours.Core;
using SpecflowBehavioursDesignPattern.Data;
using SpecflowBehavioursDesignPattern.Pages.ShippingAddressPage;
using TechTalk.SpecFlow;
using Unity;

namespace SpecflowBehavioursDesignPattern.Behaviours.BindBehaviours
{
    [Binding]
    public class ShippingAddressPageFillShippingBehaviour : ActionBehaviour
    {
        private readonly ShippingAddressPage _shippingAddressPage;
        private ClientPurchaseInfo _clientPurchaseInfo;

        public ShippingAddressPageFillShippingBehaviour()
        {
            _shippingAddressPage = UnityContainerFactory.GetContainer().Resolve<ShippingAddressPage>();
        }

        [When(@"I type full name = ""([^""]*)"", country = ""([^""]*)"", Adress = ""([^""]*)"", city = ""([^""]*)"", state = ""([^""]*)"", zip = ""([^""]*)"" and phone = ""([^""]*)""")]
        public void FillShippingInfo(string fullName, string country, string address, string state, string city, string zip, string phone)
        {
            _clientPurchaseInfo = new ClientPurchaseInfo(
                new ClientAddressInfo()
                {
                    FullName = fullName,
                    Country = country,
                    Address1 = address,
                    State = state,
                    City = city,
                    Zip = zip,
                    Phone = phone,
                });
            _shippingAddressPage.FillShippingInfo(_clientPurchaseInfo);
            Execute();
        }

        protected override void PerformAct()
        {
            _shippingAddressPage.FillShippingInfo(_clientPurchaseInfo);
        }
    }
}


text:
"""oauth 1.0 flow for khan-api"""
from __future__ import print_function, unicode_literals
import requests_oauthlib
import requests
import urlparse
import webbrowser
from six.moves import input
# package specific
import pkaaw.constants

def get_request_tokens(consumer_key, consumer_secret):
    """uses request_oauthlib to start the oauth dance."""
    khan_auth = requests_oauthlib.OAuth1Session(client_key=consumer_key,
                                                client_secret=consumer_secret)
    khan_auth.fetch_request_token(pkaaw.constants.REQUEST_TOKEN_URL)
    return khan_auth

def console_auth(khan_auth):
    """for capturing auth credentials in the python console"""
    url = khan_auth.authorization_url(pkaaw.constants.AUTHORIZATION_URL)
    webbrowser.open(url, new=0, autoraise=True)

    redirect_response = input('Paste the full redirect URL here: ')

    khan_auth.parse_authorization_response(redirect_response)
    return khan_auth

def fetch_access_token(khan_auth):
    """takes request token and exchanges for access token"""
    keys = khan_auth.auth.client
    oauth = requests_oauthlib.OAuth1(
        client_key=keys.client_key,
        client_secret=keys.client_secret,
        resource_owner_key=keys.resource_owner_key,
        resource_owner_secret=keys.resource_owner_secret
    )

    r = requests.post(
        url=pkaaw.constants.ACCESS_TOKEN_URL,
        auth=oauth
    )

    credentials = urlparse.parse_qs(r.content)
    tokens = {
        'access_token': credentials.get('oauth_token')[0],
        'access_token_secret': credentials.get('oauth_token_secret')[0]
    }
    return tokens


text:
require 'spec_helper'

class CardBoundarySpec < ServiceSpec
  let(:card_factory) { Services::CardFactory.new }
  let(:minor_id) { 'c_13' }
  let(:major_id) { '07' }
  let(:minor) { card_factory.get(minor_id) }
  let(:major) { card_factory.get(major_id) }
  let(:boundary) { Services::CardBoundary.new }
  let(:minor_result) { boundary.for(minor) }
  let(:major_result) { boundary.for(major) }

  it "grants access to id" do
    assert_equal minor_id, minor_result.id
    assert_equal major_id, major_result.id
  end

  it "grants access to 'arcana'" do
    assert_equal :minor,  minor_result.arcana
    assert_equal :major,  major_result.arcana
  end

  it "grants access to 'display_name" do
    assert_equal 'Queen of Cups', minor_result.display_name
    assert_equal 'The Chariot', major_result.display_name
  end

  it "grants access to 'suit'" do
    assert_equal :cups, minor_result.suit
    assert_equal :trumps, major_result.suit
  end

  it "grants access to 'elements'" do
    assert_equal [:water], minor_result.elements
    assert_equal [:water], major_result.elements
  end

  it "grants access to 'astrological_signs'" do
    assert_equal [:scorpio], minor_result.astrological_signs
    assert_equal [:cancer], major_result.astrological_signs
  end

  it "grants access to golden_dawn correspondence" do
    assert_empty minor_result.correspondence.golden_dawn
    assert_includes major_result.correspondence.golden_dawn, 'speech'
  end

  it "grants access to helper methods" do
    assert_equal true,  minor_result.is_minor
    assert_equal false, minor_result.is_major
    assert_equal false, major_result.is_minor
    assert_equal true,  major_result.is_major

    assert_equal true, minor_result.is_court_card
    assert_equal false, major_result.is_court_card
  end
end