Posts by luigibertaco • 674 points
25 posts
-
0
votes1
answer49
viewsA: How to check if you have a number in your Python password?
There are several ways you can perform these checks more elegantly, safely and performatively, but I’ll just focus on explaining why your code didn’t work to get if there are numbers in the…
pythonanswered luigibertaco 674 -
1
votes1
answer137
viewsA: Lambda function to return higher value from a list of dictionaries
Like the lambda works: Lambda is a real-time function definition, but works as a normal function. lamda_soma_um = lambda x: x + 1 def func_soma_um(x): return x + 1 lambda_soma_um(5) ==…
-
4
votes4
answers1016
viewsA: Exchanging elements in arrays with a function. How to do?
Your question is a little vague, so this is just a way to make this substitution using a function: // recebe dois arrays por parametro e troca a última possição // do primeiro para o segundo…
javascriptanswered luigibertaco 674 -
0
votes1
answer234
viewsA: Join several. nc files?
You can use MFDataset in place of Dataset and include a "wildcard" (*) on the date for files to be automatically selected. from netCDF4 import MFDataset data = MFDataset('/home/maou/Área de…
pythonanswered luigibertaco 674 -
1
votes3
answers688
viewsA: How to do in a select html, when clicking select more than one row at a time?
I did not understand exactly the part of the selection how it should work, explains better that I edit my answer if necessary. But as far as the bank search goes,: select mes from tabela where mes…
-
0
votes1
answer244
viewsA: Add Row in jquery with Sessionstorage
The only problem is that you were using as the var indice = sessionStorage.key(i); but since Voce controls the sequential Indice in hand, you can only use the value of the variable i var indice = i;…
-
1
votes1
answer168
viewsA: Give an alternative right-click lock on an image
Using jQuery: $('img').bind('contextmenu', function(e) { return false; }); http://jsfiddle.net/zzw216du/ Source: Disabling right click on images using jquery…
javascriptanswered luigibertaco 674 -
1
votes2
answers598
viewsA: How to list parents and city in Anglican?
Complete example using your expected return. You can run the code to test. angular.module('myApp', []) .controller('EstadosController', function() { var estados = this; estados.lista = [{ pais:…
-
0
votes2
answers879
viewsA: PHP - How to make left Join with more than one record in the other tables not return repeated values in the columns?
This is not an SQL problem, the moment you make a Join you are generating a "Cartesian product". What I can suggest to you is during the processing of the data, display only the information that you…
-
1
votes1
answer621
viewsA: How to have two or more dynamic filters in the same product group with Javascript?
$(document).ready(function() { $("#filtro select").change(function() { applyFilter(); }); function applyFilter() { …
-
0
votes1
answer146
viewsA: Distinct values
This way it doesn’t work? SELECT `forma`,`id_produto`,`id_lanche`,`qtd_max`, if(`id_lanche` in (select `id_lanche` from `produtos` where `id_lanche` = {$id_produto}),'checked','') as marca FROM…
-
2
votes3
answers794
viewsA: Capture content to be pasted
I found an answer in the international STOF that teaches a gambiarra to do this, apparently, for security reasons, only this way, otherwise the sites could copy the transfer area of all visitors.…
-
1
votes1
answer64
viewsA: ignore the cursor position on the scroll bar
var margem = 0; var diff = 0 function criarBarraDeRolagem() { if ($(document).height() < $(window).height() - diff) { return; } if ($("#rolagem").offset().top <= $("#rolagem2").offset().top) {…
-
1
votes2
answers284
viewsA: Scrollbar - Calculate Motion Field
I changed the lines: $('#rolagem2').css('top', $(window).scrollTop()); And if (move < $(window).height() - $('#rolagem2').height()){ Stayed like this var margem = 0; function…
-
7
votes1
answer532
viewsA: Stock control
you have to store the lettuce id in the recipe table, as in the stock the lettuce is id = 1, so instead of the name "lettuce" in the recipe table, you save the id, your tables would look like this:…
-
0
votes2
answers1973
viewsA: Select line in datatable and get id
In your Jsfiddle code just change the on-click event from the button to this: $('#btnGetId').click( function () { alert($('#example tr.selected').children(':first-child').html()); } ); What you are…
jqueryanswered luigibertaco 674 -
1
votes2
answers2654
viewsA: Webservice SOAP with PHP
You can convert the XML return to an object with the function simplexml_load_string <?php $string = <<<XML <?xml version='1.0'?> <document> <title>Forty…
-
2
votes1
answer101
viewsA: How to sum up the days according to a period?
I believe in your case it would be something like: select codfun, min(data_ini), max(data_fim), sum(qtd_dias) from TABELA group by codfun; I’m not sure how this will behave in mysql, but I believe…
-
17
votes4
answers1788
viewsA: Are Getters and Setters mandatory or facilitators?
You can write as you like, you can be obj.colocaValorNoNome() or anything, including, if your attribute is public, you don’t even need to use a get and set method, using, for example: obj.nome = "";…
-
5
votes1
answer288
viewsA: Error trying to use HTML5 Local Storage
Only set the SAVE function: <script type="text/javascript"> function exibir(){ document.getElementById("nome").value = localStorage.getItem("l_nome"); } function salvar(){…
-
3
votes1
answer802
viewsA: How to model product categories?
Just use a recursive reference when creating the Category model and create a level counter to limit to 3. class Category < ActiveRecord::Base has_many :products belongs_to :parent, class_name:…
-
2
votes2
answers2749
viewsA: Validate e-mail with Angularjs
Actually the abc@abc email can be valid in the same way as email@localhost. It is unusual, but is valid technologically speaking, could answer some address. You can check in:…
-
0
votes2
answers1831
viewsA: Choose color in <input type="Submit"...>
There is the plugin Colorpicker for jQuery, I think it serves your case: http://www.eyecon.ro/colorpicker/
-
0
votes3
answers208
viewsA: Writing to Mysql with PHP
Apparently your script is not using id with auto_increment. If you call the same form twice, in the first you will enter and in the second you will conflict with the already existing key. Then try…
-
1
votes1
answer1146
viewsA: How do I access a default path?
I don’t know if git has a standard way of doing this, but you can change the current directory on git bash startup Creating a. bashrc file in your default directory and putting the command below,…
gitanswered luigibertaco 674