51L6.08752 6.76548C6.02873 6.66774 6.00413 6.55315 6.01772 6.43988C6.0313 6.32661 6.08228 6.22113 6.16252 6.14009C6.24233 6.05781 6.34797 6.00542 6.46175 5.99176C6.57552 5.97809 6.69052 6.00399 6.78752 6.06504L10.275 8.34148ZM6.16252 17.8474C6.08228 17.7663 6.0313 17.6609 6.01772 17.5476C6.00413 17.4343 6.02873 17.3197 6.08752 17.222L8.37497 13.7323L2 12.4065C2.10442 14.9141 3.1467 17.2908 4.92023 19.0654C6.69376 20.8401 9.06899 21.883 11.575 21.9875L10.25 15.646L6.7625 17.9224C6.67925 17.9718 6.58428 17.9977 6.48753 17.9975C6.35971 17.9937 6.23848 17.9398 6.15001 17.8474H6.16252Z"] {
  fill: #94e2d5;
}

path[d="M17.225 6.06504C17.3227 6.00866 17.4362 5.98608 17.548 6.00084C17.6598 6.0156 17.7637 6.06686 17.8434 6.14665C17.9232 6.22645 17.9744 6.33037 17.9892 6.44225C18.0039 6.55413 17.9813 6.66772 17.925 6.76548L15.65 10.2551L21.9875 11.581C21.9875 11.7185 21.9875 11.8562 21.9875 11.9937C21.9875 12.1313 21.9875 12.2689 21.9875 12.4065L15.65 13.7323L17.925 17.222C17.9939 17.3117 18.0313 17.4216 18.0313 17.5347C18.0313 17.6478 17.9939 17.7577 17.925 17.8474C17.8281 17.9424 17.6982 17.9962 17.5625 17.9975C17.466 17.996 17.3714 17.9702 17.2875 17.9224L13.8125 15.646L12.4125 22H11.5875L10.2625 15.6585L6.77501 17.935C6.69176 17.9843 6.59672 18.0102 6.49997 18.01C6.43455 18.0098 6.3699 17.9963 6.30977 17.9705C6.24964 17.9447 6.1953 17.9072 6.15001 17.8599C6.06977 17.7789 6.01879 17.6734 6.0052 17.5601C5.99162 17.4468 6.01621 17.3323 6.07501 17.2345L8.36253 13.7449L2 12.4065C2 12.2689 2 12.1313 2 11.9937C2 11.8562 2 11.7185 2 11.581L8.35002 10.2551L6.0625 6.76548C6.0037 6.66774 5.97918 6.55315 5.99277 6.43988C6.00635 6.32661 6.05726 6.22113 6.1375 6.14009C6.21731 6.05781 6.32295 6.00542 6.43672 5.99176C6.5505 5.97809 6.6655 6.00399 6.7625 6.06504L10.25 8.34148L11.575 2H12.4L13.7375 8.34148L17.225 6.06504Z"] {
  fill: #11111b;
}

div[class^=tierPreviews-] button[class^=button-] {
  background: linear-gradient(90deg, #94e2d5, #7199ee);
}

div[class^=notice-] div[class*=noticeText-] {
  color: #11111b;
}

div[class^=notice-] div[class*=header-] {
  color:


"""
name: "benchy.py"
title: "Low Poly Benchy"
authors: "Gumyr"
license: "http://www.apache.org/licenses/LICENSE-2.0"
created: "2023-07-09"
modified: "2024-01-09"

description: |
    STL import and edit example.

    The Benchy examples shows hot to import a STL model as a `Solid` object and change it.

    .. note::

        *Attribution:*
        The low-poly-benchy used in this example is by `reddaugherty`, see
        https://www.printables.com/model/151134-low-poly-benchy.

    .. dropdown:: Info

        - uses file `low_poly_benchy.stl`
        - uses `class Mesher`
        - uses `group_by` and `sort_by`
        - uses `make_polygon`
        - uses `split`

has_builder_mode: true
has_algebra_mode: false
image_files:
    - "example_benchy_01.png"
    - "example_benchy_02.png"
    - "example_benchy_03.png"
"""

# [Imports]
from build123d import *
from ocp_vscode import *

# [Parameters]
# - none

# [Code]
# Import the benchy as a Solid model
importer = Mesher()
benchy_stl = importer.read("low_poly_benchy.stl")[0]

with BuildPart() as benchy:
    add(benchy_stl)

    # Determine the plane that defines the top of the roof
    vertices = benchy.vertices()
    roof_vertices = vertices.filter_by_position(Axis.Z, 38, 42)
    roof_plane_vertices = [
        roof_vertices.group_by(Axis.Y, tol_digits=2)[-1].sort_by(Axis.X)[0],
        roof_vertices.sort_by(Axis.Z)[0],
        roof_vertices.group_by(Axis.Y, tol_digits=2)[0].sort_by(Axis.X)[0],
    ]
    roof_plane = Plane(
        Face(Wire.make_polygon([v.to_tuple() for v in roof_plane_vertices]))
    )
    # Remove the faceted smoke stack
    split(bisect_by=roof_plane, keep=Keep.BOTTOM)

    # Determine the position and size of the smoke stack
    smoke_stack_vertices = vertices.group_by(Axis.Z, tol_digits=0)[-1]
    smoke_stack_center = sum(
        [Vector(v.X, v.Y, v.Z) for v in smoke_stack_vertices], Vector()
    ) * (1 / len(smoke_stack_vertices))
    smoke_stack_radius = max(
        [
            (Vector(*v.to_tuple()) - smoke_stack_center).length
            for v in smoke_stack_vertices
        ]
    )

    # Create the new smoke stack
    with BuildSketch(Plane(smoke_stack_center)):
        Circle(smoke_stack_radius)
        Circle(smoke_stack_radius - 2 * MM, mode=Mode.SUBTRACT)
    extrude(amount=-3 * MM)
    with BuildSketch(Plane(smoke_stack_center)):
        Circle(smoke_stack_radius - 0.5 * MM)
        Circle(smoke_stack_radius - 2 * MM, mode=Mode.SUBTRACT)
    extrude(amount=roof_plane_vertices[1].Z - smoke_stack_center.Z)

show(benchy)
# [End]


---------------------------------------------------
; KERNEL MEMORY BANK (only accessible when the kernel is mapped)
; -----------------------------------------------------------------------------
            .section .text

;
;	For now do hard interrupt masking. We will want to change this to
;	only do timer masking once we have separate serial I/O buffering
;
;
;	Disable interrupts and return the old interrupt flag.
;
__hard_di:
	tpa
	tab
	sei			; Save old state in return to C
	rts
;
;	Enable interrupts
;
__hard_ei:
	cli			; on 680x cli enables IRQs!!!
	rts

;
;	Old flag is passed to use in B
;
__hard_irqrestore:
	andb #16		; IRQ flag
	bne irq_on
	cli
	rts
irq_on:
	sei
	rts

rebootit:
	ldaa	#0x10
	staa	MLATCH		; Switch to bank 0
	sei
	ldx	0xFFFE
	jmp	,x

;
;	TODO: .discard ?

;
init_early:
	rts			; stack was copied so this is ok

init_hardware:
	ldx #IOBASE
	; set up the timer
        ldd 0x0E,x		; system timer clock
	addd timer_step
	std 0x18,x		; set compare
	clr 0x20,x		; disable output pin logic
	bset 0x22,x 0x40	; turn on timer 2 interrupt
        ; set system RAM size
	ldd #512
	std ramsize
	ldd #448
	std procmem
	; set DDRA7 to A7 is an output (second CS line)
	bset 0x26,x 0x80
	ldx #vectors
	ldy #0xF000-60	; 20 vectors
nvec:
	ldd ,x
	std ,y
	inx
	inx
	iny
	iny
	cpy #0xF000
	bne nvec

	; copy bank 0 common to all other banks
	; interrupts are off - we have no valid stack during the copy

	; Put the helper into the iram (we aren't yet using the
	; iram so this is fine. The helper must be relocatable

	ldy	#copy_helper
	ldx	#0xF040
copy_copier:
	ldd	,y
	std	,x
	inx
	inx
	iny
	iny
	cpx	#0xF080
	bne	copy_copier
	jsr	0xF040

	; All common banks now have the same data in E200-EFFF

	; Set up the cached memory bank info
	jmp	map_kernel_di

;
;	TODO rewrite me for the M8 and use the 32K split for the copy
;

copy_helper:
	ldx	#MLATCH
	ldy	#0xE200
copyall:
	ldab	#0x10
	stab	,x
	ldaa	,y
	ldab	#0x32
	; Copy ,y into each other bank
nbank:
	stab	,x
	staa	,y
	addb	#0x22
	bcc	nbank		; when we wrap we are done
	iny
	;	Next byte
	cpy	#0xF000
	bne	copyall
	ldaa	#0x10
	staa	,x		; kernel map
	rts

	;
	;  The timers require we know 16bit load/stores are generated
	;  so we do this bit in assembler
	;
	; TODO: review here and RCBUS version
	;
plt_interrupt:
	ldx #IOBASE
	ldaa #0x55
	staa 0x3a,x		; reset watchdog. We shouldn't have it on
	coma			; but we might as well reset it in case
	staa 0x3a,x
	bset 0x23,x 0x40	; clear OC2F
timer_tick_again:
	inc timer_ticks
	ldd 0x0E,x		; get the current timer
	std timer_tmp
	ldd 0x18,x		; current match
	addd timer_step		; move on 1/50th of a second
	std 0x18,x
	subd timer_tmp		; if x


ght-2,
li.active > a.u-button-style.u-button-style.u-active-color-3-light-2[class*="u-border-"] {
  color: #111111 !important;
  background-color: #f9e79b !important;
}
a.u-link.u-hover-color-3-light-2:hover {
  color: #f9e79b !important;
}
.u-color-3-light-3,
.u-body.u-color-3-light-3,
.u-container-style.u-color-3-light-3:before,
.u-container-layout.u-color-3-light-3:before,
.u-table-alt-color-3-light-3 tr:nth-child(even) {
  color: #111111;
  background-color: #fef9e6;
}
.u-button-style.u-color-3-light-3,
.u-button-style.u-color-3-light-3[class*="u-border-"] {
  color: #111111 !important;
  background-color: #fef9e6 !important;
}
.u-button-style.u-color-3-light-3:hover,
.u-button-style.u-color-3-light-3[class*="u-border-"]:hover,
.u-button-style.u-color-3-light-3:focus,
.u-button-style.u-color-3-light-3[class*="u-border-"]:focus,
.u-button-style.u-button-style.u-color-3-light-3:active,
.u-button-style.u-button-style.u-color-3-light-3[class*="u-border-"]:active,
.u-button-style.u-button-style.u-color-3-light-3.active,
.u-button-style.u-button-style.u-color-3-light-3[class*="u-border-"].active,
li.active > .u-button-style.u-button-style.u-color-3-light-3,
li.active > .u-button-style.u-button-style.u-color-3-light-3[class*="u-border-"] {
  color: #111111 !important;
  background-color: #fceeb7 !important;
}
.u-hover-color-3-light-3:hover,
.u-hover-color-3-light-3[class*="u-border-"]:hover,
.u-hover-color-3-light-3:focus,
.u-hover-color-3-light-3[class*="u-border-"]:focus,
.u-active-color-3-light-3.u-active.u-active,
.u-active-color-3-light-3[class*="u-border-"].u-active.u-active,
a.u-button-style.u-hover-color-3-light-3:hover,
a.u-button-style.u-hover-color-3-light-3[class*="u-border-"]:hover,
a.u-button-style:hover > .u-hover-color-3-light-3,
a.u-button-style:hover > .u-hover-color-3-light-3[class*="u-border-"],
a.u-button-style.u-hover-color-3-light-3:focus,
a.u-button-style.u-hover-color-3-light-3[class*="u-border-"]:focus,
a.u-button-style.u-button-style.u-active-color-3-light-3:active,
a.u-button-style.u-button-style.u-active-color-3-light-3[class*="u-border-"]:active,
a.u-button-style.u-button-style.u-active-color-3-light-3.active,
a.u-button-style.u-button-


 if not

   @retval 0 Success
   @retval 1 Variable not found
*/
int get_user_var_int(const char *name,
                     long long int *value, int *null_value);

/**
   Get the value of user variable as a double precision float number.

   This function will return the value of variable @a name as real
   number. If the original value of the variable is not a real number,
   the value will be converted into a real number.

   @param name     user variable name
   @param value    pointer to return the value
   @param null_value if not NULL, the function will set it to true if
   the value of variable is null, set to false if not

   @retval 0 Success
   @retval 1 Variable not found
*/
int get_user_var_real(const char *name,
                      double *value, int *null_value);

/**
   Get the value of user variable as a string.

   This function will return the value of variable @a name as
   string. If the original value of the variable is not a string,
   the value will be converted into a string.

   @param name     user variable name
   @param value    pointer to the value buffer
   @param len      length of the value buffer
   @param precision precision of the value if it is a float number
   @param null_value if not NULL, the function will set it to true if
   the value of variable is null, set to false if not

   @retval 0 Success
   @retval 1 Variable not found
*/
int get_user_var_str(const char *name,
                     char *value, unsigned long len,
                     unsigned int precision, int *null_value);

#ifdef __cplusplus
}
#endif
#endif /* REPLICATION_H */


/*
 * MoleculesToTriangles/CXXSurface/CXXSpace.h
 *
 * Copyright 2009 by Martin Noble, University of Oxford
 * Author: Martin Noble
 *
 * This file is part of Coot
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; either version 3 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA
 */

#include "CXXCoord.h"
#include <iostream>
#include <iomanip>
#include <fstream>
#include "CXXFFTSolventMap.h"

#ifndef  __MMDB_Manager__
#include "mmdb2/mmdb_manager.h"
#include "mmdb2/mmdb_tables.h"
#endif

#ifndef  __CXXException__
#include <CXXException.h>
#endif

class CXXSpace:public SolventMap {

private:

	double *chargeGrid;		// charge density grid
	double *solvationGrid;  // empirical atomic solvation parameters
	double *potentialGrid;  // electrostatic potential grid
	CXXCoord<CXXCoord_ftype>*dielGrid;		// dielectric constant between i,j,k and i+1,j,k charge grid points in x()
							// dielectric constant between i,j,k and i,j+1,k charge grid points in y()
							// dielectric constant between i,j,k and i,j,k+1 charge grid points in z()
							// of coord ...
	double *epsilonKappaSq;		// grid containg both the dielectric around a point and the debey-hueckel parmeter

	double dielectricBoundary; // constat for dielectric outside box ...
	double temp;
	double saltConc;

	int setSolvationGrid(int i, int j, int k, double value);
	int setChargeGrid(int i, int j, int k, double value);
	int setDielGrid(int i, int j, int k, int direction,  double value);
	int setEpsilonKappaSq(int i, int j, int k, double value);

public:

	CXXSpace() ;
	CXXSpace(float probeRadius, float gridSpacing,
			 float xMin, float xMax, float yMin, float yMax, float zMin, float zMax);

	int setSolventParameters(double saltConc, double temp);
	int addDielectricSphere(double x, double y, double z, double r);
	int addGridCharge(int i, int j, int k, double charge);
	int setPotential(int i, int j, int k, double value);

	CXXCoord<CXXCoord_ftype>getOrigin();
	CXXCoord<CXXCoord_ftype>getSpaceSpanningVectorX();
	CXXCoord<CXXCoord_ftype>getSpaceSpanningVectorZ();
	CXXCoord<CXXCoord_ftype>getSpaceSpanningVectorY();

	int getDimI();
	int getDimJ();
	int getDimK();

	double getGridCharge(int i, int j, int k);
	double getGridSolvationParameter(int i, int j, int k);
	double getBoundaryMap(int i, int j, int k);
	double getDielGrid(int i, int j, int k, int directionn);
	double getPotential(int i, int j, int k);
	double getEpsilonKappaSq(int i, int j, int k);

	int defineBoundaryConditions(double dielectricValue);
	int introduceMedium(double dielctricInMedium, double dielectricInProtein, double probeRadius);
	int dumpSpaceSlice(int dimension, int gridType, int sliceNumber);

};


:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover,.btn:focus{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled


st user : User = usersFound[0];
                const token =jwt.sign({ _id : user._id}, MY_SECRET_KEY);

                return res.status(200).json({name : user.name, email : user.email, token})

            } else {
                return res.status(400).json({error: "email ou password invalido!"});
            }

        } else {
            return res.status(400).json({error: "login e password nao informado"});
        }
    }catch(e){

        console.log(e);
        res.status(500).json({error: 'Ocorreu ero ao efetuar login, tente novamente'});

    }
}

