I've always been bad with regular expressions syntax. I am converting text into Bezier curves, polygons, etc. Part of that is identifying points in the form `(x,y)` where x and y are coordinates in a graph. I am extracting x and y as doubles and creating Point objects with those two double values. I'm having problems with the white space. I cannot assume that there will be white space and I cannot assume that there won't be white space. Here's my attempt to extract three points from a String with some random white space thrown in. String str = "( …

Member Avatar
Member Avatar
+0 forum 9

Hello there, i have problems with { "error": "invalid_grant", "error_description": "Bad Request" } " curl post request to https://www.googleapis.com/oauth2/v4/token I can't obtain new access_token... Here is my code: // These come from your client_secret.json file $clientID = "6590728998701b5184dev3d16dhgphu7b12me015bo9v.apps.googleusercontent.com"; $clientSecret = "pKAISh1d10k4vP7r1fDX20pJ"; $token_uri = 'https://www.googleapis.com/oauth2/v4/token'; // Build the URLEncoded post data $postFields = http_build_query(array( 'refresh_token' => '1\/LrjbtpDRP1rYF2rFF3Kczc5T5P0rYVsfWS3IaUqLVyg', 'client_secret' => $clientSecret, 'client_id' => $clientID, 'grant_type' => 'refresh_token', )); $ch = curl_init($token_uri); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-length:'.strlen($postFields).'', 'Content-Type: application/x-www-form-urlencoded' )); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); $response = curl_exec($ch); var_dump($response); I'm pretty sure that i'm …

Member Avatar
+0 forum 0

Hi, I wrote the following program: #include <stdio.h> #include <stdlib.h> #define TRUE = 1; #define FALSE = 0; static int *arr; static int size=0; void createSet() { arr= (int *)malloc(sizeof(int)); size=0; }/*createSet function*/ void putInSet(int num) { int *temp; size++; temp=(int *)realloc(arr,size*sizeof(int)); if(temp!=NULL) { arr=temp; } else { printf("Insufficient amount of free memory space !\nProgram will exit now."); exit(1); } *(arr+size-1)=num; }/*putInSet function*/ void printSet() { int i; for(i=0 ; i<size ; i++) { printf(i<size-1 ?"%d ":"%d\n",arr[i]); } }/*printSet function*/ int existInSet(int num) { int status=FALSE; int i=0; for(i=0 ; i<size ; i++) if(arr[i] == num) status=TRUE; return status; }/*existInSet …

Member Avatar
Member Avatar
+0 forum 1

Hello, I got an assignement: to validate a google oauth2 access token using email address.... What is the simplest way of doing it? Can anyone give me some hint? I am desperate here... trying to figure it out.. but I cannot find anything understandable... So far, I discovered how to get an API key.. (I found a sample code for a google map) and it required this API key... I am really confused... can anyone give me some hint? thanks

Member Avatar
+0 forum 0

**Hello Every body.** My toturial today how to make token input in the send data by form to the database by using php mysql it's so easily and useful . most people why use it or what's token take me to more secure. i answer : Did you ever think when you create for example add a new article you are need article name and content, However you send data usually create if statement to check the user press on the submit button after this the system will insert data to database by mysql, ok to here nice :) Now …

Member Avatar
+1 forum 0

when i log in my web site and after login if i refresh the page it gievs me message invalid token can any one know why this problem occure in joomla website

Member Avatar
Member Avatar
+0 forum 2

Maybe I'm just being dense, but I'm using [this documentation](https://developers.google.com/accounts/docs/OAuth2Login#sendauthrequest) to use Google OAuth 2 login. I'm able to successfully retrieve a JSON array that consists of the access_token, id_token, etc. The id_token is encrypted in what google calls a JWT (JSON Web Token). From what I understand, they're base 64 encoded, but base64_decode() in PHP is just giving me gibberish. What am I doing wrong??

Member Avatar
Member Avatar
+0 forum 5

I have an issue with `$_SESSION` global across a single domian, on my local machine, running PHP 5.1 build 2600 I'm creating a session in the domain root. $first_name='martin'; $second_name='thorburn'; $login_array=array("first_namet"=>$first, "second_name"=>$second); $_SESSION['login']=$login_array; When I run `print_r($_SESSION['login']);` in the root, I get the expected response "Array ( [first_name] => martin [second-name] => Thorburn ) However, when I run the same `print_r($_SESSION['login']);` in any sub-folder I get an error Notice: Undefined index: login in subfolder\test.php on line 3. I have ensured that `session_start()` is the first line of code in every file, and I ensured all my links and redirects go …

Member Avatar
Member Avatar
+0 forum 3

The End.