Posts by Antonio Alexandre • 3,281 points
107 posts
-
1
votes4
answers1152
viewsA: Javascript function with Nan error
Comrade, you are giving Not a Number(Nan) pq if you enter a value that is not within the comparisons, no value will be set in the variables ECG_TRUE, BPM_TRUE and FR_TRUE. So instead of comparing at…
-
2
votes2
answers2149
viewsA: include with parameter?
I suggest the following solution: Create a function to receive both parameters and return the desired html output. Ex: Function getHorarios.php <?php function getHorarios($dia_semana, $id_pessoa)…
-
5
votes2
answers1336
viewsA: What’s the difference between "Compile time" and "run time"?
Compile Time - Compilation time: During compilation, obvious code problems are detected as syntax errors. Run Time - Running time: Errors may also occur during execution. These may be caused by…
runtimeanswered Antonio Alexandre 3,281 -
1
votes3
answers575
viewsA: EPSON non fiscal thermal printer does not work in a shared way with USB and LPT
Viewing line 372 of the Windowsprintconnector.php file: return copy($from, $to); We see that you are trying to make a copy of a file from one location to another. Check if you are allowed to create…
-
0
votes2
answers4092
viewsA: Icon inside the input
With input does not give, use the tag button which is the same as a button type input, only it accepts html in. See the code below. <link rel="stylesheet"…
-
4
votes6
answers7179
viewsA: Simple Solution for Fibonacci Algorithm
I would not say that my solution is better, is just different and with a few more details, being a numerical detail and two aesthetic firulias, but in the same algorithm is very similar. import…
-
2
votes2
answers366
viewsA: Does using "Document.open" and "Document.close" make a difference?
As Anderson said, the document.open opens a output stream and leaves the browser with that charging signal, waiting for calls from document.write and a document.close to finalize. To illustrate an…
-
3
votes2
answers1511
viewsA: Reading data from a Java file
I made an example for you using split to break the line spaces and save to an array and an switch to check if the name on each of the pieces equals one of the values of the switch and, if married,…
-
0
votes8
answers16426
viewsA: Why is using "SELECT * FROM table" bad?
They say they use SELECT * FROM tabela is bad because normally you do not need all columns and not all rows of the table. If the table has few rows, using query like this has no burden, but see this…
-
1
votes3
answers79
viewsA: Problem to attack son and doubt in this use
With Jquery you can use child selector ( > ) to reach the span from inside the div #b. <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>…
-
1
votes2
answers212
viewsA: Why of Null Pointer Exception in simple Java agenda program, and how to configure the function that returns an array of phones
The exception Null Pointer Exception occurs when you try to access a reference that instead of pointing to an object, is with the value Null. This occurs when the variable is initialized, we do not…
-
0
votes2
answers115
viewsA: Logic for consultation in subscription system
Desired query: "Users who are in subscriptions that have plans that are with regular payments." First step: We need to identify what "plans that are with regular payments" means. In my opinion…
mysqlanswered Antonio Alexandre 3,281 -
0
votes7
answers1017
viewsA: Is there any way to know if an array is associative or sequential?
I have always used the function below for this verification: function is_assoc($array) { $arr_keys = array_keys($array); $arr_shift = array_shift($arr_keys); if(is_array($array) &&…
-
4
votes1
answer1189
viewsA: What is the difference between Netbeans JAVA WEB and Java EE?
The Java Web Project in the Netbeans IDE, which has the globine icon, creates a container with two important folders: Web Pages, which generally stores jsps, htmls, css, and javascript files, and…
-
1
votes4
answers31096
viewsA: Writing and reading file via Javascript
You can create cookies using document.cookie="nomedocookie=valor"; and cookies will be saved together in a line in a txt file in the browser. To read a cookie, use a function such as: function…
-
3
votes2
answers441
viewsA: What does this piece of code mean?
Reading of the code: On the line Toolkit tk = Toolkit.getDefaultToolkit(); you make use of the static method getDefaultToolkit() to return the Toolkit platform-specific Toolkit being a superclass of…
-
2
votes3
answers1598
viewsA: Hibernate vs Eclipselink
Hibernate is more rugged, consumes more memory and so can be considered heavier, but under extreme conditions it is more efficient by doing much more Inserts and queries per minute. Use it in…
-
2
votes2
answers928
viewsA: Close entityManager after operations? How to manage?
Things you learn after you hit your head: 1) Try to use only one jpa variable during every run. 2) Close the connection at the end. 3) If something goes wrong, give a rollback, close the connection…
-
4
votes2
answers6310
viewsA: Searching for an object inside an Arraylist
The Account class is OK if you remove the modifier static. Use static can’t use this, because static classes cannot be instantiated, that is, they cannot have objects created with the new. I created…
-
13
votes2
answers1068
viewsA: Is there a reason for separating the java and javax packages?
The separation between these packages is for a better organization. The java package is more basic and the package javax are extra features, enhanced, that can make use of pure java classes or not.…
javaanswered Antonio Alexandre 3,281 -
3
votes2
answers701
viewsA: java email sending does not show error when unable to send the same
The problem in question is the email being typed wrong. ( not that the email is invalid, it is simply a valid email that does not exist) A simple thing you can do that doesn’t solve completely but…
-
0
votes2
answers701
viewsA: In Netbeans it works, not in Jar
A command used to execute an executable class that was set as the default for the project (the one that was set as the default will be executed if there is more than one executable class inside the…
-
1
votes1
answer251
viewsA: Java Text Streams
Your code became very good, only lacked small details. I searched here and was adapting. First problem: The file path has to be complete. I put the file in c: and the file name I passed…
javaanswered Antonio Alexandre 3,281 -
1
votes1
answer262
viewsA: Access modifier for Java methods - Default
One answer just for the record: The answer is the letter A. If you have no access modifier specified, then the access is package(package). If a subclass is in another package, will not have…
-
2
votes1
answer265
viewsA: What is the "right way" to use PHP destructors
The method __destruct serves to perform one last action before the object ceases to exist. One use that can be made with it if you build a framework is to put it into a generic Controller by calling…
-
0
votes2
answers1223
viewsA: SQL - Searching for best-selling product in a date range
Apart from the fact that group by and order by should come at the end, after Where, it may be interesting to include the Count column with a nickname. SELECT produto_id, count(produto_id) as…
sqlanswered Antonio Alexandre 3,281 -
1
votes1
answer3118
viewsQ: Medical Practice Class Diagram Conference
Based on the mini-world below was modeled a Class Diagram in the Astah Community (free version with less Features that the professional for non-commercial use: http://astah.net/editions/community -…
-
4
votes3
answers391
viewsA: php doubts how to generate ten random password
The PHP 7 has a function called random_bytes that if you convert from binary to Hex, generates a string similar to what you want. <?php // Usando a função random_bytes do PHP 7 for ($x = 1; $x…
phpanswered Antonio Alexandre 3,281 -
11
votes4
answers11718
viewsA: What are the differences between web application and desktop application?
Web Application - It is an application that runs on the web. The core of the application must run on the web server, which is a different machine than the one where the user interacts, which is the…
-
0
votes2
answers62
viewsA: MYSQL: sort by specific Rows within SELECT
In Mysql everything is or becomes a table. One thing you can do is take the lines the way they’re coming, like a table, and sort that table that came. EX: SELECT PRODUCT,TIME,DATE FROM (…
-
6
votes3
answers701
viewsA: Make a search independent of the order of the keywords
1) Change the engine from Myisam table (which is the default), to Innodb. 2) Add an index of type FULLTEXT in the field that will have the search. ALTER TABLE `nometabela` ADD FULLTEXT…
-
0
votes1
answer141
viewsA: setar background color do radio button via javascript
Analyzing the code posted, I make three considerations: 1) If you don’t have tag form, you can click on Ubmit the will that goes nowhere. 2) There is no element with the Submit id on your page, so…
-
2
votes3
answers815
viewsA: How to change page content according to the end inserted in the link (URL)?
Jonas, you must take the parameter of the url by accessing the variable $_GET["p"] and use the value in your select query that will pick up the line with the user data. Next you print these…
-
1
votes2
answers434
viewsA: Pass the value of a Function post to another Function?
The variable situa only exists in the scope of the function that is executed at post return. If it was essential to pass to another function this variable would have to be declared globally, but…
-
1
votes1
answer72
viewsA: Error when displaying bank return in Mysqli
According to the manual ( http://php.net/manual/en/mysqli-stmt.fetch.php ), you must use bind_result to bind the columns. fetch will put the column values in the variables that were bound. The…
-
1
votes2
answers83
viewsA: How to instantiate an object according to a Front End event?
If I understand correctly, you want to pass a stock value to know what to do next. Normally you pass parameters by $_GET in the url, $_POST via form or breaking the url when using friendly url.…
-
1
votes2
answers207
viewsA: Print full day of the week adding one day
I know the question has already been answered, but for those who need to take the day of the week in Portuguese in systems where there is no way to change the language, you can use a function like…
-
1
votes6
answers6389
viewsA: What is a legacy code?
Bequest. s.m. What is passed on to the generations that follow. When you join a company, you call yourself legacy code every code that you must maintain and which you did not participate in the…
-
3
votes3
answers377
viewsQ: Hibernate works OK, but does not finish the process
I don’t know if this is normal, but Hibernate starts the process, inserts the object into the database, but its java process is open. What I have to do to make this process automatically end after…
-
2
votes3
answers922
viewsA: Check external file loading with JS
The onload only runs after all page content is loaded. I tested with a video following the Marconi link to the Jbueno answer. Follow the example: window.onload=function() {…
-
0
votes3
answers109
viewsA: Prompt in javascript does not redirect
Correct the following passage: if page (!= null) changing to if (page!= null) <!DOCTYPE html> <html> <head> <title>Teste</title> <meta http-equiv="Content-Type"…
-
2
votes1
answer2837
viewsA: Variables $_SESSION reset after reloading PHP page
You will need to give session_start() on all protected pages, with a fragment of the type: <?php session_start(); if(!isset($_SESSION["autenticado"])) { header("Location: login.html") } ?> If…
-
0
votes1
answer2330
viewsA: String concatenation in PHP from Array
To concatenate string in php you must use $vartexto = $vartexto . 'texto novo'; or in a reduced form $vartexto.='texto novo'; Follow your code snippet with a variable $cod_produtos_juntos that will…
phpanswered Antonio Alexandre 3,281 -
4
votes1
answer186
viewsA: How to leave ZIP form sliding equal to ifood site?
Bira, if you have knowledge of CSS3 you can create the animation in CSS3 and use javascript only to include the animation class, but you don’t even need to use Jquery if you don’t know, it can be…
-
2
votes2
answers301
viewsA: Contest Question: Java code about over-writing methods
If in class A in public void m1() { mx(); } were public void m1() { mdx(); } Then the letter and would be the right answer. But if in class A, if the method mdx, called instead of that, mx, then the…
javaanswered Antonio Alexandre 3,281 -
14
votes3
answers983
viewsA: What is a variable?
Variable is a name that holds a value, as Maniero very well explained in his reply. This value can be of various types and the variable has visibility scopes that depend on where it was originally…
-
1
votes1
answer483
viewsA: Use of . append() or . html() - jQuery
Ezequiel, the site was unavailable at the time of my reply, so I created a json.php file to test and pasted your json that you wrote in the comment on it. I removed the interrogations(??) from the…
-
21
votes2
answers71704
viewsA: How to make image responsive
If you set the image to 100% width it will adjust to the size of the container where it is. If you are not inside any container you will adjust to the page size. Dentro de container, container de…
cssanswered Antonio Alexandre 3,281 -
1
votes4
answers1358
viewsA: How to return the date and time closest to that informed by the user
There is no INTERSECT for Mysql and it was necessary to emulate using UNION ALL. This SQL at first looks weird, but it is not complicated, and passes all tests, locating the correct location for…
-
1
votes2
answers387
viewsA: Save atomatic in PHP does not work with Success and serialization
Luccas, you followed a tutorial without taking into account that the tutorial could be with errors. And that reference, my friend, was really lame in many parts. So what I did was take the tutorial…