cpp-docs | C++ Documentation
kandi X-RAY | cpp-docs Summary
kandi X-RAY | cpp-docs Summary
C++ Documentation
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cpp-docs
cpp-docs Key Features
cpp-docs Examples and Code Snippets
Community Discussions
Trending Discussions on cpp-docs
QUESTION
I'm refreshing my memory about operator precedence, because I try to be smart guy and avoid parentheses as much as possible, refreshing on following 2 links:
One problem I have, is that those 2 "reliable" docs are not telling the same thing, I no longer know whom to trust?
For one example, Cppreference says throw
keyword is in same group as the conditional operator. Microsoft's docs say the conditional operator is higher than throw
. There are other differences.
Which site is correct, or are both sites wrong in different ways?
...ANSWER
Answered 2020-Jan-15 at 07:39TL;DR: The Microsoft docs can be interpreted to be less correct, depending on how you look at them.
The first thing you have to understand is that C++ as a language does not have "operator precedence" rules. C++ has a grammar; it is the grammar that defines what a particular piece of C++ syntax means. It is the C++ grammar that tells you that 5 + 3 * 4
should be considered equivalent to 5 + (3 * 4)
rather than (5 + 3) * 4
.
Therefore, any "operator precedence" rules that you see are merely a textual, human-readable explanation of the C++ grammar around expression parsing. As such, one can imagine that two different ways of describing the behavior of the same grammar could exist.
Consider the specific example of throw
vs. the ?:
operator. The Microsoft site says that ?:
has higher precedence than throw
, while the Cppreference site says that they have the same precedence.
First, let's look at a hypothetical C++ expression:
QUESTION
According to MS documentation it appears that x86 and x64 assemblies have the same syntax as regards the END
directive, i.e., that both accept an optionally entry point [address] with this directive. But given this issue in GitHub, it seems that x64 doesn't accept this option. The example below shows this:
ANSWER
Answered 2019-Nov-23 at 19:47This is unfortunately undocumented behaviour for the x64 version of MASM. On this version of the assembler the END directive doesn't accept an entry point symbol. You must simply end your source with a bare "END" statement. (Making the END directive completely useless, as it hasn't been needed to mark the end of the file since MS-DOS 2.0.)
As a workaround, you can specify the entry point with the /ENTRY
linker option, which you can set from the Visual Studio IDE under the project's Property Page -> Linker -> Advanced -> Entry Point. You could also rename your entry point to rely on the linker's default entry point, which depends on the subsystem used, as Microsoft's documentation for /ENTRY states:
By default, the starting address is a function name from the C run-time library. The linker selects it according to the attributes of the program, as shown in the following table.
QUESTION
I am using the Google Speech API from cloud platform for getting speech-to-text of a streaming audio. I have already done the REST API calls using curl POST
requests for a short audio file
using GCP.
I have seen the documentation of the Google Streaming Recognize, which says "Streaming speech recognition is available via gRPC only."
I have gRPC (also protobuf) installed in my OpenSuse Leap 15.0. Here is the screenshot of the directory.
Next I am trying to run the streaming_transcribe example from this link, and I found that the sample program uses a local file as the input but simulate it as a microphone input (catching 64K chunks sequentially) and then send the data to Google server.
For initial tests to check the grpc is correctly set on my system I ran make run_tests
. I have changed the Makefile as:
ANSWER
Answered 2019-Feb-22 at 04:50how to run the test
Follow the instructions on cpp-docs-samples. Prerequisit - Install grpc, protobuf, and googleapis and setup the environment as saib in the links above.
gstreamer instead of the function used for simulating the mic-phone audio
For this program I have created pipelines which are
QUESTION
I'm using nlohmann/json library to use json in cpp. I have a Json::Value object and I would like to go through my json data by exploring the keys without knowing them. I came across the documentation but only found the object["mySuperKey"]
method to explore the datas which means to know the existing keys.
Can you please give me some tips ?
thanks.
...ANSWER
Answered 2019-Oct-19 at 13:28Well after creating a json Object - there are types that can be iterated.
in this nlohmann::json
implementation you interact with to basic containers (json::object
,json::array
) both has keys that can be easily retrieved or printed.
Here is a small example that implements a function to recursively (or not) traverse the json object and print the keys and value types.
The code of the Example:
QUESTION
I am unable to change find the SSL certificate that the grpc speech recognition application uses.
I need to change the certificates as I am under a secure network which monitors all the HTTPS traffic and uses a different certificate than default.
While running the above mentioned speech recognition example, I am getting the error as
...ANSWER
Answered 2019-Feb-04 at 05:41This solved my problem.
Just go to /etc/ssl/certs
and find where the ca-bundles.pem
is pointing.
Go to the file ca-bundles.pem
(for me it was in /var/lib/ca-certificates/ca-bundles.pem
) and add your certificate manually by copying it from the .pem
file.
save the changes and run your tests. :)
QUESTION
This seems to be a protobuf linking error. I am describing the steps that I followed to get here.
NOTE: Following links are to install the protocol buffer compiler and gRPC. If you already have a running gRPC system then you can skip it
I have installed protobuf and grpc successfully by following the steps mentioned in respective important links.
1.https://github.com/grpc/grpc/blob/master/BUILDING.md
NOTE: Following link is to get and run the sample codes provided by Google for speech recognition applications.
- Cloned the repo at https://github.com/GoogleCloudPlatform/cpp-docs-samples/tree/master/speech/api and followed the steps 1-9
On step 9 - make run_tests
, I am getting this error
ANSWER
Answered 2019-Jan-28 at 09:12I observed that the grpc++ version 1.19 do not support protobuf-c version 15.
To make this work, I changed the symlink pointer from libprotobuf-c.so.15
to libprotobuf-c.so.17
.
QUESTION
I'm trying to create CMake build to compile my project with google APIs library, the source of google APIs is generated with protocol buffers.
let's say I want to make CMake file for https://github.com/GoogleCloudPlatform/cpp-docs-samples/blob/master/speech/api/streaming_transcribe.cc
streaming_transcribe.cc is using
#include "google/cloud/speech/v1beta1/cloud_speech.grpc.pb.h"
which is located in the source directory of google APIs and its source is needed to be compiled and linked against the grpc library and grpc++ and a bunch of other sources in the same directory.
the makefile in the samples https://github.com/GoogleCloudPlatform/cpp-docs-samples/blob/master/speech/api/
is compiling the sources in the google APIs directory to object files without linking them to grpc, and then is archived to ar file and just then the streaming_transcribe.cc is compiled and linked with ar file and grpc.
how can I make the same process for cmake file build?
...ANSWER
Answered 2017-Apr-16 at 17:53Archive of object files is a static library. With CMake you may create it with:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cpp-docs
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page