Posts by Fernando Leal • 9,770 points
219 posts
-
3
votes1
answer454
viewsQ: Use javascript to get CSS rules from an external stylesheet
I’m getting the style sheet rules for this situation addressed in this question. But if you use internal CSS (with tag <style>) I correctly get the declared styles, as you can see in the…
-
3
votes1
answer194
viewsQ: Get only declared CSS styles for an element
I’m wanting/needing to make a CSS converter for styles inline using only and exclusively technologies client-side. Researching until I found something, in case is library (jquery.inlineStyler) and…
-
12
votes4
answers844
viewsA: How to create properties dynamically in C#?
If this is really necessary in your code without having one class really, then you can use dynamic of the C# instead of object, doing something like that: IList<dynamic> list = new…
-
2
votes1
answer1300
viewsA: Why doesn’t Transition work?
You can remove the display, and use visibility, so the element will not continue on the screen and the transition will work, as I have already mentioned here in another answer. Follow the example:…
css3answered Fernando Leal 9,770 -
3
votes2
answers2201
viewsA: Display element when mouse is over an image
Problem What’s happening is that by using opacity, to hide/display the element, it is only becoming transparent (opacity: 0) and it’s not leaving the view, so it keeps occupying its space on the…
-
4
votes3
answers3283
viewsA: Regular expression for dates without tab
Although @Adirkuhn has already provided an acceptable solution to AP. After seeing this I went looking for something more powerful, that could at least validate months with 30 and 31 days, because I…
regexanswered Fernando Leal 9,770 -
1
votes1
answer1390
viewsA: How to select a value from an <option> by Angularjs
First remove the select as of expression ng-options: <select class="form-control" name="accounts" ng-model="vm.deposit.account" ng-options="account.agency for account in vm.accounts"…
-
23
votes3
answers627
viewsQ: Optimize Java method using the Scopes concept
Well some time ago, when I took some classes J2ME to Mobile (almost deceased ), where I was presented to a concept of scope hitherto unknown by me, that would be: { // cria um novo escopo } Where…
-
0
votes1
answer783
viewsA: Call ion-view in function
It won’t work with Ionic, but since it’s web-based, we can try the following which is the code equivalent to what the <a href="#/app/page2">Page 2</a> ago: location.hash = "/app/page2";…
-
3
votes2
answers2482
viewsA: Repeat header in print
Nothing much more than my comment, and with little support from browsers (today works in Firefox and IE (I don’t know if at all)), you could put your content inside a table and add the title (or…
-
5
votes2
answers575
viewsA: Use <style> inside if of javascript
I venture a solution, which consists of the following: Explanation The tag <style> is used solely and exclusively for the style declaration (CSS) for HTML. And surely it should not be inserted…
-
4
votes1
answer1664
viewsQ: How to prevent Alertdialog from being closed when a button is clicked?
Problem I’m trying to validate certain data contained in a View customized of a AlertDialog in the Save button click event. Then after the validation I save the data and close the Alertdialog, and…
androidasked Fernando Leal 9,770 -
5
votes1
answer5215
viewsA: How to click on the Listview item and call another screen?
You must set the event setOnItemClickListener of ListView: lvMostraTodosOsLivros.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?>…
-
7
votes1
answer302
viewsA: "Run/Fly" Image by Site
Look at this adapted example that (now already with the twitter bird)(Commented, on the points of possible changes): $(document).ready(function() { // inicializa animação animateBird(); }); function…
-
1
votes1
answer829
viewsA: Edittext Android Accents
Solution 1 (InputFilter) You can use InputFilter to that end, the implementation being something like this: InputFilter filter = new InputFilter() { public CharSequence filter(CharSequence source,…
-
29
votes8
answers44013
viewsA: How to remove auto complete input from google Chrome?
As stated here and here, it seems that currently Google Chrome ignores any kind of attribute autocomplete="off", however strange it may seem. So a (workaround) solution to make Chrome not to do an…
-
1
votes1
answer250
viewsA: Javascript animation (Hover) for Touch
The behavior of mouse hover is not an expected event for Web Touch entries. As cited here, events expected for Touch entries are: touchstart; touchend; touchmove; touchcancel; Containing no…
javascriptanswered Fernando Leal 9,770 -
22
votes2
answers14617
viewsQ: What is the difference and what are operators & and && e | and || in Java for?
I was analyzing some possibilities for the implementation of an algorithm and I went to look up this & and |, and I read some topics in English but it’s not 100% clear to me what it’s for and…
-
2
votes1
answer1117
viewsQ: Set $Scope value of a Controller from an Angular Directive
I’m trying to make from an event in a Directive, is called a method belonging to a Controller, the Controller method call is already correct, only it seems that the $scope, within that method is…
-
12
votes2
answers8444
viewsA: Pass generic list as parameter
This technique is called Generics no. net. A simple way would be like this: // especificando o T na assinatura do método public void FacaAlgo<T>(List<T> lista){} Where you could use it…
-
2
votes2
answers1503
viewsA: Find out what type a CNPJ verifier is
While not seeing much use in your final implementation, as quoted from @ramaral comments, I’ll help you with the problem itself. You can use the parameters out of C#, to retrieve the checker digits…
-
3
votes2
answers164
viewsA: Check if a value exists but print another
I’m not even a programmer PHP, but I think you should do so (concatenating HTML with the dynamic values of PHP): <?php if($this->seo_tags->spam != '') { echo '<span…
-
5
votes2
answers1016
viewsQ: How to create Production Application Error Report (Client)
I am looking for a way (efficient and practical) to capture globally all Exceptions not dealt with by the application (the ones that lead the application to crash or "Application stopped working!").…
-
4
votes1
answer2229
viewsA: How to get the value of several fields filled using jQuery?
Your selector can return multiple items (since you are doing the following with this: :text:visible = select all the inputs with type equal to text and that are visible), so you should make a each…
jqueryanswered Fernando Leal 9,770 -
1
votes4
answers1152
viewsA: Is it possible to build an HTML5 app for Android with Material Design?
Perhaps this question is closed "as based on opinion". But I still think it’s worth pointing out paths, so there goes my answer "based on opinion and experience": How Material Design is a design…
-
4
votes3
answers4722
viewsA: How to create a box with lines on both sides with CSS only
I made an example in a different way from @bfavaretto (which in the end is pretty much the same result), follow my solution (I tried to explain what was done in the comments next to the CSS…
-
6
votes5
answers338
viewsA: Move background of text
In the absence of an answer that reaches 100% the problems of AP, I risk publishing an alternative using SVG, consisting of the following (commented code explaining what each part is): <svg…
-
5
votes5
answers338
viewsA: Move background of text
You can create a Timer javascript that is increasing and moving its background For example: $(function(){ var x = 0; function transacao(){ x-=100; $('h1.move').css('background-position', x + 'px…
-
2
votes1
answer368
viewsQ: Android theme support (Themes) in custom components, using Appcompat-v7
I started using the Appcompat-v7, for use the concept of Material Design in my project. Only now I realized that my custom components even inherited from native components, are not applying the…
-
4
votes1
answer1907
viewsQ: Apply Material Design (android:Theme.Material) to Android versions smaller than API 21?
I was studying a little about the Android layout guidelines as: Colors; Design material; And how to implement these guidelines; So I tried to customize my Theme, thus: <resources> <!--…
-
2
votes2
answers2748
viewsA: Group json data by a given object
It is a solution that brings a final result identical to that of reply @Miguelangelo, only that using a library that I really like and use some time (which apparently is abandoned by the developer)…
-
1
votes1
answer165
viewsA: Working with arrays, choosing only one data
To draw, since you do not want to repeat the amount, at each draw remove the drawn item ( equal a bingo for example, where the drawn ball is removed). You can do something like this: var sorteados =…
-
4
votes3
answers500
viewsA: How can I separate a string for example 36529874 from two to two without having any separation carcter for example 36.52.98.74
Can use Regex Java thus: String test = "36529874"; // regex para números de 2 em 2 // [0-9] = todos os números de 0 a 9 // {2} = agrupar de 2 em 2 // Você poderia também utilizar simplesmente isso:…
-
4
votes2
answers22046
viewsA: What is the difference between px, dp, Dip and sp?
px is pixel. sp is Scale-Independent pixels (scale independent pixels). Dip is Density-Independent pixels (pixels independent of density). Where to use: sp: for the definition of sources; dip for…
-
5
votes2
answers485
viewsA: Compare id attribute with class and give . show in another div
Like the Sergio already mentioned in his reply you can’t have ids repeated, then you must change one of the two approach to class or data- (data Attributes). I created a solution by employing id in…
-
2
votes6
answers2106
viewsA: Smooth gradient color transition automatically
I’m posting as another answer because it’s totally different from my first answer (I want to keep it, because it brings a different but useful approach). And this was created to address the new…
-
5
votes6
answers2106
viewsA: Smooth gradient color transition automatically
Use this code to create random colors: function corAleatoria(){ var pad = '000000'; return '#' + (pad + Math.floor(0x1000000 * Math.random()).toString(16)).slice(-pad.length); }; And concatenate the…
-
4
votes2
answers180
viewsA: How to use html tag as <b> in android
If you want the contents of a TextView, or any other text component is translated as HTML, you should parse the content with Html.fromHtml() before setting the text: Example:…
androidanswered Fernando Leal 9,770 -
0
votes1
answer794
viewsQ: In the Actionbar Menu, how to allow the icon of an item to be always visible, and the text only when there is space?
I’ve been trying and researching for some time the possibility of having a behavior in my Menu of ActionBar, as follows for some items: Icon (android:icon): always visible in the ActionBar; Text…
-
5
votes2
answers11135
viewsQ: Exception vs Runtimeexception, when using one or the other?
I was with that doubt, and when I was made aware of it another came to me, which I would like to be clarified. What’s the difference between Exception and RuntimeException? When to use Exception or…
-
0
votes1
answer104
viewsQ: Launch Exception on the onCreate of an Activity
I am working on the development and refactoring of some Activity's that has similar behaviors in our projects, so to avoid code repetitions, for common functionalities, I created some Activity's…
-
3
votes4
answers9017
viewsA: How to declare a constant in Javascript?
Based on the possibility of properties of an object such as read-only of reply from @mgibsonbr, and considering the correct response of @Emerson Rocha Luiz, on the use of const, only not yet…
javascriptanswered Fernando Leal 9,770 -
7
votes1
answer752
viewsQ: What is the correct way to declare a javascript Function?
For some time now, I have been observing the use of two forms of function javascript, being the following: - Form 1: function soma1(val1, val2){ return val1 + val2; }; - Form 2: var soma2 =…
-
0
votes3
answers1813
viewsA: (Javascript-jQuery) Variables within variables giving "Undefined"
If you want to keep the replacement string as an external resource to the function, you can use it outside and replace the value dynamically using the function String.format (there is no native, so…
-
2
votes2
answers176
viewsA: Move png image
Ta done, note comments. var svg = document.querySelector('svg'); //create rect var shape = document.createElementNS( "http://www.w3.org/2000/svg", "image"); svg.appendChild(shape);…
-
3
votes1
answer749
viewsA: How to get the affected line number in an Mysql Insert
According to the official Mysql documentation, the SELECT ROW_COUNT(), is what works. If you’re testing in Mysql Workbench, it may not seem to work, as per this comment. In the documentation there…
-
4
votes3
answers18417
viewsA: How to catch the child element
If you want to select the input name='plano' brother of button, do something similar to this: $('.sel-plan').click(function() { // volta para selecionar o elemento pai var $elementoPai =…
-
2
votes2
answers34
viewsA: Collect value from a return
You must access the properties of the object, being, dados the object containing: {"finalOFX":{"0":"276.67"},"0":null}, finalOFX the object containing: {"0":"276.67"} and 0 the object containing…
-
3
votes2
answers256
viewsA: Display the class of different tags from one ID each click
Simply why a id, must be unique (at all times), then the selector finds the first and to. Definition of the attribute id. One option would be to put the id, ai yes unique in the ul, thus: var $j =…
-
3
votes3
answers2872
viewsA: How to Set a Larger Size for a Textboxfor
You can use Htmlattributes from the Asp.net MVC Htmlhelper itself. You can just put a style, setting the width to the desired size: @Html.TextBoxFor(model => model.strTituloEmail, new { @class =…
asp.net-mvcanswered Fernando Leal 9,770