What's this type of encoding? [closed] - urlencode

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I'm trying to build application in c# to upload and search images in Google service. I have this link of a search.
I want to know what encoding this is:
bi:AMhZZisitFc56hrSi2zjCe4sR4p2n6_1SLwTo26zZl9ZeYcguiqTFbGXbuYhEsI_1U595_1jmGPDB69m_17l8KjPE-vqRzpkrwLmVMvZ6fvVtDy014lBFf51NaAwRS3ThcfRU-OZkodj5CMUdAY9qQX0XETLskQhq6oTyPueo4AarFG3j2cQ4txmCv6fa_1xOeoYn-4KwNELtH8gpfk4XIgWEDOzUQsOA9jnIgYFTK_1VvaE4jK4VGF_1LUaQQAPcPOmCLTGFXHaoa9A_1W4o8vj7N5SfST0f3HFJHjdzsqq0fVCSiZEcjgfqkRge92GCPX7zDsRVqy7E6zZNoVZOPfuTA5a_1kQTPsvM2QusaXUH6VPZYXWDIsWyWzPnRRD30c4gYgf3l5FAtTV-45P0fqry28BJou8WBsMuQwxFP6ZCJBpNjDVaAgDtNgjA6qeuyyAEVJ6TwY3yAKSeCobtDDXRHqp2-ZQ_1ISYh31-EIt5b0Zv8ldN1-4PY1pJRLCPERExItix4270byixOSmhdewfq5DJYVFoAx96OwwZ6-oX12rNLadhXIJ2UxAfIyGtPdtSg2-VyozMNMyfJwvdvX1zngf63hYdtj8GDfIbKqJ_1qLjaPpveqURfk9JsMo7NYXoeYBAgINHfqye-ZjiuzIPdw3tONCNFSNbsXeyFDpqeB9u9M5Y38TjIqs7-YpGP5JnzE-MgQDBHpMERMzFpcGFkw83z0FQcHZsVq_1R_1PvJz9VTI5wHZZsbMlKljvvL2OMIjfTI4E3v7O5v3hRV_1kQNPH9QPNE3PCtQRq_1v8w12dJC0uDeiPvIHrIGjDdYofJmR5fjkcYT0B32a4ev70-F83zfIT03-GM9OxomNQdLUtgOBfVCXcFNTtPty0-l-P7sSMF1pJbW4aQCUFmKbl0MgPeod2PsIL9guihNzei1V_1IDWEX_1YL6YpCVLZmMnkEM_1SKpEdSAqI69mme5TinuwWTu7blJrMTPqmg4J6AAfp8x9Ig7DmrAaLWD5-onuOgu3IoFHVXTyhHSH7irueYt7l5GvMrH-fMG7IhRUZn6ujKZrlGZZf59cCHCLM0n7SpxgB_1J7KPtlFg1IHebXycFVyB_1xWkUa3KSGk3kitfOkfxhwmvVYe-x-k04kmjVMGaMzaJx-ZoVAcX9j_1UgL7ZKxI-CdZZ78FbpjQfTlMVqcrUKi6npEwAtksfDvb_10bdMxVOXdZHdE5duw3WuL6evNoHdgLD1xFiB2VEnZQzABiP0DAGXEECROFtWZQg84gpM3H8tPRxNPzfPYiHLFdF9j--xreJa5fMsetJedratpZj5CFynxcvGNUgAmzTHxoKJPCxhuS3gkMdo6fBIX4EjuhQXTuQooh96N4_15Q3g6Rxv8fjE0oPeaCMYyu1iqtay3qyXwsX0q0JY_12xHUUfAan535H_16RvwvoVUuy8UULYCbjGolCQqHTVZz-IRi3WcK4RMdsfdk0DdhbijX26k-7UsNphKCVG4V6t1HrNMrNB_1XdA0ZKLIMSINNcGMaUh71yXMkCtj2BvhnKqMYVeqxhVd_12nPx9366_1QRAvzNQSb

The part after "sbi:" looks like its is Base64 encoded: https://en.wikipedia.org/wiki/Base64
But if it is supposed to represent the raw bytes of the image then it is hard to confirm . When I decode the example string, that's what I get, raw binary bytes, not a string.
Note: assuming it is Base64 then the encoded text continues up-to-and-including the first equal-sign (=) that appears after the "sbi:" in the URL.

#modal_dialog
But if it is supposed to represent the raw bytes of the image then it
is hard to confirm . When I decode the example string, that's what I
get, raw binary bytes, not a string.
However - those binary bytes, the decoded string (taken from the url, up to and including the '='), do not seem to translate to a picture in any known format (not even when adding an extra '=' at the end of the to-be-decoded-string) ... so that seems to me it'd indicate it's not base64 encoding
[Edit:] #GeeSuth Since your question is related to building your own reverse image search service, you might wanna work with the initial Google Images search url:
https://www.google.com/searchbyimage?image_url=[location-of-img-to-search-from]
like eg. https://www.google.com/searchbyimage?image_url=https://european-made.com/wp-content/uploads/2019/11/logo-busnises.png1144.png

Related

