Greatly simplified: Any time you have redundant copies of the same data, there is the possibility that the two copies could get out of sync. For example:
In these tables, an employee can appear multiple times if he/she is on multiple projects. 'PhoneNumber' and 'EmployeeName' is redundant in each copy and the possibility exists that one copy of an employee's name or phone number could be updated without all of the matching copies also being updated, thus creating an conflict or error.
"Normal Forms" eliminates this possibility by requiring that redundant data is factored out, split into separate tables if necessary. There should be just a single "key" field that relates data between separate tables, for example:
In this more "normalized" version there is only one record in the StaffTable for each employee. There is only one place where an employees name and phone number are recorded. Other references to that employee are references to his EmployeeID which is a "key" into the StaffTable. The ProjectStaffing table has one record for each valid combination of employee and project.
Normalizing protects your data from programming errors introducing errors into your data. On the downside your code will probably be slower because you need to join tables together more often than with the redundant version of the database.
I can't wait until someone at the RIAA figures out how to protect music with quantum DRM. You get to listen to a song ONCE, then it doesn't exist anymore. They will charge PER listening.
> Both of your lsof and snapfs suggestions leave room for data loss unless you are sure that no one will be modifying the files
No, snapfs guarantees all writes will be sent to the snap filesystem, not the main file. If the snapfs creates a modified version of the file, the defragger should not overwrite the original, but instead at the end of the run copy the snapfs versions of all modified files back. No data loss can occur. That's what snapshots are for.
So how about I wrap it in a smarter script that uses 'lsof' to check if a file has an open file descriptor before overwriting it. I skip open files, or make a list of them and try them again at the end of the run. That should do it. Or I use something like 'snapfs' to shapshot changing files.... I guess I'm moving far from plain ext2/ext3 now...
> The ONLY way you can defragment a file is to copy the fragmented file to another partition, remove it and copy it back. If you want to defragment a complete ext2/3 filesystem, make a backup of the filesystem using tar, delete the original and restore the backup.
I call bullshit. Free up a lot of space, then copy every file over. Something like this:
> Speaks the guy with no kids. >... you'll either have to buy 'em or deal with the crazed screaming/whining/sulking that will ensue... > you can fight that fight, but you have to fight it often enough already for crap that actually matters more than a box of cereal. Lot of people will give in just to avoid the inevitable scene.
No, you just have to fight it a couple of times, be consistent, and don't give in occasionally. My three kids, all under 6 years old, never whine and scream for stuff because they know it is not a strategy that will ever work. We say no to junk. If they whine and scream we say no to everything. We never make exceptions. People cannot believe how "well behaved" our kids are. We cannot believe how badly behaved most other kids are.
Remember, partial reinforcement is more powerful than continuous reinforcement, so giving in once in a while will guarantee maximum screaming and whining.
Just to clarify a subtle point: Apple sets rules on developing apps for their proprietary consumer electronic product, nazis slaughter millions of innocent people in attempted genocide.
Thought I'd help clear that up in case anyone wasn't clear on the difference.
> being intelligent does not automatically mean a robot would have the drive or desire to breed, or even the means to. Which would leave them in a pretty poor position in the Darwins game against humans.
Yes, and the first robot that DOES have a drive to breed will, by Darwinian fitness, quickly reproduce and dominate the population of robots. Lather, rinse, repeat. Getting that first urge to reproduce may take a long time and many false starts, but eventually one robot will have some sort of imperative to create more robots whether by accident or by purposeful programming by humans. The first urge to reproduce among free-floating proteins took a long time also.
> To even get an app listed on the iTunes store (whether or not you pay for it) costs $99. You can't distribute your app or load it on your phone (not even for debugging) without paying them $99. > Doesn't this impinge upon the ability to release (or port) GPL software to the iPhone?
Yes, it tramples all over your rights. By the way, to take me, my wife, and my three kids to the movies with popcorn and drinks for everyone costs $99. So I can't seem to get too worked up over this impingement. I will pay $99 once, then develop iPhone apps to my heart's content.
That nineteenth century minister had it almost right. The world wasn't created 6,000 years ago with a fully fleshed out history planted. It was created this instant with a fully fleshed out history planted, including the half-formed thought in your head "could that really be true?". Now you are thinking that instant has passed and the world was created 5 seconds ago, but no, that would be wrong. The world was in fact created this very instant with the memory of thinking you read the world was created this instant, 8 seconds ago.
Tomorrow, when you think of this, you will wonder if the world was created yesterday... but in fact that would be incorrect. Your memory of reading this yesterday is an embedded false memory. The world was just created this instant.
You seem to be making the common error of mistaking an energy transport technology (Hydrogen) for an energy source (Oil & Gasoline).
We still need energy to MAKE that Hydrogen. Whether it is done at big plants or from electricity in your house, the energy has to come from somewhere. Big oil will still be drilling to supply the engines the generate electricity that comes to your house that makes Hydrogen. Coal and Oil will still be the big sources of energy for a long time. Wind, Water, Solar, and Unicorns won't replace Coal and Oil for a long time...
The DEC printer terminals had pretty heavy printing heads, and the entire terminal would shake when the head did a carriage return from the far-right to the left. So I wrote something that would set the first tab to the far right, then send a stream of seek-far-right/carriage-return. The entire terminal would start vibrating and slowly sliding around the room.
Another favorite was years later when we got Apple II's I wrote a program in 6502 assembly that would, after suitable delay, tell the disk drive to seek to track -1, then track 32767 repeatedly. The drive would actually 'sing' while vibrating around the desk. (drives were external boxes connected by cables).
When all we had was Dec printer terminals, I wrote a program that waited until I was long out of the computer room (about 30 minutes) and then sent a stream of form-feeds to all of the printers. Form feed shot a page of fan-fold paper out of the printer at high speed. The room filled up with curling paper and looked like someone dumped a box of detergent in all the washing machines at a laundrymat.
After we upgraded to new-fangled CRTs (keyboard and monitors to you young'ens) I wrote a program that randomly drew an asci-art horse galloping across the screen from one edge to the other in the middle of whatever the user was doing. They never did find out where it was coming from or how to stop it. I quietly disabled it when the word "expelled" started being thrown around.
> If you think XML a poor choice, then could you suggest an alternative?
YAML for the win! YAML is concise, easy to read, easy to write, easy to parse, easy to edit. It has high signal-to-noise ration, and is effortless for the human eye. It can represent any data structure I can imagine. It has libraries for any popular language I can think of.
Till the script kiddies use this delivery mechanism to bypass all security and deliver their own custom payloads. Yay Microsoft! They have such good instincts when it comes to security!
I took a Computer Science course on discrete logic with a professor who was very into "model checking". By the end of the course I finally understood that all we had done was move the logic and the source of errors from the computer program to the formal specification. The formal specification was just as rigorous and complex as a computer program. The program became little more than a different expression of the formal specifications, such that it would be possible not only to check that a program had no "errors" and followed the specification exactly, but it would also be possible to have an automated process translate the formal specification into a program directly. The professor proclaimed that we now had a system that could prove programs correct. I pointed out that we had not, we had only changed programming languages to a mathematical one instead of a more typical computer programming language.
> But there's a key part of the equation you're missing here. Did you actually buy one? If not, don't worry about what it might do to your kids. > By the way, keep your kids away from your car's headlights too.
1. No, I didn't. I'm worried about the one lying around the house at someone else's house. Especially people without kids, who have no concept of how kids get into everything you never expected them to get into. 2. My car's headlights won't catch their faces on fire and burn out their retinas.
Because I have little kids that would not think twice about looking into the cool flashlight.
It may be young kids who don't know better. It might be 14 year old assholes shining it in someone's face. Somewhere, sooner or later, this will burn and blind some kids.
> If someone pulls a knife on you, do you pull out your grenade launcher?
Ummm... yes.
If someone escalates to lethal force with me, I will respond with lethal force and it will be very important to *win*. Therefore, yes, I will respond to a knife with a grenade launcher.
> I just tossed the whole pack
You know that it is illegal in some places to throw Mercury in the trash?
And a bad idea everywhere.
I won't bring CFL bulbs into my house.
I guarantee you 99% of people throw them in the trash when they burn out.
> "normal forms" (still not sure WTF that means)
Greatly simplified: Any time you have redundant copies of the same data, there is the possibility that the two copies could get out of sync. For example:
StaffTable: EmployeeID, EmployeeName, PhoneNumber, ProjectName
In these tables, an employee can appear multiple times if he/she is on multiple projects. 'PhoneNumber' and 'EmployeeName' is redundant in each copy and the possibility exists that one copy of an employee's name or phone number could be updated without all of the matching copies also being updated, thus creating an conflict or error.
"Normal Forms" eliminates this possibility by requiring that redundant data is factored out, split into separate tables if necessary. There should be just a single "key" field that relates data between separate tables, for example:
StaffTable: EmployeeID, EmployeeName, PhoneNumber
ProjectTable: ProjectID, ProjectName
ProjectStaffing: ProjectID, EmployeeID
In this more "normalized" version there is only one record in the StaffTable for each employee. There is only one place where an employees name and phone number are recorded. Other references to that employee are references to his EmployeeID which is a "key" into the StaffTable.
The ProjectStaffing table has one record for each valid combination of employee and project.
Normalizing protects your data from programming errors introducing errors into your data. On the downside your code will probably be slower because you need to join tables together more often than with the redundant version of the database.
> I think we (as a community of networked computers)
Wintermute, is that you?
Oh great...
I can't wait until someone at the RIAA figures out how to protect music with quantum DRM. You get to listen to a song ONCE, then it doesn't exist anymore.
They will charge PER listening.
> I don't see why you're "calling bullshit."
Ummm... because I'm being unreasonably antagonistic to provoke a response?
> Both of your lsof and snapfs suggestions leave room for data loss unless you are sure that no one will be modifying the files
No, snapfs guarantees all writes will be sent to the snap filesystem, not the main file.
If the snapfs creates a modified version of the file, the defragger should not overwrite the original, but instead at the end of the run copy the snapfs versions of all modified files back. No data loss can occur.
That's what snapshots are for.
ok ok...
So how about I wrap it in a smarter script that uses 'lsof' to check if a file has an open file descriptor before overwriting it. I skip open files, or make a list of them and try them again at the end of the run. That should do it. Or I use something like 'snapfs' to shapshot changing files.... I guess I'm moving far from plain ext2/ext3 now...
> The ONLY way you can defragment a file is to copy the fragmented file to another partition, remove it and copy it back. If you want to defragment a complete ext2/3 filesystem, make a backup of the filesystem using tar, delete the original and restore the backup.
I call bullshit.
Free up a lot of space, then copy every file over. Something like this:
find / -exec (cp {} {}.defrag; rm {}; mv {}.defrag {});
Done.
> Speaks the guy with no kids. ... you'll either have to buy 'em or deal with the crazed screaming/whining/sulking that will ensue...
>
> you can fight that fight, but you have to fight it often enough already for crap that actually matters more than a box of cereal. Lot of people will give in just to avoid the inevitable scene.
No, you just have to fight it a couple of times, be consistent, and don't give in occasionally. My three kids, all under 6 years old, never whine and scream for stuff because they know it is not a strategy that will ever work. We say no to junk. If they whine and scream we say no to everything. We never make exceptions. People cannot believe how "well behaved" our kids are. We cannot believe how badly behaved most other kids are.
Remember, partial reinforcement is more powerful than continuous reinforcement, so giving in once in a while will guarantee maximum screaming and whining.
> nazi-ish rules for the iPhone SDK
Just to clarify a subtle point: Apple sets rules on developing apps for their proprietary consumer electronic product, nazis slaughter millions of innocent people in attempted genocide.
Thought I'd help clear that up in case anyone wasn't clear on the difference.
> A few hundred? You are aware that there are at least ten thousand people connected to the internet..
ten thousand?
Radiometric dating shows there are at least 4.54 billion people connected to the internet.
> being intelligent does not automatically mean a robot would have the drive or desire to breed, or even the means to. Which would leave them in a pretty poor position in the Darwins game against humans.
Yes, and the first robot that DOES have a drive to breed will, by Darwinian fitness, quickly reproduce and dominate the population of robots. Lather, rinse, repeat. Getting that first urge to reproduce may take a long time and many false starts, but eventually one robot will have some sort of imperative to create more robots whether by accident or by purposeful programming by humans. The first urge to reproduce among free-floating proteins took a long time also.
That's how evolution works.
> To even get an app listed on the iTunes store (whether or not you pay for it) costs $99. You can't distribute your app or load it on your phone (not even for debugging) without paying them $99.
> Doesn't this impinge upon the ability to release (or port) GPL software to the iPhone?
Yes, it tramples all over your rights.
By the way, to take me, my wife, and my three kids to the movies with popcorn and drinks for everyone costs $99. So I can't seem to get too worked up over this impingement. I will pay $99 once, then develop iPhone apps to my heart's content.
> an iPhone version of the upcoming game Spore was also demoed
In unrelated news, a demo of the upcoming Duke Nukem Forever Mobile was demoed.
> want to wait until we've rebalanced our government and society to ensure our freedom and rights will not be abused
They are currently "rebalancing" our government. Only not in the direction you hoped.
That nineteenth century minister had it almost right. The world wasn't created 6,000 years ago with a fully fleshed out history planted. It was created this instant with a fully fleshed out history planted, including the half-formed thought in your head "could that really be true?". Now you are thinking that instant has passed and the world was created 5 seconds ago, but no, that would be wrong. The world was in fact created this very instant with the memory of thinking you read the world was created this instant, 8 seconds ago.
Tomorrow, when you think of this, you will wonder if the world was created yesterday... but in fact that would be incorrect. Your memory of reading this yesterday is an embedded false memory. The world was just created this instant.
You seem to be making the common error of mistaking an energy transport technology (Hydrogen) for an energy source (Oil & Gasoline).
We still need energy to MAKE that Hydrogen. Whether it is done at big plants or from electricity in your house, the energy has to come from somewhere. Big oil will still be drilling to supply the engines the generate electricity that comes to your house that makes Hydrogen. Coal and Oil will still be the big sources of energy for a long time. Wind, Water, Solar, and Unicorns won't replace Coal and Oil for a long time...
Oh.. oh. now I'm remembering more...
The DEC printer terminals had pretty heavy printing heads, and the entire terminal would shake when the head did a carriage return from the far-right to the left. So I wrote something that would set the first tab to the far right, then send a stream of seek-far-right/carriage-return. The entire terminal would start vibrating and slowly sliding around the room.
Another favorite was years later when we got Apple II's I wrote a program in 6502 assembly that would, after suitable delay, tell the disk drive to seek to track -1, then track 32767 repeatedly. The drive would actually 'sing' while vibrating around the desk. (drives were external boxes connected by cables).
Since we're all sharing...
When all we had was Dec printer terminals, I wrote a program that waited until I was long out of the computer room (about 30 minutes) and then sent a stream of form-feeds to all of the printers. Form feed shot a page of fan-fold paper out of the printer at high speed. The room filled up with curling paper and looked like someone dumped a box of detergent in all the washing machines at a laundrymat.
After we upgraded to new-fangled CRTs (keyboard and monitors to you young'ens) I wrote a program that randomly drew an asci-art horse galloping across the screen from one edge to the other in the middle of whatever the user was doing. They never did find out where it was coming from or how to stop it. I quietly disabled it when the word "expelled" started being thrown around.
> If you think XML a poor choice, then could you suggest an alternative?
YAML for the win!
YAML is concise, easy to read, easy to write, easy to parse, easy to edit.
It has high signal-to-noise ration, and is effortless for the human eye.
It can represent any data structure I can imagine.
It has libraries for any popular language I can think of.
Till the script kiddies use this delivery mechanism to bypass all security and deliver their own custom payloads.
Yay Microsoft! They have such good instincts when it comes to security!
I took a Computer Science course on discrete logic with a professor who was very into "model checking". By the end of the course I finally understood that all we had done was move the logic and the source of errors from the computer program to the formal specification. The formal specification was just as rigorous and complex as a computer program. The program became little more than a different expression of the formal specifications, such that it would be possible not only to check that a program had no "errors" and followed the specification exactly, but it would also be possible to have an automated process translate the formal specification into a program directly. The professor proclaimed that we now had a system that could prove programs correct. I pointed out that we had not, we had only changed programming languages to a mathematical one instead of a more typical computer programming language.
> But there's a key part of the equation you're missing here. Did you actually buy one? If not, don't worry about what it might do to your kids.
> By the way, keep your kids away from your car's headlights too.
1. No, I didn't. I'm worried about the one lying around the house at someone else's house. Especially people without kids, who have no concept of how kids get into everything you never expected them to get into.
2. My car's headlights won't catch their faces on fire and burn out their retinas.
Because I have little kids that would not think twice about looking into the cool flashlight.
It may be young kids who don't know better.
It might be 14 year old assholes shining it in someone's face.
Somewhere, sooner or later, this will burn and blind some kids.
> If someone pulls a knife on you, do you pull out your grenade launcher?
Ummm... yes.
If someone escalates to lethal force with me, I will respond with lethal force and it will be very important to *win*. Therefore, yes, I will respond to a knife with a grenade launcher.
Hell, I say nuke them from orbit.