export default corsPolicy(dbConnect(handler));
import {
  UserType,
  AuthDispatchTypes,
  AUTH_FAIL,
  AUTH_LOADING,
  AUTH_SIGNOUT_SUCCESS,
  AUTH_CHANGE_SUCCESS,
  AUTH_LOGIN_SUCCESS,
  AUTH_REGISTER_SUCCESS
} from '../actions/types/auth';

interface AuthStateI {
  loading: boolean,
  user?: UserType | null ,
  error?: {
    message: string
  }
}

const initialState: AuthStateI = {
  loading: true,
  user: null,
};

const reducer = (
  state: AuthStateI = initialState,
  action: AuthDispatchTypes,
): AuthStateI => {
  switch (action.type) {
    case AUTH_FAIL:
      return {
        loading: false,
        error: action.payload
      };
    case AUTH_LOADING:
      return {
        loading: true,
      };
    case AUTH_LOGIN_SUCCESS:
      return {
        ...state,
        loading: false,
      };
    case AUTH_REGISTER_SUCCESS:
      return {
        ...state,
        loading: false,
      };
    case AUTH_CHANGE_SUCCESS:
      return {
        ...state,
        loading: false,
        user: action.user,
      };
    case AUTH_SIGNOUT_SUCCESS:
      return {
        loading: false,
        user: action.user,
      };
    default:
      return state;
  }
};
export default reducer;
import { JSONSchema7Definition } from "json-schema";
import { Definition } from "./../Schema/Definition";
import { intersectionOfArrays } from "./intersectionOfArrays";

/**
 * Merges nested objects and arrays.
 *
 * @param a - lhs to merge.
 * @param b - rhs to merge.
 * @param intersectArrays - compute intersection of arrays (otherwise take the array from b).
 * @returns a and b merged together.
 */
