text:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.test.util.browser.tabmodel.document;

import android.app.Activity;

import org.chromium.chrome.browser.Tab;
import org.chromium.chrome.browser.document.PendingDocumentData;
import org.chromium.chrome.browser.tabmodel.document.ActivityDelegate;
import org.chromium.chrome.browser.tabmodel.document.DocumentTabModel.Entry;
import org.chromium.chrome.browser.tabmodel.document.TabDelegate;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.WebContents;

/**
 * Mocks out calls to get Tabs for the DocumentTabModel.
 */
public class MockTabDelegate implements TabDelegate {
    @Override
    public Tab getActivityTab(boolean incognito, ActivityDelegate delgate, Activity activity) {
        return null;
    }

    @Override
    public void createTabInForeground(Activity parentActivity, boolean incognito,
            LoadUrlParams loadUrlParams, PendingDocumentData documentParams) {
    }

    @Override
    public Tab createFrozenTab(Entry entry) {
        return null;
    }

    @Override
    public void createTabWithWebContents(boolean isIncognito, WebContents webContents,
            int parentTabId) {
    }

    @Override
    public void createTabForDevTools(String url) {
    }

    @Override
    public boolean isTabCoveredByChildActivity(Tab tab) {
        return false;
    }
}

redpajama_set_name: RedPajamaGithub


text:
. "${PSScriptRoot}\logging.ps1"

$DevOpsAPIBaseURI = "https://dev.azure.com/{0}/{1}/_apis/{2}/{3}?{4}api-version=6.0"

function Get-DevOpsApiHeaders ($Base64EncodedToken) {
  $headers = @{
    Authorization = "Basic $Base64EncodedToken"
  }
  return $headers
}

function Start-DevOpsBuild {
  param (
    $Organization="azure-sdk",
    $Project="internal",
    $SourceBranch,
    [Parameter(Mandatory = $true)]
    $DefinitionId,
    [ValidateNotNullOrEmpty()]
    [Parameter(Mandatory = $true)]
    $Base64EncodedAuthToken,
    [Parameter(Mandatory = $false)]
    [string]$BuildParametersJson
  )

  $uri = "$DevOpsAPIBaseURI" -F $Organization, $Project , "build" , "builds", ""

  $parameters = @{
    sourceBranch = $SourceBranch
    definition = @{ id = $DefinitionId }
    parameters = $BuildParametersJson
  }

  return Invoke-RestMethod `
          -Method POST `
          -Body ($parameters | ConvertTo-Json) `
          -Uri $uri `
          -Headers (Get-DevOpsApiHeaders -Base64EncodedToken $Base64EncodedAuthToken) `
          -MaximumRetryCount 3 `
          -ContentType "application/json"
}

function Update-DevOpsBuild {
  param (
    $Organization="azure-sdk",
    $Project="internal",
    [ValidateNotNullOrEmpty()]
    [Parameter(Mandatory = $true)]
    $BuildId,
    $Status, # pass canceling to cancel build
    [ValidateNotNullOrEmpty()]
    [Parameter(Mandatory = $true)]
    $Base64EncodedAuthToken
  )

  $uri = "$DevOpsAPIBaseURI" -F $Organization, $Project, "build", "builds/$BuildId", ""
  $parameters = @{}

  if ($Status) { $parameters["status"] = $Status}

  return Invoke-RestMethod `
          -Method PATCH `
          -Body ($parameters | ConvertTo-Json) `
          -Uri $uri `
          -Headers (Get-DevOpsApiHeaders -Base64EncodedToken $Base64EncodedAuthToken) `
          -MaximumRetryCount 3 `
          -ContentType "application/json"
}

function Get-DevOpsBuilds {
  param (
    $Organization="azure-sdk",
    $Project="internal",
    $BranchName, #Should start with 'refs/heads/'
    $Definitions, # Comma seperated string of definition IDs
    $StatusFilter, # Comma seperated string 'cancelling, completed, inProgress, notStarted'
    [ValidateNotNullOrEmpty()]
    [Parameter(Mandatory = $true)]
    $Base64EncodedAuthToken
  )

  $query = ""

  if ($BranchName) { $query += "branchName=$BranchName&" }
  if ($Definitions) { $query += "definitions=$Definitions&" }
  if ($StatusFilter) { $query += "statusFilter=$StatusFilter&" }
  $uri = "$DevOpsAPIBaseURI" -F $Organization, $Project , "build" , "builds", $query

  return Invoke-RestMethod `
          -Method GET `
          -Uri $uri `
          -Headers (Get-DevOpsApiHeaders -Base64EncodedToken $Base64EncodedAuthToken) `
          -MaximumRetryCount 3
}

function Delete-RetentionLease {
  param (
    $Organization,
    $Project,
    $LeaseId,
    $Base64EncodedAuthToken
  )

  $uri = "https://dev.azure.com/$Organization/$Project/_apis/build/retention/leases?ids=$LeaseId&api-version=6.0-preview.1"

  return Invoke-RestMethod `
    -Method DELETE `
    -Uri $uri `
    -Headers (Get-DevOpsApiHeaders -Base64EncodedToken $Base64EncodedAuthToken) `
    -MaximumRetryCount 3
}

function Get-RetentionLeases {
  param (
    $Organization,
    $Project,
    $DefinitionId,
    $RunId,
    $OwnerId,
    $Base64EncodedAuthToken
  )

  $uri = "https://dev.azure.com/$Organization/$Project/_apis/build/retention/leases?ownerId=$OwnerId&definitionId=$DefinitionId&runId=$RunId&api-version=6.0-preview.1"

  return Invoke-RestMethod `
    -Method GET `
    -Uri $uri `
    -Headers (Get-DevOpsApiHeaders -Base64EncodedToken $Base64EncodedAuthToken) `
    -MaximumRetryCount 3
}

