|
Well, err. I'm glad your happy!
Have a beer
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
martin_hughes wrote: How cool are they?
Not that cool. Wait until you see how they get abused
|
|
|
|
|
Damnit! There I was being all optomistic and happy, and you had to come along and burst my bubble!
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
We'll see. I think extension methods are limited enough that there won't be abuse. I liken it to C#'s typedefing, e.g.
using Foo = blabhalbhabhalbahb;
..
Foo f = new Foo(); That feature was also open to abuse, as seen by all kinds of nasty C++ typedef'ing. C# limited its scope, and now we don't see abuse.
Likewise, I *think* extension methods won't be abused, or at least any abuse will be limited in scope, given that they have to be part of a static class and that consumers don't see them unless you specifically import that namespace. I think this limitation is a good one that will discourage abuse.
|
|
|
|
|
Judah Himango wrote: there won't be abuse.
So for example you don't think this guy[^] is capable of abusing extension methods. I don't by it.
|
|
|
|
|
I don't buy it, either, because that's not what I'm saying. Most anything is abusable. Extension methods can be abused. But I think extension methods are limited in scope such that abuse is discouraged, and even when abuse occurs, it is limited (e.g. if I don't want to see your 420 extension methods on the string class, I don't have to).
|
|
|
|
|
Judah Himango wrote: specifically import that namespace
Hmmm... now that concerns me, and I'll reread the spec, I don't want to be required to use the using directive just to use extension methods.
Can I please my wife by using extension methods?
|
|
|
|
|
led mike wrote: see how they get abused
"Every tool is a hammer." -- PIEBALD
|
|
|
|
|
Actually, I have to agree. I've just been playing round with a quick method to parse various types of data out as an appropriate type from a string, e.g.
string s = "1.12345";
double myVal = s.ToDouble();
|
|
|
|
|
I can't help but feel that I've seen this post somewhere else...
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
This is for a web app. I have a situation where I need to copy an bunch of files to another location but still give quick feedback to the user. Right now the file copy is inline and the performance is not great. I am considering threading off each file copy so I can give quick feedback to the user. If a copy fails it is not a big deal and the user will not access the copied files immediately. My concern is that hundreds of short running threads could drive CPU through the roof.... Does anybody have any experience with this or have any suggestions? Please let me know.
Dave
|
|
|
|
|
Hi Dave,
two comments:
1.
the normal approach to handle N jobs is to have a queue and a couple of threads; stuff all
the jobs in the queue, then let each of the threads fetch a job from the queue and execute
it, until the queue is empty. That way you get load balancing amongst the threads, and
only need a selectable but limited number of them, fitting the capabilities of the entire
system.
2.
whatever you do, chances are the limited bandwidth of your disk storage subsystem will keep
your CPU quite a long way away from the roof.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
davidhart wrote: have any suggestions?
You should look into other aspects of the Microsoft Application Server family like Com+ or Message Queues for example. I advise against starting threads from an ASP.NET thread.
|
|
|
|
|
Hi,
i am trying to restart and application from within by using a batch file.
this is my batch:
TASKKILL /F /IM MyApp.exe /T
PAUSE
start MyApp.exe
when i run it by double clicking it - it does the job - closes and reopen MyApp.exe.
when i try to do it from the application by using :
System.Diagnostics.Process p = new System.Diagnostics.Process();
String path = Application.StartupPath + @"\";
p.StartInfo.FileName = path + @"ResetApp.bat";
p.Start();
the batch kill my application but doesn't restart it(doesn't get to the pause line in the batch file) - i guess that when my application is terminated it also kills the batch operation.
how can i detach the batch from the application, or is there other way to make my batch run from the application indepentlly?
thanks,
Samy
|
|
|
|
|
You could just try Process.Start(path + "ResetApp.bat");
Alternitavely, you could try starting your form, from within the OnFormClosed event, which gets fired:
[STAThread]
private static int Main(string[] args)
{
Application.Run(new MainForm());
} After the form has closed, but before your program actually ends.
^ This is of course assuming your using forms, and its not a console app.
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
You start the application back up immediately so you must want it running? But it's already running so..... what the heck are you doing?
|
|
|
|
|
i want to have the abillity to restart it remottly (if for some reason duriing its operation somthing went wrong)
any way found my problem in the batch - kill shouldn't use /T that kills all related proccess.
thanks
|
|
|
|
|
samy100 wrote: i want to have the abillity to restart it remottly (if for some reason duriing its operation somthing went wrong)
Then make it a windows service and manage it remotely from the Microsoft Management Console.
|
|
|
|
|
Why not try to make sure there are no bugs in it, and catch any errors that may occur. That way the app will keep running even if something does go wrong.
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
Hi,
Bear in mind that batch files are run by the command processor, cmd.exe. If you do want to go down the batch files route then you need to do something like "cmd.exe /c resetapp.bat".
Alan.
|
|
|
|
|
You can use Application.Restart() method to restart your application
|
|
|
|
|
I never knew that was there. Guess i never needed it.
My current favourite word is: PIE!
I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for.
-The Undefeated
|
|
|
|
|
Guys,
I have a simple C# app to send e-mail. bud wen i click on send mail button i get this error:
Syntax error, command unrecognized. The server response was: AVG POP3 Proxy Server 7.5.494/7.5.503[269.15.8/1185].
I googled a lot bud nothin found. Somebody pls a idea?
|
|
|
|
|
What does the code look like that is supposed to send the email?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|