GPS Coordinates MIssing Compass Points - geolocation

I've been provided a series of Latitude/Longitude coordinates From what I've read this is the correct format: N41 25.117 and W120 58.292
The data provided appears to be missing the N,S,E,W designations? Is there a way to derive this from the values that are provided to me?
Sample of the data here:
Longitude/Latitude
85 36.714 29 46.091
85 58.505 30 04.041
85 58.499 30 04.088
85 36.689 29 45.872
85 36.908 29 46.534
85 42.635 29 44.921
85 42.413 29 46.498
85 29.316 29 43.253
85 29.333 29 44.124
85 40.746 29 43.255

It may be that the data uses positive values as North and East, while negative values mean South and West.

Related

ESCPOS Datamatrix command

I am trying to print a Datamatrix barcode using an EPSON m30 Printer.
When the following HEX values are transmitted, no action is taken.
I was able to get this HEX value from the page below.
https://download.epson-biz.com/modules/ref_escpos/index.php?content_id=170
1d 28 6b 0d 00 36 50 30 31 32 33 34 35 36 37 38 39 30
1d 28 6b 03 00 36 54 30 0d 0a
Can you please let me know if something is wrong?
thanks
Maybe the description on the reference page is incorrect.
For example, the printing of the Aztec code is Function 581, which is 35 51 30.
The second byte of other barcodes is 51.
By analogy, there is a possibility of 36 51 30 instead of 36 54 30.
Please try sending the following command.
Q:
1d 28 6b 0d 00 36 50 30 31 32 33 34 35 36 37 38 39 30 1d 28 6b 03 00 36 54 30 0d 0a
A:
1d 28 6b 0d 00 36 50 30 31 32 33 34 35 36 37 38 39 30 1d 28 6b 03 00 36 51 30 0d 0a

Finding guid in onenote onetoc2 binary file

According to the documentation provided by Microsoft the header structure of the oncetoc2 must be at the beginning of the file and must have the value
{43FF2FA1-EFD9-4C76-9EE2-10EA5722765F}
Characters Stripped
43FF2FA1EFD94C769EE210EA5722765F
Looking through the file with a hex editor I am unable to find a match for this string, nor can I find it after stripping all the characters and flipping the string. (Endianess?)
F5672275AE012EE967C49DFE1AF2FF34
Then I attempted to find a match with the hex equivalents of the string,
7b34334646324641312d454644392d344337362d394545322d3130454135373232373635467d
This can not be right, as it is much over 16 bytes.
I have been staring at this for a while and can't see what I am missing here. Not finding a pattern match with search tools.
What am I not doing right ?
OneNote onteoc2 file structure:
https://msdn.microsoft.com/en-us/library/dd906213(v=office.12).aspx
Interesting question. I just had a look at the doc, being completely perplexed by it last time.
Here's what seems to be going on.
The first 16 bytes of the fileA1 2F FF 43 D9 EF 76 4C 9E E2 10 EA 57 22 76 5FLets break it down like this A1 2F FF 43                    flip it 43 FF 2F A1D9 EF                               flip it EF D976 4C                               flip it 4C 76
9E E2                       dont flip it 9E E210 EA 57 22 76 5F dont flip it 10 EA 57 22 76 5FAnd we get{43F2FA1-EFD9-4C76-9EE2-10EA5722765F}
If you take bytes 48 to 633F DD 9A 10 1B 91 F5 49 A5 D0 17 91 ED C8 AE D8And apply the same formula we get{109ADD3F-911B-49F5-A5D0-1791EDC8AED8} - guidFileFormat (16 bytes)I hope this helps.

Problems Implementing AR, ARMA, and possibly more complex timeseries models in pymc3 using theano.scan

I try to implement a simple ARMA model, however have serious difficulties getting it to run. When adding a parameter to the error term everything works fine (see the return x_m1 + a*e statement, commented out below), however if I add a parameter to the auto regressive part, I get a FloatingPointError or LinAlgError or PositiveDefiniteError, depending on the initialization method I use.
The code is also put into a gist you can find here. The model definition is replicated here:
with pm.Model() as model:
a = pm.Normal("a", 0, 1)
sigma = pm.Exponential('sigma', 0.1, testval=F(.1))
e = pm.Normal("e", 0, sigma, shape=(N-1,))
def x(e, x_m1, a):
# return x_m1 + a*e
return a*x_m1 + e
x, updates = theano.scan(
fn=x,
sequences=[e],
outputs_info=[tt.as_tensor_variable(data.iloc[0])],
non_sequences=[a]
)
x = pm.Deterministic('x', x)
lam = pm.Exponential('lambda', 5.0, testval=F(.1))
y = pm.StudentT("y", mu=x, lam=lam, nu=1, observed=data.values[1:]) #
with model:
trace = pm.sample(2000, init="NUTS", n_init=1000)
Here the errors respective to the initialization methods:
"ADVI" / "ADVI_MAP": FloatingPointError: NaN occurred in ADVI optimization.
"MAP": LinAlgError: 35-th leading minor not positive definite
"NUTS": PositiveDefiniteError: Scaling is not positive definite. Simple check failed. Diagonal contains negatives. Check indexes [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71]
For details on the error messages, please look at this github issue posted at pymc3.
To be explicit, I really would like to have a scan-like solution which is easily extendable to for instance a full ARMA model. I know that one can represent the presented AR(1) model without scan by defining logP as already done in pymc3/distributions/timeseries.py#L18-L46, however I was not able to extend this vectorized style to a full ARMA model. The use of theano.scan seems preferable I think.
Any help is highly appriciated!

