How to quit from 'auto' block in gitbook ? - latex

I am new to gitbook . As I have started writing books in gitbook , I am facing some problems . The following issues are needed to known to me :
1) I can write mathematical equations in gitbook using katex/latex . For example , I can write the following equations in gitbook :
$$\frac{1}{2}$$
After this code , a fraction is appeared as 1/2 . This works fine at the time of editing . But at the time of reading , no fraction is appeared. Only the above code is shown . How to get escape from this problem ?
2) If I want to position an equation/image or whatever , I am surprisingly observe that that image is gone and instad a code is appeared .
After googling , I have come to know that a code block will be appeared if I keep 4 spaces or a tab spaces .
So what should I do if I want to keep an equation or an image at center ?
3) I am editing my book in this url : . From which url , will i read my book ?

Related

ZPL command barcode 3 zeros creates issues

I am trying to print to a GT800 Zebra printer thru serial port.
I am using ZPL. I want to control the width which is fine in auto mode. To address that in the >^BC> command I am using Auto mode as no other size setting under ^BY works
Following is the code
^XA
^MMT
^PW831
^LL400
^LS0
^BY2,,76^FT225,141^BCN,76,Y,Y,N,A
^FD:RNIP29200082034^FS
^FO225,157^A#N,18,10,E:CAL002.FNT^FD26030-0892R^FS
^FO383,157^A#N,18,10,E:CAL002.FNT^FD08.01.20 12:00PM^FS
^FO225,187^A#N,18,10,E:CAL002.FNT^FDLAMP-DR RH^FS
^FO453,187^A#N,18,10,E:CAL002.FNT^FDXBA3^FS
^PQ1,0,0,Y
^XZ
There is a funny problem. If the ^BC mode = A then if three zeros come together gives issues for eg ABCD29200082034 it prints ABCD29200 and does not complete the barcode. But the other lines are getting printed. But if the data is ABCD29200182034 , there are no issues.
If BC mode = U then even if the code is ABCD29200182034 it prints 292001820347. Note 7 is added in the end.
I am clueless as to what is this issue. I remember facing this same issue in Honeywell printer too once.
Thanks
NOTE : I replaced the 000 with 111 and the problem persists.
ZPL Manual says the following
A= Automatic Mode :This analyzes the data sent and automatically determines the best packing method. The full ASCII character set can be used in the ^FD
statement — the printer determines when to shift subsets. A string of
four or more numeric digits causes an automatic shift to Subset C.
Note , it says a string of four or more numeric digits causes an automatic shift to subset C, but when the same string is 290010 it has no issues. I am really lost

