Searching \ for '[OT] tutorial on ASCII strings' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=tutorial+ascii+strings
Search entire site for: 'tutorial on ASCII strings'.

Exact match. Not showing close matches.
PICList Thread
'[OT] tutorial on ASCII strings'
2009\05\03@134916 by AGSCalabrese

picon face
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

2009\05\03@141224 by Mike Harrison

flavicon
face
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.

2009\05\03@151745 by AGSCalabrese

picon face
>
> 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

2009\05\03@181125 by Neil Cherry

flavicon
face
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.

--
Linux Home Automation         Neil Cherry       spam_OUTncherryTakeThisOuTspamlinuxha.com
http://www.linuxha.com/                         Main site
http://linuxha.blogspot.com/                    My HA Blog
Author of:            Linux Smart Homes For Dummies

2009\05\03@182440 by Steve Willoughby

flavicon
face
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.

2009\05\03@183909 by AGSCalabrese

picon face

> 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

2009\05\03@184545 by D. Daniel McGlothin

flavicon
face
AGSCalabrese wrote:
{Quote hidden}

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

2009\05\03@185104 by Steve Willoughby
flavicon
face
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.

2009\05\03@192830 by William \Chops\ Westfield

face picon face

On May 3, 2009, at 3:39 PM, 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 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:

http://en.wikipedia.org/wiki/String_functions_(programming)

BillW

2009\05\03@200436 by AGSCalabrese

picon face
{Quote hidden}

My students freak when exposed to actual programming language variances.
Gus

2009\05\03@201531 by AGSCalabrese

picon face

> 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}

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}

2009\05\04@101955 by John Ferrell

face
flavicon
face
I think you are making things too complicated.

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

{Original Message removed}

2009\05\04@161337 by Tony Smith

flavicon
face
> >> 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.

Tony

2009\05\04@161945 by Vitaliy

flavicon
face
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?


2009\05\04@163623 by AGSCalabrese

picon face
>
> 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

2009\05\04@171558 by peter green

flavicon
face

> 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).

2009\05\04@172457 by D. Daniel McGlothin

flavicon
face
> 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!"

grinning,
Daniel

2009\05\04@180320 by Alan B. Pearce

face picon face
>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 ...

2009\05\04@182038 by Bob Blick

face
flavicon
face
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.

Cheerful regards,

Bob




2009\05\04@185744 by Tony Smith

flavicon
face
> > 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.

Tony

2009\05\04@185756 by Tony Smith

flavicon
face
> >> 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.


Maybe they're all called Cedric.

Maybe Michael.

Maybe it's something (someone?) else?

Tony

2009\05\04@190540 by Nate Duehr

face
flavicon
face

> 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
--
 Nate Duehr
 .....nateKILLspamspam@spam@natetech.com

2009\05\04@191736 by Neil Cherry

flavicon
face
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!"

Now there's a smart kid! :-)

--
Linux Home Automation         Neil Cherry       ncherryspamKILLspamlinuxha.com
http://www.linuxha.com/                         Main site
http://linuxha.blogspot.com/                    My HA Blog
Author of:            Linux Smart Homes For Dummies

2009\05\04@192504 by Tony Smith

flavicon
face
> > 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.


Everybody gets a certificate for participation.

Tony

2009\05\04@192959 by Bob Blick

face
flavicon
face
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.

Cheerful regards,

Bob

2009\05\05@053634 by Lee Jones

flavicon
face
> 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.

                                               Lee Jones

2009\05\05@134312 by Michael Rigby-Jones

flavicon
face


> -----Original Message-----
> From: .....piclist-bouncesKILLspamspam.....mit.edu [EraseMEpiclist-bouncesspam_OUTspamTakeThisOuTmit.edu] On
Behalf
> Of Lee Jones
> Sent: 05 May 2009 10:40
> To: piclistspamspam_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.
=======================================================================

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...