|
I have configured Realm with JDBC, but when I try to login I get this message in Console
TRACE [org.jboss.as.domain.management.security] (default task-1) User 'UserNameDGU' not found in properties file.
and before I have seen this:
DEBUG [org.wildfly.security] (management I/O-1) Unable to create instance: java.security.NoSuchAlgorithmException: Service not registered with Provider WildFlyElytron: WildFlyElytron: SaslServerFactory.DIGEST-SHA -> org.wildfly.security.sasl.digest.DigestServerFactory
|
|
|
|
|
write a general python program that takes into account:
1. The cost of your ideal house. (basic)
2. The cost needed for a down payment. (basic)
3. Your annual salary. (basic)
4. The portion of your salary that you will
|
|
|
|
|
Apart from the fact that point 4 has been cut off early, there is no information about what the program is supposed to do. I could write the following:
def somethings():
print("Ideal house cost £295,000")
print("Down payment £29,500")
print("Annual salary £57,000")
print("The portion of my salary that I will")
But as you can see it is meaningless.
|
|
|
|
|
Message Closed
modified 29-Oct-20 4:20am.
|
|
|
|
|
First off this is nothing to do with Java, so it really belongs in Quick Answers[^] .
Secondly, do not expect people here to do your work for you. Show the code that you have written, explain what does not work (in proper details) and people will try to help you. But remember, this is your assignment, so you are expected to solve it.
|
|
|
|
|
The question is this-:
Write a program using for loop that computes sinx and cosx by using the following power series-
sinx=x-x^3/3!+x^5/5!-x^7/7!+....
cosx=1-x^2/2!+x^4/4!-x^6/6!+.....
Note-(Here ! is used for factorial of that number and ^ for to the power)
What I have tried is-:
class sincos
{
void main(double x,int n)
{
int i,j,k,f;
double sum=0.0;
x=Math.toRadians(x);
{
for(i=1,j=1;i<=n;i=i+2,j++)
{
f=1;
for(k=1;k<=i;k++)
{
f=f*i;
}
if(j%2==0)
sum=sum-(Math.pow(x,i)/f);
else
sum=sum+(Math.pow(x,i)/f);
}
System.out.println("sin"+Math.toDegrees(x)+"="+sum);
}
for(i=0,j=1;i<=n;i=i+2,j++)
{
f=1;
for(k=1;k<=i;k++)
{
f=f*i;
}
if(j%2==0)
sum=sum-(Math.pow(x,i)/f);
else
sum=sum+(Math.pow(x,i)/f);
}
System.out.println("cos"+Math.toDegrees(x)+"="+sum);
}}
My problem is that I am not understanding that whether the source code I wrote is correct or not as the output is coming something else .I checked the code many times but still can't understand where the problem is.
So can you check my source code and correct it according to the question.
-- modified 5-Dec-20 21:01pm.
|
|
|
|
|
Compiling does not mean your code is right!
Think of the development process as writing an email: compiling successfully means that you wrote the email in the right language - English, rather than German for example - not that the email contained the message you wanted to send.
So now you enter the second stage of development (in reality it's the fourth or fifth, but you'll come to the earlier stages later): Testing and Debugging.
Start by looking at what it does do, and how that differs from what you wanted. This is important, because it give you information as to why it's doing it. For example, if a program is intended to let the user enter a number and it doubles it and prints the answer, then if the input / output was like this:
Input Expected output Actual output
1 2 1
2 4 4
3 6 9
4 8 16 Then it's fairly obvious that the problem is with the bit which doubles it - it's not adding itself to itself, or multiplying it by 2, it's multiplying it by itself and returning the square of the input.
So with that, you can look at the code and it's obvious that it's somewhere here:
int Double(int value)
{
return value * value;
}
Once you have an idea what might be going wrong, start using the debugger to find out why. Put a breakpoint on the first line of the method, and run your app. When it reaches the breakpoint, the debugger will stop, and hand control over to you. You can now run your code line-by-line (called "single stepping") and look at (or even change) variable contents as necessary (heck, you can even change the code and try again if you need to).
Think about what each line in the code should do before you execute it, and compare that to what it actually did when you use the "Step over" button to execute each line in turn. Did it do what you expect? If so, move on to the next line.
If not, why not? How does it differ?
Hopefully, that should help you locate which part of that code has a problem, and what the problem is.
This is a skill, and it's one which is well worth developing as it helps you in the real world as well as in development. And like all skills, it only improves by use!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
The question is this-:
Write a program using for loop that computes sinx and cosx by using the following power series-
sinx=x-x^3/3!+x^5/5!-x^7/7!+....
cosx=1-x^2/2!+x^4/4!-x^6/6!+....
Note-(Here ! is used for factorial of that number and ^ for to the power)
-- modified 5-Dec-20 21:01pm.
|
|
|
|
|
No that is not the question. That is a description of your assignment.
|
|
|
|
|
Oh man that is only the question on which I coded .How can it be a description,you are not understanding it.Read once more
The question is this-:
Write a program using for loop that computes sinx and cosx by using the following power series-
sinx=x-x^3/3!+x^5/5!-x^7/7!+....
cosx=1-x^2/2!+x^4/4!-x^6/6!+.....
Note-(Here ! is used for factorial of that number and ^ for to the power)
-- modified 5-Dec-20 21:01pm.
|
|
|
|
|
Sir I am a student who is still learning coding so please if you can help me, then only tell .All information about the question has been already posted above.
-- modified 5-Dec-20 21:01pm.
|
|
|
|
|
Tech Proof wrote: if you can help me, then only tell
Tell what? Despite repeated requests you still have not explained what your problem is.
|
|
|
|
|
Don't be angry.....
My problem is that I am not understanding that whether the source code I wrote is correct or not as the output is coming something else .I checked the code many times but still can't understand where the problem is.
So can you check my source code and correct it according to the question.
Hope you will understand now.
-- modified 5-Dec-20 21:01pm.
|
|
|
|
|
Tech Proof wrote: Don't be angry. I am not angry, I am just trying to get you to explain what the problem is. And just saying, "it does not work", or "the output is not correct", does not help us. You need to explain where the code is going wrong and why. We cannot be expected to build and debug the code in every question that gets posted here. Many of us have work of our own that takes priority.
|
|
|
|
|
OK, I am feeling generous, so here is part of the answer:
import java.io.*;
import java.util.*;
class Trig {
static double factorial(int number) {
double product = number;
while (--number > 0) {
product *= number;
}
return product;
}
static double sine(int angle) {
double radians = (Math.PI * angle) / 180.0;
double sum = radians;
boolean minus = true;
for (int power = 3; ; power += 2) {
double dividend = Math.pow(radians, power);
double divisor = factorial(power);
double quotient = dividend / divisor;
if (minus) {
sum -= quotient;
}
else {
sum += quotient;
}
minus = !minus;
if (power > 20)
break;
}
return sum;
}
public static void main(String[] argv) {
System.out.printf("sin(90) = %f\n", sine(90));
System.out.printf("sin(180) = %f\n", sine(180));
System.out.printf("sin(270) = %f\n", sine(270));
}
}
|
|
|
|
|
Quote: My problem is that I am not understanding that whether the source code I wrote is correct or not
Your code do not behave the way you expect, or you don't understand why !
There is an almost universal solution: Run your code on debugger step by step, inspect variables.
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 know what your code is supposed to do, it don't find bugs, it just help you to by showing you what is going on. When the code don't do what is expected, you are close to a bug.
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.
Debugger - Wikipedia, the free encyclopedia[^]
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]
Basic Debugging with Visual Studio 2010 - YouTube[^]
1.11 — Debugging your program (stepping and breakpoints) | Learn C++[^]
The debugger is here to only show you what your code is doing and your task is to compare with what it should do.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
Example 1:
Input : s ="()";
Output : true
Example 2:
Input: s = "() [] {}"
Output : true
Example 3:
Input : s = "(]"
Output : false
Example 4:
Input : s = "([)]"
Output : fasle
Example 5:
Input : s = "{[] }"
Output : true
The Condition should match s ="()" true condition. or s ="(" should return false … same for other conditions as well
|
|
|
|
|
OK, and do you have an actual question?
|
|
|
|
|
If you're looking for the code that evaluates enclosing brackets to validate they are matched up and nested correctly, that's not going to happen.
|
|
|
|
|
<pre>You are required to analyze the performance for Principles of Computer Programming subject
containing 135 students. Your program will prompt for final marks of each student, accumulate
the total and calculate the average. Display the average mark and the grade obtained based on
the information in Table 2 below. Design a pseudocode and write a full java program to provide
the solution.
Table 2: (Grade Category based on Average Mark)
--
Average mark range // Grade Category
Below 50 - Low
50 to 79 - Good
80 and above - Excellent </pre>
|
|
|
|
|
This is a very basic beginner program in any language. The whole intent is to learn with this. If this was an assignment you should attempt it yourself.
Pseduocode steps:
1. Take marks of a student as input
2. Calculate average of the input marks
3. Based on table 2 category, find the grade using average marks
4. Print the average and grades
5. Repeat step 1 to 4 for 135 students
Please try of. Post specific query if you face trouble. Don't forget to share what you tried and where you get stuck.
|
|
|
|
|
i tried but... im confused and slow and this def wrong
import java.util.*;
public class Mark {
public Mark () {
}
public static void main(String args[]) {
String grade;
int avgMark;
int studentMark;
Scanner input = new Scanner (System.in);
System.out.println(" Your Mark: ");
studentMark = input.nextInt();
avgMark = (total + finalMark) / 2
if(avgMark >= 80)
{
System.out.println("Grade: Excellent");
}
else if (avgMark >= 50 && avgMark <= 79) {
System.out.println(" Grade: Good ");
}
else if (avgMark <= 50) {
System.out.println(" Grade: Low ");
}
}
}
|
|
|
|
|
|
Hey guys so iam in a bit of a stump. Me and a friend have been working on a hard drive wiping software that is absolutely amazing. Well it turned out to be that way by chance.... It is in perfect working order... I was helping with Linux side of things. Anyways my friend has had a recent job change and is being bombarded with work. He is unable to help with the project anymore, considering he has a stake in the software and even gets paid, its kind of odd for him to take off. The software uses Linux command lines, udev, node.js, php, angular and batch for the core of its operation. It is by far the most advanced batch disk wiping software currently in development and has been in development for over a year.
I am looking for a skilled nodejs programmer and can give a break down of how the software works. I need help with the nodejs portion of the software. Anyone that is willing to devote some of their spare time will not be disappointed.
If there are any takers please go ahead and respond to me with your skype or discord info.
|
|
|
|