text
stringlengths
31
1.04M
* Encoding: UTF-8. file handle data /name="c:/cc/misc2/extensions/r/stats_bayes_anova/tests". get file="data/puzzles.sav". dataset name puzzles. stats bayes anova dependent=RT indepfixed=shape color indeprandom=ID. stats bayes anova dependent=RT indepfixed=shape color indeprandom=ID /options comparison=8. stats bayes anova dependent=RT indepfixed=shape color indeprandom=ID /options posteriorindex=3 omitposteriorrandom=yes. stats bayes anova dependent=RT indepfixed=shape color indeprandom=ID /options posteriorindex=3 omitposteriorrandom=no. stats bayes anova dependent=RT indepfixed=shape color indeprandom=ID /options posteriorindex=5. stats bayes anova dependent=RT indepfixed=shape color indeprandom=ID /options posteriorindex=3 OMITPOSTERIORRANDOM=NO. STATS BAYES ANOVA DEPENDENT=salary INDEPFIXED=gender jobcat MODELS=ALLWITHMAIN /OPTIONS POSTERIORINDEX=3 OMITPOSTERIORRANDOM=YES PRIORSCALEFIXED="MEDIUM" PRIORSCALERANDOM="MEDIUM" /SAVE WORKSPACE=CLEAR. STATS BAYES ANOVA DEPENDENT=salary INDEPFIXED=gender jobcat MODELS=ALLWITHMAIN /OPTIONS COMPARISON=3 POSTERIORINDEX=3 OMITPOSTERIORRANDOM=YES OMITPOSTERIORRANDOM=YES ITERATIONS=1000 PLOTMODELS=NO PRIORSCALEFIXED="MEDIUM" PRIORSCALERANDOM="MEDIUM" /SAVE WORKSPACE=CLEAR. STATS BAYES ANOVA DEPENDENT=salary INDEPFIXED=gender jobcat MODELS=ALLWITHMAIN /OPTIONS COMPARISON=3 OMITPOSTERIORRANDOM=YES ITERATIONS=1000 PLOTMODELS=NO PRIORSCALEFIXED="MEDIUM" PRIORSCALERANDOM="MEDIUM" /SAVE WORKSPACE=CLEAR. STATS BAYES ANOVA DEPENDENT=salary INDEPFIXED=gender jobcat MODELS=ALLWITHMAIN /OPTIONS COMPARISON=3 OMITPOSTERIORRANDOM=YES ITERATIONS=1000 PLOTMODELS=NO PRIORSCALEFIXED="MEDIUM" PRIORSCALERANDOM="MEDIUM" /SAVE WORKSPACE=CLEAR. STATS BAYES ANOVA DEPENDENT=salary MODELS=ALLWITHMAIN /OPTIONS COMPARISON=3 OMITPOSTERIORRANDOM=YES ITERATIONS=1000 PLOTMODELS=NO PRIORSCALEFIXED="MEDIUM" PRIORSCALERANDOM="MEDIUM" /SAVE WORKSPACE=CLEAR. STATS BAYES ANOVA DEPENDENT=salary INDEPRANDOM=jobcat MODELS=ALLWITHMAIN /OPTIONS COMPARISON=3 OMITPOSTERIORRANDOM=YES ITERATIONS=1000 PLOTMODELS=NO PRIORSCALEFIXED="MEDIUM" PRIORSCALERANDOM="MEDIUM" /SAVE WORKSPACE=CLEAR. STATS BAYES ANOVA DEPENDENT=salary INDEPFIXED=gender educ minority INDEPRANDOM=jobcat gender MODELS=STEPUP /OPTIONS COMPARISON=3 OMITPOSTERIORRANDOM=YES ITERATIONS=1000 PLOTMODELS=NO PRIORSCALEFIXED="MEDIUM" PRIORSCALERANDOM="MEDIUM" /SAVE WORKSPACE=CLEAR. STATS BAYES ANOVA DEPENDENT=salary INDEPFIXED=gender educ minority INDEPRANDOM=jobcat MODELS=STEPUP /OPTIONS COMPARISON=3 OMITPOSTERIORRANDOM=YES ITERATIONS=1000 PLOTMODELS=NO PRIORSCALEFIXED="MEDIUM" PRIORSCALERANDOM="MEDIUM" /SAVE WORKSPACE=CLEAR. string g(a1). compute g = gender. compute mu=minority. variable level mu(nominal). STATS BAYES ANOVA DEPENDENT=salary INDEPFIXED=g mu INDEPRANDOM=jobcat MODELS=STEPDOWN /OPTIONS POSTERIORINDEX=3 OMITPOSTERIORRANDOM=NO ITERATIONS=1000 PLOTMODELS=NO PRIORSCALEFIXED="WIDE" PRIORSCALERANDOM="WIDE" /SAVE WORKSPACE=CLEAR. compute sig2=minority. variable level sig2(nominal). STATS BAYES ANOVA DEPENDENT=salary INDEPFIXED=g sig2 INDEPRANDOM=jobcat MODELS=STEPDOWN /OPTIONS POSTERIORINDEX=3 OMITPOSTERIORRANDOM=NO ITERATIONS=1000 PLOTMODELS=NO PRIORSCALEFIXED="WIDE" PRIORSCALERANDOM="WIDE" /SAVE WORKSPACE=CLEAR. STATS BAYES ANOVA DEPENDENT=salary INDEPFIXED=gender minority jobcat MODELS=ALLWITHMAIN /OPTIONS POSTERIORINDEX=3 OMITPOSTERIORRANDOM=NO ITERATIONS=1000 PLOTMODELS=NO PRIORSCALEFIXED="WIDE" PRIORSCALERANDOM="WIDE" /SAVE WORKSPACE=CLEAR. DATASET ACTIVATE puzzles. STATS BAYES ANOVA DEPENDENT=RT INDEPFIXED=color shape INDEPRANDOM=ID MODELS=ALLWITHMAIN /OPTIONS ITERATIONS=1000 PLOTMODELS=NO PRIORSCALEFIXED="MEDIUM" PRIORSCALERANDOM="MEDIUM" BAYESFACTORITERATIONS=20000 /SAVE WORKSPACE=CLEAR.
### # Author: Dave Long <dlong@cagedata.com> # Uses Autoruns from Sysinternals to get all automatically running programs on PCs. # Also tests autoruns against Virtus Total and shows how many AV programs detect # each autorun as a virus. # # Running assumes acceptance of the Sysinternals and Virus Total licenses. ### $AutorunsUrl = "https://download.sysinternals.com/files/Autoruns.zip" $AutorunsOut = Join-Path $env:TEMP "Autoruns.zip" $Autoruns = Join-Path $env:TEMP "Autoruns" $OutputFile = Join-Path $Autoruns "autoruns.csv" Invoke-WebRequest -Uri $AutorunsUrl -OutFile $AutorunsOut Expand-Archive -Path $AutorunsOut -DestinationPath $Autoruns Start-Process -Wait -FilePath $Autoruns/autorunsc.exe -NoNewWindow -PassThru -ArgumentList @("-v", "-vt", "-c", "-o $OutputFile") Import-Csv -Path $OutputFile Write-Host "Complete Autoruns output stored at $OutputFile"
# bellamall ## Project setup ``` npm install ``` ### Compiles and hot-reloads for development ``` npm run serve ``` ### Compiles and minifies for production ``` npm run build ``` ### Lints and fixes files ``` npm run lint ``` ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/).
package kotlinx.cli class CommandLineException(message: String) : RuntimeException(message) open class StopParsingException : RuntimeException() class HelpPrintedException : StopParsingException() class MissingArgumentException : RuntimeException() fun stopParsing() { throw StopParsingException() }
mxnet.symbol.Symbol.get\_children ================================= .. currentmodule:: mxnet.symbol .. automethod:: Symbol.get_children
#!/bin/bash set -ex section "load_demo_data" make run & sleep 5 && make load_demo_data kill %1 section_end "load_demo_data" section "Tests" make log & make ${TEST_TARGET} section_end "Tests" section "Build.docs" make docs section_end "Build.docs"
global frontApp, frontAppName, windowTitle, windowURL set windowTitle to "" set windowURL to "null" tell application "System Events" set frontApp to first application process whose frontmost is true set frontAppName to name of frontApp if frontAppName is "Google Chrome" then tell application "Google Chrome" set windowURL to URL of active tab of front window set windowTitle to title of active tab of front window end tell else tell frontApp tell (1st window whose value of attribute "AXMain" is true) set windowTitle to value of attribute "AXTitle" end tell end tell end if end tell return {frontAppName, windowTitle, windowURL}
<?php class NewhouseBindingSpuBrokerRequest { private $apiParas = array(); public function getApiMethodName(){ return "jingdong.newhouse.bindingSpuBroker"; } public function getApiParas(){ return json_encode($this->apiParas); } public function check(){ } public function putOtherTextParam($key, $value){ $this->apiParas[$key] = $value; $this->$key = $value; } private $v1; public function setV1($v1 ){ $this->v1=$v1; $this->apiParas["v1"] = $v1; } public function getV1(){ return $this->v1; } private $channelId; public function setChannelId($channelId){ $this->channelId = $channelId; $this->apiParas["channelId"] = $channelId; } public function getChannelId(){ return $this->channelId; } private $spuId; public function setSpuId($spuId){ $this->spuId = $spuId; $this->apiParas["spuId"] = $spuId; } public function getSpuId(){ return $this->spuId; } }
/* executechangeset_tc11.sas */ /**************** GLOBALS ****************/ /**************** INPUT TABLES ****************/ /**************** EXPECTED TABLES ****************/ DATA EXPECTED.databasechangelog; order_executed=1; OUTPUT; RUN;
# 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/kali/Dev_Ops_Final/Stalker/Stalker" set _OLD_VIRTUAL_PATH="$PATH" setenv PATH "$VIRTUAL_ENV/bin:$PATH" set _OLD_VIRTUAL_PROMPT="$prompt" if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then set prompt = "(Stalker) $prompt" endif alias pydoc python -m pydoc rehash
# User Interface {#ui} The user interface consists of a single ruler that can be displayed either horizontally or vertically. ```{r, echo=FALSE, fig.cap="The ruler user interface."} knitr::include_graphics("images/ruler.png") ``` Holding down the primary mouse button on the ruler will allow you to drag the ruler around the screen. Pressing the secondary mouse button on the ruler will display a context menu called the *Ruler Menu*. If the mouse cursor moves past the right or bottom edge of the ruler, it will automatically extend. The ruler will stay extended if the cursor is frozen or if a Guideline has been set beyond the default size. Guidelines are covered in further detail in the [Guidelines](\#guidelines) section. > The primary mouse button is determined by the *Select your primary button* option in the *Mouse Settings* in Microsoft Windows. > Typically it is the left mouse button. ## Rotating the ruler {#rotate} The ruler can be rotated using the `Ctrl + Shift + Alt + R` key combination or by the `Ruler Menu → Rotate` menu item. This is assignable to a mouse button click via the `Rotate` function. It is not possible to have both a vertical and a horizontal ruler displayed at the same time. When rotating the ruler, the axis changes but any [Guidelines](\#guidelines) are kept in the same position. ## Flipping the ruler {#flip} ```{r, echo=FALSE, fig.cap="The horizontal ruler flipped in both directions."} knitr::include_graphics("images/ruler-flipped.png") ``` The hatch marks on the ruler can be flipped to be displayed on the opposite side of the ruler. This is done by pressing the `Ctrl + Shift + Alt + E` key combination or by the `Ruler Menu → Flip Direction` menu item. This is assignable to a mouse button click via the `Flip` function. ## Shifting to the cursor {#shifttocursor} The ruler can be shifted to the cursor position using the `Ctrl + Shift + Alt + S` key combination. This will shift the ruler along its current axis and position the 0 on the ruler to the cursor position. Holding down the key will continuously shift the ruler to the cursor position. ## Freezing the Cursor {#freeze} You can freeze the cursor on the ruler so that it does not move with the mouse. This is done by pressing the `Ctrl + Shift + Alt + F` key combination. ## Exiting the software {#exit} Exit the software by pressing the `Ctrl + Shift + Alt + X` key combination or via the `Ruler Menu → Exit` menu item. ## Accessing this help {#help} You can access this help guide by pressing `F1` when the ruler is focused or vua the `Ruler Menu → Help` menu item.
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="UTF-8"%> <%@ page import="java.util.*"%> <%@ page import="conexion.ConexionDaoJDBC"%> <%@ page import="com.mezcales.parroquia.modelo.Producto"%> <!doctype html> <html class="no-js" lang="en"> <head> <!-- anexeo para cache --> <meta http-equiv="Expires" content="0"> <meta http-equiv="Last-Modified" content="0"> <meta http-equiv="Cache-Control" content="no-cache, mustrevalidate"> <meta http-equiv="Pragma" content="no-cache"> <!-- fin anexo --> <meta charset="utf-8"> <title>Mezcales La Parroquia</title> <jsp:include page="/jsp/Comunes/Estilos.jsp" /> </head> <body> <div class="super_container"> <!-- Header --> <header class="header trans_300"> <!-- Navegacion Superior --> <jsp:include page="/jsp/Comunes/NavSuperior.jsp" /> <!-- Login --> <jsp:include page="/jsp/Comunes/Login.jsp" /> <!-- Registro --> <jsp:include page="/jsp/Comunes/Registro.jsp" /> <!-- Main Navigation --> <jsp:include page="/jsp/Comunes/MainNav.jsp" /> </header> <div class="fs_menu_overlay"></div> <!-- Navegador Movil --> <jsp:include page="/jsp/Comunes/NavMovil.jsp" /> <!-- Slider --> <div class="main_slider" style="background-image: url(images/slider_Mezcales.jpg)"> <div class="container fill_height"> <div class="row align-items-center fill_height"> <div class="col"> <div class="main_slider_content"> <h6></h6> <h1></h1> <div class="red_button shop_now_button"> <a href="Controlador?accion=tienda">Comprar</a> </div> </div> </div> </div> </div> </div> <!-- Banner --> <jsp:include page="/jsp/Comunes/Banner.jsp" /> <!-- Tienda --> <c:forEach var="pro" items="${productos}"> <c:set var="producto" value="${pro.getCategoria()}" /> <c:if test="${fn:containsIgnoreCase(producto, 'promo')}"> <div class="deal_ofthe_week"> <div class="container"> <div class="row align-items-center"> <div class="col-lg-6"> <div class="deal_ofthe_week_img"> <img src="ControladorIMG?id=${pro.getId()}" alt=""> </div> </div> <div class="col-lg-6 text-right deal_ofthe_week_col"> <div class="deal_ofthe_week_content d-flex flex-column align-items-center float-right"> <div class="section_title"> <h2>${pro.getNombres()}</h2> </div> <ul class="timer"> <li class="d-inline-flex flex-column justify-content-center align-items-center"> <div id="day" class="timer_num">03</div> <div class="timer_unit">Dia</div> </li> <li class="d-inline-flex flex-column justify-content-center align-items-center"> <div id="hour" class="timer_num">15</div> <div class="timer_unit">Hora</div> </li> <li class="d-inline-flex flex-column justify-content-center align-items-center"> <div id="minute" class="timer_num">45</div> <div class="timer_unit">Minutos</div> </li> <li class="d-inline-flex flex-column justify-content-center align-items-center"> <div id="second" class="timer_num">23</div> <div class="timer_unit">Segundos</div> </li> </ul> <div class="red_button deal_ofthe_week_button"> <a href="Controlador?accion=Comprar&id=${pro.getId()}">Comprar Ahora</a> </div> </div> </div> </div> </div> </div> </c:if> </c:forEach> <!-- Best Sellers --> <jsp:include page="/jsp/Comunes/PieDePaginaInicio.jsp" /> <!-- Scrips --> <jsp:include page="/jsp/Comunes/Scripts.jsp" /> </body> </html>
\begin{code} {-# LANGUAGE UnicodeSyntax #-} {-# LANGUAGE OverloadedStrings #-} module Scotty where import Prelude.Unicode import Web.Scotty import Web.Scotty.Internal.Types (ActionT(..)) import Control.Monad (liftM) import Control.Monad.Trans.Class import Control.Monad.Trans.Except import Control.Monad.Trans.Reader \end{code} \begin{code} main ∷ IO () main = scotty 3000 $ do get "/:word" $ do beam <- param "word" (ActionT . (ExceptT . fmap Right) . ReaderT . const m . lift) $ putStrLn "hello" html $ mconcat ["<h1>Scotty, ", beam, " me up!</h1>"] \end{code}
(print (+ 1 2)) (print (+ 1 2 3)) (print (+ 1.2 2.5)) (print (+ 1.3 2.2 3.5))
; uint16_t fzx_string_extent_callee(struct fzx_font *ff, char *s) SECTION code_font SECTION code_font_fzx PUBLIC _fzx_string_extent_callee EXTERN asm_fzx_string_extent _fzx_string_extent_callee: pop af pop hl pop de push af jp asm_fzx_string_extent
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <flex-config> <include-classes> <xsl:apply-templates select="node()|@*" /> </include-classes> </flex-config> </xsl:template> <xsl:template match="node()|@*"> <xsl:apply-templates select="node()|@*" /> </xsl:template> <xsl:template match="classEntry/@path"> <class> <xsl:value-of select="." /> </class> </xsl:template> </xsl:stylesheet>
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import "client_runtime.proto"; import "evaluator_runtime.proto"; import "reef_service_protos.proto"; import "evaluator_shim.proto"; option java_package = "org.apache.reef.proto"; option java_generic_services = true; option java_generate_equals_and_hash = true; option java_outer_classname = "REEFProtocol"; message REEFMessage { // Field 1 removed // Messages defined in client_runtime.proto optional JobControlProto jobControl = 2; // Messages defined in reef_service_protos.proto optional RuntimeErrorProto runtimeError = 3; optional JobStatusProto jobStatus = 4; // Messages from evaluator_runtime.proto optional EvaluatorControlProto evaluatorControl = 5; optional EvaluatorHeartbeatProto evaluatorHeartBeat = 6; optional EvaluatorShimControlProto evaluatorShimCommand = 7; // Messages from evaluator_shim.proto optional EvaluatorShimStatusProto evaluatorShimStatus = 8; }
; A201471: Maximal diameter of a connected n-gamma_t-vertex-critical graph. ; 3,4,6,7,9,11,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201 mul $0,6 mov $2,6 lpb $2 add $2,$0 div $2,7 sub $2,$3 add $3,3 lpe trn $0,$3 div $0,3 add $0,3
local Model = {} function Model.__index(t, k) local var = rawget(Model, k) if var ~= nil then return var end end function Model.New() local inst = {} setmetatable(inst, Model) inst:ctor() return inst end function Model:ctor() self.pointArr = {} self.patchArr2 = {} self.transform = FourFourMatrix.New() self.rotation = Quaternion.New() self.anchor = Vector3.New() end function Model:LoadTeapod(width, height) self:ParsePointArrFromFile("teapot") self:ParsePatchArrFromFile("teapotBezierPatches") self:SetScale(Vector3.New(60, 60, 60)) self:SetColor(Color.New(1, 1, 1, 0.7)) self:ProcessBezierHandle() -- self:ProcessBezierHandleSimple() end function Model:ParsePointArrFromFile(fileName) local pointArr = {} local file = io.open(fileName, "r") for line in file:lines() do local lineStrArr = line:split(",") local point = Vector3.New(tonumber(lineStrArr[1]), tonumber(lineStrArr[2]), tonumber(lineStrArr[3])) table.insert(pointArr, point) end file:close() self:SetPointArr(pointArr) end function Model:ParsePatchArrFromFile(pathFileName) local indexArr2 = {} local file = io.open(pathFileName, "r") local lineCount = 1 for line in file:lines() do if (not line:startswith("#")) then local arr = {} indexArr2[lineCount] = arr local sinegleSpaceLine = line:gsub("%s+", " ") local lineStrArr = sinegleSpaceLine:split(" ") for i = 2, 17 do table.insert(arr, tonumber(lineStrArr[i])) end lineCount = lineCount + 1 end end file:close() self.patchArr2 = indexArr2 end -- 把贝塞尔模型变为简单网格 function Model:ProcessBezierHandleSimple() local patchArr2 = self:GetPatchArr2() local controlV3Arr = self:GetPointArr() self.processedPointArr = {} -- 把巴塞尔控制点给去掉, 只留下16个里面的四角锚点, 分别为顶点1,4,13,16 for _, patchArr in ipairs(patchArr2) do table.insert(self.processedPointArr, controlV3Arr[patchArr[1]]) table.insert(self.processedPointArr, controlV3Arr[patchArr[4]]) table.insert(self.processedPointArr, controlV3Arr[patchArr[13]]) table.insert(self.processedPointArr, controlV3Arr[patchArr[4]]) table.insert(self.processedPointArr, controlV3Arr[patchArr[13]]) table.insert(self.processedPointArr, controlV3Arr[patchArr[16]]) end end local function BezierFunc(v3Arr, progress) if (progress > 1) then progress = 1 end local progressComplement = 1 - progress local w1 = math.pow(progressComplement, 3) local w2 = 3 * progress * math.pow(progressComplement, 2) local w3 = 3 * math.pow(progress, 2) * progressComplement local w4 = math.pow(progress, 3) return v3Arr[1] * w1 + v3Arr[2] * w2 + v3Arr[3] * w3 + v3Arr[4] * w4 end local function BezierPatch(controlV3Arr, u, v) local v3secondLayerArr = {} for i = 0, 3 do local v3Arr = {controlV3Arr[i * 4 + 1], controlV3Arr[i * 4 + 2], controlV3Arr[i * 4 + 3], controlV3Arr[i * 4 + 4]} table.insert(v3secondLayerArr, BezierFunc(v3Arr, u)) end return BezierFunc(v3secondLayerArr, v) end -- 通过贝塞尔取间获取网格 function Model:ProcessBezierHandle(subDivNum) if (not subDivNum) then subDivNum = 2 end local patchArr2 = self:GetPatchArr2() local controlV3Arr = self:GetPointArr() self.processedPointArr = {} for _, patchArr in ipairs(patchArr2) do local patchV3Arr = table.map(patchArr, function(i) return controlV3Arr[i] end) local processedPatchArr2 = {} local subDivNumP1 = subDivNum for i = 0, subDivNumP1 do local patchResV3Arr = {} table.insert(processedPatchArr2, patchResV3Arr) for j = 0, subDivNumP1 do table.insert(patchResV3Arr, BezierPatch(patchV3Arr, j / subDivNumP1, i / subDivNumP1)) end end for i = 1, subDivNum do for j = 1, subDivNum do table.insert(self.processedPointArr, processedPatchArr2[i][j]) table.insert(self.processedPointArr, processedPatchArr2[i][j + 1]) table.insert(self.processedPointArr, processedPatchArr2[i + 1][j]) table.insert(self.processedPointArr, processedPatchArr2[i][j + 1]) table.insert(self.processedPointArr, processedPatchArr2[i + 1][j + 1]) table.insert(self.processedPointArr, processedPatchArr2[i + 1][j]) end end end end function Model:SetPointArr(pointArr) self.pointArr = pointArr if (#pointArr <= 0) then return end -- 设置默认锚点 local sumX, sumY, sumZ = 0, 0, 0 for _, v3 in ipairs(pointArr) do sumX = sumX + v3.x sumY = sumY + v3.y sumZ = sumZ + v3.z end local count = #pointArr self.anchor = Vector3.New(sumX / count, sumY / count, sumZ / count) end function Model:GetPointArr() return self.pointArr end function Model:GetProcessedPointArr() return self.processedPointArr end function Model:GetWorldPointArr() if (self.worldPointAfterRotationArr) then return self.worldPointAfterRotationArr end self:UpdateWorldPointTransform() self:UpdateWorldPointRotation() return self.worldPointAfterRotationArr end function Model:UpdateWorldPointRotation() if (self.worldPointAfterRotationArr) then return self.worldPointAfterRotationArr end self.worldPointAfterRotationArr = {} if (not self.worldPointAfterTransformArr) then return end local quat = self:GetRotation() local worldAnchor = self.worldAnchor or Vector3.New() for index, v3 in ipairs(self.worldPointAfterTransformArr) do self.worldPointAfterRotationArr[index] = quat * (v3 - worldAnchor) + worldAnchor end end function Model:UpdateWorldPointTransform() if (self.worldPointAfterTransformArr) then return self.worldPointAfterTransformArr end self.worldPointAfterTransformArr = {} local modelPointArr = Util:TableCopy(self:GetProcessedPointArr()) local transform = self:GetTransform() for _, v3 in ipairs(modelPointArr) do table.insert(self.worldPointAfterTransformArr, transform * v3) end self.worldAnchor = transform * (self.anchor or Vector3.New()) end function Model:InvalidTransformCache() self.worldPointAfterTransformArr = nil self.worldPointAfterRotationArr = nil end function Model:InvalidRotationCache() self.worldPointAfterRotationArr = nil end function Model:GetPatchArr2() return self.patchArr2 end function Model:SetAnchor(v3) self.anchor = v3 end function Model:GetAnchor() return self.anchor end function Model:SetColor(color) self.color = color end function Model:GetColor() return self.color end function Model:SetPosition(v3) self.transform:SetTranslation(v3) self:InvalidTransformCache() end function Model:SetScale(v3) self.transform:SetScale(v3) self:InvalidTransformCache() end function Model:GetTransform() return self.transform end function Model:SetRotation(v3) self.rotation:SetByEuler(v3) self:InvalidRotationCache() end function Model:SetRotationByQuaternion(q) self.rotation = q self:InvalidRotationCache() end function Model:GetRotation() return self.rotation end return Model
%File: ~/OOP/analysis/integrator/DisplacementControl.tex %What: "@(#) DisplacementControl.tex, revA" \noindent {\bf Files} \\ \indent \#include $<\tilde{ }$/analysis/integrator/DisplacementControl.h$>$ \\ UNDER CONSTRUCTION.\\ \noindent {\bf Class Declaration} \\ \indent class DisplacementControl: public StaticIntegrator \\ \noindent {\bf Class Hierarchy} \\ \indent MovableObject \\ \indent\indent Integrator \\ \indent\indent\indent IncrementalIntegrator \\ \indent\indent\indent\indent StaticIntegrator \\ \indent\indent\indent\indent\indent {\bf DisplacementControl} \\ \noindent {\bf Description} \\ \indent DisplacementControl is a subclass of StaticIntegrator, it is used to when performing a static analysis on the FE\_Model using the displacement control method. In the displacement control method the displacement at a specified degree-of-freedom Uc is specified for each iteration. The following constraint equation is added to equation~\ref{staticFormTaylor} of the StaticIntegrator class: \[ Uc_n^{(i)} - Uc_{n-1} = \delta Uc_n \] \noindent where $\delta Uc_n$ depends on $\delta Uc_{n-1}$, the displacement increment at the previous time step, $J_{n-1}$, the number of iterations required to achieve convergence in the previous load step, and $Jd$, the desired number of iteraions. $\delta Uc_n$ is bounded by $\delta Uc_{min}$ and $\delta Uc_{max}$. \\ \[ \delta Ucn = max \left( \delta Uc{min}, min \left( \frac{Jd}{J_{n-1}} \delta Uc{n-1}, \delta Uc{max} \right) \right) \] SOME THEORY.\\ \noindent {\bf Class Interface} \\ \indent // Constructors \\ \indent {\em DisplacementControl(int node, int dof, double $\delta Uc_1$, int Jd, double $\delta Uc_{min}$, double $\delta Uc_{max}$);}\\ \\ \indent // Destructor \\ \indent {\em $\tilde{ }$DisplacementControl();}\\ \\ \indent // Public Methods \\ \indent {\em int newStep(void);} \\ \indent {\em int update(const Vector \&$\Delta U$);} \\ \indent {\em int domainChanged(void);} \\ \\ \indent // Public Methods for Output\\ \indent {\em int sendSelf(int commitTag, Channel \&theChannel);}\\ \indent {\em int recvSelf(int commitTag, Channel \&theChannel, FEM\_ObjectBroker \&theBroker);}\\ \indent {\em int Print(OPS_Stream \&s, int flag = 0);}\\ \noindent {\bf Constructors} \\ \indent {\em DisplacementControl(int node, int dof, double $\delta Uc_1$, int Jd, double $\delta Uc_{min}$, double $\delta Uc_{max}$);}\\ The integer INTEGRATOR\_TAGS\_DisplacementControl (defined in $<$classTags.h$>$) is passed to the StaticIntegrator classes constructor. $\delta Uc_1$ is the load factor used in the first step. The arguments $Jd$, $\delta Uc_{min}$, and $\delta Uc_{max}$ are used in the determination of the increment in the load factor at each step. \\ \noindent {\bf Destructor} \\ \indent {\em $\tilde{ }$DisplacementControl();}\\ Does nothing. \\ \noindent {\bf Public Methods}\\ {\em int newStep(void);} \\ WHAT DO I DO?\\ {\em int update(const Vector \&$\Delta U$);} \\ WHAT DO I DO?\\ {\em int sendSelf(int commitTag, Channel \&theChannel); } \\ WHAT DO I DO?\\ {\em int recvSelf(int commitTag, Channel \&theChannel, FEM\_ObjectBroker \&theBroker); } \\ WHAT DO I DO?\\ {\em int Print(OPS_Stream \&s, int flag = 0);}\\ WHAT DO I DO?
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "./erc721.sol"; import "./erc721-enumerable.sol"; import "./erc721-token-receiver.sol"; import "@0xcert/ethereum-utils-contracts/src/contracts/utils/supports-interface.sol"; import "@0xcert/ethereum-utils-contracts/src/contracts/utils/address-utils.sol"; /** * @dev Optional enumerable implementation for ERC-721 non-fungible token standard. */ contract NFTokenEnumerable is ERC721, ERC721Enumerable, SupportsInterface { using AddressUtils for address; /** * @dev Error constants. */ string constant ZERO_ADDRESS = "005001"; string constant NOT_VALID_NFT = "005002"; string constant NOT_OWNER_OR_OPERATOR = "005003"; string constant NOT_OWNER_APPROWED_OR_OPERATOR = "005004"; string constant NOT_ABLE_TO_RECEIVE_NFT = "005005"; string constant NFT_ALREADY_EXISTS = "005006"; string constant INVALID_INDEX = "005007"; /** * @dev Magic value of a smart contract that can recieve NFT. * Equal to: bytes4(keccak256("onERC721Received(address,address,uint256,bytes)")). */ bytes4 constant MAGIC_ON_ERC721_RECEIVED = 0x150b7a02; /** * @dev Array of all NFT IDs. */ uint256[] internal tokens; /** * @dev Mapping from token ID its index in global tokens array. */ mapping(uint256 => uint256) internal idToIndex; /** * @dev Mapping from owner to list of owned NFT IDs. */ mapping(address => uint256[]) internal ownerToIds; /** * @dev Mapping from NFT ID to its index in the owner tokens list. */ mapping(uint256 => uint256) internal idToOwnerIndex; /** * @dev A mapping from NFT ID to the address that owns it. */ mapping (uint256 => address) internal idToOwner; /** * @dev Mapping from NFT ID to approved address. */ mapping (uint256 => address) internal idToApproval; /** * @dev Mapping from owner address to mapping of operator addresses. */ mapping (address => mapping (address => bool)) internal ownerToOperators; /** * @dev Contract constructor. */ constructor() { supportedInterfaces[0x80ac58cd] = true; // ERC721 supportedInterfaces[0x780e9d63] = true; // ERC721Enumerable } /** * @dev Transfers the ownership of an NFT from one address to another address. * @notice Throws unless `msg.sender` is the current owner, an authorized operator, or the * approved address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is * the zero address. Throws if `_tokenId` is not a valid NFT. When transfer is complete, this * function checks if `_to` is a smart contract (code size > 0). If so, it calls * `onERC721Received` on `_to` and throws if the return value is not * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`. * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. * @param _data Additional data with no specified format, sent in call to `_to`. */ function safeTransferFrom( address _from, address _to, uint256 _tokenId, bytes calldata _data ) external override { _safeTransferFrom(_from, _to, _tokenId, _data); } /** * @dev Transfers the ownership of an NFT from one address to another address. * @notice This works identically to the other function with an extra data parameter, except this * function just sets data to "". * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. */ function safeTransferFrom( address _from, address _to, uint256 _tokenId ) external override { _safeTransferFrom(_from, _to, _tokenId, ""); } /** * @dev Throws unless `msg.sender` is the current owner, an authorized operator, or the approved * address for this NFT. Throws if `_from` is not the current owner. Throws if `_to` is the zero * address. Throws if `_tokenId` is not a valid NFT. * @notice The caller is responsible to confirm that `_to` is capable of receiving NFTs or else * they may be permanently lost. * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. */ function transferFrom( address _from, address _to, uint256 _tokenId ) external override { _transferFrom(_from, _to, _tokenId); } /** * @dev Set or reaffirm the approved address for an NFT. * @notice The zero address indicates there is no approved address. Throws unless `msg.sender` is * the current NFT owner, or an authorized operator of the current owner. * @param _approved Address to be approved for the given NFT ID. * @param _tokenId ID of the token to be approved. */ function approve( address _approved, uint256 _tokenId ) external override { // can operate address tokenOwner = idToOwner[_tokenId]; require( tokenOwner == msg.sender || ownerToOperators[tokenOwner][msg.sender], NOT_OWNER_OR_OPERATOR ); idToApproval[_tokenId] = _approved; emit Approval(tokenOwner, _approved, _tokenId); } /** * @dev Enables or disables approval for a third party ("operator") to manage all of * `msg.sender`'s assets. It also emits the ApprovalForAll event. * @notice This works even if sender doesn't own any tokens at the time. * @param _operator Address to add to the set of authorized operators. * @param _approved True if the operator is approved, false to revoke approval. */ function setApprovalForAll( address _operator, bool _approved ) external override { ownerToOperators[msg.sender][_operator] = _approved; emit ApprovalForAll(msg.sender, _operator, _approved); } /** * @dev Returns the number of NFTs owned by `_owner`. NFTs assigned to the zero address are * considered invalid, and this function throws for queries about the zero address. * @param _owner Address for whom to query the balance. * @return Balance of _owner. */ function balanceOf( address _owner ) external override view returns (uint256) { require(_owner != address(0), ZERO_ADDRESS); return ownerToIds[_owner].length; } /** * @dev Returns the address of the owner of the NFT. NFTs assigned to zero address are considered * invalid, and queries about them do throw. * @param _tokenId The identifier for an NFT. * @return _owner Address of _tokenId owner. */ function ownerOf( uint256 _tokenId ) external override view returns (address _owner) { _owner = idToOwner[_tokenId]; require(_owner != address(0), NOT_VALID_NFT); } /** * @dev Get the approved address for a single NFT. * @notice Throws if `_tokenId` is not a valid NFT. * @param _tokenId ID of the NFT to query the approval of. * @return Address that _tokenId is approved for. */ function getApproved( uint256 _tokenId ) external override view returns (address) { require(idToOwner[_tokenId] != address(0), NOT_VALID_NFT); return idToApproval[_tokenId]; } /** * @dev Checks if `_operator` is an approved operator for `_owner`. * @param _owner The address that owns the NFTs. * @param _operator The address that acts on behalf of the owner. * @return True if approved for all, false otherwise. */ function isApprovedForAll( address _owner, address _operator ) external override view returns (bool) { return ownerToOperators[_owner][_operator]; } /** * @dev Returns the count of all existing NFTs. * @return Total supply of NFTs. */ function totalSupply() external override view returns (uint256) { return tokens.length; } /** * @dev Returns NFT ID by its index. * @param _index A counter less than `totalSupply()`. * @return Token id. */ function tokenByIndex( uint256 _index ) external override view returns (uint256) { require(_index < tokens.length, INVALID_INDEX); return tokens[_index]; } /** * @dev returns the n-th NFT ID from a list of owner's tokens. * @param _owner Token owner's address. * @param _index Index number representing n-th token in owner's list of tokens. * @return Token id. */ function tokenOfOwnerByIndex( address _owner, uint256 _index ) external override view returns (uint256) { require(_index < ownerToIds[_owner].length, INVALID_INDEX); return ownerToIds[_owner][_index]; } /** * @dev Creates a new NFT. * @notice This is a private function which should be called from user-implemented external * create function. Its purpose is to show and properly initialize data structures when using this * implementation. * @param _to The address that will own the created NFT. * @param _tokenId of the NFT to be created by the msg.sender. */ function _create( address _to, uint256 _tokenId ) internal { require(_to != address(0), ZERO_ADDRESS); require(idToOwner[_tokenId] == address(0), NFT_ALREADY_EXISTS); // add NFT idToOwner[_tokenId] = _to; ownerToIds[_to].push(_tokenId); idToOwnerIndex[_tokenId] = ownerToIds[_to].length - 1; // add to tokens array tokens.push(_tokenId); idToIndex[_tokenId] = tokens.length - 1; emit Transfer(address(0), _to, _tokenId); } /** * @dev Destroys a NFT. * @notice This is a private function which should be called from user-implemented external * destroy function. Its purpose is to show and properly initialize data structures when using * this implementation. * @param _tokenId ID of the NFT to be destroyed. */ function _destroy( uint256 _tokenId ) internal { // valid NFT address owner = idToOwner[_tokenId]; require(owner != address(0), NOT_VALID_NFT); // clear approval if (idToApproval[_tokenId] != address(0)) { delete idToApproval[_tokenId]; } // remove NFT assert(ownerToIds[owner].length > 0); uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId]; uint256 lastTokenIndex = ownerToIds[owner].length - 1; uint256 lastToken; if (lastTokenIndex != tokenToRemoveIndex) { lastToken = ownerToIds[owner][lastTokenIndex]; ownerToIds[owner][tokenToRemoveIndex] = lastToken; idToOwnerIndex[lastToken] = tokenToRemoveIndex; } delete idToOwner[_tokenId]; delete idToOwnerIndex[_tokenId]; ownerToIds[owner].pop(); // remove from tokens array assert(tokens.length > 0); uint256 tokenIndex = idToIndex[_tokenId]; lastTokenIndex = tokens.length - 1; lastToken = tokens[lastTokenIndex]; tokens[tokenIndex] = lastToken; tokens.pop(); // Consider adding a conditional check for the last token in order to save GAS. idToIndex[lastToken] = tokenIndex; idToIndex[_tokenId] = 0; emit Transfer(owner, address(0), _tokenId); } /** * @dev Helper method that actually does the transfer. * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. */ function _transferFrom( address _from, address _to, uint256 _tokenId ) internal virtual { // valid NFT require(_from != address(0), ZERO_ADDRESS); require(idToOwner[_tokenId] == _from, NOT_VALID_NFT); require(_to != address(0), ZERO_ADDRESS); // can transfer require( _from == msg.sender || idToApproval[_tokenId] == msg.sender || ownerToOperators[_from][msg.sender], NOT_OWNER_APPROWED_OR_OPERATOR ); // clear approval if (idToApproval[_tokenId] != address(0)) { delete idToApproval[_tokenId]; } // remove NFT assert(ownerToIds[_from].length > 0); uint256 tokenToRemoveIndex = idToOwnerIndex[_tokenId]; uint256 lastTokenIndex = ownerToIds[_from].length - 1; if (lastTokenIndex != tokenToRemoveIndex) { uint256 lastToken = ownerToIds[_from][lastTokenIndex]; ownerToIds[_from][tokenToRemoveIndex] = lastToken; idToOwnerIndex[lastToken] = tokenToRemoveIndex; } ownerToIds[_from].pop(); // add NFT idToOwner[_tokenId] = _to; ownerToIds[_to].push(_tokenId); idToOwnerIndex[_tokenId] = ownerToIds[_to].length - 1; emit Transfer(_from, _to, _tokenId); } /** * @dev Helper function that actually does the safeTransfer. * @param _from The current owner of the NFT. * @param _to The new owner. * @param _tokenId The NFT to transfer. * @param _data Additional data with no specified format, sent in call to `_to`. */ function _safeTransferFrom( address _from, address _to, uint256 _tokenId, bytes memory _data ) internal virtual { if (_to.isDeployedContract()) { require( ERC721TokenReceiver(_to) .onERC721Received(msg.sender, _from, _tokenId, _data) == MAGIC_ON_ERC721_RECEIVED, NOT_ABLE_TO_RECEIVE_NFT ); } _transferFrom(_from, _to, _tokenId); } }
$pwrRoot = $PSScriptRoot; $pwrName = (split-path -path $MyInvocation.MyCommand.Definition -leaf).split('.ps1')[0]; & "$pwrRoot\bin\pwr.ps1" @args;
tests - variablenodes testReifyGlobalValue | varNode instance | varNode := (ReflectivityExamples>>#exampleGlobalRead) ast body statements last value. link := MetaLink new metaObject: self; selector: #tagExec:; arguments: #(value). varNode link: link. self assert: varNode hasMetalink. self assert: (tag isNil). instance := ReflectivityExamples new . self assert: (instance exampleGlobalRead = GlobalForTesting). self assert: (tag = GlobalForTesting).
Name: z00_play.asm Type: file Size: 356168 Last-Modified: '2016-05-13T04:36:32Z' SHA-1: 8D8071668D93BD797CE7703D6D6CB589D296F5AD Description: null
//////////////////////////////////////////////////////////// // // (C) Copyright 2021 Eximius Design // // 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. //////////////////////////////////////////////////////////// module axi_mm_a32_d128_packet_up_rv_2_mem_master_top ( input logic clk_wr , input logic rst_wr_n , // Control signals input logic tx_online , input logic rx_online , input logic [7:0] init_ar_credit , input logic [7:0] init_aw_credit , input logic [7:0] init_w_credit , // PHY Interconnect output logic [ 79: 0] tx_phy0 , input logic [ 79: 0] rx_phy0 , output logic [ 79: 0] tx_phy1 , input logic [ 79: 0] rx_phy1 , // ar channel input logic [ 3: 0] user_arid , input logic [ 2: 0] user_arsize , input logic [ 7: 0] user_arlen , input logic [ 1: 0] user_arburst , input logic [ 31: 0] user_araddr , input logic user_arvalid , output logic user_arready , // aw channel input logic [ 3: 0] user_awid , input logic [ 2: 0] user_awsize , input logic [ 7: 0] user_awlen , input logic [ 1: 0] user_awburst , input logic [ 31: 0] user_awaddr , input logic user_awvalid , output logic user_awready , // w channel input logic [ 3: 0] user_wid , input logic [ 127: 0] user_wdata , input logic [ 15: 0] user_wstrb , input logic user_wlast , input logic user_wvalid , output logic user_wready , // r channel output logic [ 3: 0] user_rid , output logic [ 127: 0] user_rdata , output logic user_rlast , output logic [ 1: 0] user_rresp , output logic user_rvalid , input logic user_rready , // b channel output logic [ 3: 0] user_bid , output logic [ 1: 0] user_bresp , output logic user_bvalid , input logic user_bready , // Debug Status Outputs output logic [31:0] tx_ar_debug_status , output logic [31:0] tx_aw_debug_status , output logic [31:0] tx_w_debug_status , output logic [31:0] rx_r_debug_status , output logic [31:0] rx_b_debug_status , // Configuration input logic m_gen2_mode , input logic [ 1: 0] tx_mrk_userbit , input logic tx_stb_userbit , input logic [15:0] delay_x_value , input logic [15:0] delay_y_value , input logic [15:0] delay_z_value ); ////////////////////////////////////////////////////////////////// // Interconnect Wires logic tx_ar_pushbit ; logic user_ar_vld ; logic [ 48: 0] tx_ar_data ; logic [ 48: 0] txfifo_ar_data ; logic rx_ar_credit ; logic user_ar_ready ; logic tx_ar_pop_ovrd ; logic tx_aw_pushbit ; logic user_aw_vld ; logic [ 48: 0] tx_aw_data ; logic [ 48: 0] txfifo_aw_data ; logic rx_aw_credit ; logic user_aw_ready ; logic tx_aw_pop_ovrd ; logic tx_w_pushbit ; logic user_w_vld ; logic [ 148: 0] tx_w_data ; logic [ 148: 0] txfifo_w_data ; logic rx_w_credit ; logic user_w_ready ; logic tx_w_pop_ovrd ; logic rx_r_pushbit ; logic user_r_vld ; logic [ 134: 0] rx_r_data ; logic [ 134: 0] rxfifo_r_data ; logic tx_r_credit ; logic user_r_ready ; logic rx_r_push_ovrd ; logic rx_b_pushbit ; logic user_b_vld ; logic [ 5: 0] rx_b_data ; logic [ 5: 0] rxfifo_b_data ; logic tx_b_credit ; logic user_b_ready ; logic rx_b_push_ovrd ; logic [ 1: 0] tx_auto_mrk_userbit ; logic tx_auto_stb_userbit ; logic tx_online_delay ; logic rx_online_delay ; logic rx_online_holdoff ; // Interconnect Wires ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// // Auto Sync assign rx_online_holdoff = 1'b0 ; ll_auto_sync #(.MARKER_WIDTH(2), .PERSISTENT_MARKER(1'b1), .PERSISTENT_STROBE(1'b1)) ll_auto_sync_i (// Outputs .tx_online_delay (tx_online_delay), .tx_auto_mrk_userbit (tx_auto_mrk_userbit), .tx_auto_stb_userbit (tx_auto_stb_userbit), .rx_online_delay (rx_online_delay), // Inputs .clk_wr (clk_wr), .rst_wr_n (rst_wr_n), .tx_online (tx_online), .delay_z_value (delay_z_value[15:0]), .delay_y_value (delay_y_value[15:0]), .tx_mrk_userbit (tx_mrk_userbit), .tx_stb_userbit (tx_stb_userbit), .rx_online (rx_online), .rx_online_holdoff (rx_online_holdoff), .delay_x_value (delay_x_value[15:0])); // Auto Sync ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// // Logic Link Instantiation ll_transmit #(.WIDTH(49), .DEPTH(8'd1), .TX_CRED_SIZE(3'h1), .ASYMMETRIC_CREDIT(1'b0), .DEFAULT_TX_CRED(8'd8)) ll_transmit_iar (// Outputs .user_i_ready (user_ar_ready), .tx_i_data (tx_ar_data[48:0]), .tx_i_pushbit (tx_ar_pushbit), .tx_i_debug_status (tx_ar_debug_status[31:0]), // Inputs .clk_wr (clk_wr), .rst_wr_n (rst_wr_n), .end_of_txcred_coal (1'b1), .tx_online (tx_online_delay), .rx_online (rx_online_delay), .init_i_credit (init_ar_credit[7:0]), .tx_i_pop_ovrd (tx_ar_pop_ovrd), .txfifo_i_data (txfifo_ar_data[48:0]), .user_i_valid (user_ar_vld), .rx_i_credit ({3'b0,rx_ar_credit})); ll_transmit #(.WIDTH(49), .DEPTH(8'd1), .TX_CRED_SIZE(3'h1), .ASYMMETRIC_CREDIT(1'b0), .DEFAULT_TX_CRED(8'd8)) ll_transmit_iaw (// Outputs .user_i_ready (user_aw_ready), .tx_i_data (tx_aw_data[48:0]), .tx_i_pushbit (tx_aw_pushbit), .tx_i_debug_status (tx_aw_debug_status[31:0]), // Inputs .clk_wr (clk_wr), .rst_wr_n (rst_wr_n), .end_of_txcred_coal (1'b1), .tx_online (tx_online_delay), .rx_online (rx_online_delay), .init_i_credit (init_aw_credit[7:0]), .tx_i_pop_ovrd (tx_aw_pop_ovrd), .txfifo_i_data (txfifo_aw_data[48:0]), .user_i_valid (user_aw_vld), .rx_i_credit ({3'b0,rx_aw_credit})); ll_transmit #(.WIDTH(149), .DEPTH(8'd1), .TX_CRED_SIZE(3'h1), .ASYMMETRIC_CREDIT(1'b0), .DEFAULT_TX_CRED(8'd128)) ll_transmit_iw (// Outputs .user_i_ready (user_w_ready), .tx_i_data (tx_w_data[148:0]), .tx_i_pushbit (tx_w_pushbit), .tx_i_debug_status (tx_w_debug_status[31:0]), // Inputs .clk_wr (clk_wr), .rst_wr_n (rst_wr_n), .end_of_txcred_coal (1'b1), .tx_online (tx_online_delay), .rx_online (rx_online_delay), .init_i_credit (init_w_credit[7:0]), .tx_i_pop_ovrd (tx_w_pop_ovrd), .txfifo_i_data (txfifo_w_data[148:0]), .user_i_valid (user_w_vld), .rx_i_credit ({3'b0,rx_w_credit})); ll_receive #(.WIDTH(135), .DEPTH(8'd128)) ll_receive_ir (// Outputs .rxfifo_i_data (rxfifo_r_data[134:0]), .user_i_valid (user_r_vld), .tx_i_credit (tx_r_credit), .rx_i_debug_status (rx_r_debug_status[31:0]), // Inputs .clk_wr (clk_wr), .rst_wr_n (rst_wr_n), .rx_online (rx_online_delay), .tx_online (tx_online_delay), .rx_i_push_ovrd (rx_r_push_ovrd), .rx_i_data (rx_r_data[134:0]), .rx_i_pushbit (rx_r_pushbit), .user_i_ready (user_r_ready)); ll_receive #(.WIDTH(6), .DEPTH(8'd8)) ll_receive_ib (// Outputs .rxfifo_i_data (rxfifo_b_data[5:0]), .user_i_valid (user_b_vld), .tx_i_credit (tx_b_credit), .rx_i_debug_status (rx_b_debug_status[31:0]), // Inputs .clk_wr (clk_wr), .rst_wr_n (rst_wr_n), .rx_online (rx_online_delay), .tx_online (tx_online_delay), .rx_i_push_ovrd (rx_b_push_ovrd), .rx_i_data (rx_b_data[5:0]), .rx_i_pushbit (rx_b_pushbit), .user_i_ready (user_b_ready)); // Logic Link Instantiation ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// // User Interface axi_mm_a32_d128_packet_up_rv_2_mem_master_name axi_mm_a32_d128_packet_up_rv_2_mem_master_name ( .user_arid (user_arid[ 3: 0]), .user_arsize (user_arsize[ 2: 0]), .user_arlen (user_arlen[ 7: 0]), .user_arburst (user_arburst[ 1: 0]), .user_araddr (user_araddr[ 31: 0]), .user_arvalid (user_arvalid), .user_arready (user_arready), .user_awid (user_awid[ 3: 0]), .user_awsize (user_awsize[ 2: 0]), .user_awlen (user_awlen[ 7: 0]), .user_awburst (user_awburst[ 1: 0]), .user_awaddr (user_awaddr[ 31: 0]), .user_awvalid (user_awvalid), .user_awready (user_awready), .user_wid (user_wid[ 3: 0]), .user_wdata (user_wdata[ 127: 0]), .user_wstrb (user_wstrb[ 15: 0]), .user_wlast (user_wlast), .user_wvalid (user_wvalid), .user_wready (user_wready), .user_rid (user_rid[ 3: 0]), .user_rdata (user_rdata[ 127: 0]), .user_rlast (user_rlast), .user_rresp (user_rresp[ 1: 0]), .user_rvalid (user_rvalid), .user_rready (user_rready), .user_bid (user_bid[ 3: 0]), .user_bresp (user_bresp[ 1: 0]), .user_bvalid (user_bvalid), .user_bready (user_bready), .user_ar_vld (user_ar_vld), .txfifo_ar_data (txfifo_ar_data[ 48: 0]), .user_ar_ready (user_ar_ready), .user_aw_vld (user_aw_vld), .txfifo_aw_data (txfifo_aw_data[ 48: 0]), .user_aw_ready (user_aw_ready), .user_w_vld (user_w_vld), .txfifo_w_data (txfifo_w_data[ 148: 0]), .user_w_ready (user_w_ready), .user_r_vld (user_r_vld), .rxfifo_r_data (rxfifo_r_data[ 134: 0]), .user_r_ready (user_r_ready), .user_b_vld (user_b_vld), .rxfifo_b_data (rxfifo_b_data[ 5: 0]), .user_b_ready (user_b_ready), .m_gen2_mode (m_gen2_mode) ); // User Interface ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// // PHY Interface axi_mm_a32_d128_packet_up_rv_2_mem_master_concat axi_mm_a32_d128_packet_up_rv_2_mem_master_concat ( .tx_ar_data (tx_ar_data[ 0 +: 49]), .tx_ar_pop_ovrd (tx_ar_pop_ovrd), .tx_ar_pushbit (tx_ar_pushbit), .rx_ar_credit (rx_ar_credit), .tx_aw_data (tx_aw_data[ 0 +: 49]), .tx_aw_pop_ovrd (tx_aw_pop_ovrd), .tx_aw_pushbit (tx_aw_pushbit), .rx_aw_credit (rx_aw_credit), .tx_w_data (tx_w_data[ 0 +: 149]), .tx_w_pop_ovrd (tx_w_pop_ovrd), .tx_w_pushbit (tx_w_pushbit), .rx_w_credit (rx_w_credit), .rx_r_data (rx_r_data[ 0 +: 135]), .rx_r_push_ovrd (rx_r_push_ovrd), .rx_r_pushbit (rx_r_pushbit), .tx_r_credit (tx_r_credit), .rx_b_data (rx_b_data[ 0 +: 6]), .rx_b_push_ovrd (rx_b_push_ovrd), .rx_b_pushbit (rx_b_pushbit), .tx_b_credit (tx_b_credit), .tx_phy0 (tx_phy0[79:0]), .rx_phy0 (rx_phy0[79:0]), .tx_phy1 (tx_phy1[79:0]), .rx_phy1 (rx_phy1[79:0]), .clk_wr (clk_wr), .clk_rd (clk_wr), .rst_wr_n (rst_wr_n), .rst_rd_n (rst_wr_n), .m_gen2_mode (m_gen2_mode), .tx_online (tx_online_delay), .tx_stb_userbit (tx_auto_stb_userbit), .tx_mrk_userbit (tx_auto_mrk_userbit) ); // PHY Interface ////////////////////////////////////////////////////////////////// endmodule
;;; extensions.el --- Auctex Layer Extensions File for Spacemacs ;; ;; Copyright (c) 2012-2014 Sylvain Benner ;; Copyright (c) 2014-2015 Sylvain Benner & Contributors ;; ;; Author: Sylvain Benner <sylvain.benner@gmail.com> ;; URL: https://github.com/syl20bnr/spacemacs ;; ;; This file is not part of GNU Emacs. ;; ;;; License: GPLv3 (setq latex-post-extensions '(emacs-builtin-reftex)) (defun latex/init-emacs-builtin-reftex () "Initialize reftex" (add-hook 'LaTeX-mode-hook 'turn-on-reftex) (setq reftex-plug-into-AUCTeX '(nil nil t t t)) (evil-leader/set-key-for-mode 'latex-mode "mrc" 'reftex-citation "mrg" 'reftex-grep-document "mri" 'reftex-index-selection-or-word "mrI" 'reftex-display-index "mr C-i" 'reftex-index "mrl" 'reftex-label "mrp" 'reftex-index-phrase-selection-or-word "mrP" 'reftex-index-visit-phrases-buffer "mrr" 'reftex-reference "mrs" 'reftex-search-document "mrt" 'reftex-toc "mrT" 'reftex-toc-recenter "mrv" 'reftex-view-crossref))
project "Demo.UI" kind "WindowedApp" staticruntime "on" dependson { "Engine.Core", "Engine.UI", "Engine.UI.Direct2D", "Engine" } files { "src/**.h", "src/**.cpp", "generated/bindings/**.h" } includedirs { "src", "generated/bindings", includeDir["Engine.Core"], includeDir["Engine.UI"], includeDir["Engine.UI_bindings"], includeDir["Engine.UI.Direct2D"], includeDir["Engine"], includeDir["tinyxml2"], includeDir["entt"], includeDir["CRC"], includeDir["angelscript"], includeDir["PhysX"], includeDir["PhysX.Shared"], includeDir["DirectX"] } links { "Engine.Core", "Engine.UI", "Engine.UI.Direct2D", "Engine" } filter "configurations:Debug" links { library["tinyxml2_Debug"], library["angelscript_Debug"], library["PhysX_Debug"], library["PhysXCommon_Debug"], library["PhysXFoundation_Debug"], library["PhysXExtensions_Debug"], library["PhysXPvdSDK_Debug"] } filter "configurations:Release" links { library["tinyxml2_Release"], library["angelscript_Release"], library["PhysX_Release"], library["PhysXCommon_Release"], library["PhysXFoundation_Release"], library["PhysXExtensions_Release"], library["PhysXPvdSDK_Release"] }
; A052948: Expansion of g.f.: (1-2*x)/(1-3*x+2*x^3). ; 1,1,3,7,19,51,139,379,1035,2827,7723,21099,57643,157483,430251,1175467,3211435,8773803,23970475,65488555,178918059,488813227,1335462571,3648551595,9968028331,27233159851,74402376363,203271072427 add $0,1 lpb $0,1 sub $0,1 add $2,3 mov $1,$2 sub $1,2 mul $3,2 mov $2,$3 add $3,$1 lpe
# # Copyright 2004-present Facebook. All Rights Reserved. # namespace py neteng.fboss.switch_state namespace py3 neteng.fboss namespace py.asyncio neteng.fboss.asyncio.switch_state namespace cpp2 facebook.fboss.state include "fboss/agent/switch_config.thrift" struct VlanInfo { 1: bool tagged; } struct BufferPoolFields { 1: string id 2: i32 headroomBytes 3: i32 sharedBytes } struct PortPgFields { 1: i16 id 2: i32 minLimitBytes 3: optional i32 headroomLimitBytes 4: optional string name 5: optional i32 resumeOffsetBytes 6: string bufferPoolName 7: optional string scalingFactor 8: optional BufferPoolFields bufferPoolConfig } // Port queueing configuration struct PortQueueFields { 1: i16 id 2: i32 weight 3: optional i32 reserved // TODO: replace with switch_config.MMUScalingFactor? 4: optional string scalingFactor // TODO: replace with switch_config.QueueScheduling? 5: string scheduling // TODO: replace with switch_config.StreamType? 6: string streamType 7: optional list<switch_config.ActiveQueueManagement> aqms 8: optional string name /* * Refer PortQueueRate which is a generalized version and allows configuring * pps as well as kbps. */ 10: optional i32 packetsPerSec_DEPRECATED 11: optional i32 sharedBytes 12: optional switch_config.PortQueueRate portQueueRate 13: optional i32 bandwidthBurstMinKbits 14: optional i32 bandwidthBurstMaxKbits 15: optional i16 trafficClass 16: optional list<i16> pfcPriorities } // Port configuration and oper state fields // TODO: separate config and operational state struct PortFields { 1: required i32 portId 2: required string portName 3: string portDescription // TODO: use switch_config.PortState? 4: string portState 5: bool portOperState 6: i32 ingressVlan // TODO: use switch_config.PortSpeed? 7: string portSpeed // TODO: use switch_config.PortSpeed 8: string portMaxSpeed // TODO: use switch_config.PortFEC? 9: string portFEC // TODO: use switch_config.PortPause? 10: bool rxPause 11: bool txPause 12: map<string, VlanInfo> vlanMemberShips 13: i32 sFlowIngressRate 14: i32 sFlowEgressRate 15: list<PortQueueFields> queues 16: string portLoopbackMode 17: optional string ingressMirror 18: optional string egressMirror 19: optional string qosPolicy 20: optional string sampleDest // TODO: this will deprecate port speed and port fec 21: string portProfileID 22: list<switch_config.AclLookupClass> lookupClassesToDistrubuteTrafficOn 23: i32 maxFrameSize = switch_config.DEFAULT_PORT_MTU 24: optional switch_config.PortPfc pfc 25: optional list<PortPgFields> pgConfigs }
<!-- ========================================================= * Paper Kit 2 Angular - v1.4.0 ========================================================= * Product Page: https://www.creative-tim.com/product/paper-kit-2-angular * Copyright 2020 Creative Tim (https://www.creative-tim.com) * Licensed under MIT (https://github.com/timcreative/paper-kit/blob/master/LICENSE.md) ========================================================= * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. --> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Quqaz</title> <base href="/"> <link rel="icon" type="image/png" href="assets/img/favicon.ico"> <link rel="apple-touch-icon" sizes="76x76" href="assets/img/apple-icon.png"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' /> <meta name="viewport" content="width=device-width" /> <!-- Fonts and icons --> <link href='https://fonts.googleapis.com/css?family=Montserrat:400,300,700' rel='stylesheet' type='text/css'> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" rel="stylesheet"> <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"> </head> <body> <app-root></app-root> </body> </html>
grammar MetaModel; fragment ESC : '\\' (["\\/bfnrt] | UNICODE) ; fragment UNICODE : 'u' HEX HEX HEX HEX ; fragment HEX : [0-9a-fA-F] ; STRING : '"' (ESC | ~["\\])* '"' | '\'' (ESC | ~["\\])* '\'' ; IDENT : [a-zA-Z_][a-zA-Z_0-9]*; WS : ([ \t\r\n]+ | SL_COMMENT) -> skip ; // skip spaces, tabs, newlines SL_COMMENT : '//' ~('\r' | '\n')* ; NUMBER : [\-]?[0-9]+'.'?[0-9]*; metamodel: ruleDef*; ruleDef: 'rule' STRING condition action 'end'; condition: 'when' ('!')? (term boolOperator term); term: (type '.' attribute) | NUMBER | STRING; boolOperator: ( '==' | '>' | '>=' | '<' | '<=' | '!='); type: IDENT ('.' IDENT)*; attribute: IDENT; action: 'then' task; task: operation ('.'operation)*; operation: IDENT '(' (value(',' value)*)? ')'; value: STRING | '{' task '}';
rem run Vagrant using learn-salt definitions set VAGRANT_CWD=..\learn-salt vagrant.exe %*
(library (harlan middle compile-middle) (export compile-harlan-middle) (import (rnrs) (harlan compile-opts) (harlan verification-passes) (harlan middle lifting) (harlan middle remove-complex-kernel-args) (harlan middle remove-lambdas) (harlan middle remove-recursion) (harlan middle desugar-match) (harlan middle make-kernel-dimensions-explicit) (harlan middle make-work-size-explicit) (harlan middle optimize-fuse-kernels) (harlan middle remove-danger) (harlan middle insert-transactions) (harlan middle remove-transactions) (harlan middle remove-nested-kernels) (harlan middle returnify-kernels) (harlan middle make-vector-refs-explicit) (harlan middle lift-complex) (harlan middle annotate-free-vars) (harlan middle lower-vectors) (harlan middle insert-let-regions) (harlan middle specialize-string-equality) (harlan middle uglify-vectors) (harlan middle remove-let-regions) (harlan middle flatten-lets) (harlan middle hoist-kernels) (harlan middle fix-kernel-local-regions) (harlan middle generate-kernel-calls) (harlan middle compile-module) (harlan middle convert-types) (only (harlan middle languages M0-3) parse-M0 unparse-M3) (only (harlan middle languages M5) parse-M5) (only (harlan middle languages M7) parse-M7 unparse-M7 parse-M7.0 unparse-M7.0 parse-M7.0.0 parse-M7.0.2 unparse-M7.0.0 unparse-M7.0.1 unparse-M7.0.3) (only (harlan middle languages M8) parse-M8) (only (harlan middle languages M9) unparse-M9.3)) ;; The "middle end" of a compiler. No one ever knows what's supposed ;; to go here. (define compile-harlan-middle (passes (nanopasses (remove-lambdas : M0 -> M3)) (desugar-match verify-desugar-match) (nanopasses (make-kernel-dimensions-explicit : M5 -> M6) (make-work-size-explicit : M6 -> M7)) (optimize-lift-lets verify-optimize-lift-lets 1) (optimize-fuse-kernels verify-optimize-fuse-kernels 1) (nanopasses (remove-danger : M7 -> M7.0.0)) (remove-nested-kernels verify-remove-nested-kernels) (nanopasses (insert-transactions : M7.0.0 -> M7.0.1)) (returnify-kernels verify-returnify-kernels) (lift-complex verify-lift-complex) (optimize-lift-allocation verify-optimize-lift-allocation 1) ;; This seems like a good place to remove the transactions ;; ;; - originally I wanted to put it right after returnify-kernels, ;; but we need to be sure we don't lift any allocations outside of ;; a transaction. (nanopasses (remove-transactions : M7.0.2 -> M7.0.3)) (make-vector-refs-explicit verify-make-vector-refs-explicit) (annotate-free-vars verify-annotate-free-vars) (nanopasses (unless (allow-complex-kernel-args) (remove-complex-kernel-args : M7.0 -> M7.0))) (lower-vectors verify-lower-vectors) ;;(nanopasses ;; (uglify-vectors-new : M7.1 -> M7.2)) (uglify-vectors verify-uglify-vectors) (remove-let-regions verify-remove-let-regions) ;; remove-unused-bindings should go here. (flatten-lets verify-flatten-lets) (hoist-kernels verify-hoist-kernels) (nanopasses (fix-kernel-local-regions : M8 -> M8) (generate-kernel-calls : M8 -> M9) (remove-recursion : M9 -> M9.3) (specialize-string-equality : M9.3 -> M9.3)) (compile-module verify-compile-module) (convert-types verify-convert-types))) )
namespace ProHolz.SourceChecker; interface uses RemObjects.Elements.EUnit, ProHolz.Ast; type TestPasFile = public class(Test) private protected public method FirstTest; end; implementation method TestPasFile.FirstTest; begin Var PasFile := new tPasSource('Test', 'D:\Test'); Check.AreEqual(PasFile.Problems.Count, 0 ); PasFile.AddProblem(eEleCheck.eDfm); Check.AreEqual(PasFile.Problems.Count, 1); PasFile.AddProblem(eEleCheck.eWith); Check.AreEqual(PasFile.Problems.Count, 2); PasFile.AddProblem(eEleCheck.eInitializations, 10, 88); Check.AreEqual(PasFile.Problems.Count, 3); end; end.
class Resolvers::CategoryCreate < GraphQL::Function argument :name, !types.String argument :rubric, !types.String type Types::CategoryType def call(_obj, args, _ctx) category = Category.create!(name: args[:name]) category.rubric = Rubric.find_by(name: args[:rubric]) category rescue Mongoid::Errors::Validations => err raise GraphQL::ExecutionError.new(CategoriesHelper::Errors.INVALID_INPUT + err.message) # TODO: handle rubric not found error end end
############################################################################### # # Tests for Excel::Writer::XLSX::Worksheet methods. # # Copyright 2000-2021, John McNamara, jmcnamara@cpan.org # use lib 't/lib'; use TestFunctions '_new_worksheet'; use strict; use warnings; use Test::More tests => 3; ############################################################################### # # Tests setup. # my $expected; my $got; my $caption; my $worksheet; ############################################################################### # # 1. Test the _write_sheet_pr() method. # $caption = " \tWorksheet: _write_sheet_pr()"; $expected = '<sheetPr><pageSetUpPr fitToPage="1"/></sheetPr>'; $worksheet = _new_worksheet(\$got); $worksheet->{_fit_page} = 1; $worksheet->_write_sheet_pr(); is( $got, $expected, $caption ); ############################################################################### # # 2. Test the _write_sheet_pr() method. # $caption = " \tWorksheet: _write_sheet_pr()"; $expected = '<sheetPr><tabColor rgb="FFFF0000"/></sheetPr>'; $worksheet = _new_worksheet(\$got); # Mock up the color palette. $worksheet->{_palette}->[2] = [ 0xff, 0x00, 0x00, 0x00 ]; $worksheet->set_tab_color( 'red' ); $worksheet->_write_sheet_pr(); is( $got, $expected, $caption ); ############################################################################### # # 3. Test the _write_sheet_pr() method. # $caption = " \tWorksheet: _write_sheet_pr()"; $expected = '<sheetPr><tabColor rgb="FFFF0000"/><pageSetUpPr fitToPage="1"/></sheetPr>'; $worksheet = _new_worksheet(\$got); # Mock up the color palette. $worksheet->{_palette}->[2] = [ 0xff, 0x00, 0x00, 0x00 ]; $worksheet->{_fit_page} = 1; $worksheet->set_tab_color( 'red' ); $worksheet->_write_sheet_pr(); is( $got, $expected, $caption ); __END__
#version 330 core #extension GL_ARB_separate_shader_objects : require #extension GL_ARB_explicit_attrib_location : require layout (local_size_x = 16, local_size_y = 16) in; // uniform float z_near; // uniform float z_far; uniform sampler2D depth_linear_tex; uniform sampler2D ao_raw_tex; layout(r32f) uniform writeonly image2D ao_blurred_img; uniform float sigma_spacial; uniform float sigma_depth; uniform int ao_power; uniform int pyr_lvl; void main() { ivec2 img_coords = ivec2(gl_GlobalInvocationID.xy); //for sampling we need it in range [0,1] ivec2 img_size=textureSize( ao_raw_tex, 0); // ivec2 img_size=textureSize( depth_linear_tex, 0); vec2 uv_coord=vec2(float(img_coords.x+0.5)/img_size.x, float(img_coords.y+0.5)/img_size.y); //sample the depth and convert // float depth_linear=texture(depth_linear_tex, uv_coord).x; float depth_linear=textureLod(depth_linear_tex, uv_coord, pyr_lvl).x; // float depth_linear=textureLod(depth_linear_tex, uv_coord, 0).x; float ao_raw=texture(ao_raw_tex, uv_coord).x; // https://github.com/tranvansang/bilateral-filter/blob/master/fshader.fragA float divisor_s = -1./(2.*sigma_spacial*sigma_spacial); //divisor in the exp function of the spacial component float divisor_l = -1./(2.*sigma_depth*sigma_depth); float c_total=ao_raw; float w_total=1.0; float half_size = sigma_spacial * 2; for(float x=-half_size; x<=half_size; x++){ for(float y=-half_size; y<=half_size; y++){ vec2 offset=vec2(x,y)/vec2(img_size); float offset_depth = texture(depth_linear_tex, uv_coord + offset).x; float offset_ao = texture(ao_raw_tex, uv_coord + offset).x; float dist_spacial = length(vec2(x,y)); float dist_depth =offset_depth - depth_linear; float w_spacial = exp(divisor_s*float(dist_spacial*dist_spacial)); float w_d = exp(divisor_l*float(dist_depth*dist_depth)); float w = w_spacial*w_d; w_total+=w; c_total+=offset_ao*w; } } float final_ao=c_total/w_total; final_ao = smoothstep(0.0, 0.995, final_ao); //everything above 0.9 gets put to 1. We do this to avoid dampening the bright parts when we use pow final_ao=pow(final_ao, ao_power); // float final_ao=1.0; imageStore(ao_blurred_img, img_coords, vec4(final_ao, 0.0, 0.0, 1.0) ); }
//Line and OP: Line 74 <JES> //ORIGINAL: (source . Institution) //MUTATION: u //Line and OP: Line 74 <JEE> //ORIGINAL: (source . u) //MUTATION: ((profile . source) . u) open util/integer as integer 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 } pred inv1 []{ all u : User | (u . visible) in (u . profile) } pred inv2 []{ all u : User | ((profile . source) . u) in u } pred inv3 []{ all w1, w2 : Work, u : User | ({ w1 != w2 (w1 + w2) in (u . profile) (w1 . source) = (w2 . source) }) => (no ((w1 . ids) & (w2 . ids))) } pred inv1_OK []{ all u : User | (u . visible) in (u . profile) } pred inv2_OK []{ all u : User, w : Work | (w in (u . profile)) => ((u in (w . source)) || (some i : Institution | i in (w . source))) } pred inv3_OK []{ all w1, w2 : Work, u : User | ({ w1 != w2 (w1 + w2) in (u . profile) (w1 . source) = (w2 . source) }) => (no ((w1 . ids) & (w2 . ids))) } assert inv1_Repaired { inv1[] <=> inv1_OK[] } assert inv2_Repaired { inv2[] <=> inv2_OK[] } assert inv3_Repaired { inv3[] <=> inv3_OK[] } check inv1_Repaired expect 0 check inv2_Repaired expect 0 check inv3_Repaired expect 0
/* * Generated by class-dump 3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2012 by Steve Nygard. */ #import "NSViewController.h" #import "AccountStatusDataSourceDelegate.h" #import "MCActivityTarget.h" #import "NSUserInterfaceValidations.h" @class AccountStatusDataSource, NSOperationQueue, NewDeliveryFailure; @interface ComposeViewController : NSViewController <AccountStatusDataSourceDelegate, MCActivityTarget, NSUserInterfaceValidations> { id <ComposeViewControllerDelegate> _delegate; NSOperationQueue *_workerQueue; AccountStatusDataSource *_deliveryAccountStatusDataSource; NewDeliveryFailure *_deliveryFailure; } @property(retain, nonatomic) NewDeliveryFailure *deliveryFailure; // @synthesize deliveryFailure=_deliveryFailure; @property(retain, nonatomic) AccountStatusDataSource *deliveryAccountStatusDataSource; // @synthesize deliveryAccountStatusDataSource=_deliveryAccountStatusDataSource; @property(readonly) NSOperationQueue *workerQueue; // @synthesize workerQueue=_workerQueue; @property(nonatomic) id <ComposeViewControllerDelegate> delegate; // @synthesize delegate=_delegate; - (BOOL)_alwaysCcOrBccMyself; - (BOOL)validateUserInterfaceItem:(id)arg1; - (void)_updateActiveField; - (void)addAttachments:(id)arg1; - (void)discard; - (void)saveMessageToDrafts:(id)arg1; - (void)finishEditing; - (void)reportDeliveryFailure:(id)arg1; - (void)_didAppendMessageToOutboxWithResult:(int)arg1 error:(id)arg2; - (void)_saveRecipients; - (void)_appendMessageToOutboxInBackground:(id)arg1; - (void)sendMessageAfterChecking:(id)arg1; - (void)send:(id)arg1; - (void)_updateSendButton; - (BOOL)_allowSend; - (void)_updateSecurityControls; - (void)_updateShowCcBccFrom; - (id)_dynamicDeliveryAccountForAccount:(id)arg1; - (void)_updateDeliveryPopupWithAccount:(id)arg1; - (void)_updateComposeViewWithFrom:(id)arg1; - (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; - (void)isSignedChanged:(id)arg1; - (void)isEncryptedChanged:(id)arg1; - (void)signatureChanged:(id)arg1; - (void)priorityChanged:(id)arg1; - (void)subjectChanged:(id)arg1; - (void)setDeliveryAccount:(id)arg1; - (void)_setDeliveryAccountWithFromAccount:(id)arg1; - (void)setSelectedAccount:(id)arg1; - (void)fromChanged:(id)arg1; - (void)_replyToChanged:(id)arg1; - (void)_bccChanged:(id)arg1; - (void)_ccChanged:(id)arg1; - (void)_toChanged:(id)arg1; - (void)awakeFromNib; - (void)setRepresentedObject:(id)arg1; - (id)representedObject; - (id)view; - (id)nibName; - (void)dealloc; - (void)_composeViewControllerCommonInit; - (id)initWithNibName:(id)arg1 bundle:(id)arg2; - (id)init; @end
set Date 1581285737 set Time 537797 set Problem P1 set Team a61131 set Classify {Compile Time Error} set Mark 0 set Size 579 set Observations {} set Execution -1 set State pending set Language {Java zipped} set Program A.zip set Report 1.html set Elapsed 0 set CPU 0 set Memory 0 set Feedback {{Observações de &lt;b&gt;Compile Time Error&lt;/b&gt; &lt;pre&gt;javac: file not found: /*.java Usage: javac &lt;options&gt; &lt;source files&gt; use -help for a list of possible options&lt;/pre&gt;}}
// Tests for import Vector :: * ; import StmtFSM :: * ; typedef Bit#(4) Basic ; typedef Vector#(6,Basic) BasicV ; (* synthesize *) module sysMiscFunc() ; Reg#(BasicV) current <- mkReg( map( fromInteger, genVector ) ) ; Reg#(UInt#(3)) idx <- mkReg( 1 ) ; function Action displayVs( String s ) ; return action $display( "%s", s ) ; $display( "Values are [5:0]: %h, %h, %h, %h, %h, %h", current[5], current[4], current[3], current[2], current[1], current[0] ) ; $display( "Packed values are: %h", pack( current ) ) ; endaction; endfunction Vector#(16,Basic) foo = map( fromInteger, genVector ) ; Vector#(6, Reg#(Basic)) vregs <- replicateM (mkReg(0)); Reg#(Bit#(7)) xx1 <- mkReg(0); Reg#(Bit#(8)) xx8 <- mkReg(0); function Action dv (xxx) = $display ( "%b msb = %b parity = %b, rev = %b, Ones = %d, MSB zeros = %d, LSB zeros = %d", xxx, msb(xxx), parity(xxx), reverseBits(xxx), countOnes(xxx), countZerosMSB(xxx), countZerosLSB(xxx) ); function Action ds( x, y) = $display( "%b, truncateLSB = %b ", x, y ) ; function Action rtrun ( f ) = action Bit#(6) f6 = truncateLSB(f); ds( f, f6 ); Bit#(5) f5 = truncateLSB(f); ds( f, f5 ); Bit#(4) f4 = truncateLSB(f); ds( f, f4 ); Bit#(3) f3 = truncateLSB(f); ds( f, f3 ); Bit#(2) f2 = truncateLSB(f); ds( f, f2 ); Bit#(1) f1 = truncateLSB(f); ds( f, f1 ); Bit#(0) f0 = truncateLSB(f); ds( f, f0 ); endaction ; Stmt testseq = seq displayVs( "initial" ) ; writeVReg( vregs, drop (foo) ); current <= readVReg (vregs); displayVs( "read & writeVreg" ) ; writeVReg( vregs, take (foo) ); current <= readVReg (vregs); displayVs( "read & writeVreg head" ) ; $display ( "reverseBits: %b %b", pack(current), reverseBits(pack(current)) ) ; action xx1 <= 1 ; endaction action dv(xx1); xx1 <= 3 ; endaction action dv(xx1) ; xx1 <= 2 ; endaction action dv(xx1) ; xx1 <= 7'h41 ; endaction action dv(xx1) ; xx1 <= 7'h42 ; endaction action dv(xx1) ; xx1 <= 7'h43 ; endaction action dv(xx1) ; xx1 <= 7'h43 ; endaction action dv(xx1) ; xx1 <= 7'h50 ; endaction action dv(xx1) ; xx1 <= 7'h05 ; endaction action dv(xx1); xx8 <= '1 ; endaction action dv(xx8); xx8 <= '0 ; endaction action dv(xx8); xx8 <= 'haa ; endaction action dv(xx8); xx8 <= 'h55 ; endaction action dv(xx8); xx8 <= 'h81 ; endaction action dv(xx8); endaction action rtrun(xx8) ; xx8 <= 'hbc ; Bit#(7) f = 7'b0010011 ; rtrun(f) ; rtrun( reverseBits(f)) ; rtrun ( 9'b1100_01111 ); endaction action rtrun(xx8); endaction endseq; mkAutoFSM( testseq ) ; endmodule
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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. */ namespace java org.apache.flume.service enum Status { OK, FAILED } struct ResponseState{ 1: optional Status status 2: optional string msg } enum SourceType{ HTTP, KAFKA, DB, HDFS } enum SinkType{ ES, HDFS, KAFKA, LOGGER } struct HttpSource{ 1: required string port } struct KafkaSource{ 1: required string servers 2: required string topics 3: optional string group } struct HDFSSource{ 1: required string host } enum DBType{ MYSQL, SQLSERVER, ORACLE } struct DBSource{ 1: required string host 2: required string port 3: required string username 4: required string password 5: required string dbName 6: required string sql 7: required string interval 8: required DBType type } struct ESSink{ 1: required string hostNames 2: optional string indexName 3: optional string indexType 4: optional string clusterName 5: optional string contentType } struct HDFSSink{ 1: required string path 2: optional string filePrefix } struct KafkaSink{ 1: required string topic 2: required string servers } struct FlumeSource { 1:required SourceType sourceType 2:optional HttpSource httpSource 3:optional KafkaSource kafkaSource 4:optional HDFSSource hdfsSource 5:optional DBSource dbSource 6: optional list<Interceptor> interceptorList } struct FlumeSink { 1:required SinkType SinkType 2:optional HDFSSink hdfsSink 3:optional ESSink esSink 4:optional KafkaSink kafkaSink } struct Interceptor{ 1:required string type 2:optional map<string,string> params } struct FlumeAgent { 1:required string agentName 2: required list<FlumeSource> sourceList 3: required list<FlumeSink> sinkList } service FlumeControllerService { ResponseState startFlumeAgent(1:FlumeAgent agent) ResponseState stopFlumeAgent(1:string agentName) //Override if exist ResponseState saveOrUpdateConf(1:FlumeAgent agent) ResponseState deleteFlumeAgent(1:string agentName) }
subroutine gg_h_v(p,msqv) implicit none include 'constants.f' include 'qcdcouple.f' include 'epinv.f' include 'epinv2.f' include 'scheme.f' include 'scale.f' double precision msq(-nf:nf,-nf:nf),msqv(-nf:nf,-nf:nf), . p(mxpart,4),dot,xl12 integer j,k do j=-nf,nf do k=-nf,nf msqv(j,k)=0d0 enddo enddo call gg_h(p,msq) xl12=log(two*dot(p,1,2)/musq) c--sum of virtual diagram in DRED and UV counterterm including C--term required to bring into the MSbar scheme scheme='dred' msqv(0,0)=ason2pi*xn*2d0*( . -epinv*(epinv2-xl12)-0.5d0*xl12**2+11d0/6d0+0.5d0*pisq . -((11d0-two*dble(nf)/xn)*epinv-1d0)/6d0)*msq(0,0) return end
/** * Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com> */ package akka.camel import akka.actor.ActorRef import akka.camel.internal.component.CamelPath import org.apache.camel.model.ProcessorDefinition import scala.concurrent.duration.Duration /** * Wraps a [[org.apache.camel.model.ProcessorDefinition]]. * There is an implicit conversion in the [[akka.camel]] package object that converts a `ProcessorDefinition` into `this` type. * Because of this conversion, it is possible to use an [[akka.actor.ActorRef]] as a `to` parameter in building a route: * {{{ * class TestRoute(system: ActorSystem) extends RouteBuilder { * val responder = system.actorOf(Props[TestResponder], name = "TestResponder") * * def configure { * from("direct:producer").to(responder) * } * } * }}} * @param definition the processor definition */ class ActorRouteDefinition[T <: ProcessorDefinition[T]](definition: ProcessorDefinition[T]) { /** * Sends the message to an ActorRef endpoint. * @param actorRef the actorRef to the actor. * @return the path to the actor, as a camel uri String */ def to(actorRef: ActorRef): T = definition.to(CamelPath.toUri(actorRef)) /** * Sends the message to an ActorRef endpoint * @param actorRef the consumer * @param autoAck Determines whether one-way communications between an endpoint and this consumer actor * should be auto-acknowledged or application-acknowledged. * This flag has only effect when exchange is in-only. * @param replyTimeout When endpoint is out-capable (can produce responses) replyTimeout is the maximum time * the endpoint can take to send the response before the message exchange fails. It defaults to 1 minute. * This setting is used for out-capable, in-only, manually acknowledged communication. * @return the path to the actor, as a camel uri String */ def to(actorRef: ActorRef, autoAck: Boolean, replyTimeout: Duration): T = definition.to(CamelPath.toUri(actorRef, autoAck, replyTimeout)) }
\documentclass{article} %include lhs2TeX.fmt \usepackage{amsmath, amssymb} \usepackage{url} \usepackage{tabularx} \usepackage{inconsolata} \usepackage[T1]{fontenc} \usepackage[pdftex]{graphicx, color} \usepackage{comment} % makes \begin{conceal}...\end{conceal} a comment; % intended for hiding code that should be compiled \excludecomment{conceal} \newcommand{\prob}[1]{\noindent\textbf{#1} \nopagebreak} %-- Commands for header \renewcommand{\title}[1]{\textbf{#1}\\} \renewcommand{\line}{\begin{tabularx}{\textwidth}{X>{\raggedleft}X}\hline\\\end{tabularx}\\[-0.5cm]} \newcommand{\leftright}[2]{\begin{tabularx}{\textwidth}{X>{\raggedleft}X}#1% & #2\\\end{tabularx}\\[-0.5cm]} \newlength{\oldparindent} \newenvironment{code} {\tt\setlength{\oldparindent}{\parindent} \setlength{\parindent}{0pt}} {\setlength{\parindent}{\oldparindent}} \newsavebox{\spaceb} \newsavebox{\tabb} \savebox{\spaceb}[1ex]{~} \savebox{\tabb}[4ex]{~} \newcommand{\hsspace}{\usebox{\spaceb}} \newcommand{\hstab}{\usebox{\tabb}} \begin{document} \title{6.820 PS<+ PS NUM +> Problem <+ NUM +>} \line \leftright{\today}{Tej Chajed} \begin{conceal} \begin{code} {-# OPTIONS_GHC -fno-warn-unused-binds #-} -- {-# OPTIONS_GHC -fno-warn-missing-signatures #-} -- {-# ANN module "HLint: ignore Redundant bracket" #-} main :: IO () main = return () \end{code} \end{conceal} \end{document}
Instance: obsDynamic2 InstanceOf: BeObservationLaboratory Usage: #definition * status = #final * code = $loinc#53093-1 "Glucose^post XXX challenge" * effectiveDateTime = "2015-11-04T09:16:00-05:00" * issued = "2015-11-04T09:16:00-05:00" * performer = Reference(Practitioner/practitioner10) * valueQuantity = 9.1 'mmol/l' "mmol/l" * component.code = $sct#118578006 "Relative time" * component.valueQuantity = 240 'min' "min"
grammar CSV; @header { package csv; } file returns [List<List<String>> data] @init {$data = new ArrayList<List<String>>();} : (row {$data.add($row.list);})+ EOF ; row returns [List<String> list] @init {$list = new ArrayList<String>();} : a=value {$list.add($a.val);} (Comma b=value {$list.add($b.val);})* (LineBreak | EOF) ; value returns [String val] : SimpleValue {$val = $SimpleValue.text;} | QuotedValue { $val = $QuotedValue.text; $val = $val.substring(1, $val.length()-1); // remove leading- and trailing quotes $val = $val.replace("\"\"", "\""); // replace all `""` with `"` } ; Comma : ',' ; LineBreak : '\r'? '\n' | '\r' ; SimpleValue : ~[,\r\n"]+ ; QuotedValue : '"' ('""' | ~'"')* '"' ;
-- Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute -- -- 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. # Patch SQL required to convert Ensembl version 27 schemas to version 28 # Now have 2 separate RefSeq external_db entries UPDATE external_db SET db_name='RefSeq_dna' WHERE db_name='RefSeq'; # Add Flybase external_db entries INSERT INTO external_db VALUES (803, 'flybase_polypeptide_id', 1, 'KNOWNXREF'); INSERT INTO external_db VALUES (805, 'flybase_annotation_id', 1, 'KNOWNXREF'); # Modify column definition of xref.dbprimary_acc to remove binary property ALTER TABLE xref MODIFY dbprimary_acc VARCHAR(40) NOT NULL; # Add analysis_description table CREATE TABLE analysis_description ( analysis_id int(10) unsigned NOT NULL, description text, display_label varchar(255), KEY analysis_idx( analysis_id ) );
// ************************************************************************** // Generator: Instance of 'Compiler' // ************************************************************************** // ignore_for_file: cancel_subscriptions,constant_identifier_names,non_constant_identifier_names,library_prefixes,UNUSED_SHOWN_NAME import 'ng_zone.dart'; export 'ng_zone.dart'; import 'dart:async'; import 'package:meta/meta.dart'; import 'package:stack_trace/stack_trace.dart'; // No initReflector() linking required. void initReflector() {}
namespace go gentest typedef binary Binary typedef string String typedef i32 Int32 struct St { 1: Binary b (go.tag="json:\"b_field\" xml:\"BField\""), 2: optional String S, 3: Int32 i }
(defproject cliza "0.1.0-SNAPSHOT" :description "Eliza from PAIP in Clojure" :url "https://github.com/bass3m/cliza" :license {:name "MIT"} :dependencies [[org.clojure/clojure "1.6.0"]] :main cliza.eliza)
syntax = "proto3"; package solidity; // Structures for representing Solidity's native primitive types // borrow from shmookey/solpb and remove some definitions, // which should compatible with pb native type (eg. stirng/bool/uint32/uint64) // or other solidity type (eg. uint/int) message address { bytes data = 1; } message uint8 { bytes data = 1; } message uint16 { bytes data = 1; } message uint24 { bytes data = 1; } message uint32 { bytes data = 1; } message uint40 { bytes data = 1; } message uint48 { bytes data = 1; } message uint56 { bytes data = 1; } message uint64 { bytes data = 1; } message uint72 { bytes data = 1; } message uint80 { bytes data = 1; } message uint88 { bytes data = 1; } message uint96 { bytes data = 1; } message uint104 { bytes data = 1; } message uint112 { bytes data = 1; } message uint120 { bytes data = 1; } message uint128 { bytes data = 1; } message uint136 { bytes data = 1; } message uint144 { bytes data = 1; } message uint152 { bytes data = 1; } message uint160 { bytes data = 1; } message uint168 { bytes data = 1; } message uint176 { bytes data = 1; } message uint184 { bytes data = 1; } message uint192 { bytes data = 1; } message uint200 { bytes data = 1; } message uint208 { bytes data = 1; } message uint216 { bytes data = 1; } message uint224 { bytes data = 1; } message uint232 { bytes data = 1; } message uint240 { bytes data = 1; } message uint248 { bytes data = 1; } message uint256 { bytes data = 1; } message int8 { bytes data = 1; } message int16 { bytes data = 1; } message int24 { bytes data = 1; } message int32 { bytes data = 1; } message int40 { bytes data = 1; } message int48 { bytes data = 1; } message int56 { bytes data = 1; } message int64 { bytes data = 1; } message int72 { bytes data = 1; } message int80 { bytes data = 1; } message int88 { bytes data = 1; } message int96 { bytes data = 1; } message int104 { bytes data = 1; } message int112 { bytes data = 1; } message int120 { bytes data = 1; } message int128 { bytes data = 1; } message int136 { bytes data = 1; } message int144 { bytes data = 1; } message int152 { bytes data = 1; } message int160 { bytes data = 1; } message int168 { bytes data = 1; } message int176 { bytes data = 1; } message int184 { bytes data = 1; } message int192 { bytes data = 1; } message int200 { bytes data = 1; } message int208 { bytes data = 1; } message int216 { bytes data = 1; } message int224 { bytes data = 1; } message int232 { bytes data = 1; } message int240 { bytes data = 1; } message int248 { bytes data = 1; } message int256 { bytes data = 1; } // fixed bytes (really needed?) message bytes1 { bytes data = 1; } message bytes2 { bytes data = 1; } message bytes3 { bytes data = 1; } message bytes4 { bytes data = 1; } message bytes5 { bytes data = 1; } message bytes6 { bytes data = 1; } message bytes7 { bytes data = 1; } message bytes8 { bytes data = 1; } message bytes9 { bytes data = 1; } message bytes10 { bytes data = 1; } message bytes11 { bytes data = 1; } message bytes12 { bytes data = 1; } message bytes13 { bytes data = 1; } message bytes14 { bytes data = 1; } message bytes15 { bytes data = 1; } message bytes16 { bytes data = 1; } message bytes17 { bytes data = 1; } message bytes18 { bytes data = 1; } message bytes19 { bytes data = 1; } message bytes20 { bytes data = 1; } message bytes21 { bytes data = 1; } message bytes22 { bytes data = 1; } message bytes23 { bytes data = 1; } message bytes24 { bytes data = 1; } message bytes25 { bytes data = 1; } message bytes26 { bytes data = 1; } message bytes27 { bytes data = 1; } message bytes28 { bytes data = 1; } message bytes29 { bytes data = 1; } message bytes30 { bytes data = 1; } message bytes31 { bytes data = 1; } message bytes32 { bytes data = 1; }
# Description: Using Net::SMTP module to send mails use Net::SMTP; # TODO: Reconfigure to use google $smtp = Net::SMTP->new('MAYA'); # Connect to an SMTP server $smtp->mail( 'vikash@aztec.soft.net' ); # Use the sender's address here $smtp->to('vikash@aztec.soft.net'); # Use recipient's address here $smtp->data(); # Start the mail # Send the header. $smtp->datasend("To: Vikash\@aztec.soft.net\n"); $smtp->datasend("From: Vikash\@aztec.soft.net\n"); $smtp->datasend("Subject: Mail from Perl\n"); $smtp->datasend("\n"); # Send the body. $smtp->datasend("\n\n\t\tHello, World!\n"); $smtp->dataend(); # Finish sending the mail $smtp->quit; # Close the SMTP connection
/* * Copyright 2019 LogMeIn * * 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. * * SPDX-License-Identifier: Apache-2.0 */ #pragma once #include <gmock/gmock.h> #include <asyncly/task/Cancelable.h> namespace asyncly { class MockCancelable : public Cancelable { public: MOCK_METHOD0(cancel, void()); }; }
package Mojo::UserAgent; use Mojo::Base 'Mojo::EventEmitter'; # "Fry: Since when is the Internet about robbing people of their privacy? # Bender: August 6, 1991." use Mojo::IOLoop; use Mojo::Promise; use Mojo::Util qw(monkey_patch term_escape); use Mojo::UserAgent::CookieJar; use Mojo::UserAgent::Proxy; use Mojo::UserAgent::Server; use Mojo::UserAgent::Transactor; use Scalar::Util 'weaken'; use constant DEBUG => $ENV{MOJO_USERAGENT_DEBUG} || 0; has ca => sub { $ENV{MOJO_CA_FILE} }; has cert => sub { $ENV{MOJO_CERT_FILE} }; has connect_timeout => sub { $ENV{MOJO_CONNECT_TIMEOUT} || 10 }; has cookie_jar => sub { Mojo::UserAgent::CookieJar->new }; has [qw(local_address max_response_size)]; has inactivity_timeout => sub { $ENV{MOJO_INACTIVITY_TIMEOUT} // 20 }; has ioloop => sub { Mojo::IOLoop->new }; has key => sub { $ENV{MOJO_KEY_FILE} }; has max_connections => 5; has max_redirects => sub { $ENV{MOJO_MAX_REDIRECTS} || 0 }; has proxy => sub { Mojo::UserAgent::Proxy->new }; has request_timeout => sub { $ENV{MOJO_REQUEST_TIMEOUT} // 0 }; has server => sub { Mojo::UserAgent::Server->new(ioloop => shift->ioloop) }; has transactor => sub { Mojo::UserAgent::Transactor->new }; # Common HTTP methods for my $name (qw(DELETE GET HEAD OPTIONS PATCH POST PUT)) { monkey_patch __PACKAGE__, lc $name, sub { my ($self, $cb) = (shift, ref $_[-1] eq 'CODE' ? pop : undef); return $self->start($self->build_tx($name, @_), $cb); }; monkey_patch __PACKAGE__, lc($name) . '_p', sub { my $self = shift; return $self->start_p($self->build_tx($name, @_)); }; } sub DESTROY { Mojo::Util::_global_destruction() or shift->_cleanup } sub build_tx { shift->transactor->tx(@_) } sub build_websocket_tx { shift->transactor->websocket(@_) } sub start { my ($self, $tx, $cb) = @_; # Fork-safety $self->_cleanup->server->restart unless ($self->{pid} //= $$) eq $$; # Non-blocking if ($cb) { warn "-- Non-blocking request (@{[_url($tx)]})\n" if DEBUG; return $self->_start(Mojo::IOLoop->singleton, $tx, $cb); } # Blocking warn "-- Blocking request (@{[_url($tx)]})\n" if DEBUG; $self->_start($self->ioloop, $tx => sub { shift->ioloop->stop; $tx = shift }); $self->ioloop->start; return $tx; } sub start_p { my ($self, $tx) = @_; my $promise = Mojo::Promise->new; $self->start( $tx => sub { my ($self, $tx) = @_; my $err = $tx->error; return $promise->reject($err->{message}) if $err && !$err->{code}; return $promise->reject('WebSocket handshake failed') if $tx->req->is_handshake && !$tx->is_websocket; $promise->resolve($tx); } ); return $promise; } sub websocket { my ($self, $cb) = (shift, pop); $self->start($self->build_websocket_tx(@_), $cb); } sub websocket_p { my $self = shift; return $self->start_p($self->build_websocket_tx(@_)); } sub _cleanup { my $self = shift; delete $self->{pid}; $self->_finish($_, 1) for keys %{$self->{connections} || {}}; return $self; } sub _connect { my ($self, $loop, $peer, $tx, $handle, $cb) = @_; my $t = $self->transactor; my ($proto, $host, $port) = $peer ? $t->peer($tx) : $t->endpoint($tx); my %options = (timeout => $self->connect_timeout); if ($proto eq 'http+unix') { $options{path} = $host } else { @options{qw(address port)} = ($host, $port) } if (my $local = $self->local_address) { $options{local_address} = $local } $options{handle} = $handle if $handle; # SOCKS if ($proto eq 'socks') { @options{qw(socks_address socks_port)} = @options{qw(address port)}; ($proto, @options{qw(address port)}) = $t->endpoint($tx); my $userinfo = $tx->req->via_proxy(0)->proxy->userinfo; @options{qw(socks_user socks_pass)} = split ':', $userinfo if $userinfo; } # TLS map { $options{"tls_$_"} = $self->$_ } qw(ca cert key) if ($options{tls} = $proto eq 'https'); weaken $self; my $id; return $id = $loop->client( %options => sub { my ($loop, $err, $stream) = @_; # Connection error return unless $self; return $self->_error($id, $err) if $err; # Connection established $stream->on(timeout => sub { $self->_error($id, 'Inactivity timeout') }); $stream->on(close => sub { $self && $self->_finish($id, 1) }); $stream->on(error => sub { $self && $self->_error($id, pop) }); $stream->on(read => sub { $self->_read($id, pop) }); $self->$cb($id); } ); } sub _connect_proxy { my ($self, $loop, $old, $cb) = @_; # Start CONNECT request return undef unless my $new = $self->transactor->proxy_connect($old); return $self->_start( ($loop, $new) => sub { my ($self, $tx) = @_; # CONNECT failed $old->previous($tx)->req->via_proxy(0); my $id = $tx->connection; if ($tx->error || !$tx->res->is_success || !$tx->keep_alive) { $old->res->error({message => 'Proxy connection failed'}); $self->_remove($id) if $id; return $self->$cb($old); } # Start real transaction without TLS upgrade return $self->_start($loop, $old->connection($id), $cb) unless $tx->req->url->protocol eq 'https'; # TLS upgrade before starting the real transaction my $handle = $loop->stream($id)->steal_handle; $self->_remove($id); $id = $self->_connect($loop, 0, $old, $handle, sub { shift->_start($loop, $old->connection($id), $cb) }); $self->{connections}{$id} = {cb => $cb, ioloop => $loop, tx => $old}; } ); } sub _connected { my ($self, $id) = @_; my $c = $self->{connections}{$id}; my $stream = $c->{ioloop}->stream($id)->timeout($self->inactivity_timeout); my $tx = $c->{tx}->connection($id); my $handle = $stream->handle; unless ($handle->isa('IO::Socket::UNIX')) { $tx->local_address($handle->sockhost)->local_port($handle->sockport); $tx->remote_address($handle->peerhost)->remote_port($handle->peerport); } weaken $self; $tx->on(resume => sub { $self->_write($id) }); $self->_write($id); } sub _connection { my ($self, $loop, $tx, $cb) = @_; # Reuse connection my ($proto, $host, $port) = $self->transactor->endpoint($tx); my $id = $tx->connection || $self->_dequeue($loop, "$proto:$host:$port", 1); if ($id) { warn "-- Reusing connection $id ($proto://$host:$port)\n" if DEBUG; @{$self->{connections}{$id}}{qw(cb tx)} = ($cb, $tx); $tx->kept_alive(1) unless $tx->connection; $self->_connected($id); return $id; } # CONNECT request to proxy required if (my $id = $self->_connect_proxy($loop, $tx, $cb)) { return $id } # New connection $tx->res->error({message => "Unsupported protocol: $proto"}) and return $loop->next_tick(sub { $self->$cb($tx) }) unless $proto eq 'http' || $proto eq 'https' || $proto eq 'http+unix'; $id = $self->_connect($loop, 1, $tx, undef, \&_connected); warn "-- Connect $id ($proto://$host:$port)\n" if DEBUG; $self->{connections}{$id} = {cb => $cb, ioloop => $loop, tx => $tx}; return $id; } sub _dequeue { my ($self, $loop, $name, $test) = @_; my $old = $self->{queue}{$loop} ||= []; my ($found, @new); for my $queued (@$old) { push @new, $queued and next if $found || !grep { $_ eq $name } @$queued; # Search for id/name and sort out corrupted connections if necessary next unless my $stream = $loop->stream($queued->[1]); $test && $stream->is_readable ? $stream->close : ($found = $queued->[1]); } @$old = @new; return $found; } sub _error { my ($self, $id, $err) = @_; my $tx = $self->{connections}{$id}{tx}; $tx->res->error({message => $err}) if $tx; $self->_finish($id, 1); } sub _finish { my ($self, $id, $close) = @_; # Remove request timeout and finish transaction return unless my $c = $self->{connections}{$id}; $c->{ioloop}->remove($c->{timeout}) if $c->{timeout}; return $self->_reuse($id, $close) unless my $old = $c->{tx}; # Premature connection close my $res = $old->closed->res->finish; if ($close && !$res->code && !$res->error) { $res->error({message => 'Premature connection close'}); } # Always remove connection for WebSockets return $self->_remove($id) if $old->is_websocket; $self->cookie_jar->collect($old); # Upgrade connection to WebSocket if (my $new = $self->transactor->upgrade($old)) { weaken $self; $new->on(resume => sub { $self->_write($id) }); $c->{cb}($self, $c->{tx} = $new); return $new->client_read($old->res->content->leftovers); } # CONNECT requests always have a follow-up request $self->_reuse($id, $close) unless uc $old->req->method eq 'CONNECT'; $res->error({message => $res->message, code => $res->code}) if $res->is_error; $c->{cb}($self, $old) unless $self->_redirect($c, $old); } sub _read { my ($self, $id, $chunk) = @_; # Corrupted connection return $self->_remove($id) unless my $tx = $self->{connections}{$id}{tx}; warn term_escape "-- Client <<< Server (@{[_url($tx)]})\n$chunk\n" if DEBUG; $tx->client_read($chunk); $self->_finish($id) if $tx->is_finished; } sub _redirect { my ($self, $c, $old) = @_; return undef unless my $new = $self->transactor->redirect($old); return undef unless @{$old->redirects} < $self->max_redirects; return $self->_start($c->{ioloop}, $new, delete $c->{cb}); } sub _remove { my ($self, $id) = @_; my $c = delete $self->{connections}{$id}; $self->_dequeue($c->{ioloop}, $id); $c->{ioloop}->remove($id); } sub _reuse { my ($self, $id, $close) = @_; # Connection close my $c = $self->{connections}{$id}; my $tx = delete $c->{tx}; my $max = $self->max_connections; return $self->_remove($id) if $close || !$tx || !$max || !$tx->keep_alive || $tx->error; # Keep connection alive my $queue = $self->{queue}{$c->{ioloop}} ||= []; $self->_remove(shift(@$queue)->[1]) while @$queue && @$queue >= $max; push @$queue, [join(':', $self->transactor->endpoint($tx)), $id]; } sub _start { my ($self, $loop, $tx, $cb) = @_; # Application serve my $url = $tx->req->url; unless ($url->is_abs) { my $base = $loop == $self->ioloop ? $self->server->url : $self->server->nb_url; $url->scheme($base->scheme)->host($base->host)->port($base->port); } $_->prepare($tx) for $self->proxy, $self->cookie_jar; my $max = $self->max_response_size; $tx->res->max_message_size($max) if defined $max; $self->emit(start => $tx); return undef unless my $id = $self->_connection($loop, $tx, $cb); if (my $timeout = $self->request_timeout) { weaken $self; $self->{connections}{$id}{timeout} = $loop->timer($timeout => sub { $self->_error($id, 'Request timeout') }); } return $id; } sub _url { shift->req->url->to_abs } sub _write { my ($self, $id) = @_; # Protect from resume event recursion my $c = $self->{connections}{$id}; return if !(my $tx = $c->{tx}) || $c->{writing}; local $c->{writing} = 1; my $chunk = $tx->client_write; warn term_escape "-- Client >>> Server (@{[_url($tx)]})\n$chunk\n" if DEBUG; return unless length $chunk; weaken $self; $c->{ioloop}->stream($id)->write($chunk => sub { $self->_write($id) }); } 1; =encoding utf8 =head1 NAME Mojo::UserAgent - Non-blocking I/O HTTP and WebSocket user agent =head1 SYNOPSIS use Mojo::UserAgent; # Fine grained response handling (dies on connection errors) my $ua = Mojo::UserAgent->new; my $res = $ua->get('mojolicious.org/perldoc')->result; if ($res->is_success) { say $res->body } elsif ($res->is_error) { say $res->message } elsif ($res->code == 301) { say $res->headers->location } else { say 'Whatever...' } # Say hello to the Unicode snowman and include an Accept header say $ua->get('www.☃.net?hello=there' => {Accept => '*/*'})->result->body; # Extract data from HTML and XML resources with CSS selectors say $ua->get('www.perl.org')->result->dom->at('title')->text; # Scrape the latest headlines from a news site say $ua->get('blogs.perl.org') ->result->dom->find('h2 > a')->map('text')->join("\n"); # IPv6 PUT request with Content-Type header and content my $tx = $ua->put('[::1]:3000' => {'Content-Type' => 'text/plain'} => 'Hi!'); # Quick JSON API request with Basic authentication my $value = $ua->get('https://sri:t3st@example.com/test.json')->result->json; # JSON POST (application/json) with TLS certificate authentication my $tx = $ua->cert('tls.crt')->key('tls.key') ->post('https://example.com' => json => {top => 'secret'}); # Search DuckDuckGo anonymously through Tor $ua->proxy->http('socks://127.0.0.1:9050'); say $ua->get('api.3g2upl4pq6kufc4m.onion/?q=mojolicious&format=json') ->result->json('/Abstract'); # GET request via UNIX domain socket "/tmp/myapp.sock" (percent encoded slash) say $ua->get('http+unix://%2Ftmp%2Fmyapp.sock/perldoc')->result->body; # Follow redirects to download Mojolicious from GitHub $ua->max_redirects(5) ->get('https://www.github.com/kraih/mojo/tarball/master') ->result->content->asset->move_to('/home/sri/mojo.tar.gz'); # Form POST (application/x-www-form-urlencoded) with manual exception handling my $tx = $ua->post('https://metacpan.org/search' => form => {q => 'mojo'}); if (my $res = $tx->success) { say $res->body } else { my $err = $tx->error; die "$err->{code} response: $err->{message}" if $err->{code}; die "Connection error: $err->{message}"; } # Non-blocking request $ua->get('mojolicious.org' => sub { my ($ua, $tx) = @_; say $tx->result->dom->at('title')->text; }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running; # Concurrent non-blocking requests (synchronized with promises) my $mojo = $ua->get_p('mojolicious.org'); my $cpan = $ua->get_p('cpan.org'); Mojo::Promise->all($mojo, $cpan)->then(sub { my ($mojo, $cpan) = @_; say $mojo->[0]->result->dom->at('title')->text; say $cpan->[0]->result->dom->at('title')->text; })->wait; # WebSocket connection sending and receiving JSON via UNIX domain socket $ua->websocket('ws+unix://%2Ftmp%2Fmyapp.sock/echo.json' => sub { my ($ua, $tx) = @_; say 'WebSocket handshake failed!' and return unless $tx->is_websocket; $tx->on(json => sub { my ($tx, $hash) = @_; say "WebSocket message via JSON: $hash->{msg}"; $tx->finish; }); $tx->send({json => {msg => 'Hello World!'}}); }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running; =head1 DESCRIPTION L<Mojo::UserAgent> is a full featured non-blocking I/O HTTP and WebSocket user agent, with IPv6, TLS, SNI, IDNA, HTTP/SOCKS5 proxy, UNIX domain socket, Comet (long polling), Promises/A+, keep-alive, connection pooling, timeout, cookie, multipart, gzip compression and multiple event loop support. All connections will be reset automatically if a new process has been forked, this allows multiple processes to share the same L<Mojo::UserAgent> object safely. For better scalability (epoll, kqueue) and to provide non-blocking name resolution, SOCKS5 as well as TLS support, the optional modules L<EV> (4.0+), L<Net::DNS::Native> (0.15+), L<IO::Socket::Socks> (0.64+) and L<IO::Socket::SSL> (1.94+) will be used automatically if possible. Individual features can also be disabled with the C<MOJO_NO_NNR>, C<MOJO_NO_SOCKS> and C<MOJO_NO_TLS> environment variables. See L<Mojolicious::Guides::Cookbook/"USER AGENT"> for more. =head1 EVENTS L<Mojo::UserAgent> inherits all events from L<Mojo::EventEmitter> and can emit the following new ones. =head2 start $ua->on(start => sub { my ($ua, $tx) = @_; ... }); Emitted whenever a new transaction is about to start, this includes automatically prepared proxy C<CONNECT> requests and followed redirects. $ua->on(start => sub { my ($ua, $tx) = @_; $tx->req->headers->header('X-Bender' => 'Bite my shiny metal ass!'); }); =head1 ATTRIBUTES L<Mojo::UserAgent> implements the following attributes. =head2 ca my $ca = $ua->ca; $ua = $ua->ca('/etc/tls/ca.crt'); Path to TLS certificate authority file used to verify the peer certificate, defaults to the value of the C<MOJO_CA_FILE> environment variable. Also activates hostname verification. # Show certificate authorities for debugging IO::Socket::SSL::set_defaults( SSL_verify_callback => sub { say "Authority: $_[2]" and return $_[0] }); =head2 cert my $cert = $ua->cert; $ua = $ua->cert('/etc/tls/client.crt'); Path to TLS certificate file, defaults to the value of the C<MOJO_CERT_FILE> environment variable. =head2 connect_timeout my $timeout = $ua->connect_timeout; $ua = $ua->connect_timeout(5); Maximum amount of time in seconds establishing a connection may take before getting canceled, defaults to the value of the C<MOJO_CONNECT_TIMEOUT> environment variable or C<10>. =head2 cookie_jar my $cookie_jar = $ua->cookie_jar; $ua = $ua->cookie_jar(Mojo::UserAgent::CookieJar->new); Cookie jar to use for requests performed by this user agent, defaults to a L<Mojo::UserAgent::CookieJar> object. # Ignore all cookies $ua->cookie_jar->ignore(sub { 1 }); # Ignore cookies for public suffixes my $ps = IO::Socket::SSL::PublicSuffix->default; $ua->cookie_jar->ignore(sub { my $cookie = shift; return undef unless my $domain = $cookie->domain; return ($ps->public_suffix($domain))[0] eq ''; }); # Add custom cookie to the jar $ua->cookie_jar->add( Mojo::Cookie::Response->new( name => 'foo', value => 'bar', domain => 'mojolicious.org', path => '/perldoc' ) ); =head2 inactivity_timeout my $timeout = $ua->inactivity_timeout; $ua = $ua->inactivity_timeout(15); Maximum amount of time in seconds a connection can be inactive before getting closed, defaults to the value of the C<MOJO_INACTIVITY_TIMEOUT> environment variable or C<20>. Setting the value to C<0> will allow connections to be inactive indefinitely. =head2 ioloop my $loop = $ua->ioloop; $ua = $ua->ioloop(Mojo::IOLoop->new); Event loop object to use for blocking I/O operations, defaults to a L<Mojo::IOLoop> object. =head2 key my $key = $ua->key; $ua = $ua->key('/etc/tls/client.crt'); Path to TLS key file, defaults to the value of the C<MOJO_KEY_FILE> environment variable. =head2 local_address my $address = $ua->local_address; $ua = $ua->local_address('127.0.0.1'); Local address to bind to. =head2 max_connections my $max = $ua->max_connections; $ua = $ua->max_connections(5); Maximum number of keep-alive connections that the user agent will retain before it starts closing the oldest ones, defaults to C<5>. Setting the value to C<0> will prevent any connections from being kept alive. =head2 max_redirects my $max = $ua->max_redirects; $ua = $ua->max_redirects(3); Maximum number of redirects the user agent will follow before it fails, defaults to the value of the C<MOJO_MAX_REDIRECTS> environment variable or C<0>. =head2 max_response_size my $max = $ua->max_response_size; $ua = $ua->max_response_size(16777216); Maximum response size in bytes, defaults to the value of L<Mojo::Message::Response/"max_message_size">. Setting the value to C<0> will allow responses of indefinite size. Note that increasing this value can also drastically increase memory usage, should you for example attempt to parse an excessively large response body with the methods L<Mojo::Message/"dom"> or L<Mojo::Message/"json">. =head2 proxy my $proxy = $ua->proxy; $ua = $ua->proxy(Mojo::UserAgent::Proxy->new); Proxy manager, defaults to a L<Mojo::UserAgent::Proxy> object. # Detect proxy servers from environment $ua->proxy->detect; # Manually configure HTTP proxy (using CONNECT for HTTPS/WebSockets) $ua->proxy->http('http://127.0.0.1:8080')->https('http://127.0.0.1:8080'); # Manually configure Tor (SOCKS5) $ua->proxy->http('socks://127.0.0.1:9050')->https('socks://127.0.0.1:9050'); # Manually configure UNIX domain socket (using CONNECT for HTTPS/WebSockets) $ua->proxy->http('http+unix://%2Ftmp%2Fproxy.sock') ->https('http+unix://%2Ftmp%2Fproxy.sock'); =head2 request_timeout my $timeout = $ua->request_timeout; $ua = $ua->request_timeout(5); Maximum amount of time in seconds establishing a connection, sending the request and receiving a whole response may take before getting canceled, defaults to the value of the C<MOJO_REQUEST_TIMEOUT> environment variable or C<0>. Setting the value to C<0> will allow the user agent to wait indefinitely. The timeout will reset for every followed redirect. # Total limit of 5 seconds, of which 3 seconds may be spent connecting $ua->max_redirects(0)->connect_timeout(3)->request_timeout(5); =head2 server my $server = $ua->server; $ua = $ua->server(Mojo::UserAgent::Server->new); Application server relative URLs will be processed with, defaults to a L<Mojo::UserAgent::Server> object. # Mock web service $ua->server->app(Mojolicious->new); $ua->server->app->routes->get('/time' => sub { my $c = shift; $c->render(json => {now => time}); }); my $time = $ua->get('/time')->result->json->{now}; # Change log level $ua->server->app->log->level('fatal'); # Port currently used for processing relative URLs blocking say $ua->server->url->port; # Port currently used for processing relative URLs non-blocking say $ua->server->nb_url->port; =head2 transactor my $t = $ua->transactor; $ua = $ua->transactor(Mojo::UserAgent::Transactor->new); Transaction builder, defaults to a L<Mojo::UserAgent::Transactor> object. # Change name of user agent $ua->transactor->name('MyUA 1.0'); =head1 METHODS L<Mojo::UserAgent> inherits all methods from L<Mojo::EventEmitter> and implements the following new ones. =head2 build_tx my $tx = $ua->build_tx(GET => 'example.com'); my $tx = $ua->build_tx( PUT => 'http://example.com' => {Accept => '*/*'} => 'Content!'); my $tx = $ua->build_tx( PUT => 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'}); my $tx = $ua->build_tx( PUT => 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'}); Generate L<Mojo::Transaction::HTTP> object with L<Mojo::UserAgent::Transactor/"tx">. # Request with custom cookie my $tx = $ua->build_tx(GET => 'https://example.com/account'); $tx->req->cookies({name => 'user', value => 'sri'}); $tx = $ua->start($tx); # Deactivate gzip compression my $tx = $ua->build_tx(GET => 'example.com'); $tx->req->headers->remove('Accept-Encoding'); $tx = $ua->start($tx); # Interrupt response by raising an error my $tx = $ua->build_tx(GET => 'http://example.com'); $tx->res->on(progress => sub { my $res = shift; return unless my $server = $res->headers->server; $res->error({message => 'Oh noes, it is IIS!'}) if $server =~ /IIS/; }); $tx = $ua->start($tx); =head2 build_websocket_tx my $tx = $ua->build_websocket_tx('ws://example.com'); my $tx = $ua->build_websocket_tx( 'ws://example.com' => {DNT => 1} => ['v1.proto']); Generate L<Mojo::Transaction::HTTP> object with L<Mojo::UserAgent::Transactor/"websocket">. # Custom WebSocket handshake with cookie my $tx = $ua->build_websocket_tx('wss://example.com/echo'); $tx->req->cookies({name => 'user', value => 'sri'}); $ua->start($tx => sub { my ($ua, $tx) = @_; say 'WebSocket handshake failed!' and return unless $tx->is_websocket; $tx->on(message => sub { my ($tx, $msg) = @_; say "WebSocket message: $msg"; $tx->finish; }); $tx->send('Hi!'); }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running; =head2 delete my $tx = $ua->delete('example.com'); my $tx = $ua->delete('http://example.com' => {Accept => '*/*'} => 'Content!'); my $tx = $ua->delete( 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'}); my $tx = $ua->delete( 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'}); Perform blocking C<DELETE> request and return resulting L<Mojo::Transaction::HTTP> object, takes the same arguments as L<Mojo::UserAgent::Transactor/"tx"> (except for the C<DELETE> method, which is implied). You can also append a callback to perform requests non-blocking. $ua->delete('http://example.com' => json => {a => 'b'} => sub { my ($ua, $tx) = @_; say $tx->result->body; }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running; =head2 delete_p my $promise = $ua->delete_p('http://example.com'); Same as L</"delete">, but performs all requests non-blocking and returns a L<Mojo::Promise> object instead of accepting a callback. $ua->delete_p('http://example.com' => json => {a => 'b'})->then(sub { my $tx = shift; say $tx->result->body; })->catch(sub { my $err = shift; warn "Connection error: $err"; })->wait; =head2 get my $tx = $ua->get('example.com'); my $tx = $ua->get('http://example.com' => {Accept => '*/*'} => 'Content!'); my $tx = $ua->get( 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'}); my $tx = $ua->get( 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'}); Perform blocking C<GET> request and return resulting L<Mojo::Transaction::HTTP> object, takes the same arguments as L<Mojo::UserAgent::Transactor/"tx"> (except for the C<GET> method, which is implied). You can also append a callback to perform requests non-blocking. $ua->get('http://example.com' => json => {a => 'b'} => sub { my ($ua, $tx) = @_; say $tx->result->body; }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running; =head2 get_p my $promise = $ua->get_p('http://example.com'); Same as L</"get">, but performs all requests non-blocking and returns a L<Mojo::Promise> object instead of accepting a callback. $ua->get_p('http://example.com' => json => {a => 'b'})->then(sub { my $tx = shift; say $tx->result->body; })->catch(sub { my $err = shift; warn "Connection error: $err"; })->wait; =head2 head my $tx = $ua->head('example.com'); my $tx = $ua->head('http://example.com' => {Accept => '*/*'} => 'Content!'); my $tx = $ua->head( 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'}); my $tx = $ua->head( 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'}); Perform blocking C<HEAD> request and return resulting L<Mojo::Transaction::HTTP> object, takes the same arguments as L<Mojo::UserAgent::Transactor/"tx"> (except for the C<HEAD> method, which is implied). You can also append a callback to perform requests non-blocking. $ua->head('http://example.com' => json => {a => 'b'} => sub { my ($ua, $tx) = @_; say $tx->result->body; }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running; =head2 head_p my $promise = $ua->head_p('http://example.com'); Same as L</"head">, but performs all requests non-blocking and returns a L<Mojo::Promise> object instead of accepting a callback. $ua->head_p('http://example.com' => json => {a => 'b'})->then(sub { my $tx = shift; say $tx->result->body; })->catch(sub { my $err = shift; warn "Connection error: $err"; })->wait; =head2 options my $tx = $ua->options('example.com'); my $tx = $ua->options('http://example.com' => {Accept => '*/*'} => 'Content!'); my $tx = $ua->options( 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'}); my $tx = $ua->options( 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'}); Perform blocking C<OPTIONS> request and return resulting L<Mojo::Transaction::HTTP> object, takes the same arguments as L<Mojo::UserAgent::Transactor/"tx"> (except for the C<OPTIONS> method, which is implied). You can also append a callback to perform requests non-blocking. $ua->options('http://example.com' => json => {a => 'b'} => sub { my ($ua, $tx) = @_; say $tx->result->body; }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running; =head2 options_p my $promise = $ua->options_p('http://example.com'); Same as L</"options">, but performs all requests non-blocking and returns a L<Mojo::Promise> object instead of accepting a callback. $ua->options_p('http://example.com' => json => {a => 'b'})->then(sub { my $tx = shift; say $tx->result->body; })->catch(sub { my $err = shift; warn "Connection error: $err"; })->wait; =head2 patch my $tx = $ua->patch('example.com'); my $tx = $ua->patch('http://example.com' => {Accept => '*/*'} => 'Content!'); my $tx = $ua->patch( 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'}); my $tx = $ua->patch( 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'}); Perform blocking C<PATCH> request and return resulting L<Mojo::Transaction::HTTP> object, takes the same arguments as L<Mojo::UserAgent::Transactor/"tx"> (except for the C<PATCH> method, which is implied). You can also append a callback to perform requests non-blocking. $ua->patch('http://example.com' => json => {a => 'b'} => sub { my ($ua, $tx) = @_; say $tx->result->body; }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running; =head2 patch_p my $promise = $ua->patch_p('http://example.com'); Same as L</"patch">, but performs all requests non-blocking and returns a L<Mojo::Promise> object instead of accepting a callback. $ua->patch_p('http://example.com' => json => {a => 'b'})->then(sub { my $tx = shift; say $tx->result->body; })->catch(sub { my $err = shift; warn "Connection error: $err"; })->wait; =head2 post my $tx = $ua->post('example.com'); my $tx = $ua->post('http://example.com' => {Accept => '*/*'} => 'Content!'); my $tx = $ua->post( 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'}); my $tx = $ua->post( 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'}); Perform blocking C<POST> request and return resulting L<Mojo::Transaction::HTTP> object, takes the same arguments as L<Mojo::UserAgent::Transactor/"tx"> (except for the C<POST> method, which is implied). You can also append a callback to perform requests non-blocking. $ua->post('http://example.com' => json => {a => 'b'} => sub { my ($ua, $tx) = @_; say $tx->result->body; }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running; =head2 post_p my $promise = $ua->post_p('http://example.com'); Same as L</"post">, but performs all requests non-blocking and returns a L<Mojo::Promise> object instead of accepting a callback. $ua->post_p('http://example.com' => json => {a => 'b'})->then(sub { my $tx = shift; say $tx->result->body; })->catch(sub { my $err = shift; warn "Connection error: $err"; })->wait; =head2 put my $tx = $ua->put('example.com'); my $tx = $ua->put('http://example.com' => {Accept => '*/*'} => 'Content!'); my $tx = $ua->put( 'http://example.com' => {Accept => '*/*'} => form => {a => 'b'}); my $tx = $ua->put( 'http://example.com' => {Accept => '*/*'} => json => {a => 'b'}); Perform blocking C<PUT> request and return resulting L<Mojo::Transaction::HTTP> object, takes the same arguments as L<Mojo::UserAgent::Transactor/"tx"> (except for the C<PUT> method, which is implied). You can also append a callback to perform requests non-blocking. $ua->put('http://example.com' => json => {a => 'b'} => sub { my ($ua, $tx) = @_; say $tx->result->body; }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running; =head2 put_p my $promise = $ua->put_p('http://example.com'); Same as L</"put">, but performs all requests non-blocking and returns a L<Mojo::Promise> object instead of accepting a callback. $ua->put_p('http://example.com' => json => {a => 'b'})->then(sub { my $tx = shift; say $tx->result->body; })->catch(sub { my $err = shift; warn "Connection error: $err"; })->wait; =head2 start my $tx = $ua->start(Mojo::Transaction::HTTP->new); Perform blocking request for a custom L<Mojo::Transaction::HTTP> object, which can be prepared manually or with L</"build_tx">. You can also append a callback to perform requests non-blocking. my $tx = $ua->build_tx(GET => 'http://example.com'); $ua->start($tx => sub { my ($ua, $tx) = @_; say $tx->result->body; }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running; =head2 start_p my $promise = $ua->start_p(Mojo::Transaction::HTTP->new); Same as L</"start">, but performs all requests non-blocking and returns a L<Mojo::Promise> object instead of accepting a callback. my $tx = $ua->build_tx(GET => 'http://example.com'); $ua->start_p($tx)->then(sub { my $tx = shift; say $tx->result->body; })->catch(sub { my $err = shift; warn "Connection error: $err"; })->wait; =head2 websocket $ua->websocket('ws://example.com' => sub {...}); $ua->websocket( 'ws://example.com' => {DNT => 1} => ['v1.proto'] => sub {...}); Open a non-blocking WebSocket connection with transparent handshake, takes the same arguments as L<Mojo::UserAgent::Transactor/"websocket">. The callback will receive either a L<Mojo::Transaction::WebSocket> or L<Mojo::Transaction::HTTP> object, depending on if the handshake was successful. $ua->websocket('wss://example.com/echo' => ['v1.proto'] => sub { my ($ua, $tx) = @_; say 'WebSocket handshake failed!' and return unless $tx->is_websocket; say 'Subprotocol negotiation failed!' and return unless $tx->protocol; $tx->on(finish => sub { my ($tx, $code, $reason) = @_; say "WebSocket closed with status $code."; }); $tx->on(message => sub { my ($tx, $msg) = @_; say "WebSocket message: $msg"; $tx->finish; }); $tx->send('Hi!'); }); Mojo::IOLoop->start unless Mojo::IOLoop->is_running; You can activate C<permessage-deflate> compression by setting the C<Sec-WebSocket-Extensions> header, this can result in much better performance, but also increases memory usage by up to 300KiB per connection. $ua->websocket('ws://example.com/foo' => { 'Sec-WebSocket-Extensions' => 'permessage-deflate' } => sub {...}); =head2 websocket_p my $promise = $ua->websocket_p('ws://example.com'); Same as L</"websocket">, but returns a L<Mojo::Promise> object instead of accepting a callback. $ua->websocket_p('wss://example.com/echo')->then(sub { my $tx = shift; my $promise = Mojo::Promise->new; $tx->on(finish => sub { $promise->resolve }); $tx->on(message => sub { my ($tx, $msg) = @_; say "WebSocket message: $msg"; $tx->finish; }); $tx->send('Hi!'); return $promise; })->catch(sub { my $err = shift; warn "WebSocket error: $err"; })->wait; =head1 DEBUGGING You can set the C<MOJO_USERAGENT_DEBUG> environment variable to get some advanced diagnostics information printed to C<STDERR>. MOJO_USERAGENT_DEBUG=1 =head1 SEE ALSO L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicious.org>. =cut
return PlaceObj("ModDef", { "title", "Toggle Visible Vegetation", "id", "ChoGGi_ToggleVisibleVegetation", "lua_revision", 1001569, "steam_id", "2162375075", "pops_any_uuid", "e42779d0-c633-4a69-b3c4-69db21c0216f", "version", 1, "version_major", 0, "version_minor", 1, "image", "Preview.png", "author", "ChoGGi", "code", { "Code/Script.lua", }, "has_options", true, "TagCosmetics", true, "description", [[Adds mod option to hide trees. Includes mod option to also toggle bushes (needs to be enabled if turning visibility back on). Requested by jfffj. ]], })
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. // @dart = 2.9 import 'dart:io'; import 'package:expect/expect.dart'; Future<void> main() async { final origDir = Directory.current; final exePath = Platform.resolvedExecutable; final d = Directory.systemTemp.createTempSync('dart_symlink'); // Roughly emulate a Brew installation: // - $BREW/bin/dart -> ../Cellar/dart/2.8.0-dev.20.0/bin/dart // - $BREW/Cellar/dart/2.8.0-dev.20.0/bin/dart -> $DART_SDK/bin/dart final a = Directory('${d.path}/usr/local/bin'); a.createSync(recursive: true); // /usr/local/Cellar/dart/2.8.0-dev.20.0/bin/dart -> $DART_SDK/bin/dart Directory.current = a; final linkLocation = '${d.path}/usr/local/bin/Cellar/dart/2.8.0-dev.20.0/bin/dart'; final link = Link(linkLocation); link.createSync(exePath, recursive: true); // /usr/local/bin/dart -> /usr/local/Cellar/dart/2.8.0-dev.20/bin/dart final link2 = Link('dart')..createSync(linkLocation, recursive: true); final path = Uri.parse(link2.absolute.path).path; Directory.current = origDir; final result = await Process.run('$path', ['help']); Expect.equals(result.exitCode, 0); }
Beat 0 2 Beat 245 0 Beat 490 1 Beat 735 0 Beat 1015 4 Beat 1260 0 Beat 1505 1 Beat 1750 0 Beat 1995 2 Beat 2240 0 Beat 2485 1 Beat 2730 0 Beat 3010 3 Beat 3255 0 Beat 3500 1 Beat 3745 0 Beat 3990 2 Beat 4235 0 Beat 4480 1 Beat 4725 0 Beat 5005 4 Beat 5250 0 Beat 5495 1 Beat 5740 0 Beat 5985 2 Beat 6230 0 Beat 6475 1 Beat 6720 0 Beat 7000 3 Beat 7245 0 Beat 7490 1 Beat 7735 0 Beat 7980 2 Beat 8225 0 Beat 8470 1 Beat 8715 0 Beat 8995 4 Beat 9240 0 Beat 9485 1 Beat 9730 0 Beat 10010 2 Beat 10255 0 Beat 10500 1 Beat 10745 0 Beat 10990 3 Beat 11235 0 Beat 11480 1 Beat 11725 0 Beat 12005 2 Beat 12250 0 Beat 12495 1 Beat 12740 0 Beat 12985 4 Beat 13230 0 Beat 13475 1 Beat 13720 0 Beat 14000 2 Beat 14245 0 Beat 14490 1 Beat 14735 0 Beat 15015 3 Beat 15260 0 Beat 15505 1 Beat 15750 0 Beat 15995 2 Beat 16240 0 Beat 16485 1 Beat 16730 0 Beat 17010 4 Beat 17255 0 Beat 17500 1 Beat 17745 0 Beat 17990 2 Beat 18235 0 Beat 18480 1 Beat 18725 0 Beat 18970 3 Beat 19215 0 Beat 19460 1 Beat 19705 0 Beat 19985 2 Beat 20230 0 Beat 20475 1 Beat 20720 0 Beat 21000 4 Beat 21245 0 Beat 21490 1 Beat 21735 0 Beat 22015 2 Beat 22260 0 Beat 22505 1 Beat 22750 0 Beat 22995 3 Beat 23240 0 Beat 23485 1 Beat 23730 0 Beat 24010 2 Beat 24255 0 Beat 24500 1 Beat 24745 0 Beat 24990 4 Beat 25235 0 Beat 25480 1 Beat 25725 0 Beat 25970 2 Beat 26215 0 Beat 26495 1 Beat 26740 0 Beat 26985 3 Beat 27230 0 Beat 27475 1 Beat 27720 0 Beat 28000 2 Beat 28245 0 Beat 28490 1 Beat 28735 0 Beat 29015 4 Beat 29260 0 Beat 29505 1 Beat 29750 0 Beat 29995 2 Beat 30240 0 Beat 30485 1 Beat 30730 0 Beat 31010 3 Beat 31255 0 Beat 31500 1 Beat 31745 0 Beat 31990 2 Beat 32235 0 Beat 32515 1 Beat 32760 0 Beat 33005 4 Beat 33250 0 Beat 33495 1 Beat 33740 0 Beat 33985 2 Beat 34230 0 Beat 34475 1 Beat 34720 0 Beat 35000 3 Beat 35245 0 Beat 35490 1 Beat 35735 0 Beat 36015 2 Note 0 1015 62 Note 1015 1995 67 Note 1995 3010 69 Note 3010 3990 70 Note 3990 5005 69 Note 5005 5985 67 Note 5985 7000 69 Note 7000 8995 66 Note 8995 10010 62 | Note 10010 10990 65 Note 10990 12005 65 Note 12005 12985 63 Note 12985 14000 62 Note 14000 15015 67 Note 15015 15995 67 Note 15995 17010 66 Note 17010 19985 67 | Note 19985 21000 69 Note 21000 22015 70 Note 22015 22995 72 Note 22995 24010 74 Note 24010 24990 74 Note 24990 26495 72 Note 26495 26985 72 Note 26985 28000 70 | Note 28000 29015 74 Note 29015 29995 72 Note 29995 31010 70 Note 31010 31990 69 Note 31990 32515 67 Note 32515 33005 69 Note 33005 33985 70 Note 33985 35000 69 Note 35000 36015 67 |
/** * Copyright (C) 2012 Red Hat, Inc. * * 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. */ def pomFile = new File( basedir, 'pom.xml' ) System.out.println( "Slurping POM: ${pomFile.getAbsolutePath()}" ) def pom = new XmlSlurper().parse( pomFile ) System.out.println(pom.properties); def failed = false pom.properties.each { if ( it.text().contains ("2.5") ) { failed = true } } assert (failed == false)
% Learning MNIST with Neural Networks with backprop library % Justin Le The *backprop* library performs back-propagation over a *hetereogeneous* system of relationships. back-propagation is done automatically (as reverse-mode automatic differentiation), and you work with your values as if you were writing normal functions with them, with the help of [lens][]. [ad]: http://hackage.haskell.org/package/ad [lens]: http://hackage.haskell.org/package/lens Repository source is [on github][repo], and docs are [on hackage][hackage]. [repo]: https://github.com/mstksg/backprop [hackage]: http://hackage.haskell.org/package/backprop If you're reading this as a literate haskell file, you should know that a [rendered pdf version is available on github.][rendered]. If you are reading this as a pdf file, you should know that a [literate haskell version that you can run][lhs] is also available on github! [rendered]: https://github.com/mstksg/backprop/blob/master/renders/backprop-mnist.pdf [lhs]: https://github.com/mstksg/backprop/blob/master/samples/backprop-mnist.lhs The (extra) packages involved are: * hmatrix * lens * mnist-idx * mwc-random * one-liner-instances * split > {-# LANGUAGE BangPatterns #-} > {-# LANGUAGE DataKinds #-} > {-# LANGUAGE DeriveGeneric #-} > {-# LANGUAGE FlexibleContexts #-} > {-# LANGUAGE GADTs #-} > {-# LANGUAGE LambdaCase #-} > {-# LANGUAGE ScopedTypeVariables #-} > {-# LANGUAGE TemplateHaskell #-} > {-# LANGUAGE TupleSections #-} > {-# LANGUAGE TypeApplications #-} > {-# LANGUAGE ViewPatterns #-} > {-# OPTIONS_GHC -Wno-incomplete-patterns #-} > {-# OPTIONS_GHC -Wno-orphans #-} > {-# OPTIONS_GHC -Wno-unused-top-binds #-} > > import Control.DeepSeq > import Control.Exception > import Control.Monad > import Control.Monad.IO.Class > import Control.Monad.Trans.Maybe > import Control.Monad.Trans.State > import Data.Bitraversable > import Data.Foldable > import Data.IDX > import Data.List.Split > import Data.Time.Clock > import Data.Traversable > import Data.Tuple > import GHC.Generics (Generic) > import GHC.TypeLits > import Lens.Micro > import Lens.Micro.TH > import Numeric.Backprop > import Numeric.Backprop.Class > import Numeric.LinearAlgebra.Static > import Numeric.OneLiner > import Text.Printf > import qualified Data.Vector as V > import qualified Data.Vector.Generic as VG > import qualified Data.Vector.Unboxed as VU > import qualified Numeric.LinearAlgebra as HM > import qualified System.Random.MWC as MWC > import qualified System.Random.MWC.Distributions as MWC Introduction ============ In this walkthrough, we'll be building a classifier for the *[MNIST][]* data set. This is meant to mirror the [Tensorflow Tutorial][tf-intro] for beginners. [tf-intro]: https://www.tensorflow.org/versions/r1.2/get_started/mnist/beginners Essentially, we use a two-layer artificial neural network -- or a series of matrix multiplications, differentiable function applications, and vector additions. We feed our input image to the ANN and then try to get a label from it. Training an ANN is a matter of finding the right matrices to multiply by, and the right vectors to add. To do that, we train our network by treating our network's accuracy as a function `Network -> Error`. If we can find the gradient of the input network with respect to the error, we can perform [gradient descent][], and slowly make our network better and better. [gradient descent]: https://en.wikipedia.org/wiki/Gradient_descent Finding the gradient is usually complicated, but *backprop* makes it simpler: 1. Write a function to compute the error from the network 2. That's it! Hooray! Once you do that, the library finds the gradient function *automatically*, without any further intervention! Types ===== For the most part, we're going to be using the great *[hmatrix][]* library and its vector and matrix types. It offers a type `L m n` for $m \times n$ matrices, and a type `R n` for an $n$ vector. [hmatrix]: http://hackage.haskell.org/package/hmatrix First things first: let's define our neural networks as simple containers of parameters (weight matrices and bias vectors). First, a type for layers: > data Layer i o = > Layer { _lWeights :: !(L o i) > , _lBiases :: !(R o) > } > deriving (Show, Generic) > > instance NFData (Layer i o) > makeLenses ''Layer And a type for a simple feed-forward network with two hidden layers: > data Network i h1 h2 o = > Net { _nLayer1 :: !(Layer i h1) > , _nLayer2 :: !(Layer h1 h2) > , _nLayer3 :: !(Layer h2 o) > } > deriving (Show, Generic) > > instance NFData (Network i h1 h2 o) > makeLenses ''Network These are pretty straightforward container types...pretty much exactly the type you'd make to represent these networks! Note that, following true Haskell form, we separate out logic from data. This should be all we need. Instances --------- Things are much simplier if we had `Num` and `Fractional` instances for everything, so let's just go ahead and define that now, as well. Just a little bit of boilerplate, made easier using *[one-liner-instances][]* to auto-derive instances using Generics. [one-liner-instances]: http://hackage.haskell.org/package/one-liner-instances > instance (KnownNat i, KnownNat o) => Num (Layer i o) where > (+) = gPlus > (-) = gMinus > (*) = gTimes > negate = gNegate > abs = gAbs > signum = gSignum > fromInteger = gFromInteger > > instance ( KnownNat i > , KnownNat h1 > , KnownNat h2 > , KnownNat o > ) => Num (Network i h1 h2 o) where > (+) = gPlus > (-) = gMinus > (*) = gTimes > negate = gNegate > abs = gAbs > signum = gSignum > fromInteger = gFromInteger > > instance (KnownNat i, KnownNat o) => Fractional (Layer i o) where > (/) = gDivide > recip = gRecip > fromRational = gFromRational > > instance ( KnownNat i > , KnownNat h1 > , KnownNat h2 > , KnownNat o > ) => Fractional (Network i h1 h2 o) where > (/) = gDivide > recip = gRecip > fromRational = gFromRational `KnownNat` comes from *base*; it's a typeclass that *hmatrix* uses to refer to the numbers in its type and use it to go about its normal hmatrixy business. Now we need instances of `Backprop` for our types in order to use them for automatic differentiation. Luckily, these can be generated automatically using GHC Generics: > instance (KnownNat i, KnownNat o) => Backprop (Layer i o) > instance (KnownNat i, KnownNat h1, KnownNat h2, KnownNat o) => Backprop (Network i h1 h2 o) Ops === Now, *backprop* does require *primitive* differentiable operations on our relevant types to be defined. *backprop* uses these primitive operations to tie everything together. Ideally we'd import these from a library that implements these for you, and the end-user never has to make these primitives. But in this case, I'm going to put the definitions here to show that there isn't any magic going on. If you're curious, refer to [documentation for `Op`][opdoc] for more details on how `Op` is implemented and how this works. [opdoc]: http://hackage.haskell.org/package/backprop/docs/Numeric-Backprop-Op.html First, matrix-vector multiplication primitive, giving an explicit gradient function. > infixr 8 #>! > (#>!) > :: (KnownNat m, KnownNat n, Reifies s W) > => BVar s (L m n) > -> BVar s (R n) > -> BVar s (R m) > (#>!) = liftOp2 . op2 $ \m v -> > ( m #> v, \g -> (g `outer` v, tr m #> g) ) Dot products would be nice too. > infixr 8 <.>! > (<.>!) > :: (KnownNat n, Reifies s W) > => BVar s (R n) > -> BVar s (R n) > -> BVar s Double > (<.>!) = liftOp2 . op2 $ \x y -> > ( x <.> y, \g -> (konst g * y, x * konst g) > ) Also a function to fill a vector with the same element: > konst' > :: (KnownNat n, Reifies s W) > => BVar s Double > -> BVar s (R n) > konst' = liftOp1 . op1 $ \c -> (konst c, HM.sumElements . extract) Finally, an operation to sum all of the items in the vector. > sumElements' > :: (KnownNat n, Reifies s W) > => BVar s (R n) > -> BVar s Double > sumElements' = liftOp1 . op1 $ \x -> (HM.sumElements (extract x), konst) Again, these are not intended to be used by end-users of *backprop*, but rather are meant to be provided by libraries as primitive operations for users of the library to use. Running our Network =================== Now that we have our primitives in place, let's actually write a function to run our network! And, once we do this, we automatically also have functions to back-propagate our network! Normally, to write this function, we'd write: > runLayerNormal > :: (KnownNat i, KnownNat o) > => Layer i o > -> R i > -> R o > runLayerNormal l x = (l ^. lWeights) #> x + (l ^. lBiases) > {-# INLINE runLayerNormal #-} Using the `lWeights` and `lBiases` lenses to access the weights and biases of our layer. However, we can translate this to *backprop* by operating on `BVar`s instead of the type directly, and using our backprop-aware `#>!`: > runLayer > :: (KnownNat i, KnownNat o, Reifies s W) > => BVar s (Layer i o) > -> BVar s (R i) > -> BVar s (R o) > runLayer l x = (l ^^. lWeights) #>! x + (l ^^. lBiases) > {-# INLINE runLayer #-} `^.` lets to access data within a value using a lens, and `^^.` lets you access data within a `BVar` using a lens: ```haskell (^.) :: a -> Lens' a b -> b (^^.) :: BVar s a -> Lens' a b -> BVar s b ``` (There is also `^^?`, which can use a `Prism` or `Traversal` to extract a target that might not exist, `^^..`, which uses a `Traversal` to extract all targets, and `.~~`, which uses a `Lens` to update a value inside `BVar`) Now `runLayer` is a function on two inputs that can be backpropagated, automatically! We can find its gradient given any input, and also run it to get our expected output as well. Before writing our final network runner, we need a function to compute the "softmax" of our output vector. Writing it normally would look like: > softMaxNormal :: KnownNat n => R n -> R n > softMaxNormal x = konst (1 / HM.sumElements (extract expx)) * expx > where > expx = exp x > {-# INLINE softMaxNormal #-} But we can make the mechanical shift to the backpropagatable version: > softMax :: (KnownNat n, Reifies s W) => BVar s (R n) -> BVar s (R n) > softMax x = konst' (1 / sumElements' expx) * expx > where > expx = exp x > {-# INLINE softMax #-} We also need the [logistic function][], which is our activation function between layer outputs. Because `BVar`s have a `Floating` instance, we can just write it using typeclass functions. [logistic function]: https://en.wikipedia.org/wiki/Logistic_function > logistic :: Floating a => a -> a > logistic x = 1 / (1 + exp (-x)) > {-# INLINE logistic #-} With those in hand, let's compare how we would normally write a function to run our network: > runNetNormal > :: (KnownNat i, KnownNat h1, KnownNat h2, KnownNat o) > => Network i h1 h2 o > -> R i > -> R o > runNetNormal n = softMaxNormal > . runLayerNormal (n ^. nLayer3) > . logistic > . runLayerNormal (n ^. nLayer2) > . logistic > . runLayerNormal (n ^. nLayer1) > {-# INLINE runNetNormal #-} Basic function composition, neat. We use our lenses `nLayer1`, `nLayer2`, and `nLayer3` to extract the first, second, and third layers from our network. Writing it in a way that backprop can use is also very similar: > runNetwork > :: (KnownNat i, KnownNat h1, KnownNat h2, KnownNat o, Reifies s W) > => BVar s (Network i h1 h2 o) > -> R i > -> BVar s (R o) > runNetwork n = softMax > . runLayer (n ^^. nLayer3) > . logistic > . runLayer (n ^^. nLayer2) > . logistic > . runLayer (n ^^. nLayer1) > . constVar > {-# INLINE runNetwork #-} We use `constVar` on the input vector, because we don't care about its gradient and so treat it as a constant. And now here again we use `^^.` (instead of `^.`) to extract a value from our `BVar` of a `Network`, using a lens. Computing Errors ---------------- Now, training a neural network is about calculating its gradient with respect to some error function. The library calculatues the gradient for us -- we just need to tell it how to compute the error function. For classification problems, we usually use a [cross entropy][] error. Given a target vector, how does our neural network's output differ from what is expected? Lower numbers are better! [cross entropy]: https://en.wikipedia.org/wiki/Cross_entropy Again, let's look at a "normal" implementation, regular variables and no backprop: > crossEntropyNormal :: KnownNat n => R n -> R n -> Double > crossEntropyNormal targ res = -(log res <.> targ) > {-# INLINE crossEntropyNormal #-} And we can see that the backpropable version is pretty similar. We see `constVar t`, to introduce a `BVar` that is a constant value (that we don't care about the gradient of). > crossEntropy > :: (KnownNat n, Reifies s W) > => R n > -> BVar s (R n) > -> BVar s Double > crossEntropy targ res = -(log res <.>! constVar targ) > {-# INLINE crossEntropy #-} Our final "error function", then, is: > netErr > :: (KnownNat i, KnownNat h1, KnownNat h2, KnownNat o, Reifies s W) > => R i > -> R o > -> BVar s (Network i h1 h2 o) > -> BVar s Double > netErr x targ n = crossEntropy targ (runNetwork n x) > {-# INLINE netErr #-} The Magic ========= The actual "magic" of the library happens with the functions to "run" the functions we defined earlier: ```haskell evalBP :: (forall s. Reifies s W => BVar s a -> BVar s b) -> a -> b gradBP :: (forall s. Reifies s W => BVar s a -> BVar s b) -> a -> a backprop :: (forall s. Reifies s W => BVar s a -> BVar s b) -> a -> (b, a) ``` `evalBP` "runs" the function like normal, `gradBP` computes the gradient of the function, and `backprop` computes both the result and the gradient. So, if we have a network `net0`, an input vector `x`, and a target vector `t`, we could compute its error using: ```haskell evalBP (netErr x targ) net0 :: Double ``` And we can calculate its *gradient* using: ```haskell gradBP (netErr x targ) net0 :: (Network i h1 h2 o, R i) ``` Pulling it all together ======================= Let's write a simple function to step our network in the direction opposite of the gradient to train our model: > trainStep > :: forall i h1 h2 o. (KnownNat i, KnownNat h1, KnownNat h2, KnownNat o) > => Double -- ^ learning rate > -> R i -- ^ input > -> R o -- ^ target > -> Network i h1 h2 o -- ^ initial network > -> Network i h1 h2 o > trainStep r !x !targ !n = n - realToFrac r * gradBP (netErr x targ) n > {-# INLINE trainStep #-} Here's a convenient wrapper for training over all of the observations in a list: > trainList > :: (KnownNat i, KnownNat h1, KnownNat h2, KnownNat o) > => Double -- ^ learning rate > -> [(R i, R o)] -- ^ input and target pairs > -> Network i h1 h2 o -- ^ initial network > -> Network i h1 h2 o > trainList r = flip $ foldl' (\n (x,y) -> trainStep r x y n) > {-# INLINE trainList #-} `testNet` will be a quick way to test our net by computing the percentage of correct guesses: (mostly using *hmatrix* stuff, so don't mind too much) > testNet > :: forall i h1 h2 o. (KnownNat i, KnownNat h1, KnownNat h2, KnownNat o) > => [(R i, R o)] > -> Network i h1 h2 o > -> Double > testNet xs n = sum (map (uncurry test) xs) / fromIntegral (length xs) > where > test :: R i -> R o -> Double -- test if the max index is correct > test x (extract->t) > | HM.maxIndex t == HM.maxIndex (extract r) = 1 > | otherwise = 0 > where > r :: R o > r = evalBP (`runNetwork` x) n And now, a main loop! If you are following along at home, download the [mnist data set files][MNIST] and uncompress them into the folder `data`, and everything should work fine. [MNIST]: http://yann.lecun.com/exdb/mnist/ > main :: IO () > main = MWC.withSystemRandom $ \g -> do > Just train <- loadMNIST "data/train-images-idx3-ubyte" "data/train-labels-idx1-ubyte" > Just test <- loadMNIST "data/t10k-images-idx3-ubyte" "data/t10k-labels-idx1-ubyte" > putStrLn "Loaded data." > net0 <- MWC.uniformR @(Network 784 300 100 10) (-0.5, 0.5) g > flip evalStateT net0 . forM_ [1..] $ \e -> do > train' <- liftIO . fmap V.toList $ MWC.uniformShuffle (V.fromList train) g > liftIO $ printf "[Epoch %d]\n" (e :: Int) > > forM_ ([1..] `zip` chunksOf batch train') $ \(b, chnk) -> StateT $ \n0 -> do > printf "(Batch %d)\n" (b :: Int) > > t0 <- getCurrentTime > n' <- evaluate . force $ trainList rate chnk n0 > t1 <- getCurrentTime > printf "Trained on %d points in %s.\n" batch (show (t1 `diffUTCTime` t0)) > > let trainScore = testNet chnk n' > testScore = testNet test n' > printf "Training error: %.2f%%\n" ((1 - trainScore) * 100) > printf "Validation error: %.2f%%\n" ((1 - testScore ) * 100) > > return ((), n') > where > rate = 0.02 > batch = 5000 Each iteration of the loop: 1. Shuffles the training set 2. Splits it into chunks of `batch` size 3. Uses `trainList` to train over the batch 4. Computes the score based on `testNet` based on the training set and the test set 5. Prints out the results And, that's really it! Performance ----------- Currently, benchmarks show that *running* the network has virtually zero overhead (~ 4%) over writing the running function directly. The actual gradient descent process (compute gradient, then descend) carries about 60% overhead over writing the gradients manually, but it is unclear how much of this is because of the library, and how much of it is just because of automatic differentation giving slightly less efficient matrix/vector multiplication operations. The [README][repo] has some more detailed benchmarks and statistics, if you want to get more detailed information. Main takeaways ============== Most of the actual heavy lifting/logic actually came from the *hmatrix* library itself. We just created simple types to wrap up our bare matrices. Basically, all that *backprop* did was give you an API to define *how to run* a neural net --- how to *run* a net based on a `Network` and `R i` input you were given. The goal of the library is to let you write down how to run things in as natural way as possible. And then, after things are run, we can just get the gradient and roll from there! Because the heavy lifting is done by the data types themselves, we can presumably plug in *any* type and any tensor/numerical backend, and reap the benefits of those libraries' optimizations and parallelizations. *Any* type can be backpropagated! :D What now? --------- Check out the docs for the [Numeric.Backprop][] module for a more detailed picture of what's going on, or find more examples at the [github repo][repo]! [Numeric.Backprop]: http://hackage.haskell.org/package/backprop/docs/Numeric-Backprop.html Also, check out follow-up writeup to this tutorial, expanding on using the library with more advanced extensible neural network types, like the ones described in [this blog post][blog]. Check out the [literate haskell here][neural-lhs], and the [rendered PDF here][neural-pdf]. [blog]: https://blog.jle.im/entries/series/+practical-dependent-types-in-haskell.html [neural-lhs]: https://github.com/mstksg/backprop/blob/master/samples/extensible-neural.lhs [neural-pdf]: https://github.com/mstksg/backprop/blob/master/renders/extensible-neural.pdf Boring stuff ============ Here is a small wrapper function over the [mnist-idx][] library loading the contents of the idx files into *hmatrix* vectors: [mnist-idx]: http://hackage.haskell.org/package/mnist-idx > loadMNIST > :: FilePath > -> FilePath > -> IO (Maybe [(R 784, R 10)]) > loadMNIST fpI fpL = runMaybeT $ do > i <- MaybeT $ decodeIDXFile fpI > l <- MaybeT $ decodeIDXLabelsFile fpL > d <- MaybeT . return $ labeledIntData l i > r <- MaybeT . return $ for d (bitraverse mkImage mkLabel . swap) > liftIO . evaluate $ force r > where > mkImage :: VU.Vector Int -> Maybe (R 784) > mkImage = create . VG.convert . VG.map (\i -> fromIntegral i / 255) > mkLabel :: Int -> Maybe (R 10) > mkLabel n = create $ HM.build 10 (\i -> if round i == n then 1 else 0) And here are instances to generating random vectors/matrices/layers/networks, used for the initialization step. > instance KnownNat n => MWC.Variate (R n) where > uniform g = randomVector <$> MWC.uniform g <*> pure Uniform > uniformR (l, h) g = (\x -> x * (h - l) + l) <$> MWC.uniform g > > instance (KnownNat m, KnownNat n) => MWC.Variate (L m n) where > uniform g = uniformSample <$> MWC.uniform g <*> pure 0 <*> pure 1 > uniformR (l, h) g = (\x -> x * (h - l) + l) <$> MWC.uniform g > > instance (KnownNat i, KnownNat o) => MWC.Variate (Layer i o) where > uniform g = Layer <$> MWC.uniform g <*> MWC.uniform g > uniformR (l, h) g = (\x -> x * (h - l) + l) <$> MWC.uniform g > > instance ( KnownNat i > , KnownNat h1 > , KnownNat h2 > , KnownNat o > ) > => MWC.Variate (Network i h1 h2 o) where > uniform g = Net <$> MWC.uniform g <*> MWC.uniform g <*> MWC.uniform g > uniformR (l, h) g = (\x -> x * (h - l) + l) <$> MWC.uniform g Also, some orphan instances of `Backprop` for vector and matrix types. These are provided by the [hmatrix-backprop][] library normally: > instance Backprop (R n) where > zero = zeroNum > add = addNum > one = oneNum > > instance (KnownNat n, KnownNat m) => Backprop (L m n) where > zero = zeroNum > add = addNum > one = oneNum [hmatrix-backprop]: http://hackage.haskell.org/package/hmatrix-backprop
{-# OPTIONS --allow-unsolved-metas #-} module Term where open import OscarPrelude open import VariableName open import FunctionName open import Arity open import Vector mutual data Term : Set where variable : VariableName → Term function : FunctionName → Terms → Term record Terms : Set where constructor ⟨_⟩ inductive field {arity} : Arity terms : Vector Term arity open Terms public termVariable-inj : ∀ {𝑥₁ 𝑥₂} → Term.variable 𝑥₁ ≡ variable 𝑥₂ → 𝑥₁ ≡ 𝑥₂ termVariable-inj refl = refl termFunction-inj₁ : ∀ {𝑓₁ 𝑓₂ τ₁s τ₂s} → Term.function 𝑓₁ τ₁s ≡ function 𝑓₂ τ₂s → 𝑓₁ ≡ 𝑓₂ termFunction-inj₁ refl = refl termFunction-inj₂ : ∀ {𝑓₁ 𝑓₂ τ₁s τ₂s} → Term.function 𝑓₁ τ₁s ≡ function 𝑓₂ τ₂s → τ₁s ≡ τ₂s termFunction-inj₂ refl = refl terms-inj : ∀ {𝑎} → {τs₁ τs₂ : Vector Term 𝑎} → (τs₁≡τs₂ : (Terms.⟨_⟩ {𝑎} τs₁) ≡ ⟨ τs₂ ⟩) → τs₁ ≡ τs₂ terms-inj refl = refl module _ where open import TermByFunctionNames mutual termToTermByFunctionNames : Term → Σ Nat TermByFunctionNames termToTermByFunctionNames (variable x) = _ , (variable x) termToTermByFunctionNames (function x x₁) = {!!} termsToVec : Terms → Σ Nat (λ arity → Σ (Vec (Σ Nat TermByFunctionNames) arity) λ τs → Σ Nat λ n → n ≡ sum (vecToList $ (fst <$> τs))) termsToVec (⟨_⟩ {arity = arity₁} ⟨ vector₁ ⟩) = {!!} iTermToTerm : Σ Nat TermByFunctionNames → Term iTermToTerm = {!!} eq-term-round : ∀ τ → iTermToTerm (termToTermByFunctionNames τ) ≡ τ eq-term-round = {!!} eq-iterm-round : ∀ τ → termToTermByFunctionNames (iTermToTerm τ) ≡ τ eq-iterm-round = {!!} instance EqTerm : Eq Term Eq._==_ EqTerm x y with termToTermByFunctionNames x | graphAt termToTermByFunctionNames x | termToTermByFunctionNames y | graphAt termToTermByFunctionNames y Eq._==_ EqTerm x y | ix | ingraph eqx | iy | ingraph eqy with ix ≟ iy Eq._==_ EqTerm x y | ix | ingraph eqx | .ix | ingraph eqy | yes refl = yes $ ((cong iTermToTerm eqy ⟨≡⟩ʳ cong iTermToTerm eqx) ⟨≡⟩ eq-term-round x) ʳ⟨≡⟩ eq-term-round y Eq._==_ EqTerm x y | ix | ingraph eqx | iy | ingraph eqy | no neq = {!!} instance EqTerms : Eq Terms EqTerms = {!!} {- module _ {i : Size} where mutual EqTerm⇑ : (x y : Term) → Delay i ∘ Dec $ x ≡ y EqTerm⇑ (variable _) (variable _) = now (decEq₁ termVariable-inj $ _≟_ _ _) EqTerm⇑ (function 𝑓₁ τ₁s) (function 𝑓₂ τ₂s) = {- τ₁s≟τ₂s ← EqTerms⇑ τ₁s τ₂s -| (now $ decEq₂ termFunction-inj₁ termFunction-inj₂ (𝑓₁ ≟ 𝑓₂) τ₁s≟τ₂s) -} EqTerms⇑ τ₁s τ₂s >>= λ τ₁s≟τ₂s → now $ decEq₂ termFunction-inj₁ termFunction-inj₂ (𝑓₁ ≟ 𝑓₂) τ₁s≟τ₂s EqTerm⇑ (variable _) (function _ _) = now $ no λ () EqTerm⇑ (function _ _) (variable _) = now $ no λ () EqTerms⇑ : (x y : Terms) → Delay i ∘ Dec $ x ≡ y EqTerms⇑ (⟨_⟩ {𝑎₁} τ₁s) (⟨_⟩ {𝑎₂} τ₂s) with 𝑎₁ ≟ 𝑎₂ … | no 𝑎₁≢𝑎₂ = now $ no λ {τ₁≡τ₂ → 𝑎₁≢𝑎₂ (cong arity τ₁≡τ₂)} … | yes refl = EqVectorTerm⇑ τ₁s τ₂s >>= λ { (yes refl) → now $ yes refl ; (no τ₁s≢τ₂s) → now $ no (λ ⟨τ₁s⟩≡⟨τ₂s⟩ → τ₁s≢τ₂s (terms-inj ⟨τ₁s⟩≡⟨τ₂s⟩)) } EqVectorTerm⇑ : ∀ {n} → (x y : Vector Term n) → Delay i ∘ Dec $ x ≡ y EqVectorTerm⇑ ⟨ [] ⟩ ⟨ [] ⟩ = now (yes refl) EqVectorTerm⇑ ⟨ τ₁ ∷ τ₁s ⟩ ⟨ τ₂ ∷ τ₂s ⟩ = EqTerm⇑ τ₁ τ₂ >>= λ { (yes refl) → EqVectorTerm⇑ ⟨ τ₁s ⟩ ⟨ τ₂s ⟩ >>= λ { (yes refl) → now $ yes refl ; (no τ₁s≢τ₂s) → now $ no λ τ₁₁s≡τ₁₂s → τ₁s≢τ₂s $ cong ⟨_⟩ ((vcons-inj-tail (cong vector τ₁₁s≡τ₁₂s))) } ; (no τ₁≢τ₂) → now $ no λ τ₁₁s≡τ₂₂s → τ₁≢τ₂ $ vcons-inj-head (cong vector τ₁₁s≡τ₂₂s) } EqVectorTerm⇓ : ∀ {n} → (x y : Vector Term n) → EqVectorTerm⇑ x y ⇓ EqVectorTerm⇓ ⟨ [] ⟩ ⟨ [] ⟩ = _ , now⇓ EqVectorTerm⇓ ⟨ variable 𝑥₁ ∷ τ₁s ⟩ ⟨ variable 𝑥₂ ∷ τ₂s ⟩ with 𝑥₁ ≟ 𝑥₂ … | yes refl with EqVectorTerm⇓ ⟨ τ₁s ⟩ ⟨ τ₂s ⟩ EqVectorTerm⇓ ⟨ variable 𝑥₁ ∷ τ₁s ⟩ ⟨ variable .𝑥₁ ∷ .τ₁s ⟩ | yes refl | (yes refl , snd₁) = _ , snd₁ >>=⇓ now⇓ EqVectorTerm⇓ ⟨ variable 𝑥₁ ∷ τ₁s ⟩ ⟨ variable .𝑥₁ ∷ τ₂s ⟩ | yes refl | (no x , snd₁) = _ , snd₁ >>=⇓ now⇓ EqVectorTerm⇓ ⟨ variable 𝑥₁ ∷ τ₁s ⟩ ⟨ variable 𝑥₂ ∷ τ₂s ⟩ | no 𝑥₁≢𝑥₂ = _ , now⇓ EqVectorTerm⇓ ⟨ variable x ∷ τ₁s ⟩ ⟨ function x₁ x₂ ∷ τ₂s ⟩ = _ , now⇓ EqVectorTerm⇓ ⟨ function x x₁ ∷ τ₁s ⟩ ⟨ variable x₂ ∷ τ₂s ⟩ = _ , now⇓ EqVectorTerm⇓ ⟨ function 𝑓₁ (⟨_⟩ {𝑎₁} τ₁s) ∷ τ₁₂s ⟩ ⟨ function 𝑓₂ (⟨_⟩ {𝑎₂} τ₂s) ∷ τ₂₂s ⟩ with 𝑎₁ ≟ 𝑎₂ | 𝑓₁ ≟ 𝑓₂ … | no 𝑎₁≢𝑎₂ | no 𝑓₁≢𝑓₂ = _ , now⇓ … | no 𝑎₁≢𝑎₂ | yes refl = _ , now⇓ … | yes refl | no 𝑓₁≢𝑓₂ with EqVectorTerm⇓ τ₁s τ₂s … | (no τ₁s≢τ₂s , τ⇓) = _ , τ⇓ >>=⇓ now⇓ >>=⇓ now⇓ >>=⇓ now⇓ … | (yes refl , τ⇓) = _ , τ⇓ >>=⇓ now⇓ >>=⇓ now⇓ >>=⇓ now⇓ EqVectorTerm⇓ ⟨ function 𝑓₁ (⟨_⟩ {𝑎₁} τ₁s) ∷ τ₁₂s ⟩ ⟨ function 𝑓₂ (⟨_⟩ {𝑎₂} τ₂s) ∷ τ₂₂s ⟩ | yes refl | yes refl with EqVectorTerm⇓ τ₁s τ₂s | EqVectorTerm⇓ ⟨ τ₁₂s ⟩ ⟨ τ₂₂s ⟩ … | (no τ₁s≢τ₂s , τ⇓) | (no τ₁₂s≢τ₂₂s , τs⇓) = _ , τ⇓ >>=⇓ now⇓ >>=⇓ now⇓ >>=⇓ now⇓ … | (yes refl , τ⇓) | (no τ₁₂s≢τ₂₂s , τs⇓) = _ , τ⇓ >>=⇓ now⇓ >>=⇓ now⇓ >>=⇓ (τs⇓ >>=⇓ now⇓) … | (no τ₁s≢τ₂s , τ⇓) | (yes refl , τs⇓) = _ , τ⇓ >>=⇓ now⇓ >>=⇓ now⇓ >>=⇓ now⇓ … | (yes refl , τ⇓) | (yes refl , τs⇓) = _ , τ⇓ >>=⇓ now⇓ >>=⇓ now⇓ >>=⇓ (τs⇓ >>=⇓ now⇓) EqTerms⇓ : (x y : Terms) → EqTerms⇑ x y ⇓ EqTerms⇓ (⟨_⟩ {𝑎₁} τ₁s) (⟨_⟩ {𝑎₂} τ₂s) with 𝑎₁ ≟ 𝑎₂ … | no 𝑎₁≢𝑎₂ = _ , now⇓ … | yes refl with EqVectorTerm⇓ τ₁s τ₂s … | (yes refl , τ⇓) = _ , τ⇓ >>=⇓ now⇓ … | (no _ , τ⇓) = _ , τ⇓ >>=⇓ now⇓ EqTerm⇓ : (x y : Term) → EqTerm⇑ x y ⇓ EqTerm⇓ (variable x) (variable x₁) = _ , now⇓ EqTerm⇓ (function _ τ₁s) (function _ τ₂s) with EqTerms⇓ τ₁s τ₂s … | (_ , τ⇓) = _ , τ⇓ >>=⇓ now⇓ EqTerm⇓ (variable x) (function x₁ x₂) = _ , now⇓ EqTerm⇓ (function x x₁) (variable x₂) = _ , now⇓ instance EqTerm : Eq Term EqTerm = record { _==_ = λ x y → fst (EqTerm⇓ x y) } instance EqTerms : Eq Terms Eq._==_ EqTerms x y = fst (EqTerms⇓ x y) -} module _ where open import Membership instance MembershipTermTerms : Membership Term Terms Membership._∈_ MembershipTermTerms = _ᵗ∈ᵗˢ_ where data _ᵗ∈ᵗˢ_ (τ : Term) : Terms → Set where zero : τ ᵗ∈ᵗˢ ⟨ ⟨ τ ∷ [] ⟩ ⟩ suc : ∀ {τs} → τ ᵗ∈ᵗˢ τs → τ ᵗ∈ᵗˢ ⟨ ⟨ τ ∷ vector (terms τs) ⟩ ⟩ Membership._∉_ MembershipTermTerms x X = ¬ x ∈ X fst (Membership.xor-membership MembershipTermTerms) x₁ x₂ = x₂ x₁ snd (Membership.xor-membership MembershipTermTerms) x₁ x₂ = x₁ x₂ instance MembershipVariableNameTerm : Membership VariableName Term Membership._∈_ MembershipVariableNameTerm = _ᵛ∈ᵗ_ where data _ᵛ∈ᵗ_ (𝑥 : VariableName) : Term → Set where variable : 𝑥 ᵛ∈ᵗ variable 𝑥 function : ∀ 𝑓 {τ : Term} {τs} → {_ : 𝑥 ∈ τ} → τ ∈ τs → 𝑥 ᵛ∈ᵗ function 𝑓 τs Membership._∉_ MembershipVariableNameTerm x X = ¬ x ∈ X fst (Membership.xor-membership MembershipVariableNameTerm) x₁ x₂ = x₂ x₁ snd (Membership.xor-membership MembershipVariableNameTerm) x₁ x₂ = x₁ x₂ module _ where import UnifyTermL import UnifyMguCorrectL module L where open UnifyTermL (Maybe FunctionName) public open UnifyMguCorrectL (Maybe FunctionName) public mutual TermLtoTerm : ∃ L.Term → Term TermLtoTerm (fst₁ , UnifyTermL.i x) = {!!} TermLtoTerm (fst₁ , UnifyTermL.leaf nothing) = {!!} TermLtoTerm (fst₁ , UnifyTermL.leaf (just x)) = {!!} TermLtoTerm (fst₁ , (snd₁ UnifyTermL.fork snd₂)) = {!!} TermtoTermL : Term → ∃ L.Term TermtoTermL (variable x) = {!!} , (L.i {!!}) TermtoTermL (function x ⟨ ⟨ [] ⟩ ⟩) = {!!} , L.leaf (just x) L.fork L.leaf nothing TermtoTermL (function x ⟨ ⟨ x₁ ∷ vector₁ ⟩ ⟩) = {!!} , {!!} L.fork {!!}
class spi_transaction extends uvm_sequence_item; `uvm_object_utils(spi_transaction) function new(string name = "spi_transaction"); super.new(name); endfunction endclass //spi_transaction
# pylint: disable=missing-docstring import os from resolwe.flow.models import Data, Process from resolwe.test import tag_process, with_resolwe_host from resolwe_bio.models import Sample from resolwe_bio.utils.test import KBBioProcessTestCase from resolwe_bio.utils.filter import filter_comment_lines class SupportProcessorTestCase(KBBioProcessTestCase): @tag_process('bam-split') def test_bam_split(self): with self.preparation_stage(): bam = self.prepare_bam(fn='hybrid.bam', species='Mus musculus', build='mm10_dm6') header = self.run_process('upload-header-sam', {'src': 'mm10_header.sam'}) header2 = self.run_process('upload-header-sam', {'src': 'dm6_header.sam'}) inputs = { 'bam': bam.id, } bam1 = self.run_process('bam-split', inputs) bam2 = Data.objects.last() self.assertFile(bam1, 'bam', 'hybrid_mm10.bam') self.assertFile(bam1, 'bai', 'hybrid_mm10.bam.bai') self.assertFile(bam1, 'bigwig', 'hybrid_mm10.bw') self.assertFields(bam1, 'species', 'Mus musculus') self.assertFields(bam1, 'build', 'mm10') self.assertFile(bam2, 'bam', 'hybrid_dm6.bam') self.assertFile(bam2, 'bai', 'hybrid_dm6.bam.bai') self.assertFile(bam2, 'bigwig', 'hybrid_dm6.bw') self.assertFields(bam2, 'species', 'Drosophila melanogaster') self.assertFields(bam2, 'build', 'dm6') inputs['header'] = header.id inputs['header2'] = header2.id bam1 = self.run_process('bam-split', inputs) bam2 = Data.objects.last() self.assertFile(bam1, 'bam', 'hybrid_mm10.bam') self.assertFile(bam1, 'bai', 'hybrid_mm10.bam.bai') self.assertFile(bam1, 'bigwig', 'hybrid_mm10.bw') self.assertFields(bam1, 'species', 'Mus musculus') self.assertFields(bam1, 'build', 'mm10') self.assertFile(bam2, 'bam', 'hybrid_dm6.bam') self.assertFile(bam2, 'bai', 'hybrid_dm6.bam.bai') self.assertFile(bam2, 'bigwig', 'hybrid_dm6.bw') self.assertFields(bam2, 'species', 'Drosophila melanogaster') self.assertFields(bam2, 'build', 'dm6') @tag_process('gff-to-gtf') def test_gff_to_gtf(self): with self.preparation_stage(): annotation = self.prepare_annotation_gff() gff_to_gtf = self.run_process('gff-to-gtf', {'annotation': annotation.id}) self.assertFile(gff_to_gtf, 'annot', 'gff_to_gtf_annotation.gtf') del gff_to_gtf.output['annot_sorted_track_jbrowse']['total_size'] # Non-deterministic output. self.assertFields(gff_to_gtf, 'annot_sorted_track_jbrowse', {'refs': ['tracks/annotation'], 'file': 'trackList.json'}) @with_resolwe_host @tag_process('archive-samples') def test_ars(self): with self.preparation_stage(): txt_file = self.run_process('upload-file', {'src': '56G_masterfile_test.txt'}) bam_input = { 'src': 'bamplot_alignment.bam', 'species': 'Mus musculus', 'build': 'GRCh38 _ens90', } bam = self.run_process('upload-bam', bam_input) read_inputs = {'src': ['rRNA forw.fastq.gz', 'rRNA_rew.fastq.gz']} reads = self.run_process('upload-fastq-single', read_inputs) vcf_input = { 'src': 'igv_human.lf.vcf', 'species': 'Homo sapiens', 'build': 'b37', } vcf = self.run_process('upload-variants-vcf', vcf_input) expression_1 = self.prepare_expression(f_exp='exp_1_rc.tab.gz', f_type="RC") expression_2 = self.prepare_expression(f_exp='exp_2_rc.tab.gz', f_type="RC") expression_5 = self.prepare_expression(f_exp='exp_5_rc.tab.gz', f_type="RC") expression_3 = self.prepare_expression(f_rc='exp_2_rc.tab.gz', f_exp='exp_2_tpm.tab.gz', f_type="TPM") expression_4 = self.prepare_expression(f_rc='exp_2_rc.tab.gz', f_exp='exp_2_tpm.tab.gz', f_type="TPM") multiqc = self.run_process('multiqc', { 'data': [ bam.id, reads.id, ], 'advanced': { 'dirs': True, 'config': True, } }) self.run_process('archive-samples', { 'data': [txt_file.id, bam.id, reads.id, vcf.id, expression_1.id, expression_2.id, expression_5.id, expression_4.id, expression_3.id, multiqc.id], 'fields': ['file', 'bam', 'bai', 'fastq', 'fastqc_url', 'fastqc_archive', 'vcf', 'exp_set', 'report']}) @with_resolwe_host @tag_process('archive-samples') def test_archive_samples_exp_set(self): with self.preparation_stage(): expression_1 = self.prepare_expression(f_exp='exp_1_rc.tab.gz', f_type='RC') expression_2 = self.prepare_expression(f_exp='exp_2_tpm.tab.gz', f_type='TPM', f_rc='exp_2_rc.tab.gz') inputs = { 'data': [ expression_1.pk, expression_2.pk, ], 'fields': [ 'exp_set', ], } self.run_process('archive-samples', inputs) # Structured zip files are not supported by assertFile. When implemented, add here # self.assertFile(_, 'archive', 'test_archive_samples_exp_set.zip', compression='zip'). @with_resolwe_host @tag_process('archive-samples') def test_archive_samples_exp(self): with self.preparation_stage(): # Upload expression without exp_set output. Process.objects.create( slug='exp', type='data:expression:exp:', contributor=self.contributor, requirements={'expression-engine': 'jinja'}, data_name='Upload expression into exp output field', entity_type='sample', entity_descriptor_schema='sample', input_schema=[ { 'name': 'exp', 'type': 'basic:file:', } ], output_schema=[ { 'name': 'exp', 'type': 'basic:file:', }, { 'name': 'exp_type', 'type': 'basic:string:', }, { 'name': 'build', 'type': 'basic:string:', }, { 'name': 'species', 'type': 'basic:string:', }, ], run={ 'language': 'bash', 'program': ''' re-import {{ exp.file_temp|default(exp.file) }} {{ exp.file }} "tab|gz" tab 1.0 compress re-save-file exp "${NAME}.tab.gz" re-save exp_type RC re-save build ens re-save species "Homo sapiens" ''', }, ) inputs = { 'exp': 'exp_1_rc.tab.gz', } expression_1 = self.run_process('exp', inputs) expression_2 = self.prepare_expression(f_exp='exp_2_tpm.tab.gz', f_type='TPM', f_rc='exp_2_rc.tab.gz') inputs = { 'data': [ expression_1.pk, expression_2.pk, ], 'fields': [ 'exp_set', ], } self.run_process('archive-samples', inputs) # Structured zip files are not supported by assertFile. When implemented, add here # self.assertFile(_, 'archive', 'test_archive_samples_exp.zip', compression='zip'). @tag_process('prepare-geo-chipseq') def test_prepare_geo_chipseq(self): with self.preparation_stage(): reads_1 = self.prepare_paired_reads(mate1=['fw reads.fastq.gz', 'fw reads_2.fastq.gz'], mate2=['rw reads.fastq.gz', 'rw reads_2.fastq.gz']) reads_2 = self.prepare_reads() reads_3 = self.prepare_reads(['SRR2124780_1 1k.fastq.gz']) macs14_case_bam = self.prepare_bam(fn='macs14_case.bam', species='Homo sapiens', build='hg19') macs14_control_bam = self.prepare_bam(fn='macs14_control.bam', species='Homo sapiens', build='hg19') macs2_case_bam = self.prepare_bam(fn='macs2/input/SRR5675973_chr17.bam', species='Homo sapiens', build='hg19') macs2_control_bam = self.prepare_bam(fn='macs2/input/SRR5675974_chr17.bam', species='Homo sapiens', build='hg19') # Run macs14 inputs = {'treatment': macs14_case_bam.id, 'control': macs14_control_bam.id} macs14_1 = self.run_process('macs14', inputs) macs14_1.entity = reads_1.entity macs14_1.save() macs14_control_bam.entity = reads_2.entity macs14_control_bam.save() # Run macs14 without control/background sample del inputs['control'] macs14_2 = self.run_process('macs14', inputs) macs14_2.entity = reads_3.entity macs14_2.save() # Run macs2 inputs = { 'case': macs2_case_bam.id, "control": macs2_control_bam.id, 'settings': { 'extsize': 298, 'nomodel': True, 'bedgraph': True, }, } macs2_1 = self.run_process('macs2-callpeak', inputs) macs2_1.entity = reads_1.entity macs2_1.save() macs2_control_bam.entity = reads_2.entity macs2_control_bam.save() # Run macs2 without control/background sample del inputs['control'] macs2_2 = self.run_process('macs2-callpeak', inputs) macs2_2.entity = reads_3.entity macs2_2.save() inputs = { 'reads': [reads_1.id, reads_2.id, reads_3.id], 'macs': [macs14_1.id, macs14_2.id], 'name': 'prepare_geo', } prepare_geo_chipseq = self.run_process('prepare-geo-chipseq', inputs) self.assertFile(prepare_geo_chipseq, 'table', 'prepare_geo_ChIP-Seq_macs14.txt') inputs = { 'reads': [reads_1.id, reads_2.id, reads_3.id], 'macs': [macs2_1.id, macs2_2.id], 'name': 'prepare_geo', } prepare_geo_chipseq = self.run_process('prepare-geo-chipseq', inputs) self.assertFile(prepare_geo_chipseq, 'table', 'prepare_geo_ChIP-Seq_macs2.txt') @with_resolwe_host @tag_process('prepare-geo-rnaseq') def test_prepare_geo_rnaseq(self): with self.preparation_stage(): reads_1 = self.prepare_paired_reads(mate1=['fw reads.fastq.gz', 'fw reads_2.fastq.gz'], mate2=['rw reads.fastq.gz', 'rw reads_2.fastq.gz']) reads_2 = self.prepare_reads() expression_1 = self.prepare_expression(f_rc='exp_1_rc.tab.gz', f_exp='exp_1_tpm.tab.gz', f_type="TPM") expression_2 = self.prepare_expression(f_rc='exp_2_rc.tab.gz', f_exp='exp_2_tpm.tab.gz', f_type="TPM") # Add expressions to reads samples expression_1.entity = reads_1.entity expression_1.save() expression_2.entity = reads_2.entity expression_2.save() inputs = { "reads": [reads_1.id, reads_2.id], "expressions": [expression_1.pk, expression_2.pk], "name": "prepare_geo" } prepare_geo_rnaseq = self.run_process("prepare-geo-rnaseq", inputs) self.assertFile(prepare_geo_rnaseq, 'table', 'prepare_geo_RNA-Seq.txt') @tag_process('library-strandedness') def test_library_strandedness(self): with self.preparation_stage(): cds = self.run_process('upload-fasta-nucl', {'src': 'salmon_cds.fa.gz'}) inputs = { 'nucl': cds.id, 'source': 'ENSEMBL', 'species': 'Homo sapiens', 'build': 'ens_90', } salmon_index = self.run_process('salmon-index', inputs) single_reads = self.prepare_reads(['reads rsem.fq.gz']) paired_reads = self.prepare_paired_reads(mate1=['reads rsem.fq.gz'], mate2=['reads rsem2.fq.gz']) single_input = { 'reads': single_reads.id, 'salmon_index': salmon_index.id, } lib_strandedness_single = self.run_process('library-strandedness', single_input) self.assertFields(lib_strandedness_single, 'strandedness', 'U') self.assertFields(lib_strandedness_single, 'fragment_ratio', 1.0) paired_input = { 'reads': paired_reads.id, 'salmon_index': salmon_index.id, } lib_strandedness_paired = self.run_process('library-strandedness', paired_input) self.assertFields(lib_strandedness_paired, 'strandedness', 'IU') self.assertFields(lib_strandedness_paired, 'fragment_ratio', 1.0) @tag_process('multiqc') def test_multiqc(self): with self.preparation_stage(): reads = self.run_processor('upload-fastq-single', { 'src': ['hs_single bbduk_star_htseq_reads_single.fastq.gz'] }) paired_reads = self.prepare_paired_reads(['hs_paired_R1 workflow_bbduk_star_htseq.fastq.gz'], ['hs_paired_R2 workflow_bbduk_star_htseq.fastq.gz']) filtered_reads = self.run_process('bbduk-paired', {'reads': paired_reads.id}) bam_samtools = self.run_process('upload-bam-indexed', { 'src': 'alignment_position_sorted.bam', 'src2': 'alignment_position_sorted.bam.bai', 'species': 'Homo sapiens', 'build': 'hg19', }) annotation = self.run_process('upload-gtf', { 'src': 'hs annotation.gtf.gz', 'source': 'ENSEMBL', 'species': 'Homo sapiens', 'build': 'ens_90', }) genome_fasta = self.run_process('upload-fasta-nucl', {'src': 'hs genome.fasta.gz'}) star_index = self.run_process('alignment-star-index', { 'annotation': annotation.id, 'genome2': genome_fasta.id, }) star_alignment = self.run_process('alignment-star', { 'genome': star_index.id, 'reads': paired_reads.id, }) samtools_idxstats = self.run_process('samtools-idxstats', { 'alignment': star_alignment.id, }) qorts_report = self.run_process('qorts-qc', { 'alignment': star_alignment.id, 'annotation': annotation.id, 'options': { 'maxPhredScore': 42, }, }) multiqc = self.run_process('multiqc', { 'data': [ reads.id, paired_reads.id, filtered_reads.id, bam_samtools.id, star_alignment.id, samtools_idxstats.id, qorts_report.id, ], 'advanced': { 'dirs': True, 'config': True, } }) self.assertFileExists(multiqc, 'report') @tag_process('multiqc') def test_multiqc_slamdunk(self): with self.preparation_stage(): def set_sample_name(data, sample_name): """Set sample name.""" sample = Sample.objects.get(data=data) sample.name = sample_name sample.save() process = Process.objects.create( name='Upload Alleyoop data mock process', requirements={ 'expression-engine': 'jinja', 'resources': { 'network': True, }, 'executor': { 'docker': { 'image': 'resolwebio/base:ubuntu-18.04', }, }, }, entity_type='sample', entity_descriptor_schema='sample', contributor=self.contributor, type='data:alleyoop:', input_schema=[ { 'name': 'src', 'type': 'basic:file:', }, ], output_schema=[ { 'name': 'report', 'type': 'basic:file:', } ], run={ 'language': 'bash', 'program': r""" re-import {{ src.file_temp|default(src.file) }} {{ src.file }} "txt" "txt" 0.1 extract re-save-file report "${NAME}".txt """ } ) summary = self.run_process(process.slug, { 'src': os.path.join('slamseq', 'output', 'hs_alleyoop_summary.txt'), }) set_sample_name(summary, 'Alleyoop summary') rates = self.run_process(process.slug, { 'src': os.path.join('slamseq', 'output', 'hs_alleyoop_overallrates.txt'), }) set_sample_name(rates, 'Alleyoop rates') utrrates = self.run_process(process.slug, { 'src': os.path.join('slamseq', 'output', 'hs_alleyoop_mutationrates.txt'), }) set_sample_name(utrrates, 'Alleyoop UTR rates') multiqc = self.run_process('multiqc', { 'data': [ summary.id, rates.id, utrrates.id, ], 'advanced': { 'dirs': True, 'config': True, } }) self.assertFileExists(multiqc, 'report') @tag_process('seqtk-sample-single', 'seqtk-sample-paired') def test_seqtk_sample(self): with self.preparation_stage(): reads = self.run_processor('upload-fastq-single', { 'src': ['hs_single bbduk_star_htseq_reads_single.fastq.gz'] }) paired_reads = self.prepare_paired_reads(['hs_paired_R1 workflow_bbduk_star_htseq.fastq.gz'], ['hs_paired_R2 workflow_bbduk_star_htseq.fastq.gz']) inputs_single = { 'reads': reads.id, 'n_reads': 42, 'advanced': { 'seed': 42, } } seqtk_single = self.run_process('seqtk-sample-single', inputs_single) self.assertFiles(seqtk_single, 'fastq', ['seqtk_subsampled_reads_single_end.fastq.gz'], compression='gzip') inputs_paired = { 'reads': paired_reads.id, 'advanced': { 'seed': 42, 'fraction': 0.25, } } seqtk_paired = self.run_process('seqtk-sample-paired', inputs_paired) self.assertFiles(seqtk_paired, 'fastq', ['seqtk_subsampled_reads_paired_end_mate1.fastq.gz'], compression='gzip') self.assertFiles(seqtk_paired, 'fastq2', ['seqtk_subsampled_reads_paired_end_mate2.fastq.gz'], compression='gzip') @with_resolwe_host @tag_process('spikein-qc') def test_spikein_pairwise(self): with self.preparation_stage(): expression_1 = self.prepare_expression( f_exp='exp1_cpm_ercc_sirv.tab.gz', f_type='CPM', name='Sample 1', source='ENSEMBL', species='Homo sapiens') expression_2 = self.prepare_expression( f_exp='exp2_cpm_ercc_sirv.tab.gz', f_type='CPM', name='Sample 2', source='ENSEMBL', species='Homo sapiens') expression_3 = self.prepare_expression( f_exp='exp3_cpm_ercc_sirv.tab.gz', f_type='CPM', name='Sample3.txt', # Test for sample names that might look like filename extensions source='ENSEMBL', species='Homo sapiens') expression_4 = self.prepare_expression( f_exp='exp4_cpm_ercc_sirv.tab.gz', f_type='CPM', name='Sample without ERCC', source='ENSEMBL', species='Homo sapiens') # SIRV Set 3 sirv_set3 = self.run_process('spikein-qc', { 'samples': [expression_1.pk, expression_2.pk, expression_3.pk, expression_4.pk], 'mix': 'sirv_set3', }) self.assertEqual(sirv_set3.process_warning, [ 'All ERCC spike-ins have zero expression in sample Sample without ERCC', ]) self.assertFilesExist(sirv_set3, 'plots') expected_names = [item['file'] for item in sirv_set3.output['plots']] self.assertEqual(expected_names, [ "Sample 1 (ERCC spike-in's).png", "Sample 2 (ERCC spike-in's).png", "Sample3.txt (ERCC spike-in's).png", ]) self.assertFileExists(sirv_set3, 'report') self.assertFileExists(sirv_set3, 'report_zip') @tag_process('qorts-qc') def test_qorts_qc(self): with self.preparation_stage(): alignment = self.run_process('upload-bam', { 'src': 'qorts/input/hs paired.bam', 'species': 'Homo sapiens', 'build': 'ens_90', }) cds = self.run_process('upload-fasta-nucl', { 'src': 'qorts/input/salmon_cds.fa.gz' }) inputs = { 'nucl': cds.id, 'source': 'ENSEMBL', 'species': 'Homo sapiens', 'build': 'ens_90', } salmon_index = self.run_process('salmon-index', inputs) annotation = self.run_process('upload-gtf', { 'src': 'qorts/input/hs annotation.gtf.gz', 'source': 'ENSEMBL', 'species': 'Homo sapiens', 'build': 'ens_90' }) inputs = { 'alignment': alignment.id, 'annotation': annotation.id, 'options': { 'stranded': 'auto', 'cdna_index': salmon_index.id, 'adjustPhredScore': 31, }, } qorts_report = self.run_process('qorts-qc', inputs) self.assertFileExists(qorts_report, 'plot') self.assertFileExists(qorts_report, 'summary') self.assertFileExists(qorts_report, 'qorts_data') @tag_process('samtools-idxstats') def test_samtools_idxstats(self): with self.preparation_stage(): alignment = self.prepare_bam(fn='alignment_position_sorted.bam') idxstats = self.run_process('samtools-idxstats', {'alignment': alignment.id}) self.assertFile(idxstats, 'report', 'samtools_idxstats_report.txt') @tag_process('umi-tools-dedup') def test_umi_tools_dedup(self): with self.preparation_stage(): bam_single = self.run_process('upload-bam', { 'src': './corall/input/corall_single.bam', 'species': 'Homo sapiens', 'build': 'GRCh38', }) bam_paired = self.run_process('upload-bam', { 'src': './corall/input/corall_paired.bam', 'species': 'Homo sapiens', 'build': 'GRCh38', }) dedup_single = self.run_process('umi-tools-dedup', {'alignment': bam_single.id}) self.assertFile(dedup_single, 'stats', './corall/output/dedup_single_stats.txt') dedup_paired = self.run_process('umi-tools-dedup', {'alignment': bam_paired.id}) self.assertFile(dedup_paired, 'stats', './corall/output/dedup_paired_stats.txt') @tag_process('seqtk-rev-complement-single', 'seqtk-rev-complement-paired') def test_reverse_complement(self): with self.preparation_stage(): single_reads = self.prepare_reads(['hs_slamseq_R1.fastq.gz']) paired_reads = self.prepare_paired_reads(['hs_slamseq_R1.fastq.gz'], ['hs_slamseq_R2.fastq.gz']) revcomp_single = self.run_process('seqtk-rev-complement-single', {'reads': single_reads.id}) self.assertFiles(revcomp_single, 'fastq', ['hs_slamseq_R1_complemented.fastq.gz'], compression='gzip') revcomp_paired = self.run_process('seqtk-rev-complement-paired', { 'reads': paired_reads.id, 'select_mate': 'Mate 1' }) self.assertFiles(revcomp_paired, 'fastq', ['hs_slamseq_R1_complemented.fastq.gz'], compression='gzip') self.assertFiles(revcomp_paired, 'fastq2', ['hs_slamseq_R2.fastq.gz'], compression='gzip') @tag_process('alignment-summary') def test_alignment_summary(self): with self.preparation_stage(): bam = self.run_process('upload-bam', { 'src': 'bamclipper/output/TP53.primerclipped.bam', 'species': 'Homo sapiens', 'build': 'hg19', }) genome = self.run_process('upload-genome', { 'src': 'bqsr/input/hs_b37_chr17_upto_TP53.fasta.gz', 'species': 'Homo sapiens', 'build': 'hg19' }) alignment_summary = self.run_process('alignment-summary', { 'bam': bam.id, 'genome': genome.id }) self.assertFile( alignment_summary, 'report', 'hs_gatk_alignment_summary_metrics.txt', file_filter=filter_comment_lines ) @tag_process('insert-size') def test_insert_size(self): with self.preparation_stage(): bam = self.run_process('upload-bam', { 'src': 'bamclipper/output/TP53.primerclipped.bam', 'species': 'Homo sapiens', 'build': 'hg19', }) genome = self.run_process('upload-genome', { 'src': 'bqsr/input/hs_b37_chr17_upto_TP53.fasta.gz', 'species': 'Homo sapiens', 'build': 'hg19' }) alignment_summary = self.run_process('insert-size', { 'bam': bam.id, 'genome': genome.id }) self.assertFile( alignment_summary, 'report', 'hs_gatk_insert_size_metrics.txt', file_filter=filter_comment_lines ) @tag_process('wgs-metrics') def test_wgs_metrics(self): with self.preparation_stage(): bam = self.run_process('upload-bam', { 'src': 'bamclipper/output/TP53.primerclipped.bam', 'species': 'Homo sapiens', 'build': 'hg19', }) genome = self.run_process('upload-genome', { 'src': 'bqsr/input/hs_b37_chr17_upto_TP53.fasta.gz', 'species': 'Homo sapiens', 'build': 'hg19' }) wgs_metrics = self.run_process('wgs-metrics', { 'bam': bam.id, 'genome': genome.id, 'create_histogram': True }) self.assertFile( wgs_metrics, 'report', 'hs_gatk_wgs_metrics.txt', file_filter=filter_comment_lines ) @tag_process('rrbs-metrics') def test_rrbs_metrics(self): with self.preparation_stage(): bam = self.run_process('upload-bam', { 'src': 'bamclipper/output/TP53.primerclipped.bam', 'species': 'Homo sapiens', 'build': 'hg19', }) genome = self.run_process('upload-genome', { 'src': 'bqsr/input/hs_b37_chr17_upto_TP53.fasta.gz', 'species': 'Homo sapiens', 'build': 'hg19' }) rrbs_metrics = self.run_process('rrbs-metrics', { 'bam': bam.id, 'genome': genome.id, }) self.assertFileExists( rrbs_metrics, 'report', )
package com.example.labratour.presentation.model.cache import androidx.room.Database import androidx.room.RoomDatabase import com.example.labratour.presentation.model.dao.PlaceDao import com.example.labratour.presentation.model.data.PlaceGoogleModel import javax.inject.Singleton @Database(entities = [PlaceGoogleModel:: class], version = 1) @Singleton abstract class PlacesDatabase : RoomDatabase() { abstract fun placeDao(): PlaceDao }
-- EXERCISE 6 -- Obtenga el nombre y el apellido en un solo campo llamado Full_name de -- los constructores de las casas llamadas "Nova" o "El cañaduzal". (5 registros) -- First Way SELECT CONCAT("Builder".b_fname, ' ' ,"Builder".b_lname) AS "Full_name" FROM "Builder" JOIN "House" ON "Builder".bid="House".bid AND ("House".h_name='Nova' OR "House".h_name='El cañaduzal'); --Second Way SELECT "Builder".b_fname || ' ' || "Builder".b_lname AS "Full_name" FROM "Builder" NATURAL JOIN "House" WHERE ("House".h_name='Nova' OR "House".h_name='El cañaduzal');
# Copyright (C) 2015, 2020 Synopsys, Inc. # Anton Kolesov <anton.kolesov@synopsys.com> # Didin Evgeniy <didin@synopsys.com> # # SPDX-License-Identifier: GPL-2.0-or-later source [find cpu/arc/v2.tcl] proc arc_em_examine_target { {target ""} } { # Will set current target arc_v2_examine_target $target } proc arc_em_init_regs { } { arc_v2_init_regs [target current] configure \ -event examine-end "arc_em_examine_target [target current]" } # Scripts in "target" folder should call this function instead of direct # invocation of arc_common_reset. proc arc_em_reset { {target ""} } { arc_v2_reset $target # Set DEBUG.ED bit to enable clock in actionpoint module. # This is specific to ARC EM. set debug [arc jtag get-aux-reg 5] if { !($debug & (1 << 20)) } { arc jtag set-aux-reg 5 [expr {$debug | (1 << 20)}] } }
PREFIX : <http://www.swows.org/samples/DemoMovie#> PREFIX swi: <http://www.swows.org/instance#> PREFIX evt: <http://www.swows.org/2013/07/xml-dom-events#> DELETE { swi:GraphRoot :selectedAuthor ?oldAuthor } INSERT { swi:GraphRoot :selectedAuthor ?newAuthor . } WHERE { OPTIONAL{ swi:GraphRoot :selectedAuthor ?oldAuthor . } GRAPH <#clickEvent> { ?event a evt:Event ; evt:type "click" ; evt:target ?newAuthor . } . #FILTER ( ?newOption != ?oldOption ) . };
module mux2_1(out, feedback, in, en); output logic out; input logic feedback, in, en; logic out1, out2; and(out1, in, en); and (out2, feedback, ~en); or (out, out1, out2); endmodule
/*** Spectra Vista SIG Data ***/ name= gr071520_0029.sig instrument= HI: 1182092 (HR-1024i) integration= 330.0, 40.0, 10.0, 500.0, 40.0, 10.0 scan method= Time-based, Time-based scan coadds= 15, 116, 392, 10, 116, 392 scan time= 5, 5 scan settings= AI, AI external data set1= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 external data set2= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 external data dark= 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 external data mask= 0 optic= RAW DN(4), RAW DN(4) temp= 27.5, -5.1, -10.2, 28.8, -5.0, -10.2 battery= 7.87, 7.78 error= 0, 0 units= Counts, Counts time= 2020-07-15 10:59:57, 2020-07-15 11:13:46 longitude= , latitude= , gpstime= , comm= memory slot= 0, 0 factors= 0.000, 0.000, 0.000 [Overlap: Preserve, Matching Type: None] inclinometer x offset= 0, 0 inclinometer y offset= 90, 90 data= 338.0 29090.91 29100.00 100.03 339.5 31818.18 31800.00 99.94 340.9 34545.45 34500.00 99.87 342.4 37727.27 37500.00 99.40 343.8 41363.64 41000.00 99.12 345.3 45454.55 44700.00 98.34 346.8 49090.91 49100.00 100.02 348.2 53333.33 53300.00 99.94 349.7 57727.27 57600.00 99.78 351.1 62575.76 62100.00 99.24 352.6 67424.24 66800.00 99.07 354.0 71818.18 71400.00 99.42 355.5 75757.58 75700.00 99.92 356.9 79545.45 79600.00 100.07 358.4 83181.82 83200.00 100.02 359.9 87272.73 86700.00 99.34 361.3 91060.61 90700.00 99.60 362.8 95151.52 95000.00 99.84 364.2 98181.82 98000.00 99.81 365.7 101515.15 101200.00 99.69 367.1 104393.94 104200.00 99.81 368.6 106818.18 106300.00 99.51 370.1 108181.82 107800.00 99.65 371.5 110454.55 109900.00 99.50 373.0 113484.85 113000.00 99.57 374.5 116363.64 115900.00 99.60 375.9 119393.94 118800.00 99.50 377.4 123181.82 122800.00 99.69 378.8 127575.76 127100.00 99.63 380.3 131212.12 131100.00 99.91 381.8 135757.58 135500.00 99.81 383.2 141363.64 141100.00 99.81 384.7 146818.18 146800.00 99.99 386.1 152121.21 151900.00 99.85 387.6 158181.82 157300.00 99.44 389.0 165151.52 164200.00 99.42 390.5 173333.33 171900.00 99.17 392.0 180909.09 180400.00 99.72 393.4 189090.91 188700.00 99.79 394.9 197272.73 197200.00 99.96 396.4 206060.61 205800.00 99.87 397.8 215757.58 214700.00 99.51 399.3 226515.15 225400.00 99.51 400.7 238333.33 237200.00 99.52 402.2 251060.61 249900.00 99.54 403.6 264696.97 263800.00 99.66 405.1 278484.85 277600.00 99.68 406.6 292424.24 291400.00 99.65 408.0 307575.76 306200.00 99.55 409.5 324242.42 322800.00 99.56 410.9 341969.70 340800.00 99.66 412.4 359242.42 358400.00 99.77 413.8 375303.03 374700.00 99.84 415.3 392424.24 391400.00 99.74 416.8 411818.18 410300.00 99.63 418.2 432575.76 431000.00 99.64 419.7 451818.18 450500.00 99.71 421.1 468484.85 467000.00 99.68 422.6 485000.00 483600.00 99.71 424.0 506212.12 504600.00 99.68 425.5 530757.58 529000.00 99.67 426.9 554242.42 552600.00 99.70 428.4 574696.97 573300.00 99.76 429.9 592575.76 590900.00 99.72 431.3 608939.39 606700.00 99.63 432.8 625303.03 623200.00 99.66 434.2 643484.85 641700.00 99.72 435.6 662424.24 661000.00 99.78 437.1 679696.97 678400.00 99.81 438.5 694696.97 693400.00 99.81 440.0 706666.67 704700.00 99.72 441.5 716363.64 714500.00 99.74 442.9 727121.21 725500.00 99.78 444.4 740000.00 738400.00 99.78 445.8 753333.33 751800.00 99.80 447.2 764848.48 763200.00 99.78 448.7 773636.36 771800.00 99.76 450.1 781212.12 779300.00 99.76 451.6 787121.21 785400.00 99.78 453.0 791363.64 790000.00 99.83 454.5 795909.09 794400.00 99.81 455.9 801060.61 799400.00 99.79 457.4 808181.82 806600.00 99.80 458.8 815606.06 813800.00 99.78 460.2 821515.15 819800.00 99.79 461.7 826515.15 824500.00 99.76 463.1 829393.94 827900.00 99.82 464.6 831363.64 829500.00 99.78 466.0 834696.97 832900.00 99.78 467.5 842878.79 841100.00 99.79 468.9 855454.55 853900.00 99.82 470.3 868787.88 867300.00 99.83 471.8 881060.61 879400.00 99.81 473.2 890909.09 888800.00 99.76 474.6 898636.36 896300.00 99.74 476.1 904848.48 902600.00 99.75 477.5 911969.70 909900.00 99.77 479.0 923181.82 921700.00 99.84 480.4 938484.85 936600.00 99.80 481.8 954242.42 952300.00 99.80 483.3 968636.36 966800.00 99.81 484.7 980606.06 978600.00 99.80 486.1 991818.18 989800.00 99.80 487.6 1002272.73 1000400.00 99.81 489.0 1013181.82 1011300.00 99.81 490.4 1026212.12 1024000.00 99.78 491.9 1042727.27 1040400.00 99.78 493.3 1061363.64 1059200.00 99.80 494.7 1080757.58 1078600.00 99.80 496.1 1100151.52 1098100.00 99.81 497.6 1118939.39 1116700.00 99.80 499.0 1137878.79 1135400.00 99.78 500.4 1156212.12 1154100.00 99.82 501.8 1175000.00 1172800.00 99.81 503.3 1192878.79 1190500.00 99.80 504.7 1207727.27 1205400.00 99.81 506.1 1218484.85 1216300.00 99.82 507.5 1228030.30 1226100.00 99.84 509.0 1241515.15 1239500.00 99.84 510.4 1261969.70 1260100.00 99.85 511.8 1288636.36 1286600.00 99.84 513.2 1317878.79 1315900.00 99.85 514.6 1346363.64 1344100.00 99.83 516.1 1371666.67 1369000.00 99.81 517.5 1393030.30 1390600.00 99.83 518.9 1410000.00 1407200.00 99.80 520.3 1396363.64 1393500.00 99.79 521.7 1353484.85 1351200.00 99.83 523.1 1306515.15 1304500.00 99.85 524.6 1282878.79 1281300.00 99.88 526.0 1319242.42 1317700.00 99.88 527.4 1376666.67 1374600.00 99.85 528.8 1435000.00 1433200.00 99.87 530.2 1491212.12 1489600.00 99.89 531.6 1544242.42 1542600.00 99.89 533.0 1589848.48 1588800.00 99.93 534.4 1632575.76 1631800.00 99.95 535.8 1675757.58 1675100.00 99.96 537.3 1717272.73 1717800.00 100.03 538.7 1763030.30 1763600.00 100.03 540.1 1806666.67 1807600.00 100.05 541.5 1847575.76 1848500.00 100.05 542.9 1884696.97 1885500.00 100.04 544.3 1916515.15 1918000.00 100.08 545.7 1950757.58 1951900.00 100.06 547.1 1983484.85 1985000.00 100.08 548.5 2010000.00 2011800.00 100.09 549.9 2035000.00 2036800.00 100.09 551.3 2056666.67 2059300.00 100.13 552.7 2107727.27 2110400.00 100.13 554.1 2146363.64 2148800.00 100.11 555.5 2170606.06 2172800.00 100.10 556.9 2192727.27 2194500.00 100.08 558.3 2210909.09 2213200.00 100.10 559.7 2227121.21 2229100.00 100.09 561.1 2238030.30 2240200.00 100.10 562.5 2244242.42 2246800.00 100.11 563.9 2246818.18 2249700.00 100.13 565.3 2248030.30 2250600.00 100.11 566.7 2248030.30 2250800.00 100.12 568.1 2247727.27 2250300.00 100.11 569.5 2247575.76 2250100.00 100.11 570.8 2246969.70 2249400.00 100.11 572.2 2243636.36 2245600.00 100.09 573.6 2237121.21 2239300.00 100.10 575.0 2227575.76 2229400.00 100.08 576.4 2211363.64 2213500.00 100.10 577.8 2189696.97 2192100.00 100.11 579.2 2168484.85 2171300.00 100.13 580.6 2148030.30 2150600.00 100.12 582.0 2130757.58 2133300.00 100.12 583.3 2117272.73 2119100.00 100.09 584.7 2104848.48 2106500.00 100.08 586.1 2092272.73 2094200.00 100.09 587.5 2080454.55 2082600.00 100.10 588.9 2069242.42 2071400.00 100.10 590.3 2058030.30 2060200.00 100.11 591.6 2046212.12 2048400.00 100.11 593.0 2035757.58 2037300.00 100.08 594.4 2024393.94 2026200.00 100.09 595.8 2013484.85 2015600.00 100.11 597.2 2004848.48 2006900.00 100.10 598.5 1996515.15 1998300.00 100.09 599.9 1988636.36 1990200.00 100.08 601.3 1982272.73 1983700.00 100.07 602.7 1976818.18 1978500.00 100.09 604.0 1971818.18 1973200.00 100.07 605.4 1967121.21 1968500.00 100.07 606.8 1962121.21 1963900.00 100.09 608.2 1956969.70 1957900.00 100.05 609.5 1952575.76 1953800.00 100.06 610.9 1948939.39 1950100.00 100.06 612.3 1945151.52 1946000.00 100.04 613.6 1941060.61 1942000.00 100.05 615.0 1935909.09 1936900.00 100.05 616.4 1930303.03 1931700.00 100.07 617.8 1923181.82 1924800.00 100.08 619.1 1914696.97 1916600.00 100.10 620.5 1905151.52 1906700.00 100.08 621.8 1892878.79 1893900.00 100.05 623.2 1877878.79 1878600.00 100.04 624.6 1859848.48 1861000.00 100.06 625.9 1837424.24 1838400.00 100.05 627.3 1810454.55 1811500.00 100.06 628.7 1781666.67 1782800.00 100.06 630.0 1755151.52 1756500.00 100.08 631.4 1737272.73 1738000.00 100.04 632.8 1702272.73 1702600.00 100.02 634.1 1634090.91 1634200.00 100.01 635.5 1560909.09 1560600.00 99.98 636.8 1493787.88 1494000.00 100.01 638.2 1461818.18 1461700.00 99.99 639.5 1465303.03 1465200.00 99.99 640.9 1470757.58 1470300.00 99.97 642.2 1477878.79 1477700.00 99.99 643.6 1485757.58 1485900.00 100.01 645.0 1490000.00 1490300.00 100.02 646.3 1493333.33 1493600.00 100.02 647.7 1501818.18 1502400.00 100.04 649.0 1511515.15 1511800.00 100.02 650.4 1519242.42 1519100.00 99.99 651.7 1527575.76 1527700.00 100.01 653.1 1533030.30 1533100.00 100.00 654.4 1535000.00 1535200.00 100.01 655.8 1528787.88 1529000.00 100.01 657.1 1518030.30 1518200.00 100.01 658.5 1504242.42 1505100.00 100.06 659.8 1488333.33 1489000.00 100.04 661.2 1475303.03 1476300.00 100.07 662.5 1471818.18 1472600.00 100.05 663.8 1502272.73 1503100.00 100.06 665.2 1540303.03 1540200.00 99.99 666.5 1556969.70 1556800.00 99.99 667.9 1567878.79 1568600.00 100.05 669.2 1578636.36 1579400.00 100.05 670.5 1588181.82 1589400.00 100.08 671.9 1596515.15 1597900.00 100.09 673.2 1602272.73 1603500.00 100.08 674.6 1602878.79 1603700.00 100.05 675.9 1597878.79 1598800.00 100.06 677.2 1587272.73 1588200.00 100.06 678.6 1576060.61 1577000.00 100.06 679.9 1569545.45 1570200.00 100.04 681.2 1565303.03 1566100.00 100.05 682.6 1563484.85 1564200.00 100.05 683.9 1563030.30 1563700.00 100.04 685.2 1563181.82 1564100.00 100.06 686.6 1564090.91 1565000.00 100.06 687.9 1566060.61 1566600.00 100.03 689.2 1569090.91 1569400.00 100.02 690.6 1571969.70 1572600.00 100.04 691.9 1575606.06 1576100.00 100.03 693.2 1579848.48 1580200.00 100.02 694.5 1584393.94 1585200.00 100.05 695.9 1591212.12 1591300.00 100.01 697.2 1598787.88 1599100.00 100.02 698.5 1607272.73 1608000.00 100.05 699.8 1615606.06 1616600.00 100.06 701.2 1625000.00 1625200.00 100.01 702.5 1631818.18 1632200.00 100.02 703.8 1638484.85 1638400.00 99.99 705.1 1644696.97 1644600.00 99.99 706.5 1650454.55 1651100.00 100.04 707.8 1655909.09 1656500.00 100.04 709.1 1660757.58 1661300.00 100.03 710.4 1665606.06 1666200.00 100.04 711.7 1669545.45 1669900.00 100.02 713.1 1672121.21 1673200.00 100.06 714.4 1675454.55 1675700.00 100.01 715.7 1677272.73 1677600.00 100.02 717.0 1679242.42 1679400.00 100.01 718.3 1680606.06 1680900.00 100.02 719.6 1681666.67 1682200.00 100.03 720.9 1681363.64 1681800.00 100.03 722.3 1681060.61 1681500.00 100.03 723.6 1680454.55 1681100.00 100.04 724.9 1678484.85 1679200.00 100.04 726.2 1677121.21 1677600.00 100.03 727.5 1675151.52 1675600.00 100.03 728.8 1671969.70 1672600.00 100.04 730.1 1668333.33 1668600.00 100.02 731.4 1664545.45 1665200.00 100.04 732.7 1659848.48 1660400.00 100.03 734.0 1654696.97 1655300.00 100.04 735.3 1647878.79 1648500.00 100.04 736.6 1638939.39 1639700.00 100.05 737.9 1628939.39 1629300.00 100.02 739.2 1616666.67 1617300.00 100.04 740.5 1602575.76 1602900.00 100.02 741.8 1587878.79 1588400.00 100.03 743.1 1569848.48 1570100.00 100.02 744.4 1550454.55 1550600.00 100.01 745.7 1540303.03 1540500.00 100.01 747.0 1529848.48 1530200.00 100.02 748.3 1519545.45 1519400.00 99.99 749.6 1509696.97 1509500.00 99.99 750.9 1504242.42 1504600.00 100.02 752.2 1499545.45 1500100.00 100.04 753.5 1500909.09 1501600.00 100.05 754.8 1506818.18 1507100.00 100.02 756.1 1512727.27 1512900.00 100.01 757.4 1515454.55 1515800.00 100.02 758.7 1515000.00 1515400.00 100.03 760.0 1511060.61 1511800.00 100.05 761.2 1504242.42 1504900.00 100.04 762.5 1495606.06 1496200.00 100.04 763.8 1489090.91 1490000.00 100.06 765.1 1483333.33 1484200.00 100.06 766.4 1476060.61 1476700.00 100.04 767.7 1468030.30 1468600.00 100.04 769.0 1458939.39 1459600.00 100.05 770.2 1448030.30 1448600.00 100.04 771.5 1436515.15 1437300.00 100.05 772.8 1424242.42 1425100.00 100.06 774.1 1412424.24 1413000.00 100.04 775.4 1399242.42 1400500.00 100.09 776.7 1386515.15 1387600.00 100.08 777.9 1373030.30 1374400.00 100.10 779.2 1360151.52 1361400.00 100.09 780.5 1347121.21 1348300.00 100.09 781.8 1333333.33 1333900.00 100.04 783.0 1319696.97 1320500.00 100.06 784.3 1305303.03 1306800.00 100.11 785.6 1290606.06 1292500.00 100.15 786.8 1276060.61 1277600.00 100.12 788.1 1261212.12 1262800.00 100.13 789.4 1246515.15 1248200.00 100.14 790.7 1231212.12 1233200.00 100.16 791.9 1215757.58 1218000.00 100.18 793.2 1200454.55 1202600.00 100.18 794.5 1185454.55 1187000.00 100.13 795.7 1169545.45 1171400.00 100.16 797.0 1153787.88 1155600.00 100.16 798.2 1138181.82 1140400.00 100.19 799.5 1122575.76 1125000.00 100.22 800.8 1107121.21 1109400.00 100.21 802.0 1092424.24 1094800.00 100.22 803.3 1078030.30 1080600.00 100.24 804.5 1064090.91 1066200.00 100.20 805.8 1050000.00 1052000.00 100.19 807.1 1035757.58 1037900.00 100.21 808.3 1021818.18 1024200.00 100.23 809.6 1008181.82 1010700.00 100.25 810.8 994393.94 997500.00 100.31 812.1 981060.61 983900.00 100.29 813.3 967878.79 969700.00 100.19 814.6 954393.94 956800.00 100.25 815.8 941212.12 943400.00 100.23 817.1 927727.27 930400.00 100.29 818.3 915000.00 917700.00 100.30 819.6 902272.73 905200.00 100.32 820.8 889848.48 892500.00 100.30 822.1 877727.27 880100.00 100.27 823.3 864848.48 867600.00 100.32 824.6 852424.24 855400.00 100.35 825.8 839848.48 843100.00 100.39 827.0 828333.33 830900.00 100.31 828.3 816515.15 818700.00 100.27 829.5 804696.97 807000.00 100.29 830.8 792575.76 795300.00 100.34 832.0 780757.58 783500.00 100.35 833.2 768787.88 771800.00 100.39 834.5 757272.73 760100.00 100.37 835.7 745909.09 748200.00 100.31 836.9 734090.91 736200.00 100.29 838.2 722121.21 724800.00 100.37 839.4 710454.55 713300.00 100.40 840.6 699090.91 702000.00 100.42 841.9 688030.30 691200.00 100.46 843.1 677727.27 680400.00 100.39 844.3 668484.85 670800.00 100.35 845.5 658787.88 661300.00 100.38 846.8 649696.97 652000.00 100.35 848.0 640909.09 643300.00 100.37 849.2 632727.27 634800.00 100.33 850.5 624242.42 626600.00 100.38 851.7 615757.58 618300.00 100.41 852.9 607575.76 610200.00 100.43 854.1 599848.48 602400.00 100.43 855.3 592272.73 594500.00 100.38 856.5 584696.97 587100.00 100.41 857.8 577272.73 579900.00 100.46 859.0 570454.55 572800.00 100.41 860.2 563333.33 565500.00 100.38 861.4 556666.67 558700.00 100.37 862.6 549848.48 552300.00 100.45 863.8 543484.85 546000.00 100.46 865.0 537575.76 540300.00 100.51 866.2 531515.15 534000.00 100.47 867.5 525757.58 528100.00 100.45 868.7 520454.55 522400.00 100.37 869.9 514696.97 516800.00 100.41 871.1 509090.91 511400.00 100.45 872.3 503333.33 505700.00 100.47 873.5 498181.82 500500.00 100.47 874.7 492878.79 494900.00 100.41 875.9 487575.76 489500.00 100.39 877.1 482121.21 484100.00 100.41 878.3 477121.21 478700.00 100.33 879.5 471515.15 473400.00 100.40 880.7 466060.61 467800.00 100.37 881.9 460000.00 461900.00 100.41 883.1 454393.94 456400.00 100.44 884.3 448636.36 450800.00 100.48 885.5 443030.30 445000.00 100.44 886.7 437272.73 439300.00 100.46 887.8 432121.21 434100.00 100.46 889.0 426818.18 428600.00 100.42 890.2 420606.06 422900.00 100.55 891.4 415454.55 417500.00 100.49 892.6 410151.52 412000.00 100.45 893.8 404696.97 406500.00 100.45 895.0 399393.94 401000.00 100.40 896.2 393636.36 395700.00 100.52 897.3 388030.30 390400.00 100.61 898.5 382575.76 385100.00 100.66 899.7 377272.73 379500.00 100.59 900.9 372121.21 374300.00 100.59 902.0 366818.18 368800.00 100.54 903.2 361666.67 363600.00 100.53 904.4 356515.15 358100.00 100.44 905.6 350757.58 352500.00 100.50 906.8 345454.55 347300.00 100.53 907.9 340454.55 342300.00 100.54 909.1 335303.03 337500.00 100.66 910.3 330303.03 332400.00 100.63 911.4 325606.06 327700.00 100.64 912.6 321212.12 322900.00 100.53 913.8 316666.67 318100.00 100.45 914.9 312727.27 314000.00 100.41 916.1 308181.82 309900.00 100.56 917.3 304393.94 305700.00 100.43 918.4 299545.45 301500.00 100.65 919.6 295303.03 297400.00 100.71 920.8 291363.64 293500.00 100.73 921.9 287575.76 289700.00 100.74 923.1 284090.91 285800.00 100.60 924.2 280303.03 281600.00 100.46 925.4 276212.12 277500.00 100.47 926.5 272424.24 273800.00 100.51 927.7 267727.27 269700.00 100.74 928.8 264090.91 265600.00 100.57 930.0 260151.52 261700.00 100.60 931.2 256060.61 257300.00 100.48 932.3 251515.15 253500.00 100.79 933.5 247272.73 249200.00 100.78 934.6 243181.82 245000.00 100.75 935.8 239696.97 241000.00 100.54 936.9 236060.61 237600.00 100.65 938.0 232878.79 234100.00 100.52 939.2 229545.45 230500.00 100.42 940.3 225606.06 227100.00 100.66 941.5 221515.15 223200.00 100.76 942.6 217575.76 219500.00 100.88 943.8 213787.88 215700.00 100.89 944.9 210454.55 212300.00 100.88 946.0 207575.76 208800.00 100.59 947.2 204393.94 205500.00 100.54 948.3 200909.09 202200.00 100.64 949.4 197878.79 198500.00 100.31 950.6 194393.94 195300.00 100.47 951.7 190909.09 192100.00 100.62 952.8 187272.73 189100.00 100.98 954.0 184090.91 185900.00 100.98 955.1 181060.61 182700.00 100.91 956.2 177878.79 179300.00 100.80 957.4 175151.52 175900.00 100.43 958.5 171666.67 172400.00 100.43 959.6 168333.33 169100.00 100.46 960.8 164848.48 166100.00 100.76 961.9 161212.12 162700.00 100.92 963.0 158030.30 159300.00 100.80 964.1 154696.97 155800.00 100.71 965.3 151060.61 152200.00 100.75 966.4 147424.24 148700.00 100.87 967.5 143939.39 145300.00 100.95 968.6 140151.52 141600.00 101.03 969.7 136515.15 137500.00 100.72 970.9 132727.27 133100.00 100.28 972.0 128030.30 128900.00 100.68 973.1 123484.85 124200.00 100.58 974.2 118636.36 120200.00 101.32 975.3 113787.88 115200.00 101.24 976.5 108484.85 110000.00 101.40 977.6 103484.85 104500.00 100.98 978.7 98181.82 99200.00 101.04 979.8 93181.82 93600.00 100.45 980.9 87878.79 88300.00 100.48 982.0 82575.76 83000.00 100.51 983.1 77272.73 77800.00 100.68 984.2 72121.21 73000.00 101.22 985.3 67727.27 68800.00 101.58 986.5 63787.88 64900.00 101.74 987.6 60303.03 61200.00 101.49 988.7 57121.21 57700.00 101.01 989.8 54242.42 54500.00 100.47 990.9 51818.18 51700.00 99.77 992.0 49242.42 49400.00 100.32 993.1 46969.70 47300.00 100.70 994.2 44090.91 45000.00 102.06 995.3 41666.67 42900.00 102.96 996.4 39545.45 40800.00 103.17 997.5 38030.30 38700.00 101.76 998.6 36515.15 36700.00 100.51 999.7 34848.48 34900.00 100.15 1000.8 33181.82 33200.00 100.05 1001.9 31212.12 31500.00 100.92 1003.0 29545.45 29900.00 101.20 1004.2 28030.30 28400.00 101.32 1005.2 26818.18 26900.00 100.31 1006.3 25454.55 25800.00 101.36 1007.5 26060.61 26300.00 100.92 967.0 25750.00 26125.00 101.46 970.9 34500.00 34125.00 98.91 974.7 45125.00 45250.00 100.28 978.6 60750.00 60875.00 100.21 982.4 79375.00 79625.00 100.31 986.2 102000.00 102375.00 100.37 990.1 114875.00 115625.00 100.65 993.9 138625.00 138625.00 100.00 997.7 149750.00 149250.00 99.67 1001.5 173250.00 174250.00 100.58 1005.4 185250.00 184500.00 99.60 1009.2 198625.00 199000.00 100.19 1013.0 220500.00 220875.00 100.17 1016.9 234250.00 234500.00 100.11 1020.7 262875.00 263250.00 100.14 1024.5 270875.00 270750.00 99.95 1028.3 282625.00 283750.00 100.40 1032.2 296500.00 296375.00 99.96 1036.0 298000.00 297875.00 99.96 1039.8 310250.00 311375.00 100.36 1043.6 304375.00 304000.00 99.88 1047.4 319375.00 319625.00 100.08 1051.2 316125.00 315875.00 99.92 1055.1 316375.00 316750.00 100.12 1058.9 320500.00 320625.00 100.04 1062.7 330125.00 330250.00 100.04 1066.5 322875.00 323000.00 100.04 1070.3 329500.00 330000.00 100.15 1074.1 330500.00 330625.00 100.04 1077.9 333250.00 333500.00 100.08 1081.7 332375.00 333000.00 100.19 1085.6 327750.00 327125.00 99.81 1089.3 321250.00 321500.00 100.08 1093.2 327000.00 327125.00 100.04 1097.0 327125.00 327250.00 100.04 1100.8 332000.00 332125.00 100.04 1104.6 336875.00 337000.00 100.04 1108.4 335625.00 336125.00 100.15 1112.2 331625.00 332125.00 100.15 1116.0 336250.00 335750.00 99.85 1119.8 332500.00 332500.00 100.00 1123.6 332500.00 333000.00 100.15 1127.4 333750.00 333500.00 99.93 1131.2 338500.00 338625.00 100.04 1135.0 341625.00 341875.00 100.07 1138.8 342500.00 343000.00 100.15 1142.5 348125.00 347500.00 99.82 1146.3 347875.00 348000.00 100.04 1150.1 348625.00 348750.00 100.04 1153.9 344250.00 344500.00 100.07 1157.7 339125.00 338875.00 99.93 1161.5 351375.00 351750.00 100.11 1165.3 335625.00 336000.00 100.11 1169.1 342375.00 342500.00 100.04 1172.8 343750.00 344000.00 100.07 1176.6 342625.00 343000.00 100.11 1180.4 333750.00 334125.00 100.11 1184.2 341750.00 341875.00 100.04 1188.0 333375.00 333750.00 100.11 1191.8 332500.00 332875.00 100.11 1195.5 346625.00 346750.00 100.04 1199.3 355875.00 356500.00 100.18 1203.1 367375.00 367125.00 99.93 1206.8 379000.00 378625.00 99.90 1210.6 375625.00 376250.00 100.17 1214.4 386125.00 386250.00 100.03 1218.2 385000.00 385000.00 100.00 1221.9 391375.00 391500.00 100.03 1225.7 384875.00 385000.00 100.03 1229.5 380375.00 380500.00 100.03 1233.2 392750.00 392875.00 100.03 1237.0 389250.00 389625.00 100.10 1240.8 390500.00 391500.00 100.26 1244.5 389250.00 388375.00 99.78 1248.3 401125.00 401875.00 100.19 1252.1 396375.00 396625.00 100.06 1255.8 400875.00 401375.00 100.12 1259.6 406875.00 406875.00 100.00 1263.3 404875.00 405375.00 100.12 1267.1 404000.00 405000.00 100.25 1270.8 407625.00 407875.00 100.06 1274.6 410625.00 410625.00 100.00 1278.4 413750.00 414375.00 100.15 1282.1 431625.00 431750.00 100.03 1285.9 434625.00 435500.00 100.20 1289.6 438625.00 439000.00 100.09 1293.4 430875.00 431000.00 100.03 1297.1 429250.00 429500.00 100.06 1300.9 419875.00 420125.00 100.06 1304.6 419750.00 420375.00 100.15 1308.3 423750.00 424375.00 100.15 1312.1 425375.00 425500.00 100.03 1315.8 429875.00 430375.00 100.12 1319.6 432750.00 433250.00 100.12 1323.3 428500.00 428625.00 100.03 1327.1 427125.00 427500.00 100.09 1330.8 424000.00 424250.00 100.06 1334.5 424875.00 425625.00 100.18 1338.3 415625.00 415750.00 100.03 1342.0 413500.00 414000.00 100.12 1345.7 406500.00 406500.00 100.00 1349.5 396875.00 396750.00 99.97 1353.2 388875.00 388250.00 99.84 1356.9 367750.00 367125.00 99.83 1360.7 363125.00 362500.00 99.83 1364.4 348250.00 347750.00 99.86 1368.1 363875.00 363375.00 99.86 1371.8 356875.00 356250.00 99.82 1375.6 346500.00 345750.00 99.78 1379.3 340500.00 340250.00 99.93 1383.0 332625.00 331250.00 99.59 1386.7 331625.00 331500.00 99.96 1390.4 339875.00 339500.00 99.89 1394.1 343375.00 343125.00 99.93 1397.9 341875.00 341625.00 99.93 1401.6 345000.00 344625.00 99.89 1405.3 348125.00 348250.00 100.04 1409.0 344750.00 344125.00 99.82 1412.7 361375.00 361500.00 100.03 1416.4 353250.00 353500.00 100.07 1420.1 356750.00 356625.00 99.96 1423.8 360375.00 360500.00 100.03 1427.6 355500.00 355875.00 100.11 1431.2 348250.00 348125.00 99.96 1435.0 350000.00 349750.00 99.93 1438.7 343125.00 343750.00 100.18 1442.4 343875.00 343875.00 100.00 1446.1 338500.00 339125.00 100.18 1449.8 342875.00 342625.00 99.93 1453.5 342875.00 343500.00 100.18 1457.2 334250.00 334250.00 100.00 1460.8 338500.00 339125.00 100.18 1464.5 339250.00 339500.00 100.07 1468.2 332875.00 333375.00 100.15 1471.9 335500.00 335625.00 100.04 1475.6 334125.00 334625.00 100.15 1479.3 331125.00 332125.00 100.30 1483.0 335375.00 335000.00 99.89 1486.7 328625.00 329000.00 100.11 1490.4 325250.00 325500.00 100.08 1494.1 325125.00 325375.00 100.08 1497.7 324500.00 324375.00 99.96 1501.4 319750.00 320000.00 100.08 1505.1 316625.00 317125.00 100.16 1508.8 323875.00 324125.00 100.08 1512.4 318125.00 318500.00 100.12 1516.1 312375.00 313000.00 100.20 1519.8 320375.00 320125.00 99.92 1523.5 310625.00 311125.00 100.16 1527.2 318250.00 318875.00 100.20 1530.8 304625.00 305000.00 100.12 1534.5 309375.00 310125.00 100.24 1538.2 309750.00 309500.00 99.92 1541.8 303750.00 304000.00 100.08 1545.5 304500.00 305375.00 100.29 1549.2 301500.00 301125.00 99.88 1552.8 302125.00 302625.00 100.17 1556.5 297125.00 297375.00 100.08 1560.1 296250.00 296500.00 100.08 1563.8 294500.00 295125.00 100.21 1567.5 294875.00 295375.00 100.17 1571.1 291250.00 291000.00 99.91 1574.8 286500.00 287375.00 100.31 1578.4 289375.00 289375.00 100.00 1582.1 288000.00 288750.00 100.26 1585.7 281625.00 281750.00 100.04 1589.4 281625.00 281875.00 100.09 1593.0 280500.00 281125.00 100.22 1596.7 275750.00 276125.00 100.14 1600.3 273125.00 273750.00 100.23 1604.0 269500.00 269375.00 99.95 1607.6 267375.00 267875.00 100.19 1611.2 257750.00 257625.00 99.95 1614.9 257125.00 257000.00 99.95 1618.5 255750.00 256125.00 100.15 1622.2 255750.00 256750.00 100.39 1625.8 256125.00 255750.00 99.85 1629.4 258625.00 258875.00 100.10 1633.1 255000.00 255125.00 100.05 1636.7 254000.00 254250.00 100.10 1640.3 245125.00 245500.00 100.15 1644.0 247750.00 248125.00 100.15 1647.6 244250.00 243625.00 99.74 1651.2 237500.00 237750.00 100.11 1654.8 235500.00 236375.00 100.37 1658.5 233625.00 233375.00 99.89 1662.1 231375.00 231625.00 100.11 1665.7 228000.00 228125.00 100.05 1669.3 228625.00 229000.00 100.16 1673.0 224125.00 224000.00 99.94 1676.6 222000.00 222375.00 100.17 1680.2 220250.00 220500.00 100.11 1683.8 217750.00 218250.00 100.23 1687.4 216875.00 217250.00 100.17 1691.0 214000.00 213250.00 99.65 1694.6 211000.00 211625.00 100.30 1698.2 207875.00 208125.00 100.12 1701.9 206625.00 206750.00 100.06 1705.5 204500.00 205000.00 100.24 1709.1 200250.00 200125.00 99.94 1712.7 198250.00 198625.00 100.19 1716.3 196750.00 197250.00 100.25 1719.9 197625.00 197625.00 100.00 1723.5 190625.00 190875.00 100.13 1727.1 194125.00 194500.00 100.19 1730.7 190375.00 190500.00 100.07 1734.3 186875.00 187250.00 100.20 1737.9 189375.00 189875.00 100.26 1741.4 185750.00 186000.00 100.13 1745.0 186750.00 186875.00 100.07 1748.6 189875.00 189875.00 100.00 1752.2 183000.00 183375.00 100.20 1755.8 186750.00 186750.00 100.00 1759.4 183000.00 183625.00 100.34 1763.0 181250.00 181500.00 100.14 1766.6 178000.00 178125.00 100.07 1770.1 181125.00 181125.00 100.00 1773.7 190125.00 190250.00 100.07 1777.3 208000.00 207875.00 99.94 1780.9 219625.00 220375.00 100.34 1784.4 232750.00 232375.00 99.84 1788.0 231375.00 232125.00 100.32 1791.6 225750.00 226000.00 100.11 1795.2 215500.00 215375.00 99.94 1798.7 209875.00 209625.00 99.88 1802.3 202625.00 202875.00 100.12 1805.9 190000.00 190125.00 100.07 1809.4 183375.00 183500.00 100.07 1813.0 178000.00 178125.00 100.07 1816.6 168125.00 167750.00 99.78 1820.1 159750.00 160125.00 100.23 1823.7 156250.00 155500.00 99.52 1827.2 153250.00 153250.00 100.00 1830.8 143750.00 143250.00 99.65 1834.3 138750.00 138375.00 99.73 1837.9 133500.00 134000.00 100.37 1841.4 131375.00 131375.00 100.00 1845.0 126875.00 126375.00 99.61 1848.5 128750.00 129000.00 100.19 1852.1 121250.00 121000.00 99.79 1855.6 122500.00 122875.00 100.31 1859.2 123125.00 122625.00 99.59 1862.7 116000.00 116500.00 100.43 1866.2 113625.00 113000.00 99.45 1869.8 105750.00 104875.00 99.17 1873.3 104250.00 104625.00 100.36 1876.9 108250.00 108375.00 100.12 1880.4 107625.00 107250.00 99.65 1883.9 107875.00 107375.00 99.54 1887.5 101875.00 102500.00 100.61 1891.0 101000.00 100125.00 99.13 1894.5 92500.00 93500.00 101.08 1898.0 88375.00 87750.00 99.29 1901.6 80375.00 80500.00 100.16 1905.1 74500.00 73500.00 98.66 1908.6 66625.00 66875.00 100.38 1892.6 54500.00 60000.00 110.09 1895.4 66000.00 66500.00 100.76 1898.2 78500.00 75500.00 96.18 1901.0 92000.00 90500.00 98.37 1903.8 108500.00 109000.00 100.46 1906.7 126500.00 126000.00 99.60 1909.5 143000.00 144000.00 100.70 1912.3 161500.00 164000.00 101.55 1915.1 181000.00 183000.00 101.10 1917.9 201000.00 201500.00 100.25 1920.7 219000.00 219000.00 100.00 1923.4 234500.00 235500.00 100.43 1926.2 251500.00 252000.00 100.20 1929.0 268000.00 267000.00 99.63 1931.8 282000.00 282500.00 100.18 1934.6 298500.00 298000.00 99.83 1937.3 315000.00 314000.00 99.68 1940.1 330000.00 330500.00 100.15 1942.9 345500.00 347000.00 100.43 1945.7 363500.00 363500.00 100.00 1948.4 376000.00 376500.00 100.13 1951.2 383000.00 384500.00 100.39 1953.9 390000.00 390500.00 100.13 1956.7 393500.00 393000.00 99.87 1959.4 396000.00 395500.00 99.87 1962.2 396500.00 395500.00 99.75 1964.9 393000.00 393500.00 100.13 1967.7 390000.00 390500.00 100.13 1970.4 387000.00 386500.00 99.87 1973.1 380500.00 381000.00 100.13 1975.9 375500.00 376500.00 100.27 1978.6 370500.00 371500.00 100.27 1981.3 364500.00 365000.00 100.14 1984.1 359500.00 359500.00 100.00 1986.8 352500.00 353000.00 100.14 1989.5 347500.00 347500.00 100.00 1992.2 341500.00 341500.00 100.00 1994.9 332500.00 333500.00 100.30 1997.6 324500.00 326000.00 100.46 2000.3 316500.00 319000.00 100.79 2003.0 311000.00 311500.00 100.16 2005.7 306000.00 305500.00 99.84 2008.4 297500.00 299000.00 100.50 2011.1 290000.00 291500.00 100.52 2013.8 285000.00 284500.00 99.82 2016.5 277000.00 278500.00 100.54 2019.2 269500.00 272000.00 100.93 2021.9 264500.00 266000.00 100.57 2024.6 260000.00 260500.00 100.19 2027.2 255500.00 255500.00 100.00 2029.9 250500.00 252000.00 100.60 2032.6 245000.00 246000.00 100.41 2035.2 241000.00 241000.00 100.00 2037.9 235500.00 236500.00 100.42 2040.6 232500.00 233000.00 100.22 2043.2 231500.00 231000.00 99.78 2045.9 229500.00 228000.00 99.35 2048.5 226000.00 224500.00 99.34 2051.2 220500.00 220500.00 100.00 2053.8 218500.00 218500.00 100.00 2056.5 217500.00 216000.00 99.31 2059.1 215000.00 213000.00 99.07 2061.7 209000.00 210500.00 100.72 2064.4 206500.00 209000.00 101.21 2067.0 206500.00 206500.00 100.00 2069.6 203500.00 203000.00 99.75 2072.2 201000.00 200500.00 99.75 2074.9 198500.00 198000.00 99.75 2077.5 194000.00 195000.00 100.52 2080.1 191500.00 191500.00 100.00 2082.7 189000.00 188000.00 99.47 2085.3 185000.00 185500.00 100.27 2087.9 182500.00 183000.00 100.27 2090.5 180500.00 180500.00 100.00 2093.1 177500.00 177000.00 99.72 2095.7 174500.00 175000.00 100.29 2098.3 171500.00 173000.00 100.87 2100.9 170500.00 169500.00 99.41 2103.5 168500.00 166500.00 98.81 2106.1 163000.00 166000.00 101.84 2108.7 160000.00 162500.00 101.56 2111.2 158500.00 157500.00 99.37 2113.8 155000.00 155000.00 100.00 2116.4 151500.00 152000.00 100.33 2119.0 148500.00 149000.00 100.34 2121.5 146000.00 147500.00 101.03 2124.1 145500.00 147500.00 101.37 2126.7 144000.00 143500.00 99.65 2129.2 141000.00 139500.00 98.94 2131.8 139500.00 139000.00 99.64 2134.3 138500.00 139500.00 100.72 2136.9 138500.00 138000.00 99.64 2139.4 137500.00 137000.00 99.64 2142.0 137000.00 136500.00 99.64 2144.5 137000.00 137500.00 100.36 2147.1 138000.00 138000.00 100.00 2149.6 139000.00 139500.00 100.36 2152.1 139000.00 138500.00 99.64 2154.6 140000.00 137500.00 98.21 2157.2 140000.00 140000.00 100.00 2159.7 141000.00 141500.00 100.35 2162.2 143500.00 143000.00 99.65 2164.7 145000.00 145500.00 100.34 2167.2 148000.00 149500.00 101.01 2169.8 151000.00 151500.00 100.33 2172.3 153000.00 151000.00 98.69 2174.8 154000.00 152500.00 99.03 2177.3 155500.00 156500.00 100.64 2179.8 156000.00 159000.00 101.92 2182.2 158000.00 158500.00 100.32 2184.8 159500.00 159500.00 100.00 2187.2 158500.00 161000.00 101.58 2189.7 159000.00 159500.00 100.31 2192.2 160500.00 158000.00 98.44 2194.7 159500.00 157000.00 98.43 2197.2 155500.00 155000.00 99.68 2199.6 152500.00 151500.00 99.34 2202.1 151000.00 150500.00 99.67 2204.6 149000.00 149500.00 100.34 2207.0 147000.00 148000.00 100.68 2209.5 145500.00 146000.00 100.34 2212.0 144000.00 145000.00 100.69 2214.4 145000.00 146500.00 101.03 2216.9 146500.00 147000.00 100.34 2219.3 147500.00 146500.00 99.32 2221.8 148000.00 147500.00 99.66 2224.2 148000.00 148000.00 100.00 2226.6 148000.00 146500.00 98.99 2229.1 147000.00 147000.00 100.00 2231.5 146500.00 147500.00 100.68 2234.0 146500.00 145000.00 98.98 2236.4 146500.00 144000.00 98.29 2238.8 145500.00 143500.00 98.63 2241.2 144000.00 142000.00 98.61 2243.7 142500.00 142000.00 99.65 2246.1 141000.00 142500.00 101.06 2248.5 140000.00 142000.00 101.43 2250.9 140000.00 140500.00 100.36 2253.3 139500.00 137500.00 98.57 2255.7 138000.00 137500.00 99.64 2258.1 136500.00 138000.00 101.10 2260.5 136000.00 136000.00 100.00 2262.9 135500.00 135500.00 100.00 2265.3 134500.00 135000.00 100.37 2267.7 134500.00 134000.00 99.63 2270.1 133000.00 133500.00 100.38 2272.5 131000.00 132500.00 101.15 2274.8 130500.00 130000.00 99.62 2277.2 130000.00 128000.00 98.46 2279.6 128500.00 127500.00 99.22 2282.0 128000.00 126000.00 98.44 2284.3 126500.00 126500.00 100.00 2286.7 124000.00 125500.00 101.21 2289.1 122000.00 123500.00 101.23 2291.4 120500.00 121500.00 100.83 2293.8 121000.00 119500.00 98.76 2296.1 120000.00 117500.00 97.92 2298.5 118500.00 117000.00 98.73 2300.8 116500.00 116500.00 100.00 2303.2 114500.00 114500.00 100.00 2305.5 111500.00 113000.00 101.35 2307.9 111500.00 112500.00 100.90 2310.2 111000.00 110500.00 99.55 2312.5 108000.00 107500.00 99.54 2314.9 105500.00 105500.00 100.00 2317.2 105500.00 105500.00 100.00 2319.5 104000.00 104500.00 100.48 2321.8 102000.00 101000.00 99.02 2324.1 99000.00 99000.00 100.00 2326.5 97000.00 98000.00 101.03 2328.8 97000.00 96500.00 99.48 2331.1 96500.00 94000.00 97.41 2333.4 93500.00 92000.00 98.40 2335.7 91500.00 93000.00 101.64 2338.0 90500.00 91000.00 100.55 2340.3 87500.00 87500.00 100.00 2342.6 86000.00 85500.00 99.42 2344.9 85500.00 86000.00 100.58 2347.2 84500.00 85500.00 101.18 2349.4 83500.00 84500.00 101.20 2351.7 83500.00 82000.00 98.20 2354.0 81500.00 80000.00 98.16 2356.3 79000.00 79000.00 100.00 2358.6 79000.00 79000.00 100.00 2360.8 79500.00 78500.00 98.74 2363.1 79000.00 78500.00 99.37 2365.4 78000.00 77000.00 98.72 2367.6 76000.00 74500.00 98.03 2369.9 73000.00 73500.00 100.68 2372.1 73500.00 73500.00 100.00 2374.4 75000.00 72500.00 96.67 2376.6 75000.00 72000.00 96.00 2378.9 73500.00 72000.00 97.96 2381.1 72000.00 74000.00 102.78 2383.4 71000.00 74000.00 104.23 2385.6 70500.00 72000.00 102.13 2387.8 70000.00 69500.00 99.29 2390.1 70500.00 68500.00 97.16 2392.3 68500.00 67000.00 97.81 2394.5 65500.00 66500.00 101.53 2396.7 66500.00 68500.00 103.01 2398.9 66500.00 66500.00 100.00 2401.2 65000.00 63500.00 97.69 2403.4 64500.00 63000.00 97.67 2405.6 63500.00 64000.00 100.79 2407.8 62500.00 64000.00 102.40 2410.0 62500.00 62000.00 99.20 2412.2 62000.00 60000.00 96.77 2414.4 60000.00 60500.00 100.83 2416.6 59500.00 60000.00 100.84 2418.8 60000.00 58500.00 97.50 2421.0 60500.00 58500.00 96.69 2423.2 61000.00 60000.00 98.36 2425.3 59500.00 58000.00 97.48 2427.5 58000.00 58000.00 100.00 2429.7 56500.00 58500.00 103.54 2431.9 55500.00 56000.00 100.90 2434.0 56500.00 55000.00 97.35 2436.2 55500.00 55000.00 99.10 2438.4 52500.00 55500.00 105.71 2440.5 53500.00 54500.00 101.87 2442.7 53500.00 54000.00 100.93 2444.9 52500.00 54000.00 102.86 2447.0 52000.00 52500.00 100.96 2449.1 51000.00 51000.00 100.00 2451.3 51000.00 51000.00 100.00 2453.4 51000.00 50500.00 99.02 2455.6 50500.00 49000.00 97.03 2457.7 50000.00 48500.00 97.00 2459.9 49000.00 49000.00 100.00 2462.0 47500.00 47000.00 98.95 2464.1 48000.00 46000.00 95.83 2466.2 48000.00 47500.00 98.96 2468.4 47000.00 47000.00 100.00 2470.5 47000.00 46500.00 98.94 2472.6 46000.00 46500.00 101.09 2474.7 45500.00 46000.00 101.10 2476.8 45000.00 44000.00 97.78 2478.9 44000.00 44500.00 101.14 2481.0 41500.00 43500.00 104.82 2483.1 40500.00 44000.00 108.64 2485.2 41500.00 43500.00 104.82 2487.3 42000.00 40500.00 96.43 2489.4 40500.00 39000.00 96.30 2491.5 38500.00 38000.00 98.70 2493.6 37000.00 38500.00 104.05 2495.7 36500.00 37500.00 102.74 2497.8 37500.00 35500.00 94.67 2499.8 36500.00 35000.00 95.89 2501.9 34500.00 34000.00 98.55 2504.0 33500.00 33000.00 98.51 2506.1 33000.00 33000.00 100.00 2508.1 32000.00 32500.00 101.56 2510.2 31000.00 31500.00 101.61 2512.2 30500.00 30500.00 100.00 2514.3 29000.00 29500.00 101.72
/* Copyright 2009 the original author or 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 geb.content import geb.navigator.Navigator @SuppressWarnings("EqualsAndHashCode") class SimplePageContent extends TemplateDerivedPageContent { void init(PageContentTemplate template, Navigator navigator, Object[] args) { super.init(template, navigator, *args) } @Override boolean equals(Object o) { if (o in SimplePageContent) { super.equals(o) false } else { def values = iterator()*.value().findAll { it != null } def value switch (values.size()) { case 0: value = null break case 1: value = values.first() break default: value = values } value == o } } }
program test1_ll #if (_DP==0) use iso_fortran_env,only:int32,int64,wp=>real32 #else use iso_fortran_env,only:int32,int64,wp=>real64 #endif use modsparse implicit none integer(kind=int32)::nrow,i,j integer(kind=int32)::row integer(kind=int32)::col integer(kind=int32)::iunit, istat real(kind=wp)::val logical::lup=.false. type(llsparse)::ll type(coosparse)::coo type(crssparse)::crs !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !LINKED LINK open(newunit=iunit,file='crsinput.ascii',status='old',action='read') read(iunit,*) nrow ll=llsparse(nrow,lupper=lup) do read(iunit,*,iostat=istat) row,col,val if(istat.ne.0)exit call ll%add(row,col,val) end do close(iunit) call ll%printstats() call ll%print() !call coo%print(lint=.false.) call ll%printtofile('ll.dat') print*,'size ll: ',ll%nonzero() do i=1,ll%getdim(1) do j=1,ll%getdim(2) print*,i,j,ll%get(i,j) enddo enddo end program
package typingsSlinky.formatjsEcma402Abstract.numberMod import org.scalablytyped.runtime.StObject import scala.scalajs.js import scala.scalajs.js.`|` import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess} /* Rewritten from type alias, can be one of: - typingsSlinky.formatjsEcma402Abstract.formatjsEcma402AbstractStrings.decimal - typingsSlinky.formatjsEcma402Abstract.formatjsEcma402AbstractStrings.percent - typingsSlinky.formatjsEcma402Abstract.formatjsEcma402AbstractStrings.currency - typingsSlinky.formatjsEcma402Abstract.formatjsEcma402AbstractStrings.unit */ trait NumberFormatOptionsStyle extends StObject object NumberFormatOptionsStyle { @scala.inline def currency: typingsSlinky.formatjsEcma402Abstract.formatjsEcma402AbstractStrings.currency = "currency".asInstanceOf[typingsSlinky.formatjsEcma402Abstract.formatjsEcma402AbstractStrings.currency] @scala.inline def decimal: typingsSlinky.formatjsEcma402Abstract.formatjsEcma402AbstractStrings.decimal = "decimal".asInstanceOf[typingsSlinky.formatjsEcma402Abstract.formatjsEcma402AbstractStrings.decimal] @scala.inline def percent: typingsSlinky.formatjsEcma402Abstract.formatjsEcma402AbstractStrings.percent = "percent".asInstanceOf[typingsSlinky.formatjsEcma402Abstract.formatjsEcma402AbstractStrings.percent] @scala.inline def unit: typingsSlinky.formatjsEcma402Abstract.formatjsEcma402AbstractStrings.unit = "unit".asInstanceOf[typingsSlinky.formatjsEcma402Abstract.formatjsEcma402AbstractStrings.unit] }
(directive body: (body) @function.inner) @function.outer (section (title) @class.inner) @class.outer (transition) @class.outer [ (bullet_list) (enumerated_list) (definition_list) (field_list) (literal_block) (line_block) (block_quote) (doctest_block) ] @block.outer (footnote body: (body) @block.inner) @block.outer (citation body: (body) @block.inner) @block.outer (target link: (link) @block.inner) @block.outer (substitution_definition body: (body) @block.inner) @block.outer (comment) @comment.outer
module Main exposing (Category, Item, Model, Msg(..), Portfolio, init, initialModel, main, subscriptions, update, view) import Browser import Html exposing (..) import Html.Attributes exposing (attribute, class, classList, href, src, target, type_, width) import Html.Events exposing (onClick) import Http import Json.Decode as Decode exposing (Decoder, Value) import Json.Decode.Pipeline as Pipeline exposing (optional, required) {--Model The `initialModel` function initializes our Model. This function is called in `init` and outputs a Model --} initialModel : Model initialModel = { portfolio = { categories = [], items = [] } } type alias Model = { portfolio : Portfolio } type alias Portfolio = { categories : List Category , items : List Item } type alias Category = { id : Int, label : String } type alias Item = { id : Int , title : String , categoryId : Int , imageUrl : String , linkUrl : String , description : String , overlayColor : String } {--View The function `view` renders an Html element using our application model. Note that the type signature is Model -> Html Msg. This means that this function transforms an argument of Model into an Html element would produce messages tagged with Msg. We will see this when we introduce some interaction. --} view : Model -> Html Msg view model = text "Hello, World!!!" {--Update-- The `update` function will be called by Html.program each time a message (`Msg`) is received. This update function responds to messages (`Msg`), updating the model and returning commands as needed. --} type Msg = ApiResponse (Result Http.Error Portfolio) | None update : Msg -> Model -> ( Model, Cmd Msg ) update msg model = ( model, Cmd.none ) {--Subscriptions In Elm, using subscriptions is how your application can listen for external input. Some examples are: - Keyboard events - Mouse movements - Browser locations changes - Websocket events In this application, we don't have a need for any active subscriptions so we add in Sub.none --} subscriptions = \_ -> Sub.none {--Program setup and initialization--} {-- The `main` function is the entry point for our app which means it's the first thing that is run --} main = Browser.element { init = init , view = view , update = update , subscriptions = subscriptions } {--The `init` function is run by `main` upon application startup and allows us to set our app's initial state as well as scheduling any commands we'd like to run after the app starts up. For now, we don't need to run any commands so we'll use Cmd.none here. --} init : () -> ( Model, Cmd Msg ) init _ = ( initialModel, Cmd.none )
# 7.1 继承链 ### 1. Ruby ```ruby class Animal def eat puts 'eat food' end end class Duck < Animal def eat puts 'eat fish' end end animal = Animal.new animal.eat # eat food duck = Duck.new duck.eat # eat fish ``` 简单的继承链如下, 包括class关系和superclass关系, 可以通过「向右一步, 向上查找」, 进行方法查找: ![简单Ruby 继承链](/images/ruby_inherit_1.png) 如果加上单键类, 就会比较复杂 ![复杂Ruby 继承链](/images/ruby_inherit_2.png) 方法查找: ```ruby class Animal def eat puts 'eat food' end # 增加一个类方法 class << self def count end end end class Duck < Animal def eat puts 'eat fish' end end duck = Duck.new # duck的单键方法 def duck.fly puts "I'm a special, I can fly~" end ``` * 对象的实例方法`obj.methods`存在于class中(`obj.class.instance_methods`) ```ruby duck.methods.grep /eat/ # eat duck.class.instance_methods(false) # eat ``` * 对象(包括类对象)的单键方法(包括类的类方法)`obj.singleton_methods` 是定义在对象的单键类中: `obj.singletonclass.instance_methods` ```ruby #true duck.singleton_methods(false) == duck.singleton_class.instance_methods(false) # fly #true Animal.singleton_methods(false) == Animal.singleton_class.instance_methods(false) # count ``` * 一个对象的实例方法的查找, 遵循「向右一步, 向上查找」; 这个「向右」通常找到的是对象的class, 不过, 如果要查找单键方法(包括类查找类方法), 这个「向右」需要从singletonclass开始查找. --- ### 2. Javascript 最简单的javascript继承类似这样: ```javascript function Animal() { this.age = 0 } Animal.prototype.eat = function() { console.log('eat food') } function Duck () {} Duck.prototype = new Animal() Duck.prototype.eat = function() { console.log('eat fish') } var animal = new Animal() animal.eat() // 'eat food' var duck = new Duck() duck.eat() // 'eat fish' ``` 以上实现有如下问题: * Duck实例的constructor失真 * 在构造器Animal中的对象属性, 在Duck的对象中没有实现, 仅仅成为了继承属性(原型链上的, 只能读), 而不是对象私有属性(可读可写) ```javascript duck.constructor //[Function: Animal] duck.age // 0 这个属性属于原型链, 而不是duck本身 ``` node.js中的util核心包是node.js自带的核心代码, 其中提供了inherits方法: ```javascript var util = require('util'); function Animal() { this.age = 0 } Animal.prototype.eat = function() { console.log('eat food') } //目的是让this去执行A方法, 这样this可以有A方法里定义的属性 (类似其他语言中调用super) function Duck() {Animal.call(this)}; Duck.prototype.eat = function() { console.log('eat fish') } util.inherits(Duck, Animal); var animal = new Animal() animal.eat() // 'eat food' var duck = new Duck() duck.eat() // 'eat fish' duck.constructor //{ [Function: Duck] super_: [Function: Animal] } duck.age // duck 自身的属性 ``` 注意`Animal.call(this)`, 作用是让this去执行Animal方法, 这样this可以有Animal方法里定义的属性. 再看看inherits的实现: ```javascript exports.inherits = function(ctor, superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; ``` * 对子类设置了`super_` 指向父类 * 子类构造器的prototype采用`Object.create`, 其中一个作用就是设定constructor为子类 #### Javascript 继承链 ![Javascript 继承链](/images/javascript_inherit_1.png) * `x instanceof y` 可以理解为: `x[.__proto__]+ === y.prototype` //[和]和+是正则表达式中的含义 因为`duck.__proto__ === Duck.prototype` 所以 `duck instanceof Duck 为 true` 因为`duck.__proto__.__proto__ === Animal.prototype` 所以 `duck instanceof Animal 为 true` 因为`duck.__proto__.__proto__.__proto__ === Object.prototype` 所以 `duck instanceof Object 为 true` 而`duck instanceof Function 为 false` * `__proto__` * 函数: 所有函数的`__proto__` 指向Function.prototype * 对象: 手动实现的继承`Duck.prototype = new Animal()` `子类.__proto__` 指向`父类.prototype` 除此之外的`__proto__`指向`Object.prototype` * 原型链继承的本质是: 在对象上迭代`__proto__` 直到找到需要的方法. Ruby继承关系中方法查找有个口诀叫做: 向右一步, 向上查找, 对Javascript继承链稍作调整, 可以看到相似的关系: ![Javascript 继承链变形](/images/javascript_inherit_2.png) * 对象和类的关系(黑色箭头) `__proto__` 类似 ruby中`.class` 如果`obj.__proto__ === klass.prototype` 那么obj是klass的实例 * 类的继承关系(蓝色箭头) `__proto__` 类似 ruby中`.superclass` 如果`subklass.prototype.__proto__ === superklass.prototype` 那么subklass是superklass的子类 * prototype的作用有点类似ruby中的singletonclass, 都是存放实例方法/属性的地方 * Javascript Function 类比 Ruby Class * Javascript Object 类比 Ruby Object --- ### 3. Go Go 没有class, 只有组合, 没有继承. --- ### 4. Lua ```lua local Animal = {} function Animal:new () local new_animal = {} self.__index = self setmetatable(new_animal, self) return new_animal end function Animal:eat () print "eat food" end local Duck = Animal:new() function Duck.eat () print "eat fish" end local animal = Animal:new() animal:eat() -- eat food local duck = Duck:new() duck:eat() -- eat fish ``` ![Lua 继承链](/images/lua_inherit.png) * 类和实例不是割裂的概念 类Duck和对象animal的创建方式完全一样: `Animal:new()`, 类和对象的区分依赖于程序的语义需求. Duck 既是一个类, 也是对象; 或者说Animal本来是一个对象, 但是可以用作一个类. --- [comment]: <> (复制)
/* * Copyright (c) 2020 Andreas Pohl * Licensed under MIT (https://github.com/apohl79/audiogridder/blob/master/COPYING) * * Author: Andreas Pohl */ #include "App.hpp" #include <signal.h> #include "Server.hpp" namespace e47 { App::App() : m_menuWindow(this) {} void App::initialise(const String& commandLineParameters) { m_logger = FileLogger::createDateStampedLogger(getApplicationName(), "Main_", ".log", ""); Logger::setCurrentLogger(m_logger); signal(SIGPIPE, SIG_IGN); showSplashWindow(); setSplashInfo("Starting server..."); m_server = std::make_unique<Server>(); m_server->startThread(); } void App::shutdown() { m_server->signalThreadShouldExit(); m_server->waitForThreadToExit(1000); Logger::setCurrentLogger(nullptr); delete m_logger; } void App::restartServer() { hideEditor(); hidePluginList(); hideServerSettings(); m_server->signalThreadShouldExit(); m_server->waitForThreadToExit(1000); m_server = std::make_unique<Server>(); m_server->startThread(); } const KnownPluginList& App::getPluginList() { return m_server->getPluginList(); } void App::showEditor(std::shared_ptr<AudioProcessor> proc, Thread::ThreadID tid, WindowCaptureCallback func) { if (proc->hasEditor()) { std::lock_guard<std::mutex> lock(m_windowMtx); m_windowOwner = tid; m_windowProc = proc; m_windowFunc = func; m_window = std::make_unique<ProcessorWindow>(m_windowProc, m_windowFunc); } } void App::hideEditor(Thread::ThreadID tid) { if (tid == 0 || tid == m_windowOwner) { std::lock_guard<std::mutex> lock(m_windowMtx); m_window.reset(); m_windowOwner = 0; m_windowProc.reset(); m_windowFunc = nullptr; } } void App::resetEditor() { std::lock_guard<std::mutex> lock(m_windowMtx); m_window.reset(); } void App::restartEditor() { std::lock_guard<std::mutex> lock(m_windowMtx); m_window = std::make_unique<ProcessorWindow>(m_windowProc, m_windowFunc); } } // namespace e47 // This kicks the whole thing off.. START_JUCE_APPLICATION(e47::App)
//***************************************************************************** // Torque -- GLSL procedural shader //***************************************************************************** #include "shaders/common/gl/hlslCompat.glsl" // Dependencies: #include "shaders/common/gl/lighting.glsl" #include "shaders/common/gl/torque.glsl" // Features: // Vert Position // Texture Animation // Base Texture // Diffuse Color // RT Lighting // Visibility // Fog // HDR Output // Translucent // Forward Shaded Material in vec2 _TEXCOORD0_; in vec3 _TEXCOORD1_; in vec3 _TEXCOORD2_; // Struct defines //Fragment shader OUT out vec4 OUT_col; //----------------------------------------------------------------------------- // Main //----------------------------------------------------------------------------- uniform sampler2D diffuseMap ; uniform vec4 diffuseMaterialColor; uniform vec3 eyePosWorld ; uniform vec4 inLightPos [3]; uniform vec4 inLightInvRadiusSq; uniform vec4 inLightColor [4]; uniform vec4 inLightSpotDir [3]; uniform vec4 inLightSpotAngle; uniform vec4 inLightSpotFalloff; uniform float specularPower ; uniform vec4 specularColor ; uniform vec4 ambient ; uniform float visibility ; uniform vec4 fogColor ; uniform vec3 fogData ; void main() { vec4 diffuseMaterialColor = diffuseMaterialColor; vec3 eyePosWorld = eyePosWorld; vec4 inLightPos[3] = inLightPos; vec4 inLightInvRadiusSq = inLightInvRadiusSq; vec4 inLightColor[4] = inLightColor; vec4 inLightSpotDir[3] = inLightSpotDir; vec4 inLightSpotAngle = inLightSpotAngle; vec4 inLightSpotFalloff = inLightSpotFalloff; float specularPower = specularPower; vec4 specularColor = specularColor; vec4 ambient = ambient; float visibility = visibility; vec4 fogColor = fogColor; vec3 fogData = fogData; //------------------------- vec2 IN_texCoord = _TEXCOORD0_; vec3 IN_wsNormal = _TEXCOORD1_; vec3 IN_wsPosition = _TEXCOORD2_; //------------------------- // Vert Position // Texture Animation // Base Texture vec4 diffuseColor = tex2D(diffuseMap, IN_texCoord); diffuseColor = toLinear(diffuseColor); OUT_col = diffuseColor; // Diffuse Color OUT_col *= diffuseMaterialColor; // RT Lighting IN_wsNormal = normalize( half3( IN_wsNormal ) ); vec3 wsView = normalize( eyePosWorld - IN_wsPosition ); vec4 rtShading; vec4 specular; compute4Lights( wsView, IN_wsPosition, IN_wsNormal, vec4( 1, 1, 1, 1 ), inLightPos, inLightInvRadiusSq, inLightColor, inLightSpotDir, inLightSpotAngle, inLightSpotFalloff, specularPower, specularColor, rtShading, specular ); OUT_col *= vec4( rtShading.rgb + ambient.rgb, 1 ); // Visibility OUT_col.a *= visibility; // Fog float fogAmount = saturate( computeSceneFog( eyePosWorld, IN_wsPosition, fogData.r, fogData.g, fogData.b ) ); OUT_col.rgb = lerp( fogColor.rgb, OUT_col.rgb, fogAmount ); // HDR Output OUT_col = hdrEncode( OUT_col ); // Translucent // Forward Shaded Material }
PREFIX Frame: <http://www.adamslair.net/ontology/storygen/frame/> PREFIX Knowledge: <http://www.adamslair.net/ontology/storygen/knowledge/> SELECT ?prey WHERE { Frame:Wolf Knowledge:PredatorOf ?prey . }
redo-always ls -A \ | grep -E '\.(binary|deps|exe|o)$' \ | xargs -r rm -fv 1>&2 redo-ifchange bin/clean inc/clean lib/clean
\beginsong{Pijte vodu}[by={Jaromír Nohavica}] \beginrefrain \chordson \lrep\ \[C]Pijte vodu, pijte pitnou vodu, pijte vodu a \[G7]nepijte \[C]rum! \rrep \endrefrain \beginverse \chordson \[C]Jeden smutný ajznboňák pil na pátém nástupišti \[G7]ajrko\[C]ňak. \[C]Huba se mu slepila a dýzl lokomotiva ho \[G7]zabi\[C]la. \endverse \emptyrefrain \beginverse \chordsoff V rodině u Becherů pijou becherovku přímo ze džberů. Proto všichni Becheři mají trable s játrama a páteří. \endverse \emptyrefrain \beginverse \chordsoff Pil som vodku značky Gorbačov a potom povedal som všeličo a voľačo. Vyfásol som za to tri roky, teraz pijem chlórované patoky. \endverse \emptyrefrain \beginverse \chordsoff Jesteśmy chlopci z Warszawy, jeźdźimy pociagiem za robota do Ostrawy. Cztery litry wódky a mnóstwo piw, po prostu bardzo fajny kolektyw. \endverse \emptyrefrain \beginverse \chordsoff Jedna paní v Americe ztrapnila se převelice, vypila na ex rum, poblila jim Bílý dům. \endverse \emptyrefrain \endsong
SELECT tab7.v1 AS v1 , tab0.v0 AS v0 , tab8.v7 AS v7 , tab5.v5 AS v5 , tab6.v6 AS v6 , tab3.v4 AS v4 , tab1.v2 AS v2 , tab4.v8 AS v8 FROM (SELECT sub AS v1 FROM sorg__language$$8$$ WHERE obj = 'wsdbm:Language0' ) tab7 JOIN (SELECT obj AS v1 , sub AS v0 FROM foaf__homepage$$1$$ ) tab0 ON(tab7.v1=tab0.v1) JOIN (SELECT sub AS v0 FROM og__tag$$3$$ WHERE obj = 'wsdbm:Topic1' ) tab2 ON(tab0.v0=tab2.v0) JOIN (SELECT sub AS v0 , obj AS v8 FROM sorg__contentSize$$5$$ ) tab4 ON(tab2.v0=tab4.v0) JOIN (SELECT sub AS v0 , obj AS v4 FROM sorg__description$$4$$ ) tab3 ON(tab4.v0=tab3.v0) JOIN (SELECT sub AS v1 , obj AS v5 FROM sorg__url$$6$$ ) tab5 ON(tab0.v1=tab5.v1) JOIN (SELECT sub AS v1 , obj AS v6 FROM wsdbm__hits$$7$$ ) tab6 ON(tab5.v1=tab6.v1) JOIN (SELECT obj AS v0 , sub AS v2 FROM gr__includes$$2$$ ) tab1 ON(tab3.v0=tab1.v0) JOIN (SELECT obj AS v0 , sub AS v7 FROM wsdbm__likes$$9$$ ) tab8 ON(tab1.v0=tab8.v0) ++++++Tables Statistic sorg__url$$6$$ 1 SO sorg__url/foaf__homepage VP <sorg__url> 5000 SO <sorg__url><foaf__homepage> 4983 1.0 SS <sorg__url><wsdbm__hits> 5000 1.0 SS <sorg__url><sorg__language> 5000 1.0 ------ sorg__contentSize$$5$$ 1 SS sorg__contentSize/foaf__homepage VP <sorg__contentSize> 2438 SS <sorg__contentSize><foaf__homepage> 616 0.25 SO <sorg__contentSize><gr__includes> 2360 0.97 SS <sorg__contentSize><og__tag> 1436 0.59 SS <sorg__contentSize><sorg__description> 1448 0.59 SO <sorg__contentSize><wsdbm__likes> 2330 0.96 ------ wsdbm__likes$$9$$ 4 OS wsdbm__likes/sorg__contentSize VP <wsdbm__likes> 112401 OS <wsdbm__likes><foaf__homepage> 26377 0.23 OS <wsdbm__likes><og__tag> 64239 0.57 OS <wsdbm__likes><sorg__description> 69713 0.62 OS <wsdbm__likes><sorg__contentSize> 10190 0.09 ------ og__tag$$3$$ 4 SS og__tag/sorg__contentSize VP <og__tag> 147271 SS <og__tag><foaf__homepage> 36952 0.25 SO <og__tag><gr__includes> 142240 0.97 SS <og__tag><sorg__description> 87737 0.6 SS <og__tag><sorg__contentSize> 14270 0.1 SO <og__tag><wsdbm__likes> 140021 0.95 ------ sorg__language$$8$$ 1 SO sorg__language/foaf__homepage VP <sorg__language> 6251 SO <sorg__language><foaf__homepage> 4983 0.8 SS <sorg__language><sorg__url> 5000 0.8 SS <sorg__language><wsdbm__hits> 5000 0.8 ------ gr__includes$$2$$ 4 OS gr__includes/sorg__contentSize VP <gr__includes> 90000 OS <gr__includes><foaf__homepage> 22529 0.25 OS <gr__includes><og__tag> 53879 0.6 OS <gr__includes><sorg__description> 53801 0.6 OS <gr__includes><sorg__contentSize> 8719 0.1 ------ wsdbm__hits$$7$$ 1 SO wsdbm__hits/foaf__homepage VP <wsdbm__hits> 5000 SO <wsdbm__hits><foaf__homepage> 4983 1.0 SS <wsdbm__hits><sorg__url> 5000 1.0 SS <wsdbm__hits><sorg__language> 5000 1.0 ------ sorg__description$$4$$ 4 SS sorg__description/sorg__contentSize VP <sorg__description> 14960 SS <sorg__description><foaf__homepage> 3760 0.25 SO <sorg__description><gr__includes> 14532 0.97 SS <sorg__description><og__tag> 8948 0.6 SS <sorg__description><sorg__contentSize> 1448 0.1 SO <sorg__description><wsdbm__likes> 14248 0.95 ------ foaf__homepage$$1$$ 4 SS foaf__homepage/sorg__contentSize VP <foaf__homepage> 11204 SO <foaf__homepage><gr__includes> 6095 0.54 SS <foaf__homepage><og__tag> 3739 0.33 SS <foaf__homepage><sorg__description> 3760 0.34 SS <foaf__homepage><sorg__contentSize> 616 0.05 OS <foaf__homepage><sorg__url> 11204 1.0 OS <foaf__homepage><wsdbm__hits> 11204 1.0 OS <foaf__homepage><sorg__language> 11204 1.0 SO <foaf__homepage><wsdbm__likes> 5961 0.53 ------
module StartHere # Write your package code here. using CommonMark # TODO figure out a way to parse Markdown and expose it to users with # whatis("FWIW") end
converting encodedByteCountForCodePoint: codePoint "Return how many bytes are needed to encode integer code point" self subclassResponsibility
# Decision Lens API # # No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # # OpenAPI spec version: 1.0 # # Generated by: https://github.com/swagger-api/swagger-codegen.git #' Mappings Class #' #' @field size #' @field items #' #' @importFrom R6 R6Class #' @importFrom jsonlite fromJSON toJSON #' @export Mappings <- R6::R6Class( 'Mappings', public = list( `size` = NULL, `items` = NULL, initialize = function(`size`, `items`){ if (!missing(`size`)) { stopifnot(is.numeric(`size`), length(`size`) == 1) self$`size` <- `size` } if (!missing(`items`)) { stopifnot(is.list(`items`), length(`items`) != 0) lapply(`items`, function(x) stopifnot(R6::is.R6(x))) self$`items` <- `items` } }, toJSON = function() { MappingsObject <- list() if (!is.null(self$`size`)) { MappingsObject[['size']] <- self$`size` } if (!is.null(self$`items`)) { MappingsObject[['items']] <- lapply(self$`items`, function(x) x$toJSON()) } MappingsObject }, fromJSON = function(MappingsJson) { MappingsObject <- dlensFromJSON(MappingsJson) if (!is.null(MappingsObject$`size`)) { self$`size` <- MappingsObject$`size` } if (!is.null(MappingsObject$`items`)) { self$`items` <- lapply(MappingsObject$`items`, function(x) { itemsObject <- Mapping$new() itemsObject$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE)) itemsObject }) } }, toJSONString = function() { sprintf( '{ "size": %d, "items": [%s] }', self$`size`, lapply(self$`items`, function(x) paste(x$toJSON(), sep=",")) ) }, fromJSONString = function(MappingsJson) { MappingsObject <- dlensFromJSON(MappingsJson) self$`size` <- MappingsObject$`size` self$`items` <- lapply(MappingsObject$`items`, function(x) Mapping$new()$fromJSON(jsonlite::toJSON(x, auto_unbox = TRUE))) } ) )
tests testExactLengthIsValid self assertValid: '{"foo":1,"bar":2}' description: 'exact length is valid'
--[[ @Date : 2016-06-15 12:09:45 @Author : DengSir (ldz5@qq.com) @Link : https://dengsir.github.io @Version : $Id$ ]] BuildEnv(...) FollowQuery = Addon:NewClass('FollowQuery', Object) FollowQuery:InitAttr{ 'Name', 'Guid', 'Class', 'Level', 'ItemLevel', 'TimeStamp', } FollowQuery._Objects = setmetatable({}, {__mode = 'v'}) function FollowQuery:Constructor(name) self:SetName(name) self._Objects[name] = self end function FollowQuery:Get(name) return self._Objects[name] or self:New(name) end function FollowQuery:GetNameText() local color = RAID_CLASS_COLORS[self:GetClass()] local name, realm = strsplit('-', self:GetName()) return format('|c%s%s|r-%s', color.colorStr, name, realm) end
{ "id": "fa06ee25-8003-40ef-b6a6-28ade307cbb0", "modelName": "GMObject", "mvc": "1.0", "name": "obj_start_game", "eventList": [ { "id": "e3942737-3cf3-42f3-8765-a1a73a7817b0", "modelName": "GMEvent", "mvc": "1.0", "IsDnD": false, "collisionObjectId": "00000000-0000-0000-0000-000000000000", "enumb": 0, "eventtype": 3, "m_owner": "fa06ee25-8003-40ef-b6a6-28ade307cbb0" } ], "maskSpriteId": "00000000-0000-0000-0000-000000000000", "overriddenProperties": null, "parentObjectId": "00000000-0000-0000-0000-000000000000", "persistent": false, "physicsAngularDamping": 0.1, "physicsDensity": 0.5, "physicsFriction": 0.2, "physicsGroup": 0, "physicsKinematic": false, "physicsLinearDamping": 0.1, "physicsObject": false, "physicsRestitution": 0.1, "physicsSensor": false, "physicsShape": 1, "physicsShapePoints": null, "physicsStartAwake": true, "properties": null, "solid": false, "spriteId": "00000000-0000-0000-0000-000000000000", "visible": true }
-- The MIT License (MIT) -- -- Copyright (c) 2014 Star Brilliant <m13253@hotmail.com> -- Copyright (c) 2014 Lancelot Fong <ilbfy08@gmail.com> -- -- 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. set mcchat_input to the text returned of (display dialog "Input the text to be pasted in Minecraft" with title "Minecraft Input Helper" default answer "") set the clipboard to mcchat_input tell application "System Events" tell process "java" -- Minecraft process set frontmost to true perform action "AXRaise" of window 1 -- active window 1 end tell end tell delay 0.3 tell application "System Events" key code 53 -- escape delay 0.1 keystroke "t" delay 0.1 keystroke "v" using control down -- paste delay 0.1 key code 36 -- return end tell end
section \<open> Building Entry System \<close> theory BuildingEntry imports "Z_Machines.Z_Machine" begin term subst_upd type_synonym staff = \<nat> consts Staff :: "staff set" maxentry :: "\<nat>" schema ASystem = s :: "\<bbbP> staff" where "s \<in> \<bbbF> Staff" "#s < maxentry" record_default ASystem zoperation AEnterBuilding = over ASystem params p\<in>Staff pre "#s < maxentry \<and> p \<notin> s" update "[s \<leadsto> s \<union> {p}]" zoperation ALeaveBuilding = over ASystem params p\<in>Staff pre "p \<in> s" update "[s \<leadsto> s - {p}]" zmachine ABuildingEntry = over ASystem init "[s \<leadsto> {}]" operations AEnterBuilding ALeaveBuilding def_consts Staff = "{0..10}" maxentry = "5" animate ABuildingEntry schema CSystem = l :: "staff list" where "l \<in> iseq Staff" "#l \<le> maxentry" record_default CSystem zoperation CEnterBuilding = params p \<in> Staff pre "#l < maxentry \<and> p \<notin> ran l" update "[l \<leadsto> l @ [p]]" definition ListRetrieveSet :: "CSystem \<Rightarrow> (_, ASystem) itree" where "ListRetrieveSet = \<questiondown>CSystem? ;; \<langle>\<lblot>s \<leadsto> set l\<rblot>\<rangle>\<^sub>a" definition SetRetrieveList :: "ASystem \<Rightarrow> (_, CSystem) itree" where "SetRetrieveList = \<questiondown>ASystem? ;; \<langle>\<lblot>l \<leadsto> sorted_list_of_set s\<rblot>\<rangle>\<^sub>a" find_theorems "(\<circ>\<^sub>s)" lemma "ListRetrieveSet ;; SetRetrieveList = \<questiondown>CSystem?" apply (simp add: ListRetrieveSet_def SetRetrieveList_def ASystem_inv_def assigns_seq kcomp_assoc assigns_assume assigns_seq_comp usubst usubst_eval) lemma "p \<in> Staff \<Longrightarrow> (ListRetrieveSet ;; AEnterBuilding p) \<sqsubseteq> (CEnterBuilding p ;; ListRetrieveSet)" unfolding ListRetrieveSet_def AEnterBuilding_def CEnterBuilding_def apply refine_auto apply (simp add: distinct_card) done end
DROP FUNCTION IF EXISTS create_livestock; CREATE FUNCTION create_livestock ( IN user_id INT , IN farm_id INT , IN name VARCHAR(255) , OUT id INT ) AS $body$ BEGIN IF permission_check_farm(set_user_id(create_livestock.user_id), create_livestock.farm_id) THEN INSERT INTO livestock ( farm_id , name ) SELECT create_livestock.farm_id , create_livestock.name FROM farms AS f WHERE f.id = create_livestock.farm_id RETURNING LASTVAL() INTO create_livestock.id; END IF; END $body$ LANGUAGE plpgsql;
PREFIX ex: <http://example.com/> SELECT ?s1 ?d9s1 ?d2s1 ?d7s1 ?d8s1 ?d5s1 WHERE { ?s1 ex:d9 ?d9s1 . ?s1 ex:d2 ?d2s1 . ?s1 ex:d7 ?d7s1 . ?s1 ex:d8 ?d8s1 . ?s1 ex:d5 ?d5s1 . } SKYLINE OF ?d9s1 MIN, ?d2s1 MIN, ?d7s1 MIN, ?d8s1 MIN, ?d5s1 MAX
<?php namespace App\Entity; use Doctrine\ORM\Mapping as ORM; /** * AccumItemDiscount * * @ORM\Table(name="accum_item_discount") * @ORM\Entity */ class AccumItemDiscount { /** * @var integer * * @ORM\Column(name="store_key", type="bigint", nullable=false) */ private $storeKey; /** * @var integer * * @ORM\Column(name="pos_number", type="smallint", nullable=false) */ private $posNumber; /** * @var \DateTime * * @ORM\Column(name="fiscal_date", type="date", nullable=false) */ private $fiscalDate; /** * @var integer * * @ORM\Column(name="plu_id", type="bigint", nullable=false) */ private $pluId; /** * @var boolean * * @ORM\Column(name="discount_context", type="boolean", nullable=false) */ private $discountContext; /** * @var boolean * * @ORM\Column(name="discount_type", type="boolean", nullable=false) */ private $discountType; /** * @var integer * * @ORM\Column(name="transaction_counter", type="bigint", nullable=false) */ private $transactionCounter; /** * @var string * * @ORM\Column(name="quantity", type="decimal", precision=15, scale=3, nullable=false) */ private $quantity; /** * @var string * * @ORM\Column(name="quantity_canc", type="decimal", precision=15, scale=3, nullable=false) */ private $quantityCanc; /** * @var string * * @ORM\Column(name="amount", type="decimal", precision=15, scale=3, nullable=false) */ private $amount; /** * @var string * * @ORM\Column(name="amount_canc", type="decimal", precision=15, scale=3, nullable=false) */ private $amountCanc; /** * @var string * * @ORM\Column(name="return_quantity", type="decimal", precision=15, scale=3, nullable=true) */ private $returnQuantity; /** * @var string * * @ORM\Column(name="return_amount", type="decimal", precision=15, scale=3, nullable=true) */ private $returnAmount; /** * @var integer * * @ORM\Column(name="department_key", type="smallint", nullable=true) */ private $departmentKey; /** * @var integer * * @ORM\Column(name="maker_key", type="bigint", nullable=true) */ private $makerKey; }
function upload_release(user, repo, token, tag, path) ghr() do ghr_path run(`$ghr_path -replace -u $(user) -r $(repo) -t $(token) $(tag) $(path)`) end end # Well, to be more precise, last non patch function last_major_version() path = basedir("..", "..", "Project.toml") version = VersionNumber(TOML.parse(String(read(path)))["version"]) return "v" * string(VersionNumber(version.major, version.minor)) end function upload_reference_images(path=basedir("recorded"), tag=last_major_version(); name="refimages") mktempdir() do dir tarfile = joinpath(dir, "$(name).tar") Tar.create(path, tarfile) upload_release("JuliaPlots", "Makie.jl", ENV["GITHUB_TOKEN"], tag, tarfile) end end function download_refimages(tag=last_major_version(); name="refimages") url = "https://github.com/JuliaPlots/Makie.jl/releases/download/$(tag)/$(name).tar" images_tar = basedir("$(name).tar") images = basedir(name) isfile(images_tar) && rm(images_tar) isdir(images) && rm(images, recursive=true, force=true) Base.download(url, images_tar) Tar.extract(images_tar, images) return images end
#!/bin/bash SCRIPTDIR=`dirname $0` ROOTDIR="${SCRIPTDIR}/.." RECORDER="${ROOTDIR}/node_modules/.bin/gdc-mock-handling" RECORDING_DIR="${ROOTDIR}/../reference-workspace/src/recordings" $RECORDER \ --hostname "secure.gooddata.com" \ --project-id "l32xdyl4bjuzgf9kkqr2avl55gtuyjwf" \ --replace-project-id "referenceworkspace" \ --recordingDir "${RECORDING_DIR}"
pragma solidity >=0.6.0 <0.8.0; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; interface CurveAddressProvider { function get_registry() external view returns (address); } interface CurveRegistry { function get_pool_from_lp_token(address lp_token) external view returns (address); } interface CurveMetapool { function get_virtual_price() external view returns (uint256); function add_liquidity(uint256[2] calldata amounts, uint256 min_mint_amounts) external returns (uint256); function add_liquidity( uint256[2] calldata _amounts, uint256 _min_mint_amounts, address _receiver ) external returns (uint256); function remove_liquidity_one_coin( uint256 amount, int128 i, uint256 min_underlying_amount ) external returns (uint256); function calc_withdraw_one_coin(uint256 _token_amount, int128 i) external view returns (uint256); } interface ThreeCrv is IERC20 {} interface CrvLPToken is IERC20 {}
# # Generated Makefile - do not edit! # # Edit the Makefile in the project folder instead (../Makefile). Each target # has a pre- and a post- target defined where you can add customization code. # # This makefile implements macros and targets common to all configurations. # # NOCDDL # Building and Cleaning subprojects are done by default, but can be controlled with the SUB # macro. If SUB=no, subprojects will not be built or cleaned. The following macro # statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf # and .clean-reqprojects-conf unless SUB has the value 'no' SUB_no=NO SUBPROJECTS=${SUB_${SUB}} BUILD_SUBPROJECTS_=.build-subprojects BUILD_SUBPROJECTS_NO= BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} CLEAN_SUBPROJECTS_=.clean-subprojects CLEAN_SUBPROJECTS_NO= CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} # Project Name PROJECTNAME=ethernet # Active Configuration DEFAULTCONF=Release CONF=${DEFAULTCONF} # All Configurations ALLCONFS=Release Debug # build .build-impl: .build-pre .validate-impl .depcheck-impl @#echo "=> Running $@... Configuration=$(CONF)" "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf # clean .clean-impl: .clean-pre .validate-impl .depcheck-impl @#echo "=> Running $@... Configuration=$(CONF)" "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf # clobber .clobber-impl: .clobber-pre .depcheck-impl @#echo "=> Running $@..." for CONF in ${ALLCONFS}; \ do \ "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \ done # all .all-impl: .all-pre .depcheck-impl @#echo "=> Running $@..." for CONF in ${ALLCONFS}; \ do \ "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \ done # build tests .build-tests-impl: .build-impl .build-tests-pre @#echo "=> Running $@... Configuration=$(CONF)" "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf # run tests .test-impl: .build-tests-impl .test-pre @#echo "=> Running $@... Configuration=$(CONF)" "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf # dependency checking support .depcheck-impl: @echo "# This code depends on make tool being used" >.dep.inc @if [ -n "${MAKE_VERSION}" ]; then \ echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES} \$${TESTOBJECTFILES}))" >>.dep.inc; \ echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ echo "include \$${DEPFILES}" >>.dep.inc; \ echo "endif" >>.dep.inc; \ else \ echo ".KEEP_STATE:" >>.dep.inc; \ echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ fi # configuration validation .validate-impl: @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ then \ echo ""; \ echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \ echo "See 'make help' for details."; \ echo "Current directory: " `pwd`; \ echo ""; \ fi @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ then \ exit 1; \ fi # help .help-impl: .help-pre @echo "This makefile supports the following configurations:" @echo " ${ALLCONFS}" @echo "" @echo "and the following targets:" @echo " build (default target)" @echo " clean" @echo " clobber" @echo " all" @echo " help" @echo "" @echo "Makefile Usage:" @echo " make [CONF=<CONFIGURATION>] [SUB=no] build" @echo " make [CONF=<CONFIGURATION>] [SUB=no] clean" @echo " make [SUB=no] clobber" @echo " make [SUB=no] all" @echo " make help" @echo "" @echo "Target 'build' will build a specific configuration and, unless 'SUB=no'," @echo " also build subprojects." @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no'," @echo " also clean subprojects." @echo "Target 'clobber' will remove all built files from all configurations and," @echo " unless 'SUB=no', also from subprojects." @echo "Target 'all' will will build all configurations and, unless 'SUB=no'," @echo " also build subprojects." @echo "Target 'help' prints this message." @echo ""
require_relative '../proto/proto' class MySender < Proto::Sender def on_send(buffer, offset, size) # Send nothing... 0 end def on_send_log(message) puts "onSend: #{message}" end end class MyReceiver < Proto::Receiver def on_receive_ordermessage(value) end def on_receive_balancemessage(value) end def on_receive_accountmessage(value) end def on_receive_log(message) puts "onReceive: #{message}" end end sender = MySender.new # Enable logging sender.logging = true # Create and send a new order order = Proto::Order.new(1, 'EURUSD', Proto::OrderSide.buy, Proto::OrderType.market, 1.23456, 1000.0) sender.send(Proto::OrderMessage.new(order)) # Create and send a new balance wallet balance = Proto::Balance.new('USD', 1000.0) sender.send(Proto::BalanceMessage.new(balance)) # Create and send a new account with some orders account = Proto::Account.new(1, 'Test', Proto::State.good, Proto::Balance.new('USD', 1000.0), Proto::Balance.new('EUR', 100.0)) account.orders.push(Proto::Order.new(1, 'EURUSD', Proto::OrderSide.buy, Proto::OrderType.market, 1.23456, 1000.0)) account.orders.push(Proto::Order.new(2, 'EURUSD', Proto::OrderSide.sell, Proto::OrderType.limit, 1.0, 100.0)) account.orders.push(Proto::Order.new(3, 'EURUSD', Proto::OrderSide.buy, Proto::OrderType.stop, 1.5, 10.0)) sender.send(Proto::AccountMessage.new(account)) receiver = MyReceiver.new # Enable logging receiver.logging = true # Receive all data from the sender receiver.receive(sender.buffer)
#!/usr/bin/env bash WD=$(pwd) mv content /content cp /content/example_credentials /content/credentials # use dummy credentials to build docs cd /content/docs make html echo "Evaluating: ls -a build/html" ls -a build/html cd $WD mv /content content EXIT_STATUS=$? echo "::set-output name=code::$EXIT_STATUS"
package iampermission import "strings" // Scanner scans an IAM permission. type Scanner struct { permission string start, end int } // Init initializes the scanner. func (s *Scanner) Init(permission string) { s.permission = permission s.start, s.end = 0, 0 } // Scan to the next segment. func (s *Scanner) Scan() bool { switch s.end { case len(s.permission): return false case 0: // start at the beginning default: s.start = s.end + 1 // start past latest dot '.' } if nextDot := strings.IndexByte(s.permission[s.start:], '.'); nextDot == -1 { s.end = len(s.permission) } else { s.end = s.start + nextDot } return true } // Segment returns the current segment. func (s *Scanner) Segment() string { return s.permission[s.start:s.end] } // Wildcard reports whether the current segment is a wildcard. func (s *Scanner) Wildcard() bool { return s.Segment() == "*" }
//Line and OP: Line 264 <COR> //ORIGINAL: (((f . link) in Trash) => (f in Trash)) //MUTATION: AND[((f . link) in Trash), (f in Trash)] //Line and OP: Line 264 <CUOI> //ORIGINAL: ((f . link) in Trash) //MUTATION: ! ((f . link) in Trash) //Line and OP: Line 264 <QTOR> //ORIGINAL: (some f : one File | AND[! ((f . link) in Trash), (f in Trash)]) //MUTATION: (no f : one File | AND[! ((f . link) in Trash), (f in Trash)]) open util/integer as integer sig File { link : set File } sig Trash extends File { } sig Protected extends File { } pred inv1 []{ no Trash } pred inv2 []{ File in Trash } pred inv3 []{ some Trash } pred inv4 []{ no (Protected & Trash) } pred inv5 []{ (File - Protected) in Trash } pred inv6 []{ ((~ link) . link) in iden } pred inv7 []{ no (link . Trash) } pred inv8 []{ no link } pred inv9 []{ no (link . link) } pred inv10 []{ no f : File | (! ((f . link) in Trash)) && (f in Trash) } pred inv1_OK []{ no Trash } pred inv2_OK []{ File in Trash } pred inv3_OK []{ some Trash } pred inv4_OK []{ no (Protected & Trash) } pred inv5_OK []{ (File - Protected) in Trash } pred inv6_OK []{ ((~ link) . link) in iden } pred inv7_OK []{ no (link . Trash) } pred inv8_OK []{ no link } pred inv9_OK []{ no (link . link) } pred inv10_OK []{ (Trash . link) in Trash } assert inv1_Repaired { inv1[] <=> inv1_OK[] } assert inv2_Repaired { inv2[] <=> inv2_OK[] } assert inv3_Repaired { inv3[] <=> inv3_OK[] } assert inv4_Repaired { inv4[] <=> inv4_OK[] } assert inv5_Repaired { inv5[] <=> inv5_OK[] } assert inv6_Repaired { inv6[] <=> inv6_OK[] } assert inv7_Repaired { inv7[] <=> inv7_OK[] } assert inv8_Repaired { inv8[] <=> inv8_OK[] } assert inv9_Repaired { inv9[] <=> inv9_OK[] } assert inv10_Repaired { inv10[] <=> inv10_OK[] } check inv1_Repaired expect 0 check inv2_Repaired expect 0 check inv3_Repaired expect 0 check inv4_Repaired expect 0 check inv5_Repaired expect 0 check inv6_Repaired expect 0 check inv7_Repaired expect 0 check inv8_Repaired expect 0 check inv9_Repaired expect 0 check inv10_Repaired expect 0