|
|
I see two equally meaningless posts about "a priori" and "bayes". It seems that an assignment in the statistics / applied maths course has just been given and what does everybody do? Look through their course notes, refer to a text book or do some searching on Google, nope... ask Code Project!
|
|
|
|
|
Seems to be a growing standard for "how can I get my homework done". 
|
|
|
|
|
sir, please can any one tell me how "Naive Bayes Algorithm" implemented in java or web application project.
and how it work?
|
|
|
|
|
Google will find you the details.
|
|
|
|
|
I have a really hard professor in my Data structures class. I wrote the program to construct the tree from postfix to infix expression. But the problem is I also need to produce an output file to show registers.
Example of the infix expression:
((3-(5+9))/(2*3))
Example of the output file:
Add R0 5 9
Sub R1 3 R0
Mul R2 2 3
Div R3 R1 R2
Any help would be greatly appreciated.
Thanks
|
|
|
|
|
Member 13106249 wrote: Any help would be greatly appreciated. Exactly what help are you asking for?
|
|
|
|
|
Hello,
I am all new to java trying to learn same basic and make same little application.
I am stuck on beginning ) Can't make connection work from java app.
I make connection to server from services (there I may see database).
DB - TEST
ID - int
user - nchar(10)
pass - nchar(10)
But whan trying to run basic app it show
run:
Got an exception!
com.microsoft.jdbc.sqlserver.SQLServerDriver
BUILD SUCCESSFUL (total time: 0 seconds)
Code is
package javaapp;
import java.sql.*;
public class javaapp
{
public static void main(String[] args)
{
try
{
String myDriver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
String myUrl = "jdbc:sqlserver://core3:1433;databaseName=test";
Class.forName(myDriver);
Connection conn = DriverManager.getConnection(myUrl, "test", "test");
String query = "SELECT * FROM test";
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(query);
while (rs.next())
{
int id = rs.getInt("id");
String Ime = rs.getString("ime");
String Pasw = rs.getString("pass");
System.out.format("%d, %s %s", id, Ime, Pasw);
}
st.close();
}
catch (Exception e)
{
System.err.println("Got an exception! ");
System.err.println(e.getMessage());
}
}
}
Any tip will be welcome.
I using netbeans 8.2 and have JRE 1.8.0_121
JDBC used sqljdbc42.jar
|
|
|
|
|
You need to use the debugger to identify which statement causes the exception, and also try and see if there is more information available in the Exception object. The details provided do not give any clue as to what is wrong.
|
|
|
|
|
hello....i m creating a lan messenger with facility like pc sharing...to access remote pc ....like creating workgroup and access other pc files in own computer......
pls help me with the sharing part...
Thank you
|
|
|
|
|
|
I am currently developing an email client as my school project using javafx and gmail api. I have fetched the email content in both format json as well as mimeMessage , I want to know how can I show the email content which is having images links and texts in a javafx UI and what components should I use for the gui
|
|
|
|
|
|
I want to know that whether, I have to extract images text individually from the json object and then display them accordingly , or I have to use a webview if so then how ? or there is something else I have to do.
|
|
|
|
|
That is all part of the research you need to do to complete your project. You need to look at each possible item in your email and figure out how you want to display it in the final message that the user sees.
|
|
|
|
|
hi,
i.m getting error message while running script
java.lang.RuntimeException: java.lang.InstantiationException:
java.lang.RuntimeException: java.lang.InstantiationException: com.orangeAppScreenPages.UserAgreement
at org.openqa.selenium.support.PageFactory.instantiatePage(PageFactory.java:134)
at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:64)
at com.testCasesAndroid.SmokeTestingAndroid.Test(SmokeTestingAndroid.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:756)
at org.testng.TestRunner.run(TestRunner.java:610)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
at org.testng.TestNG.runSuites(TestNG.java:1133)
at org.testng.TestNG.run(TestNG.java:1104)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)
Caused by: java.lang.InstantiationException: com.orangeAppScreenPages.UserAgreement
at java.lang.Class.newInstance(Class.java:427)
at org.openqa.selenium.support.PageFactory.instantiatePage(PageFactory.java:131)
... 27 more
Caused by: java.lang.NoSuchMethodException: com.orangeAppScreenPages.UserAgreement.<init>()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.newInstance(Class.java:412)
... 28 more
===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0
===============================================
===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
Configuration Failures: 1, Skips: 0
===============================================
[TestNG] Time taken by org.testng.reporters.XMLReporter@72c28d64: 6 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@31000e60: 5 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@47f4e407: 11 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@57ea113a: 13 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@424ebba3: 30 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 5 ms
|
|
|
|
|
Caused by: java.lang.NoSuchMethodException: com.orangeAppScreenPages.UserAgreement.<init>()
The key part of that error message is NoSuchMethodException . You need to go back to the documentation for the class to find out what it should be.
|
|
|
|
|
So I'm creating a card game and need some help with the best way to structure my classes. Let's use Hearthstone as an example though because lots of people are familiar with it. (No I'm not actually re-creating Hearthstone but many of the structural ideas are common among many card games)
Question 1
Firstly, We have these
[Card] - has a name, cost, class, rarity, set, image, text, effects
[Minion] - a type of card which also has Attack and Health
[Spell] - a type of card
[Weapon] - a type of card which also has Attack and Durability
Those attributes need to be accessed regularly (getAttack() etc) What's the best way to represent this hierarchy in Java classes? I've heard inheritance (Minion extends Card, Spell extends Card, Weapon extends Card) is generally frowned upon. But I also can't see the purpose in making Card an interface. Should I use one of these options anyway or is there a nicer alternative?
Question 2
In a game of Hearthstone each player has a hand, deck, "graveyard", "board" (where minions are played), weapon slot and active Secrets. These are all arrays of Cards although "board" can only contain minions and the weapon slot can only contain a single weapon.
[Card in hand] - has a "base" Card and may have its attributes modified (cost, attack, health) by an effect
[Minion on board] - has a "base" Minion, current Health, may be Divine Shielded/Stealthed, may have its attributes modified by effects
[Weapon equipped] - has a "base" Weapon, current Durability, may have its attributes modified by effects
[Active Secret] - has a "base" Spell and a trigger (something happening that causes it to activate)
Naturally cards can move around between these zones. My original idea is to have a separate class for each zone with an instance variable "Card basecard" and when a card moves from eg hand to board, remove the Card in Hand from the hand array and place a Minion on board in the board array. Again, is there a nicer alternative?
Question 3
Cards have effects. There are different kinds of effects
[Battlecry, Deathrattle] - something happens when the minion is played or dies
[Trigger] - something happens when a specific "trigger" affects the minion while it's on board (eg it takes damage like Acolyte of Pain)
[Continuous] - the minion constantly affects the game in some way while it's on the board (eg buffs other minions like Dire Wolf Alpha)
[Modifier] - the minion constantly modifies its own attributes in some way (eg lowers cost for each other card in hand like Mountain Giant)
Each Card has an array of Effects. But different effects require different methods; Trigger effects have a Trigger, Battlecries often have a "target" which may only include minions with certain attributes, continuous effects don't "do something" at a particular time they just need to be checked constantly by other objects etc
Is there a good way to represent THIS hierarchy? Again, my first thought is to just use inheritance but it gets messy. I know it seems like a big ask but is there a "nice" way to do something like this?
|
|
|
|
|
|
import java.util.*;
public class Test19 {
public static void main(String[] args) {
String str1="HELLO JAVA HELLO PYTHON";
int count=0;
String str2[]=str1.split(" ");
for(int i=0;i<str2.length;i++){
for(int k=0;k>0;k++){
if(str2[i]!=str2[k]){
count++;
}//if
}//for k
System.out.println(str2[i]+"--> "+count);
}//for i
}
}
--------------------------------------------undesired output-------
HELLO--> 0
JAVA--> 0
HELLO--> 0
PYTHON--> 0
--------------------------------------want like this output-------
JAVA--> 1
PYTHON--> 1
|
|
|
|
|
|
Create an HTML file AddCookies.html which contains four text boxes .When user enters the values in these text boxes and press the submit button, the values will be sent to AddCookies.java servlet and get saved in cookies.
|
|
|
|
|
|
am bit confused to get the logic for the programm
|
|
|
|
|
How would you find the first occurence of a character?
By comparing each character starting at the begin of the string until found or reaching the end of the string.
For the last occurence do it similar but start at the end of the string.
|
|
|
|