Posts by mau humor • 1,991 points
89 posts
-
0
votes2
answers269
viewsA: List running in order with PHP
According to the documentation of the function readdir: Returns the filename of the next directory file. The names of files are returned in the order informed by the file system.…
-
0
votes1
answer310
viewsA: How to create a link to call Resource Stroy?
You should exchange the link for a form, as follows: Replace that: <td> <a href="/painel/post/{{ $p->id }}/edit">Editar</a> <a href="/painel/post/{{ $p->id…
-
2
votes1
answer1548
viewsQ: GIT recover files (git reset --hard HEAD)
I’m a little inexperienced with GIT. I was working on a branch, but I wanted to get some updates on the master branch, but git pull failed as there were no changes committed. Then I just used the…
-
0
votes1
answer653
viewsA: Curiosity - PHP and Data Query Limit
My question is, basically, if it were you on a website that you did, what would you do to expose in a table more than 100 data. Knowing that, you would not know how many information lines the basis…
-
1
votes1
answer35
viewsA: Bringing together records from another table in a new query
It would be something +- like this: SELECT id,nome,SUM(valor_1) as soma_1, SUM(valor_2) as soma2 FROM tbA a JOIN tbB ON b.fk_a1 = a.id, GROUP BY a.id I removed the LEFT because then it would have no…
-
0
votes1
answer6197
viewsA: Syntax error, unrecognized Expression when calling a function with Jquery
The JSON you are returning does not appear to be in the same format as the one used to exemplify the use of this component. To suggest another way to write this query, it is necessary to know which…
-
3
votes2
answers142
viewsA: How can I format this array to the way I want it?
From what I understand, this is it: $array = [ 3 => [1, 55, 87], 14 => [45, 78, 101] ]; $novoArray = []; foreach($array as $key => $subArray) { foreach($subArray as $value) { $novoArray[] =…
-
1
votes2
answers648
viewsA: Record Multiple Numbers in a Field in the Database
First you should create a column that supports text. Although they are multiple numbers, the way you want to store, it is impossible to use a numerical field. CREATE TABLE xxx ( .... sincrozina…
-
1
votes1
answer381
viewsA: Feedback message in php contact form
If you say a blank screen is being displayed, I imagine you are not using AJAX. In that case, you should keep in mind that the content of the page where the form is, after submission is fully…
-
5
votes1
answer4900
viewsA: When to use the http Patch method?
PUT when modifying all attributes. PATCH when modifying one or some attributes, but not all. More information: https://stackoverflow.com/questions/24241893/rest-api-patch-or-put…
-
1
votes2
answers31
viewsA: Get the name of the files sent by the form
Instead of var_dump. Try doing this: echo $file_url[0]; If the output you posted is complete, it means there is an array, containing a string But if the string content is:…
-
0
votes1
answer565
viewsA: Send without giving Refresh and using onchange
If you want to recover the input value, put an identifier in it. For example id="meu_input" <input id="meu_input" type="text" name="resultado1" size="5" onChange="envia()"> </form> Then…
-
0
votes3
answers9533
viewsA: Remove whitespace between array values
You can use the str_replace, as already suggested. You did not specify, but I’m pretty sure you just want to eliminate the extra spaces. So I suggest you do it this way: $array = [ ["DDF…
-
0
votes3
answers1182
viewsA: How do you hide a div when it’s empty?
That’s a vague question, but according to your description of the problem: CSS: .hide{ display:none; } Html: <div class="_div"> </div> Javascript: ... if ($("._div").html()==""){…
-
3
votes3
answers1007
viewsA: Parity test in C
Simply decompose the number by making successive divisions by 2, and check the result of the division. Thus: #include <stdio.h> int check(unsigned char a) { int n = 0; while (a > 0) { if…
-
2
votes3
answers63
viewsA: Perform separation on a Data Line and mount an array
You can use the function replace PHP, to break the original string. Ex: $array = []; $array[] = substr($stringOriginal,0,12); //Ou atribui logo em $id And so get the first value, to catch the next…
-
0
votes1
answer101
viewsA: Is it possible to take the content of a specific website url and display it in a Popup?
I believe an image is possible, as long as your site knows the URL of that image. But the content of an element is not. That would make navigation extremely insecure. Already imagined, if the site B…
-
4
votes1
answer497
viewsA: I can’t register a Java Arraylist
I believe you are not accessing the attribute you want to display. For example: System.out.println("\nCodigo do Cliente:" + clientes.get(i)); You are only accessing the client object, on the Dice i,…
-
0
votes1
answer1231
viewsQ: Get total records of a Jquery Datatable
I need to make a comparison with the total value of records that exist in the database, in a given table. I could get this value via PHP, and pass to Javascript, during page rendering, however,…
-
1
votes1
answer77
viewsA: Problem with editing database data
And my problem is that only on the first row of the table when I click on icon, the inputs obey the respective masks, whereas in others, no the same happens.…
-
0
votes1
answer102
viewsA: Send form data after image preview
You are overwriting, in the string html, the definition of tag <form>. And without form a post does not occur. var html = '<form action="#" method="POST" accept-charset="utf-8"…
-
1
votes1
answer50
viewsA: Ignore JSON element with PHP
That should work: for($i=0; $i<=10; $i++) { $arquivo = $json->exemplo[$i]->arquivo; $size = $json->exemplo[$i]->size ; if ((int)$json->exemplo[$i]->size < 1) {…
-
1
votes1
answer2487
viewsQ: Chartjs pie chart or pizza display percentage
Using the lib Chartjs(http://www.chartjs.org/) There is some simple way to make a chart of type "pie", display the percentage of each color, or at least allow the insertion of the character "%"…
-
0
votes2
answers318
viewsA: Change background-position with Javascript
I don’t know if the best way to "move" a background image is to constantly modify the position of the "background". However, if this solves your problem, there is an example: CSS: body{…
-
0
votes3
answers103
viewsA: C pointers, error calling the relocation function
Your parameter is already a pointer, in which case you don’t need the "&". Also, if the function will return a pointer to the allocated space, you do not need to provide a pointer as parameter.…
-
1
votes2
answers726
views -
1
votes1
answer64
viewsA: Handling PHP compressed files
Extract files in PHP: http://php.net/manual/en/ziparchive.extractto.php Getting content from a directory: http://php.net/manual/en/function.scandir.php You can also use commands from your system if…
-
2
votes2
answers284
views -
0
votes0
answers721
viewsQ: Laravel 5 (Eloquent) JOIN between two consultations, is it possible?
The following SQL, executes two queries and "sums" the hard answers "laterally": select * from (select id,name from client where id = 20) as a join (select id,age from client where id = 20) as b ON…
-
0
votes1
answer1795
viewsA: How to return to the home page after an Alert message
Missing period and comma after Alert. echo '<script language="javascript">'; echo 'alert("Sua quantidade de IMC é: '.$imc.'");'; echo 'location.href="index.html";'; echo '</script>';…
-
3
votes1
answer593
viewsA: Changing the css of a div with Jquery mouseover
CSS: .hide{ display: none; ); HTML: <div id="my-div" style="background-color:#ff0000" >Minha Div</button> Javascript: function hideDiv(){ $("#my-div").addClass('hide'); } t =…
-
3
votes3
answers75
viewsA: In a String separates with data separated by ";" how to take the 2nd data?
"Alberto;jose;Felipe;Ana".split(";")[1]; "split" returns an array with all strings resulting from the "break" in the character passed by parameter.
-
1
votes3
answers1589
viewsA: Insert data into a multidimensional array
Something next to that: $arrayOriginal[$arrayKeys[0]][$arraykeys[1][$arraykeys[2]][$arraykeys[4]] = 9999999; Suggestion for automation: $arrayOriginal = [ 'a' => 0, 'b' => [ 'f' => 5 , 'g'…
-
2
votes1
answer70
viewsA: Communication using Torrents
No, trackers only say ip/port and a flag (1 or 0) that indicates whether that host is Seed or Leech (whether or not it has 100% of the torrent content). To get the rest of the information, it is…
bittorrentanswered mau humor 1,991 -
-1
votes2
answers622
viewsA: Repeat loop for in C
It’s been a while since I’ve touched C. But it seems your code doesn’t do the minimum necessary for ordering: Read 3 values. There is only one scanf and out of any loop. I don’t know how you tested…
-
0
votes1
answer240
viewsQ: What is the best way to calculate between attributes of a model, to display in the view?
I’m currently calculating everything in the view, something close to below: {{{ $object->a + ($object->b==1?5:10) + $object->c * (int)object->d... But it doesn’t seem like a good idea. I…
-
0
votes2
answers234
viewsA: Update on Zend 2
zf2 has a class similar to the one you’re using to select. http://framework.zend.com/apidoc/2.0/classes/Zend.Db.Sql.Update.html…
-
0
votes5
answers2014
viewsA: Disable a Ubmit and Enable only when radio minimum Buttons is selected
It would be something like that: $('input[type=checkbox]').change( function() { $('input[type=submit]').prop("disabled", ($('input[type=checkbox]:checked').toArray().length>=5)); }});…
-
2
votes5
answers2014
viewsA: Disable a Ubmit and Enable only when radio minimum Buttons is selected
Add in the "change" event of each input a function that checks the amount of input that is marked, if it is the number you want, you can set the disabled property of "Submit" as "false", otherwise,…