text:
	<title>Ray Illingworth's panel show appearances</title>

	<link rel="stylesheet" media="all" href="../style.css" type="text/css"/>

Ray Illingworth's panel show appearances

Ray Illingworth (born 1932-06-08[ref]) has appeared in 1 episodes between 1970-1970.  Ray Illingworth on Wikipedia.

1970

1970-01-05 / A Question of Sport


text:
<!DOCTYPE html>

<meta charset="utf-8">
<title>Wann ist das nächste tweetupAC?</title>

<link rel="stylesheet" type="text/css" href="style.css">
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon">

Wann ist das nächste tweetupAC?

    <?php
      setlocale(LC_ALL, 'de_DE.UTF-8');
      require('config.php');
      $e = get_next_event();
      if ($e !== false):
      $next = strtotime($e['start']['dateTime']);
      $location_changed = ($e['location'] != DEFAULT_LOCATION);
      $time_changed = (date('Hi', $next) != DEFAULT_TIME_HHMM);
      $day_changed = (date('Ymd', $next) != date('Ymd', strtotime($e['originalStartTime']['dateTime'])));
    ?>

      <?php if ($location_changed || $time_changed || $day_changed): ?>

Diesmal abweichend:

      <?php endif; ?>

        <?php echo $day_changed ? ''.strftime('%A, %e. %B %Y', $next).'' : strftime('%A, %e. %B %Y', $next); ?>,
        <?php echo $time_changed ? ''.strftime('%H:%M Uhr', $next).'' : strftime('%H:%M Uhr', $next); ?>

Wo?
        <?php if ($location_changed) echo ''; ?>
        <?php echo auto_link_text($e['location']); ?>
        <?php if ($location_changed) echo ''; ?>
        (<a href="http://maps.google.de/?q=<?php echo urlencode($e['location']); ?>" target="_blank">Karte)

Alle Termine

    <?php endif; ?>
    <div id="all"<?php if ($e !== false):?> style="display: none;"<?php endif; ?>>

        (Regelmäßig am zweiten Dienstag im Monat.)

      @tweetupAC folgen
      #tweetupAC twittern

      π

redpajama_set_name: RedPajamaGithub


text:
@interface ImageRegulatorViewController : UIViewController

@end


text:
package com.josecalles.tistiq.injection.activity;

import com.josecalles.tistiq.injection.ActivityScope;
import com.josecalles.tistiq.mvp.model.SharedPrefLogger;
import com.josecalles.tistiq.mvp.presenter.SettingsPresenter;
import com.josecalles.tistiq.mvp.view.SettingsActivity;
import dagger.Module;
import dagger.Provides;

@Module
public class SettingsModule {

  private SettingsActivity mSettingsActivity;

  public SettingsModule(SettingsActivity settingsActivity) {
    mSettingsActivity = settingsActivity;
  }

  @Provides
  @ActivityScope
  SettingsActivity provideSettingsActivity() {
    return mSettingsActivity;
  }

  @Provides
  @ActivityScope
  SettingsPresenter provideSettingsPresenter(SharedPrefLogger sharedPrefLogger) {
    return new SettingsPresenter(mSettingsActivity, sharedPrefLogger);
  }
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package wvlet.airframe.http.grpc

import io.grpc.Status
import io.grpc.Status.Code
import io.grpc.StatusRuntimeException
import wvlet.airframe.http.{RPCException, RPCStatus, Router}
import wvlet.airframe.http.grpc.GrpcErrorLogTest.DemoApiDebug
import wvlet.airframe.http.grpc.example.DemoApi.DemoApiClient
import wvlet.airframe.http.grpc.internal.GrpcException
import wvlet.airspec.AirSpec
import wvlet.log.{LogLevel, Logger}

import java.io.{PrintWriter, StringWriter}

object GrpcErrorHandlingTest extends AirSpec {

  protected override def design = {
    gRPC.server
      .withName("error-handling-test-api")
      .withRouter(Router.add[DemoApiDebug])
      .designWithChannel
  }

  private def suppressLog(loggerName: String)(body: => Unit): Unit = {
    val l                = Logger(loggerName)
    val previousLogLevel = l.getLogLevel
    try {
      // Suppress error logs
      l.setLogLevel(LogLevel.OFF)
      body
    } finally {
      l.setLogLevel(previousLogLevel)
    }
  }
  test("exception test") { (client: DemoApiClient) =>
    warn("Starting a gRPC error handling test")
    suppressLog("wvlet.airframe.http.grpc.internal") {

      test("propagate HttpServerException") {
        val ex = intercept[StatusRuntimeException] {
          client.error409Test
        }
        ex.getMessage.contains("409") shouldBe true
        ex.getStatus.isOk shouldBe false
        ex.getStatus.getCode shouldBe Code.ABORTED
        val trailers = Status.trailersFromThrowable(ex)
        val rpcError = trailers.get[String](GrpcException.rpcErrorBodyKey)
        rpcError.contains("test message") shouldBe true
      }

      test("propagate RPCException") {
        val ex = intercept[StatusRuntimeException] {
          client.rpcExceptionTest(false)
        }
        val trailers     = Status.trailersFromThrowable(ex)
        val rpcErrorJson = trailers.get[String](GrpcException.rpcErrorBodyKey)
        val e            = RPCException.fromJson(rpcErrorJson)

        e.status shouldBe RPCStatus.SYNTAX_ERROR_U3
        e.message shouldBe "test RPC exception"
        e.cause shouldNotBe empty
        e.appErrorCode shouldBe Some(11)
        e.metadata shouldBe Map("retry" -> 0)

        // Extract stack trace
        val s   = new StringWriter()
        val out = new PrintWriter(s)
        e.printStackTrace(out)
        out.flush()

        val stackTrace = s.toString
        // Stack trace should contain two traces from the exception itself and its cause
        stackTrace.contains("wvlet.airframe.http.RPCStatus.newException") shouldBe true
        stackTrace.contains("wvlet.airframe.http.grpc.example.DemoApi.throwEx") shouldBe true
        stackTrace.contains("wvlet.airframe.http.grpc.example.DemoApi.rpcExceptionTest") shouldBe true
      }

      test("suppress RPCException stacktrace") {
        val ex = intercept[StatusRuntimeException] {
          client.rpcExceptionTest(true)
        }
        val trailers     = Status.trailersFromThrowable(ex)
        val rpcErrorJson = trailers.get[String](GrpcException.rpcErrorBodyKey)
        val e            = RPCException.fromJson(rpcErrorJson)

        e.status shouldBe RPCStatus.SYNTAX_ERROR_U3
        e.message shouldBe "test RPC exception"
        e.cause shouldBe empty
        e.appErrorCode shouldBe Some(11)
        e.metadata shouldBe Map("retry" -> 0)

        // Extract stack trace
        val s   = new StringWriter()
        val out = new PrintWriter(s)
        e.printStackTrace(out)
        out.flush()

        val stackTrace = s.toString
        // Stack trace should not have detailed information when RPCException.noStackTrace is used
        stackTrace.contains("wvlet.airframe.http.RPCStatus.newException") shouldBe false
        stackTrace.contains("wvlet.airframe.http.grpc.example.DemoApi.throwEx") shouldBe false
        stackTrace.contains("wvlet.airframe.http.grpc.example.DemoApi.rpcExceptionTest") shouldBe false
      }
    }
  }
}


text:
package org.apache.camel.blueprint;

import org.apache.camel.TypeConverter;
import org.apache.camel.core.osgi.OsgiCamelContextHelper;
import org.apache.camel.core.osgi.OsgiCamelContextNameStrategy;
import org.apache.camel.core.osgi.OsgiClassResolver;
import org.apache.camel.core.osgi.OsgiFactoryFinderResolver;
import org.apache.camel.core.osgi.OsgiPackageScanClassResolver;
import org.apache.camel.core.osgi.OsgiTypeConverter;
import org.apache.camel.core.osgi.utils.BundleContextUtils;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.spi.Registry;
import org.osgi.framework.BundleContext;
import org.osgi.service.blueprint.container.BlueprintContainer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class BlueprintCamelContext extends DefaultCamelContext {

    private static final transient Logger LOG = LoggerFactory.getLogger(BlueprintCamelContext.class);

    private BundleContext bundleContext;
    private BlueprintContainer blueprintContainer;

    public BlueprintCamelContext() {
    }

    public BlueprintCamelContext(BundleContext bundleContext, BlueprintContainer blueprintContainer) {
        this.bundleContext = bundleContext;
        this.blueprintContainer = blueprintContainer;
        setNameStrategy(new OsgiCamelContextNameStrategy(bundleContext));
        setClassResolver(new OsgiClassResolver(bundleContext));
        setFactoryFinderResolver(new OsgiFactoryFinderResolver(bundleContext));
        setPackageScanClassResolver(new OsgiPackageScanClassResolver(bundleContext));
        setComponentResolver(new BlueprintComponentResolver(bundleContext));
        setLanguageResolver(new BlueprintLanguageResolver(bundleContext));
        setDataFormatResolver(new BlueprintDataFormatResolver(bundleContext));
    }

    public BundleContext getBundleContext() {
        return bundleContext;
    }

    public void setBundleContext(BundleContext bundleContext) {
        this.bundleContext = bundleContext;
    }

    public BlueprintContainer getBlueprintContainer() {
        return blueprintContainer;
    }

    public void setBlueprintContainer(BlueprintContainer blueprintContainer) {
        this.blueprintContainer = blueprintContainer;
    }

    public void init() throws Exception {
        maybeStart();
    }

    private void maybeStart() throws Exception {
        if (!isStarted() && !isStarting()) {
            start();
        } else {
            // ignore as Camel is already started
            LOG.trace("Ignoring maybeStart() as Apache Camel is already started");
        }
    }

    public void destroy() throws Exception {
        stop();
    }

    @Override
    protected TypeConverter createTypeConverter() {
        // CAMEL-3614: make sure we use a bundle context which imports org.apache.camel.impl.converter package
        BundleContext ctx = BundleContextUtils.getBundleContext(getClass());
        if (ctx == null) {
            ctx = bundleContext;
        }
        return new OsgiTypeConverter(ctx, getInjector());
    }

    @Override
    protected Registry createRegistry() {
        Registry reg = new BlueprintContainerRegistry(getBlueprintContainer());
        return OsgiCamelContextHelper.wrapRegistry(this, reg, bundleContext);
    }

}


text:
'''
loadFromExcel.py is an example of a plug-in that will load an extension taxonomy from Excel
input and optionally save an (extension) DTS.

(c) Copyright 2013 Mark V Systems Limited, All rights reserved.
'''
import os, io, time, re
from collections import defaultdict
from arelle import XbrlConst

headerWidths = {
        "label": 40,
        "prefix": 20,
        "name": 36,
        "type": 24,
        "abstract": 6,
        "nillable": 6,
        "substitutionGroup": 30,
        "periodType": 8,
        "balance": 8,
        "depth": 5,
        "preferredLabel": 16,
        "calculationParent": 20,
        "calculationWeight": 12
        }

headersStyles = (
    # ELR match string, font (size: 20 * pt size)
    (r"http://[^/]+\.edinet-fsa\.go\.jp", "font: name MS UI Gothic, height 180; ", (
        # (display string, content, label role, lang [,indented])
        ("標準ラベル(日本語)", "label", XbrlConst.standardLabel, "ja", "indented"),
        ("冗長ラベル(日本語)", "label", XbrlConst.verboseLabel, "ja"),
        ("標準ラベル(英語)", "label", XbrlConst.standardLabel, "en"),
        ("冗長ラベル(英語)", "label", XbrlConst.verboseLabel, "en"),
        ("名前空間プレフィックス", "prefix"),
        ("要素名", "name"),
        ("type", "type"),
        ("substitutionGroup", "substitutionGroup"),
        ("periodType", "periodType"),
        ("balance", "balance"),
        ("abstract", "abstract"),
        ("nillable", "nillable"),
        ("depth", "depth"),
        ("preferred label", "preferredLabel"),
        ("calculation parent", "calculationParent"), # qname
        ("calculation weight", "calculationWeight")
        )),
    (r"http://[^/]+/us-gaap/", "font: name Calibri, height 180; ", (
        ("label", "label", XbrlConst.standardLabel, "en-US", "indented"),
        ("label, standard", "label", XbrlConst.standardLabel, "en-US", "overridePreferred"),
        ("label, terse", "label", XbrlConst.terseLabel, "en-US"),
        ("label, verbose", "label", XbrlConst.verboseLabel, "en-US"),
        ("prefix", "prefix"),
        ("name", "name"),
        ("type", "type"),
        ("substitutionGroup", "substitutionGroup"),
        ("periodType", "periodType"),
        ("balance", "balance"),
        ("abstract", "abstract"),
        ("nillable", "nillable"),
        ("depth", "depth"),
        ("preferred label", "preferredLabel"),
        ("calculation parent", "calculationParent"), # qname
        ("calculation weight", "calculationWeight"),
        )),
    # generic pattern taxonomy
    (r"http://[^/]+/us-gaap/", "font: name Calibri, height 180; ", (
        ("label", "label", XbrlConst.standardLabel, "en", "indented"),
        ("prefix", "prefix"),
        ("name", "name"),
        ("type", "type"),
        ("substitutionGroup", "substitutionGroup"),
        ("periodType", "periodType"),
        ("balance", "balance"),
        ("abstract", "abstract"),
        ("nillable", "nillable"),
        ("depth", "depth"),
        ("preferred label", "preferredLabel"),
        ("calculation parent", "calculationParent"), # qname
        ("calculation weight", "calculationWeight"),
        )),
    )

sheet2Headers = (
    ("specification", 14),
    ("file type", 12),
    ("prefix (schema)\ntype (linkbase)\nargument (other)", 20),
    ("file, href or role definition", 60),
    ("namespace URI", 60),
    )

def saveLoadableExcel(dts, excelFile):
    from arelle import ModelDocument, XmlUtil, xlwt

