|
What is your approach to software design?
Do you have meetings?
Write Design Documents?
Something else?
I'm really curious to find out what others find effective in a team development environment?
|
|
|
|
|
Usually a combination of meetings, design documents, whiteboard sessions, and prototyping.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
If I design it... I do it pretty much like a school project, I take the general requirements and design as I go.
If others design it, there'd better be a specification, but...
All too often the time spent writing up a design spec is completely wasted.
I can think of only four times I was given a design spec:
1) The spec concerned changes to an existed program -- I did a complete re-write instead.
2) It was rubbish, there were severe security issues -- I implemented something else entirely.
3&4) The business needs (and personnel) had changed a great deal after the design was created.
|
|
|
|
|
I always make sure that i use pencil and eraser.
|
|
|
|
|
This isn't really a C# question. You should really have posted it in something like the General Discussions forum or possibly even the Lounge, but since you asked:
JPWheeler wrote: Do you have meetings?
Yes - how else does the client tell you their requirements?
JPWheeler wrote: Write Design Documents?
Yes - how else do you ensure that you're writing what you're supposed to?
JPWheeler wrote: Something else?
Acceptance documentation? How else do you and the client ensure you're delivering what you're supposed to.
More importantly, we use TDD and are investigating MDD, possibly even BDD.
|
|
|
|
|
Hi,
I want to monitor the health of a process on a Windows computer (XP, Server 2003) using WMI, and for this I want to get it's processor usage in percent (same as process listed in the Task Manager with CPU percentage) with using C# (> 2.0).
I tried naively to use the Win32_PerfFormattedData_PerfOS_Processor classes using the PercentProcessorTime property but this gives me only 0% or 100% values.
I red on forums that a calculation must be done to get the correct percentage and found this VB script below (http://msdn.microsoft.com/en-us/library/aa394597(VS.85).aspx).
I tried to apply this code into the following C# code with the help of some article of The Code Project, but without success as I have strange values out for the Timestamp_Sys100NS property (null, big numbers that give wrong calculation).
Many thanks for your help.
VB scrip code :
Set object1 = objWMIService.Get( _
"Win32_PerfRawData_PerfOS_Processor.Name='_Total'")
N1 = object1.PercentProcessorTime
D1 = object1.TimeStamp_Sys100NS
Wscript.Sleep(1000)
set object2 = objWMIService.Get( _
"Win32_PerfRawData_PerfOS_Processor.Name='_Total'")
N2 = object2.PercentProcessorTime
D2 = object2.TimeStamp_Sys100NS
' CounterType - PERF_100NSEC_TIMER_INV
' Formula - (1- ((N2 - N1) / (D2 - D1))) x 100
PercentProcessorTime = (1 - ((N2 - N1)/(D2-D1)))*100
C# code :
mgmtScope = new ManagementScope("\\\\" + hostName + "\\root\\cimv2");
try {
mgmtScope.Connect();
}
...
string searchQuery = "SELECT * FROM Win32_PerfFormattedData_PerfProc_Process WHERE Name = 'MyProcess'";
ObjectQuery oq = new ObjectQuery(searchQuery);
ManagementObjectSearcher query = new ManagementObjectSearcher(mgmtScope, oq);
try {
ManagementObjectCollection servicesCollection = query.Get();
foreach (ManagementObject service in servicesCollection) { // seems not possible to do servicesCollection[0]
percentProcessorTime = double.Parse(service.Properties["PercentProcessorTime"].Value.ToString());
}
}
...
string searchQuery = "SELECT * FROM Win32_PerfRawData_PerfOS_Processor WHERE Name = 'MyProcess'";
ObjectQuery oq = new ObjectQuery(searchQuery);
ManagementObjectSearcher query = new ManagementObjectSearcher(mgmtScope, oq);
try {
ManagementObjectCollection servicesCollection = query.Get();
foreach (ManagementObject service in servicesCollection) {
timeStampSysNS100 = double.Parse(service.Properties["Timestamp_Sys100NS"].Value.ToString());
}
}
...
double d1 = this.getPercentProcessorTime();
double n1 = this.getTimeStampSysNS100();
Thread.Sleep(1000);
double d2 = this.getPercentProcessorTime();
double n2 = this.getTimeStampSysNS100();
double percentPT = (1 - ((n2 - n1) / (d2 - d1))) * 100;
string res = "Process CPU usage : " + percentPT;
|
|
|
|
|
I won't claim to know anything about this, but
based on the docs, I tried this (in a C# console app):
for (int i = 0; i < 100; i++)
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT PercentProcessorTime FROM Win32_PerfFormattedData_PerfProc_Process WHERE Name = 'MFCTester'");
ManagementObjectCollection.ManagementObjectEnumerator enumerator = searcher.Get().GetEnumerator();
if (enumerator.MoveNext())
{
Console.WriteLine("MFCTester PercentProcessorTime: {0}", enumerator.Current["PercentProcessorTime"].ToString());
}
Thread.Sleep(100);
}
Seems to give the same results as the system monitor.
Notes:
My 'MFCTester' app is single threaded.
I forced CPU use by dragging it around the screen rapidly.
It looks like the result is the percentage of one processor - if I
divide the displayed percentages by 4 (the number of processors on my
system) I get the same values as the CPU column of the task manager.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: divide the displayed percentages by 4 (the number of processors on my
system)
Show off
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Well...two physical
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello,
I have an application that creates a certain number of textbox controls (based on a number specified by a user) at runtime. I have the textboxes being created in the page_load method. I have created a another TextBox object to find the created controls and retrieve the text. I then pass the text to a string object. My issue is that when I try to retrieve the values inputted into the textboxes by a user, I receive an 'Object reference not set to instance'. I have provided code below. Any assistance will be great. Thanks in advance.
for (int i = 0; i < numberOf; i++)
{
TextBox tb = ((TextBox)Page.FindControl("txtName" + (i+1).ToString())) as TextBox;
results += tb.Text //this is where error occurs.
Response.Write(results);
}
|
|
|
|
|
Hi,
I start a windows service.
The process inside the service has several steps and they all take very long to complete so as a result the service times out and gives the following message :
"could not start the service on local computer.
Error 1053: The service did not respond to the start or control request in a timely fashion."
And therefore the task does not get completed.
Any thoughts please?
Thanks
|
|
|
|
|
The OnStart method shouldn't be performing task, it should kick off a thread (or similar) that does the work and then return.
|
|
|
|
|
Placed a timer inside the onstart event.
The timer starts the process which calls a web service.
The web service takes a very long time to complete. But before it completes the windows services times out even though it has started.
Any thoughts please?
Please note that when I run the web service manually, i.e. browsing to the .asmx and click invoke, the process takes a long time but eventually it will complete.
Thanks
|
|
|
|
|
I use a System.Timers.Timer for my Windows Services too.
The Timer should be a field of the class, the OnStart method should Enable or Start the Timer and complete.
|
|
|
|
|
Hi Guys
Can anybody help me to read the csv file using c# and store in the sql database.
Subash
|
|
|
|
|
If you look down this page you'll see you're the 3rd person to ask a similar question in the last few hours. Perhaps you can get some ideas from what they've posted and the relevant replies.
Could it be that you're all doing the same homework assignment?
|
|
|
|
|
What if all of the names belong to the same person?
|
|
|
|
|
That's exactly what I was starting to think but the "member since" is different for all of them.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Definitely not me
I was just looking for a good practice to do it, and yes, I've mocked csv questions once before for their frequency
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
..or they could just ask each other - they're probably all in the same classroom
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Try reading this one
clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
Need some help regarding unsafe code.
Am trying to get create an array of pointer to a struct, and not getting through with it.
here is a sampe code
public struct RoomDef
{
public ushort Id;
public string Name;
public string Status;
public string Location;
}
Within a function i have coded the following.
RoomDef* []nee = new RoomDef();
unsafe
{
testPtr = new RoomDef();
nee[1] = & testPtr;
}
This is just a snippet of the code and there are no Syntax errors anywhere. But while I compile it gives me an error stating "Cannot take the address of, get the size of, or declare a pointer to a managed type"
Have tried using the Fixed statement as well, still no go.
I can get the address of the individual members of the structure. But not the structure itself.
Any help will be appreciated.
modified on Wednesday, September 17, 2008 8:51 AM
|
|
|
|
|
First the length of the nee array is only one, so nee[1] goes past the end. Second, testPtr is the managed type. It's already a pointer so you don't need to take the address of it.
Try: nee [1] = testPtr;
|
|
|
|
|
Thanks for the Reply,
I have handled the array part. But no, nee [1] = testPtr; does not work.
|
|
|
|
|
Alan Balkany wrote: testPtr is the managed type. It's already a pointer so you don't need to take the address of it.
No, as it's a value type, testPtr isn't a pointer at all.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|