Re: [PHP] Re: PHP Brain Teasers

This is a discussion on Re: [PHP] Re: PHP Brain Teasers within the PHP General forums, part of the PHP Programming Forums category; $which = isset($_GET['chicken']) ? $_GET['egg'] : null; Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-05-2007
tedd
 
Posts: n/a
Default Re: [PHP] Re: PHP Brain Teasers



$which = isset($_GET['chicken']) ? $_GET['egg'] : null;

Cheers,

tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
Reply With Quote
  #2 (permalink)  
Old 07-05-2007
Kaleb Pomeroy
 
Posts: n/a
Default RE: [PHP] Re: PHP Brain Teasers

Which came first, the chicken or the egg?

-----Original Message-----
From: tedd [mailto:tedd@sperling.com]
Sent: Thursday, July 05, 2007 2:56 PM
To: php-general@lists.php.net
Subject: Re: [php] Re: PHP Brain Teasers



$which = isset($_GET['chicken']) ? $_GET['egg'] : null;

Cheers,

tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Reply With Quote
  #3 (permalink)  
Old 07-05-2007
Daniel Brown
 
Posts: n/a
Default Re: [PHP] PHP Brain Teasers

On 7/5/07, Chris Boget <chris.boget@wild.net> wrote:
> while( TRUE ) {
> $actions++;
> $words--;
> }


"Actions speak louder than words."

>
> $bets = array(1,2,3,4,5);
> unset( $bets );


"All bets are off."

>
> $arr = array( 'this', 'that', 'times' );
> $arr[] = 'behind';


"Behind the times."

>
> for( $i = 0; $i <= 6; $i++ ) {
> $deep++;
> }


"Deep Six."

>
> for( $i = 0; $i <= 5; $i++ ) {
> $flies--;
> }


"Time flies backwards?" // Not sure on this one.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
Reply With Quote
  #4 (permalink)  
Old 07-05-2007
Daniel Brown
 
Posts: n/a
Default Re: [PHP] Re: PHP Brain Teasers

On 7/5/07, Robert Cummings <robert@interjinn.com> wrote:
> On Thu, 2007-07-05 at 15:04 -0500, Kaleb Pomeroy wrote:
> > Which came first, the chicken or the egg?

>
> The egg, fish were laying them long before chickens walked the earth :)


Yeah, good point, smartass. ;-P

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
Reply With Quote
  #5 (permalink)  
Old 07-05-2007
Colin Guthrie
 
Posts: n/a
Default Re: PHP Brain Teasers

Chris Boget wrote:
> I wasn't sure if this one was done well enough; I guess it wasn't. The
> answer is 'Dropping like flies'. :p


Well you can't make it too easy... I like it :) (didn't get it but I
like it!!)
Reply With Quote
  #6 (permalink)  
Old 07-06-2007
Colin Guthrie
 
Posts: n/a
Default Re: PHP Brain Teasers

tedd wrote:
> $actions > $words


It pretty much goes without saying. So I wont. My actions say it for me
without words.

Col
Reply With Quote
  #7 (permalink)  
Old 07-06-2007
Brice
 
Posts: n/a
Default Re: [PHP] PHP Brain Teasers

On 7/6/07, tedd <tedd@sperling.com> wrote:
>
> My favorite.
>
> </world>


End of the world. Great!

Brice

> Cheers,
>
> tedd
>
>
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply With Quote
  #8 (permalink)  
Old 07-06-2007
Tijnema
 
Posts: n/a
Default Re: [PHP] Re: PHP Brain Teasers

On 7/6/07, tedd <tedd@sperling.com> wrote:
> At 11:00 PM -0400 7/5/07, Robert Cummings wrote:
> >On Thu, 2007-07-05 at 22:44 -0400, tedd wrote:
> >> At 4:48 PM -0400 7/5/07, Daniel Brown wrote:
> >> >On 7/5/07, Robert Cummings <robert@interjinn.com> wrote:
> >> >>On Thu, 2007-07-05 at 15:04 -0500, Kaleb Pomeroy wrote:
> >> >>> Which came first, the chicken or the egg?
> >> >>
> >> >>The egg, fish were laying them long before chickens walked the earth :)
> > > >
> > >
> > > But actually, it was dinosaurs.

> >
> >Ummmmm... fish predate all land creatures according to evolution....
> >that's not to say something with eggs didn't predate fish, but I'm too
> >lazy to go look.

