Posts by ptkato • 2,383 points
62 posts
-
2
votes1
answer64
viewsA: Problems with instance list in Haskell
The problem is that you are trying to make an instance of Char(?!) for [a]. What you want is an instance of ParImpar for [a]: instance ParImpar [a] where decide a | mod (length a) 2 == 0 = Par |…
-
1
votes1
answer74
viewsA: Null Reset,I made a check before entering the values and the error continues
You need to instantiate a login and put it inside the user, a good way to do this would be using the user builder: public Usuario(Login login) { this.login = login; } That way, the login would…
-
1
votes2
answers89
viewsQ: Array.prototype.filter does not work as expected
I am trying to validate fields using the Array.prototype.filter() method, but it does not seem to have an effect: <script> function isEmpty() { document.getElementById("submit").disabled =…
javascriptasked ptkato 2,383 -
1
votes1
answer1317
viewsA: How to solve the date validation problem - Calendar - Primefaces?
To the locale="pt" work, you need add a javascript on your page because by default it is only in English. Mask is just a mask, not the formatting itself. However, you can force the Brazilian pattern…
-
3
votes1
answer87
viewsQ: Define a function with different amounts of arguments
Is there any reason why this function: foo f x y = f x y foo x y = (+) x y Return this error? Equations for `foo' have Different Numbers of Arguments Why doesn’t Haskell allow this behavior?…
-
2
votes2
answers3120
viewsA: The name 'parameters' does not exist in the Current context
In C# (and many other languages), there are scopes, that are contexts that delimit the area of action of a variable, for example. If you try to do public String Foo(int y, int x) //escopo externo {…
-
2
votes1
answer192
viewsQ: What is the difference between the following methods?
I am developing a JSF application and came across the following methods and want to know the difference between them. ((HttpSession)FacesContext.getCurrentInstance()…
-
1
votes0
answers216
viewsQ: How to use inheritance in Managedbeans?
Considering: public abstract class Usuario { public Usuario(String login, String senha) { this.login = login; this.senha = senha; } private String login; private String senha; } public class…
-
4
votes2
answers137
viewsQ: What JSF DTD to use with HTML5 tags
Usually, when I do a JSF page with XHTML, I use the DTD for XHTML 1.0 Transitional. However, if I use namespace and put some HTML5 tags (passtrough Elements/Attributes), which DTD should I use?…
-
3
votes2
answers373
viewsQ: Selectonemenu is not powered
I have a p:selectOneMenu and would like it to be fed with existing data in the database as soon as the page was loaded: xhtml. <p:selectOneMenu id="carros"> <f:selectItem itemLabel="Carros"…
-
4
votes2
answers360
viewsQ: Put method return before a "Finally" block
Considering: try { System.out.println("Parte 1"); return false; } finally { System.out.println("Parte 2"); } What will be the output and what happens behind the scenes so that the output come out…
-
0
votes1
answer212
viewsQ: Problem with "match" attribute of a text field
I’m using the attribute match of a <p:password/>, but it doesn’t work properly. <p:password id="senha"/> <p:password match="senha"/> When I send the form via commandButton, an…
-
2
votes1
answer203
viewsQ: Null pointer exception on a radio button
I’m trying to put two Primefaces radio buttons on one page xhtml: <p:selectOneRadio id="fis_jur" layout="custom" value="#{usuario.fis_jur}" required="true"> <f:selectItem itemLabel="Física"…
-
6
votes1
answer12542
viewsQ: Tomcat startup problem
As a stopgap measure for this mistake, I installed XAMPP and placed it (Tomcat) as a container for Netbeans. But when I run a project in Netbeans, the following error appears in the Tomcat console…
-
0
votes1
answer1051
viewsQ: Target Unreachable, Identifier resolved to null
When I try to open the page, I get: javax.el.PropertyNotFoundException: pagina.xhtml @3,54 value="#{meuManagedBean.valores}": Target Unreachable, identifier 'meuManagedBean' resolved to null…
-
0
votes1
answer701
viewsQ: How to pass data between pages?
I’m trying to pass some values between pages using Managedbeans, but it’s not working: @ManagedBean @SessionScoped public class Chute { private Boolean chutar; //getters e setters... } On the first…
-
0
votes2
answers986
viewsQ: Dialog some after opening
I’m using a dialog of the first faces: <h:form> <p:dialog widgetVar="dialog" modal="true" resizable="false"> <p:outputLabel value="Mensagem qualquer."/> <p:commandButton…
-
1
votes1
answer762
viewsQ: JSF does not find component ID
I have something like <p:panelGrid id="tabelaUm"> <h:form id="formUm" rendered="#{condicao ? true : false}"/> <p:commandButton action="#{condicao = false}" update="formUm,…
-
4
votes1
answer630
viewsQ: How to get the client’s requisition?
I’m trying to get the user session from the request, but I’m not sure if I’m capturing the request correctly: I have a Managed Bean (Sessionscoped) with data. The following block creates a user’s…
-
1
votes3
answers5288
viewsQ: Problem with access to Tomcat at time of deployment
I am working on a Javaee project in Netbeans IDE 8.0.1 using Tomcat 8.0.9 as a container. The problem occurs at the time of project execution, the IDE asks for a user and password and I provide…
-
3
votes1
answer9074
viewsQ: How to select only one radio button?
In the swing of Java, a user can select more than one radio button simultaneously, so this does not happen, one can do: private void radio1ActionPerformed(java.awt.event.ActionEvent evt) { if…
-
12
votes1
answer998
viewsQ: What’s the difference between "ON" and "USING"?
Considering two ways to declare one INNER JOIN, we have: SELECT * FROM tabela1 INNER JOIN tabela2 ON tabela1.cd_tabela1 = tabela2.cd_tabela1; and SELECT * FROM tabela1 INNER JOIN tabela2…
-
18
votes1
answer2737
views -
6
votes1
answer264
viewsA: Relational model in Firebird with C#
I believe you switched the balls, the foreign keys always stay on the side N. Your tables would look something like this: client table id_client (primary key) name date bonus table id_bonus (foreign…
-
2
votes1
answer275
viewsQ: Create a conditional using the relational model
I’m trying to create a conditional "or" just using the relational paradigm: Having the tables pessoa, cliente, funcionario and considering that a person may be a client or an employee (a 1:1 ratio,…
-
5
votes1
answer3713
viewsQ: How do I enable "explicit_defaults_for_timestamp"?
I installed Mysql Server 5.6. When I try to connect the Mysql server by running mysqld.exe, I get the following message: [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use…
-
1
votes1
answer137
viewsQ: What is the difference between these two statements?
I was reading some tutorials and documentations and came across two different ways to declare the RequestContext: RequestContext requestContext = RequestContext.getCurrentInstance();…
-
1
votes1
answer1917
viewsQ: Tomcat: Application at context path /Project could not be Started
I’m facing some problems with Tomcat 8.0.9 when I tried to get into /Projeto I received a HTTP STATUS 404, I went to look at the manager and was standing still, when I tried to start the /Projeto…
-
5
votes1
answer3583
viewsQ: How to apply a style to two different elements using :Hover?
Considering: HTML <div id="div1"> <p>Elemento 1</p> </div> <div id="div2"> <p>Elemento 2</p> </div> How can I use the :hover in the div1 to change…
-
5
votes1
answer73
viewsQ: Is there any difference between an event with passing parameters to one without passing?
Considering: jQuery $("#seletor1").on("click", function(){ $("#seletor2").trigger("click", {dados: "informação"}); }); $("#seletor2").on("click", function(){ //faça coisas });…
-
8
votes2
answers1924
viewsA: How to pull content via AJAX from a site that has a menu header and a fixed audio player?
You can split the site into several parts: HTML <head> <!-- Sempre importe as bibliotecas antes de tentar trabalhar com elas. --> <script…
-
3
votes1
answer85
viewsQ: How to take blocks out of a grid?
I’m trying to do something similar to the facebook Timeline, two columns with multiple posts, the problem is, in some parts a hole opens, the reason is that the bottom block (on the left) is, in the…
-
2
votes1
answer949
viewsQ: Tomcat continues to show old files
I update the files (html, javascript), but when I access the index.html, the files are not as they should, there shows a totally different page, older, and the file of this page does not exist…
-
4
votes2
answers1249
viewsQ: "Break" or "Return false"?
Within a function there is a repeating structure, as to the processing economy, which is the best? Javascript function minhaFuncao(boom){ for(i = boom; i > 10; i--){ if(i < 0){ break; } } } or…
javascriptasked ptkato 2,383 -
4
votes1
answer520
viewsQ: How to access an element (or its values) generated dynamically?
I know it’s possible to use the on() and delegate the selector, so it accesses the dynamic element from a static element, but if it cannot use the on(), what to do? For example, inside any function…
-
6
votes1
answer75
viewsQ: Send data along with event
As I venture through jQuery some questions and problems arise in the middle of the way, one of them is: is it possible to send a data through an event triggered by another event? Something like…
-
9
votes1
answer25431
viewsQ: How to make a click shoot another click?
I wonder if there’s a way to click on an element by clicking on another place, something like this: jQuery $("#button1").click(function(){ $("#button2").click(); }); I tried that and it didn’t work.…
-
1
votes1
answer110
viewsQ: Button triggers the method of your container
I created a tab that opens and closes using jQuery and am having some problems closing it: HTML <div id="aba" style="position: absolute"> <img src="#"/> <span…
-
1
votes2
answers527
viewsA: Arraylist in JAVA
You have some alternatives, among them: Add the player you selected to Arraylist Time before having it removed from the Arraylist of players for sale: public class Time { private…
-
26
votes2
answers119390
viewsQ: How to insert date and datetime into a table in Mysql?
The big problem is that after the insert, all values that have date, are as zeroes and in the format yyyy-dd-mm and not dd/mm/yyyy, as it was inserted initially. How can I insert these values into…
-
3
votes2
answers8812
viewsQ: How to take the value of a Listbox from the selected index of another Listbox?
I’m trying to get the value of a ListBox from the selected index of another ListBox, but it doesn’t work. What I have so far: for (int i = 0; i < 10; i++) { Lst_ListBoxA.Add(2 * (3 * i) * 4);…
-
9
votes4
answers243
viewsQ: Within a decision structure, does the order of terms change the outcome?
Is there any difference between: if (variavelA == variavelB) and if (variavelB == variavelA) In Java and C#, is there a difference between the examples? I stress that the question is not limited to…
-
0
votes1
answer54
viewsQ: Method does not act as expected
When I go to check the following code, there is nothing in any of the ComboBoxes. For me, everything is normal, I see nothing wrong, what can be? public FormExemplo() { ExemploList = new…
-
1
votes1
answer8336
viewsQ: How to break a label line automatically?
= .NET Framework 4.0 = Visual C# I have a problem with Labels, when I assign a value to the property text and this value is very large, it "breaks" its container, going beyond the edges, with this,…
-
2
votes2
answers3231
viewsQ: Some method to save data from an Arraylist
First of all, some information: = .NET Framework 4.0 = Visual C# I’m simulating a database using a class specifically for this, using a List<string[]>, however, I would like to be able to…
-
3
votes1
answer1354
views -
-1
votes1
answer3237
viewsQ: How to display the values of an Arraylist separately?
class Principal { public static void main(String[] args) { Scanner entrada = new Scanner(System.in); ArrayList colecao = new ArrayList(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 2;…
-
-1
votes1
answer651
viewsQ: Arraylist returning null values
Well, I have an array, I add values to that array, I send them to a method in another class that puts the values of that array into one string only and I add that single string into an Arraylist,…
-
4
votes1
answer772
viewsQ: How to always leave a form behind?
I’m trying to always leave a form underneath the other forms, no matter if the user clicks on it, it should always be below, but usable, something similar to the desktop, and that’s the problem, I’m…
-
0
votes1
answer560
viewsQ: How to display items from an Arraylist by an array?
I came up with a code here, it’s like this: class Main { Lista lista = new Lista(); public static void main(String[] args) { i = 0; String[] vetorExibir; lista.exibicao(vetorExibir = new…