export function deepMerge(
    a: { [key: string]: JSONSchema7Definition },
    b: { [key: string]: JSONSchema7Definition }
): { [x: string]: JSONSchema7Definition } {
    const output = { ...a, ...b };

    for (const key in a) {
        if (b.hasOwnProperty(key)) {
            const elementA = a[key as keyof Definition];
            const elementB = b[key as keyof Definition];

            if (
                elementA != null &&
                elementB != null &&
                typeof elementA === "object" &&
                typeof elementB === "object" &&
                "type" in elementA &&
                "type" in elementB
            ) {
                if (elementA.type == elementB.type) {
                    if (elementA.enum == null && elementB.enum != null) {
                        (output as any)[key].enum = elementB.enum;
                    } else if (elementA.enum != null && elementB.enum == null) {
                        (output as any)[key].enum = elementA.enum;
                    } else if (elementA.enum != null && elementB.enum != null) {
                        (output as any)[key].enum = intersectionOfArrays(
                            elementA.enum as any[],
                            elementB.enum as any[]
                        );
                    }


conduit"){{
		health = 45;
	}},

	pulseconduit = new Conduit("pulseconduit"){{
		liquidCapacity = 16f;
		flowfactor = 4.9f;
		health = 65;
	}},

	liquidrouter = new LiquidRouter("liquidrouter"){{

	}},

	conveyor = new Conveyor("conveyor"){{
	}},

	steelconveyor = new Conveyor("steelconveyor"){{
		health = 55;
		speed = 0.04f;
	}},

	pulseconveyor = new Conveyor("poweredconveyor"){{
		health = 75;
		speed = 0.09f;
	}},

	router = new Router("router"){{

	}},

	junction = new Junction("junction"){{

	}},
	tunnel = new TunnelConveyor("conveyortunnel"){{
	}},
	liquidjunction = new LiquidJunction("liquidjunction"){{

	}},
	powerbooster = new PowerBooster("powerbooster"){{
		powerRange = 4;
	}},
	powerlaser = new PowerLaser("powerlaser"){{
	}},
	powerlaserrouter = new PowerLaserRouter("powerlaserrouter"){{
	}},
	powerlasercorner = new PowerLaserRouter("powerlasercorner"){{
		laserDirections = 2;
	}},
	teleporter = new Teleporter("teleporter"){{
	}},
	sorter = new Sorter("sorter"){{
	}};
}
package io.anuke.mindustry.world.blocks.types;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.BlockBar;
import io.anuke.mindustry.world.Tile;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

public abstract class PowerBlock extends Block implements PowerAcceptor{
	public float powerCapacity = 10f;
	public float voltage = 0.001f;

	public PowerBlock(String name) {
		super(name);
		update = true;
		solid = true;

		bars.add(new BlockBar(Color.YELLOW, true, tile -> tile.<PowerEntity>entity().power / powerCapacity));
	}

	@Override
	public void getStats(Array<String> list){
		super.getStats(list);
		list.add("[powerinfo]Power Capacity: " + powerCapacity);
	}

	/**Tries adding all the power with no remainder, returns success.*/
	public boolean tryAddPower(Tile tile, float amount){
		PowerEntity entity = tile.entity();

		if(entity.power + amount <= powerCapacity){
			entity.power += amount;
			return true;
		}
		return false;
	}

	@Override
	public boolean acceptsPower(Tile tile){
		PowerEntity entity = tile.entity();

		return entity.power + 0.001f <= powerCapacity;
	}

	//TODO voltage requirement so blocks need specific voltage
	@Override
	public float addPower(Tile tile, float amount){
		if(amount < voltage){
			return amount;
		}
		PowerEntity entity = tile.entity();

		float canAccept = Math.min(powerCapacity - entity.power, amount);

		entity.power += canAccept;

		return canAccept;
	}

	@Override
	public void setPower(Tile tile, float power){
		PowerEntity entity = tile.entity();
		entity.power = power;
	}

	@Override
	public TileEntity getEntity(){
		return new PowerEntity();
	}

	public static class PowerEntity extends TileEntity{
		public float power;
		public float time; //generator time. this is a bit of a hack

		@Override
		public void write(DataOutputStream stream) throws IOException{
			stream.writeF


�ౖ◌ุ◌ุ◌่b; a◌ౖ◌ุ◌ุ◌่b; a◌ౖ◌ุ◌ุ◌่b; a◌ౖ◌ุ◌ุ◌่b; ) LATIN SMALL LETTER A, THAI CHARACTER SARA U, THAI CHARACTER MAI EK, THAI CHARACTER SARA U, TELUGU AI LENGTH MARK, LATIN SMALL LETTER B
0061 0E48 0E38 0C56 0E39 0062;0061 0C56 0E38 0E39 0E48 0062;0061 0C56 0E38 0E39 0E48 0062;0061 0C56 0E38 0E39 0E48 0062;0061 0C56 0E38 0E39 0E48 0062; # (a◌่◌ุ◌ౖ◌ูb; a◌ౖ◌ุ◌ู◌่b; a◌ౖ◌ุ◌ู◌่b; a◌ౖ◌ุ◌ู◌่b; a◌ౖ◌ุ◌ู◌่b; ) LATIN SMALL LETTER A, THAI CHARACTER MAI EK, THAI CHARACTER SARA U, TELUGU AI LENGTH MARK, THAI CHARACTER SARA UU, LATIN SMALL LETTER B
0061 0E39 0E48 0E38 0C56 0062;0061 0C56 0E39 0E38 0E48 0062;0061 0C56 0E39 0E38 0E48 0062;0061 0C56 0E39 0E38 0E48 0062;0061 0C56 0E39 0E38 0E48 0062; # (a◌ู◌่◌ุ◌ౖb; a◌ౖ◌ู◌ุ◌่b; a◌ౖ◌ู◌ุ◌่b; a◌ౖ◌ู◌ุ◌่b; a◌ౖ◌ู◌ุ◌่b; ) LATIN SMALL LETTER A, THAI CHARACTER SARA UU, THAI CHARACTER MAI EK, THAI CHARACTER SARA U, TELUGU AI LENGTH MARK, LATIN SMALL LETTER B
0061 05B0 094D 3099 0E3A 0062;0061 3099 094D 0E3A 05B0 0062;0061 3099 094D 0E3A 05B0 0062;0061 3099 094D 0E3A 05B0 0062;0061 3099 094D 0E3A 05B0 0062; # (a◌ְ◌्◌゙◌ฺb; a◌゙◌्◌ฺ◌ְb; a◌゙◌्◌ฺ◌ְb; a◌゙◌्◌ฺ◌ְb; a◌゙◌्◌ฺ◌ְb; ) LATIN SMALL LETTER A, HEBREW POINT SHEVA, DEVANAGARI SIGN VIRAMA, COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK, THAI CHARACTER PHINTHU, LATIN SMALL LETTER B
0061 0E3A 05B0 094D 3099 0062;0061 3099 0E3A 094D 05B0 0062;0061 3099 0E3A 094D 05B0 0062;0061 3099 0E3A 094D 05B0 0062;0061 3099 0E3A 094D 05B0 0062; # (a◌ฺ◌ְ◌्◌゙b; a◌゙◌ฺ◌्◌ְb; a◌゙◌ฺ◌्◌ְb; a◌゙◌ฺ◌्◌ְb; a◌゙◌ฺ◌्◌ְb; ) LATIN SMALL LETTER A, THAI CHARACTER PHINTHU, HEBREW POINT SHEVA, DEVANAGAR


/*
 * Copyright (c) 2013, Andrea Mazzoleni. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/** \file
 * Dynamic array based on blocks of fixed size.
 *
 * This array is able to grow dynamically upon request, without any reallocation.
 *
 * This is very similar at ::tommy_arrayblk, but it allows to store elements of any
 * size and not just pointers.
 *
 * Note that in this case tommy_arrayblkof_ref() returns a pointer to the element,
 * that should be used for getting and setting elements in the array,
 * as generic getter and setter are not available.
 */

#ifndef __TOMMYARRAYBLKOF_H
#define __TOMMYARRAYBLKOF_H

#include "tommytypes.h"
#include "tommyarray.h"

#include <assert.h> /* for assert */

/******************************************************************************/
/* array */

/**
 * Elements for each block.
 */
#define TOMMY_ARRAYBLKOF_SIZE (4 * 1024)

/**
 * Array container type.
 * \note Don't use internal fields directly, but access the container only using functions.
 */
typedef struct tommy_arrayblkof_struct {
	tommy_array block; /**< Array of blocks. */
	tommy_size_t element_size; /**< Size of the stored element in bytes. */
	tommy_count_t count; /**< Number of initialized elements in the array. */
} tommy_arrayblkof;

/**
 * Initializes the array.
 * \param element_size Size in byte of the element to store in the array.
 */
void tommy_arrayblkof_init(tommy_arrayblkof* array, tommy_size_t element_size);

/**
 * Deinitializes the array.
 */
void tommy_arrayblkof_done(tommy_arrayblkof* array);

/**
 * Grows the size up to the specified value.
 * All the new elements in the array are initialized with the 0 value.
 */
void tommy_arrayblkof_grow(tommy_arrayblkof* array, tommy_count_t size);

/**
 * Gets a reference of the element at the specified position.
 * You must be sure that space for this position is already
 * allocated calling tommy_arrayblkof_grow().
 */
tommy_inline void* tommy_arrayblkof_ref(tommy_arrayblkof* array, tommy_count_t pos)
{
	unsigned char* base;

	assert(pos < array->count);

	base = tommy_cast(unsigned char*, tommy_array_get(&array->block, pos / TOMMY_ARRAYBLKOF_SIZE));

	return base + (pos % TOMMY_ARRAYBLKOF_SIZE) * array->element_size;
}

/**
 * Gets the initialized size of the array.
 */
tommy_inline tommy_count_t tommy_arrayblkof_size(tommy_arrayblkof* array)
{
	return array->count;
}

/**
 * Gets the size of allocated memory.
 */
tommy_size_t tommy_arrayblkof_memory_usage(tommy_arrayblkof* array);

#endif


T) == 0
        preload_line 1, dst_r_bpp, dst_bpp_shift, DST
 .endif

 .if dst_w_bpp == 8
        tst     DST, #3
        beq     174f
172:    subs    X, X, #1
        blo     177f
        process_head  , 1, 0, 1, 1, 0
        process_tail  , 1, 0
  .if !((flags) & FLAG_PROCESS_DOES_STORE)
        pixst   , 1, 0, DST
  .endif
        tst     DST, #3
        bne     172b
 .elseif dst_w_bpp == 16
        tst     DST, #2
        beq     174f
        subs    X, X, #1
        blo     177f
        process_head  , 2, 0, 1, 1, 0
        process_tail  , 2, 0
  .if !((flags) & FLAG_PROCESS_DOES_STORE)
        pixst   , 2, 0, DST
  .endif
 .endif

174:    /* Destination now 4-byte aligned; we have 0 or more output bytes to go */
        switch_on_alignment  narrow_case_inner_loop_and_trailing_pixels, process_head, process_tail,, 177f

177:    /* Check for another line */
        end_of_line %(dst_w_bpp < 32), %((flags) & FLAG_SPILL_LINE_VARS_NON_WIDE), 171b, last_one
 .if (flags) & FLAG_SPILL_LINE_VARS_NON_WIDE
  .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET - LINE_SAVED_REG_COUNT*4
  .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET - LINE_SAVED_REG_COUNT*4
 .endif

197:
 .if (flags) & FLAG_SPILL_LINE_VARS
        add     sp, sp, #LINE_SAVED_REG_COUNT*4
 .endif
198:
 .if (flags) & FLAG_PROCESS_CORRUPTS_WK0
  .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET-4
  .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET-4
        add     sp, sp, #4
 .endif

        cleanup

#ifdef DEBUG_PARAMS
        add     sp, sp, #9*4 /* junk the debug copy of arguments */
#endif
199:
        pop     {r4-r11, pc}  /* exit */

 .ltorg

    .unreq  X
    .unreq  Y
    .unreq  DST
    .unreq  STRIDE_D
    .unreq  SRC
    .unreq  STRIDE_S
    .unreq  MASK
    .unreq  STRIDE_M
    .unreq  WK0
    .unreq  WK1
    .unreq  WK2
    .unreq  WK3
    .unreq  SCRATCH
    .unreq  ORIG_W
    .endfunc
.endm

.macro line_saved_regs  x:vararg
 .set LINE_SAVED_REGS, 0
 .set LINE_SAVED_REG_COUNT, 0
 .irp SAVED_REG,x
  .ifc "SAVED_REG","Y"
   .set LINE_SAVED_REGS, LINE_SAVED_REGS | (1<<1)
   .set LINE_SAVED_REG_COUNT, LINE_SAVED_REG_COUNT + 1
  .endif
  .ifc "SAVED_REG","STRIDE_D"
   .set LINE_SAVED_REGS, LINE_SAVED_REGS | (1<<3)
   .set LINE_SAVED_REG_COUNT, LINE_SAVED_REG_COUNT + 1
  .endif
  .ifc "SAVED_REG","STRIDE_S"
   .set LINE_SAVED_REGS, LINE_SAVED_REGS | (1<<5)
   .set LINE_SAVED_REG_COUNT, LINE_SAVED_REG_COUNT + 1
  .endif
  .ifc "SAVED_REG","STRIDE_M"
   .set LINE_SAVED_REGS, LINE_SAVED_REGS | (1<<7)
   .set LINE_SAVED_REG_COUNT, LINE_SAVED_REG_COUNT + 1
  .endif
  .ifc "SAVED_REG","ORIG_W"
   .set LINE_SAVED_REGS, LINE_SAVED_REGS | (1<<14)
   .set LINE_SAVED_REG_COUNT, LINE_SAVED_REG_COUNT + 1
  .endif
 .endr
.endm

.macro nop_macro x:vararg
.endm


pv6Type(pub u8);

impl Icmpv6Type {
    pub fn new(value: u8) -> Self {
        Icmpv6Type(value)
    }
}

/// Supported ICMPv6 message types
#[allow(non_snake_case)]
#[allow(non_upper_case_globals)]
pub mod Icmpv6Types {
    use super::Icmpv6Type;

    pub const PacketTooBig: Icmpv6Type = Icmpv6Type(2);
    pub const EchoRequest: Icmpv6Type = Icmpv6Type(128);
    pub const EchoReply: Icmpv6Type = Icmpv6Type(129);

    // NDP types
    pub const RouterSolicitation: Icmpv6Type = Icmpv6Type(133);
    pub const RouterAdvertisement: Icmpv6Type = Icmpv6Type(134);
    pub const NeighborSolicitation: Icmpv6Type = Icmpv6Type(135);
    pub const NeighborAdvertisement: Icmpv6Type = Icmpv6Type(136);
    pub const Redirect: Icmpv6Type = Icmpv6Type(137);
}

impl fmt::Display for Icmpv6Type {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "{}",
            match *self {
                Icmpv6Types::PacketTooBig => "Packet Too Big".to_string(),
                Icmpv6Types::EchoRequest => "Echo Request".to_string(),
                Icmpv6Types::EchoReply => "Echo Reply".to_string(),
                Icmpv6Types::RouterSolicitation => "Router Solicitation".to_string(),
                Icmpv6Types::RouterAdvertisement => "Router Advertisement".to_string(),
                Icmpv6Types::NeighborSolicitation => "Neighbor Solicitation".to_string(),
                Icmpv6Types::NeighborAdvertisement => "Neighbor Advertisement".to_string(),
                Icmpv6Types::Redirect => "Redirect".to_string(),
                _ => format!("{}", self.0),
            }
        )
    }
}

/// ICMPv6 packet header
#[derive(Default, Debug)]
#[repr(C, packed)]
pub struct Icmpv6Header {
    msg_type: u8,
    code: u8,
    checksum: u16,
}

impl Header for Icmpv6Header {}

/// ICMPv6 packet payload
///
/// The ICMPv6 packet may contain a variable length payload. This
/// is only the fixed portion. The variable length portion has to
/// be parsed separately.
pub trait Icmpv6Payload: Fixed + Default {
    /// Returns the ICMPv6 message type that corresponds to the payload
    fn msg_type() -> Icmpv6Type;
}

/// ICMPv6 unit payload `()`
impl Icmpv6Payload for () {
    fn msg_type() -> Icmpv6Type {
        // Unit payload does not have a type
        unreachable!();
    }
}

/// Common behaviors shared by ICMPv6 packets
pub trait Icmpv6Packet<E: Ipv6Packet, P: Icmpv6Payload>:
    Packet<Header = Icmpv6Header, Envelope = E>
{
    /// Returns a reference to the fixed payload
    fn payload(&self) -> &P;

    /// Returns a mutable reference to the fixed payload
    fn payload_mut(&mut self) -> &mut P;

    #[inline]
    fn msg_type(&self) -> Icmpv6Type {
        Icmpv6Type::new(self.header().msg_type)
    }

    #[inline]
    fn code(&self) -> u8 {
        self.header().code
    }

    #[inline]
    fn set_code(&mut self, code: u8) {
        self.header_mut().code = code
    }

    #[inline]
    fn checksum(&self) -> u16 {
        u16::from_be(self.header().checksum)
    }

    #[inline]
    fn compute


erp.app.redeem.ui.screens.HowToRedeemScaffoldScreenPreview
import de.gematik.ti.erp.app.screenshot.BaseScreenshotTest
import de.gematik.ti.erp.app.screenshot.ScreenshotConfig
import org.junit.Test

class HowToRedeemScreenTest(config: ScreenshotConfig) : BaseScreenshotTest(config) {

    @Test
    fun screenShotTest() {
        paparazzi.snapshot {
            HowToRedeemScaffoldScreenPreview()
        }
    }
}
/*
 * Copyright (Change Date see Readme), gematik GmbH
 *
 * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the
 * European Commission – subsequent versions of the EUPL (the "Licence").
 * You may not use this work except in compliance with the Licence.
 *
 * You find a copy of the Licence in the "Licence" file or at
 * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the Licence is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or implied.
 * In case of changes by gematik GmbH find details in the "Readme" file.
 *
 * See the Licence for the specific language governing permissions and limitations under the Licence.
 *
 * *******
 *
 * For additional notes and disclaimer from gematik and in case of changes by gematik find details in the "Readme" file.
 */

package de.gematik.ti.erp.app.screenshot

import app.cash.paparazzi.Paparazzi
import com.android.ide.common.rendering.api.SessionParams
import org.junit.Rule
import org.junit.runner.RunWith
import org.junit.runners.Parameterized

@RunWith(Parameterized::class)
abstract class BaseComponentScreenshotTest(
    config: ScreenshotConfig,
    renderingMode: SessionParams.RenderingMode = SessionParams.RenderingMode.NORMAL
) {

    companion object {
        @JvmStatic
        @Parameterized.Parameters(name = "{0}")
        fun data(): List<ScreenshotConfig> = ScreenShotConfigComponent.entries
    }

    @get: Rule
    val paparazzi = Paparazzi(
        deviceConfig = config.deviceConfig,
        theme = config.theme,
        validateAccessibility = false,
        maxPercentDifference = ScreenshotTestDifference.DIFFERENCE,
        renderingMode = renderingMode
    )
}
/*
 * Copyright (Change Date see Readme), gematik GmbH
 *
 * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the
 * European Commission – subsequent versions of the EUPL (the "Licence").
 * You may not use this work except in compliance with the Licence.
 *
 * You find a copy of the Licence in the "Licence" file or at
 * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the Licence is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or implied.
 * In case of changes by gematik GmbH find details in the "Readme" file.
 *
 * See the Licence for the specific language governing permissions and limitations under the Licence.
 *
 * *******
 *
 * For additional notes and disclaimer from gematik and in case of changes by gematik find details in the "Readme" file.
 */

package de.gematik.ti.erp.app.screenshot

import app.cash.paparazzi.DeviceConfig

interface ScreenshotConfig {
    val deviceConfig: DeviceConfig
    val theme: String
}
/*
 * Copyright (Change Date see Readme), gematik GmbH
 *
 * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the


    return;

  ibooker.setCurrentFolder(folderName_);

  selectionFlow = ibooker.book1D("selectionFlow", "selectionFlow", 17, 0, 17);
  selectionFlow->setBinLabel(1, "all");
  selectionFlow->setBinLabel(2, "denTrigSel");
  selectionFlow->setBinLabel(3, "collecttionSel");
  selectionFlow->setBinLabel(4, "vtxSel");
  selectionFlow->setBinLabel(5, "tagMuSel");
  selectionFlow->setBinLabel(6, "vetoMuSel");
  selectionFlow->setBinLabel(7, "tagEleSel");
  selectionFlow->setBinLabel(8, "vetoEleSel");
  selectionFlow->setBinLabel(9, "tagLepSel");
  selectionFlow->setBinLabel(10, "vetoLepSel");
  selectionFlow->setBinLabel(11, "diLepSel");
  selectionFlow->setBinLabel(12, "btagSel");
  selectionFlow->setBinLabel(13, "METSel");
  selectionFlow->setBinLabel(14, "jetSel");
  selectionFlow->setBinLabel(15, "pnetScoreSel");
  selectionFlow->setBinLabel(16, "trigMatchSel");
  selectionFlow->setBinLabel(17, "numTrigSel");

  if (!NjetBinning.empty()) {
    bookME(ibooker, njets, "njets", "n-jets", NjetBinning);
    setMETitle(njets, "number of jets", "Entries");
    bookME(ibooker, nbjets, "nbjets", "b-jets", NjetBinning);
    setMETitle(nbjets, "number of b-jets", "Entries");
  }
  if (!HTBinning.empty()) {
    bookME(ibooker, ht, "ht", "HT", HTBinning);
    setMETitle(ht, "H_{T}", "Entries");
  }

  if (!leptonPtBinning.empty()) {
    bookME(ibooker, muon_pt, "muon_pt", "muon p_{T}", leptonPtBinning);
    setMETitle(muon_pt, "p_{T}(#mu)", "Entries");
    bookME(ibooker, electron_pt, "electron_pt", "electron p_{T}", leptonPtBinning);
    setMETitle(electron_pt, "p_{T}(ele)", "Entries");
  }
  if (!leptonEtaBinning.empty()) {
    bookME(ibooker, muon_eta, "muon_eta", "muon #eta", leptonEtaBinning);
    setMETitle(muon_eta, "#eta(#mu)", "Entries");
    bookME(ibooker, electron_eta, "electron_eta", "electron #eta", leptonEtaBinning);
    setMETitle(electron_eta, "#eta(ele)", "Entries");
  }
  if (!diLeptonPtBinning.empty()) {
    bookME(ibooker, dilepton_pt, "dilepton_pt", "dilepton p_{T}", diLeptonPtBinning);
    setMETitle(dilepton_pt, "p_{T}(ll)", "Entries");
  }
  if (!diLeptonMassBinning.empty()) {
    bookME(ibooker, dilepton_mass, "dilepton_mass", "dilepton mass", diLeptonMassBinning);
    setMETitle(dilepton_mass, "m(ll)", "Entries");
  }

  if (!jet1PtBinning.empty()) {
    bookME(ibooker, jet1_pt, "jet1_pt", "jet1 p_{T}", jet1PtBinning);
    setMETitle(jet1_pt, "p_{T}(j1)", "Entries");
  }
  if (!jet2PtBinning.empty()) {
    bookME(ibooker, jet2_pt, "jet2_pt", "jet2 p_{T}", jet2PtBinning);
    setMETitle(j


243AE0 0023F740  C0 44 00 04 */	lfs f2, 4(r4)
/* 80243AE4 0023F744  EC 21 00 28 */	fsubs f1, f1, f0
/* 80243AE8 0023F748  C0 03 00 20 */	lfs f0, 0x20(r3)
/* 80243AEC 0023F74C  80 03 00 04 */	lwz r0, 4(r3)
/* 80243AF0 0023F750  EC 02 00 28 */	fsubs f0, f2, f0
/* 80243AF4 0023F754  2C 00 00 00 */	cmpwi r0, 0
/* 80243AF8 0023F758  D0 23 00 0C */	stfs f1, 0xc(r3)
/* 80243AFC 0023F75C  D0 03 00 10 */	stfs f0, 0x10(r3)
/* 80243B00 0023F760  40 82 00 6C */	bne lbl_80243B6C
/* 80243B04 0023F764  88 03 00 00 */	lbz r0, 0(r3)
/* 80243B08 0023F768  C8 42 9E B0 */	lfd f2, lbl_806424B0-_SDA2_BASE_(r2)
/* 80243B0C 0023F76C  90 01 00 14 */	stw r0, 0x14(r1)
/* 80243B10 0023F770  C0 22 9E A0 */	lfs f1, lbl_806424A0-_SDA2_BASE_(r2)
/* 80243B14 0023F774  C8 01 00 10 */	lfd f0, 0x10(r1)
/* 80243B18 0023F778  EC 40 10 28 */	fsubs f2, f0, f2
/* 80243B1C 0023F77C  FC 02 08 40 */	fcmpo cr0, f2, f1
/* 80243B20 0023F780  40 80 00 28 */	bge lbl_80243B48
/* 80243B24 0023F784  C0 62 9E A4 */	lfs f3, lbl_806424A4-_SDA2_BASE_(r2)
/* 80243B28 0023F788  FC 02 18 40 */	fcmpo cr0, f2, f3
/* 80243B2C 0023F78C  40 81 00 1C */	ble lbl_80243B48
/* 80243B30 0023F790  C0 02 9E 90 */	lfs f0, lbl_80642490-_SDA2_BASE_(r2)
/* 80243B34 0023F794  FC 02 00 40 */	fcmpo cr0, f2, f0
/* 80243B38 0023F798  40 80 00 08 */	bge lbl_80243B40
/* 80243B3C 0023F79C  48 00 00 08 */	b lbl_80243B44
lbl_80243B40:
/* 80243B40 0023F7A0  FC 60 08 90 */	fmr f3, f1
lbl_80243B44:
/* 80243B44 0023F7A4  FC 40 18 90 */	fmr f2, f3
lbl_80243B48:
/* 80243B48 0023F7A8  C0 02 9E A8 */	lfs f0, lbl_806424A8-_SDA2_BASE_(r2)
/* 80243B4C 0023F7AC  C0 23 00 0C */	lfs f1, 0xc(r3)
/* 80243B50 0023F7B0  EC 40 10 24 */	fdivs f2, f0, f2
/* 80243B54 0023F7B4  C0 03 00 10 */	lfs f0, 0x10(r3)
/* 80243B58 0023F7B8  EC 21 00 B2 */	fmuls f1, f1, f2
/* 80243B5C 002


LOVE \u6211\u7684\u611b !\r\n\u6211\u5728\u9059\u9060\u7684\u53f0\u7063\uff0c\u5e0c\u671b\u6709\u4e00\u5929\u80fd\u898b\u5230\u4ed6\u672c\u4eba~OvO","El tercer mundo se muere de hambre, mientras que el primero y el segundo de colesterol.","S\u00f3lo soy feminista por moda. Electroduende. http://Instagram.com/_espatricia","Ciudadana, venezolana. La democracia es asunto de todos \u00a1Tenemos que rescatarla!","Medskapare, manusredakt\u00f6r, manusf\u00f6rfattare V\u00e5r tid \u00e4r nu (SVT/Jarowskij). Numer inneh\u00e5llsansvarig/Head of Development SVT Drama","https://www.linkedin.com/in/sedeferken/","@RebelliousMag #Chicago #feminist #indymedia Rebellion! https://t.co/pb49Qd4OVk https://t.co/3JgRKtxwQp Notebook https://t.co/narO6TIgOt","@collegeofeurope | M\u00e9moire @Celsa : les porte-parolats r\u00e9galiens | Ex  @Place_Beauvau @OCDE_fr @EdinburghUni @Sc_Po_Rennes | tweete #compublique #EU #media &Cie","For a lonely soul, you're having such a nice time...","\u041a\u043e\u0433\u0434\u0430 \u0434\u0432\u043e\u0435 \u0441\u0435\u0440\u0434\u044f\u0442\u0441\u044f, \u043e\u0431\u0430 \u0432\u0438\u043d\u043e\u0432\u0430\u0442\u044b.","catho non sectaire, jardinier bio. Citoyen du monde, de l'europe et du nord de la France...","Perfil para auxiliar no debate pol\u00edtico em todo o Brasil","#TeamNaomi | Fan Page dedicated to @NaomiCampbell: Model, Actress, Activist \ud83d\udc51\ud83d\ude46\u2764 Follow us!","the north remembers",".","La vida s\u00f3lo tiene sentido en la lucha. El triunfo o la derrota esta en nuestras manos \u00a1As\u00ed que celebremos la lucha! \r\n#AntiNeoliberal & #AntiSionista","Autodidakt, Freigeist, Denker, Nonkonformist, K\u00fcnstler, Mensch. Tweets auf deutsch, in english: Art, Kultur, Politik, fun, all day stuff, alles und nichts, etc.","\u00ab I actually think life is like a movie. That one can sort of be the director of one's own life. \u00bb | \ud83c\uddee\ud83c\uddf9","Jobbar med opinionsbildning, PR och mediestrategi. Tidigare redakt\u00f6r p\u00e5 svt opinion och ledarskribent p\u00e5 GP.","Twitter-Account des Blogs Medienstuebchen. Hier geht es um:\n\n\u25a0 Kunst \u25a0 Kultur \u25a0 Experimentalfilm \u25a0 Videokunst \u25a0 neue Erz\u00e4hlformen \u25a0","","politikaya, sosyalizme, hayata, sanata, kitaplara, avangart caza ve be\u015fikta\u015f'a dair... ali mert ile profes\u00f6r kien aras\u0131... \u00e7\u00f6pten, kumdan, b*ktan...","Art Historian from Belgrade, Serbia, living in the Netherlands. Art | Travel | Nature","dirigeante PME,aime les chevaux, fid\u00e8le \u00e0 N-Sarkozy-\u00e9lue locale - LR \ud83c\uddeb\ud83c\uddf7","Palimpsest ki\u015fi


lement=gcSpread] .gc-list-control .gc-list-control-container .gc-list-control-item .gc-list-control-item-text {
  letter-spacing: 0;
  text-align: left;
  padding: 0.4em 1em;
  display: block;
  line-height: normal;
  white-space: pre;
}
div[gcUIElement=gcSpread] .gc-list-control .gc-list-control-container .gc-list-control-item .gc-list-control-item-text.gc-list-control-item-bigtext {
  line-height: 32px;
  white-space: nowrap;
}
div[gcUIElement=gcSpread] .gc-list-control .gc-list-control-container .gc-list-control-item .gc-list-control-item-text-ellipsis {
  overflow-x: hidden;
  text-overflow: ellipsis;
}
div[gcUIElement=gcSpread] .gc-list-control .gc-list-control-container .gc-list-control-item:hover {
  background: #e2f2ff;
}
div[gcUIElement=gcSpread] .gc-list-control .gc-list-control-container .gc-list-control-item .gc-list-control-item-icon {
  left: 0.5em;
  position: absolute;
  top: 50%;
  margin-top: -8px;
  width: 16px;
  height: 16px;
  overflow: hidden;
  background-repeat: no-repeat;
  background-size: contain;
}
div[gcUIElement=gcSpread] .gc-list-control .gc-list-control-container .gc-list-control-item .gc-list-control-item-icon.gc-list-control-emptyicon {
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQyIDc5LjE2MDkyNCwgMjAxNy8wNy8xMy0wMTowNjozOSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLj


k_node)
    {
      if (complain & tf_warning_or_error)
	{
	  auto_diagnostic_group d;
	  error ("class template argument deduction failed:");
	  perform_dguide_overload_resolution (cands, args, complain);
	  if (elided)
	    inform (input_location, "explicit deduction guides not considered "
		    "for copy-initialization");
	}
      return error_mark_node;
    }
  /* [over.match.list]/1: In copy-list-initialization, if an explicit
     constructor is chosen, the initialization is ill-formed.  */
  else if (flags & LOOKUP_ONLYCONVERTING)
    {
      if (DECL_NONCONVERTING_P (fndecl))
	{
	  if (complain & tf_warning_or_error)
	    {
	      // TODO: Pass down location from cp_finish_decl.
	      auto_diagnostic_group d;
	      error ("class template argument deduction for %qT failed: "
		     "explicit deduction guide selected in "
		     "copy-list-initialization", type);
	      inform (DECL_SOURCE_LOCATION (fndecl),
		      "explicit deduction guide declared here");

	    }
	  return error_mark_node;
	}
    }

  /* If CTAD succeeded but the type doesn't have any explicit deduction
     guides, this deduction might not be what the user intended.  */
  if (fndecl != error_mark_node && !any_dguides_p && (complain & tf_warning))
    {
      auto_diagnostic_group d;
      if ((!DECL_IN_SYSTEM_HEADER (fndecl)
	   || global_dc->m_warn_system_headers)
	  && warning (OPT_Wctad_maybe_unsupported,
		      "%qT may not intend to support class template argument "
		      "deduction", type))
	inform (input_location, "add a deduction guide to suppress this "
		"warning");
    }

  return cp_build_qualified_type (TREE_TYPE (TREE_TYPE (fndecl)),
				  cp_type_quals (ptype));
}

/* Return true if INIT is an unparenthesized id-expression or an
   unparenthesized class member access.  Used for the argument of
   decltype(auto).  */

bool
unparenthesized_id_or_class_member_access_p (tree init)
{
  STRIP_ANY_LOCATION_WRAPPER (init);

  /* We need to be able to tell '(r)' and 'r' apart (when it's of
     reference type).  Only the latter is an id-expression.  */
  if (REFERENCE_REF_P (init)
      && !REF_PARENTHESIZED_P (init))
    init = TREE_OPERAND (init, 0);
  return (DECL_P (init)
	  || ((TREE_CODE (init) == COMPONENT_REF
	       || TREE_CODE (init) == SCOPE_REF)
	      && !REF_PARENTHESIZED_P (init)));
}

/* Replace occurrences of 'auto' in TYPE with the appropriate type deduced
   from INIT.  AUTO_NODE is the TEMPLATE_TYPE_PARM used for 'auto' in TYPE.
   The CONTEXT determines the context in which auto deduction is performed
   and is used to control error diagnostics.  FLAGS are the LOOKUP_* flags.

   OUTER_TARGS is used during template argument deduction (context == adc_unify)
   to properly substitute the result.  It's also used in the adc_unify and
   adc_requirement contexts to communicate the necessary template arguments
   to satisfaction.  OUTER_TARGS is ignored in other contexts.

   Additionally for adc_unify contexts TMPL is the template for which TYPE
   is a template parameter type.

   For partial-concept-ids, extra args from OUTER_TARGS, TMPL and the


 $24, %mm3
	addl $32, %edi
	addl $8, %esi
	pand GLOBL(__fb_gfx_rgb_32), %mm4
	pand GLOBL(__fb_gfx_rgb_32), %mm5
	pand GLOBL(__fb_gfx_rgb_32), %mm6
	pand GLOBL(__fb_gfx_rgb_32), %mm7
	por %mm0, %mm4
	por %mm1, %mm5
	por %mm2, %mm6
	por %mm3, %mm7
	movq %mm4, -32(%edi)
	movq %mm5, -24(%edi)
	movq %mm6, -16(%edi)
	movq %mm7, -8(%edi)
	decl %ecx
	jnz alpha_mask_x_loop

LABEL(alpha_mask_next_line)
	addl ARG5, %esi
	addl %edx, %edi
	decl %ebx
	jnz alpha_mask_y_loop

	emms
	popl %ebx
	popl %edi
	popl %esi
	popl %ebp
	ret

FUNC(fb_MMX_code_end)


idBodyB().activate();
	}
};
public_functions.dof_disableAngularMotor = function( params ) {
	var constraint = _constraints[ params.constraint ];

	var motor = constraint.getRotationalLimitMotor( params.which );
	motor.set_m_enableMotor( false );

	constraint.getRigidBodyA().activate();
	if ( constraint.getRigidBodyB() ) {
		constraint.getRigidBodyB().activate();
	}
};

reportWorld = function() {
	var index, object,
		transform, origin, rotation,
		offset = 0,
		i = 0;

	if ( SUPPORT_TRANSFERABLE ) {
		if ( worldreport.length < 2 + _num_objects * WORLDREPORT_ITEMSIZE ) {
			worldreport = new Float32Array(
				2 + // message id & # objects in report
				( Math.ceil( _num_objects / REPORT_CHUNKSIZE ) * REPORT_CHUNKSIZE ) * WORLDREPORT_ITEMSIZE // # of values needed * item size
			);
			worldreport[0] = MESSAGE_TYPES.WORLDREPORT;
		}
	}

	worldreport[1] = _num_objects; // record how many objects we're reporting on

	//for ( i = 0; i < worldreport[1]; i++ ) {
	for ( index in _objects ) {
		if ( _objects.hasOwnProperty( index ) ) {
			object = _objects[index];

			// #TODO: we can't use center of mass transform when center of mass can change,
			//        but getMotionState().getWorldTransform() screws up on objects that have been moved
			//object.getMotionState().getWorldTransform( transform );
			transform = object.getCenterOfMassTransform();

			origin = transform.getOrigin();
			rotation = transform.getRotation();

			// add values to report
			offset = 2 + (i++) * WORLDREPORT_ITEMSIZE;

			worldreport[ offset ] = object.id;

			worldreport[ offset + 1 ] = origin.x();
			worldreport[ offset + 2 ] = origin.y();
			worldreport[ offset + 3 ] = origin.z();

			worldreport[ offset + 4 ] = rotation.x();
			worldreport[ offset + 5 ] = rotation.y();
			worldreport[ offset + 6 ] = rotation.z();
			worldreport[ offset + 7 ] = rotation.w();

			_vector = object.getLinearVelocity();
			worldreport[ offset + 8 ] = _vector.x();
			worldreport[ offset + 9 ] = _vector.y();
			worldreport[ offset + 10 ] = _vector.z();

			_vector = object.getAngularVelocity();
			worldreport[ offset + 11 ] = _vector.x();
			worldreport[ offset + 12 ] = _vector.y();
			worldreport[ offset + 13 ] = _vector.z();
		}
	}

	if ( SUPPORT_TRANSFERABLE ) {
		transferableMessage( worldreport.buffer, [worldreport.buffer] );
	} else {
		transferableMessage( worldreport );
	}

};

reportCollisions = function() {
	var i, offset,
		dp = world.getDispatcher(),
		num = dp.getNumManifolds(),
		manifold, num_contacts, j, pt,
		_collided = false;

	if ( SUPPORT_TRANSFERABLE ) {
		if ( collisionreport.length < 2 + num * COLLISIONREPORT_ITEMSIZE ) {
			collisionreport = new Float32Array(
				2 + // message id & # objects in report
				( Math.ceil( _num_objects / REPORT_CHUNKSIZE ) * REPORT_CHUNKSIZE ) * COLLISIONREPORT_ITEMSIZE // # of values needed * item size
			);
			collisionreport[0] = MESSAGE_TYPES.COLLISIONREPORT;
		}
	}

	collisionreport[1] = 0; // how many collisions we're reporting on

	for ( i = 0; i <


nt int program, @GLenum int shadertype, @GLuint int index, @AutoSize("name") @GLsizei int bufsize,
	                               @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length,
	                               @OutParameter ByteBuffer name);

	@Reuse("GL40")
	@Alternate("glGetActiveSubroutineName")
	@GLreturn(value = "name", maxLength = "bufsize")
	void glGetActiveSubroutineName2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize,
	                                @OutParameter @Constant("MemoryUtil.getAddress0(name_length)") @GLsizei IntBuffer length,
	                                @OutParameter @GLchar ByteBuffer name);

	@Reuse("GL40")
	@StripPostfix("indices")
	void glUniformSubroutinesuiv(@GLenum int shadertype, @AutoSize("indices") @GLsizei int count, @Const @GLuint IntBuffer indices);

	@Reuse("GL40")
	@StripPostfix("params")
	void glGetUniformSubroutineuiv(@GLenum int shadertype, int location, @Check("1") @OutParameter @GLuint IntBuffer params);

	@Reuse("GL40")
	@Alternate("glGetUniformSubroutineuiv")
	@GLreturn("params")
	@StripPostfix(value = "params", hasPostfix = false)
	void glGetUniformSubroutineuiv2(@GLenum int shadertype, int location, @OutParameter @GLuint IntBuffer params);

	@Reuse("GL40")
	@StripPostfix("values")
	void glGetProgramStageiv(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @Check("1") @OutParameter IntBuffer values);

	@Reuse("GL40")
	@Alternate("glGetProgramStageiv")
	@GLreturn("values")
	@StripPostfix(value = "values", hasPostfix = false)
	void glGetProgramStageiv2(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @OutParameter IntBuffer values);

}/*
 * Copyright (c) 2002-2008 LWJGL Project
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 * * Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 *
 * * Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the distribution.
 *
 * * Neither the name of 'LWJGL' nor the names of
 *   its contributors may be used to endorse or promote products derived
 *   from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package org.lwjgl.opengl;

import org.lwjgl.util.generator.Extension;

@


 this dataset, and show how to use a metric as a callback during training or afterwards for evaluation.

```python
import numpy as np
from tensorflow import keras
from tensorflow.keras import layers
import evaluate

# We pull example code from Keras.io's guide on classifying with MNIST
# Located here: https://keras.io/examples/vision/mnist_convnet/

# Model / data parameters
input_shape = (28, 28, 1)

# Load the data and split it between train and test sets
(x_train, y_train), (x_test, y_test) = keras.datasets.fashion_mnist.load_data()

# Only select tshirts/tops and trousers, classes 0 and 1
def get_tshirts_tops_and_trouser(x_vals, y_vals):
    mask = np.where((y_vals == 0) | (y_vals == 1))
    return x_vals[mask], y_vals[mask]

x_train, y_train = get_tshirts_tops_and_trouser(x_train, y_train)
x_test, y_test = get_tshirts_tops_and_trouser(x_test, y_test)

# Scale images to the [0, 1] range
x_train = x_train.astype("float32") / 255
x_test = x_test.astype("float32") / 255

x_train = np.expand_dims(x_train, -1)
x_test = np.expand_dims(x_test, -1)

model = keras.Sequential(
    [
        keras.Input(shape=input_shape),
        layers.Conv2D(32, kernel_size=(3, 3), activation="relu"),
        layers.MaxPooling2D(pool_size=(2, 2)),
        layers.Conv2D(64, kernel_size=(3, 3), activation="relu"),
        layers.MaxPooling2D(pool_size=(2, 2)),
        layers.Flatten(),
        layers.Dropout(0.5),
        layers.Dense(1, activation="sigmoid"),
    ]
)
```

## Callbacks

Suppose we want to keep track of model metrics while a model is training. We can use a Callback in order to calculate this metric during training, after an epoch ends.

We'll define a callback here that will take a metric name and our training data, and have it calculate a metric after the epoch ends.

```python
class MetricsCallback(keras.callbacks.Callback):

    def __init__(self, metric_name, x_data, y_data) -> None:
        super(MetricsCallback, self).__init__()

        self.x_data = x_data
        self.y_data = y_data
        self.metric_name = metric_name
        self.metric = evaluate.load(metric_name)

    def on_epoch_end(self, epoch, logs=dict()):
        m = self.model
        # Ensure we get labels of "1" or "0"
        training_preds = np.round(m.predict(self.x_data))
        training_labels = self.y_data

        # Compute score and save
        score = self.metric.compute(predictions = training_preds, references = training_labels)

        logs.update(score)
```

We can pass this class to the `callbacks` keyword-argument to use it during training:

```python
batch_size = 128
epochs = 2

model.compile(loss="binary_crossentropy", optimizer="adam")

model_history = model.fit(x_train, y_train, batch_size=batch_size, epochs=epochs, validation_split=0.1,
callbacks = [MetricsCallback(x_data = x_train, y_data = y_train, metric_name = "accuracy")])
```

## Using an Evaluate Metric for... Evaluation!

We can also use the same metric after model training! Here, we show how to check accuracy of the model after training on the test set:

```python
acc = evaluate.load("accuracy")
# Round the predictions to turn them into "0" or "1" labels
test_preds = np.round(model.predict(x_test))
test_labels = y_test
```

```python
print("Test accuracy is : ", acc.compute(predictions = test_preds, references = test_labels))
# Test accuracy is : 0.9855
```
# pFL-Bench
The **pFL-B


ther {
    pub id : i32,
    pub dt : i64,
    pub wind_speed : f32,
    pub wind_direction : i16,
    pub temp : f32,
    pub feels_like : f32,
    pub temp_min : f32,
    pub temp_max : f32,
    pub pressure : i16,
    pub humidity : i16,
    pub weather_id : i16,
}

impl Weather {
    pub fn to_json(&self) -> Json<Value> {
        Json(json!({
            "dt": &self.dt,
            "wind_speed" : &self.wind_speed,
            "wind_direction" : &self.wind_direction,
            "temp" : &self.temp,
            "feels_like" : &self.feels_like,
            "temp_min" : &self.temp_min,
            "temp_max" : &self.temp_max,
            "pressure" : &self.pressure,
            "humidity" : &self.humidity,
            "weather_id" : &self.weather_id,
        }))
    }

    pub fn self_truncate(&mut self) {
        self.wind_speed = self.wind_speed.trunk();
        self.temp = self.temp.trunk();
        self.feels_like = self.feels_like.trunk();
        self.temp_min = self.temp_min.trunk();
        self.temp_max = self.temp_max.trunk();
    }
}

#[derive(Insertable)]
#[table_name="weather"]
pub struct NewWeather<'a> {
    pub dt : &'a i64,
    pub wind_speed : &'a f32,
    pub wind_direction : &'a i16,
    pub temp : &'a f32,
    pub feels_like : &'a f32,
    pub temp_min : &'a f32,
    pub temp_max : &'a f32,
    pub pressure : &'a i16,
    pub humidity : &'a i16,
    pub weather_id : &'a i16,
}<gh_stars>10-100
use crate::mc::PIF_RAM_START;
use crate::mc::PIF_RAM_END;

const SI_REG_DRAM_ADDR: u32 = 0x0480_0000;
const SI_REG_PIF_ADDR_RD64B: u32 = 0x0480_0004;
const SI_REG_PIF_ADDR_WR64B: u32 = 0x0480_0010;
const SI_REG_STATUS: u32 = 0x0480_0018;

pub struct PIF {
    /* PIF memories. */

    /* The PIF's internal RAM. */
    pub pram: Box<[u8]>,
    /* The PIF's internal ROM from which the console boots. */
    pub prom: Box<[u8]>,

    dram_addr: u32,
    pif_addr_rd64b: u32,
    pif_addr_wr64b: u32,
    status: u32
}

