text:
<macros>
    <macro name="trajectory_inputs" >
        <param name="inputrds" type="data" format="rdata" label="Input RDS" help="This is the output RData file given by the Cluster stage" />

            <param name="knn" type="integer" min="0" value="3" label="KNN" help="Number of nearest neighbours to consider." />
            <param name="cthr" type="integer" min="0" value="5" label="Cluster Threshold" help="Clusters to be included in the StemID analysis must have more than this number of cells" />
            <expand macro="use_defaults_no" >
                <param name="nmode" type="boolean" checked="true" label="Neighbour Mode" help="Assign a cell of a given cluster to the cluster with the smallest average distance of the knn nearest neighbours within this cluster." />
                <param name="fr" type="boolean" checked="false" label="F-R layout?" help="Use Fruchterman-Rheigold layout instead of t-SNE" />
            </expand>

            <param name="pdishuf" type="integer" min="100" value="2000" label="Shuffle Projections" help="Number of randomizations of cell positions for which to compute projections of cells on inter-cluster links" />
            <expand macro="use_defaults_no" >
                <param name="fast" type="boolean" checked="false" label="Use a fast approximate background model to infer links" />
                <param name="rseed" type="integer" value="17000" label="Random seed" />
            </expand>

            <param name="pthr" type="float" value="0.01" label="P-value cutoff" help="Cutoff for link significance. This threshold is applied for the calculation of link scores reflecting how uniformly a link is occupied by cells." />
            <param name="sensitive" type="boolean" checked="false" label="Sensitivity" help="All cells on the most highly significant link are and the link itself are disregard to test significance of the remaining links with a binomial p-value" />

            <param name="showcells" type="boolean" checked="false" label="Show Cells" help="Projections of cells are shown in the plot" />
            <param name="scthr" type="float" min="0" max="1" value="0" label="Score Threshold" help="Score threshold for links to be shown in the graph" />
            <expand macro="use_defaults_no">
                <param name="showtsne" type="boolean" checked="true" label="Show tSNE" help="Show transparent t-SNE map of cells in the background" />
                <param name="tp" type="float" min="0" max="1" value="0.5" label="Transparency" help="Level of transparency of t-SNE map" />
            </expand>

            <param name="nn" type="integer" min="0" value="1" label="Number of Neighbours" help="Number of higher order neighbours to be included for the determination of links" />
            <param name="scthr" type="float" min="0" max="1" value="0" label="Score Threshold" help="Score threshold for links to be included in the calculation" />

    </macro>
    <macro name="trajectory_tests" >
        <test>

            <param name="inputrds" value="out_cluster_default.rdat" />
            <output name="outpdf" value="out_traject_default.pdf" compare="sim_size" delta="15" />
            <output name="outrdat" value="out_traject_default.ltree.rdat" compare="sim_size" delta="15" />
        </test>
        <test>

            <param name="inputrds" value="out_cluster_default.rdat" />

                <param name="knn" value="3" />
                <param name="cthr" value="5" />
                <expand macro="test_nondef" >
                    <param name="nmode" value="true" />
                    <param name="fr" value="false" />
                </expand>

                <param name="pdishuf" value="2000" />
                <expand macro="test_nondef" >
                    <param name="fast" value="false" />
                    <param name="rseed" value="17000" />
                </expand>

                <param name="pthr" value="0.01" />
                <param name="sensitive" value="false" />

                <param name="showcells" value="false" />
                <param name="scthr" value="0" />
                <expand macro="test_nondef" >
                    <param name="showtsne" value="true" />
                    <param name="tp" value="0.5" />
                </expand>

                <param name="nn" value="1" />
                <param name="scthr" value="0" />

            <output name="outpdf" value="out_traject_default.pdf" compare="sim_size" delta="15" />
            <output name="outrdat" value="out_traject_default.ltree.rdat" compare="sim_size" delta="15" />
        </test>
        <test>

            <param name="inputrds" value="out_cluster_default.rdat" />

                <param name="knn" value="4" />
                <param name="cthr" value="4" />
                <expand macro="test_nondef" >
                    <param name="nmode" value="false" />
                    <param name="fr" value="true" />
                </expand>

                <param name="pdishuf" value="1500" />
                <expand macro="test_nondef" >
                    <param name="fast" value="true" />
                    <param name="rseed" value="1500" />
                </expand>

                <param name="pthr" value="0.05" />
                <param name="sensitive" value="true" />

                <param name="showcells" value="true" />
                <param name="scthr" value="0.5" />
                <expand macro="test_nondef" >
                    <param name="showtsne" value="false" />
                    <param name="tp" value="0.25" />
                </expand>

                <param name="nn" value="2" />
                <param name="scthr" value="0.5" />

            <output name="outpdf" value="out_traject_adv_nondef.pdf" compare="sim_size" delta="15" />
        </test>
    </macro>
    <token name="@TRAJECTORY_CHEETAH@"><![CDATA[

in.rdat = readRDS('${inputrds}')

pstc.projc = formals(projcells)
pstc.projc\$knn = as.integer( '$projcell.knn' )
pstc.projc\$cthr = as.integer( '$projcell.cthr' )
#if str($projcell.use.def) == "no":
pstc.projc\$nmode = as.logical( '$projcell.use.nmode' )
pstc.projc\$fr = as.logical( '$projcell.use.fr' )
#end if

pstc.projb = formals(projback)
pstc.projb\$pdishuf = as.integer( '$projback.pdishuf' )
#if str($projback.use.def) == "no":
pstc.projb\$fast = as.logical( '$projback.use.fast' )
pstc.projb\$rseed = as.integer( '$projback.use.rseed' )
#end if

pstc.comppval = formals(comppvalue)
pstc.comppval\$pthr = as.numeric( '$comppval.pthr' )
pstc.comppval\$sensitive = as.logical( '$comppval.sensitive' )

pstc.plotgraph = formals(plotgraph)
pstc.plotgraph\$showCells = as.logical( '$plotgraph.showcells' )
pstc.plotgraph\$scthr = as.numeric( '$plotgraph.scthr' )
#if str($plotgraph.use.def) == "no":
pstc.plotgraph\$showTsne = as.logical( '$plotgraph.use.showtsne' )
pstc.plotgraph\$tp = as.numeric( '$plotgraph.use.tp' )
#end if

pstc.compscore = formals(compscore)
pstc.compscore\$nn = as.integer( '$compscore.nn' )
pstc.compscore\$scthr = as.numeric( '$compscore.scthr' )

out.pdf='${outpdf}'
out.rdat='${outrdat}'
    ]]>
    </token>
</macros>


text:
<?php namespace Bogardo\Multiauth\Entity;

use Illuminate\Support\Collection;

/**
 * Class EntityCollection
 *
 * @package Bogardo\Multiauth\Entity
 */
class EntityCollection extends Collection
{