function Add-RetentionLease {
  param (
    $Organization,
    $Project,
    $DefinitionId,
    $RunId,
    $OwnerId,
    $DaysValid,
    $Base64EncodedAuthToken
  )

  $parameter = @{}
  $parameter["definitionId"] = $DefinitionId
  $parameter["runId"] = $RunId
  $parameter["ownerId"] = $OwnerId
  $parameter["daysValid"] = $DaysValid

  $body = $parameter | ConvertTo-Json

  $uri = "https://dev.azure.com/$Organization/$Project/_apis/build/retention/leases?api-version=6.0-preview.1"

  return Invoke-RestMethod `
          -Method POST `
          -Body "[$body]" `
          -Uri $uri `
          -Headers (Get-DevOpsApiHeaders -Base64EncodedToken $Base64EncodedAuthToken) `
          -MaximumRetryCount 3 `
          -ContentType "application/json"

}


text:
import parse from './parse.js'

const addDurations = function (View) {
  /** phrases like '2 months', or '2mins' */
  class Durations extends View {
    constructor(document, pointer, groups) {
      super(document, pointer, groups)
      this.context = {}
    }
    /** overload the original json with duration information */
    json(opts = {}) {
      return this.map(m => {
        let json = m.toView().json(opts)[0] || {}
        if (opts && opts.times !== true) {
          json.duration = parse(m)
        }
        return json
      }, [])
    }
    /** easy getter for the time */
    get(options) {
      let arr = []
      this.forEach((doc) => {
        let res = parse(doc)
        arr.push(res)
      })
      if (typeof options === 'number') {
        return arr[options]
      }
      return arr
    }
  }

  /** phrases like '2 months' */
  View.prototype.durations = function (n) {
    let m = this.match('#Value+ #Duration (and? #Value+ #Duration)?')
    // add '20mins'
    m = m.concat(this.match('(#Duration && /[0-9][a-z]+$/)'))

    // not 'in 20 minutes'
    m = m.notIf('#DateShift')

    if (typeof n === 'number') {
      m = m.eq(n)
    }
    return new Durations(this.document, m.pointer)
  }
}
export default addDurations


text:
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { translate } from 'react-i18next'
import style from './style.styl'

const View = ({children}) => (

 node && node.addEventListener('scroll', e => console.log('scroll outter', e))}>

 node && node.addEventListener('scroll', e => console.log('scroll inner', e))}>
      {children}

)

View.propTypes = {
  navbar: PropTypes.object
}

export {View as default}


text:
import sys
import os

sys.path.insert(0, os.path.abspath('..'))

import sphinx_bootstrap_theme
import lighthouse

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

# -- General configuration ------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.doctest',
    'sphinx.ext.coverage',
    'sphinx.ext.viewcode',
    'sphinx.ext.extlinks',
]
if not on_rtd:
    extensions.append("sphinxcontrib.spelling")

templates_path = ['templates']

source_suffix = '.rst'

master_doc = 'index'

project = u'lighthouse'
copyright = u'2014-2016, William Glass'
author = u'William Glass'

version = release = lighthouse.__version__

language = None

autodoc_member_order = "bysource"
autoclass_content = "both"
autodoc_docstring_signature = False

coverage_skip_undoc_in_source = True
coverage_ignore_modules = [
    "lighthouse.scripts.writer",
    "lighthouse.scripts.reporter",
]

spelling_word_list_filename = "spelling_wordlist.txt"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []

# The reST default role (used for this markup: `text`) to use for all
# documents.
default_role = "py:obj"

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False

# -- Options for HTML output ----------------------------------------------

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['static']

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
html_theme = 'bootstrap'

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
html_theme_options = {
    "navbar_links": [
        ("Getting Started", "getting_started"),
        ("Configuration", "configuration"),
        ("Examples", "examples"),
        ("Plugins", "writing_plugins"),
        ("Release Notes", "releases"),
        ("Source Docs", "source_docs"),
    ],
    "navbar_class": "navbar",
    "globaltoc_includehidden": False,
    "navbar_sidebarrel": False,
    "navbar_pagenav": True,
    "source_link_position": False,
    "bootswatch_theme": "paper",
    "bootstrap_version": "3"
}
# html_theme_options = {
#     "description": "Resilient, adaptable service discovery.",
#     "logo": "lighthouse.png",
#     "logo_name": True,
#     "github_user": "wglass",
#     "github_repo": "lighthouse",
#     "github_banner": True,
#     "github_button": False,
#     "analytics_id": "UA-63292568-1",
#     "link": "#3782be",
#     "link_hover": "#3782be",
#     "note_bg": "#cfe7f8",
#     "pre_bg": "#eef7ff",
#     # "gray_1": "#fff",
#     "gray_2": "#fff",
#     # "gray_3": "#fff",
# }

# The name for this set of Sphinx documents.  If None, it defaults to
# "<project> v<release> documentation".
#html_title = None

# A shorter title for the navigation bar.  Default is the same as html_title.
#html_short_title = None

# The name of an image file (within the static path) to use as favicon of the
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
# html_sidebars = {
#     '**': [
#         'about.html', 'navigation.html', 'searchbox.html', 'donate.html',
#     ]
# }

extlinks = {
    "current_tarball": (
        "https://pypi.python.org/packages/source/l/lighthouse/lighthouse-%s.tar.g%%s" % version,
        "lighthouse-%s.tar.g" % version
    )
}

# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}

# If false, no module index is generated.
#html_domain_indices = True

# If false, no index is generated.
#html_use_index = True

# If true, the index is split into individual pages for each letter.
#html_split_index = False

html_show_sourcelink = False

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it.  The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None

# Language to be used for generating the HTML full-text search index.
# Sphinx supports the following languages:
#   'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
#   'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
#html_search_language = 'en'

# A dictionary with options for the search language support, empty by default.
# Now only 'ja' uses this config value
#html_search_options = {'type': 'default'}

# The name of a javascript file (relative to the configuration directory) that
# implements a search results scorer. If empty, the default will be used.
#html_search_scorer = 'scorer.js'

# Output file base name for HTML help builder.
htmlhelp_basename = 'lighthousedoc'

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#'preamble': '',

# Latex figure (float) alignment
#'figure_align': 'htbp',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_documents = [
  (master_doc, 'lighthouse.tex', u'lighthouse Documentation',
   u'William Glass', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False

# If true, show page references after internal links.
#latex_show_pagerefs = False

# If true, show URL addresses after external links.
#latex_show_urls = False

# Documents to append as an appendix to all manuals.
#latex_appendices = []

# If false, no module index is generated.
#latex_domain_indices = True

# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
    (master_doc, 'lighthouse', u'lighthouse Documentation',
     [author], 1)
]

