Skip to main content
726 votes
35 answers
2.5m views

I am parsing a string in C++ using the following: using namespace std; string parsed,input="text to be parsed"; stringstream input_stringstream(input); if (getline(input_stringstream,parsed,' ')) { ...
TheCrazyProgrammer's user avatar
183 votes
3 answers
90k views

I am trying to write a program where the names of some functions are dependent on the value of a certain macro variable with a macro like this: #define VARIABLE 3 #define NAME(fun) fun ## _ ## ...
JJ.'s user avatar
  • 1,831
132 votes
2 answers
79k views

I want to create a C macro that creates a function with a name based on the line number. I thought I could do something like (the real function would have statements within the braces): #define UNIQUE ...
DD.'s user avatar
  • 1,323
54 votes
8 answers
30k views

I have an unusual use-case I'm trying to code for. The goal is this: I want the customer to be able to provide a string, such as: "cars.honda.civic = On" Using this string, my code will set a value ...
Anthony's user avatar
  • 5,463
138 votes
16 answers
440k views

Please explain to me the working of strtok() function. The manual says it breaks the string into tokens. I am unable to understand from the manual what it actually does. I added watches on str and *...
user avatar
569 votes
8 answers
448k views

I want to understand what token-based authentication means. I searched the internet but couldn't find anything understandable.
csharpbaby's user avatar
  • 6,165
17 votes
2 answers
25k views

I have a string like this: a;b;c;d;e f;g;h;i;j 1;2;3;4;5 and i want to parse it element by element. I used nested strtok function but it just splits first line and makes null the token pointer. How ...
mausmust's user avatar
  • 173
106 votes
9 answers
244k views

I can't get my refresh token with my code. I can only get my access token, token type etc., I have followed some tutorials like putting access_type=offline on my login URL: echo "<a href='https://...
Robin Carlo Catacutan's user avatar
42 votes
7 answers
84k views

I have some text (meaningful text or arithmetical expression) and I want to split it into words. If I had a single delimiter, I'd use: std::stringstream stringStream(inputString); std::string word; ...
Sergei G's user avatar
  • 1,570
176 votes
13 answers
168k views

I have used the refresh token several times in just a short period for testing purposes, but I wonder whether Google refresh tokens ever expire? Can I use the same refresh token to get another access ...
Robin Carlo Catacutan's user avatar
93 votes
5 answers
90k views

In order to generate a 32 character token for access to our API we currently use: $token = md5(uniqid(mt_rand(), true)); I have read that this method is not cryptographically secure as it's based on ...
fire's user avatar
  • 21.5k
48 votes
12 answers
312k views

For some reason, I'm getting this error message: Uncaught SyntaxError: Unexpected token < For this line of code: title: '<img src="/images/text/text_mario_planet_jukebox.png" id="...
Qcom's user avatar
  • 19.3k
345 votes
19 answers
765k views

In my react app i am using axios to perform the REST api requests. But it's unable to send the Authorization header with the request. Here is my code: tokenPayload() { let config = { headers: ...
rakibtg's user avatar
  • 5,961
177 votes
4 answers
202k views

How can I authenticate a socket.io connection? My application uses a login endpoint from another server (python) to get a token, how can I get use that token whenever a user opens a socket connection ...
el_pup_le's user avatar
  • 12.2k
242 votes
25 answers
145k views

I was using a username password for pushing my code. It was working for several months, but suddenly I'm not able to do it and am getting this error: Username for 'https://github.com': shreyas-jadhav ...
Shreyas Jadhav's user avatar

15 30 50 per page
1
2 3 4 5
42