Regular Expression seperate groups before a line of special characters

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
This PM was sent by [ helloworld ] hellworld#gmail.com,
Membership Status : YES
http://gg.com.zz/US?id=gg#1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
Title : Testing is testing
Quantity : 44
Price : 55.00
Item Location : United States
*******************************************************************
I want this message right here, hello there, you help is deeply
**
appreciated :)
*** This email was sent using gg.gg.com ***
Above would be my output string, I wish to get groups between the long ^^^^^^- and ****** divider,
End result would be:
This PM was sent by [ helloworld ] hellworld#gmail.com,
Membership Status : YES
http://gg.com.zz/US?id=gg#1
Title : Testing is testing
Quantity : 44
Price : 55.00
Item Location : United States
I want this message right here, hello there, you help is deeply
**^
appreciated :)
I had try (?<=^)[^\^]*|[^\^-]*(?<=\*\*) but just couldn't match the whole long ^^^^^^^ divider, can anybody help me with this?
You can use this regex to capture your intended data,
(?s)^(?:\^+-|\*{3,})\s*(.+?)(?=\s*(?:\^+|\*{3,}))
Explanation:
(?s) - Enables . to match newline character which is required here as the data to be captured spans across multiple lines
^ - Matches start of text
(?:\^+-|\*{3,})\s* - Matches one or more ^ characters ending with - or three (why three so the last line doesn't match as it has 2 stars) or more * characters followed by optional whitespace
(.+?) - Matches the intended text and captures it in first grouping pattern
(?=\s*(?:\^+|\*{3,})) - Look ahead to ensure it stops capturing the data followed by optional whitespace and above pattern like ^^^^^- or *****
Although my previous answer also worked, but this is even better as it neatly captures data.
Demo

Trying to Learn Hexagony

I'm trying to wrap my head around the programming language Hexagony. I've looked at a few sample programs and have tried writing a simple program to read input and print Hey [input]!. Here's what I have.
, < . . C $
. . { . # . ;
. . . # . . 2 '
. . . . # C 3 < .
. # . # . . * . ; .
. E . . E . ; . . > /
= . . . } y . . 3 .
. . . . ; . . 3 .
. . . e $ . ; .
. . ; . . # .
. H . . > &
Try it online!
If there is no input it prints Hey ! as expected. But with any input it prints EE!. I'm pretty sure my issue is I don't understand how the memory pointers work on the hexagonal grid. I'm assuming my code has issues with over writing values if the input is too many string but I'm not concerned with that as of yet. I confused as to the exact rules for which edge is selected with the { and } commands and how the direction of the MP is affected with this.
If anyone could give me a more explicit explanation of how the memory works how the MP is oriented with a shift that would be appreciated
Here's a diagram for how the memory movement commands work:
The memory pointer (MP) has a position (which is an edge of the memory grid) and an orientation along that edge. In the diagram, the initial position of the MP is marked with the red arrow, so it currently points north.
The MP movement commands are always relative to the current position and orientation of the MP. I've annotated the four adjacent edges based on which command gets you there. So { moves the MP forward and to left, and ' moves it backward and to the right, for example.
To figure out its new orientation, you can think of this movement as rotating the MP by 60 degrees about one of the adjacent hexagons. So depending on the chosen command, the MP would point in the following directions for the above diagram:
Cmd Orientation
{ north west
} north east
" north east
' north west
Also, just in case this is part of the confusion, remember that the memory grid is independent of the source grid (so these are not the edges of the grid containing the commands... it's just a separate, and infinite, hexagonal grid).
As for your actual program, it seems to have bigger issues than memory layout. Most of all, I'm not sure what those # are doing in there: # switches to one of the 6 IPs based on the current memory value modulo 6. Assuming your input is arbitrary, this basically switches you to a random IP, which is probably not what you want.
I can highly recommend trying out Timwi's EsotericIDE (which I also used to generate the diagram above), which allows you to step through the program and includes a visualisation of the memory grid.
I'm also happy to help you in this SE chat room if you have any further questions about the language.

A list of LEX expressions

Identify the lists of elements surrounded by <>, where elements can be : words formed with length multiply of 3 , even numbers with at least 3 digits .
The lists contain at least 2 elements separated by ',' .
Correct lists:<189,abc,abcdef,130057,11681111,abc>
Incorrect lists : <897,8999><00003,109,2000>
I tried to solve this problem , using :
word ([a-z][a-z][a-z])+ ; number ([1-9][0-9])+[13579]
but almost all the time it recognize bots lists , correct and incorrect .
I don't know how not to show the list if I find one wrong element . Thanks !

Corona extract each character from string

I'm beginner in game development using corona, can you please help me guys how to get every character in a word then add background image to it and make it clickable like in 4 Pics and 1 Word Game. Can you please suggest some ideas or tutorial link. Thanks. So far I don't have enough reputation to put image here but here is the Screenshot Link
Here are some pieces that may help you
1. Iterate over each character
local str="Something"
for i = 1, str:len() do
print(str:sub(i,i));
end
load image
local img = display.newImage("images/" . letter . "1.jpg");
if you need anything specific ask here
To iterate over each character, try also this:
local str="Something"
for c in str:gmatch(".") do
print(c)
end
(Actually, this iterates over each byte in the string, which may not be what you want if the string contains Unicode characters.)

Resources