# If true, show URL addresses after external links.
#man_show_urls = False

# -- Options for Texinfo output -------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
#  dir menu entry, description, category)
texinfo_documents = [
  (master_doc, 'lighthouse', u'lighthouse Documentation',
   author, 'lighthouse', 'One line description of project.',
   'Miscellaneous'),
]

# Documents to append as an appendix to all manuals.
#texinfo_appendices = []

# If false, no module index is generated.
#texinfo_domain_indices = True

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'

# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False


text:
{{monthNames[selectedMonth].name}} {{selectedYear}}

			<form class="cal-nav">

						<select ng-model="selectedMonth" name="month" id="month" ng-options="monthName.id as monthName.name for monthName in monthNames" ng-change="refresh()"></select>

						<select ng-model="selectedYear" name="year" id="year" ng-options="year as year for year in yearArray" ng-change="refresh()"></select>

					<button ng-click="setToday()">Today</button>

			</form>

Sunday

Monday

Tuesday

Wednesday

Thursday

Friday

Saturday

{{day.day}}


text:
namespace FlatRedBall.Glue.CodeGeneration.CodeBuilder
{
    public class CodeBlockIf : CodeBlockBase
    {
        public CodeBlockIf(ICodeBlock pParent, string pCondition) : base(pParent)
        {
            PreCodeLines.Add(new CodeLine("if (" + (string.IsNullOrEmpty(pCondition) ? "" : pCondition) + ")"));
            PreCodeLines.Add(new CodeLine("{"));
            PostCodeLines.Add(new CodeLine("}"));
        }
    }

    public class CodeBlockElseIf : CodeBlockBase
    {
        public CodeBlockElseIf(ICodeBlock pParent, string pCondition) : base(pParent)
        {
            PreCodeLines.Add(new CodeLine("else if (" + (string.IsNullOrEmpty(pCondition) ? "" : pCondition) + ")"));
            PreCodeLines.Add(new CodeLine("{"));
            PostCodeLines.Add(new CodeLine("}"));
        }
    }

    public class CodeBlockElse : CodeBlockBase
    {
        public CodeBlockElse(ICodeBlock pParent) : base(pParent)
        {
            PreCodeLines.Add(new CodeLine("else"));
            PreCodeLines.Add(new CodeLine("{"));
            PostCodeLines.Add(new CodeLine("}"));
        }
    }

    public static class CodeBlockIfExtensions
    {
        public static ICodeBlock If(this ICodeBlock pCodeBlock, string pCondition)
        {
            return new CodeBlockIf(pCodeBlock, pCondition);
        }

        public static ICodeBlock ElseIf(this ICodeBlock pCodeBlock, string pCondition)
        {
            return new CodeBlockElseIf(pCodeBlock, pCondition);
        }

        public static ICodeBlock Else(this ICodeBlock pCodeBlock)
        {
            return new CodeBlockElse(pCodeBlock);
        }
    }
}


text:
package pl.themolka.arcade.mob;

import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.event.entity.CreatureSpawnEvent;
import pl.themolka.arcade.config.Ref;
import pl.themolka.arcade.event.Cancelable;
import pl.themolka.arcade.filter.Filter;
import pl.themolka.arcade.filter.Filters;
import pl.themolka.arcade.game.Game;
import pl.themolka.arcade.game.IGameConfig;

public class MobSpawnRule implements Cancelable {
    private final boolean cancel;
    private final Filter filter;

    protected MobSpawnRule(Game game, IGameConfig.Library library, Config config) {
        this.filter = Filters.secure(library.getOrDefine(game, config.filter().getIfPresent()));
        this.cancel = config.cancel().get();
    }

    @Override
    public boolean isCanceled() {
        return this.cancel;
    }

    @Override
    public void setCanceled(boolean cancel) {
        throw new UnsupportedOperationException("Cannot cancel mob spawn rule");
    }

    public Filter getFilter() {
        return this.filter;
    }

    public boolean matches(Entity entity, CreatureSpawnEvent.SpawnReason reason, Location location) {
        return this.filter.filter(entity, reason, location).isTrue();
    }

    public interface Config extends IGameConfig<MobSpawnRule> {
        default Ref<Filter.Config<?>> filter() { return Ref.empty(); }
        default Ref<Boolean> cancel() { return Ref.ofProvided(true); }

        @Override
        default MobSpawnRule create(Game game, Library library) {
            return new MobSpawnRule(game, library, this);
        }
    }
}


text:
jq --version > /dev/null 2>&1
if [ $? -ne 0 ]; then
	echo "Please Install 'jq' https://stedolan.github.io/jq/ to execute this script"
	echo
	exit 1
fi
starttime=$(date +%s)

echo "POST request Enroll on Org1  ..."
echo
ORG1_TOKEN=$(curl -s -X POST \
  http://localhost:4000/users \
  -H "cache-control: no-cache" \
  -H "content-type: application/x-www-form-urlencoded" \
  -d 'username=Jim&orgName=org1')
echo $ORG1_TOKEN
ORG1_TOKEN=$(echo $ORG1_TOKEN | jq ".token" | sed "s/\"//g")
echo
echo "ORG1 token is $ORG1_TOKEN"
echo
echo "POST request Enroll on Org2 ..."
echo
ORG2_TOKEN=$(curl -s -X POST \
  http://localhost:4000/users \
  -H "cache-control: no-cache" \
  -H "content-type: application/x-www-form-urlencoded" \
  -d 'username=Barry&orgName=org2')
echo $ORG2_TOKEN
ORG2_TOKEN=$(echo $ORG2_TOKEN | jq ".token" | sed "s/\"//g")
echo
echo "ORG2 token is $ORG2_TOKEN"
echo
echo
echo "POST request Create channel  ..."
echo
curl -s -X POST \
  http://localhost:4000/channels \
  -H "authorization: Bearer $ORG1_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG1_TOKEN" \
  -d '{
	"channelName":"mychannel",
	"channelConfigPath":"../artifacts/channel/mychannel.tx"
}'
echo
echo
sleep 5
echo "POST request Join channel on Org1"
echo
curl -s -X POST \
  http://localhost:4000/channels/mychannel/peers \
  -H "authorization: Bearer $ORG1_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG1_TOKEN" \
  -d '{
	"peers": ["localhost:7051","localhost:7056"]
}'
echo
echo

