Web3.js and Ether.js help me - hex

Im learning web3, and while examining the source code of a page, I saw that the abi file was written in a strange way, what is it? how can i decode?
I assumed it was hexcode and tried to convert it..
http://ddecode.com/hexdecoder/
it didn't work

ABIs are JSON files. JSON stands for JavaScript Object Notation, and is a commonly-used data transfer format. Here's an introduction to JSON: https://www.w3schools.com/whatis/whatis_json.asp
Here's a quick description of ABIs: https://ethereum.stackexchange.com/a/235/97038
EDIT: It appears that the file you're looking at is obfuscated: https://blog.jscrambler.com/javascript-obfuscation-the-definitive-guide

Related

How to read a BLOB with qt-type compression?

I have a file (about 100k files, to be specific) containing a data from weather radars - one file is a one radar image. It is a mosaic of data from several radars, creating a map of a reflectivity over whole country.
The files have extension .cmax and I need to convert them to something more useful (eg. array of reflectivities) for further uses.
I have asked data provider how to read those files. They responded:
The standard product format in our system (.cmax) is the internal format of the company that provides us with the software. It consists of an xml and binary part. It can be read by reading as a stream of bytes. Firstly, parse the initial bytes as xml, then treat the rest (BLOBs) as a binary data compressed with the "qt" method. You need to unpack them using a library that supports this compression mode. In general, you have to work a little, but it can be done in virtually any programming language.
The main issue is with the binary part of data. I have tried to decompress it with zlib (googling qt compression it comes out) and reading as a binary data in C++. None of them worked. It also doesn't seem resonable to me to try reading that data as binary in Qt.
The file begins with those lines:
<product version="5.44.5" datetime="2017-01-01T18:00:00" datatype="dBZ" type="cmax" name="CMAX" owner="">
<data time="18:00:00" date="2017-01-01">
Then, there are radars specifications and image details (active radars, min and max reflectivity etc). XML part ends with:
</product>
<!-- END XML -->
<BLOB blobid="0" size="79617" compression="qt">(here are lots of binary data)</BLOB>
I'm looking for a way (tool?) to convert that binary data. For example, it could be that mentioned library.
Looking at the details, this is most likely Leonardo (Selex/Gematronic) Rainbow5 format. zlib is the right lib for decompression. But there are some tricks to it. A python reader is implemented in the wradlib library (https://github.com/wradlib). Maybe you can adapt from that code. Disclaimer: I'm one of the wradlib devs.
Did you try simply using the qUncompress() function? https://doc.qt.io/qt-5/qbytearray.html#qUncompress

Can I read a point clouds from a .e57 files without any library?

The libE57 is okay but I have to try to do this without any library. I found presentation and there I found next:
Binary Encoding
Blobs :
Opaque encoding
Images, user-defined data ....
"Opaque encoding" means that I can't read .e57 without libE57?
Is there some way to parse it?
I have a parser for a .pcd, .pts, .ptx. Can I convert a .e57 to one of them?
No. You can read data of .e57 only using libe57.
http://www.libe57.org/documentation.html

How to open .jl file

I want to open a .jl file and convert it to a readable file preferably in .xls format.
I do not have any any idea about Julia language.
Is there a file opener for jl files?
I came here with the same question, but since the file I was looking at was clearly JSON data, I did some more searching.
The .jl file extension also refers to JSON lines, sometimes instead a .jsonl extension.
More here: http://jsonlines.org/
You can search for .json to Excel to find a converter, e.g. https://json-csv.com/ (this worked fine on my JSON lines file).
A .jl file is a julia script.
It is source code.
Not data.
You can open it up in any text editor, e.g. notepad on windows.
However, it won't normally contain anything useful to you unless you want to edit that code.
(It might contain some array literals that you want, I guess)
Perhaps you mean to ask "How can I open a .jld file"?
Which is a julia HDF5 file.
In which case please ask another question.
As I see, Julia is a script language therefor the file can be opened in a text editor like Notepad++, Vim, etc. Do not use word processor (like LibreOffice Writer) if you want to modify it, but it's OK if you want to read only.
To get started:
https://docs.julialang.org/en/stable/

Converting .pdf files to excel (.xls)

A friend of mine doing an internship asked me 2 hours ago if I could help him avoid to do manually 462 pdf file to .xls using free online soft.
I thought of a shell script using unoconv, but I didn't find out how to use it properly, and I am not sure if unoconv can solve this problem since it mainly converts file to pdf, not the reverse thing.
Conversion from PDF to any other structured format is not always possible and not generally recommended.
Having said that, this does look like a one-off job and there's a fair few of them (462).
It's worth pursuing, if you can reliably extract text from most of them and it's reasonably structured. It's a matter of trying to get regular text output across a sample of the PDF's that you can reliably parse into a table structure.
There's plenty of tools around that target either direct or OCR based text extraction, just google around.
One I like is pstotext from the ghostscript suite; the -bboxes option lets me get the coordinates of each word and leaves it up to me to re-assemble the structure. Despite its name it does work on input PDFs. Downside is that it can be a bit flakey and works on some PDF's but not others.
If you get this far, you'd then most likely then need to write a shell-script or program to convert that to a CSV. You can either open this directly via a spread-sheet or look for tools to convert this into XLS.
PS If he hasn't already, get the intern to ask if there's any possible way of getting at the original data that was used to created the PDFs It will save a lot of time and effort and lead to a way more accurate result.
Update An alternative to pstotext is renderpdf.pl command which is included in the Perl CAM::PDF module. More robust, but just reports text (x,y) position, not bounding boxes.
Other responses on a linked question suggest Tabula, too.
https://github.com/tabulapdf/tabula
I tried and it works very well.

odfWeave error source document containing non-ASCII chars

Getting this error calling ODFWeave on my doc.
Pre-processing the contents
Sweaving content.Rnw
Error: ‘content.Rnw’ is not ASCII and does not declare an encoding
I've seen some ways you can add an encoding switch in LaTeX docs "(Sweave --encoding=utf-8)", but don't know if this can be done with odfWeave
I've worked around it before by converting the source doc back to ASCII, but ideally it would be nice if the conversion would run with whatever is in my doc (and some names, for example, require a non-ASCII charset).
We made changes to odfWeave so that it (rightly) uses a utf-8 encoding. In fact, we coerce this by using the 'encoding="UTF-8"' option to Sweave.
I guess the question is "why isn't the document utf-8"? Honestly, I dont really have a good answer for you since I don't have the document (or the results of sessionInfo()). You might be creating non-utf8 characters in the course of weaving.
One thread that might help is this:
http://r.789695.n4.nabble.com/Running-odfWeave-on-its-own-examples-odt-td4639889.html
Figuring this out appears pretty complex and I wish I had a clear-cut answer for you.

Resources