AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Class instantiation puzzle
Goto page 1, 2, 3 ... 10, 11, 12  Next
 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Language Programming
View previous topic :: View next topic  
Author Message
Ike
Guest





PostPosted: Fri Jun 27, 2003 11:02 am    Post subject: Re: Class instantiation puzzle Reply with quote



Thank you...just what I wanted to do. For some reason, I was trying to do it
via interfaces! -Ike


Back to top
Ingo R. Homann
Guest





PostPosted: Mon Feb 13, 2006 9:12 am    Post subject: Re: analytical Skill for Java Development Reply with quote



Hi SR,

Stefan Ram wrote:
Quote:
http://www.heise.de/newsticker/meldung/print/37449

In short: People want mobile phones which are easy to use. Who had
suspected that? ;-)

Quote:
Alan Kay was teaching five-year old children how to
program a circle: They were asked to walk in a circle
and to report what they did. The children would answer
"walk a little and turn a little." After that cognition
they could write a program to draw a circle.

Ten-year old children already knew what a circle is:
"The set of all point, having the same distance to a
center." So they startet to program individual points
starting at a center, which was more complicated; and
the result was non a connected circle but only single
dots.

Fifteen-year old children already knew the formula »r² = x² + y²«.
They tried to draw a circle using that formula, but
failed. (This formula is not a good starting point for such a
program.) Just because of their additional knowledge, it was
actually more difficult or impossible for them to write such a
program. At least that is what Alan Kay said in a video.

UNQUOTE

Comment This illustrates my concept of »stuckness«:
The fifteen-year old children where stuck with the
formula and thus where not able to find the solutions
of the younger children.

Yes, but how did the program and the circle of the five-year-old
children look like? (e.g. did they really ended where they started?)

I think, the problem here is another: Writing a program (even if it only
should draw a circle) is much more complicated than everybody thinks.
So, if I understand you correctly, *none* of the childs succeeded.

By the way: I do not understand how the ten-year-olds could program a
circle without knowing Phythagoras' formula. Did they use sin and cos?

Ciao,
Ingo
Back to top
Stefan Ram
Guest





PostPosted: Mon Feb 13, 2006 10:12 am    Post subject: Re: analytical Skill for Java Development Reply with quote



"Ingo R. Homann" <ihomann_spam (AT) web (DOT) de> writes:
Quote:
Yes, but how did the program and the circle of the five-year-old
children look like? (e.g. did they really ended where they started?) (...)
By the way: I do not understand how the ten-year-olds could program a
circle without knowing Phythagoras' formula. Did they use sin and cos?

Unfortunately, I do not know more about the story than what I
already wrote down.

From a mathematical point of view, one can draw a circle by
applying the »infinitesimal generator of rotations around (0,0)«
infinitely many times to the point (1,0). This can be approximated
by applying a very small generator very many times. The
generator would be just a simple matrix. Let me try ...

public class Main
{ public static void main( final java.lang.String[] args )
{ char[][] screen = new char[24][78];
for( int i = 0; i < 24; ++i )for( int j = 0; j < 78; ++j )
screen[ i ][ j ]= ' ';
double x = 1; double y = 0;
for( int i = 0; i < 1000000; ++i )
{ screen[( int )( y * 10 + 10 )][( int )( x * 20 + 38 )]= '*';
x = x - 1E-5 * y; y = y + 1E-5 * x; } // <-- generator
for( int i = 0; i < 24; ++i )
{ for( int j = 0; j < 78; ++j )
java.lang.System.out.print( screen[ i ][ j ] );
java.lang.System.out.println(); }}}

******************
***** ****
*** ***
** **
** **
** **
** **
* *
* *
** *
* **
* *
* *
** **
** **
*** **
** ***
**** ***
**** *****
******************
*
Back to top
Stefan Ram
Guest





PostPosted: Mon Feb 13, 2006 10:12 am    Post subject: Re: analytical Skill for Java Development Reply with quote

ram (AT) zedat (DOT) fu-berlin.de (Stefan Ram) writes:
Quote:
x = x - 1E-5 * y; y = y + 1E-5 * x; } // <-- generator

One can also show, that the infinitesimal generator
does not change the distance to the origin:

dist = sqrt(( x - e y )² +( y + e x )² )
= sqrt( x² - 2 x e y + e² y² + y² + 2 y e x + e² x² )
= sqrt( x² - 2 x e y + y² + 2 y e x )
= sqrt( x² + y² )