echo "POST request Join channel on Org2"
echo
curl -s -X POST \
  http://localhost:4000/channels/mychannel/peers \
  -H "authorization: Bearer $ORG2_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG2_TOKEN" \
  -d '{
	"peers": ["localhost:8051","localhost:8056"]
}'
echo
echo

echo "POST Install chaincode on Org1"
echo
curl -s -X POST \
  http://localhost:4000/chaincodes \
  -H "authorization: Bearer $ORG1_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG1_TOKEN" \
  -d '{
	"peers": ["localhost:7051","localhost:7056"],
	"chaincodeName":"mycc",
	"chaincodePath":"github.com/example_cc",
	"chaincodeVersion":"v0"
}'
echo
echo

echo "POST Install chaincode on Org2"
echo
curl -s -X POST \
  http://localhost:4000/chaincodes \
  -H "authorization: Bearer $ORG2_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG2_TOKEN" \
  -d '{
	"peers": ["localhost:8051","localhost:8056"],
	"chaincodeName":"mycc",
	"chaincodePath":"github.com/example_cc",
	"chaincodeVersion":"v0"
}'
echo
echo

echo "POST instantiate chaincode on peer1 of Org1"
echo
curl -s -X POST \
  http://localhost:4000/channels/mychannel/chaincodes \
  -H "authorization: Bearer $ORG1_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG1_TOKEN" \
  -d '{
	"peers": ["localhost:7051"],
	"chaincodeName":"mycc",
	"chaincodePath":"github.com/example_cc",
	"chaincodeVersion":"v0",
	"functionName":"init",
	"args":["a","100","b","200"]
}'
echo
echo

echo "POST invoke chaincode on peers of Org1"
echo
TRX_ID=$(curl -s -X POST \
  http://localhost:4000/channels/mychannel/chaincodes/mycc \
  -H "authorization: Bearer $ORG1_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG1_TOKEN" \
  -d '{
	"peers": ["localhost:7051", "localhost:7056"],
	"chaincodeVersion":"v0",
	"functionName":"invoke",
	"args":["move","a","b","10"]
}')
echo "Transacton ID is $TRX_ID"
echo
echo

echo "POST invoke chaincode on peers of Org2"
echo
TRX_ID=$(curl -s -X POST \
  http://localhost:4000/channels/mychannel/chaincodes/mycc \
  -H "authorization: Bearer $ORG2_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG2_TOKEN" \
  -d '{
	"peers": ["localhost:8051", "localhost:8056"],
	"chaincodeVersion":"v0",
	"functionName":"invoke",
	"args":["move","a","b","10"]
}')
echo "Transacton ID is $TRX_ID"
echo
echo

echo "GET query chaincode on peer1 of Org1"
echo
curl -s -X GET \
  "http://localhost:4000/channels/mychannel/chaincodes/mycc?peer=peer1&args=%5B%22query%22%2C%22a%22%5D&chaincodeVersion=v0" \
  -H "authorization: Bearer $ORG1_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG1_TOKEN"
echo
echo

echo "GET query Block by blockNumber"
echo
curl -s -X GET \
  "http://localhost:4000/channels/mychannel/blocks/1?peer=peer1" \
  -H "authorization: Bearer $ORG1_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG1_TOKEN"
echo
echo

echo "GET query Transaction by TransactionID"
echo
curl -s -X GET http://localhost:4000/channels/mychannel/transactions/$TRX_ID?peer=peer1 \
  -H "authorization: Bearer $ORG1_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG1_TOKEN"
echo
echo

############################################################################
### TODO: What to pass to fetch the Block information
############################################################################
#echo "GET query Block by Hash"
#echo
#hash=????
#curl -s -X GET \
#  "http://localhost:4000/channels/mychannel/blocks?hash=$hash&peer=peer1" \
#  -H "authorization: Bearer $ORG1_TOKEN" \
#  -H "cache-control: no-cache" \
#  -H "content-type: application/json" \
#  -H "x-access-token: $ORG1_TOKEN"
#echo
#echo

echo "GET query ChainInfo"
echo
curl -s -X GET \
  "http://localhost:4000/channels/mychannel?peer=peer1" \
  -H "authorization: Bearer $ORG1_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG1_TOKEN"
echo
echo

echo "GET query Installed chaincodes"
echo
curl -s -X GET \
  "http://localhost:4000/chaincodes?peer=peer1&type=installed" \
  -H "authorization: Bearer $ORG1_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG1_TOKEN"
echo
echo

echo "GET query Instantiated chaincodes"
echo
curl -s -X GET \
  "http://localhost:4000/chaincodes?peer=peer1&type=instantiated" \
  -H "authorization: Bearer $ORG1_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG1_TOKEN"
echo
echo

echo "GET query Channels"
echo
curl -s -X GET \
  "http://localhost:4000/channels?peer=peer1" \
  -H "authorization: Bearer $ORG1_TOKEN" \
  -H "cache-control: no-cache" \
  -H "content-type: application/json" \
  -H "x-access-token: $ORG1_TOKEN"
echo
echo

echo "Total execution time : $(($(date +%s)-starttime)) secs ..."


text:
#include "config.h"

#if ENABLE(ACCELERATED_2D_CANVAS)

#include "LoopBlinnClassifier.h"

#include "LoopBlinnMathUtils.h"