impl PIF {
    pub fn new(pr: Box<[u8]>) -> PIF {
        PIF {
            /* Allocate the PRAM. */
            pram: Box::new([0; (PIF_RAM_END - PIF_RAM_START + 1) as usize]),
            /* Transfer ownership of the PROM. */
            prom: pr,

            dram_addr: 0,
            pif_addr_rd64b: 0,
            pif_addr_wr64b: 0,
            status: 0
        }
    }

    /* Reads from the PIF's registers. */
    pub fn rreg(&self, reg: u32) -> u32 {
        match reg {
            SI_REG_DRAM_ADDR => {
                self.dram_addr
            }, SI_REG_PIF_ADDR_


  public abstract void open();
    public abstract void close();
}
```

但是现在如果我们需要门具有报警alarm( )的功能，那么该如何实现？下面提供两种思路：

- 将这三个功能都放在抽象类里面，但是这样一来所有继承于这个抽象类的子类都具备了报警功能，但是有的门并不一定具备报警功能；

- 将这三个功能都放在接口里面，需要用到报警功能的类就需要实现这个接口中的open( )和close( )，也许这个类根本就不具备open( )和close( )这两个功能，比如火灾报警器。

从这里可以看出， Door的open() 、close()和alarm()根本就属于两个不同范畴内的行为，open()和close()属于门本身固有的行为特性，而alarm()属于延伸的附加行为。因此最好的解决办法是单独将报警设计为一个接口，包含alarm()行为,Door设计为单独的一个抽象类，包含open和close两种行为。再设计一个报警门继承Door类和实现Alarm接口。

```java
interface Alram {
    void alarm();
}

abstract class Door {
    void open();
    void close();
}

class AlarmDoor extends Door implements Alarm {
    void oepn() {
      //....
    }
    void close() {
      //....
    }
    void alarm() {
      //....
    }
}
```

3.实际应用上的差异

在实际使用中，使用抽象类(也就是继承)，是一种强耦合的设计，用来描述`A is a B` 的关系，即如果说A继承于B，那么在代码中将A当做B去使用应该完全没有问题。比如在Android中，各种控件都可以被当做View去处理。

如果在你设计中有两个类型的关系并不是`is a`，而是`is like a`，那就必须慎重考虑继承。因为一旦我们使用了继承，就要小心处理好子类跟父类的耦合依赖关系。组合优于继承。

继承和实现接口的区别就是：继承描述的是这个类『是什么』的问题，而实现的接口则描述的是这个类『能做什么』的问题。

抽象类

- 体现的是 is a 关系，即继承关系，抽象类是多个具体类的抽象，是用来被继承的。
- 体现的是一种模板模式的设计

接口

- 定义的是一种规范，体现的是一种规


",
"begrudge":"vt. 嫉妒, 羡慕, 勉强允给, 吝惜",
"begrudged":"v. 嫉妒( begrudge的过去式和过去分词 ); 勉强做; 不乐意地付出; 吝惜",
"begrudger":"n. begrudge的变形",
"begrudges":"v. 嫉妒( begrudge的第三人称单数 ); 勉强做; 不乐意地付出; 吝惜",
"begrudging":"v. 嫉妒( begrudge的现在分词 ); 勉强做; 不乐意地付出; 吝惜",
"begrudgingly":"adv. 不乐意, 勉强地",
"begrundgingly":"吝啬地",
"begs":"v. 乞讨( beg的第三人称单数 ); 乞求; 请求; （狗蹲坐在后腿上将前爪抬起）等食物",
"beguile":"vt. 诱骗",
"beguile sb into":"欺骗某人…",
"beguile sb into doing sth":"诱骗(某人)干(某事)",
"beguile sb of sth":"骗走某人的某物",
"beguile sb with":"用…欺骗",
"beguiled":"v. 欺骗( beguile的过去式和过去分词 ); 使陶醉; 使高兴; 消磨（时间等）",
"beguilement":"n. 欺骗, 欺瞒, 轻松地消磨(时间)",
"beguilements":"(beguilement 的复数) n. 欺骗, 欺瞒, 轻松地消磨(时间)",
"beguiler":"n. 欺骗者, 消遣者",
"beguilers":"欺骗者, 消遣者( beguiler的名词复数 )",
"beguiles":"v. 欺骗( beguile的第三人称单数 ); 使陶醉; 使高兴; 消磨（时间等）",
"beguiling":"a. 欺骗的, 有趣的",
"beguilingly":"adv. 欺骗地；有趣地",
"beguin":"调戏",
"beguine":"n. 比津舞",
"beguines":"(beguine 的复数) n. 比津舞",
"begum":"n. 穆斯林国家的王后(或公主)",
"begun":"begin的过去分词",
"beh":"n. (Beh)人名；(德)贝\\n行为主义（behaviourism）\\n行为（behaviour）",
"beha":"贝亚（人名）",
"behague":" [人名] 比海格",
"behalf":"n. 利益, 方面",
"behalves":"n. 方面, 利益, 赞同( behalf的名词复数 )",
"Behan":"贝汉（人名）",
"Behar":"n. 比哈尔(印度北部的邦)",
"behari":"n.,adj. = Bihari",
"behav":"abbr. behavior 行为; 举止（机器等发生作用的）情况; behavioral 行为的; behaviorist(ic) 行为主义者（的）",
"behave":"vi. 举止端正, 行为规矩\\nvt. 检点(自己的)行为, 使表现好",
"behave about":"处理,处置…",
"behave oneself":"使举止规矩, 使运转正常",
"behave well to":"对某人有礼貌",
"behave with":"对付,对待,与…打交道",
"behave yourself":" 行为规矩些",
"behaved":"v. （行为或举止）表现( behave的过去式和过去分词 ); 工


n the input type.
         */
        int getType() const;

        /**
         * Sets the button pressed.
         *
         * @param button the button pressed.
         */
        void setButton(int button);

        /**
         * Gets the button pressed.
         *
         * @return the button pressed.
         */
        int getButton() const;

        /**
         * Sets the timestamp for the input.
         *
         * @param timeStamp the timestamp of the input.
         */
        void setTimeStamp(int timeStamp);

        /**
         * Gets the time stamp of the input.
         *
         * @return the time stamp of the input.
         */
        int getTimeStamp() const;

        /**
         * Enum with mouse input values.
         */
        enum
        {
            EMPTY = 0,
            LEFT,
            RIGHT,
            MIDDLE,
            WHEEL_UP,
            WHEEL_DOWN,
            PRESS,
            RELEASE,
            MOTION
        };

        int x, y;

    protected:
        int mType;
        int mButton;
        int mTimeStamp;
    };
}

#endif // end GCN_MOUSEINPUT_HPP


.BaseColor = new Color(1, 2, 3, 1);
			mat.Edge = 0.15f;
			mat.EdgeAlpha = 0.84f;
			mat.Elasticity = 2.34f;
			mat.ElasticityFalloff = 4.02f;
			mat.Friction = 6.32f;
			mat.GlossyImageLerp = 0.23f;
			mat.IsMetal = true;
			mat.IsOpacityActive = false;
			mat.Opacity = 0.32f;
			mat.Roughness = 0.87f;
			mat.ScatterAngle = 12.2f;
			mat.Thickness = 0.74f;
			mat.WrapLighting = 0.68f;

			table.Export(tmpFileName);
			var writtenTable = FileTableContainer.Load(tmpFileName);
			var material = writtenTable.GetMaterial("MaterialUpdated");
			material.Name.Should().Be("MaterialUpdated");
			material.BaseColor.Red.Should().Be(1);
			material.BaseColor.Green.Should().Be(2);
			material.BaseColor.Blue.Should().Be(3);
			material.Edge.Should().Be(0.15f);
			material.EdgeAlpha.Should().BeApproximately(0.84f, 0.003f);
			material.Elasticity.Should().Be(2.34f);
			material.ElasticityFalloff.Should().Be(4.02f);
			material.Friction.Should().Be(6.32f);
			material.GlossyImageLerp.Should().BeApproximately(0.23f, 0.003f);
			material.IsMetal.Should().Be(true);
			material.IsOpacityActive.Should().Be(false);
			material.Opacity.Should().Be(0.32f);
			material.Roughness.Should().Be(0.87f);
			material.ScatterAngle.Should().Be(12.2f);
			material.Thickness.Should().BeApproximately(0.74f, 0.003f);
			material.WrapLighting.Should().Be(0.68f);
			File.Delete(tmpFileName);
		}

		private void ValidateMaterial1(Material material)
		{
			material.Name.Should().Be("Material1");
			material.BaseColor.Red.Should().Be(153);
			material.BaseColor.Green.Should().Be(62);
			material.BaseColor.Blue.Should().Be(255);
			material.ClearCoat.Red.Should().Be(50);
			material.ClearCoat.Green.Should().Be(51);
			material.ClearCoat.Blue.Should().Be(52);
			material.Edge.Should().Be(0.3874f);
			material.EdgeAlpha.Should().BeApproximately(0.1968504f, 0.00001f);
			material.Elasticity.Should().Be(1.1f);
			material.ElasticityFalloff.Should().Be(2.02f);
			material.Friction.Should().Be(2.322f);
			material.Glossiness.Red.Should().Be(255);
			material.Glossiness.Green.Should().Be(158);
			material.Glossiness.Blue.Should().Be(70);
			material.GlossyImageLerp.Should().BeApproximately(0.4078431f, 0.00001f);
			material.IsMetal.Should().Be(false);
			material.IsOpacityActive.Should().Be(true);
			material.Opacity.Should().Be(0.8183f);
			material.Roughness.Should().Be(0.53628f);
			material.ScatterAngle.Should().Be(7.4332f);
			material.Thickness.Should().Be(0.654902f);
			material.WrapLighting.Should().Be(0.5492f);
		}
	}
}


39e-01, 4.98652988515397e-01, 7.97605678364206e-01, 7.85268678833408e-01, 1.95493747072068e-01, 1.25720815064634e-01, 2.79682069016325e-01, 4.69092731851899e-01, 7.88690794057686e-01, 2.12826437774348e-01, 9.77254334775169e-01, 5.89212250079350e-01, 7.93888259759860e-01, 6.44656450071723e-01, 2.49255087293649e-02, 9.72785936638460e-01, 4.47475717732895e-01, 8.43749723576504e-02, 4.61707393051235e-01);
		cout << setprecision(14) << determinant(m) << " " << determinant_gaussian_elimination(m) << " " << determinant_LU(m) << endl;
		Matrix<> n = m;
		cout << setprecision(14) << determinant(n) << " " << determinant_gaussian_elimination(n) << " " << determinant_LU(n) << endl;
	}

	{
		Matrix<6> m = Data(6.18812741281392e-02, 3.74068943074471e-01, 6.63915750469443e-01, 3.54983604761906e-01, 9.42683167058176e-01, 6.36037694108753e-01, 9.39317919407114e-01, 8.00162275029759e-01, 8.88224087928930e-01, 5.07799945684691e-01, 6.56859417305437e-01, 2.29071728408510e-01, 8.96520263537621e-01, 8.32421286310729e-01, 6.85086208473243e-01, 7.96713080968666e-01, 6.95228178548774e-02, 3.21065842249768e-01, 8.13085436558866e-01, 9.96785990862678e-01, 9.99794419525261e-01, 5.06733384408189e-01, 2.24347081645378e-01, 7.70300205790558e-01, 1.42279378761482e-01, 7.13798271861761e-01, 7.59865488317435e-01, 7.14113103449323e-01, 8.72145288721125e-02, 6.60530754098642e-01, 5.12071597579688e-01, 4.84850932681686e-01, 3.44516751617267e-01, 8.05727667320606e-01, 5.93584163172660e-03, 3.31947921577863e-01);
		cout << setprecision(14) << determinant(m) << " " << determinant_gaussian_elimination(m) << " " << determinant_LU(m) << endl;
		Matrix<> n = m;
		cout << setprecision(14) << determinant(n) << " " << determinant_gaussian_elimination(n) << " " << determinant_LU(n) << endl;
	}

	{
		Matrix<6> m = Data(3.49705542827719e-01, 1.37154944797163e-01, 6.45239524870601e-01, 4.31276022990973e-02, 8.46517570966223e-01, 8.86036951068266e-01, 9.91510616858571e-01, 6.87024047653616e-02, 7.39402886537011e-01, 7.20916863357948e-01, 2.84475490456196e-01, 2


@10.41.40.151

首先新建一个名字为nginx.json的nginx配置文件：

$ cat nginx.json
{
  "id": "nginx",
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "nginx:1.7.7",
      "network": "HOST"
    }
  },
  "instances": 1,
  "cpus": 1,
  "mem": 640,
  "constraints": [
    [
      "hostname",
      "UNIQUE"
    ]
  ]
}

可以使用如下命令在主节点上发布它：

curl -X POST -H "Content-Type: application/json" http://10.41.40.151:8080/v2/apps -d@nginx.json

这样可以使用Docker和host网络在三个从节点的任意一个上发布它。可以使用Marathon的web页面来验证是否运行正常。结果是Mesos在节点10.114.227.92上发布了它，并且可以使用如下命令验证它是否正常工作：

$ curl http://10.114.227.92
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</styl>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>

<p><em>Thank you for using nginx.</em></p>
</body>
</html>

##步骤6：使用Mesos-DNS链接nginx
现在让我们使用Mesos-DNS连接nginx，使用预期名字 nginx.marathon-0.7.6.mesos。Marathon版本号是因为注册在Mesos使用的名字marathon-0.7.6。我们可以使用 --framework_name marathon发布Marathon来避免这个问题：

$ dig nginx.marathon-0.7.6.mesos

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> nginx.marathon-0.7.6.mesos
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 11742
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;nginx.marathon-0.7.6.mesos. IN A

;; ANSWER SECTION:
nginx.marathon-0


us-gaap:CashAndCashEquivalentsAtCarryingValue" format="ixt:num-dot-decimal" scale="6" id="f-170">32,695</ix:nonFraction> 	$	<ix:nonFraction unitRef="usd" contextRef="c-24" decimals="-6" name="us-gaap:CashAndCashEquivalentsAtCarryingValue" format="ixt:num-dot-decimal" scale="6" id="f-171">29,965</ix:nonFraction>

Marketable securities	<ix:nonFraction unitRef="usd" contextRef="c-23" decimals="-6" name="us-gaap:MarketableSecuritiesCurrent" format="ixt:num-dot-decimal" scale="6" id="f-172">34,455</ix:nonFraction> 	<ix:nonFraction unitRef="usd" contextRef="c-24" decimals="-6" name="us-gaap:MarketableSecuritiesCurrent" format="ixt:num-dot-decimal" scale="6" id="f-173">31,590</ix:nonFraction>

Accounts receivable, net	<span style="color:#000000;font-family:'Helve


 - ${DateTime.now()}\n');
      } catch (e) {
        print('Failed to initialize log file: $e');
      }
    }
  }

  void log(LogLevel level, String component, String message, [Map<String, dynamic>? data]) {
    final timestamp = DateTime.now().toIso8601String();
    final levelStr = level.name.toUpperCase().padRight(11);
    final componentStr = component.padRight(15);

    String logEntry = '[$timestamp] $levelStr [$componentStr] $message';

    if (data != null && data.isNotEmpty) {
      try {
        final dataStr = jsonEncode(data);
        logEntry += ' | Data: $dataStr';
      } catch (e) {
        logEntry += ' | Data: ${data.toString()}';
      }
    }

    // Add to memory logs
    _logs.add(logEntry);
    if (_logs.length > _maxLogLines) {
      _logs.removeAt(0);
    }

    // Console logging
    if (_enableConsoleLogging) {
      print(logEntry);
    }

    // File logging
    if (_enableFileLogging && _logFile != null) {
      try {
        _logFile!.writeAsStringSync('$logEntry\n', mode: FileMode.append);
      } catch (e) {
        // Fail silently to avoid infinite loops
      }
    }
  }

  void debug(String component, String message, [Map<String, dynamic>? data]) {
    log(LogLevel.debug, component, message, data);
  }

  void info(String component, String message, [Map<String, dynamic>? data]) {
    log(LogLevel.info, component, message, data);
  }

  void warning(String component, String message, [Map<String, dynamic>? data]) {
    log(LogLevel.warning, component, message, data);
  }

  void error(String component, String message, [Map<String, dynamic>? data]) {
    log(LogLevel.error, component, message, data);
  }

  void performance(String component, String operation, int durationMs, [Map<String, dynamic>? data]) {
    final perfData = {
      'operation': operation,
      'duration_ms': durationMs,
      ...?data,
    };
    log(LogLevel.performance, component, 'Performance: $operation took ${durationMs}ms', perfData);
  }

  List<String> getLogs() => List.unmodifiable(_logs);

  void clearLogs() {
    _logs.clear();
  }

  // Performance measurement helper
  Future<T> measurePerformance<T>(String component, String operation, Future<T> Function() function) async {
    final stopwatch = Stopwatch()..start();
    try {
      debug(component, 'Starting $operation');
      final result = await function();
      stopwatch.stop();
      performance(component, operation, stopwatch.elapsedMilliseconds);
      return result;
    } catch (e) {
      stopwatch.stop();
      error(component, 'Failed $operation after ${stopwatch.elapsedMilliseconds}ms: $e');
      rethrow;
    }
  }

  T measureSync<T>(String component, String operation, T Function() function) {
    final stopwatch = Stopwatch()..start();
    try {
      debug(component, 'Starting $operation (sync)');
      final result = function();
      stopwatch.stop();
      performance(component, operation, stopwatch.elapsedMilliseconds);
      return result;
    } catch (e) {
      stopwatch.stop();
      error(component, 'Failed $operation after ${stopwatch.elapsedMilliseconds}ms: $e');
      rethrow;
    }
  }
}
import 'package:desktop_multi_window/desktop_multi_window.dart';
import 'package:flutter/material


: In function 'SHA1Final':
/root/ik_llama.cpp/examples/gguf-hash/deps/sha1/sha1.c:54:6: note: in a call to function 'SHA1Transform'
   54 | void SHA1Transform(
      |      ^~~~~~~~~~~~~
In function 'SHA1Update',
    inlined from 'SHA1Final' at /root/ik_llama.cpp/examples/gguf-hash/deps/sha1/sha1.c:269:9:
/root/ik_llama.cpp/examples/gguf-hash/deps/sha1/sha1.c:219:13: warning: 'SHA1Transform' reading 64 bytes from a region of size 0 [-Wstringop-overread]
  219 |             SHA1Transform(context->state, &data[i]);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/ik_llama.cpp/examples/gguf-hash/deps/sha1/sha1.c:219:13: note: referencing argument 2 of type 'const unsigned char[64]'
/root/ik_llama.cpp/examples/gguf-hash/deps/sha1/sha1.c: In function 'SHA1Final':
/root/ik_llama.cpp/examples/gguf-hash/deps/sha1/sha1.c:54:6: note: in a call to function 'SHA1Transform'
   54 | void SHA1Transform(
      |      ^~~~~~~~~~~~~
[ 10%] Built target sha256
[ 10%] Built target sha1
[ 10%] Building CXX object ggml/src/CMakeFiles/ggml.dir/iqk/fa/iqk_fa_128_128.cpp.o
```

...but that's all that stands out to me.

### Name and Version

Current main branch

### What operating system are you seeing the problem on?

_No response_

### Relevant log output

```shell
Ubuntu 24.04 running in Proxmox LXC
```

---

#### 💬 Conversation

👤 **ikawrakow** commented the **2025-07-18** at **06:12:11**:<br>

It looks like a confusion between `llama.cpp` and `ik_llama.cpp` libraries. I suspect `llama.cpp` is installed system-wide, so when the `ik_llama.cpp` server is started it picks up the `llama.cpp` DLLs.

This project does not consider the possibility of co-existing with a system-wide installation of `llama.cpp`. The work around is to use `LD_LIBRARY_PATH`, e.g.,
```
export LD_LIBRARY_PATH="/root/llama-builds/ik_llama.cpp/bin:$LD_LIBRARY_PATH"
/root/llama-builds/ik_llama.cpp/bin/llama-server ...
```

---

👤 **samteezy** commented the **2025-07-18** at **12:14:29**:<br>

Yep, that was root cause. I've been restructuring my llama environment to use local, static builds of both `llama.cpp` and `ik_llama.cpp` this morning using `-DBUILD_SHARED_LIBS=OFF` and now they're both working great.
Thanks for all your hard work!### 🐛 [#485](https://github.com/ikawrakow/ik_llama.cpp/issues/485) - Bug: Illegal Memory Access loading model to CUDA1

| **Author** | `cmoncure` |
| :--- | :--- |
| **State** | ❌ **Closed** |
| **Created** | 2025-06-02 |
| **Updated** | 2025-06-02 |

---

#### Description

### What happened?

I have two identical GPUs (Rtx 6000 Ada Generation 48 GB VRAM).  I have a llama-server commandline that works with device CUDA0, but fails with device CUDA1.  I have successfully tested device CUDA1 with:

- mainline llama.cpp
- oobabooga text-generation-webui

My script to run `llama-server` is as follows:
```
GPU1=CUDA0

args=(
  -mla 3
  -fa
  -ctk q8_0
  -ctv q8_0
  --ctx-size 131072
  -fmoe
  -amb 512
  -b


::BincodeGz => {
            let buf =
                flate2::write::GzEncoder::new(buf, flate2::Compression::best());
            bincode::serialize_into(buf, &data).wrap_err("serialize")?
        }
        SerializationFormat::Json => {
            serde_json::to_writer(buf, &data).wrap_err("serialize")?
        }
    }
    Ok(())
}

// TODO maybe make this async
pub fn deserialize<T>(
    file: impl AsRef<Path>,
    format: SerializationFormat,
) -> Result<T, Report>
where
    T: serde::de::DeserializeOwned,
{
    // open the file in read-only
    let file = std::fs::File::open(file).wrap_err("deserialize open file")?;
    // create a buf reader
    let buf = std::io::BufReader::new(file);
    // and try to deserialize
    let data = match format {
        SerializationFormat::BincodeGz => {
            let buf = flate2::bufread::GzDecoder::new(buf);
            bincode::deserialize_from(buf).wrap_err("deserialize")?
        }
        SerializationFormat::Json => {
            serde_json::from_reader(buf).wrap_err("deserialize")?
        }
    };
    Ok(data)
}
use std::ffi::OsStr;
use std::process::Command;

pub struct CommandError {
    pub code: Option<i32>,
    pub message: String,
}

impl std::fmt::Display for CommandError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", self.message)
    }
}

impl std::fmt::Debug for CommandError {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{:?}: {}", self.code, self.message)
    }
}

pub fn run_command<S: AsRef<OsStr> + std::fmt::Debug>(
    cmd: &str,
    args: &[S],
) -> Result<String, CommandError> {
    let mut command = Command::new(cmd);
    command.args(args);
    match command.output() {
        Ok(output) => {
            let status = output.status;
            let stdout = String::from_utf8_lossy(&output.stdout);
            if status.success() {
                Ok(stdout.to_string())
            } else {
                let stderr = String::from_utf8_lossy(&output.stderr);
                let status_code = status.code();
                let (exit_code, additional_message) = match status_code {
                    Some(127) => {
                        // I've only seen this happen on emulated systems: host
                        // architecture is different from the Docker image.
                        // Otherwise it returns the OS error ErrorKind::NotFound.
                        ("127".to_string(), " Is it installed?")
                    }
                    Some(code) => (code.to_string(), ""),
                    None => ("unknown".to_string(), ""),
                };
                return Err(CommandError {
                    code: status_code,
                    message: format!(
                        "Failed to run command.{}\n\
                        Command: {}\n\
                        Arguments: {:?}\n\
                        Exit code: {}\n\
                        STDOUT: {}\n\
                        STDERR: {}",
                        additional_message, cmd, args, exit_code, stdout, stderr
                    ),
                });
            }
        }
        Err(e) => {
            let additional_message = if e.kind() == std::io::ErrorKind::NotFound {
                " Is it installed?"
            } else {
                ""
            };
            return Err(CommandError {
                code: None,
                messa


>

write: async (secret) => {
      // Request a page that will send an HTTPOnly 'set-cookie' response header with secret value.
      await fetch(`${baseURI}cookie?secret=${secret}_http`);
    }

read: async () => {
      // Test if we now send a requests with a 'cookie' header containing the secret.
      let response = await fetch(`${baseURI}headers`);
      let cookie = (await response.json())["cookie"];
      return cookie ? cookie.match(/secret=([\w-]+)/)[1]: null;
    }

result, same session:
25b29f42-66ae-49e1-ad86-95c5905d1971_1p_http,
4bb94c20-dad4-42fb-a7e8-6567749fbbcb_1p_http,
0bfc1278-e6c9-463e-ba01-71923ef5c3e2_1p_http,
70527be4-b65a-47ca-aab2-83f8be902fd6_1p_http,
e50c2b15-c0ad-4f54-bbb9-f478e3ad0bb2_1p_http

result, different session:
25b29f42-66ae-49e1-ad86-95c5905d1971_1p_http,
4bb94c20-dad4-42fb-a7e8-6567749fbbcb_1p_http,
0bfc1278-e6c9-463e-ba01-71923ef5c3e2_1p_http,
70527be4-b65a-47ca-aab2-83f8be902fd6_1p_http,
e50c2b15-c0ad-4f54-bbb9-f478e3ad0bb2_1p_http

unsupported: false, false, false, false, false

passed: false, false, false, false, false

test failed: false, false, false, false, false

write: async (secret) => {
      // Request a page that will send an HTTPOnly 'set-cookie' response header with secret value.
      await fetch(`${baseURI}cookie?secret=${secret}_http`);
    }

read: async () => {
      // Test if we now send a requests with a 'cookie' header containing the secret.
      let response = await fetch(`${baseURI}headers`);
      let cookie = (await response.json())["cookie"];
      return cookie ? cookie.match(/secret=([\w-]+)/)[1]: null;
    }

result, same session:
5965b579-01c1-4be7-ae4f-7feea6dea55d_1p_http,
e20fa574-f9bc-4c03-b069-c417db209be6_1p_http,
b82e3ed6-f5fa-489b-8bdc-a7d68ea65ec2_1p_http,
f54a7de3-11f5-4054-9bb7-2e1ec7d210e3_1p_http,
b204ec1a-0605-4824-a69d-86028c1e0e5e_1p_http

result, different session:
5965b579-01c1-4be7-ae4f-7feea6dea55d_1p_http,
e20fa574-f9bc-4c03-b069-c417db209be6_1p_http,
b82e3ed6-f5fa-489b-8


-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}@font-face{font-family:"Font Awesome 5 Brands";font-style:normal;font-weight:400;font-display:block;src:url(../webfonts/fa-brands-400.eot);src:url(../webfonts/fa-brands-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-brands-400.woff2) format("woff2"),url(../webfonts/fa-brands-400.woff) format("woff"),url(../webfonts/fa-brands-400.ttf) format("truetype"),url(../webfonts/fa-brands-400.svg#fontawesome) format("svg")}.fab{font-family:"Font Awesome 5 Brands"}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:400;font-display:block;src:url(../webfonts/fa-regular-400.eot);src:url(../webfonts/fa-regular-400.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-regular-400.woff2) format("woff2"),url(../webfonts/fa-regular-400.woff) format("woff"),url(../webfonts/fa-regular-400.ttf) format("truetype"),url(../webfonts/fa-regular-400.svg#fontawesome) format("svg")}.fab,.far{font-weight:400}@font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:block;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.far,.fas{font-family:"Font Awesome 5 Free"}.fa,.fas{font-weight:900}
@charset "utf-8";
/* Tatujin-Publishing   */
/* Style sheet for epub */
/* Ver.0.8b1            */

/*
Scale & Rhythm
line-height 1.6
16px = 1em
x:p:h1:h2:h3 = 12px:14px:16px:24px:30px
*/
* {
}
html, body {
  min-height: 100vh;
  display: flex;
}
body {
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height:1.6;
    font-family: "ShinGoPro-Regular","ShinGo-Regular", sans-serif;
    /*
    word-break: normal;
    -webkit-line-break: after-white-space;
    */
    color: #494949;
}
p, ul, ol, dl, pre, table {
    font-family: "ShinGo Regular","ShinGo R","新ゴR","新ゴ R", sans-serif;
    font-size: 0.875em;
}
/* Heading */
h1 {
    margin: 0 0 3em;
    padding: 0.5em 0 0;
    text-align: left;
    font-size: 1.875em;
    font-weight: bold;
}
h2 {
    margin: 3em 0 0.5em;
    padding: 0.5em 0 0;
    text-align: left;
    font-size: 1.5em;
    font-weight: bold;
}
h3 {
    margin: 3em 0 0.5em;
    padding: 0;
    text-align: left;
    font-size: 1em;
    font-weight: bold;
}
h4, h5, h6 {
    margin:0.7em 0;
    pad


t switch buffer")
end

T['term-startinsert'] = new_set({
    parametrize = {
        { { 'haunt.term()' },                                  { 1 } },
        { { 'haunt.term()', 'haunt.reset()', 'haunt.term()' }, { 1, 3 } },
        { { 'haunt.help()', 'haunt.reset()', 'haunt.term()' }, { 3 } }
    }
})
T['term-startinsert']['multi'] = function(cmds, indexes)
    for i, cmd in pairs(cmds) do
        tc.lua(cmd)
        sleep(321)
        if vim.list_contains(indexes, i) then
            eq(child.fn.mode(), 't')
        end
    end
end

return T


Bestie und bringt den Hyperkondensator sowie den Pantherkäfigschlüssel zu Wizlo Lagerputzer zurück."}},
[5152] = {"Tante Marlene",nil, {"Sprecht mit Marlene, südlich der Ruinen von Andorhal."}},
[5153] = {"Ein seltsamer Historiker",nil, {"Bringt Josephs Ehering zu Chromie."}},
[5154] = {"Die Annalen von Darroheim",nil, {"Bringt die 'Annalen von Darroheim' zu Chromie in Andorhal."}},
[5155] = {"Streitmacht von Jaedenar",nil, {"Betretet Jaedenar und erschlagt 4 Hunde von Jaedenar, 4 Gardisten von Jaedenar, 6 Adepten von Jaedenar und 6 Kultisten von Jaedenar, bevor Ihr zu Greta Mooshuf im Teufelswald zurückkehrt."}},
[5156] = {"Die Verderbnis überprüfen",nil, {"Sucht und zerstört 2 entropische Bestien und 2 entropische Schrecken, während Ihr den Narbengrund erforscht. Nachdem Ihr überprüft habt, ob die Krater immer noch mit verderbtem Wasser gefüllt sind, kehrt zu Taronn Rotfeder im Teufelswald zurück."}},
[5157] = {"Verderbtes Wasser sammeln",nil, {"Bringt die leere Feldflasche zum Mondbrunnen im Zentrum von Jaedenar und füllt sie, bevor Ihr zu Greta Mooshuf im Teufelswald zurückkehrt."}},
[5158] = {"Spirituelle Hilfe suchen",nil, {"Bringt das verderbte Mondbrunnenwasser in das Brachland zu Islen Wasserdeuter."}},
[5159] = {"Gesäubertes Wasser wird zum Teufelswald gebracht",nil, {"Bringt das geläuterte Mondbrunnenwasser zu Greta Mooshuf im Teufelswald."}},
[5160] = {"Die oberste Beschützerin",nil, {"Begebt Euch nach Winterquell und sucht Haleh. Gebt ihr Awbees Schuppe."}},
[5161] = {"Der Zorn des blauen Drachenschwarms",nil, {"Sprecht mit Haleh, wenn Ihr weitermachen wollt."}},
[5162] = {"Der Zorn des blauen Drachenschwarms",nil, {"Sprecht mit Jeziba in den Pestländern. Er wohnt in Andorhal."}},
[5163] = {"Sind wir endlich da, Yeti?",nil, {"Nehmt Umis mechanischen Yeti und erschreckt ihre Freunde damit:nnLegacki in der Ewigen Warte (Winterquell)nSprinkel in Gadgetzan (Tanaris)nQuixxil in Marschalls Zuflucht (Krater von Un'Goro)nnWenn Ihr damit fertig seid, bringt den mechanischen Yeti zu Umi zurück."}},
[5164] = {"Verzeichnis der Abtrünnigen",nil, {"Lest das 'Verzeichnis der Abtrünnigen'."}},
[5165] = {"Übergießen der Flammen des Schutzes",nil, {"Übergießt die Flammen der vier Kohlenpfannen des Schutzes in der Schattenfeste im Teufelswald mit dem geläuterten Mondbrunnenwasser und kehrt danach zu Greta Mooshuf im Smaragdrefugium zurück."}},
[5166] = {"Brustplatte des chromatischen Drachenschwarms",nil, {"Um die Brustplatte des chromatischen Drachenschwarms zu schmieden, müsst Ihr die folgenden Gegenstände zu Jeziba dem 'Bildhauer' bringen:nn1 chromatischen Knochenpanzer.nn10 glänzende chromatische Schuppen.nn10 Einheiten Blut von Helden.nn10 ausgefranste


unwrap(), true);
//   }
//   #[test]
//   fn vec2d_zero_vector() {
//     let e = 1e-13;
//     let v0 = Vector2D{x: e, y: 0.0};
//     let zero_res = v0.is_zero_length(e);
//     assert_eq!(zero_res.is_err(), false);
//     assert_eq!(zero_res.unwrap(), true);

//     let zero_res1 = v0.is_zero_length(1e-14);
//     assert_eq!(zero_res1.is_err(), false);
//     assert_eq!(zero_res1.unwrap(), false);
//   }
//   #[test]
//   fn vec2d_unit_vector() {
//     let e = 1e-13;
//     let v0 = Vector2D{x: 1.0 - e, y: 0.0};
//     let unit_res = v0.is_unit_length(2.0 * e);
//     assert_eq!(unit_res.is_err(), false);
//     assert_eq!(unit_res.unwrap(), true);
//   }
//   #[test]
//   fn vec2d_parallel_vectors() {
//     let e  = 1e-14;
//     let v0 = Vector2D{ x: 1.0, y: 2.0 };
//     let v1 = Vector2D{ x: -1.0 - e, y: -2.0 - e };
//     let unit_res = v0.is_parallel_to(v1, e);
//     assert_eq!(unit_res.is_err(), false);
//     assert_eq!(unit_res.unwrap(), true);

//     let v1 = Vector2D{ x: -1.0 - 1e-6, y: -2.0 - 1e-6 };
//     let unit_res = v0.is_parallel_to(v1, e);
//     assert_eq!(unit_res.is_err(), false);
//     assert_eq!(unit_res.unwrap(), false);
//   }
//   #[test]
//   fn vec2d_perp_vectors() {
//     let e = 1e-13;
//     let v0 = Vector2D{x: 1.0, y: 2.0};
//     let p0 = v0.get_perpendicular_vector();

//     println!("{}", p0);

//     let v1 = Vector2D{x: p0.x + e, y: p0.y + e};
//     let unit_res = v0.is_perpendicular_to(v1, e);
//     assert_eq!(unit_res.is_err(), false);
//     assert_eq!(unit_res.unwrap(), true);

//     let v1 = Vector2D{x: p0.x + (2.0 * e), y: p0.y + (2.0 * e)};
//     let unit_res = v0.is_perpendicular_to(v1, e);
//     assert_eq!(unit_res.is_err(), false);
//     assert_eq!(unit_res.unwrap(), false);
//   }
//   #[test]
//   fn vec2d_codirectional_vectors() {
//     let e = 1e-14;

//     let v0 = Vector2D{ x: 1.0, y: 2.0 };
//     let v1 = Vector2D{ x: 1.0 + e, y: 2.0 + e };
//     let res = v0.is_codirectional_to(v1, e);
//     assert_eq!(res.is_err(), false);
//     assert_eq!(res.unwrap(), true);

//     let v1 = Vector2D{ x: 1.0, y: 2.0 + 1e-6 };
//     let res = v0.is_codirectional_to(v1, e);
//     assert_eq!(res.is_err(), false


-crosshairs {
  left: 50%;
  top: 25%;
}

.building-container[data-type="pavilion"] {
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%, 25% 0);
  height: 78px;
  margin-left: 0;
  margin-top: 0;
  transform-origin: 50% 50%;
  width: 90px;
}

.building-container[data-type="pavilion"] .building-inner {
  background-position: 45.45454545454545% 31.25%;
  clip-path: polygon(
    26.25% 2.5%,
    73.75% 2.5%,
    97.5% 50%,
    73.75% 97.5%,
    26.25% 97.5%,
    2.5% 50%,
    26.25% 2.5%
  );
}

.building-container[data-type="pavilion"] .building-border {
  clip-path: polygon(
    25% 0,
    75% 0,
    100% 50%,
    75% 100%,
    25% 100%,
    0 50%,
    25% 0,
    25% 0,
    28.125% 6.25%,
    28.125% 6.25%,
    6.25% 50%,
    28.125% 93.75%,
    71.875% 93.75%,
    93.75% 50%,
    71.875% 6.25%,
    28.125% 6.25%
  );
}

.building-container[data-type="pavilion"] .building-crosshairs {
  left: 50%;
  top: 50%;
}

.building-container[data-type="penguin"] {
  clip-path: polygon(
    40% 25%,
    60% 25%,
    70% 0,
    90% 0,
    100% 25%,
    90% 50%,
    100% 75%,
    90% 100%,
    70% 100%,
    60% 75%,
    40% 75%,
    30% 50%,
    10% 50%,
    0 25%,
    10% 0,
    30% 0,
    40% 25%
  );
  height: 157px;
  margin-left: -300%;
  margin-top: -173.20508075688772%;
  transform-origin: 50% 50%;
  width: 226px;
}

.building-container[data-type="penguin"] .building-inner {
  background-position: 88.88888888888889% 0;
  clip-path: polygon(
    39.5% 26.25%,
    60.5% 26.25%,
    70.5% 1.25%,
    89.5% 1.25%,
    99% 25%,
    89% 50%,
    99% 75%,
    89.5% 98.75%,
    70.5% 98.75%,
    60.5% 73.75%,
    40.5% 73.75%,
    30.5% 48.75%,
    10.5% 48.75%,
    1% 25%,
    10.5% 1.25%,
    29.5% 1.25%,
    39.5% 26.25%
  );
}

.building-container[data-type="penguin"] .building-border {
  clip-path: polygon(
    40% 25%,
    60% 25%,
    70% 0,
    90% 0,
    100% 25%,
    90% 50%,
    100% 75%,
    90% 100%,
    70% 100%,
    60% 75%,
    40% 75%,
    30% 50%,
    10% 50%,
    0 25%,
    10% 0,
    30% 0,
    40% 25%,
    40% 25%,
    38.75% 28.125%,
    38.75% 28.125%,
    28.75% 3.125%,
    11.25% 3.125%,
    2.5% 25


* Gets the list of Expenses for the selected Project.
   * @param selectedProject The selected Project to get the expenses for.
   */
  refreshExpenses(selectedProject: Project) {
    if (selectedProject.id == null) {
      return [];
    } else {
      this.getExpensesByProjectId(selectedProject).toPromise()
        .then(expense => this.expenses = new BehaviorSubject<Array<Expense>>(expense))
        .catch(() => this.errorService.displayError());
    }
  }

  /**
   * Sends a GET message to the server to retrieve the Expenses for the specified Project.
   * @param selectedProject The ID of the project to get expenses for.
   */
  private getExpensesByProjectId(selectedProject: Project) {
    return this.http.get(`${projectsUrl}/${selectedProject.id}/expenses`)
      .pipe(catchError(this.errorService.handleError()))
      .pipe(map((data: any) => {
        if (data._embedded !== undefined) {
          return data._embedded.expenses as Expense[];
        } else {
          return null;
        }
      }));
  }

  /**
   * Saves the specified Project. If the Project is new (id = -1), an HTTP POST is performed,
   * else an HTTP PUT is performed to update the existing Project.
   *
   * @param selectedProject The Project to be created/updated.
   */
  save(selectedProject: Project) {
    if (this.selectedExpense.id === -1) {
      this.http.post<Expense>(`${projectsUrl}/${selectedProject.id}/expenses`, JSON.stringify(this.selectedExpense), httpOptions).toPromise()
        .then(response => {
          this.refreshExpenses(selectedProject);
          return response;
        }).catch(() => {
        this.errorService.displayError()
      });
    } else {
      const url = this.selectedExpense._links["update"];
      this.http.put<Expense>(url["href"], JSON.stringify(this.selectedExpense), httpOptions).toPromise()
        .then((response) => {
          this.refreshExpenses(selectedProject);
          return response;
        }).catch(() => {
        this.errorService.displayError()
      });
    }
  }

  /**
   * Logically deletes the Expense (sets the active status to false).
   * @param expense The Expense to delete.
   * @param project The Project associated with the Expense to be deleted.
   */
  delete(expense: Expense, project: Project) {
    const url = `${projectsUrl}/${project.id}/expenses/${expense.id}`;
    this.http.delete<Expense>(url).toPromise()
      .then(() => this.refreshExpenses(project))
      .catch(() => this.errorService.displayError());
  }
}

/**
 * Defines the type of ClientExtensionProvidedTo.
 */
export enum ClientExtensionProvidedTo {

    /**
     * Everyone
     */
    Everyone = 0,

    /**
     * SpecificUsers
     */
    SpecificUsers = 1
}import analyze from '../tools/analyze';

describe('package.json main field', () => {

  const cwd = process.cwd();

  const analyzeWithModule = (module: string) => analyze(cwd, { module });
  const analyzeWithJSNext = (jsnext: string) => analyze(cwd, { 'jsnext:main': jsnext });

  test('should throw on non string module field', () => {

    const invalidModuleFields = [
      1,
      { name: 'value' },
    ];

    expect.assertions(invalidModuleFields.length);

    invalidModuleFields.forEach((moduleField) => {
      void expect(analyzeWithModule(moduleField as never)).rejects.toThrow(TypeError);
    });