|
thanks guys for the help. It was gladly appreciated
Ferron
|
|
|
|
|
Hello guys I have a data transfer class in which among all the code in it i have created 2 events. in the envent handler of the event DownloadBegin im running a new form. The code below demonstrates what im doing.
//Events
public event delegateNull DownloadBegin;
public event delegateNull DownloadFinished;
//Event Handler
private void btnListenforConnections_Click(object sender, EventArgs e)
{
//Start listing for incoming connection from client applications
transfer.StratListiningForIncomingConnections();
lblincomingconnection.Text = "Listening for incomming connections";
transfer.DownloadBegin += new Transfer.delegateNull(transfer_DownloadBegin);
}
void transfer_DownloadBegin()
{
frmDownloadDataProgressBar progressbar = new frmDownloadDataProgressBar();
progressbar.Show();
}
The problem is when the form is being displayed it gets stuck for some reason.
|
|
|
|
|
Ever heard of Break Points and Debugging?? You might wanna try that first.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi,
I am new to programming...
I am using Delegates in my program..
public delegate MyTable MyDelegate2(DataTable ddt, double dcost);
public class MyTable
{
public DataTable ddt;
public double dcost;
public static MyTable tablevalue(DataTable ddt, double dcost)
{
MyTable mytable = new MyTable();
mytable.ddt = ddt;
mytable.dcost = dcost;
return mytable;
}
}
How can i retrieve these return values in an event(button_click). These values are set by Other method.
Thanks
|
|
|
|
|
One of the most easiest way you can design it is, using a Static class as you have already done. Have static properties to set the static member variables. Anyone can then access the static properties and can set/get them.
public static class MyTable
{
public static DataTable Table { get; set; }
public static double Cost { get; set; }
}
|
|
|
|
|
Hi guys...I saw something in a code block that one of my colleagues wrote and I can't figure out exactly what it's doing. Google provided no help and the MSDN provided no help. The code in question looks something like this:
addUserRequest inValue = new addUserRequest();
inValue.persistUserRequest = parameterUserRequest;
addUserResponse retVal = ((UserManagement)(this)).addUser(inValue);
return retVal.@return;
What the F does '@return' do? Is that a shorthand call for something else?
"I need build Skynet. Plz send code"
|
|
|
|
|
@ is a valid, albeit odd, start character for member names. Right click and goto definition.
Need custom software developed? I do C# development and consulting all over the United States.
If you don't ask questions the answers won't stand in your way.
Doing a job is like selecting a mule, you can't choose just the front half xor the back half so when you ask me to do a job don't expect me to do it half-assed.
|
|
|
|
|
oh yeah!! ...now that you mention it, I do remember that from my "450" class back in college....could be wrong, but isn't that the "standard nomenclature" to use if you are wanting to name a member as a reserved keyword? [Even though you probably shouldn't be WANTING to use reserved keywords as member names]
"I need build Skynet. Plz send code"
|
|
|
|
|
"Standard"?? That depends on who you ask, because there's no real standard for this. But, in VB.NET, if you wanted to use a reserved word as an identifier, you'd put square brackets around it, like this:
Dim [Assembly] As Assembly
This is known as an "escaped identifier".
AFAIK, C# doesn't have an equivilent.
|
|
|
|
|
|
That's the first time anyone's used that on me!
But, I did find it on my own after I posted, thanks.
|
|
|
|
|
Alaric_ wrote: [Even though you probably shouldn't be WANTING to use reserved keywords as member names]
Correct. The functionality is only provided because CLR libraries are cross language, and reserved words vary between them. Anyone creating a library that used a C#/VB/etc reserved word for a member name should be shot, but since anyone can write a CLR compiler for their favorite language, anything potentially could be a keyword in something.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
dan neely wrote: Anyone creating a library that used a C#/VB/etc reserved word for a member name should be shot
C# keywords shouldn't be used in libraries (after all, they're lower case, and public members are supposed to be upper case).
But VB?
Are you sure you've never used one of:
'Erase', 'Error', 'Friend', 'Module', 'Option', 'Resume', 'Select', 'Step', 'Stop', 'Variant'
?
In the .NET BCL itself, there are multiple classes with a 'Stop' method; and there's "Thread.Resume". Oh, and one of the most important LINQ methods is called 'Select'.
|
|
|
|
|
Possibly excepting a local/temp var I don't think so. Intellisense means there's no excuse for not using verbose variable names.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
As Ennis said, it's a valid character in a member name. It looks like it's either going to be a method that returns something or a property or a public field in your addUserResponse class.
|
|
|
|
|
If you want to use a reserved word as a keyword, you add the @ symbol before it. It's a practice I would strongly discourage because it's plain confusing.
|
|
|
|
|
Pete O'Hanlon wrote: If you want to use a reserved word as a keyword, you add the @ symbol before it. It's a practice I would strongly discourage because it's plain confusing.
Yeah...Ennis' response kind of blew some dust off of the filing cabinet in my head. But, granted, I didn't write the code in question: A [now former due to our recent purging of contractors]colleague did.
/*This code was generated by a tool. ...His name is Dave.*/
|
|
|
|
|
|
Stop it right now. Don't post another one of these. They're all going to get tagged as spam. Advertising for another site in the forums is highly frowned upon. Buy advertising space like everyone else.
|
|
|
|
|
Sorry I was not aware of this. I have nothing to do with site. Just added assuming that It may be useful for other members.
My Apologies, Give me some time I will delete my post
|
|
|
|
|
Your site promotes no learning, and you're advertising on a board where people help others to make code for free, whereas you want to whore out your code preventing others from learning.
Yeah, you assumed wrong.
|
|
|
|
|
Don't lie on top of it...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
how can a tune sung by a user (humming) be compared with the songs in the database & produce similar results??
since the pitch of man & woman varies widely, how can the results can be made accurate?
|
|
|
|
|
sorry but this is NOT an audio analysis forum
If only MySelf.Visible was more than just a getter...
A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
|
|
|
|
|
Although off-topic, it's a very interesting question. Some high-level ideas:
1. Since the singer's key can vary, you need to transpose all melodies to a common base key. E.g. if you transpose the first note to C for every melody, you can find matches even if the singer is singing in another key.
2. A voice isn't a pure tone. All instruments (except synthesizers using a single oscillator) have harmonics (frequencies higher than the lowest). Fourier analysis will allow you to isolate the different frequency components. Ignore all but the lowest for simplicity.
3. Voices aren't exactly in tune. You will have to round each frequency to the nearest musical tone. The standard is 440 cycles per second for an 'A'. Consecutive chromatic tones have a ratio of 1 : the 12th root of 2. Thus, when you go through the 12 tones of an octave, you get (the 12th root of 2) to the 12th power = 2. So a note an octave higher has twice the frequency of the lower note.
4. The rhythm is also going to be off for a human's performance, so you will need to adjust the lengths of each note with respect to a selected granularity. E.g. round the length of each note to the nearest eighth note.
5. This will "standardize" a melody hummed into an A-to-D converter, allowing you to compare it with the melodies in the database. Of course people will make errors, so if there's no exact match, you need some kind of error metric to find the closest match in your database.
|
|
|
|