Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 internet speed test! ×

Comment Catherine the Great's Mathematician? (Score 3, Insightful) 133

Do we really need to invoke Catherine the Great's name to help explain who Leonhard "one-of-the-greatest-mathematician's-of-all-time" Euler was? For me it would be more like "Catherine the Great, a sponsor of the legendary Euler, also happened to do some notable things while leading Russia".

Comment Re:I could not agree more (Score 1) 1001

Not inserting - insertion sort. Reading more about this insertion sort and bubble sort would perform exactly the same on an already sorted list; they'd basically be doing the exact same thing. On a list that is nearly sorted, insertion sort tends to do better as well. See the Performance section on the Wikipedia entry to bubble sort for details.

Comment Re:I could not agree more (Score 1) 1001

No moves in memory happen with either bubble or insertion sort. The difference is the number of comparisons, which also count towards N. With bubble sort on a sorted list the numbers of comparisons, and thus steps, are O(N^2). With insertion sort for the same list the comparisons (also without moves) are O(N).

Comment Re:I could not agree more (Score 1) 1001

Sorry, but I still don't see how this would be faster than insertion sort in this case. With bubble sort you first go through all n elements to bubble up the largest of them. If it's sorted you go through them all and nothing is moved. Then do the same for n-1 elements, then n-2, etc. until you're done.

With insertion sort you insert the 2nd element into a list of 1. It's already sorted, so nothing happens. Move to the 3rd element to insert into the list of 2. 2nd element is already less than 3 so, again, nothing to do. And so on until you do nothing starting at the nth element. Bubble sort version has n^2 steps (times some constant) when it's already sorted. Insertion has just n times constant.

Comment Re:I could not agree more (Score 1) 1001

Sorting something that has been sorted previously and is most likely still sorted? Best choice.

Errrr... no. Insertion sort would kill it in this case. The only case I've heard of where bubble sort is preferrable would be when random access to sorting elements is an issue.

Comment Re:I could not agree more (Score 2) 1001

But bubble sort is a horrendous sorting algorithm with no practical applications. You do not, under any circumstances, need to know it. Seriously, a first-timer making up their own sorting algorithm tends to rediscover selection sort, and that's better than bubble sort.

Comment Re:"Police found Purinton 80 miles away at Applebe (Score 1) 1149

1) The Founding Fathers, almost all of whom were British subjects, saw firsthand what happens when only the government has firearms. They can use those weapons to quell public outcry over anything, claiming the people were "rioting" or were "a threat to peace and order" because the people can't effectively fight back. If you read The Federalist Papers, Hamilton, Madison and Jay all say the same basic thing: citizens who have weapons are more fully able to defend themselves from the government.

That may sound odd to Europeans

It also sounds odd to the current U.S. Supreme Court, which affirmed in D.C. vs Heller the right to bear arms for self-defense. A later court finding (People v. Aguilar) summarized the majority opinion:

In District of Columbia v. Heller, 554 U.S. 570 (2008), the Supreme Court undertook its first-ever "in-depth examination" of the second amendment's meaning Id. at 635. After a lengthy historical discussion, the Court ultimately concluded that the second amendment "guarantee[s] the individual right to possess and carry weapons in case of confrontation" (id. at 592); that "central to" this right is "the inherent right of self-defense" (id. at 628); that "the home" is "where the need for defense of self, family, and property is most acute" (id. at 628); and that, "above all other interests," the second amendment elevates "the right of law-abiding, responsible citizens to use arms in defense of hearth and home" (id. at 635). Based on this understanding, the Court held that a District of Columbia law banning handgun possession in the home violated the second amendment. Id. at 635.

So at this point they've basically decided it's a self-defense thing. The idea that the Second Amendment is to facilitate armed insurrection to overthrow a tyrannical government (a.k.a. the so-called "Second Amendment solution") has no current legal basis. The dissenting opinion went with the "well-regulated militia" idea:

The Second Amendment was adopted to protect the right of the people of each of the several States to maintain a well-regulated militia. It was a response to concerns raised during the ratification of the Constitution that the power of Congress to disarm the state militias and create a national standing army posed an intolerable threat to the sovereignty of the several States. Neither the text of the Amendment nor the arguments advanced by its proponents evidenced the slightest interest in limiting any legislature's authority to regulate private civilian uses of firearms. Specifically, there is no indication that the Framers of the Amendment intended to enshrine the common-law right of self-defense in the Constitution.

Here are the first six drafts of the Second Amendment and the final version:

  • The right of the people to keep and bear arms shall not be infringed; a well armed and well regulated militia being the best security of a free country but no person religiously scrupulous of bearing arms shall be compelled to render military service in person.
  • A well regulated militia, composed of the body of the people, being the best security of a free State, the right of the people to keep and bear arms shall not be infringed; but no person religiously scrupulous shall be compelled to bear arms.
  • A well regulated militia, composed of the body of the people, being the best security of a free state, the right of the people to keep and bear arms shall not be infringed; but no one religiously scrupulous of bearing arms shall be compelled to render military service in person.
  • A well regulated militia, composed of the body of the people, being the best security of a free state, the right of the people to keep and bear arms, shall not be infringed, but no one religiously scrupulous of bearing arms shall be compelled to render military service in person.
  • A well regulated militia, being the best security of a free state, the right of the people to keep and bear arms, shall not be infringed.
  • A well regulated militia being the security of a free state, the right of the people to keep and bear arms shall not be infringed.
  • A well regulated militia being necessary to the security of a free State, the right of the People to keep and bear arms shall not be infringed.

If they had C-SPAN back then, we would have more insight into what motivated these careful rephrasings, comma deletions, etc. At least some are known to have been introduced by Senate scribes inadvertently modifying punctuation, and introducing subtle changes in meaning. (Thank God somebody removed that "religiously scrupulous" crap.) But the Second Amendment is just badly written. we're forced to read through the Federalist Papers and other contemporary writings to figure out what these guys were thinking when they wrote it.

Two things you need to keep in mind when you read all this stuff. First of all, these were being defined as restrictions on the federal government, and only the federal government. The courts affirmed this model during the first half of the 19th century. Northern and Southern states had very different appetites for democracy in general, for obvious reasons, so the Constitution followed an "If you like your authoritarianism, you can keep it" model. The federal government was not allowed to restrict speech in any way, but if your state wanted to violate those same individual liberties, go right ahead. In most Southern states, speaking ill of slavery was a hanging offense.

Second, we have to seriously reexamine this attitude we have toward the Constitution. The older it gets, the more revered it becomes, and at this point, most Americans think of it as an appendix to the Bible. People are seriously arguing that the Bill of Rights are ordained by God. Back when it was written, things were more casual. Everyone agreed their founding document sucked, then simply crumpled it up and wrote another one. No one was in a mood to do this a third time, so the Constitution has a nice section describing how to modify it. (And nowhere does it say "and if things don't work out, start shootin'.") There seems no reason to think that they intended the document to be unalterable by future generations centuries afterward- that would be absurd. But modifying the Constitution at this point is politically impossible and will remain so. We have worshipped the document so much that we no longer control it- which is exactly what its authors tried to prevent.

Comment Re:Sterile and shattered. (Score 5, Interesting) 273

One thing you're forgetting is that these stars have very low gravity, so when they throw flares they get a lot further out into space than they do on the sun. Typically the incident radiation will be low for the reasons you described, but when a planet orbits through a flare it gets zapped really hard. Meanwhile, orbiting the sun, we are so unaffected by flares that when we saw one, we thought it was the Russians jamming our radar.

People who get excited about aliens living on planets orbiting dwarf stars are kidding themselves. These stars are a dime a dozen and make up more than 90% of all stars, their light is more strongly affected by planetary transits, and they tend not to gobble up their innermost planets when forming. It's no wonder we find exoplanets around them all the time. But there is nobody interesting living on any of them. You can really only trust type F and G stars with life. Larger stars explode so fast their planets haven't even had time to solidify, and smaller stars have to be hugged so closely that the planet is affected by the star's fickle weather patterns.

Slashdot Top Deals

Chemist who falls in acid is absorbed in work.

Working...