    workbook = xlwt.Workbook(encoding="utf-8")
    sheet1 = workbook.add_sheet("Sheet1")
    sheet2 = workbook.add_sheet("Sheet2")

    # identify type of taxonomy
    sheet1Headers = None
    cellFont = None
    for doc in dts.urlDocs.values():
        if doc.type == ModelDocument.Type.SCHEMA and doc.inDTS:
            for i in range(len(headersStyles)):
                if re.match(headersStyles[i][0], doc.targetNamespace):
                    cellFont = headersStyles[i][1]
                    sheet1Headers = headersStyles[i][2]
                    break
    if sheet1Headers is None:
        dts.info("error:saveLoadableExcel",
         _("Referenced taxonomy style not identified, assuming general pattern."),
         modelObject=dts)
        cellFont = headersStyles[-1][1]
        sheet1Headers = headersStyles[-1][2]

    hdrCellFmt = xlwt.easyxf(cellFont +
                             "align: wrap on, vert center, horiz center; "
                             "pattern: pattern solid_fill, fore_color light_orange; "
                             "border: top thin, right thin, bottom thin, left thin; ")

    # sheet 1 col widths
    for i, hdr in enumerate(sheet1Headers):
        sheet1.col(i).width = 256 * headerWidths.get(hdr[1], 40)

    # sheet 2 headers
    for i, hdr in enumerate(sheet2Headers):
        sheet2.col(i).width = 256 * hdr[1]
        sheet2.write(0, i, hdr[0], hdrCellFmt)

    # referenced taxonomies
    sheet1row = 0
    sheet2row = 2

    cellFmt = xlwt.easyxf(cellFont +
                          "border: top thin, right thin, bottom thin, left thin; "
                          "align: wrap on, vert top, horiz left;")
    cellFmtIndented = dict((i, xlwt.easyxf(cellFont +
                                           "border: top thin, right thin, bottom thin, left thin; "
                                           "align: wrap on, vert top, horiz left, indent {0};"
                                           .format(i)))
                           for i in range(16))

    # identify extension schema
    extensionSchemaDoc = None
    if dts.modelDocument.type == ModelDocument.Type.SCHEMA:
        extensionSchemaDoc = dts.modelDocument
    elif dts.modelDocument.type == ModelDocument.Type.INSTANCE:
        for doc, docReference in dts.modelDocument.referencesDocument.items():
            if docReference.referenceType == "href":
                extensionSchemaDoc = doc
                break
    if extensionSchemaDoc is None:
        dts.info("error:saveLoadableExcel",
         _("Unable to identify extension taxonomy."),
         modelObject=dts)
        return

    for doc, docReference in extensionSchemaDoc.referencesDocument.items():
        if docReference.referenceType == "import" and doc.targetNamespace != XbrlConst.xbrli:
            sheet2.write(sheet2row, 0, "import", cellFmt)
            sheet2.write(sheet2row, 1, "schema", cellFmt)
            sheet2.write(sheet2row, 2, XmlUtil.xmlnsprefix(doc.xmlRootElement, doc.targetNamespace), cellFmt)
            sheet2.write(sheet2row, 3, doc.uri, cellFmt)
            sheet2.write(sheet2row, 4, doc.targetNamespace, cellFmt)
            sheet2row += 1

    sheet2row += 1

    doc = extensionSchemaDoc
    sheet2.write(sheet2row, 0, "extension", cellFmt)
    sheet2.write(sheet2row, 1, "schema", cellFmt)
    sheet2.write(sheet2row, 2, XmlUtil.xmlnsprefix(doc.xmlRootElement, doc.targetNamespace), cellFmt)
    sheet2.write(sheet2row, 3, os.path.basename(doc.uri), cellFmt)
    sheet2.write(sheet2row, 4, doc.targetNamespace, cellFmt)
    sheet2row += 1

    for doc, docReference in extensionSchemaDoc.referencesDocument.items():
        if docReference.referenceType == "href" and doc.type == ModelDocument.Type.LINKBASE:
            linkbaseType = ""
            role = docReference.referringModelObject.get("{http://www.w3.org/1999/xlink}role") or ""
            if role.startswith("http://www.xbrl.org/2003/role/") and role.endswith("LinkbaseRef"):
                linkbaseType = os.path.basename(role)[0:-11]
            sheet2.write(sheet2row, 0, "extension", cellFmt)
            sheet2.write(sheet2row, 1, "linkbase", cellFmt)
            sheet2.write(sheet2row, 2, linkbaseType, cellFmt)
            sheet2.write(sheet2row, 3, os.path.basename(doc.uri), cellFmt)
            sheet2.write(sheet2row, 4, "", cellFmt)
            sheet2row += 1

    sheet2row += 1

    # extended link roles defined in this document
    for roleURI, roleTypes in sorted(dts.roleTypes.items(),
                                     # sort on definition if any else URI
                                     key=lambda item: (item[1][0].definition or item[0])):
        for roleType in roleTypes:
            if roleType.modelDocument == extensionSchemaDoc:
                sheet2.write(sheet2row, 0, "extension", cellFmt)
                sheet2.write(sheet2row, 1, "role", cellFmt)
                sheet2.write(sheet2row, 2, "", cellFmt)
                sheet2.write(sheet2row, 3, roleType.definition, cellFmt)
                sheet2.write(sheet2row, 4, roleURI, cellFmt)
                sheet2row += 1

    # tree walk recursive function
    def treeWalk(row, depth, concept, preferredLabel, arcrole, preRelSet, visited):
        if concept is not None:
            # calc parents
            calcRelSet = dts.relationshipSet(XbrlConst.summationItem, preRelSet.linkrole)
            calcRel = None
            for modelRel in calcRelSet.toModelObject(concept):
                calcRel = modelRel
                break
            for i, hdr in enumerate(sheet1Headers):
                colType = hdr[1]
                value = ""
                if colType == "name":
                    value = str(concept.name)
                elif colType == "prefix" and concept.qname is not None:
                    value = concept.qname.prefix
                elif colType == "type" and concept.type is not None:
                    value = str(concept.type.qname)
                elif colType == "substitutionGroup":
                    value = str(concept.substitutionGroupQname)
                elif colType == "abstract":
                    value = "true" if concept.isAbstract else "false"
                elif colType == "nillable":
                    if concept.isNillable:
                        value = "true"
                elif colType == "periodType":
                    value = concept.periodType
                elif colType == "balance":
                    value = concept.balance
                elif colType == "label":
                    role = hdr[2]
                    lang = hdr[3]
                    if role == XbrlConst.standardLabel:
                        if "indented" in hdr:
                            roleUri = preferredLabel
                        elif "overridePreferred" in hdr:
                            if preferredLabel and preferredLabel != XbrlConst.standardLabel:
                                roleUri = role
                            else:
                                roleUri = "**no value**" # skip putting a value in this column
                        else:
                            roleUri = role
                    else:
                        roleUri = role
                    if roleUri != "**no value**":
                        value = concept.label(roleUri,
                                              linkroleHint=preRelSet.linkrole,
                                              lang=lang,
                                              fallbackToQname=(role == XbrlConst.standardLabel))
                elif colType == "preferredLabel" and preferredLabel:
                    if preferredLabel.startswith("http://www.xbrl.org/2003/role/"):
                        value = os.path.basename(preferredLabel)
                    else:
                        value = preferredLabel
                elif colType == "calculationParent" and calcRel is not None:
                    calcParent = calcRel.fromModelObject
                    if calcParent is not None:
                        value = str(calcParent.qname)
                elif colType == "calculationWeight" and calcRel is not None:
                    value = calcRel.weight
                elif colType == "depth":
                    value = depth
                if "indented" in hdr:
                    style = cellFmtIndented[min(depth, len(cellFmtIndented) - 1)]
                else:
                    style = cellFmt
                sheet1.write(row, i, value, style)
            row += 1
            if concept not in visited:
                visited.add(concept)
                for modelRel in preRelSet.fromModelObject(concept):
                    if modelRel.toModelObject is not None:
                        row = treeWalk(row, depth + 1, modelRel.toModelObject, modelRel.preferredLabel, arcrole, preRelSet, visited)
                visited.remove(concept)
        return row

