|
I always thought that was what the keyboard auto-repeat beeps were for - to notify you that you've nodded off at your keyboard.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
A beep wouldn't wake you up unless you're a mosquito
|
|
|
|
|
Especially not here, where PC speakers are disconnected by company policy.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
I'd wake up if an ant farted.
|
|
|
|
|
AspDotNetDev wrote: I'd wake up if an ant farted.
Because of the sound or because of the smell?
Author of Primary ROleplaying SysTem
How do I take my coffee? Black as midnight on a moonless night.
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
Back in the day a beep was a good thing to have.
So what did you replace it with when you rewrote the vb6 code?
|
|
|
|
|
There are two parts:
1. We now use a .config file to store these settings. Reading these is done during app startup. If errors occur, either (a) a message is shown to the user if the settings is required, or (b) an entry is made in a log if the entry is non-critical.
2. The original coding loaded the settings within a VB Form. I've migrated this to app startup code, so the errors (a) raise an exception so they can be reported back to the user in a more managed way.
The old app has the business logic entirely in VB forms, in the new version almost all business logic is in C# classes, the (WPF) forms have minimal code to set the data context for the form to an appropriate view model object.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Don't underestimate "beeps". I know one wizard of Oz who writes batch mode applications (each averages 30 mins of run time) and over years, he has evolved this beeps thingy into the state of art. Most days, his daily task comprises of starting the comps, setting batch jobs, set them running and then loiter around in office all day. He can be at other end of room and just by hearing meaningless (to me) sequence of beeps, he can tell which batch job which started finished.
For those not directly involved with his work, it is a sight to see whenever his batch jobs fail and he gets desk-bound for hours. Guess where the beeps are coming from in those days? His mouth!! (And it ain't pre-watershed telly!!!)
|
|
|
|
|
Rob Grainger wrote: It's also worth considering that none of our PC's have a speaker
Surprisingly, someone asked me for an internal speaker beep to be added to a VB6 application recently, for users without speakers.
I had a look into it and, ignoring the fact that there would probably not be an internal speaker, a modern Windows O/S will divert the beep to the soundcard if there is one (even if its integrated) which needs speakers. So unless you have a machine with an internal speaker running Windows 98 or something, it just won’t do anything.
For some reason that made me feel sad and I briefly missed not being able to make things beep in such a simple manner!
|
|
|
|
|
There must be a lot of VB6 code in those darn smoke detectors!
|
|
|
|
|
The developer who made this, should be forced to wear headphones and make his/her program fail constantly for 24 hours...
Seriously, there was a time when computers had an internal speaker, given that this is VB6, i'm not really surprised.
|
|
|
|
|
RafagaX wrote: Seriously, there was a time when computers had an internal speaker
I remember far enough back that the way you made sound on a computer was by controlling the data emitted when saving to cassette (not to be recommended).
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
List<Employee> employees = new List<Employee>();
if (employees != null){
employees = GetEmployees();
}
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
Is this inside a single method? I'd be more concerned here with the fact you'd never fill the employees list.
|
|
|
|
|
Quote: Is this inside a single method?
Yes, it is.
Quote: I'd be more concerned here with the fact you'd never fill the employees list.
How??
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
Never mind - I've been up for the last 16 hours. I was reading != as == here for some reason.
|
|
|
|
|
Ohh, that's okay...
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
Pete O'Hanlon wrote: I was reading != as == here Thanks for the explanation, for a normally sensible person, I was wondering what you were smoking or what I missed with your prior comment too.
|
|
|
|
|
It isn't really filling the list, it's replacing the reference with the result of that method call. I don't think that's what he meant though. A bit pedantic, I'm sorry.
|
|
|
|
|
I think the point was that
List<Employee> employees = GetEmployees();
could just as well have been used to create a null or non-null employees object because the if statement would never be false for a statement that could produce a null result. In fact you might want to execute
if (employees == null) throw...
after executing the above line because now you are in a situation where the if statement could be true or false even if the current coding of the routine would never return null. (speaking of being pedantic...)
|
|
|
|
|
Keeping the runtime on its toes.
|
|
|
|
|
True...
Previous -> Read "CLR via C#" by Jeffrey Ritcher.
Current -> Exploring WCF thru Apress' "Pro WCF" by Chris Peiris and Dennis Mulder.
Next -> Need to read "The Art of Computer Programming" by Donald E. Knuth.
|
|
|
|
|
I hope there's a unit test for that too.
|
|
|
|
|
More like the garbage collector...
|
|
|
|
|
That's a real conundrum for the GC -
"OK, if this object is still around, at this point, I can't GC it until then. But... but what if I ... secretlly GC it before the if?"
|
|
|
|