|
Logically, the only relation between the two is that they are siblings - they are both children of the parent node that encompases them. Neither of these is a parent or child to the other.
|
|
|
|
|
AshwiniSH wrote: Can i relate these two nodes? Yes, but how do you determine the relationship? As it stands there is nothing to connect the two nodes, they are just independent URIs; you need to set some rules that specify how they relate to each other.
Veni, vidi, abiit domum
|
|
|
|
|
Hello,
Can someone explain to me how the matrices work in code and how i can code in order to make an object move?
|
|
|
|
|
That's hardly a question for a forum like this. You need to go and find some teaching materials or articles that discuss the subject.
Veni, vidi, abiit domum
|
|
|
|
|
Hi everyone, I'm currently having a problem in fixing my program. I put a comment in the code below where I think the problem is. I can't pass the values in the methods getWood and getDrawer to the method calcPrice. In the Main(), it should display there all of the information. I'm stuck in this thing please help me thank you so much.
using System;
public class DesksP
{
static int Main()
{
int drawerA = getDrawer();
string getWoodA = getWood();
int getPrice = calcPrice();
Console.WriteLine("The number of drawers is/are: {0}", drawerA);
Console.WriteLine("The type of wood is: {0}", getWoodA);
Console.WriteLine("The total cost of drawer/s is/are: {0}", getPrice);
return 0;
}
private static int getDrawer()
{
int numDrawers;
Console.Write("Enter number of drawer/s: ");
return numDrawers = Convert.ToInt32((Console.ReadLine()));
}
private static string getWood()
{
string woodType;
Console.WriteLine("Enter the type of wood. m for Mahogany, p for Pine and o for Oak: ");
return woodType = Console.ReadLine();
}
private static int calcPrice(int drawerA, char getWoodA)
{
int total = 0;
if(getWoodA == 'p')
total = drawerA * 100;
else if(getWoodA == 'o')
total = drawerA * 140;
else
total = drawerA * 180;
return total;
}
}
modified 26-Nov-13 8:27am.
|
|
|
|
|
The message is pretty explicit: "no overload for method 'calcPrice' takes 0 arguments"
So why are you trying to call it without handing it the parameters it is looking for?
private static int calcPrice(int drawerA, char getWoodA)
Needs two parameters, which you are asking how to pass - so call it with the parameters you want it to work on supplied!
int drawerA = getDrawer();
string getWoodA = getWood();
int getPrice = calcPrice(drawerA, getWoodA);
|
|
|
|
|
Hi I tried your code but I still have an error, anyway I explored my code again and tied to modify it again but it still has an error
using System;
public class ComputePriceDesk
{
public static void Main()
{
double calc = usersDrawers();
Console.WriteLine ("The total of your desk is $ {0}", calc);
}
public static double usersDrawers()
{
int New;
string HowManyDrawers = "";
Console.Write("How many drawers will you like in your desk?: ");
HowManyDrawers = Console.ReadLine();
New = Convert.ToInt32(HowManyDrawers);
return New;
}
public static int woodType()
{
string woodType;
char charWoodType;
Console.WriteLine ("What type of Wood will your desk be? ");
Console.WriteLine ("m for mahogony");
Console.WriteLine ("o for oak");
Console.WriteLine ("p for pine");
woodType = Console.ReadLine();
charWoodType = Convert.ToChar(woodType);
return 0;
}
public static int usersWood()
{
const int moh = 180;
const int oak = 140;
const int pine = 100;
int wood;
if (woodType.Equals('m') || woodType.Equals('M'))
wood = moh;
else if (woodType.Equals('o') || woodType.Equals('O'))
wood = oak;
else
wood = pine;
return wood;
}
public static void calculations(int totalDrawers, char wood)
{
int totalDrawers;
char wood;
int calc;
calc = totalDrawers * wood;
}
}
|
|
|
|
|
This looks okay:
double calc = usersDrawers();
Then you explicitly state that the return value is a double , yet you return an int .
public static double usersDrawers()
{
int New;
...
return New;
}
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
I think the time has come for you to step away from the keyboard, take a deep breath, and re-read your lecture notes - because you appear to be making changes at random!
Your original question was about calling the method you have renamed to "calculations", but you now don't call it at all. You also don't tell us what your "still has an error" is - or where it is, or whether it is run time of compile, etc.
All your code would do if you could run it is ask the user how many drawers he wants, and then tell him a desk will cost that number of dollars!
But you can't run it, can you? Because it doesn't compile. Why not? Because your "usersWood" method needs a parameter called "woodType" that you haven't told it it should expect, so it reports it can't find a variable called "woodType" in the current context. But that's ok - you don't call it anyway...
Seriously: sit down, read through your notes and try to think what you need to do, because at the moment you are probably getting frustrated because nothing you try works, and you don't know what to do, and why are computers so stupid, and...
If you stop and think about the whole task, I believe you can do this. But just guessing and hoping it will work isn't going to do anything pleasant, any more than it would if you tried to learn to drive by jumping in a Bugatti Veyron and slamming the accelerator to the floor...
|
|
|
|
|
Go and read the book I recommended to you, it explains in detail this and other issues in C#.
Veni, vidi, abiit domum
|
|
|
|
|
Hi All,
Need Decrypt C# code for below Encryption code---
public string CreatePwdHash(string pwd)
{
string s = "";
ASCIIEncoding encoding = new ASCIIEncoding();
for (int i = 0; i < pwd.Length; i++)
{
char ch = pwd[i];
byte[] bytes = encoding.GetBytes(ch.GetHashCode().ToString());
char ch2 = pwd[i];
s = s + ch2.GetHashCode().ToString() + Convert.ToBase64String(bytes);
}
return Convert.ToBase64String(encoding.GetBytes(s)).ToUpper();
}
|
|
|
|
|
That's not encryption at all.
That's is a very poor method of converting meaningless data to Base64. There is no way to convert a HashCode back to the original string that it came from.
Also, you should NEVER include code in your application that decrypts a password, no matter how it's encrypted. This increases the level of security in your application making it far more difficult to get users passwords.
If you want to know how to cryptographically hash passwords, read this[^].
|
|
|
|
|
It looks as if you don't believe what I've already told you.
Do yourself a favour and look up one way functions[^].
"I had the right to remain silent, but I didn't have the ability!"
Ron White, Comedian
|
|
|
|
|
As you have been told (here and in the Lounge) you can't "decrypt" a hash value - it is not encryption.
See here: Password Storage: How to do it.[^] it should explain it to you.
|
|
|
|
|
Where did you find that gem? From the viewpoint of security, it is: bad.
Since you are calling GetHashCode on each character of the string, that thing might actually be reversible... (though hash functions are actually meant to be irreversible, but the input value has a far too narrow range).
Actually, you only need a table containg the hash code for all possible char values (note: release version, not debug version, as they might be different).
No, do not do so. Throw that function away.
If you need to identify users of your application, use proper hashing, with salt!
If you need to pass the password to another service (database, email provider, ...) use proper encryption.
|
|
|
|
|
Hi,
I have develop Chat application like gtalk, Some one help me, how start and develop.
Thanks for reading..
|
|
|
|
|
You can start by searching CodeProject, where you'll find many resources.
As you design your application, and start to write code, you can ask specific questions here, or on the QA forums, and many people will be glad to help you ... if ... you take the time to write your questions clearly, specify what you are doing, and give details about the problems you are having.
"What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts.
Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett
|
|
|
|
|
|
You might want to look at a number of samples available on the internet.
|
|
|
|
|
The program of conversion
1. Binary to decimal
2. Decimal to binary
3. Hex decimal to decimal
4. Decimal to hex decimal
5. Octal to decimal
6. Decimal to octal
Means at the user's request, for example, the introduction of No. 4
Convert from Decimal to hex decimal
Thus, the rest of the options, preferably without work ARRAYS
|
|
|
|
|
A little reading of the .NET number classes would show you how to solve this quite easily.
Veni, vidi, abiit domum
|
|
|
|
|
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
Try it yourself, you may find it is not as difficult as you think!
|
|
|
|
|
Some of these conversions are supported by the framework classes.
However, assuming this is homework, you need to implement these using some logic.
Look at the algorithms for these conversions and then implement them in your code.
|
|
|
|
|
That is a process called "base conversion", to give you something to google for.
|
|
|
|
|