    /**
     * Convert configuration array to multiauth entities
     *
     * @param array $items
     */
    public function setConfig(array $items = [])
    {
        foreach ($items as $item) {
            $this->push(new Entity($item));
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
require "date"
require "active_support/core_ext/string/inflections"

module MetricsSatellite
  module Filer
    EXT = "txt"

    private

    def pathname
      Pathname.new(filepath)
    end

    def filepath
      "#{directory}/#{filename}"
    end

    def directory
      options[:startup_path].join(reports, name)
    end

    def create_directory
      FileUtils.mkdir_p(directory)
    end

    def filename
      "#{date}.#{ext}"
    end

    def date
      Date.today.strftime("%Y-%m-%d")
    end

    def file
      File.open(filepath, "w")
    end

    def name
      tool_name.underscore
    end

    def tool_name
      single_class_name.gsub(/Summarizer$|Collector$/, "")
    end

    def single_class_name
      self.class.to_s.split("::").last
    end

    def ext
      self.class::EXT
    end

    def reports
      options[:reports] || "reports"
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BussinesEntities;
using System.Windows.Forms;

namespace WindowsRA1.Recepcion.caja_de_cobro
{
    public partial class frmCobroDelPaciente : Form
    {
        List<EstudioRF01> estudios = new List<EstudioRF01>();
        public frmCobroDelPaciente()
        {
            InitializeComponent();
        }

        private void frmCobroDelPaciente_Load(object sender, EventArgs e)
        {
            EstudioRF01 est = new EstudioRF01();
            est.Id = 1;
            est.Nombre = "Chequeo";
            est.Descripcion = "Se checará la presión arterial";
            est.Categoría = "Tomografía";
            est.Costo = 150;
            estudios.Add(est);

            dataGridView1.DataSource = estudios;

            txtTotal.Text = estudios[0].Costo.ToString();
            txtNombrePacDeu.Text = "Juan";
            txtApellidoPacDeu.Text = "Limas";

            txtResiPacDeu.Text = "Calle Rio Nazas #128 Jardines del Canadá";
            txtTotal.Text = estudios[0].Costo.ToString();

        }

        private void txtEfectivo_TextChanged(object sender, EventArgs e)
        {
            double efectivo;
            double cambio;
            if (!string.IsNullOrEmpty(txtEfectivo.Text))
            {

                efectivo = Convert.ToDouble(txtEfectivo.Text.Trim().ToString());
                cambio = efectivo - estudios[0].Costo;
                txtCambio.Text = cambio.ToString();

            }
            else
            {
                txtCambio.Text = "0.0";
            }
        }

        private void btnPagar_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Servicio pagado");

        }

        private void btnImprimir_Click(object sender, EventArgs e)
        {
            frmImprimirPago pago = new frmImprimirPago();
            pago.ShowDialog();
        }
    }
}


text:
.foundryDialog {
	background:url(images/333-50.png);
	padding:5px;
	border:1px solid #333;
	border-radius:8px;
	-moz-border-radius:8px;
	-webkit-border-radius:8px;
}

.foundryDialog.resizing {
	padding-bottom:7px;
}

.foundryDialog .dialog-wrap {
	border:1px solid #333;
	border-radius:4px;
	-moz-border-radius:4px;
	-webkit-border-radius:4px;
	background:#fff;
	overflow:hidden;
	min-height:100%;
	height:100%;
	/* this is so when resize from big to small, contents don't overflow */
}

.foundryDialog .dialog-wrap > .in {
	position:relative;
	/* this is so inner contents can be positioned when resizing */
}

.foundryDialog .dialog-head {
	font:700 14px/30px Arial;
	height:30px;
	padding:0 9px;
	border-top:1px solid #f5f5f5;
	border-bottom:1px solid #666;
	background:#eaeaea;
	color:#444!important;
	border-radius:4px 4px 0 0;
	-moz-border-radius:4px 4px 0 0;
	-webkit-border-radius:4px 4px 0 0;
	position:relative;
}

.foundryDialog .dialog-body {
	background: #fff;
	padding: 10px;
}

.foundryDialog .dialog-body.type-iframe {
 	padding: 0;
}

.foundryDialog .dialog-footer {
  background:#fafafa;
  border-top:1px solid #aaa;
  padding:6px;
  border-radius:0 0 4px 4px;
  -moz-border-radius:0 0 4px 4px;
  -webkit-border-radius:0 0 4px 4px;
}

.foundryDialog .dialog-buttons {
  text-align:right;
}

.foundryDialog .dialog-closeButton {
  background:url(images/cross-8.png) center;
  display:block;
  text-indent:-9999px;
  width:8px;
  height:8px;
  position:absolute!important;
  right:10px;
  top:50%;
  margin-top:-4px;
  opacity:0.4;
  cursor: pointer;
}

.foundryDialog .dialog-closeButton:hover {
  opacity:0.7;
}

.foundryDialog .dialog-loader {
  position:absolute;
  background:rgba(255,255,255,0.5);
  z-index:9999;
}

.foundryDialog .loader-img {
  background:url(images/ajax-loader.gif) center no-repeat;
  width:32px;
  height:32px;
  position:absolute;
  top:50%;
  left:50%;
  margin:-16px 0 0 -16px;
}


text:
require "magentify/version"

module Magentify
  # Your code goes here...
end


text:
'*******************************************************************************************'
'                                                                                '
' Download Free Evaluation Version From:     https://bytescout.com/download/web-installer   '
'                                                                                '
' Also available as Web API! Get free API Key https://app.pdf.co/signup                     '
'                                                                                '
' Copyright © 2017-2020 ByteScout, Inc. All rights reserved.                                '
' https://www.bytescout.com                                                                 '
' https://www.pdf.co                                                                        '
'*******************************************************************************************'

Imports System.Drawing
Imports Bytescout.Spreadsheet

Module Program

    Sub Main()

        Try

            ' STEP-1: Get Invoice Data
            Dim oInvoiceData = GetInvoiceData()

            ' STEP-2: Generate Invoice in memory
            Dim document = _GetSpreadsheet(oInvoiceData)

            ' Step-3: Export to XLS, XLSX and PDF
            document.SaveAsXLSX("Invoice.xlsx")
            document.SaveAsXLS("Invoice.xls")
            document.SaveAsPDF("Invoice.pdf")

            ' Open output file
            Process.Start("Invoice.xlsx")
            Process.Start("Invoice.pdf")

        Catch ex As Exception
            Console.WriteLine(ex.Message)
        End Try

        Console.WriteLine("Press enter key to exit...")
        Console.ReadLine()
    End Sub

    ''' <summary>
    ''' Get Spreadsheet
    ''' </summary>
    Private Function _GetSpreadsheet(ByVal oInvoiceData As InvoiceData) As Spreadsheet

        ' Create new Spreadsheet
        Dim document As Spreadsheet = New Spreadsheet()
        document.Workbook.AutoCalculation = True
        document.Workbook.DefaultFont = New SpreadsheetFont("Arial", 10)

        ' Add new worksheet
        Dim Sheet As Worksheet = document.Workbook.Worksheets.Add("Invoice")

        Dim startRow As Integer = 0

        ' 1. Write Company Name
        Sheet.Cell(startRow, 0).Value = oInvoiceData.CompanyName
        Sheet.Cell(startRow, 0).Font = New Font("Arial", 15, FontStyle.Bold Or FontStyle.Italic)

        ' 2. Write Company Address
        Sheet.Cell((System.Threading.Interlocked.Increment(startRow)), 0).Value = oInvoiceData.CompanyAddress1
        Sheet.Cell((System.Threading.Interlocked.Increment(startRow)), 0).Value = oInvoiceData.CompanyAddress2
        startRow += 1

        ' 3. Write Invoice Info
        Sheet.Cell((System.Threading.Interlocked.Increment(startRow)), 2).Value = "Invoice No."
        Sheet.Cell(startRow, 2).Font = New Font("Arial", 10, FontStyle.Bold)
        Sheet.Cell(startRow, 2).AlignmentHorizontal = Bytescout.Spreadsheet.Constants.AlignmentHorizontal.Right

        Sheet.Cell(startRow, 3).Value = oInvoiceData.InvoiceNo

        Sheet.Cell((System.Threading.Interlocked.Increment(startRow)), 2).Value = "Invoice Date."
        Sheet.Cell(startRow, 2).Font = New Font("Arial", 10, FontStyle.Bold)
        Sheet.Cell(startRow, 2).AlignmentHorizontal = Bytescout.Spreadsheet.Constants.AlignmentHorizontal.Right

        Sheet.Cell(startRow, 3).ValueAsDateTime = oInvoiceData.InvoiceDate
        Sheet.Cell(startRow, 3).NumberFormatString = "mm/dd/yyyy"

        ' 4. Write Client Info
        Sheet.Cell((System.Threading.Interlocked.Increment(startRow)), 0).Value = oInvoiceData.ClientName
        Sheet.Cell(startRow, 0).Font = New Font("Arial", 12, FontStyle.Bold)

        Sheet.Cell((System.Threading.Interlocked.Increment(startRow)), 0).Value = oInvoiceData.ClientAddress1
        Sheet.Cell((System.Threading.Interlocked.Increment(startRow)), 0).Value = oInvoiceData.ClientAddress2

        startRow += 1

        ' 5. Write Notes
        Sheet.Cell((System.Threading.Interlocked.Increment(startRow)), 0).Value = "Notes"
        Sheet.Cell(startRow, 0).Font = New Font("Arial", 12, FontStyle.Bold)
        Sheet.Cell((System.Threading.Interlocked.Increment(startRow)), 0).Value = oInvoiceData.Notes

        startRow += 2

        ' 6. Add Product Listing
        Dim startAddress As String = ""
        Dim endAddress As String = ""

        Sheet.Cell((System.Threading.Interlocked.Increment(startRow)), 0).Value = "Item"
        _AddAllBorders(Sheet.Cell(startRow, 0))
        Sheet.Cell(startRow, 0).Font = New Font("Arial", 11, FontStyle.Bold)

        Sheet.Cell(startRow, 1).Value = "Quantity"
        _AddAllBorders(Sheet.Cell(startRow, 1))
        Sheet.Cell(startRow, 1).AlignmentHorizontal = Bytescout.Spreadsheet.Constants.AlignmentHorizontal.Right
        Sheet.Cell(startRow, 1).Font = New Font("Arial", 11, FontStyle.Bold)

        Sheet.Cell(startRow, 2).Value = "Price"
        _AddAllBorders(Sheet.Cell(startRow, 2))
        Sheet.Cell(startRow, 2).AlignmentHorizontal = Bytescout.Spreadsheet.Constants.AlignmentHorizontal.Right
        Sheet.Cell(startRow, 2).Font = New Font("Arial", 11, FontStyle.Bold)

        Sheet.Cell(startRow, 3).Value = "Total"
        _AddAllBorders(Sheet.Cell(startRow, 3))
        Sheet.Cell(startRow, 3).AlignmentHorizontal = Bytescout.Spreadsheet.Constants.AlignmentHorizontal.Right
        Sheet.Cell(startRow, 3).Font = New Font("Arial", 11, FontStyle.Bold)

        For i As Integer = 0 To oInvoiceData.lstProducts.Count - 1

            Sheet.Cell((System.Threading.Interlocked.Increment(startRow)), 0).Value = oInvoiceData.lstProducts(i).ProductName
            _AddAllBorders(Sheet.Cell(startRow, 0))

            Sheet.Cell(startRow, 1).Value = oInvoiceData.lstProducts(i).Quantity
            Sheet.Cell(startRow, 1).AlignmentHorizontal = Bytescout.Spreadsheet.Constants.AlignmentHorizontal.Right
            _AddAllBorders(Sheet.Cell(startRow, 1))

            Sheet.Cell(startRow, 2).Value = oInvoiceData.lstProducts(i).Price
            Sheet.Cell(startRow, 2).AlignmentHorizontal = Bytescout.Spreadsheet.Constants.AlignmentHorizontal.Right
            _AddAllBorders(Sheet.Cell(startRow, 2))

            ' Calculated cell
            Dim formulaMultiplication As String = String.Format("={0}*{1}", Sheet.Cell(startRow, 1).GetAddress().ToString(), Sheet.Cell(startRow, 2).GetAddress().ToString())
            Sheet.Cell(startRow, 3).Formula = formulaMultiplication
            Sheet.Cell(startRow, 3).AlignmentHorizontal = Bytescout.Spreadsheet.Constants.AlignmentHorizontal.Right
            _AddAllBorders(Sheet.Cell(startRow, 3))

            ' Address to be used for total sum
            If i = 0 Then
                startAddress = Sheet.Cell(startRow, 3).GetAddress().ToString()
            End If
            endAddress = Sheet.Cell(startRow, 3).GetAddress().ToString()

        Next

        Sheet.Cell((System.Threading.Interlocked.Increment(startRow)), 2).Value = "TOTAL"
        Sheet.Cell(startRow, 2).AlignmentHorizontal = Constants.AlignmentHorizontal.Right
        Sheet.Cell(startRow, 2).Font = New Font("Arial", 11, FontStyle.Bold)

        Dim formulaTotalSum As String = String.Format("=SUM({0}:{1})", startAddress, endAddress)
        Sheet.Cell(startRow, 3).Formula = formulaTotalSum
        Sheet.Cell(startRow, 3).Font = New Font("Arial", 11, FontStyle.Bold)
        Sheet.Cell(startRow, 3).AlignmentHorizontal = Bytescout.Spreadsheet.Constants.AlignmentHorizontal.Right

        ' AutoFit all columns
        Sheet.Columns.Item(0).AutoFit()
        Sheet.Columns.Item(1).AutoFit()
        Sheet.Columns.Item(2).AutoFit()
        Sheet.Columns.Item(3).AutoFit()

        ' Return all formatted document
        Return document

    End Function

    ''' <summary>
    ''' Add borders to cell
    ''' </summary>
    Private Sub _AddAllBorders(ByVal cell As Cell)
        cell.LeftBorderStyle = Bytescout.Spreadsheet.Constants.LineStyle.Thin
        cell.RightBorderStyle = Bytescout.Spreadsheet.Constants.LineStyle.Thin
        cell.TopBorderStyle = Bytescout.Spreadsheet.Constants.LineStyle.Thin
        cell.BottomBorderStyle = Bytescout.Spreadsheet.Constants.LineStyle.Thin
    End Sub

    ''' <summary>
    ''' Gets Sample invoice data
    ''' </summary>
    Private Function GetInvoiceData() As InvoiceData
        Dim oRet = New InvoiceData With {
            .CompanyName = "Your Company Name",
            .CompanyAddress1 = "Your Address",
            .CompanyAddress2 = "City, State Zip",
            .ClientName = "Client Name",
            .ClientAddress1 = "Address",
            .ClientAddress2 = "City, State Zip",
            .InvoiceNo = "123456",
            .InvoiceDate = DateTime.Now,
            .Notes = "Some notes...",
            .lstProducts = New List(Of InvoiceProduct) From {
                New InvoiceProduct With {
                    .ProductName = "Product 1",
                    .Price = 30,
                    .Quantity = 10
                },
                New InvoiceProduct With {
                    .ProductName = "Product 2",
                    .Price = 40,
                    .Quantity = 30
                },
                New InvoiceProduct With {
                    .ProductName = "Product 3",
                    .Price = 50,
                    .Quantity = 15
                },
                New InvoiceProduct With {
                    .ProductName = "Product 4",
                    .Price = 20,
                    .Quantity = 20
                }
            }
        }
        Return oRet
    End Function

#Region "Invoice Class"

    Public Class InvoiceData
        Public Sub New()
            lstProducts = New List(Of InvoiceProduct)()
        End Sub

        Public Property CompanyName As String
        Public Property CompanyAddress1 As String
        Public Property CompanyAddress2 As String
        Public Property InvoiceNo As String
        Public Property InvoiceDate As DateTime
        Public Property ClientName As String
        Public Property ClientAddress1 As String
        Public Property ClientAddress2 As String
        Public Property Notes As String
        Public Property lstProducts As List(Of InvoiceProduct)
    End Class

    Public Class InvoiceProduct
        Public Property ProductName As String
        Public Property Quantity As Integer
        Public Property Price As Decimal
    End Class

#End Region

End Module


text:
/**
* getAwesomePeople
*/
var getAwesomePeople = function(success, error) {
    var httpRequest;

    function makeRequest(url) {
        httpRequest = new XMLHttpRequest();
        httpRequest.onreadystatechange = handleCallbacks;
        httpRequest.open('GET', url);
        httpRequest.send();
    }

    function handleCallbacks() {
        if (httpRequest.readyState === XMLHttpRequest.DONE) {
            if (httpRequest.status === 200) {
                console.log(httpRequest.responseText);
                success(httpRequest.responseText);
            } else {
                error(httpRequest.responseText);
            }
        }
    }

    makeRequest('https://api.github.com/repos/Rabrennie/anything.js/contributors');
};

anything.prototype.getAwesomePeople = getAwesomePeople;


text:
package org.jclouds.dynect.v3.parse;
import static org.jclouds.dynect.v3.domain.rdata.AData.a;

import javax.ws.rs.Consumes;
import javax.ws.rs.core.MediaType;

import org.jclouds.dynect.v3.domain.Record;
import org.jclouds.dynect.v3.domain.rdata.AData;
import org.jclouds.dynect.v3.internal.BaseDynECTParseTest;
import org.jclouds.rest.annotations.SelectJson;
import org.testng.annotations.Test;

@Test(groups = "unit")
public class GetARecordResponseTest extends BaseDynECTParseTest<Record<AData>> {

   @Override
   public String resource() {
      return "/get_record_a.json";
   }

   @Override
   @SelectJson("data")
   @Consumes(MediaType.APPLICATION_JSON)
   public Record<AData> expected() {
      return Record.<AData> builder()
                   .zone("egg.org")
                   .fqdn("egg.org")
                   .type("A")
                   .id(50959331)
                   .ttl(86400)
                   .rdata(a("1.1.1.1"))
                   .build();
   }
}


text:
@protocol YWMessageSearchFriendAddCellDelegate <NSObject>

- (void)addFriends;

@end
@interface YWMessageSearchFriendAddCell : UITableViewCell

@property (nonatomic,strong)YWMessageSearchFriendAddModel * model;
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UIButton *addFriendBtn;
@property (nonatomic,assign) id<YWMessageSearchFriendAddCellDelegate>delegate;
@end


text:
Slack-VC is a Slack integration to look up famous Venture Capital's portfolio list. It's built for startup enthusiasts! 😇
![Example](http://g.recordit.co/F1OKTHKVfu.gif)

![companies](http://g.recordit.co/QJ0fFfVxpm.gif)

## Coverage
Currently, the VCs supported and corresponding commands:

- [a16z](http://a16z.com/) (a16z)
- [Founders Fund](http://foundersfund.com/) (ff)
- [Google Ventures](http://www.gv.com/) (gv)
- [GreyLock Partners](http://www.greylock.com/) (greylock)
- [Khosla Ventures](http://www.khoslaventures.com/) (khosla)
- [Sequoia Capital](https://www.sequoiacap.com/) (sequoia)
- [KPCB](http://www.kpcb.com/) (kpcb)

## Integrate with your Slack

![Integration](http://g.recordit.co/JKXbspnUcc.gif)
1. Go to one of your Slack channel.
2. Click the **Channel Settings**.
3. In the settings menu, click the **Add an app or integration**.
4. In the top menu bar, click **Manage**, then click the **Custom Integrations** on the left menu bar.
5. Click **Slash Commands**.
6. Click **Add Configuration**.
  - Command: /vc
  - URL: https://slack-vc.herokuapp.com/
  - Method: **POST**
  - In the Autocomplete help text section, check to allow autocomplete.
    - Description: VC's portfolio list, articles is in Slack now!
    - Usage hint: [VC name +  Space + Option]
7. All set!

## Usage
After adding Slack-VC integration to your team, within any channel of your team,
- To look up portfolio, in your input box, simply type **/vc [VC name + space + p]**
  - For example: **/vc a16z p**
- To look up a company's backed investors, simply type **/vc [company name + space + i]**
  - For example: **/vc instagram i**

## To test on your machine
- Clone the repo.
```
$git clone https://github.com/wang502/slack-vc
$cd slack-vc`
$pip install -r requirement.txt
$python app.py
```

- Server is up and running locally, open another terminal.
```
$curl --data "text=iconfinder i" http://0.0.0.0:5000/
```

- You will see the message returned.


text:
A project to run on Linux, and allow Core Java programs to be executed via web browser from any connected node.
This is an open source project, one is definitely open to suggestions and addition of more features.
More programming languages are being added to the project. The project is under development using Java as language instead of PHP.
The project will soon be available globally. Actions will soon taken for such using AWS.

Follow this step to run the project:
1. Install apache, php and mysql in your Linux OS
2. Make a databse 'dbtest', a table 'users' under it and 3 columns, 'rollnumber', 'email', 'password' in it.
3. Make sure password is atleast 32 in varchar, since it is in MD5. Make any of the column as primary key(not necessary).
4. Make sure the database user and password matches in the file 'dbconnect.php'
5. Run the project with localhost on same computer or with it's IP on a connected node.

For any help/assistance, search for problems on Google. Still not helpful? Email: anandabhishek58@gmail.com or call +91-7415828201


text:
package com.google.devtools.kythe.platform.kzip;

import java.io.File;

final class TestDataUtil {

  // This must match the name from the workspace(name={name}) rule in the root WORKSPACE file.
  private static final String DEFAULT_WORKSPACE = "io_kythe";

  /**
   * Load a test kzip file from one of the files provided to the test. See the BUILD target of the
   * test for the list of files that can be accessed.
   */
  static File getTestFile(String name) {
    File testDataRoot = new File(TestDataUtil.getTestRoot(), "kythe/cxx/common/testdata");
    return new File(testDataRoot, name);
  }

  private static File getTestRoot() {
    String testSrcDir = System.getenv("TEST_SRCDIR");
    if (testSrcDir == null) {
      throw new RuntimeException("TEST_SRCDIR cannot be null when executing tests.");
    }
    String workspace = System.getenv("TEST_WORKSPACE");
    if (workspace == null) {
      workspace = DEFAULT_WORKSPACE;
    }
    return new File(testSrcDir, workspace);
  }
}


text:
package org.jenkinsci.plugins.workflow.steps;

import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.ListenableFuture;
import hudson.EnvVars;
import hudson.FilePath;
import hudson.Launcher;
import hudson.model.Computer;
import hudson.model.Executor;
import hudson.model.Result;
import hudson.model.Run;
import hudson.model.TaskListener;

import javax.annotation.Nullable;
import java.io.IOException;
import java.io.Serializable;

/**
 * An implicit context available to every {@link Step}.
 * In a flow, would be created by a {@code FlowExecution}.
 * It is serializable so a step which may survive a Jenkins restart is free to save it.
 *
 *

 * {@link StepContext} is only valid until the result is set via {@link FutureCallback}.
 * Beyond that point, callers are not allowed to call any of the methods.
 */
public abstract class StepContext implements FutureCallback<Object>, Serializable {

    /**
     * Tries to find a contextually available object.
     * Suggested types:
     *

     *
{@link Launcher}
a way to fork processes
     *
{@link EnvVars}
read access to environment variables associated with a run, typically used for launchers
     *
{@link FilePath}
a "workspace" to use for example as from {@link hudson.Launcher.ProcStarter#pwd(hudson.FilePath)}
     *
{@link Computer}
a slave we are running on
     *
{@link Executor}
an executor slot on a slave we are running on
     *
{@link TaskListener}
a place to send output (see {@code LogAction} for a flow)
     *
{@link Run}
a running build
     *
{@code FlowExecution} a running flow
     *
{@code FlowNode}
a running node in a flow
     *

     * @param key the kind of thing we want
     * @return that service, if available (which it should be if {@link StepDescriptor#getRequiredContext} includes it), else null
     *
     * @throws IOException
     *      If {@link StepContext} gets serialized, Jenkins restarts, deserialized later, and
     *      {@link Step} tries to get additional context objects, it can be that the corresponding
     *      {@code FlowExecution} could be non-existent (for example, the run that was driving the flow
     *      could have failed to load.) This exception is thrown in such situations just like
     *      {@code FlowExecutionOwner.get} throws IOException.
     */
    public abstract @Nullable <T> T get(Class<T> key) throws IOException, InterruptedException;

    @Override public abstract void onSuccess(@Nullable Object result);

    /**
     * Whether {@link #get} is ready to return values.
     * May be called to break deadlocks during reloading.
     * @return true normally, false if we are still reloading the context, for example during unpickling
     */
    public abstract boolean isReady();

    /**
     * Requests that any state held by the {@link StepExecution} be saved to disk.
     * Useful when a long-running step has changed some instance fields (or the content of a final field) and needs these changes to be recorded.
     * An implementation might in fact save more state than just the associated step execution, but it must save at least that much.
     * @return a future letting you know if and when the state was in fact saved
     */
    public abstract ListenableFuture<Void> saveState();

    /**
     * Sets the overall result of the flow.
     * Like {@link Run#setResult}, can only make the result worse than it already is.
     * Since some flows may have try-catch semantics, if a step fails to complete normally it is better to use {@link #onFailure(Throwable)} instead.
     * (For example with {@link FlowInterruptedException}.)
     * @param r {@link Result#UNSTABLE}, typically
     */
    public abstract void setResult(Result r);

    /**
     * Prepares for an asynchronous invocation of the body block that's given as an argument
     * to this step invocation (in a host language dependent manner.)
     *
     *

     * When the block is completed normally or abnormally, you can have
     * {@linkplain BodyInvoker#withCallback(FutureCallback) have the callback invoked}.
     * The invocation will not get scheduled until {@linkplain BodyInvoker#start() you start it}.
     *
     *

     * {@link StepDescriptor#takesImplicitBlockArgument} must be true.
     */
    public abstract BodyInvoker newBodyInvoker();

    /**
     * {@link StepContext}s get persisted, so they may not have the identity equality, but equals
     * method would allow two instances to be compared.
     *
     * @return
     *      true if {@link StepContext}s are for the same context for the same execution.
     */
    public abstract boolean equals(Object o);

    /**
     * Needs to be overridden as the {@link #equals(Object)} method is overridden.
     */
    @Override
    public abstract int hashCode();

    private static final long serialVersionUID = 1L;
}


text:
using namespace ray::api;

/// general function of user code
int Plus1(int x) { return x + 1; }

/// a class of user code
class Counter {
 public:
  int count;

  Counter(int init) { count = init; }

  static Counter *FactoryCreate(int init) { return new Counter(init); }
  /// non static function
  int Add(int x) {
    count += x;
    return count;
  }
};

TEST(RayClusterModeTest, FullTest) {
  /// initialization to cluster mode
  ray::api::RayConfig::GetInstance()->run_mode = RunMode::CLUSTER;
  /// TODO(Guyang Song): add the dynamic library name
  ray::api::RayConfig::GetInstance()->lib_name = "";
  Ray::Init();

  /// put and get object
  auto obj = Ray::Put(12345);
  auto get_result = *(Ray::Get(obj));
  EXPECT_EQ(12345, get_result);

  auto task_obj = Ray::Task(Plus1, 5).Remote();
  int task_result = *(Ray::Get(task_obj));
  EXPECT_EQ(6, task_result);

  ActorHandle<Counter> actor = Ray::Actor(Counter::FactoryCreate, 1).Remote();
  auto actor_object = actor.Task(&Counter::Add, 5).Remote();
  int actor_task_result = *(Ray::Get(actor_object));
  EXPECT_EQ(6, actor_task_result);

  Ray::Shutdown();
}

/// TODO(Guyang Song): Separate default worker from this test.
/// Currently, we compile `default_worker` and `cluster_mode_test` in one single binary,
/// to work around a symbol conflicting issue.
/// This is the main function of the binary, and we use the `is_default_worker` arg to
/// tell if this binary is used as `default_worker` or `cluster_mode_test`.
int main(int argc, char **argv) {
  const char *default_worker_magic = "is_default_worker";
  /// `is_default_worker` is the last arg of `argv`
  if (argc > 1 &&
      memcmp(argv[argc - 1], default_worker_magic, strlen(default_worker_magic)) == 0) {
    default_worker_main(argc, argv);
    return 0;
  }
  ::testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}


text:
import * as Hub from "../../../hub"
import { MissingAuthError } from "./missing_auth_error"

type HubTypes = Hub.ActionResponse | Hub.ActionForm

export class WrappedResponse<T extends HubTypes> {
  errorPrefix = ""
  private _hubResp: T

  constructor(klass: new () => T) {
    this._hubResp = new klass()
  }

  set form(form: T) {
    this._hubResp = form
  }

  returnError(err: Error) {
    if (err instanceof MissingAuthError) {
      this.resetState()
    }
    this.setError(err)
    return this._hubResp
  }

  returnSuccess(userState?: any) {
    if (userState) {
      this.setUserState(userState)
    }
    return this._hubResp
  }

  setError(err: Error) {
    if (this._hubResp instanceof Hub.ActionResponse) {
      this._hubResp.success = false
      this._hubResp.message = this.errorPrefix + err.toString()
    } else if (this._hubResp instanceof Hub.ActionForm) {
      err.message = this.errorPrefix + err.message
      this._hubResp.error = err
    }
  }

  resetState() {
    this._hubResp.state = new Hub.ActionState()
    this._hubResp.state.data = "reset"
  }

  setUserState(userState: any) {
    this._hubResp.state = new Hub.ActionState()
    this._hubResp.state.data = JSON.stringify(userState)
  }
}


text:
package gov.cdc.epiinfo.interpreter;

import com.creativewidgetworks.goldparser.engine.Reduction;

public class Rule_MultExp extends EnterRule
{
    EnterRule PowExp = null;
    String op = null;
    EnterRule MultExp = null;

    public Rule_MultExp(Rule_Context pContext, Reduction pToken)
    {
    	super(pContext);
        /*::= <Pow Exp> '*' <Mult Exp>
							| <Pow Exp> '/' <Mult Exp>
							| <Pow Exp> MOD <Mult Exp>
							| <Pow Exp> '%' <Mult Exp>
        							| <Pow Exp>*/

        this.PowExp = EnterRule.BuildStatements(pContext, (Reduction) pToken.get(0).getData());
        if(pToken.size() > 1)
        {
            this.op = this.ExtractIdentifier(pToken.get(1));

            this.MultExp = EnterRule.BuildStatements(pContext, (Reduction) pToken.get(2).getData());
        }
    }

    /// <summary>
    /// performs execution of the (/, MOD and %) operators
    /// </summary>
    /// <returns>object</returns>
    @Override
    public Object Execute()
    {
        Object result = null;

        if (op == null)
        {
            result = this.PowExp.Execute();
        }
        else
        {
            Object LHSO = this.PowExp.Execute();
            Object RHSO = this.MultExp.Execute();

            if (LHSO instanceof Number)
            {
                LHSO = LHSO;
            }

            if (RHSO instanceof Number)
            {
                RHSO = RHSO;
            }

            switch (Operator_Enum.Convert(op))
            {
                case mul:
                    /*if ((LHSO instanceof TimeSpan) && (RHSO instanceof TimeSpan))
                    {
                        result = ((TimeSpan)LHSO).TotalDays * ((TimeSpan)RHSO).TotalDays;
                    }
                    else if ((LHSO instanceof TimeSpan) && (RHSO instanceof Double))
                    {
                        result = ((TimeSpan)LHSO).TotalDays * (Double)RHSO;
                    }
                    else if ((LHSO instanceof Double) && (RHSO instanceof TimeSpan))
                    {
                        result = (Double)LHSO * ((TimeSpan)RHSO).TotalDays;
                    }
                    else*/ if ((LHSO instanceof Double) && (RHSO instanceof Double))
                    {
                        result = (Double)LHSO * (Double)RHSO;
                    }
                    break;
                case div:
                    /*if ((LHSO instanceof TimeSpan) && (RHSO instanceof TimeSpan))
                    {
                        result = ((TimeSpan)LHSO).TotalDays / ((TimeSpan)RHSO).TotalDays;
                    }
                    else if ((LHSO instanceof TimeSpan) && (RHSO instanceof Double))
                    {
                        result = ((TimeSpan)LHSO).TotalDays / (Double)RHSO;
                    }
                    else if ((LHSO instanceof Double) && (RHSO instanceof TimeSpan))
                    {
                        result = (Double)LHSO / ((TimeSpan)RHSO).TotalDays;
                    }
                    else*/ if ((LHSO instanceof Double) && (RHSO instanceof Double))
                    {
                        result = (Double)LHSO / (Double)RHSO;
                    }
                    break;
                case mod:
                    /*if ((LHSO instanceof TimeSpan) && (RHSO instanceof TimeSpan))
                    {
                        result = ((TimeSpan)LHSO).TotalDays % ((TimeSpan)RHSO).TotalDays;
                    }
                    else if ((LHSO instanceof TimeSpan) && (RHSO instanceof Double))
                    {
                        result = ((TimeSpan)LHSO).TotalDays % (Double)RHSO;
                    }
                    else if ((LHSO instanceof Double) && (RHSO instanceof TimeSpan))
                    {
                        result = (Double)LHSO % ((TimeSpan)RHSO).TotalDays;
                    }
                    else*/ if ((LHSO instanceof Double) && (RHSO instanceof Double))
                    {
                        result = (Double)LHSO % (Double)RHSO;
                    }

                    break;
                  default:
                	  break;
            }
        }

        return result;
    }
}


text:
    This is a binding Agreement between Aureus, Inc. (“Aureus” or “We”) and the person, persons, or entity (“You” or “Your”) using the service, Software, or application (“Software”).

    RIGHTS AND OBLIGATIONS

    Aureus provides the Software solely on the terms and conditions set forth in this Agreement and on the condition that You accept and comply with them. By using the Software You (a) accept this Agreement and agree that You are legally bound by its terms; and (b) represent and warrant that: (i) You are of legal age to enter into a binding agreement; and (ii) if You are a corporation, governmental organization or other legal entity, You have the right, power and authority to enter into this Agreement on behalf of the corporation, governmental organization or other legal entity and bind them to these terms.

    This Software functions as a free, open source, and multi-signature digital wallet. The Software does not constitute an account where We or other third parties serve as financial intermediaries or custodians of Your aureus(s).

    While the Software has undergone beta testing and continues to be improved by feedback from the open-source user and developer community, We cannot guarantee there will not be bugs in the Software. You acknowledge that Your use of this Software is at Your own discretion and in compliance with all applicable laws. You are responsible for safekeeping Your passwords, private key pairs, PINs, and any other codes You use to access the Software.

    IF YOU LOSE ACCESS TO YOUR AUREUS WALLET OR YOUR ENCRYPTED PRIVATE KEYS AND YOU HAVE NOT SEPARATELY STORED A BACKUP OF YOUR WALLET AND CORRESPONDING PASSWORD, YOU ACKNOWLEDGE AND AGREE THAT ANY AUREUS YOU HAVE ASSOCIATED WITH THAT WALLET WILL BECOME INACCESSIBLE. All transaction requests are irreversible. The authors of the Software, employees and affiliates of Aureus, copyright holders, and Aureus, Inc. cannot retrieve Your private keys or passwords if You lose or forget them and cannot guarantee transaction confirmation as they do not have control over the aureus network.

    DISCLAIMER

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OF THE SOFTWARE, EMPLOYEES AND AFFILIATES OF AUREUS, COPYRIGHT HOLDERS, OR AUREUS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    IN NO EVENT WILL AUREUS OR ITS AFFILIATES, OR ANY OF ITS OR THEIR RESPECTIVE SERVICE PROVIDERS, BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY USE, INTERRUPTION, DELAY OR INABILITY TO USE THE SOFTWARE, LOST REVENUES OR PROFITS, DELAYS, INTERRUPTION OR LOSS OF SERVICES, BUSINESS OR GOODWILL, LOSS OR CORRUPTION OF DATA, LOSS RESULTING FROM SYSTEM OR SYSTEM SERVICE FAILURE, MALFUNCTION OR SHUTDOWN, FAILURE TO ACCURATELY TRANSFER, READ OR TRANSMIT INFORMATION, FAILURE TO UPDATE OR PROVIDE CORRECT INFORMATION, SYSTEM INCOMPATIBILITY OR PROVISION OF INCORRECT COMPATIBILITY INFORMATION OR BREACHES IN SYSTEM SECURITY, OR FOR ANY CONSEQUENTIAL, INCIDENTAL, INDIRECT, EXEMPLARY, SPECIAL OR PUNITIVE DAMAGES, WHETHER ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT, BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE) OR OTHERWISE, REGARDLESS OF WHETHER SUCH DAMAGES WERE FORESEEABLE AND WHETHER OR NOT WE WERE ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

    INTELLECTUAL PROPERTY

    We retain all right, title, and interest in and to the Content and all of Aureus's brands, logos, and trademarks, including, but not limited to, Aureus, Inc., Aureus, Aureus – Secure Wallet, Aureus Wallet, Aureus App, Aureus Prepaid Card, and variations of the wording of the aforementioned brands, logos, and trademarks.

    CHOICE OF LAW

    This Agreement, and its application and interpretation, shall be governed exclusively by the laws of the State of Maryland, without regard to its conflict of law rules. You consent to the exclusive jurisdiction of the federal and state courts located in or near Annapolis, Maryland for any dispute arising under this Agreement.

    SEVERABILITY

    In the event any court shall declare any section or sections of this Agreement invalid or void, such declaration shall not invalidate the entire Agreement and all other paragraphs of the Agreement shall remain in full force and effect.

    BINDING AGREEMENT

    The terms and provisions of this Agreement are binding upon Your heirs, successors, assigns, and other representatives. This Agreement may be executed in counterparts, each of which shall be considered to be an original, but both of which constitute the same Agreement.

    You assume any and all risks associated with the use of the Software. We reserve the right to modify this Agreement from time to time.


text:
package jef.database.wrapper.processor;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import jef.database.IQueryableEntity;
import jef.database.OperateTarget;

public class InsertWrapper implements StatementPreparer, InsertStep {
	private static final StatementPreparer P = new StatementPreparer() {
		public PreparedStatement doPrepareStatement(OperateTarget conn, String sql) throws SQLException {
			return conn.prepareStatement(sql);
		}
	};

	private StatementPreparer preparer = P;

	@SuppressWarnings("unchecked")
	private List<InsertStep> processors = Collections.EMPTY_LIST;

	@Override
	public void callBefore(List<? extends IQueryableEntity> data) throws SQLException {
		for (InsertStep processor : processors) {
			processor.callBefore(data);
		}
	}

	@Override
	public void callAfterBatch(List<? extends IQueryableEntity> data) throws SQLException {
		for (InsertStep processor : processors) {
			processor.callAfterBatch(data);
		}
	}

	@Override
	public void callAfter(IQueryableEntity data) throws SQLException {
		for (InsertStep processor : processors) {
			processor.callAfter(data);
		}
	}

	@Override
	public PreparedStatement doPrepareStatement(OperateTarget conn, String sql) throws SQLException {
		return preparer.doPrepareStatement(conn, sql);
	}

	public void addProcessor(InsertStep processor) {
		if (processors.isEmpty()) {
			processors = new ArrayList<InsertStep>();
		}
		processors.add(processor);
		if (processor instanceof StatementPreparer) {
			if(this.preparer!=P){
				throw new UnsupportedOperationException("两项特性均需要调整 conn.prepareStatement()的参数,无法同时满足。");
			}
			this.preparer = (StatementPreparer) processor;
		}
	}

}


text:
<?php

/**
 * Provide information and statistics about the server
 *
 * @author Ivan Shumkov
 * @package Rediska
 * @subpackage Commands
 * @version 0.5.6
 * @link http://rediska.geometria-lab.net
 * @license http://www.opensource.org/licenses/bsd-license.php
 */
class Rediska_Command_Info extends Rediska_Command_Abstract
{
    protected $_connections = array();

    /**
     * Create
     *
     * @return array
     */
    public function create()
    {
        $command = array('INFO');
        $commands = array();
        foreach($this->_rediska->getConnections() as $connection) {
            $this->_connections[] = $connection->getAlias();
            $commands[] = new Rediska_Connection_Exec($connection, $command);
        }

        return $commands;
    }

    /**
     * Parse response
     *
     * @param array $responses
     * @return array
     */
    public function parseResponses($responses)
    {
        $info = array();
        $count = 0;
        foreach($this->_connections as $connection) {
            $info[$connection] = array();

            foreach (explode(Rediska::EOL, $responses[$count]) as $param) {
                if (!$param) {
                    continue;
                }

                list($name, $stringValue) = explode(':', $param, 2);

                if (strpos($stringValue, '.') !== false) {
                    $value = (float)$stringValue;
                } else {
                    $value = (integer)$stringValue;
                }

                if ((string)$value != $stringValue) {
                    $value = $stringValue;
                }

                $info[$connection][$name] = $value;
            }

            $count++;
        }

        if (count($info) == 1) {
            $info = array_values($info);
            $info = $info[0];
        }

        return $info;
    }
}


text:
package com.yahoo.athenz.zts.cert;

import java.io.Closeable;

public interface CertRecordStoreConnection extends Closeable {

    /**
     * Close the connection to the certificate record store
     */
    void close();

    /**
     * Set the timeout for the certificate record store operation
     * @param opTimeout operation timeout in seconds
     */
    void setOperationTimeout(int opTimeout);

    /**
     * Retrieve the certificate record for the given instance
     * @param provider name of the provider
     * @param instanceId instance id
     * @return X509CertRecord object or null if not found
     */
    X509CertRecord getX509CertRecord(String provider, String instanceId);

    /**
     * Update the specified certificate record in the store
     * @param certRecord X509CertRecord to be updated
     * @return true on success otherwise false
     */
    boolean updateX509CertRecord(X509CertRecord certRecord);

    /**
     * Insert a new certificate record in the store
     * @param certRecord X509CertRecord to be created
     * @return true on success otherwise false
     */
    boolean insertX509CertRecord(X509CertRecord certRecord);

    /**
     * Delete the certificate record for the given instance
     * @param provider name of the provider
     * @param instanceId instance id
     * @return true on success otherwise false
     */
    boolean deleteX509CertRecord(String provider, String instanceId);

    /**
     * Delete all expired x509 certificate records. A certificate is
     * considered expired if it hasn't been updated within the
     * specified number of minutes
     * @param expiryTimeMins expiry time in minutes
     * @return number of records deleted
     */
    int deleteExpiredX509CertRecords(int expiryTimeMins);
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Persoonia, Suppl. 2: 282 (1985)

#### Original name
Psathyrella spadiceogrisea f. phaeophylla Kits van Wav.

### Remarks
null


text:
import styleBody from 'ghost/mixins/style-body';
import loadingIndicator from 'ghost/mixins/loading-indicator';

var DebugRoute = Ember.Route.extend(Ember.SimpleAuth.AuthenticatedRouteMixin, styleBody, loadingIndicator, {
    classNames: ['settings'],

    model: function () {
        return this.store.find('setting', { type: 'blog,theme' }).then(function (records) {
            return records.get('firstObject');
        });
    }
});

export default DebugRoute;


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

<!-- Main Simp-TSDS Config -->
<config>
    <!-- RabbitMQ host being used by Simp -->
    <rabbitmq ip="127.0.0.1" port="5672" user="" password=""/>

    <!-- TSDS Credentials -->
    <tsds url="" user="" password=""/>

    <!-- Separate worker creation to reduce request load -->

    <stagger seconds="5"/>

</config>


text:
/*global afterEach, beforeEach, describe, expect, it, jasmine, jQuery, sinon, spyOn, MM*/
describe('activity log', function () {
	'use strict';
	var activityLog, clock, logListener, errorListener;
	beforeEach(function () {
		logListener = jasmine.createSpy();
		errorListener = jasmine.createSpy();
		activityLog = new MM.ActivityLog(2);
		activityLog.addEventListener('log', logListener);
		activityLog.addEventListener('error', errorListener);
		clock = sinon.useFakeTimers();
	});
	afterEach(function () {
		clock.restore();
	});
	it('should be created', function () {
		expect(activityLog).toBeDefined();
	});
	it('should be able to log activity', function () {
		activityLog.log('Hello', 'World');

		expect(activityLog.getLog()).toEqual([{
			id: 1,
			ts: new Date(),
			event: 'Hello,World'
		}]);
	});
	it('should dispatch log event when log method invoked', function () {
		activityLog.log('category', 'event type', 'label');

		expect(logListener).toHaveBeenCalledWith('category', 'event type', 'label');
	});
	it('should always send log as a 1 depth array', function () {
		activityLog.log(['category', 'event type', 'label']);

		expect(logListener).toHaveBeenCalledWith('category', 'event type', 'label');
	});
	it('should add error messages to the activity log', function () {
		activityLog.error('Map save failed');

		expect(activityLog.getLog()).toEqual([{
			id: 1,
			ts: new Date(),
			event: 'Error,Map save failed'
		}]);
	});
	it('should dispatch error event when error method invoked', function () {
		activityLog.error('Map save failed');

		expect(errorListener).toHaveBeenCalledWith('Map save failed', activityLog.getLog());
	});
	it('should not exceed maximum event size', function () {
		activityLog.log('foo');
		activityLog.log('bar');
		activityLog.log('baz');

		expect(activityLog.getLog()).toEqual([{
			id: 2,
			ts: new Date(),
			event: 'bar'
		}, {
			id: 3,
			ts: new Date(),
			event: 'baz'
		}]);
	});
});
describe('tracking widget', function () {
	'use strict';
	var element, activityLog;
	beforeEach(function () {
		activityLog = new MM.ActivityLog(10, jQuery.noop);
		element = jQuery('<input type="button" data-category="Feedback" data-event-type="Open" data-label="topmenubar"></input>').appendTo('body');
	});
	it('should be used as a jquery plugin', function () {
		var result = element.trackingWidget(activityLog);

		expect(result).toBe(element);
	});
	it('should invoke log method on activityLog and pass in category, eventType and label as parameters', function () {
		spyOn(activityLog, 'log');
		element.trackingWidget(activityLog);

		element.click();

		expect(activityLog.log).toHaveBeenCalledWith('Feedback', 'Open', 'topmenubar');
	});
	it('should send empty strings for missing attributes', function () {
		element = jQuery('<input type="button" data-category="Feedback"></input>').appendTo('body');
		spyOn(activityLog, 'log');
		element.trackingWidget(activityLog);

		element.click();

		expect(activityLog.log).toHaveBeenCalledWith('Feedback', '', '');
	});
});


text:
<!doctype html>

  <meta charset="utf-8">

  <title>Remember</title>

  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="description" content="An app to help you remember the stuff you did.">
  <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui">
  <link rel="apple-touch-icon" href="apple-touch-icon.png">

  <link rel="stylesheet" href="../dist/styles/main.css">

  <link rel="import" href="../bower_components/font-roboto/roboto.html">

  <link rel="import" href="../bower_components/core-animated-pages/core-animated-pages.html">
  <link rel="import" href="../bower_components/app-router/app-router.html">
  <link rel="import" href="../bower_components/core-icons/core-icons.html">
  <link rel="import" href="../bower_components/core-icon-button/core-icon-button.html">
  <link rel="import" href="../bower_components/core-menu/core-menu.html">
  <link rel="import" href="../bower_components/paper-item/paper-item.html">
  <link rel="import" href="../bower_components/core-scaffold/core-scaffold.html">
  <link rel="import" href="../bower_components/paper-button/paper-button.html">
  <link rel="import" href="../bower_components/paper-icon-button/paper-icon-button.html">
  <link rel="import" href="../bower_components/paper-fab/paper-fab.html">

  <core-drawer-panel flex>
    <core-scroll-header-panel main flex fixed>
      <core-toolbar class="toolbar toolbar--main">
        <paper-icon-button icon="menu" core-drawer-toggle></paper-icon-button>

All notes

        <paper-icon-button icon="search"></paper-icon-button>
      </core-toolbar>

        <app-router core-animated-pages transitions="cross-fade">
          <app-route path="/notes" import="pages/notes-page.html"></app-route>
          <app-route path="/create" import="pages/create-page.html"></app-route>
        </app-router>

          <paper-fab icon="add" class="button button--primary"></paper-fab>

    </core-scroll-header-panel>

    <core-header-panel navigation drawer>
      <core-toolbar class="toolbar tall toolbar--drawer" mode="seamed">

Remember

      </core-toolbar>
      <core-menu>
        <paper-item label="All notes">
          <core-icon icon="inbox"></core-icon> All notes
        </paper-item>
        <paper-item label="Settings">
          <core-icon icon="settings"></core-icon> Settings
        </paper-item>
      </core-menu>
    </core-header-panel>
  </core-drawer-panel>


text:
<?php

namespace yii\adminUi\widget;

use yii\base\InvalidConfigException;
use yii\helpers\ArrayHelper;
use yii\helpers\Html;

/**
 * Column renders a Bootstrap Grid component.
 *
 * @see http://getbootstrap.com/css/#grid
 * @author Mithun Mandal <mithun12000@gmail.com>
 * @since 2.0
 */
class Column extends Widget
{
    const SIZE_FULL = 12;
    const SIZE_HALF = 6;
    const SIZE_BIG = 8;
    const SIZE_SMALL = 4;
    const SIZE_DEFAULT = 12;

    const TYPE_MOBILE = 'col-xs-';
    const TYPE_TABLET = 'col-sm-';
    const TYPE_BIG = 'col-lg-';
    const TYPE_DESKTOP = 'col-md-';

    const DEFAULT_TYPE = 'col-md-';

    /**
     * @var array the grid
     * example: [
     *      [
     *          type => self::TYPE_DESKTOP,
     *          size => self::SIZE_SMALL
     *      ],
     *      [
     *          type => self::TYPE_MOBILE,
     *          size => self::SIZE_FULL
     *      ],
     *      [
     *          type => self::TYPE_MOBILE,
     *          size => 3,
     *          positiontype => 'pull',     options are pull|push|offset
     *      ],
     * ]
     */
    public $grid;

    /**
     * Initializes the widget.
     */
    public function init()
    {
        parent::init();
        $this->initOptions();

        echo Html::beginTag('div', $this->options) . "\n";
    }

    /**
     * Renders the widget.
     */
    public function run()
    {
        echo "\n" . Html::endTag('div');
    }

    /**
     * Initializes the widget options.
     * This method sets the default values for various options.
     */
    protected function initOptions()
    {
        if($this->grid){
            $this->options = array_merge([
            'class' => $this->getGridClass().isset($this->options['class']) ? ' '.$this->options['class'] : '',
            ], $this->options);
        }else{
            $this->options = array_merge([
            'class' => self::DEFAULT_TYPE.self::SIZE_DEFAULT,
            ], $this->options);
        }
    }

    /**
     * Generate Grid Class for Div element
     * @return string Html Class Value
     */
    private function getGridClass() {
        $class = [];
        foreach($this->grid as $grid){
            if(!isset($grid['type']) || !isset($grid['size'])){
                throw new InvalidConfigException(get_called_class() . ' must have type and size.');
            }
            if(!isset($grid['positiontype']))
                $class[] = $grid['type'].$grid['size'];
            else
                $class[] = $grid['type'].$grid['positiontype'].'-'.$grid['size'];
        }
        return implode(' ',$class);
    }
}


text:
Meryl
=====

Meryl is a minimalist web framework for nodejs platform.
It is really simple to use, fun to play and easy to modify.

It consists of only ~240 source lines of code. Here is the proof.

```
$ uglifyjs -b -nm --no-seqs -ns -nc meryl.js | wc -l
     233
```

Install
-------

Use node package manager 'npm' to install latest Meryl version.

```
npm install meryl
```

Usage
-----

Here is simple preview.

``` javascript
// take the pills
var meryl = require('meryl');

// first, take it easy
meryl.get('/', function (req, resp) {
	resp.end('<h3>Hello, World!</h3>');
});

// not impressed? let it interfere with blood some more
meryl.get('/greet/{who}', function(req, resp) {
	resp.render('greeter_template', {name: req.params.who});
});

// lay down and enjoy it
meryl.plug('GET *', function(req, resp, next) {
	resp.setHeader('server', 'meryl');
	next();
});

// now you are a 'meryl' junkie
meryl.run();
```

Meryl is Connect middleware compatible. Serve static content in seconds.

``` javascript
meryl
  .plug('GET *',
    connect.favicon(),
    connect.static(".")
  )
  .get('/', function (req, resp) {
    resp.end("<h1>Welcome To NodeJS!</h1><img src='nodejs.png' />");
  })
  .run();
```

Love (fab)? Checkout (fab) flavored meryl.

``` javascript
with (connect) {
  meryl
    .fabby
      (logger(), static("."))
      ('GET /', function (req, resp) {
          resp.render('home');
        }
      )
      ('GET /posts/{postid}', function (req, resp) {
          resp.render('home');
        }
      )
      ('GET /posts/{postid}/comments/{commentid}', function (req, resp) {
          resp.render('home');
        }
      )
      ();
}
```

Also taste meryl with coffeescript, using coffeekup

``` coffeescript

people = ['animal', 'beakers', 'piggy', 'kermit']

meryl

  .plug connect.logger(),
    connect.static(".")

  .get '/', (req, resp) ->
    resp.redirect('/people')

  .get '/people', (req, resp) ->
    resp.render 'layout',
      content: 'list'
      context:
        people: people

  .get '/people/{personid}', (req, resp) ->
    resp.render 'layout',
      content: 'show'
      context:
        person: people[req.params.personid]

  .run
    templateExt: '.coffee'
    templateFunc: coffeekup.adapters.meryl
```

You can of course use its cgi interface.

``` javascript
require('http').createServer(
  meryl
    .get('/', function (req, resp) {
      resp.end("<h1>Demonstraing Meryl</h1>");
    })
    .cgi()
).listen(3000);
```

Meryl has much more, please continue from the links below.

Please visit wiki page for documentation:
  <http://github.com/kadirpekel/meryl/wiki>

Also there are plenty of examples in 'examples' directory:
  <http://github.com/kadirpekel/meryl/tree/master/examples>

For updates please follow:
  <http://twitter.com/meryljs>

Contributors:

 * Kadir Pekel (Author) <http://twitter.com/kadirpekel>
 * George Stagas <http://twitter.com/stagas>
 * Samuel Morello <http://twitter.com/ouvanous>
 * Michael Siebert <http://twitter.com/siebertm>
 * Vladimir <http://github.com/semanticprogrammer>


text:
package apple.uikit;

import java.io.*;
import java.nio.*;
import java.util.*;
import com.google.j2objc.annotations.*;
import com.google.j2objc.runtime.*;
import com.google.j2objc.runtime.block.*;
import apple.audiotoolbox.*;
import apple.corefoundation.*;
import apple.coregraphics.*;
import apple.coreservices.*;
import apple.foundation.*;
import apple.coreanimation.*;
import apple.coredata.*;
import apple.coreimage.*;
import apple.coretext.*;
import apple.corelocation.*;

/*<javadoc>*/
/*</javadoc>*/
@Adapter
public abstract class UIDynamicItemAdapter
    extends Object
    implements UIDynamicItem {

    @NotImplemented("center")
    public CGPoint getCenter() { throw new UnsupportedOperationException(); }
    @Mapping("setCenter:")
    public void setCenter(CGPoint v) { throw new UnsupportedOperationException(); }
    @NotImplemented("bounds")
    public CGRect getBounds() { throw new UnsupportedOperationException(); }
    @NotImplemented("transform")
    public CGAffineTransform getTransform() { throw new UnsupportedOperationException(); }
    @Mapping("setTransform:")
    public void setTransform(CGAffineTransform v) { throw new UnsupportedOperationException(); }

}


text:
package com.hubspot.baragon.migrations;

import com.google.common.base.Optional;
import com.google.common.base.Throwables;
import com.google.inject.Inject;
import com.hubspot.baragon.data.BaragonStateDatastore;
import com.hubspot.baragon.models.UpstreamInfo;
import java.util.Collection;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.utils.ZKPaths;

public class UpstreamsMigration extends ZkDataMigration {
  private final BaragonStateDatastore baragonStateDatastore;
  private final CuratorFramework curatorFramework;

  @Inject
  public UpstreamsMigration(
    BaragonStateDatastore baragonStateDatastore,
    CuratorFramework curatorFramework
  ) {
    super(1);
    this.baragonStateDatastore = baragonStateDatastore;
    this.curatorFramework = curatorFramework;
  }

  @Override
  public void applyMigration() {
    try {
      for (String service : baragonStateDatastore.getServices()) {
        Collection<String> upstreams = curatorFramework
          .getChildren()
          .forPath(ZKPaths.makePath(BaragonStateDatastore.SERVICES_FORMAT, service));
        for (String upstream : upstreams) {
          Optional<UpstreamInfo> maybeUpstream = baragonStateDatastore.getUpstreamInfo(
            service,
            upstream
          );

          UpstreamInfo mergedInfo;
          if (maybeUpstream.isPresent()) {
            UpstreamInfo fromPath = UpstreamInfo.fromString(upstream);
            mergedInfo =
              new UpstreamInfo(
                fromPath.getUpstream(),
                maybeUpstream.get().getRequestId().or(fromPath.getRequestId()),
                maybeUpstream.get().getRackId().or(fromPath.getRackId())
              );
          } else {
            mergedInfo = UpstreamInfo.fromString(upstream);
          }

          curatorFramework
            .inTransaction()
            .delete()
            .forPath(
              String.format(BaragonStateDatastore.UPSTREAM_FORMAT, service, upstream)
            )
            .and()
            .create()
            .forPath(
              String.format(
                BaragonStateDatastore.UPSTREAM_FORMAT,
                service,
                mergedInfo.toPath()
              )
            )
            .and()
            .commit();
        }
      }
    } catch (Exception e) {
      Throwables.propagate(e);
    }
  }
}


text:
package com.adaptris.core.services.jmx;

import org.hibernate.validator.constraints.NotBlank;

import com.adaptris.annotation.AutoPopulated;
import com.adaptris.core.AdaptrisMessage;
import com.thoughtworks.xstream.annotations.XStreamAlias;

/**
 * <p>
 * This implementation of {@link ValueTranslator} will pull the string payload value from the
 * {@link com.adaptris.core.AdaptrisMessage} to be used as a Jmx operation parameter. Conversely we can also take a
 * string result from a Jmx operation call and overwrite the payload with the new value.
 * </p>
 *
 * @author amcgrath
 * @config jmx-payload-value-translator
 * @since 3.0.3
 */
@XStreamAlias("jmx-payload-value-translator")
public class PayloadValueTranslator implements ValueTranslator {

  @NotBlank
  @AutoPopulated
  private String type;

  public PayloadValueTranslator() {
    this.setType(DEFAULT_PARAMETER_TYPE);
  }

  @Override
  public Object getValue(AdaptrisMessage message) {
    return message.getContent();
  }

  @Override
  public void setValue(AdaptrisMessage message, Object object) {
    message.setContent((String) object, message.getContentEncoding());
  }

  public String getType() {
    return this.type == null ? DEFAULT_PARAMETER_TYPE : this.type;
  }

  public void setType(String type) {
    this.type = type;
  }

}


text:
<nav>
    <input type="file" id="audio-src"/>
    <label for="visible-samples">Visible Samples</label>
    <input type="number" id="visible-samples" max="2000" min="1" step="10" value="750"/>
    <label for="playback-rate" for="playback-rate">Playback Rate (for best results change this BEFORE playing the sound)<label>
    <input type="number" id="playback-rate" max="5" min="0.5" step="0.1" value="1"/>
</nav>

<fieldset id="legend" class="hidden">
<legend>Legend</legend>

</fieldset>

<canvas id="canvas" width="100%" height="100%"/>

<style>
nav {
    position: absolute;
    left: 8px;
    bottom: 8px;
}
nav input{
    margin-right: 20px;
    margin-left: 4px;
}

#legend {
    position: absolute;
    bottom: 0;
    right: 0;
}
html, body {
    margin: 0;
    padding: 0;
}
.hidden {
    display: none;
}
</style>

<script src="js/vector.js"></script>
<script src="js/resizer.js"></script>
<script>

// Audio Buffer Source
var fileInput = document.getElementById("audio-src");
var audioContext = new AudioContext(),
    audioBuffer,
    audioSource;

var colors = ["red", "blue", "green", "yellow", "black"];
function fillLegend(channelCount) {
    var legend = document.getElementById("legend");
    legend.classList.remove("hidden");
    while (!(legend.lastChild instanceof HTMLLegendElement)) {
        legend.removeChild(legend.lastChild);
    }
    for (var i = 0; i < channelCount; i++) {
        var label = document.createElement("label");
        label.style.color = colors[i];
        label.textContent = "Channel " + i;
        legend.appendChild(label);
        legend.appendChild(document.createElement("br"));
    }
}

function playSound(buffer) {
    if (audioSource) {
        audioSource.stop();
    }

  audioSource = audioContext.createBufferSource(); // creates a sound source
  audioSource.buffer = buffer;                    // tell the source which sound to play
  audioSource.connect(audioContext.destination);       // connect the source to the context's destination (the speakers)
  audioSource.loop = false;
  audioSource.start(0);                           // play the source now
  fillLegend(buffer.numberOfChannels);
  audioTimeAtStart = audioContext.currentTime;
}

fileInput.onchange = function() {
	var reader = new FileReader();
	reader.onload = function(ev) {
		audioContext.decodeAudioData(ev.target.result, function(buffer) {
            audioBuffer = buffer;
            playSound(audioBuffer);
            init();
            loop();
		});
	};
	reader.readAsArrayBuffer(this.files[0]);
};

var canvas = document.getElementById("canvas"),
    context = canvas.getContext("2d");

Resizer.installHandler(canvas);

var frame = 0;
var visualization = [];
var maxSizeInput = document.getElementById("visible-samples"),
    playbackRateInput = document.getElementById("playback-rate");
var channels = [];
var animationFrameId = null;

var init = function () {
    channels = [];
    visualization = [];
    frame = 0;
    for (var i = 0; i < audioBuffer.numberOfChannels; i++) {
        channels.push(audioBuffer.getChannelData(i));
        visualization.push([]);
    }
    if (animationFrameId !== null) {
        cancelAnimationFrame(animationFrameId);
    }
}

function rootSquareMean(data, intervalStart, intervalLength) {
    var sum = 0;
    for (var i = intervalStart; i < intervalStart + intervalLength; i++) {
        sum += data[i] * data[i];
    }
    var rootMean = Math.sqrt(sum / intervalLength);
    return rootMean;
}

var draw = function (delta) {
    context.clearRect(0, 0, canvas.width, canvas.height);

    var playbackRate = parseFloat(playbackRateInput.value);
    var samples = ~~(delta * audioBuffer.sampleRate / 1000 * playbackRate);
    audioSource.playbackRate.value = playbackRate;
    var frameSize = ~~maxSizeInput.value;
    var baseHeight = canvas.height / 5;

    for (var ch = 0; ch < channels.length; ch++) {
        context.strokeStyle = colors[ch];
        var data = channels[ch];
        var yValue = rootSquareMean(data, frame, samples);
        visualization[ch].push(yValue);
        if (visualization[ch].length > frameSize) visualization[ch].shift();

        var data = visualization[ch];
        context.beginPath();
        context.moveTo(0, data[0] * canvas.height + baseHeight);
        for (var i = 1; i < data.length; i++) {
             context.lineTo(i * canvas.width / frameSize * 0.95, data[i] * canvas.height + baseHeight);
        }
        context.stroke();
    }
    frame += samples;
}

var previous = undefined;
function loop(time) {
    var delta = time - previous;
    if (previous === undefined) delta = 0;
    draw(delta);
    previous = time;
    animationFrameId = requestAnimationFrame(loop);
}
</script>


text:
/**
 *  Name: Jake Gregg
 *  Instructor: Dr. Scott Campbell
 *  Class: CSE 617
 *  Date: Feb 12, 2014
 *  Filename: Response.java
 *  Description: Handles all of the HTTP responses for the server.
 *  and also has some simple response generation methods for
 *  ease. It also holds a way to encrypt messages.
 */

package udpserver;

import java.util.*;
import java.io.*;
import java.net.*;
import java.security.GeneralSecurityException;

public class Response {
    private int statusCode; // response status code
    private String statusMsg; // response status message
    private HashMap<String, String> headers; // response headers (Use later)
    private String message; // message for user

    // ENCRYPTION STUFF
    private static final String KEY = "KKfHCLdNdutbQ46gkDdggQ==";
    private static UDPCipher cipher;

    /**
     *  Constructor that creates a new Response with a given status message,
     *  code, and message. Throws exceptions to the caller so errors can be
     *  logged.
     */
    public Response(int statusCode, String statusMsg, String message) throws GeneralSecurityException, IOException {
        this.statusCode = statusCode;
        this.statusMsg = statusMsg;
        this.message = message;
        this.cipher = new UDPCipher(KEY);
    }

    /**
     *  Creates a simple response with required headers and adds
     *  the message to an HTML body.
     */
    public String getSimpleResponseString() {
        return "HTTP/1.1 " + statusCode + " " + statusMsg
            + "\nContent-Type:text/html\nConnection:closed\n\n"
            + "" + message + "\n\n";
    }

    /**
     *  Creates a simple response with a date included in the body.
     */
    public String makeDateResponse() {
        Date d = new Date();
        return "HTTP/1.1 200 OK\nContent-Type:text/html\nConnection:closed\n\n"
            + ""+d.toString()+"\n\n";
    }

    /**
     *  A static method that encrypts a message into a byte array.
     */
    public static byte[] getEncryptedBytes(String msg) throws GeneralSecurityException {
        return cipher.encrypt(msg);
    }

}


text:
$.tablesorter.addParser({
    id:'stormtimestr',
    is:function (s) {
        return false;
    },
    format:function (s) {
        if (s.search('All time') != -1) {
            return 1000000000;
        }
        var total = 0;
        $.each(s.split(' '), function (i, v) {
            var amt = parseInt(v);
            if (v.search('ms') != -1) {
                total += amt;
            } else if (v.search('s') != -1) {
                total += amt * 1000;
            } else if (v.search('m') != -1) {
                total += amt * 1000 * 60;
            } else if (v.search('h') != -1) {
                total += amt * 1000 * 60 * 60;
            } else if (v.search('d') != -1) {
                total += amt * 1000 * 60 * 60 * 24;
            }
        });
        return total;
    },
    type:'numeric'
});

$(function () {
    $(".js-only").show();
});

function toggleSys() {
    var sys = $.cookies.get('sys') || false;
    sys = !sys;

    var exDate = new Date();
    exDate.setDate(exDate.getDate() + 365);

    $.cookies.set('sys', sys, {'path':'/', 'expiresAt':exDate.toUTCString()});
    window.location = window.location;
}

function ensureInt(n) {
    var isInt = /^\d+$/.test(n);
    if (!isInt) {
        alert("'" + n + "' is not integer.");
    }

    return isInt;
}

function confirmAction(id, name, action, wait, defaultWait) {
    var opts = {
        type:'POST',
        url:'/api/v1/topology/' + id + '/' + action,
        headers: { 'x-csrf-token': $.trim($('#anti-forgery-token').text()) }
    };
    if (wait) {
        var waitSecs = prompt('Do you really want to ' + action + ' topology "' + name + '"? ' +
                              'If yes, please, specify wait time in seconds:',
                              defaultWait);

        if (waitSecs != null && waitSecs != "" && ensureInt(waitSecs)) {
            opts.url += '/' + waitSecs;
        } else {
            return false;
        }
    } else if (!confirm('Do you really want to ' + action + ' topology "' + name + '"?')) {
        return false;
    }

    $("input[type=button]").attr("disabled", "disabled");
    $.ajax(opts).always(function () {
        window.location.reload();
    }).fail(function () {
        alert("Error while communicating with Nimbus.");
    });

    return false;
}

$(function () {
    var placements = ['above', 'below', 'left', 'right'];
    for (var i in placements) {
      $('.tip.'+placements[i]).twipsy({
          live: true,
          placement: placements[i],
          delayIn: 1000
      });
    }
});

function formatConfigData(data) {
    var mustacheFormattedData = {'config':[]};
    for (var prop in data) {
       if(data.hasOwnProperty(prop)) {
           mustacheFormattedData['config'].push({
               'key': prop,
               'value': data[prop]
           });
       }
    }
    return mustacheFormattedData;
}

function formatErrorTimeSecs(response){
    var errors = response["componentErrors"];
    for(var i = 0 ; i < errors.length ; i++){
        var time = errors[i]['time'];
        errors[i]['time'] = moment.utc(time).local().format("ddd, DD MMM YYYY HH:mm:ss Z");
    }
    return response;
}

function renderToggleSys(div) {
    var sys = $.cookies.get("sys") || false;
    if(sys) {
       div.append("<input onclick=\"toggleSys()\" value=\"Hide System Stats\" type=\"button\">");
    } else {
       div.append("<input onclick=\"toggleSys()\" value=\"Show System Stats\" type=\"button\">");
    }
}

function topologyActionJson(id, encodedId, name,status,msgTimeout) {
    var jsonData = {};
    jsonData["id"] = id;
    jsonData["encodedId"] = encodedId;
    jsonData["name"] = name;
    jsonData["msgTimeout"] = msgTimeout;
    jsonData["activateStatus"] = (status === "ACTIVE") ? "disabled" : "enabled";
    jsonData["deactivateStatus"] = (status === "ACTIVE") ? "enabled" : "disabled";
    jsonData["rebalanceStatus"] = (status === "ACTIVE" || status === "INACTIVE" ) ? "enabled" : "disabled";
    jsonData["killStatus"] = (status !== "KILLED") ? "enabled" : "disabled";
    return jsonData;
}

function topologyActionButton(id,name,status,actionLabel,command,wait,defaultWait) {
    var buttonData = {};
    buttonData["buttonStatus"] = status ;
    buttonData["actionLabel"] = actionLabel;
    buttonData["command"] = command;
    buttonData["isWait"] = wait;
    buttonData["defaultWait"] = defaultWait;
    return buttonData;
}

$.blockUI.defaults.css = {
    border: 'none',
    padding: '15px',
    backgroundColor: '#000',
    '-webkit-border-radius': '10px',
    '-moz-border-radius': '10px',
    'border-radius': '10px',
    opacity: .5,
    color: '#fff',margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center"
};


text:
from django.apps import AppConfig

class ChurchEventsConfig(AppConfig):
    name = 'church_events'


text:
from canvasapi import Canvas
from flask import Flask, render_template, session, request, Response
from pylti.flask import lti
import logging
import json
from logging.handlers import RotatingFileHandler

import os

if 'HEROKU_ENV' in os.environ:
    import heroku_settings as settings
else:
    import settings

app = Flask(__name__)
app.secret_key = settings.secret_key
app.config.from_object(settings.configClass)

# ============================================
# Globals
# ============================================

CANVAS = Canvas(settings.CANVAS_API_URL, settings.CANVAS_API_KEY)
ASSIGNMENTS = []
ASSIGNMENTS_EASY = []
COURSE_DATA = {}

# ============================================
# Logging
# ============================================

formatter = logging.Formatter(settings.LOG_FORMAT)
handler = RotatingFileHandler(
    settings.LOG_FILE,
    maxBytes=settings.LOG_MAX_BYTES,
    backupCount=settings.LOG_BACKUP_COUNT
)
handler.setLevel(logging.getLevelName(settings.LOG_LEVEL))
handler.setFormatter(formatter)
app.logger.addHandler(handler)

# ============================================
# Utility Functions
# ============================================

def clearData():
    """
    Reset the globals. Called by /launch.
    This fixes any chance of the previous globals
    still being set if the page is quickly reloaded.
    """
    global ASSIGNMENTS
    ASSIGNMENTS = []
    global ASSIGNMENTS_EASY
    ASSIGNMENTS_EASY = []
    global COURSE_DATA
    COURSE_DATA = {}

def return_error(msg):
    """
    Return the error template with error message.
    """
    return render_template('error.htm.j2', msg=msg)

def error(exception=None):
    """
    Handle error
    """
    app.logger.error("PyLTI error: {}".format(exception))
    return return_error('''Authentication error,
        please refresh and try again. If this error persists,
        please contact support.''')

def format_date_from_iso(iso):
    """
    """
    # 2017-05-15T06:00:00Z
    import datetime
    date = datetime.datetime.strptime(iso, "%Y-%m-%dT%H:%M:%SZ")
    date = date.strftime("%Y-%m-%d")
    return date

def set_vars(course_json, wanted_vars):
    """
    Set session variable to match variable from the course json.
    """
    global COURSE_DATA
    return_obj = {}

    for item in wanted_vars:
        this_item = 'course_' + item
        try:
            COURSE_DATA[this_item] = course_json[item]
            return_obj[this_item] = COURSE_DATA[this_item]
        except:
            COURSE_DATA[this_item] = None
            return_obj[this_item] = COURSE_DATA[this_item]
            print 'Could not obtain value for: ' + this_item
            pass

    if COURSE_DATA['course_start_at'] is not None:
        COURSE_DATA['formatted_start'] = \
            format_date_from_iso(COURSE_DATA['course_start_at'])
    else:
        COURSE_DATA['formatted_start'] = None
    if COURSE_DATA['course_end_at'] is not None:
        COURSE_DATA['formatted_end'] = \
            format_date_from_iso(COURSE_DATA['course_end_at'])
    else:
        COURSE_DATA['formatted_end'] = None

# ============================================
# Web Views / Routes
# ============================================

# LTI Launch
@app.route('/launch', methods=['POST', 'GET'])
@lti(error=error, request='initial', role='any', app=app)
def launch(lti=lti):
    """
    Runs clearData() to reset any globals that may linger
    from the page being refreshed.
    request.form will contain all the lti params
    :returns: launch.htm.j2, the launch page
    """
    clearData()

    session['custom_canvas_course_id'] = request.form.get(
        'custom_canvas_course_id')

    return render_template(
        'launch.htm.j2'
    )

# Select start date
@app.route('/select_date', methods=['POST'])
def date_select(lti=lti):
    """
    Receives a form with the selected assignment type.
    Creates retrieves the Course object from Canvas using the course_id.
    Populates global ASSIGNMENTS based on the assignment type selected.
    :returns: date.htm.j2, where the user selects the start date
        and interval of assignments.
    """
    session['assignment_type'] = request.form['selection']

    cid = session['custom_canvas_course_id']
    global CANVAS
    course = CANVAS.get_course(course_id=cid)
    course_json = json.loads(course.to_json())

    wanted_vars = [
        'name', 'id', 'account_id', 'start_at',
        'end_at', 'time_zone', 'course_code'
    ]
    # Stores desired variables in global COURSE_DATA
    set_vars(course_json=course_json, wanted_vars=wanted_vars)

    global ASSIGNMENTS
    ASSIGNMENTS = []

    if session['assignment_type'] == 'assignments':
        assignments = course.get_assignments()
        for item in assignments:
            if 'online_quiz' not in item.submission_types \
                    and 'discussion_topic' not in item.submission_types:
                ASSIGNMENTS.append(item)

    elif session['assignment_type'] == 'quizzes':
        quizzes = course.get_quizzes()
        for item in quizzes:
            ASSIGNMENTS.append(item)

    elif session['assignment_type'] == 'discussions':
        discussions = course.get_discussion_topics()
        for item in discussions:
            ASSIGNMENTS.append(item)
    else:
        print "No assignments of that type"

    global COURSE_DATA

    return render_template(
        'date.htm.j2',
        course_obj=COURSE_DATA,
        assignment_type=session['assignment_type'],
        list_length=len(ASSIGNMENTS),
        item_list=ASSIGNMENTS
    )

def get_date_select_vars():
    return

# Select assignments for dates
@app.route('/assign_dates', methods=['POST'])
def assign_dates(lti=lti):
    '''
    Creates dates starting with the date/time indicated
        by the from from date.htm.j2. Creates a number of
        dates based on the 'repetitions' parameter.
    :param date_select: String, format example: '2017-06-15'
    :param time_select: String, format example: '23:59'
    :param repetitions: String, format example: '7'

    :methods: Uses python Datetime library to adjust and combine
        the dates provided.

    :returns: assign.htm.j2 page that allows the user to
        attach the dates to assignments that exist in the course.
    '''
    import datetime

    # 2017-06-15 23:59
    selected_date = request.form['date_select'] + \
        ' ' + request.form['time_select']
    start_date = datetime.datetime.strptime(selected_date, "%Y-%m-%d %H:%M")
    repetitions = request.form['repetitions']

    daytotal = 1

    if request.form['recurring_weeks'] > 0:
        daytotal = int(request.form['recurring_weeks']) * 7

    date_list = []

    for x in range(0, int(repetitions)+1):
        days = daytotal*x
        newdate = start_date + datetime.timedelta(days=days)
        date_list.append(newdate)

    global ASSIGNMENTS
    assignment_type = session['assignment_type']

    return render_template(
        'assign.htm.j2',
        selected_date=selected_date,
        date_list=date_list,
        item_list=ASSIGNMENTS,
        assignment_type=assignment_type
    )

# Select assignments for dates
@app.route('/process_complete', methods=['POST'])
def process_complete(lti=lti):
    """
    Completes the process of changing the dates.

    :methods: uses assignment.edit(), quiz.edit(), or discussion.update()
        from the canvasapi python library. Uses python Datetime library to
        adjust the given times.

    :param request: The form from assign.htm.j2. Contains a 'key' indicating
        the desired date, and an 'assignment' containing the assignment id.

    :returns: review page with updated assignment information.
    """
    import datetime

    cid = session['custom_canvas_course_id']
    course = CANVAS.get_course(course_id=cid)

    assignment_type = session['assignment_type']

    assignment_list = []
    r = request.form
    for key, value in r.iteritems():
        assignment_list.append(
            {
                'date': key,
                'assignment': value
            }
        )

    canvas_obj_list = []

    for item in assignment_list:

        date = datetime.datetime.strptime(
            item['date'], "%Y-%m-%d %H:%M:%S"
        )

        if assignment_type == 'assignments':
            # Accepts times in ISO 8601 format, e.g. 2014-10-21T18:48:00Z.
            date = date.strftime("%Y-%m-%dT%H:%M:%S-06:00")
            this_assignment = course.get_assignment(item['assignment'])
            new_assignment = {"due_at": date}
            this_assignment.edit(assignment=new_assignment)
            canvas_obj_list.append(this_assignment)

        elif assignment_type == 'quizzes':
            # Accepts times in ISO 8601 format, e.g. 2011-10-21T18:48Z.
            date = date.strftime("%Y-%m-%dT%H:%M:%S-06:00")
            this_quiz = course.get_quiz(item['assignment'])
            new_quiz = {"due_at": date}
            this_quiz.edit(quiz=new_quiz)
            canvas_obj_list.append(this_quiz)

        elif assignment_type == 'discussions':
            this_discussion = course.get_discussion_topic(item['assignment'])
            this_discussion.update(lock_at=date)
            canvas_obj_list.append(this_discussion)

    return render_template(
        'review.htm.j2',
        assignment_type=assignment_type,
        canvas_obj_list=canvas_obj_list
    )

# ============================================
# Data Retrieval
# ============================================

@app.route('/get_course_data', methods=['POST'])
def get_course_data(lti=lti):
    global COURSE_DATA
    return json.dumps(COURSE_DATA)

@app.route('/get_assignments', methods=['POST'])
def get_assignments(lti=lti):
    global ASSIGNMENTS
    thisItem = ASSIGNMENTS[0].to_json()
    # for item in ASSIGNMENTS:
    #     item_json = item.to_json()
    #     print item_json
    # return assignment_list
    return thisItem

@app.route('/get_assignment_count', methods=['POST'])
def get_assignment_count(lti=lti):
    global ASSIGNMENTS
    result = len(ASSIGNMENTS)
    return str(result)

@app.route('/get_assignment_type', methods=['POST'])
def get_assignment_type(lti=lti):
    return session['assignment_type']

# ============================================
# Static Pages
# ============================================

# Home page
@app.route('/', methods=['GET'])
def index(lti=lti):
    """
    Home page for the lti. Displays information and
    links to the xml and launch pages.
    """
    return render_template('index.htm.j2')

# LTI XML Configuration
@app.route("/xml/", methods=['GET'])
def xml():
    """
    Returns the lti.xml file for the app.
    XML can be built at https://www.eduappcenter.com/
    """
    try:
        return Response(render_template(
            'lti.xml.j2'), mimetype='application/xml'
        )
    except:
        app.logger.error("Error with XML.")
        return return_error('''Error with XML. Please refresh and try again. If this error persists,
            please contact support.''')

if __name__ == "__main__":
    app.run()


text:
/**
 * @const
 * @namespace
 */
var nd4j = nd4j || {};

/**
 * @const
 * @namespace
 */
nd4j.graph = nd4j.graph || {};

/**
 * @enum
 */
nd4j.graph.ProfilingMode = {
  NONE: 0,
  NAN_PANIC: 1,
  INF_PANIC: 2,
  ANY_PANIC: 3
};

/**
 * @enum
 */
nd4j.graph.ExecutionMode = {
  SEQUENTIAL: 0,
  STRICT: 1,
  AUTO: 2
};

/**
 * @enum
 */
nd4j.graph.OutputMode = {
  IMPLICIT: 0,
  EXPLICIT: 1,
  EXPLICIT_AND_IMPLICIT: 2,
  VARIABLE_SPACE: 3,
  OPTIMIZED: 4
};

/**
 * @enum
 */
nd4j.graph.Direction = {
  FORWARD_ONLY: 0,
  FORWARD_AND_BACKWARD: 1,
  BACKWARD_ONLY: 2
};

/**
 * @constructor
 */
nd4j.graph.FlatConfiguration = function() {
  /**
   * @type {flatbuffers.ByteBuffer}
   */
  this.bb = null;

  /**
   * @type {number}
   */
  this.bb_pos = 0;
};

/**
 * @param {number} i
 * @param {flatbuffers.ByteBuffer} bb
 * @returns {nd4j.graph.FlatConfiguration}
 */
nd4j.graph.FlatConfiguration.prototype.__init = function(i, bb) {
  this.bb_pos = i;
  this.bb = bb;
  return this;
};

/**
 * @param {flatbuffers.ByteBuffer} bb
 * @param {nd4j.graph.FlatConfiguration=} obj
 * @returns {nd4j.graph.FlatConfiguration}
 */
nd4j.graph.FlatConfiguration.getRootAsFlatConfiguration = function(bb, obj) {
  return (obj || new nd4j.graph.FlatConfiguration).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};

/**
 * @returns {flatbuffers.Long}
 */
nd4j.graph.FlatConfiguration.prototype.id = function() {
  var offset = this.bb.__offset(this.bb_pos, 4);
  return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
};

/**
 * @returns {nd4j.graph.ExecutionMode}
 */
nd4j.graph.FlatConfiguration.prototype.executionMode = function() {
  var offset = this.bb.__offset(this.bb_pos, 6);
  return offset ? /** @type {nd4j.graph.ExecutionMode} */ (this.bb.readInt8(this.bb_pos + offset)) : nd4j.graph.ExecutionMode.SEQUENTIAL;
};

/**
 * @returns {nd4j.graph.ProfilingMode}
 */
nd4j.graph.FlatConfiguration.prototype.profilingMode = function() {
  var offset = this.bb.__offset(this.bb_pos, 8);
  return offset ? /** @type {nd4j.graph.ProfilingMode} */ (this.bb.readInt8(this.bb_pos + offset)) : nd4j.graph.ProfilingMode.NONE;
};

/**
 * @returns {nd4j.graph.OutputMode}
 */
nd4j.graph.FlatConfiguration.prototype.outputMode = function() {
  var offset = this.bb.__offset(this.bb_pos, 10);
  return offset ? /** @type {nd4j.graph.OutputMode} */ (this.bb.readInt8(this.bb_pos + offset)) : nd4j.graph.OutputMode.IMPLICIT;
};

/**
 * @returns {boolean}
 */
nd4j.graph.FlatConfiguration.prototype.timestats = function() {
  var offset = this.bb.__offset(this.bb_pos, 12);
  return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
};

/**
 * @returns {flatbuffers.Long}
 */
nd4j.graph.FlatConfiguration.prototype.footprintForward = function() {
  var offset = this.bb.__offset(this.bb_pos, 14);
  return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
};

/**
 * @returns {flatbuffers.Long}
 */
nd4j.graph.FlatConfiguration.prototype.footprintBackward = function() {
  var offset = this.bb.__offset(this.bb_pos, 16);
  return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
};

/**
 * @returns {nd4j.graph.Direction}
 */
nd4j.graph.FlatConfiguration.prototype.direction = function() {
  var offset = this.bb.__offset(this.bb_pos, 18);
  return offset ? /** @type {nd4j.graph.Direction} */ (this.bb.readInt8(this.bb_pos + offset)) : nd4j.graph.Direction.FORWARD_ONLY;
};

/**
 * @param {flatbuffers.Builder} builder
 */
nd4j.graph.FlatConfiguration.startFlatConfiguration = function(builder) {
  builder.startObject(8);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Long} id
 */
nd4j.graph.FlatConfiguration.addId = function(builder, id) {
  builder.addFieldInt64(0, id, builder.createLong(0, 0));
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {nd4j.graph.ExecutionMode} executionMode
 */
nd4j.graph.FlatConfiguration.addExecutionMode = function(builder, executionMode) {
  builder.addFieldInt8(1, executionMode, nd4j.graph.ExecutionMode.SEQUENTIAL);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {nd4j.graph.ProfilingMode} profilingMode
 */
nd4j.graph.FlatConfiguration.addProfilingMode = function(builder, profilingMode) {
  builder.addFieldInt8(2, profilingMode, nd4j.graph.ProfilingMode.NONE);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {nd4j.graph.OutputMode} outputMode
 */
nd4j.graph.FlatConfiguration.addOutputMode = function(builder, outputMode) {
  builder.addFieldInt8(3, outputMode, nd4j.graph.OutputMode.IMPLICIT);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {boolean} timestats
 */
nd4j.graph.FlatConfiguration.addTimestats = function(builder, timestats) {
  builder.addFieldInt8(4, +timestats, +false);
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Long} footprintForward
 */
nd4j.graph.FlatConfiguration.addFootprintForward = function(builder, footprintForward) {
  builder.addFieldInt64(5, footprintForward, builder.createLong(0, 0));
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Long} footprintBackward
 */
nd4j.graph.FlatConfiguration.addFootprintBackward = function(builder, footprintBackward) {
  builder.addFieldInt64(6, footprintBackward, builder.createLong(0, 0));
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {nd4j.graph.Direction} direction
 */
nd4j.graph.FlatConfiguration.addDirection = function(builder, direction) {
  builder.addFieldInt8(7, direction, nd4j.graph.Direction.FORWARD_ONLY);
};

/**
 * @param {flatbuffers.Builder} builder
 * @returns {flatbuffers.Offset}
 */
nd4j.graph.FlatConfiguration.endFlatConfiguration = function(builder) {
  var offset = builder.endObject();
  return offset;
};

/**
 * @param {flatbuffers.Builder} builder
 * @param {flatbuffers.Offset} offset
 */
nd4j.graph.FlatConfiguration.finishFlatConfigurationBuffer = function(builder, offset) {
  builder.finish(offset);
};

// Exports for Node.js and RequireJS
this.nd4j = nd4j;