Posts by Zuul • 35,190 points
501 posts
-
9
votes3
answers1361
viewsA: Validate different date formats
PHP 5 >= 5.3.0 You can make use of the functions of Datetime, particularly Datetime::createFromFormat: $date = DateTime::createFromFormat('d/m/Y', '31/10/2014'); echo $date->format('Y-m-d');…
-
8
votes4
answers5242
viewsA: What is the priority of HTML? "id" or "class"?
The answers already address the subject well, I just complement the existing ones with some notes. Summary The priority of CSS properties in an element is treated as follows: Properties prevail with…
-
6
votes1
answer839
viewsA: Install Serial for Android APP
I think the way forward will be App licensing service offered by Google Play: Google Play offers a licensing service that allows you to enforce licensing policies for apps you publish on Google…
-
4
votes1
answer73
viewsQ: Cache control for a specific file
If we want to implement a cache control for a particular file type, through the htaccess we can proceed as follows: <IfModule mod_expires.c> ExpiresActive on ExpiresDefault "access plus 1…
-
5
votes2
answers922
viewsA: How to bypass table tags that are inside the foreach in PHP and HTML
You have some issues to address so you can solve your problem. The information below will not solve your whole problem, but aims to create the basis so that you can handle the same: Opening and…
-
3
votes2
answers1125
viewsA: How to differentiate inputs that have the same class?
Collect value from own You’re attaching the event change to the field you refer to as the one you intend to collect the value, so that you can collect the value of itself, just refer to the object…
-
7
votes3
answers1789
viewsA: How to apply background-color to the p HTML element?
Solution via CSS The solution depends on the rest of your Markup, but if you have a <p/> within a <div/>, without adding more Markup you can assign the property display to your…
-
2
votes1
answer501
viewsA: How to separate tables in the same HTML that uses Javascript and display the result in boxes
Problem Your current problem is that you are using two Javascript functions both with the same name: // Antes do teu primeiro formulário var total = 4; function soma(campo) { /*...*/ } // Antes do…
-
5
votes1
answer1380
viewsA: Click on an element that triggers the click on another
The Javascript solution can be obtained as follows: function fireEvent(element,event) { if (document.createEvent) { // dispatch for firefox + others var evt = document.createEvent("HTMLEvents");…
-
3
votes2
answers1413
viewsA: Calculate the size of the div
Refine width of element Instead of animating a fixed distance in pixels, the ideal is to calculate the width that each element of the slider occupies and displaces that same measure. In jQuery you…
-
14
votes1
answer137
viewsQ: RFC6530 - Check if variable contains a well formatted PHP email address
Approval adopted by the Gmail as published in Official Gmail Blog, and as defined in RFC 6530: Assuming a function valida_email() that would return boolean: echo valida_email("té[email protected]"); //…
-
3
votes1
answer58
viewsQ: Check that process is running without bumping into the 15-character limit
With the following code we check if a process is running: #!/bin/bash #Verificar se processo abc está em execução if pgrep "abc" >/dev/null 2>&1 then printf "Está em execução.\n"…
-
14
votes4
answers80887
viewsA: How to force the opening of a link in another tab and not window?
As stated in this answer, the user decides whether the new windows go to a tab or even a window. The concept currently employed by browsers is that requests for new windows are opened as a new tab…
-
9
votes1
answer889
viewsA: Problem with the bootstrap
Your Markup indicates that you are using the plugin Togglable tabs bootstrap. Your problem If you scan your code and check the Bootstrap documentation for the plugin Togglable tabs, the way you are…
-
5
votes1
answer313
viewsA: What do I call a font variation in CSS?
In the Adobe Edge Web Fonts, the custom style i3 corresponds to Light Italic which shall be used as follows: body { font-family: open-sans, sans-serif; /* a fonte a usar e a font de fallback */…
-
3
votes1
answer461
viewsA: Error in CSS of Wordpress plugins
Probably your problem will be the lack of function wp_head() in your file header.php or index.php which is usually used with hook to load styles, scripts and meta tags: <?php ... /* Aplicar…
-
12
votes2
answers1285
viewsA: Ckeditor html content is empty after using jQuery-ui Sortable in your parent div
Solution B 2014-11-11 Indeed, what happens is that the iframe is automatically unloaded when we are dragging it because during dragging it is detached from the DOM. Therefore, except as previously…
-
3
votes5
answers758
viewsA: How to embed CSS in HTML tags?
There is a very interesting project in Github called Premailer.Net by Martin H. Normark to deal precisely with this subject: C# library for moving CSS to style attributes inline, in order to gain…
-
13
votes1
answer27404
viewsQ: Difference between CAST and CONVERT in Mysql
To solve a problem I came across two solutions where a function was used CAST() to convert a number into text, the function was used in another CONVERT() for the same purpose. The two functions, the…
-
2
votes1
answer115
viewsQ: Chrome auto page scrolling to select Multiple with selected option
When using the attribute multiple, the page when loaded, scrolls to the last <select/> containing a option with the attribute selected: Example in Jsfiddle <p>No Google Chrome a página…
-
5
votes2
answers271
viewsA: Print PHP array data
The most practical way is to store the HTML the cycle is generating in a variable and after that make use of the variable where desired: // iniciar variável a vazio $htmlDoForEach = ''; // por cada…
-
3
votes1
answer92
viewsA: Center element on a page
Without touching the Markup and without touching the CSS, you just need to change the position:absolute; to the position:relative; in the element with the class .logo. Absolute position: Jsfiddle…
-
7
votes1
answer2120
viewsA: Install a free app on an iPhone without a developer account
Jailbreaking Unfortunately it is not possible. Without a paid programmer account, you don’t have the necessary certificates to prepare your devices for the application installation. The term used in…
-
19
votes2
answers2622
viewsA: What to save in a login session?
To clarify Any login system implemented in PHP or in whatever language the login data, in particular the password or combination of password + username, is an insecure system. The security of…
-
4
votes1
answer777
viewsA: How to leave a fullscreen div with CSS3 and scrollTo with jQuery
Once you are making use of Bootstrap, I assume you have jQuery in use as well. So there is a solution to give you a starting point: Example in Jsfiddle /* Retirar da tag "body" a altura que a barra…
-
0
votes2
answers109
viewsA: Do not execute command line
For cases where it is necessary to make use of the os.execute, the same opens a terminal window that is open because the execution takes place in the same. To get around this, a solution is to make…
-
5
votes1
answer45
viewsA: Fix for Nth-Child(n)
Via CSS, the method used when supporting Internet Explorer 7 and 8 was by making use of the adjacent sibling selector: Adjacent sibling selectors + (English) /* equivalente ao li:nth-child(1) */ ul…
-
2
votes2
answers1972
viewsA: Sending Link Information to a Modal
The most practical way I can think of is for you to call modal where necessary, by doing so within a function where you first collect the data you need and send it to modal. Remove the modal call…
-
3
votes4
answers2981
viewsA: SQL Query Joining 5 tables
One or more consultations If you have a specific goal of performing a query to obtain certain information organized in a certain way, yes, the most effective way is a single query to the database…
-
9
votes3
answers13854
viewsA: Fill string with zeros on the left
You can perform as follows if it is a string: String str = "123"; String formatted = ("0000" + str).substring(str.length()); Note: Enter a zero for each desired digit, that is, 4 digits you mention…
-
8
votes2
answers2666
viewsA: Backup in Sqlite database
The solution below has been extracted from a response in SOEN and does what you want, although there is plenty of room for improvement and better portability: Import private void importDB() { try {…
-
1
votes1
answer65
viewsA: Difference between "Object(meuobjeto)" and "(meuobjeto as Object)"?
The difference between the two ways to accomplish the cast is in result when operation fails: Using as trace(mc as MovieClip); Will assign null in cases where the conversion fails. Involved in…
-
4
votes1
answer479
viewsA: Order ASC and DESC according to custom_field
I think it would be better to have two consultations, one with priorities ordered from 9 to 1, and the other with priorities 0 alphabetically ordered. With the results you can make use of the plugin…
-
7
votes2
answers417
views -
4
votes3
answers1232
viewsA: How to extract a word from a PHP URL
According to your question, whatever the URL is, there is a consistency that is getting the third word cut from the end: ┌─────────────────────────────────────────────────┬───────────────┐ │…
-
3
votes3
answers1338
viewsA: How to suspend the $_GET parameter if the array is empty?
The page code is on the client side, that is, it is in the browser and not on the server. So, via PHP you have no way to control what goes or does not go to the URL based on whether it is filled in…
-
6
votes3
answers2147
viewsA: Detect window resolution change
In Javascript we have an event handler for the resizing event window, the window.onresize (English). window.onresize = function(){ location.reload(); }; But attention: Triggering a page update in…
-
2
votes2
answers1301
viewsA: CSS condition with jQuery, e.g.: if div1 is visible the div2 will also be
In your code you are not checking whether the element is visible or not, you are checking whether it exists on the page. From what I understand from your logic, the element always exists on the…
-
2
votes2
answers10928
viewsA: Command to create site shortcut on smartphone?
Inform the user For websites there is no such command, the control of what happens on the device is on the user and not on what it uses. You must present a popup or something to inform the visitor…
-
3
votes3
answers1873
viewsA: if condition with Javascript inside PHP
Check on the PHP side Based on the code present in the question, the simplest is to check with PHP the contents of the variables, thus preparing the value to be used by Javascript on the client…
-
2
votes4
answers733
viewsA: How to check if there is only one position in the array element?
PHP In order to check if the second position is a space, you can make use of the function substr() or the function mb_substr() to collect the first two characters depending on the data single-byte…
-
4
votes2
answers1369
viewsA: Configure "Activity" hierarchy in "Androidmanifest"
The hierarchy of Activity is configured in manifest, where we can define which navigation is expected between them: Example: <activity android:name=".MainActivity"…
-
10
votes1
answer114
viewsA: Accented letters returning invalid character
It is totally possible, but you need to define the appropriate locale. For this you can make use of the function os.setlocale (locale \[, category\]) that will set the locale for the program:…
-
44
votes2
answers40509
viewsA: When to use Absolute or relative position in CSS?
Definition The property of CSS position sets alternative rules for positioning elements, having been designed to be useful in creating animations via script. It is usually used in conjunction with…
-
7
votes1
answer1002
viewsA: Semantically, which tag should I use for icons?
The tag <span/> is in fact the most commonly used tag to deal with problems like what you refer to. The HTML element <span> is a container Online Generic for phrasing content , which…
-
7
votes1
answer867
viewsA: Element moves out of place in "out-zoom"
The problem is that you are manipulating the position of your menu using a left margin, but it is always the same depending on the zoom given to the page. Menu solution in the center If you want me…
-
5
votes1
answer499
viewsA: How to adapt APP that uses TCP protocol to 3g connection?
At the application level, we usually don’t have to worry about what kind of data connection is available on the device. The operating system is the one who has this concern and management. By…
-
6
votes2
answers2126
viewsA: Multiple LEFT JOIN and slow search
Explanation of consultation Whenever an appointment is delayed, one runs EXPLAIN because the same gives you crucial information to understand what may be wrong. In your case, the EXPLAIN stresses in…
-
7
votes2
answers273
viewsA: How to return different answers with different values in equal Classes?
Your jQuery code is almost there, but when you work with multiple elements you have to refer to each element one by one, so you can act on each of the various elements found without influencing the…
-
6
votes1
answer114
viewsA: Click link highlight SVG
For the purpose of demonstrating how to achieve what you want, "Highlight" means the act of giving a different colour to the circle in question. In order to create your context, let’s use the…