I have dropped higher-order terms (terms with e²).
Back to top
Stefan Ram
Guest





PostPosted: Mon Feb 13, 2006 11:12 am    Post subject: Re: analytical Skill for Java Development Reply with quote

"Ingo R. Homann" <ihomann_spam (AT) web (DOT) de> writes:
Quote:
What I want to say is, that I have the impression that this was
a story that was retelled very often and somehow was seen as a
"proof" for the idea that small children are better in doing
some things than older children (what I think, is just
generally not true) - some kind of urban legend.

At least I can offer some confirmation, that learning can
reduce capabilities in some situations.

Sorry, I have only quotations in German. Summarized, these are
reports, where people with more knowledge perform poorer than
people with less knowledge under some circumstances.

"Mehr Grundwissen schränkt die Fähigkeit ein, sich Details
zu merken (...) Aus diesem Grund behalten Kinder
beispielsweise viel mehr Einzelheiten eines Bildes im
Gedächtnis als Erwachsene, die das Gesehene eher in
Kategorien und Rubriken einordnen. (...) Die jüngsten
Kinder schnitten beim Wiedererkennen der Tiere am besten
ab, zeigte die Auswertung. Je älter die Probanden wurden,
desto weniger Tiere erkannten sie sicher wieder. Die
Erwachsenen schließlich hatten sehr große Probleme,
überhaupt eines der Tiere zu identifizieren. Dieser
Unterschied sei damit zu erklären, daß die Kinder noch
nicht gelernt haben, die gesehenen Tiere in Kategorien
einzuordnen, erklären die Forscher. (...) Entscheidend für
die überlegene Gedächtnisleistung der Kinder ist dabei
nach Ansicht der Forscher das fehlende Vorwissen. Diese
Annahme bestätigte sich in einem weiteren Test"

http://www.wissenschaft.de/wissen/news/drucken/253282.html

"Manchmal ist es unser Wissen, das uns den Verstand
vernebelt, wie Gerd Gigerenzer, Direktor am
Max-Planck-Institut für Bildungsforschung in Berlin,
entdeckte. ,Welche Stadt hat mehr Einwohner - San Diego
oder San Antonio ?' Konfrontierte der Kognitionspsychologe
amerikanischen Studenten mit dieser Frage, wußten zwei
Drittel die Lösung: San Diego. Und wie viele deutsche
Studenten, die nie von San Antonio gehört hatten, kannten
die korrekte Antwort? Ganz genau, alle. Die deutschen
Studenten versagten erst, wenn Gigerenzer ihnen das
Problem mit zwei deutschen Städten vorlegte: Hannover und
Bielefeld. Plötzlich waren sie verunsichert, wußten nicht,
was sie wählen sollten. Nun glänzten die Amerikaner: Da
sie noch nie von Bielefeld gehört hatten, tippten sie auf
Hannover. Ihr Instinkt sagte ihnen: Nimm einfach das, was
du kennst - und traf den Nagel auf den Kopf."

http://archiv.tagesspiegel.de/archiv/17.06.2005/1882598.asp

"Die Wissenschaftler baten 43 Finanzprofis sowie 56
blutige Börsenlaien, die Kursentwicklung einiger Aktien
vorherzusagen. Das verblüffende Resultat: Die Amateure
gaben bessere Tips ab als die Analysten. Nur in einem
Punkt waren die Profis den Laien überlegen - was ihre
Überheblichkeit betraf. ,Der Nutzen von Erfahrung und
Wissen, über den die Experten ja angeblich verfügen, wird
offensichtlich überschätzt,' lautet das Fazit der
Forscher."

http://archiv.tagesspiegel.de/archiv/17.06.2005/1882598.asp
Back to top
Ingo R. Homann
Guest





PostPosted: Mon Feb 13, 2006 11:12 am    Post subject: Re: analytical Skill for Java Development Reply with quote

Hi,

Stefan Ram wrote:
Quote:
What I want to say is, that I have the impression that this was
a story that was retelled very often and somehow was seen as a
"proof" for the idea that small children are better in doing
some things than older children (what I think, is just
generally not true) - some kind of urban legend.

At least I can offer some confirmation, that learning can
reduce capabilities in some situations.

