|
Hi,
I want to calculate the CPU percentage of processes in a dual core processor system. Currently the code is developed in C# using PerformanceCounter and it is capturing the values accurately for a single core processor.The same code when exceuted on a dual core processor returns zero value. Can anyone throw lights on this issue.
Appreciate your timely help
Thanks,
Lakshmi
|
|
|
|
|
Hi,
seems to me one of the following holds true:
- you perform the measurement with a separate thread that lacks the necessary synchronization
to make it wait until the actual work is done;
- you have a bug in the measurement code.
You might consider showing us the code...
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Dear all,
I m interested in developling some king of pos software that uses equipment such as barcode readers, cash drawers etc. But if possible I want to make it hadware manufacturer independent.
Is there some package that is available that allows me to do this?
Thanks a lot,
Chris Farrugia
|
|
|
|
|
Have a read of this[^] to get an idea of how Microsoft handle POS. This should give you some idea as to what is possible.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
ChrisFarrugia wrote: Is there some package that is available that allows me to do this?
I've done a lot of research into PoS in the past (admittedly getting on for 10 years ago now... but probably still relevant).
The problem on the hardware (cashdraws, barcode scanners, receipt printers) side of things is that there aren't many standards governing how these devices should work - each manufacturer decides which control character(s) open the draw, activate the scanner, starts the printer etc. Sometimes you can get lucky and find Windows driver support, but this is the exception rather than the norm. So basically you either end up supporting just a few specific devices, or spend the rest of your life coding in support for every device that comes along.
Of the two options, there are compelling reasons to go for the first:
1) Regardless of whether you want to or not, you will become both a hardware and software vendor because no retailer will touch you if they have to manage multiple contracts/companies for both hardware and software
2) As a hardware vendor you'll need to cut costs by buying in as much bulk as possible - impossible to do if you support too many products
3) You'll never have the resources to cater for every device going
There are some other concerns that you should consider:
- Most commercial products from the big players (IBM/HP etc.) are geared towards the big (or wanting to become big) retailers - think Walmart, Tesco, Toys R Us, Borders etc. You'd think this would leave you with a huge customer base of small to medium sized businesses. Unfortunately it doesn't because a)Most small businesses - say one or two outlets - don't need a sophisticated PoS system and b)Your product will be (comparitively) very expensive which will be hard for smaller businesses to justify.
- There is no such thing as a one-size fits all PoS system, even within the same sector. I've worked for a number of Bookstores (as an Area Manager) and every single one had different procedures and processes for handling the same tasks. Sure it's possible to develop flexible software, but consider how many resources you'd need to throw at such a product and then weigh that up against how much you could make.
-Medium sized businesses (which in reality will be your potential customer base) also create their own problems for you:
a) Medium sized companies looking to get big won't touch you unless you have a proven track record.
b) Consider the amount of support "traffic" that a company of 20 outlets will generate, and the kind of resources you'll need in place to cope with it.
c) Retailing moves at a fair old pace and your product must be able to at least move at that pace, but ideally will anticpate change ahead of time. If it doesn't your product will be shown the door very quickly.
So all doom and gloom then? Well not necessarily, but first of all if you want to succeed you should first abandon the idea of rolling your own solution from scratch and become an implementor - say of the Dynamics products which Pete pointed out. What I will say is that 10 years ago when I went down the same route as you I soon realised that the risks were significant and the potential rewards relatively tiny.
Me: Can you see the "up" arrow?
User:Errr...ummm....no.
Me: Can you see an arrow that points upwards?
User: Oh yes, I see it now!
-Excerpt from a support call taken by me, 08/31/2007
|
|
|
|
|
Thank you very much for your detailed reply and i totally agree with you! So it seems there are no standards that govern pos equipments and therefore it is quite difficult to make a software compatible with the majority of them.
Thanks a lot once again,
Chris
|
|
|
|
|
Hello Chris,
You can get started in POS using the following
POS for .NET 1.11 from Microsoft.
They are trying to reduce the problem of different hardware drivers/manufacturers as mentioned
by using service objects. Epson and a few others support OPOS for .NET and even give
examples in C#, which is nice...
Good Luck
Mick Curley
|
|
|
|
|
Hello,
I am building a composite control. The problem occurs in design-time. When i use a skin file it doesn't care about it in design-time. bu in run-time it use skin file.
Any solution would be most appreciated.
|
|
|
|
|
Hi,
I've Win app that communicates with a web page using Http via WebRequest.Create(site); etc...
1. How can I send a file to web server using Post method ? (It's Windows app, not web!!)
2. When communicating with web server, I get sometimes "System.Net.WebException: The server committed a protocol violation. Section=ResponseStatusLine" . I know It has something to do with .NET security settings. How can I tunrn it off ? (I'm not concerned about security since I've created the web site I'm connected to...)
3. I also use Ftp protocol for sending files and I'm getting strange Errors there too (like ftp command unrecognized etc...) and me feeling is that it has to be something with security too.
thanx for answer
zilo
|
|
|
|
|
hi
you can upload , download files with "WebClient" class in .net.
such as follow :
WebClient client = new WebClient();
client.UploadFile(...)
|
|
|
|
|
Hi guys,
i want to save the user input as time in the sql server. bud the problem is that it also saves the date. how can i save only the time, without date? i tried the datandtime and smalldatetime.
thanx
|
|
|
|
|
AFAIK, SQLServer stores Date along with Time. You can use varchar column instead.
|
|
|
|
|
You can't. However this doesn't matter, as you can format the date for presentation purposes using a format string that only shows the time e.g. hh:mm:ss .
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi,
I want to pass one url and get response stream from that url.How can I do this with any java method.
Earlier I was using HttpWebRequest and HttpWebResponse APIs of System.net namespace. But now since I want output in stream of sbyte[] I want to use any java method. Please help me.
Prateek Gupta.
|
|
|
|
|
Response.getOutputStream() - But what is this parady?
Intelligence is measured by common sense not by how many scholarly books you read.
|
|
|
|
|
I want to use any java method which takes url and give me response of server.
Why I am doing so is I am using java.util.zip which takes sbyte[] earlier I was getting byte[] (when I was using httpWebRequest and httpWebResponse) and if i was trying to make this conversion byte[] to sbyte[] file which i m getting from server is getting damaged.So what I am thinking is if I can send url to any java method which can give me response back we can directly add this output stream to zipinputstream.
The code which I was using earlier is
HttpWebRequest hReq = (HttpWebRequest)HttpWebRequest.Create(ReqUrl);
HttpWebResponse hResp = (HttpWebResponse)hReq.GetResponse();
Stream str = hResp.GetResponseStream();
MemoryStream output = new MemoryStream();
int nBytesRead = 0;
byte[] buffer = new byte[1024];
while ((nBytesRead = str.Read(buffer, 0, 1024)) > 0)
{
//Read the stream until the end of file in chunks of 1024 bytes
output.Write(buffer, 0, nBytesRead);//Write the currently read bytes into the MemoryStream
}
hResp.Close();
output.Close();
return output.ToArray(); // This .ToArray() method gives me byte[] while i want sbyte[]
Any equivalent method in java can help me out.
Prateek Gupta.
|
|
|
|
|
hi, in the first application, i have a textbox which it's content is bind to a xml file. if there is 2 application running at the same time, when the second app changes the data in the xml file, how can i safely update the textbox which was binded to the xml file in the first app?
Thanks in advance
|
|
|
|
|
Ive started a project recently where ive been doing fairly well until i came across an issue, and is bugging me like mad.
Ive got a main form(will call it Form1)
Form1 has 2 User Control forms in it (will call Uform1 and Uform2)
Uform1 is a menu and Ufrom2 contains a DataGridview will dataset, table adapter.
Now im really new to winforms, but I did it this was because if I created lots of static forms
and the menu was statically set when ever I make a change to the menu I would have to change it on every menu on every form.
(If I should be doing this a better way please say so)
So the isssue, Ufrom1 needs to be able to access the data/controls on Uform2, I need to be able from Uform1 to update Uform2 tableadapter/controls.
I have no idea how to do this, ive seen some stuff but it looks so complicated yet this should be a everyday programmers task and should be straight forward??
Im looking for a a guide and example..please help.
thanks
David
|
|
|
|
|
ziwez0 wrote: So the isssue, Ufrom1 needs to be able to access the data/controls on Uform2, I need to be able from Uform1 to update Uform2 tableadapter/controls.
I don't know whether I understood your problem correctly, How about creating a public method in uform2 which is accessible from uform1 and does the data adapter updation ?
|
|
|
|
|
There's articles here on CP on communication between forms. The short answer is, use delegates.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
No offense, but this sounds like its a bit of mess architecturally. I would recommend that you take a look at implementing a pattern like the Model View Controller or Model View Presenter, which allows you to abstract the model (data) from the view.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi to all,
Whenever i run my application i want copy the address bar contents that are appears in the address bar into a string variable.
Is there any way to accessing the contents of Addressbar into a string variable.?
Please help me...
Pravin
|
|
|
|
|
Are you talking about ASP.NET? If it's in ASP.NET, try this Request.Url;
|
|
|
|
|
Here is how you do that:
var url = window.location.href;
This question is better asked in the web development forum, though, as this is Javascript, not C#.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
I was trying to add a timer to a checked list box and all I get is a check box without any text. I also tried creating a derived class and overriding the ToString function with no help. Anyone have any ideas?
It works fine with the TimeSpan struct, but not the Timer class.
private void button1_Click(object sender, EventArgs e)<br />
{<br />
Timer t = new Timer();<br />
checkedListBox1.Items.Add(t);<br />
ListBox1.Items.Add(t);<br />
}
I want to use the List box collection to keep track of all the timers I intend to create, having the user enable and disable them with the check boxes. Is there a better way to do this? And does anyone know why this isn't working? I thought that the list box and friends just used ToString for the display values.
Thanks for you time!
|
|
|
|