Posts by Sullyvan Nunes • 389 points
16 posts
-
3
votes1
answer278
viewsA: How to call a script with arguments?
You can "capture" parameters per command line through the constant ARGV. When you call ruby gasto_calorico 150 70 20 30 m, do: unless ARGV.length == 5 #se os parametros não foram passados…
rubyanswered Sullyvan Nunes 389 -
1
votes1
answer233
viewsA: Compress array with equal values C
As pointed out in the comments, your first problem is the initialization of the comp variable before the for commands. Solving this, a logic problem appears when discovering the repeated variables.…
canswered Sullyvan Nunes 389 -
0
votes3
answers123
viewsA: problem with inversion of values of a vector
I don’t know the syntax of c++ so I’ll do it in c because the logic is the same. From what I understand of the question, it is a planet where the order of 3 and 7 and reversed. Soon every time I…
-
0
votes2
answers2149
viewsA: How to detect the largest word of a string in C?
The function below takes a string per parameter and returns the largest word contained in that String. It checks the size of the largest word and puts it into a temporary one returning at the end…
-
1
votes1
answer198
viewsA: Error loading file to chained list
Marcelo, your problem is very simple. in the first line of the file load function, you assign the value list->Prox in the pointer to schedule, p. cronograma *p = lista->prox; causing p to…
-
0
votes2
answers771
viewsQ: Securityexception android
When I run in Android Studio the code below: public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
1
votes3
answers950
viewsA: system.out.println(""); syntax error
your problem is quite simple and it happens to most people who start in the Java world. The System.out.println("") method starts with the larger "S" of the System Class. Try with a larger "S" and…
javaanswered Sullyvan Nunes 389 -
1
votes1
answer896
viewsA: Doubt with business rule between student class and class
user45813 your error lies exactly in the class constructor Class. In line 17 and 22 of the class Testaturma you create two Objects, class 1 and class 2, respectively. However, on line 15 of the…
javaanswered Sullyvan Nunes 389 -
0
votes1
answer1259
viewsQ: Uncaught Soapfault Exception: [Versionmismatch]
I’m testing a Web Service simple that sends and receives a string, however the server (Apache 2) returns the following error message: Fatal error: Uncaught Soapfault Exception: [Versionmismatch]…
-
1
votes0
answers51
viewsQ: Error while fetching HTTP headers in php Web Services
I am learning how to create Web Services and I am making two files in php, server and client. Server.php <?php class functions { function mensagem() { return 'hello server'; } function soma($a,…
-
5
votes1
answer180
viewsA: How to check for certain values in an array?
I took a look at the in_array documentation on http://php.net/manual/en/function.in-array.php and from what I understand the "ok again" is not appearing for the following reason: in_array(array(1,…
-
-2
votes3
answers74
viewsA: SQL Query autodelete
It takes two bank accesses, one to search and one to delete. What you can do is a DELETE and SELECT in the same query. It would look something like this: DELETE FROM table_name WHERE colunaA=(SELECT…
-
5
votes2
answers6127
viewsA: Code for calculating the first N primes in C?
this error is happening because when w gets 1 it does not return to the initial value that is 0. try this way. for(k = i - 1, w = 0; k != 1; k++) { if(i%k==0) { w = 1; break; } } so when you return…
canswered Sullyvan Nunes 389 -
1
votes3
answers4717
viewsQ: I can’t connect with postgresql in php
I’m trying to make a PHP Login system using Postgresql but I can’t get my application to connect to the database. follows the code: <?php $connect = pg_connect("dbname=testebd"); //Banco de dados…
-
1
votes1
answer347
viewsA: What is CDI technology?
CDI is the Java EE 6 specification that takes care of the injection part of dependencies. To better interact on the subject of a read on…
-
10
votes3
answers115
viewsQ: Is there any way to generalize library imports into Java?
I created inside the same package called Banco, two classes in Java: ContaSalario and ContaPoupanca. When I’m going to import these two classes into my main class, I do: import Banco.ContaSalario;…