Posts by Maicon Carraro • 8,881 points
269 posts
-
0
votes1
answer90
viewsA: How to rewrite a URL
If you want to literally redirect to the url, just remove the "#", getting <a href="Contato">Contato</a> Now if you want to maintain the anchor function and just change the url visually…
-
7
votes3
answers596
viewsA: Round a number to Top 4023.8599999999997€
I ran a test on round and worked ok: $sum1 = 4023.8599999999997; echo round($sum1, 2); 4023.86 Ideone…
javascriptanswered Maicon Carraro 8,881 -
1
votes2
answers3726
viewsA: How to overload method in javascript?
In the javascript you can call the functions even not passing all methods, example: function foo(param1, param2) { console.log(param1); console.log(param2); } If you call foo(); // mostra undefined…
javascriptanswered Maicon Carraro 8,881 -
2
votes0
answers36
viewsQ: How to include Alfresco Repository in the project
We implemented Alfresco CMIS to create, modify and delete files by connecting to Alfresco Community (server), but we would need to have the repository included in our project so we don’t have to…
-
3
votes2
answers208
viewsA: Script for modifying Bible texts (accessibility)
Using regex: import re pattern = re.compile(r"(?P<nome>[^\s]+) (?P<capitulo>[^:]+?):(?P<versiculo>[^\s]+)") s = "João 3:16" m = pattern.search(s) print m.group('nome') + ",…
-
5
votes2
answers205
viewsA: Unwanted 1px space in Internet Explorer
You can use CSS Hack for this, example: @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { // apenas IE 10 // aqui tu coloca a classe com a margin negativo pro IE }…
-
1
votes1
answer165
viewsA: Time calculation logged in to SQL
A way out is for you to create a CASE WHEN on its internal date for when it is dawn you return day-1. Assuming you want to group until 6 am the next day. SELECT DATA,USUARIO,SUM(PERIODO_LOGADO) AS…
-
1
votes2
answers433
viewsA: get word in given coordinate (x,y)
If you don’t want to adopt the solution @Sanction indicated, have this code here that worked perfectly here in Chrome. Source: https://stackoverflow.com/a/3710561/3257568 function…
javascriptanswered Maicon Carraro 8,881 -
0
votes2
answers46
viewsA: Element outside the dialog
I believe you can fix it with z-index: #dialog { display: block; z-index: 9999; }
-
4
votes3
answers1786
viewsA: What is the usefulness and importance of "do... while"?
It all depends on your logic of doing things. You can take a look at the solution I put here: Tie problem for In this situation he used the same input variable for the while, the only way out of it…
-
16
votes3
answers3072
viewsA: How to convert a string to List<int>
Yes, string variavel = "1,2,3"; var numeros = variavel.Split(',').Select(Int32.Parse).ToList(); or var numeros = variavel.Split(',').Select(item => int.Parse(item)).ToList();…
-
1
votes1
answer3588
viewsA: How to send login and password to this authentication system..?(automatic login)
If you want to pass the credentials just do so: curl_setopt($curl, CURLOPT_USERPWD, "$usuario:$senha"); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); To use: $curl = curl_init();…
-
1
votes1
answer548
viewsA: Select only the first children of a parent element
If you want to use only css, the trick is to use the >: .step-content > * { display: none; } If you want to work with jQuery: For this you can use the .children(). Example:…
-
1
votes1
answer2789
viewsA: Font Awesome appear strange characters
Try switching to this url: https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css Or if you’re using Apache, include in .htaccess: <FilesMatch…
-
0
votes2
answers67
viewsA: Search only a random part within a select mysql code
Checked if the problem is not case sensitive? To solve this just add the LOWER, that will turn everything into tiny. $busca = strtolower($busca); $resultado = $mysqli->query("SELECT * FROM tabela…
-
1
votes1
answer33
viewsA: how to generate a table with an array size 228
Assuming your list comes in order, you can do something like this: $qtdeColunas = 4; // 4 porque ele gera 2 na primeira vez, totalizando 5 $i = 0; echo "<table>"; echo "<tr>"; for (;$i…
phpanswered Maicon Carraro 8,881 -
1
votes2
answers1234
viewsA: Calculate hours in PHP?
I made a code adapted from that reply: $horas = array( '-05:00:00', '08:00:00' ); $seconds = 0; foreach ( $horas as $hora ) { list( $g, $i, $s ) = explode( ':', $hora ); if ($g < 0) { $i *= -1;…
-
1
votes1
answer90
viewsA: Regular expression in PHP
For this you must use the preg_split, example: $palavras = preg_split("/[\s,]+/", $_POST["string"]); // reparte a frase quando encontrar espaço (\s), vírgula ou os dois…
-
1
votes1
answer40
viewsA: Problem to sum values in JDBC
You left a space between the function and the parameter. select SUM (valorDiaria) Arrange for: select SUM(valorDiaria)
-
1
votes1
answer29
viewsA: Sql last ids
Try: SELECT * FROM Usuarios ORDER BY ID DESC LIMIT 5 Using PDO: $pdo = new PDO('... seus dados ...'); $consulta = $pdo->query("SELECT id, nome FROM Usuarios ORDER BY ID DESC LIMIT 5"); while…
-
2
votes2
answers740
viewsA: Doubt increment $i + loop for
In his for the variable $i is being used to increment the value when you have the condition: ($isAtivo) && (substr($cd_lot, 0, 1) == 'E') for true Then after the for if you want to know how…
-
6
votes5
answers63261
viewsA: How to clean the console in Python?
Do: >>> import os >>> clear = lambda: os.system('clear') >>> clear() That way you just call the clear() when you want to clean, if you have Windows just swap clear for…
-
0
votes1
answer1481
viewsA: Display HTML text in ASP Textbox?
I believe what you want is the <asp:Literal>, it serves precisely to display some static text, be it HTML or not. Example: <form runat="server"> <asp:Literal id="meuLiteral"…
-
1
votes3
answers644
viewsA: Data Datepicker - Processing
If you want to deal with sending: var dataQuebrada = $("#datepicker").val().split("/"); var novaData = new Date("20" + dataQuebrada[2], dataQuebrada[1] - 1, dataQuebrada[0]); // new Date(year,…
-
1
votes1
answer36
viewsA: Breaking up query fields
Solution in MySQL SELECT YEAR(DAT_EHORA_EVENT), MONTH(DAT_EHORA_EVENT), DAYOFMONTH(DAT_EHORA_EVENT), HOUR(DAT_EHORA_EVENT), MINUTE(DAT_EHORA_EVENT), SECOND(DAT_EHORA_EVENT) FROM tbl_CLIENTES_AGENDA…
-
2
votes1
answer34
viewsA: Search Interlaced ID (mutual), sql mysql
I believe that’s it: select t1.id_1 as procurado, t1.id_2 as entrelacado from teste t1 inner join teste t2 on t1.id_1 = t2.id_2 and t1.id_2 = t2.Id_1 where t1.id_1 = 6 Because of INNER JOIN will…
-
4
votes4
answers29520
viewsA: Print strings in alphabetical order
The function strcmp() takes two string to be compared and will have 3 possible returns: less than 0: when you find a different character in the strings and that character of the former String for…
-
1
votes1
answer3433
viewsA: Run function with Javascript/ Jquery timer
See if that’s it :) var contador = 5; setTimeout(temporizador,1000); function temporizador() { if(contador > 0){ setTimeout(temporizador,1000); } else { window.onbeforeunload = null; }…
-
0
votes3
answers5089
viewsA: How to pass a json containing data array to Php?
You’re not losing value No, try it like this: /* no caso aqui eu forcei, mas é a mesma coisa que você envia com o JSON.stringify */ $json =…
-
3
votes1
answer755
viewsA: Changing the status of a field with Javascript
I believe there’s a logic flaw in your code, because by analyzing your razor you always use the item.Status, then it means he’s always Available. You need to change your code for when you’re with 0…
-
2
votes3
answers229
viewsA: Search HTML LIKE style %.. %
Using only javavascript: window.onload = function () { var like = "Alterbania".toLowerCase(); // evitar case sensitive var divs = document.getElementsByTagName('div'); var encontrados = []; for (var…
-
4
votes2
answers257
viewsA: Working with REDIPS drag-drop
I changed your function of clicked, looking in the source code there is an event called cloned which is when you selected some icon and are moving it. From this I created 2 div assistants to clone…
-
3
votes1
answer347
viewsA: How to create an html log with log4net
Assuming you can save the log as XML and that HTML is also a markup language, you can try to take advantage of it. You can rewrite the class Xmllayoutbase, as it was done by Darin: public class…
-
2
votes1
answer44
viewsA: Taking numeric value of Uol URL
You can use regex for this, example: $url = 'http://thumb.mais.uol.com.br/15516553-medium.jpg?ver=1'; preg_match("/^.*(uol.com.br\/)(\d+)-*/", $url, $valores); echo $valores[2]; // seu id ficará na…
phpanswered Maicon Carraro 8,881 -
1
votes2
answers141
viewsA: How to hide a div only in firefox
Following the idea that the Sergio said: window.onload = function () { var is_firefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; if (is_firefox) {…
-
1
votes2
answers290
viewsA: How to convert string array to string?
You can make an iteration and go reading each character that the read returns and adds to a char array. char arrayLeitura[20]; int index=0; char charLeitura; File prog = SD.open("prog.bin"); if…
-
2
votes3
answers561
viewsA: Search multiple Mysql tables
Analyzing your SQL you can see that it wasn’t very clear to you how to make relationships in JOINS, recommend you read here: What is the difference between INNER JOIN and OUTER JOIN? Leaving for…
-
1
votes2
answers50
viewsA: generate query dynamically with Union
You can use the function rtrim(), beyond that there is the ltrim() and trim() that serve to remove spaces (if not specified parameter) or a text specified in the parameter. In the case of rtrim will…
-
4
votes2
answers365
viewsA: ORDER BY COM GROUP BY to get last Row, sql
Experiment using the MAX on date: SELECT COUNT(u.bold) as COUNT, MAX(U.born_data) as born_data, U.bold FROM users U GROUP BY U.bold ORDER BY U.born_data DESC Exit COUNT born_data bold 1 July, 01…
-
1
votes2
answers116
viewsA: What is the appropriate http code to respond to the contents of an image?
For that there are the RFC, are technical documents developed and maintained by the IETF (Internet Enginnering Task Force), an institution that specifies the standards that will be implemented and…
-
3
votes2
answers450
viewsA: How to concatenate into a string what was selected in a select Multiple
I used the event onchange from select to change the URL every time the user clicks on some value, then runs a for looking for options selected and concateno in the string. (No problem the last…
-
0
votes2
answers267
viewsA: Lock F5 key in the application
One solution is to create a javascript function to prevent it from pressing the key corresponding to the F5 function desabilitaF5(e) { if ((e.which || e.keyCode) == 116) e.preventDefault(); };…
-
1
votes2
answers399
viewsA: Sort field or expired date notifications, database
If you want the OLDEST date and not the NEWEST one, you want ascendant and not descending. SELECT * FROM Emprestimo ORDER BY dataemprestimo ASC Sqlfiddle Example About your second problem, you can…
-
0
votes3
answers472
viewsA: Ignore certain values in Mysql
You are already filtering the status here status=$numeroStatus so if you add some other operator, example status=$numeroStatus and status <> 0, nay will help in anything because it is already…
-
3
votes2
answers1499
viewsA: Form being sent twice in a row
Put in your form onsubmit="return suaFuncao()" and on your button Submit onclick=return suaFuncao(). And in your js: function suaFuncao() { $.ajax({ type: "POST", url: baseURL + '/form-cadastro',…
-
3
votes2
answers61
viewsA: Transform into json
Although I don’t see the need to add " key, because you will be able to work with the object JSON likewise, here is a solution: $json = '{name:"Sara", daypart:"day", href:"/questions/ask", bg:"su",…
-
2
votes2
answers1486
viewsA: Compare strings to accents, UTF-8
Your problem is related to Html Entities, if you do it here: $arrayCondition = str_split($condition); $arrayString = str_split("Céu Limpo"); var_dump($arrayCondition); var_dump($arrayString); You’ll…
-
6
votes1
answer1813
viewsA: How to read whole numbers with Scanner and handle invalid entries
It won’t work with the nextInt() because it only works if you have already entered a data line, as you are using System.in you have to do it this way: Scanner entrada = new Scanner(System.in);…
javaanswered Maicon Carraro 8,881 -
0
votes1
answer159
viewsA: Avoid persisting data while refreshing
Regardless of the language the solution of the issue to be solved only with information from request sent by the browser. In this case we will use the chrome and firefox, as they both add a new…
mvcanswered Maicon Carraro 8,881 -
2
votes1
answer742
viewsA: Javascript/PHP: Page redirection
No, the only situation that can give problem is if you are specifying the path from the beginning, example window.location.href = http://localhost/pagina. While you use ../ (back directory) or by…