Posts by Zuul • 35,190 points
501 posts
-
7
votes2
answers422
viewsA: Is it possible to combine first:Child with :Hover?
It is possible to chain both, but first you have to indicate the element li:first-child and only then the event :hover: li:first-child:hover { background-color: black; color: white; } <ul>…
-
6
votes1
answer219
viewsA: Automatic scroll bar
With Javascript, you can detect when the scrolling of a particular element has come to an end and at that point force the scrolling to the top and trigger the loading of the current page, making use…
-
5
votes1
answer451
viewsQ: What is SPF and DKIM and why do we need to configure them?
Every time we talk in emails, particularly newsletters, the terms arise SPF and DKIM. Many services of mailing online ask to configure these values in web hosting but do not mention the reasons,…
-
3
votes2
answers149
viewsA: Jquery does not run because of syntax
If you observe the error: Syntaxerror: Missing ) after argument list That translates: Syntax error: Missing ) after the list of arguments Ability to understand, with the help of indicating the line…
-
1
votes4
answers3380
viewsA: change class of the clicked element
A solution can go through the use of property cookie: Document cookie. Get and set the cookies associated with the current document. Specifications can be read in: DOM Level 2: Htmldocument.cookie…
-
3
votes2
answers40368
viewsA: Alignment of text inputs in HTML/CSS
It all depends on your Markup but using only CSS, without introducing new elements in the Markup beyond the required, we have managed to resolve the issue: form, label { display: block; padding:…
-
3
votes1
answer2109
viewsA: Query in mysql with php does not return result in queries with accents
You can perform the query without it considering the accent as follows: SELECT * FROM minhaTabela WHERE minhaColuna LIKE '%joao%' COLLATE utf8_general_ci Considerations The COLLATE depends on what…
-
5
votes3
answers1001
viewsA: Use OR operator in a PHP CASE
The existing answers explain this subject well, but for "educational" questions, I will leave a way to use the control structure switch as if of a if were it: switch with OR So we can use a || or…
-
17
votes6
answers12868
viewsA: What’s the difference between Isis and elseif?
We can read in the documentation that: elseif, as its name suggests, is a combination of if and else. Like the else, he extends a command if to execute a different instruction in the case of the if…
-
3
votes2
answers6194
viewsA: How to increment and decrement values with javascript
You already have an excellent solution, I will leave a version making use of the potentialities of Jquery for the purpose of code reduction and optimization of it: var $input = $("#txtAcrescimo");…
javascriptanswered Zuul 35,190 -
6
votes3
answers397
viewsA: Can reference arguments be harmful?
Harmful, I would say yes Currently I would say yes, can be harmful given the form as the whole process unfolds since version 5.3.0. As of version 5.3.0, if the function call has the &, a Warning…
-
2
votes1
answer96
viewsA: Continuous background audio
To summarize the play of an audio file at a certain position, the server needs to be configured correctly. The browser sends requests on intervals of bytes (byte-range) to collect and reproduce…
-
7
votes1
answer218
views -
12
votes2
answers1195
viewsQ: Difference from #! in the first line of a Python script
For a Python script to be executable on a Linux/Unix-based operating system, it must start with the designated shebang (#!): #! /usr/bin/env python But followed by the same I have seen used two…
-
6
votes1
answer2147
viewsQ: Pass variable value inside nested SELECT
Assuming the following query where we are selecting values, grouping them and then re-grouping the result: SELECT CONCAT (b.label, '|', b.slug) FROM ( SELECT group_concat(name SEPARATOR '$') AS…
-
6
votes1
answer183
viewsQ: Collect shared URL statistics on Facebook using Python
To collect statistics from a shared Facebook URL in PHP, I am using Curl to query the following URI: // URL para submeter $pageUrl = 'http://www.example.com/my-new-article-is-neat'; // URI a…
-
8
votes4
answers673
viewsA: Large integers and cousins
A solution making use of Forge: var bits = 1024; forge.prime.generateProbablePrime(bits, function(err, num) { console.log('número primo aleatório', num.toString(16)); }); Solution credit for…
javascriptanswered Zuul 35,190 -
5
votes1
answer225
viewsA: Height on video Html5
For the element <video/> stand at 100% height, the parent element, in this case <div id="video"/> has to have a defined height. Similarly, the height should be provided through the CSS…
-
19
votes2
answers594
viewsQ: Collect Google Analytics data for Mysql tables
I have seen many examples of how to export data from Google Analytics to other formats as well as keep the exported data updated, but none so far served to export the data to Mysql given the…
-
4
votes1
answer576
viewsQ: Gzip Javascript implementation
Javascript and Localstorage get along very well, but one of them is always saying that there is no space. The idea would be to get a solution, like Gzip in Javascript so we can compress the…
-
2
votes1
answer576
viewsA: Gzip Javascript implementation
There is an implementation LZW, very popular, which has been redesigned thinking about your current problem: lz-string LZ-string is designed to meet the need to store large amounts of data in Torage…
-
4
votes2
answers1373
viewsA: Shorten the string size
You have at least two alternatives to compress: gzcompress() This function compresses the string using the ZLIB data format. Decompress with gzuncompress(). gzdeflate() This function compresses the…
-
1
votes1
answer209
viewsA: How to change Private DNS in AWS
If you intend to access your servers by example.com instead of the name they generate, you will have to configure your own DNS server. By default, AWS VPC manages DHCP for you and comes with…
-
3
votes4
answers2426
viewsA: Color transitions with fade in a word
The "blinking text" effect can be obtained using CSS only: p { background-color: #000; } .piscar { color: #FFF; -webkit-animation-name: blinker; -webkit-animation-duration: 1s;…
-
6
votes2
answers853
viewsA: Normalize values separated by comma for new table
Mysql has no function that allows us to split a string in multiple lines, so the work becomes a little complex: SQL Fiddle INSERT INTO press_tags (press_id, tag_id) SELECT press.press_id,…
-
6
votes2
answers853
viewsQ: Normalize values separated by comma for new table
The idea is to stop having the column with the values separated by comma and pass them to an intermediate table: Source table Assuming a table with the name press with the following fields: id,…
-
0
votes1
answer3027
viewsA: How to free access to specific FOLDER or FILE using . htaccess?
Block access to files .PHP: <Files *.php> deny from all </Files> Authorize a specific file: <Files "meuFicheiro.php"> Order Allow,Deny Allow from all </Files>…
-
6
votes2
answers1558
viewsQ: Check if a parameter has been provided for the function
Assuming a Javascript function with parameters: function minhaFuncao (param1, param2, param3) { // fazer algo ... } And then using it as follows: var param1 = "bubu"; minhaVariavel = minhaFuncao…
-
1
votes2
answers1011
viewsA: Align vertically to center footer items
You can resolve the issue by declaring a height for the first row columns of your footer and then with a little CSS and property help transform, align the paragraphs vertically: .panel-footer .cell{…
-
2
votes1
answer5730
viewsA: Vertical Sidebar Menu using Bootstrap 3.3.2
In order to have a side navigation where only the icons appear and with the mouse on top appear the icons and the caption, you need a little CSS for formatting and Javascript to control whether or…
-
2
votes4
answers3635
viewsA: How to center a div with variable size and position Absolute?
You didn’t indicate your Mac to get a solution that is perfectly suited to your case, but there is a solution without resorting to CSS statements that might jeopardize the presentation of the page…
-
26
votes4
answers20055
viewsA: How to open a pop-up without using Javascript?
You can use CSS3 to create a popup, open and close it without using Javascript. The trick is in using pseudo class target which allows us to change declarations to the element .modalDialog and thus…
-
1
votes2
answers779
viewsA: Modify src of multiple images individually
If all you need to do is trade 100x150 for 300x500: $(document).ready(function() { $("img.miniatura").each(function() { $(this).attr("src", $(this).attr("src").replace("/100x150/", "/300x500/"));…
javascriptanswered Zuul 35,190 -
2
votes2
answers662
viewsA: How to select all BD data and do a repeat word count?
What you describe can be done via Mysql without PHP. Given the way you have the records, my suggestion is to use a temporary table to insert a record for each value that is separated by comma and…
-
5
votes2
answers174
views -
28
votes7
answers30495
viewsA: How to differentiate phone types
Structure of the Brazilian Telephone System Numbers can essentially have 4 portions: Country prefix (two digits): Country call code: +55 Carrier prefix (two digits): 12 - CTBC 14 - Brasil Telecom 15…
-
3
votes2
answers308
viewsA: Rewind image and return to function
The code you currently have is making use of a temporary file that has just been sent to the server: $filter = new ImageFilter; $score = $filter->GetScore($_FILES['photoimg']['tmp_name']); To use…
-
1
votes2
answers1260
viewsA: Changing a variable’s value with a PHP check box
Essentially what you’re looking for is to submit the form when someone clicks on checkbox instead of using links. For this purpose, you can add an attribute onChange to the element checkbox that…
-
3
votes1
answer176
viewsA: Transforming a Javascript function for PHP
1st Problem The problem you indicated is caused by using the wrong function for the desired purpose. If you intend to share one string in array using a comma separator character, you need to use the…
-
1
votes1
answer190
viewsA: Module with multiple controllers in Zend 2
In the file module.config.php of your module, you have to declare the invokables for the controllers as well as add the routes for each controller. Routing and controllers 1st Solution For what you…
-
13
votes2
answers397
viewsA: Is support for users who do not use Javascript running out?
Javascript, over the years, has become much sought after, having given rise to a whole universe of frameworks with which the Internet today seems not to survive. Brendan Eich was the creator of the…
-
7
votes3
answers1055
viewsA: Is there any performance gain when using ternary operator instead of a conditional operator?
Disambiguation The ternary operator as it is called is a conditional operator, commonly known as ternary operator as part of the ternary operator group (3 operands). Both make use of a condition by…
-
20
votes4
answers35105
viewsA: Use of ? and : in PHP
In your example, the same makes use of a conditional operator whose condition is separated from the results by the character ? and the results separated by the character :. What is a conditional…
-
3
votes2
answers479
viewsA: Fancybox with Facebook share button
A more elaborate solution in case you want to have the Facebook API up and running to get their button and count of shares performed: JS Before displaying, we generate the HTML for the button. After…
-
0
votes2
answers479
viewsA: Fancybox with Facebook share button
One solution, the simplest I can think of, is to create a normal link, with a picture of the button and make use of the sharer.php: JS Your call from Fancybox would be as follows:…
-
4
votes1
answer39
viewsA: A background is loaded even when a rule is not applied over an element?
The behavior varies from browser to browser, although it is something in constant improvement. A very interesting article: Media Query & Asset Downloading Results In English, published on…
-
7
votes2
answers58
viewsQ: Determine the direction of the roll in an element
The code below aims to detect the direction of the roll in a specific element: var control = 0, lastScrollTop = 0, element = document.getElementById('idDoElemento'); element.onscroll = function() {…
-
7
votes2
answers22499
viewsQ: Add attribute to an element
In Javascript we can add the attributes to a given element with at least two ways: var div = document.createElement('div'); div.id = 'meuId'; or var div = document.createElement('div');…
-
5
votes2
answers1436
viewsA: Send email attaching a local file
You can use the class Phpmailer to facilitate the sending of the email. Follow an example of how you can achieve what you want: // Incluir a classe no teu ficheiro require_once…
-
1
votes1
answer255
viewsA: Equivalent of mysql_result in PDO
In PDO you can get the count result as follows: $sql = "SElECT COUNT('id') FROM anuncios WHERE categoria=:categoria AND estado=1"; $result = $con->prepare($sql);…