|
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.
|
|
|
|
|
Take a sheet of paper and write a sentence.
How do you find the first space ?
How do you find the last space ?
What is the algorithm difference ?
you program should do the same.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
public static int lastOccunrance(String s ,char c)
{
int index=1;
int foundAtindex=-1;
for(char t:s.toCharArray())
{
if(t==c)
foundAtindex=index;
index++;
}
return foundAtindex;
}
// If not found then return -1
|
|
|
|
|
I am a Consumer of a SOAP Webservice. where we have one element named "Arrival" in stub given below. This got generated from providers WSDL.
@XmlElement(name = "Arrival", namespace = "https://www.xxxxxxxx.com/xxxxxx/", required = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar arrival;
** As of now we are sending Full Datetime in this element but now they are expecting only "Year" value but when i tried doing it i am getting:-
javax.xml.ws.soap.SOAPFaultException: Error in deserializing body of request message for operation xxxxxx.
|
|
|
|
|
Where are you getting this exception? What data is contained in the response?
|
|
|
|
|
Anyone Help me to explain how does this code works
DataInputStream in= new DataInputStream(new FileInputStream(steg.getFile()));
in.read(byteArray, 0, fileSize);
in.close();
Cipher cipher= Cipher.getInstance("DES");
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(password.substring(0, 8).getBytes(), "DES"));
byteArray= cipher.doFinal(byteArray);
|
|
|
|
|
It reads encrypted information from a file and decrypts it.
|
|
|
|
|
Can u please explain how that code works.
|
|
|
|
|
Sorry but this forum is for programming questions. If you want to learn a language or some of its features then you should consult the documentation.
|
|
|
|
|
Yes, so only i am asking to explain the code.
|
|
|
|
|
I have explained the code. If you want the full details of each line then you need to read the documentation for each library function.
|
|
|
|
|
u explain and provide those documentation..
|
|
|
|
|
Sorry we are not here to teach you programming. And Google will find you the documentation.
|
|
|
|
|
then what kind of stuff u provide here.
|
|
|
|