Posts by Paulo • 9,980 points
164 posts
-
5
votes6
answers14224
viewsA: Distribute list of <li> in two columns
You could do this by only affecting odd blocks: ul li { width: 230px; height: 140px; margin: 0; border: 1px solid red; background: #999; overflow: hidden; } ul li:nth-child(odd) { float:left; }…
-
2
votes1
answer789
viewsQ: How to generate a username with its real name as a reference?
I have a question on how to generate user names automatically from the real name of the user, so that the result is reference to the real name. Knowing that the method should be called by informing…
-
1
votes2
answers342
viewsA: Timepicker fields disappear when you select many dates
The code is set to remove the date if it has already been selected, you can delete this function by commenting on the line: //this.removeDate(index); See on Jsfiddle…
-
2
votes1
answer97
viewsQ: How to calculate the total seconds in a date range list by ignoring intersections of intervals in Python?
I am trying to calculate the total time in a list of date ranges in Python, and if there is intersection between the intervals, it must merge to be calculated as if it were a new interval. Interval…
-
3
votes2
answers242
viewsA: How do I persist with information after reloading the page? (e.g., a chosen background)
There is the option to use Local Storage present in HTML5. Example: // Sempre que carregar a página verifica se existe um background pré-definido if (localStorage.background)…
javascriptanswered Paulo 9,980 -
1
votes1
answer91
viewsA: Display chosen Select value
I made this example using jQuery: $(document).ready(function(){ $('.capitulos').on('change', function(){ $('.escolhido').text($(this).val()); }); }); <script…
-
6
votes1
answer1995
viewsQ: How to generate Mega-Sena results ignoring some numbers?
I want to generate some games for Mega-Sena using Javascript, so I can ignore a list of numbers and indicate the total number of games to be generated. Knowing that each game will have 6 numbers,…
javascriptasked Paulo 9,980 -
1
votes1
answer268
viewsA: How to automate a deploy in Apache?
You can configure the entire server using the Fabric. Fabric is a Python (2.5-2.7) library and command-line tool for streamlining the use of SSH for application Deployment or systems Administration…
-
3
votes2
answers1462
viewsQ: Bug when using Select2 in a Bootstrap form-group
I’m having a hard time fixing a bug that happens when using Select2 in a input-group. The problem is that when selecting a option with a very long name, the input-group does not respect the width of…
-
1
votes4
answers1530
viewsQ: Problem with sorting in Postgresql
I’m having a problem sorting columns in Postgresql despite being configured correctly in UTF-8. The version of Postgresql is 9.3 and it is installing on a Macosx Maverick 10.9.5 (this problem has…
-
2
votes3
answers1185
viewsA: icone does not stand next to input bootstrap
Is missing the div with the class input-group, see how the example on the official bootstrap website version 3: <div class="input-group"> <span class="input-group-addon">@</span>…
-
1
votes1
answer1211
viewsA: Adjust Fullcalendar to initially display the week tab and not by month
When calling fullcalendar, add defaultView: 'agendaWeek'. Example: $('#calendar').fullCalendar({defaultView: 'agendaWeek'}); To change the view dynamically use changeView. Example:…
-
2
votes4
answers186
viewsA: Dropdown menu opens partially
The problem is that the <li class="media"> is with overflow:hidden;, added style='overflow:visible;' and the dropdown appeared.
-
1
votes2
answers146
viewsA: GIT error with Mac OS X: dyld: Lazy Symbol Binding failed: Symbol not found: _iconv_open
I solved the problem, I found that in addition to the file .bashrc there was the file .profile with export DYLD_LIBRARY_PATH=/Library/PostgreSQL/9.3/lib, I commented on this line and the problem was…
-
3
votes2
answers146
viewsQ: GIT error with Mac OS X: dyld: Lazy Symbol Binding failed: Symbol not found: _iconv_open
I’m trying to use GIT from the terminal (Mac OS X), but the following error is appearing: $ git help dyld: lazy symbol binding failed: Symbol not found: _iconv_open Referenced from:…
-
1
votes2
answers5787
viewsA: How to take CSS values from one element and apply to other elements. Stick Footer
You can assign the style of one element to another as follows: $("#destino").attr("style", $("#origem").attr("style")).addClass($("#origem").attr("class"));
-
1
votes2
answers138
viewsA: Animation when the element reaches the center of the page (jQuery)
To know the exact center you will have to subtract half the width/height of the element by the width/height of the page. Example: posicao = $('.elemento').offset(); centro_horizontal =…
-
5
votes1
answer772
viewsQ: What does the crossDomain:false parameter in Ajax mean?
I’m implementing an image upload web application on Ajax and there is the parameter crossDomain:false in an example finding. What is the function of this parameter?
-
3
votes1
answer2125
viewsA: Table editing, Datefield field
In the Django 1.7 the Brazilian format is automatically identified, at least that’s what’s happening to me. No Django 1.6 i added the date format on Forms.py, ex: data_de_nascimento =…
-
30
votes2
answers22530
viewsQ: How to capture a photo through the user’s webcam and send via POST?
How to perform the user’s webcam image capture procedure on a registration form to submit via POST? I am looking for a solution that is compatible with most browsers and that is simple to implement.…
-
1
votes2
answers1764
viewsA: Bootstrap alignment is not correct
I added a size to the label col-sm-2 and it was enough to line up left field. In the documentation getbootstrap-Forms has that information.…
-
83
votes4
answers42074
viewsQ: What are the main differences between jQuery and Angularjs?
I am noticing the adhesion of Angularjs and the abandonment of jQuery by some developers, however I do not know the advantages of Angularjs because I have never worked with this framework. Since…
-
3
votes1
answer1004
views -
3
votes1
answer461
viewsA: Using javascript to create effect
You can use Jquery to achieve this through click and animate, see: $('.box').click(function(){$(this).animate({height:'100px'});}); More information on this link http://api.jquery.com/animate/…
-
22
votes5
answers7447
viewsQ: How to prevent spam in contact forms without using CAPTCHA?
I am looking for a simple and efficient solution to avoid spam in contact forms. The idea is that the customer does not need to inform that he is a "person" (example CAPTCHA), the form presented…
-
8
votes1
answer480
viewsQ: How to mix two colors using Javascript?
There are two fields where the user reports a hexadecimal color. By clicking on mix colors, a calculation shall be made in JavaScript and this will have to present a picture painted with mixed color…
-
1
votes1
answer147
viewsA: Problem repeating background gradient
I don’t know if I understand what you want, see if this is it: HTML <div id='externo'> <div id='interno'></div> </div> CSS #externo{ background: -webkit-linear-gradient(left,…
-
15
votes4
answers9578
viewsA: What is the modern alternative to framesets?
In addition to the solutions already presented by @Bacchus and @Andrey, can be done with Ajax and object: Through Ajax $.ajax({ type: "POST", url: "some.php", }) .done(function(conteudo) {…
-
3
votes2
answers1390
viewsA: Dynamically change a class background
Just complementing Sergio’s response if you don’t use the tag style in your HTML, you can do as follows: if($('style').length){ var style = $('style').text(); var newStyle = '.color {color: red; }';…
-
6
votes2
answers7033
views -
2
votes1
answer1966
viewsA: How to copy a text to the Clipboard using Zeroclipboard?
See if you are importing correctly or if you are omitting some code compared to this example: HTML <html> <body> <button id="copy-button" data-clipboard-text="Copy Me!" title="Click…
-
3
votes2
answers680
viewsA: How to create the fade effect on a link that uses Sprite?
I made an example here using opacity, see: HTML <a href="#" class="botao"><span>Contrate agora</span><span></span></a> CSS .botao { display: inline-block;…
-
1
votes3
answers1664
viewsA: How to create a plugin for jQuery’s $() function
If I understand correctly, you are wanting to create a function to format a date through JQuery. If that’s it, you can do it like this: (function( $ ){ $.fn.formatadata = function() { //formata a…
-
2
votes1
answer173
viewsA: How to organize my models in the construction of a photo album in Django?
It will depend on what you want. Case 1 If you want to indicate that an album has n photos and these photos can be in more than one album, the structure can be like this: # codigo 1 Class…
-
4
votes2
answers156
viewsA: Is it possible to have more than one CSS rule for an "img" in a "div"?
You can check the size of each image and assign a style using JQuery as follows: $('img').each(function(){ if ($(this).width() > $(this).height()){ //$(this).css(); }else if ($(this).width() <…
-
2
votes2
answers498
viewsA: View navbar only when user scrolls up on iOS
Can’t do that on iOS. There’s an explanation here: http://developer.apple.com/library/IOs/#Documentation/Appleapplications/Reference/Safariwebcontent/Handlingevents/Handlingevents.html Basically,…
-
2
votes3
answers228
viewsA: How to do repeating background with sprites?
You can do this using only css: CSS .botao { background: -webkit-linear-gradient(#3f3f40, #161617); /* For Safari 5.1 to 6.0 */ background: -o-linear-gradient(#3f3f40, #161617); /* For Opera 11.1 to…
-
1
votes1
answer250
viewsA: How to create separate objects from a loop?
Put inside a list: class linha (): def __init__ (self, texto): self.texto = texto def criador (): lista = [] for i in range(5): a = raw_input ('escreva: ') lista.append(linha(a))…
-
4
votes1
answer740
viewsA: How to link when clicking a div
To open in a new window use window.open (as bfavaretto warned): $('#minhadiv').click(function(){ window.open('http://www.google.com'); }); To open in the same window use window.location:…
-
1
votes1
answer140
viewsA: "repaint" in javascript, is there?
If the problem occurs only when you change the size of the window, you could disable and activate the plugin again after performing the resize: $( window ).resize(function() { // desativa e ativa…
javascriptanswered Paulo 9,980 -
0
votes2
answers351
viewsA: Jquery . click or Function
It’s always best you leave the JavaScript unlinked separate from the HTML, as well as CSS. Regarding functionality, the result will be the same, it is more a matter of organization and practicality.…
-
37
votes3
answers8575
viewsQ: Why is it recommended to use the "in" unit instead of "px" for fonts?
I see some sites when defining the font-size use the unit em, in a brief survey I read that it is recommended to use em in sources for being better than unity px. After all, what would be the right…
-
0
votes2
answers654
viewsA: Problem decrypting hash in Base64
Macos decoded "q? 6?" but I used it --decode: echo zuQCCnEXtTamg | base64 --decode ?? q?6?Paulo:~ paulo$ On this website http://www.base64decode.org the result was "Q6"…
-
4
votes4
answers11584
viewsA: How to put a Python module in a different folder than my script?
Try to return a directory and indicate the path. Example: script py. from ..pasta3.modulo1 import Mod1
-
2
votes1
answer1757
viewsA: To assign the value of a variable that is in a Javascript function, for an SQL query.
You can use jQuery.ajax() to perform this procedure. Example var request = $.ajax({ url: "pagina_que_fara_a_consulta.php", type: "POST", data: { sua_variavel : conteudo }, dataType: "html" });…
-
148
votes5
answers6116
viewsQ: What is the difference between the functions var name = Function() and Function name()?
I see in some codes different ways to define a function, but I don’t know the difference if it exists. What is the difference between these functions? Function 1 function teste(valor){ return (valor…
javascriptasked Paulo 9,980 -
7
votes3
answers12698
viewsA: Difference between dates
Example: date1 = new Date('2014/01/01'); date2 = new Date('2014/04/01'); var diferenca = Math.abs(date1 - date2); //diferença em milésimos e positivo var dia = 1000*60*60*24; // milésimos de segundo…
-
1
votes2
answers278
viewsA: Slow to load facebook like button
First leave your div main with opacity:0. Then use Jquery to check if the Facebook button has been pressed and finally make all appear together. Example: $( ".facebook").load(function() {…
-
4
votes1
answer422
viewsA: Match javascript variable to php variable
You’ll need to use Ajax to perform a query and return whether or not this car exists in the database. It is not possible to do it the way you want because the page has already been loaded. Take a…
-
7
votes3
answers238
viewsA: How to stop three loopings for in C
I found this solution in stackoverflow in English, there are other. for(int i = 0; i < 1000; i++) { for(int j = 0; j < 1000; i++) { if(condition) { goto end; } } end:…