Corrupt .8xp file for TI 84+ - compilation

I am trying to write a few programs for my TI 84+ calculator. I am writing in a basic text editor on my desktop and then compiling into .8xp files, because it is much easier than typing on the actual device. I would then like to pass the .8xp file to my calculator via TI Connect.
However, the programs I write on my desktop do not transfer to the calculator because they are "corrupt or invalid." There are no syntax errors in my TI Basic code, and it runs perfectly on my TI emulator on my computer.
I've written the exact same program on my desktop and on my calculator to experiment with the problem, and when I compare the .8xp hex files, they are almost identical, but differ slightly. Is this simply because my compiler for my .8xp files is not working properly? If that was the case, why would it run in my emulator and not the actual calculator? Are there certain functions that I should avoid when programming in TI Basic on my computer, because the compiler may have a hard time compiling? Does anyone know how to fix these corrupt file issues? I've been perusing Google to no avail as well.
If it helps, .8xp files are the user-written program files for the TI-84+, which uses z80 assembly. I am using the Wabbitemu emulator.
EDIT: Here are the two .8xp files that are not the same. One was written on my computer and then compiled, and the other was written on my calculator. The code for the program is:
Output(1,1,"HELLO")
From my calculator:
2a2a 5449 3833 462a 1a0a 0050 726f 6772
616d 2066 696c 6520 3130 2f32 392f 3136
2c20 3130 3a33 3600 0000 0000 0000 0000
0000 0000 0020 000d 000f 0005 4845 4c4c
4f00 0000 0000 0f00 0d00 e031 2b31 2b2a
4845 4c4c 4f2a 1122 05
From my computer:
2a2a 5449 3833 462a 1a0a 0047 656e 6572
6174 6564 2062 7920 7468 6520 5449 2d42
4153 4943 2043 6f6d 7069 6c65 722e 0000
0000 0000 0021 000d 0010 0005 4845 4c4c
4f32 0000 0000 1000 0e00 e031 2b31 2b2a
4845 4c4c 4f2a 113f 9605
In addition, here's the .8xp for my program that is allegedly corrupt or invalid. The code is for the game Checkers (keep in mind it still needs some serious optimization):
2a2a 5449 3833 462a 1a0a 0047 656e 6572
6174 6564 2062 7920 7468 6520 5449 2d42
4153 4943 2043 6f6d 7069 6c65 722e 0000
0000 0000 0011 0d0d 0000 0d05 4348 4543
4b45 5253 0000 000d fe0c 2a53 4554 2955
5029 424f 4152 443f e13f 3104 583f d158
6d38 3fe0 582b 392b 2a2d 2a11 3f31 7058
0458 3fd4 3f36 3404 b55d 0011 3fe2 302b
5d00 113f 3104 5d00 1032 113e 3104 5d00
1034 113e 3104 5d00 1036 113e 3104 5d00
1038 113e 3104 5d00 1039 113e 3104 5d00
1031 3111 3e31 045d 0010 3133 113e 3104
5d00 1031 3511 3e31 045d 0010 3138 113e
3104 5d00 1032 3011 3e31 045d 0010 3232
113e 3104 5d00 1032 3411 3f32 045d 0010
3431 113e 3204 5d00 1034 3311 3e32 045d
0010 3435 113e 3204 5d00 1034 3711 3e32
045d 0010 3530 113e 3204 5d00 1035 3211
3e32 045d 0010 3534 113e 3204 5d00 1035
3611 3e32 045d 0010 3537 113e 3204 5d00
1035 3911 3e32 045d 0010 3631 113e 3204
5d00 1036 3311 3f08 3132 2b31 3209 045d
013f 2a44 5241 5729 5049 4543 4553 294f
4e29 424f 4152 443f 2a4f 2a04 aa00 3e2a
702a 04aa 013e 2af0 2a04 aa02 3f31 0458
3e31 0459 3e31 045b 3e30 0441 3fd1 5b6d
3634 3f52 454d 4149 4e44 4552 105b 2b38
1104 583f ce58 6a30 3e38 0458 3f12 105b
8338 1170 3a34 2b30 1104 593f 5d00 105b
1104 413f ce41 6a31 3ee0 592b 582b aa00
113f ce41 6a32 3ee0 592b 582b aa01 113f
5b70 3104 5b3f d43f 2a55 4929 5354 5546
463f e031 2b31 302b 2a54 5552 4e3e 292a
113f e033 2b31 302b 2a53 454c 4543 542a
113e e034 2b31 322b 2a50 4945 4345 2a11
3f2a 4d41 494e 2947 414d 4529 4c4f 4f50
3f2a 1050 2b51 1129 6a29 4355 5253 4f52
2943 4f4f 5244 533f 2a10 412b 4211 296a
2950 5245 5649 4f55 5329 434f 4f52 4453
3f2a 5b29 6a29 4c49 5354 2949 4e44 4558
2941 5429 5052 4556 494f 5553 3f2a 5a29
6a29 4c49 5354 2949 4e44 4558 2941 5429
4355 5253 4f52 3f2a 5229 6a29 5641 4c55
4529 4154 2950 5245 5649 4f55 533f 2a4d
296a 2949 4e54 4552 4d45 4449 4154 4529
5641 5249 4142 4c45 2910 5445 4d50 113f
2a46 2b47 296a 2949 4e54 4552 4d45 4449
4154 4529 5641 5249 4142 4c45 2910 5445
4d50 113f 2a4e 296a 2949 4e54 4552 4d45
4449 4154 4529 4d41 5448 2956 4152 4941
424c 453f 2a10 552b 5611 296a 294d 4f56
4529 434f 4f52 4453 3f2a 4829 6a29 434f
554e 5445 5229 464f 5229 464c 4153 4849
4e47 2943 5552 534f 523f 2a43 296a 29ad
3f2a 5729 6a29 4d4f 5645 294c 1031 113c
5210 3211 3f2a 4429 6a29 4355 5252 454e
5429 504c 4159 4552 2910 4529 6a29 4845
4c50 4552 2956 4152 113f 2a4a 2b4b 296a
2944 4f55 424c 4529 4a55 4d50 2943 4f55
4e54 4552 3f2a 4929 6a29 5354 4154 5553
294f 4629 4741 4d45 3f34 0450 3e31 0451
3e31 0441 3e31 0442 3e30 045b 3e30 045a
3e30 0452 3e31 0444 3e30 0449 3fd1 496a
303f 5004 413e 5104 423f 3882 4104 4e3e
4e71 3804 4e3e 4e70 4204 5b3f d272 3fad
0443 3fd4 3f5d 0010 5b11 0452 3fce 526a
303e e041 2b42 2b2a 292a 113f ce52 6a31
3ee0 412b 422b aa00 113f ce52 6a32 3ee0
412b 422b aa01 113f ce43 6a32 343e 5171
3104 513f ce43 6a32 353e 5071 3104 503f
ce43 6a32 363e 5170 3104 513f ce43 6a33
343e 5070 3104 503f ce43 6a31 3035 3ecf
3e3f 3882 5004 4e3e 4e71 3804 4e3e 4e70
5104 5a3f 3004 483e 3004 573e 3004 4a3e
3004 4b3f 5d00 105a 1104 523f e034 2b31
302b 2a29 2929 2929 2929 2a11 3ee0 342b
3132 2b2a 4d4f 5645 2a11 3fce 526a 3240
446a 313e cf3f d157 6a30 3fce 486b 333e
cf3e e050 2b51 2b2a 292a 113e d03e e050
2b51 2baa 0111 3ed4 3f52 454d 4149 4e44
4552 105a 7139 2b38 1104 553f ce55 6a30
3e38 0455 3f12 1010 5a71 3911 8338 1170
3a34 2b30 1104 563f ce10 5a71 3911 6d30
3c5a 6a35 373c 5a6a 3431 3c5a 6a32 353c
5a6a 393e cf3e b031 0446 3ed0 3e5d 0010
5a71 3911 0446 3ed4 3fce 466a 303e cf3e
e056 2b55 2b2a af2a 113f d03e ce46 6a31
4010 5a71 3138 116c 3040 105a 7139 116f
3537 4010 5a71 3911 6f34 3140 105a 7139
116f 3235 4010 5a71 3911 6f39 3ecf 3e5a
7139 045a 3e52 454d 4149 4e44 4552 105a
7139 2b38 1104 553e ce55 6a30 3e38 0455
3e12 1010 5a71 3911 8338 1170 3a34 2b30
1104 563e 5d00 105a 7139 1104 463e 5a70
3904 5a3e ce46 6a30 3ecf 3ee0 562b 552b
2aaf 2a11 3e31 044a 3ed4 3ed4 3ed4 3f52
454d 4149 4e44 4552 105a 7137 2b38 1104
553f ce55 6a30 3e38 0455 3f12 1010 5a71
3711 8338 1170 3a34 2b30 1104 563f ce10
5a71 3711 6d30 3c5a 6a38 3c5a 6a32 343c
5a6a 3430 3c5a 6a35 363e cf3e b031 0447
3ed0 3e5d 0010 5a71 3711 0447 3ed4 3fce
476a 303e cf3e e056 2b55 2b2a af2a 113f
d03e ce47 6a31 4010 5a71 3134 116c 3040
105a 7137 116f 3840 105a 7137 116f 3234
4010 5a71 3711 6f34 3040 105a 7137 116f
3536 3ecf 3e5a 7137 045a 3e52 454d 4149
4e44 4552 105a 7137 2b38 1104 553e ce55
6a30 3e38 0455 3e12 1010 5a71 3711 8338
1170 3a34 2b30 1104 563e 5d00 105a 7137
1104 473e 5a70 3704 5a3e ce47 6a30 3ecf
3ee0 562b 552b 2aaf 2a11 3e31 044b 3ed4
3ed4 3ed4 3f48 7031 0448 3fce 486e 363e
3004 483f ad04 433f ce43 6a32 343e 3104
573f ce43 6a32 363e 3204 573f ce43 6a31
3035 3ecf 3e33 0457 3e31 0445 3ed0 3e32
0445 3ed4 3fd4 3ed4 3fce 526a 3140 446a
323e cf3f d157 6a30 3fce 486b 333e cf3e
e050 2b51 2b2a 292a 113e d03e e050 2b51
2baa 0011 3ed4 3f52 454d 4149 4e44 4552
105a 7039 2b38 1104 553f ce55 6a30 3e38
0455 3f12 1010 5a70 3911 8338 1170 3a34
2b30 1104 563f ce10 5a70 3911 6e36 353c
5a6a 383c 5a6a 3234 3c5a 6a34 303c 5a6a
3536 3ecf 3eb0 3104 463e d03e 5d00 105a
7039 1104 463e d43f ce46 6a30 3ecf 3ee0
562b 552b 2aaf 2a11 3fd0 3ece 466a 3240
105a 7031 3811 6b36 3540 105a 7039 116f
3840 105a 7039 116f 3234 4010 5a70 3911
6f34 3040 105a 7039 116f 3536 3ecf 3e5a
7039 045a 3e52 454d 4149 4e44 4552 105a
7039 2b38 1104 553e ce55 6a30 3e38 0455
3e12 1010 5a70 3911 8338 1170 3a34 2b30
1104 563e 5d00 105a 7039 1104 463e 5a71
3904 5a3e ce46 6a30 3ecf 3ee0 562b 552b
2aaf 2a11 3e31 044a 3ed4 3ed4 3ed4 3f52
454d 4149 4e44 4552 105a 7037 2b38 1104
553f ce55 6a30 3e38 0455 3f12 1010 5a70
3711 8338 1170 3a34 2b30 1104 563f ce10
5a70 3711 6e36 353c 5a6a 3537 3c5a 6a34
313c 5a6a 3235 3c5a 6a39 3ecf 3eb0 3104
473e d03e 5d00 105a 7037 1104 473e d43f
ce47 6a30 3ecf 3ee0 562b 552b 2aaf 2a11
3fd0 3ece 476a 3240 105a 7031 3411 6b36
3540 105a 7037 116f 3537 4010 5a70 3711
6f34 3140 105a 7037 116f 3235 4010 5a70
3711 6f39 3ecf 3e5a 7037 045a 3e52 454d
4149 4e44 4552 105a 7037 2b38 1104 553e
ce55 6a30 3e38 0455 3e12 1010 5a70 3711
8338 1170 3a34 2b30 1104 563e 5d00 105a
7037 1104 473e 5a71 3704 5a3e ce47 6a30
3ecf 3ee0 562b 552b 2aaf 2a11 3e31 044b
3ed4 3ed4 3ed4 3f48 7031 0448 3fce 486e
363e 3004 483f ad04 433f ce43 6a32 343e
3104 573f ce43 6a32 363e 3204 573f ce43
6a31 3035 3ecf 3e33 0457 3e32 0445 3ed0
3e31 0445 3ed4 3fd4 3ed4 3fe0 332b 3130
2b2a 2929 2929 2929 292a 113f e034 2b31
302b 2a29 2929 2929 2929 2a11 3fe0 362b
3130 2b2a 574f 524b 494e 472a 113f e038
2b31 302b 2a3a 2a11 3fce 446a 313e cf3f
ce57 6a31 4046 6a30 3ecf 3ece 4a6a 303e
cf3e 3204 5d00 105a 7139 113e 3004 5d00
105a 113e d03e ce4a 6a31 3ecf 3e32 045d
0010 5a71 3138 113e 3004 5d00 105a 113e
3004 5d00 105a 7139 113e d43e d43e d43f
ce57 6a32 4047 6a30 3ecf 3ece 4b6a 303e
cf3e 3204 5d00 105a 7137 113e 3004 5d00
105a 113e d03e ce4b 6a31 3ecf 3e32 045d
0010 5a71 3134 113e 3004 5d00 105a 113e
3004 5d00 105a 7137 113e d43e d43e d43f
e038 2b31 312b 2a3a 2a11 3fd0 3e3f ce57
6a32 4046 6a30 3ecf 3ece 4a6a 303e cf3e
3104 5d00 105a 7039 113e 3004 5d00 105a
113e d03e ce4a 6a31 3ecf 3e31 045d 0010
5a70 3138 113e 3004 5d00 105a 113e 3004
5d00 105a 7039 113e d43e d43e d43f ce57
6a31 4047 6a30 3ecf 3ece 4b6a 303e cf3e
3104 5d00 105a 7037 113e 3004 5d00 105a
113e d03e ce4b 6a31 3ecf 3e31 045d 0010
5a70 3134 113e 3004 5d00 105a 113e 3004
5d00 105a 7037 113e d43e d43e d43f e038
2b31 312b 2a3a 2a11 3fd4 3f31 0458 3e31
0459 3e31 044d 3e30 044e 3f08 302b 3009
045d 013f d14d 6d36 343f 5245 4d41 494e
4445 5210 4d2b 3811 0458 3fce 586a 303e
3804 583f 1210 4d83 3811 703a 342b 3011
0459 3f5d 0010 4d11 044e 3fce 4e6a 303e
e059 2b58 2b2a 292a 113f ce4e 6a31 3ecf
3ee0 592b 582b aa00 113e 5d01 1031 1170
3104 5d01 1031 113e d43f ce4e 6a32 3ecf
3ee0 592b 582b aa01 113e 5d01 1032 1170
3104 5d01 1032 113e d43f ce4d 6a31 363e
e038 2b31 322b 2a3a 2a11 3fce 4d6a 3332
3ee0 382b 3133 2b2a 3a2a 113f ce4d 6a34
383e e038 2b31 342b 2a3a 2a11 3fce 4d6a
3633 3ee0 382b 3135 2b2a 3a2a 113f 4d70
3104 4d3f d43f ce5d 0110 3111 6a30 3e32
0449 3fce 5d01 1032 116a 303e 3104 493f
ce45 6a32 3e32 0444 3fce 456a 313e 3104
443f e038 2b31 362b 2a3a 2a11 3fe0 342b
3130 2b2a 2929 2929 2929 292a 113f e031
2b31 302b 2a54 5552 4e3e 292a 113f e033
2b31 302b 2a53 454c 4543 542a 113e e034
2b31 322b 2a50 4945 4345 2a11 3fe0 362b
3130 2b2a 2929 2929 2929 292a 113f d43f
2a55 4929 5354 5546 463f ce44 6a32 3ee0
312b 3136 2baa 0011 3fce 446a 313e e031
2b31 362b aa01 113f ce50 6a30 3e31 0450
3fce 506a 393e 3804 503f ce51 6a30 3e31
0451 3fce 516a 393e 3804 513f e050 2b51
2baa 0211 3fe0 382b 3130 2b2a 2929 2929
2929 292a 113f d43f 6aa5

