public object haxe_ds__IntMap_IntMapKeyIterator_cast <T_c>() { if (global::haxe.lang.Runtime.eq(typeof(T), typeof(T_c))) { return(this); } global::haxe.ds._IntMap.IntMapKeyIterator <T_c> new_me = new global::haxe.ds._IntMap.IntMapKeyIterator <T_c>(((global::haxe.lang.EmptyObject)(global::haxe.lang.EmptyObject.EMPTY))); global::Array <string> fields = global::Reflect.fields(this); int i = 0; while ((i < fields.length)) { string field = fields[i++]; global::Reflect.setField(new_me, field, global::Reflect.field(this, field)); } return(new_me); }
public virtual string __hx_toString() { global::haxe.lang.Function ts = ((global::haxe.lang.Function)(global::haxe.lang.Runtime.getField(this, "toString", 946786476, false))); if ((ts != null)) { return(global::haxe.lang.Runtime.toString(ts.__hx_invoke0_o())); } global::System.Text.StringBuilder ret_b = new global::System.Text.StringBuilder(); ret_b.Append(((string)("{"))); bool first = true; { int _g = 0; global::Array <string> _g1 = global::Reflect.fields(this); while ((_g < _g1.length)) { string f = _g1[_g]; ++_g; if (first) { first = false; } else { ret_b.Append(((string)(","))); } ret_b.Append(((string)(" "))); ret_b.Append(((string)(global::Std.@string(f)))); ret_b.Append(((string)(" : "))); ret_b.Append(((string)(global::Std.@string(((object)(global::Reflect.field(this, f))))))); } } if (!(first)) { ret_b.Append(((string)(" "))); } ret_b.Append(((string)("}"))); return(ret_b.ToString()); }
public override void __hx_getFields(global::Array <object> baseArr) { baseArr.push("merge_last_count_"); baseArr.push("last_entropy_"); baseArr.push("last_histogram_ix_"); baseArr.push("curr_histogram_ix_"); baseArr.push("block_size_"); baseArr.push("target_block_size_"); baseArr.push("histograms_"); baseArr.push("split_"); baseArr.push("num_blocks_"); baseArr.push("split_threshold_"); baseArr.push("min_block_size_"); baseArr.push("max_block_types_"); baseArr.push("num_contexts_"); baseArr.push("alphabet_size_"); baseArr.push("HistogramTypeInt"); base.__hx_getFields(baseArr); }
public override object __hx_setField(string field, int hash, object @value, bool handleProperties) { unchecked { switch (hash) { case 1337394146: { this.values = ((global::Array <double>)(global::Array <object> .__hx_cast <double>(((global::Array)(@value))))); return(@value); } default: { return(base.__hx_setField(field, hash, @value, handleProperties)); } } } }
public static void InitialEntropyCodes(int HistogramTypeInt, global::Array <uint> data, int length, int literals_per_histogram, int max_histograms, int stride, global::Array <object> vec) { unchecked { int total_histograms = ((length / literals_per_histogram) + 1); if ((total_histograms > max_histograms)) { total_histograms = max_histograms; } int seed_0 = 7; int block_length = (length / total_histograms); { int _g1 = 0; int _g = total_histograms; while ((_g1 < _g)) { int i = _g1++; int pos = ((length * i) / total_histograms); if ((i != 0)) { seed_0 = ((uint)((seed_0 * 16807))); seed_0 = ((uint)(((uint)((((uint)(seed_0)) >> 0))))); if (((bool)((seed_0 == 0)))) { seed_0 = ((uint)(1)); } pos = ((int)(((uint)((((uint)((seed_0 % block_length))) + pos))))); } if (((pos + stride) >= length)) { pos = ((length - stride) - 1); } global::encode.histogram.Histogram histo = new global::encode.histogram.Histogram(((int)(HistogramTypeInt))); histo.Add2(data, pos, stride); vec.push(histo); } } } }
public static void StoreHuffmanTreeOfHuffmanTreeToBitMask(int num_codes, uint[] code_length_bitdepth, global::Array <int> storage_ix, uint[] storage) { unchecked { global::Array <uint> kStorageOrder = new global::Array <uint>(new uint[] { ((uint)(1)), ((uint)(2)), ((uint)(3)), ((uint)(4)), ((uint)(0)), ((uint)(5)), ((uint)(17)), ((uint)(6)), ((uint)(16)), ((uint)(7)), ((uint)(8)), ((uint)(9)), ((uint)(10)), ((uint)(11)), ((uint)(12)), ((uint)(13)), ((uint)(14)), ((uint)(15)) }); global::Array <uint> kHuffmanBitLengthHuffmanCodeSymbols = new global::Array <uint>(new uint[] { ((uint)(0)), ((uint)(7)), ((uint)(3)), ((uint)(2)), ((uint)(1)), ((uint)(15)) }); global::Array <uint> kHuffmanBitLengthHuffmanCodeBitLengths = new global::Array <uint>(new uint[] { ((uint)(2)), ((uint)(4)), ((uint)(3)), ((uint)(2)), ((uint)(2)), ((uint)(4)) }); int codes_to_store = 18; if ((num_codes > 1)) { while ((codes_to_store > 0)) { if (((bool)((((uint)(((uint[])(code_length_bitdepth))[((int)(kStorageOrder[(codes_to_store - 1)]))])) != 0)))) { break; } --codes_to_store; } } int skip_some = 0; if ((((bool)((((uint)(((uint[])(code_length_bitdepth))[((int)(kStorageOrder[0]))])) == 0))) && ((bool)((((uint)(((uint[])(code_length_bitdepth))[((int)(kStorageOrder[1]))])) == 0))))) { skip_some = 2; if (((bool)((((uint)(((uint[])(code_length_bitdepth))[((int)(kStorageOrder[2]))])) == 0)))) { skip_some = 3; } } global::encode.Write_bits.WriteBits(2, ((uint)(skip_some)), storage_ix, storage); { int _g1 = skip_some; int _g = codes_to_store; while ((_g1 < _g)) { uint l = ((uint)(((uint[])(code_length_bitdepth))[((int)(kStorageOrder[_g1++]))])); global::encode.Write_bits.WriteBits(((int)(kHuffmanBitLengthHuffmanCodeBitLengths[((int)(l))])), kHuffmanBitLengthHuffmanCodeSymbols[((int)(l))], storage_ix, storage); } } } }
public override object __hx_setField(string field, int hash, object @value, bool handleProperties) { unchecked { #line 28 "/opt/haxe/std/haxe/crypto/BaseCode.hx" switch (hash) { case 5790526: { #line 28 "/opt/haxe/std/haxe/crypto/BaseCode.hx" this.tbl = ((global::Array <int>)(global::Array <object> .__hx_cast <int>(((global::Array)(@value))))); #line 28 "/opt/haxe/std/haxe/crypto/BaseCode.hx" return(@value); } case 388680308: { #line 28 "/opt/haxe/std/haxe/crypto/BaseCode.hx" this.nbits = ((int)(global::haxe.lang.Runtime.toInt(@value))); #line 28 "/opt/haxe/std/haxe/crypto/BaseCode.hx" return(@value); } case 1091627025: { #line 28 "/opt/haxe/std/haxe/crypto/BaseCode.hx" this.@base = ((global::haxe.io.Bytes)(@value)); #line 28 "/opt/haxe/std/haxe/crypto/BaseCode.hx" return(@value); } default: { #line 28 "/opt/haxe/std/haxe/crypto/BaseCode.hx" return(base.__hx_setField(field, hash, @value, handleProperties)); } } } #line default }
public static global::Date fromString(string s) { unchecked { #line 142 "/opt/haxe/std/cs/_std/Date.hx" switch (s.Length) { case 8: { #line 144 "/opt/haxe/std/cs/_std/Date.hx" global::Array <string> k = global::haxe.lang.StringExt.split(s, ":"); return(new global::Date(((global::System.DateTime)(new global::System.DateTime(((int)(1970)), ((int)(1)), ((int)(1)), (global::Std.parseInt(k[0])).@value, (global::Std.parseInt(k[1])).@value, (global::Std.parseInt(k[2])).@value, ((global::System.DateTimeKind)(global::System.DateTimeKind.Utc))))))); } case 10: { #line 147 "/opt/haxe/std/cs/_std/Date.hx" global::Array <string> k1 = global::haxe.lang.StringExt.split(s, "-"); return(new global::Date(((global::System.DateTime)(new global::System.DateTime((global::Std.parseInt(k1[0])).@value, (global::Std.parseInt(k1[1])).@value, (global::Std.parseInt(k1[2])).@value, ((int)(0)), ((int)(0)), ((int)(0)), ((global::System.DateTimeKind)(global::System.DateTimeKind.Local))))))); } case 19: { #line 150 "/opt/haxe/std/cs/_std/Date.hx" global::Array <string> k2 = global::haxe.lang.StringExt.split(s, " "); global::Array <string> y = global::haxe.lang.StringExt.split(k2[0], "-"); #line 152 "/opt/haxe/std/cs/_std/Date.hx" global::Array <string> t = global::haxe.lang.StringExt.split(k2[1], ":"); return(new global::Date(((global::System.DateTime)(new global::System.DateTime((global::Std.parseInt(y[0])).@value, (global::Std.parseInt(y[1])).@value, (global::Std.parseInt(y[2])).@value, (global::Std.parseInt(t[0])).@value, (global::Std.parseInt(t[1])).@value, (global::Std.parseInt(t[2])).@value, ((global::System.DateTimeKind)(global::System.DateTimeKind.Local))))))); } default: { #line 155 "/opt/haxe/std/cs/_std/Date.hx" throw ((global::System.Exception)(global::haxe.Exception.thrown(global::haxe.lang.Runtime.concat("Invalid date format : ", s)))); } } } #line default }
public override object __hx_setField(string field, int hash, object @value, bool handleProperties) { unchecked { #line 5 "/my-component/src/shoppingcart/CartRepository.hx" switch (hash) { case 492416764: { #line 5 "/my-component/src/shoppingcart/CartRepository.hx" this.counter = ((int)(global::haxe.lang.Runtime.toInt(@value))); #line 5 "/my-component/src/shoppingcart/CartRepository.hx" return(@value); } case 1092617875: { #line 5 "/my-component/src/shoppingcart/CartRepository.hx" this.carts = ((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)(@value))))); #line 5 "/my-component/src/shoppingcart/CartRepository.hx" return(@value); } case 4899648: { #line 5 "/my-component/src/shoppingcart/CartRepository.hx" this.bus = ((global::maglev.MagLev)(@value)); #line 5 "/my-component/src/shoppingcart/CartRepository.hx" return(@value); } default: { #line 5 "/my-component/src/shoppingcart/CartRepository.hx" return(base.__hx_setField(field, hash, @value, handleProperties)); } } } #line default }
public override object __hx_invokeField(string field, int hash, global::Array dynargs) { unchecked { switch (hash) { case 1360649653: { this.PrependCustomDictionary(((int)(global::haxe.lang.Runtime.toInt(dynargs[0]))), ((int)(global::haxe.lang.Runtime.toInt(dynargs[1]))), ((uint[])(dynargs[2]))); break; } case 1719859607: { this.WarmupHashHashLongestMatch(((int)(global::haxe.lang.Runtime.toInt(dynargs[0]))), ((uint[])(dynargs[1])), ((global::encode.hash.HashLongestMatch)(dynargs[2]))); break; } case 1113577955: { this.WarmupHashHashLongestMatchQuickly(((int)(global::haxe.lang.Runtime.toInt(dynargs[0]))), ((uint[])(dynargs[1])), ((global::encode.hash.HashLongestMatchQuickly)(dynargs[2]))); break; } case 815032112: { this.Init(((int)(global::haxe.lang.Runtime.toInt(dynargs[0])))); break; } default: { return(base.__hx_invokeField(field, hash, dynargs)); } } return(null); } }
public override object __hx_invokeField(string field, int hash, global::Array dynargs) { unchecked { switch (hash) { case 2084740880: { this.StoreSymbolWithContext(((int)(global::haxe.lang.Runtime.toInt(dynargs[0]))), ((int)(global::haxe.lang.Runtime.toInt(dynargs[1]))), ((int)(global::haxe.lang.Runtime.toInt(dynargs[2]))), ((int[])(dynargs[3])), ((global::Array <int>)(global::Array <object> .__hx_cast <int>(((global::Array)(dynargs[4]))))), ((uint[])(dynargs[5]))); break; } case 1684565497: { this.StoreSymbol(((int)(global::haxe.lang.Runtime.toInt(dynargs[0]))), ((global::Array <int>)(global::Array <object> .__hx_cast <int>(((global::Array)(dynargs[1]))))), ((uint[])(dynargs[2]))); break; } case 523201357: { this.BuildAndStoreEntropyCodes(((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)(dynargs[0]))))), ((global::Array <int>)(global::Array <object> .__hx_cast <int>(((global::Array)(dynargs[1]))))), ((uint[])(dynargs[2]))); break; } case 1606060382: { this.BuildAndStoreBlockSwitchEntropyCodes(((global::Array <int>)(global::Array <object> .__hx_cast <int>(((global::Array)(dynargs[0]))))), ((uint[])(dynargs[1]))); break; } default: { return(base.__hx_invokeField(field, hash, dynargs)); } } return(null); } }
public virtual void FindAuctionsEnding(int endfrom, int endto, int page, int perpage, string sort, bool asc, global::haxe.lang.Function callback) { #line 65 "/my-component/src/englishauction/AuctionRepository.hx" global::Array <object> auctions = new global::Array <object>(); global::maglev.MagLevArray args = global::maglev.MagLevArray.create(); #line 67 "/my-component/src/englishauction/AuctionRepository.hx" args.push(global::maglev.MagLevNumber.fromInt(endfrom)); args.push(global::maglev.MagLevNumber.fromInt(endto)); #line 69 "/my-component/src/englishauction/AuctionRepository.hx" args.push(global::maglev.MagLevNumber.fromInt(page)); args.push(global::maglev.MagLevNumber.fromInt(perpage)); #line 71 "/my-component/src/englishauction/AuctionRepository.hx" args.push(global::maglev.MagLevString.fromString(sort)); args.push(global::maglev.MagLevBoolean.fromBool(asc)); #line 73 "/my-component/src/englishauction/AuctionRepository.hx" global::maglev.MagLevResult res = this.bus.call("Persistence.EnglishAuction.Auction.FindEnding", args); res.onError((((global::englishauction.AuctionRepository_FindAuctionsEnding_74__Fun.__hx_current != null)) ? (global::englishauction.AuctionRepository_FindAuctionsEnding_74__Fun.__hx_current) : (global::englishauction.AuctionRepository_FindAuctionsEnding_74__Fun.__hx_current = ((global::englishauction.AuctionRepository_FindAuctionsEnding_74__Fun)(new global::englishauction.AuctionRepository_FindAuctionsEnding_74__Fun()))))); #line 77 "/my-component/src/englishauction/AuctionRepository.hx" res.onResult(new global::englishauction.AuctionRepository_FindAuctionsEnding_77__Fun(callback, auctions)); }
public static int matchBags(string bagName, global::Array <string> checkedBags, int depth) { unchecked { int count = 0; { object bagKey = ((object)(new global::haxe.ds._StringMap.StringMapKeyIterator <string>(((global::haxe.ds.StringMap <string>)(global::haxe.ds.StringMap <object> .__hx_cast <string>(((global::haxe.ds.StringMap)(((global::haxe.IMap <string, string>)(global::solutions.Day7.bagMap)))))))))); while (global::haxe.lang.Runtime.toBool(global::haxe.lang.Runtime.callField(bagKey, "hasNext", 407283053, null))) { string bagKey1 = global::haxe.lang.Runtime.toString(global::haxe.lang.Runtime.callField(bagKey, "next", 1224901875, null)); if ((!(checkedBags.contains(bagKey1)) && (global::haxe.lang.StringExt.indexOf(global::haxe.lang.Runtime.toString((((global::haxe.ds.StringMap <string>)(global::haxe.ds.StringMap <object> .__hx_cast <string>(((global::haxe.ds.StringMap)(((global::haxe.IMap <string, string>)(global::solutions.Day7.bagMap))))))).@get(bagKey1)).toDynamic()), bagName, default(global::haxe.lang.Null <int>)) > -1))) { count += (1 + global::solutions.Day7.matchBags(bagKey1, checkedBags, ++depth)); checkedBags.push(bagKey1); } } } return(count); } }
public static long calcSlope(global::Array <string> arr, int dx, int dy) { unchecked { long result = ((long)(0)); int x = dx; int y = dy; while ((y < arr.length)) { if ((global::haxe.lang.StringExt.charAt(arr[y], x) == "#")) { result += ((long)(1)); } x = (((x + dx)) % arr[0].Length); y += dy; } return(result); } }
public global::Array <T> filter(global::haxe.lang.Function f) { global::Array <T> ret = new global::Array <T>(new T[] {}); { int _g = 0; int _g1 = this.length; while ((_g < _g1)) { int i = _g++; T elt = global::haxe.lang.Runtime.genericCast <T>(this.__a[i]); if (global::haxe.lang.Runtime.toBool(f.__hx_invoke1_o(default(double), elt))) { ret.push(elt); } } } return(ret); }
public global::Array <T> filter(global::haxe.lang.Function f) { global::Array <T> ret = new global::Array <T>(new T[] {}); { int _g = 0; global::Array <T> _g1 = this; while ((_g < _g1.length)) { T elt = _g1[_g]; ++_g; if (global::haxe.lang.Runtime.toBool(f.__hx_invoke1_o(default(double), elt))) { ret.push(elt); } } } return(ret); }
public override object __hx_invokeField(string field, int hash, global::Array dynargs) { unchecked { switch (hash) { case 1962040800: { this.serialize(dynargs[0]); break; } case 444663929: { this.serializeFields(dynargs[0]); break; } case 997465939: { return(this.serializeRef(dynargs[0])); } case 723690193: { this.serializeString(global::haxe.lang.Runtime.toString(dynargs[0])); break; } default: { return(base.__hx_invokeField(field, hash, dynargs)); } } return(null); } }
public static void StoreTrivialContextMap(int num_types, int context_bits, global::Array <int> storage_ix, uint[] storage) { unchecked { global::encode.Brotli_bit_stream.StoreVarLenUint8((num_types - 1), storage_ix, storage); if ((num_types > 1)) { int repeat_code = (context_bits - 1); int repeat_bits = (((1 << repeat_code)) - 1); int alphabet_size = (num_types + repeat_code); int[] histogram = global::FunctionMalloc.mallocInt(alphabet_size); uint[] depths = global::FunctionMalloc.mallocUInt(alphabet_size); uint[] bits = global::FunctionMalloc.mallocUInt(alphabet_size); global::encode.Write_bits.WriteBits(1, ((uint)(1)), storage_ix, storage); global::encode.Write_bits.WriteBits(4, ((uint)((repeat_code - 1))), storage_ix, storage); ((int[])(histogram))[repeat_code] = num_types; ((int[])(histogram))[0] = 1; { int _g1 = context_bits; while ((_g1 < alphabet_size)) { ((int[])(histogram))[_g1++] = 1; } } global::encode.Brotli_bit_stream.BuildAndStoreHuffmanTree(histogram, alphabet_size, depths, 0, bits, 0, storage_ix, storage); { int _g11 = 0; while ((_g11 < num_types)) { int i = _g11++; int code = (((i == 0)) ? (0) : (((i + context_bits) - 1))); global::encode.Write_bits.WriteBits(((int)(((uint)(((uint[])(depths))[code])))), ((uint)(((uint[])(bits))[code])), storage_ix, storage); global::encode.Write_bits.WriteBits(((int)(((uint)(((uint[])(depths))[repeat_code])))), ((uint)(((uint[])(bits))[repeat_code])), storage_ix, storage); global::encode.Write_bits.WriteBits(repeat_code, ((uint)(repeat_bits)), storage_ix, storage); } } global::encode.Write_bits.WriteBits(1, ((uint)(1)), storage_ix, storage); } } }
public static global::Array <int> findFault(int startIndex, int accumulator) { unchecked { int index = startIndex; int programTerminated = -1; global::Array <int> opArr = null; global::Array <string> instructionArr = null; while ((index != global::solutions.Day8.loopEnd)) { if (((index != startIndex) && global::solutions.Day8.loopHistory.contains(index))) { break; } if ((index == global::solutions.Day8.instructions.length)) { programTerminated = 1; break; } instructionArr = global::haxe.lang.StringExt.split(global::solutions.Day8.instructions[index], " "); if ((index == startIndex)) { if ((global::haxe.lang.StringExt.indexOf(instructionArr[0], "jmp", default(global::haxe.lang.Null <int>)) > -1)) { instructionArr[0] = "nop"; } else if ((global::haxe.lang.StringExt.indexOf(instructionArr[0], "nop", default(global::haxe.lang.Null <int>)) > -1)) { instructionArr[0] = "jmp"; } } opArr = global::solutions.Day8.runOp(instructionArr, index, accumulator); index = opArr[0]; accumulator = opArr[1]; } return(new global::Array <int>(new int[] { accumulator, programTerminated })); } }
public override object __hx_invokeField(string field, int hash, global::Array dynargs) { unchecked { switch (hash) { case 1885040770: { this.DeserializeFromBytes(((global::haxe.io.Bytes)(dynargs[0]))); break; } case 337619441: { this.DeserializeFromJson(global::haxe.lang.Runtime.toString(dynargs[0])); break; } case 1630734736: { this.SeriralizeToBytes(((global::haxe.io.Bytes)(dynargs[0]))); break; } case 1990209315: { return(this.SerializeToJson()); } default: { return(base.__hx_invokeField(field, hash, dynargs)); } } return(null); } }
public override object __hx_invokeField(string field, int hash, global::Array dynargs) { unchecked { switch (hash) { case 928091019: { this.FindAllMatches(((uint[])(dynargs[0])), ((int)(global::haxe.lang.Runtime.toInt(dynargs[1]))), ((uint)(global::haxe.lang.Runtime.toInt(dynargs[2]))), ((uint)(global::haxe.lang.Runtime.toInt(dynargs[3]))), ((uint)(global::haxe.lang.Runtime.toInt(dynargs[4]))), ((int[])(dynargs[5])), ((int)(global::haxe.lang.Runtime.toInt(dynargs[6]))), ((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)(dynargs[7]))))), ((int)(global::haxe.lang.Runtime.toInt(dynargs[8])))); break; } case 322068116: { return(this.FindLongestMatch(((uint[])(dynargs[0])), ((int)(global::haxe.lang.Runtime.toInt(dynargs[1]))), ((int[])(dynargs[2])), ((uint)(global::haxe.lang.Runtime.toInt(dynargs[3]))), ((uint)(global::haxe.lang.Runtime.toInt(dynargs[4]))), ((uint)(global::haxe.lang.Runtime.toInt(dynargs[5]))), ((global::Array <int>)(global::Array <object> .__hx_cast <int>(((global::Array)(dynargs[6]))))), ((global::Array <int>)(global::Array <object> .__hx_cast <int>(((global::Array)(dynargs[7]))))), ((global::Array <int>)(global::Array <object> .__hx_cast <int>(((global::Array)(dynargs[8]))))), ((global::Array <double>)(global::Array <object> .__hx_cast <double>(((global::Array)(dynargs[9]))))))); } case 390300609: { this.Store(((uint[])(dynargs[0])), ((int)(global::haxe.lang.Runtime.toInt(dynargs[1]))), ((int)(global::haxe.lang.Runtime.toInt(dynargs[2])))); break; } case 2046146991: { this.Reset(); break; } default: { return(base.__hx_invokeField(field, hash, dynargs)); } } return(null); } }
public override object __hx_invokeField(string field, int hash, global::Array dynargs) { unchecked { switch (hash) { case 870035731: { this.Next(); break; } default: { return(base.__hx_invokeField(field, hash, dynargs)); } } return(null); } }
public static global::Array <T> shuffle <T>(global::Array <T> arr) { unchecked { if ((arr != null)) { int _g = 0; int _g1 = arr.length; while ((_g < _g1)) { int i = _g++; int j = ((int)(global::System.Math.Floor(((double)(((((arr.length - 1) + 1)) * global::Math.rand.NextDouble())))))); T a = arr[i]; T b = arr[j]; arr[i] = b; arr[j] = a; } } return(arr); } }
public static global::haxe.lang.Null <T> enumConstructor <T>(global::System.Type e) { unchecked { if (!(global::haxe.lang.Runtime.typeEq(e, null))) { global::Array <object> arr = ((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)(global::Type.allEnums <T>(((global::System.Type)(e)))))))); if (((arr != null) && (arr.length > 0))) { return(global::haxe.lang.Null <object> .ofDynamic <T>(arr[((int)(global::System.Math.Floor(((double)(((((arr.length - 1) + 1)) * global::Math.rand.NextDouble()))))))])); } else { return(default(global::haxe.lang.Null <T>)); } } else { return(default(global::haxe.lang.Null <T>)); } } }
public static global::haxe.lang.Null <T> fromIterable <T>(object it) { unchecked { if ((it != null)) { global::Array <object> arr = ((global::Array <object>)(global::Array <object> .__hx_cast <object>(((global::Array)(global::Lambda.array <T>(((object)(it)))))))); if (((arr != null) && (arr.length > 0))) { return(global::haxe.lang.Null <object> .ofDynamic <T>(arr[((int)(global::System.Math.Floor(((double)(((((arr.length - 1) + 1)) * global::Math.rand.NextDouble()))))))])); } else { return(default(global::haxe.lang.Null <T>)); } } else { return(default(global::haxe.lang.Null <T>)); } } }
public static void solve() { unchecked { global::System.Console.WriteLine(((object)("Solving Day8"))); global::solutions.Day8.instructions = global::haxe.lang.StringExt.split(global::solutions.Day8.input, "\r\n"); global::System.Console.WriteLine(((object)(global::haxe.lang.Runtime.concat("a: ", global::haxe.lang.Runtime.toString(global::solutions.Day8.runInstructions()))))); { object key = ((object)(new global::haxe.ds._IntMap.IntMapKeyIterator <int>(((global::haxe.ds.IntMap <int>)(global::haxe.ds.IntMap <object> .__hx_cast <int>(((global::haxe.ds.IntMap)(((global::haxe.IMap <int, int>)(global::solutions.Day8.testNodes)))))))))); while (global::haxe.lang.Runtime.toBool(global::haxe.lang.Runtime.callField(key, "hasNext", 407283053, null))) { int key1 = ((int)(global::haxe.lang.Runtime.toInt(global::haxe.lang.Runtime.callField(key, "next", 1224901875, null)))); global::Array <int> resultArr = global::solutions.Day8.findFault(key1, (((global::haxe.ds.IntMap <int>)(global::haxe.ds.IntMap <object> .__hx_cast <int>(((global::haxe.ds.IntMap)(((global::haxe.IMap <int, int>)(global::solutions.Day8.testNodes))))))).@get(key1)).@value); if ((resultArr[1] > -1)) { global::System.Console.WriteLine(((object)(global::haxe.lang.Runtime.concat("b: ", global::haxe.lang.Runtime.toString(resultArr[0]))))); break; } } } } }
public static global::Array <B> mapi <A, B>(object it, global::haxe.lang.Function f) { #line 79 "/opt/haxe/std/Lambda.hx" int i = 0; global::Array <B> _g = new global::Array <B>(new B[] {}); { #line 80 "/opt/haxe/std/Lambda.hx" object x = ((object)(global::haxe.lang.Runtime.callField(it, "iterator", 328878574, null))); #line 80 "/opt/haxe/std/Lambda.hx" while (global::haxe.lang.Runtime.toBool(global::haxe.lang.Runtime.callField(x, "hasNext", 407283053, null))) { #line 80 "/opt/haxe/std/Lambda.hx" A x1 = global::haxe.lang.Runtime.genericCast <A>(global::haxe.lang.Runtime.callField(x, "next", 1224901875, null)); #line 80 "/opt/haxe/std/Lambda.hx" _g.push(global::haxe.lang.Runtime.genericCast <B>(f.__hx_invoke2_o(((double)(i++)), global::haxe.lang.Runtime.undefined, default(double), x1))); } } #line 80 "/opt/haxe/std/Lambda.hx" return(_g); }
public static void RecomputeDistancePrefixes(global::Array <object> cmds, int num_commands, int num_direct_distance_codes, int distance_postfix_bits) { unchecked { if (((num_direct_distance_codes == 0) && (distance_postfix_bits == 0))) { return; } { int _g1 = 0; while ((_g1 < num_commands)) { global::encode.command.Command cmd = ((global::encode.command.Command)(cmds[_g1++])); if (((cmd.copy_len_ > 0) && ((bool)((cmd.cmd_prefix_[0] >= 128))))) { global::encode.Prefix.PrefixEncodeCopyDistance(cmd.DistanceCode(), num_direct_distance_codes, distance_postfix_bits, cmd.dist_prefix_, cmd.dist_extra_); } } } } }
public override object __hx_invokeField(string field, int hash, global::Array dynargs) { unchecked { switch (hash) { case 4846113: { this.@add(global::haxe.lang.Runtime.genericCast <T>(dynargs[0])); break; } default: { return(base.__hx_invokeField(field, hash, dynargs)); } } return(null); } }
public override object __hx_invokeField(string field, int hash, global::Array dynargs) { unchecked { switch (hash) { case 1309131464: { this.HuffmanTree3(((int)(global::haxe.lang.Runtime.toInt(dynargs[0]))), ((int)(global::haxe.lang.Runtime.toInt(dynargs[1]))), ((int)(global::haxe.lang.Runtime.toInt(dynargs[2])))); break; } default: { return(base.__hx_invokeField(field, hash, dynargs)); } } return(null); } }