Posts by Rafael Almeida • 2,585 points
57 posts
-
2
votes1
answer487
viewsA: Questions about Script Coroutine c#
You need to put the yield before the commands you want to execute. In the current way the code is executing the commands before the yield and then waiting x seconds to do nothing else. Example:…
-
1
votes1
answer110
viewsA: a more efficient way to make the Insert bind and update large
As a parameter of execute(), you can enter an array with the key/value relation of the Binding parameters. This way, it is only popular the array and pass as method parameter. Example: $bindingArray…
-
2
votes1
answer48
viewsA: How to get a Type from a string
Use the function CreateInstance, informing all the way to the class: var obj = Activator.CreateInstance(Type.GetType("System.Windows.Forms.Button")); You can also use a cast in creating the variable…
-
1
votes1
answer59
viewsQ: Get Type from a class without instantiating it
I need to get the Type of a class without instantiating it, I tried to do that way: variavelQualquer.Type = new ClasseA().Type; // Type é uma variável pública que guarda o valor do método GetType()…
-
11
votes3
answers191
viewsQ: Has the standard Java output function accepted several parameters?
My teacher taught the class to use the System.out.println("Mensagem") this way for the class (the type of total_alunos it doesn’t matter): System.out.println("Existem ", total_alunos, " alunos na…
javaasked Rafael Almeida 2,585 -
5
votes1
answer399
viewsQ: Is it a good idea to insert SVG inline files?
I’ve been going through some websites and the ones that use SVG logos usually put them in a file separately. This brings the practicality of when you change the file, on all pages it changes, but…
-
2
votes2
answers2331
viewsA: Save to database using jquery
You’re mixing things up. The jQuery shouldn’t be never placed in inline HTML, just like Vanilla JS, this is a horrible practice that should be avoided to the maximum. You need to make a Handle in…
-
2
votes2
answers1027
viewsA: Place an HTML tag on the </body> using string (PHP)
Use the htmlspecialchars() to print the text: echo htmlspecialchars($texto); This function will escape all HTML special characters. One detail, your PHP code is invalid, because you are opening the…
-
-1
votes2
answers294
viewsA: include is only inserted after the <body>, and would like it to be included earlier
Use the file_get_contents together with the echo: <html> <head> <?php echo file_get_contents('head.php'); ?> </head> </html>…
-
0
votes2
answers90
viewsA: Bootstrap Responsive Wordpress
This is happening because you remove the sidebar but don’t increase the content size. Probably your CSS rule should look like this: @media screen and (max-width:1119px){ div.sidebar.col-md-4 {…
-
3
votes2
answers1183
viewsA: Dynamic Link? And how to implement?
I think I understand what you mean. I made a solution in PHP, but you can use the same logic in another language. These /../ mean that the URL is shortened, and the removed content is where the dots…
-
1
votes1
answer1340
viewsA: Decrease height of "Row"
Why don’t you just set a width for the element via CSS? body { background-color:#ccc !important; /* Apenas para ver a barra melhor, não é necessário */ } div.progress { margin:50px auto; /*…
-
2
votes1
answer98
viewsA: Div with float does not adjust the grid
Always provide the code needed to solve the problem. The solution is to use the property display: inline-block, so all the lists would line up next to each other. Next to this, you can also use the…
-
1
votes2
answers844
viewsA: Why does this menu not work in the mobile version?
The menu is working, but on the mobile the event is activated several times, giving the impression that the menu is stuck. This becomes more evident we change the color of the button every time the…
-
1
votes2
answers436
viewsA: how to change right browser cursor and scrollbar
The cursor you can change using the property cursor specifying an image. Example: elemento { cursor:url(http://placehold.it/15x15); } It is always good to give a second argument, so that when the…
-
4
votes3
answers812
viewsA: jQuery is still "necessary"?
"The following features are easily accessed today with native Javascript from browsers" And always have been, how do you think jQuery was written? jQuery is Javascript, your use is just to shorten…
-
2
votes1
answer78
viewsA: Problem with javascript array
What you are trying to do is wrong, the displayed result is totally predictable. Imagine the following variable: var palavra = "carro"; In Javascript, everything is an object, so we can take parts…
javascriptanswered Rafael Almeida 2,585 -
5
votes2
answers2452
viewsA: How to remove a specific part of a string
If you use PHP 5.2.0 up, you can use the function pathinfo with the constant PATHINFO_FILENAME, this will return you only the file name. So, just concatenate the .zip: <?php $nome_arquivo =…
phpanswered Rafael Almeida 2,585 -
4
votes2
answers8872
viewsA: How to repeat an HTML CSS image
You will not be able to repeat the image using the background-repeat: repeat-x; because there is actually no specified background. What you need is to load the image you want through the…
-
56
votes3
answers39993
viewsA: How to implement google reCAPTCHA on my website?
Introduction to reCAPTCHA reCAPTCHA is a new Google tool to protect your site from spammers and bots. It comes from a new idea, because until then the Caps were seen more as an obstacle than a…
-
1
votes2
answers307
viewsA: pass php value to js giving error
The problem is that you are setting $teste = $row['nome']; outside the while, that is, there is no longer the variable $row['nome']. Ideally you set the variable outside the while (before), and…
-
3
votes1
answer191
viewsA: WAMP does not store
Your connection is using functions of mysqli_*, and in your query you use mysql_*. The right thing to do is to adapt everything to Mysqli. But don’t think about any moment switch to Mysql! And a…
-
4
votes1
answer610
viewsQ: Delete the last value in an array
I have an array in which each index contains a letter, which together form a sentence. I was unable to delete the last array value. After searching a lot, I was able to delete, but I think the code…
rubyasked Rafael Almeida 2,585 -
10
votes1
answer4173
viewsA: Difference between $(window) and $(Document)
$(window) The object $(window) refers to the window, viewport of the browser that is running the site. With it it is possible to capture the window dimensions, how much the user used the scroll,…
-
2
votes3
answers448
viewsA: Call a preloader before sending contact
Do you want the code to make the gif appear? I believe this is your responsibility, what you are looking for must be logic. It’s very simple, you want an image to appear when you click to send, and…
jqueryanswered Rafael Almeida 2,585 -
3
votes4
answers342
viewsA: What is the function of the " | " operator within the catch?
The symbol serves exactly for what you have guessed, it is like an "OR". It serves for you to capture multiple exceptions in a single block catch, instead of making a catch for every exception. For…
-
1
votes1
answer345
viewsA: Tag Catch Size Other TAG
This is not possible via CSS as it only changes the style of the elements, does not interpret their values. The height: 100% causes the element (in this case, iframe) is 100% tall compared to the…
-
6
votes2
answers1019
viewsA: How to take an attribute of multiple "tags" with same ID
When you click, you click on the element a, so your selector can changed to $('#linkPost a'). With that we can catch the #linkPost using the function parent(), since a is son of #linkPost. It is…
javascriptanswered Rafael Almeida 2,585 -
3
votes2
answers693
viewsA: CSS content property generating an image
Icon Fonts The name of this is called Icon Fonts, it is a technique used to show "icons" more lightly. As you may know, we can resize a font as far as we want it to not lose quality, but this does…
-
1
votes1
answer788
viewsQ: Array is not converted to JSON
I treat some functions via PHP and in the end return to the client via AJAX useful information. Such information is contained in a array which is converted to JSON through json_encode(). The problem…
-
0
votes1
answer169
viewsA: Scroll to the next Section
After a little bit of head-breaking I managed to make a script that is close to your needs. Having the following page: #navegacao { padding:5px; border:1px solid #eaeaea; position:fixed;…
-
0
votes0
answers46
viewsQ: Encryption function better than md5?
I read a couple of articles about the encryption md5 should no longer be used, since it is not considered safer (also pudera, in 5 minutes I enter a any website and break such a password). I have…
-
1
votes2
answers72
viewsA: Button animation does not happen
CSS transitions happen due to property transition, without it the changes of properties of the elements will happen "abruptly". To make any exchange (as long as Transition affects these) of elements…
-
0
votes5
answers934
viewsQ: Alternatives to center the img tag
I thought the problem was simple, but I can’t in any way center an image that’s inside a div. I have images of various sizes and would like to center them horizontally, but I can’t use the property…
cssasked Rafael Almeida 2,585 -
5
votes2
answers1331
viewsA: What is the difference between Animation and Transition CSS
The two properties are to control transitions of other properties, but there is a small different related to the control of this transition. Transitions You must have already spent an hour that you…
-
0
votes2
answers360
viewsA: Return Divs to start position
If you notice, when it moves div using the draggable jQuery UI, the element automatically receives the position as relative, and then its Top and Left positions are named 0. You can use this in your…
-
7
votes3
answers4722
viewsA: How to create a box with lines on both sides with CSS only
I love these exercises, greatly reinforce creativity :P In my solution, I used two elements: the line and the content (that would be where the month is written). That way: <div…
-
1
votes1
answer37
viewsA: Creating tabs without rectangles
You can solve this using the property border-radius. Since only the edges on top of the element are required, you use the specific properties for each side (the border-radius is simply a shortened…
-
12
votes1
answer498
viewsQ: Is a framework based on a programming language?
I know that a framework is like an application to be used in applications, but it is correct to say that a framework is based on a certain language? Example: jQuery is a Javascript-based framework…
-
3
votes1
answer506
viewsA: When you click on the smaller div, open the larger div
The structure is very simple. We have the following HTML markup: <div id="big"><img src="" /></div> <ul> <li><img src="exemplo.png" /></li>…
jqueryanswered Rafael Almeida 2,585 -
5
votes1
answer233
viewsQ: What exactly is the element.class selector?
I was developing and one thing caught my attention: the rule elemento .classe is different from elemento.classe. I realized that the main difference is that the first one could be read like this:…
cssasked Rafael Almeida 2,585 -
3
votes0
answers55
viewsQ: Do CSS prefixes vary from property to property?
I was taking a look at the prefixes and with a lot of code to put them (I didn’t have the habit of using the prefixes until I started using the new properties of CSS, sad) and went to take a look at…
cssasked Rafael Almeida 2,585 -
0
votes5
answers9469
viewsA: Hide HTML code
It is not possible to hide the user’s source code once the browser has loaded it. The maximum which can be done is a condition by PHP, so the code is not shown, but as PHP is a language server-side,…
-
1
votes1
answer166
viewsA: picture size depending on screen size
The logic is the same that you should have used with the other elements, using the values in percentage. If you have an image like this: <img src="image.png" class="image" /> Note that the…
-
6
votes3
answers2534
viewsA: Why doesn’t the height accept percentage?
When you put a size in percentage, the value is calculated based on the size of the parent element. Keeping this in mind, it is interesting to note that by default, there is no set height on a blank…
-
1
votes3
answers146
viewsA: Modification of Javascript on websites
Yes, as far as I know you can play with the Javascript of a website, some browsers even make a console available for you to debug your code (like Chrome). And there are some ways to avoid, but as…
-
1
votes2
answers5471
viewsA: Scroll to the button
I think it would be better to make a solution purely with Javascript, so avoid soiling the html with functions within elements. Change the pro classes/ids you prefer:…
-
4
votes1
answer7098
viewsA: How to go to an anchor on a page with little content?
This is because there is not enough space on the page for the div to go to the top, the page reaches as far as it can. Ideally you would fill the page in some way, for example, put min-height: 100%;…
-
1
votes2
answers196
viewsA: Display dialogs when successful
How did you use the try, everything at the end of the block will rotate if an exception is not triggered. To display the warning you linked at the end of the question, you can use the echo PHP to…
-
3
votes2
answers779
viewsA: Modify src of multiple images individually
If I understand correctly, do you want to replace the current image path with a new path, and such a path specifies a different size? I made a way here to replace the path, you can try to adapt to…
javascriptanswered Rafael Almeida 2,585