How should I answer this interview question? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I found this interview question for a company I'm interested in joining soon.
Consider that you have an API that is called from the UI to display some data using pagination. How would you change the API call if for a non UI client you need to retrieve all data at once without pagination (petabytes of data)?
How would you answer this?
Preface
Firstly, this is not a question for StackOverflow. This question is better suited for software engineering Stack Exchange. Secondly, my answer would be "I don't recommend sending petabytes of data from and HTTP request". However I will attempt to give the answer.
Chunked Transfer Encoding
The only acceptable answer to this question is to enable chunking. Essentially chunking allows you to retrieve an unlimited amount of data through and HTTP call by dividing the stream into non-overlapping chunks. The chunks are received independently of each other and the connection is managed appropriately. To enable this in an http reuqest/response you can utilize the following header
Transfer-Encoding: chunked
There are a variety of optional trailing headers that can be supplied
chunked-body = *chunk
last-chunk
trailer-part
CRLF
chunk = chunk-size [ chunk-ext ] CRLF
chunk-data CRLF
chunk-size = 1*HEXDIG
last-chunk = 1*("0") [ chunk-ext ] CRLF
chunk-data = 1*OCTET ; a sequence of chunk-size octets
Chunking became part of the standard in HTTP1.1 so this will be ineffective on HTTP1.0
However, if the issue is the size of the response you would need to implement chunking server side not as part of the client. I feel as though this is a misunderstanding of chunking on the interviewers part ( because I can't imagine what else they would be referring to ).

Bigquery: dbt seed with ARRAY fields [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'd like to load some small configuration table I have on BigQuery using seeds.
I did that successfully till now, but now I have a table with an array field.
I put the arrays in the usual BigQuery format ["blablabla"], but no luck.
I tried forcing the datatype in dbt_prject.yml, but I get a "ARRAY is not a valid value" error.
Did someone ever used seeding with structured fields?
Daniele
I don't think this is possible, unfortunately. From a little online research, this appears to be a joint limitation of:
the BigQuery LoadJobConfig API that dbt calls here
the CSV file format, which doesn't really have a way to specify a nested schema (related issue)
A long-term resolution to this may be support for JSON-formatted seeds (dbt#2365).
In the meantime, I recommend that you set the seed column type to string and convert it to an array (using json_extract_array) in a staging model.

Binary serialisation of Rust data strucutures [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
What is the current state of serialisation-to-binary in Rust?
I have some large (1-10MB) data structure to be sent across a network, and don't want to encode them as JSON or hex (the two serialisers I have found).
I have found #[repr(packed)]. Is this what I should use, or is there something more portable?
#[repr(packed)] only makes your data small. It does not offer any format guarantees or serialization help.
You have a few choices here (ordered by my opinion from best to worst solution):
You can use the Cap'n proto implementation for Rust
https://github.com/dwrensha/capnproto-rust
It's not really serialization, more of a forced format for structs that are then sent over the network without any conversion
fast
You could write your own Serializer and Deserializer.
you have full control over the format
runtime overhead for every single datum
you need to implement lots of stuff
You can transmute your structs to a [u8] and send that
probably the fastest solution
you need to make sure that the compiler for the program on both sides is exactly the same, otherwise the formats don't match up.
Someone evil may send you bad data. When you transmute that back, you get buffer overflows and stuff
references in your data-structure will cause wild pointers and undefined behaviour
Don't use references

Trimming meta description appropriately [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have a question regarding meta descriptions.
On pages other than the homepage, the meta description simply uses the post content (I'm using Wordpress). My question is, should I be trimming the content to 150 chars? That's what I normally do, and I even append a "..." to the end.
However I'm wondering if its more beneficial to forget about the 155 char limit to fit it perfectly in Google listings.
Any opinions?
Your description is just one of the sources Google considers when deciding what goes in the search result snippet.
Saying that, it is the most often used source so can be worth filling in, as it gives you a better chance of controlling what gets displayed.
Don't worry about its exact length or if it is different. The key thing is you have the chance to create a great snippet that encourages people to click to your article.
I'd install an SEO plugin that lets you override a default description. Then do that for your most popular articles so you can fine tune that snippet.
p.s. Don't append the "...". Google does that for you if your description is too long.
I think its okay. I don't know if they handle it as double content. For me it would be nicer to write a separate and real short intro with most important keywords that differs from content.
Otherwise you can leave out description on article pages and Google is picking an interesting part out by itself and this part is related to the users search terms, if I have seen this right?!
Also worth considering that the new style google site links lauinched within the last few weeks put an emphasis on the first circa 30 chars of the meta description.

Analyze format of pdf-file and extract text and images [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I need to extract the "articles" from this magazine which has both text and images. The image content has to be placed separately, the text extracted (as far as possible) and placed separately.
How do i go about doing this? Is there a commercial service / api that does this already? The input to the program/service will just be the file.
Eg of input: http://edition.pagesuite-professional.co.uk/pdfspool/rQBvRbttuPUWUoJlU6dBVSRnIlE=.pdf
(the actual file would be a normal pdf-file, not a seured one)
Docotic.Pdf library can extract images and text from PDF files for you.
Here are couple of samples for your task:
Extract text from PDFs
Extract images from a PDF
Extracted images can be saved as JPEG and TIFFs. You can extract text from each page or from the whole document. And you can extract text chunks with their coordinates.
Disclaimer: I work for Bit Miracle, vendor of the library.
Try this one:
http://asp.syncfusion.com/sfaspnetsamplebrowser/9.1.0.20/Web/Pdf.Web/samples/4.0/Importing/TextExtraction/CS/Default.aspx?args=7
The same component has the image-extraction feature also.
You could make a try!!
If you can afford a commercial option, Amyuni PDF Creator will allow you to enumerate all components inside the pdf file (text, image, etc), you will be able to extract them as independent objects and you can create new PDF files with them.
You may use Aspose.Pdf.Kit to extract text and images separately from a PDF file. The API is quite simple. You can also find samples, tutorials and support on Aspose website.
Note: I'm working as Developer Evangelist at Aspose.