Sorry, I did not want to say that this is generally (*always*) wrong. I
wanted to say, that it is "generally" (in *most* situatuations, "im
Allgemeinen") wrong. (I must admit that even in German I would not be
sure how to use the word 'generell' correctly.)

Esepcially, in analytical questions, this is IMHO mostly wrong. In
questions where you need plain "memory", it may be right.

Quote:
"Mehr Grundwissen schränkt die Fähigkeit ein, sich Details
zu merken (...) Aus diesem Grund behalten Kinder
beispielsweise viel mehr Einzelheiten eines Bildes im
Gedächtnis als Erwachsene, die das Gesehene eher in
Kategorien und Rubriken einordnen. (...) Die jüngsten
Kinder schnitten beim Wiedererkennen der Tiere am besten
ab, zeigte die Auswertung. Je älter die Probanden wurden,
desto weniger Tiere erkannten sie sicher wieder. Die
Erwachsenen schließlich hatten sehr große Probleme,
überhaupt eines der Tiere zu identifizieren. Dieser
Unterschied sei damit zu erklären, daß die Kinder noch
nicht gelernt haben, die gesehenen Tiere in Kategorien
einzuordnen, erklären die Forscher. (...) Entscheidend für
die überlegene Gedächtnisleistung der Kinder ist dabei
nach Ansicht der Forscher das fehlende Vorwissen. Diese
Annahme bestätigte sich in einem weiteren Test"

The question here is, how the word "better" is defined (this should be
easy, but obviously it isn't). The experiment uses a quality-measure
wich only measures a small proportion (and perhaps an unimportant) of
the complete task.

Quote:
"Manchmal ist es unser Wissen, das uns den Verstand
vernebelt, wie Gerd Gigerenzer, Direktor am
Max-Planck-Institut für Bildungsforschung in Berlin,
entdeckte. ,Welche Stadt hat mehr Einwohner - San Diego
oder San Antonio ?' Konfrontierte der Kognitionspsychologe
amerikanischen Studenten mit dieser Frage, wußten zwei
Drittel die Lösung: San Diego. Und wie viele deutsche
Studenten, die nie von San Antonio gehört hatten, kannten
die korrekte Antwort? Ganz genau, alle. Die deutschen
Studenten versagten erst, wenn Gigerenzer ihnen das
Problem mit zwei deutschen Städten vorlegte: Hannover und
Bielefeld. Plötzlich waren sie verunsichert, wußten nicht,
was sie wählen sollten. Nun glänzten die Amerikaner: Da
sie noch nie von Bielefeld gehört hatten, tippten sie auf
Hannover. Ihr Instinkt sagte ihnen: Nimm einfach das, was
du kennst - und traf den Nagel auf den Kopf."

Grmph - especially "Bielefeld"... you want to tease me, Stefan, do you!?

No really, that is in indeed an interesting result.

But on the other hand, this also may not work at all: The size of a city
does not always reflect it's "importance" or it's publicity. If you ask
the question with cities like "Bielefeld" (which nobody knows) and
"Güterloh" (which is much smaller but where Bertelsman comes from) or
with "Bielefeld" and "Pisa", the opposite is true.

But you are right, in *most* cases, the heuristic is correct.

Quote:
"Die Wissenschaftler baten 43 Finanzprofis sowie 56
blutige Börsenlaien, die Kursentwicklung einiger Aktien
vorherzusagen. Das verblüffende Resultat: Die Amateure
gaben bessere Tips ab als die Analysten. Nur in einem
Punkt waren die Profis den Laien überlegen - was ihre
Überheblichkeit betraf. ,Der Nutzen von Erfahrung und
Wissen, über den die Experten ja angeblich verfügen, wird
offensichtlich überschätzt,' lautet das Fazit der
Forscher."

Yes, I read this as well, and it is *really* shocking: What do the
analysts do the whole day?

Ciao,
Ingo
Back to top
Ingo R. Homann
Guest





PostPosted: Mon Feb 13, 2006 11:12 am    Post subject: Re: analytical Skill for Java Development Reply with quote

Hi Stefan,

Stefan Ram wrote:
Quote:
Yes, but how did the program and the circle of the five-year-old
children look like? (e.g. did they really ended where they started?) (...)
By the way: I do not understand how the ten-year-olds could program a
circle without knowing Phythagoras' formula. Did they use sin and cos?

Unfortunately, I do not know more about the story than what I
already wrote down.

From a mathematical point of view, one can draw a circle by
applying the »infinitesimal generator of rotations around (0,0)«

Wow, the 10 year olds were able to do this? ;-)

