I am not advocating what should or should not be legal, however to claim hunting rifles are benign compared to military rifles is silly. The differences are largely cosmetic or mechanically minor.
Well, you have to understand that this is being framed in terms of the gun control debate. Nobody -- not even the British -- has a problem with hunting rifles. You can get hunting rifles easily enough anywhere in the world. Part of the reason why they're so unregulated is because they're really not very good at doing anything but shooting deer.
That is an ill-informed opinion. For example a popular bolt action hunting rifle with a 5 round magazine, the Remington 700, has literally been quite successfully as a sniper rifle in the US military.
Which brings us to semi-automatic weapons (scary), automatic weapons (very scary), and military-grade hardware (panic-inducing).
That is an insightful statement, but not in the way you intend. Note your use of the word of "scary". Military rifles look scary. In truth to a mechanical engineer the differences between civilian hunting rifle and a military rifle is largely cosmetic. Replace wood with composites, replace shiny "blued" metals with matte black, replace a low capacity magazine (a simple sheet metal box) with a high capacity magazine,...
Regarding automatic weapons vs bolt actions rifles, the differences may not be as great as you believe. A trivially simple (yet still ingenious) device was developed during WW2 to convert WW1 era bolt action rifles to fully automatic.
Now consider hunting ammunition. It is far more deadly than military ammunition. It is literally a war crime for a soldier to use hunting ammunition.
Facing down a psychopath with an assault weapon seems terribly unfair, and, even if you've got your own assault rifle, he's fucking crazy -- he's got less to lose than you do.
And yet history shows sane police and soldiers defeating heavily armed zealots/fanatics on a regular basis. Enthusiasm nearly always loses to training.
Again, I am not advocating what should or should not be legal. I am merely arguing that claiming that hunting rifles are benign compared to military rifles is silly. The differences are largely cosmetic or mechanically minor.
In fact this result is evidence that supports a wider scope for life.
In the scope of our solar system, we could be observing a local phenomena. I'm not advocating, nor hoping, this is the case - just saying we need more evidence with respect to a universal phenomena.
Absolutely. However the bad guys may be the ones making that decision.
I don't know the scale of the LA riots, and they seem to have different motivations (race, so targeting people?) but 53 people died there.
And many have suggested that Korea town was targeted for such a reason. However the rioters were successfully deterred. I believe the deaths you refer to occurred elsewhere.
This is a complicated topic. There is no universal answer that fits all situations. There is no universal response, there is only a scale of possible responses depending on the circumstances. My point is only that some individuals seem to have additional options should the circumstances warrant it, and that recent history does show responsible and successful use of such options. YMMV.
If someone came to torch my home in the US, I would be well within my rights to kill them on the spot and the world would be a better place for their passing.
But the attackers would have guns in the US too, and they have less to lose. Do you risk your life for your home?... Also, the burned homes have all been above shops.
I understand your sentiment. Deadly force should only be used to protect people and not property, and property is not worth dying over. However you seem mistaken with respect to the odds of success for those who think otherwise. During the 1992 Los Angeles riots armed shop/home owners in Korea town successful defended homes and businesses with a visible heavily armed presence. Human predators are probably like other predators, they prefer weaker prey less able or inclined to defend themselves.
but shouldn't a school be teaching actual computing, instead of how to use commercial products?
There is nothing wrong with using common tools, even commercial ones. If you are going to teach someone to use a spreadsheet why not use the spreadsheet commonly found in businesses? The Tektronix oscilloscopes I used in the University were same I saw at work a few years later. The printing presses I learned to use in high school were the same make/model that I saw in the back of a local print shop that I visited to pick up product packaging (boxes) a few years after HS.
Also what do you mean by "teaching computing"? If its a computer literacy class learning to use word processors and spread sheets seems entirely appropriate.
I hate to intrude on your little fantasy with reality but there are plenty of public parks in the USA. When folks are referencing 6 acre plots of land for their home they are generally in rural areas. Such areas commonly have natural fields, woods, etc nearby so public parks are less of a necessity.
Perhaps you should consider that many people outside the US are misinformed regarding life in the US, just as many in the US are misinformed about life outside the US.
Interesting. Now is a good chance to find out for one-self if the famous USA universities really are as elite as their reputation. And I will learn basics of AI at the side! I already learned (thanks Wikipedia!) that Stanford is not part of the ivy league, though:)
Just like personal robots, flying cars, and apartments on the moon, a worth while dream.
Or the robots assembling and inspecting parts on a production line, or autonomous vehicles navigating from point A to point B on land or in the air, or software that screens medical imagery to hilight anomalies for doctors,..., character recognition, voice recognition, facial recognition,...
All of these are applications of AI. Pardon the emphasis on computer vision related examples, computer vision was my research area in grad school.
So there's essentially no technical difference between the RC planes/copters you're allowed to fly for fun and the ones you're not allowed to fly for money
Just as there is no difference between the plane you are allowed to fly for fun with a private pilot's license and the plane you are allowed to fly for money with a commercial pilot's license. It may be the exact same plane. Seriously, its all about money changing hands. Say you are a private pilot. A buddy asks for a favor, fly him from point A to point B. No problem with a private pilots license. It he offers money, then its no go until you get a commercial license.
And if the FAA is saying that News Corp can't use drone aircraft to perv on vacationing celebrities at the beach, but everybody else can, that seems to have serious First Amendment issues.
The first amendment allows the press to print anything they want. It does not give the press immunity from laws and regulations in their search for information to print. If the news van is speeding it gets pulled over, if the driver does not have a license he is not allowed to continue driving. Now extend this concept to aviation.
How is it different from an RC plane or helicopter?
IIRC the difference between regulated activity and unregulated activity is sometimes a matter of altitude. And of course what's on the ground underneath it all (dense population), and what is nearby (airport), can also cause regulations to come into play. A declared emergency zone (local police and fire) can also cause an otherwise unregulated environment to become regulated, even at extremely low altitudes.
No need for all that casting, as you mention it would be implied. If this is done in the context of a string type then the details are hidden. You address characters with the normal [] operator just like today, the compiler automatically generates code for the offset. About the only thing new, other than a string class, would be some operator for referencing the length.
I don't think you can use the observable earth as an indication of the protection offered. I would expect that the earth's "gravity well" (sorry, a more proper term escapes me at the moment) would be more relevant. That said I am quite suspicious of your overall approach. It seems to be commonly accepted that Jupiter provides the earth with significant protection, now consider the percentage of the sky hemisphere that jupiter occupies.
I apologize if I am missing something obvious, the coffee has not kicked in yet, but I don't see the need for indirection. I would expect a string type to be implemented as a length immediate followed by a character array - a single block of memory, not as a length and a character pointer. I suppose there are advantages to both implementations but I suspect the former to be the more likely. Especially so if the string type were a built-in type.
It seems perfectly rational to me:
* works with array types (as c0lo said)
See jerremyp's post regarding adding a new type. I don't agree with everything, for example the sizeof part, but otherwise it demonstrates that a string type may have been a reasonable choice.
* no crippling limit of 255 characters if length is 1
* no urge to have even weirder limits, like 65535 for 2-byte length
Length 1 seems a bit of a red herring, I doubt it was a serious consideration. size_t would be much more likely, if so the max length of a string would be the max length of any array.
* no waste for sane lengths, memory was at a great premium at the time
Having done microcontroller work I appreciate this sentiment however I think it is over blown in this context. String processing would seem a minor activity in the vast majority of the apps of that time, also today. For those that were string focused the programmer could simply not use the built in string type and use an array of chars with an end marker. **IF** that made sense, for some apps with custom string handing the length is desired. What would (s)he be lacking, constant string assignment and stdlib functions? The former seems a minor consideration and the later represents a handful of very simple functions. Some programs would benefit from the string type, other programs would benefit from the current implementation. I personally think it is likely that the larger group would have been the former.
* all code works the same no matter if strings are short or long
This is also true with the likely size_t based length.
* many string operations were more efficient: with Pascal strings you need to hold both the pointer and an offset inside every loop that goes over the string, this made things more complex on tiny computers of the time. On the other hand, some other operations were worse, so this goes neutral.
That doesn't seem entirely correct. Since the offset is a known constant value the offset can be embedded in the addressing mode. 68K and x86 include such addressing modes. I don't recall if PDP-11 did, I lean toward not. Even without an embedded offset the pointer or offset could be adjusted by sizeof(size_t) outside the loop, note this is all below the app programmer's view. It's something for compiler code generation when indexing a string data type and for stdlib string function implementors.
That depends on the programming language and the CPU architecture to a degree. When programming in assembly, as one may very well do in a library, one may be able to use CPU based string instructions - copy or compare or set, increment pointers, decrement count, branch/repeat depending on zero flag, etc in one or two instructions. These require a length up front so Pascal-style may be a better fit.
OK that was a little x86 centric. IIRC with the PDP-11 and 68K the move instruction will set the zero flag so the count and decrement is not needed on a copy. However the decrement is embedded into a specialized branch instruction so its the same number of instructions in the loop either way.
The GP was referring to registers being consumed during parameter passing not function implementation.
Regarding function implementation, registers are preserved so they are all available as working registers inside the function. Needing one additional register for the count does not seem troublesome. Inlining something like strcpy would complicate things but if you are inlining you are probably optimizing for speed. If so you may want to use the CPUs built-in string capabilities and these generally want a count up front, for example rep movs.
Actually the tradeoff may not have been rational. The storage bytes saved may have been offset by the extra code bytes necessary for handling unknown length strings.
Not really, no. Having written basic library code for both, it usually requires more code to handle Pascal-style (length+data) strings than C-style (data+null) strings. You save quite a bit of code ("quite a bit" being relative, but I've had to squeeze code into 208 bytes of RAM before) by using the C-style strings most of the time.
That depends on the programming language and the CPU architecture to a degree. When programming in assembly, as one may very well do in a library, one may be able to use CPU based string instructions - copy or compare or set, increment pointers, decrement count, branch/repeat depending on zero flag, etc in one or two instructions. These require a length up front so Pascal-style may be a better fit.
My assembly class in college was on a PDP-11. I've done quite a bit of x86 assembly over the years. I'm confused as to why you think a pascal style string structure pointer requires any more registers or stack than a C character pointer. In assembly if I want the the length I would reference a size_t at the pointer address, and if I want text I would reference a char at pointer+offset where offset is sizeof(size_t).
And where exactly is Apple's iPhone made?
If by "made" you mean "manufactured" then it is made in many countries. However the Chinese and non-Chinese made components are assembled in China.
The yuan *is* the real currency, get used to it.
The Yuan is pegged to the US dollar so it is as real as the dollar is.
800 yuan or £76
Can one of you foreigners please convert that into real currency?
I am shocked that no reply posts have converted to bitcoins yet. Has that "joke" truly runs its course? :-)
Well, you have to understand that this is being framed in terms of the gun control debate. Nobody -- not even the British -- has a problem with hunting rifles. You can get hunting rifles easily enough anywhere in the world. Part of the reason why they're so unregulated is because they're really not very good at doing anything but shooting deer.
That is an ill-informed opinion. For example a popular bolt action hunting rifle with a 5 round magazine, the Remington 700, has literally been quite successfully as a sniper rifle in the US military.
Which brings us to semi-automatic weapons (scary), automatic weapons (very scary), and military-grade hardware (panic-inducing).
That is an insightful statement, but not in the way you intend. Note your use of the word of "scary". Military rifles look scary. In truth to a mechanical engineer the differences between civilian hunting rifle and a military rifle is largely cosmetic. Replace wood with composites, replace shiny "blued" metals with matte black, replace a low capacity magazine (a simple sheet metal box) with a high capacity magazine, ...
Regarding automatic weapons vs bolt actions rifles, the differences may not be as great as you believe. A trivially simple (yet still ingenious) device was developed during WW2 to convert WW1 era bolt action rifles to fully automatic.
Now consider hunting ammunition. It is far more deadly than military ammunition. It is literally a war crime for a soldier to use hunting ammunition.
Facing down a psychopath with an assault weapon seems terribly unfair, and, even if you've got your own assault rifle, he's fucking crazy -- he's got less to lose than you do.
And yet history shows sane police and soldiers defeating heavily armed zealots/fanatics on a regular basis. Enthusiasm nearly always loses to training.
Again, I am not advocating what should or should not be legal. I am merely arguing that claiming that hunting rifles are benign compared to military rifles is silly. The differences are largely cosmetic or mechanically minor.
In fact this result is evidence that supports a wider scope for life.
In the scope of our solar system, we could be observing a local phenomena. I'm not advocating, nor hoping, this is the case - just saying we need more evidence with respect to a universal phenomena.
Guns would just up the ante.
Absolutely. However the bad guys may be the ones making that decision.
I don't know the scale of the LA riots, and they seem to have different motivations (race, so targeting people?) but 53 people died there.
And many have suggested that Korea town was targeted for such a reason. However the rioters were successfully deterred. I believe the deaths you refer to occurred elsewhere.
This is a complicated topic. There is no universal answer that fits all situations. There is no universal response, there is only a scale of possible responses depending on the circumstances. My point is only that some individuals seem to have additional options should the circumstances warrant it, and that recent history does show responsible and successful use of such options. YMMV.
Ah the typical american response, guns will make it better. Will you people never learn?
The lesson learned from recent US history may not be what you expect. To avoid redundancy: http://slashdot.org/comments.pl?sid=2370164&cid=37029720.
If someone came to torch my home in the US, I would be well within my rights to kill them on the spot and the world would be a better place for their passing.
But the attackers would have guns in the US too, and they have less to lose. Do you risk your life for your home? ... Also, the burned homes have all been above shops.
I understand your sentiment. Deadly force should only be used to protect people and not property, and property is not worth dying over. However you seem mistaken with respect to the odds of success for those who think otherwise. During the 1992 Los Angeles riots armed shop/home owners in Korea town successful defended homes and businesses with a visible heavily armed presence. Human predators are probably like other predators, they prefer weaker prey less able or inclined to defend themselves.
but shouldn't a school be teaching actual computing, instead of how to use commercial products?
There is nothing wrong with using common tools, even commercial ones. If you are going to teach someone to use a spreadsheet why not use the spreadsheet commonly found in businesses? The Tektronix oscilloscopes I used in the University were same I saw at work a few years later. The printing presses I learned to use in high school were the same make/model that I saw in the back of a local print shop that I visited to pick up product packaging (boxes) a few years after HS.
Also what do you mean by "teaching computing"? If its a computer literacy class learning to use word processors and spread sheets seems entirely appropriate.
But this is slashdot so the geek solution would be more appropriate. Robotics. A "roomba" lawn mower. :-)
I hate to intrude on your little fantasy with reality but there are plenty of public parks in the USA. When folks are referencing 6 acre plots of land for their home they are generally in rural areas. Such areas commonly have natural fields, woods, etc nearby so public parks are less of a necessity.
Perhaps you should consider that many people outside the US are misinformed regarding life in the US, just as many in the US are misinformed about life outside the US.
Knowledge is free. Credits cost money.
Knowledge costs time.
Interesting. Now is a good chance to find out for one-self if the famous USA universities really are as elite as their reputation. And I will learn basics of AI at the side! I already learned (thanks Wikipedia!) that Stanford is not part of the ivy league, though :)
Actually you've been able to do this for a while. Check out iTunes U, http://www.apple.com/education/itunes-u/what-is.html.
:-)
FWIW, Ivy League is a marketing gimmick.
Just like personal robots, flying cars, and apartments on the moon, a worth while dream.
Or the robots assembling and inspecting parts on a production line, or autonomous vehicles navigating from point A to point B on land or in the air, or software that screens medical imagery to hilight anomalies for doctors, ..., character recognition, voice recognition, facial recognition, ...
All of these are applications of AI. Pardon the emphasis on computer vision related examples, computer vision was my research area in grad school.
Name a News Corp act that wasnt evil and then we MIGHT give the shitheads some benefit of doubt.
They shut down one of their newspapers for misconduct.
So there's essentially no technical difference between the RC planes/copters you're allowed to fly for fun and the ones you're not allowed to fly for money
Just as there is no difference between the plane you are allowed to fly for fun with a private pilot's license and the plane you are allowed to fly for money with a commercial pilot's license. It may be the exact same plane. Seriously, its all about money changing hands. Say you are a private pilot. A buddy asks for a favor, fly him from point A to point B. No problem with a private pilots license. It he offers money, then its no go until you get a commercial license.
And if the FAA is saying that News Corp can't use drone aircraft to perv on vacationing celebrities at the beach, but everybody else can, that seems to have serious First Amendment issues.
The first amendment allows the press to print anything they want. It does not give the press immunity from laws and regulations in their search for information to print. If the news van is speeding it gets pulled over, if the driver does not have a license he is not allowed to continue driving. Now extend this concept to aviation.
How is it different from an RC plane or helicopter?
IIRC the difference between regulated activity and unregulated activity is sometimes a matter of altitude. And of course what's on the ground underneath it all (dense population), and what is nearby (airport), can also cause regulations to come into play. A declared emergency zone (local police and fire) can also cause an otherwise unregulated environment to become regulated, even at extremely low altitudes.
No need for all that casting, as you mention it would be implied. If this is done in the context of a string type then the details are hidden. You address characters with the normal [] operator just like today, the compiler automatically generates code for the offset. About the only thing new, other than a string class, would be some operator for referencing the length.
I don't think you can use the observable earth as an indication of the protection offered. I would expect that the earth's "gravity well" (sorry, a more proper term escapes me at the moment) would be more relevant. That said I am quite suspicious of your overall approach. It seems to be commonly accepted that Jupiter provides the earth with significant protection, now consider the percentage of the sky hemisphere that jupiter occupies.
I apologize if I am missing something obvious, the coffee has not kicked in yet, but I don't see the need for indirection. I would expect a string type to be implemented as a length immediate followed by a character array - a single block of memory, not as a length and a character pointer. I suppose there are advantages to both implementations but I suspect the former to be the more likely. Especially so if the string type were a built-in type.
It seems perfectly rational to me: * works with array types (as c0lo said)
See jerremyp's post regarding adding a new type. I don't agree with everything, for example the sizeof part, but otherwise it demonstrates that a string type may have been a reasonable choice.
* no crippling limit of 255 characters if length is 1 * no urge to have even weirder limits, like 65535 for 2-byte length
Length 1 seems a bit of a red herring, I doubt it was a serious consideration. size_t would be much more likely, if so the max length of a string would be the max length of any array.
* no waste for sane lengths, memory was at a great premium at the time
Having done microcontroller work I appreciate this sentiment however I think it is over blown in this context. String processing would seem a minor activity in the vast majority of the apps of that time, also today. For those that were string focused the programmer could simply not use the built in string type and use an array of chars with an end marker. **IF** that made sense, for some apps with custom string handing the length is desired. What would (s)he be lacking, constant string assignment and stdlib functions? The former seems a minor consideration and the later represents a handful of very simple functions. Some programs would benefit from the string type, other programs would benefit from the current implementation. I personally think it is likely that the larger group would have been the former.
* all code works the same no matter if strings are short or long
This is also true with the likely size_t based length.
* many string operations were more efficient: with Pascal strings you need to hold both the pointer and an offset inside every loop that goes over the string, this made things more complex on tiny computers of the time. On the other hand, some other operations were worse, so this goes neutral.
That doesn't seem entirely correct. Since the offset is a known constant value the offset can be embedded in the addressing mode. 68K and x86 include such addressing modes. I don't recall if PDP-11 did, I lean toward not. Even without an embedded offset the pointer or offset could be adjusted by sizeof(size_t) outside the loop, note this is all below the app programmer's view. It's something for compiler code generation when indexing a string data type and for stdlib string function implementors.
That depends on the programming language and the CPU architecture to a degree. When programming in assembly, as one may very well do in a library, one may be able to use CPU based string instructions - copy or compare or set, increment pointers, decrement count, branch/repeat depending on zero flag, etc in one or two instructions. These require a length up front so Pascal-style may be a better fit.
OK that was a little x86 centric. IIRC with the PDP-11 and 68K the move instruction will set the zero flag so the count and decrement is not needed on a copy. However the decrement is embedded into a specialized branch instruction so its the same number of instructions in the loop either way.
The GP was referring to registers being consumed during parameter passing not function implementation.
Regarding function implementation, registers are preserved so they are all available as working registers inside the function. Needing one additional register for the count does not seem troublesome. Inlining something like strcpy would complicate things but if you are inlining you are probably optimizing for speed. If so you may want to use the CPUs built-in string capabilities and these generally want a count up front, for example rep movs.
Actually the tradeoff may not have been rational. The storage bytes saved may have been offset by the extra code bytes necessary for handling unknown length strings.
Not really, no. Having written basic library code for both, it usually requires more code to handle Pascal-style (length+data) strings than C-style (data+null) strings. You save quite a bit of code ("quite a bit" being relative, but I've had to squeeze code into 208 bytes of RAM before) by using the C-style strings most of the time.
That depends on the programming language and the CPU architecture to a degree. When programming in assembly, as one may very well do in a library, one may be able to use CPU based string instructions - copy or compare or set, increment pointers, decrement count, branch/repeat depending on zero flag, etc in one or two instructions. These require a length up front so Pascal-style may be a better fit.
My assembly class in college was on a PDP-11. I've done quite a bit of x86 assembly over the years. I'm confused as to why you think a pascal style string structure pointer requires any more registers or stack than a C character pointer. In assembly if I want the the length I would reference a size_t at the pointer address, and if I want text I would reference a char at pointer+offset where offset is sizeof(size_t).