|
We know that XNA tool is good for develop games,
We also know that Visual Studio 2005 with DirectX9.0c SDK is another tool to do this ,It use DirectX3D's classes to build the game ,I have found that the XNA tool uses its own classes, any differents between XNA environment and DirectX SDK if only runs on PC?
|
|
|
|
|
Hi ,
I would like to know if it is possible to read a particular file from DVD present inn the DVD -Rom . The concept is the Main exe should search for all dvd-roms in the system to find this file and should call another exe if the file exists in any one of the DVD in the DVD-ROM.
I don't know how to read from DVD -ROM with C#.Any Help would be appreciated
|
|
|
|
|
hi,
i am giving xml filename as a some extra characters like &,",',@ but it is throwing error.
how can i convert these extra chratctrs to a specific format and save the filename.
pls help me
with regards
prasad
-- modified at 3:26 Thursday 12th April, 2007
|
|
|
|
|
First and foremost you it is not advisable to do so !! Can you tell me whats the exact requirement so that we can go for a proper approach !!
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
hi,
thank u for u r response..
Error i am gettign is:
"The & character,hexadecimal vale 0x26 can't be included i a filename"
I am storing some values in an XMl file and i am passing Filename as parameter of a method.
Not by SaveDialogControl.
Through code. And if I give the correct file name it is saving as a xml file.
But if i give pass extra chracters to a file name through method.
It is giving errror like.
"The & character,hexadecimal vale 0x26 can't be included i a filename"
|
|
|
|
|
That is fine but my question is why to want to store a file name with special character as most of OS doesn't allow that !!!
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
ya i got u
but i want to replace like
if & replace with "&";
if " replace with """;
pls help me
|
|
|
|
|
Hi,
Is is possible to add user defined compiler errors to CompilerError class.
My requirement is while compiling my file, using codeDomProvider,
I want to Check for the presence of Special Characters in timername. If it
is there a compilerError should be raised.
forexample,
if my file contains a line like
setTimer(timername);
and if timername contains any special characters, that should be
deducted while compiling. I want to add that error to compilerError Class
How can i do that.
Sakthi.
|
|
|
|
|
My gut feeling says that you can't code a user defined compiler errors as this means you are try modify .NET compiler which MS doesn't allow
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
I am newbie at this, please try to be patient with me. In my class at school we have been trying out various loops in problems. The instructor calls the one we've been using a "Sentinel Loop". If there is another name for it I don't know what it is.
I can get it to accept the input and also the stopping statement. I can even get the program to tell me the sales tax and shipping "on an individual input".
The instructor wants to be able to input several figures and when the stopping statement is triggered, have the program show the total shipping cost and sales tax for all of the inputs together.
I have placed the math parts between the two input statements, and also outside of the loop.
My question is: "Do I need to put the math section into a method and if so where would I place the calling statement so that it would only work after the stop statement is triggered or would something else be even more appropriate?"
I have been beating my head against the wall for the last 10 days, and have not figured out an answer. I have tried everything I can think of.
Can someone either please answer the question or at least steer me to the information on how to do this type of a problem. I would appreciate it greatly.
This is the main body of my sentinel loop program. I can get it to work fine.
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
<br />
namespace Exer4Chpt6<br />
{<br />
class Program<br />
{<br />
static void Main()<br />
{<br />
string inValue = "";<br />
double salesAmount = 0;<br />
double salesTax;<br />
double shipAmount = 0;<br />
double grdTotal;<br />
const double INTEREST_RATE = .07;<br />
double overAllTotal = 0;<br />
double totalShippingAmt = 0;<br />
double totalSalesTax = 0;<br />
<br />
Console.WriteLine("Enter as many different sales amounts ");<br />
Console.WriteLine("as you want. You will be shown the sales ");<br />
Console.WriteLine("amount, sales tax, shipping amount, and ");<br />
Console.WriteLine("the grand total. To Stop, enter");<br />
Console.WriteLine(" -99");<br />
Console.WriteLine();<br />
<br />
Console.WriteLine("Please type in a sales amount.");<br />
inValue = Console.ReadLine();
while (inValue != "-99")<br />
{<br />
salesAmount = Convert.ToDouble(inValue);<br />
salesTax = salesAmount * INTEREST_RATE;<br />
<br />
Console.WriteLine("Please type in a sales amount.");<br />
inValue = Console.ReadLine();
}<br />
}<br />
}<br />
}<br />
This is the math section of my program that I'm having the trouble with. The problem isn't in the math expressions themselves, but more in the placement to get it to do what I want.
if (salesAmount < 250.01)<br />
{<br />
shipAmount = 5.0;<br />
}<br />
else if (salesAmount < 500.01)<br />
{<br />
shipAmount = 8.0;<br />
}<br />
else if (salesAmount < 1000.01)<br />
{<br />
shipAmount = 10.0;<br />
}<br />
else if (salesAmount <= 5000.00)<br />
{<br />
shipAmount = 15.0;<br />
}<br />
else if (salesAmount > 5000.00)<br />
{<br />
shipAmount = 20.0;<br />
}<br />
else<br />
Console.WriteLine("Please type in a sales amount.");<br />
<br />
grdTotal = salesAmount + shipAmount + salesTax;<br />
overAllTotal += grdTotal;<br />
totalShippingAmt += shipAmount;<br />
totalSalesTax += salesAmount;<br />
Console.WriteLine();<br />
Console.WriteLine("Your final sales amount was: {0:C2}", grdTotal);<br />
Console.WriteLine();<br />
Console.WriteLine("Your sales tax amount was: {0:C2}", totalSalesTax);<br />
Console.WriteLine();<br />
Console.WriteLine("Your shipping amount was: {0:C2}", totalShippingAmt);<br />
Console.WriteLine();<br />
Console.WriteLine("Your total bill is: {0:C2} ", overAllTotal);<br />
Console.WriteLine();
Any help will be very greatly welcome. Thank you.
|
|
|
|
|
I was able to recheck on these type of loops and found a solution. By placing the math section after the final input I've got it to work correctly. I placed the math section in the spot shown below.
<br />
salesAmount = Convert.ToDouble(inValue);<br />
salesTax = salesAmount * INTEREST_RATE;<br />
<br />
Console.WriteLine("Please type in a sales amount.");<br />
inValue = Console.ReadLine();
}<br />
}<br />
|
|
|
|
|
Hi All,
Anybody knows why main() is called as main?
Why not someother names but Main()?
Anticipating your responses.
Thank You,
-Saran
|
|
|
|
|
|
Its name based on its compiler ,
If compiler is editable, you can change it to whatever you like ,
|
|
|
|
|
My feeling is that Microsoft wanted to have its own way of specifying the single entry point to program. And wanted to get away with traditional way !!!
Regards,
Jaiprakash M Bankolli
jaiprakash.bankolli@gmail.com
http://jaiprakash.blog.com/
|
|
|
|
|
The name comes from C, where the function that holds the code for the main program is called "main", so the name has been around for at least 30 years.
---
single minded; short sighted; long gone;
|
|
|
|
|
I am using RichTextBox class to display some text, and then I want to syntax highlight whats written to it.
So, i use Find(...) to select required text and then use SelectionFont,SelectionColor to changle font/color of the words i need.
The problem is that when i type, i have to do this when the text changes, and i actually see how text gets selected and changes it's color, and that is very annoying...
So, my question is, how to solve this problem? Maybe i can somehow disable redrawing of control till i completely highlighted control or smthing like ?
|
|
|
|
|
|
Hi EveryBody,
We know that Delegate is a Functional Pointer. But i want to pass Member name as a variable to Delegates. The example given below.
*--------------------------------------------------------------------------
using System;
namespace Delegate_concept
{
public delegate void MyFunction(int a, int b);
class Delegate_Method
{
public static void Function1 (int x, int y)
{
Console.WriteLine("Sum is"+(x+y));
}
public static void Function2 (int x, int y)
{
Console.WriteLine("Sub is"+(x-y));
}
public static void Function3(int x, int y)
{
Console.WriteLine("Mul is"+(x*y));
}
static void Main(string[] args)
{
int i = 1;
string Fstring = "Function";
string nString;
for ( i=1; i<=3; i++)
{
nString=Fstring+i.ToString();
MyFunction mObj = new MyFunction(@(nString));
mObj(20,5);
Console.Read();
}
}
}
}
*------------------------------------------------------------------------
In the above example, i am storing each function name into "nString" variable.
While creating instance, can i pass this variable name as a parameter. Because the variable name contains name of the function. Or i want to evaluvate the variable nString and execute the function name which i stored in "nString" variable.
If any solution or suggession please write to: act_ramesh@yahoo.com
Thanks
sfsad sdafasd fsadfasdf asd fsdf sdafsadsdafsda
|
|
|
|
|
Constructor MyFunction mObj = new MyFunction(void (int, int)target);
expects a target == method . You cannot provide string instead of method itself.
If you really want to call those methods by their index(Function1, Function2,...) , put them into a List<myfunction> or Dictionary<int, myfunction=""> :
Dictionary<int, myfunction=""> dFunctions = new Dictionary<int, myfunction="">();
//or
List<myfunction> lFunctions = new List<myfunction>();
//fill list/dictionary
...
//call method
for ( i=1; i<=3; i++)
{
dFunctions[i](20,5); // or lFunctions[i](20,5);
Console.Read();
}
|
|
|
|
|
I recently had a series of very good interviews with a company I was very excited about and was told I was the top candidate for the senior position. At the end of the interview I was given the assignment below and I was told to zip up the files and return them to the project manager for review when I was done. I was open in the interview that I had no experience in unit testing. I was assured this was no problem and I could omit that portion of the exercise. However, I opted to give it a shot - an opportunity to show I was a quick and willing learner when needed.
After I turned in the "assignment" to the project manager, I was told that after reviewing the code I would be passed over for the position.
I would be VERY appreciative of any feedback anyone might have as to what's wrong with my sample project? I have worked for the same small company for over 6 years and had no experience when I did, so I don't know if there's something I did that killed it for me. I bear no ill will to the company I interviewed for and I have removed any indications from any text that might indicate who the interview was with. But I still must continue to interview and if I'm doing something wrong, I want to nip it in the bud.
The assignment is below and here's a link to the project, exactly as I submitted it: Hire_Exercise.zip (179.7 Kb)
Please, don't spare my feelings, I would really appreciate some constructive criticism.
Thanks,
Mark
--------------------------------------------------------------------------------------------------
Hiring_Exercise
Development Requirements
1) Read an ascii text file named “Hire_input.txt” that contains a list of numbers with values between 0 and 100, each number separated by a cr/lf
Sample input (Hire_input.txt)
6
54
12
22
1
6
2) Sort the numbers in ascending order and write the results to an output file named “Hire_Ascending.txt”. Format the file in the same manner as the input file (cr/lf delimiters).
Sample output (Hire_Ascending.txt)
1
6
6
12
22
54
3) Group the numbers by their value and produce a histogram list providing the count of how many numbers of each value were read. Write the output to a file named “Hire_histogram.txt”, formatted using cr/lf delimiters.
Sample output (Hire_histogram.txt)
1 – 1
6 – 2
12 – 1
22 – 1
54 – 1
Additional Notes
• Name the program Hire_exercise.exe
• No user interface is required, the program will be run from the console should require no command line parameters to execute normally
• Assume that all files (input and output) will be found/created in the same directory as the program executes
• As part of the exercise, you are expected to write unit tests appropriate for the task.
• Use the development tools of your choice.
• You may not use any external libraries with the exception of standard I/O and a unit testing framework (if you choose).
• You may not use any built-in data structures such as lists, vectors, queues etc. You must build your solution using basic types such as integers, strings and arrays.
• You may not use any built-in sort or histogram functions.
• Please submit all available aspects of your work (source, buildfiles, executables, test input/output etc)
|
|
|
|
|
Haven't the foggiest idea what may have changed their mind so quickly. I looked through it, and it seems good to me. The only thing that I noticed that didn't follow the "Additional Notes" was the naming of the program to Hire_excercise.exe...
|
|
|
|
|
Thanks,
Regarding the program name, I changed the assignment text to remove the initials of the company, but didn't change the source code or output - the name of the program is what the original assignment asked for. But like I said, don't spare my feelings
|
|
|
|
|
Not sure if this is something you would consider, but why not call or email the Project Manager and ask what exactly the deal breaker was? Couldn't hurt to get some feedback so you can improve in the future...
|
|
|
|
|
Thanks, I have done that. But he said he won't be able to get back to me for a week or so. I figured I could get second opinions in the mean-time.
I guess patience isn't on my list of strong point
|
|
|
|