What I want to say is, that I have the impression that this was a story
that was retelled very often and somehow was seen as a "proof" for the
idea that small children are better in doing some things than older
children (what I think, is just generally not true) - some kind of urban
legend.

The more I think about it, the more I have the impression that I am
right. The only thing, the story tells us is the following (which also
is not a new insight): First, you think, you know everything about a
certain topic. But the more you learn, the more you realize that you do
not really know everything about that topic. But that does not mean that
you were wiser before step 2!

Ciao,
Ingo
Back to top
Nigel Wade
Guest





PostPosted: Mon Feb 13, 2006 12:12 pm    Post subject: Re: JAVA MAIL Reply with quote

Alun Harford wrote:

Quote:
"cipher" <matrix0 (AT) gmail (DOT) com> wrote in message
news:1139571545.826140.282880 (AT) z14g2000cwz (DOT) googlegroups.com...
then can you please tell me how to receive mails through SMTP.
I have a mail server that supports only SMTP, and i want to access and
read my mails through the JAVAMAIL API, how can i do this?

You can only send mail with SMTP.
You cannot recieve mail SMTP.


SMTP is used to both send and receive e-mail. If you are sending mail to another
SMTP process, it is receiving it. If you want to receive email you normally use
an SMTP process to do so.

You cannot, however, read your email using SMTP. For JavaMail you need an IMAP
or POP server which has access to the mailbox in which the SMTP process stores
the mail.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw (AT) ion (DOT) le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
Back to top
Ingo R. Homann
Guest





PostPosted: Mon Feb 13, 2006 2:12 pm    Post subject: Re: analytical Skill for Java Development Reply with quote

Hi,

Chris Uppal wrote:
Quote:
What I want to say is, that I have the impression that this was a story
that was retelled very often and somehow was seen as a "proof" for the
idea that small children are better in doing some things than older
children (what I think, is just generally not true) - some kind of urban
legend.

