Posts by Antonio • 533 points
27 posts
-
5
votes1
answer647
viewsQ: Connecting Go with Mongodb using Docker
I am creating a microservice in Go, using Mongodb as a database and using the library mgo. Using Mongodb in a Docker container locally and running the application on my machine, everything works…
-
0
votes1
answer719
viewsA: How to put the value of a Php variable inside the Input in Html5
Within the echo doesn’t work <?php ?>, you can simply concatenate with the operated . in <input style="width: 25px" type="text" name="item" value="'.$x.'"> The complete code would be:…
-
1
votes2
answers903
viewsA: Exercise in C, printing of change
This problem is pretty classic college. Basically what you have to do is get the change value, and go down by the value of the available currencies, from the highest value to the lowest value…
-
0
votes0
answers57
viewsQ: Nginx configuration data type
Is there a specific name for the data format used by Nginx? For example: upstream app1_upstream { server app1:80; } server { listen 80; server_name app1.example.com; location / { proxy_pass…
-
1
votes2
answers389
viewsA: Access the main class instance from an anonymous one in PHP 7
I think there is no way to make this reference, but you can pass a parameter to the constructor of the anonymous class , for example : class MyClass { private $prop = "test"; public function test()…
-
0
votes2
answers138
viewsA: How to put several elementByID within one variable?
You can pick up all inputs using the document.querySelectorAll, after with the input array you can use the function reduce array to transform inputs into an object obj.name => value, this works…
javascriptanswered Antonio 533 -
3
votes1
answer525
views -
1
votes1
answer88
viewsA: Convert String Json CSS Inline to an array or json with PHP
You can use array_reduce to generate it at once, follows an example $wrapStyle = "padding: 90px 0px 20px 0px; background: #000000; display: block;"; $explode = explode(';',$wrapStyle); $styles =…
-
1
votes2
answers59
viewsA: Code problem
You used an Else if to check if the option is right, Voce can check on all attempts if the attempts are over var chute = document.getElementById("chute") var tentativa =…
-
3
votes2
answers3258
viewsA: Point domain to a Docker container with apache
I use Docker in production, and went through the same problem, found the solution in the container jwilder/nginx-proxy who proxy between the VIRTUAL_HOST and the containers , the github page for the…
-
0
votes2
answers233
viewsA: Search for data in Json and display time in time and move on to javascrtipt
You can make an ajax query that at the end of the query it launches a setTimeout with the time for the next update, the code with jquery would look something like this : function updateData(){…
-
1
votes2
answers66
viewsA: Use multiple javascript loops
the problem was that the a was being played in the global context, soon in the second execution the identifier of the first setInterval was lost and only the second stopped, just add var before a to…
javascriptanswered Antonio 533 -
0
votes3
answers1606
viewsA: Count how many times a string appears in an Object
You can use reduce to reduce your array to an array containing only the item and quantity; $reduce = array_reduce($objeto,function($carry, $item){ if(empty($carry[$item->type]))…
-
0
votes6
answers300
viewsA: How do I transform an array that is in a string for javascript array?
You can use JSON.parse() , but by default the json string values use " instead of ', this would convert the string to " var arr = JSON.parse('["aaaaa", "bbbbb", "ccccc", "ddddd"]');…
-
2
votes4
answers1061
viewsA: How to take the units of a two-digit number
In php every string can be considered an array of characters and it is possible to cast from int to string, so you can get the digits of a number like this In PHP 7 $num = 25; $dig1 =…
-
0
votes3
answers990
viewsA: Show data with Angularjs according to an input type="select"
You can the array key and pick up using the employee array in the job field, it would be the solution with least code change var app = angular.module('app',[]);…
-
1
votes1
answer961
viewsA: Failed to run Ionic server
If you just created the project, probably it downloaded the Ionic-app-scripts version 1.2.2, this version is presenting this problem in many systems, I recommend you to rollback the version to 1.1.4…
-
2
votes3
answers1028
viewsA: Facilitation in PHP projects
There is the Phpintel package that brings go to declaration functions by placing the pointer over the method/Class and pressing Ctrl + F5 https://packagecontrol.io/packages/PHPIntel…
-
2
votes3
answers1988
viewsA: disable button per second with jquery
This inside the setTimeout is not the same as the external scope, I added a bind and changed the code a little to do what you said $(document).ready(function () { $("button").click(function () {…
-
1
votes2
answers55
viewsA: < and > check in php
You can use a check only from $curva_a with $curva_b and $curva_b with $curva_c if(!($curva_a > $curva_b && $curva_b > $curva_c) ){ /*ERRO*/ }…
-
0
votes2
answers1110
viewsA: Rename a variable using Function /Javascript Parameters
You can use the window variable as a global scope and change the object property, it would look something like : function myfunction(u){ window['e'+u] = 1; window['x'+u] = 2; window['o'+u] = 3; }…
javascriptanswered Antonio 533 -
2
votes2
answers2773
viewsA: consult record between two dates in mysql
Try to use with between SELECT * FROM `tabela` WHERE `data` between '2017-03-01' AND '2017-03-05' If using Datetime, set the start date to 00:00:00 and end date to 23:59:59 to consider the entire…
-
2
votes2
answers83
viewsA: With making a Count within the array
You can use the array_reduce, it reduces an array to a single value $array = [ ['valor'=>10], ['valor'=>30], ['valor'=>40] ]; $arrayTotal = array_reduce($array,function($carry,$item){…
-
2
votes1
answer104
viewsA: Pass $Scope.variavel for a javascript rating at home
You can use the window variable as global, only have to pay attention when it is changed In Javascript var myApp = angular.module('myApp',[]); window.test1 = 10; window.test2;…
-
0
votes1
answer71
viewsA: Angular.js dynamic filters
You can filter using ng-if in the element itself, such as <div ng-repeat="op in oportunidadeUnica" ng-if="op.ReferenceCode == filterCode"> {{op.name}} </div>…
-
0
votes1
answer385
viewsA: Creation Table Mysql
If you put the modality information in another table you can have 0.. n modalities, using foreign key to get registered modalities, the scheme would look like this I recommend doing something…
-
0
votes1
answer120
viewsQ: Highcharts Xaxis label on top of tooltip
I’m having a problem, where the chart tooltip is always getting below the Xaxis label. I would like the tooltip to be above the label. http://jsfiddle.net/toninho09/83gkze29/1/…