How about never ever passing any input to SQL interpreter, use prepared statements based on nothing but constants, and always store data in bind variables?
Seems a bit draconian to me. Probably non-portable, too.
I dunno. It sounds good in theory but history shows that as soon as you do it people will start thinking of ways to hide the embarrassing stuff in the name of 'security'.
It's just the way their minds work. Look at how much resistance there currently is to recording police when they're on duty.
Best to keep as much stuff as possible in plain sight. Not hidden, under control of the privileged few.
Javascript is out of place on server side, which is why server style Javascript has never caught on, and it doesn't really make a lot of sense as a general purpose programming language either.
This is the crux of the problem. People are trying to use JavaScript for real programs.
How about a language that refuses to even compile if you don't pass objects of type 'escaped_string' to the SQL functions?
Or... how about defining a constructor for escaped_string to make the the whole thing transparent. The compiler will convert all unsafe_strings to safe_strings automatically if you try to pass them to SQL functions. And it never misses one. Ever.
Sorry... but weakly typed languages are the junk food of the programming world.
e.g. All those SQL injection attacks? Mostly down to weak typing.
Articles like this (which is highly regarded in the weak-typing world)? Wrong, wrong, WRONG. Don't rely on writing code to try and make errors stand out if people pay attention, write code that refuses to compile if you make a mistake.
Compile-time checking is one of the foundations of writing solid software. The compiler never forgets to check stuff, it never has a bad day, a late night or insufficient caffeine. The more work you can get it to do for you, the better.
(This rant also applies to C programmers - C hardly lets you automate anything, get C++ and start using proper containers/strings ASAP)
Those days are still here. My Samsung Galaxy uses about 7% of battery per day in standby. On a couple of calls per day and some SMS I can go over ten days per charge.
The great thing about console programming is that you know every last detail of the target machine. You know what works, what doesn't. You can budget everything right down to the last clock cycle and squeeze out 100% performance from the chips.
If you take that away then it's game over as far as optimization is concerned.
The way the police are headed recently we need every single control and check possible over what they say and do. Letting them censor their own communications is a bad idea.
*Everything* the police does should be made public. If it was up to me I'd have every public servant walking around with a video camera on his shoulder recording everything they say/do. We need to watch the watchmen.
OTOH, yes, letting criminals listen in real time isn't good - it helps them get away. There's a better solution then 'encrypt everything' though...
The point is that a 22kHz triangle wave can be decomposed into a 22kHz sine wave plus a series of odd harmonics (i.e. 66kHz, 110kHz etc...). Those frequencies that exceed the sampling bandwidth are not captured, but since they lie outside the range of human hearing it doesn't matter.
I'd argue that they do matter. All the harmonics of an 8kHz square wave are 'outside the human hearing range' but I know for a fact it's easy to hear the difference between an 8kHz square wave and 8kHz sine wave.
Whereas with vinyl, while a few researchers have found that you can actually reproduce nanoscale artifacts present on the pressing master, you completely obliterate all that detail the first time you actually play the thing by dragging a razor-sharp needle down the groove of soft, soft vinyl that contains all your nice sound information.
You can get laser turntables which never touch the vinyl...:-)
The first harmonic of an 8kHz square wave is supposedly 'inaudible', right? (it's at 24kHz)
Get out your sound editor and generate two tracks with an 8kHz sine wave and an 8kHz square wave. Go ahead, do it. I'll wait. If you haven't got one there's a free one called "Audacity" that can do it.
Listen to both tracks. If you can't tell the difference between those two you're a cloth-eared nincompoop (don't worry, you will...)
Why should the difference between those sounds vanish because the wave is at 16kHz? Human hearing is based on moving little hairs in the inner ear, it's obvious the hair won't respond the same to a sine wave and a square wave at the same frequency. What you've claiming is that the brain can't tell the difference between the movements. The experiment above proves you're wrong.
No. No. No. Only frequencies *below* half the sample rate are captured, so there is always more than two samples available to reconstruct a sine wave.
Two-and-a-bit samples isn't an awful lot better than two, especially if it's mixed together with other waves of similar frequencies (as real sounds usually are).
nb. I'm not saying the high frequencies can't be reproduced, it's the shape of the waves I worry about. Does a 20kHz sine wave and a 20kHz sawtooth sound different when they're reproduced on a CD? They should...
Direct bribery/payoff of politicians is sooooo much more ethical than using shady rhetoric!
How about never ever passing any input to SQL interpreter, use prepared statements based on nothing but constants, and always store data in bind variables?
Seems a bit draconian to me. Probably non-portable, too.
'encrypt everything' is a perfectly fine solution
I dunno. It sounds good in theory but history shows that as soon as you do it people will start thinking of ways to hide the embarrassing stuff in the name of 'security'.
It's just the way their minds work. Look at how much resistance there currently is to recording police when they're on duty.
Best to keep as much stuff as possible in plain sight. Not hidden, under control of the privileged few.
You meant 'moobs'?
Maybe I should have said: "'Encrypt everything' is the worst possible solution"...
There's quite a few ways to do it - see rest of page.
Nah. C++ has loads of stuff that you shouldn't use. Ever.
new[] and delete[] for example - all the fun of malloc(), none of the safety/automation of STL.
Javascript is out of place on server side, which is why server style Javascript has never caught on, and it doesn't really make a lot of sense as a general purpose programming language either.
This is the crux of the problem. People are trying to use JavaScript for real programs.
How about a language that refuses to even compile if you don't pass objects of type 'escaped_string' to the SQL functions?
Or ... how about defining a constructor for escaped_string to make the the whole thing transparent. The compiler will convert all unsafe_strings to safe_strings automatically if you try to pass them to SQL functions. And it never misses one. Ever.
Put the burden on the compiler, not the humans.
Sorry ... but weakly typed languages are the junk food of the programming world.
e.g. All those SQL injection attacks? Mostly down to weak typing.
Articles like this (which is highly regarded in the weak-typing world)? Wrong, wrong, WRONG. Don't rely on writing code to try and make errors stand out if people pay attention, write code that refuses to compile if you make a mistake.
Compile-time checking is one of the foundations of writing solid software. The compiler never forgets to check stuff, it never has a bad day, a late night or insufficient caffeine. The more work you can get it to do for you, the better.
(This rant also applies to C programmers - C hardly lets you automate anything, get C++ and start using proper containers/strings ASAP)
Those days are still here. My Samsung Galaxy uses about 7% of battery per day in standby. On a couple of calls per day and some SMS I can go over ten days per charge.
No
Mod parent up.
The great thing about console programming is that you know every last detail of the target machine. You know what works, what doesn't. You can budget everything right down to the last clock cycle and squeeze out 100% performance from the chips.
If you take that away then it's game over as far as optimization is concerned.
Maybe u natually distrust the police and want to know someone is looking over their shoulder all the time.
Even with no encryption a bad cop is probably smart enough to not say anything compromising over the airwaves. Or they'll use code words, etc.
The way the police are headed recently we need every single control and check possible over what they say and do. Letting them censor their own communications is a bad idea.
*Everything* the police does should be made public. If it was up to me I'd have every public servant walking around with a video camera on his shoulder recording everything they say/do. We need to watch the watchmen.
OTOH, yes, letting criminals listen in real time isn't good - it helps them get away. There's a better solution then 'encrypt everything' though...
>
A delay of up to an hour wouldn't hurt the news agencies that much and still would keep any criminals off track.
How will they get the news helicopters there to film the action?
At the very least don't display the padlock icon as if everything is cool.
(Also, keep retrying the certificate request to see if it succeeds. Change the padlock color when it does).
Given how much they charge for certificates they ought to be able to set up a decent server + backup server.
The point is that a 22kHz triangle wave can be decomposed into a 22kHz sine wave plus a series of odd harmonics (i.e. 66kHz, 110kHz etc...). Those frequencies that exceed the sampling bandwidth are not captured, but since they lie outside the range of human hearing it doesn't matter.
I'd argue that they do matter. All the harmonics of an 8kHz square wave are 'outside the human hearing range' but I know for a fact it's easy to hear the difference between an 8kHz square wave and 8kHz sine wave.
Whereas with vinyl, while a few researchers have found that you can actually reproduce nanoscale artifacts present on the pressing master, you completely obliterate all that detail the first time you actually play the thing by dragging a razor-sharp needle down the groove of soft, soft vinyl that contains all your nice sound information.
You can get laser turntables which never touch the vinyl... :-)
https://en.wikipedia.org/wiki/Laser_turntable
(But I'd still take 96kHz/24bit...or even 192kHz/32bit in a pinch)
and fundamental physics research would simply awe the likes of Feynman and Dirac if they were around to see it
Don't be too sure. Feynman and Dirac are still aweing today's physicists.
The first harmonic of an 8kHz square wave is supposedly 'inaudible', right? (it's at 24kHz)
Get out your sound editor and generate two tracks with an 8kHz sine wave and an 8kHz square wave. Go ahead, do it. I'll wait. If you haven't got one there's a free one called "Audacity" that can do it.
Listen to both tracks. If you can't tell the difference between those two you're a cloth-eared nincompoop (don't worry, you will...)
Why should the difference between those sounds vanish because the wave is at 16kHz? Human hearing is based on moving little hairs in the inner ear, it's obvious the hair won't respond the same to a sine wave and a square wave at the same frequency. What you've claiming is that the brain can't tell the difference between the movements. The experiment above proves you're wrong.
Why is 44kHz seen as the ideal sample rate?
Full story here
Short answer: It isn't "ideal", it's based on some hardware they had lying around.
I hope that thought will provide comfort when you're sat in your cell trying to stare down Bubba...
Shall we post the XKCD comic about the five dollar wrench? Would that be cruel?
Which would be useful... if they weren't mastered to a point where the total dynamic range used comes down to 3-6db... loudness wars huzzah.
Isn't that why most decent music these days is released in "Radio Edit" and "Album Version"?
(With "Radio Edit" being compressed to hell and back for listening on the move..."Album Version" for listening to at home on proper equipment)
No. No. No. Only frequencies *below* half the sample rate are captured, so there is always more than two samples available to reconstruct a sine wave.
Two-and-a-bit samples isn't an awful lot better than two, especially if it's mixed together with other waves of similar frequencies (as real sounds usually are).
nb. I'm not saying the high frequencies can't be reproduced, it's the shape of the waves I worry about. Does a 20kHz sine wave and a 20kHz sawtooth sound different when they're reproduced on a CD? They should...
PS: 22kHz is below half the sample rate.