namespace WebCore {

using LoopBlinnMathUtils::approxEqual;
using LoopBlinnMathUtils::roundToZero;

LoopBlinnClassifier::Result LoopBlinnClassifier::classify(const FloatPoint& c0,
                                                          const FloatPoint& c1,
                                                          const FloatPoint& c2,
                                                          const FloatPoint& c3)
{
    // Consult the chapter for the definitions of the following
    // (terse) variable names. Note that the b0..b3 coordinates are
    // homogeneous, so the "z" value (actually the w coordinate) must
    // be 1.0.
    FloatPoint3D b0(c0.x(), c0.y(), 1.0f);
    FloatPoint3D b1(c1.x(), c1.y(), 1.0f);
    FloatPoint3D b2(c2.x(), c2.y(), 1.0f);
    FloatPoint3D b3(c3.x(), c3.y(), 1.0f);

    // Compute a1..a3.
    float a1 = b0 * b3.cross(b2);
    float a2 = b1 * b0.cross(b3);
    float a3 = b2 * b1.cross(b0);

    // Compute d1..d3.
    float d1 = a1 - 2 * a2 + 3 * a3;
    float d2 = -a2 + 3 * a3;
    float d3 = 3 * a3;

    // Experimentation has shown that the texture coordinates computed
    // from these values quickly become huge, leading to roundoff errors
    // and artifacts in the shader. It turns out that if we normalize
    // the vector defined by (d1, d2, d3), this fixes the problem of the
    // texture coordinates getting too large without affecting the
    // classification results.
    FloatPoint3D nd(d1, d2, d3);
    nd.normalize();
    d1 = nd.x();
    d2 = nd.y();
    d3 = nd.z();

    // Compute the discriminant.
    // term0 is a common term in the computation which helps decide
    // which way to classify the cusp case: as serpentine or loop.
    float term0 = (3 * d2 * d2 - 4 * d1 * d3);
    float discriminant = d1 * d1 * term0;

    // Experimentation has also shown that when the classification is
    // near the boundary between one curve type and another, the shader
    // becomes numerically unstable, particularly with the cusp case.
    // Correct for this by rounding d1..d3 and the discriminant to zero
    // when they get near it.
    d1 = roundToZero(d1);
    d2 = roundToZero(d2);
    d3 = roundToZero(d3);
    discriminant = roundToZero(discriminant);

    // Do the classification.
    if (approxEqual(b0, b1) && approxEqual(b0, b2) && approxEqual(b0, b3))
        return Result(kPoint, d1, d2, d3);

    if (!discriminant) {
        if (!d1 && !d2) {
            if (!d3)
                return Result(kLine, d1, d2, d3);
            return Result(kQuadratic, d1, d2, d3);
        }

        if (!d1)
            return Result(kCusp, d1, d2, d3);

        // This is the boundary case described in Loop and Blinn's
        // SIGGRAPH '05 paper of a cusp with inflection at infinity.
        // Because term0 might not be exactly 0, we decide between using
        // the serpentine and loop cases depending on its sign to avoid
        // taking the square root of a negative number when computing the
        // cubic texture coordinates.
        if (term0 < 0)
            return Result(kLoop, d1, d2, d3);

        return Result(kSerpentine, d1, d2, d3);
    }

    if (discriminant > 0)
        return Result(kSerpentine, d1, d2, d3);

    // discriminant < 0
    return Result(kLoop, d1, d2, d3);
}

} // namespace WebCore

#endif


text:
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#include <embree3/rtcore.h>
RTC_NAMESPACE_USE

#include <xmmintrin.h>
//#include <pmmintrin.h> // use this to get _MM_SET_DENORMALS_ZERO_MODE when compiling for SSE3 or higher

#if !defined(_MM_SET_DENORMALS_ZERO_MODE)
#define _MM_DENORMALS_ZERO_ON   (0x0040)
#define _MM_DENORMALS_ZERO_OFF  (0x0000)
#define _MM_DENORMALS_ZERO_MASK (0x0040)
#define _MM_SET_DENORMALS_ZERO_MODE(x) (_mm_setcsr((_mm_getcsr() & ~_MM_DENORMALS_ZERO_MASK) | (x)))
#endif

int main(int argc, char* argv[])
{
  /* for best performance set FTZ and DAZ flags in MXCSR control and status register */
  _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
  _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);

  /* create new Embree device */
  RTCDevice device = rtcNewDevice("verbose=1");

  /* delete device again */
  rtcReleaseDevice(device);

  return 0;
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Diplodia oleae Peglion, 1894

### Remarks
null


text:
package snedeker.cc.project4;

import java.io.IOException;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.TreeMap;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.TextInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;

public class KMerCounter {

	/**
	 * This is the Mapper component.  It reads the lines, composes the kmers, and outputs them to the context.
	 *
	 * @author Colby Snedeker
	 *
	 */
	public static class Map extends Mapper<LongWritable, Text, Text, IntWritable> {
	    //hadoop supported global variables
	    private final static IntWritable one = new IntWritable(1);
	    private static String previousLine;

		/**
		 * This is the map function.  In this function the lines are read.  Substrings are
		 * taken from each line for the length of the kmer specified in the configuration.
		 * These are then output to the context as a key, value pair consisting of the kmer
		 * as the key, and a hard coded one value as the value.
		 */
		public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
			// Read in the first line
			String line = value.toString();

			Configuration conf = context.getConfiguration();
			int kLength = Integer.parseInt(conf.get("k-mer.length"));

			if (!line.startsWith(">")) {
				if (previousLine != null && !previousLine.isEmpty()) {
					int j = 0;
					for (int i = kLength - 1; i > 0 && j < line.length(); i--) {
						String previousPart = previousLine.substring(previousLine.length() - i);
						String currentPart = line.substring(0, j + 1);

						context.write(new Text( previousPart + currentPart), one);
						j++;
					}
				}

				for (int i = 0; i <= (line.length() - kLength); i++) {
					context.write(new Text(line.substring(i, i + kLength)), one);
				}
			}