The only difference I can see between the two .8xps, both of which appear to have correct headers and checksums, is that the one from your computer, which is a byte longer, appends a 0x3f 'hard return' after its tokenisation of Output(1,1,"HELLO"). The last two bytes are a checksum, the 0x3f when present is the byte before that, and the earlier differences are all about the different length of subsequent data.
So, if I had to go out on a limb, is this perhaps a CR/LF misunderstanding? Maybe you're using a tool originally designed under Linux with text from a Windows-hosted editor? Try eliminating your final line break entirely if you can as a test; if that succeeds then see whether your editor supports using only linefeed characters rather than carriage return + linefeeds.

Related

Radix Sort Convert Ascending to Descending (Pascal)

*edit
I have radix sort procedure, and i got this code on another site referension. But this radix sort only for ascending not for descending.
Can you guys help me how to make it to descending
Program SortStuff;
Uses Crt, Dos;
Type
AType = Array [1..400] of Integer;
Ptr = ^Node;
Node = Record
Info : Integer;
Link : Ptr;
end;
LType = Array [0..9] of Ptr;
Var
Ran : AType;
MaxData : Integer;
and this section of the procedure of refill
Procedure Refill (Var A : AType; Var L : LType);
Var
I, J : Integer;
P : Ptr;
begin
J := 1;
For I := 0 to 9 do
begin
P := L [I];
While P <> Nil do
begin
A [J] := P^.Info;
P := P^.Link;
J := J + 1;
end;
end;
For I := 0 to 9 do
L [I] := Nil;
end;
This is the radix sort code
Procedure RadixSort (Var A : AType; MaxData : Integer);
Var
L : LType;
I,
divisor,
ListNo,
Number : Integer;
begin
For I := 0 to 9 do L [I] := Nil;
divisor := 1;
While divisor <= 1000 do
begin
I := 1;
While I <= MaxData do
begin
Number := A [I];
ListNo := Number div divisor MOD 10;
Insert (L, Number, ListNo);
I := I + 1;
end;
Refill (A, L);
divisor := 10 * divisor;
end;
end;
and this the main code
begin
ReadData (Ran, MaxData);
Writeln ('Unsorted : ');
WriteArray (Ran, MaxData);
RadixSort (Ran, MaxData);
Writeln ('Sorted : ');
WriteArray (Ran, MaxData);
readln;
end.
this is the result of the compiler when ascending
Unsorted :
7131 5110 638 7836 3809 1278 9577 7590 8244 5902 7610 4787 6809 1510 3564 3358 6411 995 4966 9800 5807 678 9174 9385 4146 1824 4869 9383 3638 2304 8130 1178 5102 2192 1739 1643 2965 7245 7050 2416 3778 5515 4395 3418 4869 9814 6073 5014 8501 210 3966 4891 8992 2882 5512 3775 799 9985 8189 4664 4360 241 7681 6235 7152 8032 8874 19 9253 1943 2049 8301 1848 9175 8698 6578 8111 4442 5157 8832 9848 6448 3881 2753 4100 1130 9516 4539 5515 9756 1047 3313 2937 575 8634 9439 8508 8 2596 3814 4996 5129 9810 1220 8242 7672 7342 1320 3195 7590 4342 5697 7866 2326 6726 3441 8276 6531 2211 6285 4492 9310 2155 2349 1396 9157 772 3984 1955 9417 7644 4814 90 7922 180 6536 7018 7411 263 3775 2014 2339 4064 6623 4173 4031 5979 4930 7654 4039 1531 4916 7357 8802 6935 6108 1580 3999 6225 2641 6330 6907 2584 3437 7753 8680 2192 4461 748 983 364 1695 197 8174 3128 104 4724 546 3826 7640 8669 4481 4763 599 2983 4433 92 8317 8102 413 91 1355 7456 4577 8442 26 8319 5010 1140 1232 1688 4080 4445 3548 5713 8391 4295 296 294 1477 8487 5823 9493 4528 434 2589 9499 6092 9784 6773 1907 9382 2203 3774 8438 8672 3290 3590 4540 2912 7308 9782 5615 8352 9456 5867 5657 218 6838 6294 3295 4741 5949 9369 8949 9672 5853 7054 855 3755 3113 4712 9043 3412 4546 2567 9934 2034 2007 1845 6466 2815 3012 498 5736 2487 881 6250 780 6817 7309 8503 9697 6149 7132 6936 5692 2757 6150 2705 1401 9272 4190 6116 8096 2386 2027 8913 7734 7318 4423 8439 7087 7995 8429 7139 818 1495 3284 2418 3295 5121 2989 5741 433 1905 5468 9828 8946 3179 7615 894 9766 2971 847 6450 4686 9597 4851 2080 7062 1956 2386 7476 1703 2738 3864 6491 7545 3046 1432 1050 3534 6054 5005 4862 9126 2877 1259 8613 1209 4982 236 9877 1697 4142 7484 2562 1554 8105 6483 3440 1462 8463 2006 7193 8316 281 6544 645 7043 2857 70 5525 6953 8924 7032 7593 4514 2192 8088 59 2861 4685 897 7319 3300 410 773 2147 9992 2985 8834 302 437 4323 6566 8357 9802 8257 7543 3607 1131 564 9474 9203 9127 575 708 7767
Sorted :
8 19 26 59 70 90 91 92 104 180 197 210 218 236 241 263 281 294 296 302 364 410 413 433 434 437 498 546 564 575 575 599 638 645 678 708 748 772 773 780 799 818 847 855 881 894 897 983 995 1047 1050 1130 1131 1140 1178 1209 1220 1232 1259 1278 1320 1355 1396 1401 1432 1462 1477 1495 1510 1531 1554 1580 1643 1688 1695 1697 1703 1739 1824 1845 1848 1905 1907 1943 1955 1956 2006 2007 2014 2027 2034 2049 2080 2147 2155 2192 2192 2192 2203 2211 2304 2326 2339 2349 2386 2386 2416 2418 2487 2562 2567 2584 2589 2596 2641 2705 2738 2753 2757 2815 2857 2861 2877 2882 2912 2937 2965 2971 2983 2985 2989 3012 3046 3113 3128 3179 3195 3284 3290 3295 3295 3300 3313 3358 3412 3418 3437 3440 3441 3534 3548 3564 3590 3607 3638 3755 3774 3775 3775 3778 3809 3814 3826 3864 3881 3966 3984 3999 4031 4039 4064 4080 4100 4142 4146 4173 4190 4295 4323 4342 4360 4395 4423 4433 4442 4445 4461 4481 4492 4514 4528 4539 4540 4546 4577 4664 4685 4686 4712 4724 4741 4763 4787 4814 4851 4862 4869 4869 4891 4916 4930 4966 4982 4996 5005 5010 5014 5102 5110 5121 5129 5157 5468 5512 5515 5515 5525 5615 5657 5692 5697 5713 5736 5741 5807 5823 5853 5867 5902 5949 5979 6054 6073 6092 6108 6116 6149 6150 6225 6235 6250 6285 6294 6330 6411 6448 6450 6466 6483 6491 6531 6536 6544 6566 6578 6623 6726 6773 6809 6817 6838 6907 6935 6936 6953 7018 7032 7043 7050 7054 7062 7087 7131 7132 7139 7152 7193 7245 7308 7309 7318 7319 7342 7357 7411 7456 7476 7484 7543 7545 7590 7590 7593 7610 7615 7640 7644 7654 7672 7681 7734 7753 7767 7836 7866 7922 7995 8032 8088 8096 8102 8105 8111 8130 8174 8189 8242 8244 8257 8276 8301 8316 8317 8319 8352 8357 8391 8429 8438 8439 8442 8463 8487 8501 8503 8508 8613 8634 8669 8672 8680 8698 8802 8832 8834 8874 8913 8924 8946 8949 8992 9043 9126 9127 9157 9174 9175 9203 9253 9272 9310 9369 9382 9383 9385 9417 9439 9456 9474 9493 9499 9516 9577 9597 9672 9697 9756 9766 9782 9784 9800 9802 9810 9814 9828 9848 9877 9934 9985 9992
then i tried to modify ListNo := Number div divisor MOD 10; and reverse it into ListNo := divisor div Number MOD 10; and the final result become to
Unsorted :
7131 5110 638 7836 3809 1278 9577 7590 8244 5902 7610 4787 6809 1510 3564 3358 6411 995 4966 9800 5807 678 9174 9385 4146 1824 4869 9383 3638 2304 8130 1178 5102 2192 1739 1643 2965 7245 7050 2416 3778 5515 4395 3418 4869 9814 6073 5014 8501 210 3966 4891 8992 2882 5512 3775 799 9985 8189 4664 4360 241 7681 6235 7152 8032 8874 19 9253 1943 2049 8301 1848 9175 8698 6578 8111 4442 5157 8832 9848 6448 3881 2753 4100 1130 9516 4539 5515 9756 1047 3313 2937 575 8634 9439 8508 8 2596 3814 4996 5129 9810 1220 8242 7672 7342 1320 3195 7590 4342 5697 7866 2326 6726 3441 8276 6531 2211 6285 4492 9310 2155 2349 1396 9157 772 3984 1955 9417 7644 4814 90 7922 180 6536 7018 7411 263 3775 2014 2339 4064 6623 4173 4031 5979 4930 7654 4039 1531 4916 7357 8802 6935 6108 1580 3999 6225 2641 6330 6907 2584 3437 7753 8680 2192 4461 748 983 364 1695 197 8174 3128 104 4724 546 3826 7640 8669 4481 4763 599 2983 4433 92 8317 8102 413 91 1355 7456 4577 8442 26 8319 5010 1140 1232 1688 4080 4445 3548 5713 8391 4295 296 294 1477 8487 5823 9493 4528 434 2589 9499 6092 9784 6773 1907 9382 2203 3774 8438 8672 3290 3590 4540 2912 7308 9782 5615 8352 9456 5867 5657 218 6838 6294 3295 4741 5949 9369 8949 9672 5853 7054 855 3755 3113 4712 9043 3412 4546 2567 9934 2034 2007 1845 6466 2815 3012 498 5736 2487 881 6250 780 6817 7309 8503 9697 6149 7132 6936 5692 2757 6150 2705 1401 9272 4190 6116 8096 2386 2027 8913 7734 7318 4423 8439 7087 7995 8429 7139 818 1495 3284 2418 3295 5121 2989 5741 433 1905 5468 9828 8946 3179 7615 894 9766 2971 847 6450 4686 9597 4851 2080 7062 1956 2386 7476 1703 2738 3864 6491 7545 3046 1432 1050 3534 6054 5005 4862 9126 2877 1259 8613 1209 4982 236 9877 1697 4142 7484 2562 1554 8105 6483 3440 1462 8463 2006 7193 8316 281 6544 645 7043 2857 70 5525 6953 8924 7032 7593 4514 2192 8088 59 2861 4685 897 7319 3300 410 773 2147 9992 2985 8834 302 437 4323 6566 8357 9802 8257 7543 3607 1131 564 9474 9203 9127 575 708 7767
Sorted :
7131 5110 7836 3809 1278 9577 7590 8244 5902 7610 4787 6809 1510 3564 3358 6411 4966 9800 5807 9174 9385 4146 1824 4869 9383 3638 2304 8130 1178 5102 2192 1739 1643 2965 7245 7050 2416 3778 5515 4395 3418 4869 9814 6073 5014 8501 3966 4891 8992 2882 5512 3775 9985 8189 4664 4360 7681 6235 7152 8032 8874 9253 1943 2049 8301 1848 9175 8698 6578 8111 4442 5157 8832 9848 6448 3881 2753 4100 1130 9516 4539 5515 9756 1047 3313 2937 8634 9439 8508 2596 3814 4996 5129 9810 1220 8242 7672 7342 1320 3195 7590 4342 5697 7866 2326 6726 3441 8276 6531 2211 6285 4492 9310 2155 2349 1396 9157 3984 1955 9417 7644 4814 7922 6536 7018 7411 3775 2014 2339 4064 6623 4173 4031 5979 4930 7654 4039 1531 4916 7357 8802 6935 6108 1580 3999 6225 2641 6330 6907 2584 3437 7753 8680 2192 4461 1695 8174 3128 4724 3826 7640 8669 4481 4763 2983 4433 8317 8102 1355 7456 4577 8442 8319 5010 1140 1232 1688 4080 4445 3548 5713 8391 4295 1477 8487 5823 9493 4528 2589 9499 6092 9784 6773 1907 9382 2203 3774 8438 8672 3290 3590 4540 2912 7308 9782 5615 8352 9456 5867 5657 6838 6294 3295 4741 5949 9369 8949 9672 5853 7054 3755 3113 4712 9043 3412 4546 2567 9934 2034 2007 1845 6466 2815 3012 5736 2487 6250 6817 7309 8503 9697 6149 7132 6936 5692 2757 6150 2705 1401 9272 4190 6116 8096 2386 2027 8913 7734 7318 4423 8439 7087 7995 8429 7139 1495 3284 2418 3295 5121 2989 5741 1905 5468 9828 8946 3179 7615 9766 2971 6450 4686 9597 4851 2080 7062 1956 2386 7476 1703 2738 3864 6491 7545 3046 1432 1050 3534 6054 5005 4862 9126 2877 1259 8613 1209 4982 9877 1697 4142 7484 2562 1554 8105 6483 3440 1462 8463 2006 7193 8316 6544 7043 2857 5525 6953 8924 7032 7593 4514 2192 8088 2861 4685 7319 3300 2147 9992 2985 8834 4323 6566 8357 9802 8257 7543 3607 1131 9474 9203 9127 7767 92 91 638 995 678 799 575 772 748 983 546 599 855 881 780 818 894 847 645 897 773 564 575 708 90 364 413 434 498 433 410 437 19 263 296 294 281 302 210 241 218 236 70 180 197 8 59 26 104

