Posts by Maicon Carraro • 8,881 points
269 posts
-
1
votes1
answer34
viewsA: Remove total color from``
Can disable the user-select, experiment: .noselect { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select:…
cssanswered Maicon Carraro 8,881 -
3
votes1
answer122
viewsA: Tie problem for
As I explained in the comments, the first time will always come and then you are assigning 0 the variable you use to control the while then it will always give false and will never enter. To force…
-
1
votes3
answers1118
viewsA: Key capture
Implement this function by gdj: #include <termios.h> #include <unistd.h> #include <errno.h> #define ECHOFLAGS (ECHO | ECHOE | ECHOK | ECHONL) int set_disp_mode(int fd,int option) {…
-
3
votes1
answer72
viewsA: Error: mysql_fetch_assoc inside Function
Is there a possibility that you or someone is passing the $nomePessoa with a single quotation mark, example João', and this ends up breaking the logic of its concatenation of parameters in addition…
-
5
votes1
answer448
viewsA: You can block the Arrow from the DATE field
Are you looking for webkit-inner-spin-button. Even you can disable the Calendar Picker if you like. About the use of ::placeholders be supported, take a look here:…
-
3
votes3
answers919
viewsA: String Suffix and Prefix. Take a piece that serves both
I made a while that compares the beginning with the end until reaching the middle String nome = "abbabba"; var i = 0; // começo var j = nome.Length-1; // fim, -1 porque começo do 0 var tamanho = 0;…
c#answered Maicon Carraro 8,881 -
0
votes3
answers183
viewsA: Return the difference between the last two records
Try :) select e.event_type, e.value - (select top 1 value from events where event_type = e.event_type and time <> e.time order by time desc) as value from events e where e.time = (select top 1…
-
-1
votes4
answers7700
viewsA: Sort a multidimensional array by a column, keeping the same lines of the array
Have you tried using the usort? Order before creating your $data. function cmpSites($a, $b) { return strcmp($a["sites"], $b["sites"]); } function cmpIPs($a, $b) { return strcmp($a["IPs"],…
-
0
votes2
answers146
viewsA: Advanced query in Ruby On Rails (Activerecord)
I don’t have much experience with Active Record, but see if it gives you a light: Produto.find(:all, joins: "INNER JOIN `clientes` ON clientes.id = produtos.cliente_id" , select: "clientes.nome,…
-
0
votes1
answer878
viewsA: Grab gallery image on android
Try to pass the URI of Media.EXTERNAL_CONTENT_URI. Intent galeriaIntent = new Intent(Intent.ACTION_VIEW, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivity(galeriaIntent);…
androidanswered Maicon Carraro 8,881 -
1
votes1
answer69
viewsA: Simplify Probability function with priority
Analyzing their if regardless of the value it will always have 2 elements that are the str1 and str2, then seeing the difference of others means that when it is less than 0 then you need to have…
-
1
votes1
answer144
viewsA: Retrieve data. Txt php in reverse
You can use the array_reverse to reverse the order from last to first. $file_contents = array_reverse(file("../includes/userlog.txt")); foreach($file_contents as $linha){ echo $linha; }…
phpanswered Maicon Carraro 8,881 -
0
votes2
answers5706
viewsA: Password check
It may not be the best way, but it is very educational. If you want to know about the values ASCII that I used in the code take a look here: http://www.asciitable.com/ function valido() { var senha…
-
2
votes1
answer1658
viewsA: Chain list ordering
Your function has a problem is that your for will run whether you have found the right position or not, the problem happens more or less like this: Add peter, is empty so no problems Add Joao, falls…
-
3
votes1
answer3328
viewsA: Concatenate string with integer
Can you use the snprintf as a trick to format your data, stay tuned to its parameters: 1. the buffer where to store the return of the function with the new format. 2. the buffer size to be written…
-
5
votes1
answer519
viewsA: Synchronized in static methods, and in nonstatic methods
Is not the even lock, precisely because of the static. Synchronized + Static: will result in a single instance involving the same lock for all who attempt to invoke. Thread 1 calls: Foo.test();…
-
6
votes1
answer1761
viewsA: How to validate format and compare two dates to enable buttons
I ended up removing some parts of your code that I didn’t find necessary and added some <p> to get better presented, and remove HTML5 validation. .message1 { font-size: 10pt; color: red; }…
-
1
votes1
answer58
viewsA: Find occurrences of a word
To avoid the case sensitive just turn both strings in capital letters or minuscules, for example: $count= substr_count(strtoupper($text), strtoupper("menino")); That way your sentence will turn: "EU…
-
5
votes1
answer9903
viewsA: Close file (is being used by another process)
That line File.Create("caminho-arq"); creates the file and returns a FileStream so you can use, if you’re not going to use you have to close it before opening a new.…
c#answered Maicon Carraro 8,881 -
1
votes2
answers842
viewsA: How to add a JAR library to a Java project without IDE?
You need to pass the classpath when executing the javac javac -classpath jfreechart.jar minhaClasse.java
-
3
votes1
answer222
viewsA: Java - String - Comparison
If you use == it will compare with memory addresses, if you want to compare only the values use the .equals(). Another attention is on case sensetive, if you type some lower case letter and use…
-
0
votes1
answer72
viewsA: My delete button is giving error expects the Parameter
I made some changes. 1. I arranged the @ missing from query. 2. I created a new instance pro Sqlcommand. private void BtnExcluir_Click(object sender, EventArgs e) { if (MessageBox.Show("Confirma a…
c#answered Maicon Carraro 8,881 -
1
votes2
answers190
viewsA: Closed JS open panel
Try putting in the .ready to close all panels $(document).ready(function() { $('.panel-heading').each(function (index) { var $this = $(this); if(!$this.hasClass('panel-collapsed')) {…
-
1
votes1
answer19
viewsA: Message in Google Webmasters Tools - Changes to sitelinks for http://meusite.com.br
Source: Google Support Sitelinks Os links exibidos abaixo de alguns resultados da pesquisa do Google, chamados de sitelinks, têm como finalidade ajudar os usuários a navegar em seu site. Nossos…
-
2
votes2
answers2326
viewsA: Set link image with Facebook Meta-tags Open Graph
It involves the Open Graph from Facebook, you can tell him what image you want to display: 1. First add the namespace of Open Graph <html xmlns="http://www.w3.org/1999/xhtml"…
-
1
votes2
answers293
viewsA: Get a single TRUE or FALSE on multiple conditions
You started out right in logic, but you missed three things: When you do split will have some img with space in front, to remove this just use .trim(). That’s why I was giving false in his, because…
javascriptanswered Maicon Carraro 8,881 -
0
votes2
answers1728
viewsA: I cannot check whether an array is empty or null
Probably his json_encode is returning [], as you can see here: https://ideone.com/BO6SsT Do a javascript check: if (query == '[]') imgs.innerHTML = "<h4>Ainda não ha galerias nesta…
-
1
votes2
answers17280
viewsA: How to crop an image - HTML
Would that be? .preview { width: 600px; height: 300px; background-image: url('http://blogdopizzato.com.br/wp-content/uploads/2015/06/201501072015-Maranhao.jpg'); border: 1px solid; } <div…
-
1
votes1
answer2189
viewsA: How to fix System.Collections.Generic.Ienumerable error
You are creating a new list of Cursos and not of AlunoCurso with that line: return View("MeusCursos", aluno.AlunoCursos.Select(ac => ac.Curso).ToList()); Within your .Select you take only the…
-
1
votes1
answer1008
viewsA: Handle files with C#
Take a closer look at the documentation of MSDN, the method .WriteAllText does not work the way you are trying to do. The first parameter is the location of the file and the second the content. var…
c#answered Maicon Carraro 8,881 -
5
votes1
answer68
viewsA: What kind of "phocus" is that?
Is the plugin Fokus, developed by Hakim El Hattab: <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dolor nisi, vulputate vitae magna id, luctus lacinia nisi. Donec finibus…
-
1
votes1
answer109
viewsA: Is there any function where I can mount a header in a pdf, through the javascript language?
There is a plugin called jsPDF, try using it. Example: window.onload = function() { var doc = new jsPDF(); doc.text(20, 20, 'Criando um cabeçalho.'); doc.setFont("courier");…
-
3
votes1
answer1721
viewsA: Copy and paste Javascript command
It’s kind of tricky, this whole copying thing clipboard something via javascript because it doesn’t work well in all browsers, one tactic is to make it easier for the user to copy. Example:…
-
16
votes6
answers14943
viewsA: JS Mask for Hours Validation
I had to put in a pastebin why don’t you let me pull the source, but the originals are: <script type="text/javascript"…
-
0
votes1
answer65
viewsA: Sha1cryptoserviceprovider and Sha1managed return different results
Your first code is incomplete, just returns the bytes and is not converting them. That line: result += b.ToString(); You should turn to hexadecimal, like this: result += b.ToString("X2");…
-
0
votes2
answers6836
viewsA: Edit object stored in an Arraylist
It would be good for you to create one unique identifier for your contact, example: public class Contato { private int id; /* aqui */ private String nome; private String email; private int telefone;…
javaanswered Maicon Carraro 8,881 -
1
votes2
answers471
viewsA: Change table structure using JQUERY
Explanation of the code: I’m looking for the last <td>of each <tr> I create a .clone() his Removed from <tr> the <td> I create a new <tr> with my clone of <td> I…
-
0
votes1
answer76
viewsA: Javascript popup does not see parent page fields
Create a function on your normal page (not the popup) to update the values according to the ids. function atualizaValor(id, value) { document.getElementById(id).value = value; } And then in your…
-
0
votes3
answers752
viewsA: Update page after download
It is not possible to give 2 answers, one being the file download and the other redirect. Another thing, with ajax will not work because it does not respond with the file download. One possum is to…
-
2
votes2
answers53
viewsA: Return data difference from two sql tables
Make a COUNT teachers to know when there is and when there is not, example: SELECT e.nome_escola, COUNT(p.nome_professor) qtdeProfessores FROM ESCOLA e LEFT JOIN PROFESSORES p ON p.ID_ESCOLA =…
-
0
votes4
answers2045
viewsA: How to limit PHP words
Solution in PHP Use the substr Example, limiting up to 15 letters: $title = "Lorem ipsum dolor sit amet."; echo substr($title, 0, 15) . '...'; Lorem ipsum Dol... Ideone example In your case I’d do…
-
1
votes1
answer50
viewsA: Return list through a specific date
In his SELECT there’s going to be a problem which is the >= when you go looking for dates prior to today, for example if you want yesterday will appear yesterday and today as it is greater or…
visual-basic-6answered Maicon Carraro 8,881 -
0
votes1
answer158
viewsA: Problems with Photoshop files inserted in Masterpage
I believe the problem lies in the hierarchy of your files, for example: --- Aplicacao/ ---- Scripts/ ---- Content/ ---- MinhaPasta/ ---- MinhaPaginaQueNaoFunciona.aspx ---- Site.Master What happens…
-
0
votes1
answer109
viewsA: php cycles with database
The problem with your code is you don’t keep it in a array the result of the second query, you do the mysqli_fetch_assoc($resultado) during the while and after that ends the first for your $result…
-
2
votes1
answer152
viewsA: My List is not updated correctly with database data
I believe you are not forcing the recharging of dataTable after saving to the bank. In your Send after doing the Save you need to re-load your list. public void editar() { try { //Anexo de Arquivo…
-
1
votes2
answers1077
viewsA: Script to open facebook messenger app chat
Open a page conversation you mean a post, right? You can try it this way: NSURL *url = [NSURL URLWithString:@"fb://post/<id_do_post>"]; [[UIApplication sharedApplication] openURL:url]; Now if…
-
0
votes2
answers1384
viewsA: Sort by day of the week starting by today
Maybe not the best option, but one way out is to create a column of ordem to know the priority based on the day: SELECT events.*, CASE WHEN dias.valor > DAYOFWEEK(NOW()) THEN dias.valor + 1 -…
-
2
votes1
answer791
viewsA: Cascade Dropdownlist MVC 4
Putting as a response the solution I indicated in the comments. In the line of your return you do not need to create a new encapsulation, change the line: return Json(new { Result = data },…
-
2
votes2
answers194
viewsA: Function only returns zero
Can’t tell how you’re instantiating calculoThompson, you’d have to do something like @FXML public void btSimularAction(ActionEvent evt) { calculoThompson.setFruto(fruto); // fruto que está…
-
1
votes1
answer167
viewsA: Signalr loses connection when giving a Postback
What is the structure of your Hub? I believe you will need to do a check on OnDisconnected and when adding the user to a new session. When it "disconnect", you will have to keep it still in the…