content
stringlengths
3
806k
option
stringclasses
3 values
score
float64
0.01
1
__index_level_0__
int64
0
100k
module IHateParens import Data.List %default total infixl 0 .| -- Instead of `f (a b) $ c d` or `f (a b) (c d)` you can write `f .| a b .| c d` public export %inline (.|) : (a -> b) -> a -> b (.|) = id f : String -> List String -> String f x = foldr .| (++) . (++ "_") .| "foo" ++ x --f x = foldr ((++) . (++ "_")) $ "foo" ++ x --f x = foldr ((++) . (++ "_")) ("foo" ++ x) f_corr : f "x" ["a", "b", "c"] = "a_b_c_foox" f_corr = Refl record Rec where constructor MkRec oneField : Int anotherField : Nat yetAnotherField : List Nat r : Nat -> Rec r n = MkRec .| cast (n + 1) .| n + 3 .| replicate n 5 r_corr : r 4 = MkRec 5 7 [5, 5, 5, 5] r_corr = Refl
high
0.552365
99,911
######################################################################################################################## # OpenStudio(R), Copyright (c) 2008-2019, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the # following conditions are met: # # (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following # disclaimer. # # (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided with the distribution. # # (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote products # derived from this software without specific prior written permission from the respective party. # # (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative works # may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar designation without specific prior # written permission from Alliance for Sustainable Energy, LLC. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED # STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ######################################################################################################################## require 'openstudio' require 'minitest/autorun' class Exceptions2_Test < MiniTest::Unit::TestCase # def setup # end # def teardown # end def test_exceptions2 workflow = OpenStudio::Runmanager::Workflow.new("ModelToIdf->ExpandObjects->EnergyPlus") job = workflow.create(OpenStudio::Path.new("/tmp/outdir"), OpenStudio::Path.new("somefile.osm")) end end
high
0.270674
99,912
;;; frontmacs.el --- Frontside config package for emacs ;;; Commentary: ;;; Code: (require 'frontmacs-config) (require 'frontmacs-style) (require 'frontmacs-system) (require 'frontmacs-projectile) (require 'frontmacs-completion) (require 'frontmacs-vcs) (require 'frontmacs-windowing) (require 'frontmacs-editing) (require 'frontmacs-devel) (require 'frontmacs-keys) (require 'frontmacs-modeline) ;; different language modes (require 'frontmacs-web) (require 'frontmacs-javascript) (require 'frontmacs-css) (require 'frontmacs-ruby) (require 'frontmacs-yaml) (require 'frontmacs-markdown) (require 'frontmacs-dart) (require 'frontmacs-language-server) (provide 'frontmacs) ;;; frontmacs.el ends here
high
0.583926
99,913
service CalcService { i64 add(1:i64 a, 2:i64 b), }
high
0.437161
99,914
PREFIX cex: <http://purl.org/weso/ontology/computex#> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dct: <http://purl.org/dc/terms/> PREFIX sdmx-attribute: <http://purl.org/linked-data/sdmx/2009/attribute#> SELECT DISTINCT ?indicatorURI ?notation ?indicatorLabel ?indicatorDescription ?unitLabel ?datasetURI ?seeAlso FROM <http://indicators.landportal.info> WHERE { ?indicatorURI a cex:Indicator . OPTIONAL { ?indicatorURI skos:notation ?notation ; rdfs:label ?indicatorLabel ; dct:description ?indicatorDescription ; sdmx-attribute:unitMeasure ?unitLabel ; dct:source ?datasetURI ; rdfs:seeAlso ?seeAlso . } } ORDER BY ?notation # NUMBER OF INDICATORS PREFIX cex: <http://purl.org/weso/ontology/computex#> PREFIX dct: <http://purl.org/dc/terms/> PREFIX skos: <http://www.w3.org/2004/02/skos/core#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX sdmx-attribute: <http://purl.org/linked-data/sdmx/2009/attribute#> SELECT (COUNT(*) AS ?count) { SELECT DISTINCT ?indicatorURI ?notation ?indicatorLabel ?indicatorDescription ?unitLabel ?datasetURI ?seeAlso FROM <http://indicators.landportal.info> WHERE { ?indicatorURI a cex:Indicator . OPTIONAL { ?indicatorURI skos:notation ?notation ; rdfs:label ?indicatorLabel ; dct:description ?indicatorDescription ; sdmx-attribute:unitMeasure ?unitLabel ; dct:source ?datasetURI ; rdfs:seeAlso ?seeAlso . } } ORDER BY ?notation }
high
0.807567
99,915
/******************************************************************************** * Copyright (C) 2018 Red Hat, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * This Source Code may also be made available under the following Secondary * Licenses when the conditions for such availability set forth in the Eclipse * Public License v. 2.0 are satisfied: GNU General Public License, version 2 * with the GNU Classpath Exception which is available at * https://www.gnu.org/software/classpath/license.html. * * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 ********************************************************************************/ import { PLUGIN_RPC_CONTEXT, TasksExt, TasksMain, TaskDto, TaskExecutionDto } from '../../common/plugin-api-rpc'; import * as theia from '@theia/plugin'; import * as converter from '../type-converters'; import { CustomExecution, Disposable } from '../types-impl'; import { RPCProtocol, ConnectionClosedError } from '../../common/rpc-protocol'; import { TaskProviderAdapter } from './task-provider'; import { Emitter, Event } from '@theia/core/lib/common/event'; import { TerminalServiceExtImpl } from '../terminal-ext'; import { UUID } from '@theia/core/shared/@phosphor/coreutils'; type ExecutionCallback = (resolvedDefintion: theia.TaskDefinition) => Thenable<theia.Pseudoterminal>; export class TasksExtImpl implements TasksExt { private proxy: TasksMain; private callId = 0; private adaptersMap = new Map<number, TaskProviderAdapter>(); private executions = new Map<number, theia.TaskExecution>(); protected callbackIdBase: string = UUID.uuid4(); protected callbackId: number; protected customExecutionIds: Map<ExecutionCallback, string> = new Map(); protected customExecutionFunctions: Map<string, ExecutionCallback> = new Map(); protected lastStartedTask: number | undefined; private readonly onDidExecuteTask: Emitter<theia.TaskStartEvent> = new Emitter<theia.TaskStartEvent>(); private readonly onDidTerminateTask: Emitter<theia.TaskEndEvent> = new Emitter<theia.TaskEndEvent>(); private readonly onDidExecuteTaskProcess: Emitter<theia.TaskProcessStartEvent> = new Emitter<theia.TaskProcessStartEvent>(); private readonly onDidTerminateTaskProcess: Emitter<theia.TaskProcessEndEvent> = new Emitter<theia.TaskProcessEndEvent>(); private disposed = false; constructor(rpc: RPCProtocol, readonly terminalExt: TerminalServiceExtImpl) { this.proxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.TASKS_MAIN); this.fetchTaskExecutions(); } dispose(): void { this.disposed = true; } get taskExecutions(): ReadonlyArray<theia.TaskExecution> { return [...this.executions.values()]; } get onDidStartTask(): Event<theia.TaskStartEvent> { return this.onDidExecuteTask.event; } async $onDidStartTask(execution: TaskExecutionDto, terminalId: number): Promise<void> { const customExecution = this.customExecutionFunctions.get(execution.task.executionId || ''); if (customExecution) { const taskDefinition = converter.toTask(execution.task).definition; const pty = await customExecution(taskDefinition); this.terminalExt.attachPtyToTerminal(terminalId, pty); if (pty.onDidClose) { const disposable = pty.onDidClose((e: number | void = undefined) => { disposable.dispose(); // eslint-disable-next-line no-void this.proxy.$customExecutionComplete(execution.id, e === void 0 ? undefined : e); }); } } this.lastStartedTask = execution.id; this.onDidExecuteTask.fire({ execution: this.getTaskExecution(execution) }); } get onDidEndTask(): Event<theia.TaskEndEvent> { return this.onDidTerminateTask.event; } $onDidEndTask(id: number): void { const taskExecution = this.executions.get(id); if (!taskExecution) { throw new Error(`Task execution with id ${id} is not found`); } this.executions.delete(id); this.onDidTerminateTask.fire({ execution: taskExecution }); } get onDidStartTaskProcess(): Event<theia.TaskProcessStartEvent> { return this.onDidExecuteTaskProcess.event; } $onDidStartTaskProcess(processId: number, executionDto: TaskExecutionDto): void { this.onDidExecuteTaskProcess.fire({ processId, execution: this.getTaskExecution(executionDto) }); } get onDidEndTaskProcess(): Event<theia.TaskProcessEndEvent> { return this.onDidTerminateTaskProcess.event; } $onDidEndTaskProcess(exitCode: number, taskId: number): void { const taskExecution = this.executions.get(taskId); if (!taskExecution) { throw new Error(`Task execution with id ${taskId} is not found`); } this.onDidTerminateTaskProcess.fire({ execution: taskExecution, exitCode }); } registerTaskProvider(type: string, provider: theia.TaskProvider): theia.Disposable { const callId = this.addNewAdapter(new TaskProviderAdapter(provider)); this.proxy.$registerTaskProvider(callId, type); return this.createDisposable(callId); } async fetchTasks(filter?: theia.TaskFilter): Promise<theia.Task[]> { const taskVersion = filter ? filter.version : undefined; const taskType = filter ? filter.type : undefined; const taskDtos = await this.proxy.$fetchTasks(taskVersion, taskType); return taskDtos.map(dto => converter.toTask(dto)); } async executeTask(task: theia.Task): Promise<theia.TaskExecution> { const taskDto = converter.fromTask(task); if (taskDto) { // If this task is a custom execution, then we need to save it away // in the provided custom execution map that is cleaned up after the // task is executed. if (CustomExecution.is(task.execution!)) { taskDto.executionId = this.addCustomExecution(task.execution!.callback); } const executionDto = await this.proxy.$executeTask(taskDto); if (executionDto) { const taskExecution = this.getTaskExecution(executionDto); return taskExecution; } throw new Error('Run task config does not return after being started'); } throw new Error('Task was not successfully transformed into a task config'); } $provideTasks(handle: number, token: theia.CancellationToken): Promise<TaskDto[] | undefined> { const adapter = this.adaptersMap.get(handle); if (adapter) { return adapter.provideTasks(token).then(tasks => { if (tasks) { for (const task of tasks) { if (task.taskType === 'customExecution') { task.executionId = this.addCustomExecution(task.callback); task.callback = undefined; } } } return tasks; }); } else { return Promise.reject(new Error('No adapter found to provide tasks')); } } $resolveTask(handle: number, task: TaskDto, token: theia.CancellationToken): Promise<TaskDto | undefined> { const adapter = this.adaptersMap.get(handle); if (adapter) { return adapter.resolveTask(task, token).then(resolvedTask => { if (resolvedTask && resolvedTask.taskType === 'customExecution') { resolvedTask.executionId = this.addCustomExecution(resolvedTask.callback); resolvedTask.callback = undefined; } return resolvedTask; }); } else { return Promise.reject(new Error('No adapter found to resolve task')); } } private addNewAdapter(adapter: TaskProviderAdapter): number { const callId = this.nextCallId(); this.adaptersMap.set(callId, adapter); return callId; } private nextCallId(): number { return this.callId++; } private createDisposable(callId: number): theia.Disposable { return new Disposable(() => { this.adaptersMap.delete(callId); this.proxy.$unregister(callId); }); } private async fetchTaskExecutions(): Promise<void> { try { const taskExecutions = await this.proxy.$taskExecutions(); taskExecutions.forEach(execution => this.getTaskExecution(execution)); } catch (error) { if (this.disposed && ConnectionClosedError.is(error)) { return; } console.error(`Can not fetch running tasks: ${error}`); } } private getTaskExecution(execution: TaskExecutionDto): theia.TaskExecution { const executionId = execution.id; let result: theia.TaskExecution | undefined = this.executions.get(executionId); if (result) { return result; } result = { task: converter.toTask(execution.task), terminate: () => { this.proxy.$terminateTask(executionId); } }; this.executions.set(executionId, result); return result; } private addCustomExecution(callback: ExecutionCallback): string { let id = this.customExecutionIds.get(callback); if (!id) { id = this.nextCallbackId(); this.customExecutionIds.set(callback, id); this.customExecutionFunctions.set(id, callback); } return id; } private nextCallbackId(): string { return this.callbackIdBase + this.callbackId++; } }
high
0.687527
99,916
<?php namespace App\Models; use Illuminate\Database\Eloquent\Model; class Plan extends Model { protected $fillable = ['name', 'url', 'price', 'description']; public function search($filter = null) { $results = $this->where('name', 'LIKE', "%{$filter}%") ->orWhere('description', 'LIKE', "%{$filter}%") ->paginate(); return $results; } }
high
0.528493
99,917
from collections import OrderedDict from collections.abc import Sequence import itertools import warnings try: from itertools import izip except ImportError: izip = zip import numpy as np import openmdao.api as om from ..utils.constants import INF_BOUND from ..transcriptions.common import InputParameterComp, PhaseLinkageComp from ..phase.options import TrajDesignParameterOptionsDictionary, \ TrajInputParameterOptionsDictionary _unspecified = object() class Trajectory(om.Group): """ A Trajectory object serves as a container for one or more Phases, as well as the linkage conditions between phases. """ def __init__(self, **kwargs): super(Trajectory, self).__init__(**kwargs) self.input_parameter_options = {} self.design_parameter_options = {} self._linkages = OrderedDict() self._phases = OrderedDict() self._phase_add_kwargs = {} def initialize(self): """ Declare any options for Trajectory. """ self.options.declare('sim_mode', types=bool, default=False, desc='Used internally by Dymos when invoking simulate on a trajectory') def add_phase(self, name, phase, **kwargs): """ Add a phase to the trajectory. Phases will be added to the Trajectory's `phases` subgroup. Parameters ---------- name : str The name of the phase being added. phase : dymos Phase object The Phase object to be added. Returns ------- phase : PhaseBase The Phase object added to the trajectory. """ self._phases[name] = phase self._phase_add_kwargs[name] = kwargs return phase def add_input_parameter(self, name, units, val=_unspecified, desc=_unspecified, targets=_unspecified, custom_targets=_unspecified, shape=_unspecified, dynamic=_unspecified): """ Add an input parameter to the trajectory. Parameters ---------- name : str Name of the input parameter. val : float or ndarray Default value of the input parameter at all nodes. desc : str A description of the input parameter. targets : dict or None A dictionary mapping the name of each phase in the trajectory to a sequence of ODE targets for this parameter in each phase. units : str or None or 0 Units in which the input parameter is defined. If 0, use the units declared for the parameter in the ODE. shape : Sequence of int The shape of the input parameter. dynamic : bool True if the targets in the ODE may be dynamic (if the inputs are sized to the number of nodes) else False. """ if name not in self.input_parameter_options: self.input_parameter_options[name] = TrajInputParameterOptionsDictionary() if units is not _unspecified: self.input_parameter_options[name]['units'] = units if val is not _unspecified: self.input_parameter_options[name]['val'] = val if desc is not _unspecified: self.input_parameter_options[name]['desc'] = desc if targets is not _unspecified: if isinstance(targets, str): self.input_parameter_options[name]['targets'] = (targets,) else: self.input_parameter_options[name]['targets'] = targets if custom_targets is not _unspecified: warnings.warn('Option custom_targets is now targets, and should provide the ode ' 'targets for the parameter in each phase', DeprecationWarning) if isinstance(custom_targets, str): self.input_parameter_options[name]['targets'] = (custom_targets,) else: self.input_parameter_options[name]['targets'] = custom_targets if shape is not _unspecified: self.input_parameter_options[name]['shape'] = shape if dynamic is not _unspecified: self.input_parameter_options[name]['dynamic'] = dynamic def add_design_parameter(self, name, units, val=_unspecified, desc=_unspecified, opt=_unspecified, targets=_unspecified, custom_targets=_unspecified, lower=_unspecified, upper=_unspecified, scaler=_unspecified, adder=_unspecified, ref0=_unspecified, ref=_unspecified, shape=_unspecified, dynamic=_unspecified): """ Add a design parameter (static control) to the trajectory. Parameters ---------- name : str Name of the design parameter. val : float or ndarray Default value of the design parameter at all nodes. desc : str A description of the design parameter. targets : dict or None If None, then the design parameter will be connected to the controllable parameter in the ODE of each phase. For each phase where no such controllable parameter exists, a warning will be issued. If targets is given as a dict, the dict should provide the relevant phase names as keys, each associated with the respective controllable parameter as a value. custom_targets : dict or None By default, the input parameter will be connect to the parameter/targets of the given name in each phase. This argument can be used to override that behavior on a phase by phase basis. units : str or None or 0 Units in which the design parameter is defined. If 0, use the units declared for the parameter in the ODE. opt : bool If True (default) the value(s) of this design parameter will be design variables in the optimization problem, in the path 'traj_name.design_params.design_parameters:name'. If False, the this design parameter will still be owned by an IndepVarComp in the phase, but it will not be a design variable in the optimization. lower : float or ndarray The lower bound of the design parameter value. upper : float or ndarray The upper bound of the design parameter value. scaler : float or ndarray The scaler of the design parameter value for the optimizer. adder : float or ndarray The adder of the design parameter value for the optimizer. ref0 : float or ndarray The zero-reference value of the design parameter for the optimizer. ref : float or ndarray The unit-reference value of the design parameter for the optimizer. shape : Sequence of int The shape of the design parameter. dynamic : bool True if the targets in the ODE may be dynamic (if the inputs are sized to the number of nodes) else False. """ if name not in self.design_parameter_options: self.design_parameter_options[name] = TrajDesignParameterOptionsDictionary() if units is not _unspecified: self.design_parameter_options[name]['units'] = units if opt is not _unspecified: self.design_parameter_options[name]['opt'] = opt if val is not _unspecified: self.design_parameter_options[name]['val'] = val if desc is not _unspecified: self.design_parameter_options[name]['desc'] = desc if lower is not _unspecified: self.design_parameter_options[name]['lower'] = lower if upper is not _unspecified: self.design_parameter_options[name]['upper'] = upper if scaler is not _unspecified: self.design_parameter_options[name]['scaler'] = scaler if adder is not _unspecified: self.design_parameter_options[name]['adder'] = adder if ref0 is not _unspecified: self.design_parameter_options[name]['ref0'] = ref0 if ref is not _unspecified: self.design_parameter_options[name]['ref'] = ref if targets is not _unspecified: if isinstance(targets, str): self.design_parameter_options[name]['targets'] = (targets,) else: self.design_parameter_options[name]['targets'] = targets if custom_targets is not _unspecified: warnings.warn('Option custom_targets is now targets, and should provide the ode ' 'targets for the parameter in each phase', DeprecationWarning) if isinstance(custom_targets, str): self.design_parameter_options[name]['targets'] = (custom_targets,) else: self.design_parameter_options[name]['targets'] = custom_targets if shape is not _unspecified: self.design_parameter_options[name]['shape'] = shape if dynamic is not _unspecified: self.design_parameter_options[name]['dynamic'] = dynamic def _setup_input_parameters(self): """ Adds an IndepVarComp if necessary and issues appropriate connections based on transcription. """ if self.input_parameter_options: passthru = InputParameterComp(input_parameter_options=self.input_parameter_options) self.add_subsystem('input_params', subsys=passthru, promotes_inputs=['*'], promotes_outputs=['*']) for name, options in self.input_parameter_options.items(): tgts = options['targets'] if tgts is None: # The user is implicitly connecting to input parameters in all phases. # No need to create input parameters in each phase. continue for phase_name, phs in self._phases.items(): if phase_name not in tgts or isinstance(tgts[phase_name], str): # If user omitted this phase from targets, we will try to connect # to an existing input parameter in the phase. # If the target for this phase is a string, assume the user specified the # name of an input parameter in the phase for this parameter. # Skip addition of input parameter to this phase. continue elif tgts[phase_name] is None: # Targets for this phase are explicitly None. # Skip addition of input parameter to this phase. continue elif isinstance(tgts[phase_name], Sequence): # User specified ODE targets for this parameter in this phase. # We need to add an input parameter to this phase. # The default target in the phase is name unless otherwise specified. kwargs = {'dynamic': options['dynamic'], 'units': options['units'], 'val': options['val'], 'targets': tgts[phase_name]} if not self.options['sim_mode']: phs.add_input_parameter(name, **kwargs) def _setup_design_parameters(self): """ Adds an IndepVarComp if necessary and issues appropriate connections based on transcription. """ if self.design_parameter_options: indep = self.add_subsystem('design_params', subsys=om.IndepVarComp(), promotes_outputs=['*']) for name, options in self.design_parameter_options.items(): if options['opt']: lb = -INF_BOUND if options['lower'] is None else options['lower'] ub = INF_BOUND if options['upper'] is None else options['upper'] self.add_design_var(name='design_parameters:{0}'.format(name), lower=lb, upper=ub, scaler=options['scaler'], adder=options['adder'], ref0=options['ref0'], ref=options['ref']) indep.add_output(name='design_parameters:{0}'.format(name), val=options['val'], shape=(1, np.prod(options['shape'])), units=options['units']) tgts = options['targets'] if tgts is None: # The user is implicitly connecting to input parameters in all phases. # No need to create input parameters in each phase. continue for phase_name, phs in self._phases.items(): if phase_name not in tgts or isinstance(tgts[phase_name], str): # If user omitted this phase from targets, we will try to connect # to an existing input parameter in the phase. # If the target for this phase is a string, assume the user specified the # name of an input parameter in the phase for this parameter. # Skip addition of input parameter to this phase. continue elif tgts[phase_name] is None: # Targets for this phase are explicitly None. # Skip addition of input parameter to this phase. continue elif isinstance(tgts[phase_name], Sequence): # User specified ODE targets for this parameter in this phase. # We need to add an input parameter to this phase. # The default target in the phase is name unless otherwise specified. kwargs = {'dynamic': options['dynamic'], 'units': options['units'], 'val': options['val'], 'targets': tgts[phase_name]} if not self.options['sim_mode']: phs.add_input_parameter(name, **kwargs) def _setup_linkages(self): link_comp = None for pair, vars in self._linkages.items(): phase_name1, phase_name2 = pair for name in pair: if name not in self._phases: raise ValueError('Invalid linkage. Phase \'{0}\' does not exist in ' 'trajectory \'{1}\'.'.format(name, self.pathname)) p1 = self._phases[phase_name1] p2 = self._phases[phase_name2] p1_states = set([key for key in p1.state_options]) p2_states = set([key for key in p2.state_options]) p1_controls = set([key for key in p1.control_options]) # Dict of vars that expands '*' to include time and states _vars = {} for var in sorted(vars.keys()): if var == '*': names = ['time'] for state in p2_states: names.append(state) # sort to make converged solutions repeatable for n in sorted(names): _vars[n] = vars[var].copy() else: _vars[var] = vars[var].copy() units_map = {} shape_map = {} vars_to_constrain = [] for var, options in _vars.items(): if options['connected']: # If this is a state, and we are linking it, we need to do some checks. if var in p2_states: # Trajectory linkage modifies these options in connected states. p2.add_state(var, connected_initial=True) elif var == 'time': p2.set_time_options(input_initial=True) else: vars_to_constrain.append(var) if var in p1.state_options: units_map[var] = p1.state_options[var]['units'] shape_map[var] = p1.state_options[var]['shape'] elif var in p1.control_options: units_map[var] = p1.control_options[var]['units'] shape_map[var] = p1.control_options[var]['shape'] elif var in p1.polynomial_control_options: units_map[var] = p1.polynomial_control_options[var]['units'] shape_map[var] = p1.polynomial_control_options[var]['shape'] elif var in p1.design_parameter_options: units_map[var] = p1.design_parameter_options[var]['units'] shape_map[var] = p1.design_parameter_options[var]['shape'] elif var in p1.input_parameter_options: units_map[var] = p1.input_parameter_options[var]['units'] shape_map[var] = p1.input_parameter_options[var]['shape'] elif var == 'time': units_map[var] = p1.time_options['units'] shape_map[var] = (1,) else: units_map[var] = None shape_map[var] = (1,) if vars_to_constrain: if not link_comp: link_comp = self.add_subsystem('linkages', PhaseLinkageComp()) linkage_name = '{0}|{1}'.format(phase_name1, phase_name2) link_comp.add_linkage(name=linkage_name, vars=vars_to_constrain, shape=shape_map, units=units_map) def setup(self): """ Setup the Trajectory Group. """ super(Trajectory, self).setup() if self.design_parameter_options: self._setup_design_parameters() if self.input_parameter_options: self._setup_input_parameters() phases_group = self.add_subsystem('phases', subsys=om.ParallelGroup(), promotes_inputs=['*'], promotes_outputs=['*']) for name, phs in self._phases.items(): g = phases_group.add_subsystem(name, phs, **self._phase_add_kwargs[name]) # DirectSolvers were moved down into the phases for use with MPI g.linear_solver = om.DirectSolver() if self._linkages: self._setup_linkages() def _configure_parameters(self, mode): """ Configure connections from input or design parameters to the appropriate targets in each phase. Parameters ---------- mode : str One of 'input' or 'design' to specify if we are dealing with input parameters or design parameters. """ parameter_options = self.input_parameter_options if mode == 'input' \ else self.design_parameter_options for name, options in parameter_options.items(): # Connect the design parameter to its target in each phase suffix = '' if mode == 'design' else '_out' src_name = '{0}_parameters:{1}{2}'.format(mode, name, suffix) targets = options['targets'] for phase_name, phs in self._phases.items(): if targets is None or phase_name not in targets: # Attempt to connect to an input parameter of the same name in the phase, if # it exists. if name in phs.input_parameter_options: tgt = '{0}.input_parameters:{1}'.format(phase_name, name) else: continue elif targets[phase_name] is None: # Connections to this phase are explicitly omitted continue elif isinstance(targets[phase_name], str) and \ targets[phase_name] in phs.input_parameter_options: # Connect to an input parameter with a different name in this phase tgt = '{0}.input_parameters:{1}'.format(phase_name, targets[phase_name]) elif isinstance(targets[phase_name], Sequence) and \ name in phs.input_parameter_options: # User gave a list of ODE targets which were passed to the creation of a # new input parameter in setup, just connect to that new input parameter tgt = '{0}.input_parameters:{1}'.format(phase_name, name) else: raise ValueError('Unhandled {0} parameter target in ' 'phase {1}'.format(mode, phase_name)) self.connect(src_name=src_name, tgt_name=tgt) def _configure_linkages(self): print('--- Linkage Report [{0}] ---'.format(self.pathname)) indent = ' ' for pair, vars in self._linkages.items(): phase_name1, phase_name2 = pair for name in pair: if name not in self._phases: raise ValueError('Invalid linkage. Phase \'{0}\' does not exist in ' 'trajectory \'{1}\'.'.format(name, self.pathname)) p1 = self._phases[phase_name1] p2 = self._phases[phase_name2] print(indent * 1, phase_name1, ' ', phase_name2) p1_states = set([key for key in p1.state_options]) p2_states = set([key for key in p2.state_options]) p1_controls = set([key for key in p1.control_options]) p2_controls = set([key for key in p2.control_options]) p1_design_parameters = set([key for key in p1.design_parameter_options]) p2_design_parameters = set([key for key in p2.design_parameter_options]) p1_input_parameters = set([key for key in p1.input_parameter_options]) p2_input_parameters = set([key for key in p2.input_parameter_options]) # Dict of vars that expands '*' to include time and states _vars = {} for var in sorted(vars.keys()): if var == '*': _vars['time'] = vars[var].copy() for state in p2_states: _vars[state] = vars[var].copy() else: _vars[var] = vars[var].copy() max_varname_length = max(len(name) for name in _vars.keys()) units_map = {} shape_map = {} vars_to_constrain = [] for var, options in _vars.items(): if not options['connected']: vars_to_constrain.append(var) if var in p1_states: units_map[var] = p1.state_options[var]['units'] shape_map[var] = p1.state_options[var]['shape'] elif var in p1_controls: units_map[var] = p1.control_options[var]['units'] shape_map[var] = p1.control_options[var]['shape'] elif var == 'time': units_map[var] = p1.time_options['units'] shape_map[var] = (1,) else: units_map[var] = None shape_map[var] = (1,) if vars_to_constrain: linkage_name = '{0}|{1}'.format(phase_name1, phase_name2) for var, options in _vars.items(): loc1, loc2 = options['locs'] if var in p1_states: source1 = 'states:{0}{1}'.format(var, loc1) elif var in p1_controls: source1 = 'controls:{0}{1}'.format(var, loc1) elif var == 'time': source1 = '{0}{1}'.format(var, loc1) elif var in p1_design_parameters: source1 = 'design_parameters:{0}'.format(var) elif var in p1_input_parameters: source1 = 'input_parameters:{0}'.format(var) else: raise ValueError('Cannot find linkage variable \'{0}\' in ' 'phase \'{1}\'. Only states, time, controls, or parameters ' 'may be linked via link_phases.'.format(var, pair[0])) if var in p2_states: source2 = 'states:{0}{1}'.format(var, loc2) elif var in p2_controls: source2 = 'controls:{0}{1}'.format(var, loc2) elif var == 'time': source2 = '{0}{1}'.format(var, loc2) elif var in p2_design_parameters: source2 = 'design_parameters:{0}'.format(var) elif var in p2_input_parameters: source2 = 'input_parameters:{0}'.format(var) else: raise ValueError('Cannot find linkage variable \'{0}\' in ' 'phase \'{1}\'. Only states, time, controls, or parameters ' 'may be linked via link_phases.'.format(var, pair[1])) if options['connected']: if var == 'time': src = '{0}.{1}'.format(phase_name1, source1) path = 't_initial' self.connect(src, '{0}.{1}'.format(phase_name2, path)) else: path = 'initial_states:{0}'.format(var) self.connect('{0}.{1}'.format(phase_name1, source1), '{0}.{1}'.format(phase_name2, path)) print('{3}{0:<{2}s} --> {1:<{2}s}'.format(source1, source2, max_varname_length + 9, indent*2)) else: self.connect('{0}.{1}'.format(phase_name1, source1), 'linkages.{0}_{1}:lhs'.format(linkage_name, var)) self.connect('{0}.{1}'.format(phase_name2, source2), 'linkages.{0}_{1}:rhs'.format(linkage_name, var)) print('{3}{0:<{2}s} = {1:<{2}s}'.format(source1, source2, max_varname_length + 9, indent*2)) print('----------------------------') def configure(self): """ Configure the Trajectory Group. This method is used to handle connections to the phases in the Trajectory, since setup has already been called on all children of the Trajectory, we can query them for variables at this point. """ if self.design_parameter_options: self._configure_parameters(mode='design') if self.input_parameter_options: self._configure_parameters(mode='input') if self._linkages: self._configure_linkages() def link_phases(self, phases, vars=None, locs=('++', '--'), connected=False): """ Specifies that phases in the given sequence are to be assume continuity of the given variables. This method caches the phase linkages, and may be called multiple times to express more complex behavior (branching phases, phases only continuous in some variables, etc). The location at which the variables should be coupled in the two phases are provided with a two character string: - '--' specifies the value at the start of the phase before an initial state or control jump - '-+' specifies the value at the start of the phase after an initial state or control jump - '+-' specifies the value at the end of the phase before a final state or control jump - '++' specifies the value at the end of the phase after a final state or control jump Parameters ---------- phases : sequence of str The names of the phases in this trajectory to be sequentially linked. vars : sequence of str The variables in the phases to be linked, or '*'. Providing '*' will time and all states. Linking control values or rates requires them to be listed explicitly. locs : tuple of str. A two-element tuple of the two-character location specification. For every pair in phases, the location specification refers to which location in the first phase is connected to which location in the second phase. If the user wishes to specify different locations for different phase pairings, those phase pairings must be made in separate calls to link_phases. units : int, str, dict of {str: str or None}, or None The units of the linkage residual. If an integer (default), then automatically determine the units of each variable in the linkage if possible. Those that cannot be determined to be a time, state, control, design parameter, or control rate will be assumed to have units None. If given as a dict, it should map the name of each variable in vars to the approprite units. connected : bool Set to True to directly connect the phases being linked. Otherwise, create constraints for the optimizer to solve. Examples -------- **Typical Phase Linkage Sequence** A typical phase linkage sequence, where all phases use the same ODE (and therefore have the same states), and are simply linked sequentially in time. >>> t.link_phases(['phase1', 'phase2', 'phase3']) **Adding an Additional Linkage** If we want some control variable, u, to be continuous in value between phase2 and phase3 only, we could subsequently issue the following: >>> t.link_phases(['phase2', 'phase3'], vars=['u']) **Branching Trajectories** For a more complex example, consider the case where we have two phases which branch off from the same point, such as the case of a jettisoned stage. The nominal trajectory consists of the phase sequence ['a', 'b', 'c']. Let phase ['d'] be the phase that tracks the jettisoned component to its impact with the ground. The linkages in this case would be defined as: >>> t.link_phases(['a', 'b', 'c']) >>> t.link_phases(['b', 'd']) **Specifying Linkage Locations** Phase linkages assume that, for each pair, the state/control values after any discontinuous jump in the first phase ('++') are linked to the state/control values before any discontinuous jump in the second phase ('--'). The user can override this behavior, but they must specify a pair of location strings for each pair given in `phases`. For instance, in the following example phases 'a' and 'b' have the same initial time and state, but phase 'c' follows phase 'b'. Note since there are three phases provided, there are two linkages and thus two pairs of location specifiers given. >>> t.link_phases(['a', 'b', 'c'], locs=[('--', '--'), ('++', '--')]) """ num_links = len(phases) - 1 if num_links <= 0: raise ValueError('Phase sequence must consists of at least two phases.') if isinstance(locs, Sequence) and len(locs) != 2: raise ValueError('If given, locs must be a sequence of two-element tuples, one pair ' 'for each phase pair in the phases sequence') _vars = ['*'] if vars is None else vars # Resolve linkage pairs from the phases sequence a, b = itertools.tee(phases) next(b, None) phase_pairs = zip(a, b) for phase1_name, phase2_name in phase_pairs: if (phase1_name, phase2_name) not in self._linkages: self._linkages[phase1_name, phase2_name] = OrderedDict() for var in _vars: self._linkages[phase1_name, phase2_name][var] = {'locs': locs, 'units': None, 'connected': connected} def simulate(self, times_per_seg=10, method='RK45', atol=1.0E-9, rtol=1.0E-9, record_file=None): """ Simulate the Trajectory using scipy.integrate.solve_ivp. Parameters ---------- times_per_seg : int or None Number of equally spaced times per segment at which output is requested. If None, output will be provided at all Nodes. method : str The scipy.integrate.solve_ivp integration method. atol : float Absolute convergence tolerance for scipy.integrate.solve_ivp. rtol : float Relative convergence tolerance for scipy.integrate.solve_ivp. record_file : str or None If a string, the file to which the result of the simulation will be saved. If None, no record of the simulation will be saved. Returns ------- problem An OpenMDAO Problem in which the simulation is implemented. This Problem interface can be interrogated to obtain timeseries outputs in the same manner as other Phases to obtain results at the requested times. """ sim_traj = Trajectory(sim_mode=True) for name, phs in self._phases.items(): sim_phs = phs.get_simulation_phase(times_per_seg=times_per_seg, method=method, atol=atol, rtol=rtol) sim_traj.add_phase(name, sim_phs) sim_traj.design_parameter_options.update(self.design_parameter_options) sim_traj.input_parameter_options.update(self.input_parameter_options) sim_prob = om.Problem(model=om.Group()) if self.name: sim_prob.model.add_subsystem(self.name, sim_traj) else: sim_prob.model.add_subsystem('sim_traj', sim_traj) if record_file is not None: rec = om.SqliteRecorder(record_file) sim_prob.model.recording_options['includes'] = ['*.timeseries.*'] sim_prob.model.add_recorder(rec) sim_prob.setup() traj_op_dict = dict([(name, opts) for (name, opts) in self.list_outputs(units=True, out_stream=None)]) # Assign trajectory design parameter values for name, options in self.design_parameter_options.items(): op = traj_op_dict['{0}.design_params.design_parameters:{1}'.format(self.pathname, name)] var_name = '{0}.design_parameters:{1}'.format(self.name, name) sim_prob[var_name] = op['value'][0, ...] # Assign trajectory input parameter values for name, options in self.input_parameter_options.items(): op = traj_op_dict['{0}.input_params.input_parameters:{1}_out'.format(self.pathname, name)] var_name = '{0}.input_parameters:{1}'.format(self.name, name) sim_prob[var_name] = op['value'][0, ...] for phase_name, phs in sim_traj._phases.items(): phs.initialize_values_from_phase(sim_prob, self._phases[phase_name]) print('\nSimulating trajectory {0}'.format(self.pathname)) sim_prob.run_model() print('Done simulating trajectory {0}'.format(self.pathname)) return sim_prob
high
0.774943
99,918
;;; -*- no-byte-compile: t -*- (define-package "inf-ruby" "20180521.648" "Run a Ruby process in a buffer" 'nil :commit "49d59a7897f594e3be74ecbddae83719f9a6c0f0" :keywords '("languages" "ruby") :url "http://github.com/nonsequitur/inf-ruby")
low
0.921903
99,919
# First program in MIPS assembly language. # Prints "Hello World!" .data str: .asciiz "Hello, world!" .text .globl main main: la $a0, str li $v0, 4 syscall
high
0.452882
99,920
{- (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 Renaming of expressions Basically dependency analysis. Handles @Match@, @GRHSs@, @HsExpr@, and @Qualifier@ datatypes. In general, all of these functions return a renamed thing, and a set of free variables. -} {-# LANGUAGE CPP #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ViewPatterns #-} {-# OPTIONS_GHC -Wno-incomplete-record-updates #-} {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} module GHC.Rename.Expr ( rnLExpr, rnExpr, rnStmts ) where #include "HsVersions.h" import GhcPrelude import GHC.Rename.Binds ( rnLocalBindsAndThen, rnLocalValBindsLHS, rnLocalValBindsRHS , rnMatchGroup, rnGRHS, makeMiniFixityEnv) import GHC.Hs import TcEnv ( isBrackStage ) import TcRnMonad import Module ( getModule ) import GHC.Rename.Env import GHC.Rename.Fixity import GHC.Rename.Utils ( HsDocContext(..), bindLocalNamesFV, checkDupNames , bindLocalNames , mapMaybeFvRn, mapFvRn , warnUnusedLocalBinds, typeAppErr , checkUnusedRecordWildcard ) import GHC.Rename.Unbound ( reportUnboundName ) import GHC.Rename.Splice ( rnBracket, rnSpliceExpr, checkThLocalName ) import GHC.Rename.Types import GHC.Rename.Pat import DynFlags import PrelNames import BasicTypes import Name import NameSet import RdrName import UniqSet import Data.List import Util import ListSetOps ( removeDups ) import ErrUtils import Outputable import SrcLoc import FastString import Control.Monad import TysWiredIn ( nilDataConName ) import qualified GHC.LanguageExtensions as LangExt import Data.Ord import Data.Array import qualified Data.List.NonEmpty as NE {- ************************************************************************ * * \subsubsection{Expressions} * * ************************************************************************ -} rnExprs :: [LHsExpr GhcPs] -> RnM ([LHsExpr GhcRn], FreeVars) rnExprs ls = rnExprs' ls emptyUniqSet where rnExprs' [] acc = return ([], acc) rnExprs' (expr:exprs) acc = do { (expr', fvExpr) <- rnLExpr expr -- Now we do a "seq" on the free vars because typically it's small -- or empty, especially in very long lists of constants ; let acc' = acc `plusFV` fvExpr ; (exprs', fvExprs) <- acc' `seq` rnExprs' exprs acc' ; return (expr':exprs', fvExprs) } -- Variables. We look up the variable and return the resulting name. rnLExpr :: LHsExpr GhcPs -> RnM (LHsExpr GhcRn, FreeVars) rnLExpr = wrapLocFstM rnExpr rnExpr :: HsExpr GhcPs -> RnM (HsExpr GhcRn, FreeVars) finishHsVar :: Located Name -> RnM (HsExpr GhcRn, FreeVars) -- Separated from rnExpr because it's also used -- when renaming infix expressions finishHsVar (L l name) = do { this_mod <- getModule ; when (nameIsLocalOrFrom this_mod name) $ checkThLocalName name ; return (HsVar noExtField (L l name), unitFV name) } rnUnboundVar :: RdrName -> RnM (HsExpr GhcRn, FreeVars) rnUnboundVar v = do { if isUnqual v then -- Treat this as a "hole" -- Do not fail right now; instead, return HsUnboundVar -- and let the type checker report the error return (HsUnboundVar noExtField (rdrNameOcc v), emptyFVs) else -- Fail immediately (qualified name) do { n <- reportUnboundName v ; return (HsVar noExtField (noLoc n), emptyFVs) } } rnExpr (HsVar _ (L l v)) = do { opt_DuplicateRecordFields <- xoptM LangExt.DuplicateRecordFields ; mb_name <- lookupOccRn_overloaded opt_DuplicateRecordFields v ; dflags <- getDynFlags ; case mb_name of { Nothing -> rnUnboundVar v ; Just (Left name) | name == nilDataConName -- Treat [] as an ExplicitList, so that -- OverloadedLists works correctly -- Note [Empty lists] in GHC.Hs.Expr , xopt LangExt.OverloadedLists dflags -> rnExpr (ExplicitList noExtField Nothing []) | otherwise -> finishHsVar (L l name) ; Just (Right [s]) -> return ( HsRecFld noExtField (Unambiguous s (L l v) ), unitFV s) ; Just (Right fs@(_:_:_)) -> return ( HsRecFld noExtField (Ambiguous noExtField (L l v)) , mkFVs fs); Just (Right []) -> panic "runExpr/HsVar" } } rnExpr (HsIPVar x v) = return (HsIPVar x v, emptyFVs) rnExpr (HsUnboundVar x v) = return (HsUnboundVar x v, emptyFVs) rnExpr (HsOverLabel x _ v) = do { rebindable_on <- xoptM LangExt.RebindableSyntax ; if rebindable_on then do { fromLabel <- lookupOccRn (mkVarUnqual (fsLit "fromLabel")) ; return (HsOverLabel x (Just fromLabel) v, unitFV fromLabel) } else return (HsOverLabel x Nothing v, emptyFVs) } rnExpr (HsLit x lit@(HsString src s)) = do { opt_OverloadedStrings <- xoptM LangExt.OverloadedStrings ; if opt_OverloadedStrings then rnExpr (HsOverLit x (mkHsIsString src s)) else do { ; rnLit lit ; return (HsLit x (convertLit lit), emptyFVs) } } rnExpr (HsLit x lit) = do { rnLit lit ; return (HsLit x(convertLit lit), emptyFVs) } rnExpr (HsOverLit x lit) = do { ((lit', mb_neg), fvs) <- rnOverLit lit -- See Note [Negative zero] ; case mb_neg of Nothing -> return (HsOverLit x lit', fvs) Just neg -> return (HsApp x (noLoc neg) (noLoc (HsOverLit x lit')) , fvs ) } rnExpr (HsApp x fun arg) = do { (fun',fvFun) <- rnLExpr fun ; (arg',fvArg) <- rnLExpr arg ; return (HsApp x fun' arg', fvFun `plusFV` fvArg) } rnExpr (HsAppType x fun arg) = do { type_app <- xoptM LangExt.TypeApplications ; unless type_app $ addErr $ typeAppErr "type" $ hswc_body arg ; (fun',fvFun) <- rnLExpr fun ; (arg',fvArg) <- rnHsWcType HsTypeCtx arg ; return (HsAppType x fun' arg', fvFun `plusFV` fvArg) } rnExpr (OpApp _ e1 op e2) = do { (e1', fv_e1) <- rnLExpr e1 ; (e2', fv_e2) <- rnLExpr e2 ; (op', fv_op) <- rnLExpr op -- Deal with fixity -- When renaming code synthesised from "deriving" declarations -- we used to avoid fixity stuff, but we can't easily tell any -- more, so I've removed the test. Adding HsPars in TcGenDeriv -- should prevent bad things happening. ; fixity <- case op' of L _ (HsVar _ (L _ n)) -> lookupFixityRn n L _ (HsRecFld _ f) -> lookupFieldFixityRn f _ -> return (Fixity NoSourceText minPrecedence InfixL) -- c.f. lookupFixity for unbound ; final_e <- mkOpAppRn e1' op' fixity e2' ; return (final_e, fv_e1 `plusFV` fv_op `plusFV` fv_e2) } rnExpr (NegApp _ e _) = do { (e', fv_e) <- rnLExpr e ; (neg_name, fv_neg) <- lookupSyntax negateName ; final_e <- mkNegAppRn e' neg_name ; return (final_e, fv_e `plusFV` fv_neg) } ------------------------------------------ -- Template Haskell extensions rnExpr e@(HsBracket _ br_body) = rnBracket e br_body rnExpr (HsSpliceE _ splice) = rnSpliceExpr splice --------------------------------------------- -- Sections -- See Note [Parsing sections] in Parser.y rnExpr (HsPar x (L loc (section@(SectionL {})))) = do { (section', fvs) <- rnSection section ; return (HsPar x (L loc section'), fvs) } rnExpr (HsPar x (L loc (section@(SectionR {})))) = do { (section', fvs) <- rnSection section ; return (HsPar x (L loc section'), fvs) } rnExpr (HsPar x e) = do { (e', fvs_e) <- rnLExpr e ; return (HsPar x e', fvs_e) } rnExpr expr@(SectionL {}) = do { addErr (sectionErr expr); rnSection expr } rnExpr expr@(SectionR {}) = do { addErr (sectionErr expr); rnSection expr } --------------------------------------------- rnExpr (HsPragE x prag expr) = do { (expr', fvs_expr) <- rnLExpr expr ; return (HsPragE x (rn_prag prag) expr', fvs_expr) } where rn_prag :: HsPragE GhcPs -> HsPragE GhcRn rn_prag (HsPragSCC x1 src ann) = HsPragSCC x1 src ann rn_prag (HsPragCore x1 src lbl) = HsPragCore x1 src lbl rn_prag (HsPragTick x1 src info srcInfo) = HsPragTick x1 src info srcInfo rn_prag (XHsPragE x) = noExtCon x rnExpr (HsLam x matches) = do { (matches', fvMatch) <- rnMatchGroup LambdaExpr rnLExpr matches ; return (HsLam x matches', fvMatch) } rnExpr (HsLamCase x matches) = do { (matches', fvs_ms) <- rnMatchGroup CaseAlt rnLExpr matches ; return (HsLamCase x matches', fvs_ms) } rnExpr (HsCase x expr matches) = do { (new_expr, e_fvs) <- rnLExpr expr ; (new_matches, ms_fvs) <- rnMatchGroup CaseAlt rnLExpr matches ; return (HsCase x new_expr new_matches, e_fvs `plusFV` ms_fvs) } rnExpr (HsLet x (L l binds) expr) = rnLocalBindsAndThen binds $ \binds' _ -> do { (expr',fvExpr) <- rnLExpr expr ; return (HsLet x (L l binds') expr', fvExpr) } rnExpr (HsDo x do_or_lc (L l stmts)) = do { ((stmts', _), fvs) <- rnStmtsWithPostProcessing do_or_lc rnLExpr postProcessStmtsForApplicativeDo stmts (\ _ -> return ((), emptyFVs)) ; return ( HsDo x do_or_lc (L l stmts'), fvs ) } rnExpr (ExplicitList x _ exps) = do { opt_OverloadedLists <- xoptM LangExt.OverloadedLists ; (exps', fvs) <- rnExprs exps ; if opt_OverloadedLists then do { ; (from_list_n_name, fvs') <- lookupSyntax fromListNName ; return (ExplicitList x (Just from_list_n_name) exps' , fvs `plusFV` fvs') } else return (ExplicitList x Nothing exps', fvs) } rnExpr (ExplicitTuple x tup_args boxity) = do { checkTupleSection tup_args ; checkTupSize (length tup_args) ; (tup_args', fvs) <- mapAndUnzipM rnTupArg tup_args ; return (ExplicitTuple x tup_args' boxity, plusFVs fvs) } where rnTupArg (L l (Present x e)) = do { (e',fvs) <- rnLExpr e ; return (L l (Present x e'), fvs) } rnTupArg (L l (Missing _)) = return (L l (Missing noExtField) , emptyFVs) rnTupArg (L _ (XTupArg nec)) = noExtCon nec rnExpr (ExplicitSum x alt arity expr) = do { (expr', fvs) <- rnLExpr expr ; return (ExplicitSum x alt arity expr', fvs) } rnExpr (RecordCon { rcon_con_name = con_id , rcon_flds = rec_binds@(HsRecFields { rec_dotdot = dd }) }) = do { con_lname@(L _ con_name) <- lookupLocatedOccRn con_id ; (flds, fvs) <- rnHsRecFields (HsRecFieldCon con_name) mk_hs_var rec_binds ; (flds', fvss) <- mapAndUnzipM rn_field flds ; let rec_binds' = HsRecFields { rec_flds = flds', rec_dotdot = dd } ; return (RecordCon { rcon_ext = noExtField , rcon_con_name = con_lname, rcon_flds = rec_binds' } , fvs `plusFV` plusFVs fvss `addOneFV` con_name) } where mk_hs_var l n = HsVar noExtField (L l n) rn_field (L l fld) = do { (arg', fvs) <- rnLExpr (hsRecFieldArg fld) ; return (L l (fld { hsRecFieldArg = arg' }), fvs) } rnExpr (RecordUpd { rupd_expr = expr, rupd_flds = rbinds }) = do { (expr', fvExpr) <- rnLExpr expr ; (rbinds', fvRbinds) <- rnHsRecUpdFields rbinds ; return (RecordUpd { rupd_ext = noExtField, rupd_expr = expr' , rupd_flds = rbinds' } , fvExpr `plusFV` fvRbinds) } rnExpr (ExprWithTySig _ expr pty) = do { (pty', fvTy) <- rnHsSigWcType BindUnlessForall ExprWithTySigCtx pty ; (expr', fvExpr) <- bindSigTyVarsFV (hsWcScopedTvs pty') $ rnLExpr expr ; return (ExprWithTySig noExtField expr' pty', fvExpr `plusFV` fvTy) } rnExpr (HsIf might_use_rebindable_syntax _ p b1 b2) = do { (p', fvP) <- rnLExpr p ; (b1', fvB1) <- rnLExpr b1 ; (b2', fvB2) <- rnLExpr b2 ; (mb_ite, fvITE) <- lookupIfThenElse might_use_rebindable_syntax ; return (HsIf noExtField mb_ite p' b1' b2', plusFVs [fvITE, fvP, fvB1, fvB2]) } rnExpr (HsMultiIf x alts) = do { (alts', fvs) <- mapFvRn (rnGRHS IfAlt rnLExpr) alts -- ; return (HsMultiIf ty alts', fvs) } ; return (HsMultiIf x alts', fvs) } rnExpr (ArithSeq x _ seq) = do { opt_OverloadedLists <- xoptM LangExt.OverloadedLists ; (new_seq, fvs) <- rnArithSeq seq ; if opt_OverloadedLists then do { ; (from_list_name, fvs') <- lookupSyntax fromListName ; return (ArithSeq x (Just from_list_name) new_seq , fvs `plusFV` fvs') } else return (ArithSeq x Nothing new_seq, fvs) } {- ************************************************************************ * * Static values * * ************************************************************************ For the static form we check that it is not used in splices. We also collect the free variables of the term which come from this module. See Note [Grand plan for static forms] in StaticPtrTable. -} rnExpr e@(HsStatic _ expr) = do -- Normally, you wouldn't be able to construct a static expression without -- first enabling -XStaticPointers in the first place, since that extension -- is what makes the parser treat `static` as a keyword. But this is not a -- sufficient safeguard, as one can construct static expressions by another -- mechanism: Template Haskell (see #14204). To ensure that GHC is -- absolutely prepared to cope with static forms, we check for -- -XStaticPointers here as well. unlessXOptM LangExt.StaticPointers $ addErr $ hang (text "Illegal static expression:" <+> ppr e) 2 (text "Use StaticPointers to enable this extension") (expr',fvExpr) <- rnLExpr expr stage <- getStage case stage of Splice _ -> addErr $ sep [ text "static forms cannot be used in splices:" , nest 2 $ ppr e ] _ -> return () mod <- getModule let fvExpr' = filterNameSet (nameIsLocalOrFrom mod) fvExpr return (HsStatic fvExpr' expr', fvExpr) {- ************************************************************************ * * Arrow notation * * ************************************************************************ -} rnExpr (HsProc x pat body) = newArrowScope $ rnPat ProcExpr pat $ \ pat' -> do { (body',fvBody) <- rnCmdTop body ; return (HsProc x pat' body', fvBody) } rnExpr other = pprPanic "rnExpr: unexpected expression" (ppr other) -- HsWrap ---------------------- -- See Note [Parsing sections] in Parser.y rnSection :: HsExpr GhcPs -> RnM (HsExpr GhcRn, FreeVars) rnSection section@(SectionR x op expr) = do { (op', fvs_op) <- rnLExpr op ; (expr', fvs_expr) <- rnLExpr expr ; checkSectionPrec InfixR section op' expr' ; return (SectionR x op' expr', fvs_op `plusFV` fvs_expr) } rnSection section@(SectionL x expr op) = do { (expr', fvs_expr) <- rnLExpr expr ; (op', fvs_op) <- rnLExpr op ; checkSectionPrec InfixL section op' expr' ; return (SectionL x expr' op', fvs_op `plusFV` fvs_expr) } rnSection other = pprPanic "rnSection" (ppr other) {- ************************************************************************ * * Arrow commands * * ************************************************************************ -} rnCmdArgs :: [LHsCmdTop GhcPs] -> RnM ([LHsCmdTop GhcRn], FreeVars) rnCmdArgs [] = return ([], emptyFVs) rnCmdArgs (arg:args) = do { (arg',fvArg) <- rnCmdTop arg ; (args',fvArgs) <- rnCmdArgs args ; return (arg':args', fvArg `plusFV` fvArgs) } rnCmdTop :: LHsCmdTop GhcPs -> RnM (LHsCmdTop GhcRn, FreeVars) rnCmdTop = wrapLocFstM rnCmdTop' where rnCmdTop' (HsCmdTop _ cmd) = do { (cmd', fvCmd) <- rnLCmd cmd ; let cmd_names = [arrAName, composeAName, firstAName] ++ nameSetElemsStable (methodNamesCmd (unLoc cmd')) -- Generate the rebindable syntax for the monad ; (cmd_names', cmd_fvs) <- lookupSyntaxNames cmd_names ; return (HsCmdTop (cmd_names `zip` cmd_names') cmd', fvCmd `plusFV` cmd_fvs) } rnCmdTop' (XCmdTop nec) = noExtCon nec rnLCmd :: LHsCmd GhcPs -> RnM (LHsCmd GhcRn, FreeVars) rnLCmd = wrapLocFstM rnCmd rnCmd :: HsCmd GhcPs -> RnM (HsCmd GhcRn, FreeVars) rnCmd (HsCmdArrApp x arrow arg ho rtl) = do { (arrow',fvArrow) <- select_arrow_scope (rnLExpr arrow) ; (arg',fvArg) <- rnLExpr arg ; return (HsCmdArrApp x arrow' arg' ho rtl, fvArrow `plusFV` fvArg) } where select_arrow_scope tc = case ho of HsHigherOrderApp -> tc HsFirstOrderApp -> escapeArrowScope tc -- See Note [Escaping the arrow scope] in TcRnTypes -- Before renaming 'arrow', use the environment of the enclosing -- proc for the (-<) case. -- Local bindings, inside the enclosing proc, are not in scope -- inside 'arrow'. In the higher-order case (-<<), they are. -- infix form rnCmd (HsCmdArrForm _ op _ (Just _) [arg1, arg2]) = do { (op',fv_op) <- escapeArrowScope (rnLExpr op) ; let L _ (HsVar _ (L _ op_name)) = op' ; (arg1',fv_arg1) <- rnCmdTop arg1 ; (arg2',fv_arg2) <- rnCmdTop arg2 -- Deal with fixity ; fixity <- lookupFixityRn op_name ; final_e <- mkOpFormRn arg1' op' fixity arg2' ; return (final_e, fv_arg1 `plusFV` fv_op `plusFV` fv_arg2) } rnCmd (HsCmdArrForm x op f fixity cmds) = do { (op',fvOp) <- escapeArrowScope (rnLExpr op) ; (cmds',fvCmds) <- rnCmdArgs cmds ; return (HsCmdArrForm x op' f fixity cmds', fvOp `plusFV` fvCmds) } rnCmd (HsCmdApp x fun arg) = do { (fun',fvFun) <- rnLCmd fun ; (arg',fvArg) <- rnLExpr arg ; return (HsCmdApp x fun' arg', fvFun `plusFV` fvArg) } rnCmd (HsCmdLam x matches) = do { (matches', fvMatch) <- rnMatchGroup LambdaExpr rnLCmd matches ; return (HsCmdLam x matches', fvMatch) } rnCmd (HsCmdPar x e) = do { (e', fvs_e) <- rnLCmd e ; return (HsCmdPar x e', fvs_e) } rnCmd (HsCmdCase x expr matches) = do { (new_expr, e_fvs) <- rnLExpr expr ; (new_matches, ms_fvs) <- rnMatchGroup CaseAlt rnLCmd matches ; return (HsCmdCase x new_expr new_matches, e_fvs `plusFV` ms_fvs) } rnCmd (HsCmdIf x _ p b1 b2) = do { (p', fvP) <- rnLExpr p ; (b1', fvB1) <- rnLCmd b1 ; (b2', fvB2) <- rnLCmd b2 ; (mb_ite, fvITE) <- lookupIfThenElse True ; return (HsCmdIf x mb_ite p' b1' b2', plusFVs [fvITE, fvP, fvB1, fvB2])} rnCmd (HsCmdLet x (L l binds) cmd) = rnLocalBindsAndThen binds $ \ binds' _ -> do { (cmd',fvExpr) <- rnLCmd cmd ; return (HsCmdLet x (L l binds') cmd', fvExpr) } rnCmd (HsCmdDo x (L l stmts)) = do { ((stmts', _), fvs) <- rnStmts ArrowExpr rnLCmd stmts (\ _ -> return ((), emptyFVs)) ; return ( HsCmdDo x (L l stmts'), fvs ) } rnCmd (XCmd nec) = noExtCon nec --------------------------------------------------- type CmdNeeds = FreeVars -- Only inhabitants are -- appAName, choiceAName, loopAName -- find what methods the Cmd needs (loop, choice, apply) methodNamesLCmd :: LHsCmd GhcRn -> CmdNeeds methodNamesLCmd = methodNamesCmd . unLoc methodNamesCmd :: HsCmd GhcRn -> CmdNeeds methodNamesCmd (HsCmdArrApp _ _arrow _arg HsFirstOrderApp _rtl) = emptyFVs methodNamesCmd (HsCmdArrApp _ _arrow _arg HsHigherOrderApp _rtl) = unitFV appAName methodNamesCmd (HsCmdArrForm {}) = emptyFVs methodNamesCmd (HsCmdPar _ c) = methodNamesLCmd c methodNamesCmd (HsCmdIf _ _ _ c1 c2) = methodNamesLCmd c1 `plusFV` methodNamesLCmd c2 `addOneFV` choiceAName methodNamesCmd (HsCmdLet _ _ c) = methodNamesLCmd c methodNamesCmd (HsCmdDo _ (L _ stmts)) = methodNamesStmts stmts methodNamesCmd (HsCmdApp _ c _) = methodNamesLCmd c methodNamesCmd (HsCmdLam _ match) = methodNamesMatch match methodNamesCmd (HsCmdCase _ _ matches) = methodNamesMatch matches `addOneFV` choiceAName methodNamesCmd (XCmd nec) = noExtCon nec --methodNamesCmd _ = emptyFVs -- Other forms can't occur in commands, but it's not convenient -- to error here so we just do what's convenient. -- The type checker will complain later --------------------------------------------------- methodNamesMatch :: MatchGroup GhcRn (LHsCmd GhcRn) -> FreeVars methodNamesMatch (MG { mg_alts = L _ ms }) = plusFVs (map do_one ms) where do_one (L _ (Match { m_grhss = grhss })) = methodNamesGRHSs grhss do_one (L _ (XMatch nec)) = noExtCon nec methodNamesMatch (XMatchGroup nec) = noExtCon nec ------------------------------------------------- -- gaw 2004 methodNamesGRHSs :: GRHSs GhcRn (LHsCmd GhcRn) -> FreeVars methodNamesGRHSs (GRHSs _ grhss _) = plusFVs (map methodNamesGRHS grhss) methodNamesGRHSs (XGRHSs nec) = noExtCon nec ------------------------------------------------- methodNamesGRHS :: Located (GRHS GhcRn (LHsCmd GhcRn)) -> CmdNeeds methodNamesGRHS (L _ (GRHS _ _ rhs)) = methodNamesLCmd rhs methodNamesGRHS (L _ (XGRHS nec)) = noExtCon nec --------------------------------------------------- methodNamesStmts :: [Located (StmtLR GhcRn GhcRn (LHsCmd GhcRn))] -> FreeVars methodNamesStmts stmts = plusFVs (map methodNamesLStmt stmts) --------------------------------------------------- methodNamesLStmt :: Located (StmtLR GhcRn GhcRn (LHsCmd GhcRn)) -> FreeVars methodNamesLStmt = methodNamesStmt . unLoc methodNamesStmt :: StmtLR GhcRn GhcRn (LHsCmd GhcRn) -> FreeVars methodNamesStmt (LastStmt _ cmd _ _) = methodNamesLCmd cmd methodNamesStmt (BodyStmt _ cmd _ _) = methodNamesLCmd cmd methodNamesStmt (BindStmt _ _ cmd _ _) = methodNamesLCmd cmd methodNamesStmt (RecStmt { recS_stmts = stmts }) = methodNamesStmts stmts `addOneFV` loopAName methodNamesStmt (LetStmt {}) = emptyFVs methodNamesStmt (ParStmt {}) = emptyFVs methodNamesStmt (TransStmt {}) = emptyFVs methodNamesStmt ApplicativeStmt{} = emptyFVs -- ParStmt and TransStmt can't occur in commands, but it's not -- convenient to error here so we just do what's convenient methodNamesStmt (XStmtLR nec) = noExtCon nec {- ************************************************************************ * * Arithmetic sequences * * ************************************************************************ -} rnArithSeq :: ArithSeqInfo GhcPs -> RnM (ArithSeqInfo GhcRn, FreeVars) rnArithSeq (From expr) = do { (expr', fvExpr) <- rnLExpr expr ; return (From expr', fvExpr) } rnArithSeq (FromThen expr1 expr2) = do { (expr1', fvExpr1) <- rnLExpr expr1 ; (expr2', fvExpr2) <- rnLExpr expr2 ; return (FromThen expr1' expr2', fvExpr1 `plusFV` fvExpr2) } rnArithSeq (FromTo expr1 expr2) = do { (expr1', fvExpr1) <- rnLExpr expr1 ; (expr2', fvExpr2) <- rnLExpr expr2 ; return (FromTo expr1' expr2', fvExpr1 `plusFV` fvExpr2) } rnArithSeq (FromThenTo expr1 expr2 expr3) = do { (expr1', fvExpr1) <- rnLExpr expr1 ; (expr2', fvExpr2) <- rnLExpr expr2 ; (expr3', fvExpr3) <- rnLExpr expr3 ; return (FromThenTo expr1' expr2' expr3', plusFVs [fvExpr1, fvExpr2, fvExpr3]) } {- ************************************************************************ * * \subsubsection{@Stmt@s: in @do@ expressions} * * ************************************************************************ -} {- Note [Deterministic ApplicativeDo and RecursiveDo desugaring] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Both ApplicativeDo and RecursiveDo need to create tuples not present in the source text. For ApplicativeDo we create: (a,b,c) <- (\c b a -> (a,b,c)) <$> For RecursiveDo we create: mfix (\ ~(a,b,c) -> do ...; return (a',b',c')) The order of the components in those tuples needs to be stable across recompilations, otherwise they can get optimized differently and we end up with incompatible binaries. To get a stable order we use nameSetElemsStable. See Note [Deterministic UniqFM] to learn more about nondeterminism. -} -- | Rename some Stmts rnStmts :: Outputable (body GhcPs) => HsStmtContext GhcRn -> (Located (body GhcPs) -> RnM (Located (body GhcRn), FreeVars)) -- ^ How to rename the body of each statement (e.g. rnLExpr) -> [LStmt GhcPs (Located (body GhcPs))] -- ^ Statements -> ([Name] -> RnM (thing, FreeVars)) -- ^ if these statements scope over something, this renames it -- and returns the result. -> RnM (([LStmt GhcRn (Located (body GhcRn))], thing), FreeVars) rnStmts ctxt rnBody = rnStmtsWithPostProcessing ctxt rnBody noPostProcessStmts -- | like 'rnStmts' but applies a post-processing step to the renamed Stmts rnStmtsWithPostProcessing :: Outputable (body GhcPs) => HsStmtContext GhcRn -> (Located (body GhcPs) -> RnM (Located (body GhcRn), FreeVars)) -- ^ How to rename the body of each statement (e.g. rnLExpr) -> (HsStmtContext GhcRn -> [(LStmt GhcRn (Located (body GhcRn)), FreeVars)] -> RnM ([LStmt GhcRn (Located (body GhcRn))], FreeVars)) -- ^ postprocess the statements -> [LStmt GhcPs (Located (body GhcPs))] -- ^ Statements -> ([Name] -> RnM (thing, FreeVars)) -- ^ if these statements scope over something, this renames it -- and returns the result. -> RnM (([LStmt GhcRn (Located (body GhcRn))], thing), FreeVars) rnStmtsWithPostProcessing ctxt rnBody ppStmts stmts thing_inside = do { ((stmts', thing), fvs) <- rnStmtsWithFreeVars ctxt rnBody stmts thing_inside ; (pp_stmts, fvs') <- ppStmts ctxt stmts' ; return ((pp_stmts, thing), fvs `plusFV` fvs') } -- | maybe rearrange statements according to the ApplicativeDo transformation postProcessStmtsForApplicativeDo :: HsStmtContext GhcRn -> [(ExprLStmt GhcRn, FreeVars)] -> RnM ([ExprLStmt GhcRn], FreeVars) postProcessStmtsForApplicativeDo ctxt stmts = do { -- rearrange the statements using ApplicativeStmt if -- -XApplicativeDo is on. Also strip out the FreeVars attached -- to each Stmt body. ado_is_on <- xoptM LangExt.ApplicativeDo ; let is_do_expr | DoExpr <- ctxt = True | otherwise = False -- don't apply the transformation inside TH brackets, because -- DsMeta does not handle ApplicativeDo. ; in_th_bracket <- isBrackStage <$> getStage ; if ado_is_on && is_do_expr && not in_th_bracket then do { traceRn "ppsfa" (ppr stmts) ; rearrangeForApplicativeDo ctxt stmts } else noPostProcessStmts ctxt stmts } -- | strip the FreeVars annotations from statements noPostProcessStmts :: HsStmtContext GhcRn -> [(LStmt GhcRn (Located (body GhcRn)), FreeVars)] -> RnM ([LStmt GhcRn (Located (body GhcRn))], FreeVars) noPostProcessStmts _ stmts = return (map fst stmts, emptyNameSet) rnStmtsWithFreeVars :: Outputable (body GhcPs) => HsStmtContext GhcRn -> (Located (body GhcPs) -> RnM (Located (body GhcRn), FreeVars)) -> [LStmt GhcPs (Located (body GhcPs))] -> ([Name] -> RnM (thing, FreeVars)) -> RnM ( ([(LStmt GhcRn (Located (body GhcRn)), FreeVars)], thing) , FreeVars) -- Each Stmt body is annotated with its FreeVars, so that -- we can rearrange statements for ApplicativeDo. -- -- Variables bound by the Stmts, and mentioned in thing_inside, -- do not appear in the result FreeVars rnStmtsWithFreeVars ctxt _ [] thing_inside = do { checkEmptyStmts ctxt ; (thing, fvs) <- thing_inside [] ; return (([], thing), fvs) } rnStmtsWithFreeVars MDoExpr rnBody stmts thing_inside -- Deal with mdo = -- Behave like do { rec { ...all but last... }; last } do { ((stmts1, (stmts2, thing)), fvs) <- rnStmt MDoExpr rnBody (noLoc $ mkRecStmt all_but_last) $ \ _ -> do { last_stmt' <- checkLastStmt MDoExpr last_stmt ; rnStmt MDoExpr rnBody last_stmt' thing_inside } ; return (((stmts1 ++ stmts2), thing), fvs) } where Just (all_but_last, last_stmt) = snocView stmts rnStmtsWithFreeVars ctxt rnBody (lstmt@(L loc _) : lstmts) thing_inside | null lstmts = setSrcSpan loc $ do { lstmt' <- checkLastStmt ctxt lstmt ; rnStmt ctxt rnBody lstmt' thing_inside } | otherwise = do { ((stmts1, (stmts2, thing)), fvs) <- setSrcSpan loc $ do { checkStmt ctxt lstmt ; rnStmt ctxt rnBody lstmt $ \ bndrs1 -> rnStmtsWithFreeVars ctxt rnBody lstmts $ \ bndrs2 -> thing_inside (bndrs1 ++ bndrs2) } ; return (((stmts1 ++ stmts2), thing), fvs) } ---------------------- {- Note [Failing pattern matches in Stmts] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Many things desugar to HsStmts including monadic things like `do` and `mdo` statements, pattern guards, and list comprehensions (see 'HsStmtContext' for an exhaustive list). How we deal with pattern match failure is context-dependent. * In the case of list comprehensions and pattern guards we don't need any 'fail' function; the desugarer ignores the fail function field of 'BindStmt' entirely. * In the case of monadic contexts (e.g. monad comprehensions, do, and mdo expressions) we want pattern match failure to be desugared to the appropriate 'fail' function (either that of Monad or MonadFail, depending on whether -XMonadFailDesugaring is enabled.) At one point we failed to make this distinction, leading to #11216. -} rnStmt :: Outputable (body GhcPs) => HsStmtContext GhcRn -> (Located (body GhcPs) -> RnM (Located (body GhcRn), FreeVars)) -- ^ How to rename the body of the statement -> LStmt GhcPs (Located (body GhcPs)) -- ^ The statement -> ([Name] -> RnM (thing, FreeVars)) -- ^ Rename the stuff that this statement scopes over -> RnM ( ([(LStmt GhcRn (Located (body GhcRn)), FreeVars)], thing) , FreeVars) -- Variables bound by the Stmt, and mentioned in thing_inside, -- do not appear in the result FreeVars rnStmt ctxt rnBody (L loc (LastStmt _ body noret _)) thing_inside = do { (body', fv_expr) <- rnBody body ; (ret_op, fvs1) <- if isMonadCompContext ctxt then lookupStmtName ctxt returnMName else return (noSyntaxExpr, emptyFVs) -- The 'return' in a LastStmt is used only -- for MonadComp; and we don't want to report -- "non in scope: return" in other cases -- #15607 ; (thing, fvs3) <- thing_inside [] ; return (([(L loc (LastStmt noExtField body' noret ret_op), fv_expr)] , thing), fv_expr `plusFV` fvs1 `plusFV` fvs3) } rnStmt ctxt rnBody (L loc (BodyStmt _ body _ _)) thing_inside = do { (body', fv_expr) <- rnBody body ; (then_op, fvs1) <- lookupStmtName ctxt thenMName ; (guard_op, fvs2) <- if isComprehensionContext ctxt then lookupStmtName ctxt guardMName else return (noSyntaxExpr, emptyFVs) -- Only list/monad comprehensions use 'guard' -- Also for sub-stmts of same eg [ e | x<-xs, gd | blah ] -- Here "gd" is a guard ; (thing, fvs3) <- thing_inside [] ; return ( ([(L loc (BodyStmt noExtField body' then_op guard_op), fv_expr)] , thing), fv_expr `plusFV` fvs1 `plusFV` fvs2 `plusFV` fvs3) } rnStmt ctxt rnBody (L loc (BindStmt _ pat body _ _)) thing_inside = do { (body', fv_expr) <- rnBody body -- The binders do not scope over the expression ; (bind_op, fvs1) <- lookupStmtName ctxt bindMName ; (fail_op, fvs2) <- monadFailOp pat ctxt ; rnPat (StmtCtxt ctxt) pat $ \ pat' -> do { (thing, fvs3) <- thing_inside (collectPatBinders pat') ; return (( [( L loc (BindStmt noExtField pat' body' bind_op fail_op) , fv_expr )] , thing), fv_expr `plusFV` fvs1 `plusFV` fvs2 `plusFV` fvs3) }} -- fv_expr shouldn't really be filtered by the rnPatsAndThen -- but it does not matter because the names are unique rnStmt _ _ (L loc (LetStmt _ (L l binds))) thing_inside = do { rnLocalBindsAndThen binds $ \binds' bind_fvs -> do { (thing, fvs) <- thing_inside (collectLocalBinders binds') ; return ( ([(L loc (LetStmt noExtField (L l binds')), bind_fvs)], thing) , fvs) } } rnStmt ctxt rnBody (L loc (RecStmt { recS_stmts = rec_stmts })) thing_inside = do { (return_op, fvs1) <- lookupStmtName ctxt returnMName ; (mfix_op, fvs2) <- lookupStmtName ctxt mfixName ; (bind_op, fvs3) <- lookupStmtName ctxt bindMName ; let empty_rec_stmt = emptyRecStmtName { recS_ret_fn = return_op , recS_mfix_fn = mfix_op , recS_bind_fn = bind_op } -- Step1: Bring all the binders of the mdo into scope -- (Remember that this also removes the binders from the -- finally-returned free-vars.) -- And rename each individual stmt, making a -- singleton segment. At this stage the FwdRefs field -- isn't finished: it's empty for all except a BindStmt -- for which it's the fwd refs within the bind itself -- (This set may not be empty, because we're in a recursive -- context.) ; rnRecStmtsAndThen rnBody rec_stmts $ \ segs -> do { let bndrs = nameSetElemsStable $ foldr (unionNameSet . (\(ds,_,_,_) -> ds)) emptyNameSet segs -- See Note [Deterministic ApplicativeDo and RecursiveDo desugaring] ; (thing, fvs_later) <- thing_inside bndrs ; let (rec_stmts', fvs) = segmentRecStmts loc ctxt empty_rec_stmt segs fvs_later -- We aren't going to try to group RecStmts with -- ApplicativeDo, so attaching empty FVs is fine. ; return ( ((zip rec_stmts' (repeat emptyNameSet)), thing) , fvs `plusFV` fvs1 `plusFV` fvs2 `plusFV` fvs3) } } rnStmt ctxt _ (L loc (ParStmt _ segs _ _)) thing_inside = do { (mzip_op, fvs1) <- lookupStmtNamePoly ctxt mzipName ; (bind_op, fvs2) <- lookupStmtName ctxt bindMName ; (return_op, fvs3) <- lookupStmtName ctxt returnMName ; ((segs', thing), fvs4) <- rnParallelStmts (ParStmtCtxt ctxt) return_op segs thing_inside ; return (([(L loc (ParStmt noExtField segs' mzip_op bind_op), fvs4)], thing) , fvs1 `plusFV` fvs2 `plusFV` fvs3 `plusFV` fvs4) } rnStmt ctxt _ (L loc (TransStmt { trS_stmts = stmts, trS_by = by, trS_form = form , trS_using = using })) thing_inside = do { -- Rename the 'using' expression in the context before the transform is begun (using', fvs1) <- rnLExpr using -- Rename the stmts and the 'by' expression -- Keep track of the variables mentioned in the 'by' expression ; ((stmts', (by', used_bndrs, thing)), fvs2) <- rnStmts (TransStmtCtxt ctxt) rnLExpr stmts $ \ bndrs -> do { (by', fvs_by) <- mapMaybeFvRn rnLExpr by ; (thing, fvs_thing) <- thing_inside bndrs ; let fvs = fvs_by `plusFV` fvs_thing used_bndrs = filter (`elemNameSet` fvs) bndrs -- The paper (Fig 5) has a bug here; we must treat any free variable -- of the "thing inside", **or of the by-expression**, as used ; return ((by', used_bndrs, thing), fvs) } -- Lookup `return`, `(>>=)` and `liftM` for monad comprehensions ; (return_op, fvs3) <- lookupStmtName ctxt returnMName ; (bind_op, fvs4) <- lookupStmtName ctxt bindMName ; (fmap_op, fvs5) <- case form of ThenForm -> return (noExpr, emptyFVs) _ -> lookupStmtNamePoly ctxt fmapName ; let all_fvs = fvs1 `plusFV` fvs2 `plusFV` fvs3 `plusFV` fvs4 `plusFV` fvs5 bndr_map = used_bndrs `zip` used_bndrs -- See Note [TransStmt binder map] in GHC.Hs.Expr ; traceRn "rnStmt: implicitly rebound these used binders:" (ppr bndr_map) ; return (([(L loc (TransStmt { trS_ext = noExtField , trS_stmts = stmts', trS_bndrs = bndr_map , trS_by = by', trS_using = using', trS_form = form , trS_ret = return_op, trS_bind = bind_op , trS_fmap = fmap_op }), fvs2)], thing), all_fvs) } rnStmt _ _ (L _ ApplicativeStmt{}) _ = panic "rnStmt: ApplicativeStmt" rnStmt _ _ (L _ (XStmtLR nec)) _ = noExtCon nec rnParallelStmts :: forall thing. HsStmtContext GhcRn -> SyntaxExpr GhcRn -> [ParStmtBlock GhcPs GhcPs] -> ([Name] -> RnM (thing, FreeVars)) -> RnM (([ParStmtBlock GhcRn GhcRn], thing), FreeVars) -- Note [Renaming parallel Stmts] rnParallelStmts ctxt return_op segs thing_inside = do { orig_lcl_env <- getLocalRdrEnv ; rn_segs orig_lcl_env [] segs } where rn_segs :: LocalRdrEnv -> [Name] -> [ParStmtBlock GhcPs GhcPs] -> RnM (([ParStmtBlock GhcRn GhcRn], thing), FreeVars) rn_segs _ bndrs_so_far [] = do { let (bndrs', dups) = removeDups cmpByOcc bndrs_so_far ; mapM_ dupErr dups ; (thing, fvs) <- bindLocalNames bndrs' (thing_inside bndrs') ; return (([], thing), fvs) } rn_segs env bndrs_so_far (ParStmtBlock x stmts _ _ : segs) = do { ((stmts', (used_bndrs, segs', thing)), fvs) <- rnStmts ctxt rnLExpr stmts $ \ bndrs -> setLocalRdrEnv env $ do { ((segs', thing), fvs) <- rn_segs env (bndrs ++ bndrs_so_far) segs ; let used_bndrs = filter (`elemNameSet` fvs) bndrs ; return ((used_bndrs, segs', thing), fvs) } ; let seg' = ParStmtBlock x stmts' used_bndrs return_op ; return ((seg':segs', thing), fvs) } rn_segs _ _ (XParStmtBlock nec:_) = noExtCon nec cmpByOcc n1 n2 = nameOccName n1 `compare` nameOccName n2 dupErr vs = addErr (text "Duplicate binding in parallel list comprehension for:" <+> quotes (ppr (NE.head vs))) lookupStmtName :: HsStmtContext GhcRn -> Name -> RnM (SyntaxExpr GhcRn, FreeVars) -- Like lookupSyntax, but respects contexts lookupStmtName ctxt n | rebindableContext ctxt = lookupSyntax n | otherwise = return (mkRnSyntaxExpr n, emptyFVs) lookupStmtNamePoly :: HsStmtContext GhcRn -> Name -> RnM (HsExpr GhcRn, FreeVars) lookupStmtNamePoly ctxt name | rebindableContext ctxt = do { rebindable_on <- xoptM LangExt.RebindableSyntax ; if rebindable_on then do { fm <- lookupOccRn (nameRdrName name) ; return (HsVar noExtField (noLoc fm), unitFV fm) } else not_rebindable } | otherwise = not_rebindable where not_rebindable = return (HsVar noExtField (noLoc name), emptyFVs) -- | Is this a context where we respect RebindableSyntax? -- but ListComp are never rebindable -- Neither is ArrowExpr, which has its own desugarer in DsArrows rebindableContext :: HsStmtContext GhcRn -> Bool rebindableContext ctxt = case ctxt of ListComp -> False ArrowExpr -> False PatGuard {} -> False DoExpr -> True MDoExpr -> True MonadComp -> True GhciStmtCtxt -> True -- I suppose? ParStmtCtxt c -> rebindableContext c -- Look inside to TransStmtCtxt c -> rebindableContext c -- the parent context {- Note [Renaming parallel Stmts] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Renaming parallel statements is painful. Given, say [ a+c | a <- as, bs <- bss | c <- bs, a <- ds ] Note that (a) In order to report "Defined but not used" about 'bs', we must rename each group of Stmts with a thing_inside whose FreeVars include at least {a,c} (b) We want to report that 'a' is illegally bound in both branches (c) The 'bs' in the second group must obviously not be captured by the binding in the first group To satisfy (a) we nest the segements. To satisfy (b) we check for duplicates just before thing_inside. To satisfy (c) we reset the LocalRdrEnv each time. ************************************************************************ * * \subsubsection{mdo expressions} * * ************************************************************************ -} type FwdRefs = NameSet type Segment stmts = (Defs, Uses, -- May include defs FwdRefs, -- A subset of uses that are -- (a) used before they are bound in this segment, or -- (b) used here, and bound in subsequent segments stmts) -- Either Stmt or [Stmt] -- wrapper that does both the left- and right-hand sides rnRecStmtsAndThen :: Outputable (body GhcPs) => (Located (body GhcPs) -> RnM (Located (body GhcRn), FreeVars)) -> [LStmt GhcPs (Located (body GhcPs))] -- assumes that the FreeVars returned includes -- the FreeVars of the Segments -> ([Segment (LStmt GhcRn (Located (body GhcRn)))] -> RnM (a, FreeVars)) -> RnM (a, FreeVars) rnRecStmtsAndThen rnBody s cont = do { -- (A) Make the mini fixity env for all of the stmts fix_env <- makeMiniFixityEnv (collectRecStmtsFixities s) -- (B) Do the LHSes ; new_lhs_and_fv <- rn_rec_stmts_lhs fix_env s -- ...bring them and their fixities into scope ; let bound_names = collectLStmtsBinders (map fst new_lhs_and_fv) -- Fake uses of variables introduced implicitly (warning suppression, see #4404) rec_uses = lStmtsImplicits (map fst new_lhs_and_fv) implicit_uses = mkNameSet $ concatMap snd $ rec_uses ; bindLocalNamesFV bound_names $ addLocalFixities fix_env bound_names $ do -- (C) do the right-hand-sides and thing-inside { segs <- rn_rec_stmts rnBody bound_names new_lhs_and_fv ; (res, fvs) <- cont segs ; mapM_ (\(loc, ns) -> checkUnusedRecordWildcard loc fvs (Just ns)) rec_uses ; warnUnusedLocalBinds bound_names (fvs `unionNameSet` implicit_uses) ; return (res, fvs) }} -- get all the fixity decls in any Let stmt collectRecStmtsFixities :: [LStmtLR GhcPs GhcPs body] -> [LFixitySig GhcPs] collectRecStmtsFixities l = foldr (\ s -> \acc -> case s of (L _ (LetStmt _ (L _ (HsValBinds _ (ValBinds _ _ sigs))))) -> foldr (\ sig -> \ acc -> case sig of (L loc (FixSig _ s)) -> (L loc s) : acc _ -> acc) acc sigs _ -> acc) [] l -- left-hand sides rn_rec_stmt_lhs :: Outputable body => MiniFixityEnv -> LStmt GhcPs body -- rename LHS, and return its FVs -- Warning: we will only need the FreeVars below in the case of a BindStmt, -- so we don't bother to compute it accurately in the other cases -> RnM [(LStmtLR GhcRn GhcPs body, FreeVars)] rn_rec_stmt_lhs _ (L loc (BodyStmt _ body a b)) = return [(L loc (BodyStmt noExtField body a b), emptyFVs)] rn_rec_stmt_lhs _ (L loc (LastStmt _ body noret a)) = return [(L loc (LastStmt noExtField body noret a), emptyFVs)] rn_rec_stmt_lhs fix_env (L loc (BindStmt _ pat body a b)) = do -- should the ctxt be MDo instead? (pat', fv_pat) <- rnBindPat (localRecNameMaker fix_env) pat return [(L loc (BindStmt noExtField pat' body a b), fv_pat)] rn_rec_stmt_lhs _ (L _ (LetStmt _ (L _ binds@(HsIPBinds {})))) = failWith (badIpBinds (text "an mdo expression") binds) rn_rec_stmt_lhs fix_env (L loc (LetStmt _ (L l (HsValBinds x binds)))) = do (_bound_names, binds') <- rnLocalValBindsLHS fix_env binds return [(L loc (LetStmt noExtField (L l (HsValBinds x binds'))), -- Warning: this is bogus; see function invariant emptyFVs )] -- XXX Do we need to do something with the return and mfix names? rn_rec_stmt_lhs fix_env (L _ (RecStmt { recS_stmts = stmts })) -- Flatten Rec inside Rec = rn_rec_stmts_lhs fix_env stmts rn_rec_stmt_lhs _ stmt@(L _ (ParStmt {})) -- Syntactically illegal in mdo = pprPanic "rn_rec_stmt" (ppr stmt) rn_rec_stmt_lhs _ stmt@(L _ (TransStmt {})) -- Syntactically illegal in mdo = pprPanic "rn_rec_stmt" (ppr stmt) rn_rec_stmt_lhs _ stmt@(L _ (ApplicativeStmt {})) -- Shouldn't appear yet = pprPanic "rn_rec_stmt" (ppr stmt) rn_rec_stmt_lhs _ (L _ (LetStmt _ (L _ (EmptyLocalBinds _)))) = panic "rn_rec_stmt LetStmt EmptyLocalBinds" rn_rec_stmt_lhs _ (L _ (LetStmt _ (L _ (XHsLocalBindsLR nec)))) = noExtCon nec rn_rec_stmt_lhs _ (L _ (XStmtLR nec)) = noExtCon nec rn_rec_stmts_lhs :: Outputable body => MiniFixityEnv -> [LStmt GhcPs body] -> RnM [(LStmtLR GhcRn GhcPs body, FreeVars)] rn_rec_stmts_lhs fix_env stmts = do { ls <- concatMapM (rn_rec_stmt_lhs fix_env) stmts ; let boundNames = collectLStmtsBinders (map fst ls) -- First do error checking: we need to check for dups here because we -- don't bind all of the variables from the Stmt at once -- with bindLocatedLocals. ; checkDupNames boundNames ; return ls } -- right-hand-sides rn_rec_stmt :: (Outputable (body GhcPs)) => (Located (body GhcPs) -> RnM (Located (body GhcRn), FreeVars)) -> [Name] -> (LStmtLR GhcRn GhcPs (Located (body GhcPs)), FreeVars) -> RnM [Segment (LStmt GhcRn (Located (body GhcRn)))] -- Rename a Stmt that is inside a RecStmt (or mdo) -- Assumes all binders are already in scope -- Turns each stmt into a singleton Stmt rn_rec_stmt rnBody _ (L loc (LastStmt _ body noret _), _) = do { (body', fv_expr) <- rnBody body ; (ret_op, fvs1) <- lookupSyntax returnMName ; return [(emptyNameSet, fv_expr `plusFV` fvs1, emptyNameSet, L loc (LastStmt noExtField body' noret ret_op))] } rn_rec_stmt rnBody _ (L loc (BodyStmt _ body _ _), _) = do { (body', fvs) <- rnBody body ; (then_op, fvs1) <- lookupSyntax thenMName ; return [(emptyNameSet, fvs `plusFV` fvs1, emptyNameSet, L loc (BodyStmt noExtField body' then_op noSyntaxExpr))] } rn_rec_stmt rnBody _ (L loc (BindStmt _ pat' body _ _), fv_pat) = do { (body', fv_expr) <- rnBody body ; (bind_op, fvs1) <- lookupSyntax bindMName ; (fail_op, fvs2) <- getMonadFailOp ; let bndrs = mkNameSet (collectPatBinders pat') fvs = fv_expr `plusFV` fv_pat `plusFV` fvs1 `plusFV` fvs2 ; return [(bndrs, fvs, bndrs `intersectNameSet` fvs, L loc (BindStmt noExtField pat' body' bind_op fail_op))] } rn_rec_stmt _ _ (L _ (LetStmt _ (L _ binds@(HsIPBinds {}))), _) = failWith (badIpBinds (text "an mdo expression") binds) rn_rec_stmt _ all_bndrs (L loc (LetStmt _ (L l (HsValBinds x binds'))), _) = do { (binds', du_binds) <- rnLocalValBindsRHS (mkNameSet all_bndrs) binds' -- fixities and unused are handled above in rnRecStmtsAndThen ; let fvs = allUses du_binds ; return [(duDefs du_binds, fvs, emptyNameSet, L loc (LetStmt noExtField (L l (HsValBinds x binds'))))] } -- no RecStmt case because they get flattened above when doing the LHSes rn_rec_stmt _ _ stmt@(L _ (RecStmt {}), _) = pprPanic "rn_rec_stmt: RecStmt" (ppr stmt) rn_rec_stmt _ _ stmt@(L _ (ParStmt {}), _) -- Syntactically illegal in mdo = pprPanic "rn_rec_stmt: ParStmt" (ppr stmt) rn_rec_stmt _ _ stmt@(L _ (TransStmt {}), _) -- Syntactically illegal in mdo = pprPanic "rn_rec_stmt: TransStmt" (ppr stmt) rn_rec_stmt _ _ (L _ (LetStmt _ (L _ (XHsLocalBindsLR nec))), _) = noExtCon nec rn_rec_stmt _ _ (L _ (LetStmt _ (L _ (EmptyLocalBinds _))), _) = panic "rn_rec_stmt: LetStmt EmptyLocalBinds" rn_rec_stmt _ _ stmt@(L _ (ApplicativeStmt {}), _) = pprPanic "rn_rec_stmt: ApplicativeStmt" (ppr stmt) rn_rec_stmt _ _ (L _ (XStmtLR nec), _) = noExtCon nec rn_rec_stmts :: Outputable (body GhcPs) => (Located (body GhcPs) -> RnM (Located (body GhcRn), FreeVars)) -> [Name] -> [(LStmtLR GhcRn GhcPs (Located (body GhcPs)), FreeVars)] -> RnM [Segment (LStmt GhcRn (Located (body GhcRn)))] rn_rec_stmts rnBody bndrs stmts = do { segs_s <- mapM (rn_rec_stmt rnBody bndrs) stmts ; return (concat segs_s) } --------------------------------------------- segmentRecStmts :: SrcSpan -> HsStmtContext GhcRn -> Stmt GhcRn body -> [Segment (LStmt GhcRn body)] -> FreeVars -> ([LStmt GhcRn body], FreeVars) segmentRecStmts loc ctxt empty_rec_stmt segs fvs_later | null segs = ([], fvs_later) | MDoExpr <- ctxt = segsToStmts empty_rec_stmt grouped_segs fvs_later -- Step 4: Turn the segments into Stmts -- Use RecStmt when and only when there are fwd refs -- Also gather up the uses from the end towards the -- start, so we can tell the RecStmt which things are -- used 'after' the RecStmt | otherwise = ([ L loc $ empty_rec_stmt { recS_stmts = ss , recS_later_ids = nameSetElemsStable (defs `intersectNameSet` fvs_later) , recS_rec_ids = nameSetElemsStable (defs `intersectNameSet` uses) }] -- See Note [Deterministic ApplicativeDo and RecursiveDo desugaring] , uses `plusFV` fvs_later) where (defs_s, uses_s, _, ss) = unzip4 segs defs = plusFVs defs_s uses = plusFVs uses_s -- Step 2: Fill in the fwd refs. -- The segments are all singletons, but their fwd-ref -- field mentions all the things used by the segment -- that are bound after their use segs_w_fwd_refs = addFwdRefs segs -- Step 3: Group together the segments to make bigger segments -- Invariant: in the result, no segment uses a variable -- bound in a later segment grouped_segs = glomSegments ctxt segs_w_fwd_refs ---------------------------- addFwdRefs :: [Segment a] -> [Segment a] -- So far the segments only have forward refs *within* the Stmt -- (which happens for bind: x <- ...x...) -- This function adds the cross-seg fwd ref info addFwdRefs segs = fst (foldr mk_seg ([], emptyNameSet) segs) where mk_seg (defs, uses, fwds, stmts) (segs, later_defs) = (new_seg : segs, all_defs) where new_seg = (defs, uses, new_fwds, stmts) all_defs = later_defs `unionNameSet` defs new_fwds = fwds `unionNameSet` (uses `intersectNameSet` later_defs) -- Add the downstream fwd refs here {- Note [Segmenting mdo] ~~~~~~~~~~~~~~~~~~~~~ NB. June 7 2012: We only glom segments that appear in an explicit mdo; and leave those found in "do rec"'s intact. See https://gitlab.haskell.org/ghc/ghc/issues/4148 for the discussion leading to this design choice. Hence the test in segmentRecStmts. Note [Glomming segments] ~~~~~~~~~~~~~~~~~~~~~~~~ Glomming the singleton segments of an mdo into minimal recursive groups. At first I thought this was just strongly connected components, but there's an important constraint: the order of the stmts must not change. Consider mdo { x <- ...y... p <- z y <- ...x... q <- x z <- y r <- x } Here, the first stmt mention 'y', which is bound in the third. But that means that the innocent second stmt (p <- z) gets caught up in the recursion. And that in turn means that the binding for 'z' has to be included... and so on. Start at the tail { r <- x } Now add the next one { z <- y ; r <- x } Now add one more { q <- x ; z <- y ; r <- x } Now one more... but this time we have to group a bunch into rec { rec { y <- ...x... ; q <- x ; z <- y } ; r <- x } Now one more, which we can add on without a rec { p <- z ; rec { y <- ...x... ; q <- x ; z <- y } ; r <- x } Finally we add the last one; since it mentions y we have to glom it together with the first two groups { rec { x <- ...y...; p <- z ; y <- ...x... ; q <- x ; z <- y } ; r <- x } -} glomSegments :: HsStmtContext GhcRn -> [Segment (LStmt GhcRn body)] -> [Segment [LStmt GhcRn body]] -- Each segment has a non-empty list of Stmts -- See Note [Glomming segments] glomSegments _ [] = [] glomSegments ctxt ((defs,uses,fwds,stmt) : segs) -- Actually stmts will always be a singleton = (seg_defs, seg_uses, seg_fwds, seg_stmts) : others where segs' = glomSegments ctxt segs (extras, others) = grab uses segs' (ds, us, fs, ss) = unzip4 extras seg_defs = plusFVs ds `plusFV` defs seg_uses = plusFVs us `plusFV` uses seg_fwds = plusFVs fs `plusFV` fwds seg_stmts = stmt : concat ss grab :: NameSet -- The client -> [Segment a] -> ([Segment a], -- Needed by the 'client' [Segment a]) -- Not needed by the client -- The result is simply a split of the input grab uses dus = (reverse yeses, reverse noes) where (noes, yeses) = span not_needed (reverse dus) not_needed (defs,_,_,_) = not (intersectsNameSet defs uses) ---------------------------------------------------- segsToStmts :: Stmt GhcRn body -- A RecStmt with the SyntaxOps filled in -> [Segment [LStmt GhcRn body]] -- Each Segment has a non-empty list of Stmts -> FreeVars -- Free vars used 'later' -> ([LStmt GhcRn body], FreeVars) segsToStmts _ [] fvs_later = ([], fvs_later) segsToStmts empty_rec_stmt ((defs, uses, fwds, ss) : segs) fvs_later = ASSERT( not (null ss) ) (new_stmt : later_stmts, later_uses `plusFV` uses) where (later_stmts, later_uses) = segsToStmts empty_rec_stmt segs fvs_later new_stmt | non_rec = head ss | otherwise = L (getLoc (head ss)) rec_stmt rec_stmt = empty_rec_stmt { recS_stmts = ss , recS_later_ids = nameSetElemsStable used_later , recS_rec_ids = nameSetElemsStable fwds } -- See Note [Deterministic ApplicativeDo and RecursiveDo desugaring] non_rec = isSingleton ss && isEmptyNameSet fwds used_later = defs `intersectNameSet` later_uses -- The ones needed after the RecStmt {- ************************************************************************ * * ApplicativeDo * * ************************************************************************ Note [ApplicativeDo] = Example = For a sequence of statements do x <- A y <- B x z <- C return (f x y z) We want to transform this to (\(x,y) z -> f x y z) <$> (do x <- A; y <- B x; return (x,y)) <*> C It would be easy to notice that "y <- B x" and "z <- C" are independent and do something like this: do x <- A (y,z) <- (,) <$> B x <*> C return (f x y z) But this isn't enough! A and C were also independent, and this transformation loses the ability to do A and C in parallel. The algorithm works by first splitting the sequence of statements into independent "segments", and a separate "tail" (the final statement). In our example above, the segements would be [ x <- A , y <- B x ] [ z <- C ] and the tail is: return (f x y z) Then we take these segments and make an Applicative expression from them: (\(x,y) z -> return (f x y z)) <$> do { x <- A; y <- B x; return (x,y) } <*> C Finally, we recursively apply the transformation to each segment, to discover any nested parallelism. = Syntax & spec = expr ::= ... | do {stmt_1; ..; stmt_n} expr | ... stmt ::= pat <- expr | (arg_1 | ... | arg_n) -- applicative composition, n>=1 | ... -- other kinds of statement (e.g. let) arg ::= pat <- expr | {stmt_1; ..; stmt_n} {var_1..var_n} (note that in the actual implementation,the expr in a do statement is represented by a LastStmt as the final stmt, this is just a representational issue and may change later.) == Transformation to introduce applicative stmts == ado {} tail = tail ado {pat <- expr} {return expr'} = (mkArg(pat <- expr)); return expr' ado {one} tail = one : tail ado stmts tail | n == 1 = ado before (ado after tail) where (before,after) = split(stmts_1) | n > 1 = (mkArg(stmts_1) | ... | mkArg(stmts_n)); tail where {stmts_1 .. stmts_n} = segments(stmts) segments(stmts) = -- divide stmts into segments with no interdependencies mkArg({pat <- expr}) = (pat <- expr) mkArg({stmt_1; ...; stmt_n}) = {stmt_1; ...; stmt_n} {vars(stmt_1) u .. u vars(stmt_n)} split({stmt_1; ..; stmt_n) = ({stmt_1; ..; stmt_i}, {stmt_i+1; ..; stmt_n}) -- 1 <= i <= n -- i is a good place to insert a bind == Desugaring for do == dsDo {} expr = expr dsDo {pat <- rhs; stmts} expr = rhs >>= \pat -> dsDo stmts expr dsDo {(arg_1 | ... | arg_n)} (return expr) = (\argpat (arg_1) .. argpat(arg_n) -> expr) <$> argexpr(arg_1) <*> ... <*> argexpr(arg_n) dsDo {(arg_1 | ... | arg_n); stmts} expr = join (\argpat (arg_1) .. argpat(arg_n) -> dsDo stmts expr) <$> argexpr(arg_1) <*> ... <*> argexpr(arg_n) = Relevant modules in the rest of the compiler = ApplicativeDo touches a few phases in the compiler: * Renamer: The journey begins here in the renamer, where do-blocks are scheduled as outlined above and transformed into applicative combinators. However, the code is still represented as a do-block with special forms of applicative statements. This allows us to recover the original do-block when e.g. printing type errors, where we don't want to show any of the applicative combinators since they don't exist in the source code. See ApplicativeStmt and ApplicativeArg in HsExpr. * Typechecker: ApplicativeDo passes through the typechecker much like any other form of expression. The only crux is that the typechecker has to be aware of the special ApplicativeDo statements in the do-notation, and typecheck them appropriately. Relevant module: TcMatches * Desugarer: Any do-block which contains applicative statements is desugared as outlined above, to use the Applicative combinators. Relevant module: DsExpr -} -- | The 'Name's of @return@ and @pure@. These may not be 'returnName' and -- 'pureName' due to @RebindableSyntax@. data MonadNames = MonadNames { return_name, pure_name :: Name } instance Outputable MonadNames where ppr (MonadNames {return_name=return_name,pure_name=pure_name}) = hcat [text "MonadNames { return_name = " ,ppr return_name ,text ", pure_name = " ,ppr pure_name ,text "}" ] -- | rearrange a list of statements using ApplicativeDoStmt. See -- Note [ApplicativeDo]. rearrangeForApplicativeDo :: HsStmtContext GhcRn -> [(ExprLStmt GhcRn, FreeVars)] -> RnM ([ExprLStmt GhcRn], FreeVars) rearrangeForApplicativeDo _ [] = return ([], emptyNameSet) rearrangeForApplicativeDo _ [(one,_)] = return ([one], emptyNameSet) rearrangeForApplicativeDo ctxt stmts0 = do optimal_ado <- goptM Opt_OptimalApplicativeDo let stmt_tree | optimal_ado = mkStmtTreeOptimal stmts | otherwise = mkStmtTreeHeuristic stmts traceRn "rearrangeForADo" (ppr stmt_tree) (return_name, _) <- lookupSyntaxName returnMName (pure_name, _) <- lookupSyntaxName pureAName let monad_names = MonadNames { return_name = return_name , pure_name = pure_name } stmtTreeToStmts monad_names ctxt stmt_tree [last] last_fvs where (stmts,(last,last_fvs)) = findLast stmts0 findLast [] = error "findLast" findLast [last] = ([],last) findLast (x:xs) = (x:rest,last) where (rest,last) = findLast xs -- | A tree of statements using a mixture of applicative and bind constructs. data StmtTree a = StmtTreeOne a | StmtTreeBind (StmtTree a) (StmtTree a) | StmtTreeApplicative [StmtTree a] instance Outputable a => Outputable (StmtTree a) where ppr (StmtTreeOne x) = parens (text "StmtTreeOne" <+> ppr x) ppr (StmtTreeBind x y) = parens (hang (text "StmtTreeBind") 2 (sep [ppr x, ppr y])) ppr (StmtTreeApplicative xs) = parens (hang (text "StmtTreeApplicative") 2 (vcat (map ppr xs))) flattenStmtTree :: StmtTree a -> [a] flattenStmtTree t = go t [] where go (StmtTreeOne a) as = a : as go (StmtTreeBind l r) as = go l (go r as) go (StmtTreeApplicative ts) as = foldr go as ts type ExprStmtTree = StmtTree (ExprLStmt GhcRn, FreeVars) type Cost = Int -- | Turn a sequence of statements into an ExprStmtTree using a -- heuristic algorithm. /O(n^2)/ mkStmtTreeHeuristic :: [(ExprLStmt GhcRn, FreeVars)] -> ExprStmtTree mkStmtTreeHeuristic [one] = StmtTreeOne one mkStmtTreeHeuristic stmts = case segments stmts of [one] -> split one segs -> StmtTreeApplicative (map split segs) where split [one] = StmtTreeOne one split stmts = StmtTreeBind (mkStmtTreeHeuristic before) (mkStmtTreeHeuristic after) where (before, after) = splitSegment stmts -- | Turn a sequence of statements into an ExprStmtTree optimally, -- using dynamic programming. /O(n^3)/ mkStmtTreeOptimal :: [(ExprLStmt GhcRn, FreeVars)] -> ExprStmtTree mkStmtTreeOptimal stmts = ASSERT(not (null stmts)) -- the empty case is handled by the caller; -- we don't support empty StmtTrees. fst (arr ! (0,n)) where n = length stmts - 1 stmt_arr = listArray (0,n) stmts -- lazy cache of optimal trees for subsequences of the input arr :: Array (Int,Int) (ExprStmtTree, Cost) arr = array ((0,0),(n,n)) [ ((lo,hi), tree lo hi) | lo <- [0..n] , hi <- [lo..n] ] -- compute the optimal tree for the sequence [lo..hi] tree lo hi | hi == lo = (StmtTreeOne (stmt_arr ! lo), 1) | otherwise = case segments [ stmt_arr ! i | i <- [lo..hi] ] of [] -> panic "mkStmtTree" [_one] -> split lo hi segs -> (StmtTreeApplicative trees, maximum costs) where bounds = scanl (\(_,hi) a -> (hi+1, hi + length a)) (0,lo-1) segs (trees,costs) = unzip (map (uncurry split) (tail bounds)) -- find the best place to split the segment [lo..hi] split :: Int -> Int -> (ExprStmtTree, Cost) split lo hi | hi == lo = (StmtTreeOne (stmt_arr ! lo), 1) | otherwise = (StmtTreeBind before after, c1+c2) where -- As per the paper, for a sequence s1...sn, we want to find -- the split with the minimum cost, where the cost is the -- sum of the cost of the left and right subsequences. -- -- As an optimisation (also in the paper) if the cost of -- s1..s(n-1) is different from the cost of s2..sn, we know -- that the optimal solution is the lower of the two. Only -- in the case that these two have the same cost do we need -- to do the exhaustive search. -- ((before,c1),(after,c2)) | hi - lo == 1 = ((StmtTreeOne (stmt_arr ! lo), 1), (StmtTreeOne (stmt_arr ! hi), 1)) | left_cost < right_cost = ((left,left_cost), (StmtTreeOne (stmt_arr ! hi), 1)) | left_cost > right_cost = ((StmtTreeOne (stmt_arr ! lo), 1), (right,right_cost)) | otherwise = minimumBy (comparing cost) alternatives where (left, left_cost) = arr ! (lo,hi-1) (right, right_cost) = arr ! (lo+1,hi) cost ((_,c1),(_,c2)) = c1 + c2 alternatives = [ (arr ! (lo,k), arr ! (k+1,hi)) | k <- [lo .. hi-1] ] -- | Turn the ExprStmtTree back into a sequence of statements, using -- ApplicativeStmt where necessary. stmtTreeToStmts :: MonadNames -> HsStmtContext GhcRn -> ExprStmtTree -> [ExprLStmt GhcRn] -- ^ the "tail" -> FreeVars -- ^ free variables of the tail -> RnM ( [ExprLStmt GhcRn] -- ( output statements, , FreeVars ) -- , things we needed -- If we have a single bind, and we can do it without a join, transform -- to an ApplicativeStmt. This corresponds to the rule -- dsBlock [pat <- rhs] (return expr) = expr <$> rhs -- In the spec, but we do it here rather than in the desugarer, -- because we need the typechecker to typecheck the <$> form rather than -- the bind form, which would give rise to a Monad constraint. stmtTreeToStmts monad_names ctxt (StmtTreeOne (L _ (BindStmt _ pat rhs _ fail_op), _)) tail _tail_fvs | not (isStrictPattern pat), (False,tail') <- needJoin monad_names tail -- See Note [ApplicativeDo and strict patterns] = mkApplicativeStmt ctxt [ApplicativeArgOne { xarg_app_arg_one = noExtField , app_arg_pattern = pat , arg_expr = rhs , is_body_stmt = False , fail_operator = fail_op}] False tail' stmtTreeToStmts monad_names ctxt (StmtTreeOne (L _ (BodyStmt _ rhs _ fail_op),_)) tail _tail_fvs | (False,tail') <- needJoin monad_names tail = mkApplicativeStmt ctxt [ApplicativeArgOne { xarg_app_arg_one = noExtField , app_arg_pattern = nlWildPatName , arg_expr = rhs , is_body_stmt = True , fail_operator = fail_op}] False tail' stmtTreeToStmts _monad_names _ctxt (StmtTreeOne (s,_)) tail _tail_fvs = return (s : tail, emptyNameSet) stmtTreeToStmts monad_names ctxt (StmtTreeBind before after) tail tail_fvs = do (stmts1, fvs1) <- stmtTreeToStmts monad_names ctxt after tail tail_fvs let tail1_fvs = unionNameSets (tail_fvs : map snd (flattenStmtTree after)) (stmts2, fvs2) <- stmtTreeToStmts monad_names ctxt before stmts1 tail1_fvs return (stmts2, fvs1 `plusFV` fvs2) stmtTreeToStmts monad_names ctxt (StmtTreeApplicative trees) tail tail_fvs = do pairs <- mapM (stmtTreeArg ctxt tail_fvs) trees let (stmts', fvss) = unzip pairs let (need_join, tail') = if any hasStrictPattern trees then (True, tail) else needJoin monad_names tail (stmts, fvs) <- mkApplicativeStmt ctxt stmts' need_join tail' return (stmts, unionNameSets (fvs:fvss)) where stmtTreeArg _ctxt _tail_fvs (StmtTreeOne (L _ (BindStmt _ pat exp _ fail_op), _)) = return (ApplicativeArgOne { xarg_app_arg_one = noExtField , app_arg_pattern = pat , arg_expr = exp , is_body_stmt = False , fail_operator = fail_op }, emptyFVs) stmtTreeArg _ctxt _tail_fvs (StmtTreeOne (L _ (BodyStmt _ exp _ fail_op), _)) = return (ApplicativeArgOne { xarg_app_arg_one = noExtField , app_arg_pattern = nlWildPatName , arg_expr = exp , is_body_stmt = True , fail_operator = fail_op }, emptyFVs) stmtTreeArg ctxt tail_fvs tree = do let stmts = flattenStmtTree tree pvarset = mkNameSet (concatMap (collectStmtBinders.unLoc.fst) stmts) `intersectNameSet` tail_fvs pvars = nameSetElemsStable pvarset -- See Note [Deterministic ApplicativeDo and RecursiveDo desugaring] pat = mkBigLHsVarPatTup pvars tup = mkBigLHsVarTup pvars (stmts',fvs2) <- stmtTreeToStmts monad_names ctxt tree [] pvarset (mb_ret, fvs1) <- if | L _ ApplicativeStmt{} <- last stmts' -> return (unLoc tup, emptyNameSet) | otherwise -> do (ret, _) <- lookupSyntaxExpr returnMName let expr = HsApp noExtField (noLoc ret) tup return (expr, emptyFVs) return ( ApplicativeArgMany { xarg_app_arg_many = noExtField , app_stmts = stmts' , final_expr = mb_ret , bv_pattern = pat } , fvs1 `plusFV` fvs2) -- | Divide a sequence of statements into segments, where no segment -- depends on any variables defined by a statement in another segment. segments :: [(ExprLStmt GhcRn, FreeVars)] -> [[(ExprLStmt GhcRn, FreeVars)]] segments stmts = map fst $ merge $ reverse $ map reverse $ walk (reverse stmts) where allvars = mkNameSet (concatMap (collectStmtBinders.unLoc.fst) stmts) -- We would rather not have a segment that just has LetStmts in -- it, so combine those with an adjacent segment where possible. merge [] = [] merge (seg : segs) = case rest of [] -> [(seg,all_lets)] ((s,s_lets):ss) | all_lets || s_lets -> (seg ++ s, all_lets && s_lets) : ss _otherwise -> (seg,all_lets) : rest where rest = merge segs all_lets = all (isLetStmt . fst) seg -- walk splits the statement sequence into segments, traversing -- the sequence from the back to the front, and keeping track of -- the set of free variables of the current segment. Whenever -- this set of free variables is empty, we have a complete segment. walk :: [(ExprLStmt GhcRn, FreeVars)] -> [[(ExprLStmt GhcRn, FreeVars)]] walk [] = [] walk ((stmt,fvs) : stmts) = ((stmt,fvs) : seg) : walk rest where (seg,rest) = chunter fvs' stmts (_, fvs') = stmtRefs stmt fvs chunter _ [] = ([], []) chunter vars ((stmt,fvs) : rest) | not (isEmptyNameSet vars) || isStrictPatternBind stmt -- See Note [ApplicativeDo and strict patterns] = ((stmt,fvs) : chunk, rest') where (chunk,rest') = chunter vars' rest (pvars, evars) = stmtRefs stmt fvs vars' = (vars `minusNameSet` pvars) `unionNameSet` evars chunter _ rest = ([], rest) stmtRefs stmt fvs | isLetStmt stmt = (pvars, fvs' `minusNameSet` pvars) | otherwise = (pvars, fvs') where fvs' = fvs `intersectNameSet` allvars pvars = mkNameSet (collectStmtBinders (unLoc stmt)) isStrictPatternBind :: ExprLStmt GhcRn -> Bool isStrictPatternBind (L _ (BindStmt _ pat _ _ _)) = isStrictPattern pat isStrictPatternBind _ = False {- Note [ApplicativeDo and strict patterns] A strict pattern match is really a dependency. For example, do (x,y) <- A z <- B return C The pattern (_,_) must be matched strictly before we do B. If we allowed this to be transformed into (\(x,y) -> \z -> C) <$> A <*> B then it could be lazier than the standard desuraging using >>=. See #13875 for more examples. Thus, whenever we have a strict pattern match, we treat it as a dependency between that statement and the following one. The dependency prevents those two statements from being performed "in parallel" in an ApplicativeStmt, but doesn't otherwise affect what we can do with the rest of the statements in the same "do" expression. -} isStrictPattern :: LPat (GhcPass p) -> Bool isStrictPattern lpat = case unLoc lpat of WildPat{} -> False VarPat{} -> False LazyPat{} -> False AsPat _ _ p -> isStrictPattern p ParPat _ p -> isStrictPattern p ViewPat _ _ p -> isStrictPattern p SigPat _ p _ -> isStrictPattern p BangPat{} -> True ListPat{} -> True TuplePat{} -> True SumPat{} -> True ConPatIn{} -> True ConPatOut{} -> True LitPat{} -> True NPat{} -> True NPlusKPat{} -> True SplicePat{} -> True _otherwise -> panic "isStrictPattern" hasStrictPattern :: ExprStmtTree -> Bool hasStrictPattern (StmtTreeOne (L _ (BindStmt _ pat _ _ _), _)) = isStrictPattern pat hasStrictPattern (StmtTreeOne _) = False hasStrictPattern (StmtTreeBind a b) = hasStrictPattern a || hasStrictPattern b hasStrictPattern (StmtTreeApplicative trees) = any hasStrictPattern trees isLetStmt :: LStmt a b -> Bool isLetStmt (L _ LetStmt{}) = True isLetStmt _ = False -- | Find a "good" place to insert a bind in an indivisible segment. -- This is the only place where we use heuristics. The current -- heuristic is to peel off the first group of independent statements -- and put the bind after those. splitSegment :: [(ExprLStmt GhcRn, FreeVars)] -> ( [(ExprLStmt GhcRn, FreeVars)] , [(ExprLStmt GhcRn, FreeVars)] ) splitSegment [one,two] = ([one],[two]) -- there is no choice when there are only two statements; this just saves -- some work in a common case. splitSegment stmts | Just (lets,binds,rest) <- slurpIndependentStmts stmts = if not (null lets) then (lets, binds++rest) else (lets++binds, rest) | otherwise = case stmts of (x:xs) -> ([x],xs) _other -> (stmts,[]) slurpIndependentStmts :: [(LStmt GhcRn (Located (body GhcRn)), FreeVars)] -> Maybe ( [(LStmt GhcRn (Located (body GhcRn)), FreeVars)] -- LetStmts , [(LStmt GhcRn (Located (body GhcRn)), FreeVars)] -- BindStmts , [(LStmt GhcRn (Located (body GhcRn)), FreeVars)] ) slurpIndependentStmts stmts = go [] [] emptyNameSet stmts where -- If we encounter a BindStmt that doesn't depend on a previous BindStmt -- in this group, then add it to the group. We have to be careful about -- strict patterns though; splitSegments expects that if we return Just -- then we have actually done some splitting. Otherwise it will go into -- an infinite loop (#14163). go lets indep bndrs ((L loc (BindStmt _ pat body bind_op fail_op), fvs): rest) | isEmptyNameSet (bndrs `intersectNameSet` fvs) && not (isStrictPattern pat) = go lets ((L loc (BindStmt noExtField pat body bind_op fail_op), fvs) : indep) bndrs' rest where bndrs' = bndrs `unionNameSet` mkNameSet (collectPatBinders pat) -- If we encounter a LetStmt that doesn't depend on a BindStmt in this -- group, then move it to the beginning, so that it doesn't interfere with -- grouping more BindStmts. -- TODO: perhaps we shouldn't do this if there are any strict bindings, -- because we might be moving evaluation earlier. go lets indep bndrs ((L loc (LetStmt noExtField binds), fvs) : rest) | isEmptyNameSet (bndrs `intersectNameSet` fvs) = go ((L loc (LetStmt noExtField binds), fvs) : lets) indep bndrs rest go _ [] _ _ = Nothing go _ [_] _ _ = Nothing go lets indep _ stmts = Just (reverse lets, reverse indep, stmts) -- | Build an ApplicativeStmt, and strip the "return" from the tail -- if necessary. -- -- For example, if we start with -- do x <- E1; y <- E2; return (f x y) -- then we get -- do (E1[x] | E2[y]); f x y -- -- the LastStmt in this case has the return removed, but we set the -- flag on the LastStmt to indicate this, so that we can print out the -- original statement correctly in error messages. It is easier to do -- it this way rather than try to ignore the return later in both the -- typechecker and the desugarer (I tried it that way first!). mkApplicativeStmt :: HsStmtContext GhcRn -> [ApplicativeArg GhcRn] -- ^ The args -> Bool -- ^ True <=> need a join -> [ExprLStmt GhcRn] -- ^ The body statements -> RnM ([ExprLStmt GhcRn], FreeVars) mkApplicativeStmt ctxt args need_join body_stmts = do { (fmap_op, fvs1) <- lookupStmtName ctxt fmapName ; (ap_op, fvs2) <- lookupStmtName ctxt apAName ; (mb_join, fvs3) <- if need_join then do { (join_op, fvs) <- lookupStmtName ctxt joinMName ; return (Just join_op, fvs) } else return (Nothing, emptyNameSet) ; let applicative_stmt = noLoc $ ApplicativeStmt noExtField (zip (fmap_op : repeat ap_op) args) mb_join ; return ( applicative_stmt : body_stmts , fvs1 `plusFV` fvs2 `plusFV` fvs3) } -- | Given the statements following an ApplicativeStmt, determine whether -- we need a @join@ or not, and remove the @return@ if necessary. needJoin :: MonadNames -> [ExprLStmt GhcRn] -> (Bool, [ExprLStmt GhcRn]) needJoin _monad_names [] = (False, []) -- we're in an ApplicativeArg needJoin monad_names [L loc (LastStmt _ e _ t)] | Just arg <- isReturnApp monad_names e = (False, [L loc (LastStmt noExtField arg True t)]) needJoin _monad_names stmts = (True, stmts) -- | @Just e@, if the expression is @return e@ or @return $ e@, -- otherwise @Nothing@ isReturnApp :: MonadNames -> LHsExpr GhcRn -> Maybe (LHsExpr GhcRn) isReturnApp monad_names (L _ (HsPar _ expr)) = isReturnApp monad_names expr isReturnApp monad_names (L _ e) = case e of OpApp _ l op r | is_return l, is_dollar op -> Just r HsApp _ f arg | is_return f -> Just arg _otherwise -> Nothing where is_var f (L _ (HsPar _ e)) = is_var f e is_var f (L _ (HsAppType _ e _)) = is_var f e is_var f (L _ (HsVar _ (L _ r))) = f r -- TODO: I don't know how to get this right for rebindable syntax is_var _ _ = False is_return = is_var (\n -> n == return_name monad_names || n == pure_name monad_names) is_dollar = is_var (`hasKey` dollarIdKey) {- ************************************************************************ * * \subsubsection{Errors} * * ************************************************************************ -} checkEmptyStmts :: HsStmtContext GhcRn -> RnM () -- We've seen an empty sequence of Stmts... is that ok? checkEmptyStmts ctxt = unless (okEmpty ctxt) (addErr (emptyErr ctxt)) okEmpty :: HsStmtContext a -> Bool okEmpty (PatGuard {}) = True okEmpty _ = False emptyErr :: HsStmtContext GhcRn -> SDoc emptyErr (ParStmtCtxt {}) = text "Empty statement group in parallel comprehension" emptyErr (TransStmtCtxt {}) = text "Empty statement group preceding 'group' or 'then'" emptyErr ctxt = text "Empty" <+> pprStmtContext ctxt ---------------------- checkLastStmt :: Outputable (body GhcPs) => HsStmtContext GhcRn -> LStmt GhcPs (Located (body GhcPs)) -> RnM (LStmt GhcPs (Located (body GhcPs))) checkLastStmt ctxt lstmt@(L loc stmt) = case ctxt of ListComp -> check_comp MonadComp -> check_comp ArrowExpr -> check_do DoExpr -> check_do MDoExpr -> check_do _ -> check_other where check_do -- Expect BodyStmt, and change it to LastStmt = case stmt of BodyStmt _ e _ _ -> return (L loc (mkLastStmt e)) LastStmt {} -> return lstmt -- "Deriving" clauses may generate a -- LastStmt directly (unlike the parser) _ -> do { addErr (hang last_error 2 (ppr stmt)); return lstmt } last_error = (text "The last statement in" <+> pprAStmtContext ctxt <+> text "must be an expression") check_comp -- Expect LastStmt; this should be enforced by the parser! = case stmt of LastStmt {} -> return lstmt _ -> pprPanic "checkLastStmt" (ppr lstmt) check_other -- Behave just as if this wasn't the last stmt = do { checkStmt ctxt lstmt; return lstmt } -- Checking when a particular Stmt is ok checkStmt :: HsStmtContext GhcRn -> LStmt GhcPs (Located (body GhcPs)) -> RnM () checkStmt ctxt (L _ stmt) = do { dflags <- getDynFlags ; case okStmt dflags ctxt stmt of IsValid -> return () NotValid extra -> addErr (msg $$ extra) } where msg = sep [ text "Unexpected" <+> pprStmtCat stmt <+> ptext (sLit "statement") , text "in" <+> pprAStmtContext ctxt ] pprStmtCat :: Stmt (GhcPass a) body -> SDoc pprStmtCat (TransStmt {}) = text "transform" pprStmtCat (LastStmt {}) = text "return expression" pprStmtCat (BodyStmt {}) = text "body" pprStmtCat (BindStmt {}) = text "binding" pprStmtCat (LetStmt {}) = text "let" pprStmtCat (RecStmt {}) = text "rec" pprStmtCat (ParStmt {}) = text "parallel" pprStmtCat (ApplicativeStmt {}) = panic "pprStmtCat: ApplicativeStmt" pprStmtCat (XStmtLR nec) = noExtCon nec ------------ emptyInvalid :: Validity -- Payload is the empty document emptyInvalid = NotValid Outputable.empty okStmt, okDoStmt, okCompStmt, okParStmt :: DynFlags -> HsStmtContext GhcRn -> Stmt GhcPs (Located (body GhcPs)) -> Validity -- Return Nothing if OK, (Just extra) if not ok -- The "extra" is an SDoc that is appended to a generic error message okStmt dflags ctxt stmt = case ctxt of PatGuard {} -> okPatGuardStmt stmt ParStmtCtxt ctxt -> okParStmt dflags ctxt stmt DoExpr -> okDoStmt dflags ctxt stmt MDoExpr -> okDoStmt dflags ctxt stmt ArrowExpr -> okDoStmt dflags ctxt stmt GhciStmtCtxt -> okDoStmt dflags ctxt stmt ListComp -> okCompStmt dflags ctxt stmt MonadComp -> okCompStmt dflags ctxt stmt TransStmtCtxt ctxt -> okStmt dflags ctxt stmt ------------- okPatGuardStmt :: Stmt GhcPs (Located (body GhcPs)) -> Validity okPatGuardStmt stmt = case stmt of BodyStmt {} -> IsValid BindStmt {} -> IsValid LetStmt {} -> IsValid _ -> emptyInvalid ------------- okParStmt dflags ctxt stmt = case stmt of LetStmt _ (L _ (HsIPBinds {})) -> emptyInvalid _ -> okStmt dflags ctxt stmt ---------------- okDoStmt dflags ctxt stmt = case stmt of RecStmt {} | LangExt.RecursiveDo `xopt` dflags -> IsValid | ArrowExpr <- ctxt -> IsValid -- Arrows allows 'rec' | otherwise -> NotValid (text "Use RecursiveDo") BindStmt {} -> IsValid LetStmt {} -> IsValid BodyStmt {} -> IsValid _ -> emptyInvalid ---------------- okCompStmt dflags _ stmt = case stmt of BindStmt {} -> IsValid LetStmt {} -> IsValid BodyStmt {} -> IsValid ParStmt {} | LangExt.ParallelListComp `xopt` dflags -> IsValid | otherwise -> NotValid (text "Use ParallelListComp") TransStmt {} | LangExt.TransformListComp `xopt` dflags -> IsValid | otherwise -> NotValid (text "Use TransformListComp") RecStmt {} -> emptyInvalid LastStmt {} -> emptyInvalid -- Should not happen (dealt with by checkLastStmt) ApplicativeStmt {} -> emptyInvalid XStmtLR nec -> noExtCon nec --------- checkTupleSection :: [LHsTupArg GhcPs] -> RnM () checkTupleSection args = do { tuple_section <- xoptM LangExt.TupleSections ; checkErr (all tupArgPresent args || tuple_section) msg } where msg = text "Illegal tuple section: use TupleSections" --------- sectionErr :: HsExpr GhcPs -> SDoc sectionErr expr = hang (text "A section must be enclosed in parentheses") 2 (text "thus:" <+> (parens (ppr expr))) badIpBinds :: Outputable a => SDoc -> a -> SDoc badIpBinds what binds = hang (text "Implicit-parameter bindings illegal in" <+> what) 2 (ppr binds) --------- monadFailOp :: LPat GhcPs -> HsStmtContext GhcRn -> RnM (SyntaxExpr GhcRn, FreeVars) monadFailOp pat ctxt -- If the pattern is irrefutable (e.g.: wildcard, tuple, ~pat, etc.) -- we should not need to fail. | isIrrefutableHsPat pat = return (noSyntaxExpr, emptyFVs) -- For non-monadic contexts (e.g. guard patterns, list -- comprehensions, etc.) we should not need to fail. See Note -- [Failing pattern matches in Stmts] | not (isMonadFailStmtContext ctxt) = return (noSyntaxExpr, emptyFVs) | otherwise = getMonadFailOp {- Note [Monad fail : Rebindable syntax, overloaded strings] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Given the code foo x = do { Just y <- x; return y } we expect it to desugar as foo x = x >>= \r -> case r of Just y -> return y Nothing -> fail "Pattern match error" But with RebindableSyntax and OverloadedStrings, we really want it to desugar thus: foo x = x >>= \r -> case r of Just y -> return y Nothing -> fail (fromString "Patterm match error") So, in this case, we synthesize the function \x -> fail (fromString x) (rather than plain 'fail') for the 'fail' operation. This is done in 'getMonadFailOp'. -} getMonadFailOp :: RnM (SyntaxExpr GhcRn, FreeVars) -- Syntax expr fail op getMonadFailOp = do { xOverloadedStrings <- fmap (xopt LangExt.OverloadedStrings) getDynFlags ; xRebindableSyntax <- fmap (xopt LangExt.RebindableSyntax) getDynFlags ; reallyGetMonadFailOp xRebindableSyntax xOverloadedStrings } where reallyGetMonadFailOp rebindableSyntax overloadedStrings | rebindableSyntax && overloadedStrings = do (failExpr, failFvs) <- lookupSyntaxExpr failMName (fromStringExpr, fromStringFvs) <- lookupSyntaxExpr fromStringName let arg_lit = mkVarOcc "arg" arg_name <- newSysName arg_lit let arg_syn_expr = nlHsVar arg_name body :: LHsExpr GhcRn = nlHsApp (noLoc failExpr) (nlHsApp (noLoc $ fromStringExpr) arg_syn_expr) let failAfterFromStringExpr :: HsExpr GhcRn = unLoc $ mkHsLam [noLoc $ VarPat noExtField $ noLoc arg_name] body let failAfterFromStringSynExpr :: SyntaxExpr GhcRn = mkSyntaxExpr failAfterFromStringExpr return (failAfterFromStringSynExpr, failFvs `plusFV` fromStringFvs) | otherwise = lookupSyntax failMName
high
0.636676
99,921
// Copyright (c) 2016 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. #include "quic/core/quic_buffered_packet_store.h" #include <list> #include <string> #include "quic/core/quic_versions.h" #include "quic/platform/api/quic_flags.h" #include "quic/platform/api/quic_test.h" #include "quic/test_tools/mock_clock.h" #include "quic/test_tools/quic_buffered_packet_store_peer.h" #include "quic/test_tools/quic_test_utils.h" namespace quic { typedef QuicBufferedPacketStore::BufferedPacket BufferedPacket; typedef QuicBufferedPacketStore::EnqueuePacketResult EnqueuePacketResult; static const size_t kDefaultMaxConnectionsInStore = 100; static const size_t kMaxConnectionsWithoutCHLO = kDefaultMaxConnectionsInStore / 2; namespace test { namespace { typedef QuicBufferedPacketStore::BufferedPacket BufferedPacket; typedef QuicBufferedPacketStore::BufferedPacketList BufferedPacketList; class QuicBufferedPacketStoreVisitor : public QuicBufferedPacketStore::VisitorInterface { public: QuicBufferedPacketStoreVisitor() {} ~QuicBufferedPacketStoreVisitor() override {} void OnExpiredPackets(QuicConnectionId /*connection_id*/, BufferedPacketList early_arrived_packets) override { last_expired_packet_queue_ = std::move(early_arrived_packets); } // The packets queue for most recently expirect connection. BufferedPacketList last_expired_packet_queue_; }; class QuicBufferedPacketStoreTest : public QuicTest { public: QuicBufferedPacketStoreTest() : store_(&visitor_, &clock_, &alarm_factory_), self_address_(QuicIpAddress::Any6(), 65535), peer_address_(QuicIpAddress::Any6(), 65535), packet_content_("some encrypted content"), packet_time_(QuicTime::Zero() + QuicTime::Delta::FromMicroseconds(42)), packet_(packet_content_.data(), packet_content_.size(), packet_time_), invalid_version_(UnsupportedQuicVersion()), valid_version_(CurrentSupportedVersions().front()) {} protected: QuicBufferedPacketStoreVisitor visitor_; MockClock clock_; MockAlarmFactory alarm_factory_; QuicBufferedPacketStore store_; QuicSocketAddress self_address_; QuicSocketAddress peer_address_; std::string packet_content_; QuicTime packet_time_; QuicReceivedPacket packet_; const ParsedQuicVersion invalid_version_; const ParsedQuicVersion valid_version_; }; TEST_F(QuicBufferedPacketStoreTest, SimpleEnqueueAndDeliverPacket) { QuicConnectionId connection_id = TestConnectionId(1); store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); EXPECT_TRUE(store_.HasBufferedPackets(connection_id)); auto packets = store_.DeliverPackets(connection_id); const std::list<BufferedPacket>& queue = packets.buffered_packets; ASSERT_EQ(1u, queue.size()); // The alpn should be ignored for non-chlo packets. ASSERT_TRUE(packets.alpns.empty()); // There is no valid version because CHLO has not arrived. EXPECT_EQ(invalid_version_, packets.version); // Check content of the only packet in the queue. EXPECT_EQ(packet_content_, queue.front().packet->AsStringPiece()); EXPECT_EQ(packet_time_, queue.front().packet->receipt_time()); EXPECT_EQ(peer_address_, queue.front().peer_address); EXPECT_EQ(self_address_, queue.front().self_address); // No more packets on connection 1 should remain in the store. EXPECT_TRUE(store_.DeliverPackets(connection_id).buffered_packets.empty()); EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); } TEST_F(QuicBufferedPacketStoreTest, DifferentPacketAddressOnOneConnection) { QuicSocketAddress addr_with_new_port(QuicIpAddress::Any4(), 256); QuicConnectionId connection_id = TestConnectionId(1); store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); store_.EnqueuePacket(connection_id, false, packet_, self_address_, addr_with_new_port, false, {}, invalid_version_); std::list<BufferedPacket> queue = store_.DeliverPackets(connection_id).buffered_packets; ASSERT_EQ(2u, queue.size()); // The address migration path should be preserved. EXPECT_EQ(peer_address_, queue.front().peer_address); EXPECT_EQ(addr_with_new_port, queue.back().peer_address); } TEST_F(QuicBufferedPacketStoreTest, EnqueueAndDeliverMultiplePacketsOnMultipleConnections) { size_t num_connections = 10; for (uint64_t conn_id = 1; conn_id <= num_connections; ++conn_id) { QuicConnectionId connection_id = TestConnectionId(conn_id); store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); } // Deliver packets in reversed order. for (uint64_t conn_id = num_connections; conn_id > 0; --conn_id) { QuicConnectionId connection_id = TestConnectionId(conn_id); std::list<BufferedPacket> queue = store_.DeliverPackets(connection_id).buffered_packets; ASSERT_EQ(2u, queue.size()); } } TEST_F(QuicBufferedPacketStoreTest, FailToBufferTooManyPacketsOnExistingConnection) { // Tests that for one connection, only limited number of packets can be // buffered. size_t num_packets = kDefaultMaxUndecryptablePackets + 1; QuicConnectionId connection_id = TestConnectionId(1); // Arrived CHLO packet shouldn't affect how many non-CHLO pacekts store can // keep. EXPECT_EQ(QuicBufferedPacketStore::SUCCESS, store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, true, {}, valid_version_)); for (size_t i = 1; i <= num_packets; ++i) { // Only first |kDefaultMaxUndecryptablePackets packets| will be buffered. EnqueuePacketResult result = store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); if (i <= kDefaultMaxUndecryptablePackets) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, result); } else { EXPECT_EQ(EnqueuePacketResult::TOO_MANY_PACKETS, result); } } // Only first |kDefaultMaxUndecryptablePackets| non-CHLO packets and CHLO are // buffered. EXPECT_EQ(kDefaultMaxUndecryptablePackets + 1, store_.DeliverPackets(connection_id).buffered_packets.size()); } TEST_F(QuicBufferedPacketStoreTest, ReachNonChloConnectionUpperLimit) { // Tests that store can only keep early arrived packets for limited number of // connections. const size_t kNumConnections = kMaxConnectionsWithoutCHLO + 1; for (uint64_t conn_id = 1; conn_id <= kNumConnections; ++conn_id) { QuicConnectionId connection_id = TestConnectionId(conn_id); EnqueuePacketResult result = store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); if (conn_id <= kMaxConnectionsWithoutCHLO) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, result); } else { EXPECT_EQ(EnqueuePacketResult::TOO_MANY_CONNECTIONS, result); } } // Store only keeps early arrived packets upto |kNumConnections| connections. for (uint64_t conn_id = 1; conn_id <= kNumConnections; ++conn_id) { QuicConnectionId connection_id = TestConnectionId(conn_id); std::list<BufferedPacket> queue = store_.DeliverPackets(connection_id).buffered_packets; if (conn_id <= kMaxConnectionsWithoutCHLO) { EXPECT_EQ(1u, queue.size()); } else { EXPECT_EQ(0u, queue.size()); } } } TEST_F(QuicBufferedPacketStoreTest, FullStoreFailToBufferDataPacketOnNewConnection) { // Send enough CHLOs so that store gets full before number of connections // without CHLO reaches its upper limit. size_t num_chlos = kDefaultMaxConnectionsInStore - kMaxConnectionsWithoutCHLO + 1; for (uint64_t conn_id = 1; conn_id <= num_chlos; ++conn_id) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, store_.EnqueuePacket(TestConnectionId(conn_id), false, packet_, self_address_, peer_address_, true, {}, valid_version_)); } // Send data packets on another |kMaxConnectionsWithoutCHLO| connections. // Store should only be able to buffer till it's full. for (uint64_t conn_id = num_chlos + 1; conn_id <= (kDefaultMaxConnectionsInStore + 1); ++conn_id) { QuicConnectionId connection_id = TestConnectionId(conn_id); EnqueuePacketResult result = store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, true, {}, valid_version_); if (conn_id <= kDefaultMaxConnectionsInStore) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, result); } else { EXPECT_EQ(EnqueuePacketResult::TOO_MANY_CONNECTIONS, result); } } } TEST_F(QuicBufferedPacketStoreTest, EnqueueChloOnTooManyDifferentConnections) { // Buffer data packets on different connections upto limit. for (uint64_t conn_id = 1; conn_id <= kMaxConnectionsWithoutCHLO; ++conn_id) { QuicConnectionId connection_id = TestConnectionId(conn_id); EXPECT_EQ(EnqueuePacketResult::SUCCESS, store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, false, {}, invalid_version_)); } // Buffer CHLOs on other connections till store is full. for (size_t i = kMaxConnectionsWithoutCHLO + 1; i <= kDefaultMaxConnectionsInStore + 1; ++i) { QuicConnectionId connection_id = TestConnectionId(i); EnqueuePacketResult rs = store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, true, {}, valid_version_); if (i <= kDefaultMaxConnectionsInStore) { EXPECT_EQ(EnqueuePacketResult::SUCCESS, rs); EXPECT_TRUE(store_.HasChloForConnection(connection_id)); } else { // Last CHLO can't be buffered because store is full. EXPECT_EQ(EnqueuePacketResult::TOO_MANY_CONNECTIONS, rs); EXPECT_FALSE(store_.HasChloForConnection(connection_id)); } } // But buffering a CHLO belonging to a connection already has data packet // buffered in the store should success. This is the connection should be // delivered at last. EXPECT_EQ(EnqueuePacketResult::SUCCESS, store_.EnqueuePacket( /*connection_id=*/TestConnectionId(1), false, packet_, self_address_, peer_address_, true, {}, valid_version_)); EXPECT_TRUE(store_.HasChloForConnection( /*connection_id=*/TestConnectionId(1))); QuicConnectionId delivered_conn_id; for (size_t i = 0; i < kDefaultMaxConnectionsInStore - kMaxConnectionsWithoutCHLO + 1; ++i) { if (i < kDefaultMaxConnectionsInStore - kMaxConnectionsWithoutCHLO) { // Only CHLO is buffered. EXPECT_EQ(1u, store_.DeliverPacketsForNextConnection(&delivered_conn_id) .buffered_packets.size()); EXPECT_EQ(TestConnectionId(i + kMaxConnectionsWithoutCHLO + 1), delivered_conn_id); } else { EXPECT_EQ(2u, store_.DeliverPacketsForNextConnection(&delivered_conn_id) .buffered_packets.size()); EXPECT_EQ(TestConnectionId(1u), delivered_conn_id); } } EXPECT_FALSE(store_.HasChlosBuffered()); } // Tests that store expires long-staying connections appropriately for // connections both with and without CHLOs. TEST_F(QuicBufferedPacketStoreTest, PacketQueueExpiredBeforeDelivery) { QuicConnectionId connection_id = TestConnectionId(1); store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); EXPECT_EQ(EnqueuePacketResult::SUCCESS, store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, true, {}, valid_version_)); QuicConnectionId connection_id2 = TestConnectionId(2); EXPECT_EQ(EnqueuePacketResult::SUCCESS, store_.EnqueuePacket(connection_id2, false, packet_, self_address_, peer_address_, false, {}, invalid_version_)); // CHLO on connection 3 arrives 1ms later. clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1)); QuicConnectionId connection_id3 = TestConnectionId(3); // Use different client address to differetiate packets from different // connections. QuicSocketAddress another_client_address(QuicIpAddress::Any4(), 255); store_.EnqueuePacket(connection_id3, false, packet_, self_address_, another_client_address, true, {}, valid_version_); // Advance clock to the time when connection 1 and 2 expires. clock_.AdvanceTime( QuicBufferedPacketStorePeer::expiration_alarm(&store_)->deadline() - clock_.ApproximateNow()); ASSERT_GE(clock_.ApproximateNow(), QuicBufferedPacketStorePeer::expiration_alarm(&store_)->deadline()); // Fire alarm to remove long-staying connection 1 and 2 packets. alarm_factory_.FireAlarm( QuicBufferedPacketStorePeer::expiration_alarm(&store_)); EXPECT_EQ(1u, visitor_.last_expired_packet_queue_.buffered_packets.size()); EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasBufferedPackets(connection_id2)); // Try to deliver packets, but packet queue has been removed so no // packets can be returned. ASSERT_EQ(0u, store_.DeliverPackets(connection_id).buffered_packets.size()); ASSERT_EQ(0u, store_.DeliverPackets(connection_id2).buffered_packets.size()); QuicConnectionId delivered_conn_id; auto queue = store_.DeliverPacketsForNextConnection(&delivered_conn_id) .buffered_packets; // Connection 3 is the next to be delivered as connection 1 already expired. EXPECT_EQ(connection_id3, delivered_conn_id); ASSERT_EQ(1u, queue.size()); // Packets in connection 3 should use another peer address. EXPECT_EQ(another_client_address, queue.front().peer_address); // Test the alarm is reset by enqueueing 2 packets for 4th connection and wait // for them to expire. QuicConnectionId connection_id4 = TestConnectionId(4); store_.EnqueuePacket(connection_id4, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); store_.EnqueuePacket(connection_id4, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); clock_.AdvanceTime( QuicBufferedPacketStorePeer::expiration_alarm(&store_)->deadline() - clock_.ApproximateNow()); alarm_factory_.FireAlarm( QuicBufferedPacketStorePeer::expiration_alarm(&store_)); // |last_expired_packet_queue_| should be updated. EXPECT_EQ(2u, visitor_.last_expired_packet_queue_.buffered_packets.size()); } TEST_F(QuicBufferedPacketStoreTest, SimpleDiscardPackets) { QuicConnectionId connection_id = TestConnectionId(1); // Enqueue some packets store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); EXPECT_TRUE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasChlosBuffered()); // Dicard the packets store_.DiscardPackets(connection_id); // No packets on connection 1 should remain in the store EXPECT_TRUE(store_.DeliverPackets(connection_id).buffered_packets.empty()); EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasChlosBuffered()); // Check idempotency store_.DiscardPackets(connection_id); EXPECT_TRUE(store_.DeliverPackets(connection_id).buffered_packets.empty()); EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasChlosBuffered()); } TEST_F(QuicBufferedPacketStoreTest, DiscardWithCHLOs) { QuicConnectionId connection_id = TestConnectionId(1); // Enqueue some packets, which include a CHLO store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, true, {}, valid_version_); store_.EnqueuePacket(connection_id, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); EXPECT_TRUE(store_.HasBufferedPackets(connection_id)); EXPECT_TRUE(store_.HasChlosBuffered()); // Dicard the packets store_.DiscardPackets(connection_id); // No packets on connection 1 should remain in the store EXPECT_TRUE(store_.DeliverPackets(connection_id).buffered_packets.empty()); EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasChlosBuffered()); // Check idempotency store_.DiscardPackets(connection_id); EXPECT_TRUE(store_.DeliverPackets(connection_id).buffered_packets.empty()); EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasChlosBuffered()); } TEST_F(QuicBufferedPacketStoreTest, MultipleDiscardPackets) { QuicConnectionId connection_id_1 = TestConnectionId(1); QuicConnectionId connection_id_2 = TestConnectionId(2); // Enqueue some packets for two connection IDs store_.EnqueuePacket(connection_id_1, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); store_.EnqueuePacket(connection_id_1, false, packet_, self_address_, peer_address_, false, {}, invalid_version_); store_.EnqueuePacket(connection_id_2, false, packet_, self_address_, peer_address_, true, {"h3"}, valid_version_); EXPECT_TRUE(store_.HasBufferedPackets(connection_id_1)); EXPECT_TRUE(store_.HasBufferedPackets(connection_id_2)); EXPECT_TRUE(store_.HasChlosBuffered()); // Discard the packets for connection 1 store_.DiscardPackets(connection_id_1); // No packets on connection 1 should remain in the store EXPECT_TRUE(store_.DeliverPackets(connection_id_1).buffered_packets.empty()); EXPECT_FALSE(store_.HasBufferedPackets(connection_id_1)); EXPECT_TRUE(store_.HasChlosBuffered()); // Packets on connection 2 should remain EXPECT_TRUE(store_.HasBufferedPackets(connection_id_2)); auto packets = store_.DeliverPackets(connection_id_2); EXPECT_EQ(1u, packets.buffered_packets.size()); ASSERT_EQ(1u, packets.alpns.size()); EXPECT_EQ("h3", packets.alpns[0]); // Since connection_id_2's chlo arrives, verify version is set. EXPECT_EQ(valid_version_, packets.version); EXPECT_TRUE(store_.HasChlosBuffered()); // Discard the packets for connection 2 store_.DiscardPackets(connection_id_2); EXPECT_FALSE(store_.HasChlosBuffered()); } TEST_F(QuicBufferedPacketStoreTest, DiscardPacketsEmpty) { // Check that DiscardPackets on an unknown connection ID is safe and does // nothing. QuicConnectionId connection_id = TestConnectionId(11235); EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasChlosBuffered()); store_.DiscardPackets(connection_id); EXPECT_FALSE(store_.HasBufferedPackets(connection_id)); EXPECT_FALSE(store_.HasChlosBuffered()); } } // namespace } // namespace test } // namespace quic
high
0.615912
99,922
<%@ page contentType="text/html;charset=UTF-8" %> <%@ include file="/WEB-INF/views/include/taglib.jsp"%> <html> <head> <title>用户注册</title> <%@include file="/WEB-INF/views/include/dialog.jsp" %> <meta name="decorator" content="default"/> <script type="text/javascript"> $(document).ready(function() { $("#loginName").focus(); $("#inputForm").validate({ rules: { loginName: {remote: "${ctx}/sys/checkLoginName?oldLoginName=" + encodeURIComponent('${user.loginName}')} }, messages: { loginName: {remote: "用户登录名已存在"}, confirmNewPassword: {equalTo: "输入与上面相同的密码"} }, submitHandler: function(form){ loading('正在提交,请稍等...'); form.submit(); }, errorContainer: "#messageBox", errorPlacement: function(error, element) { $("#messageBox").text("输入有误,请先更正。"); if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){ error.appendTo(element.parent().parent()); } else { error.insertAfter(element); } } }); }); </script> </head> <body> <ul class="nav nav-tabs"> <li class="active">用户注册</li> </ul><br/> <form:form id="inputForm" modelAttribute="user" action="${ctx}/sys/register" method="post" class="form-horizontal"> <form:hidden path="id"/> <tags:message content="${message}"/> <div class="control-group"> <label class="control-label">归属公司:</label> <div class="controls"> <tags:treeselect id="company" name="company.id" value="${user.company.id}" labelName="company.name" labelValue="${user.company.name}" title="公司" url="/sys/office/treeData?type=1" cssClass="required"/> </div> </div> <%-- <div class="control-group"> <label class="control-label">归属部门:</label> <div class="controls"> <tags:treeselect id="office" name="office.id" value="${user.office.id}" labelName="office.name" labelValue="${user.office.name}" title="部门" url="/sys/office/treeData?type=2" cssClass="required"/> </div> </div> --%> <div class="control-group"> <label class="control-label">登录名:</label> <div class="controls"> <input id="oldLoginName" name="oldLoginName" type="hidden" value="${user.loginName}"> <form:input path="loginName" htmlEscape="false" maxlength="50" class="required userName"/> </div> </div> <%-- <div class="control-group"> <label class="control-label">工号:</label> <div class="controls"> <form:input path="no" htmlEscape="false" maxlength="50" class="required"/> </div> </div> --%> <div class="control-group"> <label class="control-label">姓名:</label> <div class="controls"> <form:input path="name" htmlEscape="false" maxlength="50" class="required"/> </div> </div> <div class="control-group"> <label class="control-label">密码:</label> <div class="controls"> <input id="newPassword" name="newPassword" type="password" value="" maxlength="50" minlength="3" class="${empty user.id?'required':''}"/> <c:if test="${not empty user.id}"><span class="help-inline">若不修改密码,请留空。</span></c:if> </div> </div> <div class="control-group"> <label class="control-label">确认密码:</label> <div class="controls"> <input id="confirmNewPassword" name="confirmNewPassword" type="password" value="" maxlength="50" minlength="3" equalTo="#newPassword"/> </div> </div> <div class="control-group"> <label class="control-label">邮箱:</label> <div class="controls"> <form:input path="email" htmlEscape="false" maxlength="100" class="email"/> </div> </div> <div class="control-group"> <label class="control-label">电话:</label> <div class="controls"> <form:input path="phone" htmlEscape="false" maxlength="100"/> </div> </div> <div class="control-group"> <label class="control-label">手机:</label> <div class="controls"> <form:input path="mobile" htmlEscape="false" maxlength="100"/> </div> </div> <div class="control-group"> <label class="control-label">备注:</label> <div class="controls"> <form:textarea path="remarks" htmlEscape="false" rows="3" maxlength="200" class="input-xlarge"/> </div> </div> <%-- <div class="control-group"> <label class="control-label">用户类型:</label> <div class="controls"> <form:select path="userType"> <form:option value="" label="请选择"/> <form:options items="${fns:getDictList('sys_user_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/> </form:select> </div> </div> --%> <div class="form-actions"> <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp; <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/> </div> </form:form> </body> </html>
high
0.396035
99,923
(*--------------------------------------------------------------------------- Copyright 2014 Microsoft 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. File: VHub.Provider.fs Description: Image/Video Recognition Provider (per companies/institution) Author: Jin Li, Principal Researcher Microsoft Research, One Microsoft Way Email: jinl at microsoft dot com Date: Nov. 2014 ---------------------------------------------------------------------------*) namespace VMHub.ServiceEndpoint open System open System.Web open System.IO open System.Collections.Generic open System.Collections.Concurrent open System.Net open System.Threading open System.Threading.Tasks open System.Diagnostics open Prajna.Tools open Prajna.Tools.StringTools open Prajna.Tools.FSharp open Prajna.Tools.HttpBuilderHelper open Prajna.Core open Prajna.Service.ServiceEndpoint open VMHub.Data type VHubDomainFlag = | VHubSpecificDomain = '#' | VHubAllDomain = '*' type VHubRecogResultHelper() = static member FixedClassificationResultItem( info: string ) = RecogReply ( Confidence = 1.0, Description = info, PerfInformation = "<null>", Result = null, AuxData = [| VHubSetting.ImageNotFoundGuid |] ) static member val UnidentifiedObjectClassificationResultItem = VHubRecogResultHelper.FixedClassificationResultItem( "Unidentified Object" ) with get static member val ServiceNotAvailableClassificationResultItem = VHubRecogResultHelper.FixedClassificationResultItem( "No Service" ) with get static member val ServiceBusyClassificationResultItem = VHubRecogResultHelper.FixedClassificationResultItem( "All servers are busy" ) with get static member FixedClassificationResult( info: string, subinfo: string ) = RecogReply ( Confidence = 1.0, Description = info, PerfInformation = subinfo, Result = null, // subinfo is not carried over. Text.Encoding.UTF8.GetBytes( subinfo ), AuxData = [| VHubSetting.ImageNotFoundGuid |] ) static member val NotImplementedClassificationResult = VHubRecogResultHelper.FixedClassificationResult( "Not implemented", "Not implemented" ) with get static member val UnidentifiedObjectClassificationResult = VHubRecogResultHelper.FixedClassificationResult( "Unidentified Object", "Unidentified Object" ) with get static member val ServiceNotAvailableClassificationResult = VHubRecogResultHelper.FixedClassificationResult( "No Service", "No Service" ) with get static member val ServiceBusyClassificationResult = VHubRecogResultHelper.FixedClassificationResult( "All servers are busy", "All servers are busy" ) with get static member val TimeoutClassificationResult = VHubRecogResultHelper.FixedClassificationResult( "Query Timeout", "Query Timeout" ) with get // Constant that uniquely identifies the codec format of RecogReply static member val RecogReplyCodecGuid = Guid( "358C8C8B-AFA1-48D2-8910-695B7F78397D" ) with get // Encode a reply, with the associate id back to server. static member Pack( x: RecogReply, ms: Stream ) = ms.WriteDouble( x.Confidence ) ms.WriteString( x.Description ) ms.WriteBytesWLen( x.Result ) let lenAuxData = if Utils.IsNull x.AuxData then 0 else x.AuxData.Length ms.WriteVInt32( lenAuxData ) for i = 0 to lenAuxData - 1 do ms.WriteBytes( x.AuxData.[i].ToByteArray() ) // Decode a reply static member Unpack( ms: Stream ) = try let confidence = ms.ReadDouble() let description = ms.ReadString() let result = ms.ReadBytesWLen() let lenAuxData = ms.ReadVInt32() let auxData = if lenAuxData <= 0 then null else let buf = Array.zeroCreate<_> 16 let guidArray = Array.zeroCreate<_> lenAuxData for i = 0 to lenAuxData - 1 do ms.ReadBytes( buf ) |> ignore guidArray.[i] <- Guid(buf) guidArray let reply = RecogReply ( Confidence = confidence, Description = description, Result = result, AuxData = auxData ) reply with | e -> VHubRecogResultHelper.FixedClassificationResult( "Failed to Deserialize Classification Result", "Exception in Reading" ) type VHubRecogRequestHelper() = // Constant that uniquely identifies the codec format of RecogReply static member val RecogRequestCodecGuid = Guid( "49FEF817-52C5-4892-ADBF-90435A07568C" ) with get static member Pack( x:RecogRequest, ms: Stream ) = ms.WriteBytesWVLen( x.Data ) ms.WriteBytesWVLen( x.AuxData ) static member Unpack( ms: Stream ) = let data = ms.ReadBytesWVLen() let auxdata = ms.ReadBytesWVLen() RecogRequest( Data=data, AuxData=auxdata ) /// <summary> /// Information about the current provider and version /// </summary> [<AllowNullLiteral>] type VHubAppInfo() = /// <summary> /// Provider version, in a.b.c.d. Each of a, b, c, d should be from 0..255, and a should be from 0 to 255 the provider version is represented as an unsigned integer. /// </summary> member val ProviderVersion = 0u with get, set member x.VersionString with get() = let arr = System.BitConverter.GetBytes(x.ProviderVersion) |> Array.rev let addr = arr |> Array.map ( fun b -> b.ToString() ) |> String.concat "." addr.ToString() and set( str: string ) = let arr = str.Split([|'.'|]) |> Array.map( System.Byte.Parse ) |> Array.rev x.ProviderVersion <- System.BitConverter.ToUInt32( arr, 0 ) member val HostName = "" with get, set member val ProviderID = Guid.Empty with get, set static member Pack( x:VHubAppInfo, ms: Stream ) = ms.WriteBytes( x.ProviderID.ToByteArray() ) ms.WriteUInt32( x.ProviderVersion ) ms.WriteStringV( x.HostName ) ms static member Unpack( ms: Stream ) = let buf = Array.zeroCreate<_> 16 ms.ReadBytes( buf ) |> ignore let providerID = Guid( buf ) let providerVersion = ms.ReadUInt32() let hostName = ms.ReadStringV() VHubAppInfo( ProviderID = providerID, ProviderVersion=providerVersion, HostName = hostName )
high
0.642163
99,924
(ns mazes.grids.naive (:require [clojure.string :as str])) (defrecord Cell [top right bottom left]) (defn make-row [cols] (vec (map (fn [_] (Cell. true true true true)) (range cols)))) (defn make-grid [rows cols] (vec (map (fn [_] (make-row cols)) (range rows)))) (defn num-rows [grid] (count grid)) (defn num-cols [grid] (count (first grid))) (defn locations [grid] (reduce concat (map (fn [r] (map (fn [c] [r c]) (range (num-cols grid)))) (range (num-rows grid))))) (defn col [loc] (last loc)) (defn row [loc] (first loc)) ;; Returns the opposite side of a given side. (defn opposite [side] (get {:top :bottom :bottom :top :right :left :left :right} side)) ;; Returns the loc to the given side of loc. (defn loc-to [side loc] (cond (= side :top) [(- (row loc) 1) (col loc)] (= side :bottom) [(+ (row loc) 1) (col loc)] (= side :left) [(row loc) (- (col loc) 1)] (= side :right) [(row loc) (+ (col loc) 1)])) ;; Returns the wall that connects loc1 to loc2, from loc1's perspective. (defn connection [loc1 loc2] (let [col-offset (- (col loc2) (col loc1)) row-offset (- (row loc2) (row loc1))] (cond (= col-offset 0) (cond (= row-offset 1) :bottom (= row-offset -1) :top :else nil) (= row-offset 0) (cond (= col-offset 1) :right (= col-offset -1) :left :else nil) :else nil))) (defn link [grid loc1 loc2] (let [cell1 (get-in grid loc1) cell2 (get-in grid loc2)] (assoc-in (assoc-in grid loc1 (assoc cell1 (connection loc1 loc2) false)) loc2 (assoc cell2 (connection loc2 loc1) false)))) (defn linked? [grid loc1 loc2] (let [cell1 (get-in grid loc1)] (if-let [shared-side (connection loc1 loc2)] (not (get cell1 shared-side)) false))) (defn contains-loc? [grid loc] (let [row (row loc) col (col loc)] (and (>= row 0) (>= col 0) (< row (num-rows grid)) (< col (num-cols grid))))) (defn neighbors [grid loc] (reduce (fn [valid side] (let [neighbor (loc-to side loc)] (if (contains-loc? grid neighbor) (assoc valid side neighbor) valid))) {} [:top :bottom :left :right])) (defn linked-neighbors [grid loc] (let [all-neighbors (neighbors grid loc)] (filter #(linked? grid loc (second %1)) all-neighbors))) (defn annotate "Associate extra metadata with a given location." [grid data loc] (let [cell (get-in grid loc)] (assoc-in grid loc (merge cell data))))
high
0.505014
99,925
import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_unionad/bannerad/BannerAdView.dart'; import 'package:flutter_unionad/drawfeedad/DrawFeedAdView.dart'; import 'package:flutter_unionad/flutter_unionad.dart'; import 'package:flutter_unionad/flutter_unionad_code.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_unionad/nativead/NativeAdView.dart'; import 'package:flutter_unionad/splashad/SplashAdView.dart'; /// 描述:字节跳动 穿山甲广告flutter版 /// @author guozi /// @e-mail gstory0404@gmail.com /// @time 2020/3/11 const MethodChannel _channel = const MethodChannel('flutter_unionad'); const EventChannel adEventEvent = EventChannel("com.gstory.flutter_unionad/adevent"); ///sdk注册初始化 Future<bool> register({ required String iosAppId, required String androidAppId, bool? useTextureView, required String appName, bool? allowShowNotify, bool? allowShowPageWhenScreenLock, bool? debug, bool? supportMultiProcess, List<int>? directDownloadNetworkType, }) async { return await _channel.invokeMethod("register", { "iosAppId": iosAppId, "androidAppId": androidAppId, "useTextureView": useTextureView ?? false, "appName": appName, "allowShowNotify": allowShowNotify ?? true, "allowShowPageWhenScreenLock": allowShowPageWhenScreenLock ?? false, "debug": debug ?? false, "supportMultiProcess": supportMultiProcess ?? false, "directDownloadNetworkType": directDownloadNetworkType != null && directDownloadNetworkType.length > 0 ? directDownloadNetworkType : [ NetCode.NETWORK_STATE_MOBILE, NetCode.NETWORK_STATE_2G, NetCode.NETWORK_STATE_3G, NetCode.NETWORK_STATE_4G, NetCode.NETWORK_STATE_WIFI ] }); } ///请求权限 Future<int> requestPermissionIfNecessary() async { return await _channel.invokeMethod("requestPermissionIfNecessary"); } ///获取SDK版本号 Future<String> getSDKVersion() async { return await _channel.invokeMethod("getSDKVersion"); } ///banner广告 Widget bannerAdView( {bool? mIsExpress, required String androidCodeId, required String iosCodeId, bool? supportDeepLink, required int expressAdNum, int? expressTime, double? expressViewWidth, double? expressViewHeight, BannerAdCallBack? callBack}) { return BannerAdView( mIsExpress: mIsExpress ?? false, androidCodeId: androidCodeId, iosCodeId: iosCodeId, supportDeepLink: supportDeepLink ?? true, expressViewWidth: expressViewWidth ?? 400, expressViewHeight: expressViewHeight ?? 200, expressAdNum: expressAdNum, expressTime: expressTime ?? 30, callBack: callBack, ); } ///开屏广告 Widget splashAdView( {bool? mIsExpress, required String androidCodeId, required String iosCodeId, bool? supportDeepLink, double? expressViewWidth, double? expressViewHeight, SplashAdCallBack? callBack}) { return SplashAdView( mIsExpress: mIsExpress ?? false, androidCodeId: androidCodeId, iosCodeId: iosCodeId, supportDeepLink: supportDeepLink ?? true, expressViewWidth: expressViewWidth ?? 0.0, expressViewHeight: expressViewHeight ?? 0.0, callBack: callBack, ); } ///信息流广告 Widget nativeAdView( {bool? mIsExpress, required String androidCodeId, required String iosCodeId, bool? supportDeepLink, required double expressViewWidth, required double expressViewHeight, required int expressNum, NativeAdCallBack? callBack}) { return NativeAdView( mIsExpress: mIsExpress ?? false, androidCodeId: androidCodeId, iosCodeId: iosCodeId, supportDeepLink: supportDeepLink ?? true, expressViewWidth: expressViewWidth, expressViewHeight: expressViewHeight, expressNum: expressNum, callBack: callBack, ); } ///插屏广告 @Deprecated("推荐使用新模板渲染插屏 loadFullScreenVideoAdInteraction") Future<bool> interactionAd({ bool? mIsExpress, required String androidCodeId, required String iosCodeId, bool? supportDeepLink, required double expressViewWidth, required double expressViewHeight, required int expressNum, }) async { return await _channel.invokeMethod("interactionAd", { "mIsExpress": mIsExpress ?? false, "androidCodeId": androidCodeId, "iosCodeId": iosCodeId, "supportDeepLink": supportDeepLink ?? true, "expressViewWidth": expressViewWidth, "expressViewHeight": expressViewHeight, "expressNum": expressNum, }); } ///激励视频广告预加载 Future<bool> loadRewardVideoAd({ bool? mIsExpress, required String androidCodeId, required String iosCodeId, bool? supportDeepLink, double? expressViewWidth, double? expressViewHeight, required String rewardName, required int rewardAmount, required String userID, int? orientation, String? mediaExtra, }) async { return await _channel.invokeMethod("loadRewardVideoAd", { "mIsExpress": mIsExpress ?? false, "androidCodeId": androidCodeId, "iosCodeId": iosCodeId, "supportDeepLink": supportDeepLink ?? true, "expressViewWidth": expressViewWidth ?? 750, "expressViewHeight": expressViewHeight ?? 1080, "rewardName": rewardName, "rewardAmount": rewardAmount, "userID": userID, "orientation": orientation ?? 0, "mediaExtra": mediaExtra ?? "" }); } ///显示激励广告 Future<bool> showRewardVideoAd() async { return await _channel.invokeMethod("showRewardVideoAd", {}); } ///draw视频广告 Widget drawFeedAdView({ bool? mIsExpress, required String androidCodeId, required String iosCodeId, bool? supportDeepLink, required double expressViewWidth, required double expressViewHeight, DrawFeedAdCallBack? callBack, }) { return DrawFeedAdView( mIsExpress: mIsExpress ?? false, androidCodeId: androidCodeId, iosCodeId: iosCodeId, supportDeepLink: supportDeepLink ?? true, expressViewWidth: expressViewWidth, expressViewHeight: expressViewHeight, callBack: callBack, ); } ///个性化模板全屏广告 @Deprecated("推荐使用新模板渲染插屏 loadFullScreenVideoAdInteraction") Future<bool> fullScreenVideoAd( {bool? mIsExpress, required String androidCodeId, required String iosCodeId, bool? supportDeepLink, int? orientation}) async { return await _channel.invokeMethod("fullScreenVideoAd", { "mIsExpress": mIsExpress ?? false, "androidCodeId": androidCodeId, "iosCodeId": iosCodeId, "supportDeepLink": supportDeepLink ?? true, "orientation": orientation ?? AdOrientation.VERTICAL, }); } ///预加载新模板渲染插屏 分为全屏和插屏,全屏和插屏场景下开发者都可以选择投放的广告类型,分别为图片+视频、仅视频、仅图片。 Future<bool> loadFullScreenVideoAdInteraction( {required String androidCodeId, required String iosCodeId, bool? supportDeepLink, int? orientation}) async { return await _channel.invokeMethod("loadFullScreenVideoAdInteraction", { "androidCodeId": androidCodeId, "iosCodeId": iosCodeId, "supportDeepLink": supportDeepLink ?? true, "orientation": orientation ?? AdOrientation.VERTICAL, }); } ///显示新模板渲染插屏 分为全屏和插屏,全屏和插屏场景下开发者都可以选择投放的广告类型,分别为图片+视频、仅视频、仅图片。 Future<bool> showFullScreenVideoAdInteraction() async { return await _channel.invokeMethod("showFullScreenVideoAdInteraction", {}); }
high
0.688303
99,926
theory Foo2 imports "../Nominal2" begin (* Contrived example that has more than one binding clause *) atom_decl name nominal_datatype foo: trm = Var "name" | App "trm" "trm" | Lam x::"name" t::"trm" binds x in t | Let1 a1::"assg" t1::"trm" a2::"assg" t2::"trm" binds "bn a1" in t1, binds "bn a2" in t2 | Let2 x::"name" y::"name" t1::"trm" t2::"trm" binds x y in t1, binds y in t2 and assg = As_Nil | As "name" x::"name" t::"trm" "assg" binder bn::"assg \<Rightarrow> atom list" where "bn (As x y t a) = [atom x] @ bn a" | "bn (As_Nil) = []" thm foo.bn_defs thm foo.permute_bn thm foo.perm_bn_alpha thm foo.perm_bn_simps thm foo.bn_finite thm foo.distinct thm foo.induct thm foo.inducts thm foo.strong_induct thm foo.exhaust thm foo.strong_exhaust thm foo.fv_defs thm foo.bn_defs thm foo.perm_simps thm foo.eq_iff thm foo.fv_bn_eqvt thm foo.size_eqvt thm foo.supports thm foo.fsupp thm foo.supp thm foo.fresh thm foo.size end
high
0.623349
99,927
open Stdune module Layout = Layout module Mode = Mode module Util = Util module Version = Version (* See [doc/dev/cache.md] for design and implementation notes. *) module Store_result = struct type t = | Stored | Already_present | Error of exn | Will_not_store_due_to_non_determinism of Sexp.t let combine x y = match (x, y) with | Will_not_store_due_to_non_determinism details, _ -> Will_not_store_due_to_non_determinism details | _, Will_not_store_due_to_non_determinism details -> Will_not_store_due_to_non_determinism details | Error e, _ -> Error e | _, Error e -> Error e | Stored, _ -> Stored | _, Stored -> Stored | Already_present, Already_present -> Already_present let empty = Already_present let of_write_result (t : Util.Write_result.t) = match t with | Ok -> Stored | Already_present -> Already_present | Error exn -> Error exn end module Restore_result = struct type 'data t = | Restored of 'data | Not_found_in_cache | Error of exn let bind t ~f = match t with | Restored data -> f data | (Not_found_in_cache | Error _) as res -> res let map t ~f = match t with | Restored data -> Restored (f data) | (Not_found_in_cache | Error _) as res -> res end let restore_file_content path : string Restore_result.t = match Io.read_file ~binary:false path with | contents -> Restored contents | exception Sys_error (_some_error_message : string) -> (* CR-someday amokhov: [Io.read_file] doesn't raise "typed" exceptions like [Unix_error], so we guess here that the exception means "file not found". Can we make the API of [Io] more precise? *) Not_found_in_cache | exception e -> (* This code path might be unreachable until the above is resolved. *) Error e module Matches_existing_query = struct type t = | Match | Mismatch of Sexp.t end (* Store [metadata] corresponding to a given [rule_or_action_digest] to the cache using the supplied [to_sexp] serializer. If the cache already contains an entry for the hash, we use [matches_existing_entry] to check that the given [content] matches the previously stored one. If this is not the case, we return [Will_not_store_due_to_non_determinism]. *) let store_metadata ~mode ~rule_or_action_digest ~metadata ~to_sexp ~matches_existing_entry : Store_result.t = let content = Csexp.to_string (to_sexp metadata) in let path_in_cache = Layout.metadata_path ~rule_or_action_digest in match Util.write_atomically ~mode ~content path_in_cache with | Ok -> Stored | Error e -> Error e | Already_present -> ( match restore_file_content path_in_cache with | Not_found_in_cache -> (* This can actually happen, but we think it's an unlikely case. The [Already_present] branch should already be rarely visited (only if multiple build systems attempt to store the same entry), but also a trimmer must be running in parallel to delete this file. *) Error (Failure "Race in store_metadata") | Error e -> Error e | Restored existing_content -> ( match (matches_existing_entry metadata ~existing_content : Matches_existing_query.t) with | Mismatch details -> Will_not_store_due_to_non_determinism details | Match -> (* At this point we could in principle overwrite the existing metadata file with the new [content] because it seems fresher. We choose not to do that because in practice we end up here only due to racing. The racing processes are not totally ordered, so neither content is really fresher than the other. *) Already_present)) let restore_metadata_file file ~of_sexp : _ Restore_result.t = Restore_result.bind (restore_file_content file) ~f:(fun content -> match Csexp.parse_string content with | Ok sexp -> ( match of_sexp sexp with | Ok content -> Restored content | Error e -> Error e) | Error (_offset, msg) -> Error (Failure msg)) (* Read a metadata file corresponding to a given [rule_or_action_digest] from the cache and parse it using the supplied [of_sexp] parser. *) let restore_metadata ~rule_or_action_digest ~of_sexp : _ Restore_result.t = restore_metadata_file (Layout.metadata_path ~rule_or_action_digest) ~of_sexp module Raw_value = struct let store_unchecked ~mode ~content ~content_digest = Util.write_atomically ~mode ~content (Layout.value_path ~value_digest:content_digest) end module Value = struct module Metadata_file = struct type t = { metadata : Sexp.t list ; value_digest : Digest.t } let to_sexp { metadata; value_digest } = Sexp.List [ List (Atom "metadata" :: metadata) ; List [ Atom "value"; Sexp.Atom (Digest.to_string value_digest) ] ] let of_sexp = function | Sexp.List [ List (Atom "metadata" :: metadata) ; List [ Atom "value"; Sexp.Atom value_hash ] ] -> ( match Digest.from_hex value_hash with | Some value_digest -> Ok { metadata; value_digest } | None -> Error (Failure "Cannot parse cache metadata: malformed value digest")) | _ -> Error (Failure "Cannot parse cache metadata") let restore ~action_digest = restore_metadata ~rule_or_action_digest:action_digest ~of_sexp let matches_existing_entry t ~existing_content : Matches_existing_query.t = match Csexp.parse_string existing_content with | Error _ -> Mismatch (Atom "Malformed value in cache") | Ok sexp -> ( match of_sexp sexp with | Error _ -> Mismatch (Atom "Malformed value in cache") | Ok existing -> ( match Digest.equal t.value_digest existing.value_digest with | true -> Match | false -> Mismatch (Sexp.record [ ("in_cache", Atom (Digest.to_string existing.value_digest)) ; ("computed", Atom (Digest.to_string t.value_digest)) ]))) end let store ~mode ~action_digest value : Store_result.t = let value_digest = Digest.string value in let metadata : Metadata_file.t = { metadata = []; value_digest } in match store_metadata ~mode ~rule_or_action_digest:action_digest ~metadata ~to_sexp:Metadata_file.to_sexp ~matches_existing_entry:Metadata_file.matches_existing_entry with | Will_not_store_due_to_non_determinism details -> Will_not_store_due_to_non_determinism details | Error e -> Error e | (Already_present | Stored) as metadata_result -> (* We assume that there are no hash collisions and hence omit the check for non-determinism when writing values. *) let value_result = Raw_value.store_unchecked ~mode ~content:value ~content_digest:value_digest |> Store_result.of_write_result in Store_result.combine metadata_result value_result let restore ~action_digest = Restore_result.bind (Metadata_file.restore ~action_digest) ~f:(fun ({ value_digest; _ } : Metadata_file.t) -> restore_file_content (Layout.value_path ~value_digest)) end module Artifacts = struct module Metadata_entry = struct type t = { file_name : string ; file_digest : Digest.t } let equal x y = Digest.equal x.file_digest y.file_digest && String.equal x.file_name y.file_name let to_sexp { file_name; file_digest } = Sexp.List [ Atom file_name; Atom (Digest.to_string file_digest) ] let of_sexp = function | Sexp.List [ Atom file_name; Atom file_digest ] -> ( match Digest.from_hex file_digest with | Some file_digest -> Ok { file_name; file_digest } | None -> Error (Failure (sprintf "Cannot parse file digest %s in cache metadata entry" file_digest))) | _ -> Error (Failure "Cannot parse cache metadata entry") end module Metadata_file = struct type t = { metadata : Sexp.t list ; (* The entries are listed in the same order that they were provided when storing artifacts in the cache. We keep the order to avoid confusion even though sorting the entres is tempting. *) entries : Metadata_entry.t list } let to_sexp { metadata; entries } = Sexp.List [ List (Atom "metadata" :: metadata) ; List (Atom "files" :: List.map entries ~f:Metadata_entry.to_sexp) ] let of_sexp = function | Sexp.List [ List (Atom "metadata" :: metadata); List (Atom "files" :: entries) ] -> ( let entries = List.map entries ~f:Metadata_entry.of_sexp in match Result.List.all entries with | Ok entries -> Ok { metadata; entries } | Error e -> Error e) | _ -> Error (Failure "Cannot parse cache metadata") let matches_existing_entry t ~existing_content : Matches_existing_query.t = match Csexp.parse_string existing_content with | Error _ -> Mismatch (Atom "Malformed value in cache") | Ok sexp -> ( match of_sexp sexp with | Error _ -> Mismatch (Atom "Malformed value in cache") | Ok existing -> ( match List.equal Metadata_entry.equal t.entries existing.entries with | true -> Match | false -> Mismatch (Sexp.record [ ( "in_cache" , Sexp.List (List.map ~f:Metadata_entry.to_sexp existing.entries) ) ; ( "computed" , Sexp.List (List.map ~f:Metadata_entry.to_sexp t.entries) ) ]))) let store t ~mode ~rule_digest = store_metadata ~mode ~rule_or_action_digest:rule_digest ~metadata:t ~to_sexp ~matches_existing_entry let restore ~rule_digest = restore_metadata ~rule_or_action_digest:rule_digest ~of_sexp end let list ~rule_digest = Restore_result.map (Metadata_file.restore ~rule_digest) ~f:(fun ({ entries; _ } : Metadata_file.t) -> entries) end module Metadata = struct type t = | Artifacts of Artifacts.Metadata_file.t | Value of Value.Metadata_file.t let of_sexp sexp : (t, exn) result = match Artifacts.Metadata_file.of_sexp sexp with | Ok res -> Ok (Artifacts res) | Error _exn -> (* CR-someday amokhov: Here we are discarding the [_exn] but it may be better to combine the two exceptions when both parsers fail. *) Result.map (Value.Metadata_file.of_sexp sexp) ~f:(fun res -> Value res) let restore ~metadata_path ~rule_or_action_digest = restore_metadata_file (metadata_path ~rule_or_action_digest) ~of_sexp module Versioned = struct let restore version = restore ~metadata_path:(Layout.Versioned.metadata_path version) end let restore = restore ~metadata_path:Layout.metadata_path end let with_temp_file ?(prefix = "dune") ~suffix f = Fiber_util.Temp.with_temp_file ~dir:Layout.temp_dir ~prefix ~suffix ~f let with_temp_dir ?(prefix = "dune") ~suffix f = Fiber_util.Temp.with_temp_dir ~parent_dir:Layout.temp_dir ~prefix ~suffix ~f
high
0.821299
99,928
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE NoImplicitPrelude #-} -- | -- Module : Massalia.Morpheus -- Description : A reexport of the handy functions and types from "Morpheus". module Massalia.Morpheus ( interpreter ) where import Data.Morpheus ( interpreter )
high
0.4993
99,929
// 例6-1 function inherit(p) { if (p == null) throw TypeError(); if (Object.create) { return Object.create(p); } if (typeof p !== "object" && typeof p !== "function") throw TypeError(); var f = function() {}; f.prototype = p; return new f(); } // 例6-2 function extend(o, base) { for (p in base) { o[p] = base[p]; } return o; }
high
0.359584
99,930
package I_Am_Ada is procedure Ada_Procedure; end I_Am_Ada;
low
0.657743
99,931
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Tizen IoT Extension SDK 1.0: /home/hongkukson/_tizen_SES/SmartThingsThing_public_iot/capi/st_thing_resource_api/inc/smartthings_payload.h File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Tizen IoT Extension SDK 1.0 &#160;<span id="projectnumber">1.0.0</span> </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.6.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File&#160;List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('smartthings__payload_8h.html',''); </script> <div id="doc-content"> <div class="header"> <div class="summary"> <a href="#typedef-members">Typedefs</a> &#124; <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">/home/hongkukson/_tizen_SES/SmartThingsThing_public_iot/capi/st_thing_resource_api/inc/smartthings_payload.h File Reference</div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><code>#include &lt;stdio.h&gt;</code><br/> <code>#include &lt;stdlib.h&gt;</code><br/> <code>#include &lt;stdbool.h&gt;</code><br/> </div> <p><a href="smartthings__payload_8h_source.html">Go to the source code of this file.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="typedef-members"></a> Typedefs</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3150af182e5ef467da7b0f1f393b677b"></a><!-- doxytag: member="smartthings_payload.h::smartthings_payload_h" ref="ga3150af182e5ef467da7b0f1f393b677b" args="" --> typedef struct <br class="typebreak"/> smartthings_payload_s *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a></td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The SmartThings payload handle. 1. <br/></td></tr> <tr><td colspan="2"><h2><a name="func-members"></a> Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gaabe2cc4a63b5a021f67718fa8086155a">smartthings_payload_create</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> *payload)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a SmartThings payload handle. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gaabe2cc4a63b5a021f67718fa8086155a"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga1c4301a2a787340331ef2b60258895a2">smartthings_payload_destroy</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys a SmartThings payload handle and releases all its resources. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga1c4301a2a787340331ef2b60258895a2"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga040b8f5670fce61056e8ce0e4217185b">smartthings_payload_set_int</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, int value)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets an integer value for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga040b8f5670fce61056e8ce0e4217185b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga4412a398b8067e0097def72d887a32b6">smartthings_payload_set_bool</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, bool value)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a boolean value for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga4412a398b8067e0097def72d887a32b6"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga7566fe016dd530628b6e57eea8e4f8f8">smartthings_payload_set_double</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, double value)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a double value for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga7566fe016dd530628b6e57eea8e4f8f8"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga8ed85c7347280de35da5eebb3f6475f1">smartthings_payload_set_string</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, const char *value)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a string value for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga8ed85c7347280de35da5eebb3f6475f1"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga81a8cf71668b1547d1df3a3a8b97815c">smartthings_payload_set_byte_string</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, const char *value, unsigned int length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a byte string value and length for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga81a8cf71668b1547d1df3a3a8b97815c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gabca4711b9f890848d88b27d6e4d9d9d7">smartthings_payload_set_object</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, <a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> value)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets an object value for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gabca4711b9f890848d88b27d6e4d9d9d7"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga2de3cb13c9d9d989db25251ec3f3492e">smartthings_payload_set_int_array</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, const int *array, unsigned int length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets an integer array for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga2de3cb13c9d9d989db25251ec3f3492e"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gab79c3566408b078134d9a98ee1f8a6f4">smartthings_payload_set_bool_array</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, const bool *array, unsigned int length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a boolean array for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gab79c3566408b078134d9a98ee1f8a6f4"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gaffb0cb025dcb6f47f8fbd45c2e77cdad">smartthings_payload_set_double_array</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, const double *array, unsigned int length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a double array for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gaffb0cb025dcb6f47f8fbd45c2e77cdad"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga8a699d37d4801673b66dd5ef8333c79d">smartthings_payload_set_string_array</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, const char **array, unsigned int length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a string array for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga8a699d37d4801673b66dd5ef8333c79d"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga32188c92f2d4602fd6daf8f2ef45c5bf">smartthings_payload_set_object_array</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, <a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> *array, unsigned int length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets an object array for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga32188c92f2d4602fd6daf8f2ef45c5bf"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga62ee22485124feb188012493a4db8a4b">smartthings_payload_add_collection_object</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *resource_uri, <a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> value)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a payload for child resource of collection resource. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga62ee22485124feb188012493a4db8a4b"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gac398c500b2d464f469183fb1865ea81c">smartthings_payload_get_int</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, int *value)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets an integer value for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gac398c500b2d464f469183fb1865ea81c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga9a94581a268b84fb76e50f5398ea774c">smartthings_payload_get_bool</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, bool *value)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a boolean value for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga9a94581a268b84fb76e50f5398ea774c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga971f8554b5802f8d0ac864aa72032d87">smartthings_payload_get_double</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, double *value)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a double value for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga971f8554b5802f8d0ac864aa72032d87"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gad9ee33897be43a9c1560d847b3096a7e">smartthings_payload_get_string</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, char **value)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a string value for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gad9ee33897be43a9c1560d847b3096a7e"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3f12e22c44562d96f51f73fa3d461f27">smartthings_payload_get_byte_string</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, char **value, unsigned int *length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a byte string value and length for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3f12e22c44562d96f51f73fa3d461f27"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gab3d290cb83b8d55571f074b848459c20">smartthings_payload_get_object</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, <a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> *value)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets an object value for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gab3d290cb83b8d55571f074b848459c20"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga9912900e0c03114fe019cd0e6715f412">smartthings_payload_get_int_array</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, int **array, unsigned int *length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets an integer array for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga9912900e0c03114fe019cd0e6715f412"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga5908ad60c83a5e5cc808cffafd90ce70">smartthings_payload_get_bool_array</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, bool **array, unsigned int *length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a boolean array for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga5908ad60c83a5e5cc808cffafd90ce70"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga4b4b6d5149eb396dda36172db4f7acb2">smartthings_payload_get_double_array</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, double **array, unsigned int *length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a double array for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga4b4b6d5149eb396dda36172db4f7acb2"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gae992dca6b3e7b54562c544526918cb17">smartthings_payload_get_string_array</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, char ***array, unsigned int *length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a string array for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gae992dca6b3e7b54562c544526918cb17"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga6c9064076216746e63dd8b55bdbcca9c">smartthings_payload_get_object_array</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *attr_name, <a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> **array, unsigned int *length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets an object array for the attribute name. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga6c9064076216746e63dd8b55bdbcca9c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga61330175edd5f0399f336e9edfc45401">smartthings_payload_get_collection_object</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload, const char *resource_uri, <a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> *value)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets a payload for child resource of collection resource. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga61330175edd5f0399f336e9edfc45401"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga4062fc785b4bc904885f6d046a52aded">smartthings_payload_release_int_array</a> (int *array)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases an integer array of the SmartThings payload. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga4062fc785b4bc904885f6d046a52aded"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga6a91a1f78e64dc6874dc7bd1c86b02f0">smartthings_payload_release_bool_array</a> (bool *array)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases a boolean array of the SmartThings payload. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga6a91a1f78e64dc6874dc7bd1c86b02f0"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gaf4d215e2793f1e42cd80ec0628c6e4b0">smartthings_payload_release_double_array</a> (double *array)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases a double array of the SmartThings payload. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gaf4d215e2793f1e42cd80ec0628c6e4b0"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga7a34b84cbe30565b511d6043f456619f">smartthings_payload_release_string_array</a> (char **array, unsigned int length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases a string array of the SmartThings payload. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga7a34b84cbe30565b511d6043f456619f"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gaf14ccca6562dc62587048ed9e792627c">smartthings_payload_release_object_array</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> *array, unsigned int length)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases an object array of the SmartThings payload. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#gaf14ccca6562dc62587048ed9e792627c"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga1633962f3a32f51393dd6f8e4394125a">smartthings_payload_release_object</a> (<a class="el" href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga3150af182e5ef467da7b0f1f393b677b">smartthings_payload_h</a> payload)</td></tr> <tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Releases a SmartThings payload. 1. <a href="group___c_a_p_i___s_m_a_r_t_t_h_i_n_g_s___t_h_i_n_g___p_a_y_l_o_a_d___m_o_d_u_l_e.html#ga1633962f3a32f51393dd6f8e4394125a"></a><br/></td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"></div></div><!-- contents --> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerator</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="smartthings__payload_8h.html">smartthings_payload.h</a> </li> <li class="footer">Generated on Mon Oct 29 2018 14:48:10 for Tizen IoT Extension SDK 1.0 by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li> </ul> </div> </body> </html>
high
0.29
99,932
data { int N; real X[N]; real Y[N]; } parameters { real a; real b; real<lower=0> sigma; } model { for (n in 1:N){ Y[n] ~ normal(a + b * X[n], sigma); } }
high
0.578502
99,933
to determineProduct() tell application "QuarkXPress" tell document 1 set allBoxes to a reference to every generic box as list end tell end tell repeat with theBox in allBoxes tell application "QuarkXPress" --gets coordinates and sizing if the frame color is "die cut" --uses this info to determine what product it is if name of color of frame of theBox is "Die Cut" then set {y1, x1, y2, x2} to bounds of theBox as list set x1 to (coerce x1 to real) set y1 to (coerce y1 to real) set x2 to (coerce x2 to real) set y2 to (coerce y2 to real) set boxWidth to x2 - x1 set boxHeight to y2 - y1 end if end tell if ((boxWidth = 3.5) and (boxHeight = 9)) then return "QX" else if ((boxWidth = 3.5) and (boxHeight = 9)) then return "QS" else if ((boxWidth = 3.5) and (boxHeight = 2)) then return "BC" end if end repeat end determineProduct set productType to determineProduct() --sets variable in Keyboard Maestro tell application "Keyboard Maestro Engine" make variable with properties {name:"productType", value:productType} end tell
medium
0.502086
99,934
use crate::ffi::pyport::Py_ssize_t; use libc::wchar_t; use std::os::raw::c_char; extern "C" { pub fn Py_DecodeLocale(arg1: *const c_char, size: *mut Py_ssize_t) -> *mut wchar_t; pub fn Py_EncodeLocale(text: *const wchar_t, error_pos: *mut Py_ssize_t) -> *mut c_char; }
high
0.384077
99,935
# This file is a part of Julia. License is MIT: https://julialang.org/license function tohtml(io::IO, m::MIME"text/html", x) show(io, m, x) end function tohtml(io::IO, m::MIME"text/plain", x) htmlesc(io, sprint(show, m, x)) end function tohtml(io::IO, m::MIME"image/png", img) print(io, """<img src="data:image/png;base64,""") print(io, stringmime(m, img)) print(io, "\" />") end function tohtml(m::MIME"image/svg+xml", img) show(io, m, img) end # AbstractDisplay infrastructure function bestmime(val) for mime in ("text/html", "image/svg+xml", "image/png", "text/plain") mimewritable(mime, val) && return MIME(Symbol(mime)) end error("Cannot render $val to Markdown.") end tohtml(io::IO, x) = tohtml(io, bestmime(x), x)
low
0.255753
99,936
#version 150 #extension GL_ARB_compute_shader : enable #extension GL_ARB_shader_image_load_store : enable #extension GL_ARB_separate_shader_objects : enable #extension GL_ARB_gpu_shader5 : enable layout (local_size_x = 16, local_size_y = 16) in; const ivec3 workGroups = ivec3(16, 16, 1); layout (rgba32f) uniform image2D colorimg5; uniform vec2 viewSize; uniform int frameCounter; #include "/lib/utility/universal.glsl" float Pn(float x, int n) { if (n == 0) { return 1.0; } else { float currentR2 = 1.0; float currentR1 = x; for (int currentN = 2; currentN <= n; currentN++) { float currentR = ((2 * currentN - 1) * x * currentR1 - (currentN - 1) * currentR2) / currentN; currentR2 = currentR1; currentR1 = currentR; } return currentR1; } } float DerivativeLegendre(int n, float x) { if (n == 0) { return 0.0; } else { float currentR2 = 1.0; float dcurrentR2dx = 0.0; float currentR1 = x; float dcurrentR1dx = 1.0; for (int currentN = 2; currentN <= n; currentN++) { float currentR = ((2 * currentN - 1) * x * currentR1 - (currentN - 1) * currentR2) / currentN; float dcurrentRdx = ((2 * currentN - 1) * (currentR1 + x * dcurrentR1dx) - (currentN - 1) * dcurrentR2dx) / currentN; currentR2 = currentR1; dcurrentR2dx = dcurrentR1dx; currentR1 = currentR; dcurrentR1dx = dcurrentRdx; } return dcurrentR1dx; } } float ComputePi(float mu, int n) { return DerivativeLegendre(n, mu); } float DerivativePi(float x, int n) { if (n == 0) { return 0.0; } else { float currentR2 = 1.0; float dcurrentR2dx = 0.0; float d2currentR2dx = 0.0; float currentR1 = x; float dcurrentR1dx = 1.0; float d2currentR1dx = 0.0; for (int currentN = 2; currentN <= n; currentN++) { float currentR = ((2 * currentN - 1) * x * currentR1 - (currentN - 1) * currentR2) / currentN; float dcurrentRdx = ((2 * currentN - 1) * (currentR1 + x * dcurrentR1dx) - (currentN - 1) * dcurrentR2dx) / currentN; float d2currentRdx = ((2 * currentN - 1) * (dcurrentR1dx + (dcurrentR1dx + x * d2currentR1dx)) - (currentN - 1) * d2currentR2dx) / currentN; currentR2 = currentR1; dcurrentR2dx = dcurrentR1dx; d2currentR2dx = d2currentR1dx; currentR1 = currentR; dcurrentR1dx = dcurrentRdx; d2currentR1dx = d2currentRdx; } return d2currentR1dx; } } float ComputeTau(float mu, int n) { float mu_sin = sin(acos(mu)); return mu * ComputePi(mu, n) - pow(mu_sin, 2.0) * DerivativePi(mu, n); } void main() { ivec2 fragCoord = ivec2(gl_GlobalInvocationID.xy); float theta = fragCoord.x * (pi / 179.0); float PiN = ComputePi(cos(theta), fragCoord.y); float TauN = ComputeTau(cos(theta), fragCoord.y); imageStore(colorimg5, ivec2(fragCoord), vec4(PiN, TauN, 1.0, 0.0)); }
high
0.734731
99,937
.global s_prepare_buffers s_prepare_buffers: push %r10 push %r12 push %r14 push %r15 push %rax push %rcx push %rdi push %rsi lea addresses_WC_ht+0x9ac4, %r10 nop cmp $24899, %r15 mov $0x6162636465666768, %rax movq %rax, %xmm1 vmovups %ymm1, (%r10) nop nop nop dec %r14 lea addresses_WT_ht+0x1342d, %rsi lea addresses_UC_ht+0x3b84, %rdi nop nop nop nop nop add %r12, %r12 mov $116, %rcx rep movsq nop nop nop nop nop and $37389, %r14 pop %rsi pop %rdi pop %rcx pop %rax pop %r15 pop %r14 pop %r12 pop %r10 ret .global s_faulty_load s_faulty_load: push %r10 push %r11 push %r13 push %r14 push %r9 push %rbp push %rdi // Load lea addresses_UC+0x302c, %r13 clflush (%r13) nop nop nop nop xor %r14, %r14 mov (%r13), %edi nop nop nop nop sub $26079, %r13 // Faulty Load lea addresses_RW+0xa8c4, %r11 nop xor $18964, %r10 vmovaps (%r11), %ymm0 vextracti128 $1, %ymm0, %xmm0 vpextrq $1, %xmm0, %r13 lea oracles, %r11 and $0xff, %r13 shlq $12, %r13 mov (%r11,%r13,1), %r13 pop %rdi pop %rbp pop %r9 pop %r14 pop %r13 pop %r11 pop %r10 ret /* <gen_faulty_load> [REF] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 0, 'same': False}} {'OP': 'LOAD', 'src': {'type': 'addresses_UC', 'size': 4, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} [Faulty Load] {'OP': 'LOAD', 'src': {'type': 'addresses_RW', 'size': 32, 'AVXalign': True, 'NT': True, 'congruent': 0, 'same': True}} <gen_prepare_buffer> {'OP': 'STOR', 'dst': {'type': 'addresses_WC_ht', 'size': 32, 'AVXalign': False, 'NT': False, 'congruent': 3, 'same': False}} {'OP': 'REPM', 'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'dst': {'type': 'addresses_UC_ht', 'congruent': 5, 'same': False}} {'00': 5289, '49': 76} 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 49 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 49 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */
low
0.38356
99,938
(define-method binary+ ((a <fixnum>) (b <fixnum>)) (fixnum+ a b)) (define-method binary+ ((a <double-float>) (b <double-float>)) (float+ a b)) (define-method binary+ ((a <double-float>) (b <double-float>)) (float+ a b)) (define-method binary+ ((a <double-float>) (b <double-float>)) (float+ a b))
low
0.446196
99,939
<?php namespace App\Http\Resources\Lomba; use Illuminate\Http\Resources\Json\ResourceCollection; class LombaCollection extends ResourceCollection { /** * Transform the resource collection into an array. * * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) { if ($this->collection->count() > 0) { return [ 'status' => 'Sukses', 'data' => LombaResource::collection($this->collection), 'meta' => [ 'total_post' => $this->collection->count() ] ]; }else{ return[ 'status' => 'Data Tidak Ditemukan', 'data' => 'Angga Jembut' ]; } } }
high
0.597908
99,940
# Import all plugins from `rel/plugins` # They can then be used by adding `plugin MyPlugin` to # either an environment, or release definition, where # `MyPlugin` is the name of the plugin module. ~w(rel plugins *.exs) |> Path.join() |> Path.wildcard() |> Enum.map(&Code.eval_file(&1)) use Distillery.Releases.Config, # This sets the default release built by `mix distillery.release` default_release: :default, # This sets the default environment used by `mix distillery.release` default_environment: Mix.env() # For a full list of config options for both releases # and environments, visit https://hexdocs.pm/distillery/config/distillery.html # You may define one or more environments in this file, # an environment's settings will override those of a release # when building in that environment, this combination of release # and environment configuration is called a profile environment :dev do # If you are running Phoenix, you should make sure that # server: true is set and the code reloader is disabled, # even in dev mode. # It is recommended that you build with MIX_ENV=prod and pass # the --env flag to Distillery explicitly if you want to use # dev mode. set(dev_mode: true) set(include_erts: false) set( config_providers: [ {Distillery.Releases.Config.Providers.Elixir, ["${RELEASE_ROOT_DIR}/runtime.exs"]} ] ) set( overlays: [ {:copy, "config/runtime.exs", "runtime.exs"} ] ) end environment :prod do set(include_erts: true) set(include_src: false) set(vm_args: "rel/vm.args") set( config_providers: [ {Distillery.Releases.Config.Providers.Elixir, ["${RELEASE_ROOT_DIR}/runtime.exs"]} ] ) set( overlays: [ {:copy, "config/runtime.exs", "runtime.exs"} ] ) end # You may define one or more releases in this file. # If you have not set a default release, or selected one # when running `mix distillery.release`, the first release in the file # will be used by default release :daidoquer2 do set(version: current_version(:daidoquer2)) set( applications: [ :runtime_tools ] ) end
medium
0.654215
99,941
setwd("~/Ghat_sim") rm(list=ls()) library(BGLR) source("Ghat2.R") Pvals.res <- c() Ghat.res <- c() Cor.res <- c() for(sim in 1:100){ iter <- sprintf("%03i",sim) directory="/home/uni08/mahmoud1/Ghat_sim/r_q4" #load genotypes and phenotypes pheno <- read.table(paste(directory, "/Line_1_data_",iter,".txt",sep=""), header=T,stringsAsFactors=F) map <- read.table(paste(directory, "/lm_mrk_",iter,".txt",sep=""), header=T,stringsAsFactors=F) geno <- read.table(paste(directory, "/Line_1_mrk_",iter,".txt",sep=""), header=F,stringsAsFactors=F,skip=1,sep="", colClasses=c("numeric","character")) # read genos as characters #load allele frequencies freqs<-read.table(paste(directory, "/Line_1_freq_mrk_",iter,".txt",sep=""), header=T,fill=T,stringsAsFactors=F) freqs_15 <- freqs[freqs$Gen == 15,] freqs_20 <- freqs[freqs$Gen == 20,] ### Manipulate genotypes by coding to -1,0,1 and so that markers are columns, #individuals are rows. gen <- matrix(NA,nrow=nrow(map),ncol=nrow(geno)) gen <- as.data.frame(gen) names(gen) <- geno[,1] for(i in 1:nrow(geno)){ #print(i) tmp <- as.numeric(unlist(strsplit(geno[i,2],split=""))) tmp[which(tmp == 0)] <- -1 tmp[which(tmp == 3 | tmp ==4)] <- 0 tmp[which(tmp==2)] <- 1 gen[,i] <- tmp } gen<-t(gen) gc() ##### Estimate allel efeects g <- cbind(row.names(gen),data.frame(gen +1)) g$`row.names(gen)`<- NULL nIter=600; burnIn=100 fmBC=BGLR(pheno$Phen,ETA=list( list(X=g,model='BayesC')), nIter=nIter,burnIn=burnIn,saveAt='bc_') se <- data.frame(fmBC$ETA[[1]]$b) ### Calculate allele frequencies # Generation 15 names(freqs_15)[4] <- "Allele1" names(freqs_15)[5]<- "Allele2" freqs_15$Allele2[which(substr(freqs_15$Allele1,1,1)==2)] <- "2:1.00000" # put this in the spot for the second allele freqs_15$Allele1[which(substr(freqs_15$Allele1,1,1)==2)] <- "1:0.00000" freqs_15$Allele2[which(substr(freqs_15$Allele1,3,3)==1)] <- "2:0.00000" ## freqs_15$Allele1 <- as.numeric(substr(freqs_15$Allele1,3,nrow(map))) freqs_15$Allele2 <- as.numeric(substr(freqs_15$Allele2,3,nrow(map))) # Generation 20 names(freqs_20)[4]<- "Allele1" names(freqs_20)[5]<- "Allele2" freqs_20$Allele2[which(substr(freqs_20$Allele1,1,1)==2)] <- "2:1.00000" # put this in the spot for the second allele freqs_20$Allele1[which(substr(freqs_20$Allele1,1,1)==2)] <- "1:0.00000" freqs_20$Allele2[which(substr(freqs_20$Allele1,3,3)==1)] <- "2:0.00000" ## freqs_20$Allele1 <- as.numeric(substr(freqs_20$Allele1,3,nrow(map))) freqs_20$Allele2 <- as.numeric(substr(freqs_20$Allele2,3,nrow(map))) #Calculate change change2<-freqs_20$Allele2-freqs_15$Allele2 ##### load SNP effects test<- Ghat2(effects=se$fmBC.ETA..1...b, change=change2, method = "scale", perms = 1000, num_eff = 2000) Ghat.res[as.numeric(iter)] <- test$Ghat Pvals.res[as.numeric(iter)] <- test$p.val Cor.res[as.numeric(iter)] <- test$Cor } ### Report the results q4_s <- cbind(Ghat.res, Pvals.res, Cor.res) save(q4_s, file = "q4_s.RData") ## ############################ ## ############################ ## ############################ ### Estimating Ghat for the Controlled Populations. setwd("~/Ghat_sim") rm(list=ls()) library(BGLR) source("Ghat2.R") Pvals.res <- c() Ghat.res <- c() Cor.res <- c() for(sim in 1:100){ iter <- sprintf("%03i",sim) directory="/home/uni08/mahmoud1/Ghat_sim/r_q4" #load genotypes and phenotypes pheno <- read.table(paste(directory, "/Line_2_data_",iter,".txt",sep=""), header=T,stringsAsFactors=F) map <- read.table(paste(directory, "/lm_mrk_",iter,".txt",sep=""), header=T,stringsAsFactors=F) geno <- read.table(paste(directory, "/Line_2_mrk_",iter,".txt",sep=""), header=F,stringsAsFactors=F,skip=1,sep="", colClasses=c("numeric","character")) # read genos as characters #load allele frequencies freqs<-read.table(paste(directory, "/Line_2_freq_mrk_",iter,".txt",sep=""), header=T,fill=T,stringsAsFactors=F) freqs_15 <- freqs[freqs$Gen == 15,] freqs_20 <- freqs[freqs$Gen == 20,] ### Manipulate genotypes by coding to -1,0,1 and so that markers are columns, #individuals are rows. gen <- matrix(NA,nrow=nrow(map),ncol=nrow(geno)) gen <- as.data.frame(gen) names(gen) <- geno[,1] for(i in 1:nrow(geno)){ #print(i) tmp <- as.numeric(unlist(strsplit(geno[i,2],split=""))) tmp[which(tmp == 0)] <- -1 tmp[which(tmp == 3 | tmp ==4)] <- 0 tmp[which(tmp==2)] <- 1 gen[,i] <- tmp } gen<-t(gen) gc() ##### Estimate allel efeects g <- cbind(row.names(gen),data.frame(gen +1)) g$`row.names(gen)`<- NULL nIter=600; burnIn=100 fmBC=BGLR(pheno$Phen,ETA=list( list(X=g,model='BayesC')), nIter=nIter,burnIn=burnIn,saveAt='bc_') se <- data.frame(fmBC$ETA[[1]]$b) ### Calculate allele frequencies # Generation 15 names(freqs_15)[4] <- "Allele1" names(freqs_15)[5]<- "Allele2" freqs_15$Allele2[which(substr(freqs_15$Allele1,1,1)==2)] <- "2:1.00000" # put this in the spot for the second allele freqs_15$Allele1[which(substr(freqs_15$Allele1,1,1)==2)] <- "1:0.00000" freqs_15$Allele2[which(substr(freqs_15$Allele1,3,3)==1)] <- "2:0.00000" ## freqs_15$Allele1 <- as.numeric(substr(freqs_15$Allele1,3,nrow(map))) freqs_15$Allele2 <- as.numeric(substr(freqs_15$Allele2,3,nrow(map))) # Generation 20 names(freqs_20)[4]<- "Allele1" names(freqs_20)[5]<- "Allele2" freqs_20$Allele2[which(substr(freqs_20$Allele1,1,1)==2)] <- "2:1.00000" # put this in the spot for the second allele freqs_20$Allele1[which(substr(freqs_20$Allele1,1,1)==2)] <- "1:0.00000" freqs_20$Allele2[which(substr(freqs_20$Allele1,3,3)==1)] <- "2:0.00000" ## freqs_20$Allele1 <- as.numeric(substr(freqs_20$Allele1,3,nrow(map))) freqs_20$Allele2 <- as.numeric(substr(freqs_20$Allele2,3,nrow(map))) #Calculate change change2<-freqs_20$Allele2-freqs_15$Allele2 ##### load SNP effects test<- Ghat2(effects=se$fmBC.ETA..1...b, change=change2, method = "scale", perms=1000, num_eff = 2000) Ghat.res[as.numeric(iter)] <- test$Ghat Pvals.res[as.numeric(iter)] <- test$p.val Cor.res[as.numeric(iter)] <- test$Cor } ### Report the results q4_c <- cbind(Ghat.res, Pvals.res, Cor.res) save(q4_c, file = "q4_c.RData")
high
0.399318
99,942
(in-package :netpbm) ;;;; Peekable Streams --------------------------------------------------------- (defstruct (peekable-stream (:conc-name nil) (:constructor make-peekable-stream (s))) (p nil :type (or null (unsigned-byte 8))) (s (error "Required") :type stream)) (defun read-byte (stream &optional (eof-error-p t)) (if (p stream) (prog1 (p stream) (setf (p stream) nil)) (cl:read-byte (s stream) eof-error-p nil))) (defun peek-byte (stream) (when (null (p stream)) (setf (p stream) (cl:read-byte (s stream)))) (p stream)) (defun unread-byte (stream byte) (assert (null (p stream))) (setf (p stream) byte) (values)) ;;;; Implementation ----------------------------------------------------------- ;;; TODO: We're explicit about ASCII values here, but other places in the code ;;; rely on char-code and friends returning ASCII. Eventually we should ;;; probably fix that. (defconstant +space+ 32) (defconstant +tab+ 9) (defconstant +line-feed+ 10) (defconstant +vertical-tab+ 11) (defconstant +form-feed+ 12) (defconstant +carriage-return+ 13) (defconstant +comment-char+ 35) (defun white-space-p (byte) (if (member byte (list +space+ +form-feed+ +tab+ +vertical-tab+ +line-feed+ +carriage-return+)) t nil)) (defun line-terminator-p (byte) (if (member byte (list +line-feed+ +carriage-return+)) t nil)) (defun skip-comment-body (stream) (loop :until (line-terminator-p (read-byte stream)))) (defun skip-whitespace (stream) (loop :for byte = (read-byte stream nil) :while (white-space-p byte) :finally (unread-byte stream byte))) (defun error-junk (section byte) (error "Junk byte in ~A data: ~D (~S)" section byte (code-char byte))) (defun byte-to-digit (byte) (when (and byte (<= (char-code #\0) byte (char-code #\9))) (- byte (char-code #\0)))) (defun read-raster-number (stream) "Read the next ASCII-encoded number from `stream` (does not allow comments)." (skip-whitespace stream) (loop :with i = nil :for byte = (read-byte stream nil) :for digit = (byte-to-digit byte) :unless (or (null byte) digit (white-space-p byte)) :do (error-junk "raster" byte) :while digit :do (setf i (+ (* (or i 0) 10) digit)) :finally (return i))) (defun read-header-number (stream) "Read the next ASCII-encoded number from `stream` (allows comments)." (skip-whitespace stream) (loop :with i = nil :for byte = (read-byte stream nil) :for digit = (byte-to-digit byte) :while byte :while (cond ((= byte +comment-char+) (skip-comment-body stream) t) (digit (setf i (+ (* (or i 0) 10) digit)) t) ((white-space-p byte) nil) (t (error-junk "header" byte))) :finally (return i))) (defun read-magic-byte (stream) "Read the initial `P#` from `stream`, returning the magic `#` character." (assert (eql (cl:read-byte stream) (char-code #\P)) (stream) "Stream ~S does not appear to be in P*M file." stream) (code-char (cl:read-byte stream))) (defun write-string-as-bytes (string stream) (loop :for ch :across string :do (write-byte (char-code ch) stream))) (defun format-to-stream (stream &rest format-args) (write-string-as-bytes (apply #'format nil format-args) stream)) (defmacro check-number (place maximum-value) `(assert (typep ,place `(integer 0 ,maximum-value)) (,place) "Cannot write sample value ~D to Netpbm file with maximum value of ~D" ,place ,maximum-value)) (defun write-number-ascii (value stream maximum-value) "Write `value` to stream as an ASCII-encoded number, with sanity check." (check-number value maximum-value) (format-to-stream stream "~D " value)) (defun write-number-binary (value stream maximum-value) "Write `value` to `stream` as a binary value, with sanity check." (check-number value maximum-value) (write-byte value stream)) (defun write-line-feed (stream) (write-byte +line-feed+ stream)) (defun file-format (magic-byte) "Return `(values format binary?)` for the given magic byte character." (ecase magic-byte (#\1 (values :pbm nil)) (#\2 (values :pgm nil)) (#\3 (values :ppm nil)) (#\4 (values :pbm t)) (#\5 (values :pgm t)) (#\6 (values :ppm t)))) (defun magic-byte (file-format binary?) "Return the magic byte character to use for the given format/encoding combination." (if binary? (ecase file-format (:pbm #\4) (:pgm #\5) (:ppm #\6)) (ecase file-format (:pbm #\1) (:pgm #\2) (:ppm #\3)))) (defun pixel-type (format bit-depth) "Return the type specifier for a pixel of an image with the given `format` and `bit-depth`." (ecase format (:pbm 'bit) (:pgm `(integer 0 ,bit-depth)) (:ppm `(simple-array (integer 0 ,bit-depth) (3))))) (defun bits (byte) (loop :for i :from 7 :downto 0 :collect (ldb (byte 1 i) byte))) (defun make-color (r g b) (make-array 3 :initial-contents (list r g b) :element-type 'fixnum)) ;;;; Reading ------------------------------------------------------------------ (defun read-bitmap-binary (stream &aux (buffer nil)) (flet ((read-bit (stream) (when (null buffer) (setf buffer (bits (read-byte stream)))) (pop buffer)) (flush-buffer () (setf buffer nil))) (let* ((width (read-header-number stream)) (height (read-header-number stream)) (data (make-array (list width height) :element-type 'bit))) (dotimes (y height) (dotimes (x width) (setf (aref data x y) (- 1 (read-bit stream)))) (flush-buffer)) (values data :pbm 1)))) (defun read-bitmap-ascii (stream) (flet ((read-bit (stream) (skip-whitespace stream) (byte-to-digit (read-byte stream)))) (let* ((width (read-header-number stream)) (height (read-header-number stream)) (data (make-array (list width height) :element-type 'bit))) (dotimes (y height) (dotimes (x width) (setf (aref data x y) (- 1 (read-bit stream))))) (values data :pbm 1)))) (defun read-graymap (stream binary?) (let* ((width (read-header-number stream)) (height (read-header-number stream)) (bit-depth (read-header-number stream)) (data (make-array (list width height) :element-type `(integer 0 ,bit-depth))) (reader (if binary? #'read-byte #'read-raster-number))) (dotimes (y height) (dotimes (x width) (setf (aref data x y) (funcall reader stream)))) (values data :pgm bit-depth))) (defun read-pixmap (stream binary?) (let* ((width (read-header-number stream)) (height (read-header-number stream)) (bit-depth (read-header-number stream)) (data (make-array (list width height) :element-type `(simple-array (integer 0 ,bit-depth) (3)))) (reader (if binary? #'read-byte #'read-raster-number))) (dotimes (y height) (dotimes (x width) (setf (aref data x y) (make-color (funcall reader stream) (funcall reader stream) (funcall reader stream))))) (values data :ppm bit-depth))) (defun read-texture (stream binary?) (let* ((width (read-header-number stream)) (height (read-header-number stream)) (bit-depth (float (read-header-number stream) 1.0f0)) (data (make-array (* width height 3) :element-type '(single-float 0.0 1.0))) (reader (if binary? #'read-byte #'read-raster-number))) (loop :for y :from (1- height) :downto 0 :do (dotimes (x width) (let ((i (+ (* y width 3) (* 3 x)))) (setf (aref data (+ i 0)) (/ (funcall reader stream) bit-depth) (aref data (+ i 1)) (/ (funcall reader stream) bit-depth) (aref data (+ i 2)) (/ (funcall reader stream) bit-depth))))) (values data width height))) (defun read-netpbm (stream format binary? texture?) (if texture? (ecase format (:ppm (read-texture stream binary?))) (ecase format (:pbm (if binary? (read-bitmap-binary stream) (read-bitmap-ascii stream))) (:pgm (read-graymap stream binary?)) (:ppm (read-pixmap stream binary?))))) ;;;; Writing ------------------------------------------------------------------ (defun write-bitmap-binary (data stream &aux (buffer 0) (buffer-length 0)) (labels ((write-buffer (stream) (write-byte buffer stream) (setf buffer 0 buffer-length 0)) (write-bit (bit stream) (setf buffer (+ (ash buffer 1) bit)) (incf buffer-length) (when (= buffer-length 8) (write-buffer stream))) (flush-buffer (stream) (when (plusp buffer-length) (setf buffer (ash buffer (- 8 buffer-length))) (write-buffer stream)))) (destructuring-bind (width height) (array-dimensions data) (format-to-stream stream "P~D~%~D ~D~%" (magic-byte :pbm t) width height) (dotimes (y height) (dotimes (x width) (let ((pixel (aref data x y))) (write-bit (- 1 pixel) stream))) (flush-buffer stream))))) (defun write-bitmap-ascii (data stream) (destructuring-bind (width height) (array-dimensions data) (format-to-stream stream "P~D~%~D ~D~%" (magic-byte :pbm nil) width height) (dotimes (y height) (dotimes (x width) (write-number-ascii (- 1 (aref data x y)) stream 1)) (write-line-feed stream)))) (defun write-graymap (data stream binary? maximum-value) (let ((writer (if binary? #'write-number-binary #'write-number-ascii))) (destructuring-bind (width height) (array-dimensions data) (format-to-stream stream "P~D~%~D ~D~%~D~%" (magic-byte :pgm binary?) width height maximum-value) (dotimes (y height) (dotimes (x width) (funcall writer (aref data x y) stream maximum-value)) (unless binary? (write-line-feed stream)))))) (defun write-pixmap (data stream binary? maximum-value) (let ((writer (if binary? #'write-number-binary #'write-number-ascii))) (destructuring-bind (width height) (array-dimensions data) (format-to-stream stream "P~D~%~D ~D~%~D~%" (magic-byte :ppm binary?) width height maximum-value) (dotimes (y height) (dotimes (x width) (let ((pixel (aref data x y))) (funcall writer (aref pixel 0) stream maximum-value) (funcall writer (aref pixel 1) stream maximum-value) (funcall writer (aref pixel 2) stream maximum-value))) (unless binary? (write-line-feed stream)))))) (defun write-netpbm (data stream format binary? maximum-value) (ecase format (:pbm (if binary? (write-bitmap-binary data stream) (write-bitmap-ascii data stream))) (:pgm (write-graymap data stream binary? maximum-value)) (:ppm (write-pixmap data stream binary? maximum-value)))) ;;;; API ---------------------------------------------------------------------- ;;; TODO: The stream type checking here is kind of a mess. Basically what we ;;; care about is the following: ;;; ;;; * For input streams we need to be able to call (read-byte …) and get ;;; back numbers in the range 0-255. ;;; * For output streams we need to be able to call (write-byte …) with ;;; numbers in the range 0-255. ;;; ;;; As far as I can tell, there's no way to verify this in advance. Or, indeed, ;;; *at all*, because the spec for `write-byte` says: ;;; ;;; > Might signal an error of type type-error if byte is not an integer of the ;;; > stream element type of stream. ;;; ;;; "Might"?! (defun read-from-stream (stream) "Read a PPM image file from `stream`, returning an array of pixels and more. `stream` must be a binary input stream, specifically of `(unsigned-byte 8)`s unless you *really* know what you're doing. The primary return value will be a 2D array with dimensions `(width height)`. Each element of the array will be a single pixel whose type depends on the image file format: * PBM: `bit` * PGM: `(integer 0 maximum-value)` * PPM: `(simple-array (integer 0 maximum-value) (3))` Two other values are returned: * The format of the image that was read (one of `:pbm`, `:pgm`, `:ppm`). * The bit depth of the image. " (check-type stream stream) (assert (input-stream-p stream) (stream) "Stream ~S is not an input stream." stream) (multiple-value-bind (format binary?) (file-format (read-magic-byte stream)) (read-netpbm (make-peekable-stream stream) format binary? nil))) (defun read-from-file (path) "Read a PPM image file from `path`, returning an array of pixels and more. The primary return value will be a 2D array with dimensions `(width height)`. Each element of the array will be a single pixel whose type depends on the image file format: * PBM: `bit` * PGM: `(integer 0 maximum-value)` * PPM: `(simple-array (integer 0 maximum-value) (3))` Two other values are returned: * The format of the image that was read (one of `:pbm`, `:pgm`, `:ppm`). * The bit depth of the image. " (with-open-file (s path :direction :input :element-type '(unsigned-byte 8)) (read-from-stream s))) (defun write-to-stream (stream data &key (format :ppm) (encoding :binary) (maximum-value (ecase format (:pbm 1) ((:pgm :ppm) 255)))) "Write a PPM image array `data` to `stream`. Nothing is returned. `stream` must be a binary output stream, specifically of `(unsigned-byte 8)`s unless you *really* know what you're doing. `format` must be one of `:pbm`, `:pgm`, `:ppm`. `encoding` must be one of `:binary`, `:ascii`. `maximum-value` must be the desired bit depth of the image (the maximum value any particular pixel can have). For PBM images it must be `1`. For PBM and PGM images, `data` must be a two dimensional array of integers between `0` and `maximum-value` inclusive. For PPM images, `data` must be a two dimensional array of pixels, each of which must be a 3 element vector of integers between `0` and `maximum-value` inclusive. " (check-type stream stream) (assert (output-stream-p stream) (stream) "Stream ~S is not an output stream." stream) (check-type format (member :ppm :pgm :pbm)) (check-type encoding (member :binary :ascii)) (if (eql format :pbm) (check-type maximum-value (eql 1)) (check-type maximum-value (integer 1 *))) (write-netpbm data stream format (eql :binary encoding) maximum-value) (values)) (defun write-to-file (path data &key (if-exists nil if-exists-given) (format :ppm) (encoding :binary) (maximum-value (ecase format (:pbm 1) ((:pgm :ppm) 255)))) "Write a PPM image array `data` to a file at `path`. Nothing is returned. `format` must be one of `:pbm`, `:pgm`, `:ppm`. `encoding` must be one of `:binary`, `:ascii`. `maximum-value` must be the desired bit depth of the image (the maximum value any particular pixel can have). For PBM images it must be `1`. For PBM and PGM images, `data` must be a two dimensional array of integers between `0` and `maximum-value` inclusive. For PPM images, `data` must be a two dimensional array of pixels, each of which must be a 3 element vector of integers between `0` and `maximum-value` inclusive. " (check-type format (member :ppm :pgm :pbm)) (check-type encoding (member :binary :ascii)) (if (eql format :pbm) (check-type maximum-value (eql 1)) (check-type maximum-value (integer 1 *))) (flet ((write-it (stream) (write-to-stream stream data :format format :encoding encoding :maximum-value maximum-value))) (if if-exists-given (with-open-file (s path :direction :output :if-exists if-exists :element-type '(unsigned-byte 8)) (write-it s)) (with-open-file (s path :direction :output :element-type '(unsigned-byte 8)) (write-it s)))) (values)) (defun read-texture-from-file (path) "Read a PPM image file from `path`, returning an OpenGL-style array and more. The primary return value will be an OpenGL-style array of type: (simple-array (single-float 0.0 1.0) (* width height 3)) The vertical axis of the image will be flipped, which is what OpenGL expects. Three values are returned: the array, the width, and the height. " (with-open-file (s path :direction :input :element-type '(unsigned-byte 8)) (read-texture-from-stream s))) (defun read-texture-from-stream (stream) "Read a PPM image file from `stream`, returning an OpenGL-style array and more. `stream` must be a binary input stream, specifically of `(unsigned-byte 8)`s unless you *really* know what you're doing. The stream must contain a PPM formatted image — PBM and PGM images are not supported. The primary return value will be an OpenGL-style array of type: (simple-array (single-float 0.0 1.0) (* width height 3)) The vertical axis of the image will be flipped, which is what OpenGL expects. Three values are returned: the array, the width, and the height. " (check-type stream stream) (assert (input-stream-p stream) (stream) "Stream ~S is not an input stream." stream) (multiple-value-bind (format binary?) (file-format (read-magic-byte stream)) (read-netpbm (make-peekable-stream stream) format binary? t)))
high
0.39066
99,943
data { // Define all the data here int<lower=0> N; // number of observations int<lower=0> N_cat; // number of categories for intercept/slope vector[N] x; // explanatory variable vector[N] y; // response variable int<lower=0> cat[N]; // categorical variable } parameters { // Define parameters here real mu_alpha; // intercept mean real mu_beta; // slope mean vector[N_cat] alpha; // intercept vector[N_cat] beta; // Slope real<lower=0> sigma; // residual sd real<lower=0> sigma_alpha; // intercept sd real<lower=0> sigma_beta; // slope sd } model { // Write out the model likelihood here for(i in 1:N) { y[i] ~ normal(alpha[cat[i]] + beta[cat[i]] * x[i], sigma); } alpha ~ normal(mu_alpha, sigma_alpha); beta ~ normal(mu_beta, sigma_beta); sigma_alpha ~ cauchy(0, 1); sigma_beta ~ cauchy(0, 0.1); mu_alpha ~ normal(0, 10); mu_beta ~ normal(0, 1); }
high
0.524467
99,944
struct UserProfile { 1: i32 uid, 2: string name, 3: string blurb } service UserStorage { void store(1: UserProfile user), UserProfile retrieve(1: i32 uid) }
high
0.34355
99,945
P.svc.oaworks.report = () -> @format = 'html' return '<script src="/client/svc/oaworks/report.min.js"></script>' P.svc.oaworks.report.supplements = _index: true, _prefix: false, _key: 'DOI' P.svc.oaworks.report.check = (ror, reload) -> reload ?= @params.check ? @params.reload ? @params.sheet started = await @epoch() ts = await @datetime(false).replace /[-T\: ]/g, '_' console.log 'OA check running', ts, reload _from_crossref = (cr) => cr.published = await @src.crossref.works.published cr try cr.year = cr.published.split('-')[0] try cr.year = parseInt cr.year try crf = DOI: cr.DOI.toLowerCase(), title: cr.title?[0], journal: cr['container-title']?[0], ISSN: cr.ISSN, publisher: cr.publisher, crossref_published: cr.published, crossref_year: cr.year, citations: cr['reference-count'], crossref_is_oa: cr.is_oa try crf.title = crf.title.replace(/\n/g, '').replace(/\s\s+/g, ' ') crf.funder_grant_ids = [] crf.funder_name = [] for f in cr.funder ? [] if f.DOI is '10.13039/100000865' or (f.name and f.name.toLowerCase().includes 'gates') f.name = 'Bill and Melinda Gates Foundation' if f.name.toLowerCase() is 'bank of canada' crf.funder_name.push(f.name) if f.name not in crf.funder_name for fid in f.award ? [] for fidc in fid.split ',' fidc = fidc.trim() crf.funder_grant_ids.push(fidc) if fidc not in crf.funder_grant_ids crf.author_names = [] crf.author_affiliation = [] for a in cr.author ? [] an = a.name ? (if a.given then a.given + ' ' else '') + (a.family ? '') crf.author_names.push(an) if an for aff in a.affiliation ? [] if aff.name and aff.name.toLowerCase().includes('gates') and aff.name not in crf.author_affiliation crf.author_affiliation.push aff.name crf.crossref = cr delete crf.crossref[x] for x in ['assertion', 'reference', 'relation'] return crf catch console.log 'from crossref parse error', JSON.stringify cr return recs = {} if not reload out = '/home/cloo/static/report/OAreport_' + ts + '.csv' q = 'funder.award:OPP* OR funder.award:INV*' # query and matchers should be read from a config somewhere depending on ror q = 'type:"journal-article" AND (' + q + ')' if not q.includes 'journal-article' matchers = [ /Melinda\sGates\sFoundation/g, # about 100 /BMGF/g, /Gates\sCambridge\sTrust/g, # about 20 #/investment\s?id\s?\d{5}/gi, # didn't match anything /IID\s?\d{5}/gi, /OPPG[HD]\s?\d{4}/g, # about 20 /OPP\s?1\s?\d{6}/g, # matches the most at about ~1100 /OPP\s?[45]\s?\d{4}/g, # about 30 /INV\‐\d{6}/g # 1 ] for await rec from @index._for 'src_crossref_works', q rec.DOI = rec.DOI.toLowerCase() ex = await @tdm.extract content: JSON.stringify(rec), matchers: matchers if ex.matched recs[rec.DOI] = await _from_crossref rec recs[rec.DOI].matches = [] for mt in ex.matches recs[rec.DOI].matches.push({matcher: mt.matched, matched: mt.result.join(',')}) if mt.matched or mt.result # NOTE funders in crossref can be assigned a "DOI" as an ID, so get the crossref funders data too and use that to search for them as well. # There ARE examples of funders in works listed with or without DOI, or listed with DOI and no funder.name. There are even some with funder.DOI # and a WRONG funder.name, but evidence of being correct such as a Gates one having Gates DOI but wrong name but a Gates-formatted grant ID e.g 10.1002/uog.18811 fq = '"10.13039/100000865" OR "gates foundation" OR "gates cambridge trust"' fields = ['funder.DOI', 'funder.name', 'author.affiliation.name'] # the RORs for gates and gates cambridge trust are 0456r8d26 and 033sn5p83 but neither appear anywhere in crossref for await rec from @index._for 'src_crossref_works', fq, {fields: fields} if rec.type is 'journal-article' matches = [] js = JSON.stringify rec matches.push({field: 'funder.DOI', matched: '10.13039/100000865'}) if js.includes '10.13039/100000865' matches.push({field: 'funder.name', matched: 'gates foundation'}) if js.includes 'gates foundation' matches.push({field: 'funder.name', matched: 'gates cambridge trust'}) if js.includes 'gates cambridge trust' rec.DOI = rec.DOI.toLowerCase() if recs[rec.DOI] recs[rec.DOI].matches.push(mf) for mf in matches recs[rec.DOI].duplicate ?= 0 recs[rec.DOI].duplicate += 1 else recs[rec.DOI] = await _from_crossref rec recs[rec.DOI].matches = matches sheets = # https://docs.google.com/spreadsheets/d/.../edit finance: '1xD-5e8TTEpgRL1iCJVOEnSYiddC-K0npkCWCaqx2--4' oasupport: '180562eXtmMANfIlioclUrQDaUSWkTOz7igOymfnv2pg' staff: '1EZI0iNAXnJ-qbIJFGmtplHWP03NVT7hhf0ICazI0YXw' grants: '1lDNHAwH-8x89fgLK-JLs9bBv2cdHsJRnb1Pj86QYWZI' names: '1ZowZub-nwOHJrzP7IbhbdoydOAmBRxLysejw38Xt32Y' emails: '1U3YXF1DLhGvP4PgqxNQuHOSR99RWuwVeMmdTAmSM45U' lens: '1XulUi2Bk3QNsJLekx0PpNb6REhrwQi6Q9M1x_KIUH_0' chronos: '1SxIFu4SoROqinOXAZMepOE0d1oxAZgC8LR_nTRi4vpU' if reload if sr = sheets[reload] sheets = {} sheets[reload] = sr else for sr of sheets if sheets[sr] is reload sheets = {} sheets[sr] = reload break for s of sheets rows = await @src.google.sheets sheetid: sheets[s], sheet: 'Export', headers: false # just get rows because headers are in different places, and want to simplify them as well #if s is 'finance' # rows.shift() # rows.shift() # get rid of junk rows at top headers = [] headers.push(header.toLowerCase().trim().replace(/ /g, '_').replace('?', '')) for header in rows.shift() # get headers for row in rows rec = {} for h of headers rec[headers[h].toLowerCase()] = if not row[h] then undefined else if row[h].trim().toLowerCase() in ['true', 'yes'] then true else if row[h].trim().toLowerCase() in ['false', 'no'] then false else if headers[h].toLowerCase() in ['grant_id', 'ror'] then row[h].replace(/\//g, ',').replace(/ /g, '').split(',') else row[h] if rec.doi and typeof rec.doi is 'string' rd = rec.doi.split(',')[0].toLowerCase().replace(/\.$/, '').replace(/\s/, '').split(' ')[0].split('?')[0].trim() # some appeared to be lists of DOIs which is no use e.g. 10.1128/msphere.01330-20, 10.1128/msphere.00490-21 if rd.startsWith('10.') and rd.includes('/') and rd.length > 6 if reload recs[rd] = await @svc.oaworks.report.supplements rd if not recs[rd]? recs[rd] ?= await @src.crossref.works rd if recs[rd]? recs[rd] = await _from_crossref recs[rd] else recs[rd] = {} recs[rd][k] = rec[k] for k of rec else if recs[rd]? recs[rd].duplicate ?= 0 recs[rd].duplicate += 1 else if cr = await @src.crossref.works rd recs[rd] = await _from_crossref cr else recs[rd] = DOI: rd, in_crossref: false recs[rd].doi_resolves = false if not await @fetch 'https://doi.org/' + rd try recs[rd].sheets ?= [] recs[rd].sheets.push(s) if s not in recs[rd].sheets recs[rd].ror ?= [] for rr in rec.ror ? ['0456r8d26'] recs[rd].ror.push(rr) if rr not in recs[rd].ror for r of rec if r is 'apc_cost' try ra = parseInt rec[r] catch ra = 0 recs[rd][r] ?= 0 recs[rd][r] += ra else if recs[rd][r]? if recs[rd][r] recs[rd][r] = [recs[rd][r]] if not Array.isArray recs[rd][r] else recs[rd][r] = [] # catch blanks recs[rd][r].push(rec[r]) if rec[r]? and (typeof rec[r] isnt 'string' or rec[r].trim().length) and rec[r] not in recs[rd][r] else if rec[r]? and rec[r] isnt '' recs[rd][r] = rec[r] catch # just skip ones that error out, such as bad DOIs console.log 'sheet fields merge error', rd else console.log 'bad doi', rd dois = await @keys(recs).length console.log dois if not reload alternates = # {} title: 'Paper title' journal: 'Journal Title' publisher: 'Publisher name' published: 'Published date' year: 'Published year' keys = if @params.keys then @params.keys.split(',') else [ "DOI", "PMCID", "in_oadoi", "in_crossref", "doi_resolves", "compliant", "can_archive", "journal_oa_type", "crossref_is_oa", "oadoi_is_oa", "is_oa", "oadoi_oa_status", "best_oa_location_url", "best_oa_location_url_for_pdf", "has_repository_copy", "repository_license", "repository_url_for_pdf", "repository_url", "repository_url_in_pmc", "repository_version", "publisher_license", "publisher_url_for_pdf", "publisher_version", "epmc_licence", "epmc_licence_source", "title", "journal", "ISSN", "publisher", "published", "crossref_published", "oadoi_published", "year", "crossref_year", "oadoi_year", "author_names", "author_affiliation", "funder_name", "funder_grant_ids", # keys examples from OAreport Gates live: https://docs.google.com/spreadsheets/d/1Ufh_xs3NQjzbPRgwlFnHxK5nY2cjn4SsnCqvVnY4Nk8/edit#gid=1145124691 "grant_id", "invoice_date", "invoice_number", # and others suggested by Joe, to be sourced from sheets inputs if not already known: "apc_cost", "oawork_finance_internal_id", "type", "to", "status", "sent", "last_contact", "last_heard_from", "completed", "follow_up_due", "follow_ups_sent", "author_name", "email", "author_email_name", "citations", "sheets", "matches_targets", "matches_found"] for key in keys await fs.appendFile out, (if key isnt 'DOI' then ',"' else '"') + (alternates[key] ? key) + '"' batch = [] counter = 0 max = @params.max ? 0 for d of recs break if max and counter > max counter += 1 res = recs[d] if not res? # check cos there was one from chronos that ended up with no record e.g. 10.1016/j.vaccine.2017.05.087pmcid: console.log d else if oadoi = await @src.oadoi res.DOI res.oadoi = oadoi res.journal_oa_type = await @svc.oaworks.permissions.journals.oa.type undefined, undefined, oadoi, res.crossref for loc in oadoi.oa_locations ? [] if loc.host_type is 'publisher' res.publisher_license ?= loc.license res.publisher_url_for_pdf ?= loc.url_for_pdf res.publisher_version ?= loc.version if loc.host_type is 'repository' if loc.url and loc.url.toLowerCase().includes 'pmc' if not res.PMCID and not res.pmcid try pp = loc.url.toLowerCase().split('pmc')[1].split('/')[0].split('?')[0].split('#')[0] if pp.length and pp.replace(/[^0-9]/g, '').length is pp.length and not isNaN parseInt pp res.PMCID = 'PMC' + pp if loc.license and not res.epmc_licence res.epmc_licence = loc.license res.epmc_licence_source = 'oadoi EPMC repository oa_location' if not res.repository_url or not res.repository_url.includes 'pmc' for ok in ['license', 'url_for_pdf', 'url', 'version'] res['repository_' + ok] = loc[ok] if loc[ok] res.repository_url_in_pmc = true if res.repository_url and res.repository_url.toLowerCase().includes 'pmc' res.best_oa_location_url = oadoi.best_oa_location?.url res.best_oa_location_url_for_pdf = oadoi.best_oa_location?.url_for_pdf res.oadoi_is_oa = oadoi.is_oa res.is_oa = res.oadoi_is_oa or res.crossref_is_oa res.oadoi_oa_status = oadoi.oa_status res.has_repository_copy = oadoi.has_repository_copy res.title ?= oadoi.title res.journal ?= oadoi.journal_name res.ISSN ?= oadoi.journal_issns.split(',') if oadoi.journal_issns res.publisher ?= oadoi.publisher res.oadoi_published = oadoi.published_date res.oadoi_year = oadoi.year else res.in_oadoi = false res.year ?= res.oadoi_year ? res.crossref_year res.published ?= res.oadoi_published ? res.crossref_published if (oadoi?.best_oa_location?.license ? '').includes('cc') or oadoi?.journal_is_in_doaj res.can_archive = true else rcc = @copy (res.crossref ? {}) rcc.doi = rcc.DOI res.permissions = await @svc.oaworks.permissions rcc, undefined, undefined, oadoi, (if JSON.stringify(rcc) is '{}' then undefined else rcc) res.can_archive = res.permissions?.best_permission?.can_archive res.compliant = await @svc.oaworks.report.compliant res epmc = undefined pubmed = undefined if not res.PMCID if res.pmcid and (not Array.isArray(res.pmcid) or res.pmcid.length) # may be present from sheets? res.PMCID = 'PMC' + res.pmcid.toString().toLowerCase().replace('pmc', '') res.PMCID = res.PMCID[0] if Array.isArray res.PMCID else if pubmed = await @src.pubmed.doi res.DOI if pubmed.identifier?.pmc res.PMCID = pubmed.identifier.pmc res.PMCID = 'PMC' + res.PMCID.toLowerCase().replace('pmc', '') else if res.repository_url_in_pmc and epmc = await @src.epmc.doi res.DOI res.PMCID = epmc.pmcid if res.PMCID and res.repository_url_in_pmc and not res.epmc_licence lic = await @src.epmc.licence res.PMCID, epmc res.epmc_licence = lic?.licence res.epmc_licence_source = lic?.source if res.author_names and res.email if res.author_names.length is 1 res.author_email_name = 'Dr. ' + res.author_names[0].split(' ').pop() else ren = (if typeof res.email is 'string' then res.email else res.email[0]).split('@')[0].toLowerCase().replace(/[^a-z]/g, '') best_initial = '' best_name = '' best_score = 1000000 for ran in res.author_names lvs = await @tdm.levenshtein ren, ran.toLowerCase().replace(/[^a-z]/g, '') score = lvs.distance / ran.length if score < best_score best_score = score best_name = ran if best_score > .2 and (ren.endsWith(ran.split(' ').pop().toLowerCase()) or (ran.split(' ')[0].length > 4 and ren.includes ran.split(' ')[0].toLowerCase())) best_score = .1 best_name = ran if not best_initial and ren.startsWith (ran.split(' ')[0].slice(0,1) + ran.split(' ').pop().slice(0,1)).toLowerCase() best_initial = ran if best_score < .7 res.author_email_name = 'Dr. ' + best_name.split(' ').pop() if not res.author_email_name and best_initial res.author_email_name = best_initial batch.push res if not reload await fs.appendFile out, '\n' for k in keys val = if not res[k]? then '' else if Array.isArray(res[k]) then res[k].join(',') else if typeof res[k] is 'object' then JSON.stringify(res[k]) else res[k] if k is 'matches_targets' for m in res.matches ? [] val += (if val then ',' else '') + (m.field ? m.matcher) if m.field or m.matcher else if k is 'matches_found' val += (if val then ',' else '') + m.matched for m in res.matches ? [] await fs.appendFile out, (if k isnt 'DOI' then ',"' else '"') + val.toString().replace(/"/g, '').replace(/\n/g, '').replace(/\s\s+/g, ' ') + '"' console.log('Gates OA checking', batch.length, dois) if batch.length % 100 is 0 if not reload await @svc.oaworks.report.supplements '' # change this to a delete of only those that are relevant to the source files of the org being checked await @svc.oaworks.report.supplements batch took = Math.ceil ((await @epoch()) - started)/60000 console.log 'OA check done after ' + took + ' minutes', reload if not reload @mail to: 'mark@oa.works' subject: 'Gates OA check done ' + batch.length + ' in ' + took + ' minutes' text: 'https://static.oa.works/report/' + ts return batch.length P.svc.oaworks.report._hides = true P.svc.oaworks.report.check._bg = true P.svc.oaworks.report.check._async = true P.svc.oaworks.report.check._notify = false P.svc.oaworks.report.compliant = (rec, ror) -> # compare with https://docs.google.com/spreadsheets/d/1oanKC96Jbel7S8Hhy0muMHzRvOIUzer1dZu7FlXhqaE/edit#gid=1000508628 # and https://docs.google.com/spreadsheets/d/1-7bVmmpVfaa8biZO2GdVsjOJTPGEpjL4h9oAXjJonVw/edit#gid=1048310661 # source for TJs from JCT sheet is https://docs.google.com/spreadsheets/d/e/2PACX-1vT2SPOjVU4CKhP7FHOgaf0aRsjSOt-ApwLOy44swojTDFsWlZAIZViC0gdbmxJaEWxdJSnUmNoAnoo9/pub?gid=0&single=true&output=csv # there are 2281. But it's not clear how we used that data for anything other than display in the sheet robl = (rec.oadoi?.best_oa_location?.license ? '').toLowerCase().replace(/-/g, '') if rec.publisher in ['Cold Spring Harbor Laboratory', 'Research Square'] or rec.journal in ['Data in Brief'] or rec.DOI.startsWith('10.2139/ssrn') or rec.DOI.startsWith('10.21203/rs') or rec.DOI.startsWith('10.31234/osf.io/') return 'n/a' # not peer reviewed, so compliant is not applicable else if rec.journal_oa_type and rec.journal_oa_type not in ['closed', 'green'] and (robl.includes('ccby') or robl.includes('cc0') or robl.includes('pd') or (robl.includes('public') and robl.includes('domain'))) if not rec.repository_url_in_pmc # what repos count as approved? return 'expected' else return 'yes' else if not rec.journal_oa_type? or not robl or not rec.oadoi?.best_oa_location?.url return 'unknown' else return 'no' P.svc.oaworks.report.compliance = (ror) -> ror ?= @params.report ? @params.compliance ? @params.ror papers = await @svc.oaworks.report.supplements.count() compliant = await @svc.oaworks.report.supplements.count 'compliant:yes' pc = Math.ceil((compliant/papers) * 1000)/10 return if pc > 100 then 100 else pc P.svc.oaworks.report.rating = (ror) -> ror ?= @params.report ? @params.rating ? @params.ror if ror ror = await @src.ror(ror) if typeof ror isnt 'object' filter = 'type:"journal-article" AND ("' + ror.name + '" OR "' + ror._id + '")' papers = await @src.crossref.works.count filter opens = await @src.crossref.works.count filter + ' AND is_oa:true' else papers = await @svc.oaworks.report.supplements.count() opens = await @svc.oaworks.report.supplements.count 'is_oa:true' pc = Math.ceil((opens/papers) * 1000)/10 return if pc > 100 then 100 else pc P.svc.oaworks.report.citations = (filter) -> counts = papers: 0, citations: 0, oa: {papers: 0, citations: 0}, closed: {papers: 0, citations: 0} filter = filter._id if typeof filter is 'object' ror = @params.report ? @params.citations ror = filter if typeof filter is 'string' and filter.length < 10 and not filter.includes ' ' if ror filter = 'type:"journal-article"' + if ror then ' AND ("' + ror.name + '" OR "' + ror._id + '")' else '' if ror is '0456r8d26' for await rec from @index._for 'svc_oaworks_report_supplements', 'citations:*', {include: ['citations', 'is_oa']} counts.papers += 1 counts.citations += rec.citations counts[if rec.is_oa then 'oa' else 'closed'].papers += 1 counts[if rec.is_oa then 'oa' else 'closed'].citations += rec.citations else if filter for await rec from @index._for 'src_crossref_works', filter + ' AND reference-count:*', {include: ['reference-count', 'is_oa']} counts.papers += 1 counts.citations += rec['reference-count'] counts[if rec.is_oa then 'oa' else 'closed'].papers += 1 counts[if rec.is_oa then 'oa' else 'closed'].citations += rec['reference-count'] counts.oa.average = Math.ceil counts.oa.citations / counts.oa.papers counts.closed.average = Math.ceil counts.closed.citations / counts.closed.papers if counts.oa.average > counts.closed.average counts.oa_extra_percent = Math.ceil ((counts.oa.average - counts.closed.average) / counts.closed.average) * 100 return counts P.svc.oaworks.report.publishers = (filter) -> if filter or not publist = P.svc.oaworks.report._publishers # allow to cache the result for a while... pubs = {} for pub in await @src.crossref.works.terms 'publisher', filter, 200 pubs[pub.term] = {papers: pub.count} filter ?= '' filter = '(' + filter + ')' if filter.includes(' OR ') and not filter.includes ')' filteroa = (if filter then filter + ' AND ' else '') + 'is_oa:true' for opub in await @src.crossref.works.terms 'publisher', filteroa, 200 pubs[opub.term] ?= {} pubs[opub.term].open = opub.count publist = [] for p of pubs pubs[p].name = p if pubs[p].open? and not pubs[p].papers? pubs[p].papers = await @src.crossref.works.count filter + (if filter then ' AND ' else '') + ' publisher.keyword:"' + p + '"' if pubs[p].papers and not pubs[p].open? pubs[p].open = await @src.crossref.works.count filteroa + ' AND publisher.keyword:"' + p + '"' pubs[p].rating = if pubs[p].open and pubs[p].papers then pubs[p].open / pubs[p].papers else 0 pubs[p].percent = Math.ceil(pubs[p].rating * 1000)/10 pubs[p].percent = 100 if pubs[p].percent > 100 if pubs[p].papers and pubs[p].rating publist.push pubs[p] #publist.sort (a, b) => return b.rating - a.rating publist.sort (a, b) => return b.rating - a.rating or b.open - a.open P.svc.oaworks.report._publishers = publist return publist P.svc.oaworks.report.journals = () -> if not jrnlist = P.svc.oaworks.report._journals jrnls = {} for jrnl in await @src.crossref.works.terms 'container-title', undefined, 200 jrnls[jrnl.term] = {papers: jrnl.count} for oj in await @src.crossref.works.terms 'container-title', 'is_oa:true', 200 jrnls[oj.term] ?= {} jrnls[oj.term].open = oj.count jrnlist = [] for j of jrnls jrnls[j].name = j if jrnls[j].open? and not jrnls[j].papers? jrnls[j].papers = await @src.crossref.works.count 'container-title.keyword:"' + j + '"' if jrnls[j].papers and not jrnls[j].open? jrnls[j].open = await @src.crossref.works.count 'is_oa:true AND container-title.keyword:"' + j + '"' jrnls[j].rating = if jrnls[j].open and jrnls[j].papers then jrnls[j].open / jrnls[j].papers else 0 jrnls[j].percent = Math.ceil(jrnls[j].rating * 1000)/10 jrnls[j].percent = 100 if jrnls[j].percent > 100 if jrnls[j].papers and jrnls[j].rating jrnlist.push jrnls[j] #jrnlist.sort (a, b) => return b.rating - a.rating jrnlist.sort (a, b) => return b.rating - a.rating or b.open - a.open P.svc.oaworks.report._journals = jrnlist return jrnlist P.svc.oaworks.report.compare = () -> res = crossref: await @src.crossref.works.count '(funder.DOI:"10.13039/100000865" OR funder.name:"gates foundation" OR funder.name:"gates cambridge trust" OR author.affiliation.name:"melinda gates" OR author.affiliation.name:"gates cambridge trust")' pubmed: await @src.pubmed.count 'grant.agency:"melinda gates" OR grant.agency:"gates cambridge trust" OR author.affiliation:"melinda gates" OR author.affiliation:"gates cambridge trust"' # what about gates international research scholar? Or things like "gates institute for..." Also just the phrase in any field matches another ~204 mostly in abstract or title, but not necessarily Gates-funded articles, just ABOUT gates work pubmednodoi: 0 pubmednotcrossref: 0 pubmednotepmc: 0 mag: 0 magnodoi: 0 magnodoimatchedtitle: 0 magnotcrossref: 0 magnotcrossrefviatitle: 0 magnotcrossrefnotpubmed: 0 pubmednotcrossref = [] for await rec from @index._for 'src_pubmed', 'grant.agency:"melinda gates" OR grant.agency:"gates cambridge trust" OR author.affiliation:"melinda gates" OR author.affiliation:"gates cambridge trust"' if not rec.identifier?.pmc res.pubmednotepmc += 1 if rec.identifier?.doi if cr = await @src.crossref.works rec.identifier.doi crs = JSON.stringify(cr).toLowerCase() if not crs.includes('10.13039/100000865') and not crs.includes('gates foundation') and not crs.includes('gates cambridge trust') res.pubmednotcrossref += 1 pubmednotcrossref.push rec.identifier.doi else res.pubmednotcrossref += 1 pubmednotcrossref.push rec.identifier.doi else res.pubmednodoi += 1 seen = [] for await rec from @index._for 'src_microsoft_graph_relation', 'OriginalAffiliation:"melinda gates"' if rec.PaperId not in seen seen.push rec.PaperId res.mag += 1 paper = await @src.microsoft.graph rec.PaperId if paper.Doi if cr = await @src.crossref.works paper.Doi crs = JSON.stringify(cr).toLowerCase() if not crs.includes('10.13039/100000865') and not crs.includes('gates foundation') and not crs.includes('gates cambridge trust') res.magnotcrossref += 1 res.magnotcrossrefnotpubmed += 1 if paper.Doi not in pubmednotcrossref else res.magnotcrossref += 1 res.magnotcrossrefnotpubmed += 1 if paper.Doi not in pubmednotcrossref else res.magnodoi += 1 if paper.PaperTitle and cr = await @src.crossref.works 'title:"' + paper.PaperTitle + '"' if cr?.hits?.total isnt 0 res.magnodoimatchedtitle += 1 cr = cr.hits.hits[0]._source crs = JSON.stringify(cr).toLowerCase() if not crs.includes('10.13039/100000865') and not crs.includes('gates foundation') and not crs.includes('gates cambridge trust') res.magnotcrossref += 1 res.magnotcrossrefviatitle += 1 else res.magnotcrossrefnotpubmed += 1 return res
high
0.226956
99,946
theory RunningCodeFromIsabelle imports HelloWorld begin section\<open>Running the Generated Code inside Isabelle\<close> (*Maintainer note: We invoke the generated code ON PURPOSE from bash to demonstrate how to use the generated code from outside Isabelle and make sure the code runs.*) text\<open> Usually, one would use \<^theory_text>\<open>export_code\<close> to generate code. Here, we want to write the code to a temp directory and execute it right afterwards inside Isablle, so we invoke the code generator directly from Isabelle/ML. \<close> subsection\<open>Haskell\<close> ML\<open> val (files, _) = Code_Target.produce_code @{context} false [@{const_name main}] "Haskell" "Main" NONE [] val target = File.tmp_path (Path.basic ("export" ^ serial_string ())) val ghc = getenv "ISABELLE_GHC"; val cmd = "cd " ^ Path.implode target ^ " && " ^ Bash.string ghc ^ " Main.hs && " ^ "( echo 'Cyber Cat 42' | ./Main )"; Isabelle_System.make_directory target; List.app (fn ([file], content) => File.write (target + Path.basic file) content) files; val exitcode = if ghc <> "" then Isabelle_System.bash cmd else (writeln "not running Haskell, because $ISABELLE_GHC is not set."; 0); if exitcode <> 0 then raise (Fail ("example Haskell code did not run as expected, " ^ "exit code was " ^ (Int.toString exitcode))) else () \<close> subsection\<open>SML\<close> ML\<open> val ([(_, content)], _) = Code_Target.produce_code @{context} false [@{const_name main}] "SML" "HelloWorld" NONE [] val target = File.tmp_path (Path.basic ("export" ^ serial_string ())) val file = target + Path.basic "main.ML" val cmd = "echo 'Super Goat 2000' | " ^ "\"${POLYML_EXE?}\" --use " ^ Path.implode file ^ " --eval 'HelloWorld.main ()'"; Isabelle_System.make_directory target; File.write file content; val exitcode = Isabelle_System.bash cmd; if exitcode <> 0 then raise (Fail ("example SML code did not run as expected, " ^ "exit code was " ^ (Int.toString exitcode))) else () \<close> end
high
0.752737
99,947
syntax = "proto3"; option java_multiple_files = true; option java_package = "org.interledger.spsp.server.grpc"; package org.interledger.stream.proto; // Defines the fields that are returned after a SendPayment RPC has completed. // Next field: 4 message SendPaymentResponse { // The original amount that was requested to be sent. uint64 original_amount = 1; // The actual amount, in the receivers units, that was delivered to the receiver uint64 amount_delivered = 2; // The actual amount, in the senders units, that was sent to the receiver uint64 amount_sent = 3; // Indicates if the payment was completed successfully. bool successful_payment = 4; // TODO : include all other meta-data from SendPaymentResult }
high
0.711939
99,948
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package iot import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" "github.com/aws/aws-sdk-go-v2/private/protocol" ) // The input for the CreateKeysAndCertificate operation. type CreateKeysAndCertificateInput struct { _ struct{} `type:"structure"` // Specifies whether the certificate is active. SetAsActive *bool `location:"querystring" locationName:"setAsActive" type:"boolean"` } // String returns the string representation func (s CreateKeysAndCertificateInput) String() string { return awsutil.Prettify(s) } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s CreateKeysAndCertificateInput) MarshalFields(e protocol.FieldEncoder) error { e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/json"), protocol.Metadata{}) if s.SetAsActive != nil { v := *s.SetAsActive metadata := protocol.Metadata{} e.SetValue(protocol.QueryTarget, "setAsActive", protocol.BoolValue(v), metadata) } return nil } // The output of the CreateKeysAndCertificate operation. type CreateKeysAndCertificateOutput struct { _ struct{} `type:"structure"` // The ARN of the certificate. CertificateArn *string `locationName:"certificateArn" type:"string"` // The ID of the certificate. AWS IoT issues a default subject name for the // certificate (for example, AWS IoT Certificate). CertificateId *string `locationName:"certificateId" min:"64" type:"string"` // The certificate data, in PEM format. CertificatePem *string `locationName:"certificatePem" min:"1" type:"string"` // The generated key pair. KeyPair *KeyPair `locationName:"keyPair" type:"structure"` } // String returns the string representation func (s CreateKeysAndCertificateOutput) String() string { return awsutil.Prettify(s) } // MarshalFields encodes the AWS API shape using the passed in protocol encoder. func (s CreateKeysAndCertificateOutput) MarshalFields(e protocol.FieldEncoder) error { if s.CertificateArn != nil { v := *s.CertificateArn metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "certificateArn", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.CertificateId != nil { v := *s.CertificateId metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "certificateId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.CertificatePem != nil { v := *s.CertificatePem metadata := protocol.Metadata{} e.SetValue(protocol.BodyTarget, "certificatePem", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata) } if s.KeyPair != nil { v := s.KeyPair metadata := protocol.Metadata{} e.SetFields(protocol.BodyTarget, "keyPair", v, metadata) } return nil } const opCreateKeysAndCertificate = "CreateKeysAndCertificate" // CreateKeysAndCertificateRequest returns a request value for making API operation for // AWS IoT. // // Creates a 2048-bit RSA key pair and issues an X.509 certificate using the // issued public key. You can also call CreateKeysAndCertificate over MQTT from // a device, for more information, see Provisioning MQTT API (https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#provision-mqtt-api). // // Note This is the only time AWS IoT issues the private key for this certificate, // so it is important to keep it in a secure location. // // // Example sending a request using CreateKeysAndCertificateRequest. // req := client.CreateKeysAndCertificateRequest(params) // resp, err := req.Send(context.TODO()) // if err == nil { // fmt.Println(resp) // } func (c *Client) CreateKeysAndCertificateRequest(input *CreateKeysAndCertificateInput) CreateKeysAndCertificateRequest { op := &aws.Operation{ Name: opCreateKeysAndCertificate, HTTPMethod: "POST", HTTPPath: "/keys-and-certificate", } if input == nil { input = &CreateKeysAndCertificateInput{} } req := c.newRequest(op, input, &CreateKeysAndCertificateOutput{}) return CreateKeysAndCertificateRequest{Request: req, Input: input, Copy: c.CreateKeysAndCertificateRequest} } // CreateKeysAndCertificateRequest is the request type for the // CreateKeysAndCertificate API operation. type CreateKeysAndCertificateRequest struct { *aws.Request Input *CreateKeysAndCertificateInput Copy func(*CreateKeysAndCertificateInput) CreateKeysAndCertificateRequest } // Send marshals and sends the CreateKeysAndCertificate API request. func (r CreateKeysAndCertificateRequest) Send(ctx context.Context) (*CreateKeysAndCertificateResponse, error) { r.Request.SetContext(ctx) err := r.Request.Send() if err != nil { return nil, err } resp := &CreateKeysAndCertificateResponse{ CreateKeysAndCertificateOutput: r.Request.Data.(*CreateKeysAndCertificateOutput), response: &aws.Response{Request: r.Request}, } return resp, nil } // CreateKeysAndCertificateResponse is the response type for the // CreateKeysAndCertificate API operation. type CreateKeysAndCertificateResponse struct { *CreateKeysAndCertificateOutput response *aws.Response } // SDKResponseMetdata returns the response metadata for the // CreateKeysAndCertificate request. func (r *CreateKeysAndCertificateResponse) SDKResponseMetdata() *aws.Response { return r.response }
high
0.849442
99,949
package com.redhat.cloudnative.catalog; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.feign.EnableFeignClients; @SpringBootApplication @EnableFeignClients public class GatewayApplication { public static void main(String[] args) { SpringApplication.run(GatewayApplication.class, args); } }
high
0.548727
99,950
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Categories.NaturalTransformation.Base where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Univalence open import Cubical.Foundations.HLevels open import Cubical.Foundations.Isomorphism renaming (iso to iIso) open import Cubical.Data.Sigma open import Cubical.Categories.Category open import Cubical.Categories.Functor.Base open import Cubical.Categories.Functor.Properties open import Cubical.Categories.Commutativity open import Cubical.Categories.Morphism renaming (isIso to isIsoC) private variable ℓC ℓC' ℓD ℓD' : Level module _ {C : Precategory ℓC ℓC'} {D : Precategory ℓD ℓD'} where -- syntax for sequencing in category D infixl 15 _⋆ᴰ_ private _⋆ᴰ_ : ∀ {x y z} (f : D [ x , y ]) (g : D [ y , z ]) → D [ x , z ] f ⋆ᴰ g = f ⋆⟨ D ⟩ g open Precategory open Functor -- type aliases because it gets tedious typing it out all the time N-ob-Type : (F G : Functor C D) → Type _ N-ob-Type F G = (x : C .ob) → D [(F .F-ob x) , (G .F-ob x)] N-hom-Type : (F G : Functor C D) → N-ob-Type F G → Type _ N-hom-Type F G ϕ = {x y : C .ob} (f : C [ x , y ]) → (F .F-hom f) ⋆ᴰ (ϕ y) ≡ (ϕ x) ⋆ᴰ (G .F-hom f) record NatTrans (F G : Functor C D) : Type (ℓ-max (ℓ-max ℓC ℓC') ℓD') where constructor natTrans field -- components of the natural transformation N-ob : N-ob-Type F G -- naturality condition N-hom : N-hom-Type F G N-ob record NatIso (F G : Functor C D): Type (ℓ-max (ℓ-max ℓC ℓC') (ℓ-max ℓD ℓD')) where field trans : NatTrans F G open NatTrans trans field nIso : ∀ (x : C .ob) → isIsoC {C = D} (N-ob x) open isIsoC -- the three other commuting squares sqRL : ∀ {x y : C .ob} {f : C [ x , y ]} → F ⟪ f ⟫ ≡ (N-ob x) ⋆ᴰ G ⟪ f ⟫ ⋆ᴰ (nIso y) .inv sqRL {x} {y} {f} = invMoveR (isIso→areInv (nIso y)) (N-hom f) sqLL : ∀ {x y : C .ob} {f : C [ x , y ]} → G ⟪ f ⟫ ⋆ᴰ (nIso y) .inv ≡ (nIso x) .inv ⋆ᴰ F ⟪ f ⟫ sqLL {x} {y} {f} = invMoveL (isIso→areInv (nIso x)) (sym sqRL') where sqRL' : F ⟪ f ⟫ ≡ (N-ob x) ⋆ᴰ ( G ⟪ f ⟫ ⋆ᴰ (nIso y) .inv ) sqRL' = sqRL ∙ (D .⋆Assoc _ _ _) sqLR : ∀ {x y : C .ob} {f : C [ x , y ]} → G ⟪ f ⟫ ≡ (nIso x) .inv ⋆ᴰ F ⟪ f ⟫ ⋆ᴰ (N-ob y) sqLR {x} {y} {f} = invMoveR (symAreInv (isIso→areInv (nIso y))) sqLL open NatTrans open NatIso infix 10 NatTrans syntax NatTrans F G = F ⇒ G infix 9 NatIso syntax NatIso F G = F ≅ᶜ G -- c superscript to indicate that this is in the context of categories -- component of a natural transformation infix 30 _⟦_⟧ _⟦_⟧ : ∀ {F G : Functor C D} → (F ⇒ G) → (x : C .ob) → D [(F .F-ob x) , (G .F-ob x)] _⟦_⟧ = N-ob idTrans : (F : Functor C D) → NatTrans F F idTrans F .N-ob x = D .id (F .F-ob x) idTrans F .N-hom f = (F .F-hom f) ⋆ᴰ (idTrans F .N-ob _) ≡⟨ D .⋆IdR _ ⟩ F .F-hom f ≡⟨ sym (D .⋆IdL _) ⟩ (D .id (F .F-ob _)) ⋆ᴰ (F .F-hom f) ∎ syntax idTrans F = 1[ F ] -- vertical sequencing seqTrans : {F G H : Functor C D} (α : NatTrans F G) (β : NatTrans G H) → NatTrans F H seqTrans α β .N-ob x = (α .N-ob x) ⋆ᴰ (β .N-ob x) seqTrans {F} {G} {H} α β .N-hom f = (F .F-hom f) ⋆ᴰ ((α .N-ob _) ⋆ᴰ (β .N-ob _)) ≡⟨ sym (D .⋆Assoc _ _ _) ⟩ ((F .F-hom f) ⋆ᴰ (α .N-ob _)) ⋆ᴰ (β .N-ob _) ≡[ i ]⟨ (α .N-hom f i) ⋆ᴰ (β .N-ob _) ⟩ ((α .N-ob _) ⋆ᴰ (G .F-hom f)) ⋆ᴰ (β .N-ob _) ≡⟨ D .⋆Assoc _ _ _ ⟩ (α .N-ob _) ⋆ᴰ ((G .F-hom f) ⋆ᴰ (β .N-ob _)) ≡[ i ]⟨ (α .N-ob _) ⋆ᴰ (β .N-hom f i) ⟩ (α .N-ob _) ⋆ᴰ ((β .N-ob _) ⋆ᴰ (H .F-hom f)) ≡⟨ sym (D .⋆Assoc _ _ _) ⟩ ((α .N-ob _) ⋆ᴰ (β .N-ob _)) ⋆ᴰ (H .F-hom f) ∎ compTrans : {F G H : Functor C D} (β : NatTrans G H) (α : NatTrans F G) → NatTrans F H compTrans β α = seqTrans α β infixl 8 seqTrans syntax seqTrans α β = α ●ᵛ β -- vertically sequence natural transformations whose -- common functor is not definitional equal seqTransP : {F G G' H : Functor C D} (p : G ≡ G') → (α : NatTrans F G) (β : NatTrans G' H) → NatTrans F H seqTransP {F} {G} {G'} {H} p α β .N-ob x -- sequence morphisms with non-judgementally equal (co)domain = seqP {C = D} {p = Gx≡G'x} (α ⟦ x ⟧) (β ⟦ x ⟧) where Gx≡G'x : ∀ {x} → G ⟅ x ⟆ ≡ G' ⟅ x ⟆ Gx≡G'x {x} i = F-ob (p i) x seqTransP {F} {G} {G'} {H} p α β .N-hom {x = x} {y} f -- compose the two commuting squares -- 1. α's commuting square -- 2. β's commuting square, but extended to G since β is only G' ≡> H = compSq {C = D} (α .N-hom f) βSq where -- functor equality implies equality of actions on objects and morphisms Gx≡G'x : G ⟅ x ⟆ ≡ G' ⟅ x ⟆ Gx≡G'x i = F-ob (p i) x Gy≡G'y : G ⟅ y ⟆ ≡ G' ⟅ y ⟆ Gy≡G'y i = F-ob (p i) y Gf≡G'f : PathP (λ i → D [ Gx≡G'x i , Gy≡G'y i ]) (G ⟪ f ⟫) (G' ⟪ f ⟫) Gf≡G'f i = p i ⟪ f ⟫ -- components of β extended out to Gx and Gy respectively βx' = subst (λ a → D [ a , H ⟅ x ⟆ ]) (sym Gx≡G'x) (β ⟦ x ⟧) βy' = subst (λ a → D [ a , H ⟅ y ⟆ ]) (sym Gy≡G'y) (β ⟦ y ⟧) -- extensions are equal to originals βy'≡βy : PathP (λ i → D [ Gy≡G'y i , H ⟅ y ⟆ ]) βy' (β ⟦ y ⟧) βy'≡βy = symP (toPathP {A = λ i → D [ Gy≡G'y (~ i) , H ⟅ y ⟆ ]} refl) βx≡βx' : PathP (λ i → D [ Gx≡G'x (~ i) , H ⟅ x ⟆ ]) (β ⟦ x ⟧) βx' βx≡βx' = toPathP refl -- left wall of square left : PathP (λ i → D [ Gx≡G'x i , H ⟅ y ⟆ ]) (G ⟪ f ⟫ ⋆⟨ D ⟩ βy') (G' ⟪ f ⟫ ⋆⟨ D ⟩ β ⟦ y ⟧) left i = Gf≡G'f i ⋆⟨ D ⟩ βy'≡βy i -- right wall of square right : PathP (λ i → D [ Gx≡G'x (~ i) , H ⟅ y ⟆ ]) (β ⟦ x ⟧ ⋆⟨ D ⟩ H ⟪ f ⟫) (βx' ⋆⟨ D ⟩ H ⟪ f ⟫) right i = βx≡βx' i ⋆⟨ D ⟩ refl {x = H ⟪ f ⟫} i -- putting it all together βSq : G ⟪ f ⟫ ⋆⟨ D ⟩ βy' ≡ βx' ⋆⟨ D ⟩ H ⟪ f ⟫ βSq i = comp (λ k → D [ Gx≡G'x (~ k) , H ⟅ y ⟆ ]) (λ j → λ { (i = i0) → left (~ j) ; (i = i1) → right j }) (β .N-hom f i) module _ ⦃ isCatD : isCategory D ⦄ {F G : Functor C D} {α β : NatTrans F G} where open Precategory open Functor open NatTrans makeNatTransPath : α .N-ob ≡ β .N-ob → α ≡ β makeNatTransPath p i .N-ob = p i makeNatTransPath p i .N-hom f = rem i where rem : PathP (λ i → (F .F-hom f) ⋆ᴰ (p i _) ≡ (p i _) ⋆ᴰ (G .F-hom f)) (α .N-hom f) (β .N-hom f) rem = toPathP (isCatD .isSetHom _ _ _ _) module _ ⦃ isCatD : isCategory D ⦄ {F F' G G' : Functor C D} {α : NatTrans F G} {β : NatTrans F' G'} where open Precategory open Functor open NatTrans makeNatTransPathP : ∀ (p : F ≡ F') (q : G ≡ G') → PathP (λ i → (x : C .ob) → D [ (p i) .F-ob x , (q i) .F-ob x ]) (α .N-ob) (β .N-ob) → PathP (λ i → NatTrans (p i) (q i)) α β makeNatTransPathP p q P i .N-ob = P i makeNatTransPathP p q P i .N-hom f = rem i where rem : PathP (λ i → ((p i) .F-hom f) ⋆ᴰ (P i _) ≡ (P i _) ⋆ᴰ ((q i) .F-hom f)) (α .N-hom f) (β .N-hom f) rem = toPathP (isCatD .isSetHom _ _ _ _) private variable ℓA ℓA' ℓB ℓB' : Level module _ {B : Precategory ℓB ℓB'} {C : Precategory ℓC ℓC'} {D : Precategory ℓD ℓD'} where open NatTrans -- whiskering -- αF _∘ˡ_ : ∀ {G H : Functor C D} (α : NatTrans G H) → (F : Functor B C) → NatTrans (G ∘F F) (H ∘F F) (_∘ˡ_ {G} {H} α F) .N-ob x = α ⟦ F ⟅ x ⟆ ⟧ (_∘ˡ_ {G} {H} α F) .N-hom f = (α .N-hom) _ -- Kβ _∘ʳ_ : ∀ (K : Functor C D) → {G H : Functor B C} (β : NatTrans G H) → NatTrans (K ∘F G) (K ∘F H) (_∘ʳ_ K {G} {H} β) .N-ob x = K ⟪ β ⟦ x ⟧ ⟫ (_∘ʳ_ K {G} {H} β) .N-hom f = preserveCommF {C = C} {D = D} {K} (β .N-hom f)
high
0.647888
99,951
fxc /T ps_5_0 /E AMD_SHADOWFX_FILTERING_POINT /O1 /Fh ..\inc\AMD_SHADOWS_CUBE_FILTERING_POINT.inc /Vn AMD_SHADOWS_CUBE_FILTERING_POINT_Data ..\AMD_ShadowsCube.hlsl fxc /E AMD_SHADOWFX_FILTERING_POINT /O1 /P ShadowFilteringUsingTextureArray.hlsl ..\AMD_ShadowsCube.hlsl
low
0.886405
99,952
abstract sig Source {} sig User extends Source { profile : set Work, visible : set Work } sig Institution extends Source {} sig Id {} sig Work { ids : some Id, source : one Source } // Specify the following invariants! // You can check their correctness with the different commands and // specifying a given invariant you can assume the others to be true. pred inv1 { // The works publicly visible in a curriculum must be part of its profile all u:User | u.visible in u.profile } pred inv2 { // A user profile can only have works added by himself or some external institution { all u:User, w:Work, i:Institution | w in u.profile implies u in w.source or i in w.source } } pred inv3 { // The works added to a profile by a given source cannot have common identifiers all w1, w2 : Work, u : User | w1 != w2 and (w1 + w2) in u.profile and (w1.source = w2.source) implies no w1.ids & w2.ids } /*======== IFF PERFECT ORACLE ===============*/ pred inv1_OK { all u:User | u.visible in u.profile } assert inv1_Repaired { inv1[] iff inv1_OK[] } pred inv2_OK { all u:User, w:Work | w in u.profile implies (u in w.source or some i:Institution | i in w.source) } assert inv2_Repaired { inv2[] iff inv2_OK[] } pred inv3_OK { all w1, w2 : Work, u : User | w1 != w2 and (w1 + w2) in u.profile and (w1.source = w2.source) implies no w1.ids & w2.ids } assert inv3_Repaired { inv3[] iff inv3_OK[] } check inv1_Repaired expect 0 check inv2_Repaired expect 0 check inv3_Repaired expect 0 pred __repair { inv2 } assert __repair { inv2 <=> { all u:User, w:Work | w in u.profile implies (u in w.source or some i:Institution | i in w.source) } } check __repair
high
0.562807
99,953
module SynapseClient using PyCall const synapseclient = PyNULL() const pyclient = PyNULL() const pyannotations = PyNULL() const pydict_object = PyNULL() const pycache = PyNULL() function __init__() try copy!(synapseclient, pyimport("synapseclient")) copy!(pyclient, synapseclient.client) copy!(pyannotations, synapseclient.annotations) copy!(pydict_object, synapseclient.dict_object) copy!(pycache, synapseclient.cache) copy!(pyhasattr, pybuiltin(:hasattr)) catch @warn "Please install the python package \"synapseclient\"." end end import Base: get export Synapse, # SynapseClient chunkedquery, delete, deleteprovenance, downloadtablecolumns, downloadtablefile, #get, # NB: it makes more sense to extend Base.get since it is a dictionary lookup getannotations, getchildren, getcolumn, getcolumns, getconfigfile, getevaluation, getevaluationbycontentsource, getevaluationbyname, getpermissions, getprovenance, getsubmission, getsubmissionbundles, getsubmissionstatus, getsubmissions, gettablecolumns, getteam, getteammembers, getuserprofile, getwiki, getwikiheaders, hasattr, invalidateapikey, login, logout, md5query, onweb, printentity, restdelete, restget, restpost, restput, sendmessage, setannotations, setendpoints, setpermissions, setprovenance, store, submit, tablequery, updateactivity, uploadfile, # Entity create, # Activity used, executed include("wrapper.jl") include("types.jl") include("synapse.jl") include("utils.jl") include("entity.jl") include("annotations.jl") include("cache.jl") end
high
0.421573
99,954
-define(FORMAT, "(~s ~p:~p in ~p) "). -define(ARGS, [erlang:pid_to_list(self()), ?MODULE, ?LINE, ?FUNCTION_NAME]). -define(LOG(F), ct:log(?FORMAT ++ F, ?ARGS, [esc_chars])). -define(LOG(F, Args), ct:log(?FORMAT ++ F, ?ARGS ++ Args, [esc_chars])). -define(PAL(F, Args), ct:pal(?FORMAT ++ F, ?ARGS ++ Args)). -define(FAIL(F, Args), ct:fail(?FORMAT ++ F, ?ARGS ++ Args)).
medium
0.316327
99,955
nqubits = 15; name = "15v3 1 3 2 1 1 1 1 1 1"; nstates = 4; amplitude[x_,y_] := (Exp[-14 I y] (1 (I Sin[x])^6 Cos[x]^9 + 1 (I Sin[x])^9 Cos[x]^6) + Exp[-12 I y] (5 (I Sin[x])^5 Cos[x]^10 + 5 (I Sin[x])^10 Cos[x]^5 + 3 (I Sin[x])^8 Cos[x]^7 + 3 (I Sin[x])^7 Cos[x]^8 + 5 (I Sin[x])^6 Cos[x]^9 + 5 (I Sin[x])^9 Cos[x]^6 + 1 (I Sin[x])^4 Cos[x]^11 + 1 (I Sin[x])^11 Cos[x]^4) + Exp[-10 I y] (45 (I Sin[x])^7 Cos[x]^8 + 45 (I Sin[x])^8 Cos[x]^7 + 15 (I Sin[x])^5 Cos[x]^10 + 15 (I Sin[x])^10 Cos[x]^5 + 28 (I Sin[x])^6 Cos[x]^9 + 28 (I Sin[x])^9 Cos[x]^6 + 3 (I Sin[x])^4 Cos[x]^11 + 3 (I Sin[x])^11 Cos[x]^4) + Exp[-8 I y] (32 (I Sin[x])^4 Cos[x]^11 + 32 (I Sin[x])^11 Cos[x]^4 + 149 (I Sin[x])^7 Cos[x]^8 + 149 (I Sin[x])^8 Cos[x]^7 + 113 (I Sin[x])^6 Cos[x]^9 + 113 (I Sin[x])^9 Cos[x]^6 + 63 (I Sin[x])^5 Cos[x]^10 + 63 (I Sin[x])^10 Cos[x]^5 + 7 (I Sin[x])^3 Cos[x]^12 + 7 (I Sin[x])^12 Cos[x]^3) + Exp[-6 I y] (477 (I Sin[x])^8 Cos[x]^7 + 477 (I Sin[x])^7 Cos[x]^8 + 328 (I Sin[x])^6 Cos[x]^9 + 328 (I Sin[x])^9 Cos[x]^6 + 44 (I Sin[x])^4 Cos[x]^11 + 44 (I Sin[x])^11 Cos[x]^4 + 145 (I Sin[x])^5 Cos[x]^10 + 145 (I Sin[x])^10 Cos[x]^5 + 7 (I Sin[x])^3 Cos[x]^12 + 7 (I Sin[x])^12 Cos[x]^3) + Exp[-4 I y] (56 (I Sin[x])^3 Cos[x]^12 + 56 (I Sin[x])^12 Cos[x]^3 + 616 (I Sin[x])^6 Cos[x]^9 + 616 (I Sin[x])^9 Cos[x]^6 + 391 (I Sin[x])^5 Cos[x]^10 + 391 (I Sin[x])^10 Cos[x]^5 + 762 (I Sin[x])^7 Cos[x]^8 + 762 (I Sin[x])^8 Cos[x]^7 + 166 (I Sin[x])^4 Cos[x]^11 + 166 (I Sin[x])^11 Cos[x]^4 + 11 (I Sin[x])^2 Cos[x]^13 + 11 (I Sin[x])^13 Cos[x]^2) + Exp[-2 I y] (963 (I Sin[x])^9 Cos[x]^6 + 963 (I Sin[x])^6 Cos[x]^9 + 1296 (I Sin[x])^7 Cos[x]^8 + 1296 (I Sin[x])^8 Cos[x]^7 + 515 (I Sin[x])^5 Cos[x]^10 + 515 (I Sin[x])^10 Cos[x]^5 + 41 (I Sin[x])^3 Cos[x]^12 + 41 (I Sin[x])^12 Cos[x]^3 + 183 (I Sin[x])^4 Cos[x]^11 + 183 (I Sin[x])^11 Cos[x]^4 + 5 (I Sin[x])^2 Cos[x]^13 + 5 (I Sin[x])^13 Cos[x]^2) + Exp[0 I y] (32 (I Sin[x])^2 Cos[x]^13 + 32 (I Sin[x])^13 Cos[x]^2 + 634 (I Sin[x])^5 Cos[x]^10 + 634 (I Sin[x])^10 Cos[x]^5 + 1288 (I Sin[x])^7 Cos[x]^8 + 1288 (I Sin[x])^8 Cos[x]^7 + 335 (I Sin[x])^4 Cos[x]^11 + 335 (I Sin[x])^11 Cos[x]^4 + 1016 (I Sin[x])^6 Cos[x]^9 + 1016 (I Sin[x])^9 Cos[x]^6 + 121 (I Sin[x])^3 Cos[x]^12 + 121 (I Sin[x])^12 Cos[x]^3 + 6 (I Sin[x])^1 Cos[x]^14 + 6 (I Sin[x])^14 Cos[x]^1) + Exp[2 I y] (1236 (I Sin[x])^8 Cos[x]^7 + 1236 (I Sin[x])^7 Cos[x]^8 + 922 (I Sin[x])^6 Cos[x]^9 + 922 (I Sin[x])^9 Cos[x]^6 + 532 (I Sin[x])^10 Cos[x]^5 + 532 (I Sin[x])^5 Cos[x]^10 + 231 (I Sin[x])^4 Cos[x]^11 + 231 (I Sin[x])^11 Cos[x]^4 + 69 (I Sin[x])^3 Cos[x]^12 + 69 (I Sin[x])^12 Cos[x]^3 + 12 (I Sin[x])^2 Cos[x]^13 + 12 (I Sin[x])^13 Cos[x]^2 + 1 (I Sin[x])^1 Cos[x]^14 + 1 (I Sin[x])^14 Cos[x]^1) + Exp[4 I y] (88 (I Sin[x])^3 Cos[x]^12 + 88 (I Sin[x])^12 Cos[x]^3 + 584 (I Sin[x])^6 Cos[x]^9 + 584 (I Sin[x])^9 Cos[x]^6 + 199 (I Sin[x])^4 Cos[x]^11 + 199 (I Sin[x])^11 Cos[x]^4 + 398 (I Sin[x])^5 Cos[x]^10 + 398 (I Sin[x])^10 Cos[x]^5 + 700 (I Sin[x])^7 Cos[x]^8 + 700 (I Sin[x])^8 Cos[x]^7 + 27 (I Sin[x])^2 Cos[x]^13 + 27 (I Sin[x])^13 Cos[x]^2 + 5 (I Sin[x])^1 Cos[x]^14 + 5 (I Sin[x])^14 Cos[x]^1 + 1 Cos[x]^15 + 1 (I Sin[x])^15) + Exp[6 I y] (311 (I Sin[x])^9 Cos[x]^6 + 311 (I Sin[x])^6 Cos[x]^9 + 351 (I Sin[x])^7 Cos[x]^8 + 351 (I Sin[x])^8 Cos[x]^7 + 201 (I Sin[x])^5 Cos[x]^10 + 201 (I Sin[x])^10 Cos[x]^5 + 96 (I Sin[x])^11 Cos[x]^4 + 96 (I Sin[x])^4 Cos[x]^11 + 33 (I Sin[x])^3 Cos[x]^12 + 33 (I Sin[x])^12 Cos[x]^3 + 8 (I Sin[x])^2 Cos[x]^13 + 8 (I Sin[x])^13 Cos[x]^2 + 1 (I Sin[x])^14 Cos[x]^1 + 1 (I Sin[x])^1 Cos[x]^14) + Exp[8 I y] (57 (I Sin[x])^4 Cos[x]^11 + 57 (I Sin[x])^11 Cos[x]^4 + 99 (I Sin[x])^7 Cos[x]^8 + 99 (I Sin[x])^8 Cos[x]^7 + 8 (I Sin[x])^2 Cos[x]^13 + 8 (I Sin[x])^13 Cos[x]^2 + 79 (I Sin[x])^5 Cos[x]^10 + 79 (I Sin[x])^10 Cos[x]^5 + 24 (I Sin[x])^3 Cos[x]^12 + 24 (I Sin[x])^12 Cos[x]^3 + 95 (I Sin[x])^6 Cos[x]^9 + 95 (I Sin[x])^9 Cos[x]^6 + 2 (I Sin[x])^1 Cos[x]^14 + 2 (I Sin[x])^14 Cos[x]^1) + Exp[10 I y] (27 (I Sin[x])^8 Cos[x]^7 + 27 (I Sin[x])^7 Cos[x]^8 + 22 (I Sin[x])^10 Cos[x]^5 + 22 (I Sin[x])^5 Cos[x]^10 + 20 (I Sin[x])^6 Cos[x]^9 + 20 (I Sin[x])^9 Cos[x]^6 + 15 (I Sin[x])^4 Cos[x]^11 + 15 (I Sin[x])^11 Cos[x]^4 + 6 (I Sin[x])^12 Cos[x]^3 + 6 (I Sin[x])^3 Cos[x]^12 + 1 (I Sin[x])^13 Cos[x]^2 + 1 (I Sin[x])^2 Cos[x]^13) + Exp[12 I y] (3 (I Sin[x])^5 Cos[x]^10 + 3 (I Sin[x])^10 Cos[x]^5 + 2 (I Sin[x])^8 Cos[x]^7 + 2 (I Sin[x])^7 Cos[x]^8 + 2 (I Sin[x])^6 Cos[x]^9 + 2 (I Sin[x])^9 Cos[x]^6 + 3 (I Sin[x])^3 Cos[x]^12 + 3 (I Sin[x])^12 Cos[x]^3 + 3 (I Sin[x])^4 Cos[x]^11 + 3 (I Sin[x])^11 Cos[x]^4 + 1 (I Sin[x])^2 Cos[x]^13 + 1 (I Sin[x])^13 Cos[x]^2) + Exp[14 I y] (1 (I Sin[x])^9 Cos[x]^6 + 1 (I Sin[x])^6 Cos[x]^9))/Sqrt[2^nqubits]; amplitude2[x_,y_] := (Exp[-14 I y] (1 (I Sin[x])^6 Cos[x]^9 + 1 (I Sin[x])^9 Cos[x]^6) + Exp[-12 I y] (5 (I Sin[x])^5 Cos[x]^10 + 5 (I Sin[x])^10 Cos[x]^5 + 3 (I Sin[x])^8 Cos[x]^7 + 3 (I Sin[x])^7 Cos[x]^8 + 5 (I Sin[x])^6 Cos[x]^9 + 5 (I Sin[x])^9 Cos[x]^6 + 1 (I Sin[x])^4 Cos[x]^11 + 1 (I Sin[x])^11 Cos[x]^4) + Exp[-10 I y] (45 (I Sin[x])^7 Cos[x]^8 + 45 (I Sin[x])^8 Cos[x]^7 + 15 (I Sin[x])^5 Cos[x]^10 + 15 (I Sin[x])^10 Cos[x]^5 + 28 (I Sin[x])^6 Cos[x]^9 + 28 (I Sin[x])^9 Cos[x]^6 + 3 (I Sin[x])^4 Cos[x]^11 + 3 (I Sin[x])^11 Cos[x]^4) + Exp[-8 I y] (32 (I Sin[x])^4 Cos[x]^11 + 32 (I Sin[x])^11 Cos[x]^4 + 149 (I Sin[x])^7 Cos[x]^8 + 149 (I Sin[x])^8 Cos[x]^7 + 113 (I Sin[x])^6 Cos[x]^9 + 113 (I Sin[x])^9 Cos[x]^6 + 63 (I Sin[x])^5 Cos[x]^10 + 63 (I Sin[x])^10 Cos[x]^5 + 7 (I Sin[x])^3 Cos[x]^12 + 7 (I Sin[x])^12 Cos[x]^3) + Exp[-6 I y] (477 (I Sin[x])^8 Cos[x]^7 + 477 (I Sin[x])^7 Cos[x]^8 + 328 (I Sin[x])^6 Cos[x]^9 + 328 (I Sin[x])^9 Cos[x]^6 + 44 (I Sin[x])^4 Cos[x]^11 + 44 (I Sin[x])^11 Cos[x]^4 + 145 (I Sin[x])^5 Cos[x]^10 + 145 (I Sin[x])^10 Cos[x]^5 + 7 (I Sin[x])^3 Cos[x]^12 + 7 (I Sin[x])^12 Cos[x]^3) + Exp[-4 I y] (56 (I Sin[x])^3 Cos[x]^12 + 56 (I Sin[x])^12 Cos[x]^3 + 616 (I Sin[x])^6 Cos[x]^9 + 616 (I Sin[x])^9 Cos[x]^6 + 391 (I Sin[x])^5 Cos[x]^10 + 391 (I Sin[x])^10 Cos[x]^5 + 762 (I Sin[x])^7 Cos[x]^8 + 762 (I Sin[x])^8 Cos[x]^7 + 166 (I Sin[x])^4 Cos[x]^11 + 166 (I Sin[x])^11 Cos[x]^4 + 11 (I Sin[x])^2 Cos[x]^13 + 11 (I Sin[x])^13 Cos[x]^2) + Exp[-2 I y] (963 (I Sin[x])^9 Cos[x]^6 + 963 (I Sin[x])^6 Cos[x]^9 + 1296 (I Sin[x])^7 Cos[x]^8 + 1296 (I Sin[x])^8 Cos[x]^7 + 515 (I Sin[x])^5 Cos[x]^10 + 515 (I Sin[x])^10 Cos[x]^5 + 41 (I Sin[x])^3 Cos[x]^12 + 41 (I Sin[x])^12 Cos[x]^3 + 183 (I Sin[x])^4 Cos[x]^11 + 183 (I Sin[x])^11 Cos[x]^4 + 5 (I Sin[x])^2 Cos[x]^13 + 5 (I Sin[x])^13 Cos[x]^2) + Exp[0 I y] (32 (I Sin[x])^2 Cos[x]^13 + 32 (I Sin[x])^13 Cos[x]^2 + 634 (I Sin[x])^5 Cos[x]^10 + 634 (I Sin[x])^10 Cos[x]^5 + 1288 (I Sin[x])^7 Cos[x]^8 + 1288 (I Sin[x])^8 Cos[x]^7 + 335 (I Sin[x])^4 Cos[x]^11 + 335 (I Sin[x])^11 Cos[x]^4 + 1016 (I Sin[x])^6 Cos[x]^9 + 1016 (I Sin[x])^9 Cos[x]^6 + 121 (I Sin[x])^3 Cos[x]^12 + 121 (I Sin[x])^12 Cos[x]^3 + 6 (I Sin[x])^1 Cos[x]^14 + 6 (I Sin[x])^14 Cos[x]^1) + Exp[2 I y] (1236 (I Sin[x])^8 Cos[x]^7 + 1236 (I Sin[x])^7 Cos[x]^8 + 922 (I Sin[x])^6 Cos[x]^9 + 922 (I Sin[x])^9 Cos[x]^6 + 532 (I Sin[x])^10 Cos[x]^5 + 532 (I Sin[x])^5 Cos[x]^10 + 231 (I Sin[x])^4 Cos[x]^11 + 231 (I Sin[x])^11 Cos[x]^4 + 69 (I Sin[x])^3 Cos[x]^12 + 69 (I Sin[x])^12 Cos[x]^3 + 12 (I Sin[x])^2 Cos[x]^13 + 12 (I Sin[x])^13 Cos[x]^2 + 1 (I Sin[x])^1 Cos[x]^14 + 1 (I Sin[x])^14 Cos[x]^1) + Exp[4 I y] (88 (I Sin[x])^3 Cos[x]^12 + 88 (I Sin[x])^12 Cos[x]^3 + 584 (I Sin[x])^6 Cos[x]^9 + 584 (I Sin[x])^9 Cos[x]^6 + 199 (I Sin[x])^4 Cos[x]^11 + 199 (I Sin[x])^11 Cos[x]^4 + 398 (I Sin[x])^5 Cos[x]^10 + 398 (I Sin[x])^10 Cos[x]^5 + 700 (I Sin[x])^7 Cos[x]^8 + 700 (I Sin[x])^8 Cos[x]^7 + 27 (I Sin[x])^2 Cos[x]^13 + 27 (I Sin[x])^13 Cos[x]^2 + 5 (I Sin[x])^1 Cos[x]^14 + 5 (I Sin[x])^14 Cos[x]^1 + 1 Cos[x]^15 + 1 (I Sin[x])^15) + Exp[6 I y] (311 (I Sin[x])^9 Cos[x]^6 + 311 (I Sin[x])^6 Cos[x]^9 + 351 (I Sin[x])^7 Cos[x]^8 + 351 (I Sin[x])^8 Cos[x]^7 + 201 (I Sin[x])^5 Cos[x]^10 + 201 (I Sin[x])^10 Cos[x]^5 + 96 (I Sin[x])^11 Cos[x]^4 + 96 (I Sin[x])^4 Cos[x]^11 + 33 (I Sin[x])^3 Cos[x]^12 + 33 (I Sin[x])^12 Cos[x]^3 + 8 (I Sin[x])^2 Cos[x]^13 + 8 (I Sin[x])^13 Cos[x]^2 + 1 (I Sin[x])^14 Cos[x]^1 + 1 (I Sin[x])^1 Cos[x]^14) + Exp[8 I y] (57 (I Sin[x])^4 Cos[x]^11 + 57 (I Sin[x])^11 Cos[x]^4 + 99 (I Sin[x])^7 Cos[x]^8 + 99 (I Sin[x])^8 Cos[x]^7 + 8 (I Sin[x])^2 Cos[x]^13 + 8 (I Sin[x])^13 Cos[x]^2 + 79 (I Sin[x])^5 Cos[x]^10 + 79 (I Sin[x])^10 Cos[x]^5 + 24 (I Sin[x])^3 Cos[x]^12 + 24 (I Sin[x])^12 Cos[x]^3 + 95 (I Sin[x])^6 Cos[x]^9 + 95 (I Sin[x])^9 Cos[x]^6 + 2 (I Sin[x])^1 Cos[x]^14 + 2 (I Sin[x])^14 Cos[x]^1) + Exp[10 I y] (27 (I Sin[x])^8 Cos[x]^7 + 27 (I Sin[x])^7 Cos[x]^8 + 22 (I Sin[x])^10 Cos[x]^5 + 22 (I Sin[x])^5 Cos[x]^10 + 20 (I Sin[x])^6 Cos[x]^9 + 20 (I Sin[x])^9 Cos[x]^6 + 15 (I Sin[x])^4 Cos[x]^11 + 15 (I Sin[x])^11 Cos[x]^4 + 6 (I Sin[x])^12 Cos[x]^3 + 6 (I Sin[x])^3 Cos[x]^12 + 1 (I Sin[x])^13 Cos[x]^2 + 1 (I Sin[x])^2 Cos[x]^13) + Exp[12 I y] (3 (I Sin[x])^5 Cos[x]^10 + 3 (I Sin[x])^10 Cos[x]^5 + 2 (I Sin[x])^8 Cos[x]^7 + 2 (I Sin[x])^7 Cos[x]^8 + 2 (I Sin[x])^6 Cos[x]^9 + 2 (I Sin[x])^9 Cos[x]^6 + 3 (I Sin[x])^3 Cos[x]^12 + 3 (I Sin[x])^12 Cos[x]^3 + 3 (I Sin[x])^4 Cos[x]^11 + 3 (I Sin[x])^11 Cos[x]^4 + 1 (I Sin[x])^2 Cos[x]^13 + 1 (I Sin[x])^13 Cos[x]^2) + Exp[14 I y] (1 (I Sin[x])^9 Cos[x]^6 + 1 (I Sin[x])^6 Cos[x]^9)); probability[x_, y_] := Abs[amplitude[x, y]]^2; result = NMaximize[{nstates*probability[a, b], 0 < a < Pi/2, 0 < b < Pi}, {a, b}, Method -> {"SimulatedAnnealing", "PerturbationScale" -> 15}]; Print[name, ": ", result] f = probability[c, d]; n = Pi; Plot3D[f, {c, 0, n/2}, {d, -n, n}, PlotRange -> All] ContourPlot[probability[x, y], {x, 0, n/2}, {y, 0, n}, PlotLegends -> Automatic, Contours -> 30]
high
0.144833
99,956
--- title: "Individual Health Insurance" --- <style> div {border-radius: 10px; padding: 10px} div.red {background-color:rgba(255, 0, 0, 0.2)} div.orange {background-color:#ffe0c7} div.yellow {background-color:#fff8c7} div.green {background-color:#d7ffc7} div.blue {background-color:#c7e9ff} div.purple {background-color:#e5c7ff} </style> # Major Medical Coverage <div class = "red"> - Major medical coverage was introduced around 1950, when it was observed that simple coverage of only hospital costs did not adequately protect policyholders. - ***Major medical coverage*** = hospital + physician + ancillary - The list of health care expenditures that a policy covers are called ***covered services*** (a.k.a. ***covered expenses***). - Allocating some portion of the covered expense to the insured is often deemed to be good design, because it still provides some (albeit watered down) financial incentive to the insured to control costs. The portion of costs allocated to the insured is called ***cost sharing***. </div> ## Deductibles <div class = "orange"> - A ***deductible*** is a dollar amount, specified in the policy, for which the insured is responsible before any benefits are payable. - Deductibles can apply to all services under the contract, or a subset of the services - ***Billed charges*** is the un-discounted charge the physician puts on the bill - If the physician is participating in the insurer's network, they might lower the billed charges, asking only for the ***allowed charges*** (e.g., $1000 -> $700, if in network) - In this case, the insured pays the deductible as usual, and the insurer saves some dough on the discounted benefit </div> ## Coinsurance <div class = "yellow"> - It is common in major medical plans that, once the deductible is satisfied, benefits above that amount are payable at a percentage (typically 75%-90%, the most common being 80%) of covered expenses. - ***Co-insurance*** is the percentage payable by the insurer (the ~80%) [confusingly, some people call the ~20% co-insurance] - The insured's cost-sharing is the remaining percentage - Example: $1000 billed charges -> $700 allowed charges, with a $100 deductible, with policy paying 80%... Insured pays the first $100, then 20% of the remaining $600, for a total of $220. Insurer covers the other $480. - The practice of seeking payment from the insured for the excess of billed charges over allowed charges is known as ***balance billing*** (but most provider contracts require that this not be done) </div> ## Out-of-Pocket Limits <div class = "green"> - An ***out-of-pocket provision*** or ***stop-loss provision*** is put in place to limit the payment from the insured. - Lots of ways to set up this provision: could include or exclude deductible, different for each member of a family plan </div> ## Maximum Limits <div class = "blue"> - There can be maximums on how much the insurer will cover. These limits used to be really low, but now medicine is very expensive and the maximum limits can be in the millions of dollars. - Many plans have eliminated these maximums, but there's been a resurgence in them as insured view a "$5 million maximum" more favorably than an unlimited maximum. - Even though an insured reaches a maximum on a lifetime policy, there might be a small benefit reinstatement of, for instance, $50,000 each year, to allow for modest coverage in the event of a catastrophic injury. - Under the ACA, major medical policies (grandfathered or not) can no longer have lifetime dollar limits on covered services deemed to be “essential health benefits.” </div> ## Internal Limits <div class = "purple"> - ***Internal limits*** are limits on certain subsets of benefits (e.g., mental, substance abuse, etc.) for a given policy. - These limits could be in terms of dollars or number of visits. - The ACA prevention of lifetime dollar limits on essential health benefits caused a lot of insurers to replace dollar limits on particular services with limits on number of visits </div> ## Co-pays <div class = "red"> - Cost-sharing that occurs each time a service is provided is called a ***co-pay***. - These payments often included physician office visits ($20 each visit, for instance) and ***tiered*** ($10 for generic, $20 for brand name) payments for prescription drugs. - HMO's tend to use co-pays rather than deductibles for cost-sharing. - The administration of prescription drug benefits are typically outsourced to a ***pharmacy benefits manager (PBM)***. - Eligibility for prescription benefits and the determination of benefits typically occur at the time the prescription is filled, and requires access to benefit information to determine cost sharing, so that the pharmacy can collect it at that time. - Since PBM's don't have access to insurer benefit and claim information, there is a compelling argument to use co-pays with prescription drugs, rather than deductibles. </div> ## Variations on a Theme - Related Products ### Comprehensive Major Medical Coverage <div class = "orange"> - Major medical had high deductibles back in the day, but, over time, a new version of major medical coverage, called ***comprehensive major medical (CMM)***, emerged. - CMM involves smaller deductibles along the lines of $50-$100. - Some carriers (particularly, commercial carriers) allow insureds to pick and choose options that are best for them. </div> ### Catastrophic Medical <div class = "yellow"> - ***Catastrophic major medical*** is a variation of major medical whose purpose is to protect from the opposite risk addressed by CMM coverage: namely, it's coverage with very high (~$25k-$100k) deductibles. - ACA caps out-of-pocket maximums, so this effectively prohibits catastrophic major medical products from existing. </div> ### Short-term Medical <div class = "green"> - A lot of people only utilized major medical for a short period of time, and it led to losses on the side of the insurers. - To combat this, ***short-term medical*** products were developed, often with single limited terms of 3-12 months. - Often included pre-existing condition exclusion. - These policies appear to be largely exempt from the reforms introduced by the ACA, since ACA required most individuals to maintain coverage throughout the year. </div> ### High-risk Pool Plans <div class = "blue"> - State high-risk pool contracts set up by ACA in the early 2010s varied by state, but most were approximately: 80% co-insurance major medical, choice of deductible, max @ $350k-$2m. </div> ### Consumer-directed Plans <div class = "purple"> - A ***consumer directed plan*** is typically characterized by a high deductible major medical (or HMO) plan, combined with an underlying ***personal spending account***. - The intent is that the insured will take emotional ownership of the assets in this personal account, and will be motivated to use the money efficiently. </div> #### Medical Savings Accounts <div class = "red"> - ***Medical Savings Accounts*** are accounts created by Congress in 1997 as a demonstration project for small group and self-employed insureds. - Contributions to the account are made pre-tax (being at least tax deferred), and the earnings on the account are also tax deferred. - At age 65, it's basically an IRA: can withdraw funds, but it's taxable. - No new MSA accounts can be opened today. </div> #### Health Savings Accounts <div class = "orange"> - ***Health Savings Accounts (HSAs)*** were created in 2003. - Available to individuals and employers, but the insured must be covered under a ***High Deductible Health Plan (HDHP)*** (e.g., not Medicare). - Account owned and maintained by the insured, with contributions pre-tax and interest pre-tax. </div> ## ACA Restrictions on Plan Design <div class = "yellow"> - ACA places a wide variety of restrictions on benefit plan design (w.r.t. covered services and cost sharing) - ACA mandates all individuals purchase health insurance. - The regulation sought to partially standardize the coverage. </div> ### Essential Health Benefits <div class = "green"> ACA says: all non-grandfathered individual and small group major medical plans must cover the following ***essential health benefits (EHBs)*** starting in 2014: 1. Ambulatory patient services; 2. emergency services; 3. hospitalization; 4. maternity and newborn care; 5. mental health and substance use disorder services, including behavioral health treatment; 6. prescription drugs; 7. rehabilitative and habilitative services and devices; 8. laboratory services; 9. preventive and wellness services and chronic disease management; and 10. pediatric services, including oral and vision care. </div> Inclusion of habilitative services and pediatric vision and oral care has caused the most difficulties for insurers, but the government has since made it easier for insurers with separate standalone plans for these services. ### Actuarial Values, Metal Levels, and Cost Sharing Limits <div class = "blue"> - Actuarial value (AV) and cost sharing limit requirements set boundaries on the types and levels of cost sharing insurers may impose on members for those services - ***Actuarial value*** is the percentage of total claim costs for the plan that are expected to be paid by the insurer. - All insurers must use the Actuarial Value Calculator (AVC) to measure this benchmark, or obtain certification from an actuary. - All ACA-compliant plans sold after January 1, 2014 must meet an AV ***metal level*** (platinum, gold, silver, and bronze), whereby each metal level has a set range of allowable AVs (e.g., platinum means the insurers pays a very high percentage of the costs). </div> ### Other Requirements <div class = "purple"> Plans that are to be certified for sale on a public Exchange must also meet a variety of other market rules. These include: - Passing a meaningful difference test (to prevent insurers from monopolizing virtual “shelf space” with many very similar plans); - Network adequacy tests; - Tests for discriminatory service areas; - Tests for discriminatory cost sharing; and - Tests by the government for “outlier” premium rates. </div> ## Networks <div class = "red"> - A ***provider network*** is a collection of doctors, hospitals, and other providers, who have agreed to provide certain services for insureds of the insurer. - In return, the network is provided with a stream of patients and are paid according to the contracts. - When it is not feasible or desirable for an insurer to build a proprietary network, the other alternative usually pursued is to contract with existing ***networks for hire***. - Networks for hire are usually created by non-insurance companies who have invested the resources necessary to create their own networks, with the intent of renting the network to insurers. </div> ### PPO Products <div class = "orange"> - The class of products which utilize networks are generally referred to as ***Preferred Provider Organization (PPO)*** products - These products have two tiers: in-network, and out-of-network, with in-network being much cheaper, in most cases: <center> ![](Figures/1+.png) </center> - It is fairly common to have in-network benefits structured as a co-pay benefit, but out-of-network benefits structured as a deductible benefit. </div> ### Measuring and Choosing Providers <div class = "yellow"> - Insurers who are building their own networks must choose which providers to include in their networks. - How restrictive? Only providers who meet very strict criteria; or, all providers in the area. - Some insurers have developed multiple networks, with different levels of breadth and discount. - In many areas, health-care providers have consolidated into a few large systems, which often cannot be split up when building a network. - Common criteria used: quality measures, efficiency of care, adherence to treatment standards, cost, etc.) </div> ### Measuring and Choosing Networks <div class = "green"> - Insurers who rent networks today typically evaluate those networks mostly on the cost savings through provider discounts achieved by the network. </div> # Dental Coverage <div class = "blue"> - Dental insurance is most typically a group coverage. - Dental benefits can be defined as either a scheduled amount per service (according to a specified schedule) or as a percentage of allowed charges. - Four types of benefits: 1. Type I: Diagnostic 2. Type II: Basic Services 3. Type III: Prosthetic Coverage 4. Type IV: Orthodontia - Type IV often absent in individual product plan designs. </div> ## Multiple Treatment Options <div class = "purple"> - Often, there are a number of different treatment options for dental issue, including waiting before beginning treatment. These options can have vastly different costs. - Sometimes ***pre-authorization***, or approval by the insurer, is required before dental services can be administered. </div> ## Accumulated Untreated Conditions <div class = "red"> - Common for patients to postpone dental procedures to be sure they are covered by insurance. One way to limit these difficulties for insurers is to try to restrict coverage on pre-existing conditions, sometimes achieving this by reducing initial benefits. </div> ## External Anti-selection <div class = "orange"> - Most individuals have a pretty good self-perception of their own dental health, and often they are aware of specific needs for treatment. - Because of this, individual dental coverage is very susceptible to anti-selection by prospective insureds, who will self-select their coverage if it is worthwhile for them to do so. - This requires aggressive management, aimed at limiting that potential, as anti-selection can increase overall claim costs for small employers groups by as much as 30%, or more. </div> ## Pediatric Dental Coverage Under the ACA <div class = "yellow"> - Similar to the actuarial value rules described earlier, pediatric dental plans must meet certain benefit standards prescribed by regulation in order to be sold on the exchanges. </div>
high
0.233962
99,957
Complaint Retrieval =================== Tender Cancellation Complaint Retrieval --------------------------------------- You can list all Tender Cancellation Complaints: .. include:: tutorial/cancellation-complaints-list.http :code: And check individual complaint: .. include:: tutorial/cancellation-complaint.http :code: Complaint Submission ==================== If tender cancellation are favoriting particular supplier, or in any other viable case, any registered user can submit Tender Cancellation Complaint if tender in `active.tendering` status or participants if tender in any other status. Tender Cancellation Complaint Submission (with documents) --------------------------------------------------------- Create complaint for cancellation can anyone if tender has satatus `active.auction` or only bidders in other statuses. At first create a draft: .. include:: tutorial/cancellation-complaint-submission.http :code: Then upload necessary documents: .. include:: tutorial/cancellation-complaint-submission-upload.http :code: Submit tender cancellation complaint: .. include:: tutorial/cancellation-complaint-complaint.http :code: Tender Cancellation Complaint Submission (without documents) ------------------------------------------------------------ You can submit complaint that does not need additional documents: .. include:: tutorial/cancellation-complaint-submission-complaint.http :code: Complaint Resolution ==================== Rejecting Tender Cancellation Complaint -------------------------------------------------- .. include:: tutorial/cancellation-complaint-reject.http :code: Accepting Tender Cancellation Complaint -------------------------------------------------- .. include:: tutorial/cancellation-complaint-accept.http :code: Submitting Tender Cancellation Complaint Resolution --------------------------------------------------- The Complaint Review Body uploads the resolution document: .. include:: tutorial/cancellation-complaint-resolution-upload.http :code: And either resolves complaint: .. include:: tutorial/cancellation-complaint-resolve.http :code: Or declines it: .. include:: tutorial/cancellation-complaint-decline.http :code: Submitting Resolution Confirmation ---------------------------------- For submit resolution confirmation, cancellation must be in `unsuccessful` status. .. include:: tutorial/cancellation-complaint-resolved.http :code: When the status of cancellation changes to `resolved`, then all terms regarding the tender are recalculated according to the formula: .. code-block:: python period.endDate += complaint.tendererActionDate - cancellation.complaintPeriod.startDate Cancelling Tender Cancellation Complaint ======================================== Cancelling not accepted complaint --------------------------------- .. include:: tutorial/cancellation-complaint-reject.http :code: Cancelling accepted complaint ----------------------------- .. include:: tutorial/cancellation-complaint-accepted-stopped.http :code:
high
0.251963
99,958
cmd_net/wireless/ocb.o := aarch64-xilinx-linux-gcc -fuse-ld=bfd -fdebug-prefix-map=/home/zw/share/ultra96/mipitest/build/tmp/work/ultra96_zynqmp-xilinx-linux/linux-xlnx/4.19-xilinx-v2019.1+git999-r0=/usr/src/debug/linux-xlnx/4.19-xilinx-v2019.1+git999-r0 -fdebug-prefix-map=/home/zw/share/ultra96/mipitest/build/tmp/work/ultra96_zynqmp-xilinx-linux/linux-xlnx/4.19-xilinx-v2019.1+git999-r0/recipe-sysroot= -fdebug-prefix-map=/home/zw/share/ultra96/mipitest/build/tmp/work/ultra96_zynqmp-xilinx-linux/linux-xlnx/4.19-xilinx-v2019.1+git999-r0/recipe-sysroot-native= -fdebug-prefix-map=/home/zw/share/ultra96/mipitest/build/tmp/work-shared/ultra96-zynqmp/kernel-source=/usr/src/kernel --sysroot=/home/zw/share/ultra96/mipitest/build/tmp/work/ultra96_zynqmp-xilinx-linux/linux-xlnx/4.19-xilinx-v2019.1+git999-r0/recipe-sysroot -Wp,-MD,net/wireless/.ocb.o.d -nostdinc -isystem /home/zw/share/ultra96/mipitest/build/tmp/work/ultra96_zynqmp-xilinx-linux/linux-xlnx/4.19-xilinx-v2019.1+git999-r0/recipe-sysroot-native/usr/bin/aarch64-xilinx-linux/../../lib/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/8.2.0/include -I/home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include -I./arch/arm64/include/generated -I/home/zw/share/ultra96/mipitest/linux-xlnx/include -I./include -I/home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi -I/home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi -I./include/generated/uapi -include /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/kconfig.h -include /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/compiler_types.h -I/home/zw/share/ultra96/mipitest/linux-xlnx/net/wireless -Inet/wireless -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -DCC_HAVE_ASM_GOTO -mgeneral-regs-only -DCONFIG_AS_LSE=1 -fno-asynchronous-unwind-tables -mabi=lp64 -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -Wdeclaration-after-statement -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=/home/zw/share/ultra96/mipitest/linux-xlnx/= -Wno-packed-not-aligned -DKBUILD_BASENAME='"ocb"' -DKBUILD_MODNAME='"cfg80211"' -c -o net/wireless/ocb.o /home/zw/share/ultra96/mipitest/linux-xlnx/net/wireless/ocb.c source_net/wireless/ocb.o := /home/zw/share/ultra96/mipitest/linux-xlnx/net/wireless/ocb.c deps_net/wireless/ocb.o := \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/kconfig.h \ $(wildcard include/config/cpu/big/endian.h) \ $(wildcard include/config/booger.h) \ $(wildcard include/config/foo.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/compiler_types.h \ $(wildcard include/config/have/arch/compiler/h.h) \ $(wildcard include/config/enable/must/check.h) \ $(wildcard include/config/arch/supports/optimized/inlining.h) \ $(wildcard include/config/optimize/inlining.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/compiler-gcc.h \ $(wildcard include/config/arch/use/builtin/bswap.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/ieee80211.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/types.h \ $(wildcard include/config/have/uid16.h) \ $(wildcard include/config/uid16.h) \ $(wildcard include/config/lbdaf.h) \ $(wildcard include/config/arch/dma/addr/t/64bit.h) \ $(wildcard include/config/phys/addr/t/64bit.h) \ $(wildcard include/config/64bit.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/types.h \ arch/arm64/include/generated/uapi/asm/types.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/types.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/int-ll64.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/int-ll64.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi/asm/bitsperlong.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitsperlong.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/bitsperlong.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/posix_types.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/stddef.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/stddef.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/compiler_types.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi/asm/posix_types.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/posix_types.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/if_ether.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/skbuff.h \ $(wildcard include/config/nf/conntrack.h) \ $(wildcard include/config/bridge/netfilter.h) \ $(wildcard include/config/highmem.h) \ $(wildcard include/config/xfrm.h) \ $(wildcard include/config/ipv6/ndisc/nodetype.h) \ $(wildcard include/config/net/switchdev.h) \ $(wildcard include/config/net/cls/act.h) \ $(wildcard include/config/tls/device.h) \ $(wildcard include/config/net/sched.h) \ $(wildcard include/config/net/rx/busy/poll.h) \ $(wildcard include/config/xps.h) \ $(wildcard include/config/network/secmark.h) \ $(wildcard include/config/have/efficient/unaligned/access.h) \ $(wildcard include/config/network/phy/timestamping.h) \ $(wildcard include/config/netfilter/xt/target/trace.h) \ $(wildcard include/config/nf/tables.h) \ $(wildcard include/config/ip/vs.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/kernel.h \ $(wildcard include/config/preempt/voluntary.h) \ $(wildcard include/config/debug/atomic/sleep.h) \ $(wildcard include/config/mmu.h) \ $(wildcard include/config/prove/locking.h) \ $(wildcard include/config/arch/has/refcount.h) \ $(wildcard include/config/panic/timeout.h) \ $(wildcard include/config/tracing.h) \ $(wildcard include/config/ftrace/mcount/record.h) \ /home/zw/share/ultra96/mipitest/build/tmp/work/ultra96_zynqmp-xilinx-linux/linux-xlnx/4.19-xilinx-v2019.1+git999-r0/recipe-sysroot-native/usr/lib/aarch64-xilinx-linux/gcc/aarch64-xilinx-linux/8.2.0/include/stdarg.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/linkage.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/stringify.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/export.h \ $(wildcard include/config/modules.h) \ $(wildcard include/config/modversions.h) \ $(wildcard include/config/module/rel/crcs.h) \ $(wildcard include/config/have/arch/prel32/relocations.h) \ $(wildcard include/config/trim/unused/ksyms.h) \ $(wildcard include/config/unused/symbols.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/compiler.h \ $(wildcard include/config/trace/branch/profiling.h) \ $(wildcard include/config/profile/all/branches.h) \ $(wildcard include/config/stack/validation.h) \ $(wildcard include/config/kasan.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/barrier.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/barrier.h \ $(wildcard include/config/smp.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/kasan-checks.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/linkage.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/bitops.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/bits.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/bitops.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/builtin-__ffs.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/builtin-ffs.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/builtin-__fls.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/builtin-fls.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/ffz.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/fls64.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/find.h \ $(wildcard include/config/generic/find/first/bit.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/sched.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/hweight.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/arch_hweight.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/const_hweight.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/atomic.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/atomic.h \ $(wildcard include/config/generic/atomic64.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/atomic.h \ $(wildcard include/config/arm64/lse/atomics.h) \ $(wildcard include/config/as/lse.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/lse.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/alternative.h \ $(wildcard include/config/arm64/uao.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/cpucaps.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/insn.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/init.h \ $(wildcard include/config/strict/kernel/rwx.h) \ $(wildcard include/config/strict/module/rwx.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/atomic_lse.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/cmpxchg.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/build_bug.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/atomic-long.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/lock.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/non-atomic.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/le.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi/asm/byteorder.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/byteorder/little_endian.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/byteorder/little_endian.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/swab.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/swab.h \ arch/arm64/include/generated/uapi/asm/swab.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/swab.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/byteorder/generic.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bitops/ext2-atomic-setbit.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/log2.h \ $(wildcard include/config/arch/has/ilog2/u32.h) \ $(wildcard include/config/arch/has/ilog2/u64.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/typecheck.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/printk.h \ $(wildcard include/config/message/loglevel/default.h) \ $(wildcard include/config/console/loglevel/default.h) \ $(wildcard include/config/console/loglevel/quiet.h) \ $(wildcard include/config/early/printk.h) \ $(wildcard include/config/printk/nmi.h) \ $(wildcard include/config/printk.h) \ $(wildcard include/config/dynamic/debug.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/kern_levels.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/cache.h \ $(wildcard include/config/arch/has/cache/line/size.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/kernel.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/sysinfo.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/cache.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/cputype.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/sysreg.h \ $(wildcard include/config/broken/gas/inst.h) \ $(wildcard include/config/arm64/pa/bits/52.h) \ $(wildcard include/config/arm64/4k/pages.h) \ $(wildcard include/config/arm64/16k/pages.h) \ $(wildcard include/config/arm64/64k/pages.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/compiler.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/time.h \ $(wildcard include/config/arch/uses/gettimeoffset.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/seqlock.h \ $(wildcard include/config/debug/lock/alloc.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/spinlock.h \ $(wildcard include/config/debug/spinlock.h) \ $(wildcard include/config/preempt.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/preempt.h \ $(wildcard include/config/preempt/count.h) \ $(wildcard include/config/debug/preempt.h) \ $(wildcard include/config/trace/preempt/toggle.h) \ $(wildcard include/config/preempt/notifiers.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/list.h \ $(wildcard include/config/debug/list.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/poison.h \ $(wildcard include/config/illegal/pointer/value.h) \ $(wildcard include/config/page/poisoning/zero.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/const.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/const.h \ arch/arm64/include/generated/asm/preempt.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/preempt.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/thread_info.h \ $(wildcard include/config/thread/info/in/task.h) \ $(wildcard include/config/have/arch/within/stack/frames.h) \ $(wildcard include/config/hardened/usercopy.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/bug.h \ $(wildcard include/config/generic/bug.h) \ $(wildcard include/config/bug/on/data/corruption.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/bug.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/asm-bug.h \ $(wildcard include/config/debug/bugverbose.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/brk-imm.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/bug.h \ $(wildcard include/config/bug.h) \ $(wildcard include/config/generic/bug/relative/pointers.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/restart_block.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/time64.h \ $(wildcard include/config/64bit/time.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/math64.h \ $(wildcard include/config/arch/supports/int128.h) \ arch/arm64/include/generated/asm/div64.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/div64.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/time.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/current.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/thread_info.h \ $(wildcard include/config/arm64/sw/ttbr0/pan.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/memory.h \ $(wildcard include/config/arm64/va/bits.h) \ $(wildcard include/config/vmap/stack.h) \ $(wildcard include/config/debug/align/rodata.h) \ $(wildcard include/config/blk/dev/initrd.h) \ $(wildcard include/config/debug/virtual.h) \ $(wildcard include/config/sparsemem/vmemmap.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/page-def.h \ $(wildcard include/config/arm64/page/shift.h) \ $(wildcard include/config/arm64/cont/shift.h) \ arch/arm64/include/generated/asm/sizes.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/sizes.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sizes.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/mmdebug.h \ $(wildcard include/config/debug/vm.h) \ $(wildcard include/config/debug/vm/pgflags.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/memory_model.h \ $(wildcard include/config/flatmem.h) \ $(wildcard include/config/discontigmem.h) \ $(wildcard include/config/sparsemem.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/pfn.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/stack_pointer.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/irqflags.h \ $(wildcard include/config/trace/irqflags.h) \ $(wildcard include/config/irqsoff/tracer.h) \ $(wildcard include/config/preempt/tracer.h) \ $(wildcard include/config/trace/irqflags/support.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/irqflags.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/ptrace.h \ $(wildcard include/config/compat.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi/asm/ptrace.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/hwcap.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi/asm/hwcap.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi/asm/sigcontext.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/prctl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/ptrace.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/bottom_half.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/spinlock_types.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/spinlock_types.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/qspinlock_types.h \ $(wildcard include/config/paravirt.h) \ $(wildcard include/config/nr/cpus.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/qrwlock_types.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/lockdep.h \ $(wildcard include/config/lockdep.h) \ $(wildcard include/config/lock/stat.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rwlock_types.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/spinlock.h \ arch/arm64/include/generated/asm/qrwlock.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/qrwlock.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/processor.h \ $(wildcard include/config/have/hw/breakpoint.h) \ $(wildcard include/config/gcc/plugin/stackleak.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/string.h \ $(wildcard include/config/binary/printf.h) \ $(wildcard include/config/fortify/source.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/string.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/string.h \ $(wildcard include/config/arch/has/uaccess/flushcache.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/cpufeature.h \ $(wildcard include/config/arm64/sve.h) \ $(wildcard include/config/arm64/ssbd.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/jump_label.h \ $(wildcard include/config/jump/label.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/hw_breakpoint.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/virt.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/sections.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/sections.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/pgtable-hwdef.h \ $(wildcard include/config/pgtable/levels.h) \ $(wildcard include/config/arm64/pa/bits.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/fpsimd.h \ arch/arm64/include/generated/uapi/asm/errno.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/errno.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/errno-base.h \ arch/arm64/include/generated/asm/qspinlock.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/qspinlock.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rwlock.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/spinlock_api_smp.h \ $(wildcard include/config/inline/spin/lock.h) \ $(wildcard include/config/inline/spin/lock/bh.h) \ $(wildcard include/config/inline/spin/lock/irq.h) \ $(wildcard include/config/inline/spin/lock/irqsave.h) \ $(wildcard include/config/inline/spin/trylock.h) \ $(wildcard include/config/inline/spin/trylock/bh.h) \ $(wildcard include/config/uninline/spin/unlock.h) \ $(wildcard include/config/inline/spin/unlock/bh.h) \ $(wildcard include/config/inline/spin/unlock/irq.h) \ $(wildcard include/config/inline/spin/unlock/irqrestore.h) \ $(wildcard include/config/generic/lockbreak.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rwlock_api_smp.h \ $(wildcard include/config/inline/read/lock.h) \ $(wildcard include/config/inline/write/lock.h) \ $(wildcard include/config/inline/read/lock/bh.h) \ $(wildcard include/config/inline/write/lock/bh.h) \ $(wildcard include/config/inline/read/lock/irq.h) \ $(wildcard include/config/inline/write/lock/irq.h) \ $(wildcard include/config/inline/read/lock/irqsave.h) \ $(wildcard include/config/inline/write/lock/irqsave.h) \ $(wildcard include/config/inline/read/trylock.h) \ $(wildcard include/config/inline/write/trylock.h) \ $(wildcard include/config/inline/read/unlock.h) \ $(wildcard include/config/inline/write/unlock.h) \ $(wildcard include/config/inline/read/unlock/bh.h) \ $(wildcard include/config/inline/write/unlock/bh.h) \ $(wildcard include/config/inline/read/unlock/irq.h) \ $(wildcard include/config/inline/write/unlock/irq.h) \ $(wildcard include/config/inline/read/unlock/irqrestore.h) \ $(wildcard include/config/inline/write/unlock/irqrestore.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/time32.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rbtree.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rcupdate.h \ $(wildcard include/config/preempt/rcu.h) \ $(wildcard include/config/rcu/stall/common.h) \ $(wildcard include/config/no/hz/full.h) \ $(wildcard include/config/rcu/nocb/cpu.h) \ $(wildcard include/config/tasks/rcu.h) \ $(wildcard include/config/tree/rcu.h) \ $(wildcard include/config/tiny/rcu.h) \ $(wildcard include/config/debug/objects/rcu/head.h) \ $(wildcard include/config/hotplug/cpu.h) \ $(wildcard include/config/prove/rcu.h) \ $(wildcard include/config/rcu/boost.h) \ $(wildcard include/config/arch/weak/release/acquire.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/cpumask.h \ $(wildcard include/config/cpumask/offstack.h) \ $(wildcard include/config/debug/per/cpu/maps.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/threads.h \ $(wildcard include/config/base/small.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/bitmap.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rcutree.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/socket.h \ $(wildcard include/config/proc/fs.h) \ arch/arm64/include/generated/uapi/asm/socket.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/socket.h \ arch/arm64/include/generated/uapi/asm/sockios.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/sockios.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/sockios.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/uio.h \ $(wildcard include/config/arch/has/uaccess/mcsafe.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/uio.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/socket.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/refcount.h \ $(wildcard include/config/refcount/full.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/net.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/random.h \ $(wildcard include/config/gcc/plugin/latent/entropy.h) \ $(wildcard include/config/arch/random.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/once.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/random.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/ioctl.h \ arch/arm64/include/generated/uapi/asm/ioctl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/ioctl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/ioctl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/irqnr.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/irqnr.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/wait.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/wait.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/fcntl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/fcntl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi/asm/fcntl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/fcntl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/fs.h \ $(wildcard include/config/sysfs.h) \ $(wildcard include/config/fs/posix/acl.h) \ $(wildcard include/config/security.h) \ $(wildcard include/config/cgroup/writeback.h) \ $(wildcard include/config/ima.h) \ $(wildcard include/config/fsnotify.h) \ $(wildcard include/config/fs/encryption.h) \ $(wildcard include/config/epoll.h) \ $(wildcard include/config/file/locking.h) \ $(wildcard include/config/quota.h) \ $(wildcard include/config/fs/dax.h) \ $(wildcard include/config/block.h) \ $(wildcard include/config/mandatory/file/locking.h) \ $(wildcard include/config/migration.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/wait_bit.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/kdev_t.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/kdev_t.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/dcache.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rculist.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rculist_bl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/list_bl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/bit_spinlock.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/lockref.h \ $(wildcard include/config/arch/use/cmpxchg/lockref.h) \ include/generated/bounds.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/stringhash.h \ $(wildcard include/config/dcache/word/access.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/hash.h \ $(wildcard include/config/have/arch/hash.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/path.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/stat.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/stat.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi/asm/stat.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/stat.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/compat_time.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/compat.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sched.h \ $(wildcard include/config/virt/cpu/accounting/native.h) \ $(wildcard include/config/sched/info.h) \ $(wildcard include/config/schedstats.h) \ $(wildcard include/config/fair/group/sched.h) \ $(wildcard include/config/rt/group/sched.h) \ $(wildcard include/config/cgroup/sched.h) \ $(wildcard include/config/blk/dev/io/trace.h) \ $(wildcard include/config/memcg.h) \ $(wildcard include/config/memcg/kmem.h) \ $(wildcard include/config/compat/brk.h) \ $(wildcard include/config/cgroups.h) \ $(wildcard include/config/blk/cgroup.h) \ $(wildcard include/config/stackprotector.h) \ $(wildcard include/config/arch/has/scaled/cputime.h) \ $(wildcard include/config/virt/cpu/accounting/gen.h) \ $(wildcard include/config/posix/timers.h) \ $(wildcard include/config/sysvipc.h) \ $(wildcard include/config/detect/hung/task.h) \ $(wildcard include/config/auditsyscall.h) \ $(wildcard include/config/rt/mutexes.h) \ $(wildcard include/config/debug/mutexes.h) \ $(wildcard include/config/ubsan.h) \ $(wildcard include/config/task/xacct.h) \ $(wildcard include/config/cpusets.h) \ $(wildcard include/config/intel/rdt.h) \ $(wildcard include/config/futex.h) \ $(wildcard include/config/perf/events.h) \ $(wildcard include/config/numa.h) \ $(wildcard include/config/numa/balancing.h) \ $(wildcard include/config/rseq.h) \ $(wildcard include/config/task/delay/acct.h) \ $(wildcard include/config/fault/injection.h) \ $(wildcard include/config/latencytop.h) \ $(wildcard include/config/function/graph/tracer.h) \ $(wildcard include/config/kcov.h) \ $(wildcard include/config/uprobes.h) \ $(wildcard include/config/bcache.h) \ $(wildcard include/config/livepatch.h) \ $(wildcard include/config/arch/task/struct/on/stack.h) \ $(wildcard include/config/debug/rseq.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/sched.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/pid.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sem.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/sem.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/ipc.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/uidgid.h \ $(wildcard include/config/multiuser.h) \ $(wildcard include/config/user/ns.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/highuid.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rhashtable-types.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/mutex.h \ $(wildcard include/config/mutex/spin/on/owner.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/osq_lock.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/debug_locks.h \ $(wildcard include/config/debug/locking/api/selftests.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/workqueue.h \ $(wildcard include/config/debug/objects/work.h) \ $(wildcard include/config/freezer.h) \ $(wildcard include/config/wq/watchdog.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/timer.h \ $(wildcard include/config/debug/objects/timers.h) \ $(wildcard include/config/no/hz/common.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/ktime.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/jiffies.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/timex.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/timex.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/param.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi/asm/param.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/param.h \ $(wildcard include/config/hz.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/param.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/timex.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/arch_timer.h \ $(wildcard include/config/arm/arch/timer/ool/workaround.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/smp.h \ $(wildcard include/config/up/late/init.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/errno.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/errno.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/llist.h \ $(wildcard include/config/arch/have/nmi/safe/cmpxchg.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/smp.h \ $(wildcard include/config/arm64/acpi/parking/protocol.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/percpu.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/percpu.h \ $(wildcard include/config/have/setup/per/cpu/area.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/percpu-defs.h \ $(wildcard include/config/debug/force/weak/per/cpu.h) \ $(wildcard include/config/virtualization.h) \ $(wildcard include/config/amd/mem/encrypt.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/clocksource/arm_arch_timer.h \ $(wildcard include/config/arm/arch/timer.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/timecounter.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/timex.h \ include/generated/timeconst.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/timekeeping.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/timekeeping32.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/debugobjects.h \ $(wildcard include/config/debug/objects.h) \ $(wildcard include/config/debug/objects/free.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/ipc.h \ arch/arm64/include/generated/uapi/asm/ipcbuf.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/ipcbuf.h \ arch/arm64/include/generated/uapi/asm/sembuf.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/sembuf.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/shm.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/page.h \ $(wildcard include/config/have/arch/pfn/valid.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/personality.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/personality.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/pgtable-types.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/pgtable-nopud.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/pgtable-nop4d-hack.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/5level-fixup.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/getorder.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/shm.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/hugetlb_encode.h \ arch/arm64/include/generated/uapi/asm/shmbuf.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/shmbuf.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/shmparam.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/shmparam.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/kcov.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/kcov.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/plist.h \ $(wildcard include/config/debug/pi/list.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/hrtimer.h \ $(wildcard include/config/high/res/timers.h) \ $(wildcard include/config/time/low/res.h) \ $(wildcard include/config/timerfd.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/percpu.h \ $(wildcard include/config/need/per/cpu/embed/first/chunk.h) \ $(wildcard include/config/need/per/cpu/page/first/chunk.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/timerqueue.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/seccomp.h \ $(wildcard include/config/seccomp.h) \ $(wildcard include/config/have/arch/seccomp/filter.h) \ $(wildcard include/config/seccomp/filter.h) \ $(wildcard include/config/checkpoint/restore.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/seccomp.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/nodemask.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/numa.h \ $(wildcard include/config/nodes/shift.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/resource.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/resource.h \ arch/arm64/include/generated/uapi/asm/resource.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/resource.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/resource.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/latencytop.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sched/prio.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/signal_types.h \ $(wildcard include/config/old/sigaction.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/signal.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi/asm/signal.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/signal.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/signal.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/signal-defs.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi/asm/siginfo.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/siginfo.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/mm_types_task.h \ $(wildcard include/config/arch/want/batched/unmap/tlb/flush.h) \ $(wildcard include/config/split/ptlock/cpus.h) \ $(wildcard include/config/arch/enable/split/pmd/ptlock.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/task_io_accounting.h \ $(wildcard include/config/task/io/accounting.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/rseq.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sched/task_stack.h \ $(wildcard include/config/stack/growsup.h) \ $(wildcard include/config/debug/stack/usage.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/magic.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/stat.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/list_lru.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/shrinker.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/radix-tree.h \ $(wildcard include/config/radix/tree/multiorder.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/xarray.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rwsem.h \ $(wildcard include/config/rwsem/spin/on/owner.h) \ $(wildcard include/config/rwsem/generic/spinlock.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/err.h \ arch/arm64/include/generated/asm/rwsem.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/rwsem.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/mm_types.h \ $(wildcard include/config/have/aligned/struct/page.h) \ $(wildcard include/config/userfaultfd.h) \ $(wildcard include/config/have/arch/compat/mmap/bases.h) \ $(wildcard include/config/membarrier.h) \ $(wildcard include/config/aio.h) \ $(wildcard include/config/mmu/notifier.h) \ $(wildcard include/config/transparent/hugepage.h) \ $(wildcard include/config/hugetlb/page.h) \ $(wildcard include/config/hmm.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/auxvec.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/auxvec.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi/asm/auxvec.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/completion.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/uprobes.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/page-flags-layout.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/sparsemem.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/mmu.h \ $(wildcard include/config/unmap/kernel/at/el0.h) \ $(wildcard include/config/harden/branch/predictor.h) \ $(wildcard include/config/harden/el2/vectors.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/capability.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/capability.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/semaphore.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/fiemap.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/migrate_mode.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/percpu-rwsem.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rcuwait.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rcu_sync.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/delayed_call.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/uuid.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/uuid.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/errseq.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/ioprio.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sched/rt.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/iocontext.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/fs.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/limits.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/quota.h \ $(wildcard include/config/quota/netlink/interface.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/percpu_counter.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/gfp.h \ $(wildcard include/config/zone/dma.h) \ $(wildcard include/config/zone/dma32.h) \ $(wildcard include/config/zone/device.h) \ $(wildcard include/config/pm/sleep.h) \ $(wildcard include/config/memory/isolation.h) \ $(wildcard include/config/compaction.h) \ $(wildcard include/config/cma.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/mmzone.h \ $(wildcard include/config/force/max/zoneorder.h) \ $(wildcard include/config/zsmalloc.h) \ $(wildcard include/config/memory/hotplug.h) \ $(wildcard include/config/flat/node/mem/map.h) \ $(wildcard include/config/page/extension.h) \ $(wildcard include/config/no/bootmem.h) \ $(wildcard include/config/deferred/struct/page/init.h) \ $(wildcard include/config/have/memory/present.h) \ $(wildcard include/config/have/memoryless/nodes.h) \ $(wildcard include/config/have/memblock/node/map.h) \ $(wildcard include/config/need/multiple/nodes.h) \ $(wildcard include/config/have/arch/early/pfn/to/nid.h) \ $(wildcard include/config/sparsemem/extreme.h) \ $(wildcard include/config/memory/hotremove.h) \ $(wildcard include/config/holes/in/zone.h) \ $(wildcard include/config/arch/has/holes/memorymodel.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/pageblock-flags.h \ $(wildcard include/config/hugetlb/page/size/variable.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/memory_hotplug.h \ $(wildcard include/config/arch/has/add/pages.h) \ $(wildcard include/config/have/arch/nodedata/extension.h) \ $(wildcard include/config/have/bootmem/info/node.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/notifier.h \ $(wildcard include/config/tree/srcu.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/srcu.h \ $(wildcard include/config/tiny/srcu.h) \ $(wildcard include/config/srcu.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rcu_segcblist.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/srcutree.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rcu_node_tree.h \ $(wildcard include/config/rcu/fanout.h) \ $(wildcard include/config/rcu/fanout/leaf.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/topology.h \ $(wildcard include/config/use/percpu/numa/node/id.h) \ $(wildcard include/config/sched/smt.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/topology.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/arch_topology.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/topology.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/dqblk_xfs.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/dqblk_v1.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/dqblk_v2.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/dqblk_qtree.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/projid.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/quota.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/nfs_fs_i.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/net.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/textsearch.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/slab.h \ $(wildcard include/config/debug/slab.h) \ $(wildcard include/config/failslab.h) \ $(wildcard include/config/have/hardened/usercopy/allocator.h) \ $(wildcard include/config/slab.h) \ $(wildcard include/config/slub.h) \ $(wildcard include/config/slob.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/overflow.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/kasan.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/checksum.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/uaccess.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/uaccess.h \ $(wildcard include/config/arm64/pan.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/kernel-pgtable.h \ $(wildcard include/config/randomize/base.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/pgtable.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/proc-fns.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/pgtable-prot.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/fixmap.h \ $(wildcard include/config/acpi/apei/ghes.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/boot.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/fixmap.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/pgtable.h \ $(wildcard include/config/have/arch/transparent/hugepage/pud.h) \ $(wildcard include/config/have/arch/soft/dirty.h) \ $(wildcard include/config/arch/enable/thp/migration.h) \ $(wildcard include/config/have/arch/huge/vmap.h) \ $(wildcard include/config/x86/espfix64.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/extable.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/checksum.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/checksum.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/dma-mapping.h \ $(wildcard include/config/have/generic/dma/coherent.h) \ $(wildcard include/config/has/dma.h) \ $(wildcard include/config/arch/has/dma/set/coherent/mask.h) \ $(wildcard include/config/need/dma/map/state.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/device.h \ $(wildcard include/config/debug/devres.h) \ $(wildcard include/config/generic/msi/irq/domain.h) \ $(wildcard include/config/pinctrl.h) \ $(wildcard include/config/generic/msi/irq.h) \ $(wildcard include/config/dma/cma.h) \ $(wildcard include/config/of.h) \ $(wildcard include/config/devtmpfs.h) \ $(wildcard include/config/sysfs/deprecated.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/ioport.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/kobject.h \ $(wildcard include/config/uevent/helper.h) \ $(wildcard include/config/debug/kobject/release.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sysfs.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/kernfs.h \ $(wildcard include/config/kernfs.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/idr.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/kobject_ns.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/kref.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/klist.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/pm.h \ $(wildcard include/config/vt/console/sleep.h) \ $(wildcard include/config/pm.h) \ $(wildcard include/config/pm/clk.h) \ $(wildcard include/config/pm/generic/domains.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/ratelimit.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/device.h \ $(wildcard include/config/iommu/api.h) \ $(wildcard include/config/xen.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/pm_wakeup.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/dma-debug.h \ $(wildcard include/config/dma/api/debug.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/dma-direction.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/scatterlist.h \ $(wildcard include/config/need/sg/dma/length.h) \ $(wildcard include/config/debug/sg.h) \ $(wildcard include/config/sgl/alloc.h) \ $(wildcard include/config/arch/has/sg/chain.h) \ $(wildcard include/config/sg/pool.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/mm.h \ $(wildcard include/config/sysctl.h) \ $(wildcard include/config/have/arch/mmap/rnd/bits.h) \ $(wildcard include/config/have/arch/mmap/rnd/compat/bits.h) \ $(wildcard include/config/mem/soft/dirty.h) \ $(wildcard include/config/arch/uses/high/vma/flags.h) \ $(wildcard include/config/arch/has/pkeys.h) \ $(wildcard include/config/ppc.h) \ $(wildcard include/config/x86.h) \ $(wildcard include/config/parisc.h) \ $(wildcard include/config/ia64.h) \ $(wildcard include/config/sparc64.h) \ $(wildcard include/config/x86/intel/mpx.h) \ $(wildcard include/config/dev/pagemap/ops.h) \ $(wildcard include/config/shmem.h) \ $(wildcard include/config/have/memblock.h) \ $(wildcard include/config/debug/vm/rb.h) \ $(wildcard include/config/page/poisoning.h) \ $(wildcard include/config/debug/pagealloc.h) \ $(wildcard include/config/hibernation.h) \ $(wildcard include/config/hugetlbfs.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/range.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/percpu-refcount.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/page_ext.h \ $(wildcard include/config/idle/page/tracking.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/stacktrace.h \ $(wildcard include/config/stacktrace.h) \ $(wildcard include/config/user/stacktrace/support.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/stackdepot.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/page_ref.h \ $(wildcard include/config/debug/page/ref.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/page-flags.h \ $(wildcard include/config/arch/uses/pg/uncached.h) \ $(wildcard include/config/memory/failure.h) \ $(wildcard include/config/swap.h) \ $(wildcard include/config/thp/swap.h) \ $(wildcard include/config/ksm.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/tracepoint-defs.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/static_key.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/memremap.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/huge_mm.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sched/coredump.h \ $(wildcard include/config/core/dump/default/elf/headers.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/vmstat.h \ $(wildcard include/config/vm/event/counters.h) \ $(wildcard include/config/debug/tlbflush.h) \ $(wildcard include/config/debug/vm/vmacache.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/vm_event_item.h \ $(wildcard include/config/memory/balloon.h) \ $(wildcard include/config/balloon/compaction.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/io.h \ arch/arm64/include/generated/asm/early_ioremap.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/early_ioremap.h \ $(wildcard include/config/generic/early/ioremap.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/xen/xen.h \ $(wildcard include/config/xen/pvh.h) \ $(wildcard include/config/xen/dom0.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/io.h \ $(wildcard include/config/generic/iomap.h) \ $(wildcard include/config/has/ioport/map.h) \ $(wildcard include/config/virt/to/bus.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/pci_iomap.h \ $(wildcard include/config/pci.h) \ $(wildcard include/config/no/generic/pci/ioport/map.h) \ $(wildcard include/config/generic/pci/iomap.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/logic_pio.h \ $(wildcard include/config/indirect/pio.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/fwnode.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/vmalloc.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/mem_encrypt.h \ $(wildcard include/config/arch/has/mem/encrypt.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/dma-mapping.h \ $(wildcard include/config/iommu/dma.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/xen/hypervisor.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/xen/arm/hypervisor.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/netdev_features.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sched/clock.h \ $(wildcard include/config/have/unstable/sched/clock.h) \ $(wildcard include/config/irq/time/accounting.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/flow_dissector.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/in6.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/in6.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/libc-compat.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/if_ether.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/splice.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/pipe_fs_i.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/if_packet.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/flow.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/etherdevice.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/netdevice.h \ $(wildcard include/config/dcb.h) \ $(wildcard include/config/hyperv/net.h) \ $(wildcard include/config/wlan.h) \ $(wildcard include/config/ax25.h) \ $(wildcard include/config/mac80211/mesh.h) \ $(wildcard include/config/net/ipip.h) \ $(wildcard include/config/net/ipgre.h) \ $(wildcard include/config/ipv6/sit.h) \ $(wildcard include/config/ipv6/tunnel.h) \ $(wildcard include/config/rps.h) \ $(wildcard include/config/netpoll.h) \ $(wildcard include/config/bql.h) \ $(wildcard include/config/rfs/accel.h) \ $(wildcard include/config/fcoe.h) \ $(wildcard include/config/xfrm/offload.h) \ $(wildcard include/config/net/poll/controller.h) \ $(wildcard include/config/libfcoe.h) \ $(wildcard include/config/wireless/ext.h) \ $(wildcard include/config/net/l3/master/dev.h) \ $(wildcard include/config/ipv6.h) \ $(wildcard include/config/vlan/8021q.h) \ $(wildcard include/config/net/dsa.h) \ $(wildcard include/config/tipc.h) \ $(wildcard include/config/irda.h) \ $(wildcard include/config/atalk.h) \ $(wildcard include/config/decnet.h) \ $(wildcard include/config/mpls/routing.h) \ $(wildcard include/config/netfilter/ingress.h) \ $(wildcard include/config/garp.h) \ $(wildcard include/config/mrp.h) \ $(wildcard include/config/cgroup/net/prio.h) \ $(wildcard include/config/net/flow/limit.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/delay.h \ arch/arm64/include/generated/asm/delay.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/delay.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/prefetch.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/dynamic_queue_limits.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/ethtool.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/compat.h \ $(wildcard include/config/arch/has/syscall/wrapper.h) \ $(wildcard include/config/x86/x32/abi.h) \ $(wildcard include/config/compat/old/sigaction.h) \ $(wildcard include/config/odd/rt/sigaction.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/if.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/hdlc/ioctl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/aio_abi.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/unistd.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/unistd.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/uapi/asm/unistd.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/unistd.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/asm-generic/unistd.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/syscall_wrapper.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/ethtool.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/net_namespace.h \ $(wildcard include/config/ieee802154/6lowpan.h) \ $(wildcard include/config/ip/sctp.h) \ $(wildcard include/config/ip/dccp.h) \ $(wildcard include/config/netfilter.h) \ $(wildcard include/config/nf/defrag/ipv6.h) \ $(wildcard include/config/netfilter/netlink/acct.h) \ $(wildcard include/config/nf/ct/netlink/timeout.h) \ $(wildcard include/config/wext/core.h) \ $(wildcard include/config/mpls.h) \ $(wildcard include/config/can.h) \ $(wildcard include/config/net/ns.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sysctl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/sysctl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/core.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/mib.h \ $(wildcard include/config/xfrm/statistics.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/snmp.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/snmp.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/u64_stats_sync.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/unix.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/packet.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/ipv4.h \ $(wildcard include/config/ip/multiple/tables.h) \ $(wildcard include/config/ip/route/classid.h) \ $(wildcard include/config/ip/mroute.h) \ $(wildcard include/config/ip/mroute/multiple/tables.h) \ $(wildcard include/config/ip/route/multipath.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/inet_frag.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/ipv6.h \ $(wildcard include/config/ipv6/multiple/tables.h) \ $(wildcard include/config/ipv6/mroute.h) \ $(wildcard include/config/ipv6/mroute/multiple/tables.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/dst_ops.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/ieee802154_6lowpan.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/sctp.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/dccp.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/netfilter.h \ $(wildcard include/config/netfilter/family/arp.h) \ $(wildcard include/config/netfilter/family/bridge.h) \ $(wildcard include/config/nf/defrag/ipv4.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/netfilter_defs.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/netfilter.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/in.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/in.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/x_tables.h \ $(wildcard include/config/bridge/nf/ebtables.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/conntrack.h \ $(wildcard include/config/nf/ct/proto/dccp.h) \ $(wildcard include/config/nf/ct/proto/sctp.h) \ $(wildcard include/config/nf/conntrack/events.h) \ $(wildcard include/config/nf/conntrack/labels.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/list_nulls.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/netfilter/nf_conntrack_tcp.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/netfilter/nf_conntrack_tcp.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/netfilter/nf_conntrack_dccp.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/netfilter/nf_conntrack_tuple_common.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/netfilter/nf_conntrack_common.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/netfilter/nf_conntrack_common.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/netfilter/nf_conntrack_sctp.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/netfilter/nf_conntrack_sctp.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/nftables.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/xfrm.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/xfrm.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/mpls.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netns/can.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/ns_common.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/seq_file_net.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/seq_file.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/cred.h \ $(wildcard include/config/debug/credentials.h) \ $(wildcard include/config/keys.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/key.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/assoc_array.h \ $(wildcard include/config/associative/array.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/selinux.h \ $(wildcard include/config/security/selinux.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sched/user.h \ $(wildcard include/config/fanotify.h) \ $(wildcard include/config/posix/mqueue.h) \ $(wildcard include/config/bpf/syscall.h) \ $(wildcard include/config/net.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/nsproxy.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netprio_cgroup.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/cgroup.h \ $(wildcard include/config/cgroup/cpuacct.h) \ $(wildcard include/config/sock/cgroup/data.h) \ $(wildcard include/config/cgroup/net/classid.h) \ $(wildcard include/config/cgroup/data.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/cgroupstats.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/taskstats.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/user_namespace.h \ $(wildcard include/config/inotify/user.h) \ $(wildcard include/config/persistent/keyrings.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/kernel_stat.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/interrupt.h \ $(wildcard include/config/irq/forced/threading.h) \ $(wildcard include/config/generic/irq/probe.h) \ $(wildcard include/config/irq/timings.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/irqreturn.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/hardirq.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/ftrace_irq.h \ $(wildcard include/config/ftrace/nmi/enter.h) \ $(wildcard include/config/hwlat/tracer.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/vtime.h \ $(wildcard include/config/virt/cpu/accounting.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/context_tracking_state.h \ $(wildcard include/config/context/tracking.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/hardirq.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/arch/arm64/include/asm/irq.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/irq.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/irq_cpustat.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/cgroup-defs.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/bpf-cgroup.h \ $(wildcard include/config/cgroup/bpf.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/bpf.h \ $(wildcard include/config/efficient/unaligned/access.h) \ $(wildcard include/config/bpf/kprobe/override.h) \ $(wildcard include/config/function/error/injection.h) \ $(wildcard include/config/bpf/lirc/mode2.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/bpf_common.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/cgroup_subsys.h \ $(wildcard include/config/cgroup/device.h) \ $(wildcard include/config/cgroup/freezer.h) \ $(wildcard include/config/cgroup/perf.h) \ $(wildcard include/config/cgroup/hugetlb.h) \ $(wildcard include/config/cgroup/pids.h) \ $(wildcard include/config/cgroup/rdma.h) \ $(wildcard include/config/cgroup/debug.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/xdp.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/neighbour.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/netlink.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/scm.h \ $(wildcard include/config/security/network.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/security.h \ $(wildcard include/config/security/infiniband.h) \ $(wildcard include/config/security/network/xfrm.h) \ $(wildcard include/config/security/path.h) \ $(wildcard include/config/audit.h) \ $(wildcard include/config/securityfs.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sched/signal.h \ $(wildcard include/config/sched/autogroup.h) \ $(wildcard include/config/bsd/process/acct.h) \ $(wildcard include/config/taskstats.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/signal.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sched/jobctl.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/sched/task.h \ $(wildcard include/config/have/copy/thread/tls.h) \ $(wildcard include/config/have/exit/thread.h) \ $(wildcard include/config/arch/wants/dynamic/task/struct.h) \ $(wildcard include/config/have/arch/thread/struct/whitelist.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/netlink.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/netdevice.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/if_link.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/if_link.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/if_bonding.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/pkt_cls.h \ $(wildcard include/config/net/cls/ind.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/pkt_sched.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/hashtable.h \ arch/arm64/include/generated/asm/unaligned.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/asm-generic/unaligned.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/unaligned/access_ok.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/unaligned/generic.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/cfg80211.h \ $(wildcard include/config/cfg80211.h) \ $(wildcard include/config/nl80211/testmode.h) \ $(wildcard include/config/cfg80211/wext.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/debugfs.h \ $(wildcard include/config/debug/fs.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/nl80211.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/regulatory.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/net/wireless/nl80211.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/net/wireless/core.h \ $(wildcard include/config/cfg80211/developer/warnings.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rfkill.h \ $(wildcard include/config/rfkill.h) \ $(wildcard include/config/rfkill/leds.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/rfkill.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/leds.h \ $(wildcard include/config/leds/triggers.h) \ $(wildcard include/config/leds/brightness/hw/changed.h) \ $(wildcard include/config/leds/trigger/disk.h) \ $(wildcard include/config/leds/trigger/mtd.h) \ $(wildcard include/config/leds/trigger/camera.h) \ $(wildcard include/config/new/leds.h) \ $(wildcard include/config/leds/trigger/cpu.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/rtnetlink.h \ $(wildcard include/config/net/ingress.h) \ $(wildcard include/config/net/egress.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/rtnetlink.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/if_addr.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/genetlink.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/genetlink.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/uapi/linux/genetlink.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/net/netlink.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/net/wireless/reg.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/net/wireless/rdev-ops.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/net/wireless/trace.h \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/linux/tracepoint.h \ $(wildcard include/config/tracepoints.h) \ $(wildcard include/config/have/syscall/tracepoints.h) \ $(wildcard include/config/tracepoint.h) \ /home/zw/share/ultra96/mipitest/linux-xlnx/include/trace/define_trace.h \ net/wireless/ocb.o: $(deps_net/wireless/ocb.o) $(deps_net/wireless/ocb.o):
low
0.906856
99,959
@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . set I18NSPHINXOPTS=%SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^<target^>` where ^<target^> is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. texinfo to make Texinfo files echo. gettext to make PO message catalogs echo. changes to make an overview over all changed/added/deprecated items echo. xml to make Docutils-native XML files echo. pseudoxml to make pseudoxml-XML files for display purposes echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) %SPHINXBUILD% 2> nul if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the SPHINXBUILD environment variable to point echo.to the full path of the 'sphinx-build' executable. Alternatively you echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.http://sphinx-doc.org/ exit /b 1 ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\wltp.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\wltp.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp if errorlevel 1 exit /b 1 echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub if errorlevel 1 exit /b 1 echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex if errorlevel 1 exit /b 1 echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdf" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf cd %BUILDDIR%/.. echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdfja" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf-ja cd %BUILDDIR%/.. echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text if errorlevel 1 exit /b 1 echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man if errorlevel 1 exit /b 1 echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "texinfo" ( %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo if errorlevel 1 exit /b 1 echo. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. goto end ) if "%1" == "gettext" ( %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale if errorlevel 1 exit /b 1 echo. echo.Build finished. The message catalogs are in %BUILDDIR%/locale. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes if errorlevel 1 exit /b 1 echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck if errorlevel 1 exit /b 1 echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest if errorlevel 1 exit /b 1 echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) if "%1" == "xml" ( %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml if errorlevel 1 exit /b 1 echo. echo.Build finished. The XML files are in %BUILDDIR%/xml. goto end ) if "%1" == "pseudoxml" ( %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml if errorlevel 1 exit /b 1 echo. echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. goto end ) :end
high
0.381843
99,960
; This books demonstrates how we could model network communications between a ; client and server, and how we can interleave an attacker that would be a "Man ; in the middle" between the client and a server. This file is the second of ; two that perform this modeling. This file, network-state.lisp, is similar to ; the first, but it uses more advanced features of ACL2 (like defn, ; defaggregate, b*, guards, defun+ and its output signatures, etc.). ; The concepts in this book are based off David Rager's JFKr model, which can ; be found in books/projects/security/jfkr.lisp and is explained in "An ; Executable Model for JFKr", which was included in the 2009 ACL2 Workshop. ; Copyright David Rager 2012. ; License: (An MIT/X11-style license) ; ; Permission is hereby granted, free of charge, to any person obtaining a ; copy of this software and associated documentation files (the "Software"), ; to deal in the Software without restriction, including without limitation ; the rights to use, copy, modify, merge, publish, distribute, sublicense, ; and/or sell copies of the Software, and to permit persons to whom the ; Software is furnished to do so, subject to the following conditions: ; ; The above copyright notice and this permission notice shall be included in ; all copies or substantial portions of the Software. ; ; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ; DEALINGS IN THE SOFTWARE. ; Suppose we have the following English description of a protocol. ; There are two actors, a client/initiator and a server/responder. In this ; case, the server is providing a simple service -- it looks for a request on ; the network (presumably sent to the responder), squares the number included ; within the request, and sends the result back on the network. ; The server will keep track of the number of requests that it has served. ; The way we model state in this book is a reasonable model. However, there ; are of course other ways that we could have done this. The following two ; paragraphs are intended for a slightly more experienced reader, and the ; novice reader may wish to skip them. ; In this book, we have three states: the client state, the server state, and ; the network state. One thing that could be different is that these three ; states could be combined into one single state. Such a decision is a ; judgment call. The current approach makes it clear to the reader that the ; server can not change the client state. However, even if the client state ; was embedded in one single state (and we implemented such embedding ; correctly), ACL2 should easily be able to determine (prove) that the server ; does not change the client state. ; Another difference between this model and other models is that we sequence ; the client and server steps in a relatively manual fashion (see the uses of ; "b*" below). We could model a greater variety of attacks if we had a single ; interpreter that took a state and a list that said what sequence of steps to ; run. This interpreter would then run the sequence of steps on the state, and ; we could prove properties about the resulting sequence. We could also ; underspecify the sequence of steps and still attempt to prove the same ; properties. If those properties held, despite this less well-defined ; sequence of steps, we would have more assurance in the protocol. One ; potentially interesting way to model picking the "next step" would be to have ; an "oracle" (for an example of an oracle that returns one of two values, see ; function foo in file nondeterminism.lisp, in this same directory) that could ; indicate whether the client, server, or attacker would get to take the next ; step. We could then attempt to prove that given the oracle returns one of ; the three values each time the interpreter is called, if the :answer field in ; the client changes from :unknown, that the value for :answer must be the ; square of the client's :number-to-square. Of course, this property isn't ; true of the protocol described and implemented in this file. However, if we ; were to correctly add cryptographic functions (for example, encryption and ; signed hashes), we could perhaps create a protocol that had this property. (in-package "ACL2") (include-book "std/util/defaggregate" :dir :system) (include-book "std/util/deflist" :dir :system) (include-book "misc/defun-plus" :dir :system) (include-book "std/util/bstar" :dir :system) ;;;;;;;;;;;;;;;;;;;;;;; ; Setup client state ;;;;;;;;;;;;;;;;;;;;;;; (defn unknown-or-integerp (x) ; defn implicitly verifies a :guard of t (or (equal x :unknown) (integerp x))) (std::defaggregate client-state (number-to-square answer) :require ((integer-p-of-client-state->number-to-square (integerp number-to-square)) (unknown-or-integerp-of-client-state->answer (unknown-or-integerp answer))) :tag :client-state) (defconst *initial-client* ; for concrete simulation (make-client-state :number-to-square 8 :answer :unknown)) ;;;;;;;;;;;;;;;;;;;;;;; ; Setup server state ;;;;;;;;;;;;;;;;;;;;;;; (std::defaggregate server-state (requests-served) :require ((integerp-of-server-state->requests-served (integerp requests-served) :rule-classes ((:type-prescription)))) :tag :server-state) (defconst *initial-server* ; for concrete simulation (make-server-state :requests-served 0)) ;;;;;;;;;;;;;;;;;;;;;; ; Setup network state ;;;;;;;;;;;;;;;;;;;;;; (std::defaggregate message (tag payload) :require ((keywordp-of-message->tag (keywordp tag)) (integerp-of-message->payload (integerp payload) :rule-classes ((:type-prescription)))) :tag :message) (defn id-p (x) ; Would rather make this a macro, but since we can't do that and use deflist, ; we later create a forward chaining rule that gives us similar functionality. (keywordp x)) (defthm id-p-implies-keywordp (implies (id-p x) (keywordp x)) :rule-classes :forward-chaining) (std::defaggregate network-packet (sender dest message) :require ((id-p-of-network-packet->sender (id-p sender)) (id-p-of-network-packet->dest (id-p dest)) (message-p-of-network-packet->message (message-p message))) :tag :network-packet) (in-theory (disable id-p)) ; we want to reason about id-p, not keywordp (defconst *initial-network* ; for concrete simulation nil) (std::deflist network-state-p (x) (network-packet-p x) :elementp-of-nil nil :true-listp t) (encapsulate () (local (include-book "arithmetic/top" :dir :system)) (defun+ square (x) (declare (xargs :guard t ; could be (integerp x) :output (integerp (square x)))) (cond ((integerp x) (expt x 2)) (t 0)))) (defconst *client-id* :client) (defconst *server-id* :server) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Define retrieving a message from the network ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun retrieve-network-message (dest network-st) ; Returns the message and a new network state, which does not include the new ; message (declare (xargs :guard (and (id-p dest) (network-state-p network-st)))) (cond ((atom network-st) (mv nil nil)) (t (let ((packet (car network-st))) (cond ((equal (network-packet->dest packet) dest) (mv packet (cdr network-st))) (t (mv-let (msg network-st-recursive) (retrieve-network-message dest (cdr network-st)) (mv msg (cons (car network-st) network-st-recursive))))))))) (defthm retrieve-network-message-returns-network-packet-p (implies (and (id-p dest) (network-state-p network-st)) (implies (car (retrieve-network-message dest network-st)) (network-packet-p (mv-nth 0 (retrieve-network-message dest network-st)))))) (defthm retrieve-network-message-returns-network-state-p (implies (network-state-p network-st) ; Using (cadr ...) in the below call causes a later theorem ; (SERVER-STEP1-OUTPUT-LEMMA-2) to fail, but shouldn't (mv-nth 1 ...) just ; expand to cadr since mv-nth is enabled? Actually, probably not, since mv-nth ; is recursive and its argument isn't the base case. (network-state-p (mv-nth 1 (retrieve-network-message x network-st))))) (defun+ make-square-request (value-to-square) (declare (xargs :guard (integerp value-to-square) :output (network-packet-p (make-square-request value-to-square)))) (make-network-packet :sender *client-id* :dest *server-id* :message (make-message :tag :request :payload value-to-square))) (defn print-states (client-st server-st network-st) (prog2$ (cw "~%Client state is: ~x0~%" client-st) (prog2$ (cw "Server state is: ~x0~%" server-st) (cw "Network state is: ~x0~%" network-st)))) ;;;;;;;;;;;;;;;;;;;;;;; ; Client makes request ;;;;;;;;;;;;;;;;;;;;;;; (defun+ client-step1 (client-st network-st) (declare (xargs :guard (and (client-state-p client-st) (network-state-p network-st)) :output (and (client-state-p (car (client-step1 client-st network-st))) (network-state-p (cadr (client-step1 client-st network-st)))))) (mv client-st (cons (make-square-request (client-state->number-to-square client-st)) network-st))) #+demo-only ; skipped during book certification (let ((client-st *initial-client*) (server-st *initial-server*) (network-st *initial-network*)) (b* (((mv client-st network-st) (client-step1 client-st network-st))) (print-states client-st server-st network-st))) (defun+ make-square-response (dest result) (declare (xargs :guard (and (id-p dest) (integerp result)) :output (network-packet-p (make-square-response dest result)))) (make-network-packet :sender *server-id* :dest dest :message (make-message :tag :answer :payload result))) ;;;;;;;;;;;;;;;;;;;;;;;;;; ; Server creates response ;;;;;;;;;;;;;;;;;;;;;;;;;; ; Reordering the rewrite-clause-type-alist: I added the uppercase text below to ; make this work. See the comment in rewrite-clause-type-alist. ; JSM April 7, 2013. (DEFTHM LEMMA-ADDED-IN-TYPE-ALIST-REORDERING (IMPLIES (AND (NETWORK-STATE-P NETWORK-ST) (CAR (RETRIEVE-NETWORK-MESSAGE :SERVER NETWORK-ST))) (NETWORK-PACKET-P (CAR (RETRIEVE-NETWORK-MESSAGE :SERVER NETWORK-ST))))) ; Note: The old proof of server-step1-output-lemma-2 (generated by the defun+ ; below) was quite complex: the string ``goal'' is mentioned 91 times, 3 ; inductions are performed, and there are 3 forcing rounds to deal with 7 ; forced subgoals. The new proof, using the lemma above, mentions ``goal'' 12 ; times, does no inductions, and one subgoal is forced. (defun+ server-step1 (server-st network-st) (declare (xargs :guard (and (server-state-p server-st) (network-state-p network-st)) :output (and (server-state-p (car (server-step1 server-st network-st))) (network-state-p (cadr (server-step1 server-st network-st)))))) (b* (((mv packet network-st) (retrieve-network-message *server-id* network-st)) ((when (null packet)) (prog2$ (cw "Missing packet~%") (mv server-st network-st)))) (mv (change-server-state server-st :requests-served (+ 1 (server-state->requests-served server-st))) (cons (make-square-response (network-packet->sender packet) (square (message->payload (network-packet->message packet)))) network-st)))) #+demo-only (let ((client-st *initial-client*) (server-st *initial-server*) (network-st *initial-network*)) (mv-let (client-st network-st) (client-step1 client-st network-st) (mv-let (server-st network-st) (server-step1 server-st network-st) (print-states client-st server-st network-st)))) ;;;;;;;;;;;;;;;;;;;;;; ; Client saves answer ;;;;;;;;;;;;;;;;;;;;;; (defun+ client-step2 (client-st network-st) (declare (xargs :guard (and (client-state-p client-st) (network-state-p network-st)) :output (and (client-state-p (car (client-step2 client-st network-st))) (network-state-p (cadr (client-step2 client-st network-st)))))) (b* (((mv packet network-st) (retrieve-network-message *client-id* network-st)) ((when (null packet)) (prog2$ (cw "Missing packet~%") (mv client-st network-st)))) (mv (change-client-state client-st :answer (message->payload (network-packet->message packet))) network-st))) #+demo-only (b* ((client-st *initial-client*) (server-st *initial-server*) (network-st *initial-network*) ((mv client-st network-st) (client-step1 client-st network-st)) (- (print-states client-st server-st network-st)) ((mv server-st network-st) (server-step1 server-st network-st)) (- (print-states client-st server-st network-st)) ((mv client-st network-st) (client-step2 client-st network-st))) (print-states client-st server-st network-st)) ;;;;;;;;;;;;;;;;;;;;;;; ; Concrete correctness ;;;;;;;;;;;;;;;;;;;;;;; (defthm honest-square-is-good-concrete (b* ((client-st *initial-client*) (server-st *initial-server*) (network-st *initial-network*) ((mv client-st network-st) (client-step1 client-st network-st)) ((mv ?server-st network-st) (server-step1 server-st network-st)) ((mv client-st ?network-st) (client-step2 client-st network-st))) (equal (expt (client-state->number-to-square client-st) 2) (client-state->answer client-st)))) ;;;;;;;;;;;;;;;;;;;;;;; ; Symbolic correctness ;;;;;;;;;;;;;;;;;;;;;;; (defthm honest-square-is-good-symbolic-simulation (implies (and (client-state-p client-st-orig) (server-state-p server-st) (network-state-p network-st)) (b* (((mv client-st network-st) (client-step1 client-st-orig network-st)) ((mv ?server-st network-st) (server-step1 server-st network-st)) ((mv client-st ?network-st) (client-step2 client-st network-st))) (equal (expt (client-state->number-to-square client-st-orig) 2) (client-state->answer client-st))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Define a specific attack ;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun+ man-in-the-middle-specific-attack (network-st) (declare (xargs :guard (network-state-p network-st) :output (network-state-p (man-in-the-middle-specific-attack network-st)))) ; Changes the number that the client requested (b* (((mv original-packet network-st) (retrieve-network-message *server-id* network-st)) ((when (null original-packet)) (prog2$ (cw "Missing packet~%") network-st))) (cons (make-square-request (+ 1 (message->payload (network-packet->message original-packet)))) network-st))) #+demo-only (b* ((client-st *initial-client*) ; not symbolic, because it has concrete initialization (server-st *initial-server*) (network-st *initial-network*) ((mv client-st network-st) (client-step1 client-st network-st)) (- (print-states client-st server-st network-st)) (- (cw "~%Attack!!!~%~%")) (network-st (man-in-the-middle-specific-attack network-st)) (- (print-states client-st server-st network-st)) (- (cw "~%Done attacking~%~%")) ((mv server-st network-st) (server-step1 server-st network-st)) (- (print-states client-st server-st network-st)) ((mv client-st network-st) (client-step2 client-st network-st))) (print-states client-st server-st network-st)) ; There is no point in trying to prove the analogous concrete or symbolic ; versions of the honest-square-is-good* theorems -- they would not be true. ;;;;;;;;;;;;;;;;;;;;;;;;;; ; Define abstract attacks ;;;;;;;;;;;;;;;;;;;;;;;;;; ; We leave attack1 and attack2 completely unconstrained. We could be a little ; more realistic and at least define versions that return a network-state-p. ; However, this difference will not affect our ability to not prove the theorem ; below (it will still be false). Thus, we opt for the simple call to defstub, ; so that the reader can more clearly see that we allow the attacker to ; anything their heart desires to the network state. ; We define attack1 and attack2 to be functions that each take a single ; argument and return a single value -- nothing more. (defstub attack1 (*) => *) (defstub attack2 (*) => *) ; Technically being unable to prove the below theorem in ACL2 doesn't mean that ; the theorem isn't valid. However, if we believed the theorem to be valid, we ; would relentlessly examine the feedback from ACL2 until we figured out either ; of (1) how to make ACL2 agree with our belief or (2) a counterexample that ; illustrates a weakness in the protocol. In this example, we happen to know ; that the theorem isn't true (we have a such a counter-example, shown in ; function man-in-the-middle-specific-attack), so we leave it as is. #|| (defthm |bad-square-is-good?-with-double-attack| (implies (and (client-state-p client-st-orig) ; is symbolic (server-state-p server-st) (network-state-p network-st)) (b* (((mv client-st network-st) (client-step1 client-st network-st)) (network-st (attack1 network-st)) ; ATTACK!!! ((mv ?server-st network-st) (server-step1 server-st network-st)) (network-st (attack2 network-st)) ; ATTACK!!! ((mv client-st ?network-st) (client-step2 client-st network-st))) (equal (expt (client-state->number-to-square client-st-orig) 2) (client-state->answer client-st))))) ||#
high
0.714039
99,961
\documentclass[10 pt]{article} \include{setup} \include{profes} \begin{document} \include{rev} \input{headerMs.tex} \section{Datos de Identificaci\'{o}n de la Unidad de Aprendizaje:} \subsection{Clave y nombre de la Unidad de Aprendizaje:} \fbox{{\iam} Inteligencia artificial} \subsection{Frecuencia semanal:} horas de trabajo presencial \fbox{4} \subsection{Horas de trabajo extra aula por semana:} \fbox{2} \subsection{Modalidad:} \yes~Escolarizada \no~No escolarizada \no~Mixto \subsection{Per\'{\i}odo acad\'{e}mico:} \yes~Semestral \no~Tetramestral \no~Modular \subsection{LGAC:} \underline{\seys} \subsection{Ubicaci\'{o}n semestral:} \fbox{1 o 2} \subsection{\'{A}rea curricular:} \underline{\fb, \fa, \da, \le, \inv} \subsection{Cr\'{e}ditos:} \fbox{4} \subsection{Requisito:} \fbox{Ninguno} \subsection{Fecha de elaboraci\'{o}n:} \fbox{20/01/2010} \subsection{Fecha de la \'{u}ltima actualizaci\'{o}n:} \fbox{10/06/2021} \subsection{Responsable(s) del dise\~{n}o:} \fbox{\parbox{9cm}{\begin{itemize}[label={}] \item {\nromeo~\romeo} \item {\nelisa~\elisa} \end{itemize}}} \newpage \input{pp-ia.tex} \section{Competencias del perfil de egreso:} \subsection{Competencias del perfil de egreso} \quad \input{p1m.tex} \input{p2.tex} \input{p3.tex} \subsection{Competencias generales a que se vincula la Unidad de Aprendizaje:} \quad \input{comp_gen.tex} \input{c2.tex} & Tareas \\ \hline \input{c3.tex} & Tareas \\ \hline \input{c5.tex} & Tareas, proyecto \\ \hline \end{tabular} \newpage \input{comp-esp-ia.tex} \input{diag-ia-ms.tex} \input{end-ia.tex}
low
0.279792
99,962
/* * Copyright 2016 The BigDL Authors. * * 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 com.intel.analytics.bigdl.keras import com.intel.analytics.bigdl.dllib.nn.abstractnn.DataFormat import com.intel.analytics.bigdl.dllib.nn.{CategoricalCrossEntropy, SpatialSeparableConvolution} class SpatialSeparableConvolutionSpec extends KerasBaseSpec { "SpatialSeperableConvolution" should "be ok" in { ifskipTest() val kerasCode = """ |input_tensor = Input(shape=[5, 5, 2]) |output_tensor = SeparableConv2D(2, 2, 2)(input_tensor) |model = Model(input=input_tensor, output=output_tensor) |input = np.random.uniform(0, 1, [2, 5, 5, 2]) """.stripMargin val layer = SpatialSeparableConvolution[Float](2, 2, 1, 2, 2, dataFormat = DataFormat.NHWC) checkOutputAndGrad(layer, kerasCode) } "SpatialSeperableConvolution" should "be ok when depth multipler is not 1" in { ifskipTest() val kerasCode = """ |input_tensor = Input(shape=[5, 5, 2]) |output_tensor = SeparableConv2D(4, 2, 2, depth_multiplier=2)(input_tensor) |model = Model(input=input_tensor, output=output_tensor) |input = np.random.uniform(0, 1, [2, 5, 5, 2]) """.stripMargin val layer = SpatialSeparableConvolution[Float](2, 4, 2, 2, 2, dataFormat = DataFormat.NHWC) checkOutputAndGrad(layer, kerasCode) } }
high
0.559919
99,963
function Integer k(x,y)=3; function Integer l(Integer x)=3; module mkTest(); function f(); return ?; endfunction function g(Integer x); return ?; endfunction function h(x); return ?; endfunction function i; return ?; endfunction function Bool j; return ?; endfunction function d(x,y)=2; function Integer k(x,y)=3; function Integer l(Integer x)=3; function m provisos(Add#(1, 2, 3)) = 2; endmodule
low
0.186067
99,964
(* File: Length.thy Time-stamp: <2016-01-06T17:48:20Z> Author: JRF Web: http://jrf.cocolog-nifty.com/software/2016/01/post.html Logic Image: Logics_ZF (of Isabelle2020) *) theory Length imports Lambda dLambda begin definition LLength :: "i=>i" where "LLength(M) == LTerm_rec(%x. 0, %x m r. succ(r), %m n rm rn. succ(rm Un rn), M)" definition Length :: "i=>i" where "Length(M) == THE n. n: (INT m: M. {LLength(m)})" lemma LLength_eqns: "LLength(LVar(x)) = 0" "LLength(LLam(x, M)) = succ(LLength(M))" "LLength(LApp(M, N)) = succ(LLength(M) Un LLength(N))" apply (unfold LLength_def) apply simp_all done lemma LLength_type: "M: LTerm ==> LLength(M): nat" apply (erule LTerm.induct) apply (simp_all only: LLength_eqns) apply (assumption | rule nat_succI nat_UnI nat_0I)+ done lemma LSkeltonEq_imp_LLength_eq: assumes major: "LSkeltonEq(M, N)" shows "LLength(M) = LLength(N)" apply (rule major [THEN rev_mp]) apply (rule_tac x="N" in spec) apply (rule major [THEN LSkeltonEqD1, THEN LTerm.induct]) apply (safe elim!: LSkeltonEq_LTermEs) apply (simp_all add: LLength_eqns) done lemma Length_LAQ: "m: LTerm ==> Length(LAQ(m)) = LLength(m)" apply (unfold Length_def) apply (rule the_equality) apply (rule INT_I) apply (rule_tac [2] not_emptyI) apply (erule_tac [2] LAQ_self) apply (drule LAQ_D) apply (drule LAlphaD1 [THEN LSkeltonEq_imp_LLength_eq]) apply blast apply (drule INT_E) apply (erule LAQ_self) apply (erule singletonE) apply assumption done lemma Length_type: "M: Term ==> Length(M): nat" apply (erule TermE) apply hypsubst apply (simp only: Length_LAQ) apply (erule LLength_type) done lemma Length_Var: "x: LVariable ==> Length(Var(x)) = 0" apply (simp add: Term_LAQ Length_LAQ LLength_eqns) done lemma Length_Lam: "[| x: LVariable; M: Term |] ==> Length(Lam(x, M)) = succ(Length(M))" apply (erule TermE)+ apply (simp add: Term_LAQ Length_LAQ LLength_eqns) done lemma Length_App: "[| M: Term; N: Term |] ==> Length(App(M, N)) = succ(Length(M) Un Length(N))" apply (erule TermE)+ apply (simp add: Term_LAQ Length_LAQ LLength_eqns) done lemmas Length_eqns = Length_Var Length_Lam Length_App lemma Length_induct: assumes major: "M: Term" and prem: "!!M. [| M: Term; ALL N: Term. Length(N) < Length(M) --> P(N) |] ==> P(M)" shows "P(M)" apply (rule major [THEN rev_mp]) apply (rule_tac P="Length(M) = Length(M)" in rev_mp) apply (rule_tac [2] P="%x. Length(M) = Length(x) --> x : Term --> P(x)" in major [THEN [2] bspec]) apply (rule_tac [2] P="%n. ALL M: Term. n = Length(M) --> M: Term --> P(M)" in major [THEN Length_type, THEN complete_induct0]) apply (rule refl) apply safe apply (erule prem) apply safe apply (erule bspec [THEN bspec, THEN mp, THEN mp]) apply (erule ltD) apply (assumption | rule refl)+ done lemma Term_induct2: assumes major: "M: Term" and prem1: "X: Fin(LVariable)" and "!! x . x: LVariable ==> P(Var(x))" and "!! x M . [| x: LVariable; x ~: X; M: Term; P(M) |] ==> P(Lam(x, M))" and "!! M N . [| M: Term; P(M); N: Term; P(N) |] ==> P(App(M, N))" shows "P(M)" apply (rule major [THEN Length_induct]) apply (erule Term_cases) apply safe apply (rule_tac [2] prem1 [THEN [3] Infinite_LVariable_Alpha_lemma2, THEN bexE]) apply (erule_tac [2] asm_rl)+ apply (erule_tac [2] bexE conjE)+ apply (rotate_tac [1] 1) apply (rotate_tac [2] 1) apply (rotate_tac [3] 1) prefer 2 apply simp apply (simp_all add: Length_eqns) apply (rule_tac [3] assms) apply (rule_tac [2] assms) apply (rule_tac [1] assms) prefer 5 prefer 6 prefer 8 apply assumption+ apply (erule_tac [3] bspec [THEN mp]) apply (erule_tac [2] bspec [THEN mp]) apply (erule_tac [1] bspec [THEN mp]) apply (assumption | rule nat_into_Ord le_refl Length_type Un_upper1_le Un_upper2_le)+ done lemmas Term_typechecks = Term_intros subst_type Length_type lemmas Term_simps = Term_free_iffs Length_eqns subst_eqns FV_eqns declare Term_typechecks [TC] declare Term_simps [simp] end
high
0.589738
99,965
/* * Copyright 2016-present Open Networking Foundation * * 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.onosproject.net.link; import java.util.Set; import org.onosproject.net.provider.ProviderId; import com.google.common.collect.ImmutableSet; /** * Testing adapter for the LinkProviderRegistry API. */ public class LinkProviderRegistryAdapter implements LinkProviderRegistry { LinkProviderServiceAdapter providerService = null; @Override public LinkProviderService register(LinkProvider provider) { providerService = new LinkProviderServiceAdapter(provider); return providerService; } @Override public void unregister(LinkProvider provider) { if (providerService != null && provider.id().equals(providerService.provider().id())) { providerService = null; } } @Override public Set<ProviderId> getProviders() { if (providerService != null) { return ImmutableSet.of(providerService.provider().id()); } else { return ImmutableSet.of(); } } public LinkProviderServiceAdapter registeredProvider() { return providerService; } }
high
0.816089
99,966
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 // basic sanity test vseq class aes_sanity_vseq extends aes_base_vseq; `uvm_object_utils(aes_sanity_vseq) `uvm_object_new task body(); `uvm_info(`gfn, $sformatf("STARTING AES SEQUENCE"), UVM_LOW); `DV_CHECK_RANDOMIZE_FATAL(this) `uvm_info(`gfn, $sformatf("running aes sanity sequence"), UVM_LOW); endtask : body endclass : aes_sanity_vseq
high
0.576465
99,967
functions { real race(int winner, real RT, real[] alpha, real b, real sigma, real psi){ real log_lik; int N_choices; N_choices = num_elements(alpha); log_lik = 0; for(c in 1:N_choices) if(c == winner) log_lik = log_lik + lognormal_lpdf(RT - psi|b - alpha[c], sigma); else log_lik = log_lik + lognormal_lccdf(RT - psi|b - alpha[c], sigma); return(log_lik); } } data { int<lower = 0> N_obs; int<lower = 1> N_choices; int<lower = 1, upper = N_choices> winner[N_obs]; vector<lower = 0>[N_obs] RT; } transformed data { real b; //arbitrary threshold real min_RT; b = 10; min_RT = min(RT); } parameters{ real alpha[N_choices]; real<lower=0> sigma; real<lower=0,upper=min_RT> psi; } model { alpha ~ normal(0,10); sigma ~ normal(0,2); psi ~ normal(0,300); for (n in 1:N_obs) { target += race(winner[n], RT[n], alpha, b, sigma, psi); } }
high
0.388099
99,968
nqubits = 14; name = "14v1 1 5 3 1 1 1 1"; nstates = 4; amplitude[x_,y_] := (Exp[-13 I y] (1 (I Sin[x])^6 Cos[x]^8 + 1 (I Sin[x])^8 Cos[x]^6) + Exp[-11 I y] (4 (I Sin[x])^5 Cos[x]^9 + 4 (I Sin[x])^9 Cos[x]^5 + 4 (I Sin[x])^7 Cos[x]^7 + 4 (I Sin[x])^6 Cos[x]^8 + 4 (I Sin[x])^8 Cos[x]^6 + 2 (I Sin[x])^4 Cos[x]^10 + 2 (I Sin[x])^10 Cos[x]^4 + 1 (I Sin[x])^3 Cos[x]^11 + 1 (I Sin[x])^11 Cos[x]^3) + Exp[-9 I y] (34 (I Sin[x])^7 Cos[x]^7 + 22 (I Sin[x])^5 Cos[x]^9 + 22 (I Sin[x])^9 Cos[x]^5 + 25 (I Sin[x])^6 Cos[x]^8 + 25 (I Sin[x])^8 Cos[x]^6 + 11 (I Sin[x])^4 Cos[x]^10 + 11 (I Sin[x])^10 Cos[x]^4 + 3 (I Sin[x])^3 Cos[x]^11 + 3 (I Sin[x])^11 Cos[x]^3) + Exp[-7 I y] (43 (I Sin[x])^4 Cos[x]^10 + 43 (I Sin[x])^10 Cos[x]^4 + 99 (I Sin[x])^6 Cos[x]^8 + 99 (I Sin[x])^8 Cos[x]^6 + 110 (I Sin[x])^7 Cos[x]^7 + 70 (I Sin[x])^5 Cos[x]^9 + 70 (I Sin[x])^9 Cos[x]^5 + 15 (I Sin[x])^3 Cos[x]^11 + 15 (I Sin[x])^11 Cos[x]^3 + 4 (I Sin[x])^2 Cos[x]^12 + 4 (I Sin[x])^12 Cos[x]^2) + Exp[-5 I y] (271 (I Sin[x])^8 Cos[x]^6 + 271 (I Sin[x])^6 Cos[x]^8 + 88 (I Sin[x])^4 Cos[x]^10 + 88 (I Sin[x])^10 Cos[x]^4 + 176 (I Sin[x])^5 Cos[x]^9 + 176 (I Sin[x])^9 Cos[x]^5 + 290 (I Sin[x])^7 Cos[x]^7 + 29 (I Sin[x])^3 Cos[x]^11 + 29 (I Sin[x])^11 Cos[x]^3 + 6 (I Sin[x])^2 Cos[x]^12 + 6 (I Sin[x])^12 Cos[x]^2) + Exp[-3 I y] (64 (I Sin[x])^3 Cos[x]^11 + 64 (I Sin[x])^11 Cos[x]^3 + 320 (I Sin[x])^5 Cos[x]^9 + 320 (I Sin[x])^9 Cos[x]^5 + 466 (I Sin[x])^6 Cos[x]^8 + 466 (I Sin[x])^8 Cos[x]^6 + 153 (I Sin[x])^4 Cos[x]^10 + 153 (I Sin[x])^10 Cos[x]^4 + 17 (I Sin[x])^2 Cos[x]^12 + 17 (I Sin[x])^12 Cos[x]^2 + 4 (I Sin[x])^1 Cos[x]^13 + 4 (I Sin[x])^13 Cos[x]^1 + 526 (I Sin[x])^7 Cos[x]^7) + Exp[-1 I y] (798 (I Sin[x])^7 Cos[x]^7 + 414 (I Sin[x])^5 Cos[x]^9 + 414 (I Sin[x])^9 Cos[x]^5 + 53 (I Sin[x])^3 Cos[x]^11 + 53 (I Sin[x])^11 Cos[x]^3 + 176 (I Sin[x])^4 Cos[x]^10 + 176 (I Sin[x])^10 Cos[x]^4 + 662 (I Sin[x])^8 Cos[x]^6 + 662 (I Sin[x])^6 Cos[x]^8 + 10 (I Sin[x])^12 Cos[x]^2 + 10 (I Sin[x])^2 Cos[x]^12 + 2 (I Sin[x])^1 Cos[x]^13 + 2 (I Sin[x])^13 Cos[x]^1) + Exp[1 I y] (27 (I Sin[x])^2 Cos[x]^12 + 27 (I Sin[x])^12 Cos[x]^2 + 231 (I Sin[x])^4 Cos[x]^10 + 231 (I Sin[x])^10 Cos[x]^4 + 609 (I Sin[x])^6 Cos[x]^8 + 609 (I Sin[x])^8 Cos[x]^6 + 706 (I Sin[x])^7 Cos[x]^7 + 404 (I Sin[x])^5 Cos[x]^9 + 404 (I Sin[x])^9 Cos[x]^5 + 87 (I Sin[x])^3 Cos[x]^11 + 87 (I Sin[x])^11 Cos[x]^3 + 4 (I Sin[x])^1 Cos[x]^13 + 4 (I Sin[x])^13 Cos[x]^1 + 1 Cos[x]^14 + 1 (I Sin[x])^14) + Exp[3 I y] (511 (I Sin[x])^8 Cos[x]^6 + 511 (I Sin[x])^6 Cos[x]^8 + 132 (I Sin[x])^4 Cos[x]^10 + 132 (I Sin[x])^10 Cos[x]^4 + 300 (I Sin[x])^5 Cos[x]^9 + 300 (I Sin[x])^9 Cos[x]^5 + 594 (I Sin[x])^7 Cos[x]^7 + 39 (I Sin[x])^11 Cos[x]^3 + 39 (I Sin[x])^3 Cos[x]^11 + 8 (I Sin[x])^2 Cos[x]^12 + 8 (I Sin[x])^12 Cos[x]^2) + Exp[5 I y] (54 (I Sin[x])^3 Cos[x]^11 + 54 (I Sin[x])^11 Cos[x]^3 + 196 (I Sin[x])^5 Cos[x]^9 + 196 (I Sin[x])^9 Cos[x]^5 + 222 (I Sin[x])^7 Cos[x]^7 + 226 (I Sin[x])^8 Cos[x]^6 + 226 (I Sin[x])^6 Cos[x]^8 + 109 (I Sin[x])^4 Cos[x]^10 + 109 (I Sin[x])^10 Cos[x]^4 + 4 (I Sin[x])^1 Cos[x]^13 + 4 (I Sin[x])^13 Cos[x]^1 + 15 (I Sin[x])^2 Cos[x]^12 + 15 (I Sin[x])^12 Cos[x]^2) + Exp[7 I y] (74 (I Sin[x])^9 Cos[x]^5 + 74 (I Sin[x])^5 Cos[x]^9 + 128 (I Sin[x])^7 Cos[x]^7 + 109 (I Sin[x])^6 Cos[x]^8 + 109 (I Sin[x])^8 Cos[x]^6 + 31 (I Sin[x])^10 Cos[x]^4 + 31 (I Sin[x])^4 Cos[x]^10 + 8 (I Sin[x])^11 Cos[x]^3 + 8 (I Sin[x])^3 Cos[x]^11) + Exp[9 I y] (23 (I Sin[x])^4 Cos[x]^10 + 23 (I Sin[x])^10 Cos[x]^4 + 15 (I Sin[x])^6 Cos[x]^8 + 15 (I Sin[x])^8 Cos[x]^6 + 18 (I Sin[x])^9 Cos[x]^5 + 18 (I Sin[x])^5 Cos[x]^9 + 16 (I Sin[x])^7 Cos[x]^7 + 4 (I Sin[x])^2 Cos[x]^12 + 4 (I Sin[x])^12 Cos[x]^2 + 10 (I Sin[x])^3 Cos[x]^11 + 10 (I Sin[x])^11 Cos[x]^3) + Exp[11 I y] (2 (I Sin[x])^10 Cos[x]^4 + 2 (I Sin[x])^4 Cos[x]^10 + 5 (I Sin[x])^8 Cos[x]^6 + 5 (I Sin[x])^6 Cos[x]^8 + 4 (I Sin[x])^5 Cos[x]^9 + 4 (I Sin[x])^9 Cos[x]^5 + 4 (I Sin[x])^7 Cos[x]^7) + Exp[13 I y] (1 (I Sin[x])^3 Cos[x]^11 + 1 (I Sin[x])^11 Cos[x]^3))/Sqrt[2^nqubits]; amplitude2[x_,y_] := (Exp[-13 I y] (1 (I Sin[x])^6 Cos[x]^8 + 1 (I Sin[x])^8 Cos[x]^6) + Exp[-11 I y] (4 (I Sin[x])^5 Cos[x]^9 + 4 (I Sin[x])^9 Cos[x]^5 + 4 (I Sin[x])^7 Cos[x]^7 + 4 (I Sin[x])^6 Cos[x]^8 + 4 (I Sin[x])^8 Cos[x]^6 + 2 (I Sin[x])^4 Cos[x]^10 + 2 (I Sin[x])^10 Cos[x]^4 + 1 (I Sin[x])^3 Cos[x]^11 + 1 (I Sin[x])^11 Cos[x]^3) + Exp[-9 I y] (34 (I Sin[x])^7 Cos[x]^7 + 22 (I Sin[x])^5 Cos[x]^9 + 22 (I Sin[x])^9 Cos[x]^5 + 25 (I Sin[x])^6 Cos[x]^8 + 25 (I Sin[x])^8 Cos[x]^6 + 11 (I Sin[x])^4 Cos[x]^10 + 11 (I Sin[x])^10 Cos[x]^4 + 3 (I Sin[x])^3 Cos[x]^11 + 3 (I Sin[x])^11 Cos[x]^3) + Exp[-7 I y] (43 (I Sin[x])^4 Cos[x]^10 + 43 (I Sin[x])^10 Cos[x]^4 + 99 (I Sin[x])^6 Cos[x]^8 + 99 (I Sin[x])^8 Cos[x]^6 + 110 (I Sin[x])^7 Cos[x]^7 + 70 (I Sin[x])^5 Cos[x]^9 + 70 (I Sin[x])^9 Cos[x]^5 + 15 (I Sin[x])^3 Cos[x]^11 + 15 (I Sin[x])^11 Cos[x]^3 + 4 (I Sin[x])^2 Cos[x]^12 + 4 (I Sin[x])^12 Cos[x]^2) + Exp[-5 I y] (271 (I Sin[x])^8 Cos[x]^6 + 271 (I Sin[x])^6 Cos[x]^8 + 88 (I Sin[x])^4 Cos[x]^10 + 88 (I Sin[x])^10 Cos[x]^4 + 176 (I Sin[x])^5 Cos[x]^9 + 176 (I Sin[x])^9 Cos[x]^5 + 290 (I Sin[x])^7 Cos[x]^7 + 29 (I Sin[x])^3 Cos[x]^11 + 29 (I Sin[x])^11 Cos[x]^3 + 6 (I Sin[x])^2 Cos[x]^12 + 6 (I Sin[x])^12 Cos[x]^2) + Exp[-3 I y] (64 (I Sin[x])^3 Cos[x]^11 + 64 (I Sin[x])^11 Cos[x]^3 + 320 (I Sin[x])^5 Cos[x]^9 + 320 (I Sin[x])^9 Cos[x]^5 + 466 (I Sin[x])^6 Cos[x]^8 + 466 (I Sin[x])^8 Cos[x]^6 + 153 (I Sin[x])^4 Cos[x]^10 + 153 (I Sin[x])^10 Cos[x]^4 + 17 (I Sin[x])^2 Cos[x]^12 + 17 (I Sin[x])^12 Cos[x]^2 + 4 (I Sin[x])^1 Cos[x]^13 + 4 (I Sin[x])^13 Cos[x]^1 + 526 (I Sin[x])^7 Cos[x]^7) + Exp[-1 I y] (798 (I Sin[x])^7 Cos[x]^7 + 414 (I Sin[x])^5 Cos[x]^9 + 414 (I Sin[x])^9 Cos[x]^5 + 53 (I Sin[x])^3 Cos[x]^11 + 53 (I Sin[x])^11 Cos[x]^3 + 176 (I Sin[x])^4 Cos[x]^10 + 176 (I Sin[x])^10 Cos[x]^4 + 662 (I Sin[x])^8 Cos[x]^6 + 662 (I Sin[x])^6 Cos[x]^8 + 10 (I Sin[x])^12 Cos[x]^2 + 10 (I Sin[x])^2 Cos[x]^12 + 2 (I Sin[x])^1 Cos[x]^13 + 2 (I Sin[x])^13 Cos[x]^1) + Exp[1 I y] (27 (I Sin[x])^2 Cos[x]^12 + 27 (I Sin[x])^12 Cos[x]^2 + 231 (I Sin[x])^4 Cos[x]^10 + 231 (I Sin[x])^10 Cos[x]^4 + 609 (I Sin[x])^6 Cos[x]^8 + 609 (I Sin[x])^8 Cos[x]^6 + 706 (I Sin[x])^7 Cos[x]^7 + 404 (I Sin[x])^5 Cos[x]^9 + 404 (I Sin[x])^9 Cos[x]^5 + 87 (I Sin[x])^3 Cos[x]^11 + 87 (I Sin[x])^11 Cos[x]^3 + 4 (I Sin[x])^1 Cos[x]^13 + 4 (I Sin[x])^13 Cos[x]^1 + 1 Cos[x]^14 + 1 (I Sin[x])^14) + Exp[3 I y] (511 (I Sin[x])^8 Cos[x]^6 + 511 (I Sin[x])^6 Cos[x]^8 + 132 (I Sin[x])^4 Cos[x]^10 + 132 (I Sin[x])^10 Cos[x]^4 + 300 (I Sin[x])^5 Cos[x]^9 + 300 (I Sin[x])^9 Cos[x]^5 + 594 (I Sin[x])^7 Cos[x]^7 + 39 (I Sin[x])^11 Cos[x]^3 + 39 (I Sin[x])^3 Cos[x]^11 + 8 (I Sin[x])^2 Cos[x]^12 + 8 (I Sin[x])^12 Cos[x]^2) + Exp[5 I y] (54 (I Sin[x])^3 Cos[x]^11 + 54 (I Sin[x])^11 Cos[x]^3 + 196 (I Sin[x])^5 Cos[x]^9 + 196 (I Sin[x])^9 Cos[x]^5 + 222 (I Sin[x])^7 Cos[x]^7 + 226 (I Sin[x])^8 Cos[x]^6 + 226 (I Sin[x])^6 Cos[x]^8 + 109 (I Sin[x])^4 Cos[x]^10 + 109 (I Sin[x])^10 Cos[x]^4 + 4 (I Sin[x])^1 Cos[x]^13 + 4 (I Sin[x])^13 Cos[x]^1 + 15 (I Sin[x])^2 Cos[x]^12 + 15 (I Sin[x])^12 Cos[x]^2) + Exp[7 I y] (74 (I Sin[x])^9 Cos[x]^5 + 74 (I Sin[x])^5 Cos[x]^9 + 128 (I Sin[x])^7 Cos[x]^7 + 109 (I Sin[x])^6 Cos[x]^8 + 109 (I Sin[x])^8 Cos[x]^6 + 31 (I Sin[x])^10 Cos[x]^4 + 31 (I Sin[x])^4 Cos[x]^10 + 8 (I Sin[x])^11 Cos[x]^3 + 8 (I Sin[x])^3 Cos[x]^11) + Exp[9 I y] (23 (I Sin[x])^4 Cos[x]^10 + 23 (I Sin[x])^10 Cos[x]^4 + 15 (I Sin[x])^6 Cos[x]^8 + 15 (I Sin[x])^8 Cos[x]^6 + 18 (I Sin[x])^9 Cos[x]^5 + 18 (I Sin[x])^5 Cos[x]^9 + 16 (I Sin[x])^7 Cos[x]^7 + 4 (I Sin[x])^2 Cos[x]^12 + 4 (I Sin[x])^12 Cos[x]^2 + 10 (I Sin[x])^3 Cos[x]^11 + 10 (I Sin[x])^11 Cos[x]^3) + Exp[11 I y] (2 (I Sin[x])^10 Cos[x]^4 + 2 (I Sin[x])^4 Cos[x]^10 + 5 (I Sin[x])^8 Cos[x]^6 + 5 (I Sin[x])^6 Cos[x]^8 + 4 (I Sin[x])^5 Cos[x]^9 + 4 (I Sin[x])^9 Cos[x]^5 + 4 (I Sin[x])^7 Cos[x]^7) + Exp[13 I y] (1 (I Sin[x])^3 Cos[x]^11 + 1 (I Sin[x])^11 Cos[x]^3)); probability[x_, y_] := Abs[amplitude[x, y]]^2; result = NMaximize[{nstates*probability[a, b], 0 < a < Pi/2, 0 < b < Pi}, {a, b}, Method -> {"SimulatedAnnealing", "PerturbationScale" -> 15}]; Print[name, ": ", result] f = probability[c, d]; n = Pi; Plot3D[f, {c, 0, n/2}, {d, -n, n}, PlotRange -> All] ContourPlot[probability[x, y], {x, 0, n/2}, {y, 0, n}, PlotLegends -> Automatic, Contours -> 30]
high
0.178802
99,969
(fn t116 [n] (let [is_prime (fn is_prime [x] (if (= x 2) true (every? #(not= 0 (rem x %)) (cons 2 (filter odd? (range 3 x))))))] (and (not= n 1) (not= n 2) (is_prime n) (= n (/ (+ (nth (filter is_prime (range n (+ n 1000))) 1) (nth (filter is_prime (range n 0 -1)) 1)) 2)))))
high
0.343918
99,970
module Structural3DApplicationM use UtilitiesM use DebuggerM use SourceM use NodeM use StructuralElementM use PressureM use StructuralMaterialM use StructuralModelM implicit none private public :: Structural3DApplicationDT, structural3DApplication type :: Structural3DApplicationDT type(NodeDT) , dimension(:), allocatable :: node type(StructuralElementDT) , dimension(:), allocatable :: element type(PressureDT) , dimension(:), allocatable :: pressure type(SourceDT) , dimension(:), allocatable :: source type(StructuralMaterialDT), dimension(:), allocatable :: material type(StructuralModelDT) :: model contains procedure, public :: init end type Structural3DApplicationDT interface structural3DApplication procedure :: constructor end interface structural3DApplication contains type(Structural3DApplicationDT) function & constructor(nNode, nElement, nPressure, nSource, nMaterial, nGauss, nnz) implicit none integer(ikind), intent(in) :: nNode integer(ikind), intent(in) :: nElement integer(ikind), intent(in) :: nPressure integer(ikind), intent(in) :: nSource integer(ikind), intent(in) :: nMaterial integer(ikind), intent(in) :: nGauss integer(ikind), intent(in) :: nnz call constructor%init(nNode, nElement, nPressure, nSource, nMaterial, nGauss, nnz) end function constructor subroutine init(this, nNode, nElement, nPressure, nSource, nMaterial, nGauss, nnz) implicit none class(Structural3DApplicationDT), intent(inout) :: this integer(ikind) , intent(in) :: nNode integer(ikind) , intent(in) :: nElement integer(ikind) , intent(in) :: nPressure integer(ikind) , intent(in) :: nSource integer(ikind) , intent(in) :: nMaterial integer(ikind) , intent(in) :: nGauss integer(ikind) , intent(in) :: nnz allocate(this%node(nNode)) allocate(this%element(nElement)) allocate(this%pressure(nPressure)) allocate(this%source(nSource)) allocate(this%material(nMaterial)) call initGeometries(nGauss) this%model = structuralModel( & nDof = 3*nNode & , nnz = nnz & , id = 1 & , nNode = nNode & , nElement = nElement & , nCondition = nPressure ) end subroutine init end module Structural3DApplicationM
high
0.617003
99,971
" Background options. " Class { #name : #HighstockAnnotationsTunnelTypeOptionsBackground, #superclass : #HighchartsComponent, #category : #'HighstockSt-V8' } { #category : #accessing } HighstockAnnotationsTunnelTypeOptionsBackground >> fill: aString [ configurationOptions at: 'fill' put: aString ] { #category : #accessing } HighstockAnnotationsTunnelTypeOptionsBackground >> strokeWidth: aNumber [ configurationOptions at: 'strokeWidth' put: aNumber ]
high
0.326938
99,972
namespace cpp thrift.test.debug namespace java thrift.test struct Doubles { 1: double nan, 2: double inf, 3: double neginf, 4: double repeating, 5: double big, 6: double small, 7: double zero, 8: double negzero, } struct OneOfEach { 1: bool im_true, 2: bool im_false, 3: byte a_bite = 200, 4: i16 integer16 = 33000, 5: i32 integer32, 6: i64 integer64 = 10000000000, 7: double double_precision, 8: string some_characters, 9: string zomg_unicode, 10: bool what_who, 11: binary base64, 12: list<byte> byte_list = [1, 2, 3], 13: list<i16> i16_list = [1,2,3], 14: list<i64> i64_list = [1,2,3] } struct Bonk { 1: i32 type, 2: string message, } struct Nesting { 1: Bonk my_bonk, 2: OneOfEach my_ooe, } struct HolyMoley { 1: list<OneOfEach> big, 2: set<list<string>> contain, 3: map<string,list<Bonk>> bonks, } struct Backwards { 2: i32 first_tag2, 1: i32 second_tag1, } struct Empty { } struct Wrapper { 1: Empty foo } struct RandomStuff { 1: i32 a, 2: i32 b, 3: i32 c, 4: i32 d, 5: list<i32> myintlist, 6: map<i32,Wrapper> maps, 7: i64 bigint, 8: double triple, } struct Base64 { 1: i32 a, 2: binary b1, 3: binary b2, 4: binary b3, 5: binary b4, 6: binary b5, 7: binary b6, } service Srv { i32 Janky(i32 arg) } service PartiallyReflectable { map<i32,map<i32,i32>> returnNotReflectable(1: i32 hello), void argNotReflectable(1: list<set<i32>> arg), void arg2NotReflectable(1: i32 arg1, 2: list<set<i32>> argNotReflectable), void withMap(1: map<i32, string> amap), OneOfEach refl1(1: list<Bonk> arg1), OneOfEach refl2(2: list<string> arg1, 1: Bonk arg2); } // The only purpose of this thing is to increase the size of the generated code // so that ZlibTest has more highly compressible data to play with. struct BlowUp { 1: map<list<i32>,set<map<i32,string>>> b1; 2: map<list<i32>,set<map<i32,string>>> b2; 3: map<list<i32>,set<map<i32,string>>> b3; 4: map<list<i32>,set<map<i32,string>>> b4; }
high
0.775449
99,973
;;; yoshi-theme-autoloads.el --- automatically extracted autoloads ;; ;;; Code: (add-to-list 'load-path (directory-file-name (or (file-name-directory #$) (car load-path)))) ;;;### (autoloads nil "yoshi-theme" "yoshi-theme.el" (22894 3732 ;;;;;; 0 0)) ;;; Generated autoloads from yoshi-theme.el (and load-file-name (boundp 'custom-theme-load-path) (add-to-list 'custom-theme-load-path (file-name-as-directory (file-name-directory load-file-name)))) ;;;*** ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t ;; End: ;;; yoshi-theme-autoloads.el ends here
low
0.411531
99,974
#!/bin/bash # set -o xtrace AWS_PROFILE=tah export TAGSET='TagSet=[{Key="Name",Value="Popcorn"},{Key="AppID",Value="APP-111"},{Key="Order",Value="980791"},{Key="Org",Value="LnM"},{Key="Owner",Value="b1vc"},{Key="ProjectName",Value="OHGW"},{Key="Notify",Value="tahv@pge.com"},{Key="Environment",Value="TEST"},{Key="Role",Value="Repository"},{Key="createdBy",Value="tahv"},{Key="createDate",Value="2019-11-01"}]' aws s3api put-bucket-tagging --bucket cf-templates-q3xakicer448-us-east-2 --tagging $TAGSET --profile $AWS_PROFILE aws s3api put-bucket-tagging --bucket citrusoft-com-forwarder --tagging $TAGSET --profile $AWS_PROFILE aws s3api put-bucket-tagging --bucket citrusoft-trail-bux --tagging $TAGSET --profile $AWS_PROFILE aws s3api put-bucket-tagging --bucket config-bucket-919568423267 --tagging $TAGSET --profile $AWS_PROFILE aws s3api put-bucket-tagging --bucket config-rule-code-bucket-919568423267-us-east-2 --tagging $TAGSET --profile $AWS_PROFILE # aws s3api get-bucket-tagging --bucket tahunt-bucket --profile tahunt # aws s3api delete-bucket-tagging --bucket tahunt-bucket
low
0.526793
99,975
file(GLOB TEST_SOURCES "test/*.cpp" ) include_directories(${Boost_INCLUDE_DIRS} ${CRYPTOPP_INCLUDE_DIRS} ${JSONCPP_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include) add_executable(ethcrypto-tests EXCLUDE_FROM_ALL ${TEST_SOURCES}) add_dependencies(ethcrypto-tests ethcrypto) target_link_libraries(ethcrypto-tests ethcrypto ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_RANDOM_LIBRARY} ${JSONCPP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ) if(GMP_LIBRARIES) target_link_libraries(ethcrypto-tests ${GMP_LIBRARIES}) endif()
medium
0.668771
99,976
/- Copyright (c) 2018 Keji Neri, Blair Shi. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Keji Neri, Blair Shi * `finite_free_module R n`: the set of maps from (fin n) to R (R ^ n) -- Proved R^n is an abellian group and module R (R ^ n) * `matrix_to_linear_map` : constructs a matrix based on the given linear map * `linear_map_to_matrix` : constructs the linear map based on the given matrix -- Proved the a x b matrices and R-linear maps R^b -> R^a are equivalent -- Proved the product of two matrix is equivalent to the component of two -- corresponding linear maps -- Proved Hom(R^b,R^a) * `linear_map_to_vec V n` : constructs the basis based on the linear map * `vec_to_linear_map V n M` : construct the linear map based on the given basis -- proved a basis v1,v2,...,vn of a fdvs V/k is just an isomorphism k^n -> V -/ import xenalib.Ellen_Arlt_matrix_rings algebra.big_operators import data.set.finite algebra.module data.finsupp import algebra.group linear_algebra.basic data.fintype import data.equiv.basic linear_algebra.linear_map_module import algebra.pi_instances algebra.module data.list.basic open function universe u variables {α : Type u} variables {β : Type*} [add_comm_group α] [add_comm_group β] /-- Predicate for group homomorphism. -/ class is_add_group_hom (f : α → β) : Prop := (add : ∀ a b : α, f (a + b) = (f a) + (f b)) namespace is_add_group_hom variables (f : α → β) [is_add_group_hom f] theorem zero : f 0 = 0 := add_self_iff_eq_zero.1 $ by simp [(add f 0 _).symm] theorem inv (a : α) : f(-a) = -(f a) := eq.symm $ neg_eq_of_add_eq_zero $ by simp [(add f a (-a)).symm, zero f] instance id : is_add_group_hom (@id α) := ⟨λ _ _, rfl⟩ instance comp {γ} [add_comm_group γ] (g : β → γ) [is_add_group_hom g] : is_add_group_hom (g ∘ f) := ⟨λ x y, calc g (f (x + y)) = g (f x + f y) : by rw add f ... = g (f x) + g (f y) : by rw add g⟩ end is_add_group_hom definition finite_free_module (R : Type) (n : nat) := (fin n) → R def add (R : Type) (n : nat) [ring R] := λ (a b :finite_free_module R n), (λ i, (a i) +(b i)) def smul {R : Type} {n : nat} [ring R] (s : R) (rn : finite_free_module R n) : finite_free_module R n := λ I, s * (rn I) theorem add__assoc {R : Type} {n : nat} [ring R] (a b c :(fin n) → R) : add R n (add R n a b) c = add R n a (add R n b c):= begin unfold add, funext, simp, end theorem add__comm {R : Type} {n : nat} [ring R] (a b :(fin n) → R): add R n a b =add R n b a := begin unfold add, funext, exact add_comm (a i) (b i), end def zero (R : Type) (n : nat) [ring R]: finite_free_module R n := λ (i:fin n),(0 :R) #check zero theorem zero__add {R : Type} {n : nat} [ring R] (a:finite_free_module R n): add R n (zero R n) a = a:= begin unfold add, funext, unfold zero, simp, end def neg (R : Type) (n : nat) [ring R]:= λ (a:finite_free_module R n),(λ i, -(a i)) theorem add__left__neg {R : Type} {n : nat} [ring R] (a :finite_free_module R n): add R n (neg R n a) a = zero R n:= begin unfold add, unfold zero, funext, unfold neg, simp, end def add__zero {R : Type} {n : nat} [ring R] (a :finite_free_module R n): add R n a (zero R n) =a:= begin unfold add, funext, unfold zero, simp, end lemma is_add_group_hom_right_inv {α β : Type*} [add_comm_group α] [add_comm_group β] {f: α → β} [is_add_group_hom f] (hf : injective f) { g :β → α} (h: right_inverse g f): is_add_group_hom g:= ⟨ λ a b, hf $ by rw[h(a+b),is_add_group_hom.add f,h a,h b]⟩ instance (R : Type) [ring R] (n : nat) : add_comm_group (finite_free_module R n) := {add:=add R n, add_assoc := add__assoc, zero := zero R n, zero_add:= zero__add, neg:=neg R n, add_left_neg:= add__left__neg, add_zero:= add__zero , add_comm:= add__comm, } namespace R_module variables (R : Type) (n : nat) variable [ring R] theorem smul_add (s : R) (rn rm : finite_free_module R n) : smul s (add R n rn rm) = add R n (smul s rn) (smul s rm) := -- s • (rn + rm) = s • rn + s • rm begin apply funext, intro, unfold smul add, apply mul_add, end theorem add_smul (s t : R) (rn: finite_free_module R n): smul (s + t) rn = add R n (smul s rn) (smul t rn) := begin apply funext, intro, unfold smul add, apply add_mul, end theorem mul_smul (s t : R) (rn : finite_free_module R n): smul (s * t) rn = smul s (smul t rn) := begin apply funext, intro, unfold smul, apply mul_assoc, end theorem one_smul (rn : finite_free_module R n): smul (1 : R) rn = rn := begin apply funext, intro, unfold smul, apply one_mul, end end R_module instance (R : Type) [ring R] (n : nat) : has_scalar R (finite_free_module R n) := { smul := smul } instance {R : Type} {n : nat} [ring R] : module R (finite_free_module R n) := { smul_add := R_module.smul_add R n, add_smul := R_module.add_smul R n, mul_smul := R_module.mul_smul R n, one_smul := R_module.one_smul R n, } namespace map_matrix definition matrix_to_map {R : Type} [ring R] {a b : nat} (M : matrix R a b) : (finite_free_module R a) → (finite_free_module R b) := λ v ,(λ i,finset.sum finset.univ (λ K, (v K) *M K i ) ) instance hg {R : Type} [ring R] {a b : nat} (M : matrix R a b) : is_add_group_hom (matrix_to_map M) := ⟨begin intros, funext, unfold matrix_to_map, show (finset.sum finset.univ (λ (K : fin a), (a_1 K + b_1 K) * M K i) =_), conv in ( (a_1 _ + b_1 _) * M _ i) begin rw [add_mul], end, rw finset.sum_add_distrib, refl, end⟩ theorem smul_ {R: Type} [ring R] {a b : nat} (M : matrix R a b): ∀ (c : R) (x : finite_free_module R a), matrix_to_map M (smul c x) = smul c (matrix_to_map M x):= begin intros, unfold matrix_to_map, funext, unfold smul, rw [finset.mul_sum], simp[mul_assoc], end def module_hom {R: Type} [ring R] {a b : nat} (M : matrix R a b) : @is_linear_map R _ _ _ _ _ (matrix_to_map M) := { add:= begin exact is_add_group_hom.add _, end, smul:= smul_ _, } def matrix_to_linear_map {R : Type} [ring R] {a b : nat} (M : matrix R a b) : (@linear_map R (finite_free_module R a) (finite_free_module R b) _ _ _) := ⟨matrix_to_map M, module_hom M⟩ def e (R : Type) [ring R] (a: nat) (i: fin a): finite_free_module R a:= λ j, if i =j then 1 else 0 definition linear_map_to_matrix {R : Type} [ring R] {a b : nat} (f: @linear_map R (finite_free_module R a) (finite_free_module R b) _ _ _) : matrix R a b := λ i j, f.1 (e R a i) j theorem finset.sum_single {α : Type*} [fintype α] {β : Type*} [add_comm_monoid β] (f : α → β) {i : α} (h : ∀ (j : α), i ≠ j → f j = 0) : f i = finset.sum finset.univ (λ (K : α), f K) := begin have H : finset.sum (finset.singleton i) (λ (K : α), f K) = finset.sum finset.univ (λ (K : α), f K), from finset.sum_subset (λ _ _, finset.mem_univ _) (λ _ _ H, h _ $ mt (λ h, finset.mem_singleton.2 h.symm) H), rw [← H, finset.sum_singleton] end theorem apply_function_to_sum {R : Type}[ring R] {n p : nat} (f: fin n → finite_free_module R p ) (i : fin p ): (finset.sum finset.univ (λ (K : fin n),f K)) i = finset.sum finset.univ (λ (K : fin n), f K i):= begin rw finset.sum_hom (λ (v: finite_free_module R p), v i ) _, intros, simp, refl, end theorem span {R : Type} {n : nat} [ring R] (v : finite_free_module R n): v = finset.sum finset.univ (λ K, smul (v K) (e R n K)):= begin funext, rw [apply_function_to_sum (λ i, smul (v i) (e R n i))], simp, unfold smul, have H1 : ∀ (j : fin n), x ≠ j → v j * (e R n j) x = 0, intros, unfold e, split_ifs, exact false.elim (a h.symm), simp, have H2: finset.sum finset.univ (λ (K : fin n), v K * e R n K x) = v x * e R n x x, have Htemp := finset.sum_single (λ (K:fin n), v K * e R n K x ) H1, rw ←Htemp, rw H2, unfold e, split_ifs, simp, simp, end theorem equiv_one {R : Type} [ring R] {a b : nat} (f : (@linear_map R (finite_free_module R a) (finite_free_module R b) _ _ _)) : matrix_to_map (linear_map_to_matrix f ) = f := begin funext, unfold linear_map_to_matrix, unfold matrix_to_map, conv begin to_rhs, rw [span v], end, rw [← finset.sum_hom f _], swap 3, exact is_linear_map.zero f.2, swap 2, exact f.2.add, rw[apply_function_to_sum (λ j,f (smul (v j) (e R a j)))], simp, show _ = finset.sum finset.univ (λ (K : fin a), f ((v K) • (e R a K)) i), congr, funext, rw[( linear_map.is_linear_map_coe).smul], refl, end theorem equiv_two {R : Type} [ring R] {p b : nat} (M : matrix R p b): linear_map_to_matrix ⟨ matrix_to_map M, module_hom M⟩ = M := begin funext, unfold linear_map_to_matrix, show (matrix_to_map M) (e R p i) j =_, unfold matrix_to_map, have H1: ∀ (K : fin p), i ≠ K → e R p i K * M K j = 0, intros, unfold e, split_ifs, exact false.elim (a h), simp, have H2: finset.sum finset.univ (λ (K : fin p), e R p i K * M K j) = e R p i i * M i j, have Htemp := finset.sum_single (λ (K : fin p), e R p i K * M K j) H1, rw ← Htemp, rw H2, unfold e, split_ifs, simp, simp, end def matrix_transpose {R : Type} [ring R] {a b : nat} (M : matrix R a b) : matrix R b a := λ I, λ J, M J I definition matrix_to_map_right {R : Type} [ring R] {a b : nat} (M : matrix R a b) : (finite_free_module R a) → (finite_free_module R b) := λ v, (λ I, finset.sum finset.univ (λ K, (matrix_transpose M) I K * (v K))) -- end def matrix_to_linear_map_equiv {R : Type} [ring R] {a b : nat} : equiv (matrix R a b) (@linear_map R (finite_free_module R a) (finite_free_module R b) _ _ _):= {to_fun := matrix_to_linear_map, inv_fun := linear_map_to_matrix, right_inv:= begin unfold function.right_inverse, unfold function.left_inverse, intros, apply subtype.eq, dsimp, exact equiv_one x, end, left_inv:= begin unfold function.left_inverse, intros, exact equiv_two x, end } instance {R : Type} [ring R] {a b : nat}: is_add_group_hom (@matrix_to_linear_map R _ a b):= { add:= begin intros, unfold matrix_to_linear_map, apply linear_map.ext, intro x, show _ = matrix_to_map a_1 x + matrix_to_map b_1 x, show matrix_to_map (a_1 + b_1) x = _, unfold matrix_to_map, funext, show _ = (finset.sum finset.univ (λ (K : fin a), x K * a_1 K i)) + ( finset.sum finset.univ (λ (K : fin a), x K * b_1 K i)), rw[← finset.sum_add_distrib], congr, funext, have H1: x K * (a_1 + b_1) K i = x K * (a_1 K i + b_1 K i), refl, rw[H1], rw[mul_add], end } theorem comp_is_linear_map {R : Type} [ring R] {a b c : nat} (f : (@linear_map R (finite_free_module R b) (finite_free_module R a) _ _ _)) (g : (@linear_map R (finite_free_module R c) (finite_free_module R b) _ _ _)): @is_linear_map R _ _ _ _ _ (f.1 ∘ g.1):= { add:= begin intros, simp, have H1: f.val (g.val (x) + g.val(y)) = f.val (g.val (x + y)), rw[g.2.add], rw[← H1], rw[f.2.add], end, smul:= begin intros, simp, have H1: f.val (g.val (c_1 • x)) = f.val(c_1 • g.val(x)), rw[g.2.smul], rw[H1], rw[f.2.smul], end } theorem comp_equal_product_one {R : Type} [ring R] {a b c : nat} (f : (@linear_map R (finite_free_module R b) (finite_free_module R a) _ _ _)) (g : (@linear_map R (finite_free_module R c) (finite_free_module R b) _ _ _)): (@linear_map_to_matrix R _ c a (⟨ f.1 ∘ g.1, comp_is_linear_map f g⟩)) = @matrix.mul _ _ b c a (@linear_map_to_matrix R _ c b g ) (@linear_map_to_matrix R _ b a f) := begin unfold linear_map_to_matrix, unfold matrix.mul, funext, simp, conv begin to_lhs, rw [span (g.1 (e R c i))], end, rw [is_linear_map.sum f.2], rw [apply_function_to_sum ], congr, funext, show f.1 ((g.1 (e R c i) K) • (e R b K)) j = _, rw [is_linear_map.smul f.2], refl, end theorem comp_equal_product_two {R : Type} [ring R] {a b c : nat} (M : matrix R b a) (N : matrix R c b): @matrix_to_linear_map _ _ _ _ (@matrix.mul _ _ b c a N M) = ⟨(@matrix_to_linear_map _ _ _ _ M).1 ∘ (@matrix_to_linear_map _ _ _ _ N).1, comp_is_linear_map (@matrix_to_linear_map _ _ _ _ M) (@matrix_to_linear_map _ _ _ _ N)⟩ := begin unfold matrix_to_linear_map, funext, apply subtype.eq, simp, unfold matrix_to_map, unfold matrix.mul, funext, simp, conv in (v _ * finset.sum _ _) begin rw [finset.mul_sum], end, simp only [ finset.sum_mul], conv begin to_lhs, rw [finset.sum_comm], end, congr, funext, congr, funext, rw [mul_assoc], end -- R-module structure on Hom(R^b, R^a) theorem left_inv {R : Type} [ring R] {a b : nat} : left_inverse (@linear_map_to_matrix R _ a b ) (matrix_to_linear_map) := begin unfold function.left_inverse, intros, exact equiv_two x, end theorem right_inv {R : Type} [ring R] {a b : nat} : right_inverse (@linear_map_to_matrix R _ a b ) (matrix_to_linear_map) := begin unfold function.right_inverse, unfold function.left_inverse, intros, apply subtype.eq, dsimp, exact equiv_one x, end instance keji {R : Type} [ring R] {a b : nat}: is_add_group_hom (@linear_map_to_matrix R _ a b):= begin exact is_add_group_hom_right_inv (injective_of_left_inverse left_inv ) right_inv, end def Hom {R : Type} [comm_ring R] {a b : nat} := {f: finite_free_module R a → finite_free_module R b // is_add_group_hom f} def module_Hom {R: Type} [ring R] {a b : nat} (M : matrix R a b) : @is_linear_map R _ _ _ _ _ (matrix_to_map M) := { add:= begin exact is_add_group_hom.add _, end, smul:= smul_ _, } -- definition matrix_to_map {R : Type} [ring R] {a b : nat} (M : matrix R a b) : -- (finite_free_module R a) → (finite_free_module R b) := λ v ,(λ i,finset.sum finset.univ (λ K, (v K) *M K i ) ) def vec_to_mat {R : Type} [ring R] {n : nat} (vc : vector R n) : matrix R n 1 := λ I, λ J, vector.nth vc I def mat_mul_vec {R : Type} [ring R] {n m : nat} (M : matrix R n m) (vc : vector R m) : matrix R n 1 := @matrix.mul _ _ m n 1 M (vec_to_mat vc) theorem mat_mat_vec_assoc {R : Type} [ring R] {a b c : nat} (M : matrix R a b) (N : matrix R b c) (vc : vector R c) : @matrix.mul _ _ b a 1 M (@mat_mul_vec _ _ b c N vc) = @mat_mul_vec _ _ a c (@matrix.mul _ _ b a c M N) vc := begin apply matrix.mul_assoc, end end map_matrix namespace vector_space variables {k : Type} {V : Type} variable [field k] variable (n : nat) -- a basis v1,v2,...,vn of a fdvs V/k is just an isomorphism k^n -> V. open map_matrix -- helper function to get basis def simp_fun (V : Type*) [vector_space k V] (n : ℕ) (lm : linear_map (finite_free_module k n) V) : (fin n → V) := λ I, lm (e k n I) def linear_map_to_vec (V : Type*) [vector_space k V] (n : ℕ) : (linear_map (finite_free_module k n) V) → vector V n := λ lm, vector.of_fn (simp_fun V n lm) def vec_to_map (V : Type*) [vector_space k V] (n : ℕ) (M : vector V n): (finite_free_module k n) → V := λ sp, finset.sum finset.univ (λ K : fin n, (sp K) • (vector.nth M K)) instance vc_to_map_add_group (V : Type*) [vector_space k V] (n : ℕ) (M : vector V n) : is_add_group_hom (@vec_to_map k _ _ _ n M) := ⟨ begin intros a b, unfold vec_to_map, show (finset.sum finset.univ (λ (K : fin n), (a K + b K) • vector.nth M K))=_, conv in ((a _ + b _) • _) begin rw [add_smul], end, rw [← finset.sum_add_distrib], end ⟩ theorem smul' (V : Type*) [vector_space k V] (n : ℕ) (M : vector V n) : ∀ (c : k) (x : finite_free_module k n), @vec_to_map k _ _ _ n M (smul c x) = c • (@vec_to_map k _ _ _ n M x):= begin intros c x, unfold vec_to_map, funext, unfold smul, conv begin to_rhs, rw [finset.smul_sum], end, congr, funext, rw [smul_smul], end def module_hom' (V : Type*) [vector_space k V] (n : ℕ) (M : vector V n) : @is_linear_map _ _ _ _ _ _ (@vec_to_map k _ _ _ n M) := { add:= begin exact is_add_group_hom.add _, end, smul:= @smul' _ _ _ _ _ _, } def vec_to_linear_map (V : Type*) [vector_space k V] (n : ℕ) (M : vector V n): (linear_map (finite_free_module k n) V) := ⟨ @vec_to_map k _ _ _ n M , @module_hom' _ _ _ _ n M⟩ lemma ext {α : Type*} {n : ℕ} : ∀ (v w : vector α n), (∀ m : fin n, vector.nth v m = vector.nth w m) → v = w := λ ⟨v, hv⟩ ⟨w, hw⟩ h, subtype.eq (list.ext_le (by simp [hv, hw]) (λ m hm hn, h ⟨m, hv ▸ hm⟩)) def left_inv_ (V : Type*) [vector_space k V] (n : ℕ) (M : vector V n): (@linear_map_to_vec k _ _ _ n) (@vec_to_linear_map k _ _ _ n M) = M := begin unfold vec_to_linear_map, unfold linear_map_to_vec, unfold vec_to_map, dsimp, unfold simp_fun, apply ext, assume m, rw vector.nth_of_fn, unfold_coes, dsimp, rw [← @finset.sum_single _ _ _ _ (λ (K : fin n), e k n m K • vector.nth M K) m ], simp, unfold e, split_ifs, exact one_smul, contradiction, intros, simp, unfold e, split_ifs, contradiction, exact zero_smul, end def right_inv_ (V : Type*) [vector_space k V] (n : ℕ) (lm : linear_map (finite_free_module k n) V) : @vec_to_linear_map k _ _ _ n (@linear_map_to_vec k _ _ _ n lm) = lm := begin unfold vec_to_linear_map, unfold linear_map_to_vec, unfold vec_to_map, apply subtype.eq, dsimp, funext, simp, unfold simp_fun, unfold_coes, conv begin to_rhs, rw[span sp], end, rw [is_linear_map.sum lm.2], congr, funext, rw[← is_linear_map.smul lm.2], refl, end def n_tuples_eq_linear_maps (V : Type*) [vector_space k V] (n : ℕ) : equiv (vector V n) (linear_map (finite_free_module k n) V) := { to_fun := vec_to_linear_map V n, inv_fun := linear_map_to_vec V n, left_inv := left_inv_ V n, right_inv := right_inv_ V n, } end vector_space
high
0.671773
99,977
```{r setup, include=FALSE} library(ggplot2) ``` Import, Plot, Summarize, and Save Data Using the Bureau of Labor Statistics data, choose a dataset that interest you. Load in the dataset from csv file. Removed rows with NA data. ```{r} coffee1 <- read.csv(file = "AvgCoffee.csv", header = TRUE) coffee <- na.omit(coffee1) ``` Summary of dataset ```{r} summary(coffee) ``` Generate summary statistics for 2 variables: Summary of the January column within the dataset ```{r} summary(coffee$Jan) ``` Summary of the February column within the dataset ```{r} summary(coffee$Feb) ``` Plot some of the features (e.g., histograms, box plots, density plots, etc.) of several variables Boxplot of January/Year ```{r} janbox <- ggplot(coffee, aes(Year, Jan)) janbox + geom_boxplot() + labs(x="Year", y= "Jan") ``` Density of February ```{r} jandensity <- ggplot(coffee, aes(Feb)) jandensity + geom_density() + labs(x="Feb", y = "Density") ``` Explore Some Bivariate Relations Use the same dataset within the same website to explore some bivariate relations Pearson correlation between all variables ```{r} cor(coffee, use = "complete.obs", method = "pearson") ``` Pearson correlation between January and February ```{r} cor(coffee$Jan, coffee$Feb, use = "complete.obs", method = "pearson") ``` Pearson correlation between March and April ```{r} cor(coffee$Mar, coffee$Apr, use = "complete.obs", method = "pearson") ``` Scatterplot of January and February data ```{r} coffeescatter <- ggplot(coffee, aes(Jan, Feb)) coffeescatter + geom_point() + geom_smooth(method = "lm", colour = "Blue") +labs(x="January", y= "February") ``` Scatterplot of March and April data ```{r} coffeescatter <- ggplot(coffee, aes(Mar, Apr)) coffeescatter + geom_point() + geom_smooth(method = "lm", colour = "Red") +labs(x="March", y= "April") ``` Line Chart for January ```{r} ggplot(coffee, aes(x = Year, y = Jan)) + geom_line() ``` Line Chart for December ```{r} ggplot(coffee, aes(x = Year, y = Dec)) + geom_line() ``` Organize a Data Report Summary of dataset ```{r} summary(coffee) ``` Description of dataset Average Prie of Coffee per lb, 100% ground roast ```{r} str(coffee) ```
low
0.163293
99,978
/* libFLAC++ - Free Lossless Audio Codec library * Copyright (C) 2002-2009 Josh Coalson * Copyright (C) 2011-2016 Xiph.Org Foundation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * - Neither the name of the Xiph.org Foundation nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FLACPP__METADATA_H #define FLACPP__METADATA_H #include "export.h" #include "FLAC/metadata.h" // =============================================================== // // Full documentation for the metadata interface can be found // in the C layer in include/FLAC/metadata.h // // =============================================================== /** \file include/FLAC++/metadata.h * * \brief * This module provides classes for creating and manipulating FLAC * metadata blocks in memory, and three progressively more powerful * interfaces for traversing and editing metadata in FLAC files. * * See the detailed documentation for each interface in the * \link flacpp_metadata metadata \endlink module. */ /** \defgroup flacpp_metadata FLAC++/metadata.h: metadata interfaces * \ingroup flacpp * * \brief * This module provides classes for creating and manipulating FLAC * metadata blocks in memory, and three progressively more powerful * interfaces for traversing and editing metadata in FLAC files. * * The behavior closely mimics the C layer interface; be sure to read * the detailed description of the * \link flac_metadata C metadata module \endlink. Note that like the * C layer, currently only the Chain interface (level 2) supports Ogg * FLAC files, and it is read-only i.e. no writing back changed * metadata to file. */ namespace FLAC { namespace Metadata { // ============================================================ // // Metadata objects // // ============================================================ /** \defgroup flacpp_metadata_object FLAC++/metadata.h: metadata object classes * \ingroup flacpp_metadata * * This module contains classes representing FLAC metadata * blocks in memory. * * The behavior closely mimics the C layer interface; be * sure to read the detailed description of the * \link flac_metadata_object C metadata object module \endlink. * * Any time a metadata object is constructed or assigned, you * should check is_valid() to make sure the underlying * ::FLAC__StreamMetadata object was able to be created. * * \warning * When the get_*() methods of any metadata object method * return you a const pointer, DO NOT disobey and write into it. * Always use the set_*() methods. * * \{ */ /** Base class for all metadata block types. * See the \link flacpp_metadata_object overview \endlink for more. */ class FLACPP_API Prototype { protected: //@{ /** Constructs a copy of the given object. This form * always performs a deep copy. */ Prototype(const Prototype &); Prototype(const ::FLAC__StreamMetadata &); Prototype(const ::FLAC__StreamMetadata *); //@} /** Constructs an object with copy control. When \a copy * is \c true, behaves identically to * FLAC::Metadata::Prototype::Prototype(const ::FLAC__StreamMetadata *object). * When \a copy is \c false, the instance takes ownership of * the pointer and the ::FLAC__StreamMetadata object will * be freed by the destructor. * * \assert * \code object != NULL \endcode */ Prototype(::FLAC__StreamMetadata *object, bool copy); //@{ /** Assign from another object. Always performs a deep copy. */ Prototype &operator=(const Prototype &); Prototype &operator=(const ::FLAC__StreamMetadata &); Prototype &operator=(const ::FLAC__StreamMetadata *); //@} /** Assigns an object with copy control. See * Prototype(::FLAC__StreamMetadata *object, bool copy). */ Prototype &assign_object(::FLAC__StreamMetadata *object, bool copy); /** Deletes the underlying ::FLAC__StreamMetadata object. */ virtual void clear(); ::FLAC__StreamMetadata *object_; public: /** Deletes the underlying ::FLAC__StreamMetadata object. */ virtual ~Prototype(); //@{ /** Check for equality, performing a deep compare by following pointers. */ inline bool operator==(const Prototype &) const; inline bool operator==(const ::FLAC__StreamMetadata &) const; inline bool operator==(const ::FLAC__StreamMetadata *) const; //@} //@{ /** Check for inequality, performing a deep compare by following pointers. */ inline bool operator!=(const Prototype &) const; inline bool operator!=(const ::FLAC__StreamMetadata &) const; inline bool operator!=(const ::FLAC__StreamMetadata *) const; //@} friend class SimpleIterator; friend class Iterator; /** Returns \c true if the object was correctly constructed * (i.e. the underlying ::FLAC__StreamMetadata object was * properly allocated), else \c false. */ inline bool is_valid() const; /** Returns \c true if this block is the last block in a * stream, else \c false. * * \assert * \code is_valid() \endcode */ bool get_is_last() const; /** Returns the type of the block. * * \assert * \code is_valid() \endcode */ ::FLAC__MetadataType get_type() const; /** Returns the stream length of the metadata block. * * \note * The length does not include the metadata block header, * per spec. * * \assert * \code is_valid() \endcode */ unsigned get_length() const; /** Sets the "is_last" flag for the block. When using the iterators * it is not necessary to set this flag; they will do it for you. * * \assert * \code is_valid() \endcode */ void set_is_last(bool); /** Returns a pointer to the underlying ::FLAC__StreamMetadata * object. This can be useful for plugging any holes between * the C++ and C interfaces. * * \assert * \code is_valid() \endcode */ inline operator const ::FLAC__StreamMetadata *() const; private: /** Private and undefined so you can't use it. */ Prototype(); // These are used only by Iterator bool is_reference_; inline void set_reference(bool x) { is_reference_ = x; } }; #ifdef _MSC_VER // warning C4800: 'int' : forcing to bool 'true' or 'false' (performance warning) #pragma warning ( disable : 4800 ) #endif inline bool Prototype::operator==(const Prototype &object) const { return (bool)::FLAC__metadata_object_is_equal(object_, object.object_); } inline bool Prototype::operator==(const ::FLAC__StreamMetadata &object) const { return (bool)::FLAC__metadata_object_is_equal(object_, &object); } inline bool Prototype::operator==(const ::FLAC__StreamMetadata *object) const { return (bool)::FLAC__metadata_object_is_equal(object_, object); } #ifdef _MSC_VER #pragma warning ( default : 4800 ) #endif inline bool Prototype::operator!=(const Prototype &object) const { return !operator==(object); } inline bool Prototype::operator!=(const ::FLAC__StreamMetadata &object) const { return !operator==(object); } inline bool Prototype::operator!=(const ::FLAC__StreamMetadata *object) const { return !operator==(object); } inline bool Prototype::is_valid() const { return 0 != object_; } inline Prototype::operator const ::FLAC__StreamMetadata *() const { return object_; } /** Create a deep copy of an object and return it. */ FLACPP_API Prototype *clone(const Prototype *); /** STREAMINFO metadata block. * See the \link flacpp_metadata_object overview \endlink for more, * and the <A HREF="../format.html#metadata_block_streaminfo">format specification</A>. */ class FLACPP_API StreamInfo : public Prototype { public: StreamInfo(); //@{ /** Constructs a copy of the given object. This form * always performs a deep copy. */ inline StreamInfo(const StreamInfo &object): Prototype(object) { } inline StreamInfo(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline StreamInfo(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See * Prototype(::FLAC__StreamMetadata *object, bool copy). */ inline StreamInfo(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~StreamInfo(); //@{ /** Assign from another object. Always performs a deep copy. */ inline StreamInfo &operator=(const StreamInfo &object) { Prototype::operator=(object); return *this; } inline StreamInfo &operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); return *this; } inline StreamInfo &operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); return *this; } //@} /** Assigns an object with copy control. See * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). */ inline StreamInfo &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ /** Check for equality, performing a deep compare by following pointers. */ inline bool operator==(const StreamInfo &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); } //@} //@{ /** Check for inequality, performing a deep compare by following pointers. */ inline bool operator!=(const StreamInfo &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); } //@} //@{ /** See <A HREF="../format.html#metadata_block_streaminfo">format specification</A>. */ unsigned get_min_blocksize() const; unsigned get_max_blocksize() const; unsigned get_min_framesize() const; unsigned get_max_framesize() const; unsigned get_sample_rate() const; unsigned get_channels() const; unsigned get_bits_per_sample() const; FLAC__uint64 get_total_samples() const; const FLAC__byte *get_md5sum() const; void set_min_blocksize(unsigned value); void set_max_blocksize(unsigned value); void set_min_framesize(unsigned value); void set_max_framesize(unsigned value); void set_sample_rate(unsigned value); void set_channels(unsigned value); void set_bits_per_sample(unsigned value); void set_total_samples(FLAC__uint64 value); void set_md5sum(const FLAC__byte value[16]); //@} }; /** PADDING metadata block. * See the \link flacpp_metadata_object overview \endlink for more, * and the <A HREF="../format.html#metadata_block_padding">format specification</A>. */ class FLACPP_API Padding : public Prototype { public: Padding(); //@{ /** Constructs a copy of the given object. This form * always performs a deep copy. */ inline Padding(const Padding &object): Prototype(object) { } inline Padding(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline Padding(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See * Prototype(::FLAC__StreamMetadata *object, bool copy). */ inline Padding(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } /** Constructs an object with the given length. */ Padding(unsigned length); ~Padding(); //@{ /** Assign from another object. Always performs a deep copy. */ inline Padding &operator=(const Padding &object) { Prototype::operator=(object); return *this; } inline Padding &operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); return *this; } inline Padding &operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); return *this; } //@} /** Assigns an object with copy control. See * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). */ inline Padding &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ /** Check for equality, performing a deep compare by following pointers. */ inline bool operator==(const Padding &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); } //@} //@{ /** Check for inequality, performing a deep compare by following pointers. */ inline bool operator!=(const Padding &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); } //@} /** Sets the length in bytes of the padding block. */ void set_length(unsigned length); }; /** APPLICATION metadata block. * See the \link flacpp_metadata_object overview \endlink for more, * and the <A HREF="../format.html#metadata_block_application">format specification</A>. */ class FLACPP_API Application : public Prototype { public: Application(); // //@{ /** Constructs a copy of the given object. This form * always performs a deep copy. */ inline Application(const Application &object): Prototype(object) { } inline Application(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline Application(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See * Prototype(::FLAC__StreamMetadata *object, bool copy). */ inline Application(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~Application(); //@{ /** Assign from another object. Always performs a deep copy. */ inline Application &operator=(const Application &object) { Prototype::operator=(object); return *this; } inline Application &operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); return *this; } inline Application &operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); return *this; } //@} /** Assigns an object with copy control. See * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). */ inline Application &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ /** Check for equality, performing a deep compare by following pointers. */ inline bool operator==(const Application &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); } //@} //@{ /** Check for inequality, performing a deep compare by following pointers. */ inline bool operator!=(const Application &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); } //@} const FLAC__byte *get_id() const; const FLAC__byte *get_data() const; void set_id(const FLAC__byte value[4]); //! This form always copies \a data bool set_data(const FLAC__byte *data, unsigned length); bool set_data(FLAC__byte *data, unsigned length, bool copy); }; /** SEEKTABLE metadata block. * See the \link flacpp_metadata_object overview \endlink for more, * and the <A HREF="../format.html#metadata_block_seektable">format specification</A>. */ class FLACPP_API SeekTable : public Prototype { public: SeekTable(); //@{ /** Constructs a copy of the given object. This form * always performs a deep copy. */ inline SeekTable(const SeekTable &object): Prototype(object) { } inline SeekTable(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline SeekTable(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See * Prototype(::FLAC__StreamMetadata *object, bool copy). */ inline SeekTable(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~SeekTable(); //@{ /** Assign from another object. Always performs a deep copy. */ inline SeekTable &operator=(const SeekTable &object) { Prototype::operator=(object); return *this; } inline SeekTable &operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); return *this; } inline SeekTable &operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); return *this; } //@} /** Assigns an object with copy control. See * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). */ inline SeekTable &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ /** Check for equality, performing a deep compare by following pointers. */ inline bool operator==(const SeekTable &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); } //@} //@{ /** Check for inequality, performing a deep compare by following pointers. */ inline bool operator!=(const SeekTable &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); } //@} unsigned get_num_points() const; ::FLAC__StreamMetadata_SeekPoint get_point(unsigned index) const; //! See FLAC__metadata_object_seektable_resize_points() bool resize_points(unsigned new_num_points); //! See FLAC__metadata_object_seektable_set_point() void set_point(unsigned index, const ::FLAC__StreamMetadata_SeekPoint &point); //! See FLAC__metadata_object_seektable_insert_point() bool insert_point(unsigned index, const ::FLAC__StreamMetadata_SeekPoint &point); //! See FLAC__metadata_object_seektable_delete_point() bool delete_point(unsigned index); //! See FLAC__metadata_object_seektable_is_legal() bool is_legal() const; //! See FLAC__metadata_object_seektable_template_append_placeholders() bool template_append_placeholders(unsigned num); //! See FLAC__metadata_object_seektable_template_append_point() bool template_append_point(FLAC__uint64 sample_number); //! See FLAC__metadata_object_seektable_template_append_points() bool template_append_points(FLAC__uint64 sample_numbers[], unsigned num); //! See FLAC__metadata_object_seektable_template_append_spaced_points() bool template_append_spaced_points(unsigned num, FLAC__uint64 total_samples); //! See FLAC__metadata_object_seektable_template_append_spaced_points_by_samples() bool template_append_spaced_points_by_samples(unsigned samples, FLAC__uint64 total_samples); //! See FLAC__metadata_object_seektable_template_sort() bool template_sort(bool compact); }; /** VORBIS_COMMENT metadata block. * See the \link flacpp_metadata_object overview \endlink for more, * and the <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>. */ class FLACPP_API VorbisComment : public Prototype { public: /** Convenience class for encapsulating Vorbis comment * entries. An entry is a vendor string or a comment * field. In the case of a vendor string, the field * name is undefined; only the field value is relevant. * * A \a field as used in the methods refers to an * entire 'NAME=VALUE' string; for convenience the * string is NUL-terminated. A length field is * required in the unlikely event that the value * contains contain embedded NULs. * * A \a field_name is what is on the left side of the * first '=' in the \a field. By definition it is ASCII * and so is NUL-terminated and does not require a * length to describe it. \a field_name is undefined * for a vendor string entry. * * A \a field_value is what is on the right side of the * first '=' in the \a field. By definition, this may * contain embedded NULs and so a \a field_value_length * is required to describe it. However in practice, * embedded NULs are not known to be used, so it is * generally safe to treat field values as NUL- * terminated UTF-8 strings. * * Always check is_valid() after the constructor or operator= * to make sure memory was properly allocated and that the * Entry conforms to the Vorbis comment specification. */ class FLACPP_API Entry { public: Entry(); Entry(const char *field, unsigned field_length); Entry(const char *field); // assumes \a field is NUL-terminated Entry(const char *field_name, const char *field_value, unsigned field_value_length); Entry(const char *field_name, const char *field_value); // assumes \a field_value is NUL-terminated Entry(const Entry &entry); Entry &operator=(const Entry &entry); virtual ~Entry(); virtual bool is_valid() const; ///< Returns \c true iff object was properly constructed. unsigned get_field_length() const; unsigned get_field_name_length() const; unsigned get_field_value_length() const; ::FLAC__StreamMetadata_VorbisComment_Entry get_entry() const; const char *get_field() const; const char *get_field_name() const; const char *get_field_value() const; bool set_field(const char *field, unsigned field_length); bool set_field(const char *field); // assumes \a field is NUL-terminated bool set_field_name(const char *field_name); bool set_field_value(const char *field_value, unsigned field_value_length); bool set_field_value(const char *field_value); // assumes \a field_value is NUL-terminated protected: bool is_valid_; ::FLAC__StreamMetadata_VorbisComment_Entry entry_; char *field_name_; unsigned field_name_length_; char *field_value_; unsigned field_value_length_; private: void zero(); void clear(); void clear_entry(); void clear_field_name(); void clear_field_value(); void construct(const char *field, unsigned field_length); void construct(const char *field); // assumes \a field is NUL-terminated void construct(const char *field_name, const char *field_value, unsigned field_value_length); void construct(const char *field_name, const char *field_value); // assumes \a field_value is NUL-terminated void compose_field(); void parse_field(); }; VorbisComment(); //@{ /** Constructs a copy of the given object. This form * always performs a deep copy. */ inline VorbisComment(const VorbisComment &object): Prototype(object) { } inline VorbisComment(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline VorbisComment(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See * Prototype(::FLAC__StreamMetadata *object, bool copy). */ inline VorbisComment(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~VorbisComment(); //@{ /** Assign from another object. Always performs a deep copy. */ inline VorbisComment &operator=(const VorbisComment &object) { Prototype::operator=(object); return *this; } inline VorbisComment &operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); return *this; } inline VorbisComment &operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); return *this; } //@} /** Assigns an object with copy control. See * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). */ inline VorbisComment &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ /** Check for equality, performing a deep compare by following pointers. */ inline bool operator==(const VorbisComment &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); } //@} //@{ /** Check for inequality, performing a deep compare by following pointers. */ inline bool operator!=(const VorbisComment &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); } //@} unsigned get_num_comments() const; const FLAC__byte *get_vendor_string() const; // NUL-terminated UTF-8 string Entry get_comment(unsigned index) const; //! See FLAC__metadata_object_vorbiscomment_set_vendor_string() bool set_vendor_string(const FLAC__byte *string); // NUL-terminated UTF-8 string //! See FLAC__metadata_object_vorbiscomment_resize_comments() bool resize_comments(unsigned new_num_comments); //! See FLAC__metadata_object_vorbiscomment_set_comment() bool set_comment(unsigned index, const Entry &entry); //! See FLAC__metadata_object_vorbiscomment_insert_comment() bool insert_comment(unsigned index, const Entry &entry); //! See FLAC__metadata_object_vorbiscomment_append_comment() bool append_comment(const Entry &entry); //! See FLAC__metadata_object_vorbiscomment_replace_comment() bool replace_comment(const Entry &entry, bool all); //! See FLAC__metadata_object_vorbiscomment_delete_comment() bool delete_comment(unsigned index); //! See FLAC__metadata_object_vorbiscomment_find_entry_from() int find_entry_from(unsigned offset, const char *field_name); //! See FLAC__metadata_object_vorbiscomment_remove_entry_matching() int remove_entry_matching(const char *field_name); //! See FLAC__metadata_object_vorbiscomment_remove_entries_matching() int remove_entries_matching(const char *field_name); }; /** CUESHEET metadata block. * See the \link flacpp_metadata_object overview \endlink for more, * and the <A HREF="../format.html#metadata_block_cuesheet">format specification</A>. */ class FLACPP_API CueSheet : public Prototype { public: /** Convenience class for encapsulating a cue sheet * track. * * Always check is_valid() after the constructor or operator= * to make sure memory was properly allocated. */ class FLACPP_API Track { protected: ::FLAC__StreamMetadata_CueSheet_Track *object_; public: Track(); Track(const ::FLAC__StreamMetadata_CueSheet_Track *track); Track(const Track &track); Track &operator=(const Track &track); virtual ~Track(); virtual bool is_valid() const; ///< Returns \c true iff object was properly constructed. inline FLAC__uint64 get_offset() const { return object_->offset; } inline FLAC__byte get_number() const { return object_->number; } inline const char *get_isrc() const { return object_->isrc; } inline unsigned get_type() const { return object_->type; } inline bool get_pre_emphasis() const { return object_->pre_emphasis; } inline FLAC__byte get_num_indices() const { return object_->num_indices; } ::FLAC__StreamMetadata_CueSheet_Index get_index(unsigned i) const; inline const ::FLAC__StreamMetadata_CueSheet_Track *get_track() const { return object_; } inline void set_offset(FLAC__uint64 value) { object_->offset = value; } inline void set_number(FLAC__byte value) { object_->number = value; } void set_isrc(const char value[12]); void set_type(unsigned value); inline void set_pre_emphasis(bool value) { object_->pre_emphasis = value? 1 : 0; } void set_index(unsigned i, const ::FLAC__StreamMetadata_CueSheet_Index &index); //@@@ It's awkward but to insert/delete index points //@@@ you must use the routines in the CueSheet class. }; CueSheet(); //@{ /** Constructs a copy of the given object. This form * always performs a deep copy. */ inline CueSheet(const CueSheet &object): Prototype(object) { } inline CueSheet(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline CueSheet(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See * Prototype(::FLAC__StreamMetadata *object, bool copy). */ inline CueSheet(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~CueSheet(); //@{ /** Assign from another object. Always performs a deep copy. */ inline CueSheet &operator=(const CueSheet &object) { Prototype::operator=(object); return *this; } inline CueSheet &operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); return *this; } inline CueSheet &operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); return *this; } //@} /** Assigns an object with copy control. See * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). */ inline CueSheet &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ /** Check for equality, performing a deep compare by following pointers. */ inline bool operator==(const CueSheet &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); } //@} //@{ /** Check for inequality, performing a deep compare by following pointers. */ inline bool operator!=(const CueSheet &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); } //@} const char *get_media_catalog_number() const; FLAC__uint64 get_lead_in() const; bool get_is_cd() const; unsigned get_num_tracks() const; Track get_track(unsigned i) const; void set_media_catalog_number(const char value[128]); void set_lead_in(FLAC__uint64 value); void set_is_cd(bool value); void set_index(unsigned track_num, unsigned index_num, const ::FLAC__StreamMetadata_CueSheet_Index &index); //! See FLAC__metadata_object_cuesheet_track_resize_indices() bool resize_indices(unsigned track_num, unsigned new_num_indices); //! See FLAC__metadata_object_cuesheet_track_insert_index() bool insert_index(unsigned track_num, unsigned index_num, const ::FLAC__StreamMetadata_CueSheet_Index &index); //! See FLAC__metadata_object_cuesheet_track_insert_blank_index() bool insert_blank_index(unsigned track_num, unsigned index_num); //! See FLAC__metadata_object_cuesheet_track_delete_index() bool delete_index(unsigned track_num, unsigned index_num); //! See FLAC__metadata_object_cuesheet_resize_tracks() bool resize_tracks(unsigned new_num_tracks); //! See FLAC__metadata_object_cuesheet_set_track() bool set_track(unsigned i, const Track &track); //! See FLAC__metadata_object_cuesheet_insert_track() bool insert_track(unsigned i, const Track &track); //! See FLAC__metadata_object_cuesheet_insert_blank_track() bool insert_blank_track(unsigned i); //! See FLAC__metadata_object_cuesheet_delete_track() bool delete_track(unsigned i); //! See FLAC__metadata_object_cuesheet_is_legal() bool is_legal(bool check_cd_da_subset = false, const char **violation = 0) const; //! See FLAC__metadata_object_cuesheet_calculate_cddb_id() FLAC__uint32 calculate_cddb_id() const; }; /** PICTURE metadata block. * See the \link flacpp_metadata_object overview \endlink for more, * and the <A HREF="../format.html#metadata_block_picture">format specification</A>. */ class FLACPP_API Picture : public Prototype { public: Picture(); //@{ /** Constructs a copy of the given object. This form * always performs a deep copy. */ inline Picture(const Picture &object): Prototype(object) { } inline Picture(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline Picture(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See * Prototype(::FLAC__StreamMetadata *object, bool copy). */ inline Picture(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~Picture(); //@{ /** Assign from another object. Always performs a deep copy. */ inline Picture &operator=(const Picture &object) { Prototype::operator=(object); return *this; } inline Picture &operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); return *this; } inline Picture &operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); return *this; } //@} /** Assigns an object with copy control. See * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). */ inline Picture &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ /** Check for equality, performing a deep compare by following pointers. */ inline bool operator==(const Picture &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); } //@} //@{ /** Check for inequality, performing a deep compare by following pointers. */ inline bool operator!=(const Picture &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); } //@} ::FLAC__StreamMetadata_Picture_Type get_type() const; const char *get_mime_type() const; // NUL-terminated printable ASCII string const FLAC__byte *get_description() const; // NUL-terminated UTF-8 string FLAC__uint32 get_width() const; FLAC__uint32 get_height() const; FLAC__uint32 get_depth() const; FLAC__uint32 get_colors() const; ///< a return value of \c 0 means true-color, i.e. 2^depth colors FLAC__uint32 get_data_length() const; const FLAC__byte *get_data() const; void set_type(::FLAC__StreamMetadata_Picture_Type type); //! See FLAC__metadata_object_picture_set_mime_type() bool set_mime_type(const char *string); // NUL-terminated printable ASCII string //! See FLAC__metadata_object_picture_set_description() bool set_description(const FLAC__byte *string); // NUL-terminated UTF-8 string void set_width(FLAC__uint32 value) const; void set_height(FLAC__uint32 value) const; void set_depth(FLAC__uint32 value) const; void set_colors(FLAC__uint32 value) const; ///< a value of \c 0 means true-color, i.e. 2^depth colors //! See FLAC__metadata_object_picture_set_data() bool set_data(const FLAC__byte *data, FLAC__uint32 data_length); //! See FLAC__metadata_object_picture_is_legal() bool is_legal(const char **violation); }; /** Opaque metadata block for storing unknown types. * This should not be used unless you know what you are doing; * it is currently used only internally to support forward * compatibility of metadata blocks. * See the \link flacpp_metadata_object overview \endlink for more, */ class FLACPP_API Unknown : public Prototype { public: Unknown(); // //@{ /** Constructs a copy of the given object. This form * always performs a deep copy. */ inline Unknown(const Unknown &object): Prototype(object) { } inline Unknown(const ::FLAC__StreamMetadata &object): Prototype(object) { } inline Unknown(const ::FLAC__StreamMetadata *object): Prototype(object) { } //@} /** Constructs an object with copy control. See * Prototype(::FLAC__StreamMetadata *object, bool copy). */ inline Unknown(::FLAC__StreamMetadata *object, bool copy): Prototype(object, copy) { } ~Unknown(); //@{ /** Assign from another object. Always performs a deep copy. */ inline Unknown &operator=(const Unknown &object) { Prototype::operator=(object); return *this; } inline Unknown &operator=(const ::FLAC__StreamMetadata &object) { Prototype::operator=(object); return *this; } inline Unknown &operator=(const ::FLAC__StreamMetadata *object) { Prototype::operator=(object); return *this; } //@} /** Assigns an object with copy control. See * Prototype::assign_object(::FLAC__StreamMetadata *object, bool copy). */ inline Unknown &assign(::FLAC__StreamMetadata *object, bool copy) { Prototype::assign_object(object, copy); return *this; } //@{ /** Check for equality, performing a deep compare by following pointers. */ inline bool operator==(const Unknown &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata &object) const { return Prototype::operator==(object); } inline bool operator==(const ::FLAC__StreamMetadata *object) const { return Prototype::operator==(object); } //@} //@{ /** Check for inequality, performing a deep compare by following pointers. */ inline bool operator!=(const Unknown &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata &object) const { return Prototype::operator!=(object); } inline bool operator!=(const ::FLAC__StreamMetadata *object) const { return Prototype::operator!=(object); } //@} const FLAC__byte *get_data() const; //! This form always copies \a data bool set_data(const FLAC__byte *data, unsigned length); bool set_data(FLAC__byte *data, unsigned length, bool copy); }; /* \} */ /** \defgroup flacpp_metadata_level0 FLAC++/metadata.h: metadata level 0 interface * \ingroup flacpp_metadata * * \brief * Level 0 metadata iterators. * * See the \link flac_metadata_level0 C layer equivalent \endlink * for more. * * \{ */ FLACPP_API bool get_streaminfo(const char *filename, StreamInfo &streaminfo); ///< See FLAC__metadata_get_streaminfo(). FLACPP_API bool get_tags(const char *filename, VorbisComment *&tags); ///< See FLAC__metadata_get_tags(). FLACPP_API bool get_tags(const char *filename, VorbisComment &tags); ///< See FLAC__metadata_get_tags(). FLACPP_API bool get_cuesheet(const char *filename, CueSheet *&cuesheet); ///< See FLAC__metadata_get_cuesheet(). FLACPP_API bool get_cuesheet(const char *filename, CueSheet &cuesheet); ///< See FLAC__metadata_get_cuesheet(). FLACPP_API bool get_picture(const char *filename, Picture *&picture, ::FLAC__StreamMetadata_Picture_Type type, const char *mime_type, const FLAC__byte *description, unsigned max_width, unsigned max_height, unsigned max_depth, unsigned max_colors); ///< See FLAC__metadata_get_picture(). FLACPP_API bool get_picture(const char *filename, Picture &picture, ::FLAC__StreamMetadata_Picture_Type type, const char *mime_type, const FLAC__byte *description, unsigned max_width, unsigned max_height, unsigned max_depth, unsigned max_colors); ///< See FLAC__metadata_get_picture(). /* \} */ /** \defgroup flacpp_metadata_level1 FLAC++/metadata.h: metadata level 1 interface * \ingroup flacpp_metadata * * \brief * Level 1 metadata iterator. * * The flow through the iterator in the C++ layer is similar * to the C layer: * - Create a SimpleIterator instance * - Check SimpleIterator::is_valid() * - Call SimpleIterator::init() and check the return * - Traverse and/or edit. Edits are written to file * immediately. * - Destroy the SimpleIterator instance * * The ownership of pointers in the C++ layer follows that in * the C layer, i.e. * - The objects returned by get_block() are yours to * modify, but changes are not reflected in the FLAC file * until you call set_block(). The objects are also * yours to delete; they are not automatically deleted * when passed to set_block() or insert_block_after(). * * See the \link flac_metadata_level1 C layer equivalent \endlink * for more. * * \{ */ /** This class is a wrapper around the FLAC__metadata_simple_iterator * structures and methods; see the * \link flacpp_metadata_level1 usage guide \endlink and * ::FLAC__Metadata_SimpleIterator. */ class FLACPP_API SimpleIterator { public: /** This class is a wrapper around FLAC__Metadata_SimpleIteratorStatus. */ class FLACPP_API Status { public: inline Status(::FLAC__Metadata_SimpleIteratorStatus status): status_(status) { } inline operator ::FLAC__Metadata_SimpleIteratorStatus() const { return status_; } inline const char *as_cstring() const { return ::FLAC__Metadata_SimpleIteratorStatusString[status_]; } protected: ::FLAC__Metadata_SimpleIteratorStatus status_; }; SimpleIterator(); virtual ~SimpleIterator(); bool is_valid() const; ///< Returns \c true iff object was properly constructed. bool init(const char *filename, bool read_only, bool preserve_file_stats); ///< See FLAC__metadata_simple_iterator_init(). Status status(); ///< See FLAC__metadata_simple_iterator_status(). bool is_writable() const; ///< See FLAC__metadata_simple_iterator_is_writable(). bool next(); ///< See FLAC__metadata_simple_iterator_next(). bool prev(); ///< See FLAC__metadata_simple_iterator_prev(). bool is_last() const; ///< See FLAC__metadata_simple_iterator_is_last(). off_t get_block_offset() const; ///< See FLAC__metadata_simple_iterator_get_block_offset(). ::FLAC__MetadataType get_block_type() const; ///< See FLAC__metadata_simple_iterator_get_block_type(). unsigned get_block_length() const; ///< See FLAC__metadata_simple_iterator_get_block_length(). bool get_application_id(FLAC__byte *id); ///< See FLAC__metadata_simple_iterator_get_application_id(). Prototype *get_block(); ///< See FLAC__metadata_simple_iterator_get_block(). bool set_block(Prototype *block, bool use_padding = true); ///< See FLAC__metadata_simple_iterator_set_block(). bool insert_block_after(Prototype *block, bool use_padding = true); ///< See FLAC__metadata_simple_iterator_insert_block_after(). bool delete_block(bool use_padding = true); ///< See FLAC__metadata_simple_iterator_delete_block(). protected: ::FLAC__Metadata_SimpleIterator *iterator_; void clear(); private: // Do not use. SimpleIterator(const SimpleIterator&); SimpleIterator&operator=(const SimpleIterator&); }; /* \} */ /** \defgroup flacpp_metadata_level2 FLAC++/metadata.h: metadata level 2 interface * \ingroup flacpp_metadata * * \brief * Level 2 metadata iterator. * * The flow through the iterator in the C++ layer is similar * to the C layer: * - Create a Chain instance * - Check Chain::is_valid() * - Call Chain::read() and check the return * - Traverse and/or edit with an Iterator or with * Chain::merge_padding() or Chain::sort_padding() * - Write changes back to FLAC file with Chain::write() * - Destroy the Chain instance * * The ownership of pointers in the C++ layer is slightly * different than in the C layer, i.e. * - The objects returned by Iterator::get_block() are NOT * owned by the iterator and should be deleted by the * caller when finished, BUT, when you modify the block, * it will directly edit what's in the chain and you do * not need to call Iterator::set_block(). However the * changes will not be reflected in the FLAC file until * the chain is written with Chain::write(). * - When you pass an object to Iterator::set_block(), * Iterator::insert_block_before(), or * Iterator::insert_block_after(), the iterator takes * ownership of the block and it will be deleted by the * chain. * * See the \link flac_metadata_level2 C layer equivalent \endlink * for more. * * \{ */ /** This class is a wrapper around the FLAC__metadata_chain * structures and methods; see the * \link flacpp_metadata_level2 usage guide \endlink and * ::FLAC__Metadata_Chain. */ class FLACPP_API Chain { public: /** This class is a wrapper around FLAC__Metadata_ChainStatus. */ class FLACPP_API Status { public: inline Status(::FLAC__Metadata_ChainStatus status): status_(status) { } inline operator ::FLAC__Metadata_ChainStatus() const { return status_; } inline const char *as_cstring() const { return ::FLAC__Metadata_ChainStatusString[status_]; } protected: ::FLAC__Metadata_ChainStatus status_; }; Chain(); virtual ~Chain(); friend class Iterator; bool is_valid() const; ///< Returns \c true iff object was properly constructed. Status status(); ///< See FLAC__metadata_chain_status(). bool read(const char *filename, bool is_ogg = false); ///< See FLAC__metadata_chain_read(), FLAC__metadata_chain_read_ogg(). bool read(FLAC__IOHandle handle, FLAC__IOCallbacks callbacks, bool is_ogg = false); ///< See FLAC__metadata_chain_read_with_callbacks(), FLAC__metadata_chain_read_ogg_with_callbacks(). bool check_if_tempfile_needed(bool use_padding); ///< See FLAC__metadata_chain_check_if_tempfile_needed(). bool write(bool use_padding = true, bool preserve_file_stats = false); ///< See FLAC__metadata_chain_write(). bool write(bool use_padding, ::FLAC__IOHandle handle, ::FLAC__IOCallbacks callbacks); ///< See FLAC__metadata_chain_write_with_callbacks(). bool write(bool use_padding, ::FLAC__IOHandle handle, ::FLAC__IOCallbacks callbacks, ::FLAC__IOHandle temp_handle, ::FLAC__IOCallbacks temp_callbacks); ///< See FLAC__metadata_chain_write_with_callbacks_and_tempfile(). void merge_padding(); ///< See FLAC__metadata_chain_merge_padding(). void sort_padding(); ///< See FLAC__metadata_chain_sort_padding(). protected: ::FLAC__Metadata_Chain *chain_; virtual void clear(); private: // Do not use. Chain(const Chain&); Chain&operator=(const Chain&); }; /** This class is a wrapper around the FLAC__metadata_iterator * structures and methods; see the * \link flacpp_metadata_level2 usage guide \endlink and * ::FLAC__Metadata_Iterator. */ class FLACPP_API Iterator { public: Iterator(); virtual ~Iterator(); bool is_valid() const; ///< Returns \c true iff object was properly constructed. void init(Chain &chain); ///< See FLAC__metadata_iterator_init(). bool next(); ///< See FLAC__metadata_iterator_next(). bool prev(); ///< See FLAC__metadata_iterator_prev(). ::FLAC__MetadataType get_block_type() const; ///< See FLAC__metadata_iterator_get_block_type(). Prototype *get_block(); ///< See FLAC__metadata_iterator_get_block(). bool set_block(Prototype *block); ///< See FLAC__metadata_iterator_set_block(). bool delete_block(bool replace_with_padding); ///< See FLAC__metadata_iterator_delete_block(). bool insert_block_before(Prototype *block); ///< See FLAC__metadata_iterator_insert_block_before(). bool insert_block_after(Prototype *block); ///< See FLAC__metadata_iterator_insert_block_after(). protected: ::FLAC__Metadata_Iterator *iterator_; virtual void clear(); private: // Do not use. Iterator(const Iterator&); Iterator&operator=(const Iterator&); }; /* \} */ } } #endif
high
0.858119
99,979
{extend name="admin@public/base" /} {block name="main-content"} <div class="page-content"> <!--主题--> <div class="row maintop"> <div class="col-xs-12"> <form class="form-horizontal ajaxForm2" name="form0" method="post" action="{:url('admin/Park/meeting_room_runadd')}" enctype="multipart/form-data"> <div class="form-group"> <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 海创: </label> <div class="col-sm-10"> <select name="phase" id="phase" class="col-sm-2 selector" required> <option value="1">一期</option> <option value="2">二期</option> </select> <span class="help-inline col-xs-12 col-sm-2">* <span class="middle">请选择房源期数</span> </span> </div> </div> <div class="space-4"></div> <div class="form-group"> <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 会议室房间号: </label> <div class="col-sm-10"> <input type="number" name="room_number" id="room_number" placeholder="输入房间号,如301" class="col-xs-10 col-sm-2"/> <span class="help-inline col-xs-12 col-sm-2">* <span class="middle">请输入房间号</span> </span> </div> </div> <div class="space-4"></div> <div class="form-group"> <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 会议室面积: </label> <div class="col-sm-10"> <input type="text" name="area" id="area" value="" class="col-xs-10 col-sm-2"/> <span class="help-inline col-xs-12 col-sm-2">* <span class="middle">平方米</span> </span> </div> </div> <div class="space-4"></div> <div class="form-group"> <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 可容纳: </label> <div class="col-sm-10"> <input type="text" name="capacity" id="capacity" value="" class="col-xs-10 col-sm-2"/> <span class="help-inline col-xs-12 col-sm-2">* <span class="middle">人数</span> </span> </div> </div> <div class="space-4"></div> <div class="form-group"> <label class="col-sm-2 control-label no-padding-right" for="duallist">会议室设备:</label> <div class="col-sm-3"> <!-- #section:plugins/input.duallist --> <select multiple="multiple" size="10" name="equipment[]" id="duallist"> {volist name="equipment" id="k"} <option value="{$k.equipment_name}">{$k.equipment_name}</option> {/volist} </select> <!-- /section:plugins/input.duallist --> <div class="hr hr-16 hr-dotted"></div> </div> </div> <div class="space-4"></div> <!--<div class="form-group"> <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 会议室单价: </label> <div class="col-sm-10"> <input type="text" name="price" id="price" value="" class="col-xs-10 col-sm-2" /> <span class="help-inline col-xs-12 col-sm-2">* <span class="middle">元/小时</span> </span> </div> </div> <div class="space-4"></div>--> <div class="form-group"> <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 封面图片上传: </label> <div class="col-sm-10"> <a href="javascript:;" class="file"> <input type="file" name="pic_one[]" id="file0"/> 选择上传文件 </a> <span class="lbl">&nbsp;&nbsp;<img src="__PUBLIC__/img/no_img.jpg" width="100" height="70" id="img0"></span>&nbsp;&nbsp;<a href="javascript:;" onClick="return backpic('__PUBLIC__/img/no_img.jpg');" title="还原修改前的图片" class="file"> 撤销上传 </a> <span class="lbl">&nbsp;&nbsp;上传前先用PS处理成等比例图片后上传,最后都统一比例<br/> </span> </div> </div> <div class="space-4"></div> <div class="form-group"> <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 房间图集: </label> <div class="col-sm-10"> <div class="radio"> <label> <input name="room_pic_type" id="room_pic_list" checked type="radio" class="ace" value="1"/> <span class="lbl"> 无图模式</span> </label> <label> <input name="room_pic_type" id="room_pic_qqlist" type="radio" class="ace" value="2"/> <span class="lbl"> 多图模式</span> </label> </div> </div> </div> <div class="space-4"></div> <!-- 多图上传 --> <link href="__PUBLIC__/ppy/css/fileinput.css" media="all" rel="stylesheet" type="text/css"/> <script src="__PUBLIC__/ppy/js/fileinput.js" type="text/javascript"></script> <script src="__PUBLIC__/ppy/js/fileinput_locale_zh.js" type="text/javascript"></script> <div class="form-group" id="pic_list"> <div class="col-sm-10 col-sm-offset-2" style="padding-top:5px;"> <input id="file-5" name="pic_all[]" type="file" class="file" multiple data-preview-file-type="any" data-upload-url="#" data-preview-file-icon=""><br/> <textarea name="room_pic_content" class="col-xs-12 col-sm-12" id="room_pic_content" placeholder="单次编辑或添加文章,选择多图时请一次性选择。多图对应文章说明,例如: 图片一说明 | 图片二说明 | 图片三说明 每个文字说明以 | 分割"></textarea> </div> </div> <div class="space-4"></div> <div class="form-group"> <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 排序(从小到大): </label> <div class="col-sm-10"> <input type="text" name="listorder" value="50" class="col-xs-10 col-sm-1"/> </div> </div> <div class="space-4"></div> <div class="form-group"> <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 房间介绍: </label> <div class="col-sm-10"> <script src="__PUBLIC__/ueditor/ueditor.config.js" type="text/javascript"></script> <script src="__PUBLIC__/ueditor/ueditor.all.js" type="text/javascript"></script> <textarea name="news_content" rows="100%" style="width:80%" id="myEditor"></textarea> <script type="text/javascript"> var editor = new UE.ui.Editor(); editor.render("myEditor"); </script> </div> </div> <div class="space-4"></div> <div class="clearfix form-actions"> <div class="col-md-offset-3 col-md-9"> <input class="ace ace-checkbox-2" name="continue" type="checkbox" value="1"> <span class="lbl"> 发布后继续</span> <button class="btn btn-info" type="submit"> <i class="ace-icon fa fa-check bigger-110"></i> 保存 </button> &nbsp; &nbsp; &nbsp; <button class="btn" type="reset"> <i class="ace-icon fa fa-undo bigger-110"></i> 重置 </button> </div> </div> </form> </div> </div> </div><!-- /.page-content --> {/block} {block name="scripts"} <script> //多图设置 $("#pic_list").hide(); $("#room_pic_list").click(function () { $("#pic_list").hide(); }); $("#room_pic_qqlist").click(function () { $("#pic_list").show(); }); $('.date-picker').datepicker({ autoclose: true, todayHighlight: true, language: 'zh-CN', }) jQuery(function ($) { var demo1 = $('select[name="equipment[]"]').bootstrapDualListbox({infoTextFiltered: '<span class="label label-purple label-lg">Filtered</span>'}); var container1 = demo1.bootstrapDualListbox('getContainer'); container1.find('.btn').addClass('btn-white btn-info btn-bold'); }); </script> {/block}
high
0.451747
99,980
-module(chat_acc). -behaviour(supervisor). %% API -export([start_link/0]). %% Supervisor callbacks -export([init/1]). -define(SERVER, ?MODULE). %%%=================================================================== %%% API functions %%%=================================================================== %%-------------------------------------------------------------------- %% @doc %% Starts the supervisor %% %% @end %%-------------------------------------------------------------------- -spec(start_link() -> {ok, Pid :: pid()} | ignore | {error, Reason :: term()}). start_link() -> supervisor:start_link({local, ?SERVER}, ?MODULE, []). %%%=================================================================== %%% Supervisor callbacks %%%=================================================================== -spec(init(Args :: term()) -> {ok, {SupFlags :: {RestartStrategy :: supervisor:strategy(), MaxR :: non_neg_integer(), MaxT :: pos_integer()}, [ChildSpec :: supervisor:child_spec()] }}). init([]) -> {ok, Port} = application:get_env(port), {ok, ListenSock} = gen_tcp:listen(Port, [ {active, false}, {reuseaddr, true}, {packet, http_bin}, {mode, binary}]), RestartStrategy = one_for_one, MaxRestarts = 60, MaxSecondsBetweenRestarts = 3600, SupFlags = {RestartStrategy, MaxRestarts, MaxSecondsBetweenRestarts}, Restart = permanent, Shutdown = 3000, Type = worker, Child = fun(Name) -> {Name, {chat_acc_worker, start_link, [ListenSock]}, Restart, Shutdown, Type, [chat_acc_worker]} end, {ok, {SupFlags, lists:map(Child, lists:seq(1, 10))}}. %%%=================================================================== %%% Internal functions %%%===================================================================
low
0.413599
99,981
module Path where open import Basics hiding (_==_) open import Proc import Graph private open module G = Graph Nat data Node : Set where node : Nat -> Node stop : Node _==_ : Node -> Node -> Bool stop == stop = true node zero == node zero = true node (suc n) == node (suc m) = node n == node m _ == _ = false data U : Set where int : U ext : U data Name : Set where fwd-edge : Nat -> Nat -> Name bwd-edge : Nat -> Node -> Name start : Nat -> Name finish : Nat -> Name N : U -> Set N int = Name N ext = False data Msg : Set where forward : Node -> Node -> Msg backward : Node -> Msg T : U -> Set T int = Msg T ext = Node private module Impl where private module P = ProcDef U T N open P hiding (_!_) P = Proc int infixr 40 _!_ _!_ : Msg -> P -> P m ! p = P._!_ (lift m) p fwd : Nat -> Nat -> Msg fwd from to = forward (node from) (node to) fwd-runner : Nat -> Nat -> P fwd-runner from to = > react where react : Msg -> P react (forward from' to') = if to' == node from then fwd from to ! def (bwd-edge from from') else def (fwd-edge from to) react (backward _) = o bwd-runner : Nat -> Node -> P bwd-runner from w = > react where react : Msg -> P react (backward n) = if n == w then o else if n == node from then backward w ! o else def (bwd-edge from w) react (forward _ _) = def (bwd-edge from w) pitcher : Nat -> P pitcher n = forward stop (node n) ! o batter : Nat -> P batter n = > react where react : Msg -> P react (forward from to) = if to == node n then backward from ! o else def (start n) react _ = def (start n) env : Env env int (fwd-edge from to) = fwd-runner from to env int (bwd-edge from w) = bwd-runner from w env int (start n) = batter n env int (finish n) = pitcher n env ext () edges : Graph -> P edges [] = o edges (edge x y :: G) = def (fwd-edge x y) || edges G φ : Tran ext int φ = record { upV = up; downV = down } where down : Node -> Lift Msg down x = lift (backward x) up : Msg -> Lift Node up (forward _ _) = bot up (backward x) = lift x main : Graph -> Nat -> Nat -> Proc ext main G x y = φ /| def (finish y) || def (start x) || edges G open Impl public param : Param param = record { U = U ; T = T ; Name = N ; env = env }
high
0.671712
99,982
namespace java lucandra.serializers.thrift /** * Term Information.. */ struct ThriftTerm { 1: required string field, 2: optional binary text, 3: optional bool is_binary, 4: optional i64 longVal, 5: optional i32 intVal, 6: optional double doubleVal, 7: optional double floatVal } struct DocumentMetadata { 1: required list<ThriftTerm> terms }
high
0.767616
99,983
/*===================================================================== Program Name : IsNumM.sas Purpose : Checks if alphanumeric MACRO variable input (which is always character data) is valid numeric data. Optionally checks for IsInt, IsNonNeg, or IsPos. SAS Version : SAS 9.3 Input Data : Alphanumeric data contained in a macro variable. Output Data : Return code indicating IsNum, IsInt, IsNonNeg, or IsPos. Macros Called : parmv Originally Written by : Scott Bass Date : 16FEB2016 Program Version # : 1.0 ======================================================================= Scott Bass (sas_l_739@yahoo.com.au) This code is licensed under the Unlicense license. For more information, please refer to http://unlicense.org/UNLICENSE. This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. ======================================================================= Modification History : Original version =====================================================================*/ /*--------------------------------------------------------------------- Usage: options missing=' '; * check for numeric input ; %put isnum=%IsNumM( ); %put isnum=%IsNumM(.); %put isnum=%IsNumM(._); %put isnum=%IsNumM(.A); %put isnum=%IsNumM(.Z); %put isnum=%IsNumM(-1); %put isnum=%IsNumM(0); %put isnum=%IsNumM(1); %put isnum=%IsNumM(1.1); %put isnum=%IsNumM( 123456789012.123456789012); %put isnum=%IsNumM(-123456789012.123456789012); %put isnum=%IsNumM( 1234567890123.1234567890123); %put isnum=%IsNumM(-1234567890123.1234567890123); %put isnum=%IsNumM( 12345678901234.12345678901234); %put isnum=%IsNumM(-12345678901234.12345678901234); %put isnum=%IsNumM( 123456789012345.123456789012345); %put isnum=%IsNumM(-123456789012345.123456789012345); %put isnum=%IsNumM( 1234567890123456.1234567890123456); %put isnum=%IsNumM(-1234567890123456.1234567890123456); %put isnum=%IsNumM( 1.1); %put isnum=%IsNumM( -123); %put isnum=%IsNumM( -123.45); %put isnum=%IsNumM( --123.45); %put isnum=%IsNumM(A); %put isnum=%IsNumM( B); %put isnum=%IsNumM(123 456); %put isnum=%IsNumM(123-456); %put isnum=%IsNumM(~!@#$%^&*()_+=); options missing='.'; %put isnum=%IsNumM( ); %put isnum=%IsNumM(.); %put isnum=%IsNumM(._); %put isnum=%IsNumM(.A); %put isnum=%IsNumM(.Z); %put isnum=%IsNumM(-1); %put isnum=%IsNumM(0); %put isnum=%IsNumM(1); %put isnum=%IsNumM(1.1); %put isnum=%IsNumM( 123456789012.123456789012); %put isnum=%IsNumM(-123456789012.123456789012); %put isnum=%IsNumM( 1234567890123.1234567890123); %put isnum=%IsNumM(-1234567890123.1234567890123); %put isnum=%IsNumM( 12345678901234.12345678901234); %put isnum=%IsNumM(-12345678901234.12345678901234); %put isnum=%IsNumM( 123456789012345.123456789012345); %put isnum=%IsNumM(-123456789012345.123456789012345); %put isnum=%IsNumM( 1234567890123456.1234567890123456); %put isnum=%IsNumM(-1234567890123456.1234567890123456); %put isnum=%IsNumM( 1.1); %put isnum=%IsNumM( -123); %put isnum=%IsNumM( -123.45); %put isnum=%IsNumM( --123.45); %put isnum=%IsNumM(A); %put isnum=%IsNumM( B); %put isnum=%IsNumM(123 456); %put isnum=%IsNumM(123-456); %put isnum=%IsNumM(~!@#$%^&*()_+=); * check for integer input ; %put isint=%IsNumM(1,type=int); %put isint=%IsNumM(1.1,type=int); %put isint=%IsNumM(999999999999,type=int); %put isint=%IsNumM(9999999999999,type=int); %put isint=%IsNumM(99999999999999,type=int); %put isint=%IsNumM(999999999999999,type=int); %put isint=%IsNumM(9999999999999999,type=int); %put isint=%IsNumM(99999999999999999,type=int); %put isint=%IsNumM(999999999999999999,type=int); %put isint=%IsNumM(9999999999999999999,type=int); * check for non-negative input ; %put isnonneg=%IsNumM(-1,type=nonneg); %put isnonneg=%IsNumM(-1.2,type=nonneg); %put isnonneg=%IsNumM(0,type=nonneg); %put isnonneg=%IsNumM(1,type=nonneg); %put isnonneg=%IsNumM(1.2,type=nonneg); * check for positive input ; %put ispos=%IsNumM(-1,type=pos); %put ispos=%IsNumM(-1.2,type=pos); %put ispos=%IsNumM(0,type=pos); %put ispos=%IsNumM(1,type=pos); %put ispos=%IsNumM(1.2,type=pos); * treat missing data (not including special missing data) as valid ; %put missing=%IsNumM( ,missing=N); %put missing=%IsNumM(. ,missing=N); %put missing=%IsNumM(._,missing=N); %put missing=%IsNumM(.A,missing=N); %put missing=%IsNumM( .M,missing=N); %put missing=%IsNumM( .Z ,missing=N); %put missing=%IsNumM(-1,missing=N); %put missing=%IsNumM( 0,missing=N); %put missing=%IsNumM( 1,missing=N); %put missing=%IsNumM( ,missing=Y); %put missing=%IsNumM(. ,missing=Y); %put missing=%IsNumM(._,missing=Y); %put missing=%IsNumM(.A,missing=Y); %put missing=%IsNumM( .M,missing=Y); %put missing=%IsNumM( .Z ,missing=Y); %put missing=%IsNumM(-1,missing=Y); %put missing=%IsNumM( 0,missing=Y); %put missing=%IsNumM( 1,missing=Y); ----------------------------------------------------------------------- Notes: This is "pure macro" code and returns an R-value ("function style macro"). It must be called in the correct context for such a macro. Since %sysfunc does not support the INPUT function, the INPUTN function is used instead. INPUTN does not support the ?? modifier to suppress invalid numeric input. Therefore, additional error checking of the source data (via a Perl regular expression) is used to prevent the macro from throwing warning messages. Note that the check for IsInt collapses for large numbers, where precision is lost and the difference between num and int(num) becomes 0 [num-int(num)=0]. On my machine, this happens around 1E15, or 15 significant digits. Unlike the %IsNum macro, which runs in a data step, this function style macro does not treat special missing values as valid numeric data. This is an edge case that I am happy not to cater for. ---------------------------------------------------------------------*/ %macro IsNumM /*--------------------------------------------------------------------- Checks if alphanumeric (character) input is valid numeric data. ---------------------------------------------------------------------*/ (CHAR /* Character variable to check (Opt). */ ,TYPE=NUM /* Type of check to run (REQ). */ /* Valid values are NUM INT NONNEG or POS */ /* (case-insensitive) */ ,MISSING=N /* Include missing values as valid numeric input?(REQ)*/ /* Default value is NO. Valid values are: */ /* 0 1 OFF N NO F FALSE and ON Y YES T TRUE */ /* OFF N NO F FALSE and ON Y YES T TRUE */ /* (case insensitive) are acceptable aliases for */ /* 0 and 1 respectively. */ ); %local macro parmerr rx match num; %let macro = &sysmacroname; %* check input parameters ; %parmv(TYPE, _req=1,_words=0,_case=U,_val=NUM INT NONNEG POS) %parmv(MISSING, _req=1,_words=0,_case=U,_val=0 1) %if (&parmerr) %then %goto quit; %* remove leading spaces ; %let char=&char; %* put CHAR=*&char*; %* for debugging ; %* use a Perl regex to test for empty string, missing(.), or special missing (._,.A-.Z) data ; %* if YES: ; %* if MISSING=N treat as not valid numeric data ; %* if MISSING=Y treat as valid numeric data ; %let rx = %sysfunc(prxparse(/^( *|\.[A-Z_]*)$/o)); %let match = %sysfunc(prxmatch(&rx,%superq(char))); %syscall prxfree(rx); %if (&match eq 1) %then %do; %if (&missing) %then %let rtn=1; %else %let rtn=0; &rtn %return; %end; %* use a Perl regex to test for numeric input ; %* the regex is "/^(-{0,1})(\d*)(\.{0,1})(\d*)$/o", which means: ; %* beginning of string (^): ; %* 0 or 1 minus signs: ; %* 0 or more digits: ; %* 0 or 1 periods: ; %* 0 or more digits: ; %* end of string ($) ; %* compile the regex once (o) ; %let rx = %sysfunc(prxparse(/^(-{0,1})(\d*)(\.{0,1})(\d*)$/o)); %let match = %sysfunc(prxmatch(&rx,%superq(char))); %syscall prxfree(rx); %* if no match then not num ; %if (&match eq 0) %then %do; 0 %return; %end; %* the Perl regex should be sufficient to cleanse the input to the inputn function ; %* convert the value to num. if it is missing then not num ; %* note: this only supports options missing='.' and options missing=' ' ; %let num=%sysfunc(inputn(%superq(char),best32.),best32.); %let num=&num; %* put NUM =#&num#; %* for debugging ; %if (%superq(num) eq .) or (%superq(num) eq ) %then %do; 0 %return; %end; %* it is probably a num :-) ; %if (&type eq NUM) %then %do; 1 %end; %else %if (&type eq INT) %then %do; %let int=%sysfunc(int(&num),32.); %put INT =#&int#; %let rtn=%eval(&int eq &num); &rtn %end; %else %if (&type eq NONNEG) %then %do; %let rtn=%sysevalf(&num ge 0); &rtn %end; %else %if (&type eq POS) %then %do; %let rtn=%sysevalf(&num gt 0); &rtn %end; %quit: %mend; /******* END OF FILE *******/
high
0.287254
99,984
======================== Team and repository tags ======================== .. image:: https://governance.openstack.org/tc/badges/keystoneauth.svg :target: https://governance.openstack.org/tc/reference/tags/index.html .. Change things from this point on ============ keystoneauth ============ .. image:: https://img.shields.io/pypi/v/keystoneauth1.svg :target:https://pypi.org/project/keystoneauth1 :alt: Latest Version .. image:: https://img.shields.io/pypi/dm/keystoneauth1.svg :target: https://pypi.org/project/keystoneauth1/ :alt: Downloads This package contains tools for authenticating to an OpenStack-based cloud. These tools include: * Authentication plugins (password, token, and federation based) * Discovery mechanisms to determine API version support * A session that is used to maintain client settings across requests (based on the requests Python library) Further information: * Free software: Apache license * Documentation: https://docs.openstack.org/keystoneauth/latest/ * Source: https://opendev.org/openstack/keystoneauth * Bugs: https://bugs.launchpad.net/keystoneauth * Release notes: https://docs.openstack.org/releasenotes/keystoneauth/
high
0.64699
99,985
;; Copyright (c) 2007-2011, Florian Loitsch ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions are met: ;; * Redistributions of source code must retain the above copyright ;; notice, this list of conditions and the following disclaimer. ;; * Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; * Neither the name of the <organization> nor the ;; names of its contributors may be used to endorse or promote products ;; derived from this software without specific prior written permission. ;; ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ;; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE ;; DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY ;; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ;; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ;; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ;; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. (module with (import nodes walk symbol-table verbose) (static (class Interception-Construct intercepted-ht ;; hashtable of (potentially) intercepted variables. obj-id ;; the obj-id that intercepts. symbol-table)) (export (with! tree::Program))) ;; whenever we encounter a 'with', we "clear" the current ;; symbol-table. Whenever we encounter a var-ref that has no var in the ;; symbol-table, we know it has been intercepted by a with. ;; this pass must change the eval-next-vars too. (define (with! tree) (verbose "with-interception") (with-interception tree #f #f '())) ;; surrounding-interceptors is a list of Interception-Constructs. ;; It mainly contains 'with's but also catch, named-fun, and funs (if they ;; contain evals). (define-nmethod (Node.with-interception symbol-table surrounding-interceptors) (default-walk this symbol-table surrounding-interceptors)) (define-nmethod (Program.with-interception symbol-table surrounding-interceptors) (with-access::Program this (runtime-table imported-table globals-table) (let ((symbol-table (add-scope (add-scope (add-scope (make-symbol-table) runtime-table) imported-table) globals-table))) (default-walk this symbol-table '())))) (define-nmethod (Fun.with-interception symbol-table surrounding-interceptors) (with-access::Fun this (local-eval? locals-table eval-obj-id) (if local-eval? (begin ;; fun intercepts all variables. ;; this is necessary, as evals might create new variables inside the ;; function ;; also we need to update the 'eval-next-vars' (hashtable-for-each locals-table (lambda (id var) (when (not (This-Var? var)) (with-access::Var var (eval-next-var) (set! eval-next-var (update-var id eval-next-var symbol-table surrounding-interceptors)))))) (default-walk this (add-scope (make-symbol-table) locals-table) (cons (instantiate::Interception-Construct (intercepted-ht (make-hashtable)) (obj-id eval-obj-id) (symbol-table symbol-table)) surrounding-interceptors))) (default-walk this (add-scope symbol-table locals-table) surrounding-interceptors)))) (define-nmethod (With.with-interception symbol-table surrounding-interceptors) (with-access::With this (obj-id obj body) (walk obj symbol-table surrounding-interceptors) (walk body (make-symbol-table) (cons (instantiate::Interception-Construct (intercepted-ht (make-hashtable)) (obj-id obj-id) (symbol-table symbol-table)) surrounding-interceptors)))) ;; nearly the same as before. but this time we add the symbol-table. (define-nmethod (Decl-Intercept.with-interception symbol-table surrounding-interceptors) (with-access::Decl-Intercept this (locals-table obj-id) (default-walk this (add-scope (make-symbol-table) locals-table) (cons (instantiate::Interception-Construct (intercepted-ht (make-hashtable)) (obj-id obj-id) (symbol-table symbol-table)) surrounding-interceptors)))) ;; note: the id is redundant... (define (update-var id orig-var::Var symbol-table surrounding-interceptors) (let ((var (symbol-var symbol-table id))) (if (or var (Var-internal? orig-var)) ;; not intercepted or internal var which can't be intercepted. (begin (when (and var (not (eq? var orig-var))) (verbose "****** " (Var-id var))) orig-var) ;; intercepted (with-access::Interception-Construct (car surrounding-interceptors) (intercepted-ht obj-id symbol-table) (let ((entry (hashtable-get intercepted-ht id))) (if entry ;; not the first interception. just return the previously ;; created intercepted var. entry ;; first interception. ;; continue recursively: the intercepted var might be ;; intercepted several times... ;; ;; Note that the symbol-table in the call to update-var is the ;; one from the Interception-Construct and not the one given ;; to the function. (let* ((intercepted-var (update-var id orig-var symbol-table (cdr surrounding-interceptors))) (fake-var (instantiate::Intercepted-Var (id id) (obj-id obj-id) (intercepted intercepted-var)))) (hashtable-put! intercepted-ht id fake-var) fake-var))))))) (define-nmethod (Ref.with-interception symbol-table surrounding-interceptors) (with-access::Ref this (var id) (with-access::Var var (operator?) (unless operator? ;; operators can't be intercepted. (set! var (update-var id var symbol-table surrounding-interceptors))))))
high
0.669386
99,986
/* @group Base */ select.chzn-select { visibility: hidden; height: 28px !important; min-height: 28px !important; } .chzn-container { font-size: 13px; position: relative; display: inline-block; zoom: 1; margin-bottom: 5px; *display: inline; } .chzn-container .chzn-drop { background: #fff; border: 1px solid #aaa; border-top: 0; position: absolute; top: 29px; left: 0; -webkit-box-shadow: 0 4px 5px rgba(0,0,0,.15); -moz-box-shadow : 0 4px 5px rgba(0,0,0,.15); -o-box-shadow : 0 4px 5px rgba(0,0,0,.15); box-shadow : 0 4px 5px rgba(0,0,0,.15); z-index: 999; } /* @end */ /* @group Single Chosen */ .chzn-container-single .chzn-single { background-color: #fff; background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white)); background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%); background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%); background-image: -o-linear-gradient(top, #eeeeee 0%,#ffffff 50%); background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 50%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 ); background-image: linear-gradient(top, #eeeeee 0%,#ffffff 50%); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #aaa; display: block; overflow: hidden; white-space: nowrap; position: relative; height: 26px; line-height: 26px; padding: 0 0 0 8px; color: #444; text-decoration: none; } .chzn-container-single .chzn-single span { margin-right: 26px; display: block; overflow: hidden; white-space: nowrap; -o-text-overflow: ellipsis; -ms-text-overflow: ellipsis; -moz-binding: url('/xml/ellipsis.xml#ellipsis'); text-overflow: ellipsis; } .chzn-container-single .chzn-single div { -webkit-border-radius: 0 4px 4px 0; -moz-border-radius : 0 4px 4px 0; border-radius : 0 4px 4px 0; -moz-background-clip : padding; -webkit-background-clip: padding-box; background-clip : padding-box; background: #ccc; background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee)); background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%); background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%); background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%); background-image: -ms-linear-gradient(top, #cccccc 0%,#eeeeee 60%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cccccc', endColorstr='#eeeeee',GradientType=0 ); background-image: linear-gradient(top, #cccccc 0%,#eeeeee 60%); border-left: 1px solid #aaa; position: absolute; right: 0; top: 0; display: block; height: 100%; width: 18px; } .chzn-container-single .chzn-single div b { background: url(../images/chosen-sprite.png) no-repeat 0 1px; display: block; width: 100%; height: 100%; } .chzn-container-single .chzn-search { padding: 3px 4px; margin: 0; white-space: nowrap; } .chzn-container-single .chzn-search input { background: #fff url(../images/chosen-sprite.png) no-repeat 100% -20px; background: url(../images/chosen-sprite.png) no-repeat 100% -20px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); background: url(../images/chosen-sprite.png) no-repeat 100% -20px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); background: url(../images/chosen-sprite.png) no-repeat 100% -20px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); background: url(../images/chosen-sprite.png) no-repeat 100% -20px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); background: url(../images/chosen-sprite.png) no-repeat 100% -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); background: url(../images/chosen-sprite.png) no-repeat 100% -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); background: url(../images/chosen-sprite.png) no-repeat 100% -20px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); margin: 1px 0; padding: 4px 20px 4px 5px; outline: 0; border: 1px solid #aaa; font-family: sans-serif; font-size: 1em; } .chzn-container-single .chzn-drop { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius : 0 0 4px 4px; border-radius : 0 0 4px 4px; -moz-background-clip : padding; -webkit-background-clip: padding-box; background-clip : padding-box; } /* @end */ /* @group Multi Chosen */ .chzn-container-multi .chzn-choices { background-color: #fff; background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); background-image: -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); background-image: -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); background-image: -o-linear-gradient(bottom, white 85%, #eeeeee 99%); background-image: -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); background-image: linear-gradient(top, #ffffff 85%,#eeeeee 99%); border: 1px solid #aaa; margin: 0; padding: 0; cursor: text; overflow: hidden; height: auto !important; height: 1%; position: relative; } .chzn-container-multi .chzn-choices li { float: left; list-style: none; } .chzn-container-multi .chzn-choices .search-field { white-space: nowrap; margin: 0; padding: 0; } .chzn-container-multi .chzn-choices .search-field input { color: #666; background: transparent !important; border: 0 !important; padding: 5px; margin: 1px 0; outline: 0; -webkit-box-shadow: none; -moz-box-shadow : none; -o-box-shadow : none; box-shadow : none; } .chzn-container-multi .chzn-choices .search-field .default { color: #999; } .chzn-container-multi .chzn-choices .search-choice { -webkit-border-radius: 3px; -moz-border-radius : 3px; border-radius : 3px; -moz-background-clip : padding; -webkit-background-clip: padding-box; background-clip : padding-box; background-color: #e4e4e4; background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #e4e4e4), color-stop(0.7, #eeeeee)); background-image: -webkit-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%); background-image: -moz-linear-gradient(center bottom, #e4e4e4 0%, #eeeeee 70%); background-image: -o-linear-gradient(bottom, #e4e4e4 0%, #eeeeee 70%); background-image: -ms-linear-gradient(top, #e4e4e4 0%,#eeeeee 70%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e4e4e4', endColorstr='#eeeeee',GradientType=0 ); background-image: linear-gradient(top, #e4e4e4 0%,#eeeeee 70%); color: #333; border: 1px solid #b4b4b4; line-height: 13px; padding: 3px 19px 3px 6px; margin: 3px 0 3px 5px; position: relative; } .chzn-container-multi .chzn-choices .search-choice span { cursor: default; } .chzn-container-multi .chzn-choices .search-choice-focus { background: #d4d4d4; } .chzn-container-multi .chzn-choices .search-choice .search-choice-close { display: block; position: absolute; right: 5px; top: 6px; width: 8px; height: 9px; font-size: 1px; background: url(../images/chosen-sprite.png) right top no-repeat; } .chzn-container-multi .chzn-choices .search-choice .search-choice-close:hover { background-position: right -9px; } .chzn-container-multi .chzn-choices .search-choice-focus .search-choice-close { background-position: right -9px; } /* @end */ /* @group Results */ .chzn-container .chzn-results { margin: 0 4px 4px 0; max-height: 190px; padding: 0 0 0 4px; position: relative; overflow-x: hidden; overflow-y: auto; } .chzn-container-multi .chzn-results { margin: -1px 0 0; padding: 0; } .chzn-container .chzn-results li { padding: 7px 7px 8px; margin: 0; list-style: none; } .chzn-container .chzn-results .active-result { cursor: pointer; } .chzn-container .chzn-results .highlighted { background: #4A87BD; color: #fff; } .chzn-container .chzn-results li em { background: #ED9334; font-style: normal; color: white; padding: 5px; } .chzn-container .chzn-results .highlighted em { background: transparent; } .chzn-container .chzn-results .no-results { background: #f4f4f4; } .chzn-container .chzn-results .group-result { cursor: default; color: #999; font-weight: bold; } .chzn-container .chzn-results .group-option { padding-left: 20px; } .chzn-container-multi .chzn-drop .result-selected { display: none; } /* @end */ /* @group Active */ .chzn-container-active .chzn-single { -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); -moz-box-shadow : 0 0 5px rgba(0,0,0,.3); -o-box-shadow : 0 0 5px rgba(0,0,0,.3); box-shadow : 0 0 5px rgba(0,0,0,.3); border: 1px solid #5897fb; } .chzn-container-active .chzn-single-with-drop { border: 1px solid #aaa; -webkit-box-shadow: 0 1px 0 #fff inset; -moz-box-shadow : 0 1px 0 #fff inset; -o-box-shadow : 0 1px 0 #fff inset; box-shadow : 0 1px 0 #fff inset; background-color: #eee; background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee)); background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%); background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%); background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%); background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 ); background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%); -webkit-border-bottom-left-radius : 0; -webkit-border-bottom-right-radius: 0; -moz-border-radius-bottomleft : 0; -moz-border-radius-bottomright: 0; border-bottom-left-radius : 0; border-bottom-right-radius: 0; } .chzn-container-active .chzn-single-with-drop div { background: transparent; border-left: none; } .chzn-container-active .chzn-single-with-drop div b { background-position: -18px 1px; } .chzn-container-active .chzn-choices { -webkit-box-shadow: 0 0 5px rgba(0,0,0,.3); -moz-box-shadow : 0 0 5px rgba(0,0,0,.3); -o-box-shadow : 0 0 5px rgba(0,0,0,.3); box-shadow : 0 0 5px rgba(0,0,0,.3); border: 1px solid #5897fb; } .chzn-container-active .chzn-choices .search-field input { color: #111 !important; } /* @end */ /* @group Right to Left */ .chzn-rtl { direction:rtl;text-align: right; } .chzn-rtl .chzn-single { padding-left: 0; padding-right: 8px; } .chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; } .chzn-rtl .chzn-single div { left: 0; right: auto; border-left: none; border-right: 1px solid #aaaaaa; -webkit-border-radius: 4px 0 0 4px; -moz-border-radius : 4px 0 0 4px; border-radius : 4px 0 0 4px; } .chzn-rtl .chzn-choices li { float: right; } .chzn-rtl .chzn-choices .search-choice { padding: 3px 6px 3px 19px; margin: 3px 5px 3px 0; } .chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 5px; right: auto; background-position: right top;} .chzn-rtl.chzn-container-single .chzn-results { margin-left: 4px; margin-right: 0; padding-left: 0; padding-right: 4px; } .chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 20px; } .chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; } .chzn-rtl .chzn-search input { background: url(../images/chosen-sprite.png) no-repeat -38px -20px, #ffffff; background: url(../images/chosen-sprite.png) no-repeat -38px -20px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee)); background: url(../images/chosen-sprite.png) no-repeat -38px -20px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%); background: url(../images/chosen-sprite.png) no-repeat -38px -20px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%); background: url(../images/chosen-sprite.png) no-repeat -38px -20px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%); background: url(../images/chosen-sprite.png) no-repeat -38px -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); background: url(../images/chosen-sprite.png) no-repeat -38px -20px, -ms-linear-gradient(top, #ffffff 85%,#eeeeee 99%); background: url(../images/chosen-sprite.png) no-repeat -38px -20px, linear-gradient(top, #ffffff 85%,#eeeeee 99%); padding: 4px 5px 4px 20px; } /* @end */
high
0.441724
99,987
# This file must be used with "source bin/activate.csh" *from csh*. # You cannot run it directly. # Created by Davide Di Blasi <davidedb@gmail.com>. # Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com> alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate' # Unset irrelevant variables. deactivate nondestructive setenv VIRTUAL_ENV "/home/trevor/Documents/moringa-projects/core/flask/citadel-news/virtual" set _OLD_VIRTUAL_PATH="$PATH" setenv PATH "$VIRTUAL_ENV/bin:$PATH" set _OLD_VIRTUAL_PROMPT="$prompt" if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then if ("virtual" != "") then set env_name = "virtual" else if (`basename "VIRTUAL_ENV"` == "__") then # special case for Aspen magic directories # see http://www.zetadev.com/software/aspen/ set env_name = `basename \`dirname "$VIRTUAL_ENV"\`` else set env_name = `basename "$VIRTUAL_ENV"` endif endif set prompt = "[$env_name] $prompt" unset env_name endif alias pydoc python -m pydoc rehash
low
1
99,988
<# .SYNOPSIS Expand and return transitive group membership based on group members data in cache. .EXAMPLE PS C:\>Expand-GroupTransitiveMembership 00000000-0000-0000-0000-000000000000 -LookupCache $LookupCache Expand transitive group membership of group "00000000-0000-0000-0000-000000000000". Ensure all nested groups are in $LookupCache. .INPUTS System.Object #> function Expand-GroupTransitiveMembership { [CmdletBinding()] param ( # GroupId within Cache for which to calculate transitive member list. [Parameter(Mandatory = $true, Position = 1)] [System.Collections.Generic.Stack[guid]] $GroupId, # Lookup Cache populated with all nested group objects necessary to calculate transitive members. [Parameter(Mandatory = $true)] [psobject] $LookupCache ) $Group = Get-AadObjectById $GroupId.Peek() -LookupCache $LookupCache -ObjectType group -UseLookupCacheOnly if ($Group.psobject.Properties.Name.Contains('transitiveMembers')) { $Group.transitiveMembers } else { $transitiveMembers = New-Object 'System.Collections.Generic.Dictionary[guid,psobject]' foreach ($member in $Group.members) { if (!$transitiveMembers.ContainsKey($member.id)) { $transitiveMembers.Add($member.id, $member) $member } if ($member.'@odata.type' -eq '#microsoft.graph.group') { if (!$GroupId.Contains($member.id)) { $GroupId.Push($member.id) $transitiveMembersNested = Expand-GroupTransitiveMembership $GroupId -LookupCache $LookupCache foreach ($memberNested in $transitiveMembersNested) { if (!$transitiveMembers.ContainsKey($memberNested.id)) { $transitiveMembers.Add($memberNested.id, $memberNested) $memberNested } } } } } if ($GroupId.Count -eq 1) { $Group | Add-Member -Name transitiveMembers -MemberType NoteProperty -Value ([System.Collections.ArrayList]$transitiveMembers.Values) -ErrorAction Ignore } } [void]$GroupId.Pop() }
high
0.284243
99,989
.. _cn_api_tensor_random_randperm: randperm ------------------------------- .. py:function:: paddle.randperm(n, dtype="int64", name=None) 返回一个数值在0到n-1、随机排列的1-D Tensor,数据类型为 ``dtype``。 参数 :::::::::::: - **n** (int) - 随机序列的上限(不包括在序列中),应该大于0。 - **dtype** (str|np.dtype,可选) - 输出 Tensor 的数据类型,支持 int32、int64、float32、float64。默认值为 int64。 - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 返回 :::::::::: Tensor:一个数值在0到n-1、随机排列的1-D Tensor,数据类型为 ``dtype`` 。 代码示例 :::::::::: .. code-block:: python import paddle out1 = paddle.randperm(5) # [4, 1, 2, 3, 0] # random out2 = paddle.randperm(7, 'int32') # [1, 6, 2, 0, 4, 3, 5] # random
high
0.74972
99,990
import packageInfo from "./package.json"; import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts"; import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver"; import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node"; import { Hash } from "@aws-sdk/hash-node"; import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry"; import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider"; import { NodeHttpHandler, streamCollector } from "@aws-sdk/node-http-handler"; import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node"; import { calculateBodyLength } from "@aws-sdk/util-body-length-node"; import { defaultUserAgent } from "@aws-sdk/util-user-agent-node"; import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node"; import { SagemakerEdgeClientConfig } from "./SagemakerEdgeClient"; import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared"; import { emitWarningIfUnsupportedVersion } from "@aws-sdk/smithy-client"; /** * @internal */ export const getRuntimeConfig = (config: SagemakerEdgeClientConfig = {}) => { emitWarningIfUnsupportedVersion(process.version); const clientSharedValues = getSharedRuntimeConfig(config); return { ...clientSharedValues, ...config, runtime: "node", base64Decoder: config.base64Decoder ?? fromBase64, base64Encoder: config.base64Encoder ?? toBase64, bodyLengthChecker: config.bodyLengthChecker ?? calculateBodyLength, credentialDefaultProvider: config.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider), defaultUserAgentProvider: config.defaultUserAgentProvider ?? defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }), maxAttempts: config.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS), region: config.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS), requestHandler: config.requestHandler ?? new NodeHttpHandler(), retryModeProvider: config.retryModeProvider ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS), sha256: config.sha256 ?? Hash.bind(null, "sha256"), streamCollector: config.streamCollector ?? streamCollector, utf8Decoder: config.utf8Decoder ?? fromUtf8, utf8Encoder: config.utf8Encoder ?? toUtf8, }; };
high
0.888104
99,991
open FomBasis open FomDiag (* *) let () = Hashtbl.randomize () (* *) module Options = struct let max_width = ref 80 let whole = ref true let stop : [`Typ | `Js | `Run] ref = ref `Run end (* *) exception HttpError of (int * Cohttp.Code.meth * Uri.t) let of_lwt op = of_async @@ fun on_error on_ok -> match try Ok (op ()) with e -> Error e with | Ok p -> Lwt.on_any p on_ok on_error | Error e -> on_error e let error_io at exn = fail @@ `Error_io (at, exn) let fetch at filename = if FomElab.Path.is_http filename then of_lwt (fun () -> let open Lwt.Syntax in let open Cohttp in let open Cohttp_lwt_unix in let uri = Uri.of_string filename in let* resp, body = Client.get uri in let code = resp |> Response.status |> Code.code_of_status in if 200 <= code && code < 300 then Cohttp_lwt.Body.to_string body else Lwt.fail @@ HttpError (code, `GET, uri)) |> try_in return @@ function | HttpError (404, _, _) -> fail @@ `Error_file_doesnt_exist (at, filename) | exn -> fail @@ `Error_io (at, exn) else of_lwt (fun () -> let open Lwt.Syntax in let* channel = Lwt_io.open_file ~mode:Lwt_io.input filename in Lwt.finalize (fun () -> Lwt_io.read channel) (fun () -> Lwt_io.close channel)) |> try_in return @@ function | Unix.Unix_error (Unix.ENOENT, _, _) -> fail @@ `Error_file_doesnt_exist (at, filename) | exn -> error_io at exn (* *) let run_process_with_input at command input = of_lwt (fun () -> Lwt_process.with_process_out command @@ fun out -> let open Lwt.Syntax in let rec write_input = function | [] -> let* () = Lwt_io.flush out#stdin in Lwt_io.close out#stdin | line :: lines -> let* () = Lwt_io.write out#stdin line in write_input lines in let* () = write_input input in out#status) |> try_in (function | Unix.WEXITED 0 -> unit | Unix.WEXITED c -> error_io at @@ Failure ("Process exited with code " ^ Int.to_string c) | Unix.WSIGNALED s -> error_io at @@ Failure ("Process killed by signal " ^ Int.to_string s) | Unix.WSTOPPED s -> error_io at @@ Failure ("Process stopped by signal " ^ Int.to_string s)) (error_io at) let process filename = let at = FomSource.Loc.of_path (Sys.getcwd () ^ "/.") in let p = JsonString.of_utf8 filename in let env = FomToJsC.Env.empty ~fetch () in let cst = `Import (at, p) in let max_width = !Options.max_width in (let* ast, typ, paths = FomElab.elaborate cst |> replace_env env in (if !Options.stop = `Typ then ( typ |> FomAST.Typ.pp |> FomPP.to_string ~max_width |> Printf.printf "%s\n"; fail `Stop) else unit) >> let* js = (if !Options.whole then FomToJsC.whole_program_to_js else FomToJsC.modules_to_js) ast paths |> replace_env env in (if !Options.stop = `Js then ( js |> Printf.printf "%s\n"; fail `Stop) else unit) >> let* prelude = fetch at "docs/prelude.js" in run_process_with_input at ("node", [|"-"|]) [prelude; ";\n"; js]) |> try_in return @@ function | `Stop -> unit | #Error.t as error -> let message = let open FomPP in match Diagnostic.of_error error with | (loc, overview), [] -> gnest 2 (FomSource.Loc.pp loc ^^ colon_break_1_0 ^^ overview) |> to_string ~max_width | (loc, overview), details -> FomSource.Loc.pp loc ^^ colon ^^ gnest 2 (break_1_0 ^^ overview ^^ colon) ^^ nest 2 (break_0_0 ^^ (details |> List.map (fun (loc, msg) -> gnest 2 (FomSource.Loc.pp loc ^^ colon_break_1 ^^ msg)) |> separate break_0_0)) |> to_string ~max_width in Printf.printf "%s\n" message; exit 1 let doc msg default = " (default: " ^ default ^ ")\n\n " ^ msg ^ "\n" let () = let files = ref [] in Arg.parse [ ( "-max-width", Arg.Int (fun w -> if 20 <= w && w <= 200 then Options.max_width := w), doc "Set maximum width for various outputs." "80" ); ( "-stop", Arg.Symbol ( ["type"; "js"; "run"], function | "type" -> Options.stop := `Typ | "js" -> Options.stop := `Js | _ -> Options.stop := `Run ), doc "Stop after specified IL/output has been computed and output it." "run" ); ( "-whole", Arg.Bool (( := ) Options.whole), doc "Whole program compilation." "true" ); ] (fun file -> files := file :: !files) (Filename.basename Sys.executable_name ^ " [options] <file.fom>\n\nOptions:\n"); let p, r = Lwt.wait () in !files |> List.rev |> List.iter_fr process >>- (fun () -> Lwt.wakeup r ()) |> start (); Lwt_main.run p
high
0.526023
99,992
Function Edit-bConnectDynamicGroup() { <# .Synopsis Updates a existing DynamicGroup. .Parameter DynamicGroup Valid modified DynamicGroup .Outputs DynamicGroup (see bConnect documentation for more details). #> Param ( [Parameter(Mandatory=$true)][PSCustomObject]$DynamicGroup ) $_connectVersion = Get-bConnectVersion If($_connectVersion -ge "1.0") { If(Test-Guid $DynamicGroup.Id) { # bms2016r1 # We can not send the whole object because of not editable fields. # So we need to create a new one with editable fields only... # And as this might be too easy we face another problem: we are only allowed to send the changed fields :( # Dirty workaround: reload the object and compare new vs. old $_old_group = Get-bConnectDynamicGroup -DynamicGroup $DynamicGroup.Id $_old_group = ConvertTo-Hashtable $_old_group $_new_group = @{ Id = $DynamicGroup.Id } $_propertyList = @( "ParentId", "Name", "Statement", "Comment" ) $DynamicGroup = ConvertTo-Hashtable $DynamicGroup Foreach($_property in $_propertyList) { If($DynamicGroup[$_property] -ine $_old_group[$_property]) { $_new_group += @{ $_property = $DynamicGroup[$_property] } } } #Workaround for a bug in bConnect 2016r1 # we need to assign the property "Name" even if it is unchanged. # otherwise the controller returns an error... If($_new_group.Keys -notcontains "Name") { $_new_group += @{ "Name" = $DynamicGroup["Name"] } } return Invoke-bConnectPatch -Controller "DynamicGroups" -Version $_connectVersion -objectGuid $DynamicGroup.Id -Data $_new_group } else { return $false } } else { return $false } }
low
0.571319
99,993
namespace PaketLoadScripts #load "/home/justin/code/fsharp/GiraffeWebApp/GiraffeWebApp/.paket/load/net403/Newtonsoft.Json.fsx"
high
0.217972
99,994
---------------------------------------------------------------------------------- -- Company: -- Engineer: -- -- Create Date: 04/13/2018 10:36:07 PM -- Design Name: -- Module Name: adc_tb - Behavioral ---------------------------------------------------------------------------------- library IEEE; use IEEE.STD_LOGIC_1164.ALL; -- Uncomment the following library declaration if using -- arithmetic functions with Signed or Unsigned values --use IEEE.NUMERIC_STD.ALL; -- Uncomment the following library declaration if instantiating -- any Xilinx leaf cells in this code. --library UNISIM; --use UNISIM.VComponents.all; entity adc_tb is -- Port ( ); end adc_tb; architecture tb of adc_tb is component xadc_wiz_0 is port ( daddr_in : in STD_LOGIC_VECTOR (6 downto 0); -- Address bus for the dynamic reconfiguration port den_in : in STD_LOGIC; -- Enable Signal for the dynamic reconfiguration port di_in : in STD_LOGIC_VECTOR (15 downto 0); -- Input data bus for the dynamic reconfiguration port dwe_in : in STD_LOGIC; -- Write Enable for the dynamic reconfiguration port do_out : out STD_LOGIC_VECTOR (15 downto 0); -- Output data bus for dynamic reconfiguration port drdy_out : out STD_LOGIC; -- Data ready signal for the dynamic reconfiguration port dclk_in : in STD_LOGIC; -- Clock input for the dynamic reconfiguration port reset_in : in STD_LOGIC; -- Reset signal for the System Monitor control logic vauxp3 : in STD_LOGIC; -- Auxiliary Channel 5 vauxn3 : in STD_LOGIC; busy_out : out STD_LOGIC; -- ADC Busy signal channel_out : out STD_LOGIC_VECTOR (4 downto 0); -- Channel Selection Outputs eoc_out : out STD_LOGIC; -- End of Conversion Signal eos_out : out STD_LOGIC; -- End of Sequence Signal alarm_out : out STD_LOGIC; -- OR'ed output of all the Alarms vp_in : in STD_LOGIC; -- Dedicated Analog Input Pair vn_in : in STD_LOGIC ); end component; component psc is port ( clk_in: in std_logic; rst_n: in std_logic; sample: in std_logic_vector(8 downto 0); s_out : out STD_LOGIC; s_sync : out STD_LOGIC ); end component; component adc_interface is port ( clk_in: in std_logic; rst_n: in std_logic; eoc: in std_logic; den: out std_logic; drdy: in std_logic; daddr: out std_logic_vector(6 downto 0); dwe: out std_logic; dout: in std_logic_vector(15 downto 0); din: out std_logic_vector(15 downto 0); sample_out: out std_logic_vector(8 downto 0) ); end component; component spc is port ( clk_in: in std_logic; rst_n: in std_logic; s_in: in std_logic; s_sync: in std_logic; sample_out: out std_logic_vector(8 downto 0) ); end component; component pwm is port ( clk_in: in std_logic; rst_n: in std_logic; sample_in: in std_logic_vector(8 downto 0); pwm_out: out std_logic ); end component; signal daddr: std_logic_vector(6 downto 0); signal den: std_logic := '0'; signal di: std_logic_vector(15 downto 0); signal dwe: std_logic := '1'; signal do: std_logic_vector(15 downto 0); signal drdy: std_logic; signal dclk: std_logic := '0'; signal rst_n: std_logic; signal busy: std_logic; signal ch_mux: std_logic_vector(4 downto 0); signal eoc: std_logic; signal eos: std_logic; signal sample_read, sample_write: std_logic_vector(8 downto 0); signal sample_rdy: std_logic; signal golden_sig: std_logic; signal golden_sync: std_logic; signal pwm_out: std_logic; begin dclk <= not dclk after 5 ns; rst_n <= '0', '1' after 30 ns; psc0: psc port map ( clk_in => dclk, rst_n => rst_n, sample => sample_read, s_out => golden_sig, s_sync => golden_sync ); adc_interface0: adc_interface port map ( clk_in => dclk, rst_n => rst_n, eoc => eoc, den => den, drdy => drdy, daddr => daddr, dwe => dwe, dout => do, din => di, sample_out => sample_read ); spc0: spc port map ( clk_in => dclk, rst_n => rst_n, s_in => golden_sig, s_sync => golden_sync, sample_out => sample_write ); pwm0: pwm port map ( clk_in => dclk, rst_n => rst_n, sample_in => sample_write, pwm_out => pwm_out ); adc: xadc_wiz_0 port map ( daddr_in => daddr, --: in STD_LOGIC_VECTOR (6 downto 0); -- Address bus for the dynamic reconfiguration port den_in => den, --: in STD_LOGIC; -- Enable Signal for the dynamic reconfiguration port di_in => di, --: in STD_LOGIC_VECTOR (15 downto 0); -- Input data bus for the dynamic reconfiguration port dwe_in => dwe, --: in STD_LOGIC; -- Write Enable for the dynamic reconfiguration port do_out => do, --: out STD_LOGIC_VECTOR (15 downto 0); -- Output data bus for dynamic reconfiguration port drdy_out => drdy, --: out STD_LOGIC; -- Data ready signal for the dynamic reconfiguration port dclk_in => dclk, --: in STD_LOGIC; -- Clock input for the dynamic reconfiguration port reset_in => not rst_n, --: in STD_LOGIC; -- Reset signal for the System Monitor control logic vauxp3 => '0', --: in STD_LOGIC; -- Auxiliary Channel 5 vauxn3 => '0', --: in STD_LOGIC; busy_out => busy, --: out STD_LOGIC; -- ADC Busy signal channel_out => ch_mux, --: out STD_LOGIC_VECTOR (4 downto 0); -- Channel Selection Outputs eoc_out => eoc, --: out STD_LOGIC; -- End of Conversion Signal eos_out => eos, --: out STD_LOGIC; -- End of Sequence Signal alarm_out => open, --: out STD_LOGIC; -- OR'ed output of all the Alarms vp_in => '0', --: in STD_LOGIC; -- Dedicated Analog Input Pair vn_in => '0' --: in STD_LOGIC ); end;
medium
0.434247
99,995
;;; flx site-lisp configuration (add-to-list 'load-path "/usr/share/emacs/site-lisp/flx") (load "flx-autoloads" nil t)
low
0.961534
99,996
module Main -- Yeah, this is for windows only %lib chez "kernel32" %include chez "(display \"beep\")" beep : Int -> Int -> IO Int beep freq dur = foreign FFI_C "Beep" (Int -> Int -> IO Int) freq dur main : IO () main = do ok <- beep 1000 1000 print ok
high
0.244811
99,997
%include subfile-begin.tex \section{Problem} %if False \begin{code} module ACO.UCSP.Definitions where import Data.Set (Set) import qualified Data.Set as Set import Data.List (permutations) import Data.Typeable (Typeable) import Data.Function (on) \end{code} %endif \begin{figure}[h] \centering \fbox{\input{Graph.tikz}} \caption{Problem graph schematic, representing \textbf{G}roups, \textbf{D}isciplines, \textbf{T}ime/day, \textbf{P}rofessors, Class\textbf{R}ooms.} \label{fig:graph} \end{figure} \subsection{Classes} A \emph{class} is an event, that links together the following types of entities, denoted as \emph{roles}: \begin{enumerate} \item group-discipline pairs \item day/time \item professors \item classrooms \end{enumerate} Each of the roles must have a finite and non-empty domain, therefore ensuring finite number of unique permutations. \begin{figure}[h] \centering \input{Class.tikz} \caption{\emph{Class} structure.} \label{fig:class} \end{figure} \begin{code} -- Used as \textbf{kind} (see \emph{data type promotion}) data Role = Groups | DayTime | Professors | Classrooms deriving Typeable -- 'Role' kind container data Role' (r :: Role) = Role' deriving Typeable \end{code} \subsection{Graph Nodes} The problem graph nodes are \underline{different} \emph{permutations} of \emph{role domains}. They are grouped into \emph{layers}, depending on the corresponding \emph{role}. The nodes at some layer have exactly the same underlying size and it's the power of it's domain set. \begin{code} type family RoleValue (r :: Role) :: * newtype Node (r :: Role) = Node (String, [RoleValue r]) nodeId (Node (id,_)) = id instance Eq (Node r) where (==) = (==) `on` nodeId instance Ord (Node r) where compare = compare `on` nodeId -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- class HasDomain a v | a -> v where domain :: a -> Set v domainPower :: a -> Int type RoleDomain r = HasDomain (Role' r ) (RoleValue r) mkNodes :: RoleDomain r => String -> Role' r -> [Node r] mkNodes name = map Node . zip (map ((name ++) . show) [1..]) . permutations . Set.toList . domain \end{code} \subsubsection{Timetable} A \emph{timetable} holds schedule for one week, that repeats throughout the academic period. The \emph{timetable} is actually a table: the columns represent days of week; the rows --- discrete time intervals. Actual timetable structure may vary, as can be seen in figure \ref{fig:timetables}. \begin{figure}[h] \centering \begin{subfigure}{\textwidth} \centering \begin{tabular}{||c||c||c||c||c||c||c||} \hline ~ & Mon & Tue & Wed & Thu & Fri & Sat \\ \hline 08:30 -- 09:00 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline 09:00 -- 09:30 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline 09:30 -- 10:00 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline 10:00 -- 10:30 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline 10:30 -- 11:00 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline 11:00 -- 11:30 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline 11:30 -- 12:00 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline \vdots \qquad\quad \vdots & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline \end{tabular} \caption{Timetable without recesses.} \end{subfigure} \begin{subfigure}{\textwidth} \centering \begin{tabular}{||c||c||c||c||c||c||c||} \hline ~ & Mon & Tue & Wed & Thu & Fri & Sat \\ \hline 08:30 -- 09:10 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline 09:15 -- 09:55 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline 10:05 -- 10:45 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline 10:50 -- 11:30 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline 11:40 -- 12:20 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline 12:25 -- 13:05 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline 13:15 -- 13:55 & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline \vdots \qquad\quad \vdots & ~ & ~ & ~ & ~ & ~ & ~ \\ \hline \end{tabular} \caption{Timetable with recesses.} \end{subfigure} \caption{Possible \emph{timetable} structures. } \label{fig:timetables} \end{figure} \begin{code} class (Eq t, Ord t, Enum t, Bounded t) => DiscreteTime t where timeQuantum :: t -> Int toMinutes :: t -> Int fromMinutes :: Int -> Maybe t class (DiscreteTime t, Enum d, Bounded d) => Timetable tt t d ev | tt -> t , tt -> d , tt -> ev where listEvents :: tt -> [((d,t), ev)] newTTable :: [((d,t), ev)] -> tt eventsOn :: tt -> d -> [(t,ev)] eventsAt :: tt -> t -> [(d,ev)] eventAt :: tt -> d -> t -> Maybe ev \end{code} \subsection{Graph Edges} The edges are possible routes, that can be taken by an ``ant''. They connect nodes, belonging to \emph{different layers}. \begin{align*} \forall & a \in \mathrm{Layer}_A \\ \forall & b \in \mathrm{Layer}_B \\ &\mbox {if } \mathrm{Layer}_A \text{ and } \mathrm{Layer}_B \text{ are neighbors} \\ &\quad \exists \text{ an edge between } a \text{ and } b. \end{align*} A selection of some sub-route, connecting some nodes $A_i$ and $B_j$ (from some layers $A$ and $B$) means that the ant ``proposes'' a (partial) solution, that is described by the nodes' underlying values. The ``ant'' agent must be capable of selecting exactly one node of each role. The selection order doesn't matter. \medskip\noindent A complete route (through all the layers) describes a \emph{solution candidate}: some schedule, that holds a list of \emph{classes}. \begin{figure}[h] \centering \input{Route.tikz} \caption{\emph{Route} decomposition.} \label{fig:route} \end{figure} \section{Formalization} \label{sec:formal} Let's denote \begin{itemize}[leftmargin=2cm] \item[$N_G$ ---] number of groups; \item[$N_P$ ---] number of professors; \item[$N_R$ ---] number of classrooms; \item[$N_D$ ---] number of disciplines; \item[$N_T$ ---] number of \emph{time periods} per week:\\ $\mathrm{number~of} \mathit{~time~periods} \mathrm{~per~day} \times \mathrm{number~of} \mathit{~days}$; \item[$N_d^g$ ---] number of \emph{time periods} of discipline $d$, assigned for group $g$; \\ \item[$G =$] $\lbrace g_i \rbrace_{i=1}^{N_G}$ --- set of groups; \item[$D =$] $\lbrace d_i \rbrace_{i=1}^{N_D}$ --- set of disciplines; \item[$P =$] $\lbrace p_i \rbrace_{i=1}^{N_P}$ --- set of professors; \item[$R =$] $\lbrace r_i \rbrace_{i=1}^{N_R}$ --- set of classrooms; \\ \item[$D_g =$] $\lbrace d ~||~ N_d^g \not= 0 \rbrace_{d \in D}$ --- set of disciplines, assigned to group $g$; \item[$N_\Sigma =$] $\sum\limits_{g \in G}~\sum\limits_{d \in D_g} N_d^g$ --- total number of classes time periods per week. \end{itemize} \subsection{Problem Dimensions} \subsubsection{Groups and Disciplines} Let $G'$ be a list of pairs $\langle\mathrm{group},\mathrm{discipline}\rangle$ of length $N_\Sigma$, such that $\forall \langle g,d \rangle \in G' \implies \mathrm{count}_{G'}(\langle g,d \rangle) = N_d^g$. There are $N_\Sigma!$ unique permutations. % Let $G'$ be a list of groups of length $N_\Sigma$, % such that $$ \forall g \in G' \implies \mathrm{count}(g) = % \sum\limits_{d \in D} N_d^g $$ % Unique groups permutations: % \begin{align*} % & \mathlarger{\prod}\limits_{i=1}^{N_G} \dbinom{ N_G - \sum\limits_{j=1}^{i-1} n_j }{n_i} \\ % = & \binom{N}{n_1} \binom{N-n_1}{n_2} \binom{N-n_1-n_2}{n_3}\dots % \binom{N-n_1-\dots-n_{N-1}}{n_N} % \end{align*} % \qquad where $n_i = \sum\limits_{d \in D} N_d^{g_i}$. \subsubsection{Professors and Classrooms} With no optimization applied, exists $\dbinom{N_\Sigma + N - 1}{N_\Sigma - 1}$ (combinations with repetitions), where $N=N_P$ or $N_R$. Some invalid instances can be discarded, such that, for example, don't have enough professors capable of teaching some discipline; or classrooms configurations that won't fit all the students etc. \subsubsection{Day and Time} In general case, any day and time may be assigned for any class period, including repetitions, that yields $\dbinom{N_\Sigma + N_T - 1}{N_\Sigma - 1}$ possible combinations. This number may be diminished by \begin{itemize} \item joining class periods; \item requiring a minimum entropy. \end{itemize} \crule{0.75} \bigskip\noindent Total combinations (worst case): \begin{equation} \label{eq:totalN} \dbinom{N_\Sigma + N_P - 1}{N_\Sigma - 1} \dbinom{N_\Sigma + N_R - 1}{N_\Sigma - 1} \dbinom{N_\Sigma + N_T - 1}{N_\Sigma - 1} N_\Sigma! \end{equation} \subsection{Assessing Candidates} \begin{equation} \label{eq:eta} \eta = \eta( \lbrace r_i \rbrace_{i=1}^{n-1}, r_n ) = \begin{cases} 0 & \mbox{if } \text{any restriction is broken} \\ \mathrm{pref}(\lbrace r_i \rbrace_{i=1}^n) & \mbox{otherwise} \end{cases} \end{equation} \qquad where $r_i$ is some some sub-route. \subsubsection{Restrictions} There are two kinds of restrictions: over \emph{time} and over \emph{capabilities.} Time restriction require the schedule to be \emph{time consistent}: no group, professor and classroom can have two different classes, assigned at the same day/time. The capabilities represent: \begin{itemize}[leftmargin=3.5cm] \item[Group:] Disciplines needed (searched). \item[Professors:] Known disciplines (that can be taught). \item[Classrooms:] Special requirements (labs etc.); students capacity. \end{itemize} \emph{Note: group capabilities are incorporated into nodes generation.} \subsubsection{Preferences} Preferences create an order over \emph{valid candidates}, that permits the algorithm to optimize them. The preferences might vary for each entity (group, professor, classroom), but they all must have a form of function: $$ \mathrm{pref'}[E] : \langle \mathrm{discipline},\mathrm{day/time} \rangle \mapsto [0,1]$$ The preference value for a \emph{complete route}: $$\mathrm{pref}(r) = \dfrac{\mathrm{pref'}[G](r) + \mathrm{pref'}[P](r) + \mathrm{pref'}[R](r)} {3}$$ %include subfile-end.tex %%% Local Variables: %%% latex-build-command: "lhsTeX" %%% lhs-build-standalone-flag: t %%% eval: (haskell-indentation-mode) %%% eval: (interactive-haskell-mode) %%% End:
high
0.150094
99,998
{ "isDnd": false, "volume": 1.0, "parentRoom": null, "views": [ {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, ], "layers": [ {"instances":[ {"properties":[],"isDnd":false,"objectId":{"name":"obj_example","path":"objects/obj_example/obj_example.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":32.0,"y":32.0,"resourceVersion":"1.0","name":"inst_565241C2","tags":[],"resourceType":"GMRInstance",}, ],"visible":true,"depth":0,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"Instances","tags":[],"resourceType":"GMRInstanceLayer",}, {"spriteId":null,"colour":4278190080,"x":0,"y":0,"htiled":false,"vtiled":false,"hspeed":0.0,"vspeed":0.0,"stretch":false,"animationFPS":15.0,"animationSpeedType":0,"userdefinedAnimFPS":false,"visible":true,"depth":100,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"Background","tags":[],"resourceType":"GMRBackgroundLayer",}, ], "inheritLayers": false, "creationCodeFile": "", "inheritCode": false, "instanceCreationOrder": [ {"name":"inst_565241C2","path":"rooms/rm_example/rm_example.yy",}, ], "inheritCreationOrder": false, "sequenceId": null, "roomSettings": { "inheritRoomSettings": false, "Width": 1366, "Height": 768, "persistent": false, }, "viewSettings": { "inheritViewSettings": false, "enableViews": false, "clearViewBackground": false, "clearDisplayBuffer": true, }, "physicsSettings": { "inheritPhysicsSettings": false, "PhysicsWorld": false, "PhysicsWorldGravityX": 0.0, "PhysicsWorldGravityY": 10.0, "PhysicsWorldPixToMetres": 0.1, }, "parent": { "name": "Rooms", "path": "folders/Rooms.yy", }, "resourceVersion": "1.0", "name": "rm_example", "tags": [], "resourceType": "GMRoom", }
low
0.423401
99,999