text
stringlengths
2
99k
meta
dict
<?xml version="1.0" ?> <model> <name>Sea Bottom</name> <version>1.0</version> <sdf version="1.5">model.sdf</sdf> <author> </author> <description>A simple sea bottom</description> </model>
{ "pile_set_name": "Github" }
line 1 --> item6 item1 item7 item2 item8 item3 item9 item4 item10 item5 line 2 --> item6 item1 item7 item2 item8 item3 item9 item4 item10 item5 line 3 --> item6 item1 item7 item2 item8 item3 item9 item4 item10 item5 line 4 --> item6 item1 item7 item2 item8 item3 item9 item4 item10 item5 line 5 --> item6 item1 item7 item2 item8 item3 item9 item4 item10 item5
{ "pile_set_name": "Github" }
using Stratis.SmartContracts; public class SingleConstructor : SmartContract { public SingleConstructor(ISmartContractState smartContractState) : base(smartContractState) { } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2013 Dave Collins <dave@davec.name> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* Test Summary: NOTE: For each test, a nil pointer, a single pointer and double pointer to the base test element are also tested to ensure proper indirection across all types. - Max int8, int16, int32, int64, int - Max uint8, uint16, uint32, uint64, uint - Boolean true and false - Standard complex64 and complex128 - Array containing standard ints - Array containing type with custom formatter on pointer receiver only - Array containing interfaces - Array containing bytes - Slice containing standard float32 values - Slice containing type with custom formatter on pointer receiver only - Slice containing interfaces - Slice containing bytes - Nil slice - Standard string - Nil interface - Sub-interface - Map with string keys and int vals - Map with custom formatter type on pointer receiver only keys and vals - Map with interface keys and values - Map with nil interface value - Struct with primitives - Struct that contains another struct - Struct that contains custom type with Stringer pointer interface via both exported and unexported fields - Struct that contains embedded struct and field to same struct - Uintptr to 0 (null pointer) - Uintptr address of real variable - Unsafe.Pointer to 0 (null pointer) - Unsafe.Pointer to address of real variable - Nil channel - Standard int channel - Function with no params and no returns - Function with param and no returns - Function with multiple params and multiple returns - Struct that is circular through self referencing - Structs that are circular through cross referencing - Structs that are indirectly circular - Type that panics in its Stringer interface */ package spew_test import ( "bytes" "fmt" "testing" "unsafe" "github.com/davecgh/go-spew/spew" ) // dumpTest is used to describe a test to be perfomed against the Dump method. type dumpTest struct { in interface{} wants []string } // dumpTests houses all of the tests to be performed against the Dump method. var dumpTests = make([]dumpTest, 0) // addDumpTest is a helper method to append the passed input and desired result // to dumpTests func addDumpTest(in interface{}, wants ...string) { test := dumpTest{in, wants} dumpTests = append(dumpTests, test) } func addIntDumpTests() { // Max int8. v := int8(127) nv := (*int8)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "int8" vs := "127" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") // Max int16. v2 := int16(32767) nv2 := (*int16)(nil) pv2 := &v2 v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "int16" v2s := "32767" addDumpTest(v2, "("+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") addDumpTest(nv2, "(*"+v2t+")(<nil>)\n") // Max int32. v3 := int32(2147483647) nv3 := (*int32)(nil) pv3 := &v3 v3Addr := fmt.Sprintf("%p", pv3) pv3Addr := fmt.Sprintf("%p", &pv3) v3t := "int32" v3s := "2147483647" addDumpTest(v3, "("+v3t+") "+v3s+"\n") addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") addDumpTest(nv3, "(*"+v3t+")(<nil>)\n") // Max int64. v4 := int64(9223372036854775807) nv4 := (*int64)(nil) pv4 := &v4 v4Addr := fmt.Sprintf("%p", pv4) pv4Addr := fmt.Sprintf("%p", &pv4) v4t := "int64" v4s := "9223372036854775807" addDumpTest(v4, "("+v4t+") "+v4s+"\n") addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") addDumpTest(nv4, "(*"+v4t+")(<nil>)\n") // Max int. v5 := int(2147483647) nv5 := (*int)(nil) pv5 := &v5 v5Addr := fmt.Sprintf("%p", pv5) pv5Addr := fmt.Sprintf("%p", &pv5) v5t := "int" v5s := "2147483647" addDumpTest(v5, "("+v5t+") "+v5s+"\n") addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n") addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n") addDumpTest(nv5, "(*"+v5t+")(<nil>)\n") } func addUintDumpTests() { // Max uint8. v := uint8(255) nv := (*uint8)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "uint8" vs := "255" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") // Max uint16. v2 := uint16(65535) nv2 := (*uint16)(nil) pv2 := &v2 v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "uint16" v2s := "65535" addDumpTest(v2, "("+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") addDumpTest(nv2, "(*"+v2t+")(<nil>)\n") // Max uint32. v3 := uint32(4294967295) nv3 := (*uint32)(nil) pv3 := &v3 v3Addr := fmt.Sprintf("%p", pv3) pv3Addr := fmt.Sprintf("%p", &pv3) v3t := "uint32" v3s := "4294967295" addDumpTest(v3, "("+v3t+") "+v3s+"\n") addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") addDumpTest(nv3, "(*"+v3t+")(<nil>)\n") // Max uint64. v4 := uint64(18446744073709551615) nv4 := (*uint64)(nil) pv4 := &v4 v4Addr := fmt.Sprintf("%p", pv4) pv4Addr := fmt.Sprintf("%p", &pv4) v4t := "uint64" v4s := "18446744073709551615" addDumpTest(v4, "("+v4t+") "+v4s+"\n") addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") addDumpTest(nv4, "(*"+v4t+")(<nil>)\n") // Max uint. v5 := uint(4294967295) nv5 := (*uint)(nil) pv5 := &v5 v5Addr := fmt.Sprintf("%p", pv5) pv5Addr := fmt.Sprintf("%p", &pv5) v5t := "uint" v5s := "4294967295" addDumpTest(v5, "("+v5t+") "+v5s+"\n") addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n") addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n") addDumpTest(nv5, "(*"+v5t+")(<nil>)\n") } func addBoolDumpTests() { // Boolean true. v := bool(true) nv := (*bool)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "bool" vs := "true" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") // Boolean false. v2 := bool(false) pv2 := &v2 v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "bool" v2s := "false" addDumpTest(v2, "("+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") } func addFloatDumpTests() { // Standard float32. v := float32(3.1415) nv := (*float32)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "float32" vs := "3.1415" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") // Standard float64. v2 := float64(3.1415926) nv2 := (*float64)(nil) pv2 := &v2 v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "float64" v2s := "3.1415926" addDumpTest(v2, "("+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") addDumpTest(nv2, "(*"+v2t+")(<nil>)\n") } func addComplexDumpTests() { // Standard complex64. v := complex(float32(6), -2) nv := (*complex64)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "complex64" vs := "(6-2i)" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") // Standard complex128. v2 := complex(float64(-6), 2) nv2 := (*complex128)(nil) pv2 := &v2 v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "complex128" v2s := "(-6+2i)" addDumpTest(v2, "("+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") addDumpTest(nv2, "(*"+v2t+")(<nil>)\n") } func addArrayDumpTests() { // Array containing standard ints. v := [3]int{1, 2, 3} vLen := fmt.Sprintf("%d", len(v)) vCap := fmt.Sprintf("%d", cap(v)) nv := (*[3]int)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "int" vs := "(len=" + vLen + " cap=" + vCap + ") {\n (" + vt + ") 1,\n (" + vt + ") 2,\n (" + vt + ") 3\n}" addDumpTest(v, "([3]"+vt+") "+vs+"\n") addDumpTest(pv, "(*[3]"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**[3]"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*[3]"+vt+")(<nil>)\n") // Array containing type with custom formatter on pointer receiver only. v2i0 := pstringer("1") v2i1 := pstringer("2") v2i2 := pstringer("3") v2 := [3]pstringer{v2i0, v2i1, v2i2} v2i0Len := fmt.Sprintf("%d", len(v2i0)) v2i1Len := fmt.Sprintf("%d", len(v2i1)) v2i2Len := fmt.Sprintf("%d", len(v2i2)) v2Len := fmt.Sprintf("%d", len(v2)) v2Cap := fmt.Sprintf("%d", cap(v2)) nv2 := (*[3]pstringer)(nil) pv2 := &v2 v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "spew_test.pstringer" v2sp := "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t + ") (len=" + v2i0Len + ") stringer 1,\n (" + v2t + ") (len=" + v2i1Len + ") stringer 2,\n (" + v2t + ") (len=" + v2i2Len + ") " + "stringer 3\n}" v2s := v2sp if spew.UnsafeDisabled { v2s = "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t + ") (len=" + v2i0Len + ") \"1\",\n (" + v2t + ") (len=" + v2i1Len + ") \"2\",\n (" + v2t + ") (len=" + v2i2Len + ") " + "\"3\"\n}" } addDumpTest(v2, "([3]"+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*[3]"+v2t+")("+v2Addr+")("+v2sp+")\n") addDumpTest(&pv2, "(**[3]"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2sp+")\n") addDumpTest(nv2, "(*[3]"+v2t+")(<nil>)\n") // Array containing interfaces. v3i0 := "one" v3 := [3]interface{}{v3i0, int(2), uint(3)} v3i0Len := fmt.Sprintf("%d", len(v3i0)) v3Len := fmt.Sprintf("%d", len(v3)) v3Cap := fmt.Sprintf("%d", cap(v3)) nv3 := (*[3]interface{})(nil) pv3 := &v3 v3Addr := fmt.Sprintf("%p", pv3) pv3Addr := fmt.Sprintf("%p", &pv3) v3t := "[3]interface {}" v3t2 := "string" v3t3 := "int" v3t4 := "uint" v3s := "(len=" + v3Len + " cap=" + v3Cap + ") {\n (" + v3t2 + ") " + "(len=" + v3i0Len + ") \"one\",\n (" + v3t3 + ") 2,\n (" + v3t4 + ") 3\n}" addDumpTest(v3, "("+v3t+") "+v3s+"\n") addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") addDumpTest(nv3, "(*"+v3t+")(<nil>)\n") // Array containing bytes. v4 := [34]byte{ 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, } v4Len := fmt.Sprintf("%d", len(v4)) v4Cap := fmt.Sprintf("%d", cap(v4)) nv4 := (*[34]byte)(nil) pv4 := &v4 v4Addr := fmt.Sprintf("%p", pv4) pv4Addr := fmt.Sprintf("%p", &pv4) v4t := "[34]uint8" v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " + "{\n 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20" + " |............... |\n" + " 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30" + " |!\"#$%&'()*+,-./0|\n" + " 00000020 31 32 " + " |12|\n}" addDumpTest(v4, "("+v4t+") "+v4s+"\n") addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") addDumpTest(nv4, "(*"+v4t+")(<nil>)\n") } func addSliceDumpTests() { // Slice containing standard float32 values. v := []float32{3.14, 6.28, 12.56} vLen := fmt.Sprintf("%d", len(v)) vCap := fmt.Sprintf("%d", cap(v)) nv := (*[]float32)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "float32" vs := "(len=" + vLen + " cap=" + vCap + ") {\n (" + vt + ") 3.14,\n (" + vt + ") 6.28,\n (" + vt + ") 12.56\n}" addDumpTest(v, "([]"+vt+") "+vs+"\n") addDumpTest(pv, "(*[]"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**[]"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*[]"+vt+")(<nil>)\n") // Slice containing type with custom formatter on pointer receiver only. v2i0 := pstringer("1") v2i1 := pstringer("2") v2i2 := pstringer("3") v2 := []pstringer{v2i0, v2i1, v2i2} v2i0Len := fmt.Sprintf("%d", len(v2i0)) v2i1Len := fmt.Sprintf("%d", len(v2i1)) v2i2Len := fmt.Sprintf("%d", len(v2i2)) v2Len := fmt.Sprintf("%d", len(v2)) v2Cap := fmt.Sprintf("%d", cap(v2)) nv2 := (*[]pstringer)(nil) pv2 := &v2 v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "spew_test.pstringer" v2s := "(len=" + v2Len + " cap=" + v2Cap + ") {\n (" + v2t + ") (len=" + v2i0Len + ") stringer 1,\n (" + v2t + ") (len=" + v2i1Len + ") stringer 2,\n (" + v2t + ") (len=" + v2i2Len + ") " + "stringer 3\n}" addDumpTest(v2, "([]"+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*[]"+v2t+")("+v2Addr+")("+v2s+")\n") addDumpTest(&pv2, "(**[]"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") addDumpTest(nv2, "(*[]"+v2t+")(<nil>)\n") // Slice containing interfaces. v3i0 := "one" v3 := []interface{}{v3i0, int(2), uint(3), nil} v3i0Len := fmt.Sprintf("%d", len(v3i0)) v3Len := fmt.Sprintf("%d", len(v3)) v3Cap := fmt.Sprintf("%d", cap(v3)) nv3 := (*[]interface{})(nil) pv3 := &v3 v3Addr := fmt.Sprintf("%p", pv3) pv3Addr := fmt.Sprintf("%p", &pv3) v3t := "[]interface {}" v3t2 := "string" v3t3 := "int" v3t4 := "uint" v3t5 := "interface {}" v3s := "(len=" + v3Len + " cap=" + v3Cap + ") {\n (" + v3t2 + ") " + "(len=" + v3i0Len + ") \"one\",\n (" + v3t3 + ") 2,\n (" + v3t4 + ") 3,\n (" + v3t5 + ") <nil>\n}" addDumpTest(v3, "("+v3t+") "+v3s+"\n") addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") addDumpTest(nv3, "(*"+v3t+")(<nil>)\n") // Slice containing bytes. v4 := []byte{ 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, } v4Len := fmt.Sprintf("%d", len(v4)) v4Cap := fmt.Sprintf("%d", cap(v4)) nv4 := (*[]byte)(nil) pv4 := &v4 v4Addr := fmt.Sprintf("%p", pv4) pv4Addr := fmt.Sprintf("%p", &pv4) v4t := "[]uint8" v4s := "(len=" + v4Len + " cap=" + v4Cap + ") " + "{\n 00000000 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20" + " |............... |\n" + " 00000010 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30" + " |!\"#$%&'()*+,-./0|\n" + " 00000020 31 32 " + " |12|\n}" addDumpTest(v4, "("+v4t+") "+v4s+"\n") addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") addDumpTest(nv4, "(*"+v4t+")(<nil>)\n") // Nil slice. v5 := []int(nil) nv5 := (*[]int)(nil) pv5 := &v5 v5Addr := fmt.Sprintf("%p", pv5) pv5Addr := fmt.Sprintf("%p", &pv5) v5t := "[]int" v5s := "<nil>" addDumpTest(v5, "("+v5t+") "+v5s+"\n") addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n") addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n") addDumpTest(nv5, "(*"+v5t+")(<nil>)\n") } func addStringDumpTests() { // Standard string. v := "test" vLen := fmt.Sprintf("%d", len(v)) nv := (*string)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "string" vs := "(len=" + vLen + ") \"test\"" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") } func addInterfaceDumpTests() { // Nil interface. var v interface{} nv := (*interface{})(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "interface {}" vs := "<nil>" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") // Sub-interface. v2 := interface{}(uint16(65535)) pv2 := &v2 v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "uint16" v2s := "65535" addDumpTest(v2, "("+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") } func addMapDumpTests() { // Map with string keys and int vals. k := "one" kk := "two" m := map[string]int{k: 1, kk: 2} klen := fmt.Sprintf("%d", len(k)) // not kLen to shut golint up kkLen := fmt.Sprintf("%d", len(kk)) mLen := fmt.Sprintf("%d", len(m)) nilMap := map[string]int(nil) nm := (*map[string]int)(nil) pm := &m mAddr := fmt.Sprintf("%p", pm) pmAddr := fmt.Sprintf("%p", &pm) mt := "map[string]int" mt1 := "string" mt2 := "int" ms := "(len=" + mLen + ") {\n (" + mt1 + ") (len=" + klen + ") " + "\"one\": (" + mt2 + ") 1,\n (" + mt1 + ") (len=" + kkLen + ") \"two\": (" + mt2 + ") 2\n}" ms2 := "(len=" + mLen + ") {\n (" + mt1 + ") (len=" + kkLen + ") " + "\"two\": (" + mt2 + ") 2,\n (" + mt1 + ") (len=" + klen + ") \"one\": (" + mt2 + ") 1\n}" addDumpTest(m, "("+mt+") "+ms+"\n", "("+mt+") "+ms2+"\n") addDumpTest(pm, "(*"+mt+")("+mAddr+")("+ms+")\n", "(*"+mt+")("+mAddr+")("+ms2+")\n") addDumpTest(&pm, "(**"+mt+")("+pmAddr+"->"+mAddr+")("+ms+")\n", "(**"+mt+")("+pmAddr+"->"+mAddr+")("+ms2+")\n") addDumpTest(nm, "(*"+mt+")(<nil>)\n") addDumpTest(nilMap, "("+mt+") <nil>\n") // Map with custom formatter type on pointer receiver only keys and vals. k2 := pstringer("one") v2 := pstringer("1") m2 := map[pstringer]pstringer{k2: v2} k2Len := fmt.Sprintf("%d", len(k2)) v2Len := fmt.Sprintf("%d", len(v2)) m2Len := fmt.Sprintf("%d", len(m2)) nilMap2 := map[pstringer]pstringer(nil) nm2 := (*map[pstringer]pstringer)(nil) pm2 := &m2 m2Addr := fmt.Sprintf("%p", pm2) pm2Addr := fmt.Sprintf("%p", &pm2) m2t := "map[spew_test.pstringer]spew_test.pstringer" m2t1 := "spew_test.pstringer" m2t2 := "spew_test.pstringer" m2s := "(len=" + m2Len + ") {\n (" + m2t1 + ") (len=" + k2Len + ") " + "stringer one: (" + m2t2 + ") (len=" + v2Len + ") stringer 1\n}" if spew.UnsafeDisabled { m2s = "(len=" + m2Len + ") {\n (" + m2t1 + ") (len=" + k2Len + ") " + "\"one\": (" + m2t2 + ") (len=" + v2Len + ") \"1\"\n}" } addDumpTest(m2, "("+m2t+") "+m2s+"\n") addDumpTest(pm2, "(*"+m2t+")("+m2Addr+")("+m2s+")\n") addDumpTest(&pm2, "(**"+m2t+")("+pm2Addr+"->"+m2Addr+")("+m2s+")\n") addDumpTest(nm2, "(*"+m2t+")(<nil>)\n") addDumpTest(nilMap2, "("+m2t+") <nil>\n") // Map with interface keys and values. k3 := "one" k3Len := fmt.Sprintf("%d", len(k3)) m3 := map[interface{}]interface{}{k3: 1} m3Len := fmt.Sprintf("%d", len(m3)) nilMap3 := map[interface{}]interface{}(nil) nm3 := (*map[interface{}]interface{})(nil) pm3 := &m3 m3Addr := fmt.Sprintf("%p", pm3) pm3Addr := fmt.Sprintf("%p", &pm3) m3t := "map[interface {}]interface {}" m3t1 := "string" m3t2 := "int" m3s := "(len=" + m3Len + ") {\n (" + m3t1 + ") (len=" + k3Len + ") " + "\"one\": (" + m3t2 + ") 1\n}" addDumpTest(m3, "("+m3t+") "+m3s+"\n") addDumpTest(pm3, "(*"+m3t+")("+m3Addr+")("+m3s+")\n") addDumpTest(&pm3, "(**"+m3t+")("+pm3Addr+"->"+m3Addr+")("+m3s+")\n") addDumpTest(nm3, "(*"+m3t+")(<nil>)\n") addDumpTest(nilMap3, "("+m3t+") <nil>\n") // Map with nil interface value. k4 := "nil" k4Len := fmt.Sprintf("%d", len(k4)) m4 := map[string]interface{}{k4: nil} m4Len := fmt.Sprintf("%d", len(m4)) nilMap4 := map[string]interface{}(nil) nm4 := (*map[string]interface{})(nil) pm4 := &m4 m4Addr := fmt.Sprintf("%p", pm4) pm4Addr := fmt.Sprintf("%p", &pm4) m4t := "map[string]interface {}" m4t1 := "string" m4t2 := "interface {}" m4s := "(len=" + m4Len + ") {\n (" + m4t1 + ") (len=" + k4Len + ")" + " \"nil\": (" + m4t2 + ") <nil>\n}" addDumpTest(m4, "("+m4t+") "+m4s+"\n") addDumpTest(pm4, "(*"+m4t+")("+m4Addr+")("+m4s+")\n") addDumpTest(&pm4, "(**"+m4t+")("+pm4Addr+"->"+m4Addr+")("+m4s+")\n") addDumpTest(nm4, "(*"+m4t+")(<nil>)\n") addDumpTest(nilMap4, "("+m4t+") <nil>\n") } func addStructDumpTests() { // Struct with primitives. type s1 struct { a int8 b uint8 } v := s1{127, 255} nv := (*s1)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "spew_test.s1" vt2 := "int8" vt3 := "uint8" vs := "{\n a: (" + vt2 + ") 127,\n b: (" + vt3 + ") 255\n}" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") // Struct that contains another struct. type s2 struct { s1 s1 b bool } v2 := s2{s1{127, 255}, true} nv2 := (*s2)(nil) pv2 := &v2 v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "spew_test.s2" v2t2 := "spew_test.s1" v2t3 := "int8" v2t4 := "uint8" v2t5 := "bool" v2s := "{\n s1: (" + v2t2 + ") {\n a: (" + v2t3 + ") 127,\n b: (" + v2t4 + ") 255\n },\n b: (" + v2t5 + ") true\n}" addDumpTest(v2, "("+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") addDumpTest(nv2, "(*"+v2t+")(<nil>)\n") // Struct that contains custom type with Stringer pointer interface via both // exported and unexported fields. type s3 struct { s pstringer S pstringer } v3 := s3{"test", "test2"} nv3 := (*s3)(nil) pv3 := &v3 v3Addr := fmt.Sprintf("%p", pv3) pv3Addr := fmt.Sprintf("%p", &pv3) v3t := "spew_test.s3" v3t2 := "spew_test.pstringer" v3s := "{\n s: (" + v3t2 + ") (len=4) stringer test,\n S: (" + v3t2 + ") (len=5) stringer test2\n}" v3sp := v3s if spew.UnsafeDisabled { v3s = "{\n s: (" + v3t2 + ") (len=4) \"test\",\n S: (" + v3t2 + ") (len=5) \"test2\"\n}" v3sp = "{\n s: (" + v3t2 + ") (len=4) \"test\",\n S: (" + v3t2 + ") (len=5) stringer test2\n}" } addDumpTest(v3, "("+v3t+") "+v3s+"\n") addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3sp+")\n") addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3sp+")\n") addDumpTest(nv3, "(*"+v3t+")(<nil>)\n") // Struct that contains embedded struct and field to same struct. e := embed{"embedstr"} eLen := fmt.Sprintf("%d", len("embedstr")) v4 := embedwrap{embed: &e, e: &e} nv4 := (*embedwrap)(nil) pv4 := &v4 eAddr := fmt.Sprintf("%p", &e) v4Addr := fmt.Sprintf("%p", pv4) pv4Addr := fmt.Sprintf("%p", &pv4) v4t := "spew_test.embedwrap" v4t2 := "spew_test.embed" v4t3 := "string" v4s := "{\n embed: (*" + v4t2 + ")(" + eAddr + ")({\n a: (" + v4t3 + ") (len=" + eLen + ") \"embedstr\"\n }),\n e: (*" + v4t2 + ")(" + eAddr + ")({\n a: (" + v4t3 + ") (len=" + eLen + ")" + " \"embedstr\"\n })\n}" addDumpTest(v4, "("+v4t+") "+v4s+"\n") addDumpTest(pv4, "(*"+v4t+")("+v4Addr+")("+v4s+")\n") addDumpTest(&pv4, "(**"+v4t+")("+pv4Addr+"->"+v4Addr+")("+v4s+")\n") addDumpTest(nv4, "(*"+v4t+")(<nil>)\n") } func addUintptrDumpTests() { // Null pointer. v := uintptr(0) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "uintptr" vs := "<nil>" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") // Address of real variable. i := 1 v2 := uintptr(unsafe.Pointer(&i)) nv2 := (*uintptr)(nil) pv2 := &v2 v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "uintptr" v2s := fmt.Sprintf("%p", &i) addDumpTest(v2, "("+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") addDumpTest(nv2, "(*"+v2t+")(<nil>)\n") } func addUnsafePointerDumpTests() { // Null pointer. v := unsafe.Pointer(uintptr(0)) nv := (*unsafe.Pointer)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "unsafe.Pointer" vs := "<nil>" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") // Address of real variable. i := 1 v2 := unsafe.Pointer(&i) pv2 := &v2 v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "unsafe.Pointer" v2s := fmt.Sprintf("%p", &i) addDumpTest(v2, "("+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") } func addChanDumpTests() { // Nil channel. var v chan int pv := &v nv := (*chan int)(nil) vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "chan int" vs := "<nil>" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") // Real channel. v2 := make(chan int) pv2 := &v2 v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "chan int" v2s := fmt.Sprintf("%p", v2) addDumpTest(v2, "("+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") } func addFuncDumpTests() { // Function with no params and no returns. v := addIntDumpTests nv := (*func())(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "func()" vs := fmt.Sprintf("%p", v) addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") // Function with param and no returns. v2 := TestDump nv2 := (*func(*testing.T))(nil) pv2 := &v2 v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "func(*testing.T)" v2s := fmt.Sprintf("%p", v2) addDumpTest(v2, "("+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s+")\n") addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s+")\n") addDumpTest(nv2, "(*"+v2t+")(<nil>)\n") // Function with multiple params and multiple returns. var v3 = func(i int, s string) (b bool, err error) { return true, nil } nv3 := (*func(int, string) (bool, error))(nil) pv3 := &v3 v3Addr := fmt.Sprintf("%p", pv3) pv3Addr := fmt.Sprintf("%p", &pv3) v3t := "func(int, string) (bool, error)" v3s := fmt.Sprintf("%p", v3) addDumpTest(v3, "("+v3t+") "+v3s+"\n") addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s+")\n") addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s+")\n") addDumpTest(nv3, "(*"+v3t+")(<nil>)\n") } func addCircularDumpTests() { // Struct that is circular through self referencing. type circular struct { c *circular } v := circular{nil} v.c = &v pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "spew_test.circular" vs := "{\n c: (*" + vt + ")(" + vAddr + ")({\n c: (*" + vt + ")(" + vAddr + ")(<already shown>)\n })\n}" vs2 := "{\n c: (*" + vt + ")(" + vAddr + ")(<already shown>)\n}" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs2+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs2+")\n") // Structs that are circular through cross referencing. v2 := xref1{nil} ts2 := xref2{&v2} v2.ps2 = &ts2 pv2 := &v2 ts2Addr := fmt.Sprintf("%p", &ts2) v2Addr := fmt.Sprintf("%p", pv2) pv2Addr := fmt.Sprintf("%p", &pv2) v2t := "spew_test.xref1" v2t2 := "spew_test.xref2" v2s := "{\n ps2: (*" + v2t2 + ")(" + ts2Addr + ")({\n ps1: (*" + v2t + ")(" + v2Addr + ")({\n ps2: (*" + v2t2 + ")(" + ts2Addr + ")(<already shown>)\n })\n })\n}" v2s2 := "{\n ps2: (*" + v2t2 + ")(" + ts2Addr + ")({\n ps1: (*" + v2t + ")(" + v2Addr + ")(<already shown>)\n })\n}" addDumpTest(v2, "("+v2t+") "+v2s+"\n") addDumpTest(pv2, "(*"+v2t+")("+v2Addr+")("+v2s2+")\n") addDumpTest(&pv2, "(**"+v2t+")("+pv2Addr+"->"+v2Addr+")("+v2s2+")\n") // Structs that are indirectly circular. v3 := indirCir1{nil} tic2 := indirCir2{nil} tic3 := indirCir3{&v3} tic2.ps3 = &tic3 v3.ps2 = &tic2 pv3 := &v3 tic2Addr := fmt.Sprintf("%p", &tic2) tic3Addr := fmt.Sprintf("%p", &tic3) v3Addr := fmt.Sprintf("%p", pv3) pv3Addr := fmt.Sprintf("%p", &pv3) v3t := "spew_test.indirCir1" v3t2 := "spew_test.indirCir2" v3t3 := "spew_test.indirCir3" v3s := "{\n ps2: (*" + v3t2 + ")(" + tic2Addr + ")({\n ps3: (*" + v3t3 + ")(" + tic3Addr + ")({\n ps1: (*" + v3t + ")(" + v3Addr + ")({\n ps2: (*" + v3t2 + ")(" + tic2Addr + ")(<already shown>)\n })\n })\n })\n}" v3s2 := "{\n ps2: (*" + v3t2 + ")(" + tic2Addr + ")({\n ps3: (*" + v3t3 + ")(" + tic3Addr + ")({\n ps1: (*" + v3t + ")(" + v3Addr + ")(<already shown>)\n })\n })\n}" addDumpTest(v3, "("+v3t+") "+v3s+"\n") addDumpTest(pv3, "(*"+v3t+")("+v3Addr+")("+v3s2+")\n") addDumpTest(&pv3, "(**"+v3t+")("+pv3Addr+"->"+v3Addr+")("+v3s2+")\n") } func addPanicDumpTests() { // Type that panics in its Stringer interface. v := panicer(127) nv := (*panicer)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "spew_test.panicer" vs := "(PANIC=test panic)127" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") } func addErrorDumpTests() { // Type that has a custom Error interface. v := customError(127) nv := (*customError)(nil) pv := &v vAddr := fmt.Sprintf("%p", pv) pvAddr := fmt.Sprintf("%p", &pv) vt := "spew_test.customError" vs := "error: 127" addDumpTest(v, "("+vt+") "+vs+"\n") addDumpTest(pv, "(*"+vt+")("+vAddr+")("+vs+")\n") addDumpTest(&pv, "(**"+vt+")("+pvAddr+"->"+vAddr+")("+vs+")\n") addDumpTest(nv, "(*"+vt+")(<nil>)\n") } // TestDump executes all of the tests described by dumpTests. func TestDump(t *testing.T) { // Setup tests. addIntDumpTests() addUintDumpTests() addBoolDumpTests() addFloatDumpTests() addComplexDumpTests() addArrayDumpTests() addSliceDumpTests() addStringDumpTests() addInterfaceDumpTests() addMapDumpTests() addStructDumpTests() addUintptrDumpTests() addUnsafePointerDumpTests() addChanDumpTests() addFuncDumpTests() addCircularDumpTests() addPanicDumpTests() addErrorDumpTests() addCgoDumpTests() t.Logf("Running %d tests", len(dumpTests)) for i, test := range dumpTests { buf := new(bytes.Buffer) spew.Fdump(buf, test.in) s := buf.String() if testFailed(s, test.wants) { t.Errorf("Dump #%d\n got: %s %s", i, s, stringizeWants(test.wants)) continue } } } func TestDumpSortedKeys(t *testing.T) { cfg := spew.ConfigState{SortKeys: true} s := cfg.Sdump(map[int]string{1: "1", 3: "3", 2: "2"}) expected := "(map[int]string) (len=3) {\n(int) 1: (string) (len=1) " + "\"1\",\n(int) 2: (string) (len=1) \"2\",\n(int) 3: (string) " + "(len=1) \"3\"\n" + "}\n" if s != expected { t.Errorf("Sorted keys mismatch:\n %v %v", s, expected) } s = cfg.Sdump(map[stringer]int{"1": 1, "3": 3, "2": 2}) expected = "(map[spew_test.stringer]int) (len=3) {\n" + "(spew_test.stringer) (len=1) stringer 1: (int) 1,\n" + "(spew_test.stringer) (len=1) stringer 2: (int) 2,\n" + "(spew_test.stringer) (len=1) stringer 3: (int) 3\n" + "}\n" if s != expected { t.Errorf("Sorted keys mismatch:\n %v %v", s, expected) } s = cfg.Sdump(map[pstringer]int{pstringer("1"): 1, pstringer("3"): 3, pstringer("2"): 2}) expected = "(map[spew_test.pstringer]int) (len=3) {\n" + "(spew_test.pstringer) (len=1) stringer 1: (int) 1,\n" + "(spew_test.pstringer) (len=1) stringer 2: (int) 2,\n" + "(spew_test.pstringer) (len=1) stringer 3: (int) 3\n" + "}\n" if spew.UnsafeDisabled { expected = "(map[spew_test.pstringer]int) (len=3) {\n" + "(spew_test.pstringer) (len=1) \"1\": (int) 1,\n" + "(spew_test.pstringer) (len=1) \"2\": (int) 2,\n" + "(spew_test.pstringer) (len=1) \"3\": (int) 3\n" + "}\n" } if s != expected { t.Errorf("Sorted keys mismatch:\n %v %v", s, expected) } s = cfg.Sdump(map[customError]int{customError(1): 1, customError(3): 3, customError(2): 2}) expected = "(map[spew_test.customError]int) (len=3) {\n" + "(spew_test.customError) error: 1: (int) 1,\n" + "(spew_test.customError) error: 2: (int) 2,\n" + "(spew_test.customError) error: 3: (int) 3\n" + "}\n" if s != expected { t.Errorf("Sorted keys mismatch:\n %v %v", s, expected) } }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2002-2008 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.opengl; import org.lwjgl.util.generator.opengl.GLenum; public interface EXT_blend_minmax { /** Accepted by the &lt;mode&gt; parameter of BlendEquationEXT. */ int GL_FUNC_ADD_EXT = 0x8006; int GL_MIN_EXT = 0x8007; int GL_MAX_EXT = 0x8008; /** * Accepted by the &lt;pname&gt; parameter of GetBooleanv, GetIntegerv, * GetFloatv, and GetDoublev. */ int GL_BLEND_EQUATION_EXT = 0x8009; void glBlendEquationEXT(@GLenum int mode); }
{ "pile_set_name": "Github" }
[ { "content": "string", "created_at": "2020-01-03T12:47:21.806Z", "user": { "avatar_url": "string", "created": "2020-01-03T12:47:21.806Z", "email": "user@example.com", "full_name": "string", "id": 1, "is_admin": true, "language": "string", "last_login": "2020-01-03T12:47:21.806Z", "login": "string" } } ]
{ "pile_set_name": "Github" }
import React from "react"; import { connect } from "react-redux"; import { Everything } from "../interfaces"; import { GardenSnapshotProps, GardenSnapshot } from "./garden_snapshot"; import { selectAllPlantTemplates, findSavedGarden, } from "../resources/selectors"; import { DesignerPanel, DesignerPanelHeader, DesignerPanelContent, } from "../farm_designer/designer_panel"; import { Content } from "../constants"; import { Row } from "../ui"; import { t } from "../i18next_wrapper"; import { Panel } from "../farm_designer/panel_header"; export const mapStateToProps = (props: Everything): GardenSnapshotProps => { const { openedSavedGarden } = props.resources.consumers.farm_designer; return { currentSavedGarden: openedSavedGarden ? findSavedGarden(props.resources.index, openedSavedGarden) : undefined, dispatch: props.dispatch, plantTemplates: selectAllPlantTemplates(props.resources.index), }; }; export class RawAddGarden extends React.Component<GardenSnapshotProps, {}> { render() { return <DesignerPanel panelName={"saved-garden"} panel={Panel.SavedGardens}> <DesignerPanelHeader panelName={"saved-garden"} panel={Panel.SavedGardens} title={t("Add garden")} description={Content.SAVED_GARDENS} backTo={"/app/designer/gardens"} /> <DesignerPanelContent panelName={"saved-garden"}> <Row> <GardenSnapshot currentSavedGarden={this.props.currentSavedGarden} plantTemplates={this.props.plantTemplates} dispatch={this.props.dispatch} /> </Row> </DesignerPanelContent> </DesignerPanel>; } } export const AddGarden = connect(mapStateToProps)(RawAddGarden);
{ "pile_set_name": "Github" }
cmake_minimum_required( VERSION 3.10 FATAL_ERROR ) set( CMAKE_VERBOSE_MAKEFILE ON ) project( TextureFont ) get_filename_component( CINDER_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../.." ABSOLUTE ) get_filename_component( APP_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../" ABSOLUTE ) include( "${CINDER_PATH}/proj/cmake/modules/cinderMakeApp.cmake" ) ci_make_app( SOURCES ${APP_PATH}/src/TextureFontApp.cpp CINDER_PATH ${CINDER_PATH} )
{ "pile_set_name": "Github" }
/* * Copyright 2002-2017 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 * * https://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.springframework.context.event; import java.lang.reflect.Constructor; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** * {@link MethodInterceptor Interceptor} that publishes an * {@code ApplicationEvent} to all {@code ApplicationListeners} * registered with an {@code ApplicationEventPublisher} after each * <i>successful</i> method invocation. * * <p>Note that this interceptor is only capable of publishing <i>stateless</i> * events configured via the * {@link #setApplicationEventClass "applicationEventClass"} property. * * @author Dmitriy Kopylenko * @author Juergen Hoeller * @author Rick Evans * @see #setApplicationEventClass * @see org.springframework.context.ApplicationEvent * @see org.springframework.context.ApplicationListener * @see org.springframework.context.ApplicationEventPublisher * @see org.springframework.context.ApplicationContext */ public class EventPublicationInterceptor implements MethodInterceptor, ApplicationEventPublisherAware, InitializingBean { @Nullable private Constructor<?> applicationEventClassConstructor; @Nullable private ApplicationEventPublisher applicationEventPublisher; /** * Set the application event class to publish. * <p>The event class <b>must</b> have a constructor with a single * {@code Object} argument for the event source. The interceptor * will pass in the invoked object. * @throws IllegalArgumentException if the supplied {@code Class} is * {@code null} or if it is not an {@code ApplicationEvent} subclass or * if it does not expose a constructor that takes a single {@code Object} argument */ public void setApplicationEventClass(Class<?> applicationEventClass) { if (ApplicationEvent.class == applicationEventClass || !ApplicationEvent.class.isAssignableFrom(applicationEventClass)) { throw new IllegalArgumentException("'applicationEventClass' needs to extend ApplicationEvent"); } try { this.applicationEventClassConstructor = applicationEventClass.getConstructor(Object.class); } catch (NoSuchMethodException ex) { throw new IllegalArgumentException("ApplicationEvent class [" + applicationEventClass.getName() + "] does not have the required Object constructor: " + ex); } } @Override public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { this.applicationEventPublisher = applicationEventPublisher; } @Override public void afterPropertiesSet() throws Exception { if (this.applicationEventClassConstructor == null) { throw new IllegalArgumentException("Property 'applicationEventClass' is required"); } } @Override public Object invoke(MethodInvocation invocation) throws Throwable { Object retVal = invocation.proceed(); Assert.state(this.applicationEventClassConstructor != null, "No ApplicationEvent class set"); ApplicationEvent event = (ApplicationEvent) this.applicationEventClassConstructor.newInstance(invocation.getThis()); Assert.state(this.applicationEventPublisher != null, "No ApplicationEventPublisher available"); this.applicationEventPublisher.publishEvent(event); return retVal; } }
{ "pile_set_name": "Github" }
{-@ LIQUID "--prune-unsorted" @-} {-@ LIQUID "--total" @-} {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE QuasiQuotes #-} module LiquidR ( array , combine , indexNullary -- and, -- add, -- indexUnary, -- indexNAry ) where import Prelude hiding (product, length) -- import LiquidHaskell -------------------------------------------------------------------------------- -- Basic List Refinements ------------------------------------------------------ -------------------------------------------------------------------------------- {-@ class measure size :: forall a. a -> Int @-} {-@ instance measure size :: xs:[a] -> Int size [] = 0 size (_:xs) = 1 + size xs @-} {-@ listLength :: xs:[a] -> {v:Nat | v = size xs} @-} listLength :: [a] -> Int listLength [] = 0 listLength (x:xs) = 1 + listLength xs {-@ type ListN a N = {v:[a] | size v = N} @-} {-@ type ListNE a = {v:[a] | size v > 0} @-} {-@ type Pos = {v:Int | 0 < v} @-} -- Generic R Container Types --------------------------------------------------- {-@ class R c where index :: forall a. c a -> Int -> a length :: forall a. me:c a -> {v:Nat | v = size me} @-} class R c where index :: c a -> Int -> a length :: c a -> Int -- A Generic Non-Empty Container ----------------------------------------------- {-@ type RNE c a = {v:c a | 0 < size v} @-} -- Vector Instance ------------------------------------------------------------- newtype Vector a = V [a] {-@ instance measure size :: Vector a -> Int size (V xs) = size xs @-} instance R Vector where index (V xs) i = xs `at` i length (V xs) = listLength xs at :: [a] -> Int -> a at (x:_) 0 = x at (_:xs) n = at xs (n-1) at _ _ = undefined -- Arrays ---------------------------------------------------------------------- data Array a = Array { shape :: [Int] , elems :: [a] } {-@ measure product @-} product :: [Int] -> Int product [] = 1 product (x:xs) = x * product xs {-@ data Array a = Array { shape :: ListNE Pos, elems :: ListN a (product shape) } @-} instance R Array where index = undefined length = undefined -- Modes ----------------------------------------------------------------------- class Mode a type Logical = Maybe Bool type Numeric = Maybe Int -- | `Dim` is a refinement of `Numeric` where the values are defined type Dim = Numeric {-@ type Dim = {v:Numeric | isJust v} @-} instance Mode Logical instance Mode Numeric class (Mode a) => IntoNumeric a where intoNumeric :: a -> Numeric instance IntoNumeric Numeric where intoNumeric = id instance IntoNumeric Logical where intoNumeric Nothing = Nothing intoNumeric (Just True) = Just 1 -- (1.0 :: Double) intoNumeric (Just False) = Just 0 -- (0.0 :: Double) -- Constructor for Arrays ------------------------------------------------------ array :: (R sh, R el, Mode v) => sh Dim -> el v -> Array v {-@ array :: (R sh, R el, Mode v) => RNE sh Dim -> RNE el v -> Array v @-} array _shape _elems = undefined -- IndexNullary ---------------------------------------------------------------- {-@ type VectorN a N = {v:Vector a | size v = N} @-} {-@ indexNullary :: (R c) => a:(c m) -> VectorN m (size a) @-} indexNullary :: (R c) => c a -> (Vector a) indexNullary _ = undefined -------------------------------------------------------------------------------- -- Container Constructors ------------------------------------------------------ -------------------------------------------------------------------------------- {-@ append :: xs:_ -> ys:_ -> ListN _ {size xs + size ys} @-} append :: [a] -> [a] -> [a] append [] ys = ys append (x:xs) ys = x : append xs ys -- Constructor for vectors {-@ measure lsize :: [[a]] -> Int lsize [] = 0 lsize (x:xs) = size x + lsize xs @-} {-@ combine :: ys:[[a]] -> ListN a (lsize ys) @-} combine :: [[a]] -> [a] combine [] = [] combine (xs:xss) = append xs (combine xss)
{ "pile_set_name": "Github" }
# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. # # Copyright (c) 2010-2013 Oracle and/or its affiliates. All rights reserved. # # The contents of this file are subject to the terms of either the GNU # General Public License Version 2 only ("GPL") or the Common Development # and Distribution License("CDDL") (collectively, the "License"). You # may not use this file except in compliance with the License. You can # obtain a copy of the License at # https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html # or packager/legal/LICENSE.txt. See the License for the specific # language governing permissions and limitations under the License. # # When distributing the software, include this License Header Notice in each # file and include the License file at packager/legal/LICENSE.txt. # # GPL Classpath Exception: # Oracle designates this particular file as subject to the "Classpath" # exception as provided by Oracle in the GPL Version 2 section of the License # file that accompanied this code. # # Modifications: # If applicable, add the following below the License Header, with the fields # enclosed by brackets [] replaced by your own identifying information: # "Portions Copyright [year] [name of copyright owner]" # # Contributor(s): # If you wish your version of this file to be governed by only the CDDL or # only the GPL Version 2, indicate your decision by adding "[Contributor] # elects to include this software in this distribution under the [CDDL or GPL # Version 2] license." If you don't indicate a single choice of license, a # recipient has the option to distribute your version of this file under # either the CDDL, the GPL Version 2 or to extend the choice of license to # its licensees as provided above. However, if you add GPL Version 2 code # and therefore, elected the GPL Version 2 license, then the option applies # only if the new code is made subject to such option by the copyright # holder. #
{ "pile_set_name": "Github" }
# 性病医生的病人们 <!-- MarkdownTOC --> - 高大体面的大叔,你肿么了 - 美女啊美女 - 美丽孕妇的传说 - 她/他们的嗜好 - 口腔里的秘密 - 你们嫖就嫖,别传染给家人哦 - 女神啊,你混哪里的? <!-- /MarkdownTOC --> 八一下曾经的病号吧。最可怜的是一个送煤的,家里很穷,有次给发廊送煤后,发廊老板娘不给钱。跟他说:我这儿的小姐让你玩一次吧,要不你就白送了,玩个小姐也算你开了洋荤。送煤的想想也对,反正也要不到钱开洋荤也是白开,于是就那样那样了,然后尖锐湿疣,梅毒,淋病全都染上了。每次一来就要生不能要死不得的哭,唉,没办法,后来也不知道怎么样了。话说卖X货平时多以小诊所与游医诊治为主,加上撒谎成性,断不肯坦白承认自身的毛病,但依旧经不住久病不愈的折磨而找上医院科室人士啊, 如此一来,不就提供了某些谎言不攻自破的素材吗~ 于是性病科医生就有幸见识了其中的私密世界。注:菜花=尖锐湿疣 --- ## 高大体面的大叔,你肿么了 在门诊总会有些莫名其妙的病人。这个病人是我在急诊内科时碰到的,某男,约40岁,高高大大白白净净的,穿着很体面,7年前抽的就是蓝盒子芙蓉王,他一进来首先就是递给带教老师和我每人一支烟,由于我跟老师都不抽烟,所以拒绝但是病人很热情再三给我们,于是习惯性的接过来后带教老师放桌子上而我扔在口袋里,当着病人的面扔不好意思嘛。 言归正传,病人诉说近个把月来,乏力,反复低烧,关节痛,食欲减退,体重感觉也有所减轻,在下面的医院检查过也一直无法说清病因。于是来了我们医院想进一步检查。 开始带教老师也是考虑免疫风湿的问题,后面我才发现我们的祖先遗留下来的经验真的太管用了,望闻问切。带教老师也是无意的时候发现病人的肘部静脉血管有非常多小结痂留下来的印痕,也是随意 的问了句病人以前有没有打过针,患者这才说几年前有打过针,但是后面强制的戒了,就再也没有碰过。带教老师一听这样于是立刻马上要病人去疾控中心做个检测,骗他说我们医院的结果没有疾控中心快。等病人一走,带教老师迅速的把病人给的烟给扔掉,然后反复的用洗手液洗手。哈哈 虽然说这样无法传染HIV,但是作为医生,其实这个阴影都会存在,这个事情的后果是害的我的白大褂在84消毒液里泡了整整3天。 ## 美女啊美女 这个病人是我已经是医生的时候了,哥得意一把,其他的不擅长,皮肤性病还确实研究了一点名堂,起码在我们那个地方还是有点名气。 病人是别人请我过去看的,这也是个女病号,年纪很小,才20岁,却还带着个要喂奶的崽,一个号称是她姨妈的人陪护着,怀化妹子,之前已经在一些小诊所治过几次,但是一直没有好,小诊所无非就是这样,号称给你打消炎针,吃消炎药再涂点药就可以褪去,你妹的,懂行的都晓得,菜花打针吃药吃的好么,必须外科手术介入。女病号说一直在治疗,只是越治越多。一直没有去医院看过,也算是坑爹,我们那县城人民医院居然没有皮肤科,所以。。。。很多人看皮肤病性病大多确实是在小诊所解决。 脱了裤子,插入扩阴器,戴上手套一检查,女病号外面还好,不多,可以一拔开YD,立马一口冷气,密密麻麻不透风,里面一直长到宫颈口,好多好多粉红色的小尖刺… ## 美丽孕妇的传说 做为一个实习小医生的时候,每天可以看到很多漂亮的护士MM,还可以在很多漂亮的女病人面前大义凛然,碰到喜欢类型的有时候还可以搭讪下。我在传染科时就碰到过一个妹纸,真的美,就如95年李若彤演的小龙女一样不食人间烟火,妹纸刚来科室的时候我不清楚情况,只是看的动心,偷偷的看过多次,刚好那晚也是我的带教老师上夜班,没有想到,妹纸开始一直咳嗽,尼玛,居然咳的是血,好害怕,被带教老师骂一顿,自己病床的病人资料都不看,后面回去一看,肺结核2期。哎。后来,还是一直远远的看妹纸,再后来我就离开传染科了,那个时候妹子还是没有出院。 话撤的远了。 我记得那个下午,阳光很好,病人很少,快下班的时候,产科转来一位病人,孕妇,孕妇嗯美,除开肚子是滚圆的外,看不出像怀孕的人,她男人陪着,男人很普通,真羡慕,一个平凡的男人可以取个美丽的妹子。病人转来的时候我刚刚去WC,回来时以为是这个男子有什么问题,根本没有往其他的方向去想,事情还就这么让人意外,是这个妹子有菜花,按理说她自己应该晓得,但是一直也这么拖着,估计不想要她男人晓得,再后来,菜花越来越大。妹子心里怕撑不住了,于是拉着男人来医院。我的心里一下子从高峰跌落下拉。 很多妹纸对自己的男人说要洁身自好,有时候我更在想这个男人多可怜。真可怜。 再后来,这个女子因为即将生产,教授建议的是破腹产,再后来就不是我们的事,教授只是帮确诊下。我接触过最大的菜花病人有70岁来岁,年纪大但是性欲强,想想我们中国人,女人在50岁之后很多男人就等于当了和尚,但是和尚还是要喝水,特别是一些性欲强的人,怎么办,只能外部解决,可能又不懂,不懂得怎么保护自己,或者贪求便宜追求一时的快感,就地取材,总之,老爹爹是得了菜花,来医院的时候已经很大了,从阴囊处一直长到屁眼,约无名指大。连成一条线,教授问他多久了,老爹爹说不清楚,老婆婆还一直在边上问是不是癌症。教授想想回答老婆婆说就是个皮肤病,但是不排除癌变,一听到不排除老婆婆眼泪就哗啦哗啦的留下来,其实她根本不晓得到底是什么病。 后来,教授建议老爹爹做冷冻。再后来,我就没有见过老爹爹来过。 ## 她/他们的嗜好 这些年我和同事从YD里取出的东西,小的有一团团头发(现在都不知道是怎么弄进去为毛弄进去),半只眉笔。大的有包苹果的那个网状塑料,不过里面包的就不是苹果了,还有半截胡萝卜~,最搞笑的是一个空药瓶,各位自动脑补养生堂的维e维c那种,瓶底冲外,堵的结结实实严丝合缝,跟马德堡半球一样,真空状态吸力倍大,瓶子圆滑没地方着力,各种器械无效。弄了一刻钟才拔出来,这不是高潮,高潮是我们把药瓶取出来后,那个妹纸仍不起来,无限娇羞的说……人家那里面还有半截瓷汤匙……当时想用汤匙把 药瓶挖出来,结果就…… 深感佩服啊…… ## 口腔里的秘密 在皮肤性病科实习的时候遇到一个男病人,梅毒,带教老师太直接,问他什么时候找过小姐了,他不承认。然后老师说:“你不说就直接这样出去吧。” 病人怕了就说找过,但是只是让对方给他KJ。他说不应该这样就会染上啊。然后老师丢了他一句:“谁告诉你KJ不会染上了。人家的长口腔里面去了。” 对了,梅毒和菜花还能长在口腔里,用唾沫就能感染,你~~今天张姿态了吗?几年的医学生生涯外加4年的从医生涯。有一个病楼主不得不扒一拔,那就是梅毒。 从医这些年,我治疗性病最多的是淋病,其次才是菜花,梅毒我只见过三个患者,2个经我手,一个中年男子,一个美女,我也不得不佩服自己,很多女患者都是美女,真正的美女,哎,可惜了。不要骂我,我也是个正常的男人。 我兼职皮肤性病科的那些日子,唯一看走眼的一次也是在梅毒这个病上,就是前面我所说的中年男子。 那一天,中年男子突然找我说,说自己身上有很多红斑,于是我开始询问他的病史,中年男子说这个病有10年了,之前去过很多医院和诊所,有说是体癣的,也有说是花斑糠疹的,还有人说是金钱癣的,因为中年男子的身上有很多淡淡的印痕,不大,就古铜钱一半大小,椭圆或者圆形。开始我也以为是真菌感染之类的毛病,于是跟中年男子聊了很久,包括他的治疗史,中年男子说这十多年来一直吃中药,吃了中药可能会好些,但是一直没有断根。我问中年男子什么时候开始的,怎么开始他还有没有记忆。 中年男子说发病是在10多年前,那时他还在广州打工,有一次不晓得怎么的JJ上就破了点皮,又不痛,等JJ好了后过了一段时间身上就开始长东西,开始很少,于是就去看医生,涂点药又好些,慢慢的却越发越多,一直有治疗,但是都是在一些小诊所小医院,反正每个医生得出的诊断都不一样,那是我也习惯性的问他有没有嫖过,他说没有,只是打工的时候谈恋爱睡过几个厂妹,我也大意了,没有往心里去。后面还是给中年男子诊断了花斑癣,开了点抗真菌类药,外加注射斯奇康。还特意嘱咐中年男子1个月后来复查。 事情也就这样,过去了很久,中年男子也没有来复查,我也在一天无意的再次想起这个情况,心里一虚,焕然大悟,中年男子之前说JJ烂过又不痛,后面身上又开始长皮疹一直无法康复。撇除其他不说,我也应该想想梅毒的症状,只怪自己太大意,当初还特意用手去触摸过患者的皮损处。 我的娘,倒吸一口冷气,越想越害怕,于是楼主有一天偷偷的去别的医院做了个梅毒血清检查,万幸万幸,我没有。 ## 你们嫖就嫖,别传染给家人哦 以前在医院实习皮肤性病科见过一个小孩子长菜花,才六七岁肯定没嫖的吧!我们都很纳闷他是怎么得的,后来听老师讲是家长得病一家人衣服内裤神马的都在一起洗,小孩子就被传染了。这孩子太无辜了,还不知道性为何物就染上摆脱不掉的性病了 边缘性行为的性传播危机 一名常去KTV的病人在我疏导下,回忆了半天说:“这辈子除了老婆硬是没和第二个女人发生性交,因为我老婆温柔漂亮我不想背叛他,我仕途忙碌,回家总是洗碗扫地为她减负。”“我们长期面临宴请包娼,我都想到老婆而坐怀不乱。只是有一次例外。”“一年前,一个人办事宴请,弄来他的亲表妹,人漂亮不说还白晰丰满。不主动挑衅,只是头靠我肩上温柔的和我摆龙门阵。”“我见惯卖货,一来就摸摸搞搞的。这个不同,于是在等其它同路完事的过程中哦我亲过她脸,摸了几下乳,顺势用手伸进妹子那里摸了几下,感到水已溢流弄我一手指。。”作为医生我边听病人回忆边找切入点。就此打断问此官:“你的手之后三个月左右长过结结或者溃疡吗?”梅毒螺旋体,血液,唾液,体分泌物中含量高,经皮肤破损处感染传播,往往表现为不痛不痒的非炎症性溃疡——“硬下疳”。此病例就是YD分泌物通过手皮肤破损处传播。 在得到其本人承认做案手中指确实之后不久就长个小疙瘩,不痛不痒,随后自行愈合。再后来就手掌脱皮。 ## 女神啊,你混哪里的? 哥真是郁闷的想死了,从医的那些年中,看到过心动的妹子其实也就那么几个,一个是我说过的,前面得肺结核的,一个是那个孕妇,有菜花的,而剩下的这一个,还跟梅毒 有关。 那一天,哥是准备下班了,我承认自己不配做合格的医生,为什么呢,喜欢喝点啤酒,一两瓶不算什么,我一个人喝平常都是喝个4瓶左右,但是我从来不喝白酒,白酒喝多了影响脑神经,反应会变得迟钝。 那天心情还很好,正准备出住院部办公室门的时候,一个中年妇女带着个妹子问我,XX医生在吗,我说我就是,回答的时候正眼看到了那个妹子。妹子真的年轻,约双十二年华,皮肤白质,身高约160,,身材真的超好,特别有气质,要什么有什么,气质,胸部,脸蛋,身材,简直就一女神啊,吱吱,口水。妹纸被我看得有点不好意思,还是那中年妇女见如此尴尬的场景偷偷的推了下我,说,XX医生,她有个病咨询下你。哦哦哦,我才缓过神问有什么事情。 这时候,夜班的同事和白班的同事交接刚好查房去了,一干大小实习的同学要么早开溜要么也跟着去交接班。我把他们喊了进来坐下来。中年妇女见旁边没有什么人,就开始说故事了,她说这个妹子两年前找了个男朋友,后面一次不小心的去检查的时候居然发现感染了梅毒。。中年女子说到这里的时候,楼主开始遗憾了,妈的,太不公平了。可是后面中年女子越说越离谱,令我对这个妹子的身世有点怀疑,严重的开始怀疑到这个妹子是高级援交妹了,为什么呢,因为楼主跟各种鸡头,老妈交道打多了,看人这点经验还是有。 直到现在哥还是觉得遗憾,那么有感觉的一个妹子,哎! 后面我开始问妹子的治疗史,妹子说,从发现到来我这,将近半年的时间,一直没有来医院治疗,但是去过几次宾馆中找过游医,500块钱一针的打过好几针,后面复查没有什么效果,后面是来了医院,医院的医生说我治这块有点成绩,所以才找的我,于是把之前的检测单给我看,确实,确诊为梅毒 梅毒二字压力很大,不说别的,治疗期很长。一般是2年的治疗观察期。哎。给自己给家人带来多大的困扰,这个时段,传染期太强了。确诊后,妹子再动人,哥也不得不跟她保持一定的距离。 东聊西扯,大约清楚妹子是做援交后,楼主也兴趣下来,开药治疗,长效青霉素,后面护士皮试后居然青霉素打不得,于是换成头孢,妈的,居然也是阳性。2大法宝居然用不上,我嘱咐妹子第二天再来重新做次。 于是第二天上午,中年妇女又带着妹子重新来做皮试,居然,居然,2个药的皮试还是不成,这下我也没辙了。多西环素的效果我心里其实没有底。 但是不敢冒险给妹子强行上药,虽然她本人也同意。最后,楼主,放弃了。开了多西环素口服,嘱咐妹子,我这里就只能这样了,如果真的那个,要她去湘雅,湘雅就是我们湖南医生中最后的守护神。 最后的最后,哥还是个遗憾。2种药居然都打不得,虽然说,青霉素类必须皮试,现在很多地方头孢居然不做皮试了,但是楼主哥还是不敢,怕冒风险,药敏的反应太恐怖。哥怕的很。 我来补充,哥哥在手术室。手术前一堆病人必须查梅毒,乙肝,艾滋,梅毒太普遍了。那些老男人60,70左右的非常多,估计是老婆绝经出去吃鸡搞出来的,也有女的50~60岁基本是老公传染给她们。一个月我们这科室能发现10几个。搞得老子上台压力巨大,因为偶尔会被血碰到眼睛,还会被刀子或针刺伤。顶这个贴是希望大家别去瞎搞。 还有两个故事:一个是我一个初中同学,修冰箱。人长得高高大大,挺帅。经常去别人家修冰箱,顺便泡良家,或者说互相勾搭。有一次,中彩了。这哥们下身瘙痒,查出支原体,把儿子老婆都传染了。还怕艾滋病,查了四个月还不放心。最后是我开药把 他 治好了。从此他发誓再不在外面瞎搞了,因为当时他想到死了。家里人要全部完蛋。 再说一个:有个同事爱吃鸡,他也戴套,但是还是得了菜花,从小鸡几到肛门都是,手术冷冻做了许多次,还是没办法根治,走路的姿势非常怪异————姿势怪异的人,要当心啊中国梅毒患者加隐性估计几千万,艾滋病估计也有几百万,单纯我们这个中型城市估计得几万艾滋。 之前听皮科主任说过一个女病人,高热、皮疹什么的,查不出病因全院会诊,皮科主任看了看说叫他老公来下,来了一查老公淋病,在老婆经期同房,结果血行性感染,淋球菌性败血症了。 在医院看到最多的是男的出去找失足妇女,回来传给老婆孩子吗?好多妇女孕后期查出梅毒,这样的病人哪个医生其实都是不想接的。 嫖客真的很烂尤其是老婆大肚,还去嫖的。回头母婴感染 如果是菜花经常是长疣状物,液氮,冷冻。没有麻药,割了一次又长,会让你刻骨铭心,复发率高。其实美女染这个病我在实习生见过,美女机会大。外表看的温柔淑女,裤子一脱,扩阴器一扩,毁了老子三观。还有美女堕胎机会多。 有个村子 有个感染艾艾的姑娘据说把村里男人都睡遍了 才十八九岁呢 恐怖吧 男人都这样 女人要主动点还真少有不吃腥 男人的淋病和非淋病,女人的也一样时间久了就治愈不了。变成前列腺炎,宫颈炎,盆腔炎,输卵管堵塞。那些不孕不育很多是自己年轻时不检点造成的,所以男人女孩找处男处女当伴侣不是没有道理。 在医院整形美容科实习,就是过年的时候来了一个姑娘,个头也不高,还挺秀气,来咨询膜的修补。因为当天的手术安排满了,所以给她说了价格让她回去洗个澡第二天来。谁知道到时一上手术台,都楞了,小姑娘下面的菜花已经不堪入目了。只能用激光先烧掉才能继续手术。老师问这个女孩有几个男友,她也是不说实话,老说就一个,老师就吓唬她,说你这个尖锐湿疣不好治,因为姑娘的肛门那里都已经有了。那姑娘支支吾吾的说在外面打工感染上的,过年回家想结婚才想着来医院补个膜。那姑娘走了后,老师还说挺可惜的,姑娘那么漂亮,得了个这病,关键还没结婚。
{ "pile_set_name": "Github" }
:import { -st-from: "../Foundation/stylable/colors.st.css"; -st-named: THEME-COLOR-10, THEME-COLOR-20, THEME-COLOR-50, D10, D20, D50, D60, D70, D80; } :import { -st-from: "../Foundation/stylable/mixins/calc.js"; -st-default: calc; } :import { -st-from: "../Foundation/stylable/shadows.st.css"; -st-named: shadow30; } :import { -st-from: "../Foundation/stylable/typography.st.css"; -st-named: heading-h6, text-medium-normal; } :import { -st-from: '../Foundation/stylable/default-scroll-bar.st.css'; -st-named: defaultScrollBar; } :vars { option_height: 35px; big_option_height: 47px; content_container_height: 260px; top-arrow-size: 8px; arrowUpShadow: 3px 3px 8px rgba(0, 0, 0, .1); arrowDownShadow: -3px -3px 8px rgba(0, 0, 0, .1); } .root { -st-states: visible, withArrow, containerStyles, direction(enum(up, down)); box-sizing: border-box; position: relative; outline: none; border: none; width: 100%; display: flex; justify-content: center; } .root * { box-sizing: border-box; } .contentContainer { background: value(D80); border: none; display: none; opacity: 0; height: 0; padding: 0; transition: opacity 0.2s ease; width: 100%; z-index: 6; left: 0; -webkit-touch-callout: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .root:containerStyles .contentContainer{ border-radius: 8px; box-shadow: value(shadow30); position: absolute; } .root:visible .contentContainer { display: flex; flex-direction: column; height: auto; overflow: auto; opacity: 1; } .root:visible:withArrow .contentContainer { padding: 10px 0; } .root:visible:containerStyles:direction(up) .contentContainer{ bottom: 0; margin-top: 15px; } .root:visible:containerStyles:withArrow:direction(up) .contentContainer{ margin-bottom: value(top-arrow-size); } .root:visible:containerStyles:direction(down) .contentContainer { top: 0; margin-bottom: 15px; } .root:visible:containerStyles:withArrow:direction(down) .contentContainer { margin-top: value(top-arrow-size); } .options { -st-mixin: defaultScrollBar; position: relative; overflow: auto; } .option { -st-states: selected, hovered, disabled, title, itemHeight(enum(small, big)), overrideStyle; -st-mixin: text-medium-normal; color: value(D10); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; text-align: left; padding: 6px 20px 6px 24px; cursor: pointer; width: 100%; display: flex; align-items: center; } .option:overrideStyle { padding: 0; } .option:itemHeight(small):not(:overrideStyle) { min-height: value(option_height); } .option:itemHeight(big):not(:overrideStyle) { min-height: value(big_option_height); } .option:disabled { color: value(D50); cursor: default; } .option:title{ -st-mixin: heading-h6; text-transform: uppercase; letter-spacing: 1.2px; background: value(D70); color: value(D20); } :global(.rtl) .option, :global([dir='rtl']) .option{ text-align: right; direction: rtl; padding-right: 24px; padding-left: 24px; } .option:hovered { background: value(THEME-COLOR-50); color: value(D10); } .option:focus { outline: none; } .option:selected { background-color: value(THEME-COLOR-10); color: value(D80); } .option:selected:hovered { background-color: value(THEME-COLOR-20); color: value(D80); } .arrow { position: absolute; left: 50%; z-index: 10; transform: translateX(-50%) rotateZ(45deg); height: value(top-arrow-size); width: value(top-arrow-size); background: value(D80); } .root:direction(up) .arrow { bottom: calc(value(top-arrow-size) / 2); box-shadow: value(arrowUpShadow); } .root:direction(down) .arrow { top: calc(value(top-arrow-size) / 2); box-shadow: value(arrowDownShadow); } .loader { display: flex; justify-content: center; padding-bottom: 24px; } .linkItem{ text-decoration: none; } .divider { height: 1px; overflow: hidden; background-color: value(D60); margin: 0; }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <Bucket type = "1" version = "2.0"> <Breakpoints> <BreakpointProxy BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint"> <BreakpointContent shouldBeEnabled = "Yes" ignoreCount = "0" continueAfterRunningActions = "No" filePath = "JavaScriptAndObjectiveC/ViewController.m" timestampString = "490071930.026198" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" startingLineNumber = "46" endingLineNumber = "46" landmarkName = "-webView" landmarkType = "5"> </BreakpointContent> </BreakpointProxy> </Breakpoints> </Bucket>
{ "pile_set_name": "Github" }
/**************************************************************** * Licensed to the Apache Software Foundation (ASF) under one * * or more contributor license agreements. See the NOTICE file * * distributed with this work for additional information * * regarding copyright ownership. The ASF licenses this file * * to you under the Apache License, Version 2.0 (the * * "License"); you may not use this file except in compliance * * with the License. You may obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, * * software distributed under the License is distributed on an * * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * * KIND, either express or implied. See the License for the * * specific language governing permissions and limitations * * under the License. * ****************************************************************/ package org.apache.james.imap.message.response; import org.apache.james.imap.api.ImapCommand; import org.apache.james.imap.api.Tag; import org.apache.james.imap.api.display.HumanReadableText; import org.apache.james.imap.api.message.response.StatusResponse; import com.google.common.base.MoreObjects; /** * Immutable status response. Suitable for unpooled usage. */ public class ImmutableStatusResponse implements StatusResponse { private final ResponseCode responseCode; private final Type serverResponseType; private final Tag tag; private final HumanReadableText textKey; private final ImapCommand command; public ImmutableStatusResponse(Type serverResponseType, Tag tag, ImapCommand command, HumanReadableText textKey, ResponseCode responseCode) { super(); this.responseCode = responseCode; this.serverResponseType = serverResponseType; this.tag = tag; this.textKey = textKey; this.command = command; } @Override public ResponseCode getResponseCode() { return responseCode; } @Override public Type getServerResponseType() { return serverResponseType; } @Override public Tag getTag() { return tag; } @Override public HumanReadableText getTextKey() { return textKey; } @Override public ImapCommand getCommand() { return command; } @Override public String toString() { return MoreObjects.toStringHelper(this) .add("responseCode", responseCode) .add("serverResponseType", serverResponseType) .add("tag", tag) .add("textKey", textKey) .add("command", command) .toString(); } }
{ "pile_set_name": "Github" }
.. _access-logging: ============== Access Logging ============== The WSGI design is modular. Waitress logs error conditions, debugging output, etc., but not web traffic. For web traffic logging, Paste provides `TransLogger <https://web.archive.org/web/20160707041338/http://pythonpaste.org/modules/translogger.html>`_ :term:`middleware`. TransLogger produces logs in the `Apache Combined Log Format <https://httpd.apache.org/docs/current/logs.html#combined>`_. .. _logging-to-the-console-using-python: Logging to the Console Using Python ----------------------------------- ``waitress.serve`` calls ``logging.basicConfig()`` to set up logging to the console when the server starts up. Assuming no other logging configuration has already been done, this sets the logging default level to ``logging.WARNING``. The Waitress logger will inherit the root logger's level information (it logs at level ``WARNING`` or above). Waitress sends its logging output (including application exception renderings) to the Python logger object named ``waitress``. You can influence the logger level and output stream using the normal Python ``logging`` module API. For example: .. code-block:: python import logging logger = logging.getLogger('waitress') logger.setLevel(logging.INFO) Within a PasteDeploy configuration file, you can use the normal Python ``logging`` module ``.ini`` file format to change similar Waitress logging options. For example: .. code-block:: ini [logger_waitress] level = INFO .. _logging-to-the-console-using-pastedeploy: Logging to the Console Using PasteDeploy ---------------------------------------- TransLogger will automatically setup a logging handler to the console when called with no arguments. It "just works" in environments that don't configure logging. This is by virtue of its default configuration setting of ``setup_console_handler = True``. .. TODO: .. .. _logging-to-a-file-using-python: .. Logging to a File Using Python .. ------------------------------ .. Show how to configure the WSGI logger via python. .. _logging-to-a-file-using-pastedeploy: Logging to a File Using PasteDeploy ------------------------------------ TransLogger does not write to files, and the Python logging system must be configured to do this. The Python class :class:`FileHandler` logging handler can be used alongside TransLogger to create an ``access.log`` file similar to Apache's. Like any standard :term:`middleware` with a Paste entry point, TransLogger can be configured to wrap your application using ``.ini`` file syntax. First add a ``[filter:translogger]`` section, then use a ``[pipeline:main]`` section file to form a WSGI pipeline with both the translogger and your application in it. For instance, if you have this: .. code-block:: ini [app:wsgiapp] use = egg:mypackage#wsgiapp [server:main] use = egg:waitress#main host = 127.0.0.1 port = 8080 Add this: .. code-block:: ini [filter:translogger] use = egg:Paste#translogger setup_console_handler = False [pipeline:main] pipeline = translogger wsgiapp Using PasteDeploy this way to form and serve a pipeline is equivalent to wrapping your app in a TransLogger instance via the bottom of the ``main`` function of your project's ``__init__`` file: .. code-block:: python from mypackage import wsgiapp from waitress import serve from paste.translogger import TransLogger serve(TransLogger(wsgiapp, setup_console_handler=False)) .. note:: TransLogger will automatically set up a logging handler to the console when called with no arguments, so it "just works" in environments that don't configure logging. Since our logging handlers are configured, we disable the automation via ``setup_console_handler = False``. With the filter in place, TransLogger's logger (named the ``wsgi`` logger) will propagate its log messages to the parent logger (the root logger), sending its output to the console when we request a page: .. code-block:: text 00:50:53,694 INFO [wsgiapp] Returning: Hello World! (content-type: text/plain) 00:50:53,695 INFO [wsgi] 192.168.1.111 - - [11/Aug/2011:20:09:33 -0700] "GET /hello HTTP/1.1" 404 - "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6" To direct TransLogger to an ``access.log`` FileHandler, we need the following to add a FileHandler (named ``accesslog``) to the list of handlers, and ensure that the ``wsgi`` logger is configured and uses this handler accordingly: .. code-block:: ini # Begin logging configuration [loggers] keys = root, wsgiapp, wsgi [handlers] keys = console, accesslog [logger_wsgi] level = INFO handlers = accesslog qualname = wsgi propagate = 0 [handler_accesslog] class = FileHandler args = ('%(here)s/access.log','a') level = INFO formatter = generic As mentioned above, non-root loggers by default propagate their log records to the root logger's handlers (currently the console handler). Setting ``propagate`` to ``0`` (``False``) here disables this; so the ``wsgi`` logger directs its records only to the ``accesslog`` handler. Finally, there's no need to use the ``generic`` formatter with TransLogger, as TransLogger itself provides all the information we need. We'll use a formatter that passes-through the log messages as is. Add a new formatter called ``accesslog`` by including the following in your configuration file: .. code-block:: ini [formatters] keys = generic, accesslog [formatter_accesslog] format = %(message)s Finally alter the existing configuration to wire this new ``accesslog`` formatter into the FileHandler: .. code-block:: ini [handler_accesslog] class = FileHandler args = ('%(here)s/access.log','a') level = INFO formatter = accesslog
{ "pile_set_name": "Github" }
--disable_warnings DROP DATABASE IF EXISTS d1; DROP DATABASE IF EXISTS d2; DROP DATABASE IF EXISTS d3; --enable_warnings CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE QUICK d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE QUICK d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE QUICK d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE QUICK d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE QUICK d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE QUICK d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE QUICK d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE QUICK d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE QUICK d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE QUICK d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE QUICK d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE QUICK d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE IGNORE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE IGNORE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE IGNORE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE IGNORE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE IGNORE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE IGNORE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE IGNORE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE IGNORE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE IGNORE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE IGNORE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE IGNORE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE IGNORE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE QUICK IGNORE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE QUICK IGNORE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE QUICK IGNORE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE QUICK IGNORE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE QUICK IGNORE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE QUICK IGNORE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE QUICK IGNORE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE QUICK IGNORE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE QUICK IGNORE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE QUICK IGNORE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3; CREATE DATABASE d1; CREATE DATABASE d2; CREATE DATABASE d3; CREATE TABLE d1.t1 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d2.t2 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); CREATE TABLE d3.t3 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); DELETE QUICK IGNORE d1.t1, d2.t2 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DELETE QUICK IGNORE d1.t1.*, d2.t2.*, d3.t3 FROM d1.t1, d2.t2, d3.t3 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; DROP DATABASE d1; DROP DATABASE d2; DROP DATABASE d3;
{ "pile_set_name": "Github" }
// // Prefix header for all source files of the 'iPhone' target in the 'iPhone' project // #ifndef __IPHONE_5_0 #warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #endif
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.17" systemVersion="17A263s" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> <device id="ipad9_7" orientation="portrait"> <adaptation id="fullscreen"/> </device> <dependencies> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.14"/> <capability name="Alignment constraints to the first baseline" minToolsVersion="6.0"/> <capability name="Constraints to layout margins" minToolsVersion="6.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> <!--View Controller--> <scene sceneID="tne-QT-ifu"> <objects> <viewController id="BYZ-38-t0r" customClass="ViewController" customModule="FilterDemo" customModuleProvider="target" sceneMemberID="viewController"> <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Mvn-xO-iV4"> <rect key="frame" x="20" y="0.0" width="728" height="146"/> <subviews> <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="5" minValue="0.0" maxValue="9" translatesAutoresizingMaskIntoConstraints="NO" id="4uy-4S-wCV"> <rect key="frame" x="198" y="65.5" width="533" height="40"/> <constraints> <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="529" id="7Sp-hj-phw"/> <constraint firstAttribute="height" constant="39" id="UUA-YT-kna"/> </constraints> <connections> <action selector="changedCutoff:" destination="BYZ-38-t0r" eventType="valueChanged" id="urS-VN-hPI"/> </connections> </slider> <textField opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="lol-6O-F6a"> <rect key="frame" x="72" y="113.5" width="97" height="30"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <textInputTraits key="textInputTraits" keyboardType="decimalPad"/> </textField> <slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" minValue="-20" maxValue="20" translatesAutoresizingMaskIntoConstraints="NO" id="ZsV-Xt-jmk"> <rect key="frame" x="198" y="112.5" width="533" height="31"/> <constraints> <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="529" id="HA4-3C-9Xu"/> </constraints> <connections> <action selector="changedResonance:" destination="BYZ-38-t0r" eventType="valueChanged" id="9NK-BD-ti1"/> </connections> </slider> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Cutoff" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5rZ-Gm-nMf"> <rect key="frame" x="3" y="76" width="61" height="20.5"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <nil key="highlightedColor"/> </label> <textField opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="i52-hn-uY3"> <rect key="frame" x="72" y="70.5" width="97" height="30"/> <constraints> <constraint firstAttribute="width" constant="97" id="hw5-mH-YaC"/> </constraints> <fontDescription key="fontDescription" type="system" pointSize="17"/> <textInputTraits key="textInputTraits" keyboardType="decimalPad"/> </textField> <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="Zkh-DC-maM"> <rect key="frame" x="270.5" y="16" width="187" height="39"/> <subviews> <stackView opaque="NO" contentMode="scaleToFill" alignment="firstBaseline" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="7lK-bg-RFq"> <rect key="frame" x="0.0" y="0.0" width="187" height="39"/> <subviews> <button opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="awX-J2-WjW"> <rect key="frame" x="0.0" y="0.0" width="41" height="39"/> <fontDescription key="fontDescription" type="system" pointSize="22"/> <state key="normal" title="Play"/> <connections> <action selector="togglePlay:" destination="BYZ-38-t0r" eventType="touchUpInside" id="L06-Zo-ks1"/> </connections> </button> <button opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="751" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0Be-qM-2Hp" userLabel="Toggle Views Button"> <rect key="frame" x="61" y="0.0" width="126" height="39"/> <fontDescription key="fontDescription" type="system" pointSize="22"/> <state key="normal" title="Toggle Views"/> <connections> <action selector="toggleViews:" destination="BYZ-38-t0r" eventType="touchUpInside" id="MIm-4f-cD7"/> </connections> </button> </subviews> </stackView> </subviews> </stackView> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Resonance" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ayB-zX-5fW"> <rect key="frame" x="3" y="116.5" width="61" height="20.5"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <nil key="highlightedColor"/> </label> </subviews> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstItem="i52-hn-uY3" firstAttribute="centerY" secondItem="4uy-4S-wCV" secondAttribute="centerY" id="0La-hm-UuG"/> <constraint firstItem="i52-hn-uY3" firstAttribute="centerY" secondItem="5rZ-Gm-nMf" secondAttribute="centerY" id="1T1-JQ-CSo"/> <constraint firstItem="i52-hn-uY3" firstAttribute="trailing" secondItem="lol-6O-F6a" secondAttribute="trailing" id="2BM-SH-heV"/> <constraint firstItem="Zkh-DC-maM" firstAttribute="centerX" secondItem="Mvn-xO-iV4" secondAttribute="centerX" id="9ry-7V-pYm"/> <constraint firstItem="lol-6O-F6a" firstAttribute="top" secondItem="i52-hn-uY3" secondAttribute="bottom" constant="13" id="Adb-mF-OSB"/> <constraint firstItem="i52-hn-uY3" firstAttribute="leading" secondItem="5rZ-Gm-nMf" secondAttribute="trailing" constant="8" id="ERr-Dp-VJU"/> <constraint firstItem="4uy-4S-wCV" firstAttribute="trailing" secondItem="ZsV-Xt-jmk" secondAttribute="trailing" id="KGh-u3-e7k"/> <constraint firstItem="5rZ-Gm-nMf" firstAttribute="centerX" secondItem="ayB-zX-5fW" secondAttribute="centerX" id="RUp-VQ-6Ue"/> <constraint firstItem="4uy-4S-wCV" firstAttribute="leading" secondItem="i52-hn-uY3" secondAttribute="trailing" constant="31" id="W90-W9-caB"/> <constraint firstItem="Zkh-DC-maM" firstAttribute="top" secondItem="Mvn-xO-iV4" secondAttribute="top" constant="16" id="ZXw-dZ-PnG"/> <constraint firstItem="4uy-4S-wCV" firstAttribute="leading" secondItem="i52-hn-uY3" secondAttribute="trailing" constant="31" id="fbR-s0-Dkc"/> <constraint firstItem="ZsV-Xt-jmk" firstAttribute="top" secondItem="4uy-4S-wCV" secondAttribute="bottom" constant="8" symbolic="YES" id="glp-z0-hfD"/> <constraint firstItem="ayB-zX-5fW" firstAttribute="firstBaseline" secondItem="5rZ-Gm-nMf" secondAttribute="baseline" constant="40.5" id="kCN-1C-03k"/> <constraint firstItem="lol-6O-F6a" firstAttribute="leading" secondItem="ayB-zX-5fW" secondAttribute="trailing" constant="8" id="p3K-th-N7g"/> <constraint firstItem="lol-6O-F6a" firstAttribute="top" secondItem="i52-hn-uY3" secondAttribute="bottom" constant="13" id="slq-px-PdS"/> <constraint firstItem="i52-hn-uY3" firstAttribute="leading" secondItem="lol-6O-F6a" secondAttribute="leading" id="tUM-oH-hZH"/> <constraint firstItem="4uy-4S-wCV" firstAttribute="leading" secondItem="ZsV-Xt-jmk" secondAttribute="leading" id="tjn-sT-oid"/> <constraint firstAttribute="trailing" secondItem="4uy-4S-wCV" secondAttribute="trailing" constant="-1" id="vbv-zz-0LT"/> <constraint firstItem="4uy-4S-wCV" firstAttribute="top" secondItem="Zkh-DC-maM" secondAttribute="bottom" constant="10.5" id="zLe-Qd-Yob"/> </constraints> </view> <containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oZU-Ig-hQr"> <rect key="frame" x="20" y="154" width="730" height="850"/> <constraints> <constraint firstAttribute="height" constant="850" id="7Xv-gy-F3f"/> <constraint firstAttribute="width" constant="730" id="gk9-dQ-zQy"/> </constraints> <connections> <segue destination="n4r-Op-aTt" kind="embed" id="jpB-sF-DAF"/> </connections> </containerView> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cQh-7H-0gj" userLabel="Placeholder view"> <rect key="frame" x="8" y="1004" width="752" height="20"/> </view> </subviews> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstItem="cQh-7H-0gj" firstAttribute="top" secondItem="oZU-Ig-hQr" secondAttribute="bottom" id="9Ax-fP-1rR"/> <constraint firstItem="cQh-7H-0gj" firstAttribute="leading" secondItem="5I1-zs-Re0" secondAttribute="leading" constant="8" id="AjG-q7-A8K"/> <constraint firstItem="5I1-zs-Re0" firstAttribute="bottom" secondItem="cQh-7H-0gj" secondAttribute="bottom" id="L5p-Mf-edG"/> <constraint firstItem="Mvn-xO-iV4" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="UxQ-ho-12q"/> <constraint firstAttribute="trailingMargin" secondItem="Mvn-xO-iV4" secondAttribute="trailing" id="V8Z-vl-dIQ"/> <constraint firstItem="oZU-Ig-hQr" firstAttribute="top" secondItem="5I1-zs-Re0" secondAttribute="top" constant="134" id="hKw-d9-Uhy"/> <constraint firstItem="5rZ-Gm-nMf" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" constant="3" id="lHf-sX-kG7"/> <constraint firstItem="Mvn-xO-iV4" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="mrt-Sl-ce9"/> <constraint firstItem="oZU-Ig-hQr" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="rTe-OE-6IL"/> <constraint firstItem="ayB-zX-5fW" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" constant="3" id="uE2-cY-Kth"/> <constraint firstItem="5I1-zs-Re0" firstAttribute="trailing" secondItem="cQh-7H-0gj" secondAttribute="trailing" constant="8" id="wTM-CT-9Ky"/> <constraint firstItem="oZU-Ig-hQr" firstAttribute="top" secondItem="Mvn-xO-iV4" secondAttribute="bottom" constant="8" symbolic="YES" id="xZx-rd-pQa"/> </constraints> <viewLayoutGuide key="safeArea" id="5I1-zs-Re0"/> </view> <connections> <outlet property="auContainerView" destination="oZU-Ig-hQr" id="gDh-WB-t3u"/> <outlet property="controlsHeaderView" destination="Mvn-xO-iV4" id="tfb-MW-Tgf"/> <outlet property="cutoffSlider" destination="4uy-4S-wCV" id="dmB-V7-HW4"/> <outlet property="cutoffTextField" destination="i52-hn-uY3" id="cd1-5R-rCJ"/> <outlet property="horizontalViewConstraint" destination="gk9-dQ-zQy" id="S5p-Id-KPG"/> <outlet property="playButton" destination="awX-J2-WjW" id="yBe-iR-A9Z"/> <outlet property="resonanceSlider" destination="ZsV-Xt-jmk" id="zuX-mu-dli"/> <outlet property="resonanceTextField" destination="lol-6O-F6a" id="bjz-RL-5Tj"/> <outlet property="toggleButton" destination="0Be-qM-2Hp" id="Evn-sI-xBm"/> <outlet property="verticalViewConstraint" destination="7Xv-gy-F3f" id="zfZ-Dx-obU"/> </connections> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="302.34375" y="270.1171875"/> </scene> <!--View Controller--> <scene sceneID="t9P-R6-5hi"> <objects> <viewController automaticallyAdjustsScrollViewInsets="NO" id="n4r-Op-aTt" sceneMemberID="viewController"> <view key="view" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="pdy-KB-hsz"> <rect key="frame" x="0.0" y="0.0" width="730" height="850"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <viewLayoutGuide key="safeArea" id="bSn-kv-DHE"/> </view> <toolbarItems/> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="Mm6-zP-yY1" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="1051" y="270.75"/> </scene> </scenes> </document>
{ "pile_set_name": "Github" }
/* * Copyright (C) 2013 - 2014 Alexander "Evisceration" Martinz * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ package org.namelessrom.devicecontrol.modules.device; import android.app.Activity; import android.os.Bundle; import android.preference.Preference; import android.preference.PreferenceCategory; import android.preference.PreferenceGroup; import android.preference.PreferenceScreen; import android.text.TextUtils; import org.namelessrom.devicecontrol.ActivityCallbacks; import org.namelessrom.devicecontrol.DeviceConstants; import org.namelessrom.devicecontrol.R; import org.namelessrom.devicecontrol.actions.extras.MpDecisionAction; import org.namelessrom.devicecontrol.hardware.KsmUtils; import org.namelessrom.devicecontrol.hardware.UksmUtils; import org.namelessrom.devicecontrol.hardware.VoltageUtils; import org.namelessrom.devicecontrol.models.BootupConfig; import org.namelessrom.devicecontrol.modules.bootup.BootupItem; import org.namelessrom.devicecontrol.preferences.AwesomeListPreference; import org.namelessrom.devicecontrol.preferences.AwesomeTogglePreference; import org.namelessrom.devicecontrol.preferences.CustomListPreference; import org.namelessrom.devicecontrol.preferences.CustomPreference; import org.namelessrom.devicecontrol.views.CustomPreferenceFragment; import org.namelessrom.devicecontrol.utils.Utils; import java.util.ArrayList; public class DeviceFeatureKernelFragment extends CustomPreferenceFragment implements Preference.OnPreferenceClickListener { //============================================================================================== // Files //============================================================================================== private static final String TCP_CONGESTION_AVAILABLE = "/proc/sys/net/ipv4/tcp_available_congestion_control"; private static final String TCP_CONGESTION_CONTROL = "/proc/sys/net/ipv4/tcp_congestion_control"; //---------------------------------------------------------------------------------------------- private PreferenceScreen mRoot; //---------------------------------------------------------------------------------------------- private CustomPreference mEntropy; private CustomPreference mKsm; private CustomPreference mUksm; //---------------------------------------------------------------------------------------------- private AwesomeTogglePreference mPowerEfficientWork; private AwesomeListPreference mMcPowerScheduler; //---------------------------------------------------------------------------------------------- private AwesomeTogglePreference mMsmDcvs; private CustomPreference mVoltageControl; //---------------------------------------------------------------------------------------------- private CustomListPreference mTcpCongestion; //============================================================================================== // Overridden Methods //============================================================================================== @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.device_feature_kernel); mRoot = getPreferenceScreen(); //------------------------------------------------------------------------------------------ // Kernel Features //------------------------------------------------------------------------------------------ PreferenceCategory category = (PreferenceCategory) findPreference("kernel_features"); mEntropy = (CustomPreference) findPreference("entropy"); mEntropy.setOnPreferenceClickListener(this); mKsm = (CustomPreference) findPreference("ksm"); if (Utils.fileExists(KsmUtils.KSM_PATH)) { mKsm.setOnPreferenceClickListener(this); } else { category.removePreference(mKsm); } mUksm = (CustomPreference) findPreference("uksm"); if (Utils.fileExists(UksmUtils.UKSM_PATH)) { mUksm.setOnPreferenceClickListener(this); } else { category.removePreference(mUksm); } removeIfEmpty(category); //------------------------------------------------------------------------------------------ // Power Saving //------------------------------------------------------------------------------------------ category = (PreferenceCategory) findPreference("powersaving"); mPowerEfficientWork = (AwesomeTogglePreference) findPreference("power_efficient_work"); if (mPowerEfficientWork.isSupported()) { mPowerEfficientWork.initValue(); mPowerEfficientWork.setOnPreferenceChangeListener(this); } else { category.removePreference(mPowerEfficientWork); } mMcPowerScheduler = (AwesomeListPreference) findPreference("sched_mc_power_savings"); if (mMcPowerScheduler.isSupported()) { mMcPowerScheduler.initValue(); mMcPowerScheduler.setSummary(mMcPowerScheduler.getEntry()); mMcPowerScheduler.setOnPreferenceChangeListener(this); } else { category.removePreference(mMcPowerScheduler); } removeIfEmpty(category); //------------------------------------------------------------------------------------------ // Voltage //------------------------------------------------------------------------------------------ category = (PreferenceCategory) findPreference("voltage"); mMsmDcvs = (AwesomeTogglePreference) findPreference("msm_dcvs"); if (mMsmDcvs.isSupported()) { mMsmDcvs.initValue(); mMsmDcvs.setOnPreferenceChangeListener(this); } else { category.removePreference(mMsmDcvs); } mVoltageControl = (CustomPreference) findPreference("voltage_control"); if (Utils.fileExists(VoltageUtils.VDD_TABLE_FILE) || Utils.fileExists( VoltageUtils.UV_TABLE_FILE)) { mVoltageControl.setOnPreferenceClickListener(this); } else { category.removePreference(mVoltageControl); } removeIfEmpty(category); //------------------------------------------------------------------------------------------ // Extras //------------------------------------------------------------------------------------------ category = (PreferenceCategory) findPreference("extras"); buildExtraCategory(category); removeIfEmpty(category); isSupported(mRoot, getActivity()); } private void buildExtraCategory(final PreferenceCategory category) { mTcpCongestion = (CustomListPreference) findPreference("tcp_congestion_control"); // read the available tcp congestion controls String tmp = Utils.readFile(TCP_CONGESTION_AVAILABLE); if (!TextUtils.isEmpty(tmp)) { // split them final String[] tcp_avail = tmp.trim().split(" "); // read the current congestion control tmp = Utils.readFile(TCP_CONGESTION_CONTROL); if (!TextUtils.isEmpty(tmp)) { tmp = tmp.trim(); mTcpCongestion.setEntries(tcp_avail); mTcpCongestion.setEntryValues(tcp_avail); mTcpCongestion.setSummary(tmp); mTcpCongestion.setValue(tmp); mTcpCongestion.setOnPreferenceChangeListener(this); } } else { category.removePreference(mTcpCongestion); } } private void removeIfEmpty(final PreferenceGroup preferenceGroup) { if (mRoot != null && preferenceGroup.getPreferenceCount() == 0) { mRoot.removePreference(preferenceGroup); } } @Override public boolean onPreferenceClick(final Preference preference) { final int id; if (mVoltageControl == preference) { id = DeviceConstants.ID_VOLTAGE; } else if (mKsm == preference) { id = DeviceConstants.ID_KSM; } else if (mUksm == preference) { id = DeviceConstants.ID_UKSM; } else if (mEntropy == preference) { id = DeviceConstants.ID_ENTROPY; } else { id = Integer.MIN_VALUE; } if (id != Integer.MIN_VALUE) { final Activity activity = getActivity(); if (activity instanceof ActivityCallbacks) { ((ActivityCallbacks) activity).shouldLoadFragment(id); } return true; } return false; } @Override public boolean onPreferenceChange(Preference preference, Object o) { if (preference == mPowerEfficientWork) { mPowerEfficientWork.writeValue((Boolean) o); return true; } else if (preference == mMcPowerScheduler) { final String value = String.valueOf(o); mMcPowerScheduler.writeValue(value); if (mMcPowerScheduler.getEntries() != null) { final String summary = String.valueOf(mMcPowerScheduler.getEntries()[Utils.parseInt(value)]); mMcPowerScheduler.setSummary(summary); } return true; } else if (preference == mMsmDcvs) { mMsmDcvs.writeValue((Boolean) o); return true; } else if (preference == mTcpCongestion) { final String value = String.valueOf(o); Utils.writeValue(TCP_CONGESTION_CONTROL, value); BootupConfig.setBootup(new BootupItem( BootupConfig.CATEGORY_EXTRAS, mTcpCongestion.getKey(), TCP_CONGESTION_CONTROL, value, true)); preference.setSummary(value); return true; } return false; } //============================================================================================== // Methods //============================================================================================== public static String restore(BootupConfig config) { final ArrayList<BootupItem> items = config .getItemsByCategory(BootupConfig.CATEGORY_EXTRAS); if (items.size() == 0) { return ""; } final StringBuilder sbCmd = new StringBuilder(); for (final BootupItem item : items) { if (!item.enabled) { continue; } if (MpDecisionAction.MPDECISION_PATH.equals(item.name)) { new MpDecisionAction(item.value, false).triggerAction(); } else { sbCmd.append(Utils.getWriteCommand(item.name, item.value)); } } return sbCmd.toString(); } }
{ "pile_set_name": "Github" }
package com.wavpack.decoder; /* ** WordsUtils.java ** ** Copyright (c) 2007 - 2008 Peter McQuillan ** ** All Rights Reserved. ** ** Distributed under the BSD Software License (see license.txt) ** */ class WordsUtils { //////////////////////////////// local macros ///////////////////////////////// static int LIMIT_ONES = 16; // maximum consecutive 1s sent for "div" data // these control the time constant "slow_level" which is used for hybrid mode // that controls bitrate as a function of residual level (HYBRID_BITRATE). static int SLS = 8; static int SLO = ((1 << (SLS - 1))); // these control the time constant of the 3 median level breakpoints static int DIV0 = 128; // 5/7 of samples static int DIV1 = 64; // 10/49 of samples static int DIV2 = 32; // 20/343 of samples ///////////////////////////// local table storage //////////////////////////// static char nbits_table[] = { 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, // 0 - 15 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, // 16 - 31 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, // 32 - 47 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, // 48 - 63 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 64 - 79 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 80 - 95 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 96 - 111 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 112 - 127 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 128 - 143 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 144 - 159 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 160 - 175 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 176 - 191 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 192 - 207 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 208 - 223 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, // 224 - 239 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 // 240 - 255 }; static int log2_table[] = { 0x00, 0x01, 0x03, 0x04, 0x06, 0x07, 0x09, 0x0a, 0x0b, 0x0d, 0x0e, 0x10, 0x11, 0x12, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1a, 0x1c, 0x1d, 0x1e, 0x20, 0x21, 0x22, 0x24, 0x25, 0x26, 0x28, 0x29, 0x2a, 0x2c, 0x2d, 0x2e, 0x2f, 0x31, 0x32, 0x33, 0x34, 0x36, 0x37, 0x38, 0x39, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x41, 0x42, 0x43, 0x44, 0x45, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdc, 0xdd, 0xde, 0xdf, 0xe0, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe4, 0xe5, 0xe6, 0xe7, 0xe7, 0xe8, 0xe9, 0xea, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xee, 0xef, 0xf0, 0xf1, 0xf1, 0xf2, 0xf3, 0xf4, 0xf4, 0xf5, 0xf6, 0xf7, 0xf7, 0xf8, 0xf9, 0xf9, 0xfa, 0xfb, 0xfc, 0xfc, 0xfd, 0xfe, 0xff, 0xff }; static int exp2_table[] = { 0x00, 0x01, 0x01, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x06, 0x07, 0x08, 0x08, 0x09, 0x0a, 0x0b, 0x0b, 0x0c, 0x0d, 0x0e, 0x0e, 0x0f, 0x10, 0x10, 0x11, 0x12, 0x13, 0x13, 0x14, 0x15, 0x16, 0x16, 0x17, 0x18, 0x19, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1d, 0x1e, 0x1f, 0x20, 0x20, 0x21, 0x22, 0x23, 0x24, 0x24, 0x25, 0x26, 0x27, 0x28, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9f, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbc, 0xbd, 0xbe, 0xbf, 0xc0, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc8, 0xc9, 0xca, 0xcb, 0xcd, 0xce, 0xcf, 0xd0, 0xd2, 0xd3, 0xd4, 0xd6, 0xd7, 0xd8, 0xd9, 0xdb, 0xdc, 0xdd, 0xde, 0xe0, 0xe1, 0xe2, 0xe4, 0xe5, 0xe6, 0xe8, 0xe9, 0xea, 0xec, 0xed, 0xee, 0xf0, 0xf1, 0xf2, 0xf4, 0xf5, 0xf6, 0xf8, 0xf9, 0xfa, 0xfc, 0xfd, 0xff }; static char ones_count_table[] = { 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 7, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 8 }; ///////////////////////////// executable code //////////////////////////////// // Read the median log2 values from the specifed metadata structure, convert // them back to 32-bit unsigned values and store them. If length is not // exactly correct then we flag and return an error. static int read_entropy_vars(WavpackStream wps, WavpackMetadata wpmd) { byte byteptr[] = wpmd.data; //byteptr needs to be unsigned chars, so convert to int array int[] b_array = new int[12]; int i = 0; words_data w = new words_data(); for (i = 0; i < 6; i++) { b_array[i] = (int) (byteptr[i] & 0xff); } w.holding_one = 0; w.holding_zero = 0; if (wpmd.byte_length != 12) { if ((wps.wphdr.flags & (Defines.MONO_FLAG | Defines.FALSE_STEREO)) == 0) { return Defines.FALSE; } } w.c[0].median[0] = exp2s(b_array[0] + (b_array[1] << 8)); w.c[0].median[1] = exp2s(b_array[2] + (b_array[3] << 8)); w.c[0].median[2] = exp2s(b_array[4] + (b_array[5] << 8)); if ((wps.wphdr.flags & (Defines.MONO_FLAG | Defines.FALSE_STEREO)) == 0) { for (i = 6; i < 12; i++) { b_array[i] = (int) (byteptr[i] & 0xff); } w.c[1].median[0] = exp2s(b_array[6] + (b_array[7] << 8)); w.c[1].median[1] = exp2s(b_array[8] + (b_array[9] << 8)); w.c[1].median[2] = exp2s(b_array[10] + (b_array[11] << 8)); } wps.w = w; return Defines.TRUE; } // Read the hybrid related values from the specifed metadata structure, convert // them back to their internal formats and store them. The extended profile // stuff is not implemented yet, so return an error if we get more data than // we know what to do with. static int read_hybrid_profile(WavpackStream wps, WavpackMetadata wpmd) { byte byteptr[] = wpmd.data; int bytecnt = wpmd.byte_length; int buffer_counter = 0; int uns_buf = 0; int uns_buf_plusone = 0; if ((wps.wphdr.flags & Defines.HYBRID_BITRATE) != 0) { uns_buf = (int) (byteptr[buffer_counter] & 0xff); uns_buf_plusone = (int) (byteptr[buffer_counter + 1] & 0xff); wps.w.c[0].slow_level = exp2s(uns_buf + (uns_buf_plusone << 8)); buffer_counter = buffer_counter + 2; if ((wps.wphdr.flags & (Defines.MONO_FLAG | Defines.FALSE_STEREO)) == 0) { uns_buf = (int) (byteptr[buffer_counter] & 0xff); uns_buf_plusone = (int) (byteptr[buffer_counter + 1] & 0xff); wps.w.c[1].slow_level = exp2s(uns_buf + (uns_buf_plusone << 8)); buffer_counter = buffer_counter + 2; } } uns_buf = (int) (byteptr[buffer_counter] & 0xff); uns_buf_plusone = (int) (byteptr[buffer_counter + 1] & 0xff); wps.w.bitrate_acc[0] = (int) (uns_buf + (uns_buf_plusone << 8)) << 16; buffer_counter = buffer_counter + 2; if ((wps.wphdr.flags & (Defines.MONO_FLAG | Defines.FALSE_STEREO)) == 0) { uns_buf = (int) (byteptr[buffer_counter] & 0xff); uns_buf_plusone = (int) (byteptr[buffer_counter + 1] & 0xff); wps.w.bitrate_acc[1] = (int) (uns_buf + (uns_buf_plusone << 8)) << 16; buffer_counter = buffer_counter + 2; } if (buffer_counter < bytecnt) { uns_buf = (int) (byteptr[buffer_counter] & 0xff); uns_buf_plusone = (int) (byteptr[buffer_counter + 1] & 0xff); wps.w.bitrate_delta[0] = exp2s((short) (uns_buf + (uns_buf_plusone << 8))); buffer_counter = buffer_counter + 2; if ((wps.wphdr.flags & (Defines.MONO_FLAG | Defines.FALSE_STEREO)) == 0) { uns_buf = (int) (byteptr[buffer_counter] & 0xff); uns_buf_plusone = (int) (byteptr[buffer_counter + 1] & 0xff); wps.w.bitrate_delta[1] = exp2s((short) (uns_buf + (uns_buf_plusone << 8))); buffer_counter = buffer_counter + 2; } if (buffer_counter < bytecnt) return Defines.FALSE; } else wps.w.bitrate_delta[0] = wps.w.bitrate_delta[1] = 0; return Defines.TRUE; } // This function is called during both encoding and decoding of hybrid data to // update the "error_limit" variable which determines the maximum sample error // allowed in the main bitstream. In the HYBRID_BITRATE mode (which is the only // currently implemented) this is calculated from the slow_level values and the // bitrate accumulators. Note that the bitrate accumulators can be changing. static words_data update_error_limit(words_data w, long flags) { int bitrate_0 = (int) ((w.bitrate_acc[0] += w.bitrate_delta[0]) >> 16); if ((flags & (Defines.MONO_FLAG | Defines.FALSE_STEREO)) != 0) { if ((flags & Defines.HYBRID_BITRATE) != 0) { int slow_log_0 = (int) ((w.c[0].slow_level + SLO) >> SLS); if (slow_log_0 - bitrate_0 > -0x100) w.c[0].error_limit = exp2s(slow_log_0 - bitrate_0 + 0x100); else w.c[0].error_limit = 0; } else w.c[0].error_limit = exp2s(bitrate_0); } else { int bitrate_1 = (int) ((w.bitrate_acc[1] += w.bitrate_delta[1]) >> 16); if ((flags & Defines.HYBRID_BITRATE) != 0) { int slow_log_0 = (int) ((w.c[0].slow_level + SLO) >> SLS); int slow_log_1 = (int) ((w.c[1].slow_level + SLO) >> SLS); if ((flags & Defines.HYBRID_BALANCE) != 0) { int balance = (slow_log_1 - slow_log_0 + bitrate_1 + 1) >> 1; if (balance > bitrate_0) { bitrate_1 = bitrate_0 * 2; bitrate_0 = 0; } else if (-balance > bitrate_0) { bitrate_0 = bitrate_0 * 2; bitrate_1 = 0; } else { bitrate_1 = bitrate_0 + balance; bitrate_0 = bitrate_0 - balance; } } if (slow_log_0 - bitrate_0 > -0x100) w.c[0].error_limit = exp2s(slow_log_0 - bitrate_0 + 0x100); else w.c[0].error_limit = 0; if (slow_log_1 - bitrate_1 > -0x100) w.c[1].error_limit = exp2s(slow_log_1 - bitrate_1 + 0x100); else w.c[1].error_limit = 0; } else { w.c[0].error_limit = exp2s(bitrate_0); w.c[1].error_limit = exp2s(bitrate_1); } } return w; } // Read the next word from the bitstream "wvbits" and return the value. This // function can be used for hybrid or lossless streams, but since an // optimized version is available for lossless this function would normally // be used for hybrid only. If a hybrid lossless stream is being read then // the "correction" offset is written at the specified pointer. A return value // of WORD_EOF indicates that the end of the bitstream was reached (all 1s) or // some other error occurred. static int get_words(long nsamples, long flags, words_data w, Bitstream bs, int[] buffer) { entropy_data[] c = w.c; int csamples; int buffer_counter = 0; int entidx = 1; if ((flags & (Defines.MONO_FLAG | Defines.FALSE_STEREO)) == 0) // if not mono { nsamples *= 2; } else { // it is mono entidx = 0; } for (csamples = 0; csamples < nsamples; ++csamples) { long ones_count, low, mid, high; if ((flags & (Defines.MONO_FLAG | Defines.FALSE_STEREO)) == 0) // if not mono { if (entidx == 1) entidx = 0; else entidx = 1; } if ((w.c[0].median[0] & ~1) == 0 && w.holding_zero == 0 && w.holding_one == 0 && (w.c[1].median[0] & ~1) == 0) { long mask; int cbits; if (w.zeros_acc > 0) { --w.zeros_acc; if (w.zeros_acc > 0) { c[entidx].slow_level -= (c[entidx].slow_level + SLO) >> SLS; buffer[buffer_counter] = 0; buffer_counter++; continue; } } else { cbits = 0; bs = BitsUtils.getbit(bs); while (cbits < 33 && bs.bitval > 0) { cbits++; bs = BitsUtils.getbit(bs); } if (cbits == 33) { break; } if (cbits < 2) w.zeros_acc = cbits; else { --cbits; for (mask = 1, w.zeros_acc = 0; cbits > 0; mask <<= 1) { bs = BitsUtils.getbit(bs); if (bs.bitval > 0) w.zeros_acc |= mask; cbits--; } w.zeros_acc |= mask; } if (w.zeros_acc > 0) { c[entidx].slow_level -= (c[entidx].slow_level + SLO) >> SLS; w.c[0].median[0] = 0; w.c[0].median[1] = 0; w.c[0].median[2] = 0; w.c[1].median[0] = 0; w.c[1].median[1] = 0; w.c[1].median[2] = 0; buffer[buffer_counter] = 0; buffer_counter++; continue; } } } if (w.holding_zero > 0) ones_count = w.holding_zero = 0; else { int next8; int uns_buf; if (bs.bc < 8) { bs.ptr++; bs.buf_index++; if (bs.ptr == bs.end) bs = BitsUtils.bs_read(bs); uns_buf = bs.buf[bs.buf_index] & 0xff; bs.sr = bs.sr | (uns_buf << bs.bc); // values in buffer must be unsigned next8 = (int) (bs.sr & 0xff); bs.bc += 8; } else next8 = (int) (bs.sr & 0xff); if (next8 == 0xff) { bs.bc -= 8; bs.sr >>= 8; ones_count = 8; bs = BitsUtils.getbit(bs); while (ones_count < (LIMIT_ONES + 1) && bs.bitval > 0) { ones_count++; bs = BitsUtils.getbit(bs); } if (ones_count == (LIMIT_ONES + 1)) { break; } if (ones_count == LIMIT_ONES) { long mask; int cbits; cbits = 0; bs = BitsUtils.getbit(bs); while (cbits < 33 && bs.bitval > 0) { cbits++; bs = BitsUtils.getbit(bs); } if (cbits == 33) { break; } if (cbits < 2) ones_count = cbits; else { for (mask = 1, ones_count = 0; --cbits > 0; mask <<= 1) { bs = BitsUtils.getbit(bs); if (bs.bitval > 0) ones_count |= mask; } ones_count |= mask; } ones_count += LIMIT_ONES; } } else { bs.bc -= (ones_count = ones_count_table[next8]) + 1; bs.sr = bs.sr >> ones_count + 1; // needs to be unsigned } if (w.holding_one > 0) { w.holding_one = ones_count & 1; ones_count = (ones_count >> 1) + 1; } else { w.holding_one = ones_count & 1; ones_count >>= 1; } w.holding_zero = (int) (~w.holding_one & 1); } if ((flags & Defines.HYBRID_FLAG) > 0 && ((flags & (Defines.MONO_FLAG | Defines.FALSE_STEREO)) > 0 || (csamples & 1) == 0)) w = update_error_limit(w, flags); if (ones_count == 0) { low = 0; high = (((c[entidx].median[0]) >> 4) + 1) - 1; c[entidx].median[0] -= (((c[entidx].median[0] + (DIV0 - 2)) / DIV0) * 2); } else { low = (((c[entidx].median[0]) >> 4) + 1); c[entidx].median[0] += ((c[entidx].median[0] + DIV0) / DIV0) * 5; if (ones_count == 1) { high = low + (((c[entidx].median[1]) >> 4) + 1) - 1; c[entidx].median[1] -= ((c[entidx].median[1] + (DIV1 - 2)) / DIV1) * 2; } else { low += (((c[entidx].median[1]) >> 4) + 1); c[entidx].median[1] += ((c[entidx].median[1] + DIV1) / DIV1) * 5; if (ones_count == 2) { high = low + (((c[entidx].median[2]) >> 4) + 1) - 1; c[entidx].median[2] -= ((c[entidx].median[2] + (DIV2 - 2)) / DIV2) * 2; } else { low += (ones_count - 2) * (((c[entidx].median[2]) >> 4) + 1); high = low + (((c[entidx].median[2]) >> 4) + 1) - 1; c[entidx].median[2] += ((c[entidx].median[2] + DIV2) / DIV2) * 5; } } } mid = (high + low + 1) >> 1; if (c[entidx].error_limit == 0) { mid = read_code(bs, high - low); mid = mid + low; } else while (high - low > c[entidx].error_limit) { bs = BitsUtils.getbit(bs); if (bs.bitval > 0) { mid = (high + (low = mid) + 1) >> 1; } else { mid = ((high = mid - 1) + low + 1) >> 1; } } bs = BitsUtils.getbit(bs); if (bs.bitval > 0) { buffer[buffer_counter] = (int) ~mid; } else { buffer[buffer_counter] = (int) mid; } buffer_counter++; if ((flags & Defines.HYBRID_BITRATE) > 0) c[entidx].slow_level = c[entidx].slow_level - ((c[entidx].slow_level + SLO) >> SLS) + mylog2(mid); } w.c = c; if ((flags & (Defines.MONO_FLAG | Defines.FALSE_STEREO)) != 0) { return csamples; } else { return (csamples / 2); } } static int count_bits(long av) { if (av < (1 << 8)) { return nbits_table[(int) av]; } else { if (av < (1 << 16)) { return nbits_table[(int) (av >>> 8)] + 8; } else { if (av < (1 << 24)) { return nbits_table[(int) (av >>> 16)] + 16; } else { return nbits_table[(int) (av >>> 24)] + 24; } } } } // Read a single unsigned value from the specified bitstream with a value // from 0 to maxcode. If there are exactly a power of two number of possible // codes then this will read a fixed number of bits; otherwise it reads the // minimum number of bits and then determines whether another bit is needed // to define the code. static long read_code(Bitstream bs, long maxcode) { int bitcount = count_bits(maxcode); long extras = (1L << bitcount) - maxcode - 1, code; if (bitcount == 0) { return ((long) 0); } code = BitsUtils.getbits(bitcount - 1, bs); code &= (1L << (bitcount - 1)) - 1; if (code >= extras) { code = (code << 1) - extras; bs = BitsUtils.getbit(bs); if (bs.bitval > 0) ++code; } return (code); } // The concept of a base 2 logarithm is used in many parts of WavPack. It is // a way of sufficiently accurately representing 32-bit signed and unsigned // values storing only 16 bits (actually fewer). It is also used in the hybrid // mode for quickly comparing the relative magnitude of large values (i.e. // division) and providing smooth exponentials using only addition. // These are not strict logarithms in that they become linear around zero and // can therefore represent both zero and negative values. They have 8 bits // of precision and in "roundtrip" conversions the total error never exceeds 1 // part in 225 except for the cases of +/-115 and +/-195 (which error by 1). // This function returns the log2 for the specified 32-bit unsigned value. // The maximum value allowed is about 0xff800000 and returns 8447. static int mylog2(long avalue) { int dbits; if ((avalue += avalue >> 9) < (1 << 8)) { dbits = nbits_table[(int) avalue]; return (dbits << 8) + log2_table[(int) (avalue << (9 - dbits)) & 0xff]; } else { if (avalue < (1L << 16)) dbits = nbits_table[(int) (avalue >> 8)] + 8; else if (avalue < (1L << 24)) dbits = nbits_table[(int) (avalue >> 16)] + 16; else dbits = nbits_table[(int) (avalue >> 24)] + 24; return (dbits << 8) + log2_table[(int) (avalue >> (dbits - 9)) & 0xff]; } } // This function returns the log2 for the specified 32-bit signed value. // All input values are valid and the return values are in the range of // +/- 8192. int log2s(int value) { if (value < 0) { return -mylog2(-value); } else { return mylog2(value); } } // This function returns the original integer represented by the supplied // logarithm (at least within the provided accuracy). The log is signed, // but since a full 32-bit value is returned this can be used for unsigned // conversions as well (i.e. the input range is -8192 to +8447). static int exp2s(int log) { long value; if (log < 0) return -exp2s(-log); value = exp2_table[log & 0xff] | 0x100; if ((log >>= 8) <= 9) return ((int) (value >> (9 - log))); else return ((int) (value << (log - 9))); } // These two functions convert internal weights (which are normally +/-1024) // to and from an 8-bit signed character version for storage in metadata. The // weights are clipped here in the case that they are outside that range. static int restore_weight(byte weight) { int result; if ((result = (int) weight << 3) > 0) result += (result + 64) >> 7; return result; } }
{ "pile_set_name": "Github" }
// Copyright Aleksey Gurtovoy 2000-2004 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // *Preprocessed* version of the main "bind_fwd.hpp" header // -- DO NOT modify by hand! namespace boost { namespace mpl { template< typename F > struct bind0; template< typename F, typename T1 > struct bind1; template< typename F, typename T1, typename T2 > struct bind2; template< typename F, typename T1, typename T2, typename T3 > struct bind3; template< typename F, typename T1, typename T2, typename T3, typename T4 > struct bind4; template< typename F, typename T1, typename T2, typename T3, typename T4 , typename T5 > struct bind5; }}
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- ~ Copyright (c) 2016-2019 VMware, Inc. All Rights Reserved. ~ ~ This product is licensed to you under the Apache License, Version 2.0 (the "License"). ~ You may not use this product except in compliance with the License. ~ ~ This product may include a number of subcomponents with separate copyright notices ~ and license terms. Your use of these subcomponents is subject to the terms and ~ conditions of the subcomponent's license, as noted in the LICENSE file. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.vmware.admiral</groupId> <artifactId>admiral</artifactId> <version>1.5.6-SNAPSHOT</version> </parent> <artifactId>admiral-test-integration</artifactId> <properties> <buildDirectory>${project.basedir}/target</buildDirectory> <failsafeReportsDirectory>${project.build.directory}/failsafe-reports</failsafeReportsDirectory> </properties> <build> <directory>${buildDirectory}</directory> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <configuration> <reportsDirectory>${failsafeReportsDirectory}</reportsDirectory> <summaryFile>${failsafeReportsDirectory}/failsafe-summary.xml</summaryFile> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>${project.groupId}</groupId> <artifactId>admiral-request</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>admiral-adapter-docker</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>admiral-adapter-registry</artifactId> <version>${project.version}</version> </dependency> <!-- TEST --> <dependency> <groupId>${project.groupId}</groupId> <artifactId>admiral-common-test</artifactId> <version>${project.version}</version> <classifier>tests</classifier> <scope>test</scope> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>admiral-host</artifactId> <version>${project.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>admiral-host</artifactId> <version>${project.version}</version> <classifier>tests</classifier> <scope>test</scope> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>admiral-request</artifactId> <version>${project.version}</version> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>admiral-compute</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>admiral-compute</artifactId> <version>${project.version}</version> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>admiral-adapter-docker</artifactId> <version>${project.version}</version> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>admiral-common</artifactId> <version>${project.version}</version> <classifier>tests</classifier> <scope>test</scope> </dependency> <dependency> <groupId>com.vmware.admiral</groupId> <artifactId>admiral-rdbms</artifactId> <version>${project.version}</version> <classifier>tests</classifier> <scope>test</scope> </dependency> </dependencies> </project>
{ "pile_set_name": "Github" }
'use strict'; angular.module("ngLocale", [], ["$provide", function($provide) { var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"}; function getDecimals(n) { n = n + ''; var i = n.indexOf('.'); return (i == -1) ? 0 : n.length - i - 1; } function getVF(n, opt_precision) { var v = opt_precision; if (undefined === v) { v = Math.min(getDecimals(n), 3); } var base = Math.pow(10, v); var f = ((n * base) | 0) % base; return {v: v, f: f}; } $provide.value("$locale", { "DATETIME_FORMATS": { "AMPMS": [ "s\u00e1r\u00faw\u00e1", "c\u025b\u025b\u0301nko" ], "DAY": [ "s\u0254\u0301nd\u01dd", "l\u01ddnd\u00ed", "maad\u00ed", "m\u025bkr\u025bd\u00ed", "j\u01dd\u01ddd\u00ed", "j\u00famb\u00e1", "samd\u00ed" ], "ERANAMES": [ "di Y\u025b\u0301sus ak\u00e1 y\u00e1l\u025b", "c\u00e1m\u025b\u025bn k\u01dd k\u01ddb\u0254pka Y" ], "ERAS": [ "d.Y.", "k.Y." ], "FIRSTDAYOFWEEK": 0, "MONTH": [ "\u014bw\u00ed\u00ed a nt\u0254\u0301nt\u0254", "\u014bw\u00ed\u00ed ak\u01dd b\u025b\u0301\u025b", "\u014bw\u00ed\u00ed ak\u01dd r\u00e1\u00e1", "\u014bw\u00ed\u00ed ak\u01dd nin", "\u014bw\u00ed\u00ed ak\u01dd t\u00e1an", "\u014bw\u00ed\u00ed ak\u01dd t\u00e1af\u0254k", "\u014bw\u00ed\u00ed ak\u01dd t\u00e1ab\u025b\u025b", "\u014bw\u00ed\u00ed ak\u01dd t\u00e1araa", "\u014bw\u00ed\u00ed ak\u01dd t\u00e1anin", "\u014bw\u00ed\u00ed ak\u01dd nt\u025bk", "\u014bw\u00ed\u00ed ak\u01dd nt\u025bk di b\u0254\u0301k", "\u014bw\u00ed\u00ed ak\u01dd nt\u025bk di b\u025b\u0301\u025b" ], "SHORTDAY": [ "s\u0254\u0301n", "l\u01ddn", "maa", "m\u025bk", "j\u01dd\u01dd", "j\u00fam", "sam" ], "SHORTMONTH": [ "\u014b1", "\u014b2", "\u014b3", "\u014b4", "\u014b5", "\u014b6", "\u014b7", "\u014b8", "\u014b9", "\u014b10", "\u014b11", "\u014b12" ], "STANDALONEMONTH": [ "\u014bw\u00ed\u00ed a nt\u0254\u0301nt\u0254", "\u014bw\u00ed\u00ed ak\u01dd b\u025b\u0301\u025b", "\u014bw\u00ed\u00ed ak\u01dd r\u00e1\u00e1", "\u014bw\u00ed\u00ed ak\u01dd nin", "\u014bw\u00ed\u00ed ak\u01dd t\u00e1an", "\u014bw\u00ed\u00ed ak\u01dd t\u00e1af\u0254k", "\u014bw\u00ed\u00ed ak\u01dd t\u00e1ab\u025b\u025b", "\u014bw\u00ed\u00ed ak\u01dd t\u00e1araa", "\u014bw\u00ed\u00ed ak\u01dd t\u00e1anin", "\u014bw\u00ed\u00ed ak\u01dd nt\u025bk", "\u014bw\u00ed\u00ed ak\u01dd nt\u025bk di b\u0254\u0301k", "\u014bw\u00ed\u00ed ak\u01dd nt\u025bk di b\u025b\u0301\u025b" ], "WEEKENDRANGE": [ 5, 6 ], "fullDate": "EEEE d MMMM y", "longDate": "d MMMM y", "medium": "d MMM y HH:mm:ss", "mediumDate": "d MMM y", "mediumTime": "HH:mm:ss", "short": "d/M/y HH:mm", "shortDate": "d/M/y", "shortTime": "HH:mm" }, "NUMBER_FORMATS": { "CURRENCY_SYM": "FCFA", "DECIMAL_SEP": ",", "GROUP_SEP": "\u00a0", "PATTERNS": [ { "gSize": 3, "lgSize": 3, "maxFrac": 3, "minFrac": 0, "minInt": 1, "negPre": "-", "negSuf": "", "posPre": "", "posSuf": "" }, { "gSize": 3, "lgSize": 3, "maxFrac": 2, "minFrac": 2, "minInt": 1, "negPre": "-", "negSuf": "\u00a0\u00a4", "posPre": "", "posSuf": "\u00a0\u00a4" } ] }, "id": "ksf", "localeID": "ksf", "pluralCat": function(n, opt_precision) { var i = n | 0; var vf = getVF(n, opt_precision); if (i == 1 && vf.v == 0) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;} }); }]);
{ "pile_set_name": "Github" }
#define drivea_width 32 #define drivea_height 32 static unsigned char drivea_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x1f, 0x08, 0x00, 0x00, 0x18, 0xa8, 0xaa, 0xaa, 0x1a, 0x48, 0x55, 0xd5, 0x1d, 0xa8, 0xaa, 0xaa, 0x1b, 0x48, 0x55, 0x55, 0x1d, 0xa8, 0xfa, 0xaf, 0x1a, 0xc8, 0xff, 0xff, 0x1d, 0xa8, 0xfa, 0xaf, 0x1a, 0x48, 0x55, 0x55, 0x1d, 0xa8, 0xaa, 0xaa, 0x1a, 0x48, 0x55, 0x55, 0x1d, 0xa8, 0xaa, 0xaa, 0x1a, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
{ "pile_set_name": "Github" }
; RUN: opt < %s -instcombine -S | grep sub ; PR2553 define double @test(double %X) nounwind { ; fsub of self can't be optimized away. %Y = fsub double %X, %X ret double %Y }
{ "pile_set_name": "Github" }
================ Writing snippets ================ .. _Organizing Snippets: snippet-organization.html .. _Expanding Snippets: snippet-expansion.html .. _Writing Snippets: snippet-development.html .. _The YASnippet Menu: snippet-menu.html .. contents:: Snippet development =================== Quickly finding snippets ------------------------ There are some ways you can quickly find a snippet file: * ``M-x yas/new-snippet`` Prompts you for a snippet name, then tries to guess a suitable directory to store it, prompting you for creation if it does not exist. Finally, places you in a new buffer set to ``snippet-mode`` so you can write your snippet. * ``M-x yas/find-snippets`` Lets you find the snippet file in the directory the snippet was loaded from (if it exists) like ``find-file-other-window``. The directory searching logic is similar to ``M-x yas/new-snippet``. * ``M-x yas/visit-snippet-file`` Prompts you for possible snippet expansions like ``yas/insert-snippet``, but instead of expanding it, takes you directly to the snippet definition's file, if it exists. Once you find this file it will be set to ``snippet-mode`` (see ahead) and you can start editing your snippet. Using the ``snippet-mode`` major mode ------------------------------------- There is a major mode ``snippet-mode`` to edit snippets. You can set the buffer to this mode with ``M-x snippet-mode``. It provides reasonably useful syntax highlighting. Two commands are defined in this mode: * ``M-x yas/load-snippet-buffer`` When editing a snippet, this loads the snippet into the correct mode and menu. Bound to ``C-c C-c`` by default while in ``snippet-mode``. * ``M-x yas/tryout-snippet`` When editing a snippet, this opens a new empty buffer, sets it to the appropriate major mode and inserts the snippet there, so you can see what it looks like. This is bound to ``C-c C-t`` while in ``snippet-mode``. There are also *snippets for writing snippets*: ``vars``, ``$f`` and ``$m`` :-). File content ============ A file defining a snippet generally contains the template to be expanded. Optionally, if the file contains a line of ``# --``, the lines above it count as comments, some of which can be *directives* (or meta data). Snippet directives look like ``# property: value`` and tweak certain snippets properties described below. If no ``# --`` is found, the whole file is considered the snippet template. Here's a typical example: .. sourcecode:: text #contributor : pluskid <pluskid@gmail.com> #name : __...__ # -- __${init}__ Here's a list of currently supported directives: ``# key:`` snippet abbrev -------------------------- This is the probably the most important directive, it's the abbreviation you type to expand a snippet just before hitting ``yas/trigger-key``. If you don't specify this it will default to the name of the file the snippet is being loaded from, unless YASnippet is ignoring file names as triggers (see ``yas/ignore-filenames-as-triggers`` in `Organizing snippets`_), in which case this snippet will not be expandable through the key mechanism. Sometimes the key of a snippet is non-ASCII or not valid filename (e.g. contains ``/``). One can then define the ``key`` property which will overwrite the filename as the key to expand the snippet. ``# name:`` snippet name ------------------------ This is a one-line description of the snippet. It will be displayed in the menu. It's a good idea to select a descriptive name for a snippet -- especially distinguishable among similar snippets. If you omit this name it will default to the file name the snippet was loaded from. ``# condition:`` snippet condition ---------------------------------- This is a piece of Emacs-lisp code. If a snippet has a condition, then it will only be expanded when the condition code evaluate to some non-nil value. See also ``yas/buffer-local-condition`` in `Expanding snippets`_ ``# group:`` snippet menu grouping ---------------------------------- When expanding/visiting snippets from the menu-bar menu, snippets for a given mode can be grouped into sub-menus . This is useful if one has too many snippets for a mode which will make the menu too long. The ``# group:`` property only affect menu construction (See `the YASnippet menu`_) and the same effect can be achieved by grouping snippets into sub-directories and using the ``.yas-make-groups`` special file (for this see `Organizing Snippets`_ Refer to the bundled snippets for ``ruby-mode`` for examples on the ``# group:`` directive. Group can also be nested, e.g. ``control structure.loops`` tells that the snippet is under the ``loops`` group which is under the ``control structure`` group. ``# expand-env:`` expand environment ------------------------------------ This is another piece of Emacs-lisp code in the form of a ``let`` *varlist form*, i.e. a list of lists assigning values to variables. It can be used to override variable values while the snippet is being expanded. Interesting variables to override are ``yas/wrap-around-region`` and ``yas/indent-line`` (see `Expanding Snippets`_). As an example, you might normally have ``yas/indent-line`` set to ``'auto`` and ``yas/wrap-around-region`` set to ``t``, but for this particularly brilliant piece of ASCII art these values would mess up your hard work. You can then use: .. sourcecode:: text # name : ASCII home # expand-env: ((yas/indent-line 'fixed) (yas/wrap-around-region 'nil)) # -- welcome to my X humble / \ home, / \ $0 / \ /-------\ | | | +-+ | | | | | +--+-+--+ ``# binding:`` direct keybinding --------------------------------- You can use this directive to expand a snippet directly from a normal Emacs keybinding. The keybinding will be registered in the Emacs keymap named after the major mode the snippet is active for. Additionally a variable ``yas/prefix`` is set to to the prefix argument you normally use for a command. This allows for small variations on the same snippet, for example in this "html-mode" snippet. .. sourcecode:: text #name : <p>...</p> #binding: "C-c C-c C-m" # -- <p>`(when yas/prefix "\n")`$0`(when yas/prefix "\n")`</p> This binding will be recorded in the keymap ``html-mode-map``. To expand a paragraph tag newlines, just press "C-u C-c C-c C-m". Omitting the "C-u" will expand the paragraph tag without newlines. To override the keymap choice based on the major mode name. Use a cons cell where the first element specifies the name of the keymap where you want to record the keybinding. .. sourcecode:: text #name : <p>...</p> #binding: (rinari-minor-mode-map . "C-c C-c C-m") # -- <p>`(when yas/prefix "\n")`$0`(when yas/prefix "\n")`</p> **Note**: this feature is still **experimental**, it might go away, be changed in future release, and should be used with caution: It is easy to override important keybindings for many basic modes and it is hard to undefine them. For the moment, the variable ``yas/active-keybindings`` can tell you what snippet keybindings are active and the function ``yas/kill-snippet-keybindings`` will attempt to undefine all the keybindings. ``# contributor:`` snippet author --------------------------------------------------- This is optional and has no effect whatsoever on snippet functionality, but it looks nice. Template syntax =============== The syntax of the snippet template is simple but powerful, very similar to TextMate's. Plain Text ---------- Arbitrary text can be included as the content of a template. They are usually interpreted as plain text, except ``$`` and `````. You need to use ``\`` to escape them: ``\$`` and ``\```. The ``\`` itself may also needed to be escaped as ``\\`` sometimes. Embedded Emacs-lisp code ------------------------ Emacs-Lisp code can be embedded inside the template, written inside back-quotes (`````). The lisp forms are evaluated when the snippet is being expanded. The evaluation is done in the same buffer as the snippet being expanded. Here's an example for ``c-mode`` to calculate the header file guard dynamically: .. sourcecode:: text #ifndef ${1:_`(upcase (file-name-nondirectory (file-name-sans-extension (buffer-file-name))))`_H_} #define $1 $0 #endif /* $1 */ From version 0.6, snippets expansions are run with some special Emacs-lisp variables bound. One of this is ``yas/selected-text``. You can therefore define a snippet like: .. sourcecode:: text for ($1;$2;$3) { `yas/selected-text`$0 } to "wrap" the selected region inside your recently inserted snippet. Alternatively, you can also customize the variable ``yas/wrap-around-region`` to ``t`` which will do this automatically. Tab stop fields --------------- Tab stops are fields that you can navigate back and forth by ``TAB`` and ``S-TAB``. They are written by ``$`` followed with a number. ``$0`` has the special meaning of the *exit point* of a snippet. That is the last place to go when you've traveled all the fields. Here's a typical example: .. sourcecode:: text <div$1> $0 </div> Placeholder fields ------------------ Tab stops can have default values -- a.k.a placeholders. The syntax is like this: .. sourcecode:: text ${N:default value} They acts as the default value for a tab stop. But when you firstly type at a tab stop, the default value will be replaced by your typing. The number can be omitted if you don't want to create `mirrors`_ or `transformations`_ for this field. .. _mirrors: Mirrors ------- We refer the tab stops with placeholders as a *field*. A field can have mirrors. Its mirrors will get updated when you change the text of a field. Here's an example: .. sourcecode:: text \begin{${1:enumerate}} $0 \end{$1} When you type ``"document"`` at ``${1:enumerate}``, the word ``"document"`` will also be inserted at ``\end{$1}``. The best explanation is to see the screencast(`YouTube <http://www.youtube.com/watch?v=vOj7btx3ATg>`_ or `avi video <http://yasnippet.googlecode.com/files/yasnippet.avi>`_). The tab stops with the same number to the field act as its mirrors. If none of the tab stops has an initial value, the first one is selected as the field and others mirrors. .. _transformations: Mirrors with transformations ---------------------------- If the value of an ``${n:``-construct starts with and contains ``$(``, then it is interpreted as a mirror for field ``n`` with a transformation. The mirror's text content is calculated according to this transformation, which is Emacs-lisp code that gets evaluated in an environment where the variable ``text`` (or ``yas/text``) is bound to the text content (string) contained in the field ``n``.Here's an example for Objective-C: .. sourcecode:: text - (${1:id})${2:foo} { return $2; } - (void)set${2:$(capitalize text)}:($1)aValue { [$2 autorelease]; $2 = [aValue retain]; } $0 Look at ``${2:$(capitalize text)}``, it is a mirror with transformation instead of a field. The actual field is at the first line: ``${2:foo}``. When you type text in ``${2:foo}``, the transformation will be evaluated and the result will be placed there as the transformed text. So in this example, if you type "baz" in the field, the transformed text will be "Baz". This example is also available in the screencast. Another example is for ``rst-mode``. In reStructuredText, the document title can be some text surrounded by "===" below and above. The "===" should be at least as long as the text. So .. sourcecode:: text ===== Title ===== is a valid title but .. sourcecode:: text === Title === is not. Here's an snippet for rst title: .. sourcecode:: text ${1:$(make-string (string-width text) ?\=)} ${1:Title} ${1:$(make-string (string-width text) ?\=)} $0 Fields with transformations --------------------------- From version 0.6 on, you can also have lisp transformation inside fields. These work mostly mirror transformations but are evaluated when you first enter the field, after each change you make to the field and also just before you exit the field. The syntax is also a tiny bit different, so that the parser can distinguish between fields and mirrors. In the following example .. sourcecode:: text #define "${1:mydefine$(upcase yas/text)}" ``mydefine`` gets automatically upcased to ``MYDEFINE`` once you enter the field. As you type text, it gets filtered through the transformation every time. Note that to tell this kind of expression from a mirror with a transformation, YASnippet needs extra text between the ``:`` and the transformation's ``$``. If you don't want this extra-text, you can use two ``$``'s instead. .. sourcecode:: text #define "${1:$$(upcase yas/text)}" Please note that as soon as a transformation takes place, it changes the value of the field and sets it its internal modification state to ``true``. As a consequence, the auto-deletion behaviour of normal fields does not take place. This is by design. Choosing fields value from a list and other tricks -------------------------------------------------- As mentioned, the field transformation is invoked just after you enter the field, and with some useful variables bound, notably ``yas/field-modified-p`` and ``yas/moving-away-p``. Because of this feature you can place a transformation in the primary field that lets you select default values for it. The ``yas/choose-value`` does this work for you. For example: .. sourcecode:: text <div align="${2:$$(yas/choose-value '("right" "center" "left"))}"> $0 </div> See the definition of ``yas/choose-value`` to see how it was written using the two variables. Here's another use, for LaTeX-mode, which calls reftex-label just as you enter snippet field 2. This one makes use of ``yas/modified-p`` directly. .. sourcecode:: text \section{${1:"Titel der Tour"}}% \index{$1}% \label{{2:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont- insert))}}% The function ``yas/verify-value`` has another neat trick, and makes use of ``yas/moving-away-p``. Try it and see! Also, check out this `thread <http://groups.google.com/group/smart-snippet/browse_thread/thread/282a90a118e1b662>`_ Nested placeholder fields ------------------------- From version 0.6 on, you can also have nested placeholders of the type: .. sourcecode:: text <div${1: id="${2:some_id}"}>$0</div> This allows you to choose if you want to give this ``div`` an ``id`` attribute. If you tab forward after expanding it will let you change "some_id" to whatever you like. Alternatively, you can just press ``C-d`` (which executes ``yas/skip-and-clear-or-delete-char``) and go straight to the exit marker. By the way, ``C-d`` will only clear the field if you cursor is at the beginning of the field *and* it hasn't been changed yet. Otherwise, it performs the normal Emacs ``delete-char`` command. Customizable variables ====================== ``yas/trigger-key`` ------------------- The key bound to ``yas/expand`` when function ``yas/minor-mode`` is active. Value is a string that is converted to the internal Emacs key representation using ``read-kbd-macro``. Default value is ``"TAB"``. ``yas/next-field-key`` ---------------------- The key to navigate to next field when a snippet is active. Value is a string that is converted to the internal Emacs key representation using ``read-kbd-macro``. Can also be a list of keys. Default value is ``"TAB"``. ``yas/prev-field-key`` ---------------------- The key to navigate to previous field when a snippet is active. Value is a string that is converted to the internal Emacs key representation using ``read-kbd-macro``. Can also be a list of keys. Default value is ``("<backtab>" "<S-tab>)"``. ``yas/skip-and-clear-key`` -------------------------- The key to clear the currently active field. Value is a string that is converted to the internal Emacs key representation using ``read-kbd-macro``. Can also be a list of keys. Default value is ``"C-d"``. ``yas/good-grace`` ------------------ If non-nil, don't raise errors in inline Emacs-lisp evaluation inside snippet definitions. An error string "[yas] error" is returned instead. ``yas/indent-line`` ------------------- The variable ``yas/indent-line`` controls the indenting. It is bound to ``'auto`` by default, which causes your snippet to be indented according to the mode of the buffer it was inserted in. Another variable ``yas/also-auto-indent-first-line``, when non-nil does exactly that :-). To use the hard-coded indentation in your snippet template, set this variable to ``fixed``. To control indentation on a per-snippet basis, see also the directive ``# expand-env:`` in `Writing Snippets`_. For backward compatibility with earlier versions of YASnippet, you can also place a ``$>`` in your snippet, an ``(indent-according-to-mode)`` will be executed there to indent the line. This only takes effect when ``yas/indent-line`` is set to something other than ``'auto``. .. sourcecode:: text for (${int i = 0}; ${i < 10}; ${++i}) {$> $0$> }$> ``yas/wrap-around-region`` -------------------------- If non-nil, YASnippet will try to expand the snippet's exit marker around the currently selected region. When this variable is set to t, this has the same effect has using the ```yas/selected-text``` inline evaluation. Because on most systems starting to type deletes the currently selected region, this works mostly for snippets with direct keybindings or with the ``yas/insert-snippet`` command. However, when the value is of this variable is ``cua`` YASnippet will additionally look-up any recently selected that you deleted by starting typing. This allows you select a region, type a snippet key (deleting the region), then press ``yas/trigger-key`` to see the deleted region spring back to life inside your new snippet. ``yas/triggers-in-field`` -------------------------- If non-nil, ``yas/next-field-key`` can trigger stacked expansions, that is a snippet expansion inside another snippet expansion. Otherwise, ``yas/next-field-key`` just tries to move on to the next field. ``yas/snippet-revival`` ----------------------- Non-nil means re-activate snippet fields after undo/redo. ``yas/after-exit-snippet-hook`` and ``yas/before-expand-snippet-hook`` ---------------------------------------------------------------------- These hooks are called, respectively, before the insertion of a snippet and after exiting the snippet. If you find any strange but functional use for them, that's probably a design flaw in YASnippet, so let us know. Importing TextMate snippets =========================== There are a couple of tools that take TextMate's ".tmSnippet" xml files and create YASnippet definitions: * `a python script by Jeff Wheeler <http://code.nokrev.com/?p=snippet-copier.git;a=blob_plain;f=snippet_copier.py>`_ * a `ruby tool <http://yasnippet.googlecode.com/svn/trunk/extras/textmate_import.rb>`_ , ``textmate_import.rb`` adapted from `Rob Christie's <http://www.neutronflux.net/2009/07/28/shoulda-snippets-for-emacs/>`_, which I have uploaded to the repository. In this section, i'll shortly cover the **second** option. Download the ``textmate_import.rb`` tool and the TextMate bundle you're interested in. .. sourcecode:: text $ curl -O http://yasnippet.googlecode.com/svn/trunk/extras/textmate_import.rb $ svn export http://svn.textmate.org/trunk/Bundles/HTML.tmbundle/ Then invoke ``textmate_import.rb`` like this: .. sourcecode:: text $ ./textmate_import.rb -d HTML.tmbundle/Snippets/ -o html-mode -g HTML.tmbundle/info.plist You should end up with a ``html-mode`` subdir containing snippets exported from textmate. .. sourcecode:: text $ tree html-mode # to view dir contents, if you have 'tree' installed The ``-g`` is optional but helps the tool figure out the grouping. According to `Organizing Snippets`_, don't forget to touch ``.yas-make-groups`` and ``.yas-ignore-filename-triggers`` inside the ``html-mode`` dir. Also try ``textmate_import.rb --help`` for a list of options. Please note that snippet importation is not yet perfect. You'll probably have some adjustments to some/many snippets. Please contribute these adjustments to the google group or, better yet, patch the ``textmate_import.rb`` to automatically perform them and submit that. .. LocalWords: html YASnippet yas sourcecode pluskid init filenames filename .. LocalWords: env varlist keybinding keymap rinari ifndef upcase endif .. LocalWords: nondirectory autorelease aValue inline
{ "pile_set_name": "Github" }
// This file is part of libigl, a simple c++ geometry processing library. // // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com> // // This Source Code Form is subject to the terms of the Mozilla Public License // v. 2.0. If a copy of the MPL was not distributed with this file, You can // obtain one at http://mozilla.org/MPL/2.0/. #ifndef IGL_ACTIVE_SET_H #define IGL_ACTIVE_SET_H #include "igl_inline.h" #include "SolverStatus.h" #include <Eigen/Core> #include <Eigen/Sparse> namespace igl { struct active_set_params; // Known Bugs: rows of [Aeq;Aieq] **must** be linearly independent. Should be // using QR decomposition otherwise: // http://www.okstate.edu/sas/v8/sashtml/ormp/chap5/sect32.htm // // ACTIVE_SET Minimize quadratic energy // // 0.5*Z'*A*Z + Z'*B + C with constraints // // that Z(known) = Y, optionally also subject to the constraints Aeq*Z = Beq, // and further optionally subject to the linear inequality constraints that // Aieq*Z <= Bieq and constant inequality constraints lx <= x <= ux // // Inputs: // A n by n matrix of quadratic coefficients // B n by 1 column of linear coefficients // known list of indices to known rows in Z // Y list of fixed values corresponding to known rows in Z // Aeq meq by n list of linear equality constraint coefficients // Beq meq by 1 list of linear equality constraint constant values // Aieq mieq by n list of linear inequality constraint coefficients // Bieq mieq by 1 list of linear inequality constraint constant values // lx n by 1 list of lower bounds [] implies -Inf // ux n by 1 list of upper bounds [] implies Inf // params struct of additional parameters (see below) // Z if not empty, is taken to be an n by 1 list of initial guess values // (see output) // Outputs: // Z n by 1 list of solution values // Returns true on success, false on error // // Benchmark: For a harmonic solve on a mesh with 325K facets, matlab 2.2 // secs, igl/min_quad_with_fixed.h 7.1 secs // template < typename AT, typename DerivedB, typename Derivedknown, typename DerivedY, typename AeqT, typename DerivedBeq, typename AieqT, typename DerivedBieq, typename Derivedlx, typename Derivedux, typename DerivedZ > IGL_INLINE igl::SolverStatus active_set( const Eigen::SparseMatrix<AT>& A, const Eigen::PlainObjectBase<DerivedB> & B, const Eigen::PlainObjectBase<Derivedknown> & known, const Eigen::PlainObjectBase<DerivedY> & Y, const Eigen::SparseMatrix<AeqT>& Aeq, const Eigen::PlainObjectBase<DerivedBeq> & Beq, const Eigen::SparseMatrix<AieqT>& Aieq, const Eigen::PlainObjectBase<DerivedBieq> & Bieq, const Eigen::PlainObjectBase<Derivedlx> & lx, const Eigen::PlainObjectBase<Derivedux> & ux, const igl::active_set_params & params, Eigen::PlainObjectBase<DerivedZ> & Z ); }; #include "EPS.h" struct igl::active_set_params { // Input parameters for active_set: // Auu_pd whether Auu is positive definite {false} // max_iter Maximum number of iterations (0 = Infinity, {100}) // inactive_threshold Threshold on Lagrange multiplier values to determine // whether to keep constraints active {EPS} // constraint_threshold Threshold on whether constraints are violated (0 // is perfect) {EPS} // solution_diff_threshold Threshold on the squared norm of the difference // between two consecutive solutions {EPS} bool Auu_pd; int max_iter; double inactive_threshold; double constraint_threshold; double solution_diff_threshold; active_set_params(): Auu_pd(false), max_iter(100), inactive_threshold(igl::DOUBLE_EPS), constraint_threshold(igl::DOUBLE_EPS), solution_diff_threshold(igl::DOUBLE_EPS) {}; }; #ifndef IGL_STATIC_LIBRARY # include "active_set.cpp" #endif #endif
{ "pile_set_name": "Github" }
#ifndef BOOST_METAPARSE_V1_GRAMMAR_HPP #define BOOST_METAPARSE_V1_GRAMMAR_HPP // Copyright Abel Sinkovics (abel@sinkovics.hu) 2012. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include <boost/metaparse/v1/repeated.hpp> #include <boost/metaparse/v1/repeated1.hpp> #include <boost/metaparse/v1/sequence.hpp> #include <boost/metaparse/v1/one_of.hpp> #include <boost/metaparse/v1/transform.hpp> #include <boost/metaparse/v1/lit.hpp> #include <boost/metaparse/v1/lit_c.hpp> #include <boost/metaparse/v1/token.hpp> #include <boost/metaparse/v1/keyword.hpp> #include <boost/metaparse/v1/middle_of.hpp> #include <boost/metaparse/v1/last_of.hpp> #include <boost/metaparse/v1/always.hpp> #include <boost/metaparse/v1/one_char_except_c.hpp> #include <boost/metaparse/v1/foldr1.hpp> #include <boost/metaparse/v1/foldl_start_with_parser.hpp> #include <boost/metaparse/v1/alphanum.hpp> #include <boost/metaparse/v1/build_parser.hpp> #include <boost/metaparse/v1/entire_input.hpp> #include <boost/metaparse/v1/string.hpp> #include <boost/metaparse/v1/impl/front_inserter.hpp> #include <boost/mpl/at.hpp> #include <boost/mpl/map.hpp> #include <boost/mpl/eval_if.hpp> #include <boost/mpl/has_key.hpp> #include <boost/mpl/lambda.hpp> #include <boost/mpl/front.hpp> #include <boost/mpl/back.hpp> #include <boost/mpl/pair.hpp> #include <boost/mpl/insert.hpp> /* * The grammar * * rule_definition ::= name_token define_token expression * expression ::= seq_expression (or_token seq_expression)* * seq_expression ::= repeated_expression+ * repeated_expression ::= name_expression (repeated_token | repeated1_token)* * name_expression ::= char_token | name_token | bracket_expression * bracket_expression ::= open_bracket_token expression close_bracket_token */ namespace boost { namespace metaparse { namespace v1 { namespace grammar_util { template <char Op, class FState> struct repeated_apply_impl { typedef repeated_apply_impl type; template <class G> struct apply : repeated<typename FState::template apply<G>::type> {}; }; template <class FState> struct repeated_apply_impl<'+', FState> { typedef repeated_apply_impl type; template <class G> struct apply : repeated1<typename FState::template apply<G>::type> {}; }; struct build_repeated { typedef build_repeated type; template <class FState, class T> struct apply : repeated_apply_impl<T::type::value, FState> {}; }; struct build_sequence { typedef build_sequence type; template <class FState, class FP> struct apply_impl { typedef apply_impl type; template <class G> struct apply : sequence< typename FState::template apply<G>::type, typename FP::template apply<G>::type > {}; }; template <class FState, class FP> struct apply : apply_impl<FState, FP> {}; }; struct build_selection { typedef build_selection type; template <class FState, class FP> struct apply_impl { typedef apply_impl type; template <class G> struct apply : one_of< typename FState::template apply<G>::type, typename FP::template apply<G>::type > {}; }; template <class FState, class FP> struct apply : apply_impl<FState, FP> {}; }; template <class G, class Name> struct get_parser { typedef typename boost::mpl::at<typename G::rules, Name>::type ::template apply<G> p; template <class Actions> struct impl : transform<typename p::type, typename Actions::type> {}; typedef typename boost::mpl::eval_if< typename boost::mpl::has_key<typename G::actions, Name>::type, impl<boost::mpl::at<typename G::actions, Name> >, p >::type type; }; struct build_name { typedef build_name type; template <class Name> struct apply_impl { typedef apply_impl type; template <class G> struct apply : get_parser<G, Name> {}; }; template <class Name> struct apply : apply_impl<Name> {}; }; struct build_char { typedef build_char type; template <class C> struct apply_impl { typedef apply_impl type; template <class G> struct apply : lit<C> {}; }; template <class C> struct apply : apply_impl<C> {}; }; typedef token<lit_c<'*'> > repeated_token; typedef token<lit_c<'+'> > repeated1_token; typedef token<lit_c<'|'> > or_token; typedef token<lit_c<'('> > open_bracket_token; typedef token<lit_c<')'> > close_bracket_token; typedef token<keyword<string<':',':','='> > > define_token; typedef middle_of< lit_c<'\''>, one_of< last_of< lit_c<'\\'>, one_of< always<lit_c<'n'>, boost::mpl::char_<'\n'> >, always<lit_c<'r'>, boost::mpl::char_<'\r'> >, always<lit_c<'t'>, boost::mpl::char_<'\t'> >, lit_c<'\\'>, lit_c<'\''> > >, one_char_except_c<'\''> >, token<lit_c<'\''> > > char_token; typedef token< foldr1< one_of<alphanum, lit_c<'_'> >, string<>, impl::front_inserter > > name_token; struct expression; typedef middle_of<open_bracket_token, expression, close_bracket_token> bracket_expression; typedef one_of< transform<char_token, build_char>, transform<name_token, build_name>, bracket_expression > name_expression; typedef foldl_start_with_parser< one_of<repeated_token, repeated1_token>, name_expression, build_repeated > repeated_expression; typedef foldl_start_with_parser< repeated_expression, repeated_expression, build_sequence > seq_expression; struct expression : foldl_start_with_parser< last_of<or_token, seq_expression>, seq_expression, build_selection > {}; typedef sequence<name_token, define_token, expression> rule_definition; typedef build_parser<entire_input<rule_definition> > parser_parser; template <class P> struct build_native_parser { typedef build_native_parser type; template <class G> struct apply { typedef P type; }; }; template <class S> struct build_parsed_parser { typedef typename parser_parser::apply<S>::type p; typedef typename boost::mpl::front<p>::type name; typedef typename boost::mpl::back<p>::type exp; struct the_parser { typedef the_parser type; template <class G> struct apply : exp::template apply<G> {}; }; typedef boost::mpl::pair<name, the_parser> type; }; typedef build_parser<name_token> name_parser; template <class S> struct rebuild : name_parser::template apply<S> {}; struct no_action; template <class G, class P, class F> struct add_rule; template <class G, class Name, class P> struct add_import; template <class Start, class Rules, class Actions> struct grammar_builder { typedef grammar_builder type; typedef Rules rules; typedef Actions actions; // Make it a parser template <class S, class Pos> struct apply : get_parser< grammar_builder, typename rebuild<Start>::type >::type::template apply<S, Pos> {}; template <class Name, class P> struct import : add_import<grammar_builder, typename rebuild<Name>::type, P> {}; template <class Def, class Action = no_action> struct rule : add_rule<grammar_builder, build_parsed_parser<Def>, Action> {}; }; template <class Start, class Rules, class Actions, class P> struct add_rule<grammar_builder<Start, Rules, Actions>, P, no_action> : grammar_builder< Start, typename boost::mpl::insert<Rules, typename P::type>::type, Actions > {}; template <class Start, class Rules, class Actions, class P, class F> struct add_rule<grammar_builder<Start, Rules, Actions>, P, F> : grammar_builder< Start, typename boost::mpl::insert<Rules, typename P::type>::type, typename boost::mpl::insert< Actions, boost::mpl::pair< typename P::name, typename boost::mpl::lambda<F>::type > > ::type > {}; template <class Start, class Rules, class Actions, class Name, class P> struct add_import<grammar_builder<Start, Rules, Actions>, Name, P> : grammar_builder< Start, typename boost::mpl::insert< Rules, boost::mpl::pair<Name, build_native_parser<P> > >::type, Actions > {}; } template <class Start = string<'S'> > struct grammar : grammar_util::grammar_builder< Start, boost::mpl::map<>, boost::mpl::map<> > {}; } } } #endif
{ "pile_set_name": "Github" }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Threading.Tasks; using Microsoft.AspNetCore.Analyzer.Testing; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.Diagnostics; namespace Microsoft.DotNet.Analyzers.Async.Tests { public class AsyncDiagnosticRunner : DiagnosticAnalyzerRunner { public AsyncDiagnosticRunner(DiagnosticAnalyzer analyzer) { Analyzer = analyzer; } public DiagnosticAnalyzer Analyzer { get; } public Task<Diagnostic[]> GetDiagnosticsAsync(string source, string[] additionalEnabledDiagnostics) { return GetDiagnosticsAsync(sources: new[] { source }, Analyzer, additionalEnabledDiagnostics); } } }
{ "pile_set_name": "Github" }
version https://git-lfs.github.com/spec/v1 oid sha256:31dfc722c4836b9ce8555e28d2eaca2d76f8f68d2310274cb47ac0304404c543 size 7837
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <Scheme version = "1.3"> <BuildAction parallelizeBuildables = "YES" buildImplicitDependencies = "YES"> <BuildActionEntries> <BuildActionEntry buildForTesting = "YES" buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES" buildForAnalyzing = "YES"> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "1488137A14209C98004BCE14" BuildableName = "CoreARUnitTest" BlueprintName = "CoreARUnitTest" ReferencedContainer = "container:CoreARUnitTest.xcodeproj"> </BuildableReference> </BuildActionEntry> </BuildActionEntries> </BuildAction> <TestAction selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB" shouldUseLaunchSchemeArgsEnv = "YES" buildConfiguration = "Debug"> <Testables> </Testables> <MacroExpansion> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "1488137A14209C98004BCE14" BuildableName = "CoreARUnitTest" BlueprintName = "CoreARUnitTest" ReferencedContainer = "container:CoreARUnitTest.xcodeproj"> </BuildableReference> </MacroExpansion> </TestAction> <LaunchAction selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB" launchStyle = "0" useCustomWorkingDirectory = "NO" buildConfiguration = "Debug" debugDocumentVersioning = "YES" allowLocationSimulation = "YES"> <BuildableProductRunnable> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "1488137A14209C98004BCE14" BuildableName = "CoreARUnitTest" BlueprintName = "CoreARUnitTest" ReferencedContainer = "container:CoreARUnitTest.xcodeproj"> </BuildableReference> </BuildableProductRunnable> <AdditionalOptions> </AdditionalOptions> </LaunchAction> <ProfileAction shouldUseLaunchSchemeArgsEnv = "YES" savedToolIdentifier = "" useCustomWorkingDirectory = "NO" buildConfiguration = "Release" debugDocumentVersioning = "YES"> <BuildableProductRunnable> <BuildableReference BuildableIdentifier = "primary" BlueprintIdentifier = "1488137A14209C98004BCE14" BuildableName = "CoreARUnitTest" BlueprintName = "CoreARUnitTest" ReferencedContainer = "container:CoreARUnitTest.xcodeproj"> </BuildableReference> </BuildableProductRunnable> </ProfileAction> <AnalyzeAction buildConfiguration = "Debug"> </AnalyzeAction> <ArchiveAction buildConfiguration = "Release" revealArchiveInOrganizer = "YES"> </ArchiveAction> </Scheme>
{ "pile_set_name": "Github" }
// CS1061: Type `object' does not contain a definition for `Foo' and no extension method `Foo' of type `object' could be found. Are you missing an assembly reference? // Line: 12 using System.Collections.Generic; public class C { void M (IEnumerable<KeyValuePair<string, dynamic>> arg) { foreach (KeyValuePair<string, object> o in arg) { o.Value.Foo (); } } }
{ "pile_set_name": "Github" }
// ************************************************************************ // ***************************** CEF4Delphi ******************************* // ************************************************************************ // // CEF4Delphi is based on DCEF3 which uses CEF3 to embed a chromium-based // browser in Delphi applications. // // The original license of DCEF3 still applies to CEF4Delphi. // // For more information about CEF4Delphi visit : // https://www.briskbard.com/index.php?lang=en&pageid=cef // // Copyright © 2018 Salvador Díaz Fau. All rights reserved. // // ************************************************************************ // ************ vvvv Original license and comments below vvvv ************* // ************************************************************************ (* * Delphi Chromium Embedded 3 * * Usage allowed under the restrictions of the Lesser GNU General Public License * or alternatively the restrictions of the Mozilla Public License 1.1 * * 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. * * Unit owner : Henri Gourvest <hgourvest@gmail.com> * Web site : http://www.progdigy.com * Repository : http://code.google.com/p/delphichromiumembedded/ * Group : http://groups.google.com/group/delphichromiumembedded * * Embarcadero Technologies, Inc is not permitted to use or redistribute * this source code without explicit permission. * *) program JSExtensionWithFunction; {$MODE Delphi} {$I cef.inc} uses {$IFDEF DELPHI16_UP} Vcl.Forms, WinApi.Windows, {$ELSE} Forms, LCLIntf, LCLType, LMessages, Interfaces, {$ENDIF } uCEFApplication, uJSExtensionWithFunction in 'uJSExtensionWithFunction.pas' {JSExtensionWithFunctionFrm}, uMyV8Handler in 'uMyV8Handler.pas'; {.$R *.res} // CEF3 needs to set the LARGEADDRESSAWARE flag which allows 32-bit processes to use up to 3GB of RAM. {$SetPEFlags $20} begin // GlobalCEFApp creation and initialization moved to a different unit to fix the memory leak described in the bug #89 // https://github.com/salvadordf/CEF4Delphi/issues/89 CreateGlobalCEFApp; if GlobalCEFApp.StartMainProcess then begin Application.Initialize; {$IFDEF DELPHI11_UP} Application.MainFormOnTaskbar := True; {$ENDIF} Application.CreateForm(TJSExtensionWithFunctionFrm, JSExtensionWithFunctionFrm); Application.Run; end; DestroyGlobalCEFApp; end.
{ "pile_set_name": "Github" }
/* GIMP - The GNU Image Manipulation Program * Copyright (C) 1995 Spencer Kimball and Peter Mattis * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ #ifndef __GIMP_DISPLAY_SHELL_CLOSE_H__ #define __GIMP_DISPLAY_SHELL_CLOSE_H__ void gimp_display_shell_close (GimpDisplayShell *shell, gboolean kill_it); #endif /* __GIMP_DISPLAY_SHELL_CLOSE_H__ */
{ "pile_set_name": "Github" }
/* * Copyright © 2013 Canonical Ltd. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 or 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Authored by: Alan Griffiths <alan@octopull.co.uk> */ #include "src/server/report/logging/message_processor_report.h" #include "mir/logging/logger.h" #include "mir/test/fake_shared.h" #include <gtest/gtest.h> #include <gmock/gmock.h> using namespace testing; namespace ml = mir::logging; namespace mrl = mir::report::logging; namespace { class MockClock : public mir::time::Clock { public: MOCK_CONST_METHOD0(now, mir::time::Timestamp()); MOCK_CONST_METHOD1(min_wait_until, mir::time::Duration(mir::time::Timestamp)); ~MockClock() noexcept(true) {} }; class MockLogger : public ml::Logger { public: MOCK_METHOD3(log, void(ml::Severity severity, const std::string& message, const std::string& component)); ~MockLogger() noexcept(true) {} }; struct MessageProcessorReport : public Test { MockLogger logger; MockClock clock; mir::report::logging::MessageProcessorReport report; MessageProcessorReport() : report(mir::test::fake_shared(logger), mir::test::fake_shared(clock)) { EXPECT_CALL(logger, log( ml::Severity::debug, _, "frontend::MessageProcessor")).Times(AnyNumber()); } }; } TEST_F(MessageProcessorReport, everything_fine) { mir::time::Timestamp a_time; EXPECT_CALL(clock, now()).Times(2).WillRepeatedly(Return(a_time)); EXPECT_CALL(logger, log( ml::Severity::informational, EndsWith(": a_function(), elapsed=0µs"), "frontend::MessageProcessor")).Times(1); report.received_invocation(this, 1, "a_function"); report.completed_invocation(this, 1, true); } TEST_F(MessageProcessorReport, slow_call) { mir::time::Timestamp a_time; mir::time::Timestamp another_time = a_time + std::chrono::microseconds(1234); EXPECT_CALL(clock, now()).Times(2) .WillOnce(Return(a_time)).WillOnce(Return(another_time)); EXPECT_CALL(logger, log( ml::Severity::informational, EndsWith("elapsed=1234µs"), "frontend::MessageProcessor")).Times(1); report.received_invocation(this, 1, __PRETTY_FUNCTION__); report.completed_invocation(this, 1, true); } TEST_F(MessageProcessorReport, reports_disconnect) { mir::time::Timestamp a_time; EXPECT_CALL(clock, now()).Times(2).WillRepeatedly(Return(a_time)); EXPECT_CALL(logger, log( ml::Severity::informational, HasSubstr("(disconnecting)"), "frontend::MessageProcessor")).Times(1); report.received_invocation(this, 1, __PRETTY_FUNCTION__); report.completed_invocation(this, 1, false); } TEST_F(MessageProcessorReport, reports_error_during_call) { const char* testError = "***Test error***"; mir::time::Timestamp a_time; EXPECT_CALL(clock, now()).Times(2).WillRepeatedly(Return(a_time)); EXPECT_CALL(logger, log( ml::Severity::informational, HasSubstr(testError), "frontend::MessageProcessor")).Times(1); report.received_invocation(this, 1, __PRETTY_FUNCTION__); report.exception_handled(this, 1, std::runtime_error(testError)); report.completed_invocation(this, 1, false); } TEST_F(MessageProcessorReport, reports_unknown_method) { EXPECT_CALL(clock, now()).Times(0); EXPECT_CALL(logger, log( ml::Severity::warning, HasSubstr("UNKNOWN method=\"unknown_function_name\""), "frontend::MessageProcessor")).Times(1); report.unknown_method(this, 1, "unknown_function_name"); } TEST_F(MessageProcessorReport, reports_error_deserializing_call) { const char* testError = "***Test error***"; EXPECT_CALL(logger, log( ml::Severity::informational, HasSubstr(testError), "frontend::MessageProcessor")).Times(1); report.exception_handled(this, std::runtime_error(testError)); } TEST_F(MessageProcessorReport, logs_a_debug_message_when_invocation_starts) { mir::time::Timestamp a_time; EXPECT_CALL(clock, now()).Times(AnyNumber()).WillRepeatedly(Return(a_time)); EXPECT_CALL(logger, log( ml::Severity::informational, HasSubstr("Calls outstanding on exit:"), "frontend::MessageProcessor")).Times(AnyNumber()); EXPECT_CALL(logger, log( ml::Severity::debug, _, "frontend::MessageProcessor")).Times(1); report.received_invocation(this, 1, __PRETTY_FUNCTION__); } TEST_F(MessageProcessorReport, logs_incomplete_calls_on_destruction) { mir::time::Timestamp a_time; EXPECT_CALL(clock, now()).Times(AnyNumber()).WillRepeatedly(Return(a_time)); EXPECT_CALL(logger, log( ml::Severity::informational, HasSubstr("Calls outstanding on exit:"), "frontend::MessageProcessor")).Times(1); report.received_invocation(this, 1, __PRETTY_FUNCTION__); }
{ "pile_set_name": "Github" }
# Ruby Cocoa Graphics is a graphics library providing a simple object-oriented # interface into the power of Mac OS X's Core Graphics and Core Image drawing libraries. # With a few lines of easy-to-read code, you can write scripts to draw simple or complex # shapes, lines, and patterns, process and filter images, create abstract art or visualize # scientific data, and much more. # # Inspiration for this project was derived from Processing and NodeBox. These excellent # graphics programming environments are more full-featured than RCG, but they are implemented # in Java and Python, respectively. RCG was created to offer similar functionality using # the Ruby programming language. # # Author:: James Reynolds (mailto:drtoast@drtoast.com) # Copyright:: Copyright (c) 2008 James Reynolds # License:: Distributes under the same terms as Ruby module HotCocoa::Graphics # wandering particle with brownian motion class Particle attr_accessor :acceleration, :points, :stroke, :velocity_x, :velocity_y, :x, :y # initialize particle origin x,y coordinates (relative to the center) def initialize (x, y, velocity_x=0.0, velocity_y=2.0) @age = 0 @acceleration = 0.5 @x = x @y = y @previous_x = 0 @previous_y = 0 # initialize velocity @velocity_x=velocity_x @velocity_y=velocity_y # append the point to the array @points = [NSPoint.new(@x, @y)] @stroke = Color.white end # move to a new position using brownian motion def move # save old x,y position @previous_x=@x @previous_y=@y # move particle by velocity_x,velocity_y @x += @velocity_x @y += @velocity_y # randomly increase/decrease direction @velocity_x += random(-1.0, 1.0) * @acceleration @velocity_y += random(-1.0, 1.0) * @acceleration # draw a line from the old position to the new #CANVAS.line(@previous_x,@previous_y,@x,@y); @points.push(NSPoint.new(@x, @y)) # grow old @age += 1 if @age>200 # die and be reborn end end def draw(canvas) canvas.nofill canvas.lines(@points) end end end
{ "pile_set_name": "Github" }
(defproject enfocus "0.1.0-SNAPSHOT" :description "DOM manipulation tool for clojurescript inspired by Enlive" :dependencies [[ring "1.0.0-RC1"]] :dev-dependencies [[lein-eclipse "1.0.0"]])
{ "pile_set_name": "Github" }
DE:Scheußliche Straße US:Horrid Highway
{ "pile_set_name": "Github" }
#pragma once #include <Common/Base/hkBase.h> #include "hkbModifier_0.h" #include "hkbHandle_1.h" #include "hkbSenseHandleModifierRange_0.h" class hkbSenseHandleModifier : public hkbModifier { public: HK_DECLARE_CLASS_ALLOCATOR( HK_MEMORY_CLASS_BEHAVIOR_RUNTIME ); HK_DECLARE_REFLECTION(); public: HK_FORCE_INLINE hkbSenseHandleModifier(void) {} HK_FORCE_INLINE hkbSenseHandleModifier( hkFinishLoadedObjectFlag flag ) : hkbModifier(flag) , m_ranges(flag) , m_handleOut(flag) , m_handleIn(flag) , m_localFrameName(flag) , m_sensorLocalFrameName(flag) {} enum SensingMode { SENSE_IN_NEARBY_RIGID_BODIES = 0, SENSE_IN_RIGID_BODIES_OUTSIDE_THIS_CHARACTER = 1, SENSE_IN_OTHER_CHARACTER_RIGID_BODIES = 2, SENSE_IN_THIS_CHARACTER_RIGID_BODIES = 3, SENSE_IN_GIVEN_CHARACTER_RIGID_BODIES = 4, SENSE_IN_GIVEN_RIGID_BODY = 5, SENSE_IN_OTHER_CHARACTER_SKELETON = 6, SENSE_IN_THIS_CHARACTER_SKELETON = 7, SENSE_IN_GIVEN_CHARACTER_SKELETON = 8, SENSE_IN_GIVEN_LOCAL_FRAME_GROUP = 9, }; // Properties hkbHandle m_handle; hkVector4 m_sensorLocalOffset; hkArray<hkbSenseHandleModifierRange> m_ranges; hkRefPtr<hkbHandle> m_handleOut; hkRefPtr<hkbHandle> m_handleIn; hkStringPtr m_localFrameName; hkStringPtr m_sensorLocalFrameName; hkReal m_minDistance; hkReal m_maxDistance; hkReal m_distanceOut; hkUint32 m_collisionFilterInfo; hkInt16 m_sensorRagdollBoneIndex; hkInt16 m_sensorAnimationBoneIndex; hkEnum<SensingMode,hkInt8> m_sensingMode; hkBool m_extrapolateSensorPosition; hkBool m_keepFirstSensedHandle; hkBool m_foundHandleOut; hkReal m_timeSinceLastModify; hkInt32 m_rangeIndexForEventToSendNextUpdate; }; extern const hkClass hkbSenseHandleModifierClass;
{ "pile_set_name": "Github" }
/* Copyright The containerd 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 plugins import ( "fmt" "os" "sort" "strings" "text/tabwriter" "github.com/containerd/containerd/api/types" "github.com/containerd/containerd/cmd/ctr/commands" "github.com/containerd/containerd/platforms" v1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/urfave/cli" "google.golang.org/grpc/codes" ) // Command is a cli command that outputs plugin information var Command = cli.Command{ Name: "plugins", Aliases: []string{"plugin"}, Usage: "provides information about containerd plugins", Subcommands: []cli.Command{ listCommand, }, } var listCommand = cli.Command{ Name: "list", Aliases: []string{"ls"}, Usage: "lists containerd plugins", Flags: []cli.Flag{ cli.BoolFlag{ Name: "quiet,q", Usage: "print only the plugin ids", }, cli.BoolFlag{ Name: "detailed,d", Usage: "print detailed information about each plugin", }, }, Action: func(context *cli.Context) error { var ( quiet = context.Bool("quiet") detailed = context.Bool("detailed") ) client, ctx, cancel, err := commands.NewClient(context) if err != nil { return err } defer cancel() ps := client.IntrospectionService() response, err := ps.Plugins(ctx, context.Args()) if err != nil { return err } if quiet { for _, plugin := range response.Plugins { fmt.Println(plugin.ID) } return nil } w := tabwriter.NewWriter(os.Stdout, 4, 8, 4, ' ', 0) if detailed { first := true for _, plugin := range response.Plugins { if !first { fmt.Fprintln(w, "\t\t\t") } first = false fmt.Fprintln(w, "Type:\t", plugin.Type) fmt.Fprintln(w, "ID:\t", plugin.ID) if len(plugin.Requires) > 0 { fmt.Fprintln(w, "Requires:\t") for _, r := range plugin.Requires { fmt.Fprintln(w, "\t", r) } } if len(plugin.Platforms) > 0 { fmt.Fprintln(w, "Platforms:\t", prettyPlatforms(plugin.Platforms)) } if len(plugin.Exports) > 0 { fmt.Fprintln(w, "Exports:\t") for k, v := range plugin.Exports { fmt.Fprintln(w, "\t", k, "\t", v) } } if len(plugin.Capabilities) > 0 { fmt.Fprintln(w, "Capabilities:\t", strings.Join(plugin.Capabilities, ",")) } if plugin.InitErr != nil { fmt.Fprintln(w, "Error:\t") fmt.Fprintln(w, "\t Code:\t", codes.Code(plugin.InitErr.Code)) fmt.Fprintln(w, "\t Message:\t", plugin.InitErr.Message) } } return w.Flush() } fmt.Fprintln(w, "TYPE\tID\tPLATFORMS\tSTATUS\t") for _, plugin := range response.Plugins { status := "ok" if plugin.InitErr != nil { status = "error" } var platformColumn = "-" if len(plugin.Platforms) > 0 { platformColumn = prettyPlatforms(plugin.Platforms) } if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t\n", plugin.Type, plugin.ID, platformColumn, status, ); err != nil { return err } } return w.Flush() }, } func prettyPlatforms(pspb []types.Platform) string { psm := map[string]struct{}{} for _, p := range pspb { psm[platforms.Format(v1.Platform{ OS: p.OS, Architecture: p.Architecture, Variant: p.Variant, })] = struct{}{} } var ps []string for p := range psm { ps = append(ps, p) } sort.Stable(sort.StringSlice(ps)) return strings.Join(ps, ",") }
{ "pile_set_name": "Github" }
[![Build status](https://badge.buildkite.com/5645abfe1411086f06a4d8cee1e3bbbbba9fb9318738f1fdb1.svg?branch=master)](https://buildkite.com/input-output-hk/iohk-ops) Collection of tooling and automation to deploy IOHK infrastructure. ### Structure - `deployments` - includes all NixOps deployments controlled via `.hs` scripts - `modules` - NixOS modules - `lib.nix` - wraps upstream `<nixpkgs/lib.nix>` with our common functions - `scripts` - has bash scripts not converted to Haskell/Turtle into Cardano.hs yet - `default.nix` - is a collection of Haskell packages - `static` includes files using in deployments - `jobsets` is used by Hydra CI - `terraform` - other AWS infrastructure - `nix-darwin` - deployment script and configurations for MacOS X machines ### Getting SSH access 1. Fork https://github.com/input-output-hk/iohk-ops 2. Check out the `master` branch 3. Add your username and SSH public key to the appropriate developer section of [`lib/ssh-keys.nix`](./lib/ssh-keys.nix). Keys should remain sorted alphabetically by username. 4. Submit a PR against `master` and let DevOps know. 5. Wait until the DevOps team deploys the infrastructure cluster. ## The `io` command Sources for the `iohk-ops` tool are in the [`iohk`](./iohk) directory. ### Usage After cloning this repo, start a `nix-shell`. % nix-shell [nix-shell:~/iohk/iohk-ops]$ io --help For more documentation, see [`docs/iohk-ops-reference.md`](./docs/iohk-ops-reference.md). ### Development To hack on the `iohk-ops` tool, use % nix-shell -A ioSelfBuild [nix-shell:~/iohk/iohk-ops]$ type io io is a function io () { cabal exec iohk-ops -- "$@" } [nix-shell:~/iohk/iohk-ops]$ io --help This will provide a Haskell environment where you can use `io` to run the script or `ghci` for development: [nix-shell:~/iohk/iohk-ops]$ ghci -iiohk/common GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rodney/config/.ghc/ghci.conf λ> :l iohk/iohk-ops.hs ### Run from anywhere $(nix-build --no-out-link https://github.com/input-output-hk/iohk-ops/archive/master.tar.gz -A iohk-ops)/bin/iohk-ops --help
{ "pile_set_name": "Github" }
/* Copyright The Kubernetes 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. */ // Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake
{ "pile_set_name": "Github" }
// this ensures node understands the future require('@babel/register'); const _ = require('lodash'); const createDebugger = require('debug'); const log = createDebugger('fcc:server:production-start'); const startTime = Date.now(); // force logger to always output // this may be brittle log.enabled = true; // this is where server starts booting up const app = require('./server'); let timeoutHandler; let killTime = 15; const onConnect = _.once(() => { log('db connected in: %s', Date.now() - startTime); if (timeoutHandler) { clearTimeout(timeoutHandler); } app.start(); }); timeoutHandler = setTimeout(() => { const message = `db did not connect after ${killTime}s -- crashing hard`; // purposely shutdown server // pm2 should restart this in production throw new Error(message); }, killTime * 1000); app.dataSources.db.on('connected', onConnect);
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <title>Rgaa30 Test.8.8.2 NA 03</title> </head> <body> <div> <h1>Rgaa30 Test.8.8.2 NA 03</h1> <div class="test-detail"> On each Web page, is each language change (lang and/or xml:lang attribute) relevant? </div> <div class="testcase" lang="english"> some text in english </div> <div class="test-explanation"> NA : The only language change is not well-formed. </div> </div> </body> </html>
{ "pile_set_name": "Github" }
#region PDFsharp - A .NET library for processing PDF // // Authors: // Stefan Lange // // Copyright (c) 2005-2019 empira Software GmbH, Cologne Area (Germany) // // http://www.pdfsharp.com // http://sourceforge.net/projects/pdfsharp // // 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. #endregion using System; namespace PdfSharp.Pdf.Advanced { /// <summary> /// Represents a PDF page object. /// </summary> internal class PdfPageInheritableObjects : PdfDictionary { public PdfPageInheritableObjects() { } // TODO Inheritable Resources not yet supported /// <summary> /// /// </summary> public PdfRectangle MediaBox { get { return _mediaBox; } set { _mediaBox = value; } } PdfRectangle _mediaBox; public PdfRectangle CropBox { get { return _cropBox; } set { _cropBox = value; } } PdfRectangle _cropBox; public int Rotate { get { return _rotate; } set { if (value % 90 != 0) throw new ArgumentException("The value must be a multiple of 90.", nameof(value)); _rotate = value; } } int _rotate; } }
{ "pile_set_name": "Github" }
reference = Referenz queryParameters = Abfrage-Parameter indexedParameters = Indexierte Parameter
{ "pile_set_name": "Github" }
import { HttpStatus } from '@nestjs/common'; export interface IErrorMessages { type: string; httpStatus: HttpStatus; errorMessage: string; userMessage: string; }
{ "pile_set_name": "Github" }
// // This tests the use of an array indexer on value exprclasses // and not only variables // class X { static g () : array [int] { mutable x = array(5); x [1] = 10; x; } static Main () : int { if (g () [1] == 10) { 0; } else { 1; } } } /* BEGIN-OUTPUT END-OUTPUT */
{ "pile_set_name": "Github" }
package com.netease.nim.uikit.common.activity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import com.netease.nim.uikit.R; import com.netease.nim.uikit.api.wrapper.NimToolBarOptions; import com.netease.nim.uikit.common.ui.recyclerview.adapter.BaseQuickAdapter; import com.netease.nim.uikit.common.ui.recyclerview.decoration.DividerItemDecoration; import com.netease.nim.uikit.common.ui.recyclerview.holder.BaseViewHolder; import com.netease.nim.uikit.common.ui.recyclerview.listener.OnItemClickListener; import java.util.List; import me.everything.android.ui.overscroll.OverScrollDecoratorHelper; /** * 列表Activity抽象类 * <p> * Created by huangjun on 2017/6/21. */ public abstract class ListActivityBase<T> extends UI { // interface protected abstract String getTitleString(); protected abstract List<T> onLoadData(); protected abstract int onItemResId(); protected abstract void convertItem(BaseViewHolder helper, T item); protected abstract void onItemClick(T item); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.nim_list_activity_layout); // toolbar ToolBarOptions options = new NimToolBarOptions(); options.titleString = getTitleString(); setToolBar(R.id.toolbar, options); // RecyclerView RecyclerView recyclerView = (RecyclerView) findViewById(R.id.data_list); recyclerView.setLayoutManager(new LinearLayoutManager(this)); recyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL_LIST)); recyclerView.addOnItemTouchListener(new OnItemClickListener<Adapter>() { @Override public void onItemClick(Adapter adapter, View view, int position) { ListActivityBase.this.onItemClick(adapter.getItem(position)); } }); // ios style OverScrollDecoratorHelper.setUpOverScroll(recyclerView, OverScrollDecoratorHelper.ORIENTATION_VERTICAL); // adapter final List<T> data = onLoadData(); final BaseQuickAdapter<T, BaseViewHolder> adapter = new Adapter(recyclerView, onItemResId(), data) { @Override protected void convert(BaseViewHolder helper, T item, int position, boolean isScrolling) { convertItem(helper, item); } }; recyclerView.setAdapter(adapter); } abstract class Adapter extends BaseQuickAdapter<T, BaseViewHolder> { Adapter(RecyclerView recyclerView, final int layoutId, List<T> data) { super(recyclerView, layoutId, data); } } }
{ "pile_set_name": "Github" }
- hg: local-name: amor-ros-pkg uri: http://code.google.com/p/amor-ros-pkg/ version: fuerte
{ "pile_set_name": "Github" }
package org.drools.ruleunit.impl; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.Objects; import org.drools.ruleunit.RuleUnit; import org.kie.internal.ruleunit.RuleUnitVariable; import static org.drools.reflective.util.ClassUtils.convertFromPrimitiveType; import static org.drools.reflective.util.ClassUtils.getter2property; public final class ReflectiveRuleUnitVariable implements RuleUnitVariable { private final String name; private final Class<?> type; private final Class<?> dataSourceParameterType; private final Class<?> boxedVarType; private final String getter; private final Method getterMethod; public ReflectiveRuleUnitVariable(String name, Method getterMethod) { Objects.requireNonNull(name, "Invalid name was given: null"); if (!RuleUnit.class.isAssignableFrom(getterMethod.getDeclaringClass())) { throw new IllegalArgumentException( String.format("The given method '%s' is not from a RuleUnit instance", getterMethod)); } if (getterMethod.getParameterCount() != 0) { throw new IllegalArgumentException( String.format("The given method '%s' is not from a RuleUnit instance", getterMethod)); } if (getterMethod.getName().equals("getClass")) { throw new IllegalArgumentException("'getClass' is not a valid method for a rule unit variable"); } String id = getter2property(getterMethod.getName()); if (id == null) { throw new IllegalArgumentException( String.format("Could not parse getter name for method '%s'", getterMethod)); } this.name = name; this.getter = getterMethod.getName(); this.getterMethod = getterMethod; this.type = getterMethod.getReturnType(); this.dataSourceParameterType = getUnitVarType(getterMethod); this.boxedVarType = convertFromPrimitiveType(type); } private Class<?> getUnitVarType(Method m) { Class<?> returnClass = m.getReturnType(); if (returnClass.isArray()) { return returnClass.getComponentType(); } else if (Iterable.class.isAssignableFrom( returnClass )) { Type returnType = m.getGenericReturnType(); Class<?> sourceType = returnType instanceof ParameterizedType ? (Class<?>) ( (ParameterizedType) returnType ).getActualTypeArguments()[0] : Object.class; return sourceType; } else { return returnClass; } } @Override public boolean isDataSource() { return dataSourceParameterType != null; } @Override public String getName() { return name; } @Override public String getter() { return getter; } @Override public Class<?> getType() { return type; } @Override public Class<?> getDataSourceParameterType() { return dataSourceParameterType; } @Override public Class<?> getBoxedVarType() { return boxedVarType; } public Object getValue(RuleUnit ruleUnit) { try { return getterMethod.invoke(ruleUnit); } catch (IllegalAccessException | InvocationTargetException e) { throw new RuntimeException(e); } } @Override public String toString() { return "ReflectiveRuleUnitVariable{" + "name='" + name + '\'' + ", type=" + type + ", dataSourceParameterType=" + dataSourceParameterType + '}'; } }
{ "pile_set_name": "Github" }
#!/usr/bin/env node "use strict"; /** * Command-line interface to packet decoding * * Usage: * lora-packet-decode --hex <packet> * lora-packet-decode --base64 <packet> */ var lora_packet = require('../lib/index.js'); var cmdlineArgs = process.argv; var hexOption = cmdlineArgs.indexOf("--hex"); var b64Option = cmdlineArgs.indexOf("--base64"); var nwkOption = cmdlineArgs.indexOf("--nwkkey"); var appOption = cmdlineArgs.indexOf("--appkey"); var fCntMSBOption = cmdlineArgs.indexOf("--cntmsb"); function printUsageAndExit() { console.log ("Usage:"); console.log ("\tlora-packet-decode [--nwkkey <NwkSKey> --appkey <AppSKey> --cntmsb <fCntMSB>] --{hex|base64} <data>"); process.exit(1); } // need both keys (or neither) if (nwkOption >= 0 && ! (appOption >= 0) || !(nwkOption >= 0) && appOption >= 0) { printUsageAndExit() } var inputData; if (hexOption != -1 && hexOption+1 < cmdlineArgs.length) { var arg = cmdlineArgs[hexOption+1]; console.log("decoding from Hex: ", arg); inputData = Buffer.from(arg, 'hex'); } else if (b64Option != -1 && b64Option+1 < cmdlineArgs.length) { var arg = cmdlineArgs[b64Option+1]; console.log("decoding from Base64: ", arg); inputData = Buffer.from(arg, 'base64'); } else { printUsageAndExit(); } var packet = lora_packet.fromWire(inputData); console.log ("Decoded packet") console.log ("--------------") var res = packet.toString(); if (nwkOption >= 0 && appOption >= 0) { var fCntMSBBytes = (fCntMSBOption >= 0) ? [ cmdlineArgs[fCntMSBOption + 1] & 0xff, cmdlineArgs[fCntMSBOption + 1] & 0xff00] : null; //[0x00, 0x00]; if (fCntMSBBytes) var fCntMSB = new Buffer.from(fCntMSBBytes); var nwkKey = Buffer.from(cmdlineArgs[nwkOption+1], 'hex') var appKey = Buffer.from(cmdlineArgs[appOption+1], 'hex') var micOk = lora_packet.verifyMIC(packet, nwkKey, appKey, fCntMSB) ? " (OK)" : (" (BAD != "+asHexString(lora_packet.calculateMIC(packet, nwkKey, appKey, fCntMSB))+")"); var plaintext = asHexString(lora_packet.decrypt(packet, appKey, nwkKey, fCntMSB)); res = res.replace(/ MIC = [0-9a-fA-F]+/, '$&'+micOk); res = res.replace(/ FRMPayload = [0-9a-fA-F]+/, '$&\n'+ " Plaintext = "+plaintext+" ('"+asAscii(plaintext)+"')"); } console.log (res); function asHexString(buf) { return buf.toString('hex').toUpperCase(); } function asAscii(hex) { return hex.replace(/../g, function(x) { var code = parseInt(x, 16); return code >= 32 && code < 127 ? String.fromCharCode(code) : "."; }); }
{ "pile_set_name": "Github" }
<!DOCTYPE HTML> <!-- Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> <html class="reftest-wait"><head> <meta charset="utf-8"> <title>CSS Grid Test: test 006 dynamic remove/insert first item</title> <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1144096"> <link rel="help" href="https://drafts.csswg.org/css-grid/#pagination"> <link rel="match" href="grid-fragmentation-006-ref.html"> <script src="support/dyn.js"></script> <script> function runTest(text) { document.body.innerHTML = text; dyn1('.grid'); document.documentElement.removeAttribute("class"); } </script> </head> <body onload='dynamicTest("grid-fragmentation-006.html", runTest)'></body> </html>
{ "pile_set_name": "Github" }
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "extensions/renderer/module_system_test.h" namespace extensions { namespace { class SafeBuiltinsUnittest : public ModuleSystemTest {}; TEST_F(SafeBuiltinsUnittest, TestNotOriginalObject) { ModuleSystem::NativesEnabledScope natives_enabled_scope( env()->module_system()); env()->RegisterModule("test", "var assert = requireNative('assert');\n" "Array.foo = 10;\n" "assert.AssertTrue(!$Array.hasOwnProperty('foo'));\n"); env()->module_system()->Require("test"); } TEST_F(SafeBuiltinsUnittest, TestSelf) { ModuleSystem::NativesEnabledScope natives_enabled_scope( env()->module_system()); env()->RegisterModule("test", "var assert = requireNative('assert');\n" "Array.foo = 10;\n" "assert.AssertTrue($Array.self.foo == 10);\n" "var arr = $Array.self(1);\n" "assert.AssertTrue(arr.length == 1);\n" "assert.AssertTrue(arr[0] === undefined);\n"); env()->module_system()->Require("test"); } TEST_F(SafeBuiltinsUnittest, TestStaticFunction) { ModuleSystem::NativesEnabledScope natives_enabled_scope( env()->module_system()); env()->RegisterModule("test", "var assert = requireNative('assert');\n" "Object.keys = function() {throw new Error()};\n" "var obj = {a: 10};\n" "var keys = $Object.keys(obj);\n" "assert.AssertTrue(keys.length == 1);\n" "assert.AssertTrue(keys[0] == 'a');\n"); env()->module_system()->Require("test"); } TEST_F(SafeBuiltinsUnittest, TestInstanceMethod) { ModuleSystem::NativesEnabledScope natives_enabled_scope( env()->module_system()); env()->RegisterModule( "test", "var assert = requireNative('assert');\n" "Array.prototype.push = function() {throw new Error();}\n" "var arr = []\n" "$Array.push(arr, 1);\n" "assert.AssertTrue(arr.length == 1);\n" "assert.AssertTrue(arr[0] == 1);\n"); env()->module_system()->Require("test"); } // NOTE: JSON is already tested in ExtensionApiTest.Messaging, via // chrome/test/data/extensions/api_test/messaging/connect/page.js. } // namespace } // namespace extensions
{ "pile_set_name": "Github" }
## js-ipfs #### Lead: @diasdavid #### Notetaker: @em-ly #### Participants - @daviddias - @victorbjelkholm - @dignifiedquire - @em-ly - @flyingzumwalt - @RichardLitt ## Agenda - bunch of IPLD discussions, multibase came out - pull-streams endeavour - files (victor) **You have 30 minutes for this agenda**, 5 minutes before the meeting ends, consider moving the remaining items to a github discussion thread so that all the other sprint meetings can start in time. ## Notes - IPLD Working on interop with go-ipfs, mostly completed but still working on 100% functionality Top priority is to get js-ipfs interoping with Secio, making progress but still working on it. "Just fix the bug." - been obsessed with this for the past week. - Welcome Victor!!!!!!!! \o\ \o/ /o/ - Joined the Protocol Labs team full time to work on the js-ipfs projects. - Working on which API is being used when Nodes are being runned on tests. - Looking for a suitable fix, has to be a stream in the response. - taking a look at pull-stream PRs - The team is very focused on interop. ##### After sprint meeting is finished, create the respective action items on the Github sprint issue
{ "pile_set_name": "Github" }
package com.sequenceiq.cloudbreak.cloud.service; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.doAnswer; import java.util.List; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformNoSqlTablesRequest; import com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformNoSqlTablesResult; import com.sequenceiq.cloudbreak.cloud.model.CloudCredential; import com.sequenceiq.cloudbreak.cloud.model.ExtendedCloudCredential; import com.sequenceiq.cloudbreak.cloud.model.nosql.CloudNoSqlTable; import com.sequenceiq.cloudbreak.cloud.model.nosql.CloudNoSqlTables; import com.sequenceiq.flow.reactor.ErrorHandlerAwareReactorEventFactory; import reactor.bus.Event; import reactor.bus.EventBus; @ExtendWith(MockitoExtension.class) class CloudParameterServiceTest { @Mock private EventBus eventBus; @Mock private ErrorHandlerAwareReactorEventFactory eventFactory; @InjectMocks private CloudParameterService underTest; @Test void getNoSqlTables() { CloudNoSqlTables expected = new CloudNoSqlTables(List.of(new CloudNoSqlTable("a"), new CloudNoSqlTable("b"))); GetPlatformNoSqlTablesResult response = new GetPlatformNoSqlTablesResult(1L, expected); doAnswer(invocation -> { Event<GetPlatformNoSqlTablesRequest> ev = invocation.getArgument(1); ev.getData().getResult().onNext(response); return null; }).when(eventBus).notify(anyString(), any(Event.class)); CloudNoSqlTables noSqlTables = underTest.getNoSqlTables( new ExtendedCloudCredential( new CloudCredential("id", "name"), "aws", "desc", "crn", "account"), "region", "aws", null); assertEquals(expected, noSqlTables); } }
{ "pile_set_name": "Github" }
package centaur import centaur.api.CentaurCromwellClient import centaur.test.standard.CentaurTestCase import com.typesafe.config.{Config, ConfigFactory} import com.typesafe.scalalogging.StrictLogging import net.ceedubs.ficus.Ficus._ import org.scalatest.{BeforeAndAfterAll, ParallelTestExecution, Suite, Suites} import scala.sys.ShutdownHookThread object CentaurTestSuite extends StrictLogging { // Start cromwell if we're in Managed mode // Note: we can't use beforeAll to start Cromwell, because beforeAll is executed once the suite is instantiated and the // tests exist. However because the set of tests differs depending on the backends supported by Cromwell, it needs to be up // before we can generate the tests. startCromwell() def startCromwell(): Unit = { CentaurConfig.runMode match { case ManagedCromwellServer(preRestart, _, _) => CromwellManager.startCromwell(preRestart) case _ => } } val cromwellBackends = CentaurCromwellClient.backends.unsafeRunSync().supportedBackends.map(_.toLowerCase) def isWdlUpgradeTest(testCase: CentaurTestCase): Boolean = testCase.containsTag("wdl_upgrade") def isEngineUpgradeTest(testCase: CentaurTestCase): Boolean = testCase.containsTag("engine_upgrade") def isPapiUpgradeTest(testCase: CentaurTestCase): Boolean = testCase.containsTag("papi_upgrade") /** Horicromtality-related assertion config. */ val cromwellTracker: Option[CromwellTracker] = { def backendCountFromConfig(config: Config): Option[Int] = { val assert = config.getOrElse("assert", default = false) val backendCount = config.as[Option[Int]]("backend-count") (assert, backendCount) match { case (false, _) => None case (true, Some(_)) => backendCount case (true, _) => val message = "Invalid Centaur configuration: `horicromtal` must define `backend-count` if `assert = true`" throw new RuntimeException(message) } } for { config <- ConfigFactory.load().as[Option[Config]]("centaur.horicromtal") backendCount <- backendCountFromConfig(config) configuredSignificance = config.getOrElse("significance-level", 0.05) } yield CromwellTracker(backendCount, configuredSignificance) } logger.info(s"Horicromtal tracker config: {}", cromwellTracker) } /** * Shuts down the managed cromwell after centaur finishes running. * Should be mixed into any root suite of centaur tests. */ trait CentaurTestSuiteShutdown extends Suite with BeforeAndAfterAll { private var shutdownHook: Option[ShutdownHookThread] = _ override protected def beforeAll() = { shutdownHook = Option(sys.addShutdownHook { CromwellManager.stopCromwell("JVM Shutdown Hook") }) } override protected def afterAll() = { CromwellManager.stopCromwell("ScalaTest AfterAll") CentaurTestSuite.cromwellTracker foreach { _.assertHoricromtality() } shutdownHook.foreach(_.remove()) } } /** * The main centaur test suites, runs sub suites in parallel, but allows better control over the way each nested suite runs. */ class CentaurTestSuite extends Suites(new SequentialTestCaseSpec(), new ParallelTestCaseSpec()) with ParallelTestExecution with CentaurTestSuiteShutdown
{ "pile_set_name": "Github" }
// Protocol Buffers - Google's data interchange format // Copyright 2008 Google Inc. All rights reserved. // https://developers.google.com/protocol-buffers/ // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. syntax = "proto3"; package google.protobuf; option csharp_namespace = "Google.Protobuf.WellKnownTypes"; option go_package = "github.com/golang/protobuf/ptypes/any"; option java_package = "com.google.protobuf"; option java_outer_classname = "AnyProto"; option java_multiple_files = true; option objc_class_prefix = "GPB"; // `Any` contains an arbitrary serialized protocol buffer message along with a // URL that describes the type of the serialized message. // // Protobuf library provides support to pack/unpack Any values in the form // of utility functions or additional generated methods of the Any type. // // Example 1: Pack and unpack a message in C++. // // Foo foo = ...; // Any any; // any.PackFrom(foo); // ... // if (any.UnpackTo(&foo)) { // ... // } // // Example 2: Pack and unpack a message in Java. // // Foo foo = ...; // Any any = Any.pack(foo); // ... // if (any.is(Foo.class)) { // foo = any.unpack(Foo.class); // } // // Example 3: Pack and unpack a message in Python. // // foo = Foo(...) // any = Any() // any.Pack(foo) // ... // if any.Is(Foo.DESCRIPTOR): // any.Unpack(foo) // ... // // Example 4: Pack and unpack a message in Go // // foo := &pb.Foo{...} // any, err := ptypes.MarshalAny(foo) // ... // foo := &pb.Foo{} // if err := ptypes.UnmarshalAny(any, foo); err != nil { // ... // } // // The pack methods provided by protobuf library will by default use // 'type.googleapis.com/full.type.name' as the type URL and the unpack // methods only use the fully qualified type name after the last '/' // in the type URL, for example "foo.bar.com/x/y.z" will yield type // name "y.z". // // // JSON // ==== // The JSON representation of an `Any` value uses the regular // representation of the deserialized, embedded message, with an // additional field `@type` which contains the type URL. Example: // // package google.profile; // message Person { // string first_name = 1; // string last_name = 2; // } // // { // "@type": "type.googleapis.com/google.profile.Person", // "firstName": <string>, // "lastName": <string> // } // // If the embedded message type is well-known and has a custom JSON // representation, that representation will be embedded adding a field // `value` which holds the custom JSON in addition to the `@type` // field. Example (for message [google.protobuf.Duration][]): // // { // "@type": "type.googleapis.com/google.protobuf.Duration", // "value": "1.212s" // } // message Any { // A URL/resource name that uniquely identifies the type of the serialized // protocol buffer message. The last segment of the URL's path must represent // the fully qualified name of the type (as in // `path/google.protobuf.Duration`). The name should be in a canonical form // (e.g., leading "." is not accepted). // // In practice, teams usually precompile into the binary all types that they // expect it to use in the context of Any. However, for URLs which use the // scheme `http`, `https`, or no scheme, one can optionally set up a type // server that maps type URLs to message definitions as follows: // // * If no scheme is provided, `https` is assumed. // * An HTTP GET on the URL must yield a [google.protobuf.Type][] // value in binary format, or produce an error. // * Applications are allowed to cache lookup results based on the // URL, or have them precompiled into a binary to avoid any // lookup. Therefore, binary compatibility needs to be preserved // on changes to types. (Use versioned type names to manage // breaking changes.) // // Note: this functionality is not currently available in the official // protobuf release, and it is not used for type URLs beginning with // type.googleapis.com. // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. // string type_url = 1; // Must be a valid serialized protocol buffer of the above specified type. bytes value = 2; }
{ "pile_set_name": "Github" }
/* * Copyright 2016 higherfrequencytrading.com * * 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 net.openhft.chronicle.queue.micros; @FunctionalInterface public interface MarketDataListener { void onTopOfBookPrice(TopOfBookPrice price); }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- ~ Copyright (c) 2007-2011 flexlib contributors. ~ ~ 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. --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.google.code.flexlib</groupId> <artifactId>flexlib-examples</artifactId> <version>2.6-SNAPSHOT</version> </parent> <artifactId>flexlib-example-advancedform</artifactId> <version>2.6-SNAPSHOT</version> <packaging>swf</packaging> <name>flexlib :: examples :: AdvancedForm</name> <dependencies> <dependency> <groupId>com.google.code.flexlib</groupId> <artifactId>flexlib</artifactId> <type>swc</type> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.sonatype.flexmojos</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <extensions>true</extensions> <configuration> <sourceFile>${project.build.sourceDirectory}/AdvancedForm_Sample.mxml</sourceFile> <storepass /> </configuration> </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> </plugin> </plugins> </build> </project>
{ "pile_set_name": "Github" }
// Libraries import React, {PureComponent, ChangeEvent} from 'react' import {connect} from 'react-redux' // Components import {Form, Input, Button, Panel, Grid} from '@influxdata/clockface' // Types import {AppState} from 'src/types' import {Columns, ComponentSize, ComponentStatus} from '@influxdata/clockface' interface StateProps { me: AppState['me'] } interface State { me: AppState['me'] } export class Settings extends PureComponent<StateProps, State> { constructor(props) { super(props) this.state = { me: this.props.me, } } public render() { const {me} = this.state return ( <Grid> <Grid.Row> <Grid.Column widthXS={Columns.Six}> <Panel> <Panel.Header> <h4>About Me</h4> <Button text="Edit About Me" /> </Panel.Header> <Panel.Body> <Form> <Form.Element label="Username"> <Input value={me.name} testID="nameInput" titleText="Username" size={ComponentSize.Small} status={ComponentStatus.Disabled} onChange={this.handleChangeInput} /> </Form.Element> </Form> </Panel.Body> </Panel> </Grid.Column> </Grid.Row> </Grid> ) } private handleChangeInput = (_: ChangeEvent<HTMLInputElement>): void => { // console.log('changing: ', e) } } const mstp = ({me}: AppState) => ({ me, }) export default connect(mstp)(Settings)
{ "pile_set_name": "Github" }
/* Copyright The Kubernetes 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. */ // Code generated by protoc-gen-gogo. // source: k8s.io/kubernetes/vendor/k8s.io/api/certificates/v1beta1/generated.proto // DO NOT EDIT! /* Package v1beta1 is a generated protocol buffer package. It is generated from these files: k8s.io/kubernetes/vendor/k8s.io/api/certificates/v1beta1/generated.proto It has these top-level messages: CertificateSigningRequest CertificateSigningRequestCondition CertificateSigningRequestList CertificateSigningRequestSpec CertificateSigningRequestStatus ExtraValue */ package v1beta1 import proto "github.com/gogo/protobuf/proto" import fmt "fmt" import math "math" import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" import strings "strings" import reflect "reflect" import io "io" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package func (m *CertificateSigningRequest) Reset() { *m = CertificateSigningRequest{} } func (*CertificateSigningRequest) ProtoMessage() {} func (*CertificateSigningRequest) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} } func (m *CertificateSigningRequestCondition) Reset() { *m = CertificateSigningRequestCondition{} } func (*CertificateSigningRequestCondition) ProtoMessage() {} func (*CertificateSigningRequestCondition) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } func (m *CertificateSigningRequestList) Reset() { *m = CertificateSigningRequestList{} } func (*CertificateSigningRequestList) ProtoMessage() {} func (*CertificateSigningRequestList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } func (m *CertificateSigningRequestSpec) Reset() { *m = CertificateSigningRequestSpec{} } func (*CertificateSigningRequestSpec) ProtoMessage() {} func (*CertificateSigningRequestSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } func (m *CertificateSigningRequestStatus) Reset() { *m = CertificateSigningRequestStatus{} } func (*CertificateSigningRequestStatus) ProtoMessage() {} func (*CertificateSigningRequestStatus) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{4} } func (m *ExtraValue) Reset() { *m = ExtraValue{} } func (*ExtraValue) ProtoMessage() {} func (*ExtraValue) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{5} } func init() { proto.RegisterType((*CertificateSigningRequest)(nil), "k8s.io.api.certificates.v1beta1.CertificateSigningRequest") proto.RegisterType((*CertificateSigningRequestCondition)(nil), "k8s.io.api.certificates.v1beta1.CertificateSigningRequestCondition") proto.RegisterType((*CertificateSigningRequestList)(nil), "k8s.io.api.certificates.v1beta1.CertificateSigningRequestList") proto.RegisterType((*CertificateSigningRequestSpec)(nil), "k8s.io.api.certificates.v1beta1.CertificateSigningRequestSpec") proto.RegisterType((*CertificateSigningRequestStatus)(nil), "k8s.io.api.certificates.v1beta1.CertificateSigningRequestStatus") proto.RegisterType((*ExtraValue)(nil), "k8s.io.api.certificates.v1beta1.ExtraValue") } func (m *CertificateSigningRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CertificateSigningRequest) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ObjectMeta.Size())) n1, err := m.ObjectMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n1 dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Spec.Size())) n2, err := m.Spec.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n2 dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(m.Status.Size())) n3, err := m.Status.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n3 return i, nil } func (m *CertificateSigningRequestCondition) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CertificateSigningRequestCondition) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Type))) i += copy(dAtA[i:], m.Type) dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Reason))) i += copy(dAtA[i:], m.Reason) dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Message))) i += copy(dAtA[i:], m.Message) dAtA[i] = 0x22 i++ i = encodeVarintGenerated(dAtA, i, uint64(m.LastUpdateTime.Size())) n4, err := m.LastUpdateTime.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n4 return i, nil } func (m *CertificateSigningRequestList) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CertificateSigningRequestList) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(m.ListMeta.Size())) n5, err := m.ListMeta.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n5 if len(m.Items) > 0 { for _, msg := range m.Items { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } return i, nil } func (m *CertificateSigningRequestSpec) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CertificateSigningRequestSpec) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if m.Request != nil { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Request))) i += copy(dAtA[i:], m.Request) } dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Username))) i += copy(dAtA[i:], m.Username) dAtA[i] = 0x1a i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.UID))) i += copy(dAtA[i:], m.UID) if len(m.Groups) > 0 { for _, s := range m.Groups { dAtA[i] = 0x22 i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } if len(m.Usages) > 0 { for _, s := range m.Usages { dAtA[i] = 0x2a i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } if len(m.Extra) > 0 { keysForExtra := make([]string, 0, len(m.Extra)) for k := range m.Extra { keysForExtra = append(keysForExtra, string(k)) } github_com_gogo_protobuf_sortkeys.Strings(keysForExtra) for _, k := range keysForExtra { dAtA[i] = 0x32 i++ v := m.Extra[string(k)] msgSize := 0 if (&v) != nil { msgSize = (&v).Size() msgSize += 1 + sovGenerated(uint64(msgSize)) } mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + msgSize i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(len(k))) i += copy(dAtA[i:], k) dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64((&v).Size())) n6, err := (&v).MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n6 } } return i, nil } func (m *CertificateSigningRequestStatus) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m *CertificateSigningRequestStatus) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m.Conditions) > 0 { for _, msg := range m.Conditions { dAtA[i] = 0xa i++ i = encodeVarintGenerated(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err } i += n } } if m.Certificate != nil { dAtA[i] = 0x12 i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Certificate))) i += copy(dAtA[i:], m.Certificate) } return i, nil } func (m ExtraValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) if err != nil { return nil, err } return dAtA[:n], nil } func (m ExtraValue) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l if len(m) > 0 { for _, s := range m { dAtA[i] = 0xa i++ l = len(s) for l >= 1<<7 { dAtA[i] = uint8(uint64(l)&0x7f | 0x80) l >>= 7 i++ } dAtA[i] = uint8(l) i++ i += copy(dAtA[i:], s) } } return i, nil } func encodeFixed64Generated(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) dAtA[offset+2] = uint8(v >> 16) dAtA[offset+3] = uint8(v >> 24) dAtA[offset+4] = uint8(v >> 32) dAtA[offset+5] = uint8(v >> 40) dAtA[offset+6] = uint8(v >> 48) dAtA[offset+7] = uint8(v >> 56) return offset + 8 } func encodeFixed32Generated(dAtA []byte, offset int, v uint32) int { dAtA[offset] = uint8(v) dAtA[offset+1] = uint8(v >> 8) dAtA[offset+2] = uint8(v >> 16) dAtA[offset+3] = uint8(v >> 24) return offset + 4 } func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return offset + 1 } func (m *CertificateSigningRequest) Size() (n int) { var l int _ = l l = m.ObjectMeta.Size() n += 1 + l + sovGenerated(uint64(l)) l = m.Spec.Size() n += 1 + l + sovGenerated(uint64(l)) l = m.Status.Size() n += 1 + l + sovGenerated(uint64(l)) return n } func (m *CertificateSigningRequestCondition) Size() (n int) { var l int _ = l l = len(m.Type) n += 1 + l + sovGenerated(uint64(l)) l = len(m.Reason) n += 1 + l + sovGenerated(uint64(l)) l = len(m.Message) n += 1 + l + sovGenerated(uint64(l)) l = m.LastUpdateTime.Size() n += 1 + l + sovGenerated(uint64(l)) return n } func (m *CertificateSigningRequestList) Size() (n int) { var l int _ = l l = m.ListMeta.Size() n += 1 + l + sovGenerated(uint64(l)) if len(m.Items) > 0 { for _, e := range m.Items { l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } } return n } func (m *CertificateSigningRequestSpec) Size() (n int) { var l int _ = l if m.Request != nil { l = len(m.Request) n += 1 + l + sovGenerated(uint64(l)) } l = len(m.Username) n += 1 + l + sovGenerated(uint64(l)) l = len(m.UID) n += 1 + l + sovGenerated(uint64(l)) if len(m.Groups) > 0 { for _, s := range m.Groups { l = len(s) n += 1 + l + sovGenerated(uint64(l)) } } if len(m.Usages) > 0 { for _, s := range m.Usages { l = len(s) n += 1 + l + sovGenerated(uint64(l)) } } if len(m.Extra) > 0 { for k, v := range m.Extra { _ = k _ = v l = v.Size() mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } return n } func (m *CertificateSigningRequestStatus) Size() (n int) { var l int _ = l if len(m.Conditions) > 0 { for _, e := range m.Conditions { l = e.Size() n += 1 + l + sovGenerated(uint64(l)) } } if m.Certificate != nil { l = len(m.Certificate) n += 1 + l + sovGenerated(uint64(l)) } return n } func (m ExtraValue) Size() (n int) { var l int _ = l if len(m) > 0 { for _, s := range m { l = len(s) n += 1 + l + sovGenerated(uint64(l)) } } return n } func sovGenerated(x uint64) (n int) { for { n++ x >>= 7 if x == 0 { break } } return n } func sozGenerated(x uint64) (n int) { return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *CertificateSigningRequest) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CertificateSigningRequest{`, `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "CertificateSigningRequestSpec", "CertificateSigningRequestSpec", 1), `&`, ``, 1) + `,`, `Status:` + strings.Replace(strings.Replace(this.Status.String(), "CertificateSigningRequestStatus", "CertificateSigningRequestStatus", 1), `&`, ``, 1) + `,`, `}`, }, "") return s } func (this *CertificateSigningRequestCondition) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CertificateSigningRequestCondition{`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Reason:` + fmt.Sprintf("%v", this.Reason) + `,`, `Message:` + fmt.Sprintf("%v", this.Message) + `,`, `LastUpdateTime:` + strings.Replace(strings.Replace(this.LastUpdateTime.String(), "Time", "k8s_io_apimachinery_pkg_apis_meta_v1.Time", 1), `&`, ``, 1) + `,`, `}`, }, "") return s } func (this *CertificateSigningRequestList) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CertificateSigningRequestList{`, `ListMeta:` + strings.Replace(strings.Replace(this.ListMeta.String(), "ListMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ListMeta", 1), `&`, ``, 1) + `,`, `Items:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Items), "CertificateSigningRequest", "CertificateSigningRequest", 1), `&`, ``, 1) + `,`, `}`, }, "") return s } func (this *CertificateSigningRequestSpec) String() string { if this == nil { return "nil" } keysForExtra := make([]string, 0, len(this.Extra)) for k := range this.Extra { keysForExtra = append(keysForExtra, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForExtra) mapStringForExtra := "map[string]ExtraValue{" for _, k := range keysForExtra { mapStringForExtra += fmt.Sprintf("%v: %v,", k, this.Extra[k]) } mapStringForExtra += "}" s := strings.Join([]string{`&CertificateSigningRequestSpec{`, `Request:` + valueToStringGenerated(this.Request) + `,`, `Username:` + fmt.Sprintf("%v", this.Username) + `,`, `UID:` + fmt.Sprintf("%v", this.UID) + `,`, `Groups:` + fmt.Sprintf("%v", this.Groups) + `,`, `Usages:` + fmt.Sprintf("%v", this.Usages) + `,`, `Extra:` + mapStringForExtra + `,`, `}`, }, "") return s } func (this *CertificateSigningRequestStatus) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&CertificateSigningRequestStatus{`, `Conditions:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Conditions), "CertificateSigningRequestCondition", "CertificateSigningRequestCondition", 1), `&`, ``, 1) + `,`, `Certificate:` + valueToStringGenerated(this.Certificate) + `,`, `}`, }, "") return s } func valueToStringGenerated(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *CertificateSigningRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CertificateSigningRequest: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CertificateSigningRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if err := m.Status.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthGenerated } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CertificateSigningRequestCondition) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CertificateSigningRequestCondition: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CertificateSigningRequestCondition: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Type = RequestConditionType(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Reason", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Reason = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Message = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LastUpdateTime", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if err := m.LastUpdateTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthGenerated } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CertificateSigningRequestList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CertificateSigningRequestList: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CertificateSigningRequestList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Items = append(m.Items, CertificateSigningRequest{}) if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthGenerated } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CertificateSigningRequestSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CertificateSigningRequestSpec: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CertificateSigningRequestSpec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Request = append(m.Request[:0], dAtA[iNdEx:postIndex]...) if m.Request == nil { m.Request = []byte{} } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Username = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.UID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Groups = append(m.Groups, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Usages", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } m.Usages = append(m.Usages, KeyUsage(dAtA[iNdEx:postIndex])) iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Extra", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } var keykey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ keykey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthGenerated } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey := string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey if m.Extra == nil { m.Extra = make(map[string]ExtraValue) } if iNdEx < postIndex { var valuekey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ valuekey |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } var mapmsglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ mapmsglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if mapmsglen < 0 { return ErrInvalidLengthGenerated } postmsgIndex := iNdEx + mapmsglen if mapmsglen < 0 { return ErrInvalidLengthGenerated } if postmsgIndex > l { return io.ErrUnexpectedEOF } mapvalue := &ExtraValue{} if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { return err } iNdEx = postmsgIndex m.Extra[mapkey] = *mapvalue } else { var mapvalue ExtraValue m.Extra[mapkey] = mapvalue } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthGenerated } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *CertificateSigningRequestStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: CertificateSigningRequestStatus: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: CertificateSigningRequestStatus: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Conditions", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + msglen if postIndex > l { return io.ErrUnexpectedEOF } m.Conditions = append(m.Conditions, CertificateSigningRequestCondition{}) if err := m.Conditions[len(m.Conditions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Certificate", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + byteLen if postIndex > l { return io.ErrUnexpectedEOF } m.Certificate = append(m.Certificate[:0], dAtA[iNdEx:postIndex]...) if m.Certificate == nil { m.Certificate = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthGenerated } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *ExtraValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: ExtraValue: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: ExtraValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthGenerated } postIndex := iNdEx + intStringLen if postIndex > l { return io.ErrUnexpectedEOF } *m = append(*m, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthGenerated } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipGenerated(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowGenerated } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowGenerated } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowGenerated } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } iNdEx += length if length < 0 { return 0, ErrInvalidLengthGenerated } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowGenerated } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipGenerated(dAtA[start:]) if err != nil { return 0, err } iNdEx = start + next } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") ) func init() { proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/certificates/v1beta1/generated.proto", fileDescriptorGenerated) } var fileDescriptorGenerated = []byte{ // 816 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4d, 0x6f, 0x1b, 0x45, 0x18, 0xf6, 0xfa, 0x2b, 0xf6, 0x38, 0xa4, 0xd5, 0x08, 0x55, 0x4b, 0xa4, 0xee, 0x46, 0x2b, 0x40, 0xe1, 0xa3, 0xb3, 0xa4, 0x20, 0x88, 0x72, 0x40, 0xb0, 0xa1, 0x82, 0x88, 0x56, 0x48, 0xd3, 0x86, 0x03, 0x42, 0xa2, 0xe3, 0xf5, 0xdb, 0xcd, 0xd4, 0xd9, 0x0f, 0x76, 0x66, 0x0d, 0xbe, 0xf5, 0x27, 0x70, 0xe4, 0x82, 0xc4, 0x2f, 0xe1, 0x1c, 0x0e, 0x48, 0x3d, 0xf6, 0x80, 0x2c, 0x62, 0xfe, 0x45, 0x4f, 0x68, 0x66, 0xc7, 0x5e, 0x63, 0xcb, 0x75, 0xd5, 0xdc, 0xf6, 0x7d, 0xde, 0xf7, 0x79, 0xde, 0xcf, 0x59, 0xf4, 0xd5, 0xf0, 0x50, 0x10, 0x9e, 0xfa, 0xc3, 0xa2, 0x0f, 0x79, 0x02, 0x12, 0x84, 0x3f, 0x82, 0x64, 0x90, 0xe6, 0xbe, 0x71, 0xb0, 0x8c, 0xfb, 0x21, 0xe4, 0x92, 0x3f, 0xe2, 0x21, 0xd3, 0xee, 0x83, 0x3e, 0x48, 0x76, 0xe0, 0x47, 0x90, 0x40, 0xce, 0x24, 0x0c, 0x48, 0x96, 0xa7, 0x32, 0xc5, 0x6e, 0x49, 0x20, 0x2c, 0xe3, 0x64, 0x91, 0x40, 0x0c, 0x61, 0xf7, 0x56, 0xc4, 0xe5, 0x59, 0xd1, 0x27, 0x61, 0x1a, 0xfb, 0x51, 0x1a, 0xa5, 0xbe, 0xe6, 0xf5, 0x8b, 0x47, 0xda, 0xd2, 0x86, 0xfe, 0x2a, 0xf5, 0x76, 0x3f, 0xaa, 0x0a, 0x88, 0x59, 0x78, 0xc6, 0x13, 0xc8, 0xc7, 0x7e, 0x36, 0x8c, 0x14, 0x20, 0xfc, 0x18, 0x24, 0xf3, 0x47, 0x2b, 0x55, 0xec, 0xfa, 0xeb, 0x58, 0x79, 0x91, 0x48, 0x1e, 0xc3, 0x0a, 0xe1, 0xe3, 0x4d, 0x04, 0x11, 0x9e, 0x41, 0xcc, 0x56, 0x78, 0x1f, 0xae, 0xe3, 0x15, 0x92, 0x9f, 0xfb, 0x3c, 0x91, 0x42, 0xe6, 0xcb, 0x24, 0xef, 0xcf, 0x3a, 0x7a, 0xe3, 0xb8, 0x9a, 0xcd, 0x7d, 0x1e, 0x25, 0x3c, 0x89, 0x28, 0xfc, 0x58, 0x80, 0x90, 0xf8, 0x21, 0xea, 0xa8, 0xb6, 0x06, 0x4c, 0x32, 0xdb, 0xda, 0xb3, 0xf6, 0x7b, 0xb7, 0x3f, 0x20, 0xd5, 0x50, 0xe7, 0x59, 0x48, 0x36, 0x8c, 0x14, 0x20, 0x88, 0x8a, 0x26, 0xa3, 0x03, 0xf2, 0x4d, 0xff, 0x31, 0x84, 0xf2, 0x1e, 0x48, 0x16, 0xe0, 0x8b, 0x89, 0x5b, 0x9b, 0x4e, 0x5c, 0x54, 0x61, 0x74, 0xae, 0x8a, 0x1f, 0xa2, 0xa6, 0xc8, 0x20, 0xb4, 0xeb, 0x5a, 0xfd, 0x53, 0xb2, 0x61, 0x65, 0x64, 0x6d, 0xad, 0xf7, 0x33, 0x08, 0x83, 0x6d, 0x93, 0xab, 0xa9, 0x2c, 0xaa, 0x95, 0xf1, 0x19, 0x6a, 0x0b, 0xc9, 0x64, 0x21, 0xec, 0x86, 0xce, 0xf1, 0xd9, 0x15, 0x72, 0x68, 0x9d, 0x60, 0xc7, 0x64, 0x69, 0x97, 0x36, 0x35, 0xfa, 0xde, 0x6f, 0x75, 0xe4, 0xad, 0xe5, 0x1e, 0xa7, 0xc9, 0x80, 0x4b, 0x9e, 0x26, 0xf8, 0x10, 0x35, 0xe5, 0x38, 0x03, 0x3d, 0xd0, 0x6e, 0xf0, 0xe6, 0xac, 0xe4, 0x07, 0xe3, 0x0c, 0x9e, 0x4f, 0xdc, 0xd7, 0x97, 0xe3, 0x15, 0x4e, 0x35, 0x03, 0xbf, 0x8d, 0xda, 0x39, 0x30, 0x91, 0x26, 0x7a, 0x5c, 0xdd, 0xaa, 0x10, 0xaa, 0x51, 0x6a, 0xbc, 0xf8, 0x1d, 0xb4, 0x15, 0x83, 0x10, 0x2c, 0x02, 0xdd, 0x73, 0x37, 0xb8, 0x66, 0x02, 0xb7, 0xee, 0x95, 0x30, 0x9d, 0xf9, 0xf1, 0x63, 0xb4, 0x73, 0xce, 0x84, 0x3c, 0xcd, 0x06, 0x4c, 0xc2, 0x03, 0x1e, 0x83, 0xdd, 0xd4, 0x53, 0x7a, 0xf7, 0xe5, 0xf6, 0xac, 0x18, 0xc1, 0x0d, 0xa3, 0xbe, 0x73, 0xf7, 0x7f, 0x4a, 0x74, 0x49, 0xd9, 0x9b, 0x58, 0xe8, 0xe6, 0xda, 0xf9, 0xdc, 0xe5, 0x42, 0xe2, 0xef, 0x57, 0xee, 0x8d, 0xbc, 0x5c, 0x1d, 0x8a, 0xad, 0xaf, 0xed, 0xba, 0xa9, 0xa5, 0x33, 0x43, 0x16, 0x6e, 0xed, 0x07, 0xd4, 0xe2, 0x12, 0x62, 0x61, 0xd7, 0xf7, 0x1a, 0xfb, 0xbd, 0xdb, 0x47, 0xaf, 0x7e, 0x08, 0xc1, 0x6b, 0x26, 0x4d, 0xeb, 0x44, 0x09, 0xd2, 0x52, 0xd7, 0xfb, 0xa3, 0xf1, 0x82, 0x06, 0xd5, 0x49, 0xe2, 0xb7, 0xd0, 0x56, 0x5e, 0x9a, 0xba, 0xbf, 0xed, 0xa0, 0xa7, 0xb6, 0x62, 0x22, 0xe8, 0xcc, 0x87, 0xdf, 0x47, 0x9d, 0x42, 0x40, 0x9e, 0xb0, 0x18, 0xcc, 0xaa, 0xe7, 0x7d, 0x9d, 0x1a, 0x9c, 0xce, 0x23, 0xf0, 0x4d, 0xd4, 0x28, 0xf8, 0xc0, 0xac, 0xba, 0x67, 0x02, 0x1b, 0xa7, 0x27, 0x5f, 0x50, 0x85, 0x63, 0x0f, 0xb5, 0xa3, 0x3c, 0x2d, 0x32, 0x61, 0x37, 0xf7, 0x1a, 0xfb, 0xdd, 0x00, 0xa9, 0x8b, 0xf9, 0x52, 0x23, 0xd4, 0x78, 0x30, 0x41, 0xed, 0x42, 0xdd, 0x83, 0xb0, 0x5b, 0x3a, 0xe6, 0x86, 0x8a, 0x39, 0xd5, 0xc8, 0xf3, 0x89, 0xdb, 0xf9, 0x1a, 0xc6, 0xda, 0xa0, 0x26, 0x0a, 0x27, 0xa8, 0x05, 0x3f, 0xcb, 0x9c, 0xd9, 0x6d, 0x3d, 0xca, 0x93, 0xab, 0xbd, 0x5b, 0x72, 0x47, 0x69, 0xdd, 0x49, 0x64, 0x3e, 0xae, 0x26, 0xab, 0x31, 0x5a, 0xa6, 0xd9, 0x05, 0x84, 0xaa, 0x18, 0x7c, 0x1d, 0x35, 0x86, 0x30, 0x2e, 0x1f, 0x10, 0x55, 0x9f, 0xf8, 0x73, 0xd4, 0x1a, 0xb1, 0xf3, 0x02, 0xcc, 0x7f, 0xe4, 0xbd, 0x8d, 0xf5, 0x68, 0xb5, 0x6f, 0x15, 0x85, 0x96, 0xcc, 0xa3, 0xfa, 0xa1, 0xe5, 0xfd, 0x65, 0x21, 0x77, 0xc3, 0xeb, 0xc7, 0x3f, 0x21, 0x14, 0xce, 0xde, 0xa6, 0xb0, 0x2d, 0xdd, 0xff, 0xf1, 0xab, 0xf7, 0x3f, 0x7f, 0xe7, 0xd5, 0x8f, 0x72, 0x0e, 0x09, 0xba, 0x90, 0x0a, 0x1f, 0xa0, 0xde, 0x82, 0xb4, 0xee, 0x74, 0x3b, 0xb8, 0x36, 0x9d, 0xb8, 0xbd, 0x05, 0x71, 0xba, 0x18, 0xe3, 0x7d, 0x62, 0xc6, 0xa6, 0x1b, 0xc5, 0xee, 0xec, 0xfe, 0x2d, 0xbd, 0xe3, 0xee, 0xf2, 0xfd, 0x1e, 0x75, 0x7e, 0xfd, 0xdd, 0xad, 0x3d, 0xf9, 0x7b, 0xaf, 0x16, 0xdc, 0xba, 0xb8, 0x74, 0x6a, 0x4f, 0x2f, 0x9d, 0xda, 0xb3, 0x4b, 0xa7, 0xf6, 0x64, 0xea, 0x58, 0x17, 0x53, 0xc7, 0x7a, 0x3a, 0x75, 0xac, 0x67, 0x53, 0xc7, 0xfa, 0x67, 0xea, 0x58, 0xbf, 0xfc, 0xeb, 0xd4, 0xbe, 0xdb, 0x32, 0xdd, 0xfd, 0x17, 0x00, 0x00, 0xff, 0xff, 0x73, 0x7d, 0xca, 0x2a, 0xb4, 0x07, 0x00, 0x00, }
{ "pile_set_name": "Github" }
--- title: Documentation authors: ['CompuIves'] slug: / description: Learn what CodeSandbox is and how to use it. --- ## What is CodeSandbox CodeSandbox is an online editor for rapid web development. With CodeSandbox, you can prototype quickly, experiment easily, and share creations with a click. Use it to create static sites, full-stack web apps or components, on any device with a web browser. ## Product Values Our mission is to make web development faster. By removing complexity, we enable web developers to be more productive. By simplifying collaboration, we make it easier for teams to work on code together. ### Code, not infrastructure We handle the development environment, taking on setup, tooling, and provisioning, so it’s as fast as possible to start and build projects. ### Shareable by default We create solutions that enable developers to work from anywhere and teams to build together in new and more effective ways. ### Work like local We equip developers with a local editor experience that’s familiar and integrated with popular developer tools, so the process of creation is seamless.
{ "pile_set_name": "Github" }
/* * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ #ifndef _MACHINE_MACHINE_ROUTINES_H #define _MACHINE_MACHINE_ROUTINES_H #if defined (__ppc__) #include "ppc/machine_routines.h" #elif defined (__i386__) #include "i386/machine_routines.h" #elif defined (__arm__) #include "arm/machine_routines.h" #else #error architecture not supported #endif #endif /* _MACHINE_MACHINE_ROUTINES_H */
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> </root>
{ "pile_set_name": "Github" }
/* global it, expect, beforeAll, afterAll, afterEach */ import { setup, teardown, login, modelize } from 'stubstub'; import { Export, WorkerTask } from 'server/models'; const models = modelize` Community community { Pub pub { viewHash: "some-hash" Member { permissions: "view" User pubViewer {} } } } `; setup(beforeAll, async () => { await models.resolve(); }); afterEach(async () => { const { pub } = models; await Export.destroy({ where: { pubId: pub.id } }); }); teardown(afterAll); const makeExportQuery = ( historyKey, { branchTitle = 'draft', format = 'pdf', accessHash = null } = {}, ) => { const { community, pub } = models; const branch = pub.branches.find((br) => br.title === branchTitle); return { communityId: community.id, pubId: pub.id, branchId: branch.id, historyKey: historyKey, accessHash: accessHash, format: format, }; }; it('Does not create an export of #draft for a user without permission', async () => { const agent = await login(); await agent .post('/api/export') .send(makeExportQuery(0)) .expect(403); }); it('Creates an export of #draft for a user with a valid access hash', async () => { const { pub } = models; const agent = await login(); await agent .post('/api/export') .send(makeExportQuery(0, { accessHash: pub.viewHash })) .expect(201); }); it('Creates an export of #draft for a pub viewer', async () => { const { pubViewer } = models; const agent = await login(pubViewer); await agent .post('/api/export') .send(makeExportQuery(0)) .expect(201); }); it('Creates an export of #public for anyone', async () => { const agent = await login(); await agent .post('/api/export') .send(makeExportQuery(0, { branchTitle: 'public' })) .expect(201); }); it('Creates a new worker task or returns an existing one, appropriately', async () => { const { pubViewer } = models; const agent = await login(pubViewer); // Kick off a worker task const { body: { taskId }, } = await agent .post('/api/export') .send(makeExportQuery(0)) .expect(201); const workerTask = await WorkerTask.findOne({ where: { id: taskId } }); expect(workerTask.type).toEqual('export'); // Now query again and check that we refer to the same worker task const { body: bodyAgain } = await agent .post('/api/export') .send(makeExportQuery(0)) .expect(201); expect(bodyAgain.taskId).toEqual(taskId); }); it('Returns the URL of a completed export', async () => { const { pubViewer } = models; const agent = await login(pubViewer); // Kick off a worker task const { body: { taskId }, } = await agent .post('/api/export') .send(makeExportQuery(0)) .expect(201); // Now simulate the worker task completing await Export.update({ url: 'any_url' }, { where: { workerTaskId: taskId } }); // Hit the API again and make sure we are served the right URL const { body: { url }, } = await agent .post('/api/export') .send(makeExportQuery(0)) .expect(201); expect(url).toEqual('any_url'); }); it('Does not conflate the formats of existing exports', async () => { const { pubViewer } = models; const agent = await login(pubViewer); // Kick off a worker task const { body: { taskId: docxTaskId }, } = await agent .post('/api/export') .send(makeExportQuery(0, { format: 'docx' })) .expect(201); // Ask for the same history key but in a different format const { body: { taskId: pdfTaskId }, } = await agent .post('/api/export') .send(makeExportQuery(0, { format: 'pdf' })) .expect(201); expect(docxTaskId).not.toEqual(pdfTaskId); // Now simulate the first worker task completing await Export.update({ url: 'any_url' }, { where: { workerTaskId: docxTaskId } }); // Ask for the PDF again and ensure we are given the pending task rather than the completed // URL in the wrong format. const { body: { taskId: pdfTaskIdAgain }, } = await agent .post('/api/export') .send(makeExportQuery(0, { format: 'pdf' })) .expect(201); expect(pdfTaskIdAgain).toEqual(pdfTaskId); }); it('Creates a new export if the key has advanced', async () => { const { pubViewer } = models; const agent = await login(pubViewer); // Kick off a worker task const { body: { taskId: taskId0 }, } = await agent .post('/api/export') .send(makeExportQuery(0)) .expect(201); // Kick off another worker task for a different history key const { body: { taskId: taskId1 }, } = await agent .post('/api/export') .send(makeExportQuery(1)) .expect(201); // Make sure these are two different tasks expect(taskId0).not.toEqual(taskId1); // Now let one of the tasks finish await Export.update({ url: 'any_url' }, { where: { workerTaskId: taskId0 } }); // And query for yet another history key const { body: { taskId: taskId2 }, } = await agent .post('/api/export') .send(makeExportQuery(2)) .expect(201); // And make sure that this creates yet another task. expect([taskId0, taskId1]).not.toContain(taskId2); }); it('Restarts the export if another task failed', async () => { const { pubViewer } = models; const agent = await login(pubViewer); // Kick off a worker task const { body: { taskId: failingTaskId }, } = await agent .post('/api/export') .send(makeExportQuery(0)) .expect(201); // Now make the worker task fail. await WorkerTask.update( { error: 'something terrible happened' }, { where: { id: failingTaskId } }, ); // Now try again... const { body: { taskId: retryingTaskId }, } = await agent .post('/api/export') .send(makeExportQuery(0)) .expect(201); // ...And expect to see a new task ID. expect(retryingTaskId).not.toEqual(failingTaskId); });
{ "pile_set_name": "Github" }
/* * Copyright 2015-2019 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 * * https://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.springframework.statemachine; import java.util.List; import java.util.Map; /** * {@code StateMachineContext} represents a current state of a state machine. * * @author Janne Valkealahti * * @param <S> the type of state * @param <E> the type of event */ public interface StateMachineContext<S, E> { /** * Gets the machine id. * * @return the machine id */ String getId(); /** * Gets the child contexts if any. * * @return the child contexts */ List<StateMachineContext<S, E>> getChilds(); /** * Gets the child context references if any. * * @return the child context references */ List<String> getChildReferences(); /** * Gets the state. * * @return the state */ S getState(); /** * Gets the event. * * @return the event */ E getEvent(); /** * Gets the history state mappings * * @return the history state mappings */ Map<S, S> getHistoryStates(); /** * Gets the event headers. * * @return the event headers */ Map<String, Object> getEventHeaders(); /** * Gets the extended state. * * @return the extended state */ ExtendedState getExtendedState(); }
{ "pile_set_name": "Github" }
using System; using Org.BouncyCastle.Utilities; namespace Org.BouncyCastle.Cms { internal class BaseDigestCalculator : IDigestCalculator { private readonly byte[] digest; internal BaseDigestCalculator( byte[] digest) { this.digest = digest; } public byte[] GetDigest() { return Arrays.Clone(digest); } } }
{ "pile_set_name": "Github" }
project_path: /web/_project.yaml book_path: /web/fundamentals/_book.yaml description: 레이아웃은 브라우저가 요소의 기하학적 정보(페이지에서 차지하는 크기 및 위치)를 파악하는 장소입니다. 각 요소는 사용한 CSS, 요소의 콘텐츠 또는 상위 요소에 따라 명시적 또는 암시적 크기 지정 정보를 갖게 됩니다. 이 프로세스는 Chrome에서 레이아웃이라고 합니다. # 크고 복잡한 레이아웃 및 레이아웃 스래싱 피하기 {: .page-title } {# wf_updated_on: 2015-03-20 #} {# wf_published_on: 2015-03-20 #} {% include "web/_shared/contributors/paullewis.html" %} 레이아웃은 브라우저가 요소의 기하학적 정보(페이지에서 차지하는 크기 및 위치)를 파악하는 장소입니다. 각 요소는 사용한 CSS, 요소의 콘텐츠 또는 상위 요소에 따라 명시적 또는 암시적 크기 지정 정보를 갖게 됩니다. 이 프로세스는 Chrome, Opera, Safari 및 Internet Explorer에서 레이아웃이라고 합니다. Firefox에서는 리플로우(reflow)라고 하지만 실제로는 동일한 프로세스입니다. 스타일 계산과 마찬가지로 다음 레이아웃 비용을 고려하세요. 1. 레이아웃이 필요한 요소 수. 2. 해당 레이아웃의 복잡성. ### TL;DR {: .hide-from-toc } * 레이아웃의 범위는 일반적으로 전체 문서로 지정됩니다. * DOM 요소 수는 성능에 영향을 주므로 가급적 레이아웃 트리거를 피해야 합니다. * 레이아웃 모델 성능을 평가합니다. 새 Flexbox는 일반적으로 이전 Flexbox 또는 부동 요소 기반 레이아웃 모델보다 빠릅니다. * 강제 동기식 레이아웃 및 레이아웃 스래싱(thrashing)을 피하세요. 스타일 값을 읽은 다음 스타일을 변경하세요. ## 가급적 레이아웃 피하기 스타일을 변경하면 브라우저가 변경 시 레이아웃 계산이 필요한지, 해당 렌더링 트리를 업데이트해야 하는지 확인합니다. 너비, 높이, 왼쪽 또는 상단 등과 같은 '기하학적 속성'의 변경은 모두 레이아웃이 필요합니다. .box { width: 20px; height: 20px; } /** * Changing width and height * triggers layout. */ .box--expanded { width: 200px; height: 350px; } **레이아웃의 범위는 거의 항상 전체 문서로 지정됩니다.** 많은 요소가 있는 경우, 모든 요소의 위치와 크기를 파악하는 데 오랜 시간이 걸립니다. 레이아웃을 피할 수 없는 경우 Chrome DevTools를 다시 사용하여 시간이 얼마나 걸리는지 확인하고 레이아웃이 병목 현상의 원인인지 여부를 파악하는 것이 중요합니다. 먼저 DevTools를 열고 Timeline 탭으로 가서 레코드를 누르고 사이트와 상호작용합니다. 레코딩을 중단하면 사이트에서 수행된 분석 정보가 표시됩니다. <img src="images/avoid-large-complex-layouts-and-layout-thrashing/big-layout.jpg" alt="DevTools에서 장시간 레이아웃 표시" /> 위 예의 프레임을 분석하면 레이아웃 내부에서 20ms 이상 소요된 것을 확인할 수 있습니다. 이는 애니메이션의 화면에서 프레임에 16ms가 필요한 경우 이에 비해 훨씬 높은 값입니다. 또한 DevTools에서 트리 크기(이 예에서는 1,618 요소) 및 레이아웃에 필요한 노드 수도 확인할 수 있습니다. 참고: 레이아웃, 페인트 또는 합성을 트리거하는 명확한 CSS 속성 목록이 필요한 경우 [CSS 트리거](https://csstriggers.com)를 참조하세요. ## 이전 레이아웃 모델 대신 Flexbox 사용 웹에는 레이아웃 모델의 범위가 있고 일부 모델은 다른 모델보다 널리 지원됩니다. 가장 오래된 CSS 레이아웃 모델은 요소를 상대적으로, 절대적으로 및 부동 요소별로 화면에 배치할 수 있습니다. 아래의 스크린샷은 1,300개의 상자에서 부동 요소를 사용할 경우 레이아웃 비용을 보여줍니다. 대부분의 애플리케이션은 다양한 방법을 사용하여 요소를 배치하기 때문에 이 예는 부자연스러운 점이 있습니다. <img src="images/avoid-large-complex-layouts-and-layout-thrashing/layout-float.jpg" alt="부동 요소를 레이아웃으로 사용" /> 더 최근에 웹 플랫폼에 추가된 Flexbox를 사용하도록 샘플을 업데이트하면 다른 결과를 얻게 됩니다. <img src="images/avoid-large-complex-layouts-and-layout-thrashing/layout-flex.jpg" alt="Flexbox를 레이아웃으로 사용" /> 이제 _동일한 수의 요소_ 에 대해 레이아웃 시간을 훨씬 덜 소모하고(이 경우 14ms에서 3.5ms로 단축) 동일한 시각적 모양을 나타낼 수 있습니다. 일부 경우에 [부동 요소보다 덜 지원](http://caniuse.com/#search=flexbox)되기 때문에 Flexbox를 선택할 수 없지만, 최소한 레이아웃 모델의 성능에 미치는 영향을 조사하고 수행 비용을 최소화할 수 있는 레이아웃 모델을 사용해야 합니다. 어떤 경우이든 Flexbox 선택 여부에 상관없이 애플리케이션에 많은 부담을 주는 경우 **레이아웃 트리거를 완전히 피하려고 노력**해야 합니다! ## 강제 동기식 레이아웃 피하기 화면에 프레임을 추가하는 순서는 다음과 같습니다. <img src="images/avoid-large-complex-layouts-and-layout-thrashing/frame.jpg" alt="Flexbox를 레이아웃으로 사용" /> 자바스크립트를 실행한 _후_ 스타일 계산을 수행한 _후_ 에 레이아웃을 실행합니다. 하지만 자바스크립트를 사용하여 브라우저가 레이아웃을 더 일찍 수행하도록 하는 것도 가능합니다. 이를 **강제 동기식 레이아웃**이라고 합니다. 자바스크립트가 실행할 때 이전 프레임의 모든 이전 레이아웃 값은 알려져 있고 쿼리에 사용할 수 있습니다. 따라서 예를 들어, 프레임 시작 시 요소('상자'라고 합시다)의 높이를 기록하려면 다음과 같은 코드를 작성할 수 있습니다. // Schedule our function to run at the start of the frame. requestAnimationFrame(logBoxHeight); function logBoxHeight() { // Gets the height of the box in pixels and logs it out. console.log(box.offsetHeight); } 높이를 요청하기 _전에_ 상자의 스타일을 변경한 경우 문제가 발생할 수 있습니다. function logBoxHeight() { box.classList.add('super-big'); // Gets the height of the box in pixels // and logs it out. console.log(box.offsetHeight); } 이제 높이 질문에 답변하기 위해 브라우저는 _먼저_ 스타일 변경을 적용한 _후에_(`super-big` 클래스를 추가했기 때문에), 레이아웃을 실행해야 합니다. 그래야만 정확한 높이를 반환할 수 있습니다. 이는 불필요하고 잠재적으로 비용이 많이 드는 작업입니다. 이 때문에 항상 스타일 읽기를 일괄 처리하고 먼저 수행한 다음(이때 브라우저가 이전 프레임의 레이아웃 값을 사용할 수 있음) 쓰기를 수행해야 합니다. 위의 기능을 정확히 수행하면 다음과 같이 됩니다. function logBoxHeight() { // Gets the height of the box in pixels // and logs it out. console.log(box.offsetHeight); box.classList.add('super-big'); } 대부분의 경우 스타일을 적용한 다음 값을 쿼리할 필요가 없습니다. 마지막 프레임의 값을 사용하면 충분합니다. 브라우저가 원하는 시간보다 일찍 스타일 계산과 레이아웃을 동시에 실행하면 잠재적 병목 현상이 발생할 수 있으므로 일반적으로 바람직하지 않습니다. ## 레이아웃 스래싱 피하기 _많은 레이아웃을 연속적으로 빠르게 실행_ 하면 강제 동기식 레이아웃이 더 악화됩니다. 다음 코드를 살펴봅시다. function resizeAllParagraphsToMatchBlockWidth() { // Puts the browser into a read-write-read-write cycle. for (var i = 0; i < paragraphs.length; i++) { paragraphs[i].style.width = box.offsetWidth + 'px'; } } 이 코드는 단락 그룹을 반복 실행하고 각 단락의 너비를 “box” 요소의 너비와 일치하도록 설정합니다. 무해한 것처럼 보이지만 각 루프 반복이 스타일 값(`box.offsetWidth`)을 읽은 다음 즉시 이 값을 사용하여 단락의 너비(`paragraphs[i].style.width`)를 업데이트하는 문제가 있습니다. 다음 루프 반복에서 브라우저는 (이전 반복에서) `offsetWidth`가 마지막으로 요청된 이후 스타일이 변경되었고 따라서 스타일 변경을 적용하고 레이아웃을 실행해야 한다는 사실을 고려해야 합니다. 이는 _모든 단일 반복_에서 발생합니다! 이 샘플을 수정하려면 값을 다시 _읽은_ 다음 _써야_ 합니다. // Read. var width = box.offsetWidth; function resizeAllParagraphsToMatchBlockWidth() { for (var i = 0; i < paragraphs.length; i++) { // Now write. paragraphs[i].style.width = width + 'px'; } } 안전을 보장하려면 읽기 및 쓰기를 자동으로 일괄 처리하는 [FastDOM](https://github.com/wilsonpage/fastdom)을 확인하고, 실수로 강제 동기식 레이아웃 또는 레이아웃 스래싱을 트리거하지 않도록 해야 합니다. {# wf_devsite_translation #}
{ "pile_set_name": "Github" }
package builder import ( "bytes" "errors" "fmt" "io" "io/ioutil" "regexp" "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/httputils" "github.com/docker/docker/pkg/urlutil" ) // When downloading remote contexts, limit the amount (in bytes) // to be read from the response body in order to detect its Content-Type const maxPreambleLength = 100 const acceptableRemoteMIME = `(?:application/(?:(?:x\-)?tar|octet\-stream|((?:x\-)?(?:gzip|bzip2?|xz)))|(?:text/plain))` var mimeRe = regexp.MustCompile(acceptableRemoteMIME) // MakeRemoteContext downloads a context from remoteURL and returns it. // // If contentTypeHandlers is non-nil, then the Content-Type header is read along with a maximum of // maxPreambleLength bytes from the body to help detecting the MIME type. // Look at acceptableRemoteMIME for more details. // // If a match is found, then the body is sent to the contentType handler and a (potentially compressed) tar stream is expected // to be returned. If no match is found, it is assumed the body is a tar stream (compressed or not). // In either case, an (assumed) tar stream is passed to MakeTarSumContext whose result is returned. func MakeRemoteContext(remoteURL string, contentTypeHandlers map[string]func(io.ReadCloser) (io.ReadCloser, error)) (ModifiableContext, error) { f, err := httputils.Download(remoteURL) if err != nil { return nil, fmt.Errorf("error downloading remote context %s: %v", remoteURL, err) } defer f.Body.Close() var contextReader io.ReadCloser if contentTypeHandlers != nil { contentType := f.Header.Get("Content-Type") clen := f.ContentLength contentType, contextReader, err = inspectResponse(contentType, f.Body, clen) if err != nil { return nil, fmt.Errorf("error detecting content type for remote %s: %v", remoteURL, err) } defer contextReader.Close() // This loop tries to find a content-type handler for the detected content-type. // If it could not find one from the caller-supplied map, it tries the empty content-type `""` // which is interpreted as a fallback handler (usually used for raw tar contexts). for _, ct := range []string{contentType, ""} { if fn, ok := contentTypeHandlers[ct]; ok { defer contextReader.Close() if contextReader, err = fn(contextReader); err != nil { return nil, err } break } } } // Pass through - this is a pre-packaged context, presumably // with a Dockerfile with the right name inside it. return MakeTarSumContext(contextReader) } // DetectContextFromRemoteURL returns a context and in certain cases the name of the dockerfile to be used // irrespective of user input. // progressReader is only used if remoteURL is actually a URL (not empty, and not a Git endpoint). func DetectContextFromRemoteURL(r io.ReadCloser, remoteURL string, createProgressReader func(in io.ReadCloser) io.ReadCloser) (context ModifiableContext, dockerfileName string, err error) { switch { case remoteURL == "": context, err = MakeTarSumContext(r) case urlutil.IsGitURL(remoteURL): context, err = MakeGitContext(remoteURL) case urlutil.IsURL(remoteURL): context, err = MakeRemoteContext(remoteURL, map[string]func(io.ReadCloser) (io.ReadCloser, error){ httputils.MimeTypes.TextPlain: func(rc io.ReadCloser) (io.ReadCloser, error) { dockerfile, err := ioutil.ReadAll(rc) if err != nil { return nil, err } // dockerfileName is set to signal that the remote was interpreted as a single Dockerfile, in which case the caller // should use dockerfileName as the new name for the Dockerfile, irrespective of any other user input. dockerfileName = DefaultDockerfileName // TODO: return a context without tarsum r, err := archive.Generate(dockerfileName, string(dockerfile)) if err != nil { return nil, err } return ioutil.NopCloser(r), nil }, // fallback handler (tar context) "": func(rc io.ReadCloser) (io.ReadCloser, error) { return createProgressReader(rc), nil }, }) default: err = fmt.Errorf("remoteURL (%s) could not be recognized as URL", remoteURL) } return } // inspectResponse looks into the http response data at r to determine whether its // content-type is on the list of acceptable content types for remote build contexts. // This function returns: // - a string representation of the detected content-type // - an io.Reader for the response body // - an error value which will be non-nil either when something goes wrong while // reading bytes from r or when the detected content-type is not acceptable. func inspectResponse(ct string, r io.ReadCloser, clen int64) (string, io.ReadCloser, error) { plen := clen if plen <= 0 || plen > maxPreambleLength { plen = maxPreambleLength } preamble := make([]byte, plen, plen) rlen, err := r.Read(preamble) if rlen == 0 { return ct, r, errors.New("empty response") } if err != nil && err != io.EOF { return ct, r, err } preambleR := bytes.NewReader(preamble) bodyReader := ioutil.NopCloser(io.MultiReader(preambleR, r)) // Some web servers will use application/octet-stream as the default // content type for files without an extension (e.g. 'Dockerfile') // so if we receive this value we better check for text content contentType := ct if len(ct) == 0 || ct == httputils.MimeTypes.OctetStream { contentType, _, err = httputils.DetectContentType(preamble) if err != nil { return contentType, bodyReader, err } } contentType = selectAcceptableMIME(contentType) var cterr error if len(contentType) == 0 { cterr = fmt.Errorf("unsupported Content-Type %q", ct) contentType = ct } return contentType, bodyReader, cterr } func selectAcceptableMIME(ct string) string { return mimeRe.FindString(ct) }
{ "pile_set_name": "Github" }
# Change Log All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. <a name="1.7.2"></a> ## [1.7.2](https://github.com/sarneeh/reaptcha/compare/v1.7.1...v1.7.2) (2019-12-28) ### Bug Fixes - update component on className change ([3a376d4](https://github.com/sarneeh/reaptcha/commit/3a376d4)), closes [#189](https://github.com/sarneeh/reaptcha/issues/189) <a name="1.7.1"></a> ## [1.7.1](https://github.com/sarneeh/reaptcha/compare/v1.7.0...v1.7.1) (2019-12-28) ### Bug Fixes - add getResponse method ([ab57db7](https://github.com/sarneeh/reaptcha/commit/ab57db7)) <a name="1.7.0"></a> # [1.7.0](https://github.com/sarneeh/reaptcha/compare/v1.6.0...v1.7.0) (2019-10-20) ### Bug Fixes - add missing render prop ([2137d81](https://github.com/sarneeh/reaptcha/commit/2137d81)) - cant call this.props.children cause getResponse missing ([77ee190](https://github.com/sarneeh/reaptcha/commit/77ee190)) - resolve and reject not defined ([eac3a13](https://github.com/sarneeh/reaptcha/commit/eac3a13)) ### Features - added getResponse to types ([33d6d16](https://github.com/sarneeh/reaptcha/commit/33d6d16)) - exposed getResponse ([c0793aa](https://github.com/sarneeh/reaptcha/commit/c0793aa)) <a name="1.5.1"></a> ## [1.5.1](https://github.com/sarneeh/reaptcha/compare/v1.5.0...v1.5.1) (2019-06-28) **Note:** Version bump only for package reaptcha <a name="1.5.0"></a> # [1.5.0](https://github.com/sarneeh/reaptcha/compare/v1.4.2...v1.5.0) (2019-05-25) ### Bug Fixes - **theme:** support invisible dark mode ([44c6c82](https://github.com/sarneeh/reaptcha/commit/44c6c82)) <a name="1.4.2"></a> ## [1.4.2](https://github.com/sarneeh/reaptcha/compare/v1.4.1...v1.4.2) (2019-01-18) ### Bug Fixes - script detection ([5634d35](https://github.com/sarneeh/reaptcha/commit/5634d35)), closes [#18](https://github.com/sarneeh/reaptcha/issues/18) <a name="1.4.1"></a> ## [1.4.1](https://github.com/sarneeh/reaptcha/compare/v1.4.0...v1.4.1) (2019-01-11) **Note:** Version bump only for package reaptcha <a name="1.4.0"></a> # [1.4.0](https://github.com/sarneeh/reaptcha/compare/v1.3.0...v1.4.0) (2018-10-25) ### Bug Fixes - ava tests on babel 7 ([4370fc6](https://github.com/sarneeh/reaptcha/commit/4370fc6)) - babel-loader version bump breaking build ([2ed8d81](https://github.com/sarneeh/reaptcha/commit/2ed8d81)) - better test when hl parameter is not specified ([eed56be](https://github.com/sarneeh/reaptcha/commit/eed56be)) - if hl param is specified, inject it in script ([2ad96a8](https://github.com/sarneeh/reaptcha/commit/2ad96a8)) - use props hl to init script to set up the correct language ([ebeb734](https://github.com/sarneeh/reaptcha/commit/ebeb734)) <a name="1.3.0"></a> # [1.3.0](https://github.com/sarneeh/reaptcha/compare/v1.2.1...v1.3.0) (2018-07-22) ### Bug Fixes - cleanup on unmount, removed deprecated react methods ([7c30ba4](https://github.com/sarneeh/reaptcha/commit/7c30ba4)), closes [#29](https://github.com/sarneeh/reaptcha/issues/29) [#28](https://github.com/sarneeh/reaptcha/issues/28) [#26](https://github.com/sarneeh/reaptcha/issues/26) - do not inject script when one already present ([5db105d](https://github.com/sarneeh/reaptcha/commit/5db105d)), closes [#18](https://github.com/sarneeh/reaptcha/issues/18) <a name="1.2.1"></a> ## [1.2.1](https://github.com/sarneeh/reaptcha/compare/v1.2.0...v1.2.1) (2018-07-04) ### Bug Fixes - default container classname ([d2071fa](https://github.com/sarneeh/reaptcha/commit/d2071fa)) <a name="1.2.0"></a> # [1.2.0](https://github.com/sarneeh/reaptcha/compare/v1.1.0...v1.2.0) (2018-07-04) ### Features - **render:** language support with `hl` ([7bd5e90](https://github.com/sarneeh/reaptcha/commit/7bd5e90)) <a name="1.1.0"></a> # [1.1.0](https://github.com/sarneeh/reaptcha/compare/v1.0.0...v1.1.0) (2018-06-13) ### Features - make package usable in script tags ([c5ac515](https://github.com/sarneeh/reaptcha/commit/c5ac515)) <a name="1.1.0-beta.1"></a> # [1.1.0-beta.1](https://github.com/sarneeh/reaptcha/compare/v1.0.0...v1.1.0-beta.1) (2018-06-13) ### Features - make package usable in script tags ([ac0733a](https://github.com/sarneeh/reaptcha/commit/ac0733a)) <a name="1.1.0-beta.0"></a> # [1.1.0-beta.0](https://github.com/sarneeh/reaptcha/compare/v1.0.0...v1.1.0-beta.0) (2018-06-13) ### Features - make package usable in script tags ([ac0733a](https://github.com/sarneeh/reaptcha/commit/ac0733a)) <a name="1.0.0"></a> # [1.0.0](https://github.com/sarneeh/reaptcha/compare/v0.1.0-beta.1...v1.0.0) (2018-06-13) **Note:** Version bump only for package reaptcha <a name="0.1.0-beta.1"></a> # [0.1.0-beta.1](https://github.com/sarneeh/reaptcha/compare/v0.1.0-beta.0...v0.1.0-beta.1) (2018-06-13) ### Bug Fixes - don't reset on execution ([8047e1e](https://github.com/sarneeh/reaptcha/commit/8047e1e)) - reset recaptcha before execute ([e75a355](https://github.com/sarneeh/reaptcha/commit/e75a355)) <a name="0.1.0-beta.0"></a> # 0.1.0-beta.0 (2018-06-12) **Note:** Version bump only for package reaptcha
{ "pile_set_name": "Github" }
module.exports = { parallel : require('./parallel.js'), serial : require('./serial.js'), serialOrdered : require('./serialOrdered.js') };
{ "pile_set_name": "Github" }
#ifndef _INCLUDE_UTILS_H #define _INCLUDE_UTILS_H #include "common.h" void* memManager(VM* vm, void* ptr, uint32_t oldSize, uint32_t newSize); #define ALLOCATE(vmPtr, type) \ (type*)memManager(vmPtr, NULL, 0, sizeof(type)) #define ALLOCATE_EXTRA(vmPtr, mainType, extraSize) \ (mainType*)memManager(vmPtr, NULL, 0, sizeof(mainType) + extraSize) #define ALLOCATE_ARRAY(vmPtr, type, count) \ (type*)memManager(vmPtr, NULL, 0, sizeof(type) * count) #define DEALLOCATE_ARRAY(vmPtr, arrayPtr, count) \ memManager(vmPtr, arrayPtr, sizeof(arrayPtr[0]) * count, 0) #define DEALLOCATE(vmPtr, memPtr) memManager(vmPtr, memPtr, 0, 0) uint32_t ceilToPowerOf2(uint32_t v); typedef struct { char* str; uint32_t length; } String; typedef struct { uint32_t length; //除结束'\0'之外的字符个数 char start[0]; //类似c99中的柔性数组 } CharValue; //字符串缓冲区 //声明buffer类型 #define DECLARE_BUFFER_TYPE(type)\ typedef struct {\ /* 数据缓冲区 */ \ type* datas;\ /*缓冲区中已使用的元素个数*/\ uint32_t count;\ /*缓冲区容量用*/\ uint32_t capacity;\ } type##Buffer;\ void type##BufferInit(type##Buffer* buf);\ void type##BufferFillWrite(VM* vm, \ type##Buffer* buf, type data, uint32_t fillCount);\ void type##BufferAdd(VM* vm, type##Buffer* buf, type data);\ void type##BufferClear(VM* vm, type##Buffer* buf); //定义buffer方法 #define DEFINE_BUFFER_METHOD(type)\ void type##BufferInit(type##Buffer* buf) {\ buf->datas = NULL;\ buf->count = buf->capacity = 0;\ }\ \ void type##BufferFillWrite(VM* vm, \ type##Buffer* buf, type data, uint32_t fillCount) {\ uint32_t newCounts = buf->count + fillCount;\ if (newCounts > buf->capacity) {\ size_t oldSize = buf->capacity * sizeof(type);\ buf->capacity = ceilToPowerOf2(newCounts);\ size_t newSize = buf->capacity * sizeof(type);\ ASSERT(newSize > oldSize, "faint...memory allocate!");\ buf->datas = (type*)memManager(vm, buf->datas, oldSize, newSize);\ }\ uint32_t cnt = 0;\ while (cnt < fillCount) {\ buf->datas[buf->count++] = data;\ cnt++;\ }\ }\ \ void type##BufferAdd(VM* vm, type##Buffer* buf, type data) {\ type##BufferFillWrite(vm, buf, data, 1);\ }\ \ void type##BufferClear(VM* vm, type##Buffer* buf) {\ size_t oldSize = buf->capacity * sizeof(buf->datas[0]);\ memManager(vm, buf->datas, oldSize, 0);\ type##BufferInit(buf);\ } DECLARE_BUFFER_TYPE(String) #define SymbolTable StringBuffer typedef uint8_t Byte; typedef char Char; typedef int Int; DECLARE_BUFFER_TYPE(Int) DECLARE_BUFFER_TYPE(Char) DECLARE_BUFFER_TYPE(Byte) typedef enum { ERROR_IO, ERROR_MEM, ERROR_LEX, ERROR_COMPILE, ERROR_RUNTIME } ErrorType; void errorReport(void* parser, ErrorType errorType, const char* fmt, ...); void symbolTableClear(VM*, SymbolTable* buffer); #define IO_ERROR(...)\ errorReport(NULL, ERROR_IO, __VA_ARGS__) #define MEM_ERROR(...)\ errorReport(NULL, ERROR_MEM, __VA_ARGS__) #define LEX_ERROR(parser, ...)\ errorReport(parser, ERROR_LEX, __VA_ARGS__) #define COMPILE_ERROR(parser, ...)\ errorReport(parser, ERROR_COMPILE, __VA_ARGS__) #define RUN_ERROR(...)\ errorReport(NULL, ERROR_RUNTIME, __VA_ARGS__) #define DEFAULT_BUfFER_SIZE 512 #endif
{ "pile_set_name": "Github" }
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * This file is available under and governed by the GNU General Public * License version 2 only, as published by the Free Software Foundation. * However, the following notice accompanied the original version of this * file: * * ASM: a very small and fast Java bytecode manipulation framework * Copyright (c) 2000-2011 INRIA, France Telecom * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.internal.org.objectweb.asm; import java.util.Arrays; /** * A non standard class, field, method or code attribute. * * @author Eric Bruneton * @author Eugene Kuleshov */ public class Attribute { /** * The type of this attribute. */ public final String type; /** * The raw value of this attribute, used only for unknown attributes. */ byte[] value; /** * The next attribute in this attribute list. May be <tt>null</tt>. */ Attribute next; /** * Constructs a new empty attribute. * * @param type * the type of the attribute. */ protected Attribute(final String type) { this.type = type; } /** * Returns <tt>true</tt> if this type of attribute is unknown. The default * implementation of this method always returns <tt>true</tt>. * * @return <tt>true</tt> if this type of attribute is unknown. */ public boolean isUnknown() { return true; } /** * Returns <tt>true</tt> if this type of attribute is a code attribute. * * @return <tt>true</tt> if this type of attribute is a code attribute. */ public boolean isCodeAttribute() { return false; } /** * Returns the labels corresponding to this attribute. * * @return the labels corresponding to this attribute, or <tt>null</tt> if * this attribute is not a code attribute that contains labels. */ protected Label[] getLabels() { return null; } /** * Reads a {@link #type type} attribute. This method must return a * <i>new</i> {@link Attribute} object, of type {@link #type type}, * corresponding to the <tt>len</tt> bytes starting at the given offset, in * the given class reader. * * @param cr * the class that contains the attribute to be read. * @param off * index of the first byte of the attribute's content in * {@link ClassReader#b cr.b}. The 6 attribute header bytes, * containing the type and the length of the attribute, are not * taken into account here. * @param len * the length of the attribute's content. * @param buf * buffer to be used to call {@link ClassReader#readUTF8 * readUTF8}, {@link ClassReader#readClass(int,char[]) readClass} * or {@link ClassReader#readConst readConst}. * @param codeOff * index of the first byte of code's attribute content in * {@link ClassReader#b cr.b}, or -1 if the attribute to be read * is not a code attribute. The 6 attribute header bytes, * containing the type and the length of the attribute, are not * taken into account here. * @param labels * the labels of the method's code, or <tt>null</tt> if the * attribute to be read is not a code attribute. * @return a <i>new</i> {@link Attribute} object corresponding to the given * bytes. */ protected Attribute read(final ClassReader cr, final int off, final int len, final char[] buf, final int codeOff, final Label[] labels) { Attribute attr = new Attribute(type); attr.value = new byte[len]; System.arraycopy(cr.b, off, attr.value, 0, len); return attr; } /** * Returns the byte array form of this attribute. * * @param cw * the class to which this attribute must be added. This * parameter can be used to add to the constant pool of this * class the items that corresponds to this attribute. * @param code * the bytecode of the method corresponding to this code * attribute, or <tt>null</tt> if this attribute is not a code * attributes. * @param len * the length of the bytecode of the method corresponding to this * code attribute, or <tt>null</tt> if this attribute is not a * code attribute. * @param maxStack * the maximum stack size of the method corresponding to this * code attribute, or -1 if this attribute is not a code * attribute. * @param maxLocals * the maximum number of local variables of the method * corresponding to this code attribute, or -1 if this attribute * is not a code attribute. * @return the byte array form of this attribute. */ protected ByteVector write(final ClassWriter cw, final byte[] code, final int len, final int maxStack, final int maxLocals) { ByteVector v = new ByteVector(); v.data = value; v.length = value.length; return v; } /** * Returns the length of the attribute list that begins with this attribute. * * @return the length of the attribute list that begins with this attribute. */ final int getCount() { int count = 0; Attribute attr = this; while (attr != null) { count += 1; attr = attr.next; } return count; } /** * Returns the size of all the attributes in this attribute list. * * @param cw * the class writer to be used to convert the attributes into * byte arrays, with the {@link #write write} method. * @param code * the bytecode of the method corresponding to these code * attributes, or <tt>null</tt> if these attributes are not code * attributes. * @param len * the length of the bytecode of the method corresponding to * these code attributes, or <tt>null</tt> if these attributes * are not code attributes. * @param maxStack * the maximum stack size of the method corresponding to these * code attributes, or -1 if these attributes are not code * attributes. * @param maxLocals * the maximum number of local variables of the method * corresponding to these code attributes, or -1 if these * attributes are not code attributes. * @return the size of all the attributes in this attribute list. This size * includes the size of the attribute headers. */ final int getSize(final ClassWriter cw, final byte[] code, final int len, final int maxStack, final int maxLocals) { Attribute attr = this; int size = 0; while (attr != null) { cw.newUTF8(attr.type); size += attr.write(cw, code, len, maxStack, maxLocals).length + 6; attr = attr.next; } return size; } /** * Writes all the attributes of this attribute list in the given byte * vector. * * @param cw * the class writer to be used to convert the attributes into * byte arrays, with the {@link #write write} method. * @param code * the bytecode of the method corresponding to these code * attributes, or <tt>null</tt> if these attributes are not code * attributes. * @param len * the length of the bytecode of the method corresponding to * these code attributes, or <tt>null</tt> if these attributes * are not code attributes. * @param maxStack * the maximum stack size of the method corresponding to these * code attributes, or -1 if these attributes are not code * attributes. * @param maxLocals * the maximum number of local variables of the method * corresponding to these code attributes, or -1 if these * attributes are not code attributes. * @param out * where the attributes must be written. */ final void put(final ClassWriter cw, final byte[] code, final int len, final int maxStack, final int maxLocals, final ByteVector out) { Attribute attr = this; while (attr != null) { ByteVector b = attr.write(cw, code, len, maxStack, maxLocals); out.putShort(cw.newUTF8(attr.type)).putInt(b.length); out.putByteArray(b.data, 0, b.length); attr = attr.next; } } //The stuff below is temporary - once proper support for nestmate attribute has been added, it can be safely removed. //see also changes in ClassReader.accept. public static class NestMembers extends Attribute { public NestMembers() { super("NestMembers"); } byte[] bytes; String[] classes; @Override protected Attribute read(ClassReader cr, int off, int len, char[] buf, int codeOff, Label[] labels) { int offset = off; NestMembers a = new NestMembers(); int size = cr.readShort(off); a.classes = new String[size]; off += 2; for (int i = 0; i < size ; i++) { a.classes[i] = cr.readClass(off, buf); off += 2; } a.bytes = Arrays.copyOfRange(cr.b, offset, offset + len); return a; } @Override protected ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals) { ByteVector v = new ByteVector(bytes.length); v.putShort(classes.length); for (String s : classes) { v.putShort(cw.newClass(s)); } return v; } } public static class NestHost extends Attribute { byte[] bytes; String clazz; public NestHost() { super("NestHost"); } @Override protected Attribute read(ClassReader cr, int off, int len, char[] buf, int codeOff, Label[] labels) { int offset = off; NestHost a = new NestHost(); a.clazz = cr.readClass(off, buf); a.bytes = Arrays.copyOfRange(cr.b, offset, offset + len); return a; } @Override protected ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals) { ByteVector v = new ByteVector(bytes.length); v.putShort(cw.newClass(clazz)); return v; } } static final Attribute[] DEFAULT_ATTRIBUTE_PROTOS = new Attribute[] { new NestMembers(), new NestHost() }; }
{ "pile_set_name": "Github" }
import numpy as np from numpy import fromiter, int32 from arsenal.alphabet import Alphabet from crf.basecrf import CRF def build_domain(data): """ Do feature extraction to determine the set of *supported* featues, i.e. those active in the ground truth configuration and active labels. This function will each features and label an integer. """ L = Alphabet() A = Alphabet() for x in data: L.add_many(x.truth) A.add_many(f for token in x.sequence for f in token.attributes) # domains are now ready L.freeze() A.stop_growth() return (L, A) class Instance(object): def __init__(self, s, truth=None): self.sequence = list(s) self.truth = truth self.N = len(s) # CRF will cache data here self.feature_table = None self.target_features = None class Token(object): def __init__(self, form): self.form = form self.attributes = [] def add(self, features): """ Add features to this Token. """ self.attributes.extend(features) class StringCRF(CRF): """ Conditional Random Field (CRF) for linear-chain structured models with string-valued labels and features. This implementation of StringCRF differs from encodes features in a memory efficient fashion; instead of computing the feature_table for all (t,yp,p) pairs we do an on-the-fly conjunction with the label. """ def __init__(self, label_alphabet, feature_alphabet): self.label_alphabet = label_alphabet self.feature_alphabet = feature_alphabet CRF.__init__(self, len(self.label_alphabet), len(self.feature_alphabet)) def __call__(self, x): return self.label_alphabet.lookup_many(CRF.__call__(self, x)) def preprocess(self, data): """ preprocessing hook which caches the ``feature_table`` and ``target_features`` attributes of a Instance. """ A = self.feature_alphabet L = self.label_alphabet size = (len(A) + len(L))*len(L) if self.W.shape[0] != size: print('reallocating weight vector.') self.W = np.zeros(size) for x in data: # cache feature_table if x.feature_table is None: x.feature_table = FeatureVectorSequence(x, A, L) # cache target_features if x.target_features is None: x.target_features = self.path_features(x, list(L.map(x.truth))) class FeatureVectorSequence(object): def __init__(self, instance, A, L): self.sequence = [fromiter(A.map(t.attributes), dtype=int32) for t in instance.sequence] self.A = len(A) self.L = len(L) def __getitem__(self, item): # Conjunction with label happends on the fly in this version. (t,yp,y) = item token = self.sequence[t] if yp is not None: # This is basically the math used to index a 2d array. return np.append(token, yp) + y*self.A else: return token + y*self.A
{ "pile_set_name": "Github" }
name: Publish::Delicious author: Tsutomu Koyacho depends: Net::Delicious: 0
{ "pile_set_name": "Github" }
// minus.hpp // // (C) Copyright 2011 Vicente J. Botet Escriba // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt). // #ifndef BOOST_RATIO_MPL_MINUS_HPP #define BOOST_RATIO_MPL_MINUS_HPP #include <boost/ratio/ratio.hpp> #include <boost/ratio/mpl/numeric_cast.hpp> #include <boost/mpl/minus.hpp> namespace boost { namespace mpl { template<> struct minus_impl< rational_c_tag,rational_c_tag > { template< typename R1, typename R2 > struct apply : ratio_subtract<R1, R2> { }; }; } } #endif // BOOST_RATIO_MPL_MINUS_HPP
{ "pile_set_name": "Github" }
package tmall.exception; public class AuthException extends Exception { public AuthException(String message) { super(message); } }
{ "pile_set_name": "Github" }
package \${groupId} import griffon.core.artifact.ArtifactManager import griffon.test.core.GriffonUnitRule import griffon.test.core.TestFor import org.junit.Rule import org.junit.Test import javax.inject.Inject import static org.awaitility.Awaitility.await @TestFor(AppController) class AppControllerTest { static { System.setProperty('org.slf4j.simpleLogger.defaultLogLevel', 'trace') // force initialization JavaFX Toolkit new javafx.embed.swing.JFXPanel() } @Inject private ArtifactManager artifactManager private AppController controller @Rule public final GriffonUnitRule griffon = new GriffonUnitRule() @Test void executeClickAction() { // given: controller.model = artifactManager.newInstance(AppModel) // when: controller.invokeAction('click') await().until { controller.model.clickCount != "0" } // then: assert "1" == controller.model.clickCount } }
{ "pile_set_name": "Github" }
<?php namespace Oro\Bundle\TaxBundle\Tests\Functional\DataFixtures; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common\DataFixtures\DependentFixtureInterface; use Doctrine\Common\Persistence\ObjectManager; use Oro\Bundle\TaxBundle\Entity\CustomerTaxCode; use Oro\Bundle\TaxBundle\Entity\ProductTaxCode; use Oro\Bundle\TaxBundle\Entity\Tax; use Oro\Bundle\TaxBundle\Entity\TaxJurisdiction; use Oro\Bundle\TaxBundle\Entity\TaxRule; class LoadTaxRules extends AbstractFixture implements DependentFixtureInterface { const TAX_RULE_1 = 'TAX_RULE_1'; const TAX_RULE_2 = 'TAX_RULE_2'; const TAX_RULE_3 = 'TAX_RULE_3'; const TAX_RULE_4 = 'TAX_RULE_4'; const DESCRIPTION = 'Tax rule description 1'; const REFERENCE_PREFIX = 'tax_rule'; /** * {@inheritdoc} */ public function getDependencies() { return [ 'Oro\Bundle\TaxBundle\Tests\Functional\DataFixtures\LoadCustomerTaxCodes', 'Oro\Bundle\TaxBundle\Tests\Functional\DataFixtures\LoadProductTaxCodes', 'Oro\Bundle\TaxBundle\Tests\Functional\DataFixtures\LoadTaxes', 'Oro\Bundle\TaxBundle\Tests\Functional\DataFixtures\LoadTaxJurisdictions', ]; } /** * {@inheritdoc} */ public function load(ObjectManager $manager) { /** @var CustomerTaxCode $customerTaxCode */ $customerTaxCode = $this->getReference(LoadCustomerTaxCodes::REFERENCE_PREFIX.'.'.LoadCustomerTaxCodes::TAX_1); /** @var productTaxCode $productTaxCode */ $productTaxCode = $this->getReference(LoadProductTaxCodes::REFERENCE_PREFIX . '.' . LoadProductTaxCodes::TAX_1); /** @var Tax $tax */ $tax = $this->getReference(LoadTaxes::REFERENCE_PREFIX . '.' . LoadTaxes::TAX_1); /** @var TaxJurisdiction $taxJurisdiction */ $taxJurisdiction = $this->getReference( LoadTaxJurisdictions::REFERENCE_PREFIX . '.' . LoadTaxes::TAX_1 ); /** @var TaxJurisdiction $taxJurisdiction2 */ $taxJurisdiction2 = $this->getReference( LoadTaxJurisdictions::REFERENCE_PREFIX . '.' . LoadTaxes::TAX_2 ); /** @var TaxJurisdiction $taxJurisdiction3 */ $taxJurisdiction3 = $this->getReference( LoadTaxJurisdictions::REFERENCE_PREFIX . '.' . LoadTaxes::TAX_3 ); /** @var TaxJurisdiction $taxJurisdiction4 */ $taxJurisdiction4 = $this->getReference( LoadTaxJurisdictions::REFERENCE_PREFIX . '.' . LoadTaxes::TAX_4 ); $this->createTaxRule( $manager, $customerTaxCode, $productTaxCode, $tax, $taxJurisdiction, self::DESCRIPTION, self::TAX_RULE_1 ); $this->createTaxRule( $manager, $customerTaxCode, $productTaxCode, $tax, $taxJurisdiction2, self::DESCRIPTION, self::TAX_RULE_2 ); $this->createTaxRule( $manager, $customerTaxCode, $productTaxCode, $tax, $taxJurisdiction3, self::DESCRIPTION, self::TAX_RULE_3 ); $this->createTaxRule( $manager, $customerTaxCode, $productTaxCode, $tax, $taxJurisdiction4, self::DESCRIPTION, self::TAX_RULE_4 ); $manager->flush(); } /** * @param ObjectManager $manager * @param CustomerTaxCode $customerTaxCode * @param ProductTaxCode $productTaxCode * @param Tax $tax * @param TaxJurisdiction $taxJurisdiction * @param string $description * @param string $reference * @return TaxRule */ protected function createTaxRule( ObjectManager $manager, CustomerTaxCode $customerTaxCode, ProductTaxCode $productTaxCode, Tax $tax, TaxJurisdiction $taxJurisdiction, $description, $reference ) { $taxRule = new TaxRule(); $taxRule ->setCustomerTaxCode($customerTaxCode) ->setProductTaxCode($productTaxCode) ->setTax($tax) ->setTaxJurisdiction($taxJurisdiction) ->setDescription($description); $manager->persist($taxRule); $this->addReference(static::REFERENCE_PREFIX . '.' . $reference, $taxRule); return $taxRule; } }
{ "pile_set_name": "Github" }
M2HTML Release 1.5 (2005/05/01): ================================ New features: - added 'helptocxml' fields in options to create a 'helptoc.xml' file used by Matlab documentation system - some directories can be ignored when searching M-files (created by versioning systems for example) Bug fixes: - updated list of mexfile extensions (MacIntosh and 64bits processors) - dealing with space characters in front of 'function xxx' M2HTML Release 1.4 (2004/05/05): ================================ Changes: - a warning is printed if the HTML index file is going to overwrite an HTML M-file - 'load' parameter can be a MAT-file (m2html.mat) or the HTML output directory - added 'rootdir' and 'language' fields in options, for further use (=> previously saved mat-files may appear incomplete) New features: - PHP search engine available (but slow search index generation) in beta version. <private/doxyread.m> works as a Matlab offline search engine - full dependency graph output when 'graph' and 'global' options are 'on' - Graphical User Interface in beta version <mwizard.m> Bug fixes: - corrected the checking of template files (<exist>...) (thanks Peter) - added a call to <entity> when writing "purpose" to escape HTML entities - detected a bug with <copyfile> on Matlab R13: display of a warning - added quotes around 'dot_exec' to handle white spaces (thanks Mattias) - a default 'mex' icon is displayed even if no source code is found - replaced strtok delimiter [9:13 32 '('] by [9:13 32 40] M2HTML Release 1.3 (2003/10/26): ================================ Changes: - default input M-files ('mFiles') are now the M-files found in the direct subdirectories of the current directory (pwd). - default output directory ('htmlDir') is now 'doc' - added link to online tutorial in m2html help - modified <master.tpl> for an optional search engine - added a javascript to redirect to frame index in frame's <mfile.tpl> New features: - added an optional download link for each M-file - added <private/doxyread.m> for a future search engine - added <private/doxywrite.m> (idem) - added <private/doxysearch.m> (idem) - added <search.tpl> and <doxysearch.php> in templates (idem) - added <pcode.png> in templates for Pre-Parsed Pseudo-code files (P-files) - added <mwizard.m> and <private/m2htmltoolbarimages.mat> for a future GUI front-end Bug fixes: - added 't' permission when reading/writing files - rewrote subfunction <getmfiles> to handle <exist> behaviour - return a specific warning if an argument of 'mFiles' is a full path - handle white spaces in directories name M2HTML Release 1.2 (2003/08/31): ================================ Available for download on Matlab Central (2003-10-05): <http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=4039>
{ "pile_set_name": "Github" }
//---------------------------------------------------------------------------- /// @file benchmark_objects.cpp /// @brief Benchmark of several sort methods with different objects /// /// @author Copyright (c) 2016 Francisco José Tapia (fjtapia@gmail.com )\n /// Distributed under the Boost Software License, Version 1.0.\n /// ( See accompanying file LICENSE_1_0.txt or copy at /// http://www.boost.org/LICENSE_1_0.txt ) /// /// This program use for comparison purposes, the Threading Building /// Blocks which license is the GNU General Public License, version 2 /// as published by the Free Software Foundation. /// /// @version 0.1 /// /// @remarks //----------------------------------------------------------------------------- #include <algorithm> #include <iostream> #include <iomanip> #include <random> #include <stdlib.h> #include <vector> #include <boost/sort/common/time_measure.hpp> #include <boost/sort/common/file_vector.hpp> #include "boost/sort/common/int_array.hpp" #include <boost/sort/sort.hpp> #define NELEM 100000000 #define NMAXSTRING 10000000 using namespace std; namespace bsort = boost::sort; namespace bsc = bsort::common; using bsc::time_point; using bsc::now; using bsc::subtract_time; using bsc::fill_vector_uint64; using bsc::write_file_uint64; using bsc::int_array; using bsc::H_comp; using bsc::L_comp; using bsort::flat_stable_sort; using bsort::spinsort; using bsort::spreadsort::spreadsort; using bsort::pdqsort; template <class IA> void Generator_random(uint64_t N); template <class IA> void Generator_sorted(uint64_t N); template <class IA> void Generator_sorted_end(uint64_t N, size_t n_last ); template <class IA> void Generator_sorted_middle(uint64_t N, size_t n_last ); template <class IA> void Generator_reverse_sorted(uint64_t N); template <class IA> void Generator_reverse_sorted_end(uint64_t N, size_t n_last ); template <class IA> void Generator_reverse_sorted_middle(uint64_t N, size_t n_last ); template < class IA > struct H_rightshift { inline uint64_t operator()(const IA& A1, unsigned offset) { return A1.counter() >> offset; } }; template < class IA > struct L_rightshift { inline uint64_t operator()(const IA& A1, unsigned offset) { return A1.M[0] >> offset; } }; template <class IA, class rightshift, class compare> int Test(std::vector<IA> &B, rightshift shift, compare comp, std::vector<double> & V ); template <class IA> void Test_size ( uint64_t N); void Print_vectors ( std::vector<double> & V1, std::vector<double> & V2); int main(int argc, char *argv[]) { cout << "\n\n"; cout << "************************************************************\n"; cout << "** **\n"; cout << "** B O O S T S O R T **\n"; cout << "** **\n"; cout << "** O B J E C T S B E N C H M A R K **\n"; cout << "** **\n"; cout << "************************************************************\n"; cout << std::endl; cout << "=============================================================\n"; cout << "= OBJECT COMPARISON =\n"; cout << "= --------------------- =\n"; cout << "= =\n"; cout << "= The objects are arrays of 64 bits numbers =\n"; cout << "= They are compared in two ways : =\n"; cout << "= (H) Heavy : The comparison is the sum of all the numbers =\n"; cout << "= of the array =\n"; cout << "= (L) Light : The comparison is with the first element of =\n"; cout << "= the array, as a key =\n"; cout << "= =\n"; cout << "============================================================\n"; cout << "\n\n"; //----------------------------------------------------------------------- // I N T _ A R R A Y < 1 > //----------------------------------------------------------------------- cout << "************************************************************\n"; cout << "** **\n"; cout << " "<<NELEM<<" OBJECTS UINT64_T [1]\n"; cout << "** **\n"; cout << "************************************************************\n"; Test_size<int_array<1> >(NELEM); //----------------------------------------------------------------------- // I N T _ A R R A Y < 4 > //----------------------------------------------------------------------- cout << "************************************************************\n"; cout << "** **\n"; cout << " "<<(NELEM >>2)<<" OBJECTS UINT64_T [4]\n"; cout << "** **\n"; cout << "************************************************************\n"; Test_size<int_array<4> >(NELEM >> 2); //----------------------------------------------------------------------- // I N T _ A R R A Y < 8 > //----------------------------------------------------------------------- cout << "************************************************************\n"; cout << "** **\n"; cout << " "<<(NELEM >>3)<<" OBJECTS UINT64_T [8]\n"; cout << "** **\n"; cout << "************************************************************\n"; Test_size<int_array<8> >(NELEM >> 3); //----------------------------------------------------------------------- // I N T _ A R R A Y < 1 6 > //----------------------------------------------------------------------- cout << "************************************************************\n"; cout << "** **\n"; cout << " "<<(NELEM >>4)<<" OBJECTS UINT64_T [16]\n"; cout << "** **\n"; cout << "************************************************************\n"; Test_size<int_array<16> >(NELEM >> 4); //----------------------------------------------------------------------- // I N T _ A R R A Y < 6 4 > //----------------------------------------------------------------------- cout << "************************************************************\n"; cout << "** **\n"; cout << " "<< (NELEM >>6)<<" OBJECTS UINT64_T [64]\n"; cout << "** **\n"; cout << "************************************************************\n"; Test_size<int_array<64> >(NELEM >> 6); return 0; } template <class IA> void Test_size ( uint64_t N) { cout<<"\n"; cout<<"[ 1 ] std::sort [ 2 ] pdqsort [ 3 ] std::stable_sort \n"; cout<<"[ 4 ] spinsort [ 5 ] flat_stable_sort [ 6 ] spreadsort\n\n"; cout << " | [ 1 ] | [ 2 ] | [ 3 ] |"; cout << " [ 4 ] | [ 5 ] | [ 6 ] |\n"; //cout << " | | | |"; //cout << " | | |\n"; cout << " | H L | H L | H L |"; cout << " H L | H L | H L |\n"; cout << "--------------------+-----------+-----------+-----------+"; cout << "-----------+-----------+-----------+\n"; std::string empty_line = " | | |" " | | | |\n"; cout<<"random |"; Generator_random<IA>(N); cout<<empty_line; cout<<"sorted |"; Generator_sorted<IA>(N); cout<<"sorted + 0.1% end |"; Generator_sorted_end<IA>(N, N / 1000); cout<<"sorted + 1% end |"; Generator_sorted_end<IA>(N, N / 100); cout<<"sorted + 10% end |"; Generator_sorted_end<IA>(N, N / 10); cout<<empty_line; cout<<"sorted + 0.1% mid |"; Generator_sorted_middle<IA>(N, N / 1000); cout<<"sorted + 1% mid |"; Generator_sorted_middle<IA>(N, N / 100); cout<<"sorted + 10% mid |"; Generator_sorted_middle<IA>(N, N / 10); cout<<empty_line; cout<<"reverse sorted |"; Generator_reverse_sorted<IA>(N); cout<<"rv sorted + 0.1% end|"; Generator_reverse_sorted_end<IA>(N, N / 1000); cout<<"rv sorted + 1% end|"; Generator_reverse_sorted_end<IA>(N, N / 100); cout<<"rv sorted + 10% end|"; Generator_reverse_sorted_end<IA>(N, N / 10); cout<<empty_line; cout<<"rv sorted + 0.1% mid|"; Generator_reverse_sorted_middle<IA>(N, N / 1000); cout<<"rv sorted + 1% mid|"; Generator_reverse_sorted_middle<IA>(N, N / 100); cout<<"rv sorted + 10% mid|"; Generator_reverse_sorted_middle<IA>(N, N / 10); cout<< "--------------------+-----------+-----------+-----------+"; cout << "-----------+-----------+-----------+\n"; cout<<endl<<endl<<endl; } void Print_vectors ( std::vector<double> & V1, std::vector<double> & V2) { assert ( V1.size() == V2.size()); std::cout<<std::setprecision(2)<<std::fixed; for ( uint32_t i =0 ; i < V1.size() ; ++i) { std::cout<<std::right<<std::setw(5)<<V1[i]<<" "; std::cout<<std::right<<std::setw(5)<<V2[i]<<"|"; }; std::cout<<std::endl; } template <class IA> void Generator_random(uint64_t N) { bsc::uint64_file_generator gen("input.bin"); vector<IA> A; A.reserve(N); std::vector<double> V1, V2 ; gen.reset(); A.clear(); for (uint32_t i = 0; i < N; i++) A.emplace_back(IA::generate(gen)); Test(A, H_rightshift<IA>(), H_comp<IA>(), V1); Test(A, L_rightshift<IA>(), L_comp<IA>(), V2); Print_vectors ( V1, V2 ) ; }; template <class IA> void Generator_sorted(uint64_t N) { bsc::uint64_file_generator gen("input.bin"); vector<IA> A; A.reserve(N); std::vector<double> V1, V2 ; gen.reset(); A.clear(); for (uint32_t i = 0; i < N; i++) A.emplace_back(IA::generate(gen)); std::sort( A.begin() , A.end(),H_comp<IA>() ); Test(A, H_rightshift<IA>(), H_comp<IA>(), V1); std::sort( A.begin() , A.end(),L_comp<IA>() ); Test(A, L_rightshift<IA>(), L_comp<IA>(), V2); Print_vectors ( V1, V2 ) ; }; template <class IA> void Generator_sorted_end(uint64_t N, size_t n_last ) { bsc::uint64_file_generator gen("input.bin"); vector<IA> A; A.reserve(N); std::vector<double> V1, V2 ; gen.reset(); A.clear(); for (uint32_t i = 0; i < (N + n_last); i++) A.emplace_back(IA::generate(gen)); std::sort ( A.begin() , A.begin() + N ,H_comp<IA>()); Test(A, H_rightshift<IA>(), H_comp<IA>(),V1); std::sort ( A.begin() , A.begin() + N ,L_comp<IA>()); Test(A, L_rightshift<IA>(), L_comp<IA>(), V2); Print_vectors ( V1, V2 ) ; }; template <class IA> void Generator_sorted_middle(uint64_t N, size_t n_last ) { bsc::uint64_file_generator gen("input.bin"); std::vector<double> V1, V2 ; vector<IA> A; A.reserve(N + n_last); { A.clear() ; gen.reset(); vector<IA> B, C; C.reserve(N + n_last); B.reserve ( n_last); for (uint32_t i = 0; i < (N + n_last); i++) C.emplace_back(IA::generate(gen)); for ( size_t i = N ; i < C.size() ; ++i) B.push_back ( std::move ( C[i])); C.resize ( N); std::sort ( C.begin() , C.end() ,H_comp<IA>()); size_t step = N /n_last ; size_t pos = 0 ; for ( size_t i =0 ; i < B.size() ; ++i) { A.push_back ( B[i]); for ( size_t k = 0 ; k < step ; ++k ) A.push_back ( C[pos++] ); }; while ( pos < C.size() ) A.push_back ( C[pos++]); }; Test(A, H_rightshift<IA>(), H_comp<IA>(), V1); { A.clear() ; gen.reset(); vector<IA> B,C; C.reserve(N + n_last); B.reserve ( n_last); for (uint32_t i = 0; i < (N + n_last); i++) C.emplace_back(IA::generate(gen)); for ( size_t i = N ; i < C.size() ; ++i) B.push_back ( std::move ( C[i])); C.resize ( N); std::sort ( C.begin() , C.end() ,L_comp<IA>()); size_t step = N /n_last ; size_t pos = 0 ; for ( size_t i =0 ; i < B.size() ; ++i) { A.push_back ( B[i]); for ( size_t k = 0 ; k < step ; ++k ) A.push_back ( C[pos++] ); }; while ( pos < C.size() ) A.push_back ( C[pos++]); }; Test(A, L_rightshift<IA>(), L_comp<IA>(), V2); Print_vectors ( V1, V2 ) ; }; template <class IA> void Generator_reverse_sorted(uint64_t N) { bsc::uint64_file_generator gen("input.bin"); vector<IA> A; A.reserve(N); std::vector<double> V1, V2 ; gen.reset(); A.clear(); for (uint32_t i = 0; i < N; i++) A.emplace_back(IA::generate(gen)); std::sort( A.begin() , A.end(),H_comp<IA>() ); for ( size_t i = 0; i < (A.size() >>1) ; ++i) std::swap ( A[i], A[A.size() - i -1 ]); Test(A, H_rightshift<IA>(), H_comp<IA>(), V1); std::sort( A.begin() , A.end(),L_comp<IA>() ); for ( size_t i = 0; i < (A.size() >>1) ; ++i) std::swap ( A[i], A[A.size() - i -1 ]); Test(A, L_rightshift<IA>(), L_comp<IA>(), V2); Print_vectors ( V1, V2 ) ; }; template <class IA> void Generator_reverse_sorted_end(uint64_t N, size_t n_last ) { bsc::uint64_file_generator gen("input.bin"); vector<IA> A; A.reserve(N); std::vector<double> V1, V2 ; gen.reset(); A.clear(); for (uint32_t i = 0; i < (N + n_last); i++) A.emplace_back(IA::generate(gen)); std::sort ( A.begin() , A.begin() + N ,H_comp<IA>()); for ( size_t i =0 ; i < (N>>1); ++i) std::swap ( A[i], A[N-1-i]); Test(A, H_rightshift<IA>(), H_comp<IA>(), V1); std::sort ( A.begin() , A.begin() + N ,L_comp<IA>()); for ( size_t i =0 ; i < (N>>1); ++i) std::swap ( A[i], A[N-1-i]); Test(A, L_rightshift<IA>(), L_comp<IA>(), V2); Print_vectors ( V1, V2 ) ; }; template <class IA> void Generator_reverse_sorted_middle(uint64_t N, size_t n_last ) { bsc::uint64_file_generator gen("input.bin"); std::vector<double> V1, V2 ; vector<IA> A; A.reserve(N + n_last); { A.clear() ; gen.reset(); vector<IA> B,C; C.reserve(N + n_last); B.reserve ( n_last); for (uint32_t i = 0; i < (N + n_last); i++) C.emplace_back(IA::generate(gen)); for ( size_t i = N ; i < C.size() ; ++i) B.push_back ( std::move ( C[i])); C.resize ( N); std::sort ( C.begin() , C.end() ,H_comp<IA>()); for ( size_t i =0 ; i < (N>>1); ++i) std::swap ( C[i], C[N-1-i]); size_t step = N /n_last ; size_t pos = 0 ; for ( size_t i =0 ; i < B.size() ; ++i) { A.push_back ( B[i]); for ( size_t k = 0 ; k < step ; ++k ) A.push_back ( C[pos++ ] ); }; while ( pos < C.size() ) A.push_back ( C[pos++]); }; Test(A, H_rightshift<IA>(), H_comp<IA>(), V1); { A.clear() ; gen.reset(); vector<IA> B,C; C.reserve(N + n_last); B.reserve ( n_last); for (uint32_t i = 0; i < (N + n_last); i++) C.emplace_back(IA::generate(gen)); for ( size_t i = N ; i < C.size() ; ++i) B.push_back ( std::move ( C[i])); C.resize ( N); std::sort ( C.begin() , C.end() ,L_comp<IA>()); for ( size_t i =0 ; i < (N>>1); ++i) std::swap ( C[i], C[N-1-i]); size_t step = N /n_last ; size_t pos = 0 ; for ( size_t i =0 ; i < B.size() ; ++i) { A.push_back ( B[i]); for ( size_t k = 0 ; k < step ; ++k ) A.push_back ( C[pos++ ] ); }; while ( pos < C.size() ) A.push_back ( C[pos++]); }; Test(A, L_rightshift<IA>(), L_comp<IA>(), V2); Print_vectors ( V1, V2 ) ; }; template<class IA, class rightshift, class compare> int Test (std::vector<IA> &B, rightshift shift, compare comp,std::vector<double> &V) { //---------------------------- begin -------------------------------- double duration; time_point start, finish; std::vector<IA> A (B); V.clear() ; //-------------------------------------------------------------------- A = B; start = now (); std::sort (A.begin (), A.end (), comp); finish = now (); duration = subtract_time (finish, start); V.push_back (duration); A = B; start = now (); pdqsort (A.begin (), A.end (), comp); finish = now (); duration = subtract_time (finish, start); V.push_back (duration); A = B; start = now (); std::stable_sort (A.begin (), A.end (), comp); finish = now (); duration = subtract_time (finish, start); V.push_back (duration); A = B; start = now (); spinsort (A.begin (), A.end (), comp); finish = now (); duration = subtract_time (finish, start); V.push_back (duration); A = B; start = now (); flat_stable_sort (A.begin (), A.end (), comp); finish = now (); duration = subtract_time (finish, start); V.push_back (duration); A = B; start = now (); boost::sort::spreadsort::integer_sort (A.begin (), A.end (), shift, comp); finish = now (); duration = subtract_time (finish, start); V.push_back (duration); return 0; };
{ "pile_set_name": "Github" }
/* Copyright 2017 The Kubernetes 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 v1beta1 import ( "strings" "k8s.io/apimachinery/pkg/runtime" ) func addDefaultingFuncs(scheme *runtime.Scheme) error { scheme.AddTypeDefaultingFunc(&CustomResourceDefinition{}, func(obj interface{}) { SetDefaults_CustomResourceDefinition(obj.(*CustomResourceDefinition)) }) // TODO figure out why I can't seem to get my defaulter generated // return RegisterDefaults(scheme) return nil } func SetDefaults_CustomResourceDefinition(obj *CustomResourceDefinition) { SetDefaults_CustomResourceDefinitionSpec(&obj.Spec) } func SetDefaults_CustomResourceDefinitionSpec(obj *CustomResourceDefinitionSpec) { if len(obj.Scope) == 0 { obj.Scope = NamespaceScoped } if len(obj.Names.Singular) == 0 { obj.Names.Singular = strings.ToLower(obj.Names.Kind) } if len(obj.Names.ListKind) == 0 && len(obj.Names.Kind) > 0 { obj.Names.ListKind = obj.Names.Kind + "List" } }
{ "pile_set_name": "Github" }
// Copyright (c) 2001-2011 Hartmut Kaiser // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if !defined(BOOST_SPIRIT_KARMA_DEBUG_HANDLER_STATE_APR_21_2010_0736PM) #define BOOST_SPIRIT_KARMA_DEBUG_HANDLER_STATE_APR_21_2010_0736PM #if defined(_MSC_VER) #pragma once #endif namespace boost { namespace spirit { namespace karma { enum debug_handler_state { pre_generate , successful_generate , failed_generate }; }}} #endif
{ "pile_set_name": "Github" }
Rapidly invoke an editor to write a long, complex, or tricky command Terminal incognito mode Breaking out of a terminal when `ssh` locks Adding directories to your `$PATH` Conditional command execution (`&&` operator)
{ "pile_set_name": "Github" }
## Upgrading your app for Marshmallow + MMS A lot of changes went into Marshmallow, from the permission system to how data can be transported, that will affect your app that uses this library for MMS sending (SMS is unaffected). First and foremost, Apache HTTP utilities have been deprecated and Google now suggests a full move over to using URLConnection. This required a MAJOR change for this library. All changes have been applied and you should now see faster sending and receiving times and more stability. These changes also paved the way for adding support for dual sim devices and this will be coming to the library in the future since Google added support in Android 5.1. The permission system has changed drastically in Marshmallow as well. Previously, this library was able to use the permission CHANGE_NETWORK_STATE to request sending MMS through mobile data instead of WiFi. This is a requirement for most carriers. This permission now has a SIGNATURE level permission, meaning that your app that requests it will not be granted it. To get around this, we need to instead use the WRITE_SETTINGS permission. You can see an example of this in the included sample application. Basically, you'll need to make the following changes: 1) include <uses-permission> tag in your manifest: ```xml <uses-permission android:name="android.permission.WRITE_SETTINGS"/> ``` 2) perform a check at runtime for whether or not you have been granted this permission for users running Marshmallow or higher. If it has not been granted, then launch a UI to allow it: ```java if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.System.canWrite(this)) { new AlertDialog.Builder(this) .setMessage(com.klinker.android.send_message.R.string.write_settings_permission) .setPositiveButton(com.klinker.android.send_message.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Intent intent = new Intent(android.provider.Settings.ACTION_MANAGE_WRITE_SETTINGS); intent.setData(Uri.parse("package:" + getPackageName())); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { startActivity(intent); } catch (Exception e) { Log.e("MainActivity", "error starting permission intent", e); } } }) .show(); return; } ``` Making these changes should allow your app to be updated to Marshmallow using compileSdkVersion 23 without too many issues for sending MMS.
{ "pile_set_name": "Github" }
/* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 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. ==============================================================================*/ #include "tensorflow/lite/tools/list_flex_ops.h" #include <fstream> #include <sstream> #include <string> #include <vector> #include "flatbuffers/flexbuffers.h" // from @flatbuffers #include "json/json.h" #include "tensorflow/core/framework/node_def.pb.h" #include "tensorflow/core/framework/node_def_util.h" #include "tensorflow/core/framework/op.h" #include "tensorflow/core/framework/op_kernel.h" #include "tensorflow/core/platform/logging.h" #include "tensorflow/core/util/device_name_utils.h" #include "tensorflow/lite/util.h" namespace tflite { namespace flex { std::string OpListToJSONString(const OpKernelSet& flex_ops) { Json::Value result(Json::arrayValue); for (const OpKernel& op : flex_ops) { Json::Value op_kernel(Json::arrayValue); op_kernel.append(Json::Value(op.op_name)); op_kernel.append(Json::Value(op.kernel_name)); result.append(op_kernel); } return Json::FastWriter().write(result); } // Find the class name of the op kernel described in the node_def from the pool // of registered ops. If no kernel class is found, return an empty string. string FindTensorflowKernelClass(tensorflow::NodeDef* node_def) { if (!node_def || node_def->op().empty()) { LOG(FATAL) << "Invalid NodeDef"; } const tensorflow::OpRegistrationData* op_reg_data; auto status = tensorflow::OpRegistry::Global()->LookUp(node_def->op(), &op_reg_data); if (!status.ok()) { LOG(FATAL) << "Op " << node_def->op() << " not found: " << status; } AddDefaultsToNodeDef(op_reg_data->op_def, node_def); tensorflow::DeviceNameUtils::ParsedName parsed_name; if (!tensorflow::DeviceNameUtils::ParseFullName(node_def->device(), &parsed_name)) { LOG(FATAL) << "Failed to parse device from node_def: " << node_def->ShortDebugString(); } string class_name; if (!tensorflow::FindKernelDef( tensorflow::DeviceType(parsed_name.type.c_str()), *node_def, nullptr /* kernel_def */, &class_name) .ok()) { LOG(FATAL) << "Failed to find kernel class for op: " << node_def->op(); } return class_name; } void AddFlexOpsFromModel(const tflite::Model* model, OpKernelSet* flex_ops) { // Read flex ops. auto* subgraphs = model->subgraphs(); if (!subgraphs) return; for (int subgraph_index = 0; subgraph_index < subgraphs->size(); ++subgraph_index) { const tflite::SubGraph* subgraph = subgraphs->Get(subgraph_index); auto* operators = subgraph->operators(); auto* opcodes = model->operator_codes(); if (!operators || !opcodes) continue; for (int i = 0; i < operators->size(); ++i) { const tflite::Operator* op = operators->Get(i); const tflite::OperatorCode* opcode = opcodes->Get(op->opcode_index()); if (opcode->builtin_code() != tflite::BuiltinOperator_CUSTOM || !tflite::IsFlexOp(opcode->custom_code()->c_str())) { continue; } // Remove the "Flex" prefix from op name. std::string flex_op_name(opcode->custom_code()->c_str()); std::string tf_op_name = flex_op_name.substr(strlen(tflite::kFlexCustomCodePrefix)); // Read NodeDef and find the op kernel class. if (op->custom_options_format() != tflite::CustomOptionsFormat_FLEXBUFFERS) { LOG(FATAL) << "Invalid CustomOptionsFormat"; } const flatbuffers::Vector<uint8_t>* custom_opt_bytes = op->custom_options(); if (custom_opt_bytes && custom_opt_bytes->size()) { // NOLINTNEXTLINE: It is common to use references with flatbuffer. const flexbuffers::Vector& v = flexbuffers::GetRoot(custom_opt_bytes->data(), custom_opt_bytes->size()) .AsVector(); std::string nodedef_str = v[1].AsString().str(); tensorflow::NodeDef nodedef; if (nodedef_str.empty() || !nodedef.ParseFromString(nodedef_str)) { LOG(FATAL) << "Failed to parse data into a valid NodeDef"; } // Flex delegate only supports running flex ops with CPU. *nodedef.mutable_device() = "/CPU:0"; std::string kernel_class = FindTensorflowKernelClass(&nodedef); flex_ops->insert({tf_op_name, kernel_class}); } } } } } // namespace flex } // namespace tflite
{ "pile_set_name": "Github" }
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var BookSchema = new Schema({ isbn: { type: String, required: true }, title: { type: String, required: true }, author: { type: String, required: true }, publisher: { type: String, required: true } }); module.exports = mongoose.model('Book', BookSchema);
{ "pile_set_name": "Github" }
%table.table.table-striped.attachments.collection %thead %tr %th= t_attr :title, Attachment %th.action-links %tbody = render collection
{ "pile_set_name": "Github" }
package dns import ( "errors" "net" "strconv" ) const hexDigit = "0123456789abcdef" // Everything is assumed in ClassINET. // SetReply creates a reply message from a request message. func (dns *Msg) SetReply(request *Msg) *Msg { dns.Id = request.Id dns.Response = true dns.Opcode = request.Opcode if dns.Opcode == OpcodeQuery { dns.RecursionDesired = request.RecursionDesired // Copy rd bit dns.CheckingDisabled = request.CheckingDisabled // Copy cd bit } dns.Rcode = RcodeSuccess if len(request.Question) > 0 { dns.Question = make([]Question, 1) dns.Question[0] = request.Question[0] } return dns } // SetQuestion creates a question message, it sets the Question // section, generates an Id and sets the RecursionDesired (RD) // bit to true. func (dns *Msg) SetQuestion(z string, t uint16) *Msg { dns.Id = Id() dns.RecursionDesired = true dns.Question = make([]Question, 1) dns.Question[0] = Question{z, t, ClassINET} return dns } // SetNotify creates a notify message, it sets the Question // section, generates an Id and sets the Authoritative (AA) // bit to true. func (dns *Msg) SetNotify(z string) *Msg { dns.Opcode = OpcodeNotify dns.Authoritative = true dns.Id = Id() dns.Question = make([]Question, 1) dns.Question[0] = Question{z, TypeSOA, ClassINET} return dns } // SetRcode creates an error message suitable for the request. func (dns *Msg) SetRcode(request *Msg, rcode int) *Msg { dns.SetReply(request) dns.Rcode = rcode return dns } // SetRcodeFormatError creates a message with FormError set. func (dns *Msg) SetRcodeFormatError(request *Msg) *Msg { dns.Rcode = RcodeFormatError dns.Opcode = OpcodeQuery dns.Response = true dns.Authoritative = false dns.Id = request.Id return dns } // SetUpdate makes the message a dynamic update message. It // sets the ZONE section to: z, TypeSOA, ClassINET. func (dns *Msg) SetUpdate(z string) *Msg { dns.Id = Id() dns.Response = false dns.Opcode = OpcodeUpdate dns.Compress = false // BIND9 cannot handle compression dns.Question = make([]Question, 1) dns.Question[0] = Question{z, TypeSOA, ClassINET} return dns } // SetIxfr creates message for requesting an IXFR. func (dns *Msg) SetIxfr(z string, serial uint32, ns, mbox string) *Msg { dns.Id = Id() dns.Question = make([]Question, 1) dns.Ns = make([]RR, 1) s := new(SOA) s.Hdr = RR_Header{z, TypeSOA, ClassINET, defaultTtl, 0} s.Serial = serial s.Ns = ns s.Mbox = mbox dns.Question[0] = Question{z, TypeIXFR, ClassINET} dns.Ns[0] = s return dns } // SetAxfr creates message for requesting an AXFR. func (dns *Msg) SetAxfr(z string) *Msg { dns.Id = Id() dns.Question = make([]Question, 1) dns.Question[0] = Question{z, TypeAXFR, ClassINET} return dns } // SetTsig appends a TSIG RR to the message. // This is only a skeleton TSIG RR that is added as the last RR in the // additional section. The Tsig is calculated when the message is being send. func (dns *Msg) SetTsig(z, algo string, fudge uint16, timesigned int64) *Msg { t := new(TSIG) t.Hdr = RR_Header{z, TypeTSIG, ClassANY, 0, 0} t.Algorithm = algo t.Fudge = fudge t.TimeSigned = uint64(timesigned) t.OrigId = dns.Id dns.Extra = append(dns.Extra, t) return dns } // SetEdns0 appends a EDNS0 OPT RR to the message. // TSIG should always the last RR in a message. func (dns *Msg) SetEdns0(udpsize uint16, do bool) *Msg { e := new(OPT) e.Hdr.Name = "." e.Hdr.Rrtype = TypeOPT e.SetUDPSize(udpsize) if do { e.SetDo() } dns.Extra = append(dns.Extra, e) return dns } // IsTsig checks if the message has a TSIG record as the last record // in the additional section. It returns the TSIG record found or nil. func (dns *Msg) IsTsig() *TSIG { if len(dns.Extra) > 0 { if dns.Extra[len(dns.Extra)-1].Header().Rrtype == TypeTSIG { return dns.Extra[len(dns.Extra)-1].(*TSIG) } } return nil } // IsEdns0 checks if the message has a EDNS0 (OPT) record, any EDNS0 // record in the additional section will do. It returns the OPT record // found or nil. func (dns *Msg) IsEdns0() *OPT { // EDNS0 is at the end of the additional section, start there. // We might want to change this to *only* look at the last two // records. So we see TSIG and/or OPT - this a slightly bigger // change though. for i := len(dns.Extra) - 1; i >= 0; i-- { if dns.Extra[i].Header().Rrtype == TypeOPT { return dns.Extra[i].(*OPT) } } return nil } // IsDomainName checks if s is a valid domain name, it returns the number of // labels and true, when a domain name is valid. Note that non fully qualified // domain name is considered valid, in this case the last label is counted in // the number of labels. When false is returned the number of labels is not // defined. Also note that this function is extremely liberal; almost any // string is a valid domain name as the DNS is 8 bit protocol. It checks if each // label fits in 63 characters, but there is no length check for the entire // string s. I.e. a domain name longer than 255 characters is considered valid. func IsDomainName(s string) (labels int, ok bool) { _, labels, err := packDomainName(s, nil, 0, nil, false) return labels, err == nil } // IsSubDomain checks if child is indeed a child of the parent. If child and parent // are the same domain true is returned as well. func IsSubDomain(parent, child string) bool { // Entire child is contained in parent return CompareDomainName(parent, child) == CountLabel(parent) } // IsMsg sanity checks buf and returns an error if it isn't a valid DNS packet. // The checking is performed on the binary payload. func IsMsg(buf []byte) error { // Header if len(buf) < 12 { return errors.New("dns: bad message header") } // Header: Opcode // TODO(miek): more checks here, e.g. check all header bits. return nil } // IsFqdn checks if a domain name is fully qualified. func IsFqdn(s string) bool { l := len(s) if l == 0 { return false } return s[l-1] == '.' } // IsRRset checks if a set of RRs is a valid RRset as defined by RFC 2181. // This means the RRs need to have the same type, name, and class. Returns true // if the RR set is valid, otherwise false. func IsRRset(rrset []RR) bool { if len(rrset) == 0 { return false } if len(rrset) == 1 { return true } rrHeader := rrset[0].Header() rrType := rrHeader.Rrtype rrClass := rrHeader.Class rrName := rrHeader.Name for _, rr := range rrset[1:] { curRRHeader := rr.Header() if curRRHeader.Rrtype != rrType || curRRHeader.Class != rrClass || curRRHeader.Name != rrName { // Mismatch between the records, so this is not a valid rrset for //signing/verifying return false } } return true } // Fqdn return the fully qualified domain name from s. // If s is already fully qualified, it behaves as the identity function. func Fqdn(s string) string { if IsFqdn(s) { return s } return s + "." } // Copied from the official Go code. // ReverseAddr returns the in-addr.arpa. or ip6.arpa. hostname of the IP // address suitable for reverse DNS (PTR) record lookups or an error if it fails // to parse the IP address. func ReverseAddr(addr string) (arpa string, err error) { ip := net.ParseIP(addr) if ip == nil { return "", &Error{err: "unrecognized address: " + addr} } if ip.To4() != nil { return strconv.Itoa(int(ip[15])) + "." + strconv.Itoa(int(ip[14])) + "." + strconv.Itoa(int(ip[13])) + "." + strconv.Itoa(int(ip[12])) + ".in-addr.arpa.", nil } // Must be IPv6 buf := make([]byte, 0, len(ip)*4+len("ip6.arpa.")) // Add it, in reverse, to the buffer for i := len(ip) - 1; i >= 0; i-- { v := ip[i] buf = append(buf, hexDigit[v&0xF]) buf = append(buf, '.') buf = append(buf, hexDigit[v>>4]) buf = append(buf, '.') } // Append "ip6.arpa." and return (buf already has the final .) buf = append(buf, "ip6.arpa."...) return string(buf), nil } // String returns the string representation for the type t. func (t Type) String() string { if t1, ok := TypeToString[uint16(t)]; ok { return t1 } return "TYPE" + strconv.Itoa(int(t)) } // String returns the string representation for the class c. func (c Class) String() string { if s, ok := ClassToString[uint16(c)]; ok { // Only emit mnemonics when they are unambiguous, specically ANY is in both. if _, ok := StringToType[s]; !ok { return s } } return "CLASS" + strconv.Itoa(int(c)) } // String returns the string representation for the name n. func (n Name) String() string { return sprintName(string(n)) }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2015, Simon Fuhrmann * TU Darmstadt - Graphics, Capture and Massively Parallel Computing * All rights reserved. * * This software may be modified and distributed under the terms * of the BSD 3-Clause license. See the LICENSE.txt file for details. */ #ifndef DMRECON_SETTINGS_H #define DMRECON_SETTINGS_H #include <stdexcept> #include <string> #include <limits> #include "math/vector.h" #include "dmrecon/defines.h" MVS_NAMESPACE_BEGIN struct Settings { /** The reference view ID to reconstruct. */ std::size_t refViewNr = 0; /** Input image emebdding. */ std::string imageEmbedding = "undistorted"; /** Size of the patch is width * width, defaults to 5x5. */ unsigned int filterWidth = 5; float minNCC = 0.3f; float minParallax = 10.0f; float acceptNCC = 0.6f; float minRefineDiff = 0.001f; unsigned int maxIterations = 20; unsigned int nrReconNeighbors = 4; unsigned int globalVSMax = 20; int scale = 0; bool useColorScale = true; bool writePlyFile = false; /** Features outside the AABB are ignored. */ math::Vec3f aabbMin = math::Vec3f(-std::numeric_limits<float>::max()); math::Vec3f aabbMax = math::Vec3f(std::numeric_limits<float>::max()); std::string plyPath; bool keepDzMap = false; bool keepConfidenceMap = false; bool quiet = false; }; MVS_NAMESPACE_END #endif /* DMRECON_SETTINGS_H */
{ "pile_set_name": "Github" }
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ /* * Do not modify this file. This file is generated from the ds-2015-04-16.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.DirectoryService.Model { /// <summary> /// The LDAP activities could not be performed because at least one valid certificate /// must be registered with the system. /// </summary> #if !NETSTANDARD [Serializable] #endif public partial class NoAvailableCertificateException : AmazonDirectoryServiceException { private string _requestId; /// <summary> /// Constructs a new NoAvailableCertificateException with the specified error /// message. /// </summary> /// <param name="message"> /// Describes the error encountered. /// </param> public NoAvailableCertificateException(string message) : base(message) {} /// <summary> /// Construct instance of NoAvailableCertificateException /// </summary> /// <param name="message"></param> /// <param name="innerException"></param> public NoAvailableCertificateException(string message, Exception innerException) : base(message, innerException) {} /// <summary> /// Construct instance of NoAvailableCertificateException /// </summary> /// <param name="innerException"></param> public NoAvailableCertificateException(Exception innerException) : base(innerException) {} /// <summary> /// Construct instance of NoAvailableCertificateException /// </summary> /// <param name="message"></param> /// <param name="innerException"></param> /// <param name="errorType"></param> /// <param name="errorCode"></param> /// <param name="requestId"></param> /// <param name="statusCode"></param> public NoAvailableCertificateException(string message, Exception innerException, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode) : base(message, innerException, errorType, errorCode, requestId, statusCode) {} /// <summary> /// Construct instance of NoAvailableCertificateException /// </summary> /// <param name="message"></param> /// <param name="errorType"></param> /// <param name="errorCode"></param> /// <param name="requestId"></param> /// <param name="statusCode"></param> public NoAvailableCertificateException(string message, ErrorType errorType, string errorCode, string requestId, HttpStatusCode statusCode) : base(message, errorType, errorCode, requestId, statusCode) {} #if !NETSTANDARD /// <summary> /// Constructs a new instance of the NoAvailableCertificateException class with serialized data. /// </summary> /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param> /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param> /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is null. </exception> /// <exception cref="T:System.Runtime.Serialization.SerializationException">The class name is null or <see cref="P:System.Exception.HResult" /> is zero (0). </exception> protected NoAvailableCertificateException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.RequestId = (string)info.GetValue("RequestId", typeof(string)); } /// <summary> /// Sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with information about the exception. /// </summary> /// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param> /// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param> /// <exception cref="T:System.ArgumentNullException">The <paramref name="info" /> parameter is a null reference (Nothing in Visual Basic). </exception> #if BCL35 [System.Security.Permissions.SecurityPermission( System.Security.Permissions.SecurityAction.LinkDemand, Flags = System.Security.Permissions.SecurityPermissionFlag.SerializationFormatter)] #endif [System.Security.SecurityCritical] // These FxCop rules are giving false-positives for this method [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2123:OverrideLinkDemandsShouldBeIdenticalToBase")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2134:MethodsMustOverrideWithConsistentTransparencyFxCopRule")] public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { base.GetObjectData(info, context); info.AddValue("RequestId", this.RequestId); } #endif /// <summary> /// Gets and sets the property RequestId. /// </summary> public string RequestId { get { return this._requestId; } set { this._requestId = value; } } // Check to see if RequestId property is set internal bool IsSetRequestId() { return this._requestId != null; } } }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <GameCenterUI/GKBubblePathAnimator.h> @interface GKScatterBackToFrontAnimator : GKBubblePathAnimator { unsigned long long *_leftToRightIndexByType; } - (void)animateTransition:(id)arg1; - (long long)animatorType; @end
{ "pile_set_name": "Github" }
/** * Copyright (c) 2011-2018 by Andrew Mustun. All rights reserved. * * This file is part of the QCAD project. * * QCAD is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * QCAD is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with QCAD. */ include("../MiscBlock.js"); /** * \class BlockListAttributes * \brief This action lists all block references with attributes to the command line history. * \ingroup ecma_misc_block */ function BlockListAttributes(guiAction) { MiscBlock.call(this, guiAction); } BlockListAttributes.prototype = new MiscBlock(); BlockListAttributes.prototype.beginEvent = function() { MiscBlock.prototype.beginEvent.call(this); var doc = this.getDocument(); // iterate through all block definitions: var blockIds = doc.queryAllBlocks(); for (var i=0; i<blockIds.length; ++i) { var blockId = blockIds[i]; var block = doc.queryBlock(blockId); if (isNull(block)) { continue; } EAction.handleUserMessage(qsTr("Block:") + " " + block.getName()); // iterate through all block references of the current block: var blockRefIds = doc.queryBlockReferences(blockId); for (var k=0; k<blockRefIds.length; ++k) { var blockRefId = blockRefIds[k]; EAction.handleUserMessage(" " + qsTr("Block reference ID:") + " " + blockRefId); // iterate through all attributes of the current block reference: var attributeIds = doc.queryChildEntities(blockRefId, RS.EntityAttribute); for (var c=0; c<attributeIds.length; c++) { var attributeId = attributeIds[c]; var attribute = doc.queryEntityDirect(attributeId); if (attribute.isNull()) { continue; } EAction.handleUserMessage(" " + qsTr("Block attribute:") + " " + attribute.getTag() + ": " + attribute.getPlainText()); } } } this.terminate(); }; /** * Adds a menu for this action to the Misc menu. */ BlockListAttributes.init = function(basePath) { var action = new RGuiAction(qsTr("&List Block Attributes"), RMainWindowQt.getMainWindow()); action.setRequiresDocument(true); action.setScriptFile(basePath + "/BlockListAttributes.js"); action.setGroupSortOrder(60100); action.setSortOrder(300); action.setWidgetNames(["MiscBlockMenu", "MiscBlockToolBar", "MiscBlockToolsPanel"]); };
{ "pile_set_name": "Github" }
#!/bin/bash set -e rm -rf model && mkdir model cd model wget https://download.01.org/opencv/2019/open_model_zoo/R3/20190905_163000_models_bin/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.bin wget https://download.01.org/opencv/2019/open_model_zoo/R3/20190905_163000_models_bin/age-gender-recognition-retail-0013/FP32/age-gender-recognition-retail-0013.xml
{ "pile_set_name": "Github" }
/* TANGELO file compressor 2.41 based on PAQ8 by Matt Mahoney Release by Jan Ondrus and r-lyeh, Nov. 03, 2015 2.41 - thread safe, std::istream based, MSC friendly (r-lyeh) 2.40 - latest source code available (Jan Ondrus) Copyright (C) 2013 Matt Mahoney, Serge Osnach, Alexander Ratushnyak, Bill Pettis, Przemyslaw Skibinski, Matthew Fite, wowtiger, Andrew Paterson, Jan Ondrus, Andreas Morphis, Pavel L. Holoborodko, KZ., Simon Berger, Neill Corlett, Marwijn Hessel, Mat Chartier LICENSE This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details at Visit <http://www.gnu.org/copyleft/gpl.html>. Usage: TANGELO <command> <infile> <outfile> <Commands> c Compress d Decompress Recommended compiler command for MINGW g++: g++ tangelo.cpp -Wall -Wextra -O3 -s -march=pentium4 -mtune=pentiumpro -fomit-frame-pointer -o tangelo.exe */ #ifndef _CRT_DISABLE_PERFCRIT_LOCKS # define _CRT_DISABLE_PERFCRIT_LOCKS // for vc8 and later #endif #ifndef _CRT_SECURE_NO_DEPRECATE # define _CRT_SECURE_NO_DEPRECATE // for vc8 and later #endif #ifndef _CRT_SECURE_NO_WARNINGS # define _CRT_SECURE_NO_WARNINGS #endif #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <stdint.h> #include <sstream> #include <fstream> #if !defined(__GNUC__) #if (2 == _M_IX86_FP) || defined(_WIN64) # define __SSE2__ #endif #endif #if defined(__SSE2__) #include <emmintrin.h> #endif namespace tangelo { typedef uint8_t U8; typedef uint16_t U16; typedef uint32_t U32; // Array template<class T,int ALIGN=0> class Array { private: size_t n; char *ptr; T *data; public: explicit Array(size_t i): n(i) { if (!(ptr = (char*)calloc(ALIGN + n * sizeof(T), 1))) throw "Out of memory"; data = (ALIGN ? (T*)(ptr + ALIGN - (((size_t)ptr) & (ALIGN - 1))):(T*)ptr); } ~Array() { free(ptr); } T&operator[](U32 i) { return data[i]; } const T&operator[](U32 i) const { return data[i]; } size_t size() const { return n; } private: Array(const Array&); Array&operator=(const Array&); }; // State table const U8 State_table[256][2] = {{1,2},{3,163},{143,169},{4,163},{5,165},{6,89},{7,245},{8,217},{9,245},{10,245},{11,233},{12,244},{13,227},{14,74},{15,221},{16,221},{17,218},{18,226},{19,243},{20,218},{21,238},{22,242},{23,74},{24,238},{25,241},{26,240},{27,239},{28,224},{29,225},{30,221},{31,232},{32,72},{33,224},{34,228},{35,223},{36,225},{37,238},{38,73},{39,167},{40,76},{41,237},{42,234},{43,231},{44,72},{45,31},{46,63},{47,225},{48,237},{49,236},{50,235},{51,53},{52,234},{47,53},{54,234},{55,229},{56,219},{57,229},{58,233},{59,232},{60,228},{61,226},{62,72},{63,74},{64,222},{65,75},{66,220},{67,167},{68,57},{69,218},{6,70},{71,168},{71,72},{71,73},{61,74},{75,217},{56,76},{77,167},{78,79},{77,79},{80,166},{81,162},{82,162},{83,162},{84,162},{85,165},{86,89},{87,89},{88,165},{77,89},{90,162},{91,93},{92,93},{80,93},{94,161},{95,100},{96,93},{97,93},{98,93},{99,93},{90,93},{101,161},{94,102},{103,120},{101,104},{102,105},{104,106},{107,108},{104,106},{105,109},{108,110},{111,160},{112,134},{113,108},{114,108},{115,126},{116,117},{92,117},{118,121},{94,119},{103,120},{119,107},{122,124},{123,117},{94,117},{113,125},{126,127},{113,124},{128,139},{129,130},{114,124},{131,133},{132,109},{112,110},{134,135},{111,110},{134,136},{110,137},{134,138},{134,127},{128,140},{128,141},{142,145},{143,144},{115,124},{113,125},{142,146},{128,147},{148,151},{149,125},{79,150},{148,127},{142,152},{148,153},{150,154},{155,156},{149,139},{157,158},{149,139},{159,156},{149,139},{131,130},{101,117},{98,163},{115,164},{114,141},{91,163},{79,147},{58,2},{1,2},{170,199},{129,171},{128,172},{110,173},{174,177},{128,175},{176,171},{129,171},{174,178},{179,180},{174,172},{176,181},{141,182},{157,183},{179,184},{185,186},{157,178},{187,189},{188,181},{168,181},{151,190},{191,193},{192,182},{188,182},{187,194},{172,195},{175,196},{170,197},{152,198},{185,169},{170,200},{176,201},{170,202},{203,204},{148,180},{185,205},{203,206},{185,207},{192,208},{209,210},{188,194},{211,212},{192,184},{213,215},{214,193},{188,184},{216,208},{168,193},{84,163},{54,219},{54,168},{221,94},{54,217},{55,223},{85,224},{69,225},{63,76},{56,227},{86,217},{58,229},{230,219},{231,79},{57,86},{229,165},{56,217},{224,214},{54,225},{54,216},{66,216},{58,234},{54,75},{61,214},{57,237},{222,74},{78,74},{85,163},{82,217},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},}; // State map const short sm[16][256] = { {-119,-120,169,-476,-484,-386,-737,-881,-874,-712,-848,-679,-559,-794,-1212,-782,-1205,-1205,-613,-753,-1169,-1169,-1169,-743,-1155,-732,-720,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-1131,-540,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-1108,-2047,-2047,-2047,-2047,-2047,-2047,-782,-569,-389,-640,-720,-568,-432,-379,-640,-459,-590,-1003,-569,-981,-981,-981,-609,416,-1648,-245,-416,-152,-152,416,-1017,-1017,-179,-424,-446,-461,-508,-473,-492,-501,-520,-528,-54,-395,-405,-404,-94,-232,-274,-288,-319,-354,-379,-105,-141,-63,-113,-18,-39,-94,52,103,167,222,130,-78,-135,-253,-321,-343,102,-165,157,-229,155,-108,-188,262,283,56,447,6,-92,242,172,38,304,141,285,285,320,319,462,497,447,-56,-46,374,485,510,479,-71,198,475,549,559,584,586,-196,712,-185,673,-161,237,-63,48,127,248,-34,-18,416,-99,189,-50,39,337,263,660,153,569,832,220,1,318,246,660,660,732,416,732,1,-660,246,660,1,-416,732,262,832,369,781,781,324,1104,398,626,-416,609,1018,1018,1018,1648,732,1856,1,1856,416,-569,1984,-732,-164,416,153,-416,-569,-416,1,-660,1,-660,153,152,-832,-832,-832,-569,0,-95,-660,1,569,153,416,-416,1,1,-569,1,-318,1,1,1,1,1,1,1,1,1,1,}, {-10,-436,401,-521,-623,-689,-736,-812,-812,-900,-865,-891,-1006,-965,-981,-916,-946,-976,-1072,-1014,-1058,-1090,-1044,-1030,-1044,-1104,-1009,-1418,-1131,-1131,-1269,-1332,-1191,-1169,-1108,-1378,-1367,-1126,-1297,-1085,-1355,-1344,-1169,-1269,-1440,-1262,-1332,-2047,-2047,-1984,-2047,-2047,-2047,-225,-402,-556,-502,-746,-609,-647,-625,-718,-700,-805,-748,-935,-838,-1053,-787,-806,-269,-1006,-278,-212,-41,-399,137,-984,-998,-219,-455,-524,-556,-564,-577,-592,-610,-690,-650,-140,-396,-471,-450,-168,-215,-301,-325,-364,-315,-401,-96,-174,-102,-146,-61,-9,54,81,116,140,192,115,-41,-93,-183,-277,-365,104,-134,37,-80,181,-111,-184,194,317,63,394,105,-92,299,166,-17,333,131,386,403,450,499,480,493,504,89,-119,333,558,568,501,-7,-151,203,557,595,603,650,104,960,204,933,239,247,-12,-105,94,222,-139,40,168,-203,566,-53,243,344,542,42,208,14,474,529,82,513,504,570,616,644,92,669,91,-179,677,720,157,-10,687,672,750,686,830,787,683,723,780,783,9,842,816,885,901,1368,188,1356,178,1419,173,-22,1256,240,167,1,-31,-165,70,-493,-45,-354,-25,-142,98,-17,-158,-355,-448,-142,-67,-76,-310,-324,-225,-96,0,46,-72,0,-439,14,-55,1,1,1,1,1,1,1,1,1,1,}, {-32,-521,485,-627,-724,-752,-815,-886,-1017,-962,-1022,-984,-1099,-1062,-1090,-1062,-1108,-1085,-1248,-1126,-1233,-1104,-1233,-1212,-1285,-1184,-1162,-1309,-1240,-1309,-1219,-1390,-1332,-1320,-1262,-1320,-1332,-1320,-1344,-1482,-1367,-1355,-1504,-1390,-1482,-1482,-1525,-2047,-2047,-1984,-2047,-2047,-1984,-251,-507,-480,-524,-596,-608,-658,-713,-812,-700,-653,-820,-820,-752,-831,-957,-690,-402,-689,-189,-28,-13,-312,119,-930,-973,-212,-459,-523,-513,-584,-545,-593,-628,-631,-688,-33,-437,-414,-458,-167,-301,-308,-407,-289,-389,-332,-55,-233,-115,-144,-100,-20,106,59,130,200,237,36,-114,-131,-232,-296,-371,140,-168,0,-16,199,-125,-182,238,310,29,423,41,-176,317,96,-14,377,123,446,458,510,496,463,515,471,-11,-182,268,527,569,553,-58,-146,168,580,602,604,651,87,990,95,977,185,315,82,-25,140,286,-57,85,14,-210,630,-88,290,328,422,-20,271,-23,478,548,64,480,540,591,601,583,26,696,117,-201,740,717,213,-22,566,599,716,709,764,740,707,790,871,925,3,969,990,990,1023,1333,154,1440,89,1368,125,-78,1403,128,100,-88,-20,-250,-140,-164,-14,-175,-6,-13,-23,-251,-195,-422,-419,-107,-89,-24,-69,-244,-51,-27,-250,0,1,-145,74,12,11,1,1,1,1,1,1,1,1,1,1,}, {-25,-605,564,-746,-874,-905,-949,-1044,-1126,-1049,-1099,-1140,-1248,-1122,-1184,-1240,-1198,-1285,-1262,-1332,-1418,-1402,-1390,-1285,-1418,-1418,-1418,-1367,-1552,-1440,-1367,-1584,-1344,-1616,-1344,-1390,-1418,-1461,-1616,-1770,-1648,-1856,-1770,-1584,-1648,-2047,-1685,-2047,-2047,-1856,-2047,-2047,-1770,-400,-584,-523,-580,-604,-625,-587,-739,-626,-774,-857,-737,-839,-656,-888,-984,-624,-26,-745,-211,-103,-73,-328,142,-1072,-1062,-231,-458,-494,-518,-579,-550,-541,-653,-621,-703,-53,-382,-444,-417,-199,-288,-367,-273,-450,-268,-477,-101,-157,-123,-156,-107,-9,71,64,133,174,240,25,-138,-127,-233,-272,-383,105,-144,85,-115,188,-112,-245,236,305,26,395,-3,-164,321,57,-68,346,86,448,482,541,515,461,503,454,-22,-191,262,485,557,550,-53,-152,213,565,570,649,640,122,931,92,990,172,317,54,-12,127,253,8,108,104,-144,733,-64,265,370,485,152,366,-12,507,473,146,462,579,549,659,724,94,679,72,-152,690,698,378,-11,592,652,764,730,851,909,837,896,928,1050,74,1095,1077,1206,1059,1403,254,1552,181,1552,238,-31,1526,199,47,-214,32,-219,-153,-323,-198,-319,-108,-107,-90,-177,-210,-184,-455,-216,-19,-107,-219,-22,-232,-19,-198,-198,-113,-398,0,-49,-29,1,1,1,1,1,1,1,1,1,1,}, {-34,-648,644,-793,-889,-981,-1053,-1108,-1108,-1117,-1176,-1198,-1205,-1140,-1355,-1332,-1418,-1440,-1402,-1355,-1367,-1418,-1402,-1525,-1504,-1402,-1390,-1378,-1525,-1440,-1770,-1552,-1378,-1390,-1616,-1648,-1482,-1616,-1390,-1728,-1770,-2047,-1685,-1616,-1648,-1685,-1584,-2047,-1856,-1856,-2047,-2047,-2047,-92,-481,-583,-623,-602,-691,-803,-815,-584,-728,-743,-796,-734,-884,-728,-1616,-747,-416,-510,-265,1,-44,-409,141,-1014,-1094,-201,-490,-533,-537,-605,-536,-564,-676,-620,-688,-43,-439,-361,-455,-178,-309,-315,-396,-273,-367,-341,-92,-202,-138,-105,-117,-4,107,36,90,169,222,-14,-92,-125,-219,-268,-344,70,-137,-49,4,171,-72,-224,210,319,15,386,-2,-195,298,53,-31,339,95,383,499,557,491,457,468,421,-53,-168,267,485,573,508,-65,-109,115,568,576,619,685,179,878,131,851,175,286,19,-21,113,245,-54,101,210,-121,766,-47,282,441,483,129,303,16,557,460,114,492,596,580,557,605,133,643,154,-115,668,683,332,-44,685,735,765,757,889,890,922,917,1012,1170,116,1104,1192,1199,1213,1368,254,1462,307,1616,359,50,1368,237,52,-112,-47,-416,-255,-101,55,-177,-166,-73,-132,-56,-132,-237,-495,-152,-43,69,46,-121,-191,-102,170,-137,-45,-364,-57,-212,7,1,1,1,1,1,1,1,1,1,1,}, {-30,-722,684,-930,-1006,-1155,-1191,-1212,-1332,-1149,-1276,-1297,-1320,-1285,-1344,-1648,-1402,-1482,-1552,-1255,-1344,-1504,-1728,-1525,-1418,-1728,-1856,-1584,-1390,-1552,-1552,-1984,-1482,-1525,-1856,-2047,-1525,-1770,-1648,-1770,-1482,-1482,-1482,-1584,-2047,-2047,-1552,-2047,-2047,-2047,-2047,-1984,-2047,0,-376,-502,-568,-710,-761,-860,-838,-750,-1058,-897,-787,-865,-646,-844,-979,-1000,-416,-564,-832,-416,-64,-555,304,-954,-1081,-219,-448,-543,-510,-550,-544,-564,-650,-595,-747,-61,-460,-404,-430,-183,-287,-315,-366,-311,-347,-328,-109,-240,-151,-117,-156,-32,64,19,78,116,223,6,-195,-125,-204,-267,-346,63,-125,-92,-22,186,-128,-169,182,290,-14,384,-27,-134,303,0,-5,328,96,351,483,459,529,423,447,390,-104,-165,214,448,588,550,-127,-146,31,552,563,620,718,-50,832,14,851,93,281,60,-5,121,257,-16,103,138,-184,842,-21,319,386,411,107,258,66,475,542,178,501,506,568,685,640,78,694,122,-96,634,826,165,220,794,736,960,746,823,833,939,1045,1004,1248,22,1118,1077,1213,1127,1552,241,1440,282,1483,315,-102,1391,352,124,-188,19,1,-268,-782,0,-322,116,46,-129,95,-102,-238,-459,-262,-100,122,-152,-455,-269,-238,0,-152,-416,-369,-219,-175,-41,1,1,1,1,1,1,1,1,1,1,}, {-11,-533,477,-632,-731,-815,-808,-910,-940,-995,-1094,-1040,-946,-1044,-1198,-1099,-1104,-1090,-1162,-1122,-1145,-1205,-1248,-1269,-1255,-1285,-1140,-1219,-1269,-1285,-1269,-1367,-1344,-1390,-1482,-1332,-1378,-1461,-1332,-1461,-1525,-1584,-1418,-1504,-1648,-1648,-1648,-1856,-1856,-1616,-1984,-1525,-2047,-330,-456,-533,-524,-541,-577,-631,-715,-670,-710,-729,-743,-738,-759,-775,-850,-690,-193,-870,-102,21,-45,-282,96,-1000,-984,-177,-475,-506,-514,-582,-597,-602,-622,-633,-695,-22,-422,-381,-435,-107,-290,-327,-360,-316,-366,-374,-62,-212,-111,-162,-83,-8,127,52,101,193,237,-16,-117,-150,-246,-275,-361,122,-134,-21,28,220,-132,-215,231,330,40,406,-11,-196,329,68,-42,391,101,396,483,519,480,464,516,484,-34,-200,269,487,525,510,-79,-142,150,517,555,594,718,86,861,102,840,134,291,74,10,166,245,16,117,-21,-126,652,-71,291,355,491,10,251,-21,527,525,43,532,531,573,631,640,31,629,87,-164,680,755,145,14,621,647,723,748,687,821,745,794,785,859,23,887,969,996,1007,1286,104,1321,138,1321,169,-24,1227,123,116,13,45,-198,-38,-214,-22,-241,13,-161,-54,-108,-120,-345,-484,-119,-80,-58,-189,-253,-223,-106,-73,-57,-64,-268,-208,-4,12,1,1,1,1,1,1,1,1,1,1,}, {-38,-419,362,-548,-577,-699,-725,-838,-860,-869,-891,-970,-989,-1030,-1014,-1030,-1169,-1067,-1113,-1155,-1212,-1176,-1269,-1205,-1320,-1378,-1169,-1285,-1418,-1240,-1320,-1332,-1402,-1390,-1285,-1402,-1262,-1240,-1616,-1320,-1552,-1440,-1320,-1685,-1482,-1685,-1320,-1616,-1856,-1616,-1856,-2047,-1728,-302,-466,-608,-475,-502,-550,-598,-623,-584,-716,-679,-759,-767,-579,-713,-686,-652,-294,-791,-240,-55,-177,-377,-108,-789,-858,-226,-370,-423,-449,-474,-481,-503,-541,-551,-561,-93,-353,-345,-358,-93,-215,-246,-295,-304,-304,-349,-48,-200,-90,-150,-52,-14,92,19,105,177,217,28,-44,-83,-155,-199,-273,53,-133,-7,26,135,-90,-137,177,250,32,355,55,-89,254,67,-21,318,152,373,387,413,427,385,436,355,41,-121,261,406,470,452,40,-58,223,474,546,572,534,184,682,205,757,263,276,6,-51,78,186,-65,48,-46,-18,483,3,251,334,444,115,254,80,480,480,207,476,511,570,603,561,170,583,145,-7,662,647,287,88,608,618,713,728,725,718,520,599,621,664,135,703,701,771,807,903,324,885,240,880,296,109,920,305,-24,-314,-44,-202,-145,-481,-379,-341,-128,-187,-179,-342,-201,-419,-405,-214,-150,-119,-493,-447,-133,-331,-224,-513,-156,-247,-108,-177,-95,1,1,1,1,1,1,1,1,1,1,}, {-37,-350,295,-455,-569,-592,-653,-686,-764,-819,-825,-897,-954,-908,-951,-984,-987,-924,-995,-1030,-1081,-1019,-1022,-1058,-995,-1122,-1009,-1090,-1085,-1191,-1094,-1000,-1026,-1248,-1162,-1285,-1085,-1108,-1017,-1219,-1126,-1026,-976,-1320,-1320,-1584,-1176,-2047,-1728,-2047,-1685,-2047,-2047,-281,-492,-568,-551,-564,-636,-701,-736,-690,-667,-831,-841,-806,-897,-888,-881,-891,-337,-884,-120,-123,-143,-359,-15,-910,-981,-205,-440,-499,-526,-549,-533,-614,-591,-653,-690,-124,-423,-445,-405,-125,-246,-285,-297,-345,-303,-378,-95,-189,-96,-131,-66,2,63,49,115,146,223,82,-60,-96,-204,-248,-326,90,-142,34,-33,157,-125,-178,234,296,48,383,90,-69,333,139,5,369,152,398,419,426,467,455,528,475,61,-139,316,502,560,502,45,-102,213,537,596,606,622,159,820,222,813,247,254,16,-45,88,214,-73,18,-73,-90,450,-44,237,349,400,61,151,3,405,454,124,431,414,518,618,616,95,647,67,-146,593,697,64,-41,560,589,620,708,826,723,507,555,601,690,-35,778,814,875,894,1248,148,1333,138,1234,136,-7,1298,88,0,-55,-49,-137,-138,-159,-101,-346,-136,-214,47,-219,-199,-411,-416,-187,-82,-97,-416,-241,-267,-436,-343,55,-273,-198,-24,-103,-90,1,1,1,1,1,1,1,1,1,1,}, {-104,-555,421,-707,-754,-855,-874,-943,-970,-1030,-1014,-1113,-1226,-1131,-1122,-1418,-1176,-1276,-1155,-1205,-1367,-1378,-1482,-1332,-1320,-1685,-1482,-1440,-1191,-1552,-1262,-1233,-1440,-1402,-1402,-1240,-1367,-1770,-1355,-1770,-1344,-1344,-1176,-1053,-1145,-1131,-1276,-1616,-1344,-1525,-1418,-1248,-1390,-660,-337,-1122,-359,-511,-549,-1169,-678,-1040,-459,-660,-640,-625,-1019,-1003,-590,-1040,1,1,246,569,62,-337,660,-681,-703,-179,-335,-459,-445,-503,-450,-529,-489,-616,-507,2,-270,-234,-326,-124,-171,-222,-251,-261,-220,-387,-90,-166,-24,-40,-93,28,-88,214,129,119,182,69,-24,-44,-133,-215,-255,42,-123,-12,4,121,-87,-49,172,200,105,315,85,-110,221,117,18,298,151,347,286,359,307,369,371,328,-31,-141,196,432,459,537,14,-215,370,563,662,614,683,84,625,176,652,370,250,-2,74,114,223,8,201,-152,0,550,4,274,270,334,40,280,122,498,381,313,382,388,481,524,555,213,562,460,1,521,449,456,139,620,671,565,732,588,868,612,740,718,736,114,783,820,889,988,1001,270,990,191,1027,146,304,1010,164,48,-56,896,-416,-213,-416,416,-732,-95,95,-208,1,-416,100,-95,95,17,124,1,-416,246,220,0,1,0,0,46,256,-57,1,1,1,1,1,1,1,1,1,1,}, {-44,-551,478,-690,-789,-913,-935,-1006,-995,-1131,-1035,-1169,-1099,-1198,-1297,-1145,-1309,-1198,-1219,-1226,-1332,-1248,-1378,-1297,-1390,-1226,-1378,-1440,-1584,-1418,-1552,-1269,-1402,-1504,-1552,-1461,-1584,-1504,-1616,-1584,-1482,-1685,-1856,-1856,-1685,-1685,-1482,-1770,-1685,-1984,-2047,-1856,-1856,-405,-619,-642,-574,-582,-618,-752,-619,-780,-682,-680,-624,-772,-699,-935,-815,-749,-897,-711,-601,-99,-251,-398,-331,-846,-930,-330,-455,-488,-470,-572,-563,-570,-583,-615,-706,-216,-377,-415,-415,-166,-256,-310,-338,-397,-349,-442,-114,-229,-103,-168,-65,-20,68,26,96,200,239,91,-3,-53,-140,-231,-335,12,-174,-67,-46,91,-44,-225,172,272,74,398,150,-28,299,116,18,377,156,465,470,502,486,439,471,367,64,-97,319,471,506,593,194,34,334,501,637,649,669,321,767,291,799,444,312,-56,-173,4,161,-170,-226,-314,-29,614,93,322,425,460,123,341,185,496,523,250,506,544,613,579,619,312,708,322,184,674,603,372,423,691,767,746,747,792,732,750,776,845,1010,319,977,996,1040,985,1256,381,1277,458,1256,457,0,1321,432,-226,-370,-187,-869,-374,-416,-69,-503,-308,-371,-403,-255,-297,-408,-891,-471,-243,-805,-398,-134,-569,-319,-960,-610,-543,-398,-231,-268,-244,1,1,1,1,1,1,1,1,1,1,}, {-46,-743,732,-916,-1030,-1006,-1090,-1145,-1162,-1117,-1184,-1367,-1378,-1233,-1176,-1309,-1378,-1205,-1616,-1367,-1482,-1402,-1552,-1482,-1461,-1233,-1504,-1390,-1482,-1525,-1504,-1461,-1320,-1402,-1525,-1856,-1504,-1482,-1332,-1648,-1461,-1402,-1440,-1770,-1770,-1504,-2047,-1685,-1856,-2047,-2047,-2047,-2047,-247,-366,-436,-532,-534,-616,-668,-721,-697,-855,-627,-780,-729,-722,-848,-998,-654,-208,-1104,-320,-93,-79,-270,324,-938,-1003,-176,-441,-492,-495,-533,-553,-546,-538,-605,-637,-63,-409,-404,-436,-121,-268,-317,-390,-364,-367,-367,-131,-231,-113,-133,-104,-4,-14,17,106,146,191,95,-58,-115,-216,-278,-388,37,-174,175,-295,128,-162,-239,281,374,13,519,-41,-26,307,130,24,345,128,398,419,468,494,529,545,521,-107,-39,270,538,576,473,-115,171,418,511,585,620,588,-125,823,-85,875,-88,266,-97,-39,32,191,-68,-41,83,-266,875,-11,268,336,502,114,185,15,593,528,121,606,481,633,733,539,85,792,245,-201,653,795,591,-97,606,592,707,794,873,837,925,1001,1100,1156,98,1059,1199,1177,1213,1504,157,1526,183,1526,70,-29,1419,180,104,-109,-38,-219,-150,-255,-169,-280,0,-250,19,-26,-48,-462,-352,-175,16,-60,-195,-255,-63,-121,370,-198,1,-208,-99,-66,4,1,1,1,1,1,1,1,1,1,1,}, {-9,-75,59,-120,-186,-252,-341,-388,-442,-515,-556,-561,-537,-570,-627,-624,-600,-622,-620,-679,-696,-695,-729,-748,-800,-810,-862,-718,-838,-848,-846,-951,-879,-1104,-813,-930,-998,-1162,-838,-935,-872,-949,-1108,-848,-1030,-1145,-865,-1212,-1205,-1367,-1233,-1205,-1226,-874,-505,-483,-449,-446,-454,-462,-506,-479,-490,-510,-546,-511,-592,-563,-575,-589,-365,-501,-409,-315,-363,-470,-386,-597,-599,-357,-336,-329,-365,-404,-408,-430,-432,-476,-484,-256,-325,-316,-268,-184,-159,-190,-207,-252,-281,-302,-107,-103,-57,-62,-3,34,56,30,71,135,184,138,95,41,0,-43,-117,-68,-57,-59,-8,-21,-34,-84,79,169,42,275,197,54,228,146,121,243,176,278,302,327,325,318,327,292,182,25,251,338,356,384,253,210,326,460,448,465,453,366,606,386,601,467,209,-101,-247,-34,12,-191,-124,-350,89,128,67,147,209,256,184,237,155,310,361,260,371,385,443,462,467,280,494,344,249,519,549,409,319,555,551,562,591,601,662,205,281,334,440,248,472,510,562,607,809,463,807,462,832,500,250,878,469,-178,-442,-272,-439,-389,-419,-457,-402,-433,-428,-405,-441,-330,-352,-349,-316,-345,-588,-1019,-569,-862,-433,-374,-471,-577,-532,-556,-333,-225,1,1,1,1,1,1,1,1,1,1,}, {-19,-99,100,-211,-273,-354,-476,-580,-676,-693,-752,-772,-865,-843,-889,-927,-951,-981,-981,-1044,-1017,-1000,-1040,-1030,-984,-995,-1067,-1014,-1094,-1076,-1003,-1017,-1030,-1131,-1053,-1085,-1081,-1136,-1233,-1090,-1155,-1169,-1099,-1067,-1117,-1276,-1058,-1504,-1856,-1482,-1504,-1584,-1482,-508,-415,-521,-445,-467,-471,-522,-510,-528,-573,-579,-579,-598,-612,-653,-636,-623,-482,-757,-362,-278,-314,-391,-256,-620,-669,-380,-359,-385,-402,-433,-438,-474,-498,-501,-540,-290,-312,-369,-298,-166,-152,-185,-221,-231,-292,-302,-108,-102,-45,-64,-24,37,45,16,68,123,167,116,88,52,-1,-51,-106,-25,-84,-47,-16,-16,-32,-83,69,178,61,310,185,93,232,150,82,255,168,274,308,304,320,360,385,336,218,31,287,429,420,430,265,212,321,487,493,504,506,380,674,390,702,433,199,-84,-227,-62,10,-215,-109,-439,116,199,33,133,203,270,176,221,123,322,387,241,377,429,444,501,542,297,535,358,219,598,573,305,321,641,620,662,682,676,722,315,391,479,581,245,647,711,787,785,1199,442,1206,494,1177,486,311,1234,483,-145,-430,-238,-527,-405,-373,-368,-476,-454,-377,-320,-385,-290,-317,-374,-270,-322,-566,-544,-653,-651,-387,-554,-590,-354,-491,-349,-347,-202,1,1,1,1,1,1,1,1,1,1,}, {-15,-126,83,-181,-261,-335,-460,-592,-640,-716,-800,-774,-832,-869,-886,-965,-957,-979,-992,-1000,-970,-1094,-1000,-976,-989,-1062,-1076,-1140,-1030,-1113,-1044,-1017,-1099,-1040,-1081,-1145,-1090,-1076,-1136,-1117,-1090,-1198,-1099,-1184,-1169,-1140,-1076,-1525,-1504,-1616,-1856,-1525,-1525,-637,-419,-510,-461,-473,-565,-519,-569,-523,-558,-608,-608,-619,-684,-587,-631,-692,-350,-678,-352,-239,-344,-411,-174,-669,-647,-354,-370,-383,-448,-441,-431,-482,-490,-507,-534,-268,-342,-340,-297,-169,-173,-208,-217,-236,-283,-291,-109,-95,-46,-72,18,40,51,28,79,138,175,96,83,44,-3,-61,-92,-19,-77,-41,-13,14,-38,-64,78,176,54,311,176,87,231,142,106,246,150,262,311,347,332,345,352,346,207,13,269,393,454,414,253,165,291,491,484,533,498,345,664,388,685,442,203,-83,-260,-60,24,-198,-80,-348,38,240,65,146,218,289,163,263,100,355,370,268,403,441,475,480,542,305,545,339,238,598,593,379,325,643,631,617,671,730,712,350,390,490,583,228,626,675,726,832,1192,443,1277,470,1286,495,128,1248,426,-145,-427,-184,-374,-441,-363,-239,-439,-345,-426,-314,-274,-285,-336,-369,-335,-280,-374,-559,-694,-470,-379,-462,-507,-383,-379,-293,-320,-158,1,1,1,1,1,1,1,1,1,1,}, {-1,-95,89,-151,-218,-277,-429,-483,-610,-643,-756,-775,-749,-775,-839,-855,-883,-895,-921,-893,-908,-1017,-935,-1009,-1030,-973,-989,-976,-1014,-1090,-1011,-1017,-1000,-954,-1226,-1062,-1131,-1081,-1035,-1117,-1104,-1058,-1049,-1191,-1053,-1248,-1169,-1367,-1648,-1418,-1390,-1378,-1525,-844,-587,-618,-562,-573,-606,-581,-595,-592,-628,-670,-652,-633,-648,-721,-656,-683,-359,-810,-497,-505,-422,-495,-286,-694,-679,-411,-378,-375,-414,-464,-478,-469,-509,-488,-505,-337,-306,-345,-295,-169,-171,-171,-206,-211,-267,-284,-100,-114,-43,-58,-7,33,45,22,84,124,166,127,99,49,22,-69,-97,-63,-70,-28,-18,-16,-49,-80,87,189,83,287,223,131,227,150,107,231,157,261,258,288,325,358,380,355,287,68,322,389,426,437,308,287,373,473,485,535,496,431,659,484,627,496,182,-108,-288,-120,-22,-275,-200,-554,42,203,49,154,205,298,194,246,184,338,388,287,427,460,507,501,591,338,614,432,278,591,614,506,403,702,723,738,738,741,769,283,393,489,593,292,629,730,744,851,1263,610,1199,637,1170,713,246,1177,647,-183,-560,-333,-424,-538,-503,-1169,-575,-421,-479,-437,-549,-419,-403,-494,-368,-372,-637,-723,-1461,-850,-603,-515,-670,-613,-445,-484,-378,-233,1,1,1,1,1,1,1,1,1,1}, } ; template<const bool encode> class Encoder { // Buffer - array of n last bytes int pos = 0; class Buf { Array<U8> b; int &pos; public: Buf(size_t i, int& pos):b(i), pos(pos) {} U8& operator[](U32 i) { return b[i & (b.size() - 1)]; } int operator()(U32 i) const { return b[(pos - i) & (b.size() - 1)]; } size_t size() const { return b.size(); } }; // Global variables int y = 0, c0 = 1, bpos = 0, bytes_written = 0, bytes_read = 24, rn = 0; U32 c4 = 0; Buf buf; // Hash inline U32 hash(U32 a, U32 b, U32 c=0xffffffff, U32 d=0xffffffff, U32 e=0xffffffff) { U32 h=a*200002979u+b*30005491u+c*50004239u+d*70004807u+e*110002499u; return h^h>>9^a>>2^b>>3^c>>4^d>>5^e>>6; } static int squash(int d) { const int t[33] = { 1,2,3,6,10,16,27,45,73,120,194,310,488,747,1101,1546,2047,2549,2994,3348,3607,3785,3901,3975,4022,4050,4068,4079,4085,4089,4092,4093,4094}; if (d > 2047) return 4095; if (d < -2047) return 0; int w = d & 127; d = (d >> 7) + 16; return (t[d] * (128 - w) + t[(d + 1)] * w + 64) >> 7; } /* class Stretch { Array<short> t; public: int operator()(int x) const { return t[x]; } Stretch():t(4096) { for (int x = -2047, j = 0; x <= 2047; ++x) { int i = squash(x); while (j <= i) t[j++] = x; } t[4095] = 2047; } } stretch; */ #if defined(__SSE2__) static int dot_product (const short* const t, const short* const w) { __m128i sum = _mm_madd_epi16 (*(__m128i *) &t[0], *(__m128i *) &w[0]); sum = _mm_srai_epi32 (sum, 8); sum = _mm_add_epi32 (sum, _mm_srli_si128 (sum, 8)); sum = _mm_add_epi32 (sum, _mm_srli_si128 (sum, 4)); return _mm_cvtsi128_si32 (sum); } static void train (const short* const t, short* const w, const int e) { if (e) { const __m128i one = _mm_set1_epi16 (1); const __m128i err = _mm_set1_epi16 (short(e)); __m128i tmp = _mm_adds_epi16 (*(__m128i *) &t[0], *(__m128i *) &t[0]); tmp = _mm_mulhi_epi16 (tmp, err); tmp = _mm_adds_epi16 (tmp, one); tmp = _mm_srai_epi16 (tmp, 1); tmp = _mm_adds_epi16 (tmp, *(__m128i *) &w[0]); *(__m128i *) &w[0] = tmp; } } #else static int dot_product (const short* const t, const short* const w) { int sum = 0, n = 8; while ((n -= 2) >= 0) { sum += (t[n] * w[n] + t[n + 1] * w[n + 1]) >> 8; } return sum; } static void train (const short* const t, short* const w, const int err) { int n = 8; if (err) { while ((n -= 1) >= 0) { int wt = w[n] + ((((t[n] * err * 2) >> 16) + 1) >> 1); if (wt < -32768) { w[n] = -32768; } else if (wt > 32767) { w[n] = 32767; } else { w[n] = wt; } } } } #endif // Mixer - combines models using neural networks class Mixer { const int N; Array<short,16> tx; int pr, nx, ofs; int &y; public: Mixer(int n, int&y): N((n + 7) & -8), tx(4096), pr(0), nx(0), ofs(0), y(y) { for (int i = 0; i < 4096; ++i) { tx[i] = 0; } } void setcxt(int c) { ofs = c << 4;} void update() { int err = ((y << 12) - squash(pr)) * 7; train(&tx[ofs + 0], &tx[ofs + 8], err); nx = 0; } void add(short x) { tx[ofs + nx++] = x; } int p() { while (nx & 7) tx[ofs + nx++] = 64; return pr = (dot_product(&tx[ofs + 0], &tx[ofs + 8]) >> 7); } }; // ContextMap class ContextMap { Array<U8, 64> t; U8* cp[6]; U32 cxt[6]; int cn; int &y; int &c0; int &bpos; public: ContextMap(size_t m, int &y, int &c0, int &bpos):t(m), cn(0), y(y), c0(c0), bpos(bpos) { for (int i = 0; i < 6; ++i) { cp[i] = 0; } } void set(U32 cx) { cxt[cn++] = cx * 16; } void mix(Mixer&m) { for (int i = 0; i < cn; ++i) { if (cp[i]) { *cp[i] = State_table[*cp[i]][y]; // Update state } } const int c0b = c0 < 16 ? c0 : (16 * (1 + ((c0 >> (bpos - 4)) & 15))) + ((c0 & ((1 << (bpos - 4)) - 1)) | (1 << (bpos - 4))); for (int i = 0; i < cn; ++i) { cp[i] = &t[(cxt[i] + c0b) & (t.size() - 1)]; // Update bit context pointers } for (int i = 0; i < cn; ++i) { m.add(sm[i][*cp[i]]); // Predict from bit context } if (bpos == 7) cn = 0; } }; // Match submodel int h = 0, ptr = 0, len = 0; Array<int> t; inline void matchModel(Mixer *m) { const int MAXLEN = 88; if (!bpos) { h = (h * 997 * 8 + buf(1) + 1) & (t.size() - 1); if (len) { ++len, ++ptr; if (len > MAXLEN) len = MAXLEN; } else { ptr = t[h]; if (ptr && pos - ptr < (int)buf.size()) { while (buf(len + 1) == buf[ptr - len - 1] && len < MAXLEN) ++len; } } t[h] = pos; } int p = 0; if (len) { if (buf(1) == buf[ptr - 1] && c0 == (buf[ptr] + 256) >> (8 - bpos)) { if (len<24) p = len << 6; else p = (24 + ((len-24)>>3))<< 6; if ((buf[ptr] >> (7 - bpos) & 1) == 0) p = -p; m->add(p); } else { len=0; } } } class IntBuf { Array<int> b; public: IntBuf(int i=0): b(i) {} int& operator[](int i) { return b[i&(b.size()-1)]; } }; class Ilog { U8 t[6554]; public: int operator()(int x) const {return x < 0 ? -t[-x] : t[x];} // Compute lookup table by numerical integration of 1/x Ilog() { U32 x=14155776; for (int i=2; i<65536; ++i) { x+=774541002/(i*2-1); // numerator is 2^29/ln 2 if ((i-1) % 10 == 0) t[(i-1) / 10] = (x >> 24) / 10; } } } ilog; //////////////////////////// jpegModel ///////////////////////// int jpegModel(Mixer& m) { return 0; } Mixer mixer; ContextMap cm; // Main model - predicts next bit probability from previous data int predictNext() { mixer.update(); c0 += c0 + y; if (c0 >= 256) { buf[pos++] = c0; c4 = (c4 << 8) + c0 - 256; c0 = 1; } bpos = (bpos + 1) & 7; if (!jpegModel(mixer)) { if (bpos == 0) { mixer.setcxt(c4 & 0xff); cm.set(0); cm.set(16 *(1 + (c4 & 0xff))); if (bytes_read + bytes_written > (1 << 9)) bytes_read >>= 1, bytes_written >>= 1; if ((bytes_written+(bytes_written>>4)) <= bytes_read) { cm.set(hash(256,c4 & 0x0000ffff)); cm.set(hash(257,c4 & 0x00ffffff)); cm.set(hash(258,c4)); cm.set(hash(c4,(buf(5)<<8)+buf(6))); rn = 0; } else { rn = 1; } } cm.mix(mixer); matchModel(&mixer); } int pr = mixer.p(); if (pr < -2048) pr = -2048; if (pr > 2047) pr = 2047; return squash(pr); } private: U32 x = 0, x1 = 0, x2 = 0xffffffff; int p = 2048; std::istream &in; std::ostream &out; int code(int i = 0) { p += p < 2048; U32 xmid = x1 +((x2 - x1) >> 12) * p + (((x2 - x1) & 0xfff) * p >> 12); if (!encode) y = x <= xmid; else y = i; p = predictNext(); // Update models and predict next bit probability y ? (x2 = xmid) : (x1 = xmid + 1); while (!((x1 ^ x2) >> 24)) { if (encode) out.put(x2 >> 24); x1 <<= 8; x2 = (x2 << 8) + 255; if (!encode) x = (x << 8) + (in.get() & 255); bytes_written++; } return y; } public: Encoder(std::istream &in, std::ostream &out, size_t MEM = (0x10000u << 7) /* may be increased up to 10 on x64 platforms */ ): in(in), out(out), buf(MEM * 8, pos), t(MEM), mixer(8,y), cm(MEM * 32, y, c0, bpos) { if (!encode) { for (int i = 0; i < 4; ++i) { x = (x << 8) + (in.get() & 255); } } } void flush() { out.put(x1 >> 24); } void compress(int c) { for (int i = 7; i >= 0; --i) { code((c >> i) & 1); } bytes_read++; } int decompress() { int c = 0; for (int i = 0; i < 8; ++i) { c += c + code(); } bytes_read++; return c; } }; } #if 0 // Main program int main(int argc, char **argv) { printf("TANGELO 2.4 compressor (C) 2013, based on PAQ8 by Matt Mahoney et al.\nFree under GPL, http://www.gnu.org/licenses/gpl.txt\n"); if (argc != 4 || argv[1][1] != 0 || (argv[1][0] != 'c' && argv[1][0] != 'd')) { printf("\nUsage: TANGELO <command> <infile> <outfile>\n"); printf("\n<Commands>\n c\t\tCompress\n d\t\tDecompress\n"); return (1); } FILE *in = fopen( argv[2], "rb" ); fseek(in, 0L, SEEK_END); int len = ftell(in); fclose(in); std::ifstream ifs( argv[2], std::ios::binary ); std::ofstream ofs( argv[3], std::ios::binary ); if (ifs.bad() || ofs.bad()) { printf("Cannot read/write file\n"); return (1); } clock_t start_time = clock(); if (argv[1][0] != 'd') { printf("Compressing %s...\n", argv[2]); tangelo::Encoder<1> en(ifs, ofs); en.compress(len >> 24); en.compress(len >> 16); en.compress(len >> 8); en.compress(len); for (int i = 0; i < len; i++) { en.compress(ifs.get()); } en.flush(); printf("Compressed from %d bytes to %d bytes.\n", len, -1); } else { printf("Decompressing %s...\n", argv[2]); tangelo::Encoder<0> en(ifs, ofs); int len; len = en.decompress() << 24; len |= en.decompress() << 16; len |= en.decompress() << 8; len |= en.decompress(); for (int i = 0; i < len; i++) { ofs.put(en.decompress()); } printf("Decompressed from %d bytes to %d bytes.\n", -1, len); } printf("Time %1.2f sec\n", double(clock() - start_time) / CLOCKS_PER_SEC); return (0); } #endif
{ "pile_set_name": "Github" }
/* Copyright 2016 The Kubernetes 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 workqueue import ( "testing" "time" "k8s.io/client-go/util/clock" ) func TestRateLimitingQueue(t *testing.T) { limiter := NewItemExponentialFailureRateLimiter(1*time.Millisecond, 1*time.Second) queue := NewRateLimitingQueue(limiter).(*rateLimitingType) fakeClock := clock.NewFakeClock(time.Now()) delayingQueue := &delayingType{ Interface: New(), clock: fakeClock, heartbeat: fakeClock.Tick(maxWait), stopCh: make(chan struct{}), waitingForAddCh: make(chan waitFor, 1000), metrics: newRetryMetrics(""), } queue.DelayingInterface = delayingQueue queue.AddRateLimited("one") waitEntry := <-delayingQueue.waitingForAddCh if e, a := 1*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } queue.AddRateLimited("one") waitEntry = <-delayingQueue.waitingForAddCh if e, a := 2*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 2, queue.NumRequeues("one"); e != a { t.Errorf("expected %v, got %v", e, a) } queue.AddRateLimited("two") waitEntry = <-delayingQueue.waitingForAddCh if e, a := 1*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } queue.AddRateLimited("two") waitEntry = <-delayingQueue.waitingForAddCh if e, a := 2*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } queue.Forget("one") if e, a := 0, queue.NumRequeues("one"); e != a { t.Errorf("expected %v, got %v", e, a) } queue.AddRateLimited("one") waitEntry = <-delayingQueue.waitingForAddCh if e, a := 1*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } }
{ "pile_set_name": "Github" }
# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=5 # ebuild generated by hackport 0.4.6.9999 #hackport: flags: +base4 CABAL_FEATURES="lib profile haddock hoogle hscolour" inherit haskell-cabal DESCRIPTION="HUnit support for the test-framework package" HOMEPAGE="https://batterseapower.github.io/test-framework/" SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz" LICENSE="BSD" SLOT="0/${PV}" KEYWORDS="~amd64 ~x86" IUSE="" RDEPEND=">=dev-haskell/extensible-exceptions-0.1.1:=[profile?] <dev-haskell/extensible-exceptions-0.2.0:=[profile?] >=dev-haskell/hunit-1.2:=[profile?] >=dev-haskell/test-framework-0.2.0:=[profile?] >=dev-lang/ghc-7.4.1:= " DEPEND="${RDEPEND} >=dev-haskell/cabal-1.6 " src_prepare() { cabal_chdeps \ 'HUnit >= 1.2 && < 1.4' 'HUnit >= 1.2' default } src_configure() { haskell-cabal_src_configure \ --flag=base4 }
{ "pile_set_name": "Github" }
# Add project specific ProGuard rules here. # You can control the set of applied configuration files using the # proguardFiles setting in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} # Uncomment this to preserve the line number information for # debugging stack traces. #-keepattributes SourceFile,LineNumberTable # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile
{ "pile_set_name": "Github" }