-general@lists.php.net
Subject: RE: [PHP] while-question
Dabbling?
I think that making a living from it isn't dabbling, so I may not be
qualified to speak for the dabblers.
But for me, I was writing code before there were such courses. Later,
when I went to college I was taught
bruce wrote:
interesting points regarding college and programming..
my degrees bsee/msee covered alot more than pure programing.. as a double
ee/cs, the ability to articulate an issue/problem, and bring to mind a cogent
thought process was valuable. the ability to understand how different
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 18:01 -0500, Craige Leeder wrote:
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
Only thing to note with the foreach is that you are actually working on
a copy of the array, so if you intend to modify it, pass it
tedd wrote:
At 7:02 PM -0500 11/17/08, Craige Leeder wrote:
I'm not illiterate; promise :p
- Craige
Yeah, his parents were married before he was born.
Cheers,
tedd
omg tedd, I was just reading this thread over, thought exactly that
witty response, clicked you're reply and there it is;
Jochem Maas wrote:
just for laughs .. given the 'dabble' thread Cleeder is phonetically
very very close to a dutch word meaning 'messing around' .. rather in the way
a 2yo might mess around with a bowl of yogurt.
Haha, now that does make me laugh. Out of curiosity, what is the actual
word
Craige Leeder schreef:
Jochem Maas wrote:
just for laughs .. given the 'dabble' thread Cleeder is phonetically
very very close to a dutch word meaning 'messing around' .. rather in
the way
a 2yo might mess around with a bowl of yogurt.
Haha, now that does make me laugh. Out of curiosity,
Jochem Maas wrote:
klieder ... kliederen
the E sound is short.
Interesting to know. Thanks :D
- Craige
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Craige Leeder wrote:
Jochem Maas wrote:
klieder ... kliederen
the E sound is short.
Interesting to know. Thanks :D
- Craige
don't believe him, jochem is really called Bob Davis, a slightly
balding middle aged ASP developer from hull sent to infiltrate the PHP
community and misguide
On Tue, Nov 18, 2008 at 9:33 AM, Nathan Rixham [EMAIL PROTECTED] wrote:
Craige Leeder wrote:
Jochem Maas wrote:
klieder ... kliederen
the E sound is short.
Interesting to know. Thanks :D
- Craige
don't believe him, jochem is really called Bob Davis, a slightly balding
middle aged
On Tue, 2008-11-18 at 14:33 +, Nathan Rixham wrote:
Craige Leeder wrote:
Jochem Maas wrote:
klieder ... kliederen
the E sound is short.
Interesting to know. Thanks :D
- Craige
don't believe him, jochem is really called Bob Davis, a slightly
balding middle aged ASP
On Tue, 2008-11-18 at 10:52 +, Nathan Rixham wrote:
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 18:01 -0500, Craige Leeder wrote:
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
Only thing to note with the foreach is that you are actually working
Hi,
i'm on PHP training and our lector is telling us that to avoid counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this is an infinity loop...
it should be always something like
$count = count($my_array);
On 17 Nov 2008, at 13:01, Alain Roger wrote:
i'm on PHP training and our lector is telling us that to avoid
counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this is an infinity loop...
it should be always
Hi,
i'm on PHP training and our lector is telling us that to avoid counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this is an infinity loop...
it should be always something like
$count = count($my_array);
[snip]
...foreach...
[/snip]
You could also use a for loop if you wanted to count;
for($i = 0; $i count($array); $i++){
echo $i . \n;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
...but for best performance you should do:
$counter = count($array);
for($i = 0; $i $counter; $i++){
echo $i . \n;
}
So the expression count() in the for()-loop is only
parsed once and not every loop.
Regards
Timo
[snip]
...foreach...
[/snip]
You could also use a for loop if you wanted
Timo Erbach schreef:
...but for best performance you should do:
$counter = count($array);
for($i = 0; $i $counter; $i++){
echo $i . \n;
}
just for fun:
$a = range(1,10);
for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++);
... gives an idea of the power and flexibility of a
Jochem Maas wrote:
$a = range(1,10);
for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++);
think the point of this is to count the items in an array without count
mate :p no point in the above you could just:
$c = count($a);
foreach!
$a = range(1,10);
$c = 0;
foreach($a as $b) {
Nathan Rixham schreef:
Jochem Maas wrote:
$a = range(1,10);
for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++);
think the point of this is to count the items in an array without count
mate :p no point in the above you could just:
$c = count($a);
I thought the point was to avoid
On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
if you really want a challenge try this one..
task: add the numbers 5 and 17 together, using php, without using
the + operator. fill it in:
function add($a , $b) {
//code here but no + - / * operators
return $answer;
}
echo add(5, 17);
On Mon, Nov 17, 2008 at 9:47 AM, Jochem Maas [EMAIL PROTECTED] wrote:
Nathan Rixham schreef:
Jochem Maas wrote:
$a = range(1,10);
for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++);
think the point of this is to count the items in an array without count
mate :p no point in the
Stut wrote:
On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
if you really want a challenge try this one..
task: add the numbers 5 and 17 together, using php, without using the
+ operator. fill it in:
function add($a , $b) {
//code here but no + - / * operators
return $answer;
}
echo add(5,
On Mon, 2008-11-17 at 14:54 +, Stut wrote:
On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
if you really want a challenge try this one..
task: add the numbers 5 and 17 together, using php, without using
the + operator. fill it in:
function add($a , $b) {
//code here but no + -
... ?
-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 9:53 AM
To: Stut
Cc: Nathan Rixham; php-general@lists.php.net
Subject: Re: [PHP] while-question
On Mon, 2008-11-17 at 14:54 +, Stut wrote:
On 17 Nov 2008, at 14:31, Nathan Rixham wrote
Robert Cummings schreef:
On Mon, 2008-11-17 at 14:54 +, Stut wrote:
On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
if you really want a challenge try this one..
task: add the numbers 5 and 17 together, using php, without using
the + operator. fill it in:
function add($a , $b) {
On Mon, 2008-11-17 at 10:00 -0800, bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've
On Mon, 2008-11-17 at 19:07 +0100, Jochem Maas wrote:
Robert Cummings schreef:
On Mon, 2008-11-17 at 14:54 +, Stut wrote:
On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
if you really want a challenge try this one..
task: add the numbers 5 and 17 together, using php, without using
bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've grabbed the tools and
started
At 10:00 AM -0800 11/17/08, bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've grabbed the
Dabbling?
I think that making a living from it isn't dabbling, so I may not be
qualified to speak for the dabblers.
But for me, I was writing code before there were such courses. Later,
when I went to college I was taught adventures in keypunching and
received several next to
At 2:55 PM -0500 11/17/08, Wolf wrote:
Tedd, glad you got hooked on Phonics. One of these days I hope from
graduating from just looking at the pictures, but right now the
pictures are oh so enticing!. ;)
Wolf
Wolf:
Lot's of exciting things -- hard to keep up on bots, automated
buying,
Alain Roger wrote:
Hi,
i'm on PHP training and our lector is telling us that to avoid counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this is an infinity loop...
it should be always something like
$count =
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
Alain Roger wrote:
Hi,
i'm on PHP training and our lector is telling us that to avoid counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
Only thing to note with the foreach is that you are actually working on
a copy of the array, so if you intend to modify it, pass it by reference.
- Craige
Can you do that? I assume it would look like this:
On Mon, 2008-11-17 at 18:01 -0500, Craige Leeder wrote:
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
Only thing to note with the foreach is that you are actually working on
a copy of the array, so if you intend to modify it, pass it by reference.
bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've grabbed the tools and
started
Craige Leeder schreef:
bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've grabbed the
tedd schreef:
At 10:00 AM -0800 11/17/08, bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people
Jochem Maas wrote:
must . resist
I take you didn't score to hig on the spelling test? and collage,
is that the the cut-n-paste school of IT?
dang it, failed. ;-)
Haha! 'high' was just my 'h' key not pressing, and college is just one
of those words I have trouble with.
Craige Leeder schreef:
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
Only thing to note with the foreach is that you are actually working
on a copy of the array, so if you intend to modify it, pass it by
reference.
- Craige
Can you do that? I
At 12:52 AM +0100 11/18/08, Jochem Maas wrote:
Craige Leeder schreef:
I'm 100% self taught for now. I'm just out of higschool, and hopefully
going off to collage next year.
must . resist
I take you didn't score to hig on the spelling test? and collage,
is that the the
At 7:02 PM -0500 11/17/08, Craige Leeder wrote:
I'm not illiterate; promise :p
- Craige
Yeah, his parents were married before he was born.
Cheers,
tedd
--
---
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To
Jay Blanchard wrote:
[snip]
...foreach...
[/snip]
You could also use a for loop if you wanted to count;
for($i = 0; $i count($array); $i++){
echo $i . \n;
}
This is not good because you are calling count every loop iteration.
Thank you,
Micah Gersten
onShore Networks
Internal
tedd schreef:
At 12:52 AM +0100 11/18/08, Jochem Maas wrote:
Craige Leeder schreef:
I'm 100% self taught for now. I'm just out of higschool, and hopefully
going off to collage next year.
must . resist
I take you didn't score to hig on the spelling test? and collage,
is that
Craige Leeder schreef:
Jochem Maas wrote:
must . resist
I take you didn't score to hig on the spelling test? and collage,
is that the the cut-n-paste school of IT?
dang it, failed. ;-)
Haha! 'high' was just my 'h' key not pressing, and college is just one
of those
45 matches
Mail list logo