    # use presentation relationships for Sheet1
    arcrole = XbrlConst.parentChild
    # sort URIs by definition
    linkroleUris = []
    relationshipSet = dts.relationshipSet(arcrole)
    if relationshipSet:
        for linkroleUri in relationshipSet.linkRoleUris:
            modelRoleTypes = dts.roleTypes.get(linkroleUri)
            if modelRoleTypes:
                roledefinition = (modelRoleTypes[0].genLabel(strip=True) or modelRoleTypes[0].definition or linkroleUri)
            else:
                roledefinition = linkroleUri
            linkroleUris.append((roledefinition, linkroleUri))
        linkroleUris.sort()

        # for each URI in definition order
        for roledefinition, linkroleUri in linkroleUris:
            # write linkrole
            sheet1.write(sheet1row, 0,
                         (roledefinition or linkroleUri),
                         xlwt.easyxf(cellFont))  # ELR has no boarders, just font specified
            sheet1row += 1
            # write header row
            for i, hdr in enumerate(sheet1Headers):
                sheet1.write(sheet1row, i, hdr[0], hdrCellFmt)
            sheet1row += 1
            # elr relationships for tree walk
            linkRelationshipSet = dts.relationshipSet(arcrole, linkroleUri)
            for rootConcept in linkRelationshipSet.rootConcepts:
                sheet1row = treeWalk(sheet1row, 0, rootConcept, None, arcrole, linkRelationshipSet, set())
            sheet1row += 1 # double space rows between tables
    else:
        # write header row
        for i, hdr in enumerate(sheet1Headers):
            sheet1.write(sheet1row, i, hdr[0], hdrCellFmt)
        sheet1row += 1
        # get lang
        lang = None
        for i, hdr in enumerate(sheet1Headers):
            colType = hdr[1]
            if colType == "label":
                lang = hdr[3]
                if colType == "label":
                    role = hdr[2]
                    lang = hdr[3]
        lbls = defaultdict(list)
        for concept in set(dts.qnameConcepts.values()): # may be twice if unqualified, with and without namespace
            lbls[concept.label(role,lang=lang)].append(concept.objectId())
        srtLbls = sorted(lbls.keys())
        excludedNamespaces = XbrlConst.ixbrlAll.union(
            (XbrlConst.xbrli, XbrlConst.link, XbrlConst.xlink, XbrlConst.xl,
             XbrlConst.xbrldt,
             XbrlConst.xhtml))
        for label in srtLbls:
            for objectId in lbls[label]:
                concept = dts.modelObject(objectId)
                if concept.modelDocument.targetNamespace not in excludedNamespaces:
                    for i, hdr in enumerate(sheet1Headers):
                        colType = hdr[1]
                        value = ""
                        if colType == "name":
                            value = str(concept.qname.localName)
                        elif colType == "prefix":
                            value = concept.qname.prefix
                        elif colType == "type":
                            value = str(concept.type.qname)
                        elif colType == "substitutionGroup":
                            value = str(concept.substitutionGroupQname)
                        elif colType == "abstract":
                            value = "true" if concept.isAbstract else "false"
                        elif colType == "periodType":
                            value = concept.periodType
                        elif colType == "balance":
                            value = concept.balance
                        elif colType == "label":
                            role = hdr[2]
                            lang = hdr[3]
                            value = concept.label(role, lang=lang)
                        elif colType == "depth":
                            value = 0
                        if "indented" in hdr:
                            style = cellFmtIndented[min(0, len(cellFmtIndented) - 1)]
                        else:
                            style = cellFmt
                        sheet1.write(sheet1row, i, value, style)
                    sheet1row += 1

    try:
        workbook.save(excelFile)
        dts.info("info:saveLoadableExcel",
            _("Saved Excel file: %(excelFile)s"),
            excelFile=os.path.basename(excelFile),
            modelXbrl=dts)
    except Exception as ex:
        dts.error("exception:saveLoadableExcel",
            _("File saving exception: %(error)s"), error=ex,
            modelXbrl=dts)

def saveLoadableExcelMenuEntender(cntlr, menu):
    # Extend menu with an item for the savedts plugin
    menu.add_command(label="Save Loadable Excel",
                     underline=0,
                     command=lambda: saveLoadableExcelMenuCommand(cntlr) )

def saveLoadableExcelMenuCommand(cntlr):
    # save DTS menu item has been invoked
    if cntlr.modelManager is None or cntlr.modelManager.modelXbrl is None:
        cntlr.addToLog("No taxonomy loaded.")
        return
        # get file name into which to save log file while in foreground thread
    excelFile = cntlr.uiFileDialog("save",
            title=_("arelle - Save Loadable Excel file"),
            initialdir=cntlr.config.setdefault("loadableExcelFileDir","."),
            filetypes=[(_("Excel file .xls"), "*.xls")],
            defaultextension=".xls")
    if not excelFile:
        return False
    import os
    cntlr.config["loadableExcelFileDir"] = os.path.dirname(excelFile)
    cntlr.saveConfig()

    import threading
    thread = threading.Thread(target=lambda
                                  _dts=cntlr.modelManager.modelXbrl,
                                  _excelFile=excelFile:
                                        saveLoadableExcel(_dts, _excelFile))
    thread.daemon = True
    thread.start()

def saveLoadableExcelCommandLineOptionExtender(parser):
    # extend command line options with a save DTS option
    parser.add_option("--save-loadable-excel",
                      action="store_true",
                      dest="saveLoadableExcel",
                      help=_("Save Loadable Excel file"))

def saveLoadableExcelCommandLineXbrlRun(cntlr, options, modelXbrl):
    # extend XBRL-loaded run processing for this option
    excelFile = getattr(options, "saveLoadableExcel", None)
    if excelFile:
        if cntlr.modelManager is None or cntlr.modelManager.modelXbrl is None:
            cntlr.addToLog("No taxonomy loaded.")
            return
        saveLoadableExcel(cntlr.modelManager.modelXbrl, excelFile)

__pluginInfo__ = {
    'name': 'Save Loadable Excel',
    'version': '0.9',
    'description': "This plug-in saves XBRL in Excel that can be loaded as an extension DTS.",
    'license': 'Apache-2',
    'author': 'Mark V Systems Limited',
    'copyright': '(c) Copyright 2013 Mark V Systems Limited, All rights reserved.',
    # classes of mount points (required)
    'CntlrWinMain.Menu.Tools': saveLoadableExcelMenuEntender,
    'CntlrCmdLine.Options': saveLoadableExcelCommandLineOptionExtender,
    'CntlrCmdLine.Xbrl.Run': saveLoadableExcelCommandLineXbrlRun,
}


text:
using System.Data;
using System.Data.Common;
using System.Linq.Expressions;
using System.Reflection;
using HWClassLibrary.Debug;
using System.Collections.Generic;
using System.Linq;
using System;
using HWClassLibrary.Helper;
using HWClassLibrary.sqlass.MetaData;

namespace HWClassLibrary.sqlass
{
    public class Context : Dumpable
    {
        DbConnection _connection;
        public bool IsSqlCeConnectionBug;
        List<IPendingChange> _pending;
        readonly SimpleCache<MetaData.MetaData> _sqlMetaData;

        public Context() { _sqlMetaData = new SimpleCache<MetaData.MetaData>(ObtainSQLMetaData); }

        MetaData.MetaData ObtainSQLMetaData() { return new MetaData.MetaData(this); }

        public void SaveChanges()
        {
            if(_pending == null)
                return;

            var transaction = Connection.BeginTransaction();
            try
            {
                foreach(var pendingChange in _pending)
                    pendingChange.Apply(this);
                transaction.Commit();
                _pending = null;
            }
            catch
            {
                transaction.Rollback();
                throw;
            }
        }

        public DbConnection Connection
        {
            internal get { return _connection; }
            set
            {
                if(_connection != null)
                    _connection.Close();
                _connection = value;
                _connection.Open();
            }
        }

        internal void AddPendingChange(IPendingChange data)
        {
            if(_pending == null)
                _pending = new List<IPendingChange>();
            _pending.Add(data);
        }

        protected void UpdateDatabase(object container)
        {
            if(_pending != null)
                throw new UnsavedChangedException();

            var type = container.GetType();
            var target = typeof(Table<,>);

            var modell = type
                .GetMembers()
                .Where(m => m.DeclaringType == type && m.MemberType == MemberTypes.Field)
                .Cast<FieldInfo>()
                .Where(fi => fi.FieldType.GetGenericTypeDefinition() == target)
                .Select(fi => ((IMetaDataProvider) fi.GetValue(container)).MetaData)
                .ToArray();

            var dataBase = _sqlMetaData.Value.Tables;

            var actions = modell.Merge(dataBase, kt => kt.Name, st => st.Name).ToArray();
            foreach(var action in actions)
                UpdateDatabase(action.Item2, action.Item3);
        }

        void UpdateDatabase(Table modell, Table dataBase)
        {
            if(dataBase == null)
            {
                ExecuteNonQuery(modell.CreateTable);
                return;
            }

            if(modell == null)
            {
                ExecuteNonQuery("drop table " + dataBase.Name);
                return;
            }

            var actions = modell
                .Columns
                .Merge(dataBase.Columns, mo => mo.Name, st => st.Name)
                .Where(a => a.Item2.DiffersFrom(a.Item3))
                .ToArray();
            if(actions.Length == 0)
                return;

            foreach(var action in actions)
            {
                var sql = modell.UpdateDefinition(action.Item2, action.Item3);
                ExecuteNonQuery(sql);
            }
        }

        internal void ExecuteNonQuery(string text)
        {
            Tracer.FlaggedLine(1, text, FilePositionTag.Query);
            Connection.ToCommand(text).ExecuteNonQuery();
        }
        internal T[] Execute<T>(string text) where T : IReaderInitialize, new()
        {
            Tracer.FlaggedLine(1, text, FilePositionTag.Query);
            return Connection.ToArray<T>(text);
        }
        public DataTable Schema(string text) { return Connection.Schema(text); }

        public DataTable SubSchema(string name) { return Connection.GetSchema(name); }

        string CreateSqlStatement(Expression expression) { return new StringVisitor().Visit(expression); }
        internal DbDataReader ToDataReader(Expression expression) { return ToDataReader(CreateSqlStatement(expression)); }
        internal DbDataReader ToDataReader(string text) { return Connection.ToDataReader(text); }
    }

    sealed class UnsavedChangedException : Exception
    {}

}


text:
{% extends 'templates/nhs_transaction_layout.html' %}
{% import 'includes/form_macros.html' as form_macros %}

{% block afterHeader %}
  {% include "includes/service-headers/low-income.html" %}
{% endblock %}

{% block content %}

      Does your rent include any of the following?

Tick all that apply

  <form action="" method="get" class="form">

        <input type="checkbox" id="cbsa" name="bgroup1">

          Meals

        <input type="checkbox" id="cbj" name="bgroup1">

          Heating

        <input type="checkbox" id="sa" name="bgroup1">

          Cooking

        <input type="checkbox" id="jsa" name="bgroup1">

          Hot water

or

        <input type="checkbox" id="none" name="bgroup1">

