Posts by Rodrigo Rigotti • 12,139 points
344 posts
-
6
votes0
answers178
viewsQ: How to detect and read text in an image?
I intend to develop an application through which an image submitted by the user should be processed and its text blocks detected and read. How should I do it?
image-processingasked Rodrigo Rigotti 12,139 -
1
votes1
answer87
viewsA: Search mongodb in PHP
Your reference to the field is wrong. Instead of _id.fb_id.created_time.date, use 1098582396886267_1098592810218559.created_time.date. $user = $c_users ->find([…
-
0
votes1
answer159
viewsA: Legacy PHP and Doctrine: Duplicate Definition of column
What I would do is create a relationship Many-to-Many between users and groups. Thus, it is implied that: A user can be part of several groups; A group may have several users. Thus, these would be…
-
1
votes1
answer137
viewsA: How to display images in symfony
The correct form is the second: <img src="{{ asset('imagens/dev-total-logo.png') }}" /> There are several reasons for this. The first is that this way your application can display the image…
symfonyanswered Rodrigo Rigotti 12,139 -
1
votes1
answer40
viewsA: Symfony3 project is being accessed by mysite.com/web instead of mysite.com
So that you can access the site without being by the way /web, just change the setting DocumentRoot host on Apache. The current configuration is probably pointing to the project folder. Put /web at…
-
1
votes1
answer227
viewsA: how to write the output of var_dump($_FILES) to monolog;
If you’re inside a controller, just pick up the service logger and use it to record log in the log file: $logger = $this->get('logger'); $logger->info(var_dump($var, true)); If you are trying…
-
1
votes1
answer124
viewsA: How do I download via Github URL or SSH
Since this repository does not have a file composer.json, you specify it as a package instead of a repository. I changed here and it worked normally: { "name": "site.com.br", "authors": [ { "name" :…
-
1
votes1
answer1025
viewsA: API Instagram - Search for public photos by TAG
The endpoint that you’re looking for is this: https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN Take a look at official Instagram API documentation.…
-
0
votes2
answers134
viewsA: Select in table records with Mxn relation
Just make a INNER JOIN between the three tables: SELECT r.id, r.nome FROM tb_usuario u INNER JOIN tb_regional_usuario ru ON ru.tb_usuario_id = u.id INNER JOIN rb_regional r ON r.id =…
-
2
votes2
answers309
viewsA: How to use REST to validate XML receiving via POST
Your question is quite broad, so I’ll explain "on top" what you can do if the idea is to actually use Symfony 3: create your Symfony 3 project with the command composer create-project…
-
1
votes2
answers589
viewsA: Branch x Checkout x Merging automatico for master
The code you modified is not yet part of the branch master. It is for the time being listed as code modified, but is not in the staging or in the repository (whether local or remote). So you can…
-
3
votes2
answers698
viewsA: How to send form parameters instead of angular JSON?
You need to pass the header Content-Type: application/x-www-form-urlencoded in the request, in addition to rewriting the body of the request so that no JSON is transmitted. Therefore, in the method…
-
2
votes1
answer105
viewsA: File does not open or is not recognized on the Fedora Linux localhost?
The file name is incorrect. Are you trying to include: gerenciar-premios-imprensa.phtml ... but the name with which you saved the file is: gerenciar-premios-impresa.phtml We’re missing a n in the…
-
1
votes1
answer37
viewsA: Generate entity using a given connection
When you create Doctrine connection settings within a Symfony project, you can determine different Entity managers for each connection. For each Entity manager, it is possible to discriminate the…
-
1
votes1
answer404
viewsA: How to set up remote GIT on Amazon AWS?
You need to create the repositories locally, commit the files, upload to the remote repository and only then clone them in your AWS instance. First of all, create remote repositories in your service…
-
0
votes2
answers616
viewsA: Phpstorm stopped recognizing some files. php
You have renamed the file with the extension .txt. Just select it, go on Refactor > Rename and rename it back with the extension .php.
phpstormanswered Rodrigo Rigotti 12,139 -
0
votes3
answers1797
viewsA: How to send Jquery Json array to PHP
The content that is sent to the server goes on body request. That is, you can read it like this: $conteudo = file_get_contents('php://input'); One can also use the constant STDIN, which amounts to…
-
7
votes1
answer3557
viewsQ: Is there a difference when merging two arrays with array_merge or with "+"?
I used to unite two arrays, in PHP, using the function array_merge: $arr3 = array_merge($arr1, $arr2); However, more recently I have seen unions of arrays with + (plus sign): $arr3 = $arr1 + $arr2;…
-
0
votes2
answers57
viewsA: Using Innerjoin with Limit
Do so: class AppsRepository extends EntityRepository { public function findNewClients() { return $this ->getEntityManager() ->createQuery(' SELECT AppBundle:Apps a JOIN a.clients c WHERE…
-
0
votes1
answer78
viewsA: PHP and Javascript - Adjusting Mysql Table Search (Doctrine Query)
Quotes are missing in the function buscaBanco. The way it is, you’ll be error syntax. function buscaBanco(numero){ if (numero == '') { alert('Nenhum resultado encontrado!');…
-
5
votes1
answer182
viewsA: HTML does not run when inside a PHP variable
The HTML code is coming encoded from the database. You need to unmode it. Instead of doing like this: echo $linha->dm_codhtml; ... do so: echo html_entity_decode($linha->dm_codhtml);…
-
0
votes1
answer66
viewsA: Use two fields in a Manytoone relation
I think the easiest thing is to find the object of the type Dealerships for EntityManager and, if it is not null, assign it to the object of type Clients. First we look for Democracy: $dealership =…
-
0
votes1
answer29
viewsA: Change form before submitting it
When I run into problems where I cannot expose values in my application forms, what I do is simply fill in these values after the submitted form has been validated. Then the code would look like…
symfony-2answered Rodrigo Rigotti 12,139 -
4
votes1
answer140
viewsA: Adjustable and angular API
You need to configure the CORS headers for the request from the browser to work properly. All modern browsers make a request known as preflight before the requisition or posting of data itself, in…
-
2
votes1
answer1015
viewsA: Sum of xml file values
Just use preg_match_all to find all the lines that fit into a particular pattern (including the character 3 in fifth position), and then sum all values found in eighth position of each line:…
-
1
votes2
answers150
viewsA: Map array on function return - PHP
This resource you want is called array Dereferencing, and is available in PHP 5.4 up. According to PHP documentation: As of PHP 5.4 it is possible to array dereference the result of a Function or…
-
0
votes1
answer46
viewsA: Upload image using ajax
You need to instantiate an object of the type FormData, put the file inside it and then refer it to $.post: $("#add").click(function() { var formData = new FormData(); formData.append('file',…
-
4
votes1
answer1324
viewsA: How to authenticate the application and authorize it to consume a restful API
In my view you need to implement the mechanism CORS or protection against CSRF in its application. CORS With CORS, you can define which sources are allowed to perform certain actions in your…
-
1
votes1
answer58
viewsA: Why do we use the Containerinterface when injecting @service_container as argument?
The method says it accepts objects whose class implements the interface ContainerInterface. It doesn’t mean you’re getting an instance of an interface - that would be impossible. In the case of the…
-
0
votes1
answer778
viewsA: Why do; Warning array_push() expects Parameter 1 to be array, integer Given in /var/www/html/serie/editor_temporada/Make.php on line 83?
You don’t need to put the index when using the function array_push. Just say which variable your array: array_push($valorDeLinks, $getValueLinks);…
phpanswered Rodrigo Rigotti 12,139 -
3
votes1
answer424
viewsA: How do I use a Github project as the basis for a new one?
Do the following. Clone the project and delete the folder .git then so that it doesn’t keep Git information after being cloned: git clone https://github.com/camilaavilarinho/angular-phonecat.git…
-
2
votes1
answer136
viewsA: What is considered an element in Google Matrix Distance
The very documentation already answers your question: Each query sent to the Google Maps Distance Matrix API is Limited by the number of allowed Elements, Where the number of Origins times the…
google-mapsanswered Rodrigo Rigotti 12,139 -
6
votes1
answer717
viewsA: How to disable file mode (permission) in GIT?
Just change the setting core.filemode repository: git config core.fileMode false If you want to disable this for all your user repositories, add to flag --global: git config --global core.fileMode…
-
0
votes1
answer40
viewsA: How to list all answers
Probably the error is in your stop condition loop: for ($contar = 0; $contar < $xml->avaliacao['questoes']; $contar++) { If the key questoes is a list of questions, and not the amount of them,…
phpanswered Rodrigo Rigotti 12,139 -
4
votes1
answer51
viewsA: SQL relationship
Needs to have a relational table between care and service, since the relationship between care and service is n-to-n. Basically, it would look something like this:…
relationshipanswered Rodrigo Rigotti 12,139 -
1
votes1
answer54
viewsA: I have a question regarding the installation and configuration of Composer (Phpunit)
All you need is to create a file called composer.json in the root folder of your project. The contents of the file will be as follows: { "require-dev": { "phpunit/phpunit": "dev-master" } } (PS:…
phpanswered Rodrigo Rigotti 12,139 -
1
votes1
answer33
viewsA: Unexpected token : from a URL with extension . json
The content of URL provided does not return a valid JSON. That’s why you’re having this error. Apparently, in the specific case of your problem, looks like the quotes are missing from the keys to…
-
2
votes1
answer1109
viewsA: Open() method of the undefined FPDF
According to the documentation of the FPDF, the method Open in class FPDF does not exist. That way, if you try to call it, you will receive an undefined method error.…
-
2
votes2
answers425
viewsA: What’s the difference between "require" and "require-dev"?
The list of packages in the key require contains the essential packages for your project, which must be installed in any of the environments (production, approval, tests etc.) in which it will run.…
-
1
votes4
answers473
viewsA: DNS redirection - Problem AWS service usage
Just set up a record of type CNAME: dominio.com CNAME www.dominio.com 300 (300 is the TTL, in seconds, of that record.)
-
4
votes4
answers296
viewsA: Correct way to use php’s abs function
According to the official PHP documentation, both forms are valid. What happens is that if the function you are using is not found in namespace current, there will be a fallback to the namespace…
phpanswered Rodrigo Rigotti 12,139 -
5
votes1
answer1407
viewsA: Differences between one: Linux and Windows Development Environment
The great advantage of developing in a Linux environment (or OSX, since both are Unix) is that you get very close to the environment where you would work on a server "for real". The fact that…
-
0
votes1
answer45
viewsA: How to use Paramconverter inside the controller or in service
I’d do it this way. Suppose you have the following generic routes on your CRUD: GET /{type} // lista os objetos de um determinado tipo GET /{type}/new // exibe o formulário para criação de um objeto…
-
1
votes2
answers36
viewsA: Checking for equalities between objects
The easiest way is to transform each of the objects into strings and compare them: JSON.stringify(obj1) === JSON.stringify(obj2); Source:…
-
0
votes1
answer76
viewsA: Start with same folders and different files
Do the following. Suppose your project on the server is in the folder /var/www/projeto. Clone your repository into another folder, for example, /var/www/projeto_git: git clone <repositório>…
-
2
votes2
answers961
viewsA: Best practice for empty folders in . gitignore
Depends on what you want to do: If you want folders to be versioned, even empty, create them and put a file .gitkeep, empty, in them; If you don’t need to select folders (but don’t want to commit…
-
1
votes1
answer60
viewsA: Approvals, reprovacations and room-Java media
It was missing to call the methods resultadoSala and mediaSala: public static void main(String []args){ double notas[] = new double [30]; Scanner input = new Scanner(System.in);…
javaanswered Rodrigo Rigotti 12,139 -
3
votes3
answers643
viewsA: How to mount the regular expression below
This is the droid you’re looking for: /[\d\/-]+/ Some particularities of the above list: the list \d comprises all numbers the character \/ represents a bar; if the regular expression delimiter were…
regexanswered Rodrigo Rigotti 12,139 -
1
votes2
answers321
viewsA: Friendly url between containers/Docker images
You can solve your problem through several approaches. The one I would use would be as follows. A single container would be responsible for responding to requests through the URL www.teste.com, as…
dockeranswered Rodrigo Rigotti 12,139 -
0
votes1
answer175
viewsA: Query with json type field in Doctrine 2 and Symfony 3
This depends somewhat on how your system is modeled. You are using the EntityManager to map their classes into tables, or not? If so, there is a Bundle that solves this:…