Posts by fernandosavio • 9,013 points
290 posts
- 
		2 votes1 answer60 viewsA: Problem with Grid in cssJust add .row > .column:last-child { margin-bottom: 0; } The last column of each . Row will not have margin-bottom and your problem is solved. Just adjust this rule to the screen size you need.… 
- 
		0 votes2 answers83 viewsA: Database connection problemThe connection string is wrong, the connection format would be: jdbc:microsoft:sqlserver://HOST:PORT;DatabaseName=DATABASE It seems your connection would be:… 
- 
		4 votes1 answer4237 viewsA: Align images side by side grid bootstrapYour images are with the class pull-left, using float: left making your images not in the HTML element stream. To tidy up you can put the class clearfix in containers (Documentation). <link… twitter-bootstrapanswered fernandosavio 9,013
- 
		3 votes2 answers2519 viewsA: How to compress a folder with everything inside using python zipfile?Use the module shutil which is much more practical. Example: ... ├─── minha_pasta/ │ ├── tudo/ │ │ ├── sub_pasta_1/ │ │ │ ├── arquivo_1 │ │ │ └── arquivo_2 │ │ ├── sub_pasta_2/ │ │ │ ├── arquivo_3 │… 
- 
		3 votes2 answers1096 viewsA: How to set custom name in Javascript array index?The correct(and only) way to have a string-index data structure is to create an object. Ex.: var validation = { 200: ['icon-check', 'The key match with the message!'], 400: ['icon-close', 'The key… 
- 
		0 votes2 answers319 viewsA: Create playlist with select-option and video elements, Object and embedThis site talks about a technique that consists of using the tag video usually with their sources, and after the last source you add a Flash player for compatibility. EDIT My initial answer does not… 
- 
		0 votes3 answers1807 viewsA: How to do something asynchronous with jQuery, search in Mysql with PHP?You will have to have a page to receive this ajax request. I illustrated below, the connection to the bank is fictitious, just to illustrate. ajax.php // Apenas para exemplificar uma conexão com o… 
- 
		7 votes3 answers129 viewsA: Split a string that contains scoresA more general approach would be to use regex to solve the problem. $string = "Eu irei amanhã à casa. E tu vens?"; /* Adiciona um espaço em todos os boundaries da string Ex.: Início e fim de… 
- 
		5 votes3 answers494 viewsA: Extract information from a.txt fileYou can use the command tr to replace the : for and then use the command cut to select only the even columns. Ex.: cat arquivo.txt | tr ':' ' ' | cut -d' ' -f2,4,6,8 TR: replaces all the colon for… 
- 
		0 votes3 answers105 viewsA: How to reuse this js in other elementsYou can add an event Handler to all buttons where Handler switches a class that gives visibility to your session. Follow an example: var btns = document.querySelectorAll('.toggle'), i, l; function… 
- 
		4 votes4 answers898 viewsA: SQL Count ParoleYou will need to select all records, group by value and use the aggregation function COUNT. So the COUNT will count the records of each separate group. SELECT data, valor, COUNT(valor) as quantidade… sqlanswered fernandosavio 9,013
- 
		0 votes1 answer780 viewsA: How to fix issues with responsive website when redirecting browser window on DESKTOP?This happens because the function $.toggle applies an animation and at the end of this animation adds display: none; at the style of the element she fostered. So what’s happening is that after… 
- 
		2 votes2 answers1539 viewsA: How to add Jquery to a wordpress page?Encapsulate your code in a closure, this way: (function($){ $(document).ready(function(){ $('.data-encerramento').each(function (){ var $this = $(this); var timestamp = $this.html(); var a = new… 
- 
		0 votes2 answers62 viewsA: Show answers at random without repeating and post methodPHP has the function shuffle() altering an array in-place, that is, changes the original array. To use this function you could do so: $items = [ $row['RespostaCorrecta'], $row['RespostaErrada1'],… 
- 
		1 votes2 answers207 viewsA: Search multiple tables at onceI created a new answer because I had a completely different approach to the previous one. I checked the database you are using and with two queries you can return to the ZIP code. A query to find… 
- 
		1 votes2 answers207 viewsA: Search multiple tables at onceIn the Wikipedia has information on how the structure of a CEP works: States 0xxxx: Grande São Paulo (01000-09999) 1xxxx: Interior and coast of São Paulo (11000-19999) 2xxxx: Rio de Janeiro… 
- 
		2 votes3 answers1740 viewsA: How do I know how much memory my application uses in PHP?The function memory_get_usage returns the number of bytes allocated to the script. An example taken from the PHP documentation: // É apenas um exemplo os números serão diferentes dependendo do… 
- 
		2 votes7 answers874 viewsA: Extract Array content for PHP variablesThe mistake is where you use the var_dump(). Look at the documentation of var_dump() and you will see that this function does not return any value. The right thing would be: $reference =… 
- 
		0 votes4 answers691 viewsA: How to send form data to mysql?Array to string conversion is an error that happens when the programmer uses an array when PHP expects a string. Since PHP doesn’t know how to turn this array into a string, it launches the error.… 
- 
		4 votes1 answer2219 viewsA: Loading modal during time consuming jquery functionUses a <div> backdrop and a GIF or SVG spinner. Leaves the backdrop with display: none; by default and display: block; when you have class active. Then to activate the spinner just do… 
- 
		2 votes2 answers181 viewsA: Modal Bootstrap - Navigate element within modalWhat you can do is assign one id at the .modal-dialog and use it as an anchor. There at the end of the text insert a link to this anchor. Example: <div class="modal-dialog" role="document"… 
- 
		1 votes1 answer194 viewsA: Even by placing the <table> inside a <div> I cannot define marginI created a Codepen to demonstrate that only the block of code is needed to be inserted on the page, without adding numerous <html> tags. http://codepen.io/fernandosavio/pen/EZNEdX For better… 
- 
		2 votes2 answers326 viewsA: Open updated PDF fileA better approach would be to use the header() to inform the browser that the content of the request must not be cached. header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1… 
- 
		5 votes2 answers628 viewsA: How do I search a combo field as I type the text?The link posted by @Guilherme-reis is from 2012 and may not solve your problem. The Typeahead.js is a jQuery plugin made by the guys who made the Bootstrap. In this article of scotch io. they… 
- 
		1 votes1 answer409 viewsA: How to display the form number in phpYou can use the field id from your command table to do the counter, like this: -- Retorna o último id. SELECT c.id FROM comanda as c ORDER BY c.id DESC LIMIT 1; Or if the exposed ID is a problem for… phpanswered fernandosavio 9,013
- 
		1 votes1 answer329 viewsA: Open a banner when you visit the siteYou can use a modal to display an image when the site is loaded. There are several libraries that include modals, such as Bootstrap, Foundation, Bulma, Semanticui, etc.... If you don’t use any of… 
- 
		2 votes2 answers174 viewsA: SetInterval() and load() functions and traffic problemsYou can use Server-Sent Events instead of pooling... Client-side: var evtSource = new EventSource("ssedemo.php"); //Once you've instantiated your event source, you can begin listening for messages… 
- 
		1 votes2 answers90 viewsA: Search for two Mysql tables in phpI don’t have much to add to your query. I’m creating that answer just to show you what it is Heredocs and how to interpolate variables in it. <?php $sql = <<<SQL SELECT c.lugar,… 
- 
		1 votes2 answers117 viewsA: Very slow javascript in safari mobileThe way you did, the code performs a search in your HTML for the id element txtDesconto every time #aumentaDesconto is clicked. One way to optimize is to cache the elements used repeatedly, because… 
- 
		1 votes1 answer390 viewsA: Enter values and click the button automatically at the set timeI imagine you have to make a loop to test the time, if the time fills the fields and gives a Submit in the form. var horario = { hora: 18, minutos: 0 }, login = { email: "[email protected]", senha:… 
- 
		1 votes1 answer1359 viewsA: Someone knows a library that calculates integral and derivatives in javaI believe that this response of stackoverflow answer your question. Of the libraries described in the most relevant answer (in my opinion) is Commons Math Libray which is maintained by Apache.… 
- 
		1 votes1 answer140 viewsA: Add information to a map in SVGYou can select SVG elements normally, as if they were HTML. I created an example from your example, where it prints in a <h3> the attribute xlink:href of each state. Jsfiddle I put a class… 
- 
		2 votes3 answers751 viewsA: Send email with dynamic content in PHPThe very one Mailchimp already comes with this feature, it is called Merge Vars. (Mailchimp uses Mandrill as an email delivery) Merge vars are available through API or SMTP Headers. Email example:… 
- 
		3 votes2 answers7305 viewsA: How to compress images in PHP?There are several image processing libraries, some I know are: GD2 Imagemagick I advise you to use the Imagemagick (that is why). Some things you can do to let your images get smaller and smaller.… phpanswered fernandosavio 9,013
- 
		1 votes1 answer2355 viewsA: How to export data to Mercadolivre? [PHP/JSON]After the authentication is done you need to know which is the endpoint of the API you’ll need to use. In your case it’s endpoint search (https://api.mercadolibre.com/sites/MLA/search) So if you… 
- 
		5 votes1 answer12243 viewsA: How to use the Row class in bootstrap?According to the twitter documentation Bootstrap the answers to your questions are the following: In bootstrap it is mandatory to use the "Row" class to wrap the columns? Columns create gutters… twitter-bootstrapanswered fernandosavio 9,013
- 
		11 votes3 answers1729 viewsA: Regex to find occurrences of one word before the otherWhat I searched for has a flag to use in Sublime that makes regex multiline. Try with the Regex: (?s)TdxBar.*?TAction The (?s) tells Sublime that the regex is multiline causing the . also marry with… regexanswered fernandosavio 9,013
- 
		1 votes2 answers277 viewsA: How do I use the jsondiffpatch library?According to the library documentation just use the function patch that comes with the library. Ex.: var original = [ {"id":1004,"idproduto":3,"forma":"Alface","preco":1,"quantidade":1},… 
- 
		0 votes3 answers1265 viewsA: Show / Hide div by clicking on menuThe mistake I saw there that you’re using String.match as a comparison if. The method String.match(RegEx) server to test if the string matches the regular expression (Documentation here) So if you… javascriptanswered fernandosavio 9,013
- 
		3 votes4 answers3446 viewsA: Javascript function for zeros on the left with MVC 5You can use the method String.padStart() to fill your numbers with zeroes on the left. "2".padStart(5, 0); // "00002" "123".padStart(8, 0); // "00000123" Case to compatibility is a problem, the…