Posts by Paulo Roberto Rosa • 8,979 points
159 posts
-
2
votes1
answer383
viewsQ: Problem when removing all attributes of an object containing null values
Context I’m inside an application in Nodejs, where I have a very large object that has various attributes and also attributes objects that have children, and I have a situation where I can’t keep…
-
1
votes1
answer76
viewsA: Dimensioning of Layout
Hypothesis Based on the image provided, you have a block with a certain value of height and gray background. And it needs this block to extend horizontally on the page at all times. Code Following…
cssanswered Paulo Roberto Rosa 8,979 -
1
votes2
answers534
viewsA: Count of black pixels that have been plotted on the web image
Explanation You can use php itself to do this, you don’t need to use javascript if you don’t want, I made an example manipulating and creating an image of only two colors that I used for testing…
-
4
votes1
answer97
viewsQ: How is the conversion from String to Float done in Javascript Core?
I’ve always been curious to know how the conversion really works string for float internally in the javascript, so I would like to receive a full and detailed answer explaining what javascript does…
-
1
votes2
answers67
viewsA: Condition to appear link does not work
First, I would recommend using the identical operator in PHP to compare strings which in this case would be the !== rather than just != or use the strcmp() to that end. Another thing to say is that…
-
9
votes6
answers24661
viewsA: What is the difference between declaring variables using Let and var?
Well, fundamentally speaking, var and let are modifiers of the scope scope of the variable, that is, define how far it is possible to reference such a variable within the scope in question.…
-
-4
votes1
answer408
viewsQ: What is the difference in the declaration of variables using const?
In the ecmascript-6 some features have been added, among them is the const the visa is used in the same way as the visa var, to declare variables. What is the difference between declared variables…
-
0
votes1
answer408
viewsA: What is the difference in the declaration of variables using const?
Well, fundamentally speaking, the const serves not only to define that the variable has the global scope, but mainly to make the value of the variable immutable, so that it cannot be changed and…
-
0
votes2
answers512
viewsA: Load html with Jquery
You don’t need to use jQuery to load the file, actually. Only if you want, because you can just load the html into one <object> or <iframe> initially hidden and just show it afterwards.…
jqueryanswered Paulo Roberto Rosa 8,979 -
0
votes2
answers1652
viewsA: Insert "div" html element with javascript
In my opinion it is not necessary to use jQuery or XHR to do this, as you can load the files as Resources in the html header. This way load the files into your HTML header: <script…
-
1
votes2
answers681
viewsA: Error in String to Double conversion
Explanation You are having an exception for some reason, so in a situation where there may be exceptions, one should treat the exceptions with block try/catch. Codes Resulting in this way: public…
-
0
votes1
answer111
viewsA: How to change the field of a table by referencing values from another table. Using cakephp 1.3
Just checking if in the data to save your field is with the desired value and make a condition so that if you are, save the Project too, I believe it works: inside your if…
-
1
votes1
answer55
viewsA: jQuery ignoring the bars /
Explanation Apparently your problem is separation into variables to avoid prolemes with multiple double-quoted strings. That’s why I recommend using jQuery’s dynamic element creation and setting its…
-
2
votes4
answers1914
viewsA: Show table on page after clicking a button
Code function mostrarTabela(){ document.getElementById('empenho_solicitante').style.display = ''; } <table width="100%" style="display: none;" class="table table-bordered table-hover…
-
0
votes4
answers2082
viewsA: Keep Ivs side by side even if the line runs out
Justification Well, considering that no answer above used the way to solve this problem that I use, I am here providing my way in search to improve the content of the question. Code .pai { /*…
cssanswered Paulo Roberto Rosa 8,979 -
0
votes2
answers208
viewsA: Mark Selected in option that has the same id brought in array
Well I consider a straightforward answer to the title of the question itself. Thus generating a more succinct code, if I meet the main objective, that would work this way below: var sel =…
-
1
votes3
answers3777
viewsA: Regular Expression - Name + Space + Surname
I believe this simple regular expression will solve your problem: /\w+\s+\w/ Example of javascript usage, for example: /\w+\s+\w/.test('Igor D´Sant'); // retorna true /\w+\s+\w/.test('Igor'); //…
regexanswered Paulo Roberto Rosa 8,979 -
1
votes3
answers1274
viewsA: Can you place an array in a Javascript variable and compare it to the value in the text field?
I would use only this way: ['s10','s11','s12','s13'].indexOf(document.getElementById('zpl').value) !== -1; The result of this line would be true if the field value is any of these in the array,…
-
0
votes3
answers130
viewsA: How do I call the next field of a table with Javascript or Jquery?
Explanation I understood that what you want would be something similar to editing grid via table fields. This way would be better a solution if I meet this concept of Grid, so I created a solution…
-
1
votes4
answers1377
viewsA: filter object by javascript array
I believe that you do not need all this to solve the problem, so I understood it is only necessary to filter classes 1 and 2, so a simple one-Liner solves: alunos.filter(function(item){ return…
javascriptanswered Paulo Roberto Rosa 8,979 -
1
votes2
answers119
viewsA: Why doesn’t that code work?
'Cause you forgot to put ; at the end of the line. function multiply($a, $b) { return $a * $b; } Initially I believed that the problem was in Javascript because its variables were without the $…
phpanswered Paulo Roberto Rosa 8,979 -
1
votes4
answers804
viewsA: How to change font in textarea using javascript?
Using only javascript according to the tag of your question and assuming that you only use a textarea: document.getElementsByTagName('textarea')[0].style.fontFamily = 'Verdana';…
javascriptanswered Paulo Roberto Rosa 8,979 -
0
votes2
answers1874
viewsA: Separate query by month and add the results
Just make a select with group by mes, you didn’t give much information about the problem but based on your image and the data you wrote, I made an example working for you in Sqlfiddle here Follow…
-
2
votes4
answers14424
viewsA: Validate form before sending
Answer + justification First, I would like to mention that you are using a somewhat obsolete way of doing what you need, because you can use the attribute placeholderHTML5 instead of doing all this…
-
1
votes1
answer531
viewsA: Div showing content by clicking button
*Initial but not complete response. From what I understand, you would like a step test where the button moves to the next step, so I created an example for you to use, based on and using your…
-
2
votes1
answer122
viewsA: CSS effects are not working
Justification Natively, the jQuery and the Bootstrap by themselves do not have animations that can be performed only by including a class, but there is a CSS called Animate that allows you to…
-
8
votes1
answer374
viewsQ: How to assign an Activity to open by clicking on the Actionbar Tab?
Context I have an application that contains a Activity calling for MapActivity (of which is a Map activity you inherit from the Googlemaps api), and another Activity which will serve as a search…
-
0
votes1
answer99
viewsA: Hide text from a select
"I want to hide the text when I open select" Why no longer leave it by default "hidden"? with this css it is possible to make it invisible to the eyes because the text would be the same color as the…
javascriptanswered Paulo Roberto Rosa 8,979 -
1
votes2
answers254
viewsA: Doubt about a specific regular expression in Javascript
"How can I do that?" You can do this using a regular expression containing the conditions you want, and testing such expression using javascript for such a character, but you must specify such…
-
2
votes3
answers8663
viewsA: What is the difference between DOM and virtual DOM?
Virtual DOM, is nothing more than a Mini DOM, which is a small part of the GIFT, which would be the recreation of the DOM objects used containing only the necessary content, and leaving aside all…
javascriptanswered Paulo Roberto Rosa 8,979 -
8
votes1
answer196
viewsA: Whether or not to "div" in the CSS
Inform or not div as a class prefix, in css, it depends on the type of element you want the rule to be applied to, because a css rule can work in the following ways: div { blabla } //aplica a todas…
cssanswered Paulo Roberto Rosa 8,979 -
0
votes2
answers1501
viewsA: Error - HTTP Status 404
Error 404 means that you are trying to access a/Resource file on the server, which does not exist, so the server returns a status to you 404 which would be this such "Error 404" so you know that the…
javaanswered Paulo Roberto Rosa 8,979 -
2
votes2
answers5742
viewsA: Use global variable in more than one js file
In fact, reading the title of your question, you say how to use global variable in more than one js file, Well, to answer that, I can tell you that regardless of how many files. js you have included…
-
2
votes1
answer349
viewsA: Open a certain folder created by me on android
The android features the Intent which makes these actions much easier, which would be a call from pre-defined screens/actions of android where you only specify what you want and the rest it takes…
androidanswered Paulo Roberto Rosa 8,979 -
7
votes3
answers1450
viewsA: Remote control of an Android is technically possible?
Emulating events of touch in this image above I called the developer mode "show pointer location", note the position coordinates being shown, it would be perfectly possible to use information like…
-
0
votes4
answers1289
viewsA: Javascript URL redirect code
Just check and validate the user’s host and url(href), so you should add if the domain is equal to x but not add if there is already: function validaDominio(dominioX){ var host =…
javascriptanswered Paulo Roberto Rosa 8,979 -
3
votes3
answers312
viewsA: Placeholder does not work in Textarea
Your problem is one, you have a predefined text within your <textarea>: <textarea type="text" id="trabalheConoscoObs" name="trabalheConoscoObs"…
-
1
votes1
answer613
viewsA: Intent opening two Activity in stack
You are currently overwriting a method that in your case would not be necessary at all to overwrite, which would be the onBackPressed(), you should remove this event from your code because it in…
androidanswered Paulo Roberto Rosa 8,979 -
5
votes3
answers660
viewsA: Should we validate function parameters?
In fact, what we should or should not do, it is up to us programmers, but common sense tells us to make validations that sometimes we are not used to knowing that Javascript is a language with very…
-
1
votes1
answer492
viewsA: How to limit a player’s chances in Javascript
It is very simple to control the moves, just add a start variable false so that it only becomes true if the player has hit, otherwise continue false and at the end of the loop you should reduce a…
-
1
votes2
answers154
viewsA: Do IF to give Slideup on an element
You can simply check if there is the class you add when performing the .slideDown() which is the class unidadesHover and then you make a if that realizes the .slideDown() if this class exists, and…
jqueryanswered Paulo Roberto Rosa 8,979 -
7
votes3
answers7469
viewsA: Doubt about input stylization="Submit"
You can use in the CSS selector an attribute and its value, as well as an element like the input in this case you could use both things, you seek a input in his .rodape but it must have the…
cssanswered Paulo Roberto Rosa 8,979 -
3
votes4
answers7358
viewsA: How to jump to the next field using jQuery?
I particularly prefer simple and straightforward solutions, so I believe this can be solved this way by assigning an event .keyup() from jQuery in the inputs would solve the situation.…
-
6
votes2
answers9366
viewsQ: How to split an image into multiple parts with link?
I would like to know how to split an image that can have multiple parts so that I can define the number of parts, and assign a different link to each part. Bonus: If the parts can assume any…
-
5
votes2
answers2003
viewsA: Shoot event to change slider image by clicking the arrow keys on the keyboard
Explanation: Well your solution can be simply solved using the event keyup directly applied to the body of your document(body) and checking if the key the user clicked was ←[keycode: 37] or…
-
7
votes3
answers10114
viewsA: Which JSON structure to use for large data volume without loss of performance?
First of all, JSON is a very compact object, imagine an enhanced XML, it’s JSON. So you can seamlessly include many and many records without worrying too much about it, including you don’t really…
-
2
votes1
answer2029
viewsA: Implement navigation with buttons: [first] [next] [previous] [last]
You can add the same way you created the pages, follow the implementation of the buttons you requested, which work exactly the same way as pagination: Previous button (previous button) $('<span…
-
2
votes3
answers7273
viewsA: Load image and insert into a DIV
There is no need for any plugin for this style, you can simply use the html input element that would be the following: <input type=file id=teste> You would soon have a button to select a file…
jqueryanswered Paulo Roberto Rosa 8,979 -
3
votes1
answer10772
viewsA: Pass value by POST with select option PHP
Apparently, your problem is that you’re confusing value with the description of its <option> because I tested these two codes here and it’s working: pregnant and nom In this case, you have the…
phpanswered Paulo Roberto Rosa 8,979 -
4
votes1
answer2075
viewsQ: How to use Tfdjsondatasets in Delphi XE4?
Explanation Today I was seeing an example called FireDACJSONReflect in the Samples folder of Delphi XE6 and I saw that it was very interesting how the server communicated with the client and I would…