Posts by André Ribeiro • 5,137 points
125 posts
-
1
votes1
answer914
viewsA: How to maintain screen positioning after postback?
You need to save the value of window.pageYOffset (document.documentElement.scrollTop to IE8) and restore as soon as your page loads again. If you are using jQuery you can do so: Add an Hidden field…
-
2
votes2
answers1048
viewsA: Warning: preg_match(): No ending delimiter ' '
You need to add delimiters to your regular expression. Example using a # at the beginning and at the end: "#^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$#"…
phpanswered André Ribeiro 5,137 -
1
votes1
answer624
viewsA: Doubt in the Generation of Bradesco banking bill via PHP
The "Our Number" field serves primarily for your internal control. You can use there a number that is incremented to each ticket generated or the ID of a request on your system, for example. This…
-
1
votes1
answer150
viewsA: Canvas - getWidth(), getHeight() and Onclicklistener()
Your problem is that you are actually dividing two integers and the result turns out to be another integer. You can cast one of the operators to float that the split result will also be a float.…
-
3
votes1
answer229
viewsA: Mkmapview circular Swift
I did a test here and saw that using cornerRadius works normally. 1. Add the QuarzCore.framework in the project going in Build Phases > Link Binary with Libraries. 1.1 1.2 2. Import QuartzCore in…
-
0
votes1
answer429
viewsA: .htaccess URL friendly PHP problem
It seems that the problem is in href of your a. The .htaccess is correct but the link you are printing is not. It should be like this (to generate index/$i) <a href="index/$i"> $i </a>…
-
3
votes2
answers255
viewsA: Can the webservice set a limit memory usage for who queries it?
Ideally you set a limit of records returned query (where you can be sure it will not exceed your memory limit) and implement some kind of paging so that it is possible to navigate through all the…
-
0
votes1
answer593
viewsA: Difficulties with Ionic framework and android sdk?
By error it seems that you have not installed (or removed?) the package Build Tools. Go to the directory where the Android SDK is installed, run the SDK Manager.exe and check that the package is…
-
12
votes1
answer2187
viewsA: Remote REST webservice in PHP receiving JSON via POST with problems
The problem is that Webservice is sending the POST with the Content-Type: application/json and PHP does not $_POST with the data sent in this way. $_POST will only be automatically filled in if the…
-
5
votes2
answers26842
viewsA: Simulate a click event without clicking using jQuery
You can use $.trigger('click') $(document).ready(function () { if(window.location.href.indexOf("?tipo=coberturas") > -1) { alert("Opa, encontrou."); var filtroCoberturas = $('li…
-
1
votes1
answer349
viewsA: iPhone 5 and iOS 8 - Location permissions
In iOS 8, before you can use Corelocation you must call the function requestAlwaysAuthorizationfor use in the foreground or requestWhenInUseAuthorization for use in the background. Since these…
-
1
votes1
answer604
viewsA: Store Variable within a While
You can wear something like that: $ids = $_POST['check_imprime']; // só pra garantir que não terão strings injetadas aqui foreach($ids as $k => $v) { $ids[$k] = (int)$v; } $ids = implode(',',…
-
3
votes1
answer1728
viewsA: Remove div "Father"
You can do it like this $(function(){ $('a.delete').click(function(){ $(this).closest('.row').remove(); return false; }); }); <script…
jqueryanswered André Ribeiro 5,137 -
2
votes1
answer14715
viewsA: How to remove/uninstall the entire LAMP layer?
To remove only the main packages you can use: sudo apt-get purge mysql-server apache2 php5 To remove these packages and all other related: sudo apt-get remove apache2 apache2-mpm-prefork…
-
5
votes2
answers236
viewsA: Regular expressions
The ideal is to use XPATH to get these prices. Looking at this page you reported would look like this: $dom = new DomDocument; $dom->loadHTMLFile("http://ciagri.iea.sp.gov.br/precosdiarios/");…
-
6
votes2
answers12115
viewsA: Doubt with ng-if or ng-Ide Angularjs
The directive ng-hide hides the element depending on the output of the expression specified in the attribute. Example: <button ng-hide="esconderBotao">Botao 1</button> Case the variable…
-
3
votes1
answer80
viewsA: How to work with mirrored systems?
Domains would have to be on the same server for that to be possible? Not necessarily. You could just create a CNAME entry in the domain pointing to your server. When the page was loaded you could…
-
3
votes1
answer5415
viewsA: Create directives with Angularjs
Changing the sonclick for sonClick (attention to the capital C) seems to solve the problem. angular.module('App', []) .directive('sonClick', function () { return { restrict: 'A', link:…
-
8
votes5
answers41788
viewsA: How to sort an array of objects with array.Sort()
You can do it like this: var pessoas = [ { nome: 'Joao', num: 1 }, { nome: 'Maria', num: 2 }, { nome: 'Fulano', num: 3 } ]; function compare(a,b) { if (a.nome < b.nome) return -1; if (a.nome >…
javascriptanswered André Ribeiro 5,137 -
1
votes1
answer154
viewsA: Filter json city returned from google Places
In function getPlace you can use JSONArray terms = jPlace.getJSONArray("terms") To access the Terms array.
-
3
votes1
answer639
viewsA: How to show only the selected div
See if this fits you: $(function() { $('ul#items li').click(function(){ var item = $('.elem[data-item="' + $(this).attr('data-item') + '"]'); if($(this).attr('data-item') == 'all') {…
jqueryanswered André Ribeiro 5,137 -
0
votes1
answer87
viewsA: When accessing a *.php lead to Autostart.php? url=*. php
Solution: RewriteEngine on RewriteRule (.*\.php)$ autostart.php?url=$1 [R,NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d I don’t think it’s a good idea to use this…
-
2
votes1
answer1043
viewsA: How do I use Vmasktextfield with Swift?
Example: class ViewController: UIViewController, UITextFieldDelegate { @IBOutlet weak var comVM: VMaskTextField! override func viewDidLoad() { super.viewDidLoad() comVM.mask = "(##) ####-####";…
swiftanswered André Ribeiro 5,137 -
2
votes3
answers762
viewsA: How to return the number of the input position within a form?
You followed the right path but missed one small detail: document.forms[0].elements[i] will return the element html. The correct index is itself i. descendentes[i].addEventListener("click", function…
javascriptanswered André Ribeiro 5,137 -
1
votes3
answers4054
viewsA: Close div on an output link or when clicking outside
You can add the following code: $(document).mouseup(function(){ $('.descricaoobs').hide(); }); This will make this div hidden by clicking anywhere else in the document. See working:…