Websocket - Chrome complaining about mask bit set

I have implemented a websocket server in my existing server. Handshake is good and then I can even send first message and client browser receives it. But any subsequent messages disconnect websocket. On chrome I get following error.
failed: A server must not mask any frames that it sends to the client.
My frame is created like this
Len = erlang:size(Msg),
if
Len < 126 ->
Message = [<<1:1, 0:3,2:4,0:1,Len:7>>,Msg];
Len < 65536 ->
Message = [<<1:1, 0:3,2:4,0:1,126:7,Len:16>>,Msg];
true ->
Message = [<<1:1, 0:3,2:4,0:1,127:7,Len:64>>,Msg]
end,
Now one sample data to be transmitted looks like this
<<130,46,60,115,110,112,95,105,110,102,111,32,97,118,95,112,111,116,61,34,49,49,34,32,104,97,110,100,115,95,112,101,114,95,104,111,117,114,61,34,48,46,50,48,34,32,47,62>>
As you can see in the code above, my mask bit is always set to 0, but I don't why the same message works for the first time and then I send the same message again, it complains about mask bit set.
Anybody got any idea why?
Thanks
The frame sample data you pasted is sane.
48 bytes
ErlangSampleBytes[48] = 82 2E 3C 73 6E 70 5F 69 6E 66 6F 20 61 76 5F 70
6F 74 3D 22 31 31 22 20 68 61 6E 64 73 5F 70 65
72 5F 68 6F 75 72 3D 22 30 2E 32 30 22 20 2F 3E
It Parses/Translates to:
82 = fin:true
rsv1:false
rsv2:false
rsv3:false
opcode:2
2E = masked:false
payloadLength:46 (decimal)
Payload = UTF8 valid:
<snp_info av_pot="11" hands_per_hour="0.20" />
You don't even have a mismatch on the payload length declaration and what is left in the sample buffer.
At this point, it would be wise to look at the chrome inspection tooling to find out what the frames it thinks it got. And a next step after that would be to try to capture the network traffic with a tool like WireShark in an effort to see what is going on.
Suspect that the # of bytes you are sending on the wire, vs what you are declaring in the payloadLength are differing. (common one i've seen is sending more bytes than you declare)
Such as allocating a buffer of 1024 bytes, filling in the first 48 properly, then sending the entire 1024 bytes. That will mess parsing of the next frame.

How would you put a small graphic in your latex document source?

I have a small graphic that is part of my document. It's PDF, is 193 lines, and has some binary data mixed with its postscript. I'm currently using the graphicx package and including the pdf as a separate file. Is there a way I can inline it directly in my latex source?
Here's a solution I devised:
convert the pdf to postscript using pdftops (part of the xpdf package),
convert the postscript to ASCII-only, and
embed the postscript using the graphicx package and the \special macro.
A drawback is that embedding postscript using \special requires me to emit dvi instead of pdf. It would be nice to improve this solution to allow pdf to be emitted directly.
The latex source will look something like this.
\noindent\vbox to 112pt{\vfil\hbox to 248pt{\special{" gsave
currentfile /ASCIIHexDecode filter cvx exec
25 21 50 53 2d 41 64 6f 62 65 2d 33 2e 30 20 45
50 53 46 2d 33 2e 30 0a 25 20 50 72 6f 64 75 63
65 64 20 62 79 20 78 70 64 66 2f 70 64 66 74 6f
70 73 20 33 2e 30 32 0a 25 25 43 72 65 61 74 6f
...
65 72 0a 65 6e 64 0a 25 25 44 6f 63 75 6d 65 6e
74 53 75 70 70 6c 69 65 64 52 65 73 6f 75 72 63
65 73 3a 0a 25 25 45 4f 46 0a
>
grestore
}
\hfil}}
I made a gist at github that provides a complete example.
Take a look at Asymptote and Latex Integration Guide
I don't think there is a way to inline binary data in LaTeX. You could recreate graphics as vector type images with various packages (such as Asymptote recommended by lpthnc). If you're really clever you could write some TeX to store the data in array format and recreate it, but I don't think there's a package to do it simply.
you should also take a look at the pdfpages package. all kinds of options for including PDFs in your PDF document.
pdfpages: http://www.ctan.org/tex-archive/macros/latex/contrib/pdfpages/pdfpages.pdf
OK, I think this does what you want, but unless you really need to do something like this, other solutions are better.
To be able to use this solution, you need to:
enable shell escape in your Latex command (-shell-escape command line option). Shell escape is disabled by default because of security reasons.
have access to uuencode and uudecode programs where you're compiling the file.
Let's say your graphic is graphic.png, and your main document is doc.tex. First, encode graphic.png and append it to the end (the encoded data is all text):
$ cat graphic.png | uuencode graphic.jpg >>doc.tex
Then, make sure you have this before you include the graphic in doc.tex:
\immediate\write18{cat \jobname.tex | uudecode}
For example, here's a document I created:
\documentclass{article}
\immediate\write18{cat \jobname.tex | uudecode}
\usepackage{graphicx}
\begin{document}
\includegraphics[width=\textwidth]{graphic}
\end{document}
%%% Do not touch the data below, this is added by uuencode.
begin 644 graphic.png
..... (stripped a lot of lines) ...
`
end
Then, this will work:
$ pdflatex -shell-escape doc
As I said, there are much nicer and better solutions, and unless you really have to have one source file, don't do this.

Resources