More likely (especially knowing something about Kay's attitudes) the point it
was intended to illustrate (not prove) is that increased knowledge can tie you
into a particular approach or worldview, and that that worldview is not either
necessarily optimal, nor easy to get out of once you are in it.

Compare concepts like "files", "processes", "functions" (sub-routines, methods,
whatever you want to call them), etc in today's programming world. Very
difficult to untangle ones' thinking about programming from these inessential
minutia of what may ultimately prove to be a sub-optimal dead-end approach.

On the one hand I agree to what you say: You are right that coming from
"C++"/"Java", I think about "methods" in a certain way - maybe
completely different than someone who comes from "Smalltalk".

On the other hand, I think, it is nearly impossible to talk and discuss
about something *without* the necessary background knowledge, e.g. it is
impossible to talk about "methods" (or more complicated issues like
"inheritance") to a 10-year-old child that *never* has programmed in
*any* language.

But what I *really* wanted to say with my last posts was, that the story
with the children drwaing circles does not really illustrate *any* of
these points.

Ciao,
Ingo
Back to top
Ingo R. Homann
Guest





PostPosted: Mon Feb 13, 2006 2:12 pm    Post subject: Re: analytical Skill for Java Development Reply with quote

Hi,

Chris Uppal wrote:
Quote:
As for how the 5yo-s managed it using only "go forward a bit, turn a bit",
almost certainly they were using a turtle-graphics system, in which case they
could just fiddle with the "parameters" until they found a combination that
worked to their satisfaction.

Although the "turtle-graphics-systems" may be very easy, I do not know
any 5-year-old who is able to do what you are saying.

And, if you help the 5-year-old by formalizing what he somehow may
'fell' or 'guess', then you must help the 10-year-old and the
15-year-old childs as well - otherwise your comparison is not fair.

What brings me back to my first point: I think this is an urban legend
that was intentionally (not by Stefan, but by Alan Key) used to
illustrate a certain idea.

Ciao,
Ingo
Back to top
Chris Uppal
Guest





PostPosted: Mon Feb 13, 2006 2:12 pm    Post subject: Re: analytical Skill for Java Development Reply with quote

Ingo R. Homann wrote:

Quote:
By the way: I do not understand how the ten-year-olds could program a
circle without knowing Phythagoras' formula. Did they use sin and cos?

Probably there was a distance-between-points function in the library they were
using. Then they could use (the equivalent of):

for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
if (dist(origin, (x,y)) == radius)
plotAt(x, y)

which would yield the disconnected points that Stefan's quote describes.
Depending on how the graphics system they were using was set up, that could
easily have been a loop-free one-liner. In fact I'd assume it was such a
one-liner since I can't imagine Alan Kay wasting his own time, let alone being
stupid enough to expect the kids to waste their time, with a system that wasn't
transparently expressive.

As for how the 5yo-s managed it using only "go forward a bit, turn a bit",
almost certainly they were using a turtle-graphics system, in which case they
could just fiddle with the "parameters" until they found a combination that
worked to their satisfaction.

-- chris
Back to top
Chris Uppal
Guest





PostPosted: Mon Feb 13, 2006 2:12 pm    Post subject: Re: analytical Skill for Java Development Reply with quote

Ingo R. Homann wrote:

Quote:
What I want to say is, that I have the impression that this was a story
that was retelled very often and somehow was seen as a "proof" for the
idea that small children are better in doing some things than older
children (what I think, is just generally not true) - some kind of urban
legend.

More likely (especially knowing something about Kay's attitudes) the point it
was intended to illustrate (not prove) is that increased knowledge can tie you
into a particular approach or worldview, and that that worldview is not either
necessarily optimal, nor easy to get out of once you are in it.

Compare concepts like "files", "processes", "functions" (sub-routines, methods,
whatever you want to call them), etc in today's programming world. Very
difficult to untangle ones' thinking about programming from these inessential
minutia of what may ultimately prove to be a sub-optimal dead-end approach.

-- chris
Back to top
Oliver Wong
Guest





PostPosted: Mon Feb 13, 2006 3:12 pm    Post subject: Re: analytical Skill for Java Development Reply with quote

"Patricia Shanahan" <pats (AT) acm (DOT) org> wrote in message
news:lqaHf.412$UN.394 (AT) newsread2 (DOT) news.pas.earthlink.net...
Quote:
Damn!

And here I was, thinking I had a 14-drop solution the whole time. Oh
well, back to the drawing board.

- Oliver

I think your solution concept is correct, even if the details need to be
reworked. You broke the pattern you seemed to be following when you used
76 rather than 77 (69+8, where the previous increment was 9).

How about 14, 27, 39, 50, 60, 69, 77, 84, 90, 95, 99, 100?

Yes, my intention was to keep the pattern until the
before-last-worst-case-drop-of-the-first-ball (99 in your example), which
could be dropped a few floors lower, essentially splitting the last segment
in half. E.g. my series would have ended something like 90, 95, 97.

The idea is that this pattern seems optimal except when nearing the end,
where something like binary search works better. However, after playing
around, it really looks like 14 is the best one can do, so I've sort of
stopped thinking about this problem now.

- Oliver
Back to top
Roedy Green
Guest





PostPosted: Mon Feb 13, 2006 3:12 pm    Post subject: Re: JAVA MAIL Reply with quote

On Mon, 13 Feb 2006 12:02:08 +0000, Nigel Wade <nmw (AT) ion (DOT) le.ac.uk>
wrote, quoted or indirectly quoted someone who said :

Quote:
If you want to receive email you normally use
an SMTP process to do so.

It might be clearer to say that as:
"If you want to receive email from the outside world to forward to
your clients in your role as an email server, you normally use
an SMTP process to do so."
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Back to top
Ingo R. Homann
Guest





PostPosted: Mon Feb 13, 2006 4:12 pm    Post subject: Re: analytical Skill for Java Development Reply with quote

Hi,

Stefan Ram wrote:
Quote:
Although the "turtle-graphics-systems" may be very easy, I do not know
any 5-year-old who is able to do what you are saying.

I have tried the »walk-a-little, turn-a-little« approach:

The »walk-a-little« is the part with
x = x + ...
y = y + ...

The »turn-a-litte« is »++direction«.

Of course, for children the math would be hidden within the
turtle class (I have no time to do this right now, but you
could imagine it).

Sorry, I am not convinced, that you can explain this to a 5-year-old
child, or how you can think that a child is able to get more than a
rough idea (explained in natural language) by itself.

Ciao,
Ingo
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java Language Programming All times are GMT
Goto page 1, 2, 3 ... 10, 11, 12  Next
Page 1 of 12

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.