question stringlengths 25 894 | answer stringlengths 4 863 |
|---|---|
For some reason when I call WSARecvFrom the function does not return until something is received.
```
_socket = WSASocket(AF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, NULL, WS_OVERLAPPED);
...
sockaddr_in addr = ...
if(bind(_socket, (const sockaddr*)&addr, sizeof(addr)) != EXIT_SUCCESS) { ... }
...
HANDLE _handle = Create... |
ChangeWS_OVERLAPPED(which as a value of 0) toWSA_FLAG_OVERLAPPED(which has a value of 1) instead. You are not creating an overlapped socket correctly, so_recvOverlapis being ignored byWSARecvFrom().
|
I just started to use gstreamer and I want to know how to register a plugin that I wrote. Of course, I have followed thePlugin Writer's Guideand used themake_elementcommand to build my plugin. Now, I want to test it in a basic pipe line using thegst-launchcommand.
The problem is that I don't know how to register my ... |
I'v solve my problem by upgrading to 1.0 but I also had to change the installation path in the "configure" folder.
|
This question already has answers here:Alternative (K&R) C syntax for function declaration versus prototypes(6 answers)Closed9 years ago.
What's the difference between this declaration:
```
void
main(argc, argv)
int argc;
char **argv;
{
// ...
}
```
from this?
```
void
main(int argc, char **argv)
{
// ..... |
Its a different notation style that was used in C at its beginning called the KR Notation (for Kernighan and Ritchie, C's designers). The well known C notation style that is used today follows the ANSI standard.
Here's link to a Wikipedia article describing the KR notation :http://en.wikipedia.org/wiki/K%26R_C#K.26R_... |
I have the following code:
```
char* p;
void func1()
{
p = "hello world";
}
int main()
{
func1();
printf(p);
return 0;
}
```
This code works fine here, but I'd like to know if it is correct or if there is an "undefined behavior" here.
Will the "hello world" still exist outside the func1()?
|
String literals are character arrays with static storage duration (cf. C11 6.4.5/6), and thus their lifetime extends to the end of the entire program. Your code is fine.
|
So I am trying to run a sscanf on char *temp[512], but i get an error( error:invalid operands to binary & (have 'char *' and 'float').
char *temp[512] contains info:Flen 2014-5-20 19.90 14.15 19.91 2014-05-21 15.05 11.3 15.05
```
char dates[13];
char dates2[13];
char city[15];
float temp1, temp2, temp3, temp4, temp5,... |
Iftempis defined aschar *temp[512]then you it isn't a string and you can't pass it tosscanf. It should be defined aschar temp[512].
|
I have always used themallocfunction as, for exemple,
```
int size = 10000;
int *a;
a = malloc(size * sizeof(int));
```
I recently run into a piece of code that discards thesizeof(int)part, i.e.
```
int size = 10000;
int *a;
a = malloc(size);
```
This second code seems to be working fine.
My question is then, whi... |
The argument tomallocis the number of bytes to be allocated. If you need space for an array ofnelements of typeT, callmalloc(n * sizeof(T)).mallocdoes not know about types, it only cares about bytes.
The only exception is that when you allocate space for (byte/char) strings, thesizeofcan be omitted becausesizeof(char... |
This question already has answers here:Definition of int64_t(5 answers)Closed9 years ago.
I know that in Unixes/Linuxes thelongsize is 64bit.
But when using the same under the windows (x64) thelongis always 32bit.
Is there any workaround/library that enable the use oflarger integersin C ?
|
Under C99, you have two possibilities
Uselong long, since it is required to be at least 64-bitIf available, useint64_t, orint_least64_t, fromstdint.h
In the second approach, you may find it useful to combine withinttypes.h, which adds portable formatting and conversion functions, but note that whilestdint.his requir... |
For performance reasons, I want to run an SQLite query that deletes rows AND returns the deleted rows so I don't have to run two separate queries when I want to know what is being deleted. PostOgreSQL allows this using something like "RETURNING *" at the end, but I can't find anything in the documentation for SQLite. ... |
Try the OLD alias. This should get you the results you are needing.
|
Closed. This question needsdetails or clarity. It is not currently accepting answers.Want to improve this question?Add details and clarify the problem byediting this post.Closed9 years ago.Improve this question
I want to do conditional initialization in global matrix; is it possible as below (pseudo code)? Please sug... |
Makeaa global pointer and then initialize conditionally using malloc.
```
char **a;
int main()
{
if (condition){
a = malloc(some_size);
//initialize the memory here
}
else {
a = malloc(other_size);
//or initialize differently here
}
```
}
|
Problem statement:
Wanted to have an optimized split function which will search for given character in string and split the string into 2sub-strings, before and after the character.
Example :
```
s1 = strdup("XYZ@30");
s2 = split(s1,"@");
Should get following output.
s1 = "XYZ"
s2 = "30"
```
I have written fol... |
Don't usestrdup; just havestr2point to the character after the split character.
|
Closed. This question needsdetails or clarity. It is not currently accepting answers.Want to improve this question?Add details and clarify the problem byediting this post.Closed9 years ago.Improve this question
I can convert it if the doulble * is pointing only to one double but not an array.
Here is my function,
`... |
```
#include <stdio.h>
#include <string.h>
typedef struct dbl9 {
double array[9];
} Dbl9;
Dbl9 fun(double *in){
Dbl9 ret;
memcpy(ret.array, in, sizeof(ret.array));//There can be no assurance that <in> the correct
return ret;
}
int main(){
double array[9] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0... |
TheGtkStackclass provides the method :gtk_stack_set_transition_typeto enable transitions between pages.
But only the follwing transition types are available :
```
typedef enum {
GTK_STACK_TRANSITION_TYPE_NONE,
GTK_STACK_TRANSITION_TYPE_CROSSFADE,
GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT,
GTK_STACK_TRANSITION_TY... |
no, there currently isn't a way to specify a transition in CSS for GTK widgets, and forGtkStackin particular.
|
This question already has answers here:What should main() return in C and C++?(19 answers)Closed9 years ago.
Why is adding a return statement for themain()function in C important if the programs I make runs the same without it?
Is there a disadvantage in my programs if I omitted the return statement in themain()func... |
It is by convention that you tell the operating system if your program exited successfully(returning 0), or if there was an error(for example, byreturning an error code).
To remain more standards compliant, usereturn EXIT_SUCCESSorreturn EXIT_FAILURE.
|
I'm trying to calculate the value of n that solves the problem below. I am not exactly sure where I am messing up. I tried using a do while loop also, but I am having trouble figuring out the logic error. Could anyone assist?
If S = √ (6*( 1+1/2^2+1/3^2 +1/4^2 + 1/5^2 + ... ) ) = (pi^2)/6, after how many terms will ... |
```
int abs(int i)
```
computes the absolute value of aninteger. Therefore in
```
abs(sqrt(6*s) - 3.141592)
```
the floating point numbersqrt(6*s) - 3.141592is converted to anintfirst, which gives zero as soon as the absolute value of this number is less than one.
You want to usefabs()instead.
|
Let us assume there is a struct with multiple members. The struct members are initialized with some values. The memory location of a specific member is given. Assume that you don't know the other members, their types, the ordering of members etc. Is there a way to know the memory location of the struct itself?
Is thi... |
If you know the name of the struct, simply useoffsetof
```
struct my_struct {
const char *name;
struct list_node list;
};
int main() {
struct my_struct t;
struct list_node* pl = &t.list;
size_t offset = offsetof(struct my_struct, list); //here
struct my_struct* pt = (struct my_struct*)((unsig... |
Closed.This question does not meetStack Overflow guidelines. It is not currently accepting answers.This question does not appear to be abouta specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic onanother Stack Exchange site,... |
The usual way is for each driver when first loaded, typically at boot time, to poll the buses it supports and look for matches between what it is designed to support and the returned signatures (vendor and device IDs), and their classes.
This is at least the way it works for the so-called plug and play peripherals.
|
I have always used themallocfunction as, for exemple,
```
int size = 10000;
int *a;
a = malloc(size * sizeof(int));
```
I recently run into a piece of code that discards thesizeof(int)part, i.e.
```
int size = 10000;
int *a;
a = malloc(size);
```
This second code seems to be working fine.
My question is then, whi... |
The argument tomallocis the number of bytes to be allocated. If you need space for an array ofnelements of typeT, callmalloc(n * sizeof(T)).mallocdoes not know about types, it only cares about bytes.
The only exception is that when you allocate space for (byte/char) strings, thesizeofcan be omitted becausesizeof(char... |
This question already has answers here:Definition of int64_t(5 answers)Closed9 years ago.
I know that in Unixes/Linuxes thelongsize is 64bit.
But when using the same under the windows (x64) thelongis always 32bit.
Is there any workaround/library that enable the use oflarger integersin C ?
|
Under C99, you have two possibilities
Uselong long, since it is required to be at least 64-bitIf available, useint64_t, orint_least64_t, fromstdint.h
In the second approach, you may find it useful to combine withinttypes.h, which adds portable formatting and conversion functions, but note that whilestdint.his requir... |
For performance reasons, I want to run an SQLite query that deletes rows AND returns the deleted rows so I don't have to run two separate queries when I want to know what is being deleted. PostOgreSQL allows this using something like "RETURNING *" at the end, but I can't find anything in the documentation for SQLite. ... |
Try the OLD alias. This should get you the results you are needing.
|
Closed. This question needsdetails or clarity. It is not currently accepting answers.Want to improve this question?Add details and clarify the problem byediting this post.Closed9 years ago.Improve this question
I want to do conditional initialization in global matrix; is it possible as below (pseudo code)? Please sug... |
Makeaa global pointer and then initialize conditionally using malloc.
```
char **a;
int main()
{
if (condition){
a = malloc(some_size);
//initialize the memory here
}
else {
a = malloc(other_size);
//or initialize differently here
}
```
}
|
Problem statement:
Wanted to have an optimized split function which will search for given character in string and split the string into 2sub-strings, before and after the character.
Example :
```
s1 = strdup("XYZ@30");
s2 = split(s1,"@");
Should get following output.
s1 = "XYZ"
s2 = "30"
```
I have written fol... |
Don't usestrdup; just havestr2point to the character after the split character.
|
Closed. This question needsdetails or clarity. It is not currently accepting answers.Want to improve this question?Add details and clarify the problem byediting this post.Closed9 years ago.Improve this question
I can convert it if the doulble * is pointing only to one double but not an array.
Here is my function,
`... |
```
#include <stdio.h>
#include <string.h>
typedef struct dbl9 {
double array[9];
} Dbl9;
Dbl9 fun(double *in){
Dbl9 ret;
memcpy(ret.array, in, sizeof(ret.array));//There can be no assurance that <in> the correct
return ret;
}
int main(){
double array[9] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0... |
TheGtkStackclass provides the method :gtk_stack_set_transition_typeto enable transitions between pages.
But only the follwing transition types are available :
```
typedef enum {
GTK_STACK_TRANSITION_TYPE_NONE,
GTK_STACK_TRANSITION_TYPE_CROSSFADE,
GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT,
GTK_STACK_TRANSITION_TY... |
no, there currently isn't a way to specify a transition in CSS for GTK widgets, and forGtkStackin particular.
|
How would one go about taking a value ofstdinwhen it could be either a character (p or q in this case) or an integer value above zero but below a max?
I have tried using the%cconversion character but find that this means it loses anything after the first digit (obviously as it would just take a single char)
Should I... |
Check the return value of scanf:
```
if (scanf("%d", &intInput) == 0) {
/* Nothing read. Not an integer! */
scanf("%c", &charInput);
/* Process char input */
} else {
/* Process integer input */
```
|
Doing stuff like
```
int x = 3;
if(x)
```
is quite common thing to do in C, but what does exactly if(x) resolve to according to the standard?
Is it equivalent to if(x == 1) or if(x != 0) or something else?
|
From the C99 standard section6.8.4.1 The if statement:
In both forms,the first substatement is executed if the expression compares unequal to 0. In the else form, the second substatement is executed if the expression compares equal to 0. If the first substatement is reached via a label, the second substatement is not... |
Is there an easy way to calculate 90 days earlier than current? For example if it is 31 of May today, what is the date 90 days earlier? Is there a function to do so? Thanks
|
```
#include <stdio.h>
#include <string.h>
#include <time.h>
int main(void) {
time_t t = time(0); // NOW
struct tm tm[1];
memmove(tm, localtime(&t), sizeof tm); // convert to struct tm
tm->tm_mday -= 90; // subtract 90 days
time_t then2 = mktime(tm); ... |
I made this code :
```
int n,m;
void print(int a[][m])
{
int i=0,j=0;
for(;i<n;i++)
{
for(j=0;j<m;j++)
printf("%d ",a[i][j]);
printf("\n");
}
}
int main()
{
scanf("%d %d",&n,&m);
int a[100][100];
int i=0;
int j=0;
for(;i<n;i++)
{
for(j=0;j<m;j++)
... |
You may enter m of value 4, but the array a is still of size100. Thus when you writescanf("%d",&a[i][j]);fori = 1, you are reading the 101-th element of the array, which is not a part of the first 16 elements. You will need to haveaof sizemin order to do what you try to do.
|
I have to restrict when the user gives "--" as an option.
For example:
```
./test --
```
should thrown an error.
For the sake of parsing I am usinggetopt
How to achieve this using getopt?
|
getoptis intended for implementing programs which conform to thePOSIX Utility Syntax Guidelineswhere--has a special meaning of causing all subsequent arguments to be treated as non-options even if they have the form of options (e.g.rm -- -fto remove a file named-f). There's no explicit way to suppress this behavior. Y... |
I have a 3D arrayarr1[16][8][9]and I want to assign the contents of this array to a 1D arrayarr2[36]. So I'm trying:
```
arr2[0] = arr1[0][0][0];
arr2[1] = arr1[0][0][1];
......
arr2[8] = arr1[0][0][8];
```
I'm calling a function:
```
func_arr(int arr2[36], int arr1[16][8][9])
```
The function declaration goes lik... |
Function calling seems incorrect. Replace below line
```
func_arr(int arr2[36], int arr1[16][8][9])
```
with
```
func_arr(arr2, arr1);
```
Type of your first function argument isint [36]and you are passingarr2[36]. Assuming arr2 isint arr2[36], type ofarr2[36]isintand thus a type mis-match. Moreover arr2[36] is in... |
Closed. This question needsdetails or clarity. It is not currently accepting answers.Want to improve this question?Add details and clarify the problem byediting this post.Closed9 years ago.Improve this question
I have a stringchar date[16] ;I want, that the last two signs are zero. I have tried:
```
date[14] = '0';
... |
Storing the character'0'in a character array is principally correct the way you have tried it,butyou say you havechar date[16]so the indexes including the terminating'\0'go from 0 to 15, you must not assign anything todate[16].
Depending on what the complete content ofdateis, it should be eitherchar date[17]or
```
d... |
My program needs to import xxx.so, and this xxx.so file is compiled under Python2.4.
I want to run my program under Python2.7 & Python2.4, but there is an error when import xxx.so under Python2.7, I know that is due to mismatching with the Python version.
My question:should I compile xxx.so file to match each Python... |
C extension modules are version specific. Each different version of Python requires a different version of the extension module. You need to compile the extension module from source linking against the headers and libraries for the target Python version.
|
I have images that are monochrome and images that aren't.
```
unsigned char* buffer //represents the content of the image
```
and I want to do the following:
```
if monochromeImage
do something
else
do something else
```
but how can I tell that an image is monochrome according to its buffer?
|
You can't.
There is no inherent difference between a buffer contaning an image in 32-bit ARGB color and a monochrome image. Bytes are bytes, bits are bits.
However, you do have this information when the file is loaded and it would make sense to store it somewhere for later retrieval.
|
This question already has answers here:Is there any alternative to using % (modulus) in C/C++?(13 answers)Closed9 years ago.
I have a code segment that requires the remainder of two ints. I am using modulus operator as usual but I am hearing that it takes more time. So I am asking that is there any way to get the rem... |
It appears from your question thatbppis always a power of 2, in which case you can use instead:
```
int rem = gid & (bpp - 1);
```
However you should not optimise prematurely - unless you have profiled and know for certain that this mod operation is a bottleneck then you should just leave it in its original, more re... |
```
sprintf(query, "SELECT username, msg, ts, lat, lon FROM tweet WHERE msg LIKE '%'%s'%' ORDER BY ts DESC", keyword);
```
The way I did it, is giving me errors. How am I supposed to format the '%keyword%' into SQL using printf?
|
If my understanding SQL Query statements is correct, when the value ofkeywordisNBA, you want the query string to look like:
```
"SELECT username, msg, ts, lat, lon FROM tweet WHERE msg LIKE '%NBA%' ORDER BY ts DESC"
```
In that case, the format of thesprintfstatement needs to be:
```
"SELECT username, msg, ts, lat,... |
Using my android phone to control mouse of linux laptop
so the mouse has to move acordingly to my finger touch and drags
got to be tcpip(or udp) wifi socket programming between android server and linux server. (so java and C)
how to make linux server in c to move pointer and communicate the coordinates?
should it b... |
XWarpPointer from XWindows Library does the trick.http://tronche.com/gui/x/xlib/input/XWarpPointer.html
|
Can I do anything I want betweenglPushAttrib(GL_ALL_ATTRIB_BITS)andglPopAttrib()and still do not harm the other code using - setting gl states before and after (do these functions provide complete isolation)?
|
No, that only pushes theserver-sidestates onto the stack.
There areclient-sidestates too, like pixel store and vertex arrays. For them, you have to useglPushClientAttrib (...).
While pixel store states are infrequently changed, vertex array state changes are very common in deprecated code. So if you want to do this ... |
I'm trying to learn a bit about emulation and I'm trying to think of how I can decode opcodes. Each opcode is a short data type, 16 bits. I'd like to be able to compare only specific sets of 4 bits. For example: there are multiple opcodes that start with 00, such as 0x00E0.
I'd like to be able to compare each of t... |
Use a bit mask, which has the bits set that you care about. Then use the&operator to zero out everything that you don't care about. For instance, say we want to compare the lowest four bits inaandb:
```
uint16 mask = 0x000f;
if ((a & mask) == (b & mask)) {
// lowest 4 bits are equal
}
```
|
When I compile my programgcc -o myprog myprog.c, the produced binary is not stripped:
```
myprog: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically
linked (uses shared libs), for GNU/Linux 2.6.26,
BuildID[sha1]=0x2697ed96b65e8a11239af0a44abc7896954b6e20, not stripped
```
I am wondering whygccproduce... |
AFAIK Once the binary is stripped you wont be able to get the stripped information back until or unless you regenerate the binary. stripping is useful when you have memory constraints to look after. This might be the reason strip is not enabled by default in GCC.
|
Closed. This question needs to be morefocused. It is not currently accepting answers.Want to improve this question?Update the question so it focuses on one problem only byediting this post.Closed9 years ago.Improve this question
What is a concise way to write an if statement with more than many || and && in C?
I wan... |
```
if ((a == 1 || a == 2 || a == 4 || a == 6) && b == 8 && c == 10)
```
|
This is a basic C program and it doesn't use looping or conditions to print digits. I wanna know how it does what it does, along with purpose of "exit" and "main". Ismainused for recursion here?
```
#include <stdio.h>
#include <stdlib.h>
void main(int j) {
printf("%d\n", j);
(&main + (&exit - &main)*(j/1000... |
Suppose that j is 500. Then(&exit - &main)issomething(doesn't matter what) and(j/1000)is 0, so(&main + (&exit - &main)*(j/1000))(j+1)is effectivelymain(501). In contrast, if j is 1000, then(j/1000)is 1, which means(&main + (&exit - &main)*(j/1000))is the same as(&main + (&exit - &main))(which is to say,&exit), so it c... |
Suppose I have 2D array such as:
```
A[3][10];
```
Does it mean it is an array of 3 pointers? (from which everyone points to 1 of 10 elements)
So A is a pointer which points to 1 of 3 pointers?
|
No.
It means it's an array of 3 arrays, where each of these is an array with 10 elements.
If it helps, you can think of it as one big 1D array of 30 elements with compiler support that allows you to use 2D indexing (the compiler performs the necessary calculations to turn your indexes into a flat index). In fact, th... |
Let's assume that I've got such a table:
```
char *table = "abcdef\n";
```
How can I put '\n' as decimal subsituide (eg. in hex I put \x0D, in oct I put \015, but what about decimal?)
|
'/n'is not a character control, but a multi-character constant, so I assume you're talking about'\n'instead.
There is no escape notation in decimal, so simply use\n, the octal (\012or\12) or the hexadecimal (\x0a) escape notation.
Learn more about escape sequences.
|
What are the general differences between compiling a program as a static library
vs. including the source code into the program?
i.e. A program with functions that is compiled as a static library (.lib) and linked into the program vs A program with functions that is included as a source file in the main program.
St... |
I'd advocate inclusion of source code because:
Static library is more architecture depending than source code. You will need to compile it again and again.Optionally, source code allows more optimization than linking with a pre-compiled library.When examining the program it is always better to have the possibility to... |
I do not understand what is causing the memory access error here.
I made this simple example which shows my problem:
```
#include <stdlib.h>
typedef struct mycanvas {
void *pixels;
} mycanvas;
main()
{
void* testchunk;
testchunk = (void*) calloc (1024 * 768 * 4,sizeof(char));
struct mycanvas* ne... |
You have never initializednew_canvas. Most likely, you want to do this:
```
struct mycanvas new_canvas;
new_canvas.pixels=testchunk;
```
|
Consider a function
```
void f() {
assert(condition);
...
}
```
In debug mode, where asserts are enabled, the compiler is free to assumeconditionholds, since the remaining code will not be executed if it does not.
However, in release mode, I believe the compiler will only see
```
void f() {
...
}
```
an... |
This can't be done in portable C or C++.
Some compilers provide intrinsic functions such as__assume(for MSVC) and__builtin_unreachable(forGCC, ICC, andClang), that can be used for this purpose.
For example:
```
void f() {
__assume(condition); //For MSVC
/*...*/
}
void f() {
if (!condition) __builtin_un... |
Closed.This question isnot reproducible or was caused by typos. It is not currently accepting answers.This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may beon-topichere, this one was resolved in a way less likely to help future readers.Closed9 years ago.Improve... |
In the firstprintf()statement you haveUndefined Behaviour. Anything can happen. In this instance you were unlucky and got a result you think you can explain (but really you can't: it'sUB).
In the secondprintf()statement (ignoring the fact thatUBhas occurred and the whole program is thus invalid), the first element of... |
I want my thread to run forever. Somewhere in the code, if 'BYE' is received, it will kill the whole process. When I usewhile(TRUE)orfor(;;)I see 25% increment in CPU usage. sleep function is also limited. Any idea?
```
int _tmain(int argc, _TCHAR* argv[])
{
// Run the Standard Input/Output to reply to the super ... |
Why not justpthread_joinsome other thread that will also last the lifetime of the application, orpthread_cond_waita condvar that is never signalled? Those operations will block the thread "forever", unlikesleepwhich simply asks for it to be woken up "in a while".
|
This is a basic C program and it doesn't use looping or conditions to print digits. I wanna know how it does what it does, along with purpose of "exit" and "main". Ismainused for recursion here?
```
#include <stdio.h>
#include <stdlib.h>
void main(int j) {
printf("%d\n", j);
(&main + (&exit - &main)*(j/1000... |
Suppose that j is 500. Then(&exit - &main)issomething(doesn't matter what) and(j/1000)is 0, so(&main + (&exit - &main)*(j/1000))(j+1)is effectivelymain(501). In contrast, if j is 1000, then(j/1000)is 1, which means(&main + (&exit - &main)*(j/1000))is the same as(&main + (&exit - &main))(which is to say,&exit), so it c... |
Suppose I have 2D array such as:
```
A[3][10];
```
Does it mean it is an array of 3 pointers? (from which everyone points to 1 of 10 elements)
So A is a pointer which points to 1 of 3 pointers?
|
No.
It means it's an array of 3 arrays, where each of these is an array with 10 elements.
If it helps, you can think of it as one big 1D array of 30 elements with compiler support that allows you to use 2D indexing (the compiler performs the necessary calculations to turn your indexes into a flat index). In fact, th... |
Let's assume that I've got such a table:
```
char *table = "abcdef\n";
```
How can I put '\n' as decimal subsituide (eg. in hex I put \x0D, in oct I put \015, but what about decimal?)
|
'/n'is not a character control, but a multi-character constant, so I assume you're talking about'\n'instead.
There is no escape notation in decimal, so simply use\n, the octal (\012or\12) or the hexadecimal (\x0a) escape notation.
Learn more about escape sequences.
|
What are the general differences between compiling a program as a static library
vs. including the source code into the program?
i.e. A program with functions that is compiled as a static library (.lib) and linked into the program vs A program with functions that is included as a source file in the main program.
St... |
I'd advocate inclusion of source code because:
Static library is more architecture depending than source code. You will need to compile it again and again.Optionally, source code allows more optimization than linking with a pre-compiled library.When examining the program it is always better to have the possibility to... |
I do not understand what is causing the memory access error here.
I made this simple example which shows my problem:
```
#include <stdlib.h>
typedef struct mycanvas {
void *pixels;
} mycanvas;
main()
{
void* testchunk;
testchunk = (void*) calloc (1024 * 768 * 4,sizeof(char));
struct mycanvas* ne... |
You have never initializednew_canvas. Most likely, you want to do this:
```
struct mycanvas new_canvas;
new_canvas.pixels=testchunk;
```
|
Consider a function
```
void f() {
assert(condition);
...
}
```
In debug mode, where asserts are enabled, the compiler is free to assumeconditionholds, since the remaining code will not be executed if it does not.
However, in release mode, I believe the compiler will only see
```
void f() {
...
}
```
an... |
This can't be done in portable C or C++.
Some compilers provide intrinsic functions such as__assume(for MSVC) and__builtin_unreachable(forGCC, ICC, andClang), that can be used for this purpose.
For example:
```
void f() {
__assume(condition); //For MSVC
/*...*/
}
void f() {
if (!condition) __builtin_un... |
Closed.This question isnot reproducible or was caused by typos. It is not currently accepting answers.This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may beon-topichere, this one was resolved in a way less likely to help future readers.Closed9 years ago.Improve... |
In the firstprintf()statement you haveUndefined Behaviour. Anything can happen. In this instance you were unlucky and got a result you think you can explain (but really you can't: it'sUB).
In the secondprintf()statement (ignoring the fact thatUBhas occurred and the whole program is thus invalid), the first element of... |
I want my thread to run forever. Somewhere in the code, if 'BYE' is received, it will kill the whole process. When I usewhile(TRUE)orfor(;;)I see 25% increment in CPU usage. sleep function is also limited. Any idea?
```
int _tmain(int argc, _TCHAR* argv[])
{
// Run the Standard Input/Output to reply to the super ... |
Why not justpthread_joinsome other thread that will also last the lifetime of the application, orpthread_cond_waita condvar that is never signalled? Those operations will block the thread "forever", unlikesleepwhich simply asks for it to be woken up "in a while".
|
I have a question regarding recv (C, Android).
Is recv guaranteed to return a complete UDP datagram when it returns?
In my case I am using recv to read RTP packets from a socket. The expected length of each RTP packet is 172 (160 bytes for payload and 12 for the header). However, I'm not sure whether I have a guaran... |
Per POSIX,recvreturns the entire UDP packet, unless and error occurs or the buffer is too small for the entire packet. You can detect this by setting theMSG_TRUNCflag, which causesrecvto return the frame'sactualdata length, which you can compare to the buffer size.
|
Is there any information in theelf headersthat show where_edatais located?
Am aware I can search the whole image for the symbol but would like to know where it is from information in the headers...
|
The virtual address (p_vaddr) of the data segment (thePT_LOADsegment that's writable) plus its size on disk (p_filesz) gives you the equivalent of_edataif you mean for it to be just past the end of initialized data and before bss. If you also want to count bss, use the full size in memory (p_memsz) instead of the size... |
I am trying to run 'gtags -v' to build index for my large code base.
from this link:Emacs as an IDE for large C++ projects
My question is how can I tell gtags to skip walk into some directories (not necessary top level) "e.g. 'out', '.git', 'tools'?
Thank you.
|
You can add the file/dirs you want to exclude to your ~/.globalrc file in thecommon: skip:section.
For example:
common:\:skip=HTML/,HTML.pub/,tags,TAGS,ID,y.tab.c,y.tab.h,gtags.files,cscope.files,cscope.out,cscope.po.out,cscope.in.out,SCCS/,RCS/,CVS/,CVSROOT/,{arch}/,autom4te.cache/,*.orig,*.rej,*.bak,*~,#*#,*.swp,*.... |
We know that each thread has its own stack. Where are these stacks allocated? I read some documents, it seems the stacks are allocated from heap when a thread is created. Does this make sense? Thanks in advance!
|
C doesn't specify where the memory comes from. It's dependent on the OS and the C runtime library. Either thread stack memory is allocated by the operating system as part of the system call that creates a thread, or the process creating the thread has to provide memory from the application heap to be used as thread st... |
I get most of pointer arithmetic, until I saw the following:
```
int x[5];
sizeof(x) // equals 20
sizeof(&x) // equals 4 -- sizeof(int))
```
So far I give this the semantic meaning of:
pointer to N-element array of T -- in the case of&x
However when doingx+1we increment withsizeof(int)and when we do&x+1we incremen... |
x is of type int[5], so &x is a pointer to an integer array of five elements, when adding 1 to &x you are incrementing to to next array of 5 elemnts.
|
Closed. This question needs to be morefocused. It is not currently accepting answers.Want to improve this question?Update the question so it focuses on one problem only byediting this post.Closed9 years ago.Improve this question
I was browsing the go source and I wanted to build it as a standalone linker for osx that... |
The linker is already a standalone tool. You can see it by running
```
go tool -n 6l
```
which will print the location of the6l(x86 64 bit linker) executable.
The source code of6lcan be found inGOROOT/src/cmd/6l.
In that directory you can usemaketo build it.
|
I'd just like to ask what's the difference in execution time when:
a) We have variables declared inmain()and send them in functions using arguments
b) We have global variables and access them directly from functions with no arguments
The thing is I started writing few aps and just saw a few discussions about this, ... |
Passing parameters to function involvesusuallyone of two assembler instructions:push param(and laterpop param) ormov ax, param. Since processor is able to do (a lot) more in a second, such "optimization" mostly probably will go unnoticed (a few ms on the whole program is below the error margin)
Using global variables... |
I understand that character variable is declared likechar C;in C. But what range of values can a character variable hold?
|
The answer really is:It depends on your platform.
Fortunately, this is all defined in your implementation's<limits.h>. Here you will find constants which define the valid range for achar, as well as all of the other standard data types.
Acharis one byte, which isusually8 bits. Technically, acharisCHAR_BITbits. For s... |
I am working on an Ubuntu v12.04 machine with IBM DB2 v10.1 Enterprise edition on it. The DB2 installation directory is located at:
```
/opt/ibm/db2/V10.1/
```
But under the include/ directory there is only the following file:
```
ls /opt/ibm/db2/V10.1/include/
asn.h
```
Where are the rest of the C headers located... |
You should have selected the Application Development Tools package during the server installation -- they are not installed by default. You can rerun the server installation or install the IBM Data Server Client (http://www-01.ibm.com/support/docview.wss?uid=swg27016878).
|
Closed.This question isnot reproducible or was caused by typos. It is not currently accepting answers.This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may beon-topichere, this one was resolved in a way less likely to help future readers.Closed9 years ago.Improve... |
```
cout << r1 << endl;
cout << r1 << endl;
// ^-- You're printing r1 twice
```
|
Closed. This question needsdetails or clarity. It is not currently accepting answers.Want to improve this question?Add details and clarify the problem byediting this post.Closed9 years ago.Improve this question
Is there a way to intercept a C function call on a binary (e.g: write to a file) in Python?
I need to exec... |
The way to go is to create a named pipe. Iflogfileis the name of your logfile:
```
import os
import subprocess
LOGFILE = 'somefile.log'
if not os.path.exists(LOGFILE):
os.mkfifo(LOGFILE)
proc = subprocess.Popen([YOUR_PROGRAM])
with open(LOGFILE) as log:
data = log.read() # process your data
proc.wait()
``... |
Closed.This question does not meetStack Overflow guidelines. It is not currently accepting answers.Questions asking us torecommend or find a tool, library or favorite off-site resourceare off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead,describe the problemand what has been do... |
I have used gnuplot with C before. It should satisfy what you are trying to do.
See here for information about gnuplot and C.
|
I built MongoDB C drivers from a tar distro on OSX (Mavericks). Built ok and installed to /usr/local/lib along with libbson. Made links to /usr/lib.
It built libbson-1.0.0.dylib, libbson-1.0.la, libmongoc-1.0.0.dylib, and libmongoc-1.0.la.
Not "*.a" files built tho, for whatever reason, by the makefile.
I added /u... |
Have you tried to add "-llibbson-1.0.0 -llibbson-1.0 -llibmongoc-1.0" to the linker flags ?
|
Is there a case, when calling of sendto() on UDP socket returns 0 and if yes, what does it mean? Manual only says, that on error it's -1, otherwise it's number of bytes sent.
|
You cansend()/sendto()a zero-byte message on a domain datagram or UDP socket, in which case a returned length of 0 bytes is correct. If you are seeing this unexpectedly, verify yourlenparameter in yoursendto(int fd, void const *buf, size_t len, int flags, struct const *dest, sockles_t addrlen)call.
|
```
#include <stdio.h>
#include <string.h>
main()
{
int i=-1, j=-1, k=0, l=2,m;
m = i++&&j++&&k++||l++;
printf("%d%d%d%d%d", i, j, k, l, m);
}
```
Output:
00131
I am confused how the expression is getting evaluated.
|
All that really matters here is the||. Sincel++evaluates to the boolean1(true), the entire statement is true. Somis 1, and the rest are just their original values plus one for the post increment after they are evaluated.
You're evaluating the boolean expression:
```
((-1 && -1) && 0) || 2
```
As an aside, your ... |
This question already has answers here:How to change a variable in a calling function from a called function? [duplicate](3 answers)Closed9 years ago.
I'm trying to write a function that changes screen in my simple C snake game.
```
main(){
int stage = 0;
...
..
.
while(stage!=0){
//if snake hits wall
... |
stageis passed by value tochangeStage.stage = 1only changes the local value ofstageinchangeStage, not the value ofstageinmain. You have to pass a pointer instead:
```
while (stage != 0) {
changeStage(&stage);
}
void changeStage(int *stage) {
*stage = 1;
}
```
|
```
int n = argv[i][j];
n = n + (int)argv[1];
/* I'm pretty sure the above part that is wrong. What I was hoping that this
would do is take the number the person put in and increase n by that number but
it isnt working*/
printf("%d\n", n);
```
i = the string numbers of the argumentj = the characters of the stri... |
argv[1]is a string (i.e, a null-terminated char array), casting it tointdoesn't give the result you expected
You should useatoito do the job. Or better, usestrtolto get better stability.
|
Closed.This question isnot reproducible or was caused by typos. It is not currently accepting answers.This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may beon-topichere, this one was resolved in a way less likely to help future readers.Closed9 years ago.Improve... |
```
cout << r1 << endl;
cout << r1 << endl;
// ^-- You're printing r1 twice
```
|
Closed. This question needsdetails or clarity. It is not currently accepting answers.Want to improve this question?Add details and clarify the problem byediting this post.Closed9 years ago.Improve this question
Is there a way to intercept a C function call on a binary (e.g: write to a file) in Python?
I need to exec... |
The way to go is to create a named pipe. Iflogfileis the name of your logfile:
```
import os
import subprocess
LOGFILE = 'somefile.log'
if not os.path.exists(LOGFILE):
os.mkfifo(LOGFILE)
proc = subprocess.Popen([YOUR_PROGRAM])
with open(LOGFILE) as log:
data = log.read() # process your data
proc.wait()
``... |
Closed.This question does not meetStack Overflow guidelines. It is not currently accepting answers.Questions asking us torecommend or find a tool, library or favorite off-site resourceare off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead,describe the problemand what has been do... |
I have used gnuplot with C before. It should satisfy what you are trying to do.
See here for information about gnuplot and C.
|
I built MongoDB C drivers from a tar distro on OSX (Mavericks). Built ok and installed to /usr/local/lib along with libbson. Made links to /usr/lib.
It built libbson-1.0.0.dylib, libbson-1.0.la, libmongoc-1.0.0.dylib, and libmongoc-1.0.la.
Not "*.a" files built tho, for whatever reason, by the makefile.
I added /u... |
Have you tried to add "-llibbson-1.0.0 -llibbson-1.0 -llibmongoc-1.0" to the linker flags ?
|
Is there a case, when calling of sendto() on UDP socket returns 0 and if yes, what does it mean? Manual only says, that on error it's -1, otherwise it's number of bytes sent.
|
You cansend()/sendto()a zero-byte message on a domain datagram or UDP socket, in which case a returned length of 0 bytes is correct. If you are seeing this unexpectedly, verify yourlenparameter in yoursendto(int fd, void const *buf, size_t len, int flags, struct const *dest, sockles_t addrlen)call.
|
In my question aboutAnalysis of float/double precision in 32 decimal digits, one answer said to take a look at__float128.
I used it and the compiler could find it, but I can not print it, since the complier can not find the headerquadmath.h.
So my questions are:
__float128is standard, correct?How to print it?Isn'tq... |
Using the boost library was the best answer for me:
```
#include <boost/multiprecision/float128.hpp>
#include <boost/math/special_functions/gamma.hpp>
using namespace boost::multiprecision;
float128 su1= 0.33333333333333333q;
cout << "su1=" << su1 << endl;
```
Remember to link this library:
```
-lquadmath
```
|
I have a database, I can see it with phpMyAdmin.
But when I try to connect in my C program it fail and mysql_error only return :
```
Unknown database 'database-name'
```
There is no spelling mistake so why doesn't it work ?
EDIT : here is the code used :
```
if(mysql_real_connect(&mysql, address, username, passwor... |
I tried it on my own MySQL version, it worked, after re-installing MySQL on the destination computer it worked. Sorry for the disturbance.
|
I am using Xcode to learn C. I made a project named Learn C, and I would like this to contain many exercises, like ex11.c, ex12.c, etc. However, this does not work, because all my exercises need the main function, but only main.c can have it.
In Eclipse, I would be able to make a workspace named Learn C, and have man... |
You can do this in Xcode as well. For each exercise, you need to create a new target. To do that, open your Xcode project, click on the Project Navigator tab, and select the project. Then, from the "Editor" menu, select "Add Target". If you're working with examples from a book or web page that isn't Mac-specific (or i... |
EDIT: NOT HOMEWORK, i am trying to solve a test from past years, just learning.
I have this function, and would like to know what steps to take in order to transform it into a recursive one.
This is my function, it sums the N first odd numbers:
```
4^2 = 1+3+5+7 = 16;
int quadIT(int n){
int x=0;
int z=1;
... |
I don't want to give you a straight answer, but rather show you roughly how to do it.
These two are equivalent:
```
int foo(int n){
if (n == 0){
return something
} else {
do something
return foo(n-1);
}
}
while(n > 0){
do something
n--;
}
```
|
I'm trying to read ints from stdin, but i don't know the length. I tried this but I have no idea why it doesn't work
```
#include <stdio.h>
#include <stdlib.h>
int main()
{
int *arr = (int *) malloc(sizeof(int));
int sizeCounter = 0;
int tmp = 0;
while(scanf("%d", &tmp) != EOF)
{
ar... |
This line is wrong.
```
arr = (int *) realloc(arr, sizeof(arr)+sizeof(int));
```
sizeof(arr)+sizeof(int)is a constant. It is equal tosizeof(int*)+sizeof(int).
What you need is:
```
arr = (int *) realloc(arr, (sizeCounter+1)*sizeof(int));
```
|
Working on this little piece of code, but for some reason it keep crashing the whole time.
Anyone got an idea what i'm doing wrong
```
char *str;
printf("Enter a string\n");
gets(str);
printf("The size of the string is %d", strlen(str));
system("PAUSE");
return 0;
```
|
You have not allocated any memory forstr. Declare a buffer, for examplechar str[50], but be aware ofbuffer overflows.
|
Closed. This question needsdetails or clarity. It is not currently accepting answers.Want to improve this question?Add details and clarify the problem byediting this post.Closed9 years ago.Improve this question
I want to find best 3 value from an array where i got array from input.how many element will be in the arra... |
```
Begin
Create storage for three elements of the array
Load the storage area with the first three elements of the array
Iterate through the array, starting with the fourth element:
If the current element in the array is larger than any of the three elements in the storage:
Replace the... |
I have a function divided between a header and source files as follows,
In the header file:
```
uint8_t SoundEffects(uint8_t EffectType,uint8_t RecordedSample);
```
In the source file :
```
uint8_t SoundEffects(uint8_t EffectType,uint8_t RecordedSample)
{
// some code
}
```
Generates the following error
Soun... |
Make sure you haven't#defined the tokenSoundEffectsto something else already.
|
I have this code
```
char binary[] = "0001001010000011";
long number = strtol(binary, NULL, 16);
printf("%x", number);
```
I want to convert the string into a hex number. the answer is 1283, but i am getting DF023BCF what am i doing wrong?
|
The base you specify tostrtolis the base to use to parse theinput, not the output (which instead is specified by the%x). IOW, that code says tostrtolto parse0001001010000011as if it were a hexadecimal number (and, by the way, it results in overflow).
|
I have a method in a .c file that returns the modified time of a file.
```
int lastModifiedTime(char *filePath)
{
struct stat attrib;
stat(filePath, &attrib);
char datestring[256];
struct tm *tm = localtime(&attrib.st_mtime);
strftime(datestring, sizeof(datestring), "%s", tm);
return atoi(date... |
According to this (and your error):http://www.cplusplus.com/reference/ctime/strftime/
%sisn't a supported format option. I'm not sure what you're using%sfor, but maybe%Sis what you're looking for.
|
I've a little problem with my code, why when I use printf on string1 (last line), it doesn't give me what I wrote for this variable ?
For example if I wrote : asdfgh, string1 give me something weird like : @>>..
Any idea ?
Thanks for help.
```
int main()
{
int length;
int i = 0;
char string1[100];
... |
You have few problems there:
1) Should use%sfor printing string.2) Terminate the string with NULL terminator (It's not a string until then ;)3) use a standard prototype for main(), such as:int main(void)
|
I recently found out that reading SUB character(ASCII code 26) usingfgetc(),fscanf()(Common functions in C to scan characters) makes both of the interpret it as an error and return EOF. I was wondering if there is any way to detect SUB character so that I can distinguish between the 'real' end of file and the apparen... |
Open the file(s) in binary mode.
```
...fopen("filename", "rb")...
```
Don't forget that the library code no longer translates "newlines" in binary mode. If the file has"\r\n"pairs to end lines, you'll get both'\r'and'\n'when reading the file.
|
This question already has answers here:malloc an array of struct pointers(4 answers)Closed9 years ago.
I couldn't find answer of the exact question, since the condition is a bit more specific:
How can i allocate array of struct pointers.
```
typedef struct COORDS
{
int xp;
int yp;
} coord;
coord** xy;
```
i wa... |
```
coord** new = malloc (500 * sizeof (coord*));
int idx = 0;
for(; idx < 500; ++idx)
new [idx] = malloc (460 * sizeof (coord));
```
|
I would like to create a buffer and then write random data in it.
here's what I got so far
```
uint8_t size = 10;
int* buffer = malloc (size*sizeof(uint8_t));
int i;
for (i=0; i<size; i++)
{
buffer[i]=(rand()%100)+1;
}
printf("Content of buffer = %d\n", buffer);
```
the result is wandom yes but only 8 numbers inste... |
You need
```
malloc (size*sizeof(int))
```
instead of
```
malloc (size*sizeof(uint8_t))
```
or maybe you need
```
uint8_t* buffer = malloc (size*sizeof(uint8_t));
```
It depends if you want a buffer of 10intof a buffer of 10uint8_t.
For printing the content of the buffer use:
```
for (i = 0; i < size; i++)
{
... |
I'm trying to do a 2d wchar_t array initialization using that code:
```
const wchar_t* e[6][]={
{ L"ç", L"$^^" },
{ L"ç"},
{ L"ç", L"$^^" },
{ L"ç", L"$^^" },
{ L"ç", L"$^^" },
{ L"ç", L"$^^" }
};
```
but I get an error when compiling:
```
array type has incomplete element type
```
so what'... |
The only optional length when declaring an array is the first one, so in your case you need to specify the second one:
```
const wchar_t *e[][2] ;
```
Moreover be carefull that the array in second position is filled withNULLvalue at the end:
```
{L"ç"}
// is in fact
{L"ç", NULL}
```
|
Consider this code
```
NSInteger q = 2048;
BOOL boolQ = q;
NSLog(@"%hhd",boolQ);
```
After execution boolQ is equal 0. Could someone explain why is this so?
|
BOOL probably is implemented ascharoruint8_t/int8_t, as"hh"prints half of the half of an integer. which typically is a byte.
Converting tocharis taking the lowest 8bit of2048(=0x800) and gives you0.
The proper way to convert any integer to a boolean value is:
```
NSInteger q = some-value;
BOOL b = !!q;
```
|
I want to assign something to a variable like this:
```
rtpArray[bn].ts06_timestamp = rtpArray[bn].timestamps_shm_ptr_aux[SCPAD_TS06];
```
The thing is,rtpArray[bn].ts06_timestampthis is of a type calledutdc_samplesthat is bigger thanchar, andrtpArray[bn].timestamps_shm_ptr_auxis an array ofchar.
My question is, wi... |
IfrtpArray[bn].timestamps_shm_ptr_auxis an array of chars, thenrtpArray[bn].timestamps_shm_ptr_aux[SCPAD_TS06]is a singlecharvalue. There's no reason why you can't assign this to a larger integer type.
|
I absolutely love C language, so I want to learn programming Windows phone 8 with it. Does Microsoft support C language (I don't like C++, so please don't include it here)? If not, do you know any mobile platform which supports C. Also please don't include iOS here because I don't have enough money to buy a Mac or iPh... |
You can program for Maemo (Nokia N900), MeeGo, Tizen OS (Samsung (soon to be released)), QNX (BlackBerry Playbook, BlackBerry 10), Ubuntu Touch etc. in C. For Android there is NDK, though that wouldn't be the default choice unless you are build games and such.For Windows Phone, C++ is the default native choice, though... |
I'm trying to setenv a new environement variable with setenv().
But I noticided that setenv() function set my new environement variable only if I use the environement "extern char **environ"
But I want to use the argument of the main() : "char **envp".
Here's the code I tried to do for setting in envp, but as you w... |
setenv() is documented to not be allowed to change the optionalenvpargument to main.
If you need to iterate through all the environment variables, use theextern char **environvariable.
See alsothis question.
|
If on linux I try to compile c code in the standard way
```
gcc -myprog.c
```
the generated binary uses only the base CPU features, since the modern CPUs have a lot of special features to increase the performances, like AVX, AVX2, SSE3, SSE4 etc. according the model
Since I want targeting only a specific CPU type (... |
Look at the -march and -mtunegcc flags
|
I am reading a nano second value and want to store it in a specific variable, so that I wont loss data. Could someone tell me what could be the data type ??
example :
```
struct timespec ts;
getrawmonotonic(&ts);
end_time = timespec_to_ns(&ts);
```
what could be the data type for end_time ??
|
In C++, this would bestd::chrono::nanoseconds. For example, to find the length of (wall-)time taken to execute some code, you could write:
```
auto start = std::chrono::system_clock.now();
//do some things
//...
auto end = std::chrono::system_clock.now();
std::chrono::nanoseconds nanoseconds_taken =
duration_ca... |
Background
Im trying to determine character codes for some national diactric letters.
Problem
Is something is wrong with my code?
```
char a = "a"; // "a" ascii code is 97
char buffer[8];
itoa(buffer,(int)a, 10);
print(buffer); // but it prints "252" instead of "97"
```
|
The character code for'a'is indeed 97, but"a"is of typechar *. Single quotes'encode characters, double quotes"encode string literals.
Try
```
char a = 'a';
```
|
I'm trying to write a function for printing text in C for PIC microcontrollers (I think it's based on gcc).
```
void print(char[] text);
void print(char[] text)
{
for(ch = 0; ch < sizeof(text); ch ++)
{
do_something_with_character(text[ch]);
}
}
```
and call it like this:
```
print("some text")... |
The correct syntax is
```
void print(char text[])
```
or
```
void print(char *text)
```
Inprint(), you cannot usesizeofoperator to find out the length of stringtext, you need to usestrlen()(include<string.h>first) or test whethertext[ch]is\0.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.