			previousLine = line;
		}
	}

	/**
	 * This is the Reducer component.  It will receive the Mapped, Shuffled, and Sorted kmers.
	 * The kmers are then summed to find the total count, and ordered to find the top 10.
	 *
	 * @author Colby Snedeker
	 *
	 */
	public static class Reduce extends Reducer<Text, IntWritable, Text, IntWritable> {
		private TreeMap<Integer, PriorityQueue<String>> orderer = new TreeMap<>();

		/**
		 * This is the reduce function.  It takes all of the entries containing a kmer
		 * and it's hard coded one value then sums them to find the total count for
		 * each kmer.  Once this sum has been found the kmer is inserted into a priority
		 * queue which is the value of a TreeMap entry where the sum is the key.  This
		 * provides automatic sorting first on the count, and then alphabetically.  It
		 * then reads through the top 10 entries, and outputs them to the context.
		 */
		public void reduce(Text key, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException {

			int sum = 0;

			for (IntWritable val : values) {
				sum += val.get();
			}

			PriorityQueue<String> kmers = orderer.get(Integer.valueOf(sum));

			if (kmers != null) {
				kmers.add(key.toString());
			}
			else {
				PriorityQueue<String> newKmer = new PriorityQueue<>();
				newKmer.add(key.toString());
				orderer.put(Integer.valueOf(sum), newKmer);
			}
		}

		protected void cleanup(Context context) throws IOException, InterruptedException {
			int i = 0;

			for (Entry<Integer, PriorityQueue<String>> entry : orderer.descendingMap().entrySet()) {
				for (String kmer : entry.getValue()) {
					if (i < 10) {
						i++;

						context.write(new Text(kmer), new IntWritable(entry.getKey()));
					}
				}
			}

//			for (Entry<Text, Integer> entry : kMerTreeMap.entrySet()) {
//				context.write(entry.getKey(), new IntWritable(entry.getValue()));
//			}
		}
	}

	/**
	 * Configures the Hadoop job, and reads the user provided arguments
	 *
	 * @param args The user provided arguments.
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		//Get configuration object and set a job name
		Configuration conf = new Configuration();
		conf.set("k-mer.length", args[0]);
		conf.set("mapred.textoutputformat.separator", "");
		Job job = new Job(conf, "kMerCounter");
		job.setJarByClass(snedeker.cc.project4.KMerCounter.class);

		job.setMapOutputKeyClass(Text.class);
		job.setMapOutputValueClass(IntWritable.class);
		job.setOutputKeyClass(Text.class);
		job.setOutputValueClass(Text.class);
		//Set key, output classes for the job (same as output classes for Reducer)
		job.setMapperClass(Map.class);
		job.setReducerClass(Reduce.class);

		//Set format of input files; "TextInputFormat" views files
		//as a sequence of lines
		job.setInputFormatClass(TextInputFormat.class);
		//Set format of output files: lines of text
		job.setOutputFormatClass(TextOutputFormat.class);
		//job.setNumReduceTasks(2); #set num of reducers
		//accept the hdfs input and output directory at run time
		FileInputFormat.addInputPath(job, new Path(args[1]));
		FileOutputFormat.setOutputPath(job, new Path(args[2]));
		//Launch the job and wait for it to finish
//		job.waitForCompletion(true);
		System.exit(job.waitForCompletion(true) ? 0 : 1);

	}

}


text:
/**
 * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components
 * @version v25.0.1
 * @link http://www.ag-grid.com/
 * @license MIT
 */
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { Bean, Autowired } from './context/context';
import { BeanStub } from "./context/beanStub";
import { addCssClass } from './utils/dom';
import { doOnce } from './utils/function';
var MAT_GRID_SIZE = 8;
var BASE_GRID_SIZE = 4;
var BALHAM_GRID_SIZE = 4;
var ALPINE_GRID_SIZE = 6;
var HARD_CODED_SIZES = {
    // this item is required for custom themes
    'ag-theme-custom': {
        headerHeight: 25,
        headerCellMinWidth: 24,
        listItemHeight: BASE_GRID_SIZE * 5,
        rowHeight: 25,
        chartMenuPanelWidth: 220
    },
    'ag-theme-material': {
        headerHeight: MAT_GRID_SIZE * 7,
        headerCellMinWidth: 48,
        listItemHeight: MAT_GRID_SIZE * 4,
        rowHeight: MAT_GRID_SIZE * 6,
        chartMenuPanelWidth: 240
    },
    'ag-theme-balham': {
        headerHeight: BALHAM_GRID_SIZE * 8,
        headerCellMinWidth: 24,
        listItemHeight: BALHAM_GRID_SIZE * 6,
        rowHeight: BALHAM_GRID_SIZE * 7,
        chartMenuPanelWidth: 220
    },
    'ag-theme-alpine': {
        headerHeight: ALPINE_GRID_SIZE * 8,
        headerCellMinWidth: 36,
        listItemHeight: ALPINE_GRID_SIZE * 4,
        rowHeight: ALPINE_GRID_SIZE * 7,
        chartMenuPanelWidth: 240
    }
};
/**
 * this object contains a list of Sass variables and an array
 * of CSS styles required to get the correct value.
 * eg. $virtual-item-height requires a structure, so we can get its height.
 *

 *

 *

 *

 *

 */
var SASS_PROPERTY_BUILDER = {
    headerHeight: ['ag-header-row'],
    headerCellMinWidth: ['ag-header-cell'],
    listItemHeight: ['ag-virtual-list-item'],
    rowHeight: ['ag-row'],
    chartMenuPanelWidth: ['ag-chart-docked-container']
};
var CALCULATED_SIZES = {};
var Environment = /** @class */ (function (_super) {
    __extends(Environment, _super);
    function Environment() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Environment.prototype.getSassVariable = function (theme, key) {
        var useTheme = 'ag-theme-' + (theme.match('material') ? 'material' : theme.match('balham') ? 'balham' : theme.match('alpine') ? 'alpine' : 'custom');
        var defaultValue = HARD_CODED_SIZES[useTheme][key];
        var calculatedValue = 0;
        if (!CALCULATED_SIZES[theme]) {
            CALCULATED_SIZES[theme] = {};
        }
        if (CALCULATED_SIZES[theme][key]) {
            return CALCULATED_SIZES[theme][key];
        }
        if (SASS_PROPERTY_BUILDER[key]) {
            var classList = SASS_PROPERTY_BUILDER[key];
            var div = document.createElement('div');
            addCssClass(div, theme);
            div.style.position = 'absolute';
            var el = classList.reduce(function (el, currentClass) {
                var div = document.createElement('div');
                div.style.position = 'static';
                addCssClass(div, currentClass);
                el.appendChild(div);
                return div;
            }, div);
            if (document.body) {
                document.body.appendChild(div);
                var sizeName = key.toLowerCase().indexOf('height') !== -1 ? 'height' : 'width';
                calculatedValue = parseInt(window.getComputedStyle(el)[sizeName], 10);
                document.body.removeChild(div);
            }
        }
        CALCULATED_SIZES[theme][key] = calculatedValue || defaultValue;
        return CALCULATED_SIZES[theme][key];
    };
    Environment.prototype.isThemeDark = function () {
        var theme = this.getTheme().theme;
        return !!theme && theme.indexOf('dark') >= 0;
    };
    Environment.prototype.chartMenuPanelWidth = function () {
        var theme = this.getTheme().themeFamily;
        return this.getSassVariable(theme, 'chartMenuPanelWidth');
    };
    Environment.prototype.getTheme = function () {
        var reg = /\bag-(material|(?:theme-([\w\-]*)))\b/;
        var el = this.eGridDiv;
        var themeMatch;
        while (el) {
            themeMatch = reg.exec(el.className);
            if (!themeMatch) {
                el = el.parentElement;
            }
            else {
                break;
            }
        }
        if (!themeMatch) {
            return {};
        }
        var theme = themeMatch[0];
        var usingOldTheme = themeMatch[2] === undefined;
        if (usingOldTheme) {
            var newTheme_1 = theme.replace('ag-', 'ag-theme-');
            doOnce(function () { return console.warn("ag-Grid: As of v19 old theme are no longer provided. Please replace " + theme + " with " + newTheme_1 + "."); }, 'using-old-theme');
        }
        return { theme: theme, el: el, themeFamily: theme.replace(/-dark$/, '') };
    };
    __decorate([
        Autowired('eGridDiv')
    ], Environment.prototype, "eGridDiv", void 0);
    Environment = __decorate([
        Bean('environment')
    ], Environment);
    return Environment;
}(BeanStub));
export { Environment };


text:
navigator.serviceWorker.register('service-worker.js').then(function(registration) {
  // Use the PushManager to get the user's subscription to the push service.
  return registration.pushManager.getSubscription().then(function(subscription) {
    // If a subscription was found, return it.
    if (subscription) {
      return subscription;
    }

    // Otherwise, subscribe the user (userVisibleOnly allows to specify that we don't plan to
    // send notifications that don't have a visible effect for the user).
    return registration.pushManager.subscribe({ userVisibleOnly: true }).then(function(newSubscription) {
      return newSubscription;
    });
  });
}).then(function(subscription) {
  // Send the subscription details to the server using the Fetch API.
  fetch('./register', {
    method: 'post',
    headers: {
      'Content-type': 'application/json'
    },
    body: JSON.stringify({
      endpoint: subscription.endpoint,
    }),
  });
});

document.getElementById('doIt').onclick = function() {
  // Ask the server to send the client a notification (for testing purposes, in real
  // applications the notification will be generated by some event on the server).
  fetch('./sendNotification', {
    method: 'post',
  });
};


text:
"""Script for reporting gcloud metrics."""

import os
import pickle
import sys

from googlecloudsdk.core import http_proxy

try:
  # pylint:disable=g-import-not-at-top
  import httplib2
except ImportError:
  # Do nothing if we can't import the lib.
  sys.exit(0)

# If outgoing packets are getting dropped, httplib2 will hang forever waiting
# for a response.
TIMEOUT_IN_SEC = 10

def ReportMetrics(metrics_file_path):
  """Sends the specified anonymous usage event to the given analytics endpoint.

  Args:
      metrics_file_path: str, File with pickled metrics (list of tuples).
  """
  with open(metrics_file_path, 'rb') as metrics_file:
    metrics = pickle.load(metrics_file)
  os.remove(metrics_file_path)

  http = httplib2.Http(timeout=TIMEOUT_IN_SEC,
                       proxy_info=http_proxy.GetHttpProxyInfo())

  for metric in metrics:
    headers = {'user-agent': metric[3]}
    http.request(metric[0], method=metric[1], body=metric[2], headers=headers)

if __name__ == '__main__':
  try:
    ReportMetrics(sys.argv[1])
  # pylint: disable=bare-except, Never fail or output a stacktrace here.
  except:
    pass


text:
FactoryBot.define do
  factory :city do
    initialize_with { City.find_by(code: code) || new(attributes) }

    code 'vilnius'
    name 'Vilnius'
    lat '54.687157'
    lng '25.279652'
    active true
  end
end


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 org.camunda.bpm.engine.impl.pvm.runtime.operation;

import org.camunda.bpm.engine.ProcessEngineException;
import org.camunda.bpm.engine.delegate.ExecutionListener;
import org.camunda.bpm.engine.impl.core.model.CoreModelElement;
import org.camunda.bpm.engine.impl.pvm.PvmActivity;
import org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl;

/**
 *
 * @author Tom Baeyens
 * @author Daniel Meyer
 * @author Thorben Lindhauer
 */
public abstract class AbstractPvmAtomicOperationTransitionNotifyListenerTake extends AbstractPvmEventAtomicOperation {

  protected void eventNotificationsCompleted(PvmExecutionImpl execution) {
    PvmActivity destination = execution.getTransition().getDestination();

    // check start behavior of next activity
    switch (destination.getActivityStartBehavior()) {
    case DEFAULT:
      execution.setActivity(destination);
      execution.performOperation(TRANSITION_CREATE_SCOPE);
      break;
    case INTERRUPT_FLOW_SCOPE:
      execution.setActivity(null);
      execution.performOperation(TRANSITION_INTERRUPT_FLOW_SCOPE);
      break;
    default:
      throw new ProcessEngineException("Unsupported start behavior for activity '"+destination
          +"' started from a sequence flow: "+destination.getActivityStartBehavior());
    }
  }

  protected CoreModelElement getScope(PvmExecutionImpl execution) {
    return execution.getTransition();
  }

  protected String getEventName() {
    return ExecutionListener.EVENTNAME_TAKE;
  }

}


text:
import java.io.IOException;
import java.io.OutputStream;

public class ComPortSender {

	static OutputStream out;

	public static void SetOutputStream(OutputStream out) {
		ComPortSender.out = out;
	}

	public static void send(byte[] message) {
		// TODO Auto-generated method stub

		System.out.println("SENDING: " + Orders.convertBytesToHex(message));
		// sending through serial port is simply writing into OutputStream
		try {
			out.write(message);
			out.flush();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}


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

import { Component, Input, OnInit } from '@angular/core';
import { Params } from '@angular/router';
import { CoreCourseModuleData } from '@features/course/services/course-helper';
import { CoreUser, CoreUserProfile } from '@features/user/services/user';
import { CoreNavigator } from '@services/navigator';
import { CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom';
import { AddonModWorkshopData, AddonModWorkshopGetWorkshopAccessInformationWSResponse } from '../../services/workshop';
import {
    AddonModWorkshopHelper,
    AddonModWorkshopSubmissionAssessmentWithFormData,
    AddonModWorkshopSubmissionDataWithOfflineData,
} from '../../services/workshop-helper';
import { AddonModWorkshopOffline } from '../../services/workshop-offline';

/**
 * Component that displays workshop assessment.
 */
@Component({
    selector: 'addon-mod-workshop-assessment',
    templateUrl: 'addon-mod-workshop-assessment.html',
})
export class AddonModWorkshopAssessmentComponent implements OnInit {

    @Input() assessment!: AddonModWorkshopSubmissionAssessmentWithFormData;
    @Input() courseId!: number;
    @Input() workshop!: AddonModWorkshopData;
    @Input() access!: AddonModWorkshopGetWorkshopAccessInformationWSResponse;
    @Input() submission!: AddonModWorkshopSubmissionDataWithOfflineData;
    @Input() module!: CoreCourseModuleData;

    canViewAssessment = false;
    canSelfAssess = false;
    profile?: CoreUserProfile;
    showGrade: (grade?: string | number) => boolean;
    offline = false;
    loaded = false;

    protected currentUserId: number;
    protected assessmentId?: number;

    constructor() {
        this.currentUserId = CoreSites.getCurrentSiteUserId();
        this.showGrade = AddonModWorkshopHelper.showGrade;
    }

    /**
     * Component being initialized.
     */
    ngOnInit(): void {
        const canAssess = this.access && this.access.assessingallowed;
        const userId = this.assessment.reviewerid;
        const promises: Promise<void>[] = [];

        this.assessmentId = this.assessment.id;
        this.canViewAssessment = !!this.assessment.grade;
        this.canSelfAssess = canAssess && userId == this.currentUserId;

        if (userId) {
            promises.push(CoreUser.getProfile(userId, this.courseId, true).then((profile) => {
                this.profile = profile;

                return;
            }));
        }

        let assessOffline: Promise<void>;
        if (userId == this.currentUserId) {
            assessOffline = AddonModWorkshopOffline.getAssessment(this.workshop.id, this.assessmentId) .then((offlineAssess) => {
                this.offline = true;
                this.assessment.weight = <number>offlineAssess.inputdata.weight;

                return;
            });
        } else {
            assessOffline = AddonModWorkshopOffline.getEvaluateAssessment(this.workshop.id, this.assessmentId)
                .then((offlineAssess) => {
                    this.offline = true;
                    this.assessment.gradinggradeover = offlineAssess.gradinggradeover;
                    this.assessment.weight = <number>offlineAssess.weight;

                    return;

                });
        }

        promises.push(assessOffline.catch(() => {
            this.offline = false;
            // Ignore errors.
        }));

        Promise.all(promises).finally(() => {
            this.loaded = true;
        });
    }

    /**
     * Navigate to the assessment.
     */
    async gotoAssessment(event: Event): Promise<void> {
        if (!this.canSelfAssess && this.canViewAssessment) {
            event.preventDefault();
            event.stopPropagation();

            const params: Params = {
                assessment: this.assessment,
                submission: this.submission,
                profile: this.profile,
            };

            if (!this.submission) {
                const modal = await CoreDomUtils.showModalLoading();

                try {
                    params.submission = await AddonModWorkshopHelper.getSubmissionById(
                        this.workshop.id,
                        this.assessment.submissionid,
                        { cmId: this.workshop.coursemodule },
                    );

                    CoreNavigator.navigate(String(this.assessmentId), { params });
                } catch (error) {
                    CoreDomUtils.showErrorModalDefault(error, 'Cannot load submission');
                } finally {
                    modal.dismiss();
                }
            } else {
                CoreNavigator.navigate(String(this.assessmentId), { params });
            }
        }
    }

    /**
     * Navigate to my own assessment.
     */
    gotoOwnAssessment(event: Event): void {
        if (!this.canSelfAssess) {
            return;
        }
        event.preventDefault();
        event.stopPropagation();

        const params: Params = {
            module: this.module,
            workshop: this.workshop,
            access: this.access,
            profile: this.profile,
            submission: this.submission,
            assessment: this.assessment,
        };

        CoreNavigator.navigate(String(this.submission.id), params);

    }

}


text:
<?php class DB{   var $conect;  var $BaseDatos;   var $Servidor;  var $Usuario;   var $Clave;   function DB(){

$this->BaseDatos = "ingresos";
$this->Servidor = "localhost";
$this->Usuario = "ingresosuser";
$this->Clave = "ingreso321";
}

function conectar() {
//Defino la zona horaria para que sea la chilena
date_default_timezone_set('America/Santiago');
if(!($con=@mysql_connect($this->Servidor,$this->Usuario,$this->Clave))){
echo"Error al conectar a la base de datos";
exit();
}
if (!@mysql_select_db($this->BaseDatos,$con)){
echo "Error al seleccionar la base de datos";
exit();
}
$this->conect=$con;
return true;
}
}

function calcular_personas_en_recinto(){

     //consulto por las salidas de hoy
    $totalRecintoQuery = "select rut,nombre,apellido,(select registro from registro where rut=personas.rut and tipo = 1 order by registro desc limit 1) as UltimoIngreso, (select registro from registro where rut=personas.rut and tipo = 0 order by registro desc limit 1) as UltimaSalida from personas";
    $BuscarRecintoDatos = mysql_query($totalRecintoQuery);
   // $totalRecintoRegistros = mysql_fetch_array($BuscarRecintoDatos);

    $numFilasRecinto = mysql_num_rows($BuscarRecintoDatos);
    $cantidadTotal = 0;
for ($i=0; $i<$numFilasRecinto; $i++)
{

$fila2 = mysql_fetch_array($BuscarRecintoDatos);
$numlista2 = $i + 1;

if ($fila2['UltimoIngreso']>$fila2['UltimaSalida']){

	$cantidadTotal++;

}

}

return $cantidadTotal;
}

?>


text:
@interface UIView (FindController)

- (UIViewController *)viewController;

@end