Posts by Blau • 966 points
26 posts
-
1
votes3
answers456
viewsA: Why does IDLE not finish running the program automatically?
In fact, IDLE does end the execution of programs. The problem is that it has two basic components: the Python console (known as "interactive mode") and the editor. Programs loaded into the editor…
-
8
votes1
answer17396
viewsA: Separate text in two columns
No, only CSS2 does not exist, but CSS3 is not so incompatible, and you can design an alternative layout/script for obsolete browsers with the language you know best. With CSS3, it would be enough:…
-
2
votes1
answer169
viewsA: Centering a horizontal div
A quick solution, as long as you don’t worry about semantics, would be to use the attribute display:table, instead of display:block in their Ivs, thus: <div id="paginador-wrapper"> <div…
-
1
votes2
answers11265
viewsA: How to edit the CSS of an iframe?
By definition, iframe allows you to open an external document, whether on the same server or on others. Some javascript solutions can help you do what you want, but only if it’s a document on the…
-
5
votes1
answer593
viewsA: PHP: Function as a condition for an if
Not only is it possible, it is extremely common to use. if (is_array($a)) { // função que verifica se $a é uma array // e retorna verdadeiro ou falso... if (minha_funcao($a)) { // função criada pelo…
-
0
votes3
answers3361
viewsA: Configuration of . htaccess to access several PHP files within the same folder
Before answering the question itself, an important detail that can cause a lot of confusion in your tests: do not forget to set the base path! This can be done in . htaccess, but the simplest way is…
-
2
votes2
answers180
viewsA: Why does the universal selector * have a negative impact on browser rendering?
The main argument against the universal selector was not so much performance, but the impact it caused on property inheritance. In practice, neither loss of performance nor inheritance problems were…
-
4
votes1
answer9410
viewsA: Active link with CSS :active
The problem here is a conceptual mistake. To pseudo-class (That’s what it’s called) :active is used to identify one of the four states of a link, that is, if it corresponds to the moment you click…
-
8
votes1
answer11259
viewsA: Python with Windows Form or graphical interface
Python works with various toolkits for graphical interfaces, such as Gtk, Qt and wx, but standard Toolkit is Tkinter. A basic example you can try: from Tkinter import * def Cumprimente():…
-
4
votes3
answers795
viewsA: creating a group of random numbers that are unique
It all depends on what you mean by "unique" and what you will do with these numbers. In principle, uniqid() returns hexa values that you can convert to decimals: $uid = hexdec(uniqid()); Another…
-
1
votes1
answer635
viewsA: Insert selected value in array/drop down in database
Everything indicates that Rsform! transforms the value of select into an array where the first element is the code of the option and the second is the option itself. In this case, just get the…
-
3
votes5
answers22327
viewsA: Simple Rotary Banner
It is perfectly possible to do this only with HTML and CSS. Simply place each slide in a DIV with an anchor, enclose them all with another DIV, which will be your container, and create links within…
-
2
votes3
answers525
viewsA: Doubt with Mysqli and PHP OO
More directly answering your question: I would have to pass variables by parameter ALWAYS there in the function? At some point you have to pass the arguments, either by defining class properties, or…
-
2
votes1
answer262
views -
5
votes1
answer226
viewsA: Server Side rendering need for javascript content - Angularjs
As it is in the article itself that you cite, in general the answer is no, since observed some details: Scripts in separate files with blocked access (via robots.txt) will not be executed and…
-
0
votes1
answer215
viewsA: .htaccess - rewriting non-user-friendly URL
More generally, since it is not known what you want or how you will use your . htaccess, to get the query string "l", it would be enough: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d…
-
0
votes4
answers3461
viewsA: How to center a rectangular image on a square div
If I wanted to use only Javascript, CSS and HTML, I would do so: Javascript: <script type="text/javascript"> var img = new Image(); img.onload = function(){ var height = img.height; var width…
-
1
votes2
answers547
viewsA: PHP delete values from the form if successful
In PHP, there is no effective way to unset $_POST as a whole. You can even unset the keys you used, for example: unset($_POST['imgName']); unset($_POST['imgLink']); ... But anyway, the only…
-
1
votes1
answer2285
viewsA: Text position in Tkinter
From what I understand, you need 5 Abels to display 5 numbers side by side. If that’s right, instead of creating 9 Labels, one for each button, you can create 5 without any definition of text, but…
-
3
votes2
answers1371
viewsA: Use mysql_fetch_assoc more than once
From what you say in the description, it seems that the first search already gives you all the results you need, and your only problem is that mysql_fetch_assoc keeps changing the internal pointer…
-
2
votes3
answers3696
viewsA: Merge arrays in php
If you really need to name the keys the way indicated, the other answers are all good options. However, if the sizes of the two arrays are always equal and the values are aligned, there is still…
-
6
votes5
answers74116
viewsA: Removing a specific element in an array
You can use "array_diff" to remove one or more elements from an array by values: $input = array("item 1", "item2", "item3", "item4"); $remover = array("item2"); $resultado = array_diff($input,…
-
2
votes1
answer1156
viewsA: Changing sequential values of a multidimensional array
I’m still not sure if I understand, but it seems like you want to keep order by "name" as it was generated in the while loop. If so, you could add more of this reference array to the multisort…
-
1
votes2
answers2221
viewsA: Dynamically change label value
Look at this other example: #!/usr/bin/env python # -*- coding: utf-8 -*- from Tkinter import * # Funções... def Cumprimente(): hello.set("Olá, mundo!") # Interface... gui = Tk() gui.title("Olá…
-
4
votes2
answers426
viewsA: PHP: elements with and without explicit keys in the same array
It would appear that the answer to the original question is indeed nay, there is no PHP way to differentiate elements with and without keys within the same array. But, the original problem stemmed…
-
5
votes2
answers426
viewsQ: PHP: elements with and without explicit keys in the same array
I’m trying to figure out a better or cleaner way to do something like this in PHP: // Isto será passado como argumento de uma função... $params = array('Nome', 'Idade', 'Mail' =>…