|
Hi again,
It must be late or I'm just plain thick, but what is the purpose for the members to be static?
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
its holding information. i just didnt want to have to create instances, fore what i had in min,d i didnt see the point.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
|
im not - thats why its static.
Abor is in a class called ServerCommand
SrvCmd is a struct, which ive used to make the Abor object.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Nnamdi Onyeyiri wrote:
im not - thats why its static.
You are!!!
public static SvrCmd Abor = new SvrCmd();
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
im iticating a static member of type svrcmd in another class, because i want each of the static variables to hold two pieces of information.
anywayx, no need to get ur knickers in a twist, rama solved it for me, i had to put the code where i assigned a value to Abor in a constructos.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
|
Thanks to help from several people I can now get my NotifyIcon to display text instead of an image, and it can change at run time. Very cool. The next logical step, of course, is to display text instead of an icon.
Basically, I'd like to replace the System Tray clock with my own clock so I can setup different formats, etc.
So, my question is, how can I draw TEXT in the system tray instead of an icon?
thanks
|
|
|
|
|
I have this class that I have derived from DataGridColumnStyle and all is working well apart from one issue.
In my test program I have created a DataSet at runtime and created a table with 3 columns, the table is set to the datasource for the grid. One of the columns is set to readonly.
Now my problem is that I can't seem to find anyway to detect this from within my derived DataGridColumnStyle class. The DataGridTextBoxColumn class seems to manage this feat somehow. For me I just get an exception thrown from DataGrid.CommitEdit() telling me that an object reference is not set to an object when I try to commit the change.
Anyone got any ideas on how I could dected the the DataSet.DataTable.DataColumn is read only?
Thanks
Stephen.
|
|
|
|
|
hello
I'm looking for a nice class containing high level math or statistical functions. Indeed I only know System.Math that isn't enough.
Notably, I've to use the normsdist function (an excel statistical function)
Does anybody know if such a class exist in .net or on the web, or how to create this function
Excel Help :
Returns the normal distribution for the specified mean and standard deviation. This function has a very wide range of applications in statistics, including hypothesis testing.
Syntax
Returns the standard normal cumulative distribution function. The distribution has a mean of 0 (zero) and a standard deviation of one. Use this function in place of a table of standard normal curve areas.
Syntax
NORMSDIST(z)
Z is the value for which you want the distribution.
Thanks a lot
|
|
|
|
|
|
thx Richard
but what I need isn't the density function, that is calculable from the Math class, but the integral of this density.
But with the other post, I will surely find what I need
thx for your help
troz
|
|
|
|
|
there is the cumulative fonction in addition of your first formula
caution : this is an approximation, found on http://www.pitt.edu/~wpilib/gaussfaq.html
this is only available for y>=0, the precision is 5 digits
and it's only for mean =0 and stdDev = 1
public class Stats
{
static readonly double root2Pi = Math.Sqrt(2.0 * Math.PI);
public static double normDist(double y)
{
return Math.Exp(-(y*y)/2.0) / root2Pi;
}
public static double normDist(double y, double mean, double stdDev)
{
double yStd = y - mean;
return Math.Exp(-(yStd*yStd)/(2.0 * stdDev * stdDev)) / (stdDev * root2Pi);
}
//Attention : CumulnormDist est une approximation (à 10^-5 pres)
//De plus, elle n'est correcte que pour x>=0
//et pour m=0 et sigma = 1 !
public static double CumulnormDist(double y)
{
double t = 1/(1 + 0.33267 * y);
double norm = Stats.normDist(y);
double p = 1 - norm * (0.4361836*t - 0.1201676 *t*t + 0.9372980 * t*t*t);
return(p);
}
}
|
|
|
|
|
|
thx a lot, it seems nice
troz
|
|
|
|
|
Hi all,
Is there a way of changing (or setting ) attributes (specifically ReadOnly) at runtime? I have looked at the CustomAttributeBuilder class but it seems to be difficult to understand and apply . I could be wrong.
Anyone?
Thanx all
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Nope, at least none that I know of.
Attributes are part of a types meta-data which is created at compile time so they aren't things that can be added and removed at runtime.
I think that CustomAttributeBuilder is used to create new Attributes for use in your Reflection.Emit generated code.
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
O dear, but thanx anyways James
Maybe theres another way to do what i need. OK, what I need is a property that have a Get and a Set, but the Set should only be active at at certain application states.
Is this possible without having to dig thru all them Builder classes again?
UPDATE: the following does the job, but its still "editable" in a property grid. Can I make it "disabled" in some way so the user cant edit it?
public int Slots
{
get{return slots;}
set{if (state == State.Stopped)slots = value;} }
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
leppie wrote:
UPDATE: the following does the job, but its still "editable" in a property grid. Can I make it "disabled" in some way so the user cant edit it?
What exactly are you trying to do?
Jared
jparsons@jparsons.org
www.prism.gatech.edu/~gte477n
|
|
|
|
|
Im trying to mess with your mind, no just kidding;P
I'm using a propertygrid to monitor a class Properties, but some properties should be able to be settable when the class is in a certain state. This is OK code wise , but like I said the Property is still "settable" according to the user (the brainless user that is), but as soon as he tries to enter a new value it will just revert to the current value, but I dont want to even allow this. I want a nice greyed out GridItem.
It doesnt really bother me, but I have allways taken the approach of Programming for the Dummies , iow what they cant click or change, they cant break, dont even generate interest or you will create an instant 10 finger virus.
Anyways, I will look at some of the code from the PropertyGridInternal namespace, it seems my answer mite lie somewhere deep in there.
Thanx
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Hi leppie,
have you found any workaround for this issue? My custom control has a property, which should be en/disabled depending on another property. I hope you've found a solution already
Regards
Thomas
Disclaimer: Because of heavy processing requirements, we are currently using some of your unused brain capacity for backup processing. Please ignore any hallucinations, voices or unusual dreams you may experience. Please avoid concentration-intensive tasks until further notice. Thank you.
|
|
|
|
|
I think a type convertor could solve this. But you will have to keep track of some static members.
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
This is the code of an XML Web Service that Query an SQL Server.
It takes two strings and returns a DataSet.
It's a simple excercise, It query the database, populate a DataSet, modify a Field and Update the changes.
[WebMethod]
public DataSet GetUserData(string szUsername, string szNewLocalName)
{
string szSqlCommand = "SELECT * FROM Locals WHERE Username = '" + szUsername + "'";
SqlConnection myConnection = new SqlConnection(" User ID=sa;Password=password;Initial Catalog=laphijia;Data Source=(local)");
SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(szSqlCommand, myConnection);
DataSet myDataSet = new DataSet();
mySqlDataAdapter.UpdateCommand = new SqlCommand("UPDATE Locals SET LocalName = @LocalName" +
"WHERE Username = @Username", myConnection);
mySqlDataAdapter.UpdateCommand.Parameters.Add("@LocalName", SqlDbType.NVarChar, 25, "LocalName");
SqlParameter workParam = mySqlDataAdapter.UpdateCommand.Parameters.Add("@Username", SqlDbType.NVarChar, 25);
workParam.SourceColumn = "Username";
workParam.SourceVersion = DataRowVersion.Original;
mySqlDataAdapter.Fill(myDataSet, "Locals");
myDataSet.Tables["Locals"].Rows[0]["LocalName"]= szNewLocalName;
mySqlDataAdapter.Update(myDataSet, "Locals");
return myDataSet;
}
I made this with help from the MSDN NET Framework Developer's Guide article Updating the Database with a DataAdapter and the DataSet.
When I try to access the Web Service and Invokes it, I get a 505 Internal Server Error.
I tried to remove the line:
mySqlDataAdapter.Update(myDataSet, "Locals");
and it works (it returns the DataSet as XML data, but obviously don't update the DataBase.
What's wrong with my code?
I also tried with the SQL Command Builder, but it's just the same.
Thank You.
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|
|
Try wrapping the Update code with a try/catch and see if something is happening there.
Maybe Alex sees something wrong with the call
James
"Java is free - and worth every penny." - Christian Graus
|
|
|
|
|
I tried changing the UpdateCommand with a custom string like "UPDATE locals SET LocalName = 'New Name' WHERE Username = 'john'"
This Worked, I mean, the Method returned the DataSet, and didn't give a 500 Internal Server Error, anyway the Method was completely USELESS now.
But I figured out that the problem is in the UpdateCommand Sql statement.
What's wrong there?
Username is not the Primary Key, it's only used for Authentication purposes on the final version.
How Can I have a correct Sql Statement, connected with the values that I could modify in the DataSet?
"Nelle cose del mondo non e' il sapere ma il volere che puo'."
|
|
|
|