How to add path parameter in elasticsearch Java bulk Api

I'm using Java bulk Api,Elasticsearch 6.6.2, and expect to POST bulk request as
POST /<index>/_bulk,
but i got POST /_bulk instead (see packet captured below).
I know these 2 POST methods are the same, but there're a proxy between my app and ES, the path parameter is for the proxy for some reasons(I don't know why).
so, I wonder how to set the path parameter in Java ,so that request can be sent in POST /<index>/_bulk format.
Here's the code
RestHighLevelClient client;
/* some client init code ....*/
...
String INDEX = "api_track";
String DOC_TYPE = "_doc";
BulkProcessor.Builder builder = BulkProcessor.builder(
(request, bulkListener) ->
client.bulkAsync(request, RequestOptions.DEFAULT, bulkListener),
listener);
builder.setBulkActions(500);
builder.setBulkSize(new ByteSizeValue(1L, ByteSizeUnit.MB));
builder.setConcurrentRequests(0);
builder.setFlushInterval(TimeValue.timeValueSeconds(5L));
builder.setBackoffPolicy(BackoffPolicy
.constantBackoff(TimeValue.timeValueSeconds(1L), 3));
builder.setGlobalIndex(INDEX);
builder.setGlobalType(DOC_TYPE);
bulkProcessor = builder.build();
IndexRequest request = new IndexRequest().index(INDEX).type(DOC_TYPE).source(maps);
bulkProcessor.add(request);
and the packet captured:
0x0000: 0200 0000 4500 0277 0000 4000 4006 12c9 ....E..w..#.#...
0x0010: 1e27 dee3 0ba3 1d0b e142 23f0 85d1 ad67 .'.......B#....g
0x0020: 1540 31d3 8018 0801 3eb0 0000 0101 080a .#1.....>.......
0x0030: 1500 c5e6 b6ba 7ff0 504f 5354 202f 5f62 ........POST./_b <-- POST format here
0x0040: 756c 6b3f 7469 6d65 6f75 743d 316d 2048 ulk?timeout=1m.H
0x0050: 5454 502f 312e 310d 0a43 6f6e 7465 6e74 TTP/1.1..Content
0x0060: 2d4c 656e 6774 683a 2033 3335 0d0a 436f -Length:.335..Co
0x0070: 6e74 656e 742d 5479 7065 3a20 6170 706c ntent-Type:.appl
0x0080: 6963 6174 696f 6e2f 6a73 6f6e 0d0a 486f ication/json..Ho
0x0090: 7374 3a20 7365 6172 6368 2e61 6c69 7061 st:.search.alipa
0x00a0: 792e 6e65 743a 3932 3030 0d0a 436f 6e6e y.net:9200..Conn
0x00b0: 6563 7469 6f6e 3a20 4b65 6570 2d41 6c69 ection:.Keep-Ali
0x00c0: 7665 0d0a 5573 6572 2d41 6765 6e74 3a20 ve..User-Agent:.
0x00d0: 4170 6163 6865 2d48 7474 7041 7379 6e63 Apache-HttpAsync
0x00e0: 436c 6965 6e74 2f34 2e31 2e34 2028 4a61 Client/4.1.4.(Ja
0x00f0: 7661 2f31 2e38 2e30 5f31 3531 290d 0a41 va/1.8.0_151)..A
0x0100: 7574 686f 7269 7a61 7469 6f6e 3a20 4261 uthorization:.Ba
0x0110: 7369 6320 6247 6c75 6132 4d36 527a 4e61 sic.bGlua2M6RzNa
0x0120: 5954 4e4e 5755 593d 0d0a 0d0a 7b22 696e YTNNWUY=....{"in
0x0130: 6465 7822 3a7b 225f 696e 6465 7822 3a22 dex":{"_index":"
0x0140: 6170 695f 7472 6163 6b22 2c22 5f74 7970 api_track","_typ
0x0150: 6522 3a22 5f64 6f63 227d 7d0a 7b22 6372 e":"_doc"}}.{"cr
0x0160: 6561 7465 6441 7422 3a22 3230 3230 2d30 eatedAt":"2020-0
0x0170: 322d 3132 5430 383a 3438 3a34 332e 3333 2-12T08:48:43.33
0x0180: 3822 2c22 686f 7374 4164 6472 223a 2231 8","hostAddr":"1
0x0190: 3237 2e30 2e30 2e31 222c 2274 656e 616e 27.0.0.1","tenan
0x01a0: 7449 6422 3a6e 756c 6c2c 2273 6572 7665 tId":null,"serve
0x01b0: 724e 616d 6522 3a6e 756c 6c2c 2270 6172 rName":null,"par
0x01c0: 616d 7322 3a22 2670 7269 7661 7465 5f74 ams":"&private_t
0x01d0: 6f6b 656e 3d2a 2a2a 266f 7264 6572 5f62 oken=***&order_b
0x01e0: 793d 7369 7a65 222c 2275 7365 724e 616d y=size","userNam
0x01f0: 6522 3a22 6d79 7363 6d22 2c22 7573 6572 e":"myscm","user
0x0200: 4964 223a 3330 3034 2c22 7061 7468 6e61 Id":3004,"pathna
0x0210: 6d65 223a 222f 6170 692f 7634 2f70 726f me":"/api/v4/pro
0x0220: 6a65 6374 732f 3339 3235 352f 6c61 6e67 jects/39255/lang
0x0230: 7561 6765 7322 2c22 7265 6d6f 7465 4164 uages","remoteAd
0x0240: 6472 223a 2233 302e 3339 2e32 3232 2e32 dr":"30.39.222.2
0x0250: 3237 222c 2275 7064 6174 6564 4174 223a 27","updatedAt":
0x0260: 2232 3032 302d 3032 2d31 3254 3038 3a34 "2020-02-12T08:4
0x0270: 383a 3433 2e33 3338 227d 0a 8:43.338"}.
It can be done by client.getLowLevelClient().performRequest(new Request(method, endpoint)), fill INDEX into parameter of method.

spring cloud config server don't use profile

I use:
<artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.SR6</version>
in my application.properties I have put
spring.profiles.active= prod
spring.application.name= FunctionalControl
I can see on the log :
2016-10-20 17:58:17.900 INFO c.o.l.f.Application - The following profiles are active: prod
But if I use tcpdump I can see than despite does a GET /FunctionalControl/prod
on my spring.cloud.config server It does GET /FunctionalControl/default
0x0030: 15f1 ddb3 4745 5420 2f46 756e 6374 696f ....GET./Functio
0x0040: 6e61 6c43 6f6e 7472 6f6c 2f64 6566 6175 nalControl/defau
0x0050: 6c74 2048 5454 502f 312e 310d 0a41 6363 lt.HTTP/1.1..Acc
0x0060: 6570 743a 2061 7070 6c69 6361 7469 6f6e ept:.application
0x0070: 2f6a 736f 6e2c 2061 7070 6c69 6361 7469 /json,.applicati
0x0080: 6f6e 2f2a 2b6a 736f 6e0d 0a55 7365 722d on/*+json..User-
So I never manage to use FunctionalControl-prod.properties from my git repo :-(
I found myself the solution and share it with everybody.
The active profile for config server is taken in consideration only if it is put into bootstrap.properties (or .yaml) not in application.properties
file bootstrap.properties:
spring.profiles.active= prod
spring.application.name= FunctionalControl
I add this file in my project and then it works fine as you can see on this tcpdump
0x0000: 4500 00d3 0799 4000 4006 348a 7f00 0001 E.....#.#.4.....
0x0010: 7f00 0001 9f40 22b8 8800 ede0 32d2 4aa8 .....#".....2.J.
0x0020: 8018 0156 fec7 0000 0101 080a 16da ea48 ...V...........H
0x0030: 16da ea48 4745 5420 2f46 756e 6374 696f ...HGET./Functio
0x0040: 6e61 6c43 6f6e 7472 6f6c 2f70 726f 6420 nalControl/prod.
0x0050: 4854 5450 2f31 2e31 0d0a 4163 6365 7074 HTTP/1.1..Accept
0x0060: 3a20 6170 706c 6963 6174 696f 6e2f 6a73 :.application/js
0x0070: 6f6e 2c20 6170 706c 6963 6174 696f 6e2f on,.application/
0x0080: 2a2b 6a73 6f6e 0d0a 5573 6572 2d41 6765 *+json..User-Age
0x0090: 6e74 3a20 4a61 7661 2f31 2e38 2e30 5f34 nt:.Java/1.8.0_4
0x00a0: 350d 0a48 6f73 743a 206c 6f63 616c 686f 5..Host:.localho
0x00b0: 7374 3a38 3838 380d 0a43 6f6e 6e65 6374 st:8888..Connect
0x00c0: 696f 6e3a 206b 6565 702d 616c 6976 650d ion:.keep-alive.
You need to define the active profile for your config client application (in your case "FunctionalControl"). There are multiple ways to do that.
E.g. you can add the following to your client's bootstrap.properties file
spring.profiles.active=prod
or e.g. start you config client application via
mvn spring-boot:run -Dspring.profiles.active=prod
Either way, your client server application doesn't need any active profile. It will server whatever file is available in your git repo.

sort the numbers in multiple lines in vim

I have a file formatted as such:
...
[ strNADPplus ]
3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457
3458 3459 3460 3461 3462 3463 3464 11153 11154 11155 11156 11157 11158 11159 11160
5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269
5270 5271 5272 5273 5274 5275 5276 5277 12964 12965 12966 12967 12968 12969 12970
5360 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070
5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375
5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414
5415 5416 5417 5418 5419 5420 5421 13110 13111 13112 13113 13114 13115 13116 13117
5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478
5479 5480 5481 5482 5483 5484 5485 5486 13173 13174 13175 13176 13177 13178 13179
5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 13557 13558 13559 13560
5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 13683 13684 13685 13686
6021 6022 6023 6024 6025 6026 6027 6028 6029 13718 13719 13720 13721 13722 13723
6339 6340 6341 6342 6343 6344 6345 6346 6347 14044 14045 14046 14047 14048 14049
...
I want to sort the numbers in that block of lines to have something that looks like:
1 2 3 4
7 8 9 100
101 121 345
346 348 10232
16654 ...
I first tried with :4707,4743%sort n (4707 and 4743 are the lines of that block), but I was only able to sort the first values of each line.
I then tried to join the selection and sort the line: visual mode + J and :'<,'>sort n.
But it doesn't sort correctly.
3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 11153 11154 11155 11156 11157 11158 11159 11160 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 12964 12965 12966 12967 12968 12969 12970 5360 13057 13058 13059 13060 13061 13062 13063 13064 13065 13066 13067 13068 13069 13070 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 13110 13111 13112 13113 13114 13115 13116 13117 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 13173 13174 13175 13176 13177 13178 13179 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 13557 13558 13559 13560 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 13683 13684 13685 13686 6021 6022 6023 6024 6025 6026 6027 6028 6029 13718 13719 13720 13721 13722 13723 6339 6340 6341 6342 6343 6344 6345 6346 6347 14044 14045 14046 14047 14048 14049 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 15124 15125 15126 15127 15128 15129 15130 15131 15132 15133 15134 15135 15136 7502 7503 7504 7505 7506 7507 7508 7509 15208 15209 15210 15211 15212 15213 15214 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 15377 15378 15379 15380 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 5254 12971 12972 12973 12974 12975 12976 12977 12978 12979 12980 12981 12982 12983 12984 12985 12986 12987 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 13071 13072 13073 13074 13075 13076 13077 13078 13079 13080 13081 13082 13083 13084 13085 13118 13119 13120 13121 13122 13123 13124 13125 13126 13127 13128 13129 13130 13131 5463 13180 13181 13182 13183 13184 13185 13186 13187 13188 13189 13190 13191 13192 13193 13194 13195 13196 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 13561 13562 13563 13564 13565 13566 13567 13568 13569 13570 13571 13572 13573 13574 13575 13576 13577 13578 13579 13580 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 13687 13688 13689 13690 13691 13692 13693 13694 13695 13696 13697 13698 13699 13700 13701 13702 13703 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 13724 13725 13726 13727 13728 13729 13730 13731 13732 13733 13734 13735 13736 13737 13738 13739 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 14013 14014 14015 14016 14017 14018 14019 14020 14021 14022 14023 14024 6334 6335 6336 6337 6338 14050 14051 14052 14053 14054 14055 14056 14057 7414 7415 7416 7417 7418 7419 7420 15137 15138 15139 15140 15141 15142 15143 15144 15145 15146 15147 7498 7499 7500 7501 15215 15216 15217 15218 15219 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 15381 15382 15383 15384 15385 15386 15387 15388 15389 15390 15391 15392 15393 15394 15395 15396 15397
How do I sort everything and keep that layout?
I would simply use standard external unix tools:
:'<,'>!tr ' ' '\n' | sort -n | tr '\n' ' ' | fold -w 15 -s
This wraps lines to 15 characters.
:'<,'>!tr ' ' '\n' | sort -n | paste -d' ' - - -
This wraps to 3 numbers per line.

CasperJS "unable to load script"

I have the strangest issue while writing a new script for casperJS, which I use all the time.
When I try to launch the script, using "casperjs myScript.js, I get the following :
Unable to load script /var/www/scrapers/myScript.js; check file syntax
I checked my syntax and found nothing wrong, chmod +x the file, sudoed everything, still the same.
Even stranger, I copypasted the example code from the quickstart (http://docs.casperjs.org/en/latest/quickstart.html), saved , and same message...
All my other scripts in the same directory are working, what do I try now?
Re: what do I try now?
You can use xxd to look inside the files. Looking at the comments, you now have a working version and a non-working version, so can compare them side-by-side to understand what the problem was. (And if they are identical then you know you are looking for something at the file system level, not inside the files.)
(xxd comes with the vi package, and apparently is also available for Windows if you install vim.)
Here is sample output for a script with and without the UTF-8 BOM (which, incidentally, made no difference: both these scripts worked, at least with CasperJS 1.1 on Ubuntu):
0000000: efbb bf76 6172 2063 6173 7065 7220 3d20 ...var casper =
0000010: 7265 7175 6972 6528 2763 6173 7065 7227 require('casper'
0000020: 292e 6372 6561 7465 2829 3b0a 0a63 6173 ).create();..cas
0000030: 7065 722e 7374 6172 7428 2768 7474 703a per.start('http:
0000040: 2f2f 676f 6f67 6c65 2e63 6f6d 2f27 2c20 //google.com/',
0000050: 6675 6e63 7469 6f6e 2829 207b 0a20 2020 function() {.
0000060: 2074 6869 732e 6563 686f 2874 6869 732e this.echo(this.
0000070: 6765 7454 6974 6c65 2829 293b 0a7d 293b getTitle());.});
0000080: 0a0a 6361 7370 6572 2e72 756e 2829 3b0a ..casper.run();.
0000000: 7661 7220 6361 7370 6572 203d 2072 6571 var casper = req
0000010: 7569 7265 2827 6361 7370 6572 2729 2e63 uire('casper').c
0000020: 7265 6174 6528 293b 0a0a 6361 7370 6572 reate();..casper
0000030: 2e73 7461 7274 2827 6874 7470 3a2f 2f67 .start('http://g
0000040: 6f6f 676c 652e 636f 6d2f 272c 2066 756e oogle.com/', fun
0000050: 6374 696f 6e28 2920 7b0a 2020 2020 7468 ction() {. th
0000060: 6973 2e65 6368 6f28 7468 6973 2e67 6574 is.echo(this.get
0000070: 5469 746c 6528 2929 3b0a 7d29 3b0a 0a63 Title());.});..c
0000080: 6173 7065 722e 7275 6e28 293b 0a asper.run();.

Resources