Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
When answering a question please:
Read the question carefully
Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
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.
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 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
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)
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?
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?
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?
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.
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's a forum another person had answered for this question. so if u know programming u can explain ,,,, how does this code process... it's Audio steganography using LSB technique by this u wouls have answered.
HI im tryin to implement dijkstra's algorithm in java but my output is not correct. The output should be [0,492,665,114,452,999] but i keep getting a different range.Can anybody help please as i need this for my assignment. Thnks
public ArrayList <Integer> dijkstra (int start, int end) // start = 0 & end = 999
int N = adj.length;
HashMap <Integer,Double> Q = new HashMap <Integer,Double>(); // key,value
ArrayList <Integer>  paths = new ArrayList [N]; // paths 1000//System.out.println( "paths.Length" + paths.length); for (int i=0;i<N;i++) // end = 999
Q.put(i,Double.POSITIVE_INFINITY); // blank i = 0 to 999(keys/vertex)//System.out.println("Q @ " +Q.get(999));
paths[i]=new ArrayList <Integer>();
paths[i] = new ArrayList<Integer>(start); // blank distances
HashSet <Integer> S= new HashSet(); // contains unique elements
S.add(start); // blank
Q.put(start,Q.get(start)); //blank while (!Q.isEmpty())
int v = findSmallest(Q); // blank//System.out.println("key of Q " + v)if (v==end && Q.get(v)!= Double.POSITIVE_INFINITY) // blank Q ! map to vreturn paths[end]; // blankdouble w = Q.get(v); // blank
S.add(v); // blankfor(int u: neighbours(v))
double w1= adj[u][v] + w; // adj contains all the weigths of the graphif (w1 < Q.get(u))
returnnew ArrayList <Integer> ();
You prevent yourself from getting help because we don't have the input data and we don't have actual result.
When you don't understand what your code is doing or why it does what it does, the answer is debugger. Use the debugger to see what your code is doing. Just set a breakpoint and see your code performing, the debugger allow you to execute lines 1 by 1 and to inspect variables as it execute, it is an incredible learning tool.
The debugger is here to show you what your code is doing and your task is to compare with what it should do. There is no magic in the debugger, it don't find bugs, it just help you to. When the code don't do what is expected, you are close to a bug.
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
Also, you cannot convert C# code to Java code because there is a lot of difference in the standards of C# language and Java. Even if you could find a tool that converts the bytecodes to nearest Java code, there will be a lot of problems.
The problems will be more tough to solve, compared to creating the new application. You can easily create a new application, in NetBeans if you just look at what was done in C# and do the same in Java.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
In my workplace we have an application that requires us to enter a unique tracking code into a java input field. We normally do this by scanning a barcode on an item until all items are scanned.
We already have a list of the unique tracking codes in excel so rather than scan each barcode when we have 100 or so items we copy from excel, paste into the field press tab to add the item and then copy paste tab repeat until all 100 items are added.
Is there a way to automate the copy cell --> paste id into input box --> Have the script press tab after id is pasted and repeat until all 100 items are added?
Posting this in Java as I am needing to put the data into a java application that is embedded in a web page but maybe I can paste the list into a Windows Form or a C++ application and then have that program perform the copy paste tab function for all items in the list.
Appreciate anyone's help I have no idea where to start.
Just an idea (which depends on the format of multiple selected cells).
Create a multi line input field where the content of all selected and copied cells can be inserted at once. Create a button that reads the input field content, splits it (depending on the separation characters provided by Excel when putting the data on the clipboard), and adds the items.
Excel puts the data in multiple formats to the clipboard but the form usually uses only the text format with line feed terminated rows and space (or tab?) separated columns. To check this just paste into any text editor.
I only have the raw data of Unique IDs so they don't have to be in excel can be in notepad or just pasted anywhere.
The IDs are being input into a Java Applet and must be added one ID at a time. So I need to copy Cell A1, Paste Into Applet & Press Tab and then copy Cell A2, Paste,Tab Repeat until all cells have been added into the applet.
The IDs are in excel but could be in a text file or just pasted into an application that could read all ids line by line input the text into the applet followed by tab key and repeat until there is no more lines to read.
As the applet input field is a text field I don't think any excel formatting of separating values will carry over from excel or a text file to the text field in the applet.
If the data are separated in some form (as text) and you are able to split them, then your applet should be able to iterate over the splitted data and perform the necessary operation on each item.
There will be some separating when Excel generates text to be put on the clipboard (or saved as text file; the default text file format used by Excel is TAB separation). When the cells did not contain spaces it should be always possible to split.
I understand that this might not be possible (especially when there may be multiple formats). Was just a suggestion.
Will it matter if the IDs are in Cell A1, A2 or should they been in A1, B1 all on the same row?
Sorry, but I can't answer that because I did not know in which order they are copied and if the order is important. But if there is no specific relation between the cell position and the content just forget the Excel cell indexes.