          These things are not included

    {{
      form_macros.button({
        href: 'services',
        label: 'Next'
      })
    }}

  </form>

{% endblock %}


text:
package com.ityang.leetcode;

public class Subject292 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.println(canWinNim(3));
	}

	public static boolean canWinNim(int n) {
		return !(n%4==0);
	}
}


text:
using Microsoft.Owin;
using Owin;

//[assembly: OwinStartup(typeof(MQ.Web.Startup), "Configuration")]
namespace MQ.Web
{
    //public class Startup
    //{
    //    public void Configuration(IAppBuilder app)
    //    {
    //        Startup.ConfigureSignalR(app);
    //    }

    //    public static void ConfigureSignalR(IAppBuilder app)
    //    {
    //        // For more information on how to configure your application using OWIN startup, visit http://go.microsoft.com/fwlink/?LinkID=316888
    //        app.MapSignalR();
    //    }
    //}
}


text:
// Copyright 2020 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * @fileoverview Rules service for the AlgebraicExpressionInput interaction.
 */

import { Injectable } from '@angular/core';
import { downgradeInjectable } from '@angular/upgrade/static';

import nerdamer from 'nerdamer';

import { MathInteractionsService } from 'services/math-interactions.service';
import { AlgebraicExpressionAnswer } from 'interactions/answer-defs';
import {
  AlgebraicExpressionRuleInputsWithPlaceholder,
  AlgebraicExpressionRuleInputsWithoutPlaceholder
} from 'interactions/rule-input-defs';
import { NumericExpressionInputRulesService } from 'interactions/NumericExpressionInput/directives/numeric-expression-input-rules.service';

@Injectable({
  providedIn: 'root'
})
export class AlgebraicExpressionInputRulesService {
  MatchesExactlyWith(
      answer: AlgebraicExpressionAnswer,
      inputs: AlgebraicExpressionRuleInputsWithoutPlaceholder): boolean {
    let mis = new MathInteractionsService();

    // If the answer and the inputs are both purely numeric, we use the numeric
    // expression input's rule functions.
    if (
      !mis.containsAtLeastOneVariable(answer) &&
      !mis.containsAtLeastOneVariable(inputs.x)
    ) {
      let numericExpressionRuleService = (
        new NumericExpressionInputRulesService());
      return numericExpressionRuleService.MatchesExactlyWith(answer, inputs);
    }

    // Inserting '*' signs between variables if not present.
    answer = mis.insertMultiplicationSigns(answer);
    inputs.x = mis.insertMultiplicationSigns(inputs.x);
    return answer === inputs.x;
  }

  IsEquivalentTo(
      answer: AlgebraicExpressionAnswer,
      inputs: AlgebraicExpressionRuleInputsWithoutPlaceholder): boolean {
    let mis = new MathInteractionsService();

    // If the answer and the inputs are both purely numeric, we use the numeric
    // expression input's rule functions.
    if (
      !mis.containsAtLeastOneVariable(answer) &&
      !mis.containsAtLeastOneVariable(inputs.x)
    ) {
      let numericExpressionRuleService = (
        new NumericExpressionInputRulesService());
      return numericExpressionRuleService.IsEquivalentTo(answer, inputs);
    }

    // Inserting '*' signs between variables if not present.
    answer = mis.insertMultiplicationSigns(answer);
    inputs.x = mis.insertMultiplicationSigns(inputs.x);

    let expandedLearnerAnswer = nerdamer(answer).expand().text();
    let simplifiedLearnerAnswer = nerdamer(
      `simplify(${expandedLearnerAnswer})`).text();

    let expandedCreatorAnswer = nerdamer(inputs.x).expand().text();
    let simplifiedCreatorAnswer = nerdamer(
      `simplify(${expandedCreatorAnswer})`).text();
    return nerdamer(
      simplifiedLearnerAnswer
    ).eq(simplifiedCreatorAnswer);
  }

  ContainsSomeOf(
      answer: AlgebraicExpressionAnswer,
      inputs: AlgebraicExpressionRuleInputsWithoutPlaceholder): boolean {
    // At least one term should match between answer and input.
    let mis = new MathInteractionsService();
    // Inserting '*' signs between variables if not present.
    answer = mis.insertMultiplicationSigns(answer);
    inputs.x = mis.insertMultiplicationSigns(inputs.x);

    // The expression is first split into terms by addition and subtraction.
    let answerTerms = mis.getTerms(answer);
    let inputTerms = mis.getTerms(inputs.x);

    for (let answerTerm of answerTerms) {
      for (let inputTerm of inputTerms) {
        if (mis.termsMatch(answerTerm, inputTerm)) {
          return true;
        }
      }
    }
    return false;
  }

  OmitsSomeOf(
      answer: AlgebraicExpressionAnswer,
      inputs: AlgebraicExpressionRuleInputsWithoutPlaceholder): boolean {
    // There must be at least one term in the input that is not present in the
    // answer.
    let mis = new MathInteractionsService();
    // Inserting '*' signs between variables if not present.
    answer = mis.insertMultiplicationSigns(answer);
    inputs.x = mis.insertMultiplicationSigns(inputs.x);

    // The expression is first split into terms by addition and subtraction.
    let answerTerms = mis.getTerms(answer);
    let inputTerms = mis.getTerms(inputs.x);

    for (let inputTerm of inputTerms) {
      let matched = false;
      for (let answerTerm of answerTerms) {
        if (mis.termsMatch(answerTerm, inputTerm)) {
          matched = true;
          break;
        }
      }
      if (!matched) {
        return true;
      }
    }
    return false;
  }

  MatchesWithGeneralForm(
      answer: AlgebraicExpressionAnswer,
      inputs: AlgebraicExpressionRuleInputsWithPlaceholder): boolean {
    let mis = new MathInteractionsService();
    // Inserting '*' signs between variables if not present.
    answer = mis.insertMultiplicationSigns(answer);
    inputs.x = mis.insertMultiplicationSigns(inputs.x);

    let placeholders = inputs.y;

    return mis.expressionMatchWithPlaceholders(inputs.x, answer, placeholders);
  }
}

angular.module('oppia').factory(
  'AlgebraicExpressionInputRulesService',
  downgradeInjectable(AlgebraicExpressionInputRulesService));


text:
[kakao](../../index.md) / [com.agoda.kakao.text](../index.md) / [TextViewAssertions](index.md) / [startsWithText](./starts-with-text.md)

# startsWithText

