content
stringlengths
4
1.04M
lang
stringclasses
358 values
score
int64
0
5
repo_name
stringlengths
5
114
repo_path
stringlengths
4
229
repo_licenses
listlengths
1
8
'' ================================================================================================= '' '' File....... sdloader.spin (version 1.00) '' Requires... SD Card and reader (FAT16), boot EEPROM must be 64K not 32K '' Purpose.... resident loader to allow updates via SD card '' Author..... Brian Riley, Underill Center, VT, USA '' various parts based upon work/ideas from '' Matthew Cornelisse '' Nick McClanahan '' Jon McPhalen '' and a lot of work by Mike Green on the underlying '' hardware drivers as well as help converting to the Femto '' based sd/spi/i2c hardware handlers '' '' -- see below for terms of use '' '' E-mail..... [email protected] '' Started.... 5/5/2010 '' Updated.... 5/9/2010 '' ================================================================================================= '' '' How to use: '' '' 1) Load this code to propeller in normal load to low EEPROM fashion '' 2) open the actual firmware file you want to be on the propeller '' 3) select save to EEPROM file and name it "update.pgm" and save to SD card '' 4) insert SD card to propeller system and power up '' 5) sdloader will read and load "update.pgm" to high EEPROM, erase the file '' then load from high EEPROM to RAM and begin running the new program '' 6) if you have a need to load a large number of boards with the same file '' create and save to the SD card an empty file named "nodelete.txt". This '' will stop sdloader from erasing the file ''------------------------------------------------------------------------------ '' '' Additional features '' '' 7) If you need to update the sdloader program itself repeat steps 2-5, except '' name the file "loader.pgm" and it will be loaded into low EEPROM, step 6 '' also applies with regard to file erasure. '' 8) If you want/need to run a program for a quick test, you may open the file '' and save to EEPROM file, naming it "run.pgm" and save it to the SD card. '' sdloader will see this and load it directly to RAM and run it. No erase '' option is available. Upon power cycling or hitting reset no trace of the '' program is left on the hardware except the file on the SD card. '' 9) If there is a "run.pgm" the sdloader is terminated by the new load and run. '' If not it drops down to step 11. '' 10) ANY or ALL of the three .PGM files may be present on the SD card. sdloader '' looks first for "loader.pgm", then "update.pgm" and then "run.pgm" '' 11) If no SD card is present, or an SD card is present, but none of the named '' files are there, sdloader drops to load from high EEPROM to RAM and run. '' 12) In step 10 if no intelligible program is in high EEPROM it will still be '' loaded to RAM and run ... ya get what you get! '' ''------------------------------------------------------------------------------ CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 '80 MHz PAGESIZE = 32 LO_EEPROM = $0000 ' based upon 24LC512 (64KB) HI_EEPROM = $8000 VAR byte buffer[PAGESIZE] long maincog long ss[50] ' Stack for watchdog timer long ioControl[2] OBJ SD : "fsrwFemto" ' Has different mount call sdspi : "sdspiFemto" ' SPIN program loader and support routines DAT RunNow byte "run.pgm", 0 NewLoader byte "loader.pgm", 0 NewFirmware byte "update.pgm", 0 NoDelete byte "nodelete.txt", 0 PUB start | wdcog maincog := cogid ' get cog# of current cog sd.start(@iocontrol) ' start fsrw, point to IO control block wdcog:=cognew(wd,@ss) ' start watchdog if \sd.mount(0,1,2,3) == 0 ' access SD card (DO,Clk,DI,CS) ' yes, card mounted cogstop(wdcog) ' stop watchdog ' test for file to be loaded into low ' EEPROM, nominally a replacement bootloader \loadEEPROM(@NewLoader, LO_EEPROM) ' test for file to be loaded into high ' EEPROM, this will be the normal running program \loadEEPROM(@NewFirmware, HI_EEPROM) ' test for file to be immediately loaded ' into RAM and RUN, leaving no EEPROM footprint if \sd.popen(@RunNow, "r") == 0 sd.bootSDCard ' this loads the current open file from SD card and runs it ' successful, the new program is now in command ' fail, it drops through to default high EEPROM prog sdspi.bootEEPROM(sdspi#bootAddr + $8000) ' load from 2nd 32K of EEPROM PRI wd waitcnt(cnt+clkfreq/2) ' wait for 10th of a second cogstop(maincog) ' stop hung main cog sdspi.bootEEPROM(sdspi#bootAddr + $8000) ' load from 2nd 32K of EEPROM PRI loadEEPROM (fname, eeAdr) | a, c, d eeAdr += sdspi#bootAddr ' always use boot EEPROM if \SD.popen(fname,"r") abort string("Can't open file") if SD.pread(@buffer,PAGESIZE) <> PAGESIZE abort string("Can't read program") if SD.writeEEPROM(eeAdr,@buffer,PAGESIZE) abort string("Copy EEPROM write error") if SD.writeWait(eeAdr) abort string("Copy EEPROM wait error") a := word[@buffer+SD#vbase] 'use actual size of program repeat c from PAGESIZE to a - 1 step PAGESIZE d := (a - c) <# PAGESIZE if SD.pread(@buffer,d) <> d abort string("Can't read program") if SD.writeEEPROM(eeAdr+c,@buffer,d) abort string("Copy EEPROM write error") if SD.writeWait(eeAdr+c) abort string("Copy EEPROM wait error") if \SD.pclose < 0 abort string("Error closing file") if \sd.popen(@NoDelete, "r") <> 0 \sd.popen(fname, "d") '------------------------------------------------------------------- {{ TERMS OF USE: MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. }}
Propeller Spin
5
deets/propeller
libraries/community/p1/All/SDLoader/sdloader.spin
[ "MIT" ]
/** * ${language_name} */ package io.cucumber.java.${normalized_language};
Groovy Server Pages
1
sidharta/cucumber-jvm
java/src/main/groovy/package-info.java.gsp
[ "MIT" ]
Feature: Special commands @wip Scenario: run refresh command When we refresh completions and we wait for prompt then we see completions refresh started
Cucumber
3
lyrl/mycli
test/features/specials.feature
[ "BSD-3-Clause" ]
a { color: #aabccc }
CSS
1
mengxy/swc
crates/swc_css_parser/tests/fixture/esbuild/misc/AocxkR5Gt30Hu6JV7J56Wg/input.css
[ "Apache-2.0" ]
%%%------------------------------------------------------------------- %%% @author dlive %%% @copyright (C) 2019, <COMPANY> %%% @doc %%% %%% @end %%% Created : 06. Apr 2019 3:25 PM %%%------------------------------------------------------------------- -module(erlcat_tests). -author("dlive"). -include_lib("eunit/include/eunit.hrl"). -include("erlcat.hrl"). -compile(export_all). setup() -> erlcat:init_cat("testapp", #cat_config{enable_heartbeat = 0, enable_debugLog = 1, encoder_type = 1}), ok. remote_call_client_test()-> setup(), Content = erlcat:new_context(), erlcat:log_remote_call_client(Content), ok. transaction_test_() -> { setup, spawn, fun() -> setup() end, [ fun() -> init_context(), send_trans(4) end, fun() -> send_trans2(4) end ] }. logevent_test_() -> { setup, spawn, fun() -> setup() end, [ fun() -> init_context(), erlcat:log_event(get(erlcat_process_context), "EVENT_TYPE", "EVENT_NAME", "0", "data") end, fun() -> erlcat:log_event(get(erlcat_process_context), "EVENT_TYPE", "EVENT_NAME", "0", "data") end ] }. logerror_test_() -> { setup, spawn, fun() -> setup() end, [ fun() -> init_context(), erlcat:log_error(get(erlcat_process_context), "errormessage", "detail info") end, fun() -> erlcat:log_error(get(erlcat_process_context), "errormessage","detail info") end ] }. heart_test_() -> { setup, spawn, fun() -> setup() end, [ fun() -> init_context(), heart_count(4) end, fun() -> heart_count(4) end ] }. init_context() -> Context = erlcat:new_context(), put(erlcat_process_context, Context). % cat_test:init(),cat_test:trans(). send_trans(0) -> ok; send_trans(Index) -> ErlCatContext = get(erlcat_process_context), io:format(user, "contetxt111 ~p ~n", [ErlCatContext]), T1 = erlcat:new_transaction(ErlCatContext, "MSG.send", "send"), sleep1(), T2 = erlcat:new_transaction(ErlCatContext, "MSG.send", "check"), sleep1(), erlcat:complete(ErlCatContext, T2), T3 = erlcat:new_transaction(ErlCatContext, "MSG.send", "del111111"), sleep1(), erlcat:complete(ErlCatContext, T3), erlcat:complete(ErlCatContext, T1), send_trans(Index - 1). send_trans2(0) -> ok; send_trans2(Index) -> ErlCatContext = get(erlcat_process_context), io:format(user, "contetxt ~p ~n", [ErlCatContext]), T1 = erlcat:new_transaction(ErlCatContext, "MSG.send", "tttt1"), sleep1(), T2 = erlcat:new_transaction(ErlCatContext, "MSG.send", "tttt1_check"), sleep1(), erlcat:complete(ErlCatContext, T2), T3 = erlcat:new_transaction(ErlCatContext, "MSG.send", "tttt1_del"), sleep1(), erlcat:complete(ErlCatContext, T3), erlcat:complete(ErlCatContext, T1), io:format(user, "send2 ~p~n", [Index]), send_trans2(Index - 1). sleep1() -> timer:sleep(rand:uniform(200)). heart_count(0) -> ok; heart_count(Count) -> heart(), heart_count(Count - 1). heart() -> % erlcat:init_cat("testapp",#cat_config{enable_heartbeat=1,enable_debugLog=1}), Data = #{ "userinfo" => integer_to_list(rand:uniform(1000)), "test22" => integer_to_list(rand:uniform(1000)), "test333" => integer_to_list(rand:uniform(1000)) }, erlcat:log_heartbeat(get(erlcat_process_context), "titleh1", Data), ok.
Erlang
3
woozhijun/cat
lib/erlang/test/erlcat_tests.erl
[ "Apache-2.0" ]
(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.0' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: [email protected] phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 118380, 3215]*) (*NotebookOutlinePosition[ 119012, 3237]*) (* CellTagsIndexPosition[ 118968, 3233]*) (*WindowFrame->Normal*) Notebook[{ Cell[BoxData[ \(\(cons := {{1, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 1, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 1, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 1, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 1, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 1, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 1, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 1, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 1, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 1, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 1, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 1, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 1, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 1, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 1, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 1, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 1, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 1, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 1, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 1, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 1, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 1, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 1, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 1, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 1, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 1, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 1, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 1, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 1, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 1, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 1, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 1, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 1, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 1, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 1, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 1, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 1, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 1, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 1, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 1, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 1, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 1, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 1, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 1, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 1, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 1, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 1, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 1, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 1, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 1}, \[IndentingNewLine]{1, 1, 1, 1, 1, 1, 1, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 1, 1, 1, 1, 1, 1, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 1, 1, 1, 1, 1, 1, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 1, 1, 1, 1, 1, 1, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 1, 1, 1, 1, 1, 1, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 1, 1, 1, 1, 1, 1, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 1, 1, 1, 1, 1, 1, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 1, 1, 1, 1, 1, 1, 1}, \[IndentingNewLine]{1, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]\(-1\), 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]\(-1\), 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]\(-1\), 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]\(-1\), 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 1, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, \(-1\), 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 1, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, \(-1\), 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 1, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, \(-1\), 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 1, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, \(-1\), 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 1, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, \(-1\), 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 1, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, \(-1\), 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 1, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, \(-1\), 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 1, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, \(-1\), 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 1, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, \(-1\), 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 1, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, \(-1\), 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 1, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, \(-1\), 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 1, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, \(-1\), 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 1, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, \(-1\), 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 1, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, \(-1\), 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 1, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, \(-1\), 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 1, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, \(-1\), 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 1, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, \(-1\), 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 1, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, \(-1\), 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 1, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, \(-1\), 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 1, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, \(-1\), 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 1, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, \(-1\), 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 1, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, \(-1\), 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 1, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, \(-1\), 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 1, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, \(-1\), 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, \(-1\), \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, \(-1\), \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, \(-1\), \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 1, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, \(-1\)}, \[IndentingNewLine]{1, \(-1\), 1, \(-1\), 1, \(-1\), 1, \(-1\), \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, \(-1\), 1, \(-1\), 1, \(-1\), 1, \(-1\), \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, \(-1\), 1, \(-1\), 1, \(-1\), 1, \(-1\), \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, \(-1\), 1, \(-1\), 1, \(-1\), 1, \(-1\), \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, \(-1\), 1, \(-1\), 1, \(-1\), 1, \(-1\), \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, \(-1\), 1, \(-1\), 1, \(-1\), 1, \(-1\), \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, \(-1\), 1, \(-1\), 1, \(-1\), 1, \(-1\), \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0}, \[IndentingNewLine]{0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]0, 0, 0, 0, 0, 0, 0, 0, \[IndentingNewLine]1, \(-1\), 1, \(-1\), 1, \(-1\), 1, \(-1\)}};\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(cons // MatrixForm\)], "Input"], Cell[BoxData[ TagBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ {"1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0"}, {"0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0"}, {"0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0"}, {"0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0"}, {"0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0"}, {"0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0"}, {"0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0"}, {"0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", "1"}, {"1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "1", "1", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", "1", "1", "1", "1", "1", "1", "1"}, {"1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0"}, {"0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0"}, {"0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0"}, {"0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0"}, {"0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0"}, {"0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0"}, {"0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0"}, {"0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\), "0", "0", "0", "0", "0", "0", "0", "1", "0", "0", "0", "0", "0", "0", "0", \(-1\)}, {"1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\), "0", "0", "0", "0", "0", "0", "0", "0"}, {"0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "1", \(-1\), "1", \(-1\), "1", \(-1\), "1", \(-1\)} }], "\[NoBreak]", ")"}], Function[ BoxForm`e$, MatrixForm[ BoxForm`e$]]]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\((\(Partition[#, 8] &\) /@ RowReduce[cons])\) // MatrixForm\)], "Input"], Cell[BoxData[ InterpretationBox[ RowBox[{"(", "\[NoBreak]", GridBox[{ { RowBox[{"(", "\[NoBreak]", GridBox[{ {"1"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"1"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)}, {"0"}, {\(-1\)} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"}, {"0"}, {"1"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]}, { RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}], RowBox[{"(", "\[NoBreak]", GridBox[{ {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"}, {"0"} }], "\[NoBreak]", ")"}]} }], "\[NoBreak]", ")"}], MatrixForm[ {{{1, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, -1, 0, -1, 0, -1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, -1, 0, -1, 0, -1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, -1, 0, -1, 0, -1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, -1, 0, -1, 0, -1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, -1, 0, -1, 0, -1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, -1, 0, -1, 0, -1}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, -1, 0, -1, 0, -1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, -1, 0, -1, 0, -1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, -1, 0, -1, 0, -1, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, -1, 0, -1, 0, -1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, -1, 0, -1, 0, -1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, -1, 0, -1, 0, -1}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 1, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 1, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 1}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {1, 0, 1, 0, 1, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 1, 0, 1, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {1, 0, 1, 0, 1, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 1, 0, 1, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {1, 0, 1, 0, 1, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 1, 0, 1, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {1, 0, 1, 0, 1, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 1, 0, 1, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {1, 0, 1, 0, 1, 0, 1, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 1, 0, 1, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {1, 0, 1, 0, 1, 0, 1, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 0, 1, 0, 1, 0, 1}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}, {{0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0}}}]]], "Output"] }, Open ]] }, FrontEndVersion->"5.0 for X", ScreenRectangle->{{0, 1600}, {0, 1200}}, WindowSize->{520, 600}, WindowMargins->{{214, Automatic}, {Automatic, 153}} ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1754, 51, 14734, 256, 4107, "Input"], Cell[CellGroupData[{ Cell[16513, 311, 51, 1, 27, "Input"], Cell[16567, 314, 13459, 197, 598, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[30063, 516, 93, 1, 27, "Input"], Cell[30159, 519, 88205, 2693, 4630, "Output"] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)
Mathematica
3
junaidnaseer/daala
doc/noise-shape.nb
[ "BSD-2-Clause" ]
{foreach $array as $item} {$iterator->} {/foreach}
Latte
1
timfel/netbeans
php/php.latte/test/unit/data/testfiles/completion/testIterator_01.latte
[ "Apache-2.0" ]
<div class="spacer" style="height:{{ height }}px;"></div>
Liquid
1
noahcb/lit
website/src/_includes/partials/spacer.liquid
[ "Apache-2.0" ]
-- Taken from an example from Autodesk's MAXScript reference: -- http://help.autodesk.com/view/3DSMAX/2016/ENU/?guid=__files_GUID_84E24969_C175_4389_B9A6_3B2699B66785_htm macroscript MoveToSurface category: "HowTo" ( fn g_filter o = superclassof o == Geometryclass fn find_intersection z_node node_to_z = ( local testRay = ray node_to_z.pos [0,0,-1] local nodeMaxZ = z_node.max.z testRay.pos.z = nodeMaxZ + 0.0001 * abs nodeMaxZ intersectRay z_node testRay ) on isEnabled return selection.count > 0 on Execute do ( target_mesh = pickObject message:"Pick Target Surface:" filter:g_filter if isValidNode target_mesh then ( undo "MoveToSurface" on ( for i in selection do ( int_point = find_intersection target_mesh i if int_point != undefined then i.pos = int_point.pos )--end i loop )--end undo )--end if )--end execute )--end script
MAXScript
4
JavascriptID/sourcerer-app
src/test/resources/samples/langs/MAXScript/macro-1.mcr
[ "MIT" ]
<!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=CHANGED-8" /> <title>CHANGED</title> <link CHANGED="stylesheet" href="CHANGED/CHANGED.CHANGED"> <script CHANGED="CHANGED.js"></script> </head> <body> <h1>CHANGED</h1> <p>Intro to CHANGED</p> <ul class="CHANGED"> <li>CHANGED</li> <li>CHANGED</li> <li>CHANGED</li> </ul> <p class="CHANGED">It's CHANGED about CHANGED CHANGED</p> </body> </html>
HTML
1
ravitejavalluri/brackets
test/spec/FindReplace-known-goods/regexp-case-insensitive/foo.html
[ "MIT" ]
[ (section) ] @fold
Scheme
0
hmac/nvim-treesitter
queries/godot_resource/folds.scm
[ "Apache-2.0" ]
<div class="ui image"></div>
HTML
0
292388900/Semantic-UI
test/fixtures/transition.html
[ "MIT" ]
/* * Copyright 2014-2019 Jiří Janoušek <[email protected]> * * 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. */ namespace Nuvola { public class WebViewSidebar: Gtk.Grid { private Gtk.Entry? width_entry = null; private Gtk.Entry? height_entry = null; private Gtk.Widget web_view; private int resize_delay_remaining = -1; private Gtk.SpinButton resize_delay_spin; private Gtk.Button resize_button; #if HAVE_CEF private Gtk.SpinButton delay_spin; private int delay_remaining = -1; private Gtk.Button snapshot_button; #endif private unowned AppRunnerController app; public WebViewSidebar(AppRunnerController app) { this.app = app; web_view = app.web_engine.get_main_web_view(); orientation = Gtk.Orientation.VERTICAL; hexpand = vexpand = true; row_spacing = column_spacing = 5; var row = 0; var label = new Gtk.Label("Width:"); label.halign = Gtk.Align.START; attach(label, 0, row, 1, 1); width_entry = new Gtk.Entry(); width_entry.max_width_chars = 4; width_entry.input_purpose = Gtk.InputPurpose.NUMBER; width_entry.halign = Gtk.Align.END; width_entry.hexpand = false; attach(width_entry, 1, row, 1, 1); label = new Gtk.Label("Height:"); label.halign = Gtk.Align.START; attach(label, 0, ++row, 1, 1); height_entry = new Gtk.Entry(); height_entry.max_width_chars = 4; height_entry.hexpand = false; height_entry.input_purpose = Gtk.InputPurpose.NUMBER; height_entry.halign = Gtk.Align.END; attach(height_entry, 1, row, 1, 1); var button = new Gtk.Button.with_label("Update dimensions"); button.clicked.connect(update); attach(button, 0, ++row, 2, 1); label = new Gtk.Label("Delay:"); label.halign = Gtk.Align.START; attach(label, 0, ++row, 1, 1); resize_delay_spin = new Gtk.SpinButton.with_range(0, 3600, 1); resize_delay_spin.numeric = true; resize_delay_spin.digits = 0; resize_delay_spin.snap_to_ticks = true; attach(resize_delay_spin, 1, row, 1, 1); button = new Gtk.Button.with_label("Resize web view"); button.clicked.connect(resize_or_cancel); resize_button = button; attach(button, 0, ++row, 2, 1); #if HAVE_CEF if (web_view is CefGtk.WebView) { label = new Gtk.Label("Delay:"); label.halign = Gtk.Align.START; attach(label, 0, ++row, 1, 1); delay_spin = new Gtk.SpinButton.with_range(0, 3600, 1); delay_spin.numeric = true; delay_spin.digits = 0; delay_spin.snap_to_ticks = true; attach(delay_spin, 1, row, 1, 1); button = new Gtk.Button.with_label("Take snapshot"); button.clicked.connect(take_cancel_snapshot); attach(button, 0, ++row, 2, 1); snapshot_button = button; } #endif show_all(); update(); Timeout.add(300, () => { update(); return false; }); } ~WebViewSidebar() { } private void update() { height_entry.text = web_view.get_allocated_height().to_string(); width_entry.text = web_view.get_allocated_width().to_string(); } private void resize_or_cancel() { if (resize_delay_remaining < 0) { resize_delay_remaining = resize_delay_spin.get_value_as_int(); apply(); } else { resize_delay_remaining = 0; } } private void apply() { if (resize_delay_remaining > 0) { Timeout.add(1000, () => {apply(); return false; }); resize_button.label = "Resize web view ... %d".printf(resize_delay_remaining); resize_delay_remaining--; return; } resize_button.label = "Resize web view"; resize_delay_remaining = -1; Gtk.Allocation allocation; web_view.get_allocation(out allocation); int width = int.parse(width_entry.text); int height = int.parse(height_entry.text); web_view.set_size_request(width, height); if (height < allocation.height || width < allocation.width) { var window = get_toplevel() as Gtk.Window; assert(window != null); int window_width; int window_height; window.get_size(out window_width, out window_height); window_width -= allocation.width - width + 10; window_height -= allocation.height - height + 10; window.resize(int.max(10, window_width), int.max(10, window_height)); } Timeout.add(100, () => {web_view.set_size_request(-1, -1); return false;}); } #if HAVE_CEF private void take_cancel_snapshot() { if (delay_remaining < 0) { delay_remaining = delay_spin.get_value_as_int(); take_snapshot(); } else { delay_remaining = 0; } } private void take_snapshot() { if (delay_remaining > 0) { Timeout.add(1000, () => { take_snapshot(); return false; }); snapshot_button.label = "Take snapshot ... %d".printf(delay_remaining); delay_remaining--; return; } snapshot_button.label = "Take snapshot"; delay_remaining = -1; Gdk.Pixbuf? snapshot = ((CefGtk.WebView) web_view).get_snapshot(); if (snapshot != null) { var dialog = new Gtk.FileChooserNative( "Save snapshot", /* TODO use (get_toplevel() as Gtk.Window) when https://gitlab.gnome.org/GNOME/gtk/issues/83 lands */ null, Gtk.FileChooserAction.SAVE, "Save snapshot", "Cancel"); dialog.do_overwrite_confirmation = true; var filter = new Gtk.FileFilter(); filter.set_filter_name("PNG images"); filter.add_pattern("*.png"); dialog.add_filter(filter); dialog.response.connect((response_id) => { if (response_id == Gtk.ResponseType.ACCEPT) { try { snapshot.save(dialog.get_filename(), "png", "compression", "9", null); } catch (GLib.Error e) { app.show_warning("Failed to save snapshot", e.message); } } dialog.destroy(); }); dialog.show(); } else { app.show_warning("Snapshot failure", "Failed to take a snapshot."); } } #endif } } // namespace Nuvola
Vala
4
xcffl/nuvolaruntime
src/nuvolakit-runner/components/developer/WebViewSidebar.vala
[ "BSD-2-Clause" ]
/** * ApplyReconciler.x10 * * Rudra Distributed Learning Platform * * Copyright (c) IBM Corporation 2016 * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of Rudra 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 HOLDER 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 rudra; import x10.util.concurrent.AtomicBoolean; import x10.io.Unserializable; import x10.compiler.Pinned; import rudra.util.Logger; import rudra.util.MergingMonitor; import rudra.util.Monitor; import rudra.util.Unit; import rudra.util.SwapBuffer; @Pinned class ApplyReconciler(size:Long, maxMB: UInt, nLearner:NativeLearner, desiredR:Int, reducer:AtLeastRAllReducer, mmPLH:PlaceLocalHandle[MergingMonitor], logger:Logger) implements Unserializable { var timeStamp:UInt = 0un; // incremented each time an all reduce produces non zero load // TODO: double buffer to avoid wait on lock..?? Debatable. You want freshest weights. val monitor = new Monitor(); var sizeMB:UInt = 0un; // #MB processed since last pickup var weightTimeStamp:UInt=0un; // accumulate the weights, used by learner to figure out which epoch it is in def acceptNWGradient(rg:TimedGradient) { monitor.atomicBlock(()=> { weightTimeStamp=rg.timeStamp; val multiplier = 1.0f / rg.loadSize(); nLearner.acceptGradients(rg.grad, multiplier); sizeMB += rg.loadSize(); Unit() }); logger.info(()=>"Reconciler:<- Network, weights updated with " + rg); rg.setLoadSize(0un); } def fillInWeights(w:TimedWeight):void { monitor.atomicBlock(()=> { if (w.timeStamp < weightTimeStamp) { nLearner.serializeWeights(w.weight); w.setLoadSize(sizeMB); w.timeStamp=weightTimeStamp; sizeMB=0un; } Unit() }); } def run(fromLearner:SwapBuffer[TimedGradient], done:AtomicBoolean) { logger.info(()=>"Reconciler: started."); val dest = new TimedGradient(size); var compG:TimedGradient = new TimedGradient(size); var totalMBReceived:UInt = 0un; reducer.initialize(size); val mm = mmPLH(); // local merging monitor while (totalMBReceived < maxMB) { var readyToReduce:Boolean = false; if (desiredR > 0 ) { logger.info(()=>"Reconciler: awaiting input."); val newPhase = mm.await(timeStamp); logger.info(()=>"Reconciler: awakened with phase=" + newPhase); readyToReduce = newPhase == timeStamp+1un; } assert compG.loadSize()==0un : "Reconciler: " + compG + " should have zero size."; val tmp = fromLearner.get(compG); val received = tmp!= compG; compG = tmp; if (received) logger.info(()=>"Reconciler:<- Learner " + tmp); reducer.run(readyToReduce, timeStamp, compG, mmPLH, dest); // may reduce val includedMB = dest.loadSize(); totalMBReceived += includedMB; if (includedMB > 0un) { timeStamp = dest.timeStamp; acceptNWGradient(dest); }// includeMB>0 } // while logger.info(()=>"Reconciler: Exited main loop, terminating. timeStamp=" + timeStamp); logger.notify(()=> "" + reducer.allreduceTimer); done.set(true); } //reconciler } // vim: shiftwidth=4:tabstop=4:expandtab
X10
4
milthorpe/rudra
x10/src/rudra/ApplyReconciler.x10
[ "BSD-3-Clause" ]
Mozilla/5.0 (Linux; Android 7.0; LG-H871 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 7.0; LG-H871 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.158 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 7.0; LG-H871 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 7.0; LG-H871 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 8.0.0; LG-H871 Build/OPR1.170623.032; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/69.0.3497.100 Mobile Safari/537.36 Mozilla/5.0 (Android 7.0; Mobile; LG-H871; rv:53.0) Gecko/53.0 Firefox/53.0 Mozilla/5.0 (Linux; Android 8.0.0; LG-H871 Build/OPR1.170623.032) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Mobile Safari/537.36 Mozilla/5.0 (Android 7.0; Mobile; LG-H871; rv:51.0) Gecko/51.0 Firefox/51.0 Mozilla/5.0 (Android 7.0; Mobile; LG-H871; rv:56.0) Gecko/56.0 Firefox/56.0 Mozilla/5.0 (Android 7.0; Mobile; LG-H871; rv:55.0) Gecko/55.0 Firefox/55.0 Mozilla/5.0 (Linux; Android 7.0; LG-H871 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 7.0; LG-H871 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.125 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 7.0; LG-H871 Build/NRD90U; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/65.0.3325.109 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 8.0.0; LG-H871 Build/OPR1.170623.032) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36 Mozilla/5.0 (Android 7.0; Mobile; LG-H871; rv:57.0) Gecko/57.0 Firefox/57.0 Mozilla/5.0 (Linux; Android 7.0; LG-H871 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.98 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 8.0.0; LG-H871 Build/OPR1.170623.032) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 7.0; LG-H871 Build/NRD90U; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/64.0.3282.137 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 8.0.0; LG-H871 Build/OPR1.170623.032) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.91 Mobile Safari/537.36 Mozilla/5.0 (Android 8.0.0; Mobile; LG-H871; rv:60.0) Gecko/60.0 Firefox/60.0 Mozilla/5.0 (Linux; Android 8.0.0; LG-H871 Build/OPR1.170623.032) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.81 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 8.0.0; LG-H871 Build/OPR1.170623.032) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.76 Mobile Safari/537.36 Mozilla/5.0 (Android 8.0.0; Mobile; LG-H871; rv:57.0) Gecko/57.0 Firefox/57.0 Mozilla/5.0 (Linux; Android 7.0; LG-H871 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.68 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 7.0; LG-H871 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 8.0.0; LG-H871 Build/OPR1.170623.032) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.85 Mobile Safari/537.36 Mozilla/5.0 (Linux; Android 7.0; LG-H871 Build/NRD90U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36
Text
1
5tr1x/SecLists
Fuzzing/User-Agents/operating-platform/lg-h871.txt
[ "MIT" ]
/************************************************************************* * * * YAP Prolog * * * * Yap Prolog was developed at NCCUP - Universidade do Porto * * * * Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 * * * ************************************************************************** * * * File: undefined.yap * * Last rev: 8/2/88 * * mods: * * comments: Predicate Undefined for YAP * * * *************************************************************************/ /** @defgroup Undefined_Procedures Handling Undefined Procedures @ingroup YAPControl @{ A predicate in a module is said to be undefined if there are no clauses defining the predicate, and if the predicate has not been declared to be dynamic. What YAP does when trying to execute undefined predicates can be specified in three different ways: + By setting an YAP flag, through the yap_flag/2 or set_prolog_flag/2 built-ins. This solution generalizes the ISO standard by allowing module-specific behavior. + By using the unknown/2 built-in (this deprecated solution is compatible with previous releases of YAP). + By defining clauses for the hook predicate `user:unknown_predicate_handler/3`. This solution is compatible with SICStus Prolog. */ /** @pred user:unknown_predicate_handler(+ _Call_, + _M_, - _N_) In YAP, the default action on undefined predicates is to output an `error` message. Alternatives are to silently `fail`, or to print a `warning` message and then fail. This follows the ISO Prolog standard where the default action is `error`. The user:unknown_predicate_handler/3 hook was originally include in SICStus Prolog. It allows redefining the answer for specifici calls. As an example. after defining `undefined/1` by: ~~~~~ undefined(A) :- format('Undefined predicate: ~w~n',[A]), fail. ~~~~~ and executing the goal: ~~~~~ :- assert(user:unknown_predicate_handler(U,M,undefined(M:U)) ) ~~~~~ a call to a predicate for which no clauses were defined will result in the output of a message of the form: ~~~~~ Undefined predicate: ~~~~~ followed by the failure of that call. */ :- multifile user:unknown_predicate_handler/3. undefined_query(G0, M0, Cut) :- recorded('$import','$import'(M,M0,G,G0,_,_),_), '$call'(G, Cut, G, M). /** * @pred '$undefp_search'(+ M0:G0, -MG) * * @param G0 input goal * @param M0 current module * @param G1 new goal * * @return succeeds on finding G1, otherwise fails. * * Tries: * 1 - `user:unknown_predicate_handler` * 2 - `goal_expansion` * 1 - `import` mechanism` */ '$undefp'(M0G0,_) :- '$undefp_search'(M0G0, M:G), call(M:G). %% undef handler: % we found an import, and call again % we have user code in the unknown_predicate % we fail, output a message, and just generate an exception. '$undefp_search'(M0:G0, MG) :- user:unknown_predicate_handler(G0,M0,MG), !. '$undefp_search'(G0, G) :- % make sure we do not loop on undefined predicates setup_call_catcher_cleanup( '$undef_setup'(Action,Debug,Current), '$import'( G0, G ), Catch, '$undef_cleanup'(Catch, Action,Debug,Current,G0) ), !. %'$undefp_search'(M0:G0, M:G) :- % '$found_undefined_predicate'( M0:G0, M:G ). '$undef_setup'(Action,Debug,Current) :- yap_flag( unknown, Action, exit), yap_flag( debug, Debug, false), '$stop_creeping'(Current). '$undef_cleanup'(Catch, Action,Debug, _Current, ModGoal) :- yap_flag( unknown, _, Action), yap_flag( debug, _, Debug), ( lists:member(Catch, [!,exit]) -> true ; '$undef_error'(Action, ModGoal) ). '$undef_error'(error, Mod:Goal) :- '$do_error'(existence_error(procedure,Mod:Goal), Mod:Goal). '$undef_error'(warning,Mod:Goal) :- '$program_continuation'(PMod,PName,PAr), print_message(warning,error(existence_error(procedure,Mod:Goal), context(Mod:Goal,PMod:PName/PAr))). '$undef_error'(fail,_). % % undef handler ready -> we can drop the original, very simple one. % :- abolish(prolog:'$undefp0'/2). :- '$undefp_handler'('$undefp'(_,_), prolog). /** @pred unknown(- _O_,+ _N_) The unknown predicate, informs about what the user wants to be done when there are no clauses for a predicate. Using unknown/3 is strongly deprecated. We recommend setting the `unknown` prolog flag for generic behaviour, and calling the hook user:unknown_predicate_handler/3 to fine-tune specific cases undefined goals. */ unknown(P, NP) :- yap_flag( unknown, P, NP ). /** @} */
Prolog
5
KuroLevin/yap-6.3
pl/undefined.yap
[ "Artistic-1.0-Perl", "ClArtistic" ]
// Copyright 2021 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // CPU specific code for arm independent of OS goes here. #include <sys/syscall.h> #include <unistd.h> #if V8_TARGET_ARCH_RISCV64 #include "src/codegen/cpu-features.h" namespace v8 { namespace internal { void CpuFeatures::FlushICache(void* start, size_t size) { #if !defined(USE_SIMULATOR) char* end = reinterpret_cast<char*>(start) + size; // The definition of this syscall is // SYSCALL_DEFINE3(riscv_flush_icache, uintptr_t, start, // uintptr_t, end, uintptr_t, flags) // The flag here is set to be SYS_RISCV_FLUSH_ICACHE_LOCAL, which is // defined as 1 in the Linux kernel. syscall(SYS_riscv_flush_icache, start, end, 1); #endif // !USE_SIMULATOR. } } // namespace internal } // namespace v8 #endif // V8_TARGET_ARCH_RISCV64
C++
3
EXHades/v8
src/codegen/riscv64/cpu-riscv64.cc
[ "BSD-3-Clause" ]
({ type: 'recycle-list', attr: { append: 'tree', listData: [ { type: 'A', dynamic: 'decimal', two: '2', four: '4' }, { type: 'A', dynamic: 'binary', two: '10', four: '100' } ], switch: 'type', alias: 'item' }, children: [{ type: 'cell-slot', attr: { append: 'tree', case: 'A' }, children: [{ type: 'text', attr: { value: 'static' } }, { type: 'text', attr: { value: { '@binding': 'item.dynamic' } } }, { type: 'text', attr: { value: [ 'one ', { '@binding': 'item.two' }, ' three ', { '@binding': 'item.four' }, ' five' ] } }] }] })
JavaScript
3
Rewats/vue
test/weex/cases/recycle-list/text-node.vdom.js
[ "MIT" ]
-- CqlStorage libdata = LOAD 'cql://libdata/libout' USING CqlStorage(); book_by_mail = FILTER libdata BY C_OUT_TY == 'BM'; libdata_buildings = FILTER libdata BY SQ_FEET > 0; state_flat = FOREACH libdata_buildings GENERATE STABR AS State,SQ_FEET AS SquareFeet; state_grouped = GROUP state_flat BY State; state_footage = FOREACH state_grouped GENERATE group AS State, SUM(state_flat.SquareFeet) AS TotalFeet:int; insert_format= FOREACH state_footage GENERATE TOTUPLE(TOTUPLE('year',2011),TOTUPLE('state',State)),TOTUPLE(TotalFeet); STORE insert_format INTO 'cql://libdata/libsqft?output_query=UPDATE%20libdata.libsqft%20SET%20sqft%20%3D%20%3F' USING CqlStorage;
PigLatin
4
mghosh4/cassandra
examples/pig/example-script-cql.pig
[ "Apache-2.0" ]
for i from 0 to 2 console.log does-not-exist
LiveScript
0
danielo515/LiveScript
test/data/runtime-error.ls
[ "MIT" ]
(* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) val iter_all : unit Lwt.t list -> unit Lwt.t val all : 'a Lwt.t list -> 'a list Lwt.t val output_graph : Lwt_io.output_channel -> ('a -> string) -> ('a * 'a list) list -> unit Lwt.t val fold_result_s : f:('acc -> 'b -> ('acc, 'c) result Lwt.t) -> init:'acc -> 'b list -> ('acc, 'c) result Lwt.t
OCaml
3
zhangmaijun/flow
src/common/lwt/lwtUtils.mli
[ "MIT" ]
discard """ errormsg: "undeclared identifier: 'z'" line: 11 """ # Open a new scope for static expr blocks block: let a = static: var z = 123 33 echo z
Nimrod
3
JohnAD/Nim
tests/errmsgs/tstaticexprscope.nim
[ "MIT" ]
# Check variable string specific parsing functionality. # # RUN: %{llbuild} ninja parse %s 2> %t.err # RUN: %{FileCheck} < %t.err %s # Check that we accept and preserve spaces in variable bindings. # # CHECK: actOnBindingDecl(/*Name=*/"a0", /*Value=*/"b0 c0") a0 = b0 c0 # Check that we strip leading space. # # CHECK: actOnBindingDecl(/*Name=*/"a1", /*Value=*/"b1 c1") a1 = b1 c1 # Check that we accept "special" characters in this context. # # CHECK: actOnBindingDecl(/*Name=*/"a2", /*Value=*/"this is a : followed by a |") a2 = this is a : followed by a | # Check that we don't stop on escapes. # # CHECK: actOnBindingDecl(/*Name=*/"a3", /*Value=*/"this spans$\na$ line") a3 = this spans$ a$ line # Check that we diagnose missing '=' properly. # # CHECK: string-parsing.ninja:[[@LINE+1]]:2: error: expected '=' token a4 # Check that we allow empty assignments. # # CHECK: actOnBindingDecl(/*Name=*/"a5", /*Value=*/"") a5 = # Check that we handle escapes at the beginning of the variable string parsing. # # CHECK: actOnBindingDecl(/*Name=*/"a6", /*Value=*/"value") a6 =$ value
Ninja
4
uraimo/swift-llbuild
tests/Ninja/Parser/variable-string-parsing.ninja
[ "Apache-2.0" ]
// run-pass #![allow(unused_variables)] // aux-build:issue-7899.rs // pretty-expanded FIXME #23616 extern crate issue_7899 as testcrate; fn main() { let f = testcrate::V2(1.0f32, 2.0f32); }
Rust
3
Eric-Arellano/rust
src/test/ui/issues/issue-7899.rs
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
# This checks what type would be inferred for a first-class function equivalent # to an `if` expression \x -> \y -> \z -> if x then y else z
Grace
3
DebugSteven/grace
tasty/data/complex/if-then-else-input.grace
[ "BSD-3-Clause" ]
package public inline fun </*0*/ T> funWithAtLeastOnceCallsInPlace(/*0*/ block: () -> T): T CallsInPlace(block, AT_LEAST_ONCE) public inline fun funWithAtLeastOnceCallsInPlace(/*0*/ block: () -> kotlin.Unit): kotlin.Unit CallsInPlace(block, AT_LEAST_ONCE) public inline fun funWithAtMostOnceCallsInPlace(/*0*/ block: () -> kotlin.Unit): kotlin.Unit CallsInPlace(block, AT_MOST_ONCE) public inline fun </*0*/ T> funWithExactlyOnceCallsInPlace(/*0*/ block: () -> T): T CallsInPlace(block, EXACTLY_ONCE) public inline fun funWithExactlyOnceCallsInPlace(/*0*/ block: () -> kotlin.Unit): kotlin.Unit CallsInPlace(block, EXACTLY_ONCE) public fun funWithReturns(/*0*/ cond: kotlin.Boolean): kotlin.Unit Returns(WILDCARD) -> cond public fun funWithReturnsAndInvertCondition(/*0*/ cond: kotlin.Boolean): kotlin.Unit Returns(WILDCARD) -> !cond public fun funWithReturnsAndInvertTypeCheck(/*0*/ value_1: kotlin.Any?): kotlin.Unit Returns(WILDCARD) -> value_1 !is String public fun funWithReturnsAndNotNullCheck(/*0*/ value_1: kotlin.Any?): kotlin.Unit Returns(WILDCARD) -> value_1 != null public fun funWithReturnsAndNullCheck(/*0*/ value_1: kotlin.Any?): kotlin.Unit Returns(WILDCARD) -> value_1 == null public fun funWithReturnsAndTypeCheck(/*0*/ value_1: kotlin.Any?): kotlin.Unit Returns(WILDCARD) -> value_1 is String public fun funWithReturnsFalse(/*0*/ cond: kotlin.Boolean): kotlin.Boolean Returns(FALSE) -> cond public fun funWithReturnsFalseAndInvertCondition(/*0*/ cond: kotlin.Boolean): kotlin.Boolean Returns(FALSE) -> !cond public fun funWithReturnsFalseAndInvertTypeCheck(/*0*/ value_1: kotlin.Any?): kotlin.Boolean Returns(FALSE) -> value_1 !is String public fun funWithReturnsFalseAndNotNullCheck(/*0*/ value_1: kotlin.Number?): kotlin.Boolean Returns(FALSE) -> value_1 != null public fun funWithReturnsFalseAndNullCheck(/*0*/ value_1: kotlin.Number?): kotlin.Boolean Returns(FALSE) -> value_1 == null public fun funWithReturnsFalseAndTypeCheck(/*0*/ value_1: kotlin.Any?): kotlin.Boolean Returns(FALSE) -> value_1 is String public fun funWithReturnsNotNull(/*0*/ cond: kotlin.Boolean): kotlin.Boolean? Returns(NOT_NULL) -> cond public fun funWithReturnsNotNullAndInvertCondition(/*0*/ cond: kotlin.Boolean): kotlin.Boolean? Returns(NOT_NULL) -> !cond public fun funWithReturnsNotNullAndInvertTypeCheck(/*0*/ value_1: kotlin.Any?): kotlin.Boolean? Returns(NOT_NULL) -> value_1 !is String public fun funWithReturnsNotNullAndNotNullCheck(/*0*/ value_1: kotlin.Number?): kotlin.Boolean? Returns(NOT_NULL) -> value_1 != null public fun funWithReturnsNotNullAndNullCheck(/*0*/ value_1: kotlin.Number?): kotlin.Boolean? Returns(NOT_NULL) -> value_1 == null public fun funWithReturnsNotNullAndTypeCheck(/*0*/ value_1: kotlin.Any?): kotlin.Boolean? Returns(NOT_NULL) -> value_1 is String public fun funWithReturnsNull(/*0*/ cond: kotlin.Boolean): kotlin.Boolean? Returns(NULL) -> cond public fun funWithReturnsNullAndInvertCondition(/*0*/ cond: kotlin.Boolean): kotlin.Boolean? Returns(NULL) -> !cond public fun funWithReturnsNullAndInvertTypeCheck(/*0*/ value_1: kotlin.Any?): kotlin.Boolean? Returns(NULL) -> value_1 !is String public fun funWithReturnsNullAndNotNullCheck(/*0*/ value_1: kotlin.Number?): kotlin.Boolean? Returns(NULL) -> value_1 != null public fun funWithReturnsNullAndNullCheck(/*0*/ value_1: kotlin.Number?): kotlin.Boolean? Returns(NULL) -> value_1 == null public fun funWithReturnsNullAndTypeCheck(/*0*/ value_1: kotlin.Any?): kotlin.Boolean? Returns(NULL) -> value_1 is String public fun funWithReturnsTrue(/*0*/ cond: kotlin.Boolean): kotlin.Boolean Returns(TRUE) -> cond public fun funWithReturnsTrueAndInvertCondition(/*0*/ cond: kotlin.Boolean): kotlin.Boolean Returns(TRUE) -> !cond public fun funWithReturnsTrueAndInvertTypeCheck(/*0*/ value_1: kotlin.Any?): kotlin.Boolean Returns(TRUE) -> value_1 !is String public fun funWithReturnsTrueAndNotNullCheck(/*0*/ value_1: kotlin.Any?): kotlin.Boolean Returns(TRUE) -> value_1 != null public fun funWithReturnsTrueAndNullCheck(/*0*/ value_1: kotlin.Any?): kotlin.Boolean Returns(TRUE) -> value_1 == null public fun funWithReturnsTrueAndTypeCheck(/*0*/ value_1: kotlin.Any?): kotlin.Boolean Returns(TRUE) -> value_1 is String public inline fun funWithUnknownCallsInPlace(/*0*/ block: () -> kotlin.Unit): kotlin.Unit CallsInPlace(block, UNKNOWN) public final class case_1 { public constructor case_1() public final val prop_1: kotlin.Int? = 10 public final fun case_1(/*0*/ value_1: kotlin.Any?, /*1*/ value_2: kotlin.Number?): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class case_2 { public constructor case_2() public final val prop_1: kotlin.Int? = 10 public final fun case_2(/*0*/ value_1: kotlin.Any?, /*1*/ value_2: kotlin.Number?): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class case_3 { public constructor case_3() public final val prop_1: kotlin.Int? = 10 public final fun case_3(/*0*/ value_1: kotlin.Any?, /*1*/ value_2: kotlin.Number?): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class case_4 { public constructor case_4() public final val prop_1: kotlin.Int? = 10 public final fun case_4(/*0*/ value_1: kotlin.Any?, /*1*/ value_2: kotlin.Number?): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } package contracts { public fun case_3(/*0*/ value_1: kotlin.Any?, /*1*/ value_2: kotlin.Any?, /*2*/ value_3: kotlin.Any?, /*3*/ value_4: kotlin.Any?): kotlin.Unit Returns(WILDCARD) -> value_1 is Float? && value_1 != null && value_2 != null && value_3 != null && value_4 != null public fun case_4(/*0*/ value_1: kotlin.Any?, /*1*/ value_2: kotlin.Any?, /*2*/ value_3: kotlin.Any?, /*3*/ value_4: kotlin.Any?): kotlin.Boolean Returns(TRUE) -> value_1 is Float? && value_1 != null && value_2 != null && value_3 != null && value_4 != null }
Text
3
AndrewReitz/kotlin
compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/11.txt
[ "ECL-2.0", "Apache-2.0" ]
At: "spec_min_sep-08.hac":9: parse error: syntax error parser stacks: state value #STATE# (null) #STATE# (process-prototype) [6:1..30] #STATE# { [6:32] #STATE# keyword: spec [7:1..4] #STATE# { [7:6] #STATE# identifier: min_sep [9:2..8] #STATE# list<(expr)>: int: 13 ... [9:9..12] #STATE# ( [9:13] #STATE# list<(inst-ref-expr)>: (id-expr): q ... [9:14] #STATE# , [9:15] #STATE# { [9:17] #STATE# { [9:18] in state #STATE#, possible rules are: grouped_reference: '{' . mandatory_member_index_expr_list '}' (#RULE#) acceptable tokens are: ID (shift) SCOPE (shift)
Bison
2
broken-wheel/hacktist
hackt_docker/hackt/test/parser/prs/spec_min_sep-08.stderr.bison
[ "MIT" ]
#![allow(dead_code)] #![allow(unused_variables)] #![allow(non_snake_case)] #![deny(unreachable_patterns)] enum Stack<T> { Nil, Cons(T, Box<Stack<T>>) } fn is_empty<T>(s: Stack<T>) -> bool { match s { Nil => true, //~^ WARN pattern binding `Nil` is named the same as one of the variants of the type `Stack` _ => false //~^ ERROR unreachable pattern } } fn main() {}
Rust
3
Eric-Arellano/rust
src/test/ui/issues/issue-30302.rs
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
package IncreaseReg_v1; interface IncreaseReg; method Action write(int x); method int read; endinterface (* synthesize *) module mkIncreaseReg (IncreaseReg); Reg#(int) reg_data <- mkReg(0); (* preempts = "write, increase" *) rule increase; reg_data <= reg_data + 1; endrule method write = reg_data._write; method read = reg_data._read; endmodule module mkTb(); Reg#(int) cnt <- mkReg(0); rule up_counter; cnt <= cnt + 1; if(cnt > 10) $finish; endrule let inc_reg <- mkIncreaseReg; rule update_data (cnt%3 == 0); $display("write inc_reg<=%3d", 2 * cnt); inc_reg.write(2 * cnt); endrule rule show; $display("read inc_reg =%3d", inc_reg.read); endrule endmodule endpackage
Bluespec
3
Xiefengshang/BSV_Tutorial_cn
src/14.IncreaseReg/IncreaseReg_v1.bsv
[ "MIT" ]
very Rectangle is classy shh 1 wow
Dogescript
0
erinkeith/dogescript
test/spec/classy/expression/simple/source.djs
[ "MIT" ]
<p>Annotation Servlet!</p>
Java Server Pages
0
zeesh49/tutorials
spring-custom-aop/src/main/webapp/annotationservlet.jsp
[ "MIT" ]
particle_system sand { src = blendmode = "alpha" acceleration = 1.000000 gravity = 0.000000,-4.375000,0.000000 velocity = 0.000000,2.500000,0.000000 spread = 26.865999 lifetime = 2.907000 lifetime_variance = 0.000000 colour = 246.000000,206.000000,90.000000,255.000000 random_initial_rotation = true rotation_speed = 0.000000 scale_affector = 0.000000 size = 0.022000 emit_rate = 10.000000 emit_count = 10 spawn_radius = 0.060000 spawn_offset = 0.000000,0.000000,0.000000 release_count = 10 inherit_rotation = true frame_count = 1 animate = false random_frame = false framerate = 1.000000 forces { force = 0.000000,0.000000,0.000000 force = 0.000000,0.000000,0.000000 force = 0.000000,0.000000,0.000000 force = 0.000000,0.000000,0.000000 } }
Component Pascal
4
fallahn/crogine
samples/golf/assets/golf/particles/sand.cps
[ "FTL", "Zlib" ]
= Description of the intent of that setup The goal of this dataset is to configure a custom directory layout for workspaces and builds. This for use with @LocalData to test JENKINS-50164 Specifically, the config.xml should contain: ``` <workspaceDir>${JENKINS_HOME}/previous-custom-workspace/${ITEM_FULL_NAME}</workspaceDir> <buildsDir>${ITEM_ROOTDIR}/ze-previous-custom-builds</buildsDir> ```
AsciiDoc
3
1st/jenkins
test/src/test/resources/jenkins/model/JenkinsBuildsAndWorkspacesDirectoriesTest/fromPreviousCustomSetup/README.adoc
[ "MIT" ]
# One XADD with one huge 5GB field # Expected to fail resulting in an empty stream start_server [list overrides [list save ""] ] { test {XADD one huge field} { r config set proto-max-bulk-len 10000000000 ;#10gb r config set client-query-buffer-limit 10000000000 ;#10gb r write "*5\r\n\$4\r\nXADD\r\n\$2\r\nS1\r\n\$1\r\n*\r\n" r write "\$1\r\nA\r\n" catch { write_big_bulk 5000000000 ;#5gb } err assert_match {*too large*} $err r xlen S1 } {0} {large-memory} } # One XADD with one huge (exactly nearly) 4GB field # This uncovers the overflow in lpEncodeGetType # Expected to fail resulting in an empty stream start_server [list overrides [list save ""] ] { test {XADD one huge field - 1} { r config set proto-max-bulk-len 10000000000 ;#10gb r config set client-query-buffer-limit 10000000000 ;#10gb r write "*5\r\n\$4\r\nXADD\r\n\$2\r\nS1\r\n\$1\r\n*\r\n" r write "\$1\r\nA\r\n" catch { write_big_bulk 4294967295 ;#4gb-1 } err assert_match {*too large*} $err r xlen S1 } {0} {large-memory} } # Gradually add big stream fields using repeated XADD calls start_server [list overrides [list save ""] ] { test {several XADD big fields} { r config set stream-node-max-bytes 0 for {set j 0} {$j<10} {incr j} { r xadd stream * 1 $::str500 2 $::str500 } r ping r xlen stream } {10} {large-memory} } # Add over 4GB to a single stream listpack (one XADD command) # Expected to fail resulting in an empty stream start_server [list overrides [list save ""] ] { test {single XADD big fields} { r write "*23\r\n\$4\r\nXADD\r\n\$1\r\nS\r\n\$1\r\n*\r\n" for {set j 0} {$j<10} {incr j} { r write "\$1\r\n$j\r\n" write_big_bulk 500000000 "" yes ;#500mb } r flush catch {r read} err assert_match {*too large*} $err r xlen S } {0} {large-memory} } # Gradually add big hash fields using repeated HSET calls # This reproduces the overflow in the call to ziplistResize # Object will be converted to hashtable encoding start_server [list overrides [list save ""] ] { r config set hash-max-ziplist-value 1000000000 ;#1gb test {hash with many big fields} { for {set j 0} {$j<10} {incr j} { r hset h $j $::str500 } r object encoding h } {hashtable} {large-memory} } # Add over 4GB to a single hash field (one HSET command) # Object will be converted to hashtable encoding start_server [list overrides [list save ""] ] { test {hash with one huge field} { catch {r config set hash-max-ziplist-value 10000000000} ;#10gb r config set proto-max-bulk-len 10000000000 ;#10gb r config set client-query-buffer-limit 10000000000 ;#10gb r write "*4\r\n\$4\r\nHSET\r\n\$2\r\nH1\r\n" r write "\$1\r\nA\r\n" write_big_bulk 5000000000 ;#5gb r object encoding H1 } {hashtable} {large-memory} } # SORT which stores an integer encoded element into a list. # Just for coverage, no news here. start_server [list overrides [list save ""] ] { test {SORT adds integer field to list} { r set S1 asdf r set S2 123 ;# integer encoded assert_encoding "int" S2 r sadd myset 1 2 r mset D1 1 D2 2 r sort myset by D* get S* store mylist r llen mylist } {2} {cluster:skip} }
Tcl
5
hpdic/redis
tests/unit/violations.tcl
[ "BSD-3-Clause" ]
= ImpCEvalFun : Evaluation Function for Imp > module ImpCEvalFun We saw in the `Imp` chapter how a naive approach to defining a function representing evaluation for Imp runs into difficulties. There, we adopted the solution of changing from a functional to a relational definition of evaluation. In this optional chapter, we consider strategies for getting the functional approach to work. > import Logic > import Maps > import Imp > %access public export > %default total == A Broken Evaluator Here was our first try at an evaluation function for commands, omitting \idr{WHILE}. > ceval_step1 : (st : State) -> (c : Com) -> State > ceval_step1 st CSkip = st > ceval_step1 st (CAss l a1) = t_update l (aeval st a1) st > ceval_step1 st (CSeq c1 c2) = > let st' = ceval_step1 st c1 > in ceval_step1 st' c2 > ceval_step1 st (CIf b c1 c2) = > if beval st b > then ceval_step1 st c1 > else ceval_step1 st c2 > ceval_step1 st (CWhile b c) = st -- bogus As we remarked in chapter `Imp`, in a traditional functional programming language like ML or Haskell we could write the WHILE case as follows: ```idris ... ceval_step1 st (CWhile b c) = if (beval st b) then ceval_step1 st (CSeq c $ CWhile b c) else st ``` Idris doesn't accept such a definition (\idr{ImpCEvalFun.ceval_step1 is possibly not total due to recursive path ImpCEvalFun.ceval_step1 --> ImpCEvalFun.ceval_step1 --> ImpCEvalFun.ceval_step1}) because the function we want to define is not guaranteed to terminate. Indeed, the changed \idr{ceval_step1} function applied to the \idr{loop} program from `Imp.lidr` would never terminate. Since Idris is not just a functional programming language, but also a consistent logic, any potentially non-terminating function needs to be rejected. Here is an invalid(!) Idris program showing what would go wrong if Idris allowed non-terminating recursive functions: ```idris loop_false : (n : Nat) -> Void loop_false n = loop_false n ``` That is, propositions like \idr{Void} would become provable (e.g., \idr{loop_false 0} would be a proof of \idr{Void}), which would be a disaster for Idris's logical consistency. Thus, because it doesn't terminate on all inputs, the full version of \idr{ceval_step1} cannot be written in Idris -- at least not without one additional trick... == A Step-Indexed Evaluator The trick we need is to pass an _additional_ parameter to the evaluation function that tells it how long to run. Informally, we start the evaluator with a certain amount of "gas" in its tank, and we allow it to run until either it terminates in the usual way _or_ it runs out of gas, at which point we simply stop evaluating and say that the final result is the empty memory. (We could also say that the result is the current state at the point where the evaluator runs out fo gas -- it doesn't really matter because the result is going to be wrong in either case!) > ceval_step2 : (st : State) -> (c : Com) -> (i : Nat) -> State > ceval_step2 _ _ Z = empty_state > ceval_step2 st CSkip (S i') = st > ceval_step2 st (CAss l a1) (S i') = t_update l (aeval st a1) st > ceval_step2 st (CSeq c1 c2) (S i') = > let st' = ceval_step2 st c1 i' > in ceval_step2 st' c2 i' > ceval_step2 st (CIf b c1 c2) (S i') = > if beval st b > then ceval_step2 st c1 i' > else ceval_step2 st c2 i' > ceval_step2 st c@(CWhile b1 c1) (S i') = > if (beval st b1) > then let st' = ceval_step2 st c1 i' in > ceval_step2 st' c i' > else st _Note_: It is tempting to think that the index \idr{i} here is counting the "number of steps of evaluation." But if you look closely you'll see that this is not the case: for example, in the rule for sequencing, the same \idr{i} is passed to both recursive calls. Understanding the exact way that \idr{i} is treated will be important in the proof of \idr{ceval__ceval_step}, which is given as an exercise below. One thing that is not so nice about this evaluator is that we can't tell, from its result, whether it stopped because the program terminated normally or because it ran out of gas. Our next version returns an \idr{Maybe State} instead of just a \idr{State}, so that we can distinguish between normal and abnormal termination. > ceval_step3 : (st : State) -> (c : Com) -> (i : Nat) -> Maybe State > ceval_step3 _ _ Z = Nothing > ceval_step3 st CSkip (S i') = Just st > ceval_step3 st (CAss l a1) (S i') = Just $ t_update l (aeval st a1) st > ceval_step3 st (CSeq c1 c2) (S i') = > case ceval_step3 st c1 i' of > Just st' => ceval_step3 st' c2 i' > Nothing => Nothing > ceval_step3 st (CIf b c1 c2) (S i') = > if beval st b > then ceval_step3 st c1 i' > else ceval_step3 st c2 i' > ceval_step3 st c@(CWhile b1 c1) (S i') = > if (beval st b1) > then case ceval_step3 st c1 i' of > Just st' => ceval_step3 st' c i' > Nothing => Nothing > else Just st We can improve the readability of this version by using the fact that /idr{Maybe} forms a monad to hide the plumbing involved in repeatedly matching against optional states. ```idris Monad Maybe where Nothing >>= k = Nothing (Just x) >>= k = k x ``` > ceval_step : (st : State) -> (c : Com) -> (i : Nat) -> Maybe State > ceval_step _ _ Z = Nothing > ceval_step st CSkip (S i') = Just st > ceval_step st (CAss l a1) (S i') = Just $ t_update l (aeval st a1) st > ceval_step st (CSeq c1 c2) (S i') = > do st' <- ceval_step st c1 i' > ceval_step st' c2 i' > ceval_step st (CIf b c1 c2) (S i') = > if beval st b > then ceval_step st c1 i' > else ceval_step st c2 i' > ceval_step st c@(CWhile b1 c1) (S i') = > if (beval st b1) > then do st' <- ceval_step st c1 i' > ceval_step st' c i' > else Just st > test_ceval : (st : State) -> (c : Com) -> Maybe (Nat, Nat, Nat) > test_ceval st c = case ceval_step st c 500 of > Nothing => Nothing > Just st => Just (st X, st Y, st Z) \todo[inline]{Syntax sugar for IF breaks down here} ```idris λΠ> test_ceval Imp.empty_state (CSeq (X ::= ANum 2) (CIf (BLe (AId X) (ANum 1)) (Y ::= ANum 3) (Z ::= ANum 4))) Just (2, 0, 4) : Maybe (Nat, Nat, Nat) ``` ==== Exercise: 2 stars, recommended (pup_to_n) Write an Imp program that sums the numbers from \idr{1} to \idr{X} (inclusive: \idr{1 + 2 + ... + X}) in the variable \idr{Y}. Make sure your solution satisfies the test that follows. > pup_to_n : Com > pup_to_n = ?pup_to_n_rhs > pup_to_n_1 : test_ceval (t_update X 5 $ Imp.empty_state) ImpCEvalFun.pup_to_n = Just (0, 15, 0) > pup_to_n_1 = ?pup_to_n_1 -- replace with Refl when done $\square$ ==== Exercise: 2 stars, optional (peven) Write a \idr{While} program that sets \idr{Z} to \idr{0} if \idr{X} is even and sets \idr{Z} to \idr{1} otherwise. Use \idr{test_ceval} to test your program. > -- FILL IN HERE $\square$ == Relational vs. Step-Indexed Evaluation As for arithmetic and boolean expressions, we'd hope that the two alternative definitions of evaluation would actually amount to the same thing in the end. This section shows that this is the case. > ceval_step__ceval : (c : Com) -> (st, st' : State) -> (i ** ceval_step st c i = Just st') -> c / st \\ st' > ceval_step__ceval c st st' (Z ** prf) = absurd prf > ceval_step__ceval CSkip st st (S i ** Refl) = E_Skip > ceval_step__ceval (CAss l a) st st' (S i ** prf) = > rewrite sym $ justInjective prf in > E_Ass {n=aeval st a} Refl > ceval_step__ceval (CSeq c1 c2) st st' (S i ** prf) with (ceval_step st c1 i) proof c1prf > ceval_step__ceval (CSeq c1 c2) st st' (S i ** prf) | Just st1 = > E_Seq (ceval_step__ceval c1 st st1 (i**sym c1prf)) > (ceval_step__ceval c2 st1 st' (i**prf)) > ceval_step__ceval (CSeq c1 c2) st st' (S i ** prf) | Nothing = absurd prf > ceval_step__ceval (CIf b c1 c2) st st' (S i ** prf) with (beval st b) proof bprf > ceval_step__ceval (CIf b c1 c2) st st' (S i ** prf) | True = > E_IfTrue (sym bprf) (ceval_step__ceval c1 st st' (i**prf)) > ceval_step__ceval (CIf b c1 c2) st st' (S i ** prf) | False = > E_IfFalse (sym bprf) (ceval_step__ceval c2 st st' (i**prf)) > ceval_step__ceval (CWhile b c) st st' (S i ** prf) with (beval st b) proof bprf > ceval_step__ceval (CWhile b c) st st' (S i ** prf) | True with (ceval_step st c i) proof cprf > ceval_step__ceval (CWhile b c) st st' (S i ** prf) | True | Just st1 = > E_WhileLoop (sym bprf) (ceval_step__ceval c st st1 (i**sym cprf)) \todo[inline]{Idris can't see sigma is decreasing, use WellFounded here?} > (assert_total $ ceval_step__ceval (CWhile b c) st1 st' (i**prf)) > ceval_step__ceval (CWhile b c) st st' (S i ** prf) | True | Nothing = absurd prf > ceval_step__ceval (CWhile b c) st st (S i ** Refl) | False = E_WhileEnd (sym bprf) ==== Exercise: 4 stars (ceval_step__ceval_inf) Write an informal proof of \idr{ceval_step__ceval}, following the usual template. (The template for case analysis on an inductively defined value should look the same as for induction, except that there is no induction hypothesis.) Make your proof communicate the main ideas to a human reader; do not simply transcribe the steps of the formal proof. > -- FILL IN HERE $\square$ > ceval_step_more : (i1, i2 : Nat) -> (st, st' : State) -> (c : Com) -> LTE i1 i2 -> ceval_step st c i1 = Just st' > -> ceval_step st c i2 = Just st' > ceval_step_more Z i2 st st' c lte prf = absurd prf > ceval_step_more (S i1) Z st st' c lte prf = absurd lte > ceval_step_more (S i1) (S i2) st st' CSkip lte prf = prf > ceval_step_more (S i1) (S i2) st st' (CAss l a) lte prf = prf > ceval_step_more (S i1) (S i2) st st' (CSeq c1 c2) lte prf with (ceval_step st c1 i1) proof cprf > ceval_step_more (S i1) (S i2) st st' (CSeq c1 c2) lte prf | Just st1 = > rewrite ceval_step_more i1 i2 st st1 c1 (fromLteSucc lte) (sym cprf) in > ceval_step_more i1 i2 st1 st' c2 (fromLteSucc lte) prf > ceval_step_more (S i1) (S i2) st st' (CSeq c1 c2) lte prf | Nothing = absurd prf > ceval_step_more (S i1) (S i2) st st' (CIf b c1 c2) lte prf with (beval st b) proof bprf > ceval_step_more (S i1) (S i2) st st' (CIf b c1 c2) lte prf | True = > ceval_step_more i1 i2 st st' c1 (fromLteSucc lte) prf > ceval_step_more (S i1) (S i2) st st' (CIf b c1 c2) lte prf | False = > ceval_step_more i1 i2 st st' c2 (fromLteSucc lte) prf > ceval_step_more (S i1) (S i2) st st' (CWhile b c) lte prf with (beval st b) > ceval_step_more (S i1) (S i2) st st' (CWhile b c) lte prf | True with (ceval_step st c i1) proof cprf > ceval_step_more (S i1) (S i2) st st' (CWhile b c) lte prf | True | Just st1 = > rewrite ceval_step_more i1 i2 st st1 c (fromLteSucc lte) (sym cprf) in > ceval_step_more i1 i2 st1 st' (CWhile b c) (fromLteSucc lte) prf > ceval_step_more (S i1) (S i2) st st' (CWhile b c) lte prf | True | Nothing = absurd prf > ceval_step_more (S i1) (S i2) st st' (CWhile b c) lte prf | False = prf ==== Exercise: 3 stars, recommended (ceval__ceval_step) Finish the following proof. You'll need \idr{ceval_step_more} in a few places, as well as some basic facts about \idr{LTE} and \idr{S}. > ceval__ceval_step : (c : Com) -> (st, st' : State) -> (c / st \\ st') -> (i ** ceval_step st c i = Just st') > ceval__ceval_step c st st' prf = ?ceval__ceval_step_rhs $\square$ > ceval_and_ceval_step_coincide : (c : Com) -> (st, st' : State) -> (c / st \\ st') <-> (i ** ceval_step st c i = Just st') > ceval_and_ceval_step_coincide c st st' = (ceval__ceval_step c st st', ceval_step__ceval c st st') == Determinism of Evaluation Again Using the fact that the relational and step-indexed definition of evaluation are the same, we can give a slicker proof that the evaluation _relation_ is deterministic. > ceval_deterministic' : (c : Com) -> (st, st1, st2 : State) -> (c / st \\ st1) -> (c / st \\ st2) -> st1 = st2 > ceval_deterministic' c st st1 st2 prf1 prf2 = > let > (i1**e1) = ceval__ceval_step c st st1 prf1 > (i2**e2) = ceval__ceval_step c st st2 prf2 > plus1 = ceval_step_more i1 (i1+i2) st st1 c (lteAddRight i1) e1 > plus2 = ceval_step_more i2 (i1+i2) st st2 c (rewrite plusCommutative i1 i2 in lteAddRight i2) e2 > in > justInjective $ trans (sym plus1) plus2
Idris
5
diseraluca/software-foundations
src/ImpCEvalFun.lidr
[ "MIT" ]
//This file is part of "GZE - GroundZero Engine" //The permisive licence allow to use GZE for free or commercial project (Apache License, Version 2.0). //For conditions of distribution and use, see copyright notice in Licence.txt, this license must be included with any distribution of the code. package { //import GZ.Base.Math.Math; import GZ.Base.Pt; import GZ.Base.Vec3; /** * @author Maeiky */ //public class PtA extends Pt { public class PtA { public var vPt : Pt<Float>; //Original unmodified pt public var vTf : Pt<Float>; //Transformed pt public var vFinal : Pt<Float>; //3d Final Pass (Rotated) (Maybe useless) public var o2d : Pt<Float>; //2d pass (Maybe useless) //union public var vPt : Pt<Float>; /* //public var vPt : Pt<Float>; public var nX : Float; public var nY : Float; public var nZ : Float; */ public function PtA(_nX : Float = 0, _nY : Float = 0, _nZ : Float = 0):Void { vPt.nX = _nX; vPt.nY = _nY; vPt.nZ = _nZ; //oTf = new Pt<Float>(); //o2d = new Pt<Float>(); //Pt(_nX, _nY, _nZ); } public function fCopyToTf():Void { vTf.nX = vPt.nX; vTf.nY = vPt.nY; vTf.nZ = vPt.nZ; } public function fCopyToFinal():Void { vFinal.nX = vTf.nX; vFinal.nY = vTf.nY; vFinal.nZ = vTf.nZ; /* vFinal.nX = vPt.nX; vFinal.nY = vPt.nY; vFinal.nZ = vPt.nZ; */ } } }
Redcode
3
VLiance/GZE
src/Lib_GZ/Base/PtA.cw
[ "Apache-2.0" ]
<!DOCTYPE HTML> <!-- NewPage --> <html lang="en"> <head><!-- start favicons snippet, use https://realfavicongenerator.net/ --><link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="manifest" href="/assets/site.webmanifest"><link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#fc4d50"><link rel="shortcut icon" href="/assets/favicon.ico"><meta name="msapplication-TileColor" content="#ffc40d"><meta name="msapplication-config" content="/assets/browserconfig.xml"><meta name="theme-color" content="#ffffff"><!-- end favicons snippet --> <title>com.google.android.exoplayer2.metadata.id3 (ExoPlayer library)</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../../../../jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> <script type="text/javascript" src="../../../../../../jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="../../../../../../jquery/jquery-3.5.1.js"></script> <script type="text/javascript" src="../../../../../../jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="com.google.android.exoplayer2.metadata.id3 (ExoPlayer library)"; } } catch(err) { } //--> var pathtoroot = "../../../../../../"; var useModuleDirectories = false; loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <header role="banner"> <nav role="navigation"> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a id="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../index.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses.html">All&nbsp;Classes</a></li> </ul> <ul class="navListSearch"> <li><label for="search">SEARCH:</label> <input type="text" id="search" value="search" disabled="disabled"> <input type="reset" id="reset" value="reset" disabled="disabled"> </li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <a id="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> </nav> </header> <main role="main"> <div class="header"> <h1 title="Package" class="title">Package&nbsp;com.google.android.exoplayer2.metadata.id3</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="typeSummary"> <caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Interface</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <th class="colFirst" scope="row"><a href="Id3Decoder.FramePredicate.html" title="interface in com.google.android.exoplayer2.metadata.id3">Id3Decoder.FramePredicate</a></th> <td class="colLast"> <div class="block">A predicate for determining whether individual frames should be decoded.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <table class="typeSummary"> <caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Class</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <th class="colFirst" scope="row"><a href="ApicFrame.html" title="class in com.google.android.exoplayer2.metadata.id3">ApicFrame</a></th> <td class="colLast"> <div class="block">APIC (Attached Picture) ID3 frame.</div> </td> </tr> <tr class="rowColor"> <th class="colFirst" scope="row"><a href="BinaryFrame.html" title="class in com.google.android.exoplayer2.metadata.id3">BinaryFrame</a></th> <td class="colLast"> <div class="block">Binary ID3 frame.</div> </td> </tr> <tr class="altColor"> <th class="colFirst" scope="row"><a href="ChapterFrame.html" title="class in com.google.android.exoplayer2.metadata.id3">ChapterFrame</a></th> <td class="colLast"> <div class="block">Chapter information ID3 frame.</div> </td> </tr> <tr class="rowColor"> <th class="colFirst" scope="row"><a href="ChapterTocFrame.html" title="class in com.google.android.exoplayer2.metadata.id3">ChapterTocFrame</a></th> <td class="colLast"> <div class="block">Chapter table of contents ID3 frame.</div> </td> </tr> <tr class="altColor"> <th class="colFirst" scope="row"><a href="CommentFrame.html" title="class in com.google.android.exoplayer2.metadata.id3">CommentFrame</a></th> <td class="colLast"> <div class="block">Comment ID3 frame.</div> </td> </tr> <tr class="rowColor"> <th class="colFirst" scope="row"><a href="GeobFrame.html" title="class in com.google.android.exoplayer2.metadata.id3">GeobFrame</a></th> <td class="colLast"> <div class="block">GEOB (General Encapsulated Object) ID3 frame.</div> </td> </tr> <tr class="altColor"> <th class="colFirst" scope="row"><a href="Id3Decoder.html" title="class in com.google.android.exoplayer2.metadata.id3">Id3Decoder</a></th> <td class="colLast"> <div class="block">Decodes ID3 tags.</div> </td> </tr> <tr class="rowColor"> <th class="colFirst" scope="row"><a href="Id3Frame.html" title="class in com.google.android.exoplayer2.metadata.id3">Id3Frame</a></th> <td class="colLast"> <div class="block">Base class for ID3 frames.</div> </td> </tr> <tr class="altColor"> <th class="colFirst" scope="row"><a href="InternalFrame.html" title="class in com.google.android.exoplayer2.metadata.id3">InternalFrame</a></th> <td class="colLast"> <div class="block">Internal ID3 frame that is intended for use by the player.</div> </td> </tr> <tr class="rowColor"> <th class="colFirst" scope="row"><a href="MlltFrame.html" title="class in com.google.android.exoplayer2.metadata.id3">MlltFrame</a></th> <td class="colLast"> <div class="block">MPEG location lookup table frame.</div> </td> </tr> <tr class="altColor"> <th class="colFirst" scope="row"><a href="PrivFrame.html" title="class in com.google.android.exoplayer2.metadata.id3">PrivFrame</a></th> <td class="colLast"> <div class="block">PRIV (Private) ID3 frame.</div> </td> </tr> <tr class="rowColor"> <th class="colFirst" scope="row"><a href="TextInformationFrame.html" title="class in com.google.android.exoplayer2.metadata.id3">TextInformationFrame</a></th> <td class="colLast"> <div class="block">Text information ID3 frame.</div> </td> </tr> <tr class="altColor"> <th class="colFirst" scope="row"><a href="UrlLinkFrame.html" title="class in com.google.android.exoplayer2.metadata.id3">UrlLinkFrame</a></th> <td class="colLast"> <div class="block">Url link ID3 frame.</div> </td> </tr> </tbody> </table> </li> </ul> </div> </main> <footer role="contentinfo"> <nav role="navigation"> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a id="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a id="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../index.html">Overview</a></li> <li class="navBarCell1Rev">Package</li> <li>Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <a id="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </nav> </footer> </body> </html>
HTML
3
UniiqTV/ExoPlayer
docs/doc/reference/com/google/android/exoplayer2/metadata/id3/package-summary.html
[ "Apache-2.0" ]
! Copyright (C) 2013 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: kernel tools.test unix.linux.proc ; IN: unix.linux.proc.tests { } [ parse-proc-cmdline drop ] unit-test { } [ parse-proc-cpuinfo drop ] unit-test { } [ parse-proc-loadavg drop ] unit-test { } [ parse-proc-meminfo drop ] unit-test { } [ parse-proc-partitions drop ] unit-test { } [ parse-proc-stat drop ] unit-test { } [ parse-proc-swaps drop ] unit-test { } [ parse-proc-uptime drop ] unit-test
Factor
4
alex-ilin/factor
basis/unix/linux/proc/proc-tests.factor
[ "BSD-2-Clause" ]
--TEST-- Bug #42177 (Warning "array_merge_recursive(): recursion detected" comes again...) --FILE-- <?php $a1 = array( 'key1' => 1, 'key3' => 2 ); $a2 = array(); $a1 = array_merge_recursive( $a1, $a2 ); $a1 = array_merge_recursive( $a1, $a2 ); unset( $a1, $a2 ); $a1 = array(); $a2 = array( 'key1' => 1, 'key3' => 2 ); $a1 = array_merge_recursive( $a1, $a2 ); $a1 = array_merge_recursive( $a1, $a2 ); unset( $a1, $a2 ); $a1 = array(); $a2 = array( 'key1' => &$a1 ); $a1 = array_merge_recursive( $a1, $a2 ); try { $a1 = array_merge_recursive( $a1, $a2 ); } catch (\Error $e) { echo $e->getMessage() . " on line " . $e->getLine() . "\n"; } unset( $a1, $a2 ); $x = 'foo'; $y =& $x; $a1 = array($x, $y, $x, $y); $a2 = array( 'key1' => $a1, $x, $y ); $a1 = array_merge_recursive( $a1, $a2 ); $a1 = array_merge_recursive( $a1, $a2 ); unset( $a1, $a2 ); ?> --EXPECT-- Recursion detected on line 19
PHP
2
thiagooak/php-src
ext/standard/tests/array/bug42177.phpt
[ "PHP-3.01" ]
package com.baeldung.pcollections; import org.junit.Test; import org.pcollections.HashPMap; import org.pcollections.HashTreePMap; import org.pcollections.HashTreePSet; import org.pcollections.MapPSet; import org.pcollections.PVector; import org.pcollections.TreePVector; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class PCollectionsUnitTest { @Test public void whenEmpty_thenCreateEmptyHashPMap() { HashPMap<String, String> pmap = HashTreePMap.empty(); assertEquals(pmap.size(), 0); } @Test public void givenKeyValue_whenSingleton_thenCreateNonEmptyHashPMap() { HashPMap<String, String> pmap1 = HashTreePMap.singleton("key1", "value1"); assertEquals(pmap1.size(), 1); } @Test public void givenExistingHashMap_whenFrom_thenCreateHashPMap() { Map<String, String> map = new HashMap<>(); map.put("mkey1", "mval1"); map.put("mkey2", "mval2"); HashPMap<String, String> pmap2 = HashTreePMap.from(map); assertEquals(pmap2.size(), 2); } @Test public void whenHashPMapMethods_thenPerformOperations() { HashPMap<String, String> pmap = HashTreePMap.empty(); HashPMap<String, String> pmap0 = pmap.plus("key1", "value1"); Map<String, String> map = new HashMap<>(); map.put("key2", "val2"); map.put("key3", "val3"); HashPMap<String, String> pmap1 = pmap0.plusAll(map); HashPMap<String, String> pmap2 = pmap1.minus("key1"); HashPMap<String, String> pmap3 = pmap2.minusAll(map.keySet()); assertEquals(pmap0.size(), 1); assertEquals(pmap1.size(), 3); assertFalse(pmap2.containsKey("key1")); assertEquals(pmap3.size(), 0); } @Test public void whenTreePVectorMethods_thenPerformOperations() { TreePVector<String> pVector = TreePVector.empty(); TreePVector<String> pV1 = pVector.plus("e1"); TreePVector<String> pV2 = pV1.plusAll(Arrays.asList("e2", "e3", "e4")); assertEquals(1, pV1.size()); assertEquals(4, pV2.size()); TreePVector<String> pV3 = pV2.minus("e1"); TreePVector<String> pV4 = pV3.minusAll(Arrays.asList("e2", "e3", "e4")); assertEquals(pV3.size(), 3); assertEquals(pV4.size(), 0); TreePVector<String> pSub = pV2.subList(0, 2); assertTrue(pSub.contains("e1") && pSub.contains("e2")); PVector<String> pVW = pV2.with(0, "e10"); assertEquals(pVW.get(0), "e10"); } @Test public void whenMapPSetMethods_thenPerformOperations() { MapPSet pSet = HashTreePSet.empty().plusAll(Arrays.asList("e1", "e2", "e3", "e4")); assertEquals(pSet.size(), 4); MapPSet pSet1 = pSet.minus("e4"); assertFalse(pSet1.contains("e4")); } }
Java
4
zeesh49/tutorials
libraries/src/test/java/com/baeldung/pcollections/PCollectionsUnitTest.java
[ "MIT" ]
* Version check * * * See technical description in ../version.gms. Parameter MESSAGE_ix_version(*); $GDXIN '%in%' $LOAD MESSAGE_IX_version $GDXIN IF ( NOT ( MESSAGE_IX_version("major") = %VERSION_MAJOR% AND MESSAGE_IX_version("minor") = %VERSION_MINOR% ), logfile.nw = 1; logfile.nd = 0; put_utility 'log' / '***'; put_utility 'log' / '*** ABORT'; put_utility 'log' / '*** GDX file was written by an ixmp.jar incompatible with this version of MESSAGEix:'; put_utility 'log' / '*** %in%'; put_utility 'log' / '*** ...has version ' MESSAGE_IX_version("major") '.' MESSAGE_IX_version("minor") ' while version.gms has %VERSION_MAJOR%.%VERSION_MINOR%'; put_utility 'log' / '***'; abort "GDX file incompatible with current version of MESSAGEix"; ) ;
GAMS
3
shaohuizhang/message_ix
message_ix/model/MESSAGE/version_check.gms
[ "Apache-2.0", "CC-BY-4.0" ]
%YAML 1.1 # Gazebo Dockerfile database --- images: gzserver@(gazebo_version): base_image: @(os_name):@(os_code_name) maintainer_name: @(maintainer_name) template_name: docker_images/create_gzserver_image.Dockerfile.em entrypoint_name: docker_images/gzserver_entrypoint.sh template_packages: - docker_templates gazebo_packages: - gazebo@(gazebo_version) libgazebo@(gazebo_version): base_image: @(user_name):gzserver@(gazebo_version)-@(os_code_name) maintainer_name: @(maintainer_name) template_name: docker_images/create_gzclient_image.Dockerfile.em template_packages: - docker_templates gazebo_packages: - libgazebo@(gazebo_version)-dev gzweb@(gazebo_version): base_image: @(user_name):libgazebo@(gazebo_version)-@(os_code_name) maintainer_name: @(maintainer_name) template_name: docker_images/create_gzweb_image.Dockerfile.em template_packages: - docker_templates upstream_packages: - build-essential - cmake - imagemagick - libboost-all-dev - libgts-dev - libjansson-dev - libtinyxml-dev - mercurial - nodejs - nodejs-legacy - npm - pkg-config - psmisc - xvfb gazebo_packages: - libgazebo@(gazebo_version)-dev gzclient@(gazebo_version): base_image: @(user_name):gzserver@(gazebo_version)-@(os_code_name) maintainer_name: @(maintainer_name) template_name: docker_images/create_gzclient_image.Dockerfile.em template_packages: - docker_templates upstream_packages: - binutils - mesa-utils - module-init-tools - x-window-system gazebo_packages: - gazebo@(gazebo_version)
EmberScript
3
christophebedard/docker_images-1
gazebo/9/ubuntu/xenial/images.yaml.em
[ "Apache-2.0" ]
/* * Copyright (c) 2016-present, RxJava Contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See * the License for the specific language governing permissions and limitations under the License. */ package io.reactivex.rxjava3.internal.operators.completable; import static org.junit.Assert.*; import static org.mockito.Mockito.*; import org.junit.Test; import io.reactivex.rxjava3.core.*; import io.reactivex.rxjava3.exceptions.TestException; import io.reactivex.rxjava3.observers.TestObserver; import io.reactivex.rxjava3.processors.PublishProcessor; import io.reactivex.rxjava3.subjects.CompletableSubject; public class CompletableSwitchOnNextTest extends RxJavaTest { @Test public void normal() { Runnable run = mock(Runnable.class); Completable.switchOnNext( Flowable.range(1, 10) .map(v -> { if (v % 2 == 0) { return Completable.fromRunnable(run); } return Completable.complete(); }) ) .test() .assertResult(); verify(run, times(5)).run(); } @Test public void normalDelayError() { Runnable run = mock(Runnable.class); Completable.switchOnNextDelayError( Flowable.range(1, 10) .map(v -> { if (v % 2 == 0) { return Completable.fromRunnable(run); } return Completable.complete(); }) ) .test() .assertResult(); verify(run, times(5)).run(); } @Test public void noDelaySwitch() { PublishProcessor<Completable> pp = PublishProcessor.create(); TestObserver<Void> to = Completable.switchOnNext(pp).test(); assertTrue(pp.hasSubscribers()); to.assertEmpty(); CompletableSubject cs1 = CompletableSubject.create(); CompletableSubject cs2 = CompletableSubject.create(); pp.onNext(cs1); assertTrue(cs1.hasObservers()); pp.onNext(cs2); assertFalse(cs1.hasObservers()); assertTrue(cs2.hasObservers()); pp.onComplete(); assertTrue(cs2.hasObservers()); cs2.onComplete(); to.assertResult(); } @Test public void delaySwitch() { PublishProcessor<Completable> pp = PublishProcessor.create(); TestObserver<Void> to = Completable.switchOnNextDelayError(pp).test(); assertTrue(pp.hasSubscribers()); to.assertEmpty(); CompletableSubject cs1 = CompletableSubject.create(); CompletableSubject cs2 = CompletableSubject.create(); pp.onNext(cs1); assertTrue(cs1.hasObservers()); pp.onNext(cs2); assertFalse(cs1.hasObservers()); assertTrue(cs2.hasObservers()); assertTrue(cs2.hasObservers()); cs2.onError(new TestException()); assertTrue(pp.hasSubscribers()); to.assertEmpty(); pp.onComplete(); to.assertFailure(TestException.class); } }
Java
3
Jawnnypoo/RxJava
src/test/java/io/reactivex/rxjava3/internal/operators/completable/CompletableSwitchOnNextTest.java
[ "Apache-2.0" ]
theory HoareTripleForInstructions imports Main "./Hoare" begin (** ** Hoare Triple for each instruction **) lemmas as_set_simps = memory_as_set_def storage_as_set_def log_as_set_def balance_as_set_def next_state_def contract_action_as_set_def stack_as_set_def ext_program_as_set_def program_as_set_def constant_ctx_as_set_def variable_ctx_as_set_def contexts_as_set_def account_existence_as_set_def instruction_result_as_set_def lemma continuing_not_context[simp]: "ContinuingElm b \<notin> contexts_as_set x32 co_ctx" by (simp add: as_set_simps) lemma caller_elm_means: " (CallerElm x12 \<in> variable_ctx_as_set v) = (x12 = vctx_caller v)" by (simp add: as_set_simps) lemma lst_longer [dest!]: "length l = Suc h \<Longrightarrow> \<exists> a t. l = a # t \<and> length t = h" by (simp add: length_Suc_conv) lemma rev_append : "(rev l ! a \<noteq> (rev l @ l') ! a) = ((a \<ge> length l) \<and> (rev l) ! a \<noteq> l' ! (a - length l))" apply(simp add: nth_append) done lemma rev_append_inv : "((rev l @ l') ! a \<noteq> rev l ! a) = ((a \<ge> length l) \<and> (rev l) ! a \<noteq> l' ! (a - length l))" apply(auto simp add: nth_append) done lemma rev_rev_append : "((rev l @ a0) ! idx \<noteq> (rev l @ a1) ! idx) = (idx \<ge> length l \<and> a0 ! (idx - length l) \<noteq> a1 ! (idx - length l))" apply(auto simp add: nth_append) done lemma over_one : "length lst = a \<Longrightarrow> (rev lst @ (v # l)) ! a = v" apply(simp add: nth_append) done lemma over_one_rev : "((rev l @ (w # x)) ! idx \<noteq> w) = (idx < (length l) \<and> (rev l) ! idx \<noteq> w ) \<or> ( idx > (length l) \<and> x ! (idx - length l - 1) \<noteq> w)" apply(simp add: nth_append) by (simp add: nth_Cons') lemma over_one_rev' : "((rev l @ [w, v]) ! idx \<noteq> w) = (idx < (length l) \<and> (rev l) ! idx \<noteq> w ) \<or> ( idx > (length l) \<and> [v] ! (idx - length l - 1) \<noteq> w)" apply(auto simp add: nth_append nth_Cons') done lemma over_two : "Suc (length lst) = a \<Longrightarrow> (rev lst @ (v # w # l)) ! a = w" apply(simp add: nth_append) done lemma over_two_rev : "((rev l @ (w # v # x)) ! idx \<noteq> v) = (idx \<le> (length l) \<and> (rev l @ [w]) ! idx \<noteq> v ) \<or> ( idx > Suc (length l) \<and> x ! (idx - length l - 2) \<noteq> v )" apply(simp add: nth_append) (* sledgehammer *) by (metis Suc_diff_Suc diff_self_eq_0 less_antisym linorder_neqE_nat nth_Cons_0 nth_Cons_Suc) lemma rev_append_look_up : "(rev ta @ lst) ! pos = val = ((pos < length ta \<and> rev ta ! pos = val) \<or> (length ta \<le> pos \<and> lst ! (pos - length ta) = val))" apply (simp add: nth_append) done lemmas rev_nth_simps = (* lookup_over lookup_over1 short_match*) rev_append rev_append_inv rev_rev_append over_one over_one_rev over_one_rev' over_two over_two_rev rev_append_look_up lemma advance_pc_advance: " vctx_next_instruction x1 co_ctx = Some i \<Longrightarrow> inst_size i = 1 \<Longrightarrow> vctx_pc (vctx_advance_pc co_ctx x1) = vctx_pc x1 + 1" apply(simp add: vctx_advance_pc_def) done lemma advance_pc_no_gas_change: "vctx_gas (vctx_advance_pc co_ctx x1) = vctx_gas x1" apply(simp add: vctx_advance_pc_def) done lemma constant_diff_stack_height: "constant_ctx_as_set co_ctx - {StackHeightElm h} = constant_ctx_as_set co_ctx" by (auto simp add: as_set_simps) lemma constant_diff_stack : "constant_ctx_as_set co_ctx - {StackElm s} = constant_ctx_as_set co_ctx" by (auto simp add: as_set_simps) lemma constant_diff_pc : "constant_ctx_as_set co_ctx - {PcElm p} = constant_ctx_as_set co_ctx" by (auto simp add: as_set_simps) lemma constant_diff_gas: "constant_ctx_as_set co_ctx - {GasElm g} = constant_ctx_as_set co_ctx" by (auto simp add: as_set_simps) lemma stack_height_element_means: "(StackHeightElm h \<in> variable_ctx_as_set v) = (length (vctx_stack v) = h) " by (auto simp add: as_set_simps) lemma stack_element_means: "(StackElm pw \<in> variable_ctx_as_set v) = (rev (vctx_stack v) ! (fst pw) = (snd pw) \<and> (fst pw) < length (vctx_stack v))" by (case_tac pw; auto simp: as_set_simps) lemma stack_element_notin_means: "(StackElm pw \<notin> variable_ctx_as_set v) = (rev (vctx_stack v) ! (fst pw) \<noteq> (snd pw) \<or> (fst pw) \<ge> length (vctx_stack v))" by (case_tac pw; auto simp: as_set_simps) lemma storage_element_means : "StorageElm idxw \<in> variable_ctx_as_set v = (vctx_storage v (fst idxw) = (snd idxw))" by (case_tac idxw; auto simp: as_set_simps) lemma memory_element_means: "MemoryElm addrw \<in> variable_ctx_as_set v = (vctx_memory v (fst addrw) = snd addrw)" by (case_tac addrw; auto simp: as_set_simps) lemma memory_usage_element_means: "MemoryUsageElm m \<in> variable_ctx_as_set v = (vctx_memory_usage v = m)" by (auto simp: as_set_simps) lemma balance_all: "P \<in> balance_as_set b \<Longrightarrow> P \<in> range BalanceElm" by (fastforce simp add: balance_as_set_def) lemma not_balance_all: "p \<notin> range BalanceElm \<Longrightarrow> p \<notin> balance_as_set b" by (fastforce simp add: balance_as_set_def) lemma pc_not_balance: "PcElm p \<notin> balance_as_set b" apply(simp add: balance_as_set_def) done lemma pc_element_means: "(PcElm p \<in> variable_ctx_as_set v) = (vctx_pc v = p)" by (auto simp: as_set_simps) lemma gas_element_means: "(GasElm g \<in> variable_ctx_as_set v) = (vctx_gas v = g)" by (auto simp: as_set_simps) lemma log_element_means: "(LogElm p \<in> variable_ctx_as_set v) = (rev (vctx_logs v) ! (fst p) = (snd p) \<and> fst p < length (vctx_logs v))" by (case_tac p; auto simp: as_set_simps) lemma code_element_means: "(CodeElm xy \<in> constant_ctx_as_set c) = (program_content (cctx_program c) (fst xy) = Some (snd xy) \<or> program_content (cctx_program c) (fst xy) = None \<and> (snd xy) = Misc STOP)" by (case_tac xy; auto simp: as_set_simps) lemma origin_element_means: "(OriginElm orig \<in> variable_ctx_as_set v) = (orig = vctx_origin v)" by (auto simp: as_set_simps) lemma sent_value_means: "SentValueElm x14 \<in> variable_ctx_as_set x1 = (x14 = vctx_value_sent x1)" by (auto simp: as_set_simps) lemma sent_data_means: "SentDataElm p \<in> variable_ctx_as_set x1 = (p = vctx_data_sent x1)" by (case_tac p; auto simp: as_set_simps) lemma block_number_elm_c_means : "BlockNumberElm x22 \<in> contexts_as_set x1 co_ctx = (x22 = block_number (vctx_block x1))" by (simp add: as_set_simps) lemma balance_elm_means : "BalanceElm p \<in> variable_ctx_as_set v = (vctx_balance v (fst p) = (snd p))" by (case_tac p; auto simp: as_set_simps) lemma stack_as_set_cons_means: "x \<in> stack_as_set (w # lst) = (x = StackHeightElm (Suc (length lst)) \<or> x = StackElm (length lst, w) \<or> x \<in> stack_as_set lst - {StackHeightElm (length lst)})" by (auto simp add: as_set_simps rev_nth_simps) lemma ext_program_size_elm_means : "ExtProgramSizeElm ab \<in> variable_ctx_as_set v = (program_length (vctx_ext_program v (fst ab)) = snd ab)" apply(auto simp add: as_set_simps) apply(case_tac ab; auto) done lemma ext_program_size_c_means : "ExtProgramSizeElm ab \<in> contexts_as_set v co_ctx = (program_length (vctx_ext_program v (fst ab)) = snd ab)" apply (rule iffI) apply(clarsimp simp add: as_set_simps )+ apply (rule exI[where x="(fst ab)"]) apply clarsimp done lemma ext_program_elm_means : "ExtProgramElm abc \<in> variable_ctx_as_set v = (program_as_natural_map ((vctx_ext_program v) (fst abc)) (fst (snd abc)) = (snd (snd abc)))" apply(case_tac abc ; auto simp add: as_set_simps) done lemma ext_program_c_means : "ExtProgramElm abc \<in> contexts_as_set v co_ctx = (program_as_natural_map ((vctx_ext_program v) (fst abc)) (fst (snd abc)) = (snd (snd abc)))" by(case_tac abc, auto simp add: as_set_simps) lemma blockhash_elm_means : "BlockhashElm ab \<in> variable_ctx_as_set x1 = (block_blockhash (vctx_block x1) (fst ab) = snd ab)" by(case_tac ab; auto simp add: as_set_simps vctx_advance_pc_def) lemma blockhash_c_means : "BlockhashElm ab \<in> contexts_as_set x1 co_ctx = (block_blockhash (vctx_block x1) (fst ab) = snd ab)" by(case_tac ab; auto simp add: as_set_simps vctx_advance_pc_def) lemma coinbase_elm_means : "CoinbaseElm v \<in> variable_ctx_as_set x2 = ((block_coinbase (vctx_block x2)) = v)" by(case_tac v; auto simp add: as_set_simps) lemma coinbase_c_means : "CoinbaseElm x23 \<in> contexts_as_set x1 co_ctx = (block_coinbase (vctx_block x1) = x23)" by (auto simp add: as_set_simps) lemma timestamp_elm_means : "TimestampElm t \<in> variable_ctx_as_set x1 = (t = block_timestamp (vctx_block x1))" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma timestamp_c_means : "TimestampElm t \<in> contexts_as_set x1 co_ctx = (t = block_timestamp (vctx_block x1))" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma difficulty_elm_means : "DifficultyElm x24 \<in> variable_ctx_as_set x1 = (x24 = block_difficulty (vctx_block x1))" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma difficulty_c_means : "DifficultyElm x24 \<in> contexts_as_set x1 co_ctx = (x24 = block_difficulty (vctx_block x1))" by (auto simp add: as_set_simps vctx_advance_pc_def) lemmas stateelm_basic_means_simps = stack_height_element_means stack_element_means stack_element_notin_means storage_element_means memory_element_means pc_not_balance pc_element_means gas_element_means log_element_means memory_usage_element_means code_element_means origin_element_means sent_value_means sent_data_means caller_elm_means block_number_elm_c_means balance_elm_means stack_as_set_cons_means ext_program_size_elm_means ext_program_size_c_means ext_program_elm_means ext_program_c_means blockhash_elm_means blockhash_c_means coinbase_elm_means coinbase_c_means timestamp_elm_means timestamp_c_means difficulty_elm_means difficulty_c_means lemma inst_size_nonzero[simp]: "inst_size a \<noteq> 0" apply(simp add: inst_size_def) apply(case_tac a; auto simp add: inst_code.simps dup_inst_code_def) apply(rename_tac s) apply(case_tac s; simp add: stack_inst_code.simps) apply(rename_tac l) apply(case_tac l; simp) apply(split if_splits; auto) done lemma advance_pc_different[simp]: "vctx_pc (vctx_advance_pc co_ctx x1) \<noteq> vctx_pc x1" apply(simp add: vctx_advance_pc_def) apply(case_tac "vctx_next_instruction x1 co_ctx"; auto) done lemma stateelm_program_all: "P \<in> program_as_set ctx \<Longrightarrow> P \<in> range CodeElm" by (auto simp add: program_as_set_def) lemma stateelm_not_program_all: "P \<notin> range CodeElm \<Longrightarrow> P \<notin> program_as_set ctx" by (auto simp add: program_as_set_def) lemma stack_elm_not_program: "StackElm x2 \<notin> program_as_set (cctx_program co_ctx)" apply(simp add: program_as_set_def) done lemma stack_elm_not_constant: "StackElm x2 \<notin> constant_ctx_as_set co_ctx" apply(simp add: as_set_simps) done lemma storage_elm_not_constant: "StorageElm x \<notin> constant_ctx_as_set c" apply(simp add: constant_ctx_as_set_def) apply(simp add: program_as_set_def) done lemma stack_height_elm_not_constant: "StackHeightElm h \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma memory_elm_not_constant : "MemoryElm m \<notin> constant_ctx_as_set c" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma memory_usage_elm_not_constant : "MemoryUsageElm m \<notin> constant_ctx_as_set c" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma pc_elm_not_constant: "PcElm x \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma gas_elm_not_constant : "GasElm x \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma contract_action_elm_not_constant: "ContractActionElm a \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma code_elm_not_variable[simp] : "CodeElm c \<notin> variable_ctx_as_set v" by (auto simp: as_set_simps) lemma this_account_elm_not_variable [simp]: "ThisAccountElm t \<notin> variable_ctx_as_set v" by (auto simp: as_set_simps) lemma advance_pc_preserves_storage : "vctx_storage (vctx_advance_pc co_ctx x1) = vctx_storage x1" by(simp add: vctx_advance_pc_def) lemma advance_pc_preserves_memory: "vctx_memory (vctx_advance_pc co_ctx x1) = vctx_memory x1" by(simp add: vctx_advance_pc_def) lemma advance_pc_preserves_logs : "vctx_logs (vctx_advance_pc co_ctx x1) = vctx_logs x1" by(simp add: vctx_advance_pc_def) lemma advance_pc_preserves_memory_usage : "vctx_memory_usage (vctx_advance_pc co_ctx x1) = vctx_memory_usage x1" by(simp add: vctx_advance_pc_def) lemma advance_pc_preserves_balance : "vctx_balance (vctx_advance_pc co_ctx x1) = vctx_balance x1" by(simp add: vctx_advance_pc_def) lemma advance_pc_preserves_caller : "vctx_caller (vctx_advance_pc co_ctx x1) = vctx_caller x1" by(simp add: vctx_advance_pc_def) lemma advance_pc_preserves_value_sent : "vctx_value_sent (vctx_advance_pc co_ctx x1) = vctx_value_sent x1" by(simp add: vctx_advance_pc_def) lemma advance_pc_preserves_origin : " vctx_origin (vctx_advance_pc co_ctx x1) = vctx_origin x1" by(simp add: vctx_advance_pc_def) lemma advance_pc_preserves_block : " vctx_block (vctx_advance_pc co_ctx x1) = vctx_block x1" by(simp add: vctx_advance_pc_def) lemma advance_pc_keeps_stack : "(vctx_stack (vctx_advance_pc co_ctx v)) = vctx_stack v" by(simp add: vctx_advance_pc_def) lemma advance_pc_change: "vctx_pc x1 \<noteq> vctx_pc (vctx_advance_pc co_ctx x1)" by (metis advance_pc_different) lemma caller_sep: "(caller c ** rest) s = (CallerElm c \<in> s \<and> rest (s - {CallerElm c}))" by (solve_sep_iff simp: caller_def) lemma sep_caller: "(rest ** caller c) s = (CallerElm c \<in> s \<and> rest (s - {CallerElm c}))" by (solve_sep_iff simp: caller_def) lemma sep_caller_sep: "(a ** caller c ** rest) s = (CallerElm c \<in> s \<and> (a ** rest) (s - {CallerElm c}))" (is "?L = ?R") proof - have "?L = (caller c ** a ** rest) s" by (metis sep_conj_assoc sep_conj_commute) moreover have "(caller c ** a ** rest) s = ?R" by (rule caller_sep) ultimately show ?thesis by auto qed lemma balance_sep : "(balance a b ** rest) s = (BalanceElm (a, b) \<in> s \<and> rest (s - {BalanceElm (a, b)}))" by (solve_sep_iff simp: balance_def) lemma sep_balance : "(rest ** balance a b) s = (BalanceElm (a, b) \<in> s \<and> rest (s - {BalanceElm (a, b)}))" by (solve_sep_iff simp: balance_def) lemma sep_balance_sep : "(q ** balance a b ** rest) s = (BalanceElm (a, b) \<in> s \<and> (q ** rest) (s - {BalanceElm (a, b)}))" (is "?L = ?R") proof - have "?L = (balance a b ** q ** rest) s" by (metis sep_conj_assoc sep_conj_commute) moreover have "(balance a b ** q ** rest) s = ?R" by (rule balance_sep) ultimately show ?thesis by auto qed lemma Gverylow_positive[simp] : "Gverylow > 0" apply(simp add: Gverylow_def) done lemma saying_zero : "(x - Suc 0 < x) = (x \<noteq> 0)" apply(case_tac x; auto) done lemma inst_size_pop: "inst_size (Stack POP) = 1" apply(simp add: inst_code.simps inst_size_def stack_inst_code.simps) done lemma pop_advance: "program_content (cctx_program co_ctx) (vctx_pc x1) = Some (Stack POP) \<Longrightarrow> vctx_pc (vctx_advance_pc co_ctx x1) = vctx_pc x1 + 1" apply(simp add: vctx_advance_pc_def vctx_next_instruction_def inst_size_pop) done lemma advance_pc_as_set: "program_content (cctx_program co_ctx) (vctx_pc v) = Some (Stack POP) \<Longrightarrow> (contexts_as_set (vctx_advance_pc co_ctx v) co_ctx) = (contexts_as_set v co_ctx) \<union> {PcElm (vctx_pc v + 1)} - {PcElm (vctx_pc v)}" by (auto simp add: memory_usage_element_means as_set_simps vctx_next_instruction_def pop_advance advance_pc_preserves_memory_usage vctx_advance_pc_def inst_size_pop ) lemma gas_change_as_set: "(contexts_as_set (x1\<lparr>vctx_gas := new_gas\<rparr>) co_ctx) = ((contexts_as_set x1 co_ctx - {GasElm (vctx_gas x1) }) \<union> { GasElm new_gas } )" by (auto simp add: as_set_simps) lemma stack_change_as_set: "(contexts_as_set (v\<lparr>vctx_stack := t\<rparr>) co_ctx) = (contexts_as_set v co_ctx - stack_as_set (vctx_stack v)) \<union> stack_as_set t " by (auto simp add: as_set_simps) lemma stack_height_in[simp]: "StackHeightElm (length t) \<in> stack_as_set t" by(simp add: stack_as_set_def) lemma pc_not_stack : "PcElm k \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma code_not_stack : "CodeElm p \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma action_not_context[simp]: "ContractActionElm a \<notin> contexts_as_set x1 co_ctx" by (simp add: as_set_simps) lemma failed_is_failed[simp]: "failed_for_reasons {OutOfGas} (InstructionToEnvironment (ContractFail [OutOfGas]) a b)" apply(simp add: failed_for_reasons_def) done lemma stack_height_increment[simp]: "StackHeightElm (Suc (length lst)) \<in> stack_as_set (x # lst)" apply(simp add: stack_as_set_def) done lemma stack_inc_element [simp] : "StackElm (length lst, elm) \<in> stack_as_set (elm # lst)" by (simp add: as_set_simps nth_append) lemma caller_elm_means_c: "(CallerElm c \<in> contexts_as_set x1 co_ctx) = (vctx_caller x1 = c)" by (auto simp add: as_set_simps) lemma continue_not_failed[simp] : "\<not> failed_for_reasons {OutOfGas} (InstructionContinue v)" apply(simp add: failed_for_reasons_def) done lemma info_single_advance: "program_content (cctx_program co_ctx) (vctx_pc x1) = Some (Info i) \<Longrightarrow> vctx_pc (vctx_advance_pc co_ctx x1) = vctx_pc x1 + 1" apply(simp add: vctx_advance_pc_def vctx_next_instruction_def inst_size_def inst_code.simps) done lemma caller_not_stack : "CallerElm c \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma advance_keeps_storage_elm: "StorageElm ab \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (StorageElm ab \<in> contexts_as_set x1 co_ctx)" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma advance_keeps_memory_elm: "MemoryElm ab \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (MemoryElm ab \<in> contexts_as_set x1 co_ctx)" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma advance_keeps_log_elm: "LogElm ab \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (LogElm ab \<in> contexts_as_set x1 co_ctx)" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma advance_keeps_memory_usage_elm: "MemoryUsageElm x8 \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (MemoryUsageElm x8 \<in> contexts_as_set x1 co_ctx)" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma advance_keeps_this_account_elm: "ThisAccountElm x10 \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (ThisAccountElm x10 \<in> contexts_as_set x1 co_ctx)" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma advance_keeps_balance_elm: "BalanceElm ab \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (BalanceElm ab \<in> contexts_as_set x1 co_ctx)" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma advance_keeps_origin_elm: "OriginElm x13 \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (OriginElm x13 \<in> contexts_as_set x1 co_ctx)" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma advance_keeps_sent_value_elm: "SentValueElm x14 \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (SentValueElm x14 \<in> contexts_as_set x1 co_ctx)" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma data_sent_advance_pc: "vctx_data_sent (vctx_advance_pc co_ctx x1) = vctx_data_sent x1" by (auto simp add: vctx_advance_pc_def) lemma advance_keeps_sent_data_elm : "SentDataElm ab \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (SentDataElm ab \<in> contexts_as_set x1 co_ctx) " by(simp add: as_set_simps vctx_advance_pc_def) lemma ext_program_size_not_constant: "ExtProgramSizeElm ab \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma ext_program_advance_pc : " vctx_ext_program (vctx_advance_pc co_ctx x1) = vctx_ext_program x1" apply(simp add: vctx_advance_pc_def balance_as_set_def) done lemma advance_keeps_ext_program_size_elm: "ExtProgramSizeElm ab \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (ExtProgramSizeElm ab \<in> contexts_as_set x1 co_ctx)" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma ext_program_elm_not_constant : "ExtProgramElm abc \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma advance_keeps_ext_program_elm : "ExtProgramElm abc \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (ExtProgramElm abc \<in> contexts_as_set x1 co_ctx)" by(auto simp add: as_set_simps vctx_advance_pc_def) lemma blockhash_not_constant: "BlockhashElm ab \<notin> constant_ctx_as_set co_ctx" by(auto simp add: as_set_simps vctx_advance_pc_def) lemma advance_keeps_blockhash_elm : "BlockhashElm ab \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (BlockhashElm ab \<in> contexts_as_set x1 co_ctx)" by(auto simp add: as_set_simps vctx_advance_pc_def) lemma coinbase_elm_not_constant : "CoinbaseElm v \<notin> constant_ctx_as_set co_ctx" by(case_tac v; auto simp add: as_set_simps vctx_advance_pc_def) lemma advance_keeps_conbase_elm : "CoinbaseElm x22 \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (CoinbaseElm x22 \<in> contexts_as_set x1 co_ctx)" by (auto simp add:as_set_simps vctx_advance_pc_def) lemma timestamp_not_constant : "TimestampElm t \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma advance_keeps_timestamp_elm : "TimestampElm t \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (TimestampElm t \<in> contexts_as_set x1 co_ctx)" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma difficulty_not_constant : "DifficultyElm x24 \<notin> constant_ctx_as_set co_ctx" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma advance_keeps_difficulty_elm: "DifficultyElm x24 \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (DifficultyElm x24 \<in> contexts_as_set x1 co_ctx)" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma gaslimit_not_constant: "GaslimitElm x25 \<notin> constant_ctx_as_set co_ctx" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma gaslimit_elm_means : "GaslimitElm x25 \<in> variable_ctx_as_set x1 = (x25 = block_gaslimit (vctx_block x1))" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma gaslimit_elm_c : "GaslimitElm x25 \<in> contexts_as_set x1 co_ctx = (x25 = block_gaslimit (vctx_block x1))" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma advance_keeps_gaslimit_elm : "GaslimitElm x25 \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (GaslimitElm x25 \<in> contexts_as_set x1 co_ctx)" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma gasprice_not_constant : "GaspriceElm x26 \<notin> constant_ctx_as_set co_ctx" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma advance_keeps_gasprice [simp] : "vctx_gasprice (vctx_advance_pc co_ctx x1) = vctx_gasprice x1" by(simp add: vctx_advance_pc_def) lemma gasprice_elm_means : "GaspriceElm x26 \<in> variable_ctx_as_set x1 = (x26 = vctx_gasprice x1)" by (auto simp add: as_set_simps ) lemma gasprice_c_means : "GaspriceElm x26 \<in> contexts_as_set x1 co_ctx = (x26 = vctx_gasprice x1)" by (auto simp add: as_set_simps) lemma advance_keeps_gasprice_elm: "GaspriceElm x26 \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (GaspriceElm x26 \<in> contexts_as_set x1 co_ctx)" by (auto simp add: as_set_simps vctx_advance_pc_def) lemma stackheight_different: " StackHeightElm len \<in> stack_as_set lst = (len = length lst) " apply(simp add: stack_as_set_def) done lemma stack_element_in_stack : "StackElm ab \<in> stack_as_set lst = ((fst ab) < length lst \<and> rev lst ! (fst ab) = snd ab)" apply(case_tac ab; auto simp add: stack_as_set_def) done lemma storage_not_stack : "StorageElm ab \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma memory_not_stack : "MemoryElm ab \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma log_not_stack : "LogElm ab \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma gas_not_stack : "GasElm x7 \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma memory_usage_not_stack : "MemoryUsageElm x8 \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma this_account_not_stack : "ThisAccountElm x10 \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma balance_not_stack: "BalanceElm ab \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma code_elm_means: "CodeElm xy \<in> instruction_result_as_set c (InstructionContinue x1) = (program_content (cctx_program c) (fst xy) = Some (snd xy) \<or> program_content (cctx_program c) (fst xy) = None \<and> (snd xy) = Misc STOP) " by (case_tac xy, auto simp add: as_set_simps vctx_advance_pc_def instruction_result_as_set_def) lemma pc_elm_means: "PcElm k \<in> instruction_result_as_set co_ctx (InstructionContinue x1) = (k = vctx_pc x1)" by (auto simp add: as_set_simps vctx_advance_pc_def instruction_result_as_set_def) lemma memory_usage_elm_means: "MemoryUsageElm k \<in> instruction_result_as_set co_ctx (InstructionContinue x1) = (k = vctx_memory_usage x1)" by (auto simp add: as_set_simps vctx_advance_pc_def instruction_result_as_set_def) lemma block_number_pred_sep: "(block_number_pred bn ** rest) s = ((BlockNumberElm bn \<in> s) \<and> rest (s - {BlockNumberElm bn}))" by (solve_sep_iff simp: block_number_pred_def) lemma sep_block_number_pred_sep: "(rest ** block_number_pred bn ** a) s = ((BlockNumberElm bn \<in> s) \<and> (rest ** a) (s - {BlockNumberElm bn}))" apply (rule iffI) apply (sep_select_asm 2) apply (subst (asm) block_number_pred_sep, simp) apply (sep_select 2) apply (subst block_number_pred_sep, simp) done lemma block_number_elm_not_constant: "BlockNumberElm bn \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma block_number_elm_in_v_means: "BlockNumberElm bn \<in> variable_ctx_as_set v = ( bn = block_number (vctx_block v) )" by ( auto simp add: as_set_simps ) lemma block_number_elm_means: "BlockNumberElm bn \<in> instruction_result_as_set co_ctx (InstructionContinue v) = ( bn = block_number (vctx_block v) )" by (simp add: instruction_result_as_set_def as_set_simps) lemma stack_heigh_elm_means : "StackHeightElm h \<in> instruction_result_as_set co_ctx (InstructionContinue x1) = (length (vctx_stack x1) = h)" apply(auto simp add: instruction_result_as_set_def as_set_simps) done lemma stack_elm_means : "StackElm ha \<in> instruction_result_as_set co_ctx (InstructionContinue v) = (fst ha < length (vctx_stack v) \<and> rev (vctx_stack v) ! fst ha = snd ha)" apply(case_tac ha, auto simp add: instruction_result_as_set_def as_set_simps) done lemma balance_not_constant: "BalanceElm ab \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma balance_elm_i_means : "BalanceElm ab \<in> instruction_result_as_set co_ctx (InstructionContinue x1) = (vctx_balance x1 (fst ab) = (snd ab)) " apply(case_tac ab, auto simp add: instruction_result_as_set_def as_set_simps) done lemma gas_elm_i_means : "GasElm g \<in> instruction_result_as_set co_ctx (InstructionContinue x1) = (vctx_gas x1 = g)" apply(auto simp add: instruction_result_as_set_def as_set_simps) done lemma continuing_continuing[simp]: "ContinuingElm True \<in> instruction_result_as_set co_ctx (InstructionContinue x1)" apply(simp add: instruction_result_as_set_def) done lemma stack_all: "P \<in> stack_as_set lst \<Longrightarrow> P \<in> range StackElm \<union> range StackHeightElm" by (induction lst ; auto simp add:as_set_simps) lemma not_stack_all: "P \<notin> range StackElm \<union> range StackHeightElm \<Longrightarrow> P \<notin> stack_as_set lst" by (induction lst ; auto simp add:as_set_simps) lemma origin_not_stack : "OriginElm x13 \<notin> stack_as_set lst" by (auto dest: stack_all) lemma sent_value_not_stack : "SentValueElm x14 \<notin> stack_as_set lst" by (auto dest: stack_all) lemma ext_program_not_stack: "ExtProgramElm a \<notin> stack_as_set lst" by (auto dest: stack_all) lemma sent_data_not_stack : "SentDataElm ab \<notin> stack_as_set lst" by (auto dest: stack_all) lemma contract_action_elm_not_stack : "ContractActionElm x19 \<notin> stack_as_set lst" by (auto dest: stack_all) lemma log_num_v_advance : "LogNumElm x6 \<in> variable_ctx_as_set (vctx_advance_pc co_ctx x1) = (LogNumElm x6 \<in> variable_ctx_as_set x1)" by(simp add: as_set_simps vctx_advance_pc_def) lemma log_num_advance : "LogNumElm x6 \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (LogNumElm x6 \<in> contexts_as_set x1 co_ctx)" apply(simp add: as_set_simps vctx_advance_pc_def) done lemma account_existence_not_in_constant [simp] : "AccountExistenceElm p \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma account_existence_not_in_stack : "AccountExistenceElm p \<notin> stack_as_set (vctx_stack x1)" apply(simp add: stack_as_set_def) done lemma account_existence_not_in_balance : "AccountExistenceElm p \<notin> balance_as_set (vctx_balance x1)" apply(simp add: balance_as_set_def) done lemma account_existence_not_ext : "AccountExistenceElm p \<notin> ext_program_as_set (vctx_ext_program x1)" apply(simp add: ext_program_as_set_def) done lemma account_existence_elm_means : "AccountExistenceElm p \<in> variable_ctx_as_set x = (vctx_account_existence x (fst p) = snd p)" by (case_tac p, auto simp add: as_set_simps vctx_advance_pc_def instruction_result_as_set_def) lemma account_existence_elm_means_c : "AccountExistenceElm p \<in> contexts_as_set x c = (vctx_account_existence x (fst p) = snd p)" by (case_tac p, auto simp add: as_set_simps) lemma account_existence_advance : "AccountExistenceElm (aa, x) \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (AccountExistenceElm (aa, x) \<in> contexts_as_set x1 co_ctx)" by(simp add: as_set_simps vctx_advance_pc_def) lemma account_existence_advance_v : "vctx_account_existence (vctx_advance_pc co_ctx x1) aa = (vctx_account_existence x1 aa)" apply(simp add: vctx_advance_pc_def) done lemma prog_content_vctx_next_instruction: "program_content (cctx_program y) (vctx_pc x) = Some v \<Longrightarrow> vctx_next_instruction x y = Some v" by (simp add: vctx_next_instruction_def split: option.split) lemma inst_size_eq_1: "\<forall>x. inst \<noteq> Stack (PUSH_N x) \<Longrightarrow> inst_size inst = 1" apply (case_tac inst; simp add: inst_size_def inst_code.simps) apply (rename_tac x) apply (case_tac x ;fastforce simp add: stack_inst_code.simps) done lemma inst_size_no_stack_eq_1[simplified image_def, simp]: "inst \<notin> (Stack ` range PUSH_N) \<Longrightarrow> inst_size inst = 1" "inst \<notin> range Stack \<Longrightarrow> inst_size inst = 1" by (auto intro: inst_size_eq_1) lemma advance_pc_no_inst: "vctx_pc (vctx_advance_pc co_ctx x1) = vctx_pc x1 \<Longrightarrow> program_content (cctx_program co_ctx) (vctx_pc x1) = None" by (simp add: vctx_advance_pc_def vctx_next_instruction_def split:option.splits) lemma advance_pc_inc_but_stack : "program_content (cctx_program co_ctx) (vctx_pc x) = Some inst \<Longrightarrow> inst \<notin> range Stack\<Longrightarrow> vctx_pc (vctx_advance_pc co_ctx x) = vctx_pc x + 1" by (case_tac inst; simp add: vctx_next_instruction_def vctx_advance_pc_def inst_size_def inst_code.simps) lemmas advance_pc_simps = advance_pc_preserves_storage advance_pc_preserves_memory advance_pc_preserves_balance ext_program_advance_pc advance_pc_no_gas_change advance_pc_preserves_memory_usage advance_pc_keeps_stack data_sent_advance_pc advance_pc_preserves_logs advance_pc_preserves_value_sent advance_pc_preserves_caller advance_pc_preserves_origin advance_pc_preserves_block (* advance_pc_no_inst *) (* advance_pc_inc_but_stack *) log_num_v_advance log_num_advance advance_keeps_balance_elm advance_keeps_blockhash_elm advance_keeps_conbase_elm advance_keeps_difficulty_elm advance_keeps_ext_program_elm advance_keeps_ext_program_size_elm advance_keeps_gaslimit_elm advance_keeps_gasprice_elm advance_keeps_log_elm advance_keeps_memory_elm advance_keeps_memory_usage_elm advance_keeps_origin_elm advance_keeps_sent_data_elm advance_keeps_sent_value_elm advance_keeps_storage_elm advance_keeps_this_account_elm advance_keeps_timestamp_elm account_existence_advance (*pop_advance *) account_existence_advance_v lemma balance0 : notes rev_nth_simps[simp] shows "length list = h \<Longrightarrow> vctx_stack x1 = a # list \<Longrightarrow> vctx_gas x1 = g \<Longrightarrow> program_content (cctx_program co_ctx) (vctx_pc x1) = Some (Info BALANCE) \<Longrightarrow> (instruction_result_as_set co_ctx (InstructionContinue (vctx_advance_pc co_ctx x1\<lparr>vctx_stack := b # list, vctx_gas := g - 400\<rparr>)) - {BlockNumberElm (block_number (vctx_block x1))} - {StackHeightElm (Suc h)} - {StackElm (h, b)} - {PcElm (vctx_pc x1 + 1)} - {BalanceElm (ucast a, b)} - {GasElm (g - 400)} - {ContinuingElm True} - {CodeElm (vctx_pc x1, Info BALANCE)}) = (instruction_result_as_set co_ctx (InstructionContinue x1) - {BlockNumberElm (block_number (vctx_block x1))} - {StackHeightElm (Suc h)} - {StackElm (h, a)} - {PcElm (vctx_pc x1)} - {BalanceElm (ucast a, b)} - {GasElm g} - {ContinuingElm True} - {CodeElm (vctx_pc x1, Info BALANCE)})" apply(auto simp: set_diff_eq) apply(rename_tac elm; case_tac elm; auto simp add: instruction_result_as_set_def as_set_simps vctx_advance_pc_def prog_content_vctx_next_instruction inst_size_eq_1) apply (simp add: instruction_result_as_set_def stateelm_equiv_simps advance_pc_simps)+ apply(rename_tac elm; case_tac elm; auto simp add: instruction_result_as_set_def stack_as_set_def balance_as_set_def stateelm_equiv_simps vctx_advance_pc_def vctx_next_instruction_def) apply (clarsimp simp add: contexts_as_set_def variable_ctx_as_set_def stack_as_set_def )+ apply (simp add: instruction_result_as_set_def stateelm_equiv_simps )+ done lemma ext_program_size_elm_not_stack: "ExtProgramSizeElm ab \<notin> stack_as_set (1 # ta)" apply(simp add: stack_as_set_def) done lemma continuing_not_stack: "ContinuingElm b \<notin> stack_as_set lst" apply(simp add: stack_as_set_def) done lemma block_hash_not_stack: "BlockhashElm ab \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma block_number_not_stack: "BlockNumberElm x22 \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma coinbase_not_stack: "CoinbaseElm x23 \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma timestamp_not_stack: "TimestampElm x24 \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma difficulty_not_stack: "DifficultyElm k \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma gaslimit_not_stack: "GaslimitElm x26 \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma gasprice_not_stack: "GaspriceElm a \<notin> stack_as_set s" apply(simp add: stack_as_set_def) done lemma ext_program_size_not_stack: "ExtProgramSizeElm p \<notin> stack_as_set lst" apply(simp add: stack_as_set_def) done lemmas not_stack_simps = ext_program_size_elm_not_stack continuing_not_stack block_hash_not_stack block_number_not_stack coinbase_not_stack timestamp_not_stack difficulty_not_stack gaslimit_not_stack gasprice_not_stack ext_program_size_not_stack lemma advance_keeps_stack_elm: "StackElm x2 \<in> contexts_as_set (vctx_advance_pc co_ctx v) co_ctx = (StackElm x2 \<in> contexts_as_set v co_ctx)" by (simp add: contexts_as_set_def stateelm_basic_means_simps advance_pc_simps) lemma advance_keeps_code_elm: "CodeElm x9 \<in> contexts_as_set (vctx_advance_pc co_ctx x1) co_ctx = (CodeElm x9 \<in> contexts_as_set x1 co_ctx)" by (simp add: contexts_as_set_def code_elm_not_variable stateelm_basic_means_simps advance_pc_simps) lemma storage_elm_means: "StorageElm ab \<in> contexts_as_set x1 co_ctx = (vctx_storage x1 (fst ab) = (snd ab))" by (simp add: contexts_as_set_def stateelm_basic_means_simps advance_pc_simps storage_elm_not_constant) lemma memory_elm_means: "MemoryElm ab \<in> contexts_as_set x1 co_ctx = (vctx_memory x1 (fst ab) = (snd ab))" apply(simp add: contexts_as_set_def stateelm_basic_means_simps memory_elm_not_constant) done lemma memory_usage_elm_c_means: "MemoryUsageElm m \<in> contexts_as_set x1 co_ctx = (vctx_memory_usage x1 = m)" apply(simp add: contexts_as_set_def stateelm_basic_means_simps memory_usage_elm_not_constant) done lemma log_not_constant : "LogElm ab \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma log_elm_means : "LogElm ab \<in> contexts_as_set x1 co_ctx = (fst ab < length (vctx_logs x1) \<and> rev (vctx_logs x1) ! (fst ab) = (snd ab))" apply(auto simp add: contexts_as_set_def log_not_constant stateelm_basic_means_simps ) done lemma this_account_means: "ThisAccountElm x10 \<in> contexts_as_set x1 co_ctx = (cctx_this co_ctx = x10)" by (auto simp: as_set_simps) lemma balance_elm_c_means : "BalanceElm ab \<in> contexts_as_set x1 co_ctx = (vctx_balance x1 (fst ab) = (snd ab))" apply(auto simp add: contexts_as_set_def balance_elm_means stateelm_basic_means_simps balance_not_constant) done lemma origin_not_constant: "OriginElm x13 \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma orogin_elm_c_means: "OriginElm x13 \<in> contexts_as_set x1 co_ctx = (vctx_origin x1 = x13)" apply(auto simp add: advance_keeps_origin_elm constant_ctx_as_set_def program_as_set_def contexts_as_set_def stateelm_basic_means_simps) done lemma sent_value_not_constant: "SentValueElm x14 \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma sent_value_c_means : "SentValueElm x14 \<in> contexts_as_set x1 co_ctx = (vctx_value_sent x1 = x14)" apply(auto simp add: contexts_as_set_def stateelm_basic_means_simps sent_value_not_constant) done lemma sent_data_not_constant: "SentDataElm ab \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma sent_data_elm_c_means : "SentDataElm ab \<in> contexts_as_set x1 co_ctx = (ab = vctx_data_sent x1)" by (auto simp add: contexts_as_set_def sent_data_not_constant stateelm_basic_means_simps ) lemmas not_constant_simps = stack_elm_not_constant storage_elm_not_constant stack_height_elm_not_constant memory_elm_not_constant memory_usage_elm_not_constant pc_elm_not_constant gas_elm_not_constant contract_action_elm_not_constant balance_not_constant sent_value_not_constant sent_data_not_constant lemma short_rev_append: "a < length t \<Longrightarrow> (rev t @ lst) ! a = rev t ! a" by (simp add: nth_append) lemma memory_usage_not_constant: "MemoryUsageElm x8 \<notin> constant_ctx_as_set co_ctx" apply(simp add: constant_ctx_as_set_def program_as_set_def) done lemma code_elms : "{CodeElm (pos, i) |pos i. P pos i \<or> Q pos i} \<subseteq> S = ({CodeElm (pos, i) | pos i. P pos i} \<subseteq> S \<and> {CodeElm (pos, i) | pos i. Q pos i} \<subseteq> S)" apply(auto) done lemma pc_update_v: "x \<in> variable_ctx_as_set (x1\<lparr>vctx_pc := p\<rparr>) = (x = PcElm p \<or> x \<in> variable_ctx_as_set x1 - {PcElm (vctx_pc x1)})" by (auto simp add: stateelm_basic_means_simps advance_pc_simps as_set_simps) lemma pc_update : "x \<in> contexts_as_set (x1\<lparr>vctx_pc := p\<rparr>) co_ctx = (x = PcElm p \<or> x \<in> contexts_as_set x1 co_ctx - {PcElm (vctx_pc x1)})" by (auto simp add: as_set_simps) lemma not_continuing_sep : "(not_continuing ** rest) s = (ContinuingElm False \<in> s \<and> rest (s - {ContinuingElm False}))" by (solve_sep_iff simp: not_continuing_def) lemma sep_not_continuing : "(rest ** not_continuing ) s = (ContinuingElm False \<in> s \<and> rest (s - {ContinuingElm False}))" by (solve_sep_iff simp: not_continuing_def) lemma sep_not_continuing_sep : "(a ** not_continuing ** rest) s = (ContinuingElm False \<in> s \<and> (a ** rest) (s - {ContinuingElm False}))" by (metis not_continuing_sep sep_conj_assoc sep_conj_commute) lemma this_account_sep : "(this_account t ** rest) s = (ThisAccountElm t \<in> s \<and> rest (s - {ThisAccountElm t}))" by (solve_sep_iff simp: this_account_def) lemma sep_this_account : "(rest ** this_account t) s = (ThisAccountElm t \<in> s \<and> rest (s - {ThisAccountElm t}))" by (solve_sep_iff simp: this_account_def) lemma sep_this_account_sep : "(a ** this_account t ** rest) s = (ThisAccountElm t \<in> s \<and> (a ** rest) (s - {ThisAccountElm t}))" proof - have "(a ** this_account t ** rest) = (this_account t ** a ** rest)" by (metis sep_conj_assoc sep_conj_commute) moreover have "(this_account t ** a ** rest) s = (ThisAccountElm t \<in> s \<and> (a ** rest) (s - {ThisAccountElm t}))" by (rule this_account_sep) ultimately show ?thesis by auto qed lemma action_sep : "(action a ** rest) s = (ContractActionElm a \<in> s \<and> rest (s - {ContractActionElm a}))" by (solve_sep_iff simp: action_def) lemma sep_action : "(rest ** action a) s = (ContractActionElm a \<in> s \<and> rest (s - {ContractActionElm a}))" by (solve_sep_iff simp: action_def) lemma sep_action_sep : "(b ** action a ** rest) s = (ContractActionElm a \<in> s \<and> (b ** rest) (s - {ContractActionElm a}))" by (sep_simp simp: action_sep) lemma iota0_non_empty_aux: "\<forall> b x len lst a. len \<le> l \<longrightarrow> iota0 b len (lst @ [a]) = a # iota0 b len lst" apply(induction l) apply(simp add: iota0.simps) apply(simp add: iota0.simps) apply(rule allI) apply(rule allI) apply(case_tac "len = Suc l"; auto) apply(drule_tac x = "b + 1" in spec) apply(drule_tac x = l in spec) apply simp apply(drule_tac x = "b # lst" in spec) apply(drule_tac x = "a" in spec) by(simp add: iota0.simps) lemma iota0_non_empty_aux': "\<forall> b x len lst a l. len \<le> l \<longrightarrow> iota0 b len (lst @ [a]) = a # iota0 b len lst" using iota0_non_empty_aux apply auto done lemma iota0_non_empty: "iota0 b len (lst @ [a]) = a # iota0 b len lst" using iota0_non_empty_aux' apply auto done lemma iota0_singleton': "iota0 b len ([] @ [a]) = a # iota0 b len []" using iota0_non_empty apply blast done lemma iota0_singleton: "iota0 b len [a] = a # iota0 b len []" using iota0_singleton' apply auto done lemma cut_memory_aux_alt_eqv : "\<forall> b. cut_memory_aux_alt b len m = cut_memory_aux b len m" apply(induction len) apply(simp add: cut_memory_aux.simps cut_memory_aux_alt_def iota0.simps) apply(simp add: cut_memory_aux.simps cut_memory_aux_alt_def iota0.simps iota0_singleton) done lemma cut_memory_head: "cut_memory b (n + 1) m = a # lst \<Longrightarrow> m b = a" apply(simp add: cut_memory_aux.simps cut_memory_def cut_memory_aux_alt_eqv) apply(cases "unat (n+1)") apply(simp add: cut_memory_aux.simps cut_memory_def) apply(simp add: cut_memory_aux.simps cut_memory_def) done (* declare cut_memory.simps [simp del] *) lemma my_unat_suc : "unat (n::256 word) = x \<Longrightarrow> unat (n+1) > 0 \<Longrightarrow> unat (n+1) = x+1" by (metis Suc_eq_plus1 add.commute neq0_conv unatSuc unat_eq_zero) lemma cut_memory_aux : "cut_memory_aux b (Suc n) m = m b # cut_memory_aux (b+1) n m" apply(simp add:cut_memory_aux.simps) done lemma cut_memory_S1 : "cut_memory b (n + 1) m = [] \<or> cut_memory b (n + 1) m = m b # cut_memory (b + 1) n m" apply(simp add: cut_memory_def cut_memory_aux_alt_eqv) apply(cases "unat (n + 1)") apply(simp add:cut_memory_aux.simps) apply(cases "unat n") apply(simp add:cut_memory_aux.simps) apply (simp add: cut_memory_aux.simps(1) unat_eq_zero) apply(simp add:cut_memory_aux.simps) apply(cases "unat (n + 1)") apply(simp) apply(subst (asm) my_unat_suc) by(auto simp add:cut_memory_aux.simps) lemma cut_memory_tail: "cut_memory b (n + 1) m = a # lst \<Longrightarrow> cut_memory (b + 1) n m = lst" proof - assume "cut_memory b (n + 1) m = a # lst" moreover have "cut_memory b (n + 1) m = [] \<or> cut_memory b (n + 1) m = (m b # cut_memory (b + 1) n m)" by(rule cut_memory_S1) ultimately moreover have "cut_memory b (n + 1) m = m b # cut_memory (b + 1) n m" by simp ultimately show "cut_memory (b + 1) n m = lst" by simp qed lemma cut_memory_zero [simp] : "cut_memory b 0 m = []" apply(simp add: cut_memory_aux.simps cut_memory_def cut_memory_aux_alt_eqv) done lemma cut_memory_aux_cons[simp] : "(cut_memory_aux b (Suc n) m = a # lst) = (m b = a \<and> cut_memory_aux (b + 1) n m = lst)" apply(simp add: cut_memory_aux.simps cut_memory_def) done lemma unat_minus_one2 : "unat x = Suc n \<Longrightarrow> unat (x - 1) = n" by (metis diff_Suc_1 nat.simps(3) unat_eq_zero unat_minus_one) lemma cut_memory_cons[simp] : "(cut_memory b n m = a # lst) = (n \<noteq> 0 \<and> m b = a \<and> cut_memory (b + 1) (n - 1) m = lst)" apply(auto simp:cut_memory_def cut_memory_aux.simps cut_memory_aux_alt_eqv) apply(cases "unat n", auto simp:cut_memory_aux.simps) apply(cases "unat n", auto simp:cut_memory_aux.simps unat_minus_one) apply(cases "unat n", auto simp:cut_memory_aux.simps) apply (metis diff_Suc_1 nat.simps(3) unat_eq_zero unat_minus_one) apply(cases "unat n", auto simp:cut_memory_aux.simps) apply (metis unat_eq_zero ) done lemma memory_range_cons : "(memory_range b (a # lst) ** rest) s = (memory8 b a ** memory_range (b + 1) lst ** rest) s" by (simp only: memory_range.simps sep_conj_ac) lemma cut_memory_memory_range[rule_format] : "\<forall> rest b n. unat n = length lst \<longrightarrow> (memory_range b lst ** rest) (instruction_result_as_set c (InstructionContinue v)) \<longrightarrow> cut_memory b n (vctx_memory v) = lst" apply(induction lst) apply(simp add: unat_eq_0) apply clarsimp apply (sep_simp simp: memory8_sep) apply(drule_tac x = "memory8 b a ** rest" in spec) apply(drule_tac x = "b + 1" in spec) apply(drule_tac x = "n - 1" in spec) apply (erule impE) apply unat_arith apply (erule impE) apply (sep_simp simp: memory8_sep ; clarsimp) apply (simp add: cut_memory_cons) apply (rule conjI) apply unat_arith apply (simp add: instruction_result_as_set_def as_set_simps) done (****** specifying each instruction *******) bundle simp_for_triples_bundle = vctx_next_instruction_default_def[simp] stack_2_1_op_def[simp] stack_1_1_op_def[simp] stack_0_0_op_def[simp] vctx_next_instruction_def[simp] instruction_sem_def[simp] check_resources_def[simp] pop_def[simp] jump_def[simp] jumpi_def[simp] instruction_failure_result_def[simp] strict_if_def[simp] blocked_jump_def[simp] blockedInstructionContinue_def[simp] vctx_pop_stack_def[simp] stack_0_1_op_def[simp] general_dup_def[simp] dup_inst_numbers_def[simp] new_memory_consumption.simps[simp] inst_stack_numbers.simps[simp] arith_inst_numbers.simps[simp] program_sem.simps[simp] info_inst_numbers.simps[simp] stack_inst_numbers.simps[simp] pc_inst_numbers.simps[simp] storage_inst_numbers.simps[simp] subtract_gas.simps[simp] lemmas removed_from_sft = meter_gas_def C_def Cmem_def Gmemory_def thirdComponentOfC_def Gbalance_def Gbase_def Gsreset_def lemma emp_sep [simp] : "(emp ** rest) s = rest s" apply(simp add: emp_def sep_basic_simps) done lemma memory_range_elms_index_aux[rule_format] : "\<forall> i a begin_word. MemoryElm (i, a) \<in> memory_range_elms begin_word input \<longrightarrow> (\<exists>pos. \<not> length input \<le> pos \<and> begin_word + word_of_int (int pos) = i)" apply(induction input) apply(simp) apply(clarsimp) apply(drule_tac x = i in spec) apply(drule_tac x = aa in spec) apply(drule_tac x = "begin_word + 1" in spec) apply(auto) apply(rule_tac x = "Suc pos" in exI) apply(auto) apply(simp add: Word.wi_hom_syms(1)) done lemmas memory_range_elms_index_meta = memory_range_elms_index_aux lemma memory_range_elms_index_contra[rule_format] : "(\<forall> pos. pos \<ge> length input \<or> begin_word + (word_of_int (int pos)) \<noteq> i) \<longrightarrow> MemoryElm (i, a) \<notin> memory_range_elms begin_word input" by (fastforce dest: memory_range_elms_index_meta) lemma memory_range_elms_index_contra_meta : "(\<forall> pos. pos \<ge> length input \<or> begin_word + (word_of_int (int pos)) \<noteq> i) \<Longrightarrow> MemoryElm (i, a) \<notin> memory_range_elms begin_word input" by (auto simp add: memory_range_elms_index_contra) lemma suc_is_word : "unat (len_word :: w256) = Suc n \<Longrightarrow> n < 2 ^ 256 - 1 " proof - have "unat (len_word :: 256 word) < 2 ^ 256" by (rule order_less_le_trans, rule unat_lt2p, simp) moreover assume "unat (len_word :: w256) = Suc n" ultimately have "Suc n < 2 ^ 256" by auto then show "n < 2 ^ 256 - 1" by auto qed lemma w256_add_com : "(a :: w256) + b = b + a" apply(auto) done lemma word_of_int_mod : "(word_of_int i = (w :: w256)) = (i mod 2 ^ 256 = uint w)" apply(auto simp add:word_of_int_def Word.word.Abs_word_inverse Word.word.uint_inverse) done lemma too_small_to_overwrap : "(1 :: 256 word) + word_of_int (int pos) = 0 \<Longrightarrow> (pos :: nat) \<ge> 2 ^ 256 - 1" proof - have "word_of_int (int pos) + (1 :: 256 word) = (1 :: 256 word) + word_of_int (int pos)" by (rule w256_add_com) moreover assume "(1 :: 256 word) + word_of_int (int pos) = 0" ultimately have "word_of_int (int pos) + (1 :: 256 word) = 0" by auto then have "word_of_int (int pos) = (max_word :: 256 word)" by (rule Word.max_word_wrap) then have "(int pos) mod 2^256 = (uint (max_word :: 256 word))" by (simp add: word_of_int_mod) then have "pos \<ge> nat (uint (max_word :: 256 word))" (* sledgehammer *) proof - have "(0::int) \<le> 2" by auto then show ?thesis by (metis (no_types) Divides.mod_less_eq_dividend Divides.transfer_nat_int_functions(2) Nat_Transfer.transfer_nat_int_function_closures(4) Nat_Transfer.transfer_nat_int_function_closures(9) \<open>int pos mod 2 ^ 256 = uint max_word\<close> nat_int.Rep_inverse) qed then show "(pos :: nat) \<ge> 2 ^ 256 - 1" by(simp add: max_word_def) qed lemma no_overwrap[simp]: "unat (len_word :: w256) = Suc (length input) \<Longrightarrow> MemoryElm (begin_word, a) \<notin> memory_range_elms (begin_word + 1) input" apply(rule memory_range_elms_index_contra_meta) apply(drule suc_is_word) apply(auto dest: too_small_to_overwrap) done lemma memory_range_alt : "\<forall> len_word begin_word va. unat (len_word :: w256) = length input \<longrightarrow> memory_range begin_word input va = (va = memory_range_elms begin_word input)" apply(induction input) apply(simp add: emp_def sep_set_conv) apply(clarify) apply(drule_tac x = "len_word - 1" in spec) apply(drule_tac x = "begin_word + 1" in spec) apply(drule_tac x = "va - {MemoryElm (begin_word, a)}" in spec) apply(subgoal_tac "unat (len_word - 1) = length input") apply (erule (1) impE) apply (subst memory_range.simps, simp) apply (sep_simp simp: memory8_sep) apply (auto simp add: no_overwrap)[1] apply unat_arith done lemma memory_range_sep : " unat (len_word :: w256) = length input \<longrightarrow> (memory_range begin_word input ** rest) s = ((memory_range_elms begin_word input \<subseteq> s) \<and> rest (s - memory_range_elms begin_word input)) " apply(induction input arbitrary: begin_word s len_word rest) apply clarsimp apply (clarsimp simp del: sep_conj_assoc simp: sep_conj_ac) apply (drule_tac x="begin_word + 1" in meta_spec) apply (drule_tac x="s - {MemoryElm (begin_word, a)}" in meta_spec) apply (drule_tac x="len_word -1" in meta_spec) apply (drule_tac x=rest in meta_spec) apply (erule impE) apply (fastforce simp: unat_arith_simps) apply (sep_simp simp: memory8_sep) apply clarsimp apply (rule iffI) apply (rule conjI) apply (auto simp add: sep_basic_simps )[1] apply clarsimp apply (rule conjI) apply (auto simp add: sep_basic_simps )[1] apply (simp add: set_diff_eq) apply clarsimp apply (rule conjI) apply (fastforce simp: no_overwrap) apply (simp add: set_diff_eq) done lemma sep_memory_range : " \<forall> begin_word len_word rest s. unat (len_word :: w256) = length input \<longrightarrow> (rest ** memory_range begin_word input) s = ((memory_range_elms begin_word input \<subseteq> s) \<and> rest (s - memory_range_elms begin_word input)) " by (metis sep_conj_commute memory_range_sep) lemma account_existence_sep : "(account_existence a b ** R) s = ( AccountExistenceElm (a, b) \<in> s \<and> R (s - {AccountExistenceElm (a, b)}))" by (solve_sep_iff simp: account_existence_def) lemma sep_account_existence_sep : "(p ** account_existence a b ** q) s = ( AccountExistenceElm (a, b) \<in> s \<and> (p ** q) (s - {AccountExistenceElm (a, b)}))" apply (subst sep_conj_commute) apply (subst sep_conj_assoc) apply (subst account_existence_sep) apply (simp only: sep_conj_commute) done lemma sep_sep_account_existence_sep : "(n ** p ** account_existence a b ** q) s = ( AccountExistenceElm (a, b) \<in> s \<and> (n ** p ** q) (s - {AccountExistenceElm (a, b)}))" proof - have "(n ** p ** account_existence a b ** q) s = ((n ** p) ** account_existence a b ** q) s" by (auto simp: sep_conj_ac) moreover have "((n ** p) ** account_existence a b ** q) s = ( AccountExistenceElm (a, b) \<in> s \<and> ((n ** p) ** q) (s - {AccountExistenceElm (a, b)}))" by (rule "sep_account_existence_sep") moreover have "( AccountExistenceElm (a, b) \<in> s \<and> ((n ** p) ** q) (s - {AccountExistenceElm (a, b)})) = ( AccountExistenceElm (a, b) \<in> s \<and> (n ** p ** q) (s - {AccountExistenceElm (a, b)}))" by (auto simp: sep_conj_ac) ultimately show ?thesis by auto qed lemma sep_account_existence : "(p ** account_existence a b ) s = ( AccountExistenceElm (a, b) \<in> s \<and> p (s - {AccountExistenceElm (a, b)}))" apply (subst sep_conj_commute) apply (simp only: account_existence_sep) done lemma sep_memory_range_sep : "unat (len_word :: w256) = length input \<Longrightarrow> (a ** memory_range begin_word input ** rest) s = ((memory_range_elms begin_word input \<subseteq> s) \<and> (a ** rest) (s - memory_range_elms begin_word input)) " apply (subst sep_conj_commute) apply (subst sep_conj_assoc) apply (subst memory_range_sep[rule_format], assumption) apply (simp add: sep_conj_commute) done lemma continuging_not_memory_range: "\<forall> in_begin. ContinuingElm False \<notin> memory_range_elms in_begin input" apply(induction input; auto) done lemma contractaction_not_memory_range : "\<forall> in_begin a. ContractActionElm a \<notin> memory_range_elms in_begin input" apply(induction input; auto) done lemma pc_not_memory_range : "\<forall> in_begin k. PcElm k \<notin> memory_range_elms in_begin input" apply(induction input; auto) done lemma this_account_not_memory_range : "\<forall> this in_begin. ThisAccountElm this \<notin> memory_range_elms in_begin input" apply(induction input; auto) done lemma balance_not_memory_range : "\<forall> in_begin. BalanceElm p \<notin> memory_range_elms in_begin input" apply(induction input; auto) done lemma code_not_memory_range: "\<forall> k in_begin. CodeElm pair \<notin> memory_range_elms in_begin input" apply(induction input; auto) done lemma continuing_not_memory_range : "\<forall> b in_begin. ContinuingElm b \<notin> memory_range_elms in_begin input" apply(induction input; auto) done lemma stack_not_memory_range : "\<forall> in_begin. StackElm e \<notin> memory_range_elms in_begin input" apply(induction input; auto) done lemma stack_height_not_memory_range: "\<forall> in_begin. StackHeightElm h \<notin> memory_range_elms in_begin input" apply(induction input; auto) done lemma gas_not_memory_range : "\<forall> in_begin. GasElm g \<notin> memory_range_elms in_begin input" apply(induction input; auto) done definition triple_alt :: "network \<Rightarrow> failure_reason set \<Rightarrow> (state_element set \<Rightarrow> bool) \<Rightarrow> (int * inst) set \<Rightarrow> (state_element set \<Rightarrow> bool) \<Rightarrow> bool" where "triple_alt net allowed_failures pre insts post == \<forall> co_ctx presult rest stopper. (code insts ** pre ** rest) (instruction_result_as_set co_ctx presult) \<longrightarrow> (\<exists> k. ((post ** code insts ** rest) (instruction_result_as_set co_ctx (program_sem stopper co_ctx k net presult))) \<or> failed_for_reasons allowed_failures (program_sem stopper co_ctx k net presult))" lemma triple_triple_alt : "triple net s pre c post = triple_alt net s pre c post" apply(simp only: triple_def triple_alt_def sep_conj_commute[where P=pre] sep_conj_assoc) done fun stack_topmost_elms :: "nat \<Rightarrow> w256 list \<Rightarrow> state_element set" where "stack_topmost_elms h [] = { StackHeightElm h }" | "stack_topmost_elms h (f # rest) = { StackElm (h, f) } \<union> stack_topmost_elms (h + 1) rest" definition stack_topmost :: "nat \<Rightarrow> w256 list \<Rightarrow> state_element set \<Rightarrow> bool" where "stack_topmost h lst s = (s = stack_topmost_elms h lst)" lemma stack_topmost_sep: "(stack_topmost h lst ** rest) s = (stack_topmost_elms h lst \<subseteq> s \<and> rest (s - stack_topmost_elms h lst))" apply (rule iffI) apply (clarsimp simp add: sep_basic_simps stack_topmost_def set_diff_eq) apply (erule back_subst[where P=rest]) apply blast apply clarsimp apply (clarsimp simp add: sep_basic_simps stack_topmost_def set_diff_eq) apply (exI_pick_last_conj) done lemma sep_stack_topmost : "(rest ** stack_topmost h lst) s = (stack_topmost_elms h lst \<subseteq> s \<and> rest (s - stack_topmost_elms h lst))" by (rule iffI ; sep_simp simp: stack_topmost_sep) lemma fourth_stack_topmost : "(a ** b ** c ** stack_topmost h lst ** rest) s = (stack_topmost_elms h lst \<subseteq> s \<and> (a ** b ** c ** rest) (s - stack_topmost_elms h lst))" by (rule iffI ; sep_simp simp: stack_topmost_sep) lemma this_account_not_stack_topmost : "\<forall> h. ThisAccountElm this \<notin> stack_topmost_elms h lst" apply(induction lst; simp ) done lemma gas_not_stack_topmost : "\<forall> h. GasElm g \<notin> stack_topmost_elms h lst" apply(induction lst; simp) done lemma stack_topmost_empty: "x \<in> stack_topmost_elms h [] = (x = StackHeightElm h)" by simp lemma not_memory_range_elms_all: "P \<notin> range MemoryElm \<Longrightarrow> P \<notin> memory_range_elms in_begin input" by (induction input arbitrary: in_begin; auto) lemma memory_range_elms_all: "P \<in> memory_range_elms in_begin input \<Longrightarrow> P \<in> range MemoryElm" by (induction input arbitrary: in_begin; auto) lemma memory_range_elms_not_pc : "(memory_range_elms in_begin input \<subseteq> s - {PcElm k}) = (memory_range_elms in_begin input \<subseteq> s)" by (auto dest: memory_range_elms_all) lemma account_ex_is_not_memory_range : "AccountExistenceElm p \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma lognum_not_memory : " LogNumElm n \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma account_existence_not_memory: "AccountExistenceElm x \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma log_not_memory_range : "LogElm x5 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma caller_not_memory_range: "CallerElm x5 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma origin_not_memory_range: "OriginElm x5 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma sent_value_not_memory_range : "SentValueElm x5 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma memory_usage_not_memory_range: "MemoryUsageElm x \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemmas not_memory_range_simps = continuing_not_memory_range contractaction_not_memory_range pc_not_memory_range this_account_not_memory_range balance_not_memory_range code_not_memory_range stack_not_memory_range stack_height_not_memory_range gas_not_memory_range account_ex_is_not_memory_range lognum_not_memory account_existence_not_memory log_not_memory_range caller_not_memory_range origin_not_memory_range sent_value_not_memory_range memory_usage_not_memory_range lemma memory_range_elms_not_account_existence : "(memory_range_elms in_begin input \<subseteq> s - {AccountExistenceElm p}) = (memory_range_elms in_begin input \<subseteq> s)" by (auto simp : account_ex_is_not_memory_range) lemma memory_range_elms_not_code : "(memory_range_elms in_begin input \<subseteq> s - {CodeElm pair}) = (memory_range_elms in_begin input \<subseteq> s) " by (auto dest: memory_range_elms_all) lemma memory_not_stack_topmost: "MemoryElm p \<notin> stack_topmost_elms h lst" by (induction lst arbitrary: h, auto simp add: stack_topmost_elms.simps) lemma memory_usage_not_stack_topmost: "MemoryUsageElm p \<notin> stack_topmost_elms h lst" by (induction lst arbitrary: h, auto simp add: stack_topmost_elms.simps) lemma stack_topmost_not_memory : "(stack_topmost_elms h lst \<subseteq> s - memory_range_elms in_begin input) = (stack_topmost_elms h lst \<subseteq> s)" by (induction input arbitrary: in_begin; auto simp add: memory_not_stack_topmost memory_range_elms.simps) lemma pc_not_stack_topmost : "PcElm p \<notin> stack_topmost_elms h lst" by (induction lst arbitrary:h; auto simp add: stack_topmost_elms.simps) lemma stack_topmost_not_pc: "stack_topmost_elms h lst \<subseteq> s - {PcElm (vctx_pc x1)} = (stack_topmost_elms h lst \<subseteq> s)" by (auto simp: pc_not_stack_topmost) lemma ae_not_stack_topmost : "AccountExistenceElm p \<notin> stack_topmost_elms h lst" by(induction lst arbitrary: h; auto simp add: stack_topmost_elms.simps) lemma stack_topmost_not_account_existence : "stack_topmost_elms h lst \<subseteq> s - {AccountExistenceElm p} = (stack_topmost_elms h lst \<subseteq> s)" by (auto simp: ae_not_stack_topmost) lemma stack_topmost_not_code: "stack_topmost_elms h lst \<subseteq> s - {CodeElm (vctx_pc x1, Misc CALL)} = (stack_topmost_elms h lst \<subseteq> s)" by (induction lst arbitrary: h; auto) lemma stack_height_after_call: includes simp_for_triples_bundle shows "vctx_balance x1 (cctx_this co_ctx) \<ge> vctx_stack x1 ! 2 \<Longrightarrow> (StackHeightElm (h + 7) \<in> instruction_result_as_set co_ctx (InstructionContinue x1)) \<Longrightarrow> (StackHeightElm h \<in> instruction_result_as_set co_ctx (subtract_gas g memu (call net x1 co_ctx))) " apply(simp add: call_def as_set_simps stateelm_basic_means_simps) apply(auto simp add: instruction_result_as_set_def as_set_simps split: list.splits) done lemma topmost_elms_means: "\<forall> h x1. stack_topmost_elms h lst \<subseteq> instruction_result_as_set co_ctx (InstructionContinue x1) = (length (vctx_stack x1) = h + (length lst) \<and> drop h (rev (vctx_stack x1)) = lst) " apply(induction lst; simp) apply(simp add: instruction_result_as_set_def as_set_simps) apply blast apply(rule allI) apply(rule allI) apply (simp (no_asm) add: instruction_result_as_set_def as_set_simps) apply (rule iffI ) apply (clarify) apply (rule conjI) apply (simp (no_asm)) apply (drule sym[where t="_#_"]) apply (simp add: Cons_nth_drop_Suc)+ apply (rule conjI) apply (clarsimp) apply (subst nth_via_drop) apply (erule HOL.trans[rotated]) apply (subst drop_append) apply simp+ apply clarsimp apply (drule arg_cong[where f="drop 1"]) apply simp done lemma to_environment_not_continuing[simp]: "ContinuingElm True \<notin> instruction_result_as_set co_ctx (InstructionToEnvironment x31 x32 x33)" apply(simp add: instruction_result_as_set_def as_set_simps) done lemma topmost_all: "P \<in> stack_topmost_elms h lst \<Longrightarrow> P \<in> range StackElm \<union> range StackHeightElm" by (induction lst arbitrary:h ; auto) lemma not_topmost_all: "P \<notin> range StackElm \<union> range StackHeightElm \<Longrightarrow> P \<notin> stack_topmost_elms h lst" by (induction lst arbitrary:h ; auto) lemma balance_not_topmost : "BalanceElm pair \<notin> stack_topmost_elms h lst" by (auto dest: topmost_all) lemma this_not_topmost : "ThisAccountElm pair \<notin> stack_topmost_elms h lst" by (auto dest: topmost_all) lemma continue_not_topmost : "ContinuingElm b\<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma this_account_i_means : "ThisAccountElm this \<in> instruction_result_as_set co_ctx (InstructionContinue x1) = (cctx_this co_ctx = this)" by (auto simp add: instruction_result_as_set_def as_set_simps) lemma memory_usage_not_topmost: "MemoryUsageElm u \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma gas_not_topmost: "GasElm pair \<notin> stack_topmost_elms h lst" by (auto dest: topmost_all) lemma call_new_balance : "v \<le> fund \<Longrightarrow> ThisAccountElm this \<in> instruction_result_as_set co_ctx (InstructionContinue x1) \<Longrightarrow> vctx_balance x1 this = fund \<Longrightarrow> meter_gas (Misc CALL) x1 co_ctx net \<le> vctx_gas x1 \<Longrightarrow> vctx_stack x1 = g # r # v # in_begin # in_size # out_begin # out_size # tf \<Longrightarrow> BalanceElm (this, fund - v) \<in> instruction_result_as_set co_ctx (subtract_gas (meter_gas (Misc CALL) x1 co_ctx net) memu (call net x1 co_ctx))" apply(clarify) apply(auto simp add: call_def failed_for_reasons_def) apply(simp add: instruction_result_as_set_def subtract_gas.simps strict_if_def) apply(case_tac "vctx_balance x1 (cctx_this co_ctx) < v") apply(simp add: as_set_simps) apply(simp add: strict_if_def subtract_gas.simps update_balance_def as_set_simps) done lemma advance_pc_call: includes simp_for_triples_bundle shows "program_content (cctx_program co_ctx) (vctx_pc x1) = Some (Misc CALL) \<Longrightarrow> k = vctx_pc x1 \<Longrightarrow> vctx_pc (vctx_advance_pc co_ctx x1) = vctx_pc x1 + 1" by (simp add: vctx_advance_pc_def inst_size_def inst_code.simps) lemma memory_range_elms_not_continuing : "(memory_range_elms in_begin input \<subseteq> insert (ContinuingElm True) (contexts_as_set x1 co_ctx)) = (memory_range_elms in_begin input \<subseteq> (contexts_as_set x1 co_ctx)) " by (auto dest: memory_range_elms_all) lemma suc_unat : "Suc n = unat (aa :: w256) \<Longrightarrow> n = unat (aa - 1) " apply(rule HOL.sym) apply(drule HOL.sym) apply(rule unat_suc) apply(simp) done lemma memory_range_elms_cut_memory : "\<forall> in_begin in_size. length lst = unat in_size \<longrightarrow> memory_range_elms in_begin lst \<subseteq> variable_ctx_as_set x1 \<longrightarrow> cut_memory in_begin in_size (vctx_memory x1) = lst" apply(induction lst) apply(simp add: unat_eq_0 ) apply(rule allI) apply(rule allI) apply(drule_tac x = "in_begin + 1" in spec) apply(drule_tac x = "in_size - 1" in spec) apply(clarsimp) apply (erule impE) apply unat_arith apply (rule conjI) apply auto[1] apply (clarsimp simp add: as_set_simps) done lemma stack_height_in_topmost_means: "\<forall> h. StackHeightElm x1a \<in> stack_topmost_elms h lst = (x1a = h + length lst)" apply(induction lst) apply(simp) apply(auto simp add: ) done lemma code_elm_not_stack_topmost : "\<forall> len. CodeElm x9 \<notin> stack_topmost_elms len lst" apply(induction lst) apply(auto) done lemma stack_elm_c_means : "StackElm x \<in> contexts_as_set v c = ( rev (vctx_stack v) ! fst x = snd x \<and> fst x < length (vctx_stack v) )" by(force simp add: as_set_simps) lemma stack_elm_in_topmost : "\<forall> len. StackElm x2 \<in> stack_topmost_elms len lst = (fst x2 \<ge> len \<and> fst x2 < len + length lst \<and> lst ! (fst x2 - len) = snd x2)" apply(induction lst) apply(simp) apply(rule allI) apply(drule_tac x = "Suc len" in spec) apply(case_tac x2) apply(auto simp only: stack_topmost_elms.simps; simp) apply(case_tac "aa \<le> len"; auto) apply(case_tac "aa = len"; auto) done lemma rev_append_eq : "(rev tf @ l) ! a = (if a < length tf then rev tf ! a else l ! (a - length tf))" by(auto simp: nth_append) lemma code_elm_in_c : "CodeElm x9 \<in> contexts_as_set x1 co_ctx = (program_content (cctx_program co_ctx) (fst x9) = Some (snd x9) \<or> program_content (cctx_program co_ctx) (fst x9) = None \<and> snd x9 = Misc STOP)" by (case_tac x9, simp add: stateelm_equiv_simps) lemma storage_not_stack_topmost: "StorageElm x \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma log_not_topmost: "LogElm x \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma caller_not_topmost: "CallerElm x \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma origin_not_topmost : "OriginElm x13 \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma sent_value_not_topmost : "SentValueElm x \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma sent_data_not_topmost: "SentDataElm x \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma ext_program_size_not_topmost : "ExtProgramSizeElm x \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma code_elm_c: "CodeElm x \<in> contexts_as_set y c = (CodeElm x \<in> constant_ctx_as_set c)" apply(simp add: as_set_simps) done lemma ext_program_not_topmost_elms : " ExtProgramElm x \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma block_hash_not_topmost: "BlockhashElm x \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma block_number_not_topmost : "BlockNumberElm x \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma coinbase_not_topmost: "CoinbaseElm x \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma timestamp_not_topmost : "TimestampElm x \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma difficulty_not_topmost: "DifficultyElm x \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma memory_range_gas_update : "x \<in> memory_range_elms in_begin input \<Longrightarrow> x \<in> variable_ctx_as_set (x1 \<lparr>vctx_gas := g \<rparr>) = (x \<in> variable_ctx_as_set x1)" by (auto simp: as_set_simps dest: memory_range_elms_all) lemma memory_range_stack : " x \<in> memory_range_elms in_begin input \<Longrightarrow> x \<in> variable_ctx_as_set (x1\<lparr>vctx_stack := sta\<rparr>) = (x \<in> variable_ctx_as_set x1)" by (auto simp add: as_set_simps dest: memory_range_elms_all) lemma memory_range_memory_usage : " x \<in> memory_range_elms in_begin input \<Longrightarrow> x \<in> variable_ctx_as_set (x1\<lparr>vctx_memory_usage := u\<rparr>) = (x \<in> variable_ctx_as_set x1)" by (auto simp add: as_set_simps dest: memory_range_elms_all) lemma memory_range_balance : " x \<in> memory_range_elms in_begin input \<Longrightarrow> x \<in> variable_ctx_as_set (x1\<lparr>vctx_balance := u\<rparr>) = (x \<in> variable_ctx_as_set x1)" by (auto simp add: as_set_simps dest: memory_range_elms_all) lemma memory_range_advance_pc : " x \<in> memory_range_elms in_begin input \<Longrightarrow> x \<in> variable_ctx_as_set (vctx_advance_pc co_ctx x1) = (x \<in> variable_ctx_as_set x1) " by (auto simp add: as_set_simps advance_pc_simps dest: memory_range_elms_all) lemma memory_range_action : "x \<in> memory_range_elms in_begin input \<Longrightarrow> x \<in> instruction_result_as_set co_ctx (InstructionToEnvironment act v cont) = (x \<in> variable_ctx_as_set v)" by (auto simp add: instruction_result_as_set_def as_set_simps dest: memory_range_elms_all) lemma storage_not_memory_range: "StorageElm x3 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma memory_range_insert_cont : "memory_range_elms in_begin input \<subseteq> insert (ContinuingElm True) s = (memory_range_elms in_begin input \<subseteq> s)" by (auto dest: memory_range_elms_all) lemma memory_range_constant_union : "memory_range_elms in_begin input \<subseteq> constant_ctx_as_set co_ctx \<union> s = (memory_range_elms in_begin input \<subseteq> s)" by (auto simp: as_set_simps dest: memory_range_elms_all) lemma memory_range_elms_i : "memory_range_elms in_begin input \<subseteq> instruction_result_as_set co_ctx (InstructionContinue x1) = (memory_range_elms in_begin input \<subseteq> variable_ctx_as_set x1)" by (auto simp: instruction_result_as_set_def as_set_simps dest: memory_range_elms_all) lemma memory_range_continue: " x \<in> memory_range_elms in_begin input \<Longrightarrow> x \<in> instruction_result_as_set co_ctx (InstructionContinue x1) = (x \<in> variable_ctx_as_set x1)" by (auto simp: instruction_result_as_set_def as_set_simps dest: memory_range_elms_all) lemmas memory_range_simps = memory_range_constant_union memory_range_insert_cont memory_range_elms_i memory_range_elms_not_account_existence memory_range_elms_not_code memory_range_elms_not_pc memory_range_elms_not_continuing memory_range_continue memory_range_advance_pc memory_range_balance memory_range_gas_update memory_range_memory_usage memory_range_stack memory_range_action lemma call_memory_no_change: includes simp_for_triples_bundle shows "x \<in> memory_range_elms in_begin input \<Longrightarrow> x \<in> instruction_result_as_set co_ctx (subtract_gas (meter_gas (Misc CALL) x1 co_ctx net) memu (call net x1 co_ctx)) = (x \<in> instruction_result_as_set co_ctx (InstructionContinue x1))" apply (simp add: call_def) apply (auto simp: instruction_result_as_set_def dest: not_memory_range_elms_all split: list.splits) apply ((auto simp: as_set_simps advance_pc_simps dest: memory_range_elms_all)[1])+ done lemma memory_call: includes simp_for_triples_bundle shows "x \<in> memory_range_elms in_begin input \<Longrightarrow> x \<in> instruction_result_as_set co_ctx (call net x1 co_ctx) = (x \<in> instruction_result_as_set co_ctx (InstructionContinue x1))" apply(simp add: call_def) apply (auto split: list.splits simp: memory_range_simps) done lemma gas_limit_not_topmost: "GaslimitElm g \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma gas_price_not_topmost : " GaspriceElm p \<notin> stack_topmost_elms len lst" by (auto dest: topmost_all) lemma fourth_last_pure : "(a ** b ** c ** \<langle> P \<rangle>) s = (P \<and> (a ** b ** c) s)" by (metis get_pure sep_three) lemma lookup_over4': "(listf @ a # b # c # d # e # rest) ! Suc (Suc (Suc (Suc (length listf)))) = e" (is "?app ! ?idx = e") proof - have "?idx = length listf + 4" by auto then have "?app ! ?idx = ?app ! (length listf + 4)" by (simp add: \<open>Suc (Suc (Suc (Suc (length listf)))) = length listf + 4\<close>) moreover have "?app ! (length listf + 4) = (a # b # c # d # e # rest) ! 4" by (rule nth_append_length_plus) ultimately have "?app ! ?idx = (a # b # c # d # e # rest) ! 4" by auto then show ?thesis by simp qed lemma lookup_over_suc : "n \<ge> length lst \<Longrightarrow> (rev lst @ a # rest) ! Suc n = (rev lst @ rest) ! n" proof - assume "n \<ge> length lst" then have "n = length lst + (n - length lst)" by simp then have " (rev lst @ a # rest) ! Suc n = (rev lst @ a # rest) ! (length lst + Suc (n - length lst))" by simp moreover have "(rev lst @ a # rest) ! (length lst + Suc (n - length lst)) = (rev lst @ a # rest) ! (length (rev lst) + Suc (n - length lst))" by simp moreover have "(rev lst @ a # rest) ! (length (rev lst) + Suc (n - length lst)) = (a # rest) ! Suc (n - length lst)" by (rule nth_append_length_plus) ultimately have "(rev lst @ a # rest) ! Suc n = (a # rest) ! Suc (n - length lst)" by auto moreover have "(a # rest) ! Suc (n - length lst) = rest ! (n - length lst)" by auto ultimately have " (rev lst @ a # rest) ! Suc n = rest ! (n - length lst)" by simp moreover assume "n \<ge> length lst" then have "n = length lst + (n - length lst)" by simp then have "(rev lst @ rest) ! n = (rev lst @ rest) ! (length lst + (n - length lst))" by simp then have "(rev lst @ rest) ! n = (rev lst @ rest) ! (length (rev lst) + (n - length lst))" by simp moreover have "(rev lst @ rest) ! (length (rev lst) + (n - length lst)) = rest ! (n - length lst)" by (rule nth_append_length_plus) ultimately show ?thesis by auto qed lemma lookup_over4 : "(rev listf @ a # b # c # d # e # rest) ! Suc (Suc (Suc (Suc (length listf)))) = e" by (simp add: lookup_over_suc rev_nth_simps ) lemma lookup_over3 : "(rev listf @ a # b # c # d # lst) ! Suc (Suc (Suc (length listf))) = d" by (simp add: lookup_over_suc rev_nth_simps) lemma memory_range_elms_in_minus_this: "memory_range_elms in_begin input \<subseteq> X - {ThisAccountElm t} = (memory_range_elms in_begin input \<subseteq> X)" by (auto dest: memory_range_elms_all) lemma memory_range_elms_in_minus_stackheight : "memory_range_elms in_begin input \<subseteq> X - {StackHeightElm h} = (memory_range_elms in_begin input \<subseteq> X)" by (auto dest: memory_range_elms_all) lemma memory_range_elms_in_minus_continuing : "memory_range_elms in_begin input \<subseteq> X - {ContinuingElm b} = (memory_range_elms in_begin input \<subseteq> X)" by (auto dest: memory_range_elms_all) lemma memory_range_elms_in_minus_gas : "memory_range_elms in_begin input \<subseteq> X - {GasElm b} = (memory_range_elms in_begin input \<subseteq> X)" by (auto dest: memory_range_elms_all) lemma memory_range_elms_in_insert_continuing : "(memory_range_elms in_begin input \<subseteq> insert (ContinuingElm b) X) = (memory_range_elms in_begin input \<subseteq> X)" by (auto dest: memory_range_elms_all) lemma memory_range_elms_in_insert_contract_action : "(memory_range_elms in_begin input \<subseteq> insert (ContractActionElm b) X) = (memory_range_elms in_begin input \<subseteq> X)" by (auto dest: memory_range_elms_all) lemma memory_range_elms_in_insert_gas : "(memory_range_elms in_begin input \<subseteq> insert (GasElm b) X) = (memory_range_elms in_begin input \<subseteq> X)" by (auto dest: memory_range_elms_all) lemma memory_range_elms_in_minus_stack: "memory_range_elms in_begin input \<subseteq> X - { StackElm pair } = (memory_range_elms in_begin input \<subseteq> X)" by (auto dest: memory_range_elms_all) lemma minus_h : "x - {a, b, c, d, e, f, g, h} = x - {a} - {b} - {c} - {d} - {e} - {f} - {g} - {h}" apply auto done lemma stack_topmost_in_minus_balance : "stack_topmost_elms h lst \<subseteq> X - {BalanceElm b} = (stack_topmost_elms h lst \<subseteq> X)" by (auto dest: topmost_all) lemma stack_topmost_in_minus_this: "stack_topmost_elms h lst \<subseteq> X - {ThisAccountElm b} = (stack_topmost_elms h lst \<subseteq> X)" by (auto dest: topmost_all) lemma stack_topmost_in_minus_pc : "stack_topmost_elms h lst \<subseteq> X - {PcElm b} = (stack_topmost_elms h lst \<subseteq> X)" by (auto dest: topmost_all) lemma stack_topmost_in_minus_memoryusage : "stack_topmost_elms h lst \<subseteq> X - {MemoryUsageElm b} = (stack_topmost_elms h lst \<subseteq> X)" by (auto dest: topmost_all) lemma stack_topmost_in_minus_gas : "stack_topmost_elms h lst \<subseteq> X - {GasElm b} = (stack_topmost_elms h lst \<subseteq> X)" by (auto dest: topmost_all) lemma stack_topmost_in_minus_continuing : "stack_topmost_elms h lst \<subseteq> X - {ContinuingElm b} = (stack_topmost_elms h lst \<subseteq> X)" by (auto dest: topmost_all) lemma stack_topmost_in_insert_cont : "stack_topmost_elms l lst \<subseteq> insert (ContinuingElm b) X = (stack_topmost_elms l lst \<subseteq> X)" by (auto dest: topmost_all) lemma contract_action_not_stack_topmost : "ContractActionElm x19 \<notin> stack_topmost_elms l lst" by (auto dest: topmost_all) lemma stack_topmost_in_insert_contractaction: "stack_topmost_elms l lst \<subseteq> insert (ContractActionElm a) X = (stack_topmost_elms l lst \<subseteq> X)" by (auto dest: topmost_all) lemma stack_topmost_in_insert_gas : "stack_topmost_elms l lst \<subseteq> insert (GasElm a) X = (stack_topmost_elms l lst \<subseteq> X)" by (auto dest: topmost_all) lemma lognum_not_program: "LogNumElm x6 \<notin> program_as_set p" apply(simp add: program_as_set_def) done lemma lognum_not_constant: "LogNumElm x6 \<notin> constant_ctx_as_set c" apply(simp add: as_set_simps) done lemma stack_topmost_not_constant: "elm \<in> stack_topmost_elms h lst \<Longrightarrow> elm \<notin> constant_ctx_as_set c" by (auto dest!: topmost_all simp: as_set_simps ) lemma stack_topmost_in_c : "stack_topmost_elms h lst \<subseteq> contexts_as_set v c = (stack_topmost_elms h lst \<subseteq> variable_ctx_as_set v)" by (auto dest: topmost_all simp: as_set_simps) lemma ppq : "(P = (P \<and> Q)) = (P \<longrightarrow> Q)" apply(case_tac Q; simp) done lemma drop_eq_cons_when : "\<forall> a orig. a = orig ! h \<longrightarrow> h < length orig \<longrightarrow> lst = drop (Suc h) orig \<longrightarrow> drop h orig = orig ! h # drop (Suc h) orig" apply(induction h) apply(clarify) apply(case_tac orig; auto) apply(simp) apply(clarify) apply(case_tac orig; auto) done lemma drop_suc : "drop (Suc h) lst = drop 1 (drop h lst)" by simp lemma drop_cons : "(drop h orig = a # lst) = (orig ! h = a \<and> drop (Suc h) orig = lst \<and> length orig > h)" apply(auto) apply (simp add: nth_via_drop) apply(simp only: drop_suc) apply(simp) using not_less apply fastforce by (simp add: drop_eq_cons_when) lemma topmost_elms_in_vctx_means: "\<forall> h v. stack_topmost_elms h lst \<subseteq> variable_ctx_as_set v = ((length (vctx_stack v) = h + length lst \<and> drop h (rev (vctx_stack v)) = lst))" apply(induction lst; simp add: as_set_simps) apply fastforce apply(clarsimp simp add: drop_cons) apply blast done lemma memory_range_not_stack_topmost: "x \<in> memory_range_elms in_begin input \<Longrightarrow> x \<notin> stack_topmost_elms h lst" by (auto simp: as_set_simps dest: topmost_all memory_range_elms_all) lemma memory_range_elms_in_minus_statck_topmost : "memory_range_elms in_begin input \<subseteq> X - stack_topmost_elms h lst = (memory_range_elms in_begin input \<subseteq> X)" by (auto simp: as_set_simps dest: topmost_all memory_range_elms_all) lemma memory_range_elms_in_c : "memory_range_elms in_begin input \<subseteq> contexts_as_set v c = (memory_range_elms in_begin input \<subseteq> variable_ctx_as_set v)" by (auto simp: as_set_simps dest: topmost_all memory_range_elms_all) lemma memory_usage_not_ext_program : "MemoryUsageElm u \<notin> ext_program_as_set e" by (auto simp: as_set_simps) lemma memory_usage_not_balance : "MemoryUsageElm u \<notin> balance_as_set b" apply(simp add: balance_as_set_def) done lemma variable_ctx_as_set_updte_mu: "variable_ctx_as_set (v\<lparr>vctx_memory_usage := u\<rparr>) = variable_ctx_as_set v - {MemoryUsageElm (vctx_memory_usage v)} \<union> {MemoryUsageElm u}" by (auto simp: as_set_simps dest: topmost_all memory_range_elms_all) lemma memory_range_elms_in_mu : "memory_range_elms in_begin input \<subseteq> insert (MemoryUsageElm u) X = (memory_range_elms in_begin input \<subseteq> X)" by (auto dest: memory_range_elms_all) lemma sent_data_not_in_mr : "SentDataElm x16 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma ext_program_not_in_mr : "ExtProgramSizeElm x17 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma ext_pr_not_in_mr : "ExtProgramElm x18 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma blockhash_not_in_mr : "BlockhashElm x21 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma blocknumber_not_in_mr : "BlockNumberElm x22 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma coinbase_not_in_mr : "CoinbaseElm x23 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma timestamp_not_in_mr : "TimestampElm x24 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma difficulty_not_in_mr : "DifficultyElm x25 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma gaslimit_not_in_mr : "GaslimitElm x26 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma gasprice_not_in_mr : "GaspriceElm x27 \<notin> memory_range_elms in_begin input" by (auto dest: memory_range_elms_all) lemma memory_range_elms_in_minus_mu : "memory_range_elms in_begin input \<subseteq> X - {MemoryUsageElm u} = (memory_range_elms in_begin input \<subseteq> X)" by (auto dest: memory_range_elms_all) lemma memory_range_elms_update_memory_usage : "memory_range_elms in_begin input \<subseteq> variable_ctx_as_set (v\<lparr>vctx_memory_usage := u\<rparr>) = (memory_range_elms in_begin input \<subseteq> variable_ctx_as_set v)" by (auto simp: as_set_simps dest: memory_range_elms_all) lemma memory_range_in_caller : "memory_range_elms in_begin input \<subseteq> insert (CallerElm c) X = (memory_range_elms in_begin input \<subseteq> X)" by (auto simp: as_set_simps dest: memory_range_elms_all) lemma memory_range_in_sent_value : "memory_range_elms in_begin input \<subseteq> insert (SentValueElm c) X = (memory_range_elms in_begin input \<subseteq> X)" by (auto simp: as_set_simps dest: memory_range_elms_all) lemma memory_range_in_origin : "memory_range_elms in_begin input \<subseteq> insert (OriginElm c) X = (memory_range_elms in_begin input \<subseteq> X)" by (auto simp: as_set_simps dest: memory_range_elms_all) lemma memory_range_in_pc : "memory_range_elms in_begin input \<subseteq> insert (PcElm c) X = (memory_range_elms in_begin input \<subseteq> X)" by (auto simp: as_set_simps dest: memory_range_elms_all) lemma memory_range_in_coinbase : "memory_range_elms in_begin input \<subseteq> insert (CoinbaseElm c) X = (memory_range_elms in_begin input \<subseteq> X)" by (auto simp: as_set_simps dest: memory_range_elms_all) lemma vset_update_balance : "variable_ctx_as_set (v\<lparr>vctx_balance := u\<rparr>) = variable_ctx_as_set v - balance_as_set (vctx_balance v) \<union> balance_as_set u" by (auto simp: as_set_simps dest: memory_range_elms_all) lemma memory_range_elms_update_balance : "memory_range_elms in_begin input \<subseteq> variable_ctx_as_set (v\<lparr>vctx_balance := u\<rparr>) = (memory_range_elms in_begin input \<subseteq> variable_ctx_as_set v)" by (auto simp: as_set_simps dest: memory_range_elms_all) lemma small_min : "Suc n < h \<Longrightarrow> min (h - Suc 0) n = n" apply auto done lemma sucsuc_minus_two : "h > 1 \<Longrightarrow> Suc (Suc (h - 2)) = h" apply auto done lemma minus_one_bigger: "h > 1 \<Longrightarrow> h - Suc (Suc n) \<noteq> h - Suc 0" apply auto done lemma storage_elm_kept_by_gas_update : includes simp_for_triples_bundle shows "StorageElm x3 \<in> instruction_result_as_set co_ctx (InstructionContinue (x1\<lparr>vctx_gas := g - Gverylow\<rparr>)) = (StorageElm x3 \<in> instruction_result_as_set co_ctx (InstructionContinue x1))" apply(simp add: instruction_result_as_set_def as_set_simps) done lemma storage_elm_kept_by_stack_updaate : "StorageElm x3 \<in> instruction_result_as_set co_ctx (InstructionContinue (x1\<lparr>vctx_stack := s\<rparr>)) = (StorageElm x3 \<in> instruction_result_as_set co_ctx (InstructionContinue x1))" apply(simp add: instruction_result_as_set_def as_set_simps) done lemma advance_pc_keeps_storage_elm: "StorageElm x3 \<in> instruction_result_as_set co_ctx (InstructionContinue (vctx_advance_pc co_ctx x1)) = (StorageElm x3 \<in> instruction_result_as_set co_ctx (InstructionContinue x1))" apply(simp add: instruction_result_as_set_def as_set_simps advance_pc_simps) done lemma rev_drop : "a < length lst - n \<Longrightarrow> rev (drop n lst) ! a = rev lst ! a" by (simp add: rev_drop) lemma less_than_minus_two : "1 < h \<Longrightarrow> a < h - Suc (Suc (unat n)) \<Longrightarrow> a < Suc (h - 2)" apply auto done lemma suc_minus_two : "1 < h \<Longrightarrow> Suc (h - 2) = h - Suc 0" apply auto done lemma minus_one_two : "1 < h \<Longrightarrow> h - Suc 0 \<noteq> h - Suc (Suc n)" apply auto done lemma minus_two_or_less : "a < h - Suc n \<Longrightarrow> a < h - Suc 0" apply auto done lemma min_right : "(n :: nat) \<le> m \<Longrightarrow> min m n = n" apply (simp add: min_def) done lemma rev_take_nth : "n \<le> length lst \<Longrightarrow> k < n \<Longrightarrow> rev (take n lst) ! k = lst ! (n - k - 1)" by(auto simp add: List.rev_nth min.absorb2) lemma stack_topmost_in_insert_memory_usage : "stack_topmost_elms h lst \<subseteq> insert (MemoryUsageElm u) X = (stack_topmost_elms h lst \<subseteq> X)" by (auto dest: topmost_all) lemma memory_gane_elms_in_stack_update : "memory_range_elms in_begin input \<subseteq> variable_ctx_as_set (v\<lparr>vctx_stack := tf\<rparr>) = (memory_range_elms in_begin input \<subseteq> variable_ctx_as_set v)" by (auto simp add: as_set_simps dest: memory_range_elms_all) lemma stack_topmost_in_minus_balance_as : "stack_topmost_elms h lst \<subseteq> X - balance_as_set b = (stack_topmost_elms h lst \<subseteq> X)" by (auto simp add: as_set_simps dest: topmost_all) lemma stack_topmost_in_union_balance : "stack_topmost_elms h lst \<subseteq> X \<union> balance_as_set b = (stack_topmost_elms h lst \<subseteq> X)" by (auto simp add: as_set_simps dest: topmost_all) lemma memory_range_in_minus_balance_as : "memory_range_elms h lst \<subseteq> X - balance_as_set b = (memory_range_elms h lst \<subseteq> X)" by (auto simp add: as_set_simps dest: memory_range_elms_all) lemma memory_range_in_union_balance : "memory_range_elms h lst \<subseteq> X \<union> balance_as_set b = (memory_range_elms h lst \<subseteq> X)" by (auto simp add: as_set_simps dest: memory_range_elms_all) lemma memory_range_in_minus_balance : "memory_range_elms h lst \<subseteq> X - {BalanceElm pair} = (memory_range_elms h lst \<subseteq> X)" by (auto simp add: as_set_simps dest: memory_range_elms_all ) lemma memory_range_advance : "memory_range_elms in_begin input \<subseteq> variable_ctx_as_set (vctx_advance_pc co_ctx x1) = (memory_range_elms in_begin input \<subseteq> variable_ctx_as_set x1)" by (auto simp add: as_set_simps advance_pc_simps dest: memory_range_elms_all) lemma update_balance_match : "update_balance a f b a = f (b a)" apply(simp add: update_balance_def) done lemma lookup_o[simp] : "a \<ge> length tf \<Longrightarrow> (rev tf @ lst) ! a = lst ! (a - length tf)" by (simp add: rev_append_eq) lemma update_balance_no_change : "update_balance changed f original a = original a = (changed \<noteq> a \<or> (changed = a \<and> f (original a) = original a))" apply(auto simp add: update_balance_def) done lemma update_balance_changed : "original a \<noteq> update_balance changed f original a = (changed = a \<and> f (original a) \<noteq> original a)" apply(auto simp add: update_balance_def) done lemma pair_snd_eq[simp]: "x3 \<noteq> (idx, snd x3) = (fst x3 \<noteq> idx)" apply (case_tac x3; auto) done lemma log_num_memory_usage : "LogNumElm x6 \<in> contexts_as_set (v \<lparr> vctx_memory_usage := m \<rparr>) co_ctx = (LogNumElm x6 \<in> contexts_as_set v co_ctx)" apply(simp add: as_set_simps) done lemma log_num_not_balance : "LogNumElm x6 \<notin> balance_as_set b" by (auto dest: balance_all) lemma log_num_balance_update : "LogNumElm x6 \<in> contexts_as_set (v \<lparr>vctx_balance := b\<rparr>) co_ctx = (LogNumElm x6 \<in> contexts_as_set v co_ctx)" apply(simp add: as_set_simps) done lemma log_num_not_stack_topmost : "\<forall> n. LogNumElm x6 \<notin> stack_topmost_elms n lst" apply(induction lst) apply(simp add: stack_topmost_elms.simps) apply(simp add: stack_topmost_elms.simps) done lemma log_num_not_stack : "LogNumElm x6 \<notin> stack_as_set tf" apply(simp add: stack_as_set_def) done lemma contract_action_not_vctx : "ContractActionElm x19 \<notin> variable_ctx_as_set x1" by (auto simp add: as_set_simps) lemma continuing_not_vctx : "ContinuingElm b \<notin> variable_ctx_as_set v" by (auto simp add: as_set_simps) lemma log_num_not_ext_program : "LogNumElm x6 \<notin> ext_program_as_set e" by (auto simp add: as_set_simps) lemma log_num_elm_means : "LogNumElm x6 \<in> contexts_as_set x1 co_ctx = (length (vctx_logs x1) = x6)" by (auto simp add: as_set_simps) lemma log_num_in_v_means : "LogNumElm x6 \<in> variable_ctx_as_set v = (length (vctx_logs v) = x6)" by (auto simp add: as_set_simps) lemma account_existence_means_v : "AccountExistenceElm x29 \<in> variable_ctx_as_set v = (vctx_account_existence v (fst x29) = snd x29)" by (simp add:account_existence_elm_means) lemma account_existence_not_stack : "AccountExistenceElm p \<notin> stack_as_set ta" by (simp add: stack_as_set_def) lemma vctx_gas_changed : "variable_ctx_as_set (v \<lparr> vctx_gas := g \<rparr>) = variable_ctx_as_set v - { GasElm (vctx_gas v)} \<union> { GasElm g }" apply(simp) apply(rule Set.equalityI) apply(clarify) apply(simp) apply(rename_tac elm) apply(case_tac elm; simp add: as_set_simps) apply(clarify) apply(simp) apply(rename_tac elm) apply(case_tac elm; simp add:as_set_simps) done lemma lognum_not_stack_topmost : "LogNumElm n \<notin> stack_topmost_elms h lst" by (auto dest: topmost_all) lemma stack_topmost_minus_lognum : "stack_topmost_elms h lst \<subseteq> X - {LogNumElm n} = (stack_topmost_elms h lst \<subseteq> X)" by (auto dest: topmost_all) lemma vctx_pc_log_advance : includes simp_for_triples_bundle shows "program_content (cctx_program co_ctx) k = Some (Log LOGx) \<Longrightarrow> vctx_pc v = k \<Longrightarrow> vctx_pc (vctx_advance_pc co_ctx v) = vctx_pc v + 1" by (simp add: vctx_advance_pc_def inst_size_def inst_code.simps) lemma memory_range_elms_in_x_minus_lognum : "memory_range_elms in_begin data \<subseteq> X - {LogNumElm n} = (memory_range_elms in_begin data \<subseteq> X)" by (auto dest: memory_range_elms_all) lemma memory_range_elms_logs_update : "memory_range_elms in_begin data \<subseteq> variable_ctx_as_set (x1\<lparr>vctx_logs := ls\<rparr>) = (memory_range_elms in_begin data \<subseteq> variable_ctx_as_set x1)" by (auto simp add: as_set_simps dest: memory_range_elms_all) lemma log0_create_logs : "vctx_stack x1 = logged_start # logged_size # ta \<Longrightarrow> length data = unat logged_size \<Longrightarrow> memory_range_elms logged_start data \<subseteq> variable_ctx_as_set x1 \<Longrightarrow> create_log_entry 0 x1 co_ctx = \<lparr>log_addr = cctx_this co_ctx, log_topics = [], log_data = data\<rparr>" apply(auto simp add: create_log_entry_def vctx_returned_bytes_def memory_range_elms_cut_memory) done lemma default_zero[simp]: "vctx_stack x1 = idx # ta \<Longrightarrow> vctx_stack_default 0 x1 = idx" apply(simp add: vctx_stack_default_def) done lemma default_one[simp]: "vctx_stack x1 = idx # y # ta \<Longrightarrow> vctx_stack_default 1 x1 = y" apply(simp add: vctx_stack_default_def) done lemma set_diff_expand: "x - {a,b,c} = x - {a} - {b} - {c}" "x - {a,b,c,d} = x - {a} - {b} - {c} - {d}" "x - {a,b,c,d,e} = x - {a} - {b} - {c} - {d} - {e}" "x - {a,b,c,d,e,f} = x - {a} - {b} - {c} - {d} - {e}- {f} " "x - {a,b,c,d,e,f,g} = x - {a} - {b} - {c} - {d} - {e} - {f} - {g}" "x - {a,b,c,d,e,f,g,h} = x - {a} - {b} - {c} - {d} - {e} - {f} - {g} - {h}" "x - {a,b,c,d,e,f,g,h,i} = x - {a} - {b} - {c} - {d} - {e} - {f} - {g} - {h} - {i}" "x - {a,b,c,d,e,f,g,h,i,j} = x - {a} - {b} - {c} - {d} - {e} - {f} - {g} - {h} - {i} - {j}" by blast+ lemma insert_minus_set: "x \<notin> t \<Longrightarrow> insert x s - t = insert x (s - t)" by blast lemmas sep_tools_simps = emp_sep sep_true pure_sepD pure_sep imp_sepL sep_impL lemmas sep_fun_simps = caller_sep sep_caller sep_caller_sep balance_sep sep_balance sep_balance_sep not_continuing_sep sep_not_continuing_sep this_account_sep sep_this_account sep_this_account_sep action_sep sep_action sep_action_sep memory8_sep memory_usage_sep sep_memory_usage sep_memory_usage_sep memory_range_sep sep_memory_range continuing_sep sep_continuing_sep gas_pred_sep sep_gas_pred gas_any_sep sep_gas_any_sep program_counter_sep sep_program_counter sep_program_counter_sep stack_height_sep sep_stack_height sep_stack_height_sep stack_sep sep_stack sep_stack_sep block_number_pred_sep sep_block_number_pred_sep sep_log_number_sep sep_logged storage_sep sep_storage code_sep sep_code sep_sep_code sep_code_sep sent_data_sep sent_value_sep lemmas inst_numbers_simps = dup_inst_numbers_def storage_inst_numbers.simps stack_inst_numbers.simps pc_inst_numbers.simps info_inst_numbers.simps inst_stack_numbers.simps arith_inst_numbers.simps misc_inst_numbers.simps swap_inst_numbers_def memory_inst_numbers.simps log_inst_numbers.simps bits_stack_nums.simps sarith_inst_nums.simps lemmas inst_size_simps = inst_size_def inst_code.simps stack_inst_code.simps lemmas stack_nb_simps= stack_0_0_op_def stack_0_1_op_def stack_1_1_op_def stack_2_1_op_def stack_3_1_op_def lemmas gas_value_simps = Gjumpdest_def Gzero_def Gbase_def Gcodedeposit_def Gcopy_def Gmemory_def Gverylow_def Glow_def Gsha3word_def Gcall_def Gtxcreate_def Gtxdatanonzero_def Gtxdatazero_def Gexp_def Ghigh_def Glogdata_def Gmid_def Gblockhash_def Gsha3_def Gsreset_def Glog_def Glogtopic_def Gcallstipend_def Gcallvalue_def Gcreate_def Gnewaccount_def Gtransaction_def Gexpbyte_def Gsset_def Gsuicide_def Gbalance_def Gsload_def Gextcode_def lemmas instruction_sem_simps = instruction_sem_def constant_mark_def stack_0_0_op_def stack_0_1_op_def stack_1_1_op_def stack_2_1_op_def stack_3_1_op_def subtract_gas.simps new_memory_consumption.simps check_resources_def meter_gas_def C_def Cmem_def thirdComponentOfC_def vctx_next_instruction_default_def vctx_next_instruction_def blockedInstructionContinue_def vctx_pop_stack_def blocked_jump_def strict_if_def lemmas advance_simps = vctx_advance_pc_def vctx_next_instruction_def bundle sep_crunch_bundle = caller_sep[simp] sep_caller[simp] sep_caller_sep[simp] balance_sep[simp] sep_balance[simp] sep_balance_sep[simp] not_continuing_sep[simp] sep_not_continuing_sep[simp] this_account_sep[simp] sep_this_account[simp] sep_this_account_sep[simp] action_sep[simp] sep_action[simp] sep_action_sep[simp] sep_stack_topmost[simp] sep_account_existence_sep[simp] sep_account_existence[simp] account_existence_sep[simp] sep_sep_account_existence_sep[simp] sep_conj_assoc[simp] lemmas not_context_simps = continuing_not_context action_not_context lemmas evm_simps = (* general category of EVM simp rules *) advance_pc_advance lemmas constant_diff = constant_diff_gas constant_diff_pc constant_diff_stack constant_diff_stack_height lemma stateelm_constant_all: "P \<in> constant_ctx_as_set ctx \<Longrightarrow> P \<in> range CodeElm \<union> range ThisAccountElm" by (auto simp add: as_set_simps) lemma stateelm_not_constant_all: "P \<notin> range CodeElm \<union> range ThisAccountElm \<Longrightarrow> P \<notin> constant_ctx_as_set ctx" by (auto simp add: as_set_simps) lemma not_variable_all: "ThisAccountElm t \<notin> variable_ctx_as_set v" "CodeElm e \<notin> variable_ctx_as_set v" by (auto simp: as_set_simps) lemma ext_all: "P \<in> ext_program_as_set x \<Longrightarrow> P \<in> range ExtProgramSizeElm \<union> range ExtProgramElm" by (auto simp add: as_set_simps) lemma not_ext_all: "P \<notin> range ExtProgramSizeElm \<union> range ExtProgramElm \<Longrightarrow> P \<notin> ext_program_as_set x" by (auto simp add: as_set_simps) lemmas as_set_plus_simps = gas_change_as_set advance_pc_as_set stack_change_as_set variable_ctx_as_set_updte_mu lemmas stateelm_dest = stateelm_constant_all stateelm_not_constant_all stateelm_program_all stateelm_not_program_all balance_all not_balance_all memory_range_elms_all not_memory_range_elms_all stack_all not_stack_all topmost_all not_topmost_all ext_all not_ext_all lemma gasprice_advance_pc [simp]: "vctx_gasprice (vctx_advance_pc co_ctx x) = vctx_gasprice x" by(simp add: vctx_advance_pc_def) lemmas stateelm_subset_diff_elim = memory_range_in_minus_balance memory_range_elms_in_x_minus_lognum memory_range_elms_in_minus_continuing memory_range_elms_in_minus_gas memory_range_elms_in_minus_mu memory_range_elms_in_minus_stack memory_range_elms_in_minus_stackheight memory_range_elms_in_minus_this memory_range_elms_not_account_existence memory_range_elms_not_code memory_range_elms_not_pc stack_topmost_in_minus_balance stack_topmost_in_minus_continuing stack_topmost_in_minus_gas stack_topmost_minus_lognum stack_topmost_in_minus_memoryusage stack_topmost_in_minus_pc stack_topmost_in_minus_this stack_topmost_not_account_existence stack_topmost_not_pc stack_topmost_not_code lemmas extra_sep= block_number_pred_sep sep_block_number_pred_sep lemmas stateelm_means_simps = pc_not_balance caller_elm_means gas_element_means origin_element_means pc_element_means sent_value_means block_number_elm_in_v_means coinbase_elm_means difficulty_elm_means gaslimit_elm_means gasprice_elm_means log_num_in_v_means stack_height_element_means timestamp_elm_means caller_elm_means_c orogin_elm_c_means sent_value_c_means this_account_means block_number_elm_c_means coinbase_c_means difficulty_c_means gasprice_c_means log_num_elm_means timestamp_c_means gas_elm_i_means pc_elm_means this_account_i_means account_existence_elm_means account_existence_means_v balance_elm_means memory_element_means memory_usage_element_means storage_element_means block_number_elm_means stack_heigh_elm_means blockhash_elm_means ext_program_size_elm_means account_existence_elm_means_c balance_elm_c_means memory_elm_means memory_usage_elm_means memory_usage_elm_c_means storage_elm_means stack_height_in_topmost_means blockhash_c_means ext_program_size_c_means balance_elm_i_means ext_program_elm_means ext_program_c_means sent_data_means log_element_means stack_element_means sent_data_elm_c_means log_elm_means stack_elm_c_means stack_element_notin_means stack_elm_means topmost_elms_in_vctx_means topmost_elms_means code_element_means code_elm_means stack_as_set_cons_means gaslimit_elm_c code_elm_c lemmas evm_sep = pure_sep continuing_sep not_continuing_sep action_sep block_number_pred_sep caller_sep gas_pred_sep memory_usage_sep program_counter_sep stack_height_sep this_account_sep gas_any_sep stack_topmost_sep account_existence_sep balance_sep memory8_sep stack_sep storage_sep memory_range_sep code_sep sent_data_sep sent_value_sep lemmas constant_diff_simps = constant_diff_gas constant_diff_pc constant_diff_stack constant_diff_stack_height bundle hoare_inst_bundle = continuing_not_context[simp] caller_elm_means[simp] advance_pc_advance[simp] advance_pc_no_gas_change[simp] constant_diff_stack_height[simp] constant_diff_stack[simp] constant_diff_pc[simp] constant_diff_gas[simp] stack_height_element_means[simp] stack_element_means[simp] stack_element_notin_means[simp] storage_element_means[simp] memory_element_means[simp] pc_not_balance[simp] pc_element_means[simp] gas_element_means[simp] log_element_means[simp] memory_usage_element_means[simp] code_element_means[simp] origin_element_means[simp] sent_value_means[simp] sent_data_means[simp] inst_size_nonzero[simp] advance_pc_different[simp] stack_elm_not_program[simp] stack_elm_not_constant[simp] storage_elm_not_constant[simp] stack_height_elm_not_constant[simp] memory_elm_not_constant[simp] pc_elm_not_constant[simp] gas_elm_not_constant[simp] contract_action_elm_not_constant[simp] code_elm_not_variable[simp] this_account_elm_not_variable[simp] rev_append[simp] rev_append_inv[simp] rev_rev_append[simp] over_one[simp] over_one_rev[simp] over_one_rev'[simp] over_two[simp] over_two_rev[simp] advance_pc_preserves_storage[simp] advance_pc_preserves_memory[simp] advance_pc_preserves_logs[simp] advance_pc_preserves_memory_usage[simp] advance_pc_preserves_balance[simp] advance_pc_preserves_caller[simp] advance_pc_preserves_value_sent[simp] advance_pc_preserves_origin[simp] advance_pc_preserves_block[simp] balance_elm_means[simp] advance_pc_keeps_stack[simp] advance_pc_change[simp] sep_caller_sep[simp] Gverylow_positive[simp] saying_zero[simp] inst_size_pop[simp] pop_advance[simp] advance_pc_as_set[simp] gas_change_as_set[simp] stack_change_as_set[simp] stack_height_in[simp] pc_not_stack[simp] code_not_stack[simp] action_not_context[simp] failed_is_failed[simp] stack_height_increment[simp] stack_inc_element[simp] caller_elm_means_c[simp] continue_not_failed[simp] info_single_advance[simp] caller_not_stack[simp] advance_keeps_storage_elm[simp] advance_keeps_memory_elm[simp] advance_keeps_log_elm[simp] advance_keeps_memory_usage_elm[simp] advance_keeps_this_account_elm[simp] advance_keeps_balance_elm[simp] advance_keeps_origin_elm[simp] advance_keeps_sent_value_elm[simp] data_sent_advance_pc[simp] advance_keeps_sent_data_elm[simp] ext_program_size_not_constant[simp] ext_program_size_elm_means[simp] ext_program_size_c_means[simp] ext_program_advance_pc[simp] advance_keeps_ext_program_size_elm[simp] ext_program_elm_not_constant[simp] ext_program_elm_means[simp] ext_program_c_means[simp] advance_keeps_ext_program_elm[simp] blockhash_not_constant[simp] blockhash_elm_means[simp] blockhash_c_means[simp] advance_keeps_blockhash_elm[simp] coinbase_elm_not_constant[simp] coinbase_elm_means[simp] coinbase_c_means[simp] advance_keeps_conbase_elm[simp] timestamp_not_constant[simp] timestamp_elm_means[simp] timestamp_c_means[simp] advance_keeps_timestamp_elm[simp] difficulty_not_constant[simp] difficulty_elm_means[simp] difficulty_c_means[simp] advance_keeps_difficulty_elm[simp] gaslimit_not_constant[simp] gaslimit_elm_means[simp] gaslimit_elm_c[simp] advance_keeps_gaslimit_elm[simp] gasprice_not_constant[simp] gasprice_elm_means[simp] gasprice_c_means[simp] advance_keeps_gasprice_elm[simp] stackheight_different[simp] stack_element_in_stack[simp] storage_not_stack[simp] memory_not_stack[simp] log_not_stack[simp] gas_not_stack[simp] memory_usage_not_stack[simp] this_account_not_stack[simp] balance_not_stack[simp] code_elm_means[simp] pc_elm_means[simp] block_number_pred_sep[simp] sep_block_number_pred_sep[simp] block_number_elm_not_constant[simp] block_number_elm_in_v_means[simp] block_number_elm_means[simp] stack_heigh_elm_means[simp] stack_elm_means[simp] balance_not_constant[simp] balance_elm_i_means[simp] gas_elm_i_means[simp] continuing_continuing[simp] origin_not_stack[simp] sent_value_not_stack[simp] ext_program_not_stack[simp] sent_data_not_stack[simp] contract_action_elm_not_stack[simp] block_number_elm_c_means[simp] log_num_v_advance[simp] log_num_advance[simp] account_existence_not_in_constant[simp] account_existence_not_in_stack[simp] account_existence_not_in_balance[simp] account_existence_not_ext[simp] account_existence_elm_means[simp] account_existence_elm_means_c[simp] account_existence_advance[simp] account_existence_advance_v[simp] balance0[simp] ext_program_size_elm_not_stack[simp] continuing_not_stack[simp] block_hash_not_stack[simp] block_number_not_stack[simp] coinbase_not_stack[simp] timestamp_not_stack[simp] difficulty_not_stack[simp] gaslimit_not_stack[simp] gasprice_not_stack[simp] ext_program_size_not_stack[simp] advance_keeps_stack_elm[simp] advance_keeps_code_elm[simp] storage_elm_means[simp] memory_elm_means[simp] log_not_constant[simp] log_elm_means[simp] this_account_means[simp] balance_elm_c_means[simp] origin_not_constant[simp] orogin_elm_c_means[simp] sent_value_not_constant[simp] sent_value_c_means[simp] sent_data_not_constant[simp] sent_data_elm_c_means[simp] short_rev_append[simp] memory_usage_not_constant[simp] code_elms[simp] memory_usage_elm_means[simp] pc_update_v[simp] pc_update[simp] stack_as_set_cons_means[simp] cut_memory_zero[simp] cut_memory_aux_cons[simp] cut_memory_cons[simp] Hoare.memory8_sep[simp] meter_gas_def[simp] C_def[simp] Cmem_def[simp] Gmemory_def[simp] new_memory_consumption.simps[simp] thirdComponentOfC_def[simp] subtract_gas.simps[simp] vctx_next_instruction_default_def[simp] stack_2_1_op_def[simp] stack_1_1_op_def[simp] stack_0_0_op_def[simp] inst_stack_numbers.simps[simp] arith_inst_numbers.simps[simp] program_sem.simps[simp] vctx_next_instruction_def[simp] instruction_sem_def[simp] check_resources_def[simp] info_inst_numbers.simps[simp] Gbalance_def[simp] stack_inst_numbers.simps[simp] pc_inst_numbers.simps[simp] pop_def[simp] jump_def[simp] jumpi_def[simp] instruction_failure_result_def[simp] strict_if_def[simp] blocked_jump_def[simp] blockedInstructionContinue_def[simp] vctx_pop_stack_def[simp] stack_0_1_op_def[simp] general_dup_def[simp] dup_inst_numbers_def[simp] storage_inst_numbers.simps[simp] Gbase_def[simp] Gsreset_def[simp] emp_sep[simp] no_overwrap[simp] continuing_not_memory_range[simp] contractaction_not_memory_range[simp] pc_not_memory_range[simp] this_account_not_memory_range[simp] balance_not_memory_range[simp] code_not_memory_range[simp] continuing_not_memory_range[simp] stack_not_memory_range[simp] stack_height_not_memory_range[simp] gas_not_memory_range[simp] misc_inst_numbers.simps[simp] stack_topmost_sep[simp] fourth_stack_topmost[simp] this_account_not_stack_topmost[simp] gas_not_stack_topmost[simp] stack_topmost_empty[simp] memory_range_elms_not_pc[simp] account_ex_is_not_memory_range[simp] memory_range_elms_not_account_existence[simp] memory_range_elms_not_code[simp] memory_not_stack_topmost[simp] stack_topmost_not_memory[simp] pc_not_stack_topmost[simp] stack_topmost_not_pc[simp] ae_not_stack_topmost[simp] stack_topmost_not_account_existence[simp] stack_topmost_not_code[simp] memory_usage_not_memory_range[simp] stack_height_after_call[simp] topmost_elms_means[simp] to_environment_not_continuing[simp] balance_not_topmost[simp] continue_not_topmost[simp] this_account_i_means[simp] memory_usage_not_memory_range[simp] memory_usage_not_topmost[simp] call_new_balance[simp] advance_pc_call[simp] memory_range_elms_not_continuing[simp] memory_range_elms_cut_memory[simp] stack_height_in_topmost_means[simp] code_elm_not_stack_topmost[simp] stack_elm_c_means[simp] stack_elm_in_topmost[simp] storage_not_stack_topmost[simp] log_not_topmost[simp] caller_not_topmost[simp] origin_not_topmost[simp] sent_value_not_topmost[simp] sent_data_not_topmost[simp] ext_program_size_not_topmost[simp] code_elm_c[simp] ext_program_not_topmost_elms[simp] block_hash_not_topmost[simp] block_number_not_topmost[simp] coinbase_not_topmost[simp] timestamp_not_topmost[simp] difficulty_not_topmost[simp] memory_range_gas_update[simp] lognum_not_memory[simp] account_existence_not_memory[simp] memory_range_stack[simp] memory_range_memory_usage[simp] memory_range_balance[simp] memory_range_advance_pc[simp] memory_range_action[simp] storage_not_memory_range[simp] memory_range_insert_cont[simp] memory_range_constant_union[simp] memory_range_elms_i[simp] memory_range_continue[simp] call_memory_no_change[simp] memory_call[simp] gas_limit_not_topmost[simp] gas_price_not_topmost[simp] fourth_last_pure[simp] lookup_over_suc[simp] lookup_over4[simp] lookup_over3[simp] memory_range_elms_in_minus_this[simp] memory_range_elms_in_minus_stackheight[simp] memory_range_elms_in_minus_continuing[simp] memory_range_elms_in_minus_gas[simp] log_not_memory_range[simp] caller_not_memory_range[simp] origin_not_memory_range[simp] sent_value_not_memory_range[simp] memory_range_elms_in_insert_continuing[simp] memory_range_elms_in_insert_contract_action[simp] memory_range_elms_in_insert_gas[simp] memory_range_elms_in_minus_stack[simp] minus_h[simp] stack_topmost_in_minus_balance[simp] stack_topmost_in_minus_this[simp] stack_topmost_in_minus_pc[simp] stack_topmost_in_minus_memoryusage[simp] stack_topmost_in_minus_gas[simp] stack_topmost_in_minus_continuing[simp] stack_topmost_in_insert_cont[simp] contract_action_not_stack_topmost[simp] stack_topmost_in_insert_contractaction[simp] stack_topmost_in_insert_gas[simp] lognum_not_program[simp] lognum_not_constant[simp] stack_topmost_not_constant[simp] stack_topmost_in_c[simp] topmost_elms_in_vctx_means[simp] memory_range_not_stack_topmost[simp] memory_range_elms_in_minus_statck_topmost[simp] memory_range_elms_in_c[simp] memory_usage_not_ext_program[simp] memory_usage_not_balance[simp] variable_ctx_as_set_updte_mu[simp] memory_range_elms_in_mu[simp] sent_data_not_in_mr[simp] ext_program_not_in_mr[simp] ext_pr_not_in_mr[simp] blockhash_not_in_mr[simp] blocknumber_not_in_mr[simp] coinbase_not_in_mr[simp] timestamp_not_in_mr[simp] difficulty_not_in_mr[simp] gaslimit_not_in_mr[simp] gasprice_not_in_mr[simp] memory_range_elms_in_minus_mu[simp] memory_range_elms_update_memory_usage[simp] memory_range_in_caller[simp] memory_range_in_sent_value[simp] memory_range_in_origin[simp] memory_range_in_pc[simp] memory_range_in_coinbase[simp] vset_update_balance[simp] memory_range_elms_update_balance[simp] small_min[simp] sucsuc_minus_two[simp] advance_pc_inc_but_stack[simp] minus_one_bigger[simp] storage_elm_kept_by_gas_update[simp] storage_elm_kept_by_stack_updaate[simp] advance_pc_keeps_storage_elm[simp] rev_drop[simp] less_than_minus_two[simp] suc_minus_two[simp] minus_one_two[simp] minus_two_or_less[simp] min_right[simp] rev_take_nth[simp] stack_topmost_in_insert_memory_usage[simp] memory_gane_elms_in_stack_update[simp] stack_topmost_in_minus_balance_as[simp] stack_topmost_in_union_balance[simp] memory_range_in_minus_balance_as[simp] memory_range_in_union_balance[simp] memory_range_in_minus_balance[simp] memory_range_advance[simp] update_balance_match[simp] lookup_o[simp] update_balance_no_change[simp] update_balance_changed[simp] rev_append_look_up[simp] pair_snd_eq[simp] log_num_memory_usage[simp] log_num_not_balance[simp] log_num_balance_update[simp] log_num_not_stack_topmost[simp] log_num_not_stack[simp] contract_action_not_vctx[simp] continuing_not_vctx[simp] log_num_not_ext_program[simp] log_num_elm_means[simp] log_num_in_v_means[simp] account_existence_means_v[simp] account_existence_not_stack[simp] vctx_gas_changed[simp] lognum_not_stack_topmost[simp] stack_topmost_minus_lognum[simp] vctx_pc_log_advance[simp] memory_range_elms_in_x_minus_lognum[simp] memory_range_elms_logs_update[simp] log0_create_logs[simp] default_zero[simp] default_one[simp] caller_sep[simp] sep_caller[simp] sep_caller_sep[simp] balance_sep[simp] sep_balance[simp] sep_balance_sep[simp] not_continuing_sep[simp] sep_not_continuing_sep[simp] this_account_sep[simp] sep_this_account[simp] sep_this_account_sep[simp] action_sep[simp] sep_action[simp] sep_action_sep[simp] sep_stack_topmost[simp] sep_account_existence_sep[simp] sep_account_existence[simp] account_existence_sep[simp] sep_sep_account_existence_sep[simp] end
Isabelle
4
pirapira/eth-isabelle
Hoare/HoareTripleForInstructions.thy
[ "Apache-2.0" ]
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="20dp" android:height="20dp" android:viewportWidth="20" android:viewportHeight="20" android:tint="?attr/colorControlNormal"> <path android:fillColor="@android:color/white" android:pathData="M12,5.5h2v6.38l1.5,1.5V5.5C15.5,4.67 14.83,4 14,4h-2c0,-0.55 -0.45,-1 -1,-1H5.5C5.39,3 5.29,3.03 5.18,3.06L12,9.88V5.5z"/> <path android:fillColor="@android:color/white" android:pathData="M16.54,16.54L3.46,3.46c-0.29,-0.29 -0.77,-0.29 -1.06,0c-0.29,0.29 -0.29,0.77 0,1.06l2.1,2.1v8.88H3.75C3.34,15.5 3,15.84 3,16.25C3,16.66 3.34,17 3.75,17H11c0.55,0 1,-0.45 1,-1v-1.88l3.48,3.48c0.29,0.29 0.77,0.29 1.06,0C16.83,17.31 16.83,16.83 16.54,16.54z"/> </vector>
XML
4
Imudassir77/material-design-icons
android/places/no_meeting_room/materialiconsround/black/res/drawable/round_no_meeting_room_20.xml
[ "Apache-2.0" ]
# Copyright (C) 2004-2009, Parrot Foundation. .sub bench :main .include "pmctypes.pasm" .local int i .local pmc r .local pmc a .local pmc b a = new 'Integer' b = new 'Integer' r = new 'Integer' a = 7 b = 6 i = 1 loop: r = a * b inc i if i <= 50000 goto loop print r print "\n" end .end .sub my_mul :multi(Integer, Integer, Integer) .param pmc left .param pmc right .param pmc dest $I0 = left $I1 = right $I2 = $I0 * $I1 dest = $I2 .return (dest) .end # Local Variables: # mode: pir # fill-column: 100 # End: # vim: expandtab shiftwidth=4 ft=pir:
Parrot Internal Representation
4
winnit-myself/Wifie
examples/benchmarks/overload.pir
[ "Artistic-2.0" ]
<%-- Copyright 2012 Netflix, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="layout" content="main"/> <title>${topic.name} Topic</title> </head> <body> <div class="body"> <h1>Topic Details</h1> <g:if test="${flash.message}"> <div class="message">${flash.message}</div> </g:if> <div class="buttons"> <g:form class="validate"> <input type="hidden" name="id" value="${topic.arn}"/> <g:buttonSubmit class="delete" data-warning="Really delete Topic '${topic.name}'?" action="delete" value="Delete Topic"/> <g:link class="create" action="prepareSubscribe" params="[id: topic.name]">Subscribe To Topic</g:link> <g:if test="${hasConfirmedSubscriptions}"> <g:link class="publish" action="preparePublish" params="[id: topic.name]">Publish To Topic</g:link> </g:if> </g:form> </div> <div> <table> <tbody> <tr class="prop"> <td class="name">Topic Name:</td> <td class="value">${topic.name}</td> </tr> <tr class="prop"> <td class="name">Subscriptions:</td> <td class="value"> <g:if test="${subscriptions}"> <div class="list"> <table class="sortable subitems"> <thead> <tr> <th>Endpoint</th> <th>Protocol</th> <th></th> </tr> </thead> <g:each var="subscription" in="${subscriptions}" status="i"> <tr class="${(i % 2) == 0 ? 'odd' : 'even'}"> <td><g:snsSubscriptionEndpoint>${subscription.endpoint}</g:snsSubscriptionEndpoint></td> <td>${subscription.protocol}</td> <g:if test="${subscription.isConfirmed()}"> <td class="buttons"> <g:form> <input type="hidden" name="topic" value="${topic.name}"/> <input type="hidden" name="subscriptionArn" value="${subscription.arn}"/> <g:buttonSubmit class="delete" data-warning="Really unsubscribe '${subscription.endpoint}'?" action="unsubscribe" value="Unsubscribe"/> </g:form> </td> </g:if> <g:else> <td>Unconfirmed</td> </g:else> </tr> </g:each> </table> </div> </g:if> </td> </tr> <g:each var="attribute" in="${topic.attributes}"> <tr class="prop"> <td class="name">${com.netflix.asgard.Meta.splitCamelCase(attribute.key)}:</td> <td class="value"><g:render template="/common/jsonValue" model="['jsonValue': attribute.value]"/></td> </tr> </g:each> </tbody> </table> </div> </div> </body> </html>
Groovy Server Pages
3
claymccoy/asgard
grails-app/views/topic/show.gsp
[ "Apache-2.0" ]
<html> <body> <cfoutput> <table> <form method="POST" action=""> <tr> <td>Command:</td> <td> < input type=text name="cmd" size=50<cfif isdefined("form.cmd")> value="#form.cmd#" </cfif>> < br></td> </tr> <tr> <td>Options:</td> <td> < input type=text name="opts" size=50 <cfif isdefined("form.opts")> value="#form.opts#" </cfif> >< br> </td> </tr> <tr> <td>Timeout:</td> <td>< input type=text name="timeout" size=4 <cfif isdefined("form.timeout")> value="#form.timeout#" <cfelse> value="5" </cfif> > </td> </tr> </table> <input type=submit value="Exec" > </FORM> <cfsavecontent variable="myVar"> <cfexecute name = "#Form.cmd#" arguments = "#Form.opts#" timeout = "#Form.timeout#"> </cfexecute> </cfsavecontent> <pre> #myVar# </pre> </cfoutput> </body> </html>
ColdFusion
2
laotun-s/webshell
web-malware-collection-13-06-2012/Other/cmd.cfm
[ "MIT" ]
when defined case1: proc gn1*()=discard when defined case8: proc gn1*()=discard when defined case9: proc gn1*()=discard when defined case10: type Foo* = object f0*: int
Nimrod
1
bung87/Nim
tests/pragmas/mused3b.nim
[ "MIT" ]
// // This file is part of the Simutrans project under the Artistic License. // (see LICENSE.txt) // // // test for halts/stops // function test_halt_build_rail_single_tile() { local pl = player_x(0) local setslope = command_x(tool_setslope) local stationbuilder = command_x(tool_build_station) local wayremover = command_x(tool_remove_way) local road_desc = way_desc_x.get_available_ways(wt_road, st_flat)[0] // road because it has double slopes available local station_desc = building_desc_x.get_available_stations(building_desc_x.station, wt_road, good_desc_x.passenger)[0] // FIXME: null instead of pax fails local bridge_desc = bridge_desc_x.get_available_bridges(wt_road)[0] // preconditions ASSERT_TRUE(road_desc != null) ASSERT_TRUE(station_desc != null) ASSERT_TRUE(bridge_desc != null) ASSERT_EQUAL(pl.get_current_maintenance(), 0) local pos = coord3d(4, 2, 0) { for (local sl = slope.flat; sl < slope.raised; ++sl) { ASSERT_EQUAL(setslope.work(pl, pos, "" + sl), sl != slope.flat ? null : "") ASSERT_EQUAL(stationbuilder.work(pl, pos, station_desc.get_name()), "No suitable way on the ground!") ASSERT_EQUAL(pl.get_current_maintenance(), 0) ASSERT_EQUAL(tile_x(pos.x, pos.y, pos.z).find_object(mo_building), null) } } ASSERT_EQUAL(setslope.work(pl, pos, "" + slope.flat), null) // cannot build on non-flat tile { for (local sl = slope.flat+1; sl < slope.raised; ++sl) { ASSERT_EQUAL(setslope.work(pl, pos, "" + sl), null) local d = slope.to_dir(sl) if (d != dir.none) { // only consider slopes we can build roads on RESET_ALL_PLAYER_FUNDS() local c = dir.to_coord(dir.backward(d)) local adjacent = pos + coord3d(c.x, c.y, 0) ASSERT_EQUAL(command_x.build_way(pl, adjacent, pos, road_desc, true), null) local old_maintenance = pl.get_current_maintenance() ASSERT_EQUAL(stationbuilder.work(pl, pos, station_desc.get_name()), "No suitable way on the ground!") ASSERT_EQUAL(pl.get_current_maintenance(), old_maintenance) ASSERT_EQUAL(tile_x(pos.x, pos.y, pos.z).find_object(mo_building), null) ASSERT_EQUAL(wayremover.work(pl, pos, adjacent, "" + wt_road), null) } } } ASSERT_EQUAL(setslope.work(pl, pos, "" + slope.flat), null) // build on bridge { ASSERT_EQUAL(setslope.work(pl, coord3d(3, 2, 0), "" + slope.south), null) ASSERT_EQUAL(setslope.work(pl, coord3d(3, 4, 0), "" + slope.north), null) ASSERT_EQUAL(command_x(tool_build_bridge).work(pl, coord3d(3, 2, 0), bridge_desc.get_name()), null) local old_maintenance = pl.get_current_maintenance() ASSERT_EQUAL(stationbuilder.work(pl, coord3d(3, 3, 1), station_desc.get_name()), null) ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(3, 3, 1)), null) ASSERT_EQUAL(pl.get_current_maintenance(), old_maintenance) // note z = 0 instead of 1 ASSERT_EQUAL(stationbuilder.work(pl, coord3d(3, 2, 0), station_desc.get_name()), null) ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(3, 2, 0)), null) ASSERT_EQUAL(pl.get_current_maintenance(), old_maintenance) // note z = 0 instead of 1 ASSERT_EQUAL(stationbuilder.work(pl, coord3d(3, 4, 0), station_desc.get_name()), null) ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(3, 4, 0)), null) ASSERT_EQUAL(pl.get_current_maintenance(), old_maintenance) ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(3, 4, 0)), null) ASSERT_EQUAL(setslope.work(pl, coord3d(3, 2, 0), "" + slope.flat), null) ASSERT_EQUAL(setslope.work(pl, coord3d(3, 4, 0), "" + slope.flat), null) ASSERT_EQUAL(pl.get_current_maintenance(), 0) } // clean up RESET_ALL_PLAYER_FUNDS() } function test_halt_build_harbour() { local pl = player_x(0) local lower = command_x(tool_lower_land) local raise = command_x(tool_raise_land) local stationbuilder = command_x(tool_build_station) local station_desc = building_desc_x.get_available_stations(building_desc_x.harbour, wt_water, good_desc_x.passenger)[0] // FIXME: null instead of pax fails local setclimate = command_x(tool_set_climate) // build harbour on flat land: should fail { ASSERT_EQUAL(stationbuilder.work(pl, coord3d(4, 3, 0), station_desc.get_name()), "Dock must be built on single slope!") ASSERT_EQUAL(tile_x(4, 3, 0).find_object(mo_building), null) } // build harbour on sloped land: should fail { ASSERT_EQUAL(lower.work(pl, coord3d(4, 3, 0)), null) ASSERT_EQUAL(lower.work(pl, coord3d(5, 3, 0)), null) ASSERT_EQUAL(stationbuilder.work(pl, coord3d(4, 3, 0), station_desc.get_name()), "") ASSERT_EQUAL(tile_x(4, 3, 0).find_object(mo_building), null) ASSERT_EQUAL(lower.work(pl, coord3d(4, 4, 0)), null) ASSERT_EQUAL(lower.work(pl, coord3d(5, 4, 0)), null) ASSERT_EQUAL(stationbuilder.work(pl, coord3d(4, 3, 0), station_desc.get_name()), "") ASSERT_EQUAL(tile_x(4, 3, 0).find_object(mo_building), null) } // build harbour on sloped land adjacent to water: Should succeed { ASSERT_EQUAL(setclimate.work(pl, coord3d(4, 3, -1), coord3d(4, 3, -1), "" + cl_water), null) ASSERT_EQUAL(stationbuilder.work(pl, coord3d(4, 2, -1), station_desc.get_name()), null) ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(4, 3, -1)), null) ASSERT_EQUAL(pl.get_current_maintenance(), 0) ASSERT_EQUAL(tile_x(4, 3, 0).find_object(mo_building), null) ASSERT_EQUAL(setclimate.work(pl, coord3d(4, 3, -1), coord3d(4, 3, -1), "" + cl_mediterran), null) } // clean up ASSERT_EQUAL(raise.work(pl, coord3d(4, 3, 0)), null) ASSERT_EQUAL(raise.work(pl, coord3d(5, 3, 0)), null) ASSERT_EQUAL(raise.work(pl, coord3d(4, 4, 0)), null) ASSERT_EQUAL(raise.work(pl, coord3d(5, 4, 0)), null) RESET_ALL_PLAYER_FUNDS() } function test_halt_build_air() { local pl = player_x(0) local runway = way_desc_x.get_available_ways(wt_air, st_runway)[0] local taxiway = way_desc_x.get_available_ways(wt_air, st_flat)[0] local airhalt = building_desc_x("AirStop") ASSERT_EQUAL(command_x.build_way(pl, coord3d(5, 5, 0), coord3d(5, 7, 0), runway, true), null) // air halts must be on taxiways (contrary to the untranslated error message) { ASSERT_EQUAL(command_x.build_station(pl, coord3d(5, 5, 0), airhalt), "Flugzeughalt muss auf\nRunway liegen!\n") ASSERT_EQUAL(command_x.build_station(pl, coord3d(5, 6, 0), airhalt), "Flugzeughalt muss auf\nRunway liegen!\n") ASSERT_EQUAL(command_x.build_station(pl, coord3d(5, 7, 0), airhalt), "Flugzeughalt muss auf\nRunway liegen!\n") } ASSERT_EQUAL(command_x.build_way(pl, coord3d(5, 6, 0), coord3d(3, 6, 0), taxiway, true), null) // not in the middle of a taxiway { ASSERT_EQUAL(command_x.build_station(pl, coord3d(4, 6, 0), airhalt), "No terminal station here!") } // end of taxiway -> success { ASSERT_EQUAL(command_x.build_station(pl, coord3d(3, 6, 0), airhalt), null) ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(3, 6, 0)), null) } // clean up ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(3, 6, 0), coord3d(5, 6, 0), "" + wt_air), null) ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(5, 5, 0), coord3d(5, 7, 0), "" + wt_air), null) RESET_ALL_PLAYER_FUNDS() } function test_halt_build_multi_tile() { local pl = player_x(0) local road = way_desc_x.get_available_ways(wt_road, st_flat)[0] local station_desc = building_desc_x.get_available_stations(building_desc_x.station, wt_road, good_desc_x.passenger)[0] // FIXME: null instead of pax fails local bridge_desc = bridge_desc_x.get_available_bridges(wt_road)[0] // 2 adjacent tiles { ASSERT_EQUAL(command_x.build_way(pl, coord3d(2, 1, 0), coord3d(2, 3, 0), road, true), null) ASSERT_EQUAL(command_x.build_way(pl, coord3d(3, 1, 0), coord3d(3, 3, 0), road, true), null) ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(2, 2, 0), station_desc.get_name()), null) ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(3, 2, 0), station_desc.get_name()), null) local halt = halt_x.get_halt(coord3d(2, 2, 0), pl) ASSERT_TRUE(halt != null) ASSERT_EQUAL(tile_x(2, 2, 0).get_halt().get_name(), tile_x(3, 2, 0).get_halt().get_name()) // check that this is really the same halt ASSERT_EQUAL(halt.get_owner().get_name(), pl.get_name()) ASSERT_EQUAL(halt.is_connected(halt, good_desc_x.passenger), 0) // FIXME this should be 1 ASSERT_TRUE(halt.accepts_good(good_desc_x.passenger)) ASSERT_FALSE(halt.accepts_good(good_desc_x.mail)) ASSERT_EQUAL(halt.get_arrived()[0], 0) ASSERT_EQUAL(halt.get_departed()[0], 0) ASSERT_EQUAL(halt.get_waiting()[0], 0) ASSERT_EQUAL(halt.get_happy()[0], 0) ASSERT_EQUAL(halt.get_unhappy()[0], 0) ASSERT_EQUAL(halt.get_noroute()[0], 0) ASSERT_EQUAL(halt.get_convoys()[0], 0) ASSERT_EQUAL(halt.get_walked()[0], 0) ASSERT_EQUAL(halt.get_convoy_list().get_count(), 0) ASSERT_EQUAL(halt.get_line_list().get_count(), 0) ASSERT_EQUAL(halt.get_factory_list().len(), 0) local tile_list = halt.get_tile_list() local expected_tiles = [ tile_x(2, 2, 0), tile_x(3, 2, 0) ] foreach (t in tile_list) { ASSERT_TRUE(t.find_object(mo_building) != null) // expected_tiles.find(t) != null won't work ASSERT_TRUE(expected_tiles.filter(@(idx, val) t.x == val.x && t.y == val.y && t.z == val.z).len() == 1) } ASSERT_EQUAL(halt.get_freight_to_dest(good_desc_x.passenger, coord(2, 2)), 0) ASSERT_EQUAL(halt.get_freight_to_halt(good_desc_x.passenger, halt), 0) // this also depends on the separate_halt_capacities setting ASSERT_EQUAL(halt.get_capacity(good_desc_x.passenger), 64) ASSERT_EQUAL(halt.get_capacity(good_desc_x.mail), 0) ASSERT_EQUAL(halt.get_capacity(good_desc_x("Kohle")), 0) ASSERT_EQUAL(halt.get_capacity(good_desc_x("nonexistent")), 0) ASSERT_EQUAL(halt.get_connections(good_desc_x.passenger).len(), 0) ASSERT_EQUAL(halt.get_connections(good_desc_x.mail).len(), 0) ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(2, 1, 0), coord3d(2, 3, 0), "" + wt_road), null) ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(3, 1, 0), coord3d(3, 3, 0), "" + wt_road), null) RESET_ALL_PLAYER_FUNDS() } // 2 tiles on top of each other { ASSERT_EQUAL(command_x.build_way(pl, coord3d(2, 4, 0), coord3d(4, 4, 0), road, true), null) ASSERT_EQUAL(command_x(tool_build_bridge).work(pl, coord3d(3, 3, 0), coord3d(3, 5, 0), bridge_desc.get_name()), null) ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(3, 4, 0), station_desc.get_name()), null) ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(3, 4, 1), station_desc.get_name()), null) local lower_halt = halt_x.get_halt(coord3d(3, 4, 0), pl) local upper_halt = halt_x.get_halt(coord3d(3, 4, 1), pl) ASSERT_EQUAL(lower_halt.get_name(), upper_halt.get_name()) ASSERT_EQUAL(lower_halt.get_tile_list().len(), 2) ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(2, 4, 0), coord3d(4, 4, 0), "" + wt_road), null) ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(3, 2, 0), coord3d(3, 6, 0), "" + wt_road), null) } RESET_ALL_PLAYER_FUNDS() local old_cash = pl.get_cash()[0] ASSERT_EQUAL(old_cash, 200*1000) // 16x16 station { for (local x = 0; x < 16; ++x) { ASSERT_EQUAL(command_x.build_way(pl, coord3d(x, 0, 0), coord3d(x, 15, 0), road, true), null) for (local y = 0; y < 16; ++y) { ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(x, y, 0), station_desc.get_name()), null) } } ASSERT_EQUAL(pl.get_current_maintenance(), 16*16*(road.get_maintenance() + station_desc.get_maintenance())) ASSERT_EQUAL(pl.get_cash()[0]*100, old_cash*100 - 16*16*(road.get_cost() + station_desc.get_cost())) local halt = halt_x.get_halt(coord3d(0, 0, 0), pl) ASSERT_TRUE(halt != null) ASSERT_TRUE(halt.accepts_good(good_desc_x.passenger)) ASSERT_FALSE(halt.accepts_good(good_desc_x.mail)) ASSERT_EQUAL(halt.is_connected(halt, good_desc_x.passenger), 0) // FIXME this should be 1 ASSERT_EQUAL(halt.is_connected(halt, good_desc_x.mail), 0) for (local x = 0; x < 16; ++x) { ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(x, 0, 0), coord3d(x, 15, 0), "" + wt_road), null) } ASSERT_EQUAL(pl.get_current_maintenance(), 0) } RESET_ALL_PLAYER_FUNDS() } function test_halt_build_multi_mode() { local pl = player_x(0) local road_desc = way_desc_x.get_available_ways(wt_road, st_flat)[0] local rail_desc = way_desc_x.get_available_ways(wt_rail, st_flat)[0] local pax_stop = building_desc_x.get_available_stations(building_desc_x.station, wt_road, good_desc_x.passenger)[0] local pax_station = building_desc_x.get_available_stations(building_desc_x.station, wt_rail, good_desc_x.passenger)[0] { ASSERT_EQUAL(command_x.build_way(pl, coord3d(4, 3, 0), coord3d(4, 4, 0), road_desc, true), null) ASSERT_EQUAL(command_x.build_way(pl, coord3d(5, 3, 0), coord3d(5, 4, 0), rail_desc, true), null) ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(4, 4, 0), pax_stop.get_name()), null) ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(5, 4, 0), pax_station.get_name()), null) ASSERT_EQUAL(halt_x.get_halt(coord3d(4, 4, 0), pl).get_name(), halt_x.get_halt(coord3d(5, 4, 0), pl).get_name()) local halt = halt_x.get_halt(coord3d(4, 4, 0), pl) ASSERT_EQUAL(halt.get_capacity(good_desc_x.passenger), 64) ASSERT_TRUE(halt.accepts_good(good_desc_x.passenger)) ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(4, 4, 0), coord3d(4, 3, 0), "" + wt_road), null) ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(5, 4, 0), coord3d(5, 3, 0), "" + wt_rail), null) } RESET_ALL_PLAYER_FUNDS() } function test_halt_build_multi_player() { local pl = player_x(0) local public_pl = player_x(1) local road_desc = way_desc_x.get_available_ways(wt_road, st_flat)[0] local pax_halt = building_desc_x.get_available_stations(building_desc_x.station, wt_road, good_desc_x.passenger)[0] { ASSERT_EQUAL(command_x.build_way(pl, coord3d(4, 4, 0), coord3d(3, 4, 0), road_desc, true), null) ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(4, 4, 0), pax_halt.get_name()), null) ASSERT_EQUAL(command_x(tool_build_station).work(public_pl, coord3d(3, 4, 0), pax_halt.get_name()), null) ASSERT_TRUE(halt_x.get_halt(coord3d(3, 4, 0), pl) != null) ASSERT_EQUAL(halt_x.get_halt(coord3d(4, 4, 0), public_pl), null) local my_halt = halt_x.get_halt(coord3d(4, 4, 0), pl) local pub_halt = halt_x.get_halt(coord3d(3, 4, 0), public_pl) ASSERT_TRUE(my_halt != null) ASSERT_TRUE(pub_halt != null) ASSERT_TRUE(my_halt.get_name() != pub_halt.get_name()) ASSERT_EQUAL(my_halt.get_tile_list().len(), 1) ASSERT_EQUAL(pub_halt.get_tile_list().len(), 1) ASSERT_EQUAL(command_x(tool_remove_way).work(public_pl, coord3d(4, 4, 0), coord3d(3, 4, 0), "" + wt_road), null) } RESET_ALL_PLAYER_FUNDS() } function test_halt_build_separate() { local pl = player_x(0) local road_desc = way_desc_x.get_available_ways(wt_road, st_flat)[0] local pax_halt = building_desc_x.get_available_stations(building_desc_x.station, wt_road, good_desc_x.passenger)[0] { ASSERT_EQUAL(command_x.build_way(pl, coord3d(5, 4, 0), coord3d(3, 4, 0), road_desc, true), null) ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(5, 4, 0), pax_halt.get_name()), null) ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(3, 4, 0), pax_halt.get_name()), null) ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(4, 4, 0), pax_halt.get_name()), null) local halt3 = halt_x.get_halt(coord3d(3, 4, 0), pl) local halt4 = halt_x.get_halt(coord3d(4, 4, 0), pl) local halt5 = halt_x.get_halt(coord3d(5, 4, 0), pl) ASSERT_TRUE(halt3 != null) ASSERT_TRUE(halt4 != null) ASSERT_TRUE(halt5 != null) ASSERT_TRUE(halt3.get_name() != halt5.get_name()) ASSERT_TRUE(halt4.get_name() == halt5.get_name()) ASSERT_TRUE(halt4.get_name() != halt3.get_name()) ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(5, 4, 0), coord3d(3, 4, 0), "" + wt_road), null) } RESET_ALL_PLAYER_FUNDS() } function test_halt_build_near_factory() { local pl = player_x(0) local public_pl = player_x(1) local road_desc = way_desc_x.get_available_ways(wt_road, st_flat)[0] local pax_halt = building_desc_x.get_available_stations(building_desc_x.station, wt_road, good_desc_x.passenger)[0] local freight_halt = building_desc_x.get_available_stations(building_desc_x.station, wt_road, good_desc_x("Kohle"))[0] local remover = command_x(tool_remover) // build coal mine + coal power plant, then link them ASSERT_EQUAL(build_factory(pl, coord3d(0, 0, 0), 1, 1, 1024, "Kohlegrube"), null) { // also depends on station catchment area size ASSERT_EQUAL(command_x.build_way(pl, coord3d(4, 4, 0), coord3d(4, 3, 0), road_desc, true), null) ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(4, 4, 0), pax_halt.get_name()), null) local halt = halt_x.get_halt(coord3d(4, 4, 0), pl) ASSERT_TRUE(halt != null) ASSERT_EQUAL(halt.get_factory_list().len(), 1) ASSERT_EQUAL(halt.get_factory_list()[0].get_name(), "Coal mine") ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(4, 4, 0), coord3d(4, 3, 0), "" + wt_road), null) } ASSERT_EQUAL(remover.work(public_pl, coord3d(0, 0, 0)), null) RESET_ALL_PLAYER_FUNDS() } function test_halt_build_near_factories() { local pl = player_x(0) local public_pl = player_x(1) local road_desc = way_desc_x.get_available_ways(wt_road, st_flat)[0] local pax_halt = building_desc_x.get_available_stations(building_desc_x.station, wt_road, good_desc_x.passenger)[0] local freight_halt = building_desc_x.get_available_stations(building_desc_x.station, wt_road, good_desc_x("Kohle"))[0] local remover = command_x(tool_remover) // build coal mine + coal power plant, then link them ASSERT_EQUAL(build_factory(pl, coord3d(0, 0, 0), 1, 1, 1024, "Kohlegrube"), null) ASSERT_EQUAL(build_factory(pl, coord3d(6, 6, 0), 1, 1, 1024, "Kohlekraftwerk"), null) ASSERT_EQUAL(command_x(tool_link_factory).work(pl, coord3d(0, 0, 0), coord3d(6, 6, 0), ""), null) { // also depends on station catchment area size ASSERT_EQUAL(command_x.build_way(pl, coord3d(4, 4, 0), coord3d(4, 3, 0), road_desc, true), null) ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(4, 4, 0), pax_halt.get_name()), null) local halt = halt_x.get_halt(coord3d(4, 4, 0), pl) ASSERT_TRUE(halt != null) ASSERT_EQUAL(halt.get_factory_list().len(), 2) ASSERT_EQUAL(halt.get_factory_list()[0].get_name(), "Coal power station") ASSERT_EQUAL(halt.get_factory_list()[1].get_name(), "Coal mine") ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(4, 4, 0), coord3d(4, 3, 0), "" + wt_road), null) } // this only works with catchment area size of 4 { ASSERT_EQUAL(command_x.build_way(pl, coord3d(0, 7, 0), coord3d(1, 7, 0), road_desc, true), null) ASSERT_EQUAL(command_x(tool_build_station).work(pl, coord3d(1, 7, 0), pax_halt.get_name()), null) local halt = halt_x.get_halt(coord3d(1, 7, 0), pl) ASSERT_TRUE(halt != null) ASSERT_EQUAL(halt.get_factory_list().len(), 0) ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(0, 7, 0), coord3d(1, 7, 0), "" + wt_road), null) } ASSERT_EQUAL(remover.work(public_pl, coord3d(0, 0, 0)), null) ASSERT_EQUAL(remover.work(public_pl, coord3d(6, 6, 0)), null) RESET_ALL_PLAYER_FUNDS() } function test_halt_build_on_tunnel_entrance() { local pl = player_x(0) local rail_tunnel = tunnel_desc_x.get_available_tunnels(wt_rail)[0] local raise = command_x(tool_raise_land) local lower = command_x(tool_lower_land) local station_desc = building_desc_x.get_available_stations(building_desc_x.station, wt_rail, good_desc_x.passenger)[0] ASSERT_EQUAL(raise.work(pl, coord3d(4, 2, 0)), null) ASSERT_EQUAL(raise.work(pl, coord3d(4, 3, 0)), null) ASSERT_EQUAL(raise.work(pl, coord3d(5, 2, 0)), null) ASSERT_EQUAL(raise.work(pl, coord3d(5, 3, 0)), null) ASSERT_EQUAL(command_x(tool_build_tunnel).work(pl, coord3d(4, 1, 0), rail_tunnel.get_name()), null) ASSERT_EQUAL(command_x(tool_build_tunnel).work(pl, coord3d(3, 2, 0), rail_tunnel.get_name()), null) ASSERT_EQUAL(command_x(tool_build_tunnel).work(pl, coord3d(5, 2, 0), rail_tunnel.get_name()), null) // Building station on tunnel entrance fails (contrary to depots) { for (local d = dir.north; d < dir.all; d = d*2) { local p = coord3d(4, 2, 0) + dir.to_coord(d) ASSERT_EQUAL(command_x.build_station(pl, p, station_desc), "No suitable way on the ground!") } } local remover = command_x(tool_remover) remover.set_flags(2) ASSERT_EQUAL(remover.work(pl, coord3d(4, 1, 0)), null) ASSERT_EQUAL(lower.work(pl, coord3d(4, 2, 0)), null) ASSERT_EQUAL(lower.work(pl, coord3d(4, 3, 0)), null) ASSERT_EQUAL(lower.work(pl, coord3d(5, 2, 0)), null) ASSERT_EQUAL(lower.work(pl, coord3d(5, 3, 0)), null) RESET_ALL_PLAYER_FUNDS() } function test_halt_build_on_bridge_end() { local pl = player_x(0) local rail_bridge = bridge_desc_x.get_available_bridges(wt_rail)[0] local setslope = command_x(tool_setslope) local station_desc = building_desc_x.get_available_stations(building_desc_x.station, wt_rail, good_desc_x.passenger)[0] // north-south direction { ASSERT_EQUAL(setslope.work(pl, coord3d(4, 2, 0), "" + slope.south), null) ASSERT_EQUAL(setslope.work(pl, coord3d(4, 4, 0), "" + slope.north), null) ASSERT_EQUAL(command_x(tool_build_bridge).work(pl, coord3d(4, 2, 0), rail_bridge.get_name()), null) ASSERT_EQUAL(command_x.build_station(pl, coord3d(4, 2, 0), station_desc), null) ASSERT_EQUAL(command_x.build_station(pl, coord3d(4, 4, 0), station_desc), null) // tool_remover removes halt first, then bridge, then depot (depot is automatically removed when destroying bridge) // So here we have to remove things on the tile twice (contrary to test_depot_build_on_bridge_end) ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(4, 2, 0)), null) ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(4, 2, 0)), null) ASSERT_EQUAL(setslope.work(pl, coord3d(4, 2, 0), "" + slope.flat), null) ASSERT_EQUAL(setslope.work(pl, coord3d(4, 4, 0), "" + slope.flat), null) } // east-west direction { ASSERT_EQUAL(setslope.work(pl, coord3d(3, 3, 0), "" + slope.east), null) ASSERT_EQUAL(setslope.work(pl, coord3d(5, 3, 0), "" + slope.west), null) ASSERT_EQUAL(command_x(tool_build_bridge).work(pl, coord3d(3, 3, 0), rail_bridge.get_name()), null) ASSERT_EQUAL(command_x.build_depot(pl, coord3d(3, 3, 0), get_depot_by_wt(wt_rail)), null) ASSERT_EQUAL(command_x.build_depot(pl, coord3d(5, 3, 0), get_depot_by_wt(wt_rail)), null) ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(3, 3, 0)), null) ASSERT_EQUAL(setslope.work(pl, coord3d(3, 3, 0), "" + slope.flat), null) ASSERT_EQUAL(setslope.work(pl, coord3d(5, 3, 0), "" + slope.flat), null) } RESET_ALL_PLAYER_FUNDS() } function test_halt_build_on_depot() { local pl = player_x(0) local rail_desc = way_desc_x.get_available_ways(wt_rail, st_flat)[0] local station_desc = building_desc_x.get_available_stations(building_desc_x.station, wt_rail, good_desc_x.passenger)[0] local depot = get_depot_by_wt(wt_rail) ASSERT_EQUAL(command_x.build_way(pl, coord3d(4, 2, 0), coord3d(4, 4, 0), rail_desc, true), null) ASSERT_EQUAL(command_x.build_depot(pl, coord3d(4, 2, 0), depot), null) { ASSERT_EQUAL(command_x.build_station(pl, coord3d(4, 2, 0), station_desc), "No suitable ground!") } ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(4, 2, 0)), null) ASSERT_EQUAL(command_x(tool_remove_way).work(pl, coord3d(4, 2, 0), coord3d(4, 4, 0), "" + wt_rail), null) RESET_ALL_PLAYER_FUNDS() } function test_halt_build_station_extension() { local pl = player_x(0) local setslope = command_x(tool_setslope) local stationbuilder = command_x(tool_build_station) local wayremover = command_x(tool_remove_way) local road_desc = way_desc_x.get_available_ways(wt_road, st_flat)[0] // road because it has double slopes available local station_desc = building_desc_x.get_available_stations(building_desc_x.station, wt_road, good_desc_x.passenger)[0] // FIXME: null instead of pax fails local stext_desc = building_desc_x.get_available_stations(building_desc_x.station_extension, wt_rail, good_desc_x.passenger)[0] local bridge_desc = bridge_desc_x.get_available_bridges(wt_road)[0] ASSERT_TRUE(station_desc != null) ASSERT_TRUE(stext_desc != null) ASSERT_TRUE(bridge_desc != null) ASSERT_TRUE(road_desc != null) // build station extension without station: should fail { ASSERT_EQUAL(stationbuilder.work(pl, coord3d(4, 3, 0), stext_desc.get_name()), "Post muss neben\nHaltestelle\nliegen!\n") ASSERT_EQUAL(pl.get_current_maintenance(), 0) ASSERT_EQUAL(tile_x(4, 3, 0).find_object(mo_building), null) } ASSERT_EQUAL(command_x.build_way(pl, coord3d(4, 2, 0), coord3d(4, 4, 0), road_desc, true), null) ASSERT_EQUAL(stationbuilder.work(pl, coord3d(4, 3, 0), station_desc.get_name()), null) local old_maintenance = pl.get_current_maintenance() // build station extension next to station: should succeed { ASSERT_EQUAL(stationbuilder.work(pl, coord3d(5, 3, 0), stext_desc.get_name()), null) ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(5, 3, 0)), null) ASSERT_EQUAL(pl.get_current_maintenance(), old_maintenance) // and diagonal ASSERT_EQUAL(stationbuilder.work(pl, coord3d(5, 2, 0), stext_desc.get_name()), null) ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(5, 2, 0)), null) ASSERT_EQUAL(pl.get_current_maintenance(), old_maintenance) } // build station extension on raised tile: should succeed { ASSERT_EQUAL(setslope.work(pl, coord3d(5, 3, 0), "" + slope.all_up_slope), null) ASSERT_EQUAL(setslope.work(pl, coord3d(5, 3, 1), "" + slope.all_up_slope), null) ASSERT_EQUAL(setslope.work(pl, coord3d(5, 3, 2), "" + slope.all_up_slope), null) ASSERT_EQUAL(stationbuilder.work(pl, coord3d(5, 3, 3), stext_desc.get_name()), null) ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(5, 3, 3)), null) ASSERT_EQUAL(pl.get_current_maintenance(), old_maintenance) // up slope is automatically removed ASSERT_EQUAL(square_x(5, 3).get_tile_at_height(1), null) ASSERT_EQUAL(square_x(5, 3).get_tile_at_height(2), null) } { // diagonal too ASSERT_EQUAL(setslope.work(pl, coord3d(5, 2, 0), "" + slope.all_up_slope), null) ASSERT_EQUAL(setslope.work(pl, coord3d(5, 2, 1), "" + slope.all_up_slope), null) ASSERT_EQUAL(stationbuilder.work(pl, coord3d(5, 2, 2), stext_desc.get_name()), null) ASSERT_EQUAL(command_x(tool_remover).work(pl, coord3d(5, 2, 2)), null) ASSERT_EQUAL(pl.get_current_maintenance(), old_maintenance) // up slope is automatically removed ASSERT_EQUAL(square_x(5, 3).get_tile_at_height(1), null) ASSERT_EQUAL(square_x(5, 3).get_tile_at_height(2), null) } ASSERT_EQUAL(wayremover.work(pl, coord3d(4, 2, 0), coord3d(4, 4, 0), "" + wt_road), null) ASSERT_EQUAL(pl.get_current_maintenance(), 0) // clean up RESET_ALL_PLAYER_FUNDS() } function test_halt_upgrade_downgrade() { local pl = player_x(0) local stationbuilder = command_x(tool_build_station) local wayremover = command_x(tool_remove_way) local road_desc = way_desc_x.get_available_ways(wt_road, st_flat)[0] local pax_halts = building_desc_x.get_available_stations(building_desc_x.station, wt_road, good_desc_x.passenger) pax_halts.sort(@(a, b) a.get_capacity() <=> b.get_capacity()) ASSERT_TRUE(pax_halts.len() >= 2) local small_halt = pax_halts[0] local big_halt = pax_halts[1] local pos = coord3d(3, 3, 0) ASSERT_EQUAL(command_x.build_way(pl, coord3d(3, 2, 0), coord3d(3, 4, 0), road_desc, true), null) // upgrade station { ASSERT_EQUAL(stationbuilder.work(pl, pos, small_halt.get_name()), null) local halt = halt_x.get_halt(pos, pl) ASSERT_TRUE(halt != null) local old_capacity = halt.get_capacity(good_desc_x.passenger) local old_maint = pl.get_current_maintenance() ASSERT_EQUAL(stationbuilder.work(pl, pos, big_halt.get_name()), null) ASSERT_TRUE(halt.is_valid()) ASSERT_TRUE(halt.accepts_good(good_desc_x.passenger)) ASSERT_TRUE(halt.get_capacity(good_desc_x.passenger) > old_capacity) ASSERT_EQUAL(halt.get_tile_list().len(), 1) ASSERT_TRUE(pl.get_current_maintenance() > old_maint) ASSERT_EQUAL(pl.get_current_maintenance() - old_maint, big_halt.get_maintenance() - small_halt.get_maintenance()) } // upgrade station to same level { local halt = halt_x.get_halt(pos, pl) local old_capacity = halt.get_capacity(good_desc_x.passenger) local old_maint = pl.get_current_maintenance() local old_cash = pl.get_current_cash() ASSERT_EQUAL(stationbuilder.work(pl, coord3d(3, 3, 0), big_halt.get_name()), null) ASSERT_TRUE(halt.is_valid()) ASSERT_TRUE(halt.accepts_good(good_desc_x.passenger)) ASSERT_EQUAL(halt.get_capacity(good_desc_x.passenger), old_capacity) ASSERT_EQUAL(halt.get_tile_list().len(), 1) ASSERT_EQUAL(pl.get_current_maintenance(), old_maint) } // downgrade without ctrl, should fail { local halt = halt_x.get_halt(pos, pl) local old_capacity = halt.get_capacity(good_desc_x.passenger) local old_maint = pl.get_current_maintenance() local old_cash = pl.get_current_cash() ASSERT_EQUAL(stationbuilder.work(pl, coord3d(3, 3, 0), small_halt.get_name()), "Upgrade must have\na higher level") ASSERT_TRUE(halt.is_valid()) ASSERT_TRUE(halt.accepts_good(good_desc_x.passenger)) ASSERT_EQUAL(halt.get_capacity(good_desc_x.passenger), old_capacity) ASSERT_EQUAL(halt.get_tile_list().len(), 1) ASSERT_EQUAL(pl.get_current_maintenance(), old_maint) } // downgrade with ctrl { local halt = halt_x.get_halt(pos, pl) local old_capacity = halt.get_capacity(good_desc_x.passenger) local old_maint = pl.get_current_maintenance() local old_cash = pl.get_current_cash() stationbuilder.set_flags(2) // ctrl ASSERT_EQUAL(stationbuilder.work(pl, coord3d(3, 3, 0), small_halt.get_name()), null) ASSERT_TRUE(halt.is_valid()) ASSERT_TRUE(halt.accepts_good(good_desc_x.passenger)) ASSERT_TRUE(halt.get_capacity(good_desc_x.passenger) < old_capacity) ASSERT_EQUAL(halt.get_tile_list().len(), 1) ASSERT_TRUE(pl.get_current_maintenance() < old_maint) ASSERT_EQUAL(pl.get_current_maintenance() - old_maint, small_halt.get_maintenance() - big_halt.get_maintenance()) } // clean up ASSERT_EQUAL(wayremover.work(pl, coord3d(3, 2, 0), coord3d(3, 4, 0), "" + wt_road), null) RESET_ALL_PLAYER_FUNDS() } function test_halt_make_public_single() { local pl = player_x(0) local public_pl = player_x(1) local stationbuilder = command_x(tool_build_station) local wayremover = command_x(tool_remove_way) local pax_halt = building_desc_x.get_available_stations(building_desc_x.station, wt_road, good_desc_x.passenger)[0] local road_desc = way_desc_x.get_available_ways(wt_road, st_flat)[0] local makepublic = command_x(tool_make_stop_public) ASSERT_EQUAL(command_x.build_way(pl, coord3d(4, 2, 0), coord3d(4, 4, 0), road_desc, true), null) ASSERT_EQUAL(command_x.build_station(pl, coord3d(4, 3, 0), pax_halt), null) // invalid pos { local old_cash = pl.get_current_cash() local old_maint = pl.get_current_maintenance() ASSERT_EQUAL(makepublic.work(pl, coord3d(-1, -1, -1)), "No suitable ground!") ASSERT_EQUAL(pl.get_current_cash(), old_cash) ASSERT_EQUAL(pl.get_current_maintenance(), old_maint) } // no stop under cursor { local old_cash = pl.get_current_cash() local old_maint = pl.get_current_maintenance() ASSERT_EQUAL(makepublic.work(pl, coord3d(3, 2, 0)), null) ASSERT_EQUAL(pl.get_current_cash(), old_cash) ASSERT_EQUAL(pl.get_current_maintenance(), old_maint) } // valid stop - Making the stop public also makes the road under it public { local old_cash = pl.get_current_cash() local old_maint = pl.get_current_maintenance() ASSERT_EQUAL(makepublic.work(pl, coord3d(4, 3, 0)), null) ASSERT_TRUE(halt_x.get_halt(coord3d(4, 3, 0), public_pl) != null) ASSERT_EQUAL(halt_x.get_halt(coord3d(4, 3, 0), public_pl).get_owner().get_name(), public_pl.get_name()) ASSERT_EQUAL(pl.get_current_maintenance(), old_maint - 1*pax_halt.get_maintenance() - 1*road_desc.get_maintenance()) ASSERT_EQUAL(pl.get_current_cash()*100, old_cash*100 - 60 * (1*pax_halt.get_maintenance() + 1*road_desc.get_maintenance()) ) ASSERT_EQUAL(public_pl.get_current_maintenance(), 1*pax_halt.get_maintenance() + 1*road_desc.get_maintenance()) } // already public - should have no effect { local old_cash = pl.get_current_cash() local old_maint = pl.get_current_maintenance() ASSERT_EQUAL(makepublic.work(pl, coord3d(4, 3, 0)), null) ASSERT_TRUE(halt_x.get_halt(coord3d(4, 3, 0), public_pl) != null) ASSERT_EQUAL(halt_x.get_halt(coord3d(4, 3, 0), public_pl).get_owner().get_name(), public_pl.get_name()) ASSERT_EQUAL(pl.get_current_maintenance(), old_maint) ASSERT_EQUAL(pl.get_current_cash(), old_cash) } // same for public player { local old_cash = public_pl.get_current_cash() local old_maint = public_pl.get_current_maintenance() ASSERT_EQUAL(makepublic.work(public_pl, coord3d(4, 3, 0)), null) ASSERT_TRUE(halt_x.get_halt(coord3d(4, 3, 0), public_pl) != null) ASSERT_EQUAL(public_pl.get_current_maintenance(), old_maint) ASSERT_EQUAL(public_pl.get_current_cash(), old_cash) } ASSERT_EQUAL(command_x(tool_remover).work(public_pl, coord3d(4, 3, 0)), null) ASSERT_EQUAL(command_x.build_station(pl, coord3d(4, 3, 0), pax_halt), null) // If public player uses this tool, he pays for it { local old_cash = public_pl.get_current_cash() local old_maint = public_pl.get_current_maintenance() ASSERT_EQUAL(makepublic.work(pl, coord3d(4, 3, 0)), null) ASSERT_TRUE(halt_x.get_halt(coord3d(4, 3, 0), public_pl) != null) ASSERT_EQUAL(halt_x.get_halt(coord3d(4, 3, 0), public_pl).get_owner().get_name(), public_pl.get_name()) // only halt maintenance because the road is already public ASSERT_EQUAL(public_pl.get_current_cash()*100, 100*old_cash + 60 * pax_halt.get_maintenance()) ASSERT_EQUAL(public_pl.get_current_maintenance(), old_maint + pax_halt.get_maintenance()) } ASSERT_EQUAL(wayremover.work(public_pl, coord3d(4, 2, 0), coord3d(4, 4, 0), "" + wt_road), null) ASSERT_EQUAL(command_x.build_way(pl, coord3d(4, 2, 0), coord3d(4, 4, 0), road_desc, true), null) ASSERT_EQUAL(command_x.build_station(pl, coord3d(4, 3, 0), pax_halt), null) // Public player can make halts of other players public even if road underneath is not public { local old_cash = public_pl.get_current_cash() local old_maint = public_pl.get_current_maintenance() ASSERT_EQUAL(makepublic.work(pl, coord3d(4, 3, 0)), null) ASSERT_TRUE(halt_x.get_halt(coord3d(4, 3, 0), public_pl) != null) ASSERT_EQUAL(halt_x.get_halt(coord3d(4, 3, 0), public_pl).get_owner().get_name(), public_pl.get_name()) // halt + road maintenance ASSERT_EQUAL(public_pl.get_current_cash()*100, 100*old_cash + 60 * pax_halt.get_maintenance()) ASSERT_EQUAL(public_pl.get_current_maintenance(), old_maint + pax_halt.get_maintenance() + road_desc.get_maintenance()) } ASSERT_EQUAL(wayremover.work(public_pl, coord3d(4, 2, 0), coord3d(4, 4, 0), "" + wt_road), null) RESET_ALL_PLAYER_FUNDS() } function test_halt_make_public_multi_tile() { local pl = player_x(0) local public_pl = player_x(1) local stationbuilder = command_x(tool_build_station) local wayremover = command_x(tool_remove_way) local pax_halt = building_desc_x.get_available_stations(building_desc_x.station, wt_road, good_desc_x.passenger)[0] local road_desc = way_desc_x.get_available_ways(wt_road, st_flat)[0] local makepublic = command_x(tool_make_stop_public) ASSERT_EQUAL(command_x.build_way(pl, coord3d(4, 2, 0), coord3d(4, 5, 0), road_desc, true), null) ASSERT_EQUAL(command_x.build_station(pl, coord3d(4, 3, 0), pax_halt), null) ASSERT_EQUAL(command_x.build_station(pl, coord3d(4, 4, 0), pax_halt), null) // valid stop - Making the stop public also makes the road under it public { local old_cash = pl.get_current_cash() local old_maint = pl.get_current_maintenance() ASSERT_EQUAL(makepublic.work(pl, coord3d(4, 3, 0)), null) ASSERT_TRUE(halt_x.get_halt(coord3d(4, 3, 0), public_pl) != null) ASSERT_EQUAL(halt_x.get_halt(coord3d(4, 3, 0), public_pl).get_owner().get_name(), public_pl.get_name()) ASSERT_EQUAL(pl.get_current_maintenance(), old_maint - 2*pax_halt.get_maintenance() - 2*road_desc.get_maintenance()) ASSERT_EQUAL(pl.get_current_cash()*100, old_cash*100 - 60 * (2*pax_halt.get_maintenance() + 2*road_desc.get_maintenance()) ) ASSERT_EQUAL(public_pl.get_current_maintenance(), 2*pax_halt.get_maintenance() + 2*road_desc.get_maintenance()) } // already public - should have no effect { local old_cash = pl.get_current_cash() local old_maint = pl.get_current_maintenance() ASSERT_EQUAL(makepublic.work(pl, coord3d(4, 3, 0)), null) ASSERT_TRUE(halt_x.get_halt(coord3d(4, 3, 0), public_pl) != null) ASSERT_EQUAL(halt_x.get_halt(coord3d(4, 3, 0), public_pl).get_owner().get_name(), public_pl.get_name()) ASSERT_EQUAL(pl.get_current_maintenance(), old_maint) ASSERT_EQUAL(pl.get_current_cash(), old_cash) } // same for public player { local old_cash = public_pl.get_current_cash() local old_maint = public_pl.get_current_maintenance() ASSERT_EQUAL(makepublic.work(public_pl, coord3d(4, 3, 0)), null) ASSERT_TRUE(halt_x.get_halt(coord3d(4, 3, 0), public_pl) != null) ASSERT_EQUAL(public_pl.get_current_maintenance(), old_maint) ASSERT_EQUAL(public_pl.get_current_cash(), old_cash) } ASSERT_EQUAL(wayremover.work(public_pl, coord3d(4, 2, 0), coord3d(4, 5, 0), "" + wt_road), null) ASSERT_EQUAL(command_x.build_way(pl, coord3d(4, 2, 0), coord3d(4, 5, 0), road_desc, true), null) ASSERT_EQUAL(command_x.build_station(pl, coord3d(4, 3, 0), pax_halt), null) ASSERT_EQUAL(command_x.build_station(pl, coord3d(4, 4, 0), pax_halt), null) // If public player uses this tool, he pays for it { local old_cash = public_pl.get_current_cash() local old_maint = public_pl.get_current_maintenance() ASSERT_EQUAL(makepublic.work(pl, coord3d(4, 3, 0)), null) ASSERT_TRUE(halt_x.get_halt(coord3d(4, 3, 0), public_pl) != null) ASSERT_EQUAL(halt_x.get_halt(coord3d(4, 3, 0), public_pl).get_owner().get_name(), public_pl.get_name()) ASSERT_EQUAL(public_pl.get_current_cash()*100, 100*old_cash + 60 * 2*pax_halt.get_maintenance()) ASSERT_EQUAL(public_pl.get_current_maintenance(), old_maint + (2*pax_halt.get_maintenance() + 2*road_desc.get_maintenance())) } ASSERT_EQUAL(wayremover.work(public_pl, coord3d(4, 2, 0), coord3d(4, 5, 0), "" + wt_road), null) RESET_ALL_PLAYER_FUNDS() } function test_halt_make_public_underground() { local pl = player_x(0) local public_pl = player_x(1) local tunnel_desc = tunnel_desc_x.get_available_tunnels(wt_road)[0] local pax_halt = building_desc_x("LongBusStop") local makepublic = command_x(tool_make_stop_public) local raise = command_x(tool_raise_land) local lower = command_x(tool_lower_land) local stationbuilder = command_x(tool_build_station) ASSERT_EQUAL(raise.work(public_pl, coord3d(4, 3, 0)), null) ASSERT_EQUAL(raise.work(public_pl, coord3d(5, 3, 0)), null) ASSERT_EQUAL(raise.work(public_pl, coord3d(4, 4, 0)), null) ASSERT_EQUAL(raise.work(public_pl, coord3d(5, 4, 0)), null) ASSERT_EQUAL(command_x(tool_build_tunnel).work(pl, coord3d(4, 2, 0), tunnel_desc.get_name()), null) ASSERT_EQUAL(stationbuilder.work(pl, coord3d(4, 3, 0), pax_halt.get_name()), null) // valid underground stop { local old_cash = pl.get_current_cash() local old_maint = pl.get_current_maintenance() ASSERT_EQUAL(makepublic.work(pl, coord3d(4, 3, 0)), null) ASSERT_TRUE(halt_x.get_halt(coord3d(4, 3, 0), public_pl) != null) ASSERT_EQUAL(halt_x.get_halt(coord3d(4, 3, 0), public_pl).get_owner().get_name(), public_pl.get_name()) ASSERT_EQUAL(pl.get_current_maintenance(), old_maint - 1*pax_halt.get_maintenance() - 1*tunnel_desc.get_maintenance()) ASSERT_EQUAL(pl.get_current_cash()*100, old_cash*100 - 60 * (1*pax_halt.get_maintenance() + 1*tunnel_desc.get_maintenance()) ) ASSERT_EQUAL(public_pl.get_current_maintenance(), 1*pax_halt.get_maintenance() + 1*tunnel_desc.get_maintenance()) } ASSERT_EQUAL(command_x(tool_remove_way).work(public_pl, coord3d(4, 2, 0), coord3d(4, 4, 0), "" + wt_road), null) ASSERT_EQUAL(lower.work(public_pl, coord3d(4, 3, 0)), null) ASSERT_EQUAL(lower.work(public_pl, coord3d(5, 3, 0)), null) ASSERT_EQUAL(lower.work(public_pl, coord3d(4, 4, 0)), null) ASSERT_EQUAL(lower.work(public_pl, coord3d(5, 4, 0)), null) }
Squirrel
5
Andarix/simutrans_nightly
tests/tests/test_halt.nut
[ "Artistic-1.0" ]
/* * Copyright 2019 The Sculptor Project Team, including the original * author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.sculptor.generator.template.domain import com.google.inject.Inject import org.eclipse.xtext.testing.InjectWith import org.eclipse.xtext.testing.extensions.InjectionExtension; import org.eclipselabs.xtext.utils.unittesting.XtextTest import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.^extension.ExtendWith; import org.sculptor.dsl.tests.SculptordslInjectorProvider import org.sculptor.generator.configuration.Configuration import org.sculptor.generator.configuration.ConfigurationProviderModule import org.sculptor.generator.test.GeneratorModelTestFixtures import static org.junit.jupiter.api.Assertions.*; import static extension org.sculptor.generator.test.GeneratorTestExtensions.* @ExtendWith(typeof(InjectionExtension)) @InjectWith(typeof(SculptordslInjectorProvider)) class DomainObjectReferenceAnnotationTmplDDDSampleTest extends XtextTest { @Inject var GeneratorModelTestFixtures generatorModelTestFixtures; var DomainObjectReferenceAnnotationTmpl domainObjectReferenceAnnotationTmpl; var DomainObjectReferenceTmpl domainObjectReferenceTmpl; @BeforeEach def void setup() { System.setProperty(Configuration.PROPERTIES_LOCATION_PROPERTY, "generator-tests/dddsample/sculptor-generator.properties") generatorModelTestFixtures.setupInjector(typeof(DomainObjectReferenceAnnotationTmpl)) generatorModelTestFixtures.setupInjector(typeof(DomainObjectReferenceTmpl)) generatorModelTestFixtures.setupModel("generator-tests/dddsample/model.btdesign") domainObjectReferenceAnnotationTmpl = generatorModelTestFixtures.getProvidedObject( typeof(DomainObjectReferenceAnnotationTmpl)); domainObjectReferenceTmpl = generatorModelTestFixtures.getProvidedObject( typeof(DomainObjectReferenceTmpl)); } @AfterEach def void clearSystemProperties() { System.clearProperty(ConfigurationProviderModule.PROPERTIES_LOCATION_PROPERTY); } @Test def void testAppTransformation() { val app = generatorModelTestFixtures.app assertNotNull(app) assertEquals(5, app.modules.size) } @Test def void assertOneToManyInIntineraryBaseForReferenceLeg() { val app = generatorModelTestFixtures.app assertNotNull(app) val module = app.modules.namedElement("cargo") assertNotNull(module) val itinerary = module.domainObjects.namedElement("Itinerary") val legs = itinerary.references.namedElement("legs") assertNotNull(legs) val code = domainObjectReferenceAnnotationTmpl.oneToManyJpaAnnotation(legs) assertNotNull(code) assertContains(code, '@javax.persistence.OneToMany') assertContains(code, 'cascade=javax.persistence.CascadeType.ALL') assertContains(code, 'orphanRemoval=true') assertContains(code, 'fetch=javax.persistence.FetchType.EAGER') assertContains(code, '@javax.persistence.JoinColumn') assertContains(code, 'name="ITINERARY"') assertContains(code, '[email protected]') assertContains(code, 'name="FK_ITINERARY_LEG"') } @Test def void assertManyToOneInLegBaseForReferenceCarrierMovement() { val app = generatorModelTestFixtures.app assertNotNull(app) val module = app.modules.namedElement("cargo") assertNotNull(module) val leg = module.domainObjects.namedElement("Leg") val carrierMovement = leg.references.namedElement("carrierMovement") assertNotNull(carrierMovement) val code = domainObjectReferenceAnnotationTmpl.manyToOneJpaAnnotation(carrierMovement) assertNotNull(code) assertContains(code, '@javax.persistence.ManyToOne') assertContains(code, 'optional=false') assertContains(code, 'fetch=javax.persistence.FetchType.EAGER') assertContains(code, '@javax.persistence.JoinColumn') assertContains(code, 'name="CARRIERMOVEMENT"') assertContains(code, '[email protected]') assertContains(code, 'name="FK_LEG_CARRIERMOVEMENT"') } @Test def void assertAllPersonReferences() { val app = generatorModelTestFixtures.app assertNotNull(app) val routingModule = app.modules.namedElement("relation") assertNotNull(routingModule) val person = routingModule.domainObjects.namedElement("Person") assertNotNull(person) // person.references.forEach[it | // System.out.println("-------------------------------------------------------\nPERSON REFS = " + it); // System.out.println("CODE:\n" + domainObjectReferenceTmpl.manyReferenceAttribute(it, true)); // ]; // - List<@House> owning <-> owner inverse; val owning = person.references.namedElement("owning"); val owningCode = domainObjectReferenceTmpl.manyReferenceAttribute(owning, true); assertContains(owningCode, '@javax.persistence.OneToMany'); assertContains(owningCode, 'mappedBy="owner"'); assertContains(owningCode, 'java.util.List<org.sculptor.dddsample.relation.domain.House>'); assertContains(owningCode, 'owning = new'); // - Set<@House> related <-> relation inverse; val related = person.references.namedElement("related"); val relCode = domainObjectReferenceTmpl.manyReferenceAttribute(related, true); assertContains(relCode, '@javax.persistence.OneToMany'); assertContains(relCode, 'mappedBy="relation"'); assertContains(relCode, 'java.util.Set<org.sculptor.dddsample.relation.domain.House>'); assertContains(relCode, 'related = new'); // - Bag<@House> other <-> something inverse; val other = person.references.namedElement("other"); val otherCode = domainObjectReferenceTmpl.manyReferenceAttribute(other, true) assertContains(otherCode, '@javax.persistence.OneToMany'); assertContains(otherCode, 'mappedBy="something"') assertContains(otherCode, 'java.util.List<org.sculptor.dddsample.relation.domain.House>'); assertContains(otherCode, 'other = new'); // - List<@House> owningUni inverse; val owningUni = person.references.namedElement("owningUni"); val owningUniCode = domainObjectReferenceTmpl.manyReferenceAttribute(owningUni, true); assertContains(owningUniCode, '@javax.persistence.OneToMany'); assertContains(owningUniCode, '@javax.persistence.JoinColumn'); assertContains(owningUniCode, 'name="PERSON"'); assertContains(owningUniCode, '[email protected]'); assertContains(owningUniCode, 'name="FK_PERSON_HOUSE"'); assertContains(owningUniCode, 'java.util.List<org.sculptor.dddsample.relation.domain.House>'); assertContains(owningUniCode, 'owningUni = new'); // - Set<@House> relatedUni inverse; val relatedUni = person.references.namedElement("relatedUni"); val relUniCode = domainObjectReferenceTmpl.manyReferenceAttribute(relatedUni, true); assertContains(relUniCode, '@javax.persistence.OneToMany'); assertContains(relUniCode, '@javax.persistence.JoinColumn'); assertContains(relUniCode, 'name="PERSON"'); assertContains(relUniCode, '[email protected]'); assertContains(relUniCode, 'name="FK_PERSON_HOUSE"'); assertContains(relUniCode, 'java.util.Set<org.sculptor.dddsample.relation.domain.House>'); assertContains(relUniCode, 'relatedUni = new'); // - Bag<@House> otherUni inverse; val otherUni = person.references.namedElement("otherUni"); val otherUniCode = domainObjectReferenceTmpl.manyReferenceAttribute(otherUni, true) assertContains(otherUniCode, '@javax.persistence.OneToMany'); assertContains(otherUniCode, '@javax.persistence.JoinColumn'); assertContains(otherUniCode, 'name="PERSON"'); assertContains(otherUniCode, '[email protected]'); assertContains(otherUniCode, 'name="FK_PERSON_HOUSE"'); assertContains(otherUniCode, 'java.util.List<org.sculptor.dddsample.relation.domain.House>'); assertContains(otherUniCode, 'otherUni = new'); // - List<@House> owningN <-> ownerN; val owningN = person.references.namedElement("owningN"); val owningNCode = domainObjectReferenceTmpl.manyReferenceAttribute(owningN, true) assertContains(owningNCode, '@javax.persistence.ManyToMany'); assertContains(owningNCode, 'mappedBy="ownerN"') assertContains(owningNCode, 'java.util.List<org.sculptor.dddsample.relation.domain.House>'); assertContains(owningNCode, 'owningN = new'); // - Set<@House> relatedN <-> relationN; val relatedN = person.references.namedElement("relatedN"); val relNCode = domainObjectReferenceTmpl.manyReferenceAttribute(relatedN, true) assertContains(relNCode, '@javax.persistence.ManyToMany'); assertContains(relNCode, 'mappedBy="relationN"') assertContains(relNCode, 'java.util.Set<org.sculptor.dddsample.relation.domain.House>'); assertContains(relNCode, 'relatedN = new'); // - Bag<@House> otherN <-> somethingN; val otherN = person.references.namedElement("otherN"); val otherNCode = domainObjectReferenceTmpl.manyReferenceAttribute(otherN, true) assertContains(otherNCode, '@javax.persistence.ManyToMany'); assertContains(otherNCode, 'mappedBy="somethingN"') assertContains(otherNCode, 'java.util.List<org.sculptor.dddsample.relation.domain.House>'); assertContains(otherNCode, 'otherN = new'); // - List<@House> owningUniN; val owningUniN = person.references.namedElement("owningUniN"); val owningUniNCode = domainObjectReferenceTmpl.manyReferenceAttribute(owningUniN, true); assertContains(owningUniNCode, '@javax.persistence.ManyToMany'); assertContains(owningUniNCode, '@javax.persistence.JoinTable'); assertContains(owningUniNCode, 'name="OWNINGUNIN_PERSON"'); assertContains(owningUniNCode, '[email protected]'); assertContains(owningUniNCode, 'name="PERSON"'); assertContains(owningUniNCode, '[email protected]'); assertContains(owningUniNCode, 'name="FK_OWNINGUNIN_PERSON_PERSON"'); assertContains(owningUniNCode, '[email protected]'); assertContains(owningUniNCode, 'name="OWNINGUNIN"'); assertContains(owningUniNCode, 'name="FK_OWNINGUNIN_PERSON_OWNINGUNIN"'); assertContains(owningUniNCode, 'java.util.List<org.sculptor.dddsample.relation.domain.House>'); assertContains(owningUniNCode, 'owningUniN = new'); // - Set<@House> relatedUniN; val relatedUniN = person.references.namedElement("relatedUniN"); val relatedUniNCode = domainObjectReferenceTmpl.manyReferenceAttribute(relatedUniN, true); assertContains(relatedUniNCode, '@javax.persistence.ManyToMany'); assertContains(relatedUniNCode, '@javax.persistence.JoinTable'); assertContains(relatedUniNCode, 'name="PERSON_RELATEDUNIN"'); assertContains(relatedUniNCode, '[email protected]'); assertContains(relatedUniNCode, 'name="PERSON"'); assertContains(relatedUniNCode, '[email protected]'); assertContains(relatedUniNCode, 'name="FK_PERSON_RELATEDUNIN_PERSON"'); assertContains(relatedUniNCode, '[email protected]'); assertContains(relatedUniNCode, 'name="RELATEDUNIN"'); assertContains(relatedUniNCode, 'name="FK_PERSON_RELATEDUNIN_RELATEDUNIN"'); assertContains(relatedUniNCode, 'java.util.Set<org.sculptor.dddsample.relation.domain.House>'); assertContains(relatedUniNCode, 'relatedUniN = new'); // - Bag<@House> otherUniN; val otherUniN = person.references.namedElement("otherUniN"); val otherUniNCode = domainObjectReferenceTmpl.manyReferenceAttribute(otherUniN, true); assertContains(otherUniNCode, '@javax.persistence.ManyToMany'); assertContains(otherUniNCode, '@javax.persistence.JoinTable'); assertContains(otherUniNCode, 'name="OTHERUNIN_PERSON"'); assertContains(otherUniNCode, '[email protected]'); assertContains(otherUniNCode, 'name="PERSON"'); assertContains(otherUniNCode, '[email protected]'); assertContains(otherUniNCode, 'name="FK_OTHERUNIN_PERSON_PERSON"'); assertContains(otherUniNCode, '[email protected]'); assertContains(otherUniNCode, 'name="OTHERUNIN",'); assertContains(otherUniNCode, 'name="FK_OTHERUNIN_PERSON_OTHERUNIN"'); assertContains(otherUniNCode, 'java.util.List<org.sculptor.dddsample.relation.domain.House>'); assertContains(otherUniNCode, 'otherUniN = new'); } }
Xtend
5
sculptor/sculptor
sculptor-generator/sculptor-generator-templates/src/test/java/org/sculptor/generator/template/domain/DomainObjectReferenceAnnotationTmplDDDSampleTest.xtend
[ "Apache-2.0" ]
<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24" viewBox="0 0 24 24" width="24"><g><path d="M0,0h24v24H0V0z" fill="none"/></g><g><g><path d="M16.13,15.13l1.69-10.98C17.92,3.55,17.45,3,16.83,3H14v0c0-0.55-0.45-1-1-1h-2c-0.55,0-1,0.45-1,1v0H5C3.9,3,3,3.9,3,5v4 c0,1.1,0.9,2,2,2h2.23l0.64,4.13C6.74,16.05,6,17.43,6,19v1c0,1.1,0.9,2,2,2h8c1.1,0,2-0.9,2-2v-1 C18,17.43,17.26,16.05,16.13,15.13z M5,9V5h1.31l0.62,4H5z M12,19c-0.55,0-1-0.45-1-1s0.45-1,1-1s1,0.45,1,1S12.55,19,12,19z M14.29,14H9.72L8.33,5h7.34L14.29,14z"/></g></g></svg>
SVG
2
good-gym/material-ui
packages/material-ui-icons/material-icons/blender_rounded_24px.svg
[ "MIT" ]
import React from "react" import { useTitle } from "../hooks/use-title" export default function Jsx() { const title = useTitle() return <div>{title}</div> }
JSX
4
pipaliyajaydip/gatsby
integration-tests/artifacts/src/pages/jsx.jsx
[ "MIT" ]
; ============================================================================== Local $version = "0.98" Local $expHash = "0xBC08BE1D87BF135A2B8F139A4FCD93F0AE027A87AE0A8374DD1716A18E1E2DEC" ; ============================================================================== #include <Crypt.au3> #include <InetConstants.au3> Local $title = "Npcap " & $version & " Setup" Local $localFile = "npcap.exe" Local $nb = InetGet("https://nmap.org/npcap/dist/npcap-" & $version & ".exe", $localFile, $INET_FORCERELOAD, $INET_DOWNLOADWAIT) If ($nb <= 0) Then Exit 1 EndIf _Crypt_Startup() Local $hash = _Crypt_HashFile($localFile, $CALG_SHA_256) If (String($hash) <> $expHash) Then Exit 2 EndIf Run($localFile) WinWait($title, "I &Agree") SendKeepActive($title) Send("!a") WinWaitActive($title, "Installation Options") If Not ControlCommand($title, "Installation Options", "[CLASS:Button; TEXT:Install Npcap in WinPcap API-compatible Mode]", "IsChecked") Then ControlCommand($title, "Installation Options", "[CLASS:Button; TEXT:Install Npcap in WinPcap API-compatible Mode]", "Check") EndIf Send("!i") WinWaitActive($title, "Installation Complete") Send("!n") WinWaitActive($title, "Finished") Send("{ENTER}")
AutoIt
4
Giuan0/cap
test/npcap-install.au3
[ "MIT" ]
{} (:package |test-map) :configs $ {} (:init-fn |test-map.main/main!) (:reload-fn |test-map.main/reload!) :modules $ [] |./util.cirru :files $ {} |test-map.main $ {} :ns $ quote ns test-map.main $ :require [] util.core :refer $ [] log-title inside-eval: inside-js: :defs $ {} |test-maps $ quote defn test-maps () assert= 2 $ count $ {} (:a 1) (:b 2) let dict $ merge {} (:a 1) (:b 2) {} (:c 3) (:d 5) assert= 4 $ count dict assert-detect identity (contains? dict :a) assert-detect not (contains? dict :a2) assert-detect identity (includes? dict 2) assert-detect not (includes? dict :a) ; echo $ keys dict assert= keys dict #{} :c :a :b :d assert= vals $ {} (:a 1) (:b 2) (:c 2) #{} 2 1 assert= (assoc dict :h 10) $ {} :a 1 :b 2 :c 3 :d 5 :h 10 assert= assoc (&{} :a 1 :b 2) :a 3 &{} :a 3 :b 2 assert= assoc (&{} :a 1 :b 2) :b 3 &{} :a 1 :b 3 assert= assoc (&{} :a 1 :b 2) :c 3 &{} :a 1 :b 2 :c 3 assert= assoc (&{} :a 1) :b 2 :c 3 &{} :a 1 :b 2 :c 3 inside-js: &let data $ &{} :a 1 .!turnMap data assert= assoc data :b 2 :c 3 &{} :a 1 :b 2 :c 3 assert= dissoc dict :a {,} :b 2 , :c 3 , :d 5 assert= dict (dissoc dict :h) assert= dissoc dict :a :b :c &{} :d 5 assert= merge {} :a 1 :b 2 {} :c 3 {} :d 4 {} (:a 1) (:b 2) (:c 3) (:d 4) assert= merge {,} :a 1 , :b 2 , :c 3 {,} :a nil , :b 12 {,} :c nil , :d 14 {,} :a nil , :b 12 , :c nil , :d 14 assert= merge-non-nil {,} :a 1 , :b 2 , :c 3 {,} :a nil , :b 12 {,} :c nil , :d 14 {,} :a 1 , :b 12 , :c 3 , :d 14 assert= merge {} (:a true) (:b false) (:c true) (:d false) {} (:a false) (:b false) (:c true) (:d true) {} (:a false) (:b false) (:c true) (:d true) assert= merge ({} (:a 1)) nil {} (:a 1) |test-pairs $ quote fn () assert= pairs-map $ [] [] :a 1 [] :b 2 {} (:a 1) (:b 2) assert= zipmap [] :a :b :c [] 1 2 3 {} :a 1 :b 2 :c 3 assert= to-pairs $ {} :a 1 :b 2 #{} [] :a 1 [] :b 2 assert= map-kv {} (:a 1) (:b 2) fn (k v) ([] k (+ v 1)) {} (:a 2) (:b 3) assert= filter {} (:a 1) (:b 2) (:c 3) (:d 4) fn (pair) $ let[] (k v) pair &> v 2 {} (:c 3) (:d 4) assert= .filter {} (:a 1) (:b 2) (:c 3) (:d 4) fn (pair) $ let[] (k v) pair &> v 2 {} (:c 3) (:d 4) assert= .filter-kv {} (:a 1) (:b 2) (:c 3) (:d 4) fn (k v) &> v 2 {} (:c 3) (:d 4) |test-native-map-syntax $ quote defn test-native-map-syntax () inside-eval: assert= macroexpand $ quote $ {} (:a 1) quote $ &{} :a 1 |test-map-comma $ quote fn () log-title "|Testing {,}" inside-eval: assert= macroexpand $ quote $ {,} :a 1 , :b 2 , :c 3 quote $ pairs-map $ section-by ([] :a 1 :b 2 :c 3) 2 assert= {,} :a 1 , :b 2 , :c 3 {} (:a 1) (:b 2) (:c 3) |test-keys $ quote fn () log-title "|Testing keys" assert= keys-non-nil $ {} :a 1 :b 2 #{} :a :b assert= keys-non-nil $ {} :a 1 :b 2 :c nil #{} :a :b |test-get $ quote fn () log-title "|Testing get" assert= nil $ get (&{}) :a assert= nil $ get-in (&{}) $ [] :a :b assert= nil $ get nil :a &let m $ &{} :a 1 :b 2 :c 3 :d 4 assert= (first m) (first m) assert= (rest m) (rest m) assert= 3 (count $ rest m) assert= 10 foldl m 0 $ fn (acc pair) let[] (k v) pair &+ acc v |test-select $ quote fn () log-title "|Testing select" assert= select-keys ({} (:a 1) (:b 2) (:c 3)) ([] :a :b) {} (:a 1) (:b 2) assert= select-keys ({} (:a 1) (:b 2) (:c 3)) ([] :d) {} (:d nil) assert= unselect-keys ({} (:a 1) (:b 2) (:c 3)) ([] :a :b) {} (:c 3) assert= unselect-keys ({} (:a 1) (:b 2) (:c 3)) ([] :c :d) {} (:a 1) (:b 2) |test-methods $ quote fn () log-title "|Testing map methods" assert= &{} :a 1 :b 2 .add (&{} :a 1) ([] :b 2) assert= &{} :a 1 :b 2 .assoc (&{} :a 1) :b 2 assert= true .contains? (&{} :a 1) :a assert= false .contains? (&{} :a 1) :b assert= 2 .count $ {} (:a 1) (:b 2) assert= &{} :a 1 .dissoc (&{} :a 1 :b 2) :b assert= &{} :a 1 .dissoc (&{} :a 1 :b 2 :c 3) :b :c assert= &{} .empty $ &{} :a 1 :b 2 assert= false .empty? $ &{} :a 1 :b 2 assert= true .empty? $ &{} assert= 1 .get (&{} :a 1) :a assert= nil .get (&{} :a 1) :b assert= 2 .get-in {} :a $ {} :b 2 [] :a :b assert= nil .get-in (&{}) [] :a :b assert= true .includes? (&{} :a 1 :b 2) 1 assert= false .includes? (&{} :a 1 :b 2) 3 assert= #{} :a :b .keys $ &{} :a 1 :b 2 assert= #{} :a :b keys-non-nil $ &{} :a 1 :b 2 :c nil assert= {} (:a 11) (:b 12) .map (&{} :a 1 :b 2) $ fn (entry) [] first entry + 10 $ last entry ; "not so stable, :bbbb is rare so it could be larger" assert= [] [] :a 11 [] :bbbb 12 .sort-by .map-list (&{} :a 1 :bbbb 2) $ fn (entry) [] first entry + 10 $ last entry , first assert= {} (:a 11) .map-kv ({} (:a 1)) $ fn (k v) [] k (+ v 10) assert= {} (:a 11) (:b 12) .map-kv ({} (:a 1) (:b 2) (:c 13)) fn (k v) if (< v 10) [] k (+ v 10) , nil assert= &{} :a 1 :b 2 .merge &{} :a 1 &{} :b 2 assert= &{} :a 1 :b 2 select-keys &{} :a 1 :b 2 :c 3 [] :a :b assert= [] ([] :a 1) .to-list $ {} (:a 1) assert= 2 .count $ .to-list $ {} :a 1 :b 2 assert= 2 .count $ .to-pairs $ {} :a 1 :b 2 assert= &{} :a 1 :b 2 unselect-keys &{} :a 1 :b 2 :c 3 [] :c assert= #{} 1 2 3 .values $ &{} :a 1 :b 2 :c 3 assert= true list? $ .first $ &{} :a 1 :b 2 :c 3 assert= 2 count $ .first $ &{} :a 1 :b 2 :c 3 assert= 2 .count $ .rest $ &{} :a 1 :b 2 :c 3 assert= &{} :c 3 .diff-new (&{} :a 1 :b 2 :c 3) (&{} :a 2 :b 3) assert= #{} :c .diff-keys (&{} :a 1 :b 2 :c 3) (&{} :a 2 :b 3) assert= #{} :a :b .common-keys (&{} :a 1 :b 2 :c 3) (&{} :a 2 :b 3) assert= &{} :a 1 .to-map (&{} :a 1) |test-diff $ quote fn () log-title "|Testing diff" assert= &map:diff-new &{} :a 1 :b 2 &{} :a 2 :b 3 &{} assert= &map:diff-new &{} :a 1 :b 2 :c 3 &{} :a 2 :b 3 &{} :c 3 assert= &map:diff-new &{} :a 1 :b 2 &{} :a 2 :b 3 :c 4 &{} assert= &map:diff-keys &{} :a 1 :b 2 &{} :a 2 #{} :b assert= &map:diff-keys &{} :a 1 :b 2 &{} :a 2 :c 3 #{} :b assert= &map:common-keys &{} :a 1 :b 2 &{} :a 2 :c 3 #{} :a |main! $ quote defn main! () log-title "|Testing maps" test-maps log-title "|Testing map pairs" test-pairs log-title "|Testing map syntax" test-native-map-syntax test-map-comma test-keys test-get test-select test-methods test-diff do true :proc $ quote () :configs $ {} (:extension nil)
Cirru
5
calcit-lang/calcit.rs
calcit/test-map.cirru
[ "MIT" ]
{:lint-as {reagent.core/with-let clojure.core/let} :linters {:unused-binding {:level :off} :if {:level :off} :unused-referred-var {:exclude {cljs.test [deftest testing is]}}}}
edn
2
oakmac/reagent
.clj-kondo/config.edn
[ "MIT" ]
Documentation This resource provides any keywords related to the Harbor private registry appliance Resource ../../resources/Util.robot *** Keywords *** Copy Image [Arguments] ${tag} ${projectname} ${reponame} Retry Element Click xpath=//clr-dg-row[contains(.,'${tag}')]//label Sleep 1 Retry Element Click ${artifact_action_xpath} Sleep 1 Retry Element Click ${artifact_action_copy_xpath} Sleep 1 #input necessary info Retry Text Input xpath=${copy_project_name_xpath} ${projectname} Retry Text Input xpath=${copy_repo_name_xpath} ${reponame} Retry Double Keywords When Error Retry Element Click ${confirm_btn} Retry Wait Until Page Not Contains Element ${confirm_btn}
RobotFramework
3
gerhardgossen/harbor
tests/resources/Harbor-Pages/Project-Copy.robot
[ "Apache-2.0" ]
def basic_fermat(n): a = ceil(sqrt(n)) b2 = a^2 - n while not is_square(b2): a += 1 b2 = a^2 - n return (a-sqrt(b2), a+sqrt(b2))
Sage
3
amoniaka-knabino/Crypton
RSA-encryption/Factorisation-Fermat/fermat.sage
[ "MIT" ]
// run-pass pub fn main() { match &[(Box::new(5),Box::new(7))] { ps => { let (ref y, _) = ps[0]; assert_eq!(**y, 5); } } match Some(&[(Box::new(5),)]) { Some(ps) => { let (ref y,) = ps[0]; assert_eq!(**y, 5); } None => () } match Some(&[(Box::new(5),Box::new(7))]) { Some(ps) => { let (ref y, ref z) = ps[0]; assert_eq!(**y, 5); assert_eq!(**z, 7); } None => () } }
Rust
4
Eric-Arellano/rust
src/test/ui/issues/issue-8498.rs
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
Deno.test("no-op", function () {}); Deno.test("leak interval", function () { setInterval(function () {}); });
TypeScript
2
erfanium/deno
cli/tests/testdata/test/ops_sanitizer_unstable.ts
[ "MIT" ]
/* * Title, should be H1 */ .title { font-family: 'Lato', sans-serif; font-size: 2em; margin: 0.67em 0 0; } dt { font-weight: bold; } div.multicol { -moz-column-gap: 1em; -webkit-column-gap: 1em; -moz-column-count: 3; -webkit-column-count: 3; } div.qindex, div.navtab { background-color: #EBEFF6; border: 1px solid #A3B4D7; text-align: center; } div.line { font-family: monospace, fixed; min-height: 13px; line-height: 1.0; text-wrap: unrestricted; white-space: -moz-pre-wrap; /* Moz */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ white-space: pre-wrap; /* CSS3 */ word-wrap: break-word; /* IE 5.5+ */ text-indent: -53px; padding-left: 53px; padding-bottom: 0px; margin: 0px; } span.lineno { padding-right: 4px; text-align: right; border-right: 2px solid #0F0; white-space: pre; } /* @group Code Colorization */ span.keyword { color: #008000 } span.keywordtype { color: #604020 } span.keywordflow { color: #e08000 } span.comment { color: #800000 } span.preprocessor { color: #806020 } span.stringliteral { color: #002080 } span.charliteral { color: #008080 } span.vhdldigit { color: #ff00ff } span.vhdlchar { color: #000000 } span.vhdlkeyword { color: #700070 } span.vhdllogic { color: #ff0000 } blockquote { background-color: #F7F8FB; border-left: 2px solid #9CAFD4; margin: 0 24px 0 4px; padding: 0 12px 0 16px; } /* @end */ hr { height: 0px; border: none; display: none; } dl { padding: 0 0 0 10px; } /* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ dl.section { margin-left: 0px; padding-left: 0px; } dl.note { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #D0C000; } dl.warning, dl.attention { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #FF0000; } dl.pre, dl.post, dl.invariant { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #00D000; } dl.deprecated { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #505050; } dl.todo { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #00C0E0; } dl.test { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #3030E0; } dl.bug { margin-left:-7px; padding-left: 3px; border-left:4px solid; border-color: #C08050; } dl.section dd { margin-bottom: 6px; } /* tooltip related style info */ .ttc { position: absolute; display: none; } #powerTip { cursor: default; white-space: nowrap; background-color: white; border: 1px solid gray; border-radius: 4px 4px 4px 4px; box-shadow: 1px 1px 7px gray; display: none; font-size: smaller; max-width: 80%; opacity: 0.9; padding: 1ex 1em 1em; position: absolute; z-index: 2147483647; } #powerTip div.ttdoc { color: grey; font-style: italic; } #powerTip div.ttname a { font-weight: bold; } #powerTip div.ttname { font-weight: bold; } #powerTip div.ttdeci { color: #006318; } #powerTip div { margin: 0px; padding: 0px; font: 12px/16px Roboto,sans-serif; } #powerTip:before, #powerTip:after { content: ""; position: absolute; margin: 0px; } #powerTip.n:after, #powerTip.n:before, #powerTip.s:after, #powerTip.s:before, #powerTip.w:after, #powerTip.w:before, #powerTip.e:after, #powerTip.e:before, #powerTip.ne:after, #powerTip.ne:before, #powerTip.se:after, #powerTip.se:before, #powerTip.nw:after, #powerTip.nw:before, #powerTip.sw:after, #powerTip.sw:before { border: solid transparent; content: " "; height: 0; width: 0; position: absolute; } #powerTip.n:after, #powerTip.s:after, #powerTip.w:after, #powerTip.e:after, #powerTip.nw:after, #powerTip.ne:after, #powerTip.sw:after, #powerTip.se:after { border-color: rgba(255, 255, 255, 0); } #powerTip.n:before, #powerTip.s:before, #powerTip.w:before, #powerTip.e:before, #powerTip.nw:before, #powerTip.ne:before, #powerTip.sw:before, #powerTip.se:before { border-color: rgba(128, 128, 128, 0); } #powerTip.n:after, #powerTip.n:before, #powerTip.ne:after, #powerTip.ne:before, #powerTip.nw:after, #powerTip.nw:before { top: 100%; } #powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { border-top-color: #ffffff; border-width: 10px; margin: 0px -10px; } #powerTip.n:before { border-top-color: #808080; border-width: 11px; margin: 0px -11px; } #powerTip.n:after, #powerTip.n:before { left: 50%; } #powerTip.nw:after, #powerTip.nw:before { right: 14px; } #powerTip.ne:after, #powerTip.ne:before { left: 14px; } #powerTip.s:after, #powerTip.s:before, #powerTip.se:after, #powerTip.se:before, #powerTip.sw:after, #powerTip.sw:before { bottom: 100%; } #powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { border-bottom-color: #ffffff; border-width: 10px; margin: 0px -10px; } #powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { border-bottom-color: #808080; border-width: 11px; margin: 0px -11px; } #powerTip.s:after, #powerTip.s:before { left: 50%; } #powerTip.sw:after, #powerTip.sw:before { right: 14px; } #powerTip.se:after, #powerTip.se:before { left: 14px; } #powerTip.e:after, #powerTip.e:before { left: 100%; } #powerTip.e:after { border-left-color: #ffffff; border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.e:before { border-left-color: #808080; border-width: 11px; top: 50%; margin-top: -11px; } #powerTip.w:after, #powerTip.w:before { right: 100%; } #powerTip.w:after { border-right-color: #ffffff; border-width: 10px; top: 50%; margin-top: -10px; } #powerTip.w:before { border-right-color: #808080; border-width: 11px; top: 50%; margin-top: -11px; } /* * Centered container for all content */ div.contents, div.header > *, ul.tablist, .navpath ul { margin:0 15px; } @media (min-width: 568px) { div.contents, div.header > *, ul.tablist, .navpath ul { margin: 0 auto; width: 90%; max-width: 1200px; } } /* * padding inside content */ div.contents > * { padding-top: 8px; padding-bottom: 8px; } @media (min-width: 568px) { div.contents > h2, div.contents > div.textblock, div.contents > div.memitem, div.contents > table.memberdecls h2, div.contents > p { padding-top: 30px; } } div.contents h2 { margin-top: 0px; } div.summary { display: none; } /* * Tabs * * Based on doxygen tabs.css */ .tabs, .tabs2, .tabs3 { width: 100%; background-color: #f4f4f4; border-top: solid 1px #ececec; } .tablist { margin: 0; padding: 0; display: table; } .tablist li { float: left; display: table-cell; line-height: 36px; list-style: none; } .tablist a { display: block; padding: 0 30px 0 0; } .tabs3 .tablist a { padding: 0 20px 0 0; } .tablist li.current a { color: #54a23d; } /* * Navpath */ .navpath ul { padding:20px 0px; } .navpath li { list-style-type:none; padding-right: 10px; float:left; } .navpath li.navelem a { padding-left: 10px; } .navpath li.navelem:before { content: "/"; color: #777; } /* * Member * * Styles for detailed member documentation */ .memitem { border-top: solid 1px #c9c9c9; } .memname { font-weight: bold; font-family: monospace; } td.memname { color: #54a23d; } .memname td { vertical-align: bottom; } .memproto, dl.reflist dt { font-weight: bold; } .memdoc, dl.reflist dd { } /* * Parameters */ .paramkey { text-align: right; } .paramtype { white-space: nowrap; } .paramname { color: #aa0e0e; white-space: nowrap; } .paramname em { font-style: normal; } .params, .retval, .exception, .tparams { margin-left: 0px; padding-left: 0px; } .params td { padding-right: 1em; padding-bottom: 0.5em; } .params .paramname, .retval .paramname { font-weight: bold; vertical-align: top; } .params .paramtype { font-style: italic; vertical-align: top; } /* * Inline Label etc. */ table.mlabels { border-spacing: 0px; } td.mlabels-left { width: 100%; padding: 0px; } td.mlabels-right { vertical-align: bottom; padding: 0px; white-space: nowrap; } span.mlabels { margin-left: 8px; } /* * Member Descriptions */ table.memberdecls { font-family: monospace; border-spacing: 0px; padding: 0px; } .memSeparator { line-height: 1px; margin: 0px; padding: 0 0 0.2em 0; } .memItemLeft, .memTemplItemLeft { white-space: nowrap; } .memItemRight { width: 100%; } .memTemplParams { color: #4665A2; white-space: nowrap; font-size: 80%; } /* * Fieldtable (Enums) */ .fieldtable td, .fieldtable th { padding: 0 1em 0.2em 0; } .fieldtable td.fieldtype, .fieldtable td.fieldname { white-space: nowrap; vertical-align: top; } /* * Directory */ .directory table { border-collapse:collapse; } .directory td { margin: 0px; padding: 0px; vertical-align: top; } .directory td.entry { white-space: nowrap; padding-right: 6px; padding-top: 3px; } .directory td.entry a { outline:none; } .directory td.entry a img { border: none; } .directory td.desc { width: 100%; padding-left: 6px; padding-right: 6px; padding-top: 3px; } .directory tr.even { padding-left: 6px; } .directory img { vertical-align: -30%; } .directory .levels { white-space: nowrap; width: 100%; text-align: right; } .directory .levels span { cursor: pointer; padding-left: 2px; padding-right: 2px; color: #3c92d1; } .arrow { color: #9CAFD4; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; font-size: 80%; display: inline-block; width: 16px; height: 22px; } .icon { font-family: Arial, Helvetica; font-weight: bold; font-size: 12px; height: 14px; width: 16px; display: inline-block; background-color: #54a23d; color: white; text-align: center; border-radius: 4px; margin-left: 2px; margin-right: 2px; } .icona { width: 24px; height: 22px; display: inline-block; } .iconfopen { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('ftv2folderopen.png'); background-position: 0px 0px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } .iconfclosed { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('ftv2folderclosed.png'); background-position: 0px 0px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } .icondoc { width: 24px; height: 18px; margin-bottom: 4px; background-image:url('ftv2doc.png'); background-position: 0px -1px; background-repeat: repeat-y; vertical-align:top; display: inline-block; } /* * Data Structure Index * * Hardcoded style attribute */ .contents > table[style] { margin: 20px auto !important; } /* * Search Box */ #MSearchBox { right: 4%; } @media print { #top { display: none; } #side-nav { display: none; } #nav-path { display: none; } body { overflow:visible; } h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } .summary { display: none; } .memitem { page-break-inside: avoid; } #doc-content { margin-left:0 !important; height:auto !important; width:auto !important; overflow:inherit; display:inline; } }
CSS
2
uga-rosa/neovim
contrib/doxygen/customdoxygen.css
[ "Vim" ]
/* * Program type: Embedded Dynamic SQL * * Description: * This program displays employee names and phone extensions. * * It allocates an output SQLDA, declares and opens a cursor, * and loops fetching multiple rows. * The contents of this file are subject to the Interbase Public * License Version 1.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy * of the License at http://www.Inprise.com/IPL.html * * Software distributed under the License is distributed on an * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express * or implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code was created by Inprise Corporation * and its predecessors. Portions created by Inprise Corporation are * Copyright (C) Inprise Corporation. * * All Rights Reserved. * Contributor(s): ______________________________________. */ #include "example.h" #include <stdlib.h> #include <string.h> void print_error (void); char *sel_str = "SELECT last_name, first_name, phone_ext FROM phone_list \ WHERE location = 'Monterey' ORDER BY last_name, first_name;"; /* This macro is used to declare structures representing SQL VARCHAR types */ #define SQL_VARCHAR(len) struct {short vary_length; char vary_string[(len)+1];} char Db_name[128]; EXEC SQL SET DATABASE empdb = "employee.fdb" RUNTIME :Db_name; int main(int argc, char** argv) { SQL_VARCHAR(15) first_name; SQL_VARCHAR(20) last_name; char phone_ext[6]; XSQLDA *sqlda; short flag0 = 0, flag1 = 0, flag2 = 0; if (argc > 1) strcpy(Db_name, argv[1]); else strcpy(Db_name, "employee.fdb"); EXEC SQL WHENEVER SQLERROR GO TO Error; EXEC SQL CONNECT empdb; EXEC SQL SET TRANSACTION; /* Allocate an output SQLDA. */ sqlda = (XSQLDA *) malloc(XSQLDA_LENGTH(3)); sqlda->sqln = 3; sqlda->version = 1; /* Prepare the query. */ EXEC SQL PREPARE q INTO SQL DESCRIPTOR sqlda FROM :sel_str; /* * Although, all three selected columns are of type varchar, the * third field's type is changed and printed as type TEXT. */ sqlda->sqlvar[0].sqldata = (char *)&last_name; sqlda->sqlvar[0].sqltype = SQL_VARYING + 1; sqlda->sqlvar[0].sqlind = &flag0; sqlda->sqlvar[1].sqldata = (char *)&first_name; sqlda->sqlvar[1].sqltype = SQL_VARYING + 1; sqlda->sqlvar[1].sqlind = &flag1; sqlda->sqlvar[2].sqldata = phone_ext; sqlda->sqlvar[2].sqltype = SQL_TEXT + 1; sqlda->sqlvar[2].sqlind = &flag2; /* Declare the cursor for the prepared query. */ EXEC SQL DECLARE s CURSOR FOR q; EXEC SQL OPEN s; printf("\n%-20s %-15s %-10s\n\n", "LAST NAME", "FIRST NAME", "EXTENSION"); /* * Fetch and print the records. */ while (SQLCODE == 0) { EXEC SQL FETCH s USING SQL DESCRIPTOR sqlda; if (SQLCODE == 100) break; printf("%-20.*s ", last_name.vary_length, last_name.vary_string); printf("%-15.*s ", first_name.vary_length, first_name.vary_string); phone_ext[sqlda->sqlvar[2].sqllen] = '\0'; printf("%-10s\n", phone_ext); } EXEC SQL CLOSE s; EXEC SQL COMMIT; EXEC SQL DISCONNECT empdb; free( sqlda); return(0); Error: print_error(); } void print_error (void) { isc_print_status(gds__status); printf("SQLCODE=%d\n", SQLCODE); }
Eiffel
5
AlexeyMochalov/firebird
examples/dyn/dyn3.e
[ "Condor-1.1" ]
# frozen_string_literal: true require "isolation/abstract_unit" module ApplicationTests module RakeTests class TmpTest < ActiveSupport::TestCase include ActiveSupport::Testing::Isolation def setup build_app end def teardown teardown_app end test "tmp:clear clear cache, socket, screenshot, and storage files" do Dir.chdir(app_path) do FileUtils.mkdir_p("tmp/cache") FileUtils.touch("tmp/cache/cache_file") FileUtils.mkdir_p("tmp/sockets") FileUtils.touch("tmp/sockets/socket_file") FileUtils.mkdir_p("tmp/screenshots") FileUtils.touch("tmp/screenshots/fail.png") FileUtils.mkdir_p("tmp/storage/6h/np") FileUtils.touch("tmp/storage/6h/np/6hnp81jvgt42pcfqtlpoy8qshfb0") rails "tmp:clear" assert_not File.exist?("tmp/cache/cache_file") assert_not File.exist?("tmp/sockets/socket_file") assert_not File.exist?("tmp/screenshots/fail.png") assert_not File.exist?("tmp/storage/6h/np/6hnp81jvgt42pcfqtlpoy8qshfb0") end end test "tmp:clear should work if folder missing" do FileUtils.remove_dir("#{app_path}/tmp") rails "tmp:clear" end end end end
Ruby
4
jstncarvalho/rails
railties/test/application/rake/tmp_test.rb
[ "MIT" ]
using Microsoft.Maui.Graphics; namespace Microsoft.Maui.Controls.Shapes { public partial class Ellipse : IShape { public override PathF GetPath() { var path = new PathF(); float x = (float)StrokeThickness / 2; float y = (float)StrokeThickness / 2; float w = (float)(Width - StrokeThickness); float h = (float)(Height - StrokeThickness); path.AppendEllipse(x, y, w, h); return path; } } }
C#
3
andreas-nesheim/maui
src/Controls/src/Core/HandlerImpl/Ellipse.Impl.cs
[ "MIT" ]
ruleset G2S.indy_sdk.pool { meta { shares __testing, list, handle,create , open provides list, handle, create , open } global { __testing = { "queries": [ { "name": "list" },{"name":"handle"} //, { "name": "entry", "args": [ "key" ] } ] , "events": [ { "domain": "pool", "type": "open" , "attrs": ["name"]}, { "domain": "pool", "type": "close" , "attrs": ["handle"]}, { "domain": "pool", "type": "create" , "attrs": ["name","config"]}, { "domain": "pool", "type": "delete" , "attrs": ["handle"]} //, { "domain": "d2", "type": "t2", "attrs": [ "a1", "a2" ] } ] } list= function(){ pool:listPool().map(function(value) {value{"pool"}}); } handle= function(){ pool:poolHandle(); } create= defaction(){ noop() } open = defaction(name){ pool:openPool(name) setting(poolHandle) returns poolHandle } } rule create { select when pool create pool:createPool(event:attr("name"),event:attr("config")) } rule open { select when pool open pool:openPool(event:attr("name")) setting(poolHandle) } rule close { select when pool close pool:closePool(event:attr("handle")) } rule delete { select when pool delete pool:deletePool(event:attr("handle")) } }
KRL
4
Picolab/G2S
krl/g2s.indy_sdk.pool.krl
[ "MIT" ]
#include "script_component.hpp" /* Name: TFAR_fnc_isLRRadio Author: Dedmen Returns if a radio is a Longrange radio. Arguments: 0: Radio classname <STRING> Return Value: True if Longrange, false if handheld radio. <BOOL> Example: "TFAR_anprc_152" call TFAR_fnc_isLRRadio; Public: Yes */ params ["_classname"]; if (_this isEqualType []) exitWith {true}; if (_classname isEqualType objNull) then {_classname = typeOf _classname;}; private _result = getNumber (configFile >> "CfgVehicles" >> _classname >> "tf_hasLRradio"); if (isNil "_result" || {_result != 1}) exitWith {false}; true
SQF
5
MrDj200/task-force-arma-3-radio
addons/core/functions/fnc_isLRRadio.sqf
[ "RSA-MD" ]
reset set terminal pdf set output 'workloadd.pdf'; set style data histogram set style histogram errorbars gap 2 lw 1 set title "ycsb worload-d" set ylabel "time(us)/req" set auto x set key outside below center # set log y set style fill pattern border set grid plot "data_workloadd.dat" using 2:3:xtic(1) with histogram title column(2), \ '' using 4:5:xtic(1) with histogram title column(4) set output
Gnuplot
2
aberdev/orientdb
core/src/test/resources/vpm_impact/plot_wld.plt
[ "Apache-2.0" ]
// run-rustfix #![allow(dead_code)] struct Events<R>(R); struct Other; pub trait Trait<T> { fn handle(value: T) -> Self; } // Blanket impl. (If you comment this out, compiler figures out that it // is passing an `&mut` to a method that must be expecting an `&mut`, // and injects an auto-reborrow.) impl<T, U> Trait<U> for T where T: From<U> { fn handle(_: U) -> Self { unimplemented!() } } impl<'a, R> Trait<&'a mut Events<R>> for Other { fn handle(_: &'a mut Events<R>) -> Self { unimplemented!() } } fn this_compiles<'a, R>(value: &'a mut Events<R>) { for _ in 0..3 { Other::handle(&mut *value); } } fn this_does_not<'a, R>(value: &'a mut Events<R>) { for _ in 0..3 { Other::handle(value); //~ ERROR use of moved value: `value` } } fn main() {}
Rust
5
Eric-Arellano/rust
src/test/ui/borrowck/mut-borrow-in-loop-2.rs
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
-- Macro Scripts File -- Created: Nov 17 1998 -- Modified: July 6 1999 -- Author: Frank DeLise -- Macro Scripts for SpaceWarps --*********************************************************************************************** -- MODIFY THIS AT YOUR OWN RISK macroScript SpaceBend category:"Space Warps" internalcategory:"Space Warps" tooltip:"Bend Space Warp " buttontext:"Bend Space Warp " Icon:#("SW_ModBased",1) ( on execute do StartObjectCreation SpaceBend on isChecked return mcrUtils.IsCreating SpaceBend ) macroScript SpaceTaper category:"Space Warps" internalcategory:"Space Warps" tooltip:"Taper Space Warp " buttontext:"Taper Space Warp " Icon:#("SW_ModBased",2) ( on execute do StartObjectCreation SpaceTaper on isChecked return mcrUtils.IsCreating SpaceTaper ) macroScript SpaceNoise category:"Space Warps" internalcategory:"Space Warps" tooltip:"Noise Space Warp " buttontext:"Noise Space Warp " Icon:#("SW_ModBased",3) ( on execute do StartObjectCreation SpaceNoise on isChecked return mcrUtils.IsCreating SpaceNoise ) macroScript SpaceTwist category:"Space Warps" internalcategory:"Space Warps" tooltip:"Twist Space Warp " buttontext:"Twist Space Warp " Icon:#("SW_ModBased",4) ( on execute do StartObjectCreation SpaceTwist on isChecked return mcrUtils.IsCreating SpaceTwist ) macroScript SpaceSkew category:"Space Warps" internalcategory:"Space Warps" tooltip:"Skew Space Warp" buttontext:"Skew Space Warp" Icon:#("SW_ModBased",5) ( on execute do StartObjectCreation SpaceSkew on isChecked return mcrUtils.IsCreating SpaceSkew ) macroScript SpaceStretch category:"Space Warps" internalcategory:"Space Warps" tooltip:"Stretch Space Warp" buttontext:"Stretch Space Warp" Icon:#("SW_ModBased",6) ( on execute do StartObjectCreation SpaceStretch on isChecked return mcrUtils.IsCreating SpaceStretch ) macroScript Ripple category:"Space Warps" internalcategory:"Space Warps" tooltip:"Ripple Space Warp" buttontext:"Ripple Space Warp" Icon:#("SW_GeoDef",6) ( on execute do StartObjectCreation SpaceRipple on isChecked return mcrUtils.IsCreating SpaceRipple ) macroScript FFD_Cyl category:"Space Warps" internalcategory:"Space Warps" tooltip:"FFD(Cyl) Space Warp" ButtonText:"FFD(Cyl) Space Warp" Icon:#("SW_GeoDef",5) ( on execute do StartObjectCreation SpaceFFDCyl on isChecked return mcrUtils.IsCreating SpaceFFDCyl ) macroScript FFD_Box category:"Space Warps" internalcategory:"Space Warps" tooltip:"FFD(Box) Space Warp" ButtonText:"FFD(Box) Space Warp" Icon:#("SW_GeoDef",1) ( on execute do StartObjectCreation SpaceFFDBox on isChecked return mcrUtils.IsCreating SpaceFFDBox ) macroScript Motor category:"Space Warps" internalcategory:"Space Warps" tooltip:"Motor Space Warp" buttontext:"Motor Space Warp" Icon:#("SW_PartDyn",3) ( on execute do StartObjectCreation Motor on isChecked return mcrUtils.IsCreating Motor ) macroScript Pbomb category:"Space Warps" internalcategory:"Space Warps" tooltip:"PBomb Space Warp" buttontext:"PBomb Space Warp" Icon:#("SW_PartDyn",4) ( on execute do StartObjectCreation PBomb on isChecked return mcrUtils.IsCreating PBomb ) macroScript Push category:"Space Warps" internalcategory:"Space Warps" tooltip:"Push Space Warp" buttontext:"Push Space Warp" Icon:#("SW_PartDyn",5) ( on execute do StartObjectCreation PushSpaceWarp on isChecked return mcrUtils.IsCreating PushSpaceWarp ) macroScript SDynaFlect category:"Space Warps" internalcategory:"Space Warps" tooltip:"SDynaFlect Space Warp" buttontext:"SDynaFlect Space Warp" Icon:#("SW_DynInt",2) ( on execute do StartObjectCreation SDynaFlect on isChecked return mcrUtils.IsCreating SDynaFlect ) macroScript PDynaFlect category:"Space Warps" internalcategory:"Space Warps" tooltip:"PDynaFlect Space Warp" buttontext:"PDynaFlect Space Warp" Icon:#("SW_DynInt",3) ( on execute do StartObjectCreation PDynaFlect on isChecked return mcrUtils.IsCreating PDynaFlect ) macroScript UDynaFlect category:"Space Warps" internalcategory:"Space Warps" tooltip:"UDynaFlect Space Warp" buttontext:"UDynaFlect Space Warp" Icon:#("SW_DynInt",4) ( on execute do StartObjectCreation UDynaFlect on isChecked return mcrUtils.IsCreating UDynaFlect ) macroScript POmniFlect category:"Space Warps" internalcategory:"Space Warps" tooltip:"POmniFlect Space Warp" buttontext:"POmniFlect Space Warp" Icon:#("SW_PartOnly",1) ( on execute do StartObjectCreation POmniFlect on isChecked return mcrUtils.IsCreating POmniFlect ) macroScript SOmniFlect category:"Space Warps" internalcategory:"Space Warps" tooltip:"SOmniFlect Space Warp" buttontext:"SOmniFlect Space Warp" Icon:#("SW_PartOnly",5) ( on execute do StartObjectCreation SOmniFlect on isChecked return mcrUtils.IsCreating SOmniFlect ) macroScript UOmniFlect category:"Space Warps" internalcategory:"Space Warps" tooltip:"UOmniFlect Space Warp" buttontext:"UOmniFlect Space Warp" Icon:#("SW_PartOnly",2) ( on execute do StartObjectCreation UOmniFlect on isChecked return mcrUtils.IsCreating UOmniFlect ) macroScript SDeflector category:"Space Warps" internalcategory:"Space Warps" tooltip:"SDeflector Space Warp" buttontext:"SDeflector Space Warp" Icon:#("SW_PartOnly",6) ( on execute do StartObjectCreation SDeflector on isChecked return mcrUtils.IsCreating SDeflector ) macroScript UDeflector category:"Space Warps" internalcategory:"Space Warps" tooltip:"UDeflector Space Warp" buttontext:"UDeflector Space Warp" Icon:#("SW_PartOnly",7) ( on execute do StartObjectCreation UDeflector on isChecked return mcrUtils.IsCreating UDeflector ) macroScript Wave category:"Space Warps" internalcategory:"Space Warps" tooltip:"Wave Space Warp" buttontext:"Wave Space Warp" Icon:#("SW_GeoDef",2) ( on execute do StartObjectCreation SpaceWave on isChecked return mcrUtils.IsCreating SpaceWave ) macroScript Gravity category:"Space Warps" internalcategory:"Space Warps" tooltip:"Gravity Space Warp " buttontext:"Gravity Space Warp " Icon:#("SW_PartDyn",1) ( on execute do StartObjectCreation Gravity on isChecked return mcrUtils.IsCreating Gravity ) macroScript Wind category:"Space Warps" internalcategory:"Space Warps" tooltip:"Wind Space Warp " buttontext:"Wind Space Warp " Icon:#("SW_PartDyn",2) ( on execute do StartObjectCreation Wind on isChecked return mcrUtils.IsCreating Wind ) macroScript Displace category:"Space Warps" internalcategory:"Space Warps" tooltip:"Displace Space Warp" buttontext:"Displace Space Warp" Icon:#("SW_GeoDef",3) ( on execute do StartObjectCreation SpaceDisplace on isChecked return mcrUtils.IsCreating SpaceDisplace ) macroScript Deflector category:"Space Warps" internalcategory:"Space Warps" tooltip:"Deflector Space Warp" buttontext:"Deflector Space Warp" Icon:#("SW_Partonly",4) ( on execute do StartObjectCreation Deflector on isChecked return mcrUtils.IsCreating Deflector ) macroScript Bomb category:"Space Warps" internalcategory:"Space Warps" tooltip:"Bomb Space Warp" buttontext:"Bomb Space Warp" Icon:#("SW_GeoDef",4) ( on execute do StartObjectCreation Bomb on isChecked return mcrUtils.IsCreating Bomb ) macroScript Path_Follow category:"Space Warps" internalcategory:"Space Warps" tooltip:"Path Follow Space Warp" buttontext:"Path Follow Space Warp" Icon:#("SW_Partonly",3) ( on execute do StartObjectCreation Path_Follow on isChecked return mcrUtils.IsCreating Path_Follow ) macroScript SpaceConform category:"Space Warps" internalcategory:"Space Warps" tooltip:"Conform Space Warp" buttontext:"Conform Space Warp" Icon:#("SW_GeoDef",7) ( on execute do StartObjectCreation ConformSpacewarp on isChecked return mcrUtils.IsCreating ConformSpacewarp )
MAXScript
4
89096000/MaxScript
Modelling/softinstance/treeview/icons/Macro_SpaceWarps.mcr
[ "MIT" ]
package scala.tools.eclipse.contribution.weaving.jdt.ui.actions; import java.util.List; import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor; import org.eclipse.jdt.ui.actions.OpenAction; import scala.tools.eclipse.contribution.weaving.jdt.ScalaJDTWeavingPlugin; import scala.tools.eclipse.contribution.weaving.jdt.ui.javaeditor.IScalaEditor; /** * When the user right clicks on a element and select "Open Declaration" in the * context menu, an instance of <code>OpenAction</code> is used to resolve the * binding and jump to the declaration. Because the Eclipse API does not expose * an extension point for this action, we need to create a custom one and * intercept the creation of an <code>OpenAction</code>, if it originates from a * <code>IScalaEditor</code>. */ @SuppressWarnings("restriction") public privileged aspect OpenActionProviderAspect { pointcut newInstance(JavaEditor editor): call(public OpenAction.new(JavaEditor)) && args(editor); OpenAction around(JavaEditor editor) : newInstance(editor) { if (editor instanceof IScalaEditor) { List<IOpenActionProvider> providers = OpenActionProviderRegistry .getInstance().getProviders(); if (providers.size() == 1) { IOpenActionProvider provider = providers.get(0); return provider.getOpenAction(editor); } else if (providers.isEmpty()) { return proceed(editor); } else { String msg = "Found multiple provider classes for extension point `" + OpenActionProviderRegistry.OPEN_ACTION_PROVIDERS_EXTENSION_POINT + "`.\n" + "This is ambiguos, therefore I'm going to ignore this custom extension point and use the default implementation.\n" + "\tHint: To fix this look in your plugin.xml file and make sure to declare at most one provider class for the extension point: " + OpenActionProviderRegistry.OPEN_ACTION_PROVIDERS_EXTENSION_POINT; ScalaJDTWeavingPlugin.getInstance().logErrorMessage(msg); return proceed(editor); } } else { return proceed(editor); } } }
AspectJ
4
dragos/scala-ide
org.scala-ide.sdt.aspects/src/scala/tools/eclipse/contribution/weaving/jdt/ui/actions/OpenActionProviderAspect.aj
[ "BSD-3-Clause" ]
USING LanguageService.CodeAnalysis.Scripting USING LanguageService.CodeAnalysis.XSharp.Scripting FUNCTION Start() AS VOID ? "Printing from within a script..." XSharpScript.RunAsync(" ? 'HELLO WORLD!' ") ? ? "The Print() function that pretty-prints stuff in xsi.exe is not available here..." TRY XSharpScript.RunAsync(" Print( 'HELLO WORLD!' ) ") CATCH e AS CompilationErrorException ? Console.WriteLine("Caught exception: {0}",e:GetType()) END TRY ? ? "A script could also return a value..." ? XSharpScript.EvaluateAsync(" 1+1 "):Result ? ? "A script have multiple lines and still return a value..." ? XSharpScript.EvaluateAsync(; e" LOCAL X := 10 AS INT \n"+; e" LOCAL Y := 10 AS INT \n"+; e" return X+Y"; ):Result ? RETURN
xBase
3
JohanNel/XSharpPublic
ScriptSamples/XIDE/1-HelloWorld.prg
[ "Apache-2.0" ]
<%= greeting %>: <%= customer.name %>
HTML+ERB
1
mdesantis/rails
actionview/test/fixtures/customers/_customer.html.erb
[ "MIT" ]
/** * */ import Util; import OpenApi; import OpenApiUtil; import EndpointUtil; extends OpenApi; init(config: OpenApi.Config){ super(config); @endpointRule = ''; checkConfig(config); @endpoint = getEndpoint('tablestore', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint); } function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{ if (!Util.empty(endpoint)) { return endpoint; } if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) { return endpointMap[regionId]; } return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix); } model GetInstanceRequest { instanceName?: string(name='InstanceName'), } model GetInstanceResponseBody = { requestId?: string(name='RequestId', description='Id of the request'), instanceName?: string(name='InstanceName'), regionId?: string(name='RegionId'), SPInstanceId?: string(name='SPInstanceId'), aliasName?: string(name='AliasName'), userId?: string(name='UserId'), network?: string(name='Network'), instanceDescription?: string(name='InstanceDescription'), instanceSpecification?: string(name='InstanceSpecification'), paymentType?: string(name='PaymentType'), storageType?: string(name='StorageType'), VCUQuota?: int32(name='VCUQuota'), tableQuota?: int32(name='TableQuota'), instanceStatus?: string(name='InstanceStatus'), createTime?: string(name='CreateTime'), tags?: [ { tagKey?: string(name='TagKey'), tagValue?: string(name='TagValue'), } ](name='Tags'), } model GetInstanceResponse = { headers: map[string]string(name='headers'), body: GetInstanceResponseBody(name='body'), } async function getInstance(request: GetInstanceRequest): GetInstanceResponse { var runtime = new Util.RuntimeOptions{}; var headers : map[string]string = {}; return getInstanceWithOptions(request, headers, runtime); } async function getInstanceWithOptions(request: GetInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetInstanceResponse { Util.validateModel(request); var query : map[string]any= {}; if (!Util.isUnset(request.instanceName)) { query.InstanceName = request.instanceName; } var req = new OpenApi.OpenApiRequest{ headers = headers, query = OpenApiUtil.query(query), }; return doROARequest('GetInstance', '2020-12-09', 'HTTPS', 'GET', 'AK', `/v2/openapi/getinstance`, 'json', req, runtime); } model DescribeRegionsRequest { clientToken?: string(name='ClientToken', description='幂等参数'), } model DescribeRegionsResponseBody = { requestId?: string(name='requestId', description='Id of the request'), regions?: [ { regionId?: string(name='RegionId', description='region id'), i18nKey?: string(name='I18nKey', description='region key'), } ](name='Regions', description='region list'), } model DescribeRegionsResponse = { headers: map[string]string(name='headers'), body: DescribeRegionsResponseBody(name='body'), } async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse { var runtime = new Util.RuntimeOptions{}; var headers : map[string]string = {}; return describeRegionsWithOptions(request, headers, runtime); } async function describeRegionsWithOptions(request: DescribeRegionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DescribeRegionsResponse { Util.validateModel(request); var query : map[string]any= {}; if (!Util.isUnset(request.clientToken)) { query.ClientToken = request.clientToken; } var req = new OpenApi.OpenApiRequest{ headers = headers, query = OpenApiUtil.query(query), }; return doROARequest('DescribeRegions', '2020-12-09', 'HTTPS', 'GET', 'AK', `/region/DescribeRegions`, 'json', req, runtime); } model ListInstancesRequest { status?: string(name='Status'), maxResults?: int32(name='MaxResults'), nextToken?: string(name='NextToken'), } model ListInstancesResponseBody = { requestId?: string(name='RequestId', description='Id of the request'), totalCount?: long(name='TotalCount'), nextToken?: string(name='NextToken'), instances?: [ { instanceName?: string(name='InstanceName', description='实例名称,唯一键'), resourceGroupId?: string(name='ResourceGroupId', description='资源组id'), regionId?: string(name='RegionId'), SPInstanceId?: string(name='SPInstanceId'), aliasName?: string(name='AliasName'), userId?: string(name='UserId'), instanceDescription?: string(name='InstanceDescription'), instanceSpecification?: string(name='InstanceSpecification'), paymentType?: string(name='PaymentType'), storageType?: string(name='StorageType'), VCUQuota?: int32(name='VCUQuota'), instanceStatus?: string(name='InstanceStatus'), createTime?: string(name='CreateTime'), } ](name='Instances'), } model ListInstancesResponse = { headers: map[string]string(name='headers'), body: ListInstancesResponseBody(name='body'), } async function listInstances(request: ListInstancesRequest): ListInstancesResponse { var runtime = new Util.RuntimeOptions{}; var headers : map[string]string = {}; return listInstancesWithOptions(request, headers, runtime); } async function listInstancesWithOptions(request: ListInstancesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListInstancesResponse { Util.validateModel(request); var query : map[string]any= {}; if (!Util.isUnset(request.status)) { query.Status = request.status; } if (!Util.isUnset(request.maxResults)) { query.MaxResults = request.maxResults; } if (!Util.isUnset(request.nextToken)) { query.NextToken = request.nextToken; } var req = new OpenApi.OpenApiRequest{ headers = headers, query = OpenApiUtil.query(query), }; return doROARequest('ListInstances', '2020-12-09', 'HTTPS', 'GET', 'AK', `/v2/openapi/listinstances`, 'json', req, runtime); } model UpdateInstanceRequest { instanceName?: string(name='InstanceName'), aliasName?: string(name='AliasName'), instanceDescription?: string(name='InstanceDescription'), network?: string(name='Network'), } model UpdateInstanceResponseBody = { requestId?: string(name='RequestId'), } model UpdateInstanceResponse = { headers: map[string]string(name='headers'), body: UpdateInstanceResponseBody(name='body'), } async function updateInstance(request: UpdateInstanceRequest): UpdateInstanceResponse { var runtime = new Util.RuntimeOptions{}; var headers : map[string]string = {}; return updateInstanceWithOptions(request, headers, runtime); } async function updateInstanceWithOptions(request: UpdateInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateInstanceResponse { Util.validateModel(request); var body : map[string]any= {}; if (!Util.isUnset(request.instanceName)) { body.InstanceName = request.instanceName; } if (!Util.isUnset(request.aliasName)) { body.AliasName = request.aliasName; } if (!Util.isUnset(request.instanceDescription)) { body.InstanceDescription = request.instanceDescription; } if (!Util.isUnset(request.network)) { body.Network = request.network; } var req = new OpenApi.OpenApiRequest{ headers = headers, body = OpenApiUtil.parseToMap(body), }; return doROARequest('UpdateInstance', '2020-12-09', 'HTTPS', 'POST', 'AK', `/v2/openapi/updateinstance`, 'json', req, runtime); }
Tea
4
aliyun/alibabacloud-sdk
tablestore-20201209/main.tea
[ "Apache-2.0" ]
.panel.panel-default .panel-body.market-ticker = render partial: 'shared/market/ticker' .panel-body.market-chart
Slim
3
gsmlg/peatio
app/views/shared/market/_chart.html.slim
[ "MIT" ]
#!/usr/bin/perl -wT use strict; use CGI; print "Content-type: text/plain\r\n"; print "Access-Control-Allow-Origin: *\r\n\r\n"; print "hello\n";
Perl
3
zealoussnow/chromium
third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/resources/xhr-redirect-not-allowed.pl
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
export { default } from './Popover'; export * from './Popover'; export { default as popoverClasses } from './popoverClasses'; export * from './popoverClasses';
TypeScript
4
good-gym/material-ui
packages/material-ui/src/Popover/index.d.ts
[ "MIT" ]
#N canvas 616 23 656 802 12; #X obj 83 447 rpole~; #X obj 104 527 cpole~; #X obj 128 558 cpole~; #X obj 104 495 *~; #X msg 512 555 clear; #X obj 151 248 loadbang; #X obj 177 622 rzero~; #X obj 207 684 czero~; #X obj 233 720 czero~; #X obj 207 652 /~; #X obj 421 436 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 50; #X obj 83 418 *~; #X obj 177 594 /~; #X obj 198 315 samplerate~; #X obj 198 341 / 2; #X obj 151 369 / 22050; #X obj 151 316 f \$1; #X obj 151 342 t f b; #X obj 159 287 inlet; #X obj 421 248 loadbang; #X obj 429 287 inlet; #X obj 287 248 loadbang; #X obj 333 317 samplerate~; #X obj 333 343 / 2; #X obj 287 371 / 22050; #X obj 287 343 t f b; #X obj 295 287 inlet; #X obj 83 251 inlet~; #X obj 514 287 inlet; #X obj 233 748 outlet~; #X obj 287 318 f \$2; #X obj 421 320 f \$3; #X text 83 230 audio; #X text 155 227 lp freq; #X text 285 227 hp freq; #X text 417 227 hi/lo norm; #X text 515 265 clear; #X text 110 26 3-pole \, 3-zero butterworth lp/hp/shelving filter. Args: lp freq \, hp freq \, normalize-hi. Inlets: input signal \, lo freq \, hi freq \, hi norm \, reset.; #X text 112 101 For high-pass: set LP freq =0 and hi/lo to 1; #X text 112 72 For low-pass: set HP freq >= SR/2 and hi/lo to 0; #X text 111 147 Shelving: HP and LP specify shelving band. Gain difference is about HP/LP cubed (so HP=2LP should give about 18 dB \, for example.) ; #X obj 151 401 buttercoef3; #X obj 244 577 buttercoef3; #X connect 0 0 3 0; #X connect 1 0 2 0; #X connect 1 1 2 1; #X connect 2 0 12 0; #X connect 3 0 1 0; #X connect 4 0 0 0; #X connect 4 0 1 0; #X connect 4 0 2 0; #X connect 4 0 6 0; #X connect 4 0 7 0; #X connect 4 0 8 0; #X connect 5 0 16 0; #X connect 6 0 9 0; #X connect 7 0 8 0; #X connect 7 1 8 1; #X connect 8 0 29 0; #X connect 9 0 7 0; #X connect 10 0 41 1; #X connect 10 0 42 1; #X connect 11 0 0 0; #X connect 12 0 6 0; #X connect 13 0 14 0; #X connect 14 0 15 1; #X connect 15 0 41 0; #X connect 16 0 17 0; #X connect 17 0 15 0; #X connect 17 1 13 0; #X connect 18 0 16 0; #X connect 19 0 31 0; #X connect 20 0 31 0; #X connect 21 0 30 0; #X connect 22 0 23 0; #X connect 23 0 24 1; #X connect 24 0 42 0; #X connect 25 0 24 0; #X connect 25 1 22 0; #X connect 26 0 30 0; #X connect 27 0 11 0; #X connect 28 0 4 0; #X connect 30 0 25 0; #X connect 31 0 10 0; #X connect 41 0 11 1; #X connect 41 1 3 1; #X connect 41 2 0 1; #X connect 41 3 1 2; #X connect 41 3 2 2; #X connect 41 4 1 3; #X connect 41 5 2 3; #X connect 42 0 12 1; #X connect 42 1 9 1; #X connect 42 2 6 1; #X connect 42 3 7 2; #X connect 42 3 8 2; #X connect 42 4 7 3; #X connect 42 5 8 3;
Pure Data
5
mxa/pure-data
doc/3.audio.examples/butterworth3~.pd
[ "TCL" ]
Module: WIN32-Automation Synopsis: Dylan accessors for OLE Automation arrays. Author: David N. Gray Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc. All rights reserved. License: See License.txt in this distribution for details. Warranty: Distributed WITHOUT WARRANTY OF ANY KIND define constant $unknown-element-type = <C-void*>; // "Safe Array" define C-subtype <ole-array> ( <array>, <LPSAFEARRAY> ) slot element-pointer-type :: <class>, init-value: $unknown-element-type; end; define function import-safe-array ( ptr :: <LPSAFEARRAY> ) => ( value :: <ole-array> ); let address = pointer-address(ptr); if ( zero?(address) | (ptr.cDims-value = 1) ) make(<ole-vector>, address: address) else make(<ole-array>, address: address) end if end import-safe-array; define C-mapped-subtype <c-safe-array> ( <LPSAFEARRAY> ) import-map <ole-array>, import-function: import-safe-array; end; define method make( class :: subclass(<ole-array>), #rest rest-args, #key address = %no-value, dimensions = %no-value, size: size-arg :: <integer> = 0, fill = %no-value, vartype = $VT-VARIANT ) => (array :: <ole-array>); if ( address ~== %no-value ) next-method() else let element-ptr-type :: false-or(<class>) = if ( vartype = $VT-UI1 ) // in this context, treat as a byte instead of a character. <C-unsigned-char*> else element($vt-c-pointer-classes, vartype, default: #f) end if; if ( element-ptr-type == #f | vartype > $VT-VARIANT-MAX ) error("make %= invalid vartype = %d", class, vartype); end if; let ndims :: <integer> = if ( dimensions ~== %no-value ) size(dimensions) else 1 end if; let result :: <ole-array> = with-stack-structure ( bounds :: <LPSAFEARRAYBOUND>, element-count: max(ndims,1) ) bounds.cElements-value := size-arg; bounds.lLbound-value := 0; unless ( dimensions == %no-value ) // Note: the bounds array passed to SafeArrayCreate is in the // reverse order from what ends up in the safe array structure. for ( i :: <integer> from 0 below ndims ) let bound :: <LPSAFEARRAYBOUND> = pointer-value-address(bounds, index: i); let dim :: <integer> = dimensions[i]; bound.cElements-value := dim; bound.lLbound-value := 0; end for; end unless; let psa :: <LPSAFEARRAY> = SafeArrayCreate(vartype, ndims, bounds); if ( null-pointer?(psa) ) if ( ndims <= 0 ) error("0-dimension <ole-array> not supported"); else apply(ole-error, $E-OUTOFMEMORY, "SafeArrayCreate", $null-interface, rest-args); end if; end if; import-safe-array(psa); end with-stack-structure; result.element-pointer-type := element-ptr-type; unless ( fill == %no-value ) fill!(result, fill); end; result end if end method make; define method destroy ( a :: <ole-array>, #key ) => () SafeArrayDestroy(a); values() end method destroy; define sealed method empty?( a :: <ole-array> ) => empty :: <boolean>; null-pointer?(a) | zero?(a.cDims-value) | zero?(a.rgsabound-value.cElements-value) end; define sealed method rank( a :: <ole-array> ) => (ndim :: <integer>); a.cDims-value end; define sealed method dimensions( a :: <ole-array> ) => dims :: <simple-object-vector>; let ndim :: <U16> = rank(a); let dims :: <simple-object-vector> = make(<simple-object-vector>, size: ndim); let ad = a.rgsabound-value; for ( i :: <U16> from 0 below ndim ) let bound :: <LPSAFEARRAYBOUND> = pointer-value-address(ad, index: i); dims[ndim - 1 - i] := bound.cElements-value; end for; dims end method dimensions; // Note: we do not need to define `aref' and `aref-setter' methods on // `<ole-array>' because the default methods will do the right thing // by using our methods for `row-major-index' and `element'. define sealed method row-major-index (array :: <ole-array>, #rest subscripts) => (index :: <integer>) // Compute the linear index for the array element, even though despite // the function name, safe arrays are actually stored in column major order. let ndim = array.rank; unless (ndim = subscripts.size) /* // can't do this yet because the class is not exported. error(make(<subscript-out-of-bounds-error>, format-string: "Number of subscripts %= not equal to " "rank of array %=", format-arguments: list(subscripts, array))) */ error("Wrong number of subscripts %= for %=", subscripts, array); end unless; let sum :: <integer> = 0; let ad = array.rgsabound-value; // dimensions in reverse order for ( i :: <integer> from ndim - 1 to 0 by -1, j :: <integer> from 0 by 1 ) let bound :: <LPSAFEARRAYBOUND> = pointer-value-address(ad, index: j); let index :: <integer> = subscripts[i]; let dimension :: <integer> = bound.cElements-value; if (index >= dimension | index < 0) element-range-error(array, subscripts); end if; sum := (sum * dimension) + index; end for; sum end method row-major-index; define C-subtype <ole-vector> ( <vector>, <ole-array> ) end; define sealed method size ( v :: <ole-vector> ) => size :: <integer>; v.rgsabound-value.cElements-value end; define constant $range-error-message = "ELEMENT outside of range: %=[%=]"; define function element-range-error( collection, index ) => (); /* // should do this for consistency with the built-in `element' methods, // but can't because the condition class is not exported. error(make(<invalid-index-error>, format-string: $range-error-message, format-arguments: vector(collection, index))); */ error($range-error-message, collection, index); end; define sealed method element-pointer ( v :: <ole-array>, index :: <integer>, default) => ptr :: <C-pointer>; // code shared by `element' and `element-setter' // returns a pointer to the designated element. if ( index < 0 | index >= size(v) ) if ( default == %no-value ) element-range-error(v, index); end if; $NULL-VOID else let pointer-class :: <class> = v.element-pointer-type; if ( pointer-class == $unknown-element-type ) let kind = logand(v.fFeatures-value, logior($FADF-BSTR, $FADF-UNKNOWN, $FADF-DISPATCH, $FADF-VARIANT)); pointer-class := select (kind) $FADF-VARIANT => <LPVARIANT>; $FADF-BSTR => <LPBSTR>; $FADF-UNKNOWN => <LPLPUNKNOWN>; $FADF-DISPATCH => <LPLPDISPATCH>; otherwise => error("Unknown element type for %=", v); end select; end if; SafeArrayLock(v); // ensures validity of pvData-value make(pointer-class, address: u%+(pointer-address(v.pvData-value), index * v.cbElements-value)) end if end method element-pointer; define method element ( v :: <ole-array>, index :: <integer>, #key default = %no-value) => elem :: <object>; // Note: this does not use `SafeArrayGetElement' because we // don't want it copying strings or calling AddRef, since that is // not part of the expected protocol for `element'. let ptr :: <C-pointer> = element-pointer(v, index, default); if ( ptr == $NULL-VOID ) default else let result = pointer-value(ptr); SafeArrayUnlock(v); result end if end method element; define method element-setter ( new-value :: <object>, v :: <ole-array>, index :: <integer> ) => (element :: <object>); let ptr :: <C-pointer> = element-pointer(v, index, %no-value); pointer-value(ptr) := new-value; SafeArrayUnlock(v); new-value end element-setter; define method copy-safearray-element ( value :: <string> ); // Even if it is already a <BSTR>, a new copy is needed because it will // be automatically deleted when the containing SAFEARRAY is deleted. copy-as-BSTR(value) end; define method copy-safearray-element ( value :: <LPUNKNOWN> ); // Increment the ref count because it will be automatically decremented // when the containing SAFEARRAY is deleted. AddRef(value); value end; define method vt-of-elements ( elements :: <sequence> ) => (vt :: <integer>); let vt :: <integer> = $VT-VARIANT; unless ( empty?(elements) ) let first-vt = vartype-of-value(first(elements)); if ( first-vt ~= $VT-VARIANT ) if ( every?(method(value) vartype-of-value(value) == first-vt end, elements) ) vt := first-vt; end if; end if; end unless; vt end vt-of-elements; define method vt-of-elements ( elements :: type-union(<simple-byte-vector>, <simple-byte-array>) ) => (vt :: <integer>); $VT-UI1 end; define method vt-of-elements ( elements :: type-union(<simple-integer-vector>, <simple-integer-array>)) => (vt :: <integer>); $VT-I4 end; define method vt-of-elements ( elements :: type-union(<simple-single-float-vector>, <simple-single-float-array>)) => (vt :: <integer>); $VT-R4 end; define function ole-vector ( #rest elements ) => vector :: <ole-vector>; let vt :: <integer> = vt-of-elements(elements); let vector :: <ole-vector> = make(<ole-vector>, size: size(elements), vartype: vt); if ( ~ zero?(logand(vector.fFeatures-value, logior($FADF-BSTR, $FADF-UNKNOWN, $FADF-DISPATCH))) ) map-into(vector, copy-safearray-element, elements); else // Either don't need to copy the elements, or else the copy will be done // by a `pointer-value-setter' method for <LPVARIANT>. for ( i from 0, value in elements ) vector[i] := value; end for; end if; vector end ole-vector; // type codes that could appear in a <VARIANT>: define constant <variant-vt> = limited(<integer>, min: $VT-VARIANT-MIN, max: $VT-VARIANT-MAX); define generic vartype-of-value ( value ) => (vt :: <variant-vt>); define method vartype-of-value ( value :: <integer> ) => (vt :: <variant-vt>) $VT-I4 end; define method vartype-of-value ( value :: <machine-word> ) => (vt :: <variant-vt>) $VT-I4 end; define method vartype-of-value ( value :: <single-float> ) => (vt :: <variant-vt>) $VT-R4 end; define method vartype-of-value ( value :: <double-float> ) => (vt :: <variant-vt>) $VT-R8 end; define method vartype-of-value ( value :: <string> ) => (vt :: <variant-vt>) $VT-BSTR end; define method vartype-of-value ( value :: <boolean> ) => (vt :: <variant-vt>) $VT-BOOL end; define method vartype-of-value ( value :: <object> ) => (vt :: <variant-vt>) $VT-VARIANT end; define method as( class == <ole-vector>, data :: <sequence> ) => v :: <ole-vector>; apply(ole-vector, data) end; define method as( class == <ole-vector>, data :: <ole-vector> ) => v :: <ole-vector>; data end; // used in "variant.dylan" but defined here so all the array stuff is together. define function as-safe-array ( array :: <array> ) => ( sa :: <ole-array>, vt :: <integer> ); let vt :: <integer> = vt-of-elements(array); let dims :: <sequence> = dimensions(array); let sa :: <ole-array> = make(<ole-array>, dimensions: dims, vartype: vt); unless ( empty?(dims) ) // Copy the elements. // Can't just do a sequential copy because storage order is different. // This currently works properly only for two-dimensional arrays. ??? let pointer-class :: <class> = sa.element-pointer-type; SafeArrayLock(sa); // ensures validity of pvData-value let data-address = pointer-address(sa.pvData-value); let element-size :: <integer> = sa.cbElements-value; let total-size :: <integer> = size(array); let nrows = dims[0]; let row :: <integer> = 0; let n :: <integer> = 0; let special? = ~ zero?(logand(sa.fFeatures-value, logior($FADF-BSTR, $FADF-UNKNOWN, $FADF-DISPATCH))); for ( element in array ) let ptr = make(pointer-class, address: u%+(data-address, n * element-size)); pointer-value(ptr) := if ( special? ) copy-safearray-element(element) else element end if; n := n + nrows; if ( n >= total-size ) row := row + 1; n := row; end if; end for; SafeArrayUnlock(sa); end unless; values( sa, vt ) end as-safe-array; define method copy-automation-value ( sa :: <ole-array> ); if ( null-pointer?(sa) ) // Shouldn't really happen, but just to be safe. sa else let dims = dimensions(sa); let result :: <array> = make(<array>, dimensions: dims); unless ( empty?(dims) ) // Copy the elements. // Can't just do a sequential copy because storage order is different. // This currently works properly only for two-dimensional arrays. ??? let pointer-class :: <class> = sa.element-pointer-type; SafeArrayLock(sa); // ensures validity of pvData-value let data-address = pointer-address(sa.pvData-value); let element-size :: <integer> = sa.cbElements-value; let total-size :: <integer> = size(result); let nrows = dims[0]; let row :: <integer> = 0; let n :: <integer> = 0; for ( i from 0 below total-size ) let ptr = make(pointer-class, address: u%+(data-address, n * element-size)); let element = pointer-value(ptr); result[i] := copy-automation-value(element); n := n + nrows; if ( n >= total-size ) row := row + 1; n := row; end if; end for; SafeArrayUnlock(sa); end unless; result end if; end;
Dylan
5
kryptine/opendylan
sources/ole/win32-automation/arrays.dylan
[ "BSD-2-Clause" ]
{{ page.date }}
Liquid
0
binyamin/eleventy
test/stubs/pagedate.liquid
[ "MIT" ]
.search-page.ais-Hits { width: 100%; position: relative; background: #fefefe; } .search-page .ais-Hits-list { display: flex; flex-direction: column; align-items: center; margin-left: 0; border: 1px solid #efefef; } .search-page .ais-Hits-list > a { width: 100%; text-decoration: none; } .search-page .ais-Hits-list > a:nth-child(odd) { background-color: #efefef; } .search-page .ais-Hits-item { width: 100%; margin: 0; border-color: transparent; color: #333; padding: 15px; box-shadow: none; } .search-page .ais-Hits-item:hover, .search-page .ais-Hits-item:focus { background-color: #006400; color: white; } .search-page .ais-Hits-item:hover em { color: #333; }
CSS
3
fcastillo-serempre/freeCodeCamp
client/src/components/search/searchPage/search-page-hits.css
[ "BSD-3-Clause" ]
#tag Class Protected Class KioskApplicationWFS Inherits Application #tag Event Sub Open() mAppTester = new Mutex( App.ExecutableFile.Name ) if mAppTester.TryEnter then Soft Declare Function CreateDesktopW Lib "User32" ( name as WString, device as Integer, devMode as Integer, _ flags as Integer, access as Integer, sec as Integer ) as Integer Declare Function GetCurrentThreadId Lib "Kernel32" () as Integer Soft Declare Function GetThreadDesktop Lib "User32" ( id as Integer ) as Integer Soft Declare Function OpenInputDesktop Lib "User32" ( flags as Integer, inherit as Boolean, access as Integer ) as Integer Soft Declare Sub SetThreadDesktop Lib "User32" ( desk as Integer ) Soft Declare Sub SwitchDesktop Lib "User32" ( desk as Integer ) Soft Declare Sub CloseDesktop Lib "User32" ( desk as Integer ) Const GENERIC_ALL = &H10000000 Const DESKTOP_SWITCHDESKTOP = &H100 // These local variables will hold all of our desktop references Dim hDesk, hOldDesk, hOldInputDesk as Integer // The first thing we need to do is keep track of the current // desktop so that we can switch back to it when we're done hOldDesk = GetThreadDesktop( GetCurrentThreadId ) // We also need to get the input desktop hOldInputDesk = OpenInputDesktop( 0, false, DESKTOP_SWITCHDESKTOP ) if hOldInputDesk = 0 then KioskModeExceptionWFS.Create( "Could not open the input desktop for switching" ) return end if // Now we're ready to make our new desktop. We're just going to use // the application name as the desktop name. hDesk = CreateDesktopW( App.ExecutableFile.Name, 0, 0, 0, GENERIC_ALL, 0 ) if hDesk = 0 then KioskModeExceptionWFS.Create( "Could not create a new desktop" ) return end if // Now that we've made a new desktop, let's set it up and // switch over to it SetThreadDesktop( hDesk ) SwitchDesktop( hDesk ) // Since we're the first instance, we want to launch another instance of // this application, and wait for it to complete App.ExecutableFile.LaunchAndWait( "", App.ExecutableFile.Name ) // Now clean everything up if hDesk <> 0 then SwitchDesktop( hOldInputDesk ) SetThreadDesktop( hOldDesk ) CloseDesktop( hDesk ) end if // We're done too Quit return else // Call the user's Open event since this is a "normal" instance // of the kiosk application Open end if Exception err as FunctionNotFoundException // Cannot run in true kiosk mode, so do something about it KioskModeExceptionWFS.Create( "Kiosk mode not supported on this operating system" ) End Sub #tag EndEvent #tag Hook, Flags = &h0 Event Open() #tag EndHook #tag Property, Flags = &h21 Private mAppTester As Mutex #tag EndProperty #tag ViewBehavior #tag EndViewBehavior End Class #tag EndClass
REALbasic
5
bskrtich/WFS
Windows Functionality Suite/Kiosk Mode/KioskApplicationWFS.rbbas
[ "MIT" ]
#! /bin/sh -e src=gcc if [ $# -eq 3 -a "$2" = '-d' ]; then pdir="-d $3" src=$3/gcc elif [ $# -ne 1 ]; then echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 fi case "$1" in -patch) patch $pdir -f --no-backup-if-mismatch -p0 --fuzz 10 < $0 ;; -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 --fuzz 10 < $0 ;; *) echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" exit 1 esac exit 0 # DP: try harder to avoid ldm in function epilogues --- gcc/config/arm/arm.c Fri Mar 5 18:49:42 2004 +++ gcc/config/arm/arm.c Fri Mar 5 16:00:21 2004 @@ -7598,6 +7629,26 @@ return_used_this_function = 0; } +/* Return the number (counting from 0) of + the least significant set bit in MASK. */ + +#ifdef __GNUC__ +inline +#endif +static int +number_of_first_bit_set (mask) + int mask; +{ + int bit; + + for (bit = 0; + (mask & (1 << bit)) == 0; + ++bit) + continue; + + return bit; +} + const char * arm_output_epilogue (really_return) int really_return; @@ -7788,27 +7839,47 @@ saved_regs_mask |= (1 << PC_REGNUM); } - /* Load the registers off the stack. If we only have one register - to load use the LDR instruction - it is faster. */ - if (saved_regs_mask == (1 << LR_REGNUM)) - { - /* The exception handler ignores the LR, so we do - not really need to load it off the stack. */ - if (eh_ofs) - asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM); - else - asm_fprintf (f, "\tldr\t%r, [%r], #4\n", LR_REGNUM, SP_REGNUM); - } - else if (saved_regs_mask) + if (saved_regs_mask) { - if (saved_regs_mask & (1 << SP_REGNUM)) - /* Note - write back to the stack register is not enabled - (ie "ldmfd sp!..."). We know that the stack pointer is - in the list of registers and if we add writeback the - instruction becomes UNPREDICTABLE. */ - print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask); + /* Load the registers off the stack. If we only have one register + to load use the LDR instruction - it is faster. */ + if (bit_count (saved_regs_mask) == 1) + { + int reg = number_of_first_bit_set (saved_regs_mask); + + switch (reg) + { + case SP_REGNUM: + /* Mustn't use base writeback when loading SP. */ + asm_fprintf (f, "\tldr\t%r, [%r]\n", SP_REGNUM, SP_REGNUM); + break; + + case LR_REGNUM: + if (eh_ofs) + { + /* The exception handler ignores the LR, so we do + not really need to load it off the stack. */ + asm_fprintf (f, "\tadd\t%r, %r, #4\n", SP_REGNUM, SP_REGNUM); + break; + } + /* else fall through */ + + default: + asm_fprintf (f, "\tldr\t%r, [%r], #4\n", reg, SP_REGNUM); + break; + } + } else - print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask); + { + if (saved_regs_mask & (1 << SP_REGNUM)) + /* Note - write back to the stack register is not enabled + (ie "ldmfd sp!..."). We know that the stack pointer is + in the list of registers and if we add writeback the + instruction becomes UNPREDICTABLE. */ + print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask); + else + print_multi_reg (f, "ldmfd\t%r!", SP_REGNUM, saved_regs_mask); + } } if (current_function_pretend_args_size) @@ -9610,26 +9677,6 @@ } } -/* Return the number (counting from 0) of - the least significant set bit in MASK. */ - -#ifdef __GNUC__ -inline -#endif -static int -number_of_first_bit_set (mask) - int mask; -{ - int bit; - - for (bit = 0; - (mask & (1 << bit)) == 0; - ++bit) - continue; - - return bit; -} - /* Generate code to return from a thumb function. If 'reg_containing_return_addr' is -1, then the return address is actually on the stack, at the stack pointer. */
Darcs Patch
4
JrCs/opendreambox
recipes/gcc/gcc-3.3.4/arm-ldm.dpatch
[ "MIT" ]
# --experiment_type=yolo_darknet # mAP 43.0 runtime: distribution_strategy: 'tpu' mixed_precision_dtype: 'bfloat16' task: smart_bias_lr: 0.0 model: darknet_based_model: true input_size: [512, 512, 3] backbone: type: 'darknet' darknet: model_id: 'cspdarknet53' max_level: 5 min_level: 3 decoder: type: yolo_decoder yolo_decoder: version: v4 type: regular activation: leaky head: smart_bias: true detection_generator: box_type: 'all': original scale_xy: '5': 1.05 '4': 1.1 '3': 1.2 max_boxes: 200 nms_type: iou iou_thresh: 0.001 nms_thresh: 0.60 loss: use_scaled_loss: false box_loss_type: 'all': ciou ignore_thresh: 'all': 0.7 iou_normalizer: 'all': 0.07 cls_normalizer: 'all': 1.0 object_normalizer: 'all': 1.0 objectness_smooth: 'all': 0.0 max_delta: 'all': 5.0 norm_activation: activation: mish norm_epsilon: 0.0001 norm_momentum: 0.99 use_sync_bn: true num_classes: 80 anchor_boxes: anchors_per_scale: 3 boxes: [box: [12, 16], box: [19, 36], box: [40, 28], box: [36, 75], box: [76, 55], box: [72, 146], box: [142, 110], box: [192, 243], box: [459, 401]] train_data: global_batch_size: 64 dtype: float32 input_path: '/readahead/200M/placer/prod/home/tensorflow-performance-data/datasets/coco/train*' is_training: true drop_remainder: true seed: 1000 parser: mosaic: mosaic_frequency: 0.75 mixup_frequency: 0.0 mosaic_crop_mode: 'crop' mosaic_center: 0.2 aug_scale_min: 0.2 aug_scale_max: 1.6 jitter: 0.3 max_num_instances: 200 letter_box: false random_flip: true aug_rand_saturation: 1.5 aug_rand_brightness: 1.5 aug_rand_hue: 0.1 aug_scale_min: 0.1 aug_scale_max: 1.9 aug_rand_translate: 0.0 jitter: 0.3 area_thresh: 0.1 random_pad: true use_tie_breaker: true anchor_thresh: 0.4 validation_data: global_batch_size: 8 dtype: float32 input_path: '/readahead/200M/placer/prod/home/tensorflow-performance-data/datasets/coco/val*' is_training: false drop_remainder: true parser: max_num_instances: 200 letter_box: false use_tie_breaker: true anchor_thresh: 0.4 weight_decay: 0.000 init_checkpoint: 'gs://tf_model_garden/vision/yolo/ckpt-15000' init_checkpoint_modules: 'backbone' annotation_file: null trainer: train_steps: 555000 validation_steps: 625 steps_per_loop: 1850 summary_interval: 1850 validation_interval: 9250 checkpoint_interval: 1850 optimizer_config: ema: average_decay: 0.9998 trainable_weights_only: false dynamic_decay: true learning_rate: type: stepwise stepwise: boundaries: [400000] name: PiecewiseConstantDecay values: [0.00131, 0.000131] optimizer: type: sgd_torch sgd_torch: momentum: 0.949 momentum_start: 0.949 nesterov: true warmup_steps: 1000 weight_decay: 0.0005 name: SGD warmup: type: 'linear' linear: warmup_steps: 1000 # learning rate rises from 0 to 0.0013 over 1000 steps
YAML
3
KiryanovKD/models
official/vision/beta/projects/yolo/configs/experiments/yolov4/detection/yolov4_512_tpu.yaml
[ "Apache-2.0" ]
CREATE TABLE `tb_ambgylvzkp` ( `col_smbnzspzed` date DEFAULT NULL, `col_ebfnpjymeg` tinytext CHARACTER SET utf8mb4, `col_llpqomujks` varchar(24) CHARACTER SET latin1 NOT NULL DEFAULT '', `col_eeieaubbdp` decimal(12,0) DEFAULT NULL, `col_evvhlyienk` char(172) CHARACTER SET utf8mb4 DEFAULT NULL, PRIMARY KEY (`col_llpqomujks`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `tb_rnradhkfon` ( `col_sbuommslma` timestamp(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), `col_corovzewna` date DEFAULT '2019-07-04', UNIQUE KEY `col_sbuommslma` (`col_sbuommslma`), UNIQUE KEY `col_sbuommslma_2` (`col_sbuommslma`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SQL
2
yuanweikang2020/canal
parse/src/test/resources/ddl/alter/mysql_65.sql
[ "Apache-2.0" ]
ECERE Project File Version 0.1a Target "Style" Configurations + Debug Compiler Options Intermediate Directory = debug Debug = True Optimize = None AllWarnings = True Preprocessor Definitions = _DEBUG Linker Options Target Name = Style Target Type = Executable Target Directory = debug Libraries = ecere + Release Compiler Options Intermediate Directory = release Debug = False Optimize = Speed AllWarnings = True Linker Options Target Name = Style Target Type = Executable Target Directory = release Libraries = ecere Files - Style.ec - Layout.ec - Test.ec - Image.ec - Animation.ec - Button.ec
Ecere Projects
2
N-eil/ecere-sdk
autoLayout/ryanStyles/Style.epj
[ "BSD-3-Clause" ]
INTERFACE zif_abapgit_cts_api PUBLIC . TYPES: BEGIN OF ty_transport, obj_type TYPE tadir-object, obj_name TYPE tadir-obj_name, trkorr TYPE trkorr, END OF ty_transport. TYPES ty_transport_list TYPE SORTED TABLE OF ty_transport WITH NON-UNIQUE KEY obj_type obj_name. "! Returns the transport request / task the object is currently in "! @parameter is_item | Object "! @parameter rv_transport | Transport request / task "! @raising zcx_abapgit_exception | Object is not in a transport METHODS get_transport_for_object IMPORTING !is_item TYPE zif_abapgit_definitions=>ty_item RETURNING VALUE(rv_transport) TYPE trkorr RAISING zcx_abapgit_exception . "! Check if change recording is possible for the given package "! @parameter iv_package | Package "! @parameter rv_possible | Change recording is possible "! @raising zcx_abapgit_exception | Package could not be loaded METHODS is_chrec_possible_for_package IMPORTING !iv_package TYPE devclass RETURNING VALUE(rv_possible) TYPE abap_bool RAISING zcx_abapgit_exception . METHODS get_transports_for_list IMPORTING !it_items TYPE zif_abapgit_definitions=>ty_items_tt RETURNING VALUE(rt_transports) TYPE ty_transport_list RAISING zcx_abapgit_exception . METHODS get_r3tr_obj_for_limu_obj IMPORTING iv_object TYPE tadir-object iv_obj_name TYPE trobj_name EXPORTING ev_object TYPE tadir-object ev_obj_name TYPE trobj_name RAISING zcx_abapgit_exception . ENDINTERFACE.
ABAP
5
IvxLars/abapGit
src/cts/zif_abapgit_cts_api.intf.abap
[ "MIT" ]
% Net Arbiter Module % Interface to the Java Net Arbiter unit module pervasive NetArbiter export % Constants ~. ARB_ERROR_NO_ERROR, ~. ARB_ERROR_ALREADY_RUNNING, ~. ARB_ERROR_CONNECTION_REFUSED, ~. ARB_ERROR_INVALID_ARG, ~. ARB_ERROR_INVALID_RESPONSE, ~. ARB_ERROR_STARUP_FAILED, ~. ARB_ERROR_UNKNOWN_ERROR, ~. STATUS_NEW, ~. STATUS_DISCONNECT, % Structures ~. var Arbiter, ~. Packet, ~. ConnectionStatus, errorToString %% Types %%% % Representation of a packet class pervasive Packet export % Exportable constants % size is modified by 'expand' var connID, var next, size, % Payload helpers getPayload, expand, cleanup % Packet data var connID : nat2 := 0 var size : nat2 := 0 var bytes : flexible array 1 .. 0 of nat1 var next : ^Packet := nil /** * Gets the address of the payload data */ fcn getPayload () : addressint result addr (bytes) end getPayload /** * Alters the size of the payload * Doesn't allow for the shrinkage of the payload size */ proc expand (newSize : nat4) if newSize < size then return end if size := newSize new bytes, newSize end expand /** * Cleans up data related to the packet */ proc cleanup () free bytes end cleanup end Packet /** * Special packet that's used to indicate a connection change * Used for indication of new connections and disconnects */ type pervasive ConnectionStatus : record % Status indication of the packet statusType : int % Connection ID associated with the status update connID : int % Pointer to the next status update next : ^ConnectionStatus end record %% Error Codes %% const pervasive ARB_ERROR_NO_ERROR : int := 0 % Current arbiter is already running const pervasive ARB_ERROR_ALREADY_RUNNING : int := -1 % Connection to the arbiter was refused const pervasive ARB_ERROR_CONNECTION_REFUSED : int := -2 % Invalid argument given (Bad connection ID or bad address) const pervasive ARB_ERROR_INVALID_ARG : int := -3 % Invalid response given const pervasive ARB_ERROR_INVALID_RESPONSE : int := -4 % Unable to start arbiter process const pervasive ARB_ERROR_STARUP_FAILED : int := -5 % Unknown error const pervasive ARB_ERROR_UNKNOWN_ERROR : int := -6 %% Constants %% const pervasive ITOHX : array 0 .. 15 of nat1 := init ( ord ('0'), ord ('1'), ord ('2'), ord ('3'), ord ('4'), ord ('5'), ord ('6'), ord ('7'), ord ('8'), ord ('9'), ord ('A'), ord ('B'), ord ('C'), ord ('D'), ord ('E'), ord ('F') ) % Status update for the ConnectionStatus structure const pervasive STATUS_NEW : int := 0 const pervasive STATUS_DISCONNECT : int := 1 /** * Converts an errno into a string */ fcn pervasive errorToString (error : int) : string case error of label ARB_ERROR_NO_ERROR: result "No Error" label ARB_ERROR_CONNECTION_REFUSED: result "Connection Refused" label ARB_ERROR_ALREADY_RUNNING: result "Already Running" label ARB_ERROR_INVALID_ARG: result "Invalid Argument" label ARB_ERROR_INVALID_RESPONSE: result "Invalid Arbiter Response" label ARB_ERROR_STARUP_FAILED: result "Process Startup Failed" label ARB_ERROR_UNKNOWN_ERROR: result "Unknown Error" label : result "Bad error code" end case end errorToString % Main net arbiter code class Arbiter import Sys export startup, shutdown, connectTo, disconnect, poll, getPacket, nextPacket, getStatus, nextStatus, writePacket, getError %% Normal constants %% const ARB_RESPONSE_NEW_CONNECTION : nat1 := ord ('N') const ARB_RESPONSE_CONNECTION_CLOSED : nat1 := ord ('R') const ARB_RESPONSE_ERROR : nat1 := ord ('W') const ARB_RESPONSE_COMMAND_SUCCESS : nat1 := ord ('S') %% Stateful variables %% % Current run state of the arbiter var isRunning : boolean := false % FilDes for the net socket var netFD : int := -1 % Last error the arbiter encountered var errno : int := ARB_ERROR_NO_ERROR % Current command sequence var sequence : nat2 := 0 % List of pending packets var pendingPackets : ^Packet := nil var pendingPacketsTail : ^Packet := nil % List of pending connection status updates var pendingStatus : ^ConnectionStatus := nil var pendingStatusTail : ^ConnectionStatus := nil %% Asynchronous Dealsies %% % Is there a command being currently processed var isCommandInProgress : boolean := false % Response for the current command var responseParam : int4 := -1 var lastBytes : int := 0 %%% Private Functions %%% /** * Handles the response given by the net arbiter * * Params: * responseID: The packet ID of the response * packetData: The remaining data of the packet * * Returns: * The response parameter, or -1 if an error occurred */ fcn handleResponse (responseID : char, packetData : array 1 .. * of nat1) : int4 % Packet Data Format: [sequence:2][packetID:1][connID:2][payload] % By this point, the command has been handled isCommandInProgress := false var param : int4 := -1 % Read in the response param param := cheat(int4, (packetData (6) shl 24) or (packetData (7) shl 16) or (packetData (8) shl 8) or (packetData (9))) % Handle the appropriate response case responseID of label 'E': % Command ended % If the param is < 0, an error occurred if param < 0 then % Translate the error code case param of % No error label 0: param := ARB_ERROR_NO_ERROR % Unknown error label -1: param := ARB_ERROR_UNKNOWN_ERROR % Bad connection id label -2: param := ARB_ERROR_INVALID_ARG % Connection refused label -3: param := ARB_ERROR_CONNECTION_REFUSED % Bad hostname or port label -4: param := ARB_ERROR_INVALID_ARG % Bad response label : param := ARB_ERROR_INVALID_RESPONSE end case errno := param end if if errno not= ARB_ERROR_NO_ERROR then param := -1 end if % TODO: Handle remote connections label 'N', 'F': % New Connection, or Remote closed connection % Get the connection id in the param var connID : nat2 := cheat (nat2, param) % Build the connection status data var status : ^ConnectionStatus new status status -> connID := cheat (nat2, connID) status -> next := nil % Select the appropriate status if responseID = 'N' then status -> statusType := STATUS_NEW else status -> statusType := STATUS_DISCONNECT end if % Append to status update list if pendingStatus = nil then % Empty queue pendingStatus := status pendingStatusTail := status else % List with things in it pendingStatusTail -> next := status pendingStatusTail := status end if label : errno := ARB_ERROR_INVALID_RESPONSE result -1 end case result param end handleResponse /** * Handles the current incoming read packet * * packetData: The data of the packet */ proc handleRead (packetData : array 1 .. * of nat1) % Packet Data Format: [sequence:2][packetID:1][connID:2][payload] var connID, payloadSize : nat4 % Get connID connID := (packetData (4) shl 8) or (packetData (5)) % Calculate payload size payloadSize := upper(packetData) - 5 if payloadSize = 0 then % Ignore 0-length packets return end if % Build the packet data var packet : ^Packet new packet packet -> connID := cheat (nat2, connID) packet -> next := nil % Copy the payload data packet -> expand (cheat (nat2, payloadSize)) for i : 0 .. payloadSize - 1 nat1 @ (packet -> getPayload () + i) := nat1 @ (addr(packetData) + i + 5) end for % Append to packet list if pendingPackets = nil then % Empty queue pendingPackets := packet pendingPacketsTail := packet else % List with things in it pendingPacketsTail -> next := packet pendingPacketsTail := packet end if end handleRead %%% Exported Functions %%% /** * Gets the most recent error encountered by the arbiter * * Valid return values: * ARB_ERROR_NO_ERROR: * No error has occured * ARB_ERROR_ALREADY_RUNNING: * The arbiter is already running * ARB_ERROR_CONNECTION_REFUSED: * A connection to the arbiter or remote arbiter was refused * ARB_ERROR_INVALID_ARG: * An invalid argument was given * ARB_ERROR_STARUP_FAILED: * An error was encountered while starting up the arbiter process * ARB_ERROR_UNKNOWN_ERROR: * An unknown error occurred */ fcn getError () : int result errno end getError /** * Polls the arbiter to see if there is any incoming data * Must be called before a getPacket () * * Returns: * true if there is any pending data, false otherwise */ fcn poll () : boolean % Handle net exceptions handler ( eN ) if eN < 2300 or eN > 2400 then % Not a net error quit > end if put "ExceptionP: ", eN % Die isRunning := false % No more packets to process result false end handler if not isRunning then result false end if if Net.BytesAvailable (netFD) = 0 then % Nothing in the buffer result false end if % There is some pending data available % It is either a response, or a read packet loop exit when Net.BytesAvailable (netFD) = 0 % Read the entire packet var len : nat2 loop % TODO: For some reason, single bytes are sent to the % endpoint. Handle that case read : netFD, len : 2 % Ignore empty length packets exit when len > 0 end loop % Swap the bytes into little endian len := cheat(nat2, len shr 8) or cheat(nat2, len shl 8) % Read the rest of the packet var packetData : array 1 .. (len - 2) of nat1 read : netFD, packetData : (len - 2) % Read the packet data (5 - 2 -> 3) var packetID : char := chr(packetData(3)) case packetID of label 'R': responseParam := -1 handleRead(packetData) label : responseParam := handleResponse(packetID, packetData) end case end loop result true end poll /** * Gets the most recent packet in the queue */ fcn getPacket () : ^Packet result pendingPackets end getPacket /** * Pops the given packet from the current queue and moves on to the next * one * * Returns: * True if there is more packets to process, false otherwise */ fcn nextPacket () : boolean if pendingPackets = nil then % Nothing inside of the queue result false end if var packet : ^Packet := pendingPackets % Advance the queue pendingPackets := pendingPackets -> next % Done with the packet packet -> cleanup () free packet if pendingPackets = nil then % Queue is empty pendingPacketsTail := nil result false end if % More packets to process result true end nextPacket /** * Gets the most recent connection status update in the queue */ fcn getStatus () : ^ConnectionStatus result pendingStatus end getStatus /** * Pops the current update from the current queue and moves on to the * next one * * Returns: * True if there is more updates to process, false otherwise */ fcn nextStatus () : boolean if pendingStatus = nil then % Nothing inside of the queue result false end if var status : ^ConnectionStatus := pendingStatus % Advance the queue pendingStatus := pendingStatus -> next % Done with the status update free status if pendingStatus = nil then % Queue is empty pendingStatusTail := nil result false end if % More status updates to process result true end nextStatus /** * Sends data to a remote connection */ fcn writePacket (connID : int4, byteData : array 1 .. * of nat1) : int % Handle net exceptions handler ( eN ) if eN < 2300 or eN > 2400 then % Not a net error quit > end if put "ExceptionW: ", eN % Die isRunning := false % Nothing to do result 0 end handler if not isRunning then result 0 end if % Command format: | length (2) | sequence (2) | 'W' | connID (2) | payload (???) | % Packet length: CmdID (1) + ConnID (4) + Size (4) + Payload (???) var packetLength : nat4 := (2 + 2 + 1) + 2 + upper (byteData) var arbData : array 1 .. packetLength of nat1 %% Header %% % Length arbData (1) := ((packetLength shr 8) & 16#FF) arbData (2) := ((packetLength shr 0) & 16#FF) % Sequence arbData (3) := ((sequence shr 8) & 16#FF) arbData (4) := ((sequence shr 0) & 16#FF) % Packet ID arbData (5) := ord ('W') % Connection ID arbData (6) := (connID shr 8) & 16#FF arbData (7) := (connID shr 0) & 16#FF % Payload for i : 1 .. upper (byteData) arbData (7 + i) := byteData (i) end for /*for i : 1 .. packetLength put chr(arbData (i)) .. end for put ""*/ % Send the packet write : netFD, arbData : packetLength % Wait for the response errno := ARB_ERROR_NO_ERROR loop exit when not isCommandInProgress var dummy := poll () end loop % Advance the sequence sequence := (sequence + 1) & 16#FFFF result 0 end writePacket /** * Connects to a remote arbiter * * Parameters: * host: The address of the host to connect to (can be a domain name or) * a valid ip address * port: The specific port of the host to connect to * * Returns: * The connection ID to the remote arbiter. If it is negative, then an error * has occurred. * * Errors: * ARB_ERROR_INVALID_ARG: * If the host name given was invalid * ARB_ERROR_CONNECTION_REFUSED: * If connection to the remote arbiter was refused */ fcn connectTo (host : string, port : nat2) : int4 % Handle net exceptions handler ( eN ) if eN < 2300 or eN > 2400 then % Not a net error quit > end if put "ExceptionC: ", eN % Die isRunning := false % Nothing to do result ARB_ERROR_UNKNOWN_ERROR end handler if not isRunning then result ARB_ERROR_UNKNOWN_ERROR end if % Command format: | length (2) | sequence (2) | 'C' | [port] | [hostname] const packetLength : int := (2 + 2 + 1) + (2 + 1 + length (host)) var arbConnect : array 1 .. packetLength of nat1 % Deal with command state if isCommandInProgress then % Command is in progress result -1 end if isCommandInProgress := true %% Header %% % Length arbConnect (1) := (packetLength shr 8) & 16#FF arbConnect (2) := (packetLength shr 0) & 16#FF % Sequence arbConnect (3) := (sequence shr 8) & 16#FF arbConnect (4) := (sequence shr 0) & 16#FF % Packet ID arbConnect (5) := ord ('C') % Port arbConnect (6) := (port shr 8) & 16#FF arbConnect (7) := (port shr 0) & 16#FF % String length arbConnect (8) := cheat(nat1, length (host)) % String for i : 1 .. length (host) arbConnect (8 + i) := ord (host (i)) end for % Send the command write : netFD, arbConnect : upper (arbConnect) % Wait for the response errno := ARB_ERROR_NO_ERROR loop exit when not isCommandInProgress var dummy := poll () end loop % Advance the sequence sequence := (sequence + 1) & 16#FFFF % responseParam has the connection id result responseParam end connectTo /** * Disconnects from a remote arbiter * * Parameters: * connID: The destination location of the connection ID * * Errors: * ARB_ERROR_INVALID_ARG: * If the connection id given was invalid */ proc disconnect (connID : int4) % Handle net exceptions handler ( eN ) if eN < 2300 or eN > 2400 then % Not a net error quit > end if put "ExceptionD: ", eN % Die isRunning := false % No more packets to process return end handler if not isRunning then return end if % Command format: | length (2) | seq (2) | 'D' | connID % Packet length: CmdId (1) + Connection ID (4) const packetLength : int := (2 + 2 + 1) + 2 var arbDisconnect : array 1 .. packetLength of nat1 % Deal with command state if isCommandInProgress then return end if isCommandInProgress := true %% Header %% % Length arbDisconnect (1) := 0 arbDisconnect (2) := packetLength % Sequence arbDisconnect (3) := (sequence shr 8) & 16#FF arbDisconnect (4) := (sequence shr 0) & 16#FF % PacketID arbDisconnect (5) := ord ('D') % Connection ID arbDisconnect (6) := (connID shr 8) & 16#0F arbDisconnect (7) := (connID shr 0) & 16#0F % Send the command write : netFD, arbDisconnect : upper (arbDisconnect) % Wait for the response errno := ARB_ERROR_NO_ERROR loop exit when not isCommandInProgress var dummy := poll () end loop % Advance the sequence sequence := (sequence + 1) & 16#FFFF end disconnect /** * Launches the net arbiter * * As communication with the net arbiter is done over a network socket, the * local port of the arbiter needs to be specified * * The listening port is not required for the operation of the arbiter, but * it is used to allow the arbiter to accept connections from other arbiters * If this behaviour is not desired, then the listenPort parameter can be * set to 0 * * Parameters: * arbiterPort: The port that the arbiter interface will be at * listenPort: The port that the arbiter will accept connections from * * Errors: * ARB_ERROR_CONNECTION_REFUSED: * If a connection attempt was refused * ARB_ERROR_INVALID_ARG: * If the arbiterPort is equal to listenPort * If the arbiterPort is 0 */ proc startup (arbiterPort : nat2, listenPort : nat2) if isRunning then % The net arbiter is already running errno := ARB_ERROR_ALREADY_RUNNING return end if if arbiterPort = listenPort or arbiterPort = 0 then % - Endpoint port can't be the same as the listening port % - Arbiter port can't be 0 errno := ARB_ERROR_INVALID_ARG return end if % TODO: Start the net arbiter process const CMD_STRING : string := "javaw -jar ./netarbiter/net-arbiter.jar" %"javaw -cp ..//out/production/turing-net-arbiter ddb.io.netarbiter.NetArbiter" % Build the command string var realCommand : string := "" realCommand += CMD_STRING realCommand += " --endpointPort=" + natstr(arbiterPort) if listenPort not= 0 then % Append optional listening port realCommand += " --listenPort=" + natstr(listenPort) end if % Launch the arbiter process put "Starting arbiter with command: \"", realCommand, '"' var retval : int system (realCommand, retval) if retval not= 0 then % Error in starting the net arbiter process % Note: "Error.Last" contains more information about the % specific error errno := ARB_ERROR_STARUP_FAILED return end if % Attempt to connect to the net arbiter 10 times before failing % Have increasing delay so that connection attempts aren't spaced together for try : 1 .. 10 netFD := Net.OpenConnectionBinary ("localhost", arbiterPort) exit when netFD >= 0 % Wait for at least 10ms, up to 10 seconds delay (10 * (1 shl try)) end for if netFD < 0 then % Net socket connection error (connection refused) errno := ARB_ERROR_CONNECTION_REFUSED return end if % Connection to arbiter successful isRunning := true errno := ARB_ERROR_NO_ERROR end startup /** * Stops the current arbiter */ proc shutdown () handler ( eN ) if eN < 2300 or eN > 2400 then % Not a net error quit > end if put "ExceptionS: ", eN % Force the death isRunning := false end handler if not isRunning then % Arbiter has been stopped, don't need to do anything return end if % Cleanup any remaining packets var nextPacket : ^Packet := pendingPackets loop exit when nextPacket = nil % Advance to the next packet & free the current one var packet : ^Packet := nextPacket nextPacket := nextPacket -> next packet -> cleanup () free packet end loop % Empty the list pendingPackets := nil pendingPacketsTail := nil % Cleanup any remaining statuses var nextStatus : ^ConnectionStatus := pendingStatus loop exit when nextStatus = nil var status : ^ConnectionStatus := nextStatus nextStatus := nextStatus -> next free status end loop % Empty the list pendingStatus := nil pendingStatusTail := nil % Command format: | len (2) | seq (2) | X % Send the stop command const arbStop : array 0 .. 4 of nat1 := init (0, 5, 0, 0, ord('X')) write : netFD, arbStop : 5 Net.CloseConnection (netFD) isRunning := false errno := ARB_ERROR_NO_ERROR end shutdown end Arbiter end NetArbiter
Turing
5
DropDemBits/net-arbiter
turing-code/netarbiter/net_arbiter.tu
[ "MIT" ]
//This file is part of "GZE - GroundZero Engine" //The permisive licence allow to use GZE for free or commercial project (Apache License, Version 2.0). //For conditions of distribution and use, see copyright notice in Licence.txt, this license must be included with any distribution of the code. package { import GZ.Sys.Interface.Window; import GZ.Gfx.Clip; import GZ.Gfx.Object; import GZ.Gfx.Root; import GZ.Base.Math.Math; import GZ.Sys.Interface.Context; import GZ.Gfx.Vector.Box; import GZ.Gpu.ShaderModel.GzModel.GzShCommun.GzShCommun_Light; /** * @author Maeiky */ public class Light extends Clip { public var oBoxColor : Box; public var oBoxSpecular : Box; public var oBox3 : Box; public var nSize : Int = 4; public var nLineWidth : Int = 1; public var nIndex : UInt; public function Light( _nX: Float, _nY:Float, _nZ:Float):Void { Clip(parent, _nX , _nY); vPos.nZ = _nZ; vColor.nAlpha = 0.5; oBoxColor = new Box( 0,0, nSize,nSize, nLineWidth); oBoxColor.vColor.nBlue = 1.0; oBoxColor.vColor.nGreen = 1.0; oBoxColor.vColor.nRed = 1.0; oBoxColor.vColor.nAlpha = 1.50; //oBoxColor.vColor.nAlpha = 2.75; oBoxSpecular = new Box( 0,0, nSize,nSize, nLineWidth); oBoxSpecular.vColor.nBlue = 0.0; oBoxSpecular.vColor.nGreen = 1.0; //oBoxSpecular.vColor.nGreen = 0.0; oBoxSpecular.vColor.nRed = 1.0; oBoxSpecular.vColor.nAlpha = 0.5; oBoxSpecular.vRot.nPitch = 3.1416 / 3.0 oBoxSpecular.vRot.nRoll = 3.1416 / 3.0 oBox3 = new Box( 0,0, nSize,nSize, nLineWidth); oBox3.vColor.nRed = 1.0; oBox3.vRot.nYaw = 3.1416 / 3.0 oBox3.vRot.nRoll = 3.1416 / 3.0 nIndex = GzShCommun_Light.fAddLight(); } //Overited override public function fUpdateParentToChild():Void { //Context.fGetMousePosition(); //Maybe si upder entre temps or not vRot.nRoll = vRot.nRoll + 0.1; vRot.nPitch = vRot.nPitch + 0.1; GzShCommun_Light.fUpdateLight(nIndex, this); } } }
Redcode
3
VLiance/GZE
src/Lib_GZ/Gfx/Effects/Light.cw
[ "Apache-2.0" ]
""" a = null """ a = null
Boo
0
popcatalin81/boo
tests/testcases/parser/wsa/null-1.boo
[ "BSD-3-Clause" ]
/- Copyright (c) 2016 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Leonardo de Moura, Sebastian Ullrich -/ prelude import init.category.functor open function universes u v class has_pure (f : Type u → Type v) := (pure {} {α : Type u} : α → f α) export has_pure (pure) class has_seq (f : Type u → Type v) : Type (max (u+1) v) := (seq : Π {α β : Type u}, f (α → β) → f α → f β) infixl ` <*> `:60 := has_seq.seq class has_seq_left (f : Type u → Type v) : Type (max (u+1) v) := (seq_left : Π {α β : Type u}, f α → f β → f α) infixl ` <* `:60 := has_seq_left.seq_left class has_seq_right (f : Type u → Type v) : Type (max (u+1) v) := (seq_right : Π {α β : Type u}, f α → f β → f β) infixl ` *> `:60 := has_seq_right.seq_right class applicative (f : Type u → Type v) extends functor f, has_pure f, has_seq f, has_seq_left f, has_seq_right f := (map := λ _ _ x y, pure x <*> y) (seq_left := λ α β a b, const β <$> a <*> b) (seq_right := λ α β a b, const α id <$> a <*> b)
Lean
4
JLimperg/lean
library/init/category/applicative.lean
[ "Apache-2.0" ]
@import "{}/imports/ui/stylesheets/not-found.less";
Less
0
joseconstela/meteor
tools/static-assets/skel-full/client/main.less
[ "Apache-2.0", "BSD-2-Clause", "MIT" ]
{:data {:hero {:friends [nil nil nil]}} :errors [{:message "Non-nullable field was null." :locations [{:line 1 :column 20}] :path [:hero :friends :arch_enemy]}]}
edn
1
hagenek/lacinia
docs/_examples/errors-result.edn
[ "Apache-2.0" ]
#![allow(unused_macros)] macro_rules! test { ($wrong:t_ty ..) => () } //~^ ERROR: invalid fragment specifier `t_ty` fn main() {}
Rust
2
Eric-Arellano/rust
src/test/ui/issues/issue-21356.rs
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
/************************************************************ Copyright (c) 2007 Iowa State University, Glenn Luecke, James Coyle, James Hoekstra, Marina Kraeva, Olga Weiss, Andre Wehe, Ying Xu, Melissa Yahya, Elizabeth Kleiman, Varun Srinivas, Alok Tripathi. All rights reserved. Licensed under the Educational Community License version 1.0. See the full agreement at http://rted.public.iastate.edu/ . ************************************************************* File name of the main program for this test: c_C_10_1_a_D.upc Description of the error from the test plan: Out-of-bounds shared memory access using indices. Test description: Read one element past the second dimension bound but within an array of N*K elements. The array is declared as shared [K] <type> (*arrA)[K], and allocated as one piece of shared memory. Read arrA[0][K] on thread 0. Requires relaxed mode to contain an error (yes or no): no Support files needed: c_C_10_1_a_D_s.upc Date last modified: September 18, 2008 Name of person writing this test: Olga Weiss Name of person reviewing this test: Ying Xu ****************************************************************/ #include <upc.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #define NT 4 /* default number of threads */ void check_thr(int num_thr) /* function to check number of threads */ { if(THREADS!=num_thr){ if(MYTHREAD == 0) printf("Wrong number of threads. THREADS = %d\n", THREADS); exit(1); } } /* function that returns an integer zero value which can not be calculated at compile time */ int zero(){ return (int) (sin(0.1*MYTHREAD)/2.3); } //#include "upcparam.h" #define K 4 #define N 2*K void work_arr(shared [K] double (*arrA)[K], int i); void work_arr(shared [K] double (*arrA)[K], int i) { double varA; varA = arrA[0][i] + 1; /*RTERR*/ printf("varA = %d\n", (int)varA); } int main() { int i,j; shared [K] double (* arrA)[K]; /*DECLARE1*/ check_thr(NT); arrA = (shared [K] double (*) [K])upc_all_alloc(N, K*sizeof(double)); /*VARALLOC*/ upc_barrier; if(MYTHREAD==0){ if (arrA==NULL){ printf("Not enough memory to allocate arrA\n"); upc_global_exit(1); } } upc_forall(i=0;i<N;i++;&arrA[i]) for(j=0;j<K;j++) arrA[i][j] = 1000+i*100+j; upc_barrier; if(MYTHREAD == 0) work_arr(arrA, K); upc_barrier; if(MYTHREAD == 0) { for(i=0;i<N;i++) { printf("arrA[%d][0]=%d\n", i, (int)arrA[i][0]); } upc_free(arrA); } return 0; }
Unified Parallel C
4
maurizioabba/rose
projects/RTED/tests/UPC/simple/simple.upc
[ "BSD-3-Clause" ]
"""Tests for the mfi component."""
Python
0
domwillcode/home-assistant
tests/components/mfi/__init__.py
[ "Apache-2.0" ]
-- Copyright 2020-2021 Jeff Foley. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. local url = require("url") local json = require("json") name = "ThreatMiner" type = "api" function start() set_rate_limit(8) end function vertical(ctx, domain) local resp, err = request(ctx, {['url']=build_url(domain)}) if (err ~= nil and err ~= "") then log(ctx, "vertical request to service failed: " .. err) return end local d = json.decode(resp) if (d == nil or d.status_code ~= "200" or #(d.results) == 0) then return end for _, sub in pairs(d.results) do new_name(ctx, sub) end end function build_url(domain) local params = { ['rt']="5", ['q']=domain, ['api']="True", } return "https://api.threatminer.org/v2/domain.php?" .. url.build_query_string(params) end
Ada
4
Elon143/Amass
resources/scripts/api/threatminer.ads
[ "Apache-2.0" ]
directory-level1-test-pass: test.succeed_without_changes: - name: testing-saltcheck
SaltStack
0
Noah-Huppert/salt
tests/integration/files/file/base/validate-saltcheck/directory/level1.sls
[ "Apache-2.0" ]
{:duct.server.http/http-kit {}}
edn
1
xsoheilalizadeh/FrameworkBenchmarks
frameworks/Clojure/duct/resources/hello/server-httpkit.edn
[ "BSD-3-Clause" ]
=pod =head1 NAME CMS_EncryptedData_decrypt - Decrypt CMS EncryptedData =head1 SYNOPSIS #include <openssl/cms.h> int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms, const unsigned char *key, size_t keylen, BIO *dcont, BIO *out, unsigned int flags); =head1 DESCRIPTION CMS_EncryptedData_decrypt() decrypts a I<cms> EncryptedData object using the symmetric I<key> of size I<keylen> bytes. I<out> is a BIO to write the content to and I<flags> is an optional set of flags. I<dcont> is used in the rare case where the encrypted content is detached. It will normally be set to NULL. The following flags can be passed in the B<flags> parameter. If the B<CMS_TEXT> flag is set MIME headers for type B<text/plain> are deleted from the content. If the content is not of type B<text/plain> then an error is returned. =head1 RETURN VALUES CMS_EncryptedData_decrypt() returns 0 if an error occurred otherwise it returns 1. =head1 SEE ALSO L<ERR_get_error(3)>, L<CMS_EncryptedData_encrypt(3)> =head1 COPYRIGHT Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at L<https://www.openssl.org/source/license.html>. =cut
Pod
4
pmesnier/openssl
doc/man3/CMS_EncryptedData_decrypt.pod
[ "Apache-2.0" ]
import * as React from 'react' expect(<div />).to.be.an('object')
JSX
2
bkucera2/cypress
npm/webpack-batteries-included-preprocessor/test/fixtures/jsx_spec.jsx
[ "MIT" ]