I have googled around and have not found a webpage explaining
the data type "string" without referring to a programming language.
Can someone point me to a URL that describes strings and useful
operations on strings in the abstract without referring to a specific
language ?
>I have googled around and have not found a webpage explaining
>the data type "string" without referring to a programming language.
>Can someone point me to a URL that describes strings and useful
>operations on strings in the abstract without referring to a specific
>language ?
>
>Gus Calabrese
String handling is always language dependent, as there are different ways of representing them, and
different sets of standard operations.
>
> On May 3, 2009, at 12:12 PM, Mike Harrison wrote:
>
> On Sun, 3 May 2009 11:49:09 -0600, you wrote:
>
>> I have googled around and have not found a webpage explaining
>> the data type "string" without referring to a programming language.
>> Can someone point me to a URL that describes strings and useful
>> operations on strings in the abstract without referring to a specific
>> language ?
>>
>> Gus Calabrese
>
> String handling is always language dependent, as there are different
> ways of representing them, and
> different sets of standard operations.
>
Of course string handling is language dependent, but just as you can
discuss
sorting algorithms independent of a language, you should be able to
discuss
string handling independent of a language.
Gus
AGSCalabrese wrote:
> I have googled around and have not found a webpage explaining
> the data type "string" without referring to a programming language.
> Can someone point me to a URL that describes strings and useful
> operations on strings in the abstract without referring to a specific
> language ?
As others have pointed out it's language dependent. There's no firm
definition. I usually use a string to mean 7 bit ASCII with some
form of termination but I've also used hex representation to mean
string (such as "12345" == 0x30 0x31 0x32 0x33 0x34 0x35), I've also
done 5 bits and 8 bits. Some with Zero termination (ASCIZ) some
without.
Neil Cherry wrote:
> As others have pointed out it's language dependent. There's no firm
> definition. I usually use a string to mean 7 bit ASCII with some
> form of termination but I've also used hex representation to mean
> string (such as "12345" == 0x30 0x31 0x32 0x33 0x34 0x35), I've also
> done 5 bits and 8 bits. Some with Zero termination (ASCIZ) some
> without.
This was my initial reaction as well, but there is a higher level of
abstraction, which might more properly be called "text manipulation"
algorithms and techniques, as opposed to "string" which is a computer
language-dependent data type. Although specifying ASCII pushes it down
into a lower-level discussion, but maybe that was unintended.
Are you asking things about manipulating collections of text characters
at a very high level? Like how to sort strings in some conceptual way,
or encode text in various ways (base 64 for example) or ideas like
pattern matching?
The problem is that it doesn't take too long in those kinds of
discussions before you're forced to talk about language features anyway,
so you're more likely to find useful information when discussing how to
do things like that in Python, or Ruby, or C, or PIC assembly, or
whatever, than one that stays completely language-neutral.
> On May 3, 2009, at 4:11 PM, Neil Cherry wrote:
>
> AGSCalabrese wrote:
>> I have googled around and have not found a webpage explaining
>> the data type "string" without referring to a programming language.
>> Can someone point me to a URL that describes strings and useful
>> operations on strings in the abstract without referring to a specific
>> language ?
>
> As others have pointed out it's language dependent. There's no firm
> definition. I usually use a string to mean 7 bit ASCII with some
> form of termination but I've also used hex representation to mean
> string (such as "12345" == 0x30 0x31 0x32 0x33 0x34 0x35), I've also
> done 5 bits and 8 bits. Some with Zero termination (ASCIZ) some
> without.
>
> Sorry to not be of much help there.
What I am really after is a tutorial that describes string
operations. I am
teaching some students about strings.
I wanted to find some tutorial that explained concatenation,
string length, getting a character at position "n", 8 bit and 16 bit
characters, capitalization and capitalization not. Also string to
<--> hex conversion, string <--> decimal conversion , character
<--> ASCII value and more. These things can be explained without
requiring a specific implementation.
Gus
>> On May 3, 2009, at 12:12 PM, Mike Harrison wrote:
>>
>> On Sun, 3 May 2009 11:49:09 -0600, you wrote:
>>
>>
>>> I have googled around and have not found a webpage explaining
>>> the data type "string" without referring to a programming language.
>>> Can someone point me to a URL that describes strings and useful
>>> operations on strings in the abstract without referring to a specific
>>> language ?
>>>
>>> Gus Calabrese
>>>
>> String handling is always language dependent, as there are different
>> ways of representing them, and
>> different sets of standard operations.
>>
>>
> Of course string handling is language dependent, but just as you can
> discuss
> sorting algorithms independent of a language, you should be able to
> discuss
> string handling independent of a language.
> Gus
>
>
For myself, however, I'd just pick up a good article on string
processing in, say, one of the current BASICs or python, or even the C
string library , and just read it as if the string operations described
were fundamental basics. Most of those operators are present because
there were found to be highly useful in practice. In the process, don't
overlook the regular expression tools, or the phonetic-like tools such
as soundex.
AGSCalabrese wrote:
> What I am really after is a tutorial that describes string
> operations. I am
> teaching some students about strings.
> I wanted to find some tutorial that explained concatenation,
> string length, getting a character at position "n", 8 bit and 16 bit
But right there you have implementation-dependent concepts. Take string
length. All you can say without looking at an implementation is
"strings consist of a number of characters (whatever a character might
or might not BE on a particular platform), and you can do something
language-specific to see what the number of characters is." Beyond
that, what, exactly, could you say without knowing what characters are
and how the strings are represented?
Getting a character at position N is the same. What "position N" even
means is language dependent. How to "get" a "character" is also.
> characters, capitalization and capitalization not. Also string to
> <--> hex conversion, string <--> decimal conversion , character
> <--> ASCII value and more. These things can be explained without
> requiring a specific implementation.
I'd love to see how they can be explained in any useful way without
assuming a particular implementation. (Silently assuming one and just
not calling out what it is doesn't count.)
I've taught no small number of programming classes myself, and I'm a
little mystified by what's driving you to take this angle. I'd explain
strings very briefly in abstract but from there I think anything
meaningful would better be done by picking a sample implementation (ANY
one) and showing concrete examples and actually working with them.
> What I am really after is a tutorial that describes string
> operations. I am teaching some students about strings. I wanted to
> find some tutorial that explained concatenation, string length,
> getting a character at position "n", 8 bit and 16 bit characters,
> capitalization and capitalization not.
As Steve said, you're better off looking for information on "text
processing." Perhaps even one of the older languages that specialized
in text processing, like SNOBOL ?
The only other idea is to take several languages and compare their
string primitives to look for commonalities and differences. C is
probably an awful choice, since it doesn't really have any string data
type or operations built into it. A lot of the early languages seem
to ignore strings in favor of supporting algorithmic math. (Fortran,
Pascal, etc. I remember looking at Algol be being singularly
unimpressed with it's string handling.) BASIC may be one of the
better thought-out examples of text processing in an early language
(mind boggling though that may be), and a lot of more modern languages
have followed its examples in their string libraries.
The wikipedia article looks like it has some nice formal definitions,
but it's hardly beginner stuff ("Fixed length strings can be viewed as
nodes on a hypercube" ! Reminds me of the reasons I was unimpressed
with "computer science.") The "programming" link looks more likely:
>
> On May 3, 2009, at 4:44 PM, D. Daniel McGlothin wrote:
>
> AGSCalabrese wrote:
>>> On May 3, 2009, at 12:12 PM, Mike Harrison wrote:
>>>
>>> On Sun, 3 May 2009 11:49:09 -0600, you wrote:
>>>
>>>
>>>> I have googled around and have not found a webpage explaining
>>>> the data type "string" without referring to a programming language.
>>>> Can someone point me to a URL that describes strings and useful
>>>> operations on strings in the abstract without referring to a
>>>> specific
>>>> language ?
>>>>
>>>> Gus Calabrese
>>>>
>>> String handling is always language dependent, as there are different
>>> ways of representing them, and
>>> different sets of standard operations.
>>>
>>>
>> Of course string handling is language dependent, but just as you can
>> discuss
>> sorting algorithms independent of a language, you should be able to
>> discuss
>> string handling independent of a language.
>> Gus
>>
>>
>
> Have you considered
> http://en.wikipedia.org/wiki/String_(computer_science) and
> http://en.wikipedia.org/wiki/String_operations ?
>
> Perhaps _Abstract data types_ by Henry M. Walker (
> http://books.google.com/books?id=gCAbDb0u7b0C ) starting with section
> called 'Sequences" on page 222.
>
> For myself, however, I'd just pick up a good article on string
> processing in, say, one of the current BASICs or python, or even the C
> string library , and just read it as if the string operations
> described
> were fundamental basics. Most of those operators are present because
> there were found to be highly useful in practice. In the process,
> don't
> overlook the regular expression tools, or the phonetic-like tools such
> as soundex.
>
> A purist might also want to consult a SNOBOL description (
> http://en.wikipedia.org/wiki/SNOBOL ).
>
> I'm curious, what does the discussion 'in abstract' offer that is
> absent
> from a specific language's string operation library?
>
> Daniel
My students freak when exposed to actual programming language variances.
Gus
> On May 3, 2009, at 4:51 PM, Steve Willoughby wrote:
>
> AGSCalabrese wrote:
>> What I am really after is a tutorial that describes string
>> operations. I am
>> teaching some students about strings.
>> I wanted to find some tutorial that explained concatenation,
>> string length, getting a character at position "n", 8 bit and 16 bit
>
> But right there you have implementation-dependent concepts. Take
> string
> length. All you can say without looking at an implementation is
> "strings consist of a number of characters (whatever a character might
> or might not BE on a particular platform), and you can do something
> language-specific to see what the number of characters is." Beyond
> that, what, exactly, could you say without knowing what characters are
> and how the strings are represented?
I don't see a problem with simply stating that characters can be 8 bit
or
16 bit and that a string might start with a header and might end with a
trailer which would affect the value of "n". ( and that there might be
variations where characters were 6,7, 9 or whatever bits. )
Gus {Quote hidden}
>
>
> Getting a character at position N is the same. What "position N" even
> means is language dependent. How to "get" a "character" is also.
>
>> characters, capitalization and capitalization not. Also string to
>> <--> hex conversion, string <--> decimal conversion , character
>> <--> ASCII value and more. These things can be explained without
>> requiring a specific implementation.
>
> I'd love to see how they can be explained in any useful way without
> assuming a particular implementation. (Silently assuming one and just
> not calling out what it is doesn't count.)
I am confident I can write a tutorial. I just wanted to steal one
from someone
else. I would do what you are suggesting ( silently assuming and mixing
various implementations without mentioning them explicitly )
Gus {Quote hidden}
>
>
> I've taught no small number of programming classes myself, and I'm a
> little mystified by what's driving you to take this angle. I'd
> explain
> strings very briefly in abstract but from there I think anything
> meaningful would better be done by picking a sample implementation
> (ANY
> one) and showing concrete examples and actually working with them.
> --
As I see it there are 3 kinds of strings. Defined length, fixed length, and
null terminated.
A string consists of an ordered set of characters.
If characters are represented by 8 bits each, the maximum number of
characters is the range of values from 0..255 decimal or 00000000..11111111
binary or 00..FF hexadecimal.
A string may also be considered to be a one dimensional array of characters.
Additional instructions to manipulate strings are not necessary are not
necessary but they are usually provided by the compiler because of their
usefulness.
John Ferrell W8CCW
"All that is necessary for the triumph of evil is for good men to do
nothing." -- Edmund Burke
...."The problem with socialism is that you eventually run out of other
people's money."
MARGARET THATCHER http://DixieNC.US
> >> I have googled around and have not found a webpage explaining
> >> the data type "string" without referring to a programming language.
> >> Can someone point me to a URL that describes strings and useful
> >> operations on strings in the abstract without referring to a specific
> >> language ?
> >>
> >> Gus Calabrese
> >
> > String handling is always language dependent, as there are different
> > ways of representing them, and
> > different sets of standard operations.
> >
> Of course string handling is language dependent, but just as you can
> discuss
> sorting algorithms independent of a language, you should be able to
> discuss
> string handling independent of a language.
> Gus
A string is a finite sequence of characters, whether is "ABC" or the
contents or 'War & Peace'.
In general there's really not much you can do with a string, you can check
its length, add bits, remove bits or search for bits within it. Shouldn't
take too long to explain.
Knuth - Art of Programming has all of this stuff, although, as other have
said, it mainly explains it in the context of a programming language.
I'm not sure how useful strings outside of programming are...
Even BASIC got a bit complicated with strings. For a long time one
character equalled a byte, now with Unicode that's not the case. In VB,
Len("ABC") will state that string has 3 characters, but LenB("ABC") may
return 3 or 6, depending on how many bytes are used to represent a
character.
AGSCalabrese wrote:
>> I'm curious, what does the discussion 'in abstract' offer that is
>> absent
>> from a specific language's string operation library?
>
> My students freak when exposed to actual programming language variances.
>
> On May 4, 2009, at 2:18 PM, Vitaliy wrote:
>
> AGSCalabrese wrote:
>>> I'm curious, what does the discussion 'in abstract' offer that is
>>> absent
>>> from a specific language's string operation library?
>>
>> My students freak when exposed to actual programming language
>> variances.
>
> Are your students majoring in horticulture?
>
I used to teach skiing two different ways.
1) Take the athletic beginner to the top of a black diamond and tell
them to follow me.
2) Discuss the techniques of skiing, see some videos, put on very
short skis, and go to
the bunny hill or even better pull them around with a snowmobile.
Then go get a drink.
Gus
> My students freak when exposed to actual programming language variances.
>
>
Presumablly they are going to have to learn them sooner or later.
My suggestion would be to start with a language where strings are a
built in type with sensible behaviour (e.g. basic or borland style
pascal). Then when they are more confident you can move onto languages
where the programmer has to do more (java, C etc).
Alan B. Pearce wrote:
>> My students freak when exposed to actual programming language variances.
>
> If they are going to get involved with computers, then they better get used
> to the variances ...
Maybe they're only 7 year-olds.
Or maybe they're cats and he's teaching them how to unlock a very
sophisticated cat door.
Or maybe it's his SO and not a CS student.
Maybe it's for students of haiku, or he's trying to communicate with Klaatu.
Most likely they are liberal arts students or a VocEd mix and he's
trying to make it possible for all of them to understand.
And if it's community college, you want to maintain class size, not thin
the herd.
> > I'm not sure how useful strings outside of programming are...
>
> As a result of this thread:
>
> My 8 year old son walks up and asks "What are you watching?"
>
> "I am watching a lecture on how computers manipulate strings. Do you
> know what a string is?"
>
> "Sure," he replies, "it's a piece of rope!"
He might turn into a physicist, lots of room for strings there.
Still, that gives me an idea. Gus can cut out letters from cardboard, make
hooks from paper clips and hang them on the string, shuffling them about to
represent different algorithms. A hook with nothing on it can represent
Null, should the need to describe AsciiZ come up.
> >> My students freak when exposed to actual programming language
variances.
> >
> > If they are going to get involved with computers, then they better get
used
> > to the variances ...
>
> Maybe they're only 7 year-olds.
>
> Or maybe they're cats and he's teaching them how to unlock a very
> sophisticated cat door.
>
> Or maybe it's his SO and not a CS student.
>
> Maybe it's for students of haiku, or he's trying to communicate with
Klaatu.
D. Daniel McGlothin wrote:
>> I'm not sure how useful strings outside of programming are...
>
> As a result of this thread:
>
> My 8 year old son walks up and asks "What are you watching?"
>
> "I am watching a lecture on how computers manipulate strings. Do you
> know what a string is?"
>
> "Sure," he replies, "it's a piece of rope!"
> > And if it's community college, you want to maintain class size, not thin
> > the herd.
>
> Why?
>
> There's either a standard education level to maintain, or there isn't.
Nate Duehr wrote:
>> And if it's community college, you want to maintain class size, not thin
>> the herd.
>
> Why?
>
> There's either a standard education level to maintain, or there isn't.
There isn't. At least not anywhere I've taught. Ask any teacher who
tries to maintain standards, you fail too many, or the wrong students,
and you get pressure from above. And then, of course, there are teachers
that need to maintain a minimum number of students for a class to
continue, and will do just that.
But I didn't mean to turn this into an analysis of any particular
education system, it is not particularly more screwed up or corrupt than
anything else.
> Still, that gives me an idea. Gus can cut out letters from cardboard,
> make hooks from paper clips and hang them on the string, shuffling them
> about to represent different algorithms. A hook with nothing on it can
> represent Null, should the need to describe AsciiZ come up.
That's a really cute, usefull idea. Instead of string to hold the
characters/paperclips, I'd use a piece of light chain or cardboard
strip with holes punched at regular intervals. That might make it
cleared that each character has to be at a discrete location.
> -----Original Message-----
> From: .....piclist-bouncesKILLspam.....mit.edu [EraseMEpiclist-bouncesspam_OUTTakeThisOuTmit.edu] On
Behalf
> Of Lee Jones
> Sent: 05 May 2009 10:40
> To: piclistspam_OUTmit.edu
> Subject: RE: [OT] tutorial on ASCII strings
>
> > Still, that gives me an idea. Gus can cut out letters from
cardboard,
> > make hooks from paper clips and hang them on the string, shuffling
them
> > about to represent different algorithms. A hook with nothing on it
can
> > represent Null, should the need to describe AsciiZ come up.
>
> That's a really cute, usefull idea. Instead of string to hold the
> characters/paperclips, I'd use a piece of light chain or cardboard
> strip with holes punched at regular intervals. That might make it
> cleared that each character has to be at a discrete location.
>
> Thanks for the idea.
strcat = knot/sellotape
strtok = scissors
:D
Mike
=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================