`open fun startsWithText(text: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)

Checks if the view text start with given substring

### Parameters

`text` - Text to be searched


text:
require 'spec_helper'

module Walrus
  using StringAdditions

  describe 'converting to source strings' do
    it 'standard strings should be unchanged' do
      expect(''.to_source_string).to eq('')
      expect('hello world'.to_source_string).to eq('hello world')
      expect("hello\nworld".to_source_string).to eq("hello\nworld")
    end

    it 'single quotes should be escaped' do
      expect("'foo'".to_source_string).to eq("\\'foo\\'")
    end

    it 'backslashes should be escaped' do
      expect('hello\\nworld'.to_source_string).to eq("hello\\\\nworld")
    end

    it 'should work with Unicode characters' do
      expect('€ información…'.to_source_string).to eq('€ información…')
    end

    it 'should be able to round trip' do
      expect(eval("'" + ''.to_source_string + "'")).to eq('')
      expect(eval("'" + 'hello world'.to_source_string + "'")).to eq('hello world')
      expect(eval("'" + "hello\nworld".to_source_string + "'")).to eq("hello\nworld")
      expect(eval("'" + "'foo'".to_source_string + "'")).to eq('\'foo\'')
      expect(eval("'" + 'hello\\nworld'.to_source_string + "'")).to eq('hello\\nworld')
      expect(eval("'" + '€ información…'.to_source_string + "'")).to eq('€ información…')
    end
  end
end


text:
function setupTent(el) {
  var href = el.href;

  if ($('#tent-profile').length > 0) {
    window.location = href;
    return;
  }

  var spinner = new Spinner(spin_opts).spin();
  $('#tent-link').append(spinner.el);

  require(
    ["json!" + tent_entity_uri + "/posts",
     "json!" + tent_entity_uri + "/profile",
     "json!" + tent_entity_uri + "/followers",
     "json!" + tent_entity_uri + "/followings",
     "json!" + tent_entity_uri + "/posts/count",
     "text!templates/tent-view.html"],

    function(tent_posts, tent_profile, tent_followers, tent_followings, tent_posts_count, tent_view) {

      if (tent_posts.error || tent_posts.length == 0) {
        window.location = href;
          return;
        }

      var template = Handlebars.compile(tent_view);

      var user = tent_profile["https://tent.io/types/info/basic/v0.1.0"];

      user.entity_url = tent_profile["https://tent.io/types/info/core/v0.1.0"].entity;
      user.feed_url = tent_feed_url;
      user.profile_image_url = user.avatar_url;
      user.statuses_count =numberWithCommas(tent_posts_count);
      user.friends_count = numberWithCommas(tent_followings.length);
      user.followers_count = numberWithCommas(tent_followers.length);
      user.f_description =  user.bio;

      var posts = [];
      var item_count = 0;
      $.each(tent_posts, function(i, t) {
        if (item_count > 4)
          return;

        // show only tent.io status posts
        if (t.type == "https://tent.io/types/post/status/v0.1.0") {
          t.formated_date = moment(new Date(t.published_at * 1000)).fromNow();
          t.f_text = tentLinkify(t.content.text);
          t.user = user;
          posts.push(t);
          item_count++;
        }
      });

      var template_data = {
        "user": user,
        "posts": posts
      }

      $(template(template_data)).modal().on('hidden', function () {
        $(this).remove();
        adjustSelection('home');
      })

    spinner.stop();
    });

}

function tentLinkify(text) {
  text = text.replace(/(https?:\/\/\S+)/gi, function (s) {
    return '' + s + '';
  });

  return text;
}


text:
package net.herit.common.excel.transformer;

import java.util.List;
import java.util.Map;

import net.sf.jxls.transformer.XLSTransformer;

public abstract class HeritAbstractExcelTransformer {

	protected XLSTransformer transformer;

	public HeritAbstractExcelTransformer() {
		transformer = new XLSTransformer();
	}

	protected abstract void tranformDataToExcel(String fileName, String srcFilePath, String destFilePath,
			Object headerData, List<Map<String, Object>> dataList);

}


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.Azure.Devices
{
    using Newtonsoft.Json;

    public sealed class AuthenticationMechanism
    {
        public AuthenticationMechanism()
        {
            this.SymmetricKey = new SymmetricKey();
        }

        [JsonProperty(PropertyName = "symmetricKey")]
        public SymmetricKey SymmetricKey { get; set; }
    }
}


text:
$(document).ready(function() {
			var selectedItems=0;
			//Table Row Click Event
			$('.clickable').click( function() {
				$('#inbox-wrapper').addClass('animated fadeOut');
				$('#inbox-wrapper').hide();
				$('#preview-email-wrapper').addClass('animated fadeIn ');
				$('#preview-email-wrapper').show();
				$('.page-title').show();
				//Load email details
				$('#inbox-wrapper').removeClass('animated fadeOut');
				$('#inbox-wrapper').removeClass('animated fadeIn');
			});

			//Back Button Event
			$('#btn-back').click( function() {
				$('#inbox-wrapper').addClass('animated fadeIn');
				$('#inbox-wrapper').show();
				$('#preview-email-wrapper').addClass('animated fadeOut');
				$('#preview-email-wrapper').hide();
				$('.page-title').hide();
				$('#preview-email-wrapper').removeClass('animated fadeIn ');
				$('#preview-email-wrapper').removeClass('animated fadeOut ');
			});

			//Check box select Event
			//Trigger Quick bar
			$('#email-list .checkbox input').click( function() {
				if($(this).is(':checked')){
					selectedItems++;
					$("#quick-access").css("bottom","0px");
					$(this).parent().parent().parent().toggleClass('row_selected');
				}
				else{
						selectedItems--;
						$("#quick-access").css("bottom","0px");
						$(this).parent().parent().parent().toggleClass('row_selected');
				}
				if(selectedItems==0){
						$("#quick-access").css("bottom","-115px");
				}
			});

			//Adjust Page layout to condensed
			$('.page-content').css('margin-left','50');

			//Quick action dismiss Event
			$('#quick-access .btn-cancel').click( function() {
					$("#quick-access").css("bottom","-115px");
					$('#email-list .checkbox').children('input').attr('checked', false);
					$("#emails tbody tr").removeClass('row_selected');
			});

});


text:
package headfirst.command.simpleremote;

/**
 * Created by Gavin on 2017/3/14.
 */
public class Light {

    public Light() {
    }

    public void on() {
        System.out.println("Light is on");
    }

    public void off() {
        System.out.println("Light is off");
    }
}


text:
/*Newlines (\a) and spaces (\20) before each parameter*/
.sig-param::before {
    content: "\a\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20\20";
    white-space: pre;
}

/*Newline after the last parameter (so the closing bracket is on a new line)*/
dt em.sig-param:last-of-type::after {
    content: "\a";
    white-space: pre;
}

/*To have blue background of width of the block (instead of width of content)*/
dl.class > dt:first-of-type {
    display: block !important;
}


text:
<?php

// src/AppBundle/Utils/InteractionCategoryStatus.php
namespace AppBundle\Utils;

class InteractionCategoryStatus
{

	public $highest_category_status;

	public $category_array;

	public $tissue_expression_array;

	public function getHighestCategoryStatus() {
		return $this->highest_category_status;
	}
	public function setHighestCategoryStatus($highest_category_status) {
		$this->highest_category_status = $highest_category_status;
		return $this;
	}
	public function getCategoryArray() {
		return $this->category_array;
	}
	public function setCategoryArray($category_array) {
		$this->category_array= $category_array;
		return $this;
	}
	public function getTissueExpressionArray() {
		return $this->tissue_expression_array;
	}
	public function setTissueExpressionArray($tissue_expression_array) {
		$this->tissue_expression_array= $tissue_expression_array;
		return $this;
	}

}

?>


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width">
	<meta name="description" content="Web Developer, Entrepreneur, Freelancer and Creative. Passionate about startups, leadership, code and some other things.">
	<meta name="keywords" content="web developer, web development, front-end, css, html, javascript, freelancer, entrepreneur">

    <meta property="og:locale" content="pt_BR">
    <meta property="og:url" content="http://www.julianopadilha.com">
    <meta property="og:title" content="Juliano Padilha">
    <meta property="og:site_name" content="Juliano Padilha">
    <meta property="og:description" content="Entrepreneur; Front End Developer; Changemaker; Cerveja; Startups; Vendas; Marketing; Apple; Defensor do SDG #8; São Paulo">
    <meta property="og:image" content="http://julianopadilha.com/assets/images/hero.jpg">
    <meta property="og:image:type" content="image/jpeg">
    <meta property="og:image:width" content="800">
    <meta property="og:image:height" content="600">
    <meta property="og:type" content="website">

    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:description" content="Entrepreneur; Front End Developer; Changemaker; Cerveja; Startups; Vendas; Marketing; Apple; Defensor do SDG #8; São Paulo">
    <meta name="twitter:title" content="Juliano Padilha">
    <meta name="twitter:site" content="@padilhano">
    <meta name="twitter:image" content="http://julianopadilha.com/assets/images/hero.jpg">
    <meta name="twitter:creator" content="@padilhano">

	<link rel="stylesheet" type="text/css" href="assets/css/main.css">
	<title>Juliano Padilha | Front End Developer, Entrepreneur, Freelancer and Creative</title>
	<link rel="manifest" href="/manifest.json">

  	<meta name="apple-mobile-web-app-capable" content="yes">
  	<meta name="apple-mobile-web-app-status-bar-style" content="black">
  	<meta name="apple-mobile-web-app-title" content="JulianoPadilha">
  	<link rel="apple-touch-icon" href="assets/images/icons/icon-152x152.png">
  	<meta name="msapplication-TileImage" content="assets/images/icons/icon-144x144.png">
  	<meta name="msapplication-TileColor" content="#2F3BA2">

About

Interests

Articles

Skills

Projects

Contact

Juliano Padilha

About

Interests

Articles

Skills

Projects

Contact

Web Developer& Entrepreneur& Changemaker...

...born to create and share...

ENTREPRENEURSHIP has the power to change reality and bring innovation to the most diverse areas, causing economies to grow and more opportunities arise. I am an entrepreneur. And you?

LEADERSHIP is one of the great skills that someone who wants to change the world needs to have. I work hard to exercise my leadership every day in everything I'm involved.

WRITE is one of the ways I have found to put order in the ideas bubbling in my head. Writing also helps me in the study process. I usually write about everything I'm studying and this has helped me a lot.

READ gives me the power to go further and see the world from a different perspective from mine. I read everything and do not spend a single day without reading something (article, book, ebook, etc ..). In my GitHub has a repository only with books and ebooks I have ever read.

STUDY shows me that I always have something new to learn and I should never stay in my comfort zone. I love to study and know that every day I know a little bit more than the previous day.

Knowing how to CODE is like having super powers. And I believe that I have powers to create awesome things and share to world.

...Passionate about some things...

						See more things

Um pouco sobre a BrazilJS 2017: a maior conferência JavaScript do Universo

Fundamentos do CSS: Flexbox

Debug tips: Chrome Developer Tools

Back to basics: HTML5 Fundamentals

Como usar o GitHub como um ser humano adequado

Precisamos falar sobre Progressive Enhancement

How to build: Um To-Do List com JavaScript utilizando a API Web Storage do HTML

Criação: Interface do Nubank

...Who likes to write and design things...

								See All Articles

HTML/CSS

JavaScript

Git

Bootstrap

Gulp

Sass

Requirements Analysis

PHP

Wordpress

Email Design

jQuery

Design Interfaces

...And have some cool skills...

							Checkout more Skills

 ...and Projects...

							See more on Behance

				sistemas.padilha@gmail.com


text:
from sparktk.propobj import PropertiesObject

class LinearRegressionTestMetrics(PropertiesObject):
    """
    RegressionMetrics class used to hold the data returned from linear regression test
    """
    def __init__(self, scala_result):
        self._explained_variance = scala_result.explainedVariance()
        self._mean_absolute_error = scala_result.meanAbsoluteError()
        self._mean_squared_error = scala_result.meanSquaredError()
        self._r2 = scala_result.r2()
        self._root_mean_squared_error = scala_result.rootMeanSquaredError()

    @property
    def explained_variance(self):
        """The explained variance regression score"""
        return self._explained_variance

    @property
    def mean_absolute_error(self):
        """The risk function corresponding to the expected value of the absolute error loss or l1-norm loss"""
        return self._mean_absolute_error

    @property
    def mean_squared_error(self):
        """The risk function corresponding to the expected value of the squared error loss or quadratic loss"""
        return self._mean_squared_error

    @property
    def r2(self):
        """The coefficient of determination"""
        return self._r2

    @property
    def root_mean_squared_error(self):
        """The square root of the mean squared error"""
        return self._root_mean_squared_error


text:
<?php

namespace EVRRSSFeedORM\om;

use \BasePeer;
use \Criteria;
use \PDO;
use \PDOStatement;
use \Propel;
use \PropelException;
use \PropelPDO;
use EVRRSSFeedORM\EVRRSSFeedView;
use EVRRSSFeedORM\EVRRSSFeedViewPeer;
use EVRRSSFeedORM\map\EVRRSSFeedViewTableMap;

/**
 * Base static class for performing query and update operations on the 'evr_rss_feed_view' table.
 *
 *
 *
 * @package propel.generator.EVRRSSFeed.om
 */
abstract class BaseEVRRSSFeedViewPeer
{

    /** the default database name for this class */
    const DATABASE_NAME = 'evr';

    /** the table name for this class */
    const TABLE_NAME = 'evr_rss_feed_view';

    /** the related Propel class for this table */
    const OM_CLASS = 'EVRRSSFeedORM\\EVRRSSFeedView';

    /** the related TableMap class for this table */
    const TM_CLASS = 'EVRRSSFeedViewTableMap';

    /** The total number of columns. */
    const NUM_COLUMNS = 12;

    /** The number of lazy-loaded columns. */
    const NUM_LAZY_LOAD_COLUMNS = 0;

    /** The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */
    const NUM_HYDRATE_COLUMNS = 12;

    /** the column name for the EVENT_ID field */
    const EVENT_ID = 'evr_rss_feed_view.EVENT_ID';

    /** the column name for the EVENT_NAME field */
    const EVENT_NAME = 'evr_rss_feed_view.EVENT_NAME';

    /** the column name for the EVENT_DESCRIPTION field */
    const EVENT_DESCRIPTION = 'evr_rss_feed_view.EVENT_DESCRIPTION';

    /** the column name for the EVENT_STATUS field */
    const EVENT_STATUS = 'evr_rss_feed_view.EVENT_STATUS';

    /** the column name for the EVENT_RESPONSIBLE_REPRESENTATIVE_NAME field */
    const EVENT_RESPONSIBLE_REPRESENTATIVE_NAME = 'evr_rss_feed_view.EVENT_RESPONSIBLE_REPRESENTATIVE_NAME';

    /** the column name for the EVENT_RESPONSIBLE_REPRESENTATIVE_EMAIL_ADDRESS field */
    const EVENT_RESPONSIBLE_REPRESENTATIVE_EMAIL_ADDRESS = 'evr_rss_feed_view.EVENT_RESPONSIBLE_REPRESENTATIVE_EMAIL_ADDRESS';

    /** the column name for the EVENT_START_TIME field */
    const EVENT_START_TIME = 'evr_rss_feed_view.EVENT_START_TIME';

    /** the column name for the EVENT_END_TIME field */
    const EVENT_END_TIME = 'evr_rss_feed_view.EVENT_END_TIME';

    /** the column name for the EVENT_LOCATION field */
    const EVENT_LOCATION = 'evr_rss_feed_view.EVENT_LOCATION';

    /** the column name for the EVENT_COST field */
    const EVENT_COST = 'evr_rss_feed_view.EVENT_COST';

    /** the column name for the EVENT_START_TIME_FILTER field */
    const EVENT_START_TIME_FILTER = 'evr_rss_feed_view.EVENT_START_TIME_FILTER';

    /** the column name for the EVENT_END_TIME_FILTER field */
    const EVENT_END_TIME_FILTER = 'evr_rss_feed_view.EVENT_END_TIME_FILTER';

    /** The default string format for model objects of the related table **/
    const DEFAULT_STRING_FORMAT = 'YAML';

    /**
     * An identiy map to hold any loaded instances of EVRRSSFeedView objects.
     * This must be public so that other peer classes can access this when hydrating from JOIN
     * queries.
     * @var        array EVRRSSFeedView[]
     */
    public static $instances = array();

    /**
     * holds an array of fieldnames
     *
     * first dimension keys are the type constants
     * e.g. EVRRSSFeedViewPeer::$fieldNames[EVRRSSFeedViewPeer::TYPE_PHPNAME][0] = 'Id'
     */
    protected static $fieldNames = array (
        BasePeer::TYPE_PHPNAME => array ('EventId', 'EventName', 'EventDescription', 'EventStatus', 'EventResponsibleRepresentativeName', 'EventResponsibleRepresentativeEmailAddress', 'EventStartTime', 'EventEndTime', 'EventLocation', 'EventCost', 'EventStartTimeFilter', 'EventEndTimeFilter', ),
        BasePeer::TYPE_STUDLYPHPNAME => array ('eventId', 'eventName', 'eventDescription', 'eventStatus', 'eventResponsibleRepresentativeName', 'eventResponsibleRepresentativeEmailAddress', 'eventStartTime', 'eventEndTime', 'eventLocation', 'eventCost', 'eventStartTimeFilter', 'eventEndTimeFilter', ),
        BasePeer::TYPE_COLNAME => array (EVRRSSFeedViewPeer::EVENT_ID, EVRRSSFeedViewPeer::EVENT_NAME, EVRRSSFeedViewPeer::EVENT_DESCRIPTION, EVRRSSFeedViewPeer::EVENT_STATUS, EVRRSSFeedViewPeer::EVENT_RESPONSIBLE_REPRESENTATIVE_NAME, EVRRSSFeedViewPeer::EVENT_RESPONSIBLE_REPRESENTATIVE_EMAIL_ADDRESS, EVRRSSFeedViewPeer::EVENT_START_TIME, EVRRSSFeedViewPeer::EVENT_END_TIME, EVRRSSFeedViewPeer::EVENT_LOCATION, EVRRSSFeedViewPeer::EVENT_COST, EVRRSSFeedViewPeer::EVENT_START_TIME_FILTER, EVRRSSFeedViewPeer::EVENT_END_TIME_FILTER, ),
        BasePeer::TYPE_RAW_COLNAME => array ('EVENT_ID', 'EVENT_NAME', 'EVENT_DESCRIPTION', 'EVENT_STATUS', 'EVENT_RESPONSIBLE_REPRESENTATIVE_NAME', 'EVENT_RESPONSIBLE_REPRESENTATIVE_EMAIL_ADDRESS', 'EVENT_START_TIME', 'EVENT_END_TIME', 'EVENT_LOCATION', 'EVENT_COST', 'EVENT_START_TIME_FILTER', 'EVENT_END_TIME_FILTER', ),
        BasePeer::TYPE_FIELDNAME => array ('event_id', 'event_name', 'event_description', 'event_status', 'event_responsible_representative_name', 'event_responsible_representative_email_address', 'event_start_time', 'event_end_time', 'event_location', 'event_cost', 'event_start_time_filter', 'event_end_time_filter', ),
        BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
    );

    /**
     * holds an array of keys for quick access to the fieldnames array
     *
     * first dimension keys are the type constants
     * e.g. EVRRSSFeedViewPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
     */
    protected static $fieldKeys = array (
        BasePeer::TYPE_PHPNAME => array ('EventId' => 0, 'EventName' => 1, 'EventDescription' => 2, 'EventStatus' => 3, 'EventResponsibleRepresentativeName' => 4, 'EventResponsibleRepresentativeEmailAddress' => 5, 'EventStartTime' => 6, 'EventEndTime' => 7, 'EventLocation' => 8, 'EventCost' => 9, 'EventStartTimeFilter' => 10, 'EventEndTimeFilter' => 11, ),
        BasePeer::TYPE_STUDLYPHPNAME => array ('eventId' => 0, 'eventName' => 1, 'eventDescription' => 2, 'eventStatus' => 3, 'eventResponsibleRepresentativeName' => 4, 'eventResponsibleRepresentativeEmailAddress' => 5, 'eventStartTime' => 6, 'eventEndTime' => 7, 'eventLocation' => 8, 'eventCost' => 9, 'eventStartTimeFilter' => 10, 'eventEndTimeFilter' => 11, ),
        BasePeer::TYPE_COLNAME => array (EVRRSSFeedViewPeer::EVENT_ID => 0, EVRRSSFeedViewPeer::EVENT_NAME => 1, EVRRSSFeedViewPeer::EVENT_DESCRIPTION => 2, EVRRSSFeedViewPeer::EVENT_STATUS => 3, EVRRSSFeedViewPeer::EVENT_RESPONSIBLE_REPRESENTATIVE_NAME => 4, EVRRSSFeedViewPeer::EVENT_RESPONSIBLE_REPRESENTATIVE_EMAIL_ADDRESS => 5, EVRRSSFeedViewPeer::EVENT_START_TIME => 6, EVRRSSFeedViewPeer::EVENT_END_TIME => 7, EVRRSSFeedViewPeer::EVENT_LOCATION => 8, EVRRSSFeedViewPeer::EVENT_COST => 9, EVRRSSFeedViewPeer::EVENT_START_TIME_FILTER => 10, EVRRSSFeedViewPeer::EVENT_END_TIME_FILTER => 11, ),
        BasePeer::TYPE_RAW_COLNAME => array ('EVENT_ID' => 0, 'EVENT_NAME' => 1, 'EVENT_DESCRIPTION' => 2, 'EVENT_STATUS' => 3, 'EVENT_RESPONSIBLE_REPRESENTATIVE_NAME' => 4, 'EVENT_RESPONSIBLE_REPRESENTATIVE_EMAIL_ADDRESS' => 5, 'EVENT_START_TIME' => 6, 'EVENT_END_TIME' => 7, 'EVENT_LOCATION' => 8, 'EVENT_COST' => 9, 'EVENT_START_TIME_FILTER' => 10, 'EVENT_END_TIME_FILTER' => 11, ),
        BasePeer::TYPE_FIELDNAME => array ('event_id' => 0, 'event_name' => 1, 'event_description' => 2, 'event_status' => 3, 'event_responsible_representative_name' => 4, 'event_responsible_representative_email_address' => 5, 'event_start_time' => 6, 'event_end_time' => 7, 'event_location' => 8, 'event_cost' => 9, 'event_start_time_filter' => 10, 'event_end_time_filter' => 11, ),
        BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, )
    );

    /**
     * Translates a fieldname to another type
     *
     * @param      string $name field name
     * @param      string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
     *                         BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
     * @param      string $toType   One of the class type constants
     * @return string          translated name of the field.
     * @throws PropelException - if the specified name could not be found in the fieldname mappings.
     */
    public static function translateFieldName($name, $fromType, $toType)
    {
        $toNames = EVRRSSFeedViewPeer::getFieldNames($toType);
        $key = isset(EVRRSSFeedViewPeer::$fieldKeys[$fromType][$name]) ? EVRRSSFeedViewPeer::$fieldKeys[$fromType][$name] : null;
        if ($key === null) {
            throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(EVRRSSFeedViewPeer::$fieldKeys[$fromType], true));
        }

        return $toNames[$key];
    }

    /**
     * Returns an array of field names.
     *
     * @param      string $type The type of fieldnames to return:
     *                      One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
     *                      BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
     * @return array           A list of field names
     * @throws PropelException - if the type is not valid.
     */
    public static function getFieldNames($type = BasePeer::TYPE_PHPNAME)
    {
        if (!array_key_exists($type, EVRRSSFeedViewPeer::$fieldNames)) {
            throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' . $type . ' was given.');
        }

        return EVRRSSFeedViewPeer::$fieldNames[$type];
    }

    /**
     * Convenience method which changes table.column to alias.column.
     *
     * Using this method you can maintain SQL abstraction while using column aliases.
     * <code>
     *		$c->addAlias("alias1", TablePeer::TABLE_NAME);
     *		$c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
     * </code>
     * @param      string $alias The alias for the current table.
     * @param      string $column The column name for current table. (i.e. EVRRSSFeedViewPeer::COLUMN_NAME).
     * @return string
     */
    public static function alias($alias, $column)
    {
        return str_replace(EVRRSSFeedViewPeer::TABLE_NAME.'.', $alias.'.', $column);
    }

    /**
     * Add all the columns needed to create a new object.
     *
     * Note: any columns that were marked with lazyLoad="true" in the
     * XML schema will not be added to the select list and only loaded
     * on demand.
     *
     * @param      Criteria $criteria object containing the columns to add.
     * @param      string   $alias    optional table alias
     * @throws PropelException Any exceptions caught during processing will be
     *		 rethrown wrapped into a PropelException.
     */
    public static function addSelectColumns(Criteria $criteria, $alias = null)
    {
        if (null === $alias) {
            $criteria->addSelectColumn(EVRRSSFeedViewPeer::EVENT_ID);
            $criteria->addSelectColumn(EVRRSSFeedViewPeer::EVENT_NAME);
            $criteria->addSelectColumn(EVRRSSFeedViewPeer::EVENT_DESCRIPTION);
            $criteria->addSelectColumn(EVRRSSFeedViewPeer::EVENT_STATUS);
            $criteria->addSelectColumn(EVRRSSFeedViewPeer::EVENT_RESPONSIBLE_REPRESENTATIVE_NAME);
            $criteria->addSelectColumn(EVRRSSFeedViewPeer::EVENT_RESPONSIBLE_REPRESENTATIVE_EMAIL_ADDRESS);
            $criteria->addSelectColumn(EVRRSSFeedViewPeer::EVENT_START_TIME);
            $criteria->addSelectColumn(EVRRSSFeedViewPeer::EVENT_END_TIME);
            $criteria->addSelectColumn(EVRRSSFeedViewPeer::EVENT_LOCATION);
            $criteria->addSelectColumn(EVRRSSFeedViewPeer::EVENT_COST);
            $criteria->addSelectColumn(EVRRSSFeedViewPeer::EVENT_START_TIME_FILTER);
            $criteria->addSelectColumn(EVRRSSFeedViewPeer::EVENT_END_TIME_FILTER);
        } else {
            $criteria->addSelectColumn($alias . '.EVENT_ID');
            $criteria->addSelectColumn($alias . '.EVENT_NAME');
            $criteria->addSelectColumn($alias . '.EVENT_DESCRIPTION');
            $criteria->addSelectColumn($alias . '.EVENT_STATUS');
            $criteria->addSelectColumn($alias . '.EVENT_RESPONSIBLE_REPRESENTATIVE_NAME');
            $criteria->addSelectColumn($alias . '.EVENT_RESPONSIBLE_REPRESENTATIVE_EMAIL_ADDRESS');
            $criteria->addSelectColumn($alias . '.EVENT_START_TIME');
            $criteria->addSelectColumn($alias . '.EVENT_END_TIME');
            $criteria->addSelectColumn($alias . '.EVENT_LOCATION');
            $criteria->addSelectColumn($alias . '.EVENT_COST');
            $criteria->addSelectColumn($alias . '.EVENT_START_TIME_FILTER');
            $criteria->addSelectColumn($alias . '.EVENT_END_TIME_FILTER');
        }
    }

    /**
     * Returns the number of rows matching criteria.
     *
     * @param      Criteria $criteria
     * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
     * @param      PropelPDO $con
     * @return int Number of matching rows.
     */
    public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null)
    {
        // we may modify criteria, so copy it first
        $criteria = clone $criteria;

        // We need to set the primary table name, since in the case that there are no WHERE columns
        // it will be impossible for the BasePeer::createSelectSql() method to determine which
        // tables go into the FROM clause.
        $criteria->setPrimaryTableName(EVRRSSFeedViewPeer::TABLE_NAME);

        if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
            $criteria->setDistinct();
        }

        if (!$criteria->hasSelectClause()) {
            EVRRSSFeedViewPeer::addSelectColumns($criteria);
        }

        $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
        $criteria->setDbName(EVRRSSFeedViewPeer::DATABASE_NAME); // Set the correct dbName

        if ($con === null) {
            $con = Propel::getConnection(EVRRSSFeedViewPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        // BasePeer returns a PDOStatement
        $stmt = BasePeer::doCount($criteria, $con);

        if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
            $count = (int) $row[0];
        } else {
            $count = 0; // no rows returned; we infer that means 0 matches.
        }
        $stmt->closeCursor();

        return $count;
    }
    /**
     * Selects one object from the DB.
     *
     * @param      Criteria $criteria object used to create the SELECT statement.
     * @param      PropelPDO $con
     * @return                 EVRRSSFeedView
     * @throws PropelException Any exceptions caught during processing will be
     *		 rethrown wrapped into a PropelException.
     */
    public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
    {
        $critcopy = clone $criteria;
        $critcopy->setLimit(1);
        $objects = EVRRSSFeedViewPeer::doSelect($critcopy, $con);
        if ($objects) {
            return $objects[0];
        }

        return null;
    }
    /**
     * Selects several row from the DB.
     *
     * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
     * @param      PropelPDO $con
     * @return array           Array of selected Objects
     * @throws PropelException Any exceptions caught during processing will be
     *		 rethrown wrapped into a PropelException.
     */
    public static function doSelect(Criteria $criteria, PropelPDO $con = null)
    {
        return EVRRSSFeedViewPeer::populateObjects(EVRRSSFeedViewPeer::doSelectStmt($criteria, $con));
    }
    /**
     * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
     *
     * Use this method directly if you want to work with an executed statement durirectly (for example
     * to perform your own object hydration).
     *
     * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
     * @param      PropelPDO $con The connection to use
     * @throws PropelException Any exceptions caught during processing will be
     *		 rethrown wrapped into a PropelException.
     * @return PDOStatement The executed PDOStatement object.
     * @see        BasePeer::doSelect()
     */
    public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection(EVRRSSFeedViewPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }

        if (!$criteria->hasSelectClause()) {
            $criteria = clone $criteria;
            EVRRSSFeedViewPeer::addSelectColumns($criteria);
        }

        // Set the correct dbName
        $criteria->setDbName(EVRRSSFeedViewPeer::DATABASE_NAME);

        // BasePeer returns a PDOStatement
        return BasePeer::doSelect($criteria, $con);
    }
    /**
     * Adds an object to the instance pool.
     *
     * Propel keeps cached copies of objects in an instance pool when they are retrieved
     * from the database.  In some cases -- especially when you override doSelect*()
     * methods in your stub classes -- you may need to explicitly add objects
     * to the cache in order to ensure that the same objects are always returned by doSelect*()
     * and retrieveByPK*() calls.
     *
     * @param      EVRRSSFeedView $obj A EVRRSSFeedView object.
     * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
     */
    public static function addInstanceToPool($obj, $key = null)
    {
        if (Propel::isInstancePoolingEnabled()) {
            if ($key === null) {
                $key = (string) $obj->getEventId();
            } // if key === null
            EVRRSSFeedViewPeer::$instances[$key] = $obj;
        }
    }

    /**
     * Removes an object from the instance pool.
     *
     * Propel keeps cached copies of objects in an instance pool when they are retrieved
     * from the database.  In some cases -- especially when you override doDelete
     * methods in your stub classes -- you may need to explicitly remove objects
     * from the cache in order to prevent returning objects that no longer exist.
     *
     * @param      mixed $value A EVRRSSFeedView object or a primary key value.
     *
     * @return void
     * @throws PropelException - if the value is invalid.
     */
    public static function removeInstanceFromPool($value)
    {
        if (Propel::isInstancePoolingEnabled() && $value !== null) {
            if (is_object($value) && $value instanceof EVRRSSFeedView) {
                $key = (string) $value->getEventId();
            } elseif (is_scalar($value)) {
                // assume we've been passed a primary key
                $key = (string) $value;
            } else {
                $e = new PropelException("Invalid value passed to removeInstanceFromPool().  Expected primary key or EVRRSSFeedView object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true)));
                throw $e;
            }

            unset(EVRRSSFeedViewPeer::$instances[$key]);
        }
    } // removeInstanceFromPool()

    /**
     * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
     *
     * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
     * a multi-column primary key, a serialize()d version of the primary key will be returned.
     *
     * @param      string $key The key (@see getPrimaryKeyHash()) for this instance.
     * @return   EVRRSSFeedView Found object or null if 1) no instance exists for specified key or 2) instance pooling has been disabled.
     * @see        getPrimaryKeyHash()
     */
    public static function getInstanceFromPool($key)
    {
        if (Propel::isInstancePoolingEnabled()) {
            if (isset(EVRRSSFeedViewPeer::$instances[$key])) {
                return EVRRSSFeedViewPeer::$instances[$key];
            }
        }

        return null; // just to be explicit
    }

    /**
     * Clear the instance pool.
     *
     * @return void
     */
    public static function clearInstancePool()
    {
        EVRRSSFeedViewPeer::$instances = array();
    }

    /**
     * Method to invalidate the instance pool of all tables related to evr_rss_feed_view
     * by a foreign key with ON DELETE CASCADE
     */
    public static function clearRelatedInstancePool()
    {
    }

    /**
     * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
     *
     * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
     * a multi-column primary key, a serialize()d version of the primary key will be returned.
     *
     * @param      array $row PropelPDO resultset row.
     * @param      int $startcol The 0-based offset for reading from the resultset row.
     * @return string A string version of PK or null if the components of primary key in result array are all null.
     */
    public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
    {
        // If the PK cannot be derived from the row, return null.
        if ($row[$startcol] === null) {
            return null;
        }

        return (string) $row[$startcol];
    }

    /**
     * Retrieves the primary key from the DB resultset row
     * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
     * a multi-column primary key, an array of the primary key columns will be returned.
     *
     * @param      array $row PropelPDO resultset row.
     * @param      int $startcol The 0-based offset for reading from the resultset row.
     * @return mixed The primary key of the row
     */
    public static function getPrimaryKeyFromRow($row, $startcol = 0)
    {

        return (int) $row[$startcol];
    }

    /**
     * The returned array will contain objects of the default type or
     * objects that inherit from the default.
     *
     * @throws PropelException Any exceptions caught during processing will be
     *		 rethrown wrapped into a PropelException.
     */
    public static function populateObjects(PDOStatement $stmt)
    {
        $results = array();

        // set the class once to avoid overhead in the loop
        $cls = EVRRSSFeedViewPeer::getOMClass();
        // populate the object(s)
        while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
            $key = EVRRSSFeedViewPeer::getPrimaryKeyHashFromRow($row, 0);
            if (null !== ($obj = EVRRSSFeedViewPeer::getInstanceFromPool($key))) {
                // We no longer rehydrate the object, since this can cause data loss.
                // See http://www.propelorm.org/ticket/509
                // $obj->hydrate($row, 0, true); // rehydrate
                $results[] = $obj;
            } else {
                $obj = new $cls();
                $obj->hydrate($row);
                $results[] = $obj;
                EVRRSSFeedViewPeer::addInstanceToPool($obj, $key);
            } // if key exists
        }
        $stmt->closeCursor();

        return $results;
    }
    /**
     * Populates an object of the default type or an object that inherit from the default.
     *
     * @param      array $row PropelPDO resultset row.
     * @param      int $startcol The 0-based offset for reading from the resultset row.
     * @throws PropelException Any exceptions caught during processing will be
     *		 rethrown wrapped into a PropelException.
     * @return array (EVRRSSFeedView object, last column rank)
     */
    public static function populateObject($row, $startcol = 0)
    {
        $key = EVRRSSFeedViewPeer::getPrimaryKeyHashFromRow($row, $startcol);
        if (null !== ($obj = EVRRSSFeedViewPeer::getInstanceFromPool($key))) {
            // We no longer rehydrate the object, since this can cause data loss.
            // See http://www.propelorm.org/ticket/509
            // $obj->hydrate($row, $startcol, true); // rehydrate
            $col = $startcol + EVRRSSFeedViewPeer::NUM_HYDRATE_COLUMNS;
        } else {
            $cls = EVRRSSFeedViewPeer::OM_CLASS;
            $obj = new $cls();
            $col = $obj->hydrate($row, $startcol);
            EVRRSSFeedViewPeer::addInstanceToPool($obj, $key);
        }

        return array($obj, $col);
    }

    /**
     * Returns the TableMap related to this peer.
     * This method is not needed for general use but a specific application could have a need.
     * @return TableMap
     * @throws PropelException Any exceptions caught during processing will be
     *		 rethrown wrapped into a PropelException.
     */
    public static function getTableMap()
    {
        return Propel::getDatabaseMap(EVRRSSFeedViewPeer::DATABASE_NAME)->getTable(EVRRSSFeedViewPeer::TABLE_NAME);
    }

    /**
     * Add a TableMap instance to the database for this peer class.
     */
    public static function buildTableMap()
    {
      $dbMap = Propel::getDatabaseMap(BaseEVRRSSFeedViewPeer::DATABASE_NAME);
      if (!$dbMap->hasTable(BaseEVRRSSFeedViewPeer::TABLE_NAME)) {
        $dbMap->addTableObject(new EVRRSSFeedViewTableMap());
      }
    }

    /**
     * The class that the Peer will make instances of.
     *
     *
     * @return string ClassName
     */
    public static function getOMClass()
    {
        return EVRRSSFeedViewPeer::OM_CLASS;
    }

    /**
     * Retrieve a single object by pkey.
     *
     * @param      int $pk the primary key.
     * @param      PropelPDO $con the connection to use
     * @return EVRRSSFeedView
     */
    public static function retrieveByPK($pk, PropelPDO $con = null)
    {

        if (null !== ($obj = EVRRSSFeedViewPeer::getInstanceFromPool((string) $pk))) {
            return $obj;
        }

        if ($con === null) {
            $con = Propel::getConnection(EVRRSSFeedViewPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }

        $criteria = new Criteria(EVRRSSFeedViewPeer::DATABASE_NAME);
        $criteria->add(EVRRSSFeedViewPeer::EVENT_ID, $pk);

        $v = EVRRSSFeedViewPeer::doSelect($criteria, $con);

        return !empty($v) > 0 ? $v[0] : null;
    }

    /**
     * Retrieve multiple objects by pkey.
     *
     * @param      array $pks List of primary keys
     * @param      PropelPDO $con the connection to use
     * @return EVRRSSFeedView[]
     * @throws PropelException Any exceptions caught during processing will be
     *		 rethrown wrapped into a PropelException.
     */
    public static function retrieveByPKs($pks, PropelPDO $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection(EVRRSSFeedViewPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }

        $objs = null;
        if (empty($pks)) {
            $objs = array();
        } else {
            $criteria = new Criteria(EVRRSSFeedViewPeer::DATABASE_NAME);
            $criteria->add(EVRRSSFeedViewPeer::EVENT_ID, $pks, Criteria::IN);
            $objs = EVRRSSFeedViewPeer::doSelect($criteria, $con);
        }

        return $objs;
    }

} // BaseEVRRSSFeedViewPeer

// This is the static code needed to register the TableMap for this table with the main Propel class.
//
BaseEVRRSSFeedViewPeer::buildTableMap();


text:
package utils

import ()

type FailReason struct {
	Success bool
	Message string
}

func NewFailReason(success bool, msg string) FailReason {
	return FailReason{Success: success, Message: msg}
}


text:
package br.com.zynger.creditcardedittext.flag;

import br.com.zynger.creditcardedittext.R;

public class MasterCard extends CardFlag {

	@Override
	public String getRegex() {
		return "^5[1-5][0-9]{5,}$";
	}

	@Override
	public int getCardImageResource() {
		return R.drawable.cc_mc;
	}

}


text:
"""
Retrieve and extract data from HTML documents.

    >>> import extraction
    >>> import requests
    >>> extr = Extractor()
    >>> html = requests.get("http://lethain.com/").text
    >>> resp = extr.extract(html)
    >>> print resp
"""
import urlparse
import importlib

class Extracted(object):
    "Contains data extracted from a page."

    def __init__(self, titles=None, descriptions=None, images=None, urls=None, feeds=None, **kwargs):
        """
        Initialize Extracted instance.

        Extracted always internally stores titles, descriptions, images and
        canonical urls as lists, which can be accessed as properties::

            >>> print x.titles, x.urls, x.images

        The lists should be helpful For situations where you have a editor
        or user who is picking through possible options. For situations where
        you're without a curation mechanism, you can always get the best option
        using associated non-plural properties::

            >>> print x.title, x.url, x.image

        `urls` is a list of strings representing the best-guess canonical
        url for this piece of content as extracted from the HTML document.
        Sometimes there is no canonical URL referenced in the HTML, and in
        that case the using code will need to default to the url it fetched
        the HTML from (which the Extractor  doesn't know about, as it is
        agnostic to the source of information)::

            >>> import requests
            >>> from extraction import Extractor
            >>> url = "http://lethain.com/"
            >>> html = requests.get("url).text
            >>> extracted = Extractor().extract(html)
            >>> canonical_url = extracted.url if extract.url else url

        Titles, descriptions and images should all be lists.
        The lists should be ordered best to worst.
        """
        if titles is None:
            titles = []
        if descriptions is None:
            descriptions = []
        if images is None:
            images = []
        if urls is None:
            urls = []
        if feeds is None:
           feeds = []

        assert type(titles) in (list, tuple), "titles must be a list or tuple"
        assert type(descriptions) in (list, tuple), "descriptions must be a list or tuple"
        assert type(images) in (list, tuple), "images must be a list or tuple"
        assert type(urls) in (list, tuple), "urls must be a list or tuple"
        assert type(feeds) in (list, tuple), "urls must be a list or tuple"

        self.titles = titles
        self.descriptions = descriptions
        self.images = images
        self.urls = urls
        self.feeds = feeds

        # stores unexpected and uncaptured values to avoid crashing if
        # a technique returns additional types of data
        self._unexpected_values = kwargs

    def __repr__(self):
        "String representation of extracted results."
        details = (("title", self.titles),
                   ("url", self.urls),
                   ("image", self.images),
                   ("feed", self.feeds),
                   ("description", self.descriptions),
                   )

        details_strs = []
        max_shown = 50
        for name, values, in details:
            if values:
                value = values[0]
                count = len(values)
                if count -1 > 0:
                    details_strs.append("(%s: '%s', %s more)" % (name, value[:max_shown], count-1))
                else:
                    details_strs.append("(%s: '%s')" % (name, value[:max_shown]))

        return "<%s: %s>" % (self.__class__.__name__, ", ".join(details_strs))

    @property
    def title(self):
        "Return the best title, if any."
        if self.titles:
            return self.titles[0]
        else:
            return None

    @property
    def image(self):
        "Return the best image, if any."
        if self.images:
            return self.images[0]
        else:
            return None

    @property
    def description(self):
        "Return the best description, if any."
        if self.descriptions:
            return self.descriptions[0]
        else:
            return None

    @property
    def url(self):
        "Return the best url, if any."
        if self.urls:
            return self.urls[0]
        else:
            return None

    @property
    def feed(self):
        "Return the best feed, if any."
        if self.feeds:
            return self.feeds[0]
        else:
            return None

class Extractor(object):
    "Extracts title, summary and image(s) from an HTML document."
    techniques = ["extraction.techniques.FacebookOpengraphTags",
                  "extraction.techniques.HTML5SemanticTags",
                  "extraction.techniques.HeadTags",
                  "extraction.techniques.SemanticTags",
                  ]
    extracted_class = Extracted

    # for determining which cleanup mechanisms to apply
    text_types = ["titles", "descriptions"]
    url_types = ["images", "urls", "feeds"]

    def __init__(self, techniques=None, extracted_class=None, *args, **kwargs):
        "Extractor."
        if techniques:
            self.techniques = techniques
        if extracted_class:
            self.extracted_class = extracted_class

        super(Extractor, self).__init__(*args, **kwargs)

    def run_technique(self, technique, html):
        """
        Run a given technique against the HTML.

        Technique is a string including the full module path
        and class name for the technique, for example::

            extraction.techniques.FacebookOpengraphTags

        HTML is a string representing an HTML document.
        """
        technique_path_parts = technique.split('.')
        assert len(technique_path_parts) > 1, "technique_path_parts must include a module and a class"
        technique_module_path = ".".join(technique_path_parts[:-1])
        technique_class_name = technique_path_parts[-1]
        technique_module = importlib.import_module(technique_module_path)
        technique_inst = getattr(technique_module, technique_class_name)(extractor=self)
        return technique_inst.extract(html)

    def cleanup_text(self, value):
        "Cleanup text values like titles or descriptions."
        return " ".join(value.split())

    def cleanup_url(self, value_url, source_url=None):
        """
        Transform relative URLs into absolute URLs if possible.

        If the value_url is already absolute, or we don't know the
        source_url, then return the existing value. If the value_url is
        relative, and we know the source_url, then try to rewrite it.
        """
        value = urlparse.urlparse(value_url)
        if value.netloc or not source_url:
            return value_url
        else:
            return urlparse.urljoin(source_url, value_url)

    def cleanup(self, results, html, source_url=None):
        """
        Allows standardizing extracted contents, at this time:

        1. removes multiple whitespaces
        2. rewrite relative URLs as absolute URLs if source_url is specified
        3. filter out duplicate values
        """
        cleaned_results = {}
        for data_type, data_values in results.items():
            if data_type in self.text_types:
                data_values = [self.cleanup_text(x) for x in filter(None, data_values)]
            if data_type in self.url_types:
                data_values = [self.cleanup_url(x, source_url=source_url) for x in data_values]

            # filter out duplicate values
            unique_values = []
            for data_value in data_values:
                if data_value not in unique_values:
                    unique_values.append(data_value)

            cleaned_results[data_type] = unique_values

        return cleaned_results

    def extract(self, html, source_url=None):
        """
        Extract contents from a string representing an HTML document.

            >>> from extraction import Extractor
            >>> import requests
            >>> html = requests.get("http://lethain.com/").text
            >>> extracted = Extractor().extract(html)
            >>> print extracted

        `source_url` is optional, but allows for a certain level of
        cleanup to be performed, such as converting relative URLs
        into absolute URLs and such.
        """
        extracted = {}
        for technique in self.techniques:
            technique_extracted = self.run_technique(technique, html)
            for data_type, data_values in technique_extracted.items():
                if data_values:
                    if data_type not in extracted:
                        extracted[data_type] = []
                    extracted[data_type] += data_values

        return self.extracted_class(**self.cleanup(extracted, html, source_url=source_url))


text:
#ifndef _LOVEBIRD_SCOPE
#define _LOVEBIRD_SCOPE

#include <memory>

#include "exception.hpp"
#include "string.hpp"

namespace lovebird
{

class Decl; // decl.hpp
class Type; // type.hpp

struct Scope_exception : public Exception
{
    Scope_exception(const char * s) : Exception(s) {}
    const char * name() const noexcept final { return u8"scope exception"; }
};

/*---------------------------------- scope -----------------------------------*/

/* Scope is represented with a parent-pointer tree embedded within the AST. */
class Scope
{
public:
    using Ptr = std::unique_ptr<Scope>;

    Scope();
    Scope(Scope * up);

private:
    String_dict<Decl *> id_dict;
    Scope * up;
};

} // namespace lovebird

#endif // ifndef _LOVEBIRD_SCOPE


text:
package com.atlassian.jira.plugins.dvcs.analytics.event;

public enum FailureReason
{
    OAUTH_GENERIC("oauth.generic"),
    OAUTH_SOURCECONTROL("oauth.sourcecontrol"),
    OAUTH_RESPONSE("oauth.response"),
    OAUTH_TOKEN("oauth.token"),
    OAUTH_UNAUTH("oauth.unauth"),
    VALIDATION("validation");

    private String failureReason;

    FailureReason(String failureReason)
    {
        this.failureReason = failureReason;
    }

    @Override
    public String toString()
    {
        return this.failureReason;
    }

}


text:
from __future__ import absolute_import
from blazeform.form import Form

class TestForm(Form):
    """ required note at form-top position, but header not in first position """
    def __init__(self):
        Form.__init__(self, 'reqnoteform')
        self.add_header('header', 'Header')
        self.add_text('text', 'Text')
        self.add_header('header2', 'Header2')
        self.add_text('text2', 'Text2')

render_opts = {
    'req_note': '
required field
',
    'req_note_level': 'form'
}