Posts by Luis Henrique • 3,693 points
78 posts
-
3
votes1
answer348
viewsA: "OK" button in warning message -
Your UIAlertAction is okay. As it did not actually post the error presented, I believe it is Warning compilation warning that you are not using the created action, once not used, can be removed.…
-
1
votes1
answer85
viewsA: How do I execute code with closed or minimized application?
There is no app running in the background on iOS other than some exceptions (music, gps, bluetooth, etc). See the official documentation for more information: iOS - Background Execution…
-
2
votes1
answer30
viewsA: Doubt in SQL Query
SELECT * FROM mensagens GROUP BY usuario_envia
-
5
votes3
answers3134
viewsA: Add or Remove Class from a DIV by clicking
You can use the method toggleClass() jQuery: $(".pacotes").click(function() { $(this).toggleClass("select"); });
-
5
votes1
answer692
viewsA: How to count how many characters a string has - Swift
If it is Swift 1: word.utf16count If it is Swift 2: word.characters.count
-
2
votes1
answer179
viewsQ: Error making POST containing "@" or "#" in PHP with Curl
I’m having a problem and I can’t fix it, I have a PHP script that submits a form using Curl. Initially I used the format array(key => value) to submit the POST data. However I came up with a…
-
1
votes1
answer138
viewsA: Close the IOS keyboard by clicking confirm
How do you not press the Return from the keyboard in the field, you don’t have the textField in which the event occurred. Soon you need to say that the view is no longer being edited, as follows:…
swiftanswered Luis Henrique 3,693 -
2
votes1
answer240
viewsA: Doubt, add value of an array [Anyobject] using Swift?
As you mixed the types of your array, everything becomes AnyObject, soon to effect the binary sum operation you need type the data. var jogador02 = ["Teste", 0] var temp = jogador02[1] as! Int temp…
swiftanswered Luis Henrique 3,693 -
25
votes1
answer16196
viewsA: Difference between keyup(), keydown() and keypress()
They don’t really do the same thing. keyup(): the event occurs when the key returns to the original position on the keyboard (i.e. when you release it). keydown(): the event occurs when the key is…
-
3
votes1
answer39
viewsA: Has not initializers - Swift IOS
The variable image needs to be initialized in your creation or within the class constructor, or you can say that it can be optional as follows: var image: UIImage? This way you will have to check…
swiftanswered Luis Henrique 3,693 -
7
votes1
answer20225
viewsA: Array to string Conversion in
Based on your response in the comments. Change the line: $tamanho = $_POST['tamanho'] To: $tamanho = $_POST['tamanho'][0] The field value is not the cause of the problem since you are not using it…
-
1
votes2
answers366
viewsA: Start screen in storyboard
What you can do is create the Views stack programmatically by Appdelegate. I never tried to create the whole stack dynamically, I just changed the already existing. I can’t test at the moment, so I…
-
8
votes6
answers22962
viewsA: How to calculate percentage?
Just make a simple calculation. $valor_descontado = $total - $total * $pctm / 100.0; whereas: 30% = 30/100
-
8
votes4
answers971
viewsA: Select between dates in Mysql
Simply calculate the difference between the desired field and the current date (now) in the Where. As it is not quite clear what you want, then follow the two possible solutions: 90 days prior to…
mysqlanswered Luis Henrique 3,693 -
2
votes1
answer72
viewsQ: Transaction/Commit on Core Data, is it possible?
There is the concept of Transaction and Commit in Core Data? I have a database in the app that is fed by an external file, but it is a lot of data and the application takes around 2 minutes to…
-
4
votes2
answers208
viewsA: How do I force entry into "while"?
Just reset the counter i, because he is the control of his tables. After the while switch to: i = 0; Thus remaining: void main() { int i,x, a, resultado; printf(" Introduza o numero da tabuada que…
-
11
votes4
answers1541
viewsA: What is the difference between "++$variable" for "$variable++"?
These are increment types, called preincrement ++$i and post-increment $i++. In the for it is not clear as it is always executed after the execution of the block. A practical example to see the…
-
5
votes2
answers43
viewsA: What’s the best way to post this echo?
I would invert the code, let HTML call php and not the other way around: <a href="page.php"><em><?php echo $locale->translate('ID'); ?></em></a>' However, if you…
phpanswered Luis Henrique 3,693 -
2
votes1
answer412
viewsA: Mask for hour with iMask
Just change the defined wildcards for the mask: 00:00 Must be replaced by: 99:99 When you used 0 it is not replaced by anything because it is not a joker for the plugin that runs behind. The…
jqueryanswered Luis Henrique 3,693 -
5
votes2
answers349
viewsQ: Know if a class is native to JAVA or created by the User?
I created a method that uses Reflection to run getters on top of an object, but I need to know if the class is native to JAVA, for example: java.lang.String, or whether it has been implemented by…
-
0
votes2
answers277
viewsA: Error entering record, last possible Intel value already used
The value you are entering is greater than the maximum value supported by the type defined by the column. You can check the maximum sizes for each field: integer-types. An alternative to your…
mysqlanswered Luis Henrique 3,693 -
29
votes1
answer76391
viewsA: INNER JOIN with 3 tables
Just do 2 INNER JOIN by listing the keys of the tables. SELECT * FROM TB_ContratoCotista INNER JOIN TB_Contrato ON TB_Contrato.id_contrato = TB_ContratoCotista.id_contrato INNER JOIN TB_Cotista ON…
-
1
votes3
answers74
viewsA: How to select information from a table without duplicate values
Just use distinct SELECT DISTINCT sobrenome FROM alunos;
sqlanswered Luis Henrique 3,693 -
3
votes1
answer617
viewsA: How to set a char in a Preparedstatement?
Exactly this way, however it is necessary that the type passed is a String. Therefore: ps.setString(1, String.valueOf(veiculo.getTipoCombustivel())); Type mapping: JDBC Type Java Type…
-
1
votes1
answer45
viewsA: Bank query for another variable
Simply assign the value directly to the desired variable during the loop. <?php include ("conectar.php"); $query = "SELECT * FROM pontos ORDER by pontos DESC LIMIT 0,10"; if ($result =…
-
2
votes2
answers67
viewsA: Error displaying the sum of three arrays read
Your second for is wrong, try it this way: #include <stdio.h> #include <stdlib.h> int main() { int i, notas[5]; int soma = 0; for(i=0; i<3; i++) { printf("Digite os tres numeros:\n");…
-
0
votes2
answers335
viewsA: Split a String dynamically based on screen size
Can get the width string and work on it. Paint mPaint = new Paint(); mPaint.setTextSize(/*put here ur size*/); mPaint.setTypeface(/* put here ur font type */); Rect bounds = new Rect();…
-
1
votes2
answers10851
viewsA: How to return the difference in hours between two dates?
<?php $date1 = new DateTime("now"); $date2 = new DateTime("tomorrow"); $interval = date_diff($date1, $date2);
phpanswered Luis Henrique 3,693 -
-1
votes3
answers55
viewsA: Search value corresponding to weight
SELECT estado, kg, valorCap, valorExcedCap, valorAloremCap, prazoCap FROM transportadoras_valores WHERE id_transportadora = '1' && estado = 'AL' && kg > '3' && kg <=…
-
1
votes1
answer360
viewsA: Search by age in birth date field
SELECT * FROM paciente WHERE TIMESTAMPDIFF(YEAR, data_nascimento, CURDATE()) = idade
-
12
votes6
answers4694
viewsA: How to make a stopwatch continue counting after closing the page?
Can implement a stopwatch front-end using Javascript where by clicking on Play starts the timer, when the user clicks Pause or close the window should then send a Ajax to the PHP update the current…
-
4
votes1
answer1047
viewsA: How to remove a single element having several with the same id
Change the onClick from your remove button to onClick="delete_obj(this)". And Javascript for: function delete_obj(obj) { $(obj).parents('#telefone').remove(); } or function delete_obj(obj) {…
-
10
votes2
answers14697
viewsQ: Why does the address of some sites contain number after www?
Why are there urls that contain some number after www? (www1, www3, www12) What does this influence? It is possible to create a link like this? Ex: http://www1.folha.uol.com.br…
-
5
votes2
answers145
viewsA: Concatenate letters/words if it contains "&" and there is space between them
Can use preg_replace to replace the occurrence of & . preg_replace("/ *& */", "&", $string); With this regex you will replace the spaces that exist before and after the &. * :…
phpanswered Luis Henrique 3,693 -
0
votes2
answers261
viewsA: Inner Join display last status
Just make a GROUP BY numero.id SELECT numero.id, numero.numero, status.status, status.data FROM numero INNER JOIN dados ON numero.id = dados.id_numero INNER JOIN status ON numero.numero =…
mysqlanswered Luis Henrique 3,693 -
6
votes2
answers33357
viewsA: How to get the current date in Mysql?
Just use the function NOW() Ex: SELECT NOW() Return: 2015-04-29 12:07:45 Follows documentation: NOW…
mysqlanswered Luis Henrique 3,693 -
0
votes1
answer1523
viewsA: Log into a system via Curl and display data from another page
Problem solved. Really was the CURLOPT_FOLLOWLOCATION, I’ll put it on the server I was testing php on safe_mode and did not perform the redirect. I set the CURLOPT_FOLLOWLOCATION = true and I went…
-
1
votes1
answer1523
viewsQ: Log into a system via Curl and display data from another page
I am trying to display the contents of a page after logging in to the system. The login is done successfully, I receive the welcome from the system, but when changing the URL and making a new…
-
2
votes2
answers217
viewsA: preg_match('/ d*$/', $nr_procedure) ? 'f' : ’t'; - what do ? php
The function preg_match matches a regular expression in a string, returning 1 in match case, 0 if there was no match and false in case any error has occurred. You pass two parameters to it, the…
-
3
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 separate using substring. String imei = "36529874"; int size = imei.length()/2; String[] grupos = new String[size]; for (int i = 0; i < size; i++) { grupos[i] = imei.substring(i*2, i*2+2); }…
-
5
votes6
answers2106
viewsA: Smooth gradient color transition automatically
You can do it this way: Create a function to randomly generate RGB color: function getRandomColor() { var letters = '0123456789ABCDEF'.split(''); var color = '#'; for (var i = 0; i < 6; i++ ) {…
-
4
votes1
answer222
viewsQ: How to generate a random number within a range?
Using the mercy of arc4random_uniform(), how should I set the logic to generate a Random within a certain range? For example, given the range [5, 10] Candidates for Andom: 5, 6, 7, 8, 9, 10…
-
1
votes1
answer985
viewsA: ENUM returning only key and not value
Use as follows: SaleType.SEND_BUDGET.getSaleType()
-
2
votes3
answers1864
viewsA: How to return key of object with higher value in Javascript?
Using the each of jQuery and traversing through all objects, can do as follows: function getKeyOfMaxObjValue(obj){ // Variável que armazenará a maior key. var key; // Variável auxiliar para checar…
-
5
votes4
answers14217
viewsA: How to create/maintain "global variable" in java? To log in
Using the Pattern design Singleton. This pattern ensures the existence of only one instance of a class, maintaining a global access point to your object. Can create the class Sessao: public class…
-
7
votes2
answers1263
viewsA: How to create array dynamically?
From what I understand you want $p_p[0] be the key and $p_p[1] the value, then: $zt = array(); $zt[$p_p[0]] = $p_p[1]; print_r($zt);
-
2
votes2
answers484
viewsA: Find input values with same class
Can make a each in the items corresponding to the class sought. Example: var sum_p1 = 0; $('.p1').each(function (){ // O + antes do $ é para converter o valor para inteiro, uma vez que ele retorna…
jqueryanswered Luis Henrique 3,693 -
2
votes2
answers34
viewsA: Collect value from a return
Just select which key you want in this case is 0. Example: alert(dados.finalOFX[0]);
-
3
votes1
answer1409
viewsA: SQL syntax error
When they have n values in a insert, these need to be separated by a comma: insert into [table_name] (column_1, column_2, ...) values (value_1, value_2, ...), (value_3, value_4, ...) In your code…
-
2
votes1
answer56
viewsA: Argument when initializing Weka
This parameter sets the maximum size of the Heap available for Weka to use. You can read what Heap is here.…