Posts by Ricardo Lucas • 593 points
30 posts
-
2
votes1
answer42
viewsQ: Is it possible to declare that in a function you launch an exception with PHP?
With a small example: public function calcularMedia($valor){ if($valor < 0){ //LANÇAR EXCEÇÃO } else if($valor > 6){ return "Passou"; }else{ return "Recuperação"; } } Remembering this function…
-
0
votes1
answer127
viewsQ: Formatting values with Numberformatter() Swift
I have a function that I want to format the values to decimals with the Brazilian standard. Today my function is like this ... func formatNumberToDecimal(value:Double) -> String { let…
swiftasked Ricardo Lucas 593 -
1
votes1
answer222
viewsQ: How to perform an action when finishing each() Jquery
I’m using the function each() of Jquery would like to know if there is a mechanism so that I can perform a function after the each(). As soon as I finish mine each(), I can do something else, but it…
-
1
votes1
answer535
viewsQ: Formatting value with Numeraljs
I need to format a value for the Brazilian monetary format, R$ 0.000,00. But in the database the values are in decimal, in the format 0.00. But when the value 20.00 is used, I get 2000 and not 20. I…
-
0
votes2
answers798
viewsA: Get Imei on Android using Java
Try to use it like this to get the IMEI of the device. /** * Returns the unique identifier for the device * * @return unique identifier for the device */ public String getDeviceIMEI() { String…
-
0
votes1
answer24
viewsQ: Listfragment Android
Today using a Fragment to solve a problem, I saw that there is a class called ListFragment but what does it do? What’s the difference with a Fragment? When should I use the ListFragment when should…
-
2
votes2
answers1661
viewsQ: How to sort a Map by key in Java
I’m trying to use a loop to show the grouped information of a Map. for(Map.Entry<Date, List<Exam>> entry : groupedList.entrySet()) { setNewList(entry.getKey(), entry.getValue()); } But…
-
0
votes1
answer15
viewsA: Capture ID eloquently on JOIN
Just to close the topic. You may not always want to select all columns of a database table. Using the select method, you can specify a custom selection clause for the query: You can use the :…
-
1
votes1
answer48
viewsQ: Ways to remove with Sparsearray
While trying to remove items from my SparsArray found the method remove and another method that is the removeAt but what’s the difference?
-
1
votes2
answers259
viewsA: Trigger Ubmit inside the iframe
To start within the context of your modal you will create a reference . $('#modal-form')[0].contentWindow.$('body').trigger('text-event'); Dai you must shoot from a new context the event.…
-
6
votes1
answer1544
viewsA: Multi-threading in PHP applications
Multi-threading is possible in php Yes you can do multi-threading in PHP with pthreads. Of PHP documentation: pthreads is an object-oriented API that provides all the tools needed for…
-
1
votes1
answer150
viewsA: How to add an array with dynamic values in an object with dynamic properties?
Based on what you’ve given me, I’ve made some changes and managed to replicate your result. <script> var products = {}; $(function() { const items = $('.items .item');…
-
0
votes5
answers815
viewsA: Check if URL has string
So I guess using the: const url = window.location.href; You retrieve the value of your URL in a string, the indexOf is a possible position o -1(minus one) which is a non-existent position. Usually…
-
4
votes1
answer88
viewsQ: Sparsearray vs Hashmap what’s the difference?
I was doing my daily refactoring and came across a warning. use new Sparsearray(...) to Instead for Better performance Okay, but what’s the difference between Map and SparseArray? This is my code:…
-
2
votes1
answer404
viewsA: What function and how to use Controllers in Laravel
So I guess you haven’t looked at the documentation but all right, I’ll try to help. Controller as the name suggests is the Controller class, which involves your logic and maybe your business rule,…
-
1
votes1
answer83
viewsA: Laravel does not generate error while processing form with 'post'
I believe that MethodNotAllowedHttpException is a route error in Laravel, maybe it is using POST and you are using GET. Open your route file and check. But a basic example would be like this.…
-
3
votes1
answer270
viewsQ: Function . filter() for a List<Class>
I have a class Pessoa that has the columns Integer id. String name, and String date_born. In my main Activity I am already retrieving the list of people that comes from my request made in the API…
-
-1
votes2
answers39
viewsQ: Uilongpressgesturerecognizer does not work with my Uiimageview
I’m trying to capture the long tap on my image. So I can send an action to in a long touch. @IBOutlet weak var imageRecord: UIImageView! override func viewDidLoad() { super.viewDidLoad() let…
swiftasked Ricardo Lucas 593 -
0
votes2
answers4611
viewsA: Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
There is a post on stackoverflow itself that can help you . https://stackoverflow.com/questions/10160339/starting-apache-fails-could-not-bind-to-address-0-0-0-080 On my mac I used the following…
-
0
votes2
answers39
viewsQ: Remove all subviews from a Stack View
At a certain time of my application I consume an API and add buttons in a Stack View. The name of my Stack view is "viewPossibleAnswer". for answer in newListsResponses { let newButton = UIButton()…
swiftasked Ricardo Lucas 593 -
0
votes2
answers39
viewsA: Remove all subviews from a Stack View
I was wrong since I am adding "subviews" the correct function is to access the value of the "subviews" of my Stack View so I changed my function. for itemSubView in self.viewPossibleAnswer.subviews{…
swiftanswered Ricardo Lucas 593 -
0
votes2
answers39
viewsA: Content is not shown after clicking
Your HTML <div class="boxContent"> <ul> <li class="buttonShowContentSinopse active">Sinopse</li> <li>Ficha Ténica</li> <li>Imagens</li>…
jqueryanswered Ricardo Lucas 593 -
0
votes2
answers112
viewsA: How to lock commit via an ajax request by a bind() event on button
Then as I did not understand very well your JSON I did an example meuPHP.php would look like this : $bonito = "SIM"; $meuJson = Array('mensagem'=>''); if($bonito == "SIM"){ $meuJson['mensagem'] =…
-
3
votes4
answers265
viewsA: Phpmailer without ajax
Add this to the end of your PHP by changing only the URL. if($send){ echo 'E-mail enviado com sucesso!'; echo '<meta http-equiv="refresh" content="3;URL="paginadoformulario.HTML">'; } else{…
-
1
votes1
answer401
viewsA: PHP update SQL Nothing Happens
replace your code where you have " $sqlupdate" with this one, maybe it works . $sqlupdate ="update tb_utilizador SET Nome='".$Nome."', NumeroBI='".$NumeroBI."', Morada='".$Morada."',…
phpanswered Ricardo Lucas 593 -
0
votes3
answers646
viewsA: pass checkbox values to the url
How do I select the checkbox of items 1,2,5 to pass a url in the following way www.teste.com/realatorio.php? id=1,2,5. That was your question to my answer, created just your example url which is…
phpanswered Ricardo Lucas 593 -
1
votes4
answers659
viewsA: Submit does not call function
<script type="text/javascript"> jQuery(function($) { $('#form-ajax').submit(function(e){ alert('entrou na função'); if($('#enviar').val() === 'Enviando...'){ return(false);…
-
0
votes1
answer55
viewsA: Perform POST with Ajax
See if it works like this. var formatoid= '2'; var motivoid = '2'; var motivonome = 'Nome'; var teste = '5'; $.ajax({ url: 'salvarDados.php', data: {teste:teste, motivoid :motivoid, formatoid:…
-
1
votes3
answers97
viewsA: POST ajax and combo box problem
The correct Klaider can also be ! $(document).ready(function() { $("select[name=predata]").change(function() { $("select[name=prehora]").html('<option value="">Carregando...</option>');…
-
1
votes2
answers120
viewsA: Inner Join not returning database values
Guy in your php puts $result = mysql_query($connection,$query) or die(mysql_error()); So you will really see if the error is in the programming or in the query you have run.