Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About PHPLazy

  • Rank

Recent Profile Visitors

417 profile views
  1. Hey Python Geeks, I need code to parse one access log file and show the ip address with count. The log file is : https://bureau-ehe.ch/logs/logs/access.log Anybody help me to parse the file in python? I want to track the repeated ips. Thanks
  2. Hey Guys. I want to implement google cloud vision api for recognise the image. Everything installed fine, I'm getting the error Google\Cloud\Core\Exception\ServiceException { "error": { "code": 403, "message": "The request is missing a valid API key.", "status": "PERMISSION_DENIED" } } 1. in C:\xampp\htdocs\vofms\vendor\google\cloud-core\src\RequestWrapper.php at line 336 327328329330331332333334335336337338339340341342343344345 case 504: $exception = Exception\DeadlineExceededException::class; break; default: $exception = Exception\ServiceException::class; break; } return new $exception($this->getExceptionMessage($ex), $ex->getCode(), $ex); } /** * Gets the exception message. * * @param \Exception $ex * @return string */ private function getExceptionMessage(\Exception $ex) 2. in C:\xampp\htdocs\vofms\vendor\google\cloud-core\src\RequestWrapper.php at line 189 – Google\Cloud\Core\RequestWrapper::convertToGoogleException(GuzzleHttp\Exception\ClientException) 183184185186187188189190191192193194195 try { return $backoff->execute($this->httpHandler, [ $this->applyHeaders($request), $this->getRequestOptions($options) ]); } catch (\Exception $ex) { throw $this->convertToGoogleException($ex); } } /** * Deliver the request asynchronously. * 3. in C:\xampp\htdocs\vofms\vendor\google\cloud-core\src\RestTrait.php at line 96 – Google\Cloud\Core\RequestWrapper::send(GuzzleHttp\Psr7\Request, []) 90919293949596979899100101102 try { return json_decode( $this->requestWrapper->send( $this->requestBuilder->build($resource, $method, $options), $requestOptions )->getBody(), true ); } catch (NotFoundException $e) { if ($whitelisted) { throw $this->modifyWhitelistedError($e); } 4. in C:\xampp\htdocs\vofms\vendor\google\cloud-vision\src\Connection\Rest.php at line 59 – Google\Cloud\Vision\Connection\Rest::send('images', 'annotate', ['requests' => [['image' => ['content' => '/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBD...'], 'features' => [['type' => 'FACE_DETECTION']]]]]) 535455565758596061 /** * @param array $args */ public function annotate(array $args) { return $this->send('images', 'annotate', $args); } } 5. in C:\xampp\htdocs\vofms\vendor\google\cloud-vision\src\VisionClient.php at line 272 – Google\Cloud\Vision\Connection\Rest::annotate(['requests' => [['image' => ['content' => '/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBD...'], 'features' => [['type' => 'FACE_DETECTION']]]]]) 266267268269270271272273274275276277278 foreach ($images as $image) { $requests[] = $image->requestObject(); } $res = $this->connection->annotate([ 'requests' => $requests ] + $options); $annotations = []; if (isset($res['responses'])) { foreach ($res['responses'] as $response) { $annotations[] = new Annotation($response); } 6. in C:\xampp\htdocs\vofms\vendor\google\cloud-vision\src\VisionClient.php at line 229 – Google\Cloud\Vision\VisionClient::annotateBatch([Google\Cloud\Vision\Image], []) 223224225226227228229230231232233234235 * @param Image $image The image to annotate * @param array $options Configuration options * @return Annotation */ public function annotate(Image $image, array $options = []) { $res = $this->annotateBatch([$image], $options); return $res[0]; } /** * Annotate a set of images. * 7. in C:\xampp\htdocs\vofms\frontend\themes\admin_lte\site\index.php at line 22 – Google\Cloud\Vision\VisionClient::annotate(Google\Cloud\Vision\Image) 16171819202122232425262728 $image = $vision->image( fopen('C:\xampp\htdocs\vofms\frontend\themes\admin_lte\images\1.jpg', 'r'), ['faces'] ); $annotation = $vision->annotate($image); // Determine if the detected faces have headwear. foreach ($annotation->faces() as $key => $face) { if ($face->hasHeadwear()) { echo "Face $key has headwear.\n"; } 8. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\View.php at line 348 – require('C:\xampp\htdocs\vofms\frontend\t...') 9. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\View.php at line 257 – yii\base\View::renderPhpFile('C:\xampp\htdocs\vofms\frontend\t...', ['dataProvider' => yii\data\ActiveDataProvider]) 10. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\View.php at line 156 – yii\base\View::renderFile('C:\xampp\htdocs\vofms\frontend\v...', ['dataProvider' => yii\data\ActiveDataProvider], frontend\controllers\SiteController) 11. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\Controller.php at line 384 – yii\base\View::render('index', ['dataProvider' => yii\data\ActiveDataProvider], frontend\controllers\SiteController) 12. in C:\xampp\htdocs\vofms\frontend\controllers\SiteController.php at line 89 – yii\base\Controller::render('index', ['dataProvider' => yii\data\ActiveDataProvider]) 83848586878889909192939495 $dataProvider = new ActiveDataProvider([ 'query' => Offenses::find(), ]); return $this->render('index', [ 'dataProvider' => $dataProvider, ]); } /** * Displays a single Offenses model. * @param integer $id * @return mixed 13. frontend\controllers\SiteController::actionIndex() 14. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\InlineAction.php at line 57 – call_user_func_array([frontend\controllers\SiteController, 'actionIndex'], []) 15. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\Controller.php at line 157 – yii\base\InlineAction::runWithParams(['r' => 'site/index']) 16. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\Module.php at line 528 – yii\base\Controller::runAction('index', ['r' => 'site/index']) 17. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\web\Application.php at line 103 – yii\base\Module::runAction('site/index', ['r' => 'site/index']) 18. in C:\xampp\htdocs\vofms\vendor\yiisoft\yii2\base\Application.php at line 386 – yii\web\Application::handleRequest(yii\web\Request) 19. in C:\xampp\htdocs\vofms\frontend\web\index.php at line 17 – yii\base\Application::run() 11121314151617 require _DIR_ . '/../../common/config/main.php', require _DIR_ . '/../../common/config/main-local.php', require _DIR_ . '/../config/main.php', require _DIR_ . '/../config/main-local.php' ); (new yii\web\Application($config))->run() Where I can set GOOGLE_APPLICATION_CREDENTIALS environment variable in Yii2 framework.
  3. Hey Guys, I'm currently in a program managed by IT Department of India. My topic is Vehicle Offence Management System. Unfortunately I failed with android finger print scanning. I need to record face of every individual when registering offence and I need to retrieve data when the same face is captured. is there is any Solution in PHP ??? for matching 2 faces ? Thanks
  4. PHPLazy

    Extract Data From JSON Using PHP

    Can you give one example
  5. Hi, Anybody can help me to extract data from son using php {"location":{"woeid":2293962,"city":"Kasaragod","region":" KL","country":"India","lat":12.5174,"long":74.990662,"timezone_id":"Asia/Kolkata"},"current_observation":{"wind":{"chill":80,"direction":338,"speed":11.81},"atmosphere":{"humidity":70,"visibility":10.0,"pressure":29.8,"rising":0},"astronomy":{"sunrise":"6:54 am","sunset":"6:35 pm"},"condition":{"text":"Clear","code":31,"temperature":80},"pubDate":1549638000},"forecasts":[{"day":"Fri","date":1549564200,"low":76,"high":85,"text":"Sunny","code":32},{"day":"Sat","date":1549650600,"low":76,"high":85,"text":"Sunny","code":32},{"day":"Sun","date":1549737000,"low":75,"high":85,"text":"Sunny","code":32},{"day":"Mon","date":1549823400,"low":76,"high":87,"text":"Mostly Sunny","code":34},{"day":"Tue","date":1549909800,"low":76,"high":89,"text":"Sunny","code":32},{"day":"Wed","date":1549996200,"low":77,"high":88,"text":"Partly Cloudy","code":30},{"day":"Thu","date":1550082600,"low":76,"high":89,"text":"Mostly Sunny","code":34},{"day":"Fri","date":1550169000,"low":76,"high":86,"text":"Sunny","code":32},{"day":"Sat","date":1550255400,"low":76,"high":85,"text":"Sunny","code":32},{"day":"Sun","date":1550341800,"low":74,"high":85,"text":"Sunny","code":32}]} How to extract data of "current_observation" Thanks
  6. Means. We need to create different directory for different users?
  7. Cool gizmola! Got some points and ideas. Let me ask one thing for building apk we need to set different que? Because users input necessary details to build apk such as Icon, appname, packages name, version code, splash, We store these details into our global database and make a unique global path for every users. Once user build apk, our code write the path into entire configuration file may be gradle.properties for Android. I don't know about Apache Cordova but I will learn. The question is "How we can set building apk task" for different users? Possible to call only exec() command for every user? Need to make anything before? Thanks
  8. Are you sure that these sites are using the same method to run commands from pure codes?
  9. Thank you for the informations. Okay let me say if everything is installed in our server to build the apk. Assume that Someone comes to our website interface to create an hello world app. We accept project name from the interface. In Apache Cordova the command to create project is cordova create hello com.example.hello HelloWorld This is the command to create a hello world project. My question is how we can run the entire command from our php code with the project name which is taken from user input & How we can show the response to user. If project is successfully created. Im really confused to run the command from our code. Please give me some tips for this, so i can continue.. Yii Framework is okay for this? Thanks
  10. I want to build a online "app builder" project that users can create android / iphone applications online without any coding knowledge. These sites are very common in market. They offer onclick app builder. I have skill in development of web applications using php frameworks. My question is How we can generate android apk from our server after getting the necessary information from user? (Appname, icon, packagename etc) PHP can do this entire task?, if yes any framework for that? Can you give me some basic tips to generate apk from our server? Can we genrate both android and iphone app from one single code? What are the requirements needed for the server? Anybody having skills in these areas, please help me. I need basic tips to get started this project. Thanks
  11. Anyway thanks. It works fine
  12. This works like we doing with .htaccess file ?
  13. Dear PHP Experts, I have one simple question to ask you that i have to redirect an entire site into new domain using 301 Redirect In Htaccess. Also i have to check one condition. I have variable called $country; It stores country name, I have to redirect only if the country become "INDIA" Im confused that my condition is comes in my php file & 301 redirect is in htaccess. How its possible ? Thanks IN Advance PHPLazy

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.