I'm starting in this programming and I'm getting into the OOP. In python, why in the classes it is put __init__
?. And this may sound stupid, but why use classes when you can use functions?
I'm looking at the topic of annotations in the Oracle documentation . And looking at this example:
@ClassPreamble (
author = "John Doe",
date = "3/17/2002",
currentRevision = 6,
lastModified = "4/12/2004",
lastModifiedBy = "Jane Doe",
// Note array notation
reviewers = {"Alice", "Bob", "Cindy"}
)
public class Generation3List extends Generation2List {
// class code goes here
}
I still don't understand what it can do for me. For example, if I remove the annotation it still works; So what are they generally used for? They explained to me that they are used for interfaces but until then I understood.
When a notice occurs, the code may work, but it may not display what we expect.
I think that these are the three types of news that we can have more frequently in PHP.
Notice: Undefined variable
Notice: Undefined index
Notice: Undefined offset
What do these three news mean and what could generate them?
Note:
This question exists in SO in English , the idea is to have a good answer also in Spanish that helps to understand problems that PHP always shows us in English.
As we know, in SQL statements terminate, or should they terminate? by a semicolon ;
.
I mean:
SELECT persona_id, persona_nom FROM persona;
But it turns out that in programming languages, it is very often written like this:
Form A:
$SQL="SELECT persona_id, persona_nom FROM persona";
Here the semicolon at the end is to indicate the end of that line in the programming language, not the SQL statement, which will be sent to the database driver without the semicolon .
Generally the SQL statement works without the semicolon in it .
In my case I try to write like this:
Form B:
$SQL="SELECT persona_id, persona_nom FROM persona;";
Here only the semicolon within the quotes will be sent to the database handler, while the final semicolon will indicate an end of line in the programming language.
My question is if I might get some unexpected result or just the program might crash in some cases when we use way A .
A scenario in which (I think), it could be problematic, would be in the hypothetical case of executing, in successive calls, normal SQL statements and Stored Procedures or functions created by the same user.
Hello, I'm blocked to perform an action with jQuery.
I have this:
<div>
<p>
Password: <span id="passwordServer">*********</span>
<b><i id="togglePasswordServer" class="unhide icon"></i></b>
</p>
</div>
<script>
$(document).ready(function(){
var passwordServer = "123456";
$("#passwordServer").text(passwordServer);
});
</script>
Basically what I want to do is the password appears hidden as long as it is not pressed in the label and I have been investigating and it shows that with the function longclick
but it is with a plugin external to jQuery .
The password that is stored in the variable would not be seen until the with passwordServer
is pressed ; if you stop pressing it, it shows the .i
id="togglePasswordServer
*****