Im developing a Flutter app that need to print selected image with mobile printer (ZEBRA ZQ521).
Generated ZPL string are works on http://labelary.com/viewer.html.
But mobile printer (ZQ521) totally stuck when printing (sometimes goes smooth).
error : Caused by: java.io.IOException: Bluetooth LE Write timed out
is it my ZPL string are too long? please help.
my zpl stringļ¼
^XA
~DGimg5.GRF,5126,22, FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE
FFFFFFFFFFFFFFFFFFFFFFFFFE7FFFFFFFFFFFFFFFFE
FFFFFFFFFFFFFFFFFFFFCFC78607FFFFFFFFFFFFFFFE
FFFFFFFFFFFFFFFFFFFF0FFCB303FFFFFFFFFFFFFFFE
FFFFFFFFFFFFFFFFFFFF3FFC33807FFFFFFFFFFFFFFE
FFFFFFFFFFFFFFFFFFFE06338C803FFFFFC7FFFFFFFE
FFFFFFFFFFFFFFFFFFFE7FF3CFE01FFFFFE1FFFFFFFE
FFFFFFFFFFFFFFFFFFFC380FFFC01FFFFFF1FFFFFFFE
FFFFFFFFFFFFFFFFFFFCF338FFE00FFFFFF87FFFFFFE
FFFFFFFFFFFFFFFFFFFFFBF03FFFFFFFFFFC3FFFFFFE
FFFFFFFFFFFFFFFFFFC1F1F03FFFFFFFFFFC1FFFFFFE
FFFFFFFFFFFFFFFFFC000000187C19FFFFF80FFFFFFE
FFFFFFFFFFFFFFC000000000000000001CFFFFFFFFFE
FFFFFFFFFFFFFEC00000000000000000000FFFFFFFFE
FFFFFFFFFFFFFF80000000000000000000007FFFFFFE
FFFFFFFFFFFFE0000000000000000000000003FFFFFE
FFFFFFFFFFFFF80000000000000000000000007FFFFE
FFFFFFFFFFFFFFF000000000000000000000007FFFFE
FFFFFFFFFFFFFFE000000000000000000000003FFFFE
FFFFFFFFFFFFFFC000000000000000000000003FFFFE
FFFFFFFFFFFFFF8000000000000000000000003FFFFE
FFFFFFFFFFFFF80000000000000000000000007FFFFE
FFFFFFFFFFFFFFFF00000000000000000000007FFFFE
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC000007FFFFE
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF50007FFFFE
FFFFFFFFFFFFFFFF8100000000000FE7FFFFF07FFFFE
FFFFFFFFFFFF80000000000000000400000407FFFFFE
FFFFFFFFFFC000040300000000000C00000000FFFFFE
FFFFFFFFFFE1000006000000000000000000007FFFFE
FFFFFFFFFFC0000404400000000008000000007FFFFE
FFFFFFFFFFC0000000D80000000000000000003FFFFE
FFFFFFFFFFC0000000F80000000000000000003FFFFE
FFFFFFFFFFC91000007A0000000000000000003FFFFE
FFFFFFFFFFC91000009E0000000000000000003FFFFE
FFFFFFFFFFCF0000009E0000000000000000003FFFFE
FFFFFFFFFFCF000001B60000000000000000001FFFFE
FFFFFFFFFFCF000000970000080001000000001FFFFE
FFFFFFFFFFEF2000029F0000080001000000001FFFFE
FFFFFFFFFFFF2000039F0000080001001000001FFFFE
FFFFFFFFFFFEA00003530000080001003000001FFFFE
FFFFFFFFFFFF2000061B8000080009001800001FFFFE
FFFFFFFFFFEF2000060BA000080008001800001FFFFE
FFFFFFFFFFFF200006038000080008001800001FFFFE
FFFFFFFFFFFFA00002038000080008000000001FFFFE
FFFFFFFFFFFFE00000038000080005000000001FFFFE
FFFFFFFFFFFFE00000438000080005000000001FFFFE
FFFFFFFFFFFFE00000618040280025000000001FFFFE
FFFFFFFFFFFFE0000047B040280025C00000001FFFFE
FFFFFFFFFFFFE40001251040280025000000001FFFFE
FFFFFFFFFFFFE40001A51040280025000000001FFFFE
FFFFFFFFFFFFE40001A53040388024000000003FFFFE
FFFFFFFFFFFFE40005A41040388004000000003FFFFE
FFFFFFFFFFFFF00007A41040388004000000003FFFFE
FFFFFFFFFFFFF00007BD1040348004600000003FFFFE
FFFFFFFFFFFFFE0007BDBB4064801760000001FFFFFE
FFFFFFFFFFFFFF900735BFC0648ED778000083FFFFFE
FFFFFFFFFFFFF7FFFFFFFFC06880877FFEFFDFFFFFFE
FFFFFFFFFFFFFFF803FFFFFFFFFFFFFFFFFFFFFFFFFE
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFE
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFE
FFFFF8FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE07FFFFE
FFFFFFE3FFFFFFFFFFFFFFFFFFFFFFFFFFFD007FFFFE
FFFFFC7FFFFFFF83EFFFFFFFFFFFFFFFD911017FFFFE
FFF017FFFFFFFF8007FFFFFE75FFFFFFC201007FFFFE
FFFFFFFFFFFFFF0003FFFF581429FFFFC200007FFFFE
FFFFFFFFFFFFFF8003F87700102BFFFFC200007FFFFE
FFFFFFFFFFFFFFD803F033001021FFFEC20200FFFFFE
FFFFFFFFFFCFFF8003FF3B001001FFFEC20700FFFFFE
FFFFFFFFF80FFFD803FF3F10100FFFFEC20300FFFFFE
FFFFFFFF000FFFFF03F89F101001FFFF431100FFFFFE
FFFFFFF00007FFF803F89E50300BFFFF63B900FFFFFE
FFFFFC000007FFFD63F91F10210FFFFDD3BB01FFFFFE
FFFF00000007FFFFEBF81E00210BFFFDD3FF05FFFFFE
FFE000000007FFFFEBF89E00210FFFFFD3FE05FFFFFE
F00000000007FFFFE3FD9E00210FFFFFFFFE0DFFFFFE
000000000007FFFEE7FF9E50210FFFFFFFFE0BFFFFFE
000000000007FFFFEFFF9E50210FFFFFFFFE0BFFFFFE
000000000007FFFFF7FF9E50210FFFFFA7FF1BFFFFFE
000000000007FFFFF7DF9E40210FFFFFB7FF1BFFFFFE
000000000007FFFFEBFDAC20200FFFFFFBFE57FFFFFE
000000000007FFFFFBFDEC22200FFFFFFBFF7FFFFFFE
000000000007FFFFFFF5FC22200FFFFFFFFFFFFFFFFE
000000000007FFFFFFF5FC62201FFFFFFFFFFFFFFFFE
000000000007FFFFFFF5FC62201FFFFFFFFEFFFFFFFE
000000000003FFFFFFFDFC0A205FFFFFFFFEFFFFFFFE
000000000003FFFFFFFDFC4A205FFFFFFFFFFFFFFFFE
000000000003FFFFFFFDFDE2207FFFFFFFFFFFFFFFFE
000000000007FFFFFFFFEEDA606FFFFFDFFDDFFFFFFE
000000000003FFFFFFFFFEDA603FFFFFFFFFFFFFFFFE
000000000003FFFFFFFFFFDA603FFFFFFFFFFFFFFFFE
000000000003FFFFFFFFFFDA603FFFFFFFFFFFFFFFFE
000000000003FFFFFFFFDFDA603FFFFFBFFFFFFFFFFE
000000000003FFFFFFFFFEDA629FFFFFFFFFFFFFFFFE
000000000003FFFFFFFFFEDA46DFFFFFFFF7FFFFFFFE
000000000003FFFFFFFFFFFA67DFFFFFFFF7FFFFFFFE
000000000003FFFFFFFFFFFC57FFFFFFFFFFFFFFFFFE
000000000003FFFFFFFFFFFED7FFFFFFFFFFFFFFFFFE
000000000003FFFFFFFFFFFFD3FFFFFFFFEFFFFFFFFE
000000000001FFFFFFFFFFFFD3FFFFFFFFFFFFFFFFFE
000000000001FFFFFFFFFFFFD77FFFFFFFFFFFFFFFFE
000000000001FFFFFFFFFFFE5F7FFFFFFFBFFFFFFFFE
000000000001FFFFFFFFFFFE5DFFFFFFFFBFFFFFFFFE
000000000001FFFFFFFFFFFFC9FFFFFFFFFFFFFFFFFE
000000000001FFFFFFFFFFFD5FFFFFFFFFFFFFFFFFFE
000000000001FFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFE
000000000001FFFFFFFFFFFFCFFFFFFFFFFFFFFFFFFE
000000000001FFFFFFFFFFFFCFFFFFFFFEFFFFFFFFFE
000000000001FFFFFFFFFFFFCF7FFFFFFFFFFFFFFFFE
000000000001FFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFE
000000000001FFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFE
000000000000FFFFFFFFFFFFDFFFFFFFFFFFFFFFFFFE
000000000000FFFFFFFFFFFFDBFFFFFFFFF07FFFFFFE
000000000000FFFFFFFFFFFFFFFFFFFFFFF007FFFFFE
000000000000FFFFFFFFFFFFFFFFFFFFFFE0003FFFFE
000000000000FFFFFFFFFFFFFFFFFFFFFF800003FFFE
000000000000FFFFFFFFFFFFFFFFFFFFFF8000003FFE
000000000000FFFFFFFFFFFFFFFFFFFFFF00000003FE
000000000000FFFFFFFFFFFFFFFFFFFFFE00000003FE
000000000000FFFFFFFFFFFFFFFFFFFFF800000003FE
000000000000FFFFFFFFFFFFFFFFFFFFE400000003FE
000000000000FFFFFFFFFFFFFFFFFFFFE000000003FE
000000000000FFFFFFFFFFFFFFFFFFFFC000000007FE
000000000000FFFFFFFFFFFFFFFFFFFFC000000007FE
000000000000FFFFFFFFFFFFFFFFFFFF8000000007FE
000000000000FFFFFFFFFFFFFFFFFFFF0000000027FE
000000000000FFFFFFFFFFFFFFFFFFFE0000000027FE
000000000000FFFFFFFFFFFFFFFFFFF60000000067FE
0000000000007F07FFFFFFFFFFFFFFFC00000000FFFE
0000000000007F03FFFFFFFFFFFFFFF0000000009FFE
0000000000007E00FE7EFFFFFFFFFFE0000000019FFE
0000000000007C00387F7FFFFFFFFF0000000000BFFE
0000000000007C00001FEFFFFFFFFE00000000027FFE
0000000000007C000003FFFFFFFFF000000000067FFE
0000000000007C000000FFFFFFFF8000000000007FFE
000000000000780000001FFFFFF8000000000000FFFE
0000000000007000000007FFFE20000000000002FFFE
0000000000007200000000FE0000000000000003FFFE
00000000000060000000043F0000000000000003FFFE
000000000001F20000001C0FE000000000000007FFFE
000000000001CF0000007081FC00000000000007FFFE
000000000006BF600000E0007F0000000000000FFFFE
000000000006EFF0000300000FE000000000001FFFFE
0000000000017FFC0006000003F800000000001FFFFE
000000000003FFFF00180000087E00000000003FFFFE
0000000000017FFB80600000000F80000000003FFFFE
0000000000005FFA00C000000007F0000000007FFFFE
0000000000003FE8020000000000F8000000007FFFFE
0000000000000FF00C00000000003E00000000FFFFFE
00000000000003C01000000000000F80000000FFFFFE
000000000300000060000000000003E0000003FFFFFE
0000000003000001C1010000000000F8000013FFBFFE
0000000006000003000000000000007C000003FFFFFE
000000001800000E000000000000001E000007FFFFFE
0000000030000038000000000000000F80000FFFFFFE
00000000E00000600000000000000003C0000FFFFFFE
00000001803801C00000000000000001A0001FFFFFFE
0000000600FF0700000000000000000060003FFFFFFE
0000000EFFEFFC00000000000000000030003FFFFFFE
00000031FFFFF00000000000000000001C007FFFFFFE
000000C09FFFFC0000000000000000000E007FEFFFFE
000003FFFFFFFF8000000000000000000700FFFFFFFC
000007FFFFFFFFE000000000000000000781FFFFFFFC
00001CFFFFFFFFF0000000000000000003C1FFFFFFFE
000031FFFFFFFFFC000000000000000003C3FFFFFFFE
0000E7FFFFFFFFFE000000000000000001E3FFFFFFFC
00038FFFFFFFFFFF000000000000000008F7FFFFFFFC
000E1FFFFFFFFFFFC00000000000000005F7FFFFFFFE
00183FFFFFFFFFFFE000000000000000007FFEFFFFFE
00707FFFFFFFFFF7F800000000000000007FFFFFFFFE
01C07FFFFFFFFFE7F800000000000000007FF5FBFFFE
0700FFFFFFFFFFE7FE00000000000000007FF0FFFFFE
0C00FFFFFFFFFFF9FF00000000000000007FE83FFFFE
30007FFFFFFFFF00FF00000000000000007FE05FFFFE
E0007FFFFFFFFF40FF8000000000000000FFD07FFFF6
C0007FFFFFFFFF01FFC000000000000000FFE07FFFF6
80003FFFFFFFFFE27FE000000000000000FFC0FFFFEE
80001FFFFFFFFC383FE006000000000001FFC13FFFEE
00001FFFFFFFFC393FF000000000000001FFE017FFDE
00008FFFFFFFFFF3BFF800000000000003FFFC06FFDE
00000FFFFFFFFFFFFFF800000000000007FFFE06FFDE
000003FFFFFFFFFFFFFC0000000000000FFFFE0DFFDE
000000FFFFFFCFFFFFFC0000000000000FFFFF0DFFBE
0000000FFFFFFFFFFFFC0000000000001FDFFFCDFFBE
00000203FFFFE7FFFFFF8040000000003F9FFFFBFFBE
00000000FFFFF7FFFFFF00C0000000003F1FFFFBFFBE
000000003FFFFFFFFFFE000003000000FF1FFFF3FF7E
000000001FFFFFFFFFFE000000000000FE1FFFF7FF7E
000000000FFFFFFFFFFE000000000000FC1FFFE7FF68
0000000003FFFFFFFFFE000000000001FC1FFFEFFF00
0000000001FFFFFFFFFC000000800001F81FFFCFFE00
0000010001FFFFFFFFFC000401800003F01FFFCFFE00
0000000100FFFFFFFFFC000000000003E03FFF9FFE00
00000000007FFFFFFFF800000000000FE03FFF9FFE00
00000000003FFFFFFFF800000000003FC07FFF9FFC00
00000000001FFFFFFFF800000000003FC05FFF3FFC00
00000000001FFFFFFFE000000000007FC09FFF3FFC00
00000000000FFFFFFFE000000000007FE69FFF7FFC00
000000100007FFFFFFC000000000007FE3BFFE7FF800
800000100007FFFFFF000000000000FFE93FFE7FF800
000000000003FFFFFE000000400000FFF07FFCFFF800
000000000000FFFFF8000000000001FFE8FFFCFFF800
0000000000047FFFE0000000000003FFCF7FF8FFF000
0000000000001FFF80000000000003FFDFFFF9FFF000
000000000000016000000000100001FFDFFFFBFFF000
000000000000004000000000100001FFBFFFF3FFF000
000000000000000010000000000003FBFFFFF3FFE000
000000000000000000000000000003FB7FFFE7FFE000
000000000000000000000000000007F0FFFFE7FFE000
00000000000000000000000000000780FFFFC7FFE000
00000000000000000000000000002F80FFFFCFFFC000
0000000002000000000000000000FF00DFFFCFFFC000
0000000000000000000200000000FF00C7FF9FFFC000
0000000000000000000000000000FE0101FF9FFF8000
0008000040000000000000000001FC0100FF3FFF8000
0000000000000000000000000001FC03007F3FFF8000
000000000000C000000000000001F802007E3FFF8000
0000000000000000010000000001F006007E3FFF0000
0000000000000000010000000001F00400FC7FFF0000
0000000000000000000000000001E00C00FCFFFF0000
000000000000000000000000003BE01800FCFFFF0000
700000000000000000000000007FC01800F8FFFE0000
700000000000000000000000007FC01000F9FFFE0000
600000000000000000000000007F80200071FFFE0000
00000000000000000000000600FFC0600079FFFC0000
00000000000000000000000701FFF040007BFFFC0000
00000000000000000003000303FFF88000FBFFFC0000
00010000000000000003000007FFFE8000FBFFF80000
0000000000000000000100101FFFFF8001DB9FF80000
0000010000000000000118031FFFFF8001FB8FF80000
0000000000000000000018073FFFFFE003FB83F00000
000000200000000000000004BFFFFFF803BB03F00000
0000000000000000000000887FFFFFFC07FB80F00000
^FO150,150^XGR:img5.GRF,1,1^FS
^XZ
BTLE on zebra printers is meant to be used just to configure the printer, not to print labels, so it has a low timeout and a slow transmission speed.
Not a Flutter expert at all, but all the mobile printers should have the BT Classic, which should allow you to print labels, so you might check if you can switch to that on the printing call you're doing from your app.
You can also check what BT type the printer is set on by sending the following command
! U1 getvar "bluetooth.le.controller_mode"
and you can set it to use Classic BT sending this command
! U1 setvar "bluetooth.le.controller_mode" "classic"
(Note that all these commands need a new line after the command itself).
Have a look here to see how to send this command
I use ssh to login remote server quite often and on the server I'll use tools like emacs, git, tmux, etc. I noticed that the color on the remote server is very ugly compared with local machine. Especially for emacs, I want to use solarize theme but on the remote server it doesn't really show the correct color.
Does anyone know how to improve the color on remote server?
I am using item2 and when running infocmp I got the following results:
# Reconstructed via infocmp from file: /opt/sw/python/20201012/anaconda3/envs/i38/share/terminfo/x/xterm-256color
xterm-256color|xterm with 256 colors,
am, bce, ccc, km, mc5i, mir, msgr, npc, xenl,
colors#0x100, cols#80, it#8, lines#24, pairs#0x10000,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=\r,
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
dl=\E[%p1%dM, dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K,
el1=\E[1K, flash=\E[?5h$<100/>\E[?5l, home=\E[H,
hpa=\E[%i%p1%dG, ht=^I, hts=\EH, ich=\E[%p1%d#,
il=\E[%p1%dL, il1=\E[L, ind=\n, indn=\E[%p1%dS,
initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
invis=\E[8m, is2=\E[!p\E[?3;4l\E[4l\E>, kDC=\E[3;2~,
kEND=\E[1;2F, kHOM=\E[1;2H, kIC=\E[2;2~, kLFT=\E[1;2D,
kNXT=\E[6;2~, kPRV=\E[5;2~, kRIT=\E[1;2C, ka1=\EOw,
ka3=\EOy, kb2=\EOu, kbs=^H, kc1=\EOq, kc3=\EOs, kcbt=\E[Z,
kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
kf11=\E[23~, kf12=\E[24~, kf13=\E[1;2P, kf14=\E[1;2Q,
kf15=\E[1;2R, kf16=\E[1;2S, kf17=\E[15;2~, kf18=\E[17;2~,
kf19=\E[18;2~, kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~,
kf22=\E[21;2~, kf23=\E[23;2~, kf24=\E[24;2~,
kf25=\E[1;5P, kf26=\E[1;5Q, kf27=\E[1;5R, kf28=\E[1;5S,
kf29=\E[15;5~, kf3=\EOR, kf30=\E[17;5~, kf31=\E[18;5~,
kf32=\E[19;5~, kf33=\E[20;5~, kf34=\E[21;5~,
kf35=\E[23;5~, kf36=\E[24;5~, kf37=\E[1;6P, kf38=\E[1;6Q,
kf39=\E[1;6R, kf4=\EOS, kf40=\E[1;6S, kf41=\E[15;6~,
kf42=\E[17;6~, kf43=\E[18;6~, kf44=\E[19;6~,
kf45=\E[20;6~, kf46=\E[21;6~, kf47=\E[23;6~,
kf48=\E[24;6~, kf49=\E[1;3P, kf5=\E[15~, kf50=\E[1;3Q,
kf51=\E[1;3R, kf52=\E[1;3S, kf53=\E[15;3~, kf54=\E[17;3~,
kf55=\E[18;3~, kf56=\E[19;3~, kf57=\E[20;3~,
kf58=\E[21;3~, kf59=\E[23;3~, kf6=\E[17~, kf60=\E[24;3~,
kf61=\E[1;4P, kf62=\E[1;4Q, kf63=\E[1;4R, kf7=\E[18~,
kf8=\E[19~, kf9=\E[20~, khome=\EOH, kich1=\E[2~,
kind=\E[1;2B, kmous=\E[<, knp=\E[6~, kpp=\E[5~,
kri=\E[1;2A, mc0=\E[i, mc4=\E[4i, mc5=\E[5i, meml=\El,
memu=\Em, mgc=\E[?69l, oc=\E]104\007, op=\E[39;49m, rc=\E8,
rep=%p1%c\E[%p2%{1}%-%db, rev=\E[7m, ri=\EM,
rin=\E[%p1%dT, ritm=\E[23m, rmacs=\E(B, rmam=\E[?7l,
rmcup=\E[?1049l\E[23;0;0t, rmir=\E[4l, rmkx=\E[?1l\E>,
rmm=\E[?1034l, rmso=\E[27m, rmul=\E[24m,
rs1=\Ec\E]104\007, rs2=\E[!p\E[?3;4l\E[4l\E>, sc=\E7,
setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p5%t;2%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
sgr0=\E(B\E[m, sitm=\E[3m, smacs=\E(0, smam=\E[?7h,
smcup=\E[?1049h\E[22;0;0t,
smglr=\E[?69h\E[%i%p1%d;%p2%ds, smir=\E[4h,
smkx=\E[?1h\E=, smm=\E[?1034h, smso=\E[7m, smul=\E[4m,
tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n,
u8=\E[?%[;0123456789]c, u9=\E[c, vpa=\E[%i%p1%dd,
Make sure your terminal type is set to xterm-256color in Preferences > Profiles > Terminal > Report Terminal Type.
https://iterm2.com/faq.html
Q: How do I get 256 color mode working in vim?
A: The recommended way is to set your terminal type to xterm-256color in Preferences > Profiles > Terminal > Report Terminal Type. You may also need to put set background=light or set background=dark in your .vimrc.
I am trying to make a simple parser for an https website push, so trying to follow from the example from http://rosettacode.org/wiki/HTTP#Ada, just changing the address from a website.
So I tried
with Ada.Text_IO; use Ada.Text_IO;
with AWS.Client;
with AWS.Response;
procedure Main_Other is
begin
Put_Line (AWS.Response.Message_Body
(AWS.Client.Get
(URL => "https://google.com")));
end Main_Other;
But I got an exception
raised PROGRAM_ERROR : aws-client.adb:398 finalize/adjust raised exception
[2020-04-02 10:41:20] process exited with status 1, elapsed time: 00.80s
So, any thoughts on how to fix that?
I'd like to parse the current status of some tables in a website, similar of making something like that in Python
import pandas as pd
def retrieve_json(json_url):
return pd.read_json(json_url)
I'd like to code this solution the simplest way possible, even better not relying on AWS.
Please, and thanks.
It seems that you're using a build of AWS with SSL support disabled (SSL support is optional). Replacing https with http should do the trick. If an unsecured connection is not an option, either recompile AWS with SSL support enabled (see here and here) or, if you're in a hurry and happen to develop on Linux, fall back on GNAT.Expect and wget (tested with GNAT CE 2019):
main.adb
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Expect; use GNAT.Expect;
with GNATCOLL.JSON; use GNATCOLL.JSON;
procedure Main is
-------------------
-- Download_JSON --
-------------------
function Download_JSON (URL : String) return JSON_Value is
Cmd : constant String := "wget";
Arg_1 : aliased String := "-q"; -- Turn off Wget's own messages.
Arg_2 : aliased String := "-O"; -- Output response to ...
Arg_3 : aliased String := "-"; -- ... standard output.
Arg_4 : aliased String := URL;
Status : aliased Integer;
Response : String :=
Get_Command_Output
(Command => Cmd,
Arguments => (1 => Arg_1'Unchecked_Access,
2 => Arg_2'Unchecked_Access,
3 => Arg_3'Unchecked_Access,
4 => Arg_4'Unchecked_Access),
Input => "",
Status => Status'Unchecked_Access);
begin
-- Omitting check of 'Status' for brevity.
return Read (Response);
end;
Root : JSON_Value;
begin
Root := Download_JSON
("https://raw.githubusercontent.com/AdaCore/gnatcoll-core/" &
"master/testsuite/tests/json/validation/basic_object.json");
Put_Line (Write (Root));
end Main;
default.gpr
with "gnatcoll.gpr";
project Default is
for Source_Dirs use ("src");
for Object_Dir use "obj";
for Main use ("main.adb");
end Default;
output
$ ./main
{"a":1,"b":"a tringg","c":[1,2,3],"d":{"a":"a"},"e":null}
I am new to python & sleekxmpp scripting and would like to know how to pass this iq stanza (XEP-0133: Service administration - Get Online Users) using python (mainly the node in below stanza):
http://xmpp.org/extensions/xep-0133.html#get-online-users-list
<iq from='bard#shakespeare.lit/globe'
id='get-online-users-list-1'
to='shakespeare.lit'
type='set'
xml:lang='en'>
<command xmlns='http://jabber.org/protocol/commands'
action='execute'
node='http://jabber.org/protocol/admin#get-online-users-list'/>
</iq>
What I tried:
iq = self .make_iq_get(queryxmlns='http://jabber.org/protocol/commands', ito=self.domain, ifrom=self.jid, iq='')
response = iq.send()
print ('response = %s' % response)
Running above code in python is always resulting in IqError.
Can anyone please explain how to pass above iq stanza's xmlns, action and node information into make_iq_get ??
Please Help!!
Following code has solved my above problem:
1st line of code returns you a form to be filled, 2nd line returns a session id which is used in last line of code
iq = self['xep_0050'}.send_command(domain, "http://jabber.org/protocol/admin#get-online-users-list")
sessionid = iq['command']['sessionid']
form = self.xmpp.plugin['xep_0004'].make_form(ftype='submit')
field = form.add_field(
ftype='hidden',
type='hidden',
var='FORM_TYPE',
value=ADMIN)
field['type'] = 'hidden'
form.add_field(var='max_items', value='100')
print self['xep_0050'}.send_command(domain, "http://jabber.org/protocol/admin#get-online-users-list", sessionid=sessionid, payload=form)
I want to fit data with my custom function to calculate parameters of the model. Data of x and y are attached at the end. The custom function is:
y=a+(-((4/3)*3.14*((60e-10)^3-((60e-10)-x).^3).*b*(c-1096)/c+4*3.14*(60e-10)^2.*(d.*((60e-10)-x).^2/(60e-10)^2+e+(f-e-d.*((60e-10)-x).^2/(60e-10)^2).*exp(-x./g)))/(1e3*1.38e-23*1090))
and parameters have constraints and initials:
-inf<a<inf, a=2e4
1e11<b<1e12, b=7.8e11
1120<c<1300, c=1200
70<d<130, d=127
300<e<700, e=680
400<f<900, f=850
1e-10<g<3e-10, g=2.5e-10
However, I both tried matlab and rigin to fit data with the model, but they all failed to find a good fit. I am appreciate if you can provide any suggestions. In fact, I understand there are too many parameters, and I also tried to fix parameter b, d, e and g while free others, but still no good results.
x=[3.70400000000000e-10
3.80400000000000e-10
3.90400000000000e-10
4.00400000000000e-10
4.10400000000000e-10
4.20400000000000e-10
4.30400000000000e-10
4.40400000000000e-10
4.50400000000000e-10
4.60400000000000e-10
4.70400000000000e-10
4.80400000000000e-10
4.90400000000000e-10
5.00400000000000e-10
5.10400000000000e-10
5.20400000000000e-10
5.30400000000000e-10
5.40400000000000e-10
5.50400000000000e-10
5.60400000000000e-10
5.70400000000000e-10
5.80400000000000e-10
5.90400000000000e-10
6.00400000000000e-10
6.10400000000000e-10
6.20400000000000e-10
6.30400000000000e-10
6.40400000000000e-10
6.50400000000000e-10
6.60400000000000e-10
6.70400000000000e-10
6.80400000000000e-10
6.90400000000000e-10
7.00400000000000e-10
7.10400000000000e-10
7.20400000000000e-10
7.30400000000000e-10
7.40400000000000e-10
7.50400000000000e-10
7.60400000000000e-10
7.70400000000000e-10
7.80400000000000e-10
7.90400000000000e-10
8.00400000000000e-10
8.10400000000000e-10
8.20400000000000e-10
8.30400000000000e-10
8.40400000000000e-10
8.50400000000000e-10
8.60400000000000e-10
8.70400000000000e-10
8.80400000000000e-10
8.90400000000000e-10
9.00400000000000e-10
9.10400000000000e-10
9.20400000000000e-10
9.30400000000000e-10
9.40400000000000e-10
9.50400000000000e-10
9.60400000000000e-10
9.70400000000000e-10
9.80400000000000e-10
9.90400000000000e-10
1.00040000000000e-09
1.01040000000000e-09
1.02040000000000e-09
1.03040000000000e-09
1.04040000000000e-09
1.05040000000000e-09
1.06040000000000e-09
1.07040000000000e-09
1.08040000000000e-09
1.09040000000000e-09
1.10040000000000e-09
1.11040000000000e-09
1.12040000000000e-09
1.13040000000000e-09
1.14040000000000e-09
1.15040000000000e-09
1.16040000000000e-09
1.17040000000000e-09
1.18040000000000e-09
1.19040000000000e-09
1.20040000000000e-09
1.21040000000000e-09
1.22040000000000e-09
1.23040000000000e-09
1.24040000000000e-09
1.25040000000000e-09
1.26040000000000e-09
1.27040000000000e-09
1.28040000000000e-09
1.29040000000000e-09
1.30040000000000e-09
1.31040000000000e-09
1.32040000000000e-09
1.33040000000000e-09
1.34040000000000e-09
1.35040000000000e-09
1.36040000000000e-09
1.37040000000000e-09
1.38040000000000e-09
1.39040000000000e-09
1.40040000000000e-09
1.41040000000000e-09
1.42040000000000e-09
1.43040000000000e-09
1.44040000000000e-09
1.45040000000000e-09
1.46040000000000e-09
1.47040000000000e-09
1.48040000000000e-09
1.49040000000000e-09
1.50040000000000e-09
1.51040000000000e-09
1.52040000000000e-09
1.53040000000000e-09
1.54040000000000e-09
1.55040000000000e-09
1.56040000000000e-09
1.57040000000000e-09
1.58040000000000e-09
1.59040000000000e-09
1.60040000000000e-09
1.61040000000000e-09
1.62040000000000e-09
1.63040000000000e-09
1.64040000000000e-09
1.65040000000000e-09
1.66040000000000e-09
1.67040000000000e-09
1.68040000000000e-09
1.69040000000000e-09
1.70040000000000e-09
1.71040000000000e-09
1.72040000000000e-09
1.73040000000000e-09
1.74040000000000e-09
1.75040000000000e-09
1.76040000000000e-09
1.77040000000000e-09
1.78040000000000e-09
1.79040000000000e-09
1.80040000000000e-09
1.81040000000000e-09
1.82040000000000e-09
1.83040000000000e-09
1.84040000000000e-09
1.85040000000000e-09
1.86040000000000e-09
1.87040000000000e-09
1.88040000000000e-09
1.89040000000000e-09]
y=[-22.8405306447565
-22.2450287793417
-21.6577585104770
-21.0787198381626
-20.5079127623984
-19.9453372831843
-19.3909934005205
-18.8448811144068
-18.3070004248434
-17.7773513318301
-17.2559338353671
-16.7427479354542
-16.2377936320915
-15.7410709252790
-15.2525798150167
-14.7723203013046
-14.3002923841427
-13.8364960635310
-13.3809313394694
-12.9335982119581
-12.4944966809970
-12.0636267465860
-11.6409884087253
-11.2265816674147
-10.8204065226543
-10.4224629744442
-10.0327510227842
-9.65127066767441
-9.27802190911481
-8.91300474710541
-8.55621918164621
-8.20766521273719
-7.86734284037838
-7.53525206456975
-7.21139288531131
-6.89576530260307
-6.58836931644503
-6.28920492683717
-5.99827213377951
-5.71557093727205
-5.44110133731477
-5.17486333390769
-4.91685692705081
-4.66708211674411
-4.42553890298761
-4.19222728578130
-3.96714726512519
-3.75029884101927
-3.54168201346354
-3.34129678245801
-3.14914314800267
-2.96522111009752
-2.78953066874256
-2.62207182393780
-2.46284457568323
-2.31184892397886
-2.16908486882468
-2.03455241022069
-1.90825154816689
-1.79018228266329
-1.68034461370989
-1.57873854130667
-1.48536406545365
-1.40022118615082
-1.32330990339818
-1.25463021719574
-1.19418212754349
-1.14196563444144
-1.09798073788958
-1.06222743788791
-1.03470573443643
-1.01541562753515
-1.00435711718406
-1.00153020338316
-1.00693488613246
-1.02057116543195
-1.04243904128163
-1.07253851368151
-1.11086958263158
-1.15743224813184
-1.21222651018230
-1.27525236878295
-1.34650982393380
-1.42599887563483
-1.51371952388606
-1.60967176868748
-1.71385561003910
-1.82627104794091
-1.94691808239291
-2.07579671339511
-2.21290694094750
-2.35824876505008
-2.51182218570286
-2.67362720290583
-2.84366381665899
-3.02193202696235
-3.20843183381589
-3.40316323721964
-3.60612623717357
-3.81732083367770
-4.03674702673202
-4.26440481633653
-4.50029420249125
-4.74441518519615
-4.99676776445124
-5.25735194025653
-5.52616771261201
-5.80321508151769
-6.08849404697355
-6.38200460897961
-6.68374676753587
-6.99372052264231
-7.31192587429896
-7.63836282250579
-7.97303136726282
-8.31593150857004
-8.66706324642746
-9.02642658083506
-9.39402151179286
-9.76984803930086
-10.1539061633590
-10.5461958839674
-10.9467172011260
-11.3554701148348
-11.7724546250937
-12.1976707319029
-12.6311184352622
-13.0727977351718
-13.5227086316315
-13.9808511246414
-14.4472252142016
-14.9218309003119
-15.4046681829724
-15.8957370621831
-16.3950375379440
-16.9025696102550
-17.4183332791163
-17.9423285445278
-18.4745554064895
-19.0150138650013
-19.5637039200634
-20.1206255716756
-20.6857788198381
-21.2591636645507
-21.8407801058135
-22.4306281436265
-23.0287077779897
-23.6350190089032
-24.2495618363668
-24.8723362603805
-25.5033422809445
-26.1425798980587
-26.7900491117231]