>
>
> Yes, but I was talking about predecessors to the chicken, like
> Archeopteryx (one of the first feathered dinosaurs), which is/was (my
> education is dated) believed to be the predecessor of birds.
>
> As far as eggs are concerned, they predate fish considerably.
>
> So, IF the question is "Which came first, the chicken or the egg?" --
> then the answer is clearly "the egg".
>
> However, if the question is "Which came first, the chicken or the
> chicken's egg?" -- then the answer is much less obvious.
>
> Evolution is alteration in the genetic code usually caused by changes
> in the critter's environment. So, the question becomes, is the
> alteration of the genetic code found in the egg a random fluctuation
> of genetic code not found in the parent, or is it the product of a
> lifetime experience, under the influence of the parent's environment,
> that changed the parents genetic code in reproduction?
>
> Also, there is a difference in the genetic code you have and the code
> your pass on in terms of dominance/preference with your spouse's
> genetic code. In other words, male and female produce something
> different than either of them. However, for both to reach
> reproduction age, they both had to have "successful" genetic makeup.
> As such, their offspring has a different chance, perhaps better, of
> reaching reproduction age and passing on it's contribution.
>
> Now at what point does the offspring differ enough in genetic code to
> be classified as a chicken? That's an interesting question
> considering that it's offspring may not be a chicken (consider that).
> Pre-chickens will have to go through numerous generations before
> producing a "true" chicken in our taxonomy.
>
> I doubt that one can demarcate the non-chicken parents from the
> chicken offspring. So... it is perplexing.
>
> Cheers,
>
> tedd
>



From which point in the evolution do you call it a chicken egg? See it
like bytes, 00000000 is a fish egg, and 11111111 is a chicken egg,
then it went from fish egg to chicken egg like this:
00000001
00000011
00000111
00001111
00011111
00111111
01111111
11111111

So, at which point do you call it which egg, same with the fish and
the chicken itself. If you call the fish earlier a chicken than you
call the fish egg a chicken egg, then the chicken was first, if you
call the fish egg earlier a chicken egg than you call the fish a
chicken, then the chicken egg was first...

Tijnema
>
> >
> >But dwelling on the topic, the chicken egg problem is actually stated
> >incorrectly to some degree, it's a more interesting question to ask:
> >
> > What came first? The chicken or the chicken egg?
> >
> >Now this question is only perplexing until you realize that the concept
> >of "chicken egg" is ambiguous. Is a "chicken egg" an egg that was
> >created by a chicken, or an egg from which a chicken hatches? As such,
> >there are two possible answers to the age old question...
> >
> > Case 1: a "chicken egg" is defined by having been created
> > by a chicken.
> >
> > In this case the chicken must have come first :)
> >
> > Case 2: a "chicken egg" is defined by being an egg from
> > which a chicken hatches.
> >
> > In this case the egg comes first since the first
> > genetic chicken was born from an egg created by
> > it's direct ancestor that was not a chicken.
> >
> >See... it's not perplexing at all :)
> >
> >Cheers,
> >Rob.
> >--
> >.------------------------------------------------------------.
> >| InterJinn Application Framework - http://www.interjinn.com |
> >:------------------------------------------------------------:
> >| An application and templating framework for PHP. Boasting |
> >| a powerful, scalable system for accessing system services |
> >| such as forms, properties, sessions, and caches. InterJinn |
> >| also provides an extremely flexible architecture for |
> >| creating re-usable components quickly and easily. |
> >`------------------------------------------------------------'

>
>
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
Reply With Quote
  #9 (permalink)  
Old 07-06-2007
Daniel Brown
 
Posts: n/a
Default Re: [PHP] PHP Brain Teasers

On 7/5/07, tedd <tedd@sperling.com> wrote:
>
> My favorite.
>
> </world>


Fan-freaking-tastic! I've never seen it before (I live under a
rock), but it has so many potential uses.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107
Reply With Quote
  #10 (permalink)  
Old 07-07-2007
Tijnema
 
Posts: n/a
Default Re: [PHP] Re: PHP Brain Teasers

On 7/7/07, tedd <tedd@sperling.com> wrote:
> At 4:16 PM +0200 7/6/07, Tijnema wrote:
> >From which point in the evolution do you call it a chicken egg? See it
> >like bytes, 00000000 is a fish egg, and 11111111 is a chicken egg,
> >then it went from fish egg to chicken egg like this:
> >00000001
> >00000011
> >00000111
> >00001111
> >00011111
> >00111111
> >01111111
> >11111111
> >
> >So, at which point do you call it which egg, same with the fish and
> >the chicken itself. If you call the fish earlier a chicken than you
> >call the fish egg a chicken egg, then the chicken was first, if you
> >call the fish egg earlier a chicken egg than you call the fish a
> >chicken, then the chicken egg was first...

>
>
> Tijnema:
>
> For good grief -- you're going to hurt yourself thinking that way.
>
> The world is not made of one's and zero's but rather thresholds,
> chaotic systems, and a bunch of weird stuff we haven't figured out
> yet.


Thank god for that ;) All that computers with ones and zeros is enough :P
But, you CAN compare it with ones and zeros :)

>
> We observe phenomena, we develop algorithms and use them until they
> don't fit observations anymore and then we develop others to take
> their place. And all the while we believe that we have figured
> something out, that we know what the answer is -- but the "truth" of
> the matter is we're like children putting our tinker toys together to
> mimic the things around us. From our perspective, we're pretty good
> at it. But, I wonder what the perspective will be one thousand years
> from now? Do you think todays answers will serve tomorrow's questions?


Not tomorrow's questions ;) next year maybe...

>
> You know, I was a lot smarter when I was younger and knew better.
>
> Cheers,
>
> tedd


They all say that ;)


Tijnema

ps. This was a late night reply, ... Or I should say early morning ;)
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 12:49 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0