Go Back   SoCalTrailRiders > Local Riding > General Discussion

General Discussion For any bike discussion that doesn't belong in other forums.

Reply
 
Thread Tools
Old 05-12-2008, 02:33 PM   #21 (permalink)
Aloha Brah!
 
northshore's Avatar
 
Default

Quote:
Originally Posted by el_d00der1n0 View Post
here's the C# version. i'm concerned you'll never get out of that one...

Code:
    public class Bike
    {
        private DateTime m_modelDt;

        public DateTime ModelDate
        {
            get { return m_modelDt; }
            set { m_modelDt = value; }
        }

        public Bike(DateTime modelDt)
        {
            m_modelDt = modelDt;
        }

        public TimeSpan GetAge()
        {
            return DateTime.Now.Subtract(m_modelDt);
        }

        public static int CalculatePerfectBikeCount()
        {
            bool needMoreBikes = true;
            IList<Bike> bikes = new IList<Bike>();
            TimeSpan maxAge = new TimeSpan(730, 0, 0, 0);
            bikes.Add(new Bike(DateTime.Now));
            while (bikes.Count > 0 || needMoreBikes)
            {
                bikes.Add(new Bike(DateTime.Now));
                foreach (Bike bike in bikes)
                    if (bike.GetAge() > maxAge)
                        bikes.Remove(bike); //sell bike
            }
            return bikes.Count;
        }
    }
Dude....you are REALLY bored.....I will only code if I have to.....AHHAHHAHAHAHA
__________________
Hawaiian Island Creations
Ride it: dw-link.com/reasons
northshore is offline
post thanked by:
el_d00der1n0 (05-12-2008), Justin (05-12-2008), kanga (05-12-2008)
Old 05-12-2008, 02:45 PM   #22 (permalink)
White boy w/ a doo rag
 
BoingBoing's Avatar
 
Default

Quote:
Originally Posted by hoovermd View Post
Yes, but you DO realize that as soon as you get 1 bike, the loop is endless
Not true. There is a largest integer that a computer can handle. If you add one to it, you get a negative number and the loop ends. So the correct number of bikes is 2 to the 31 minus 1 or something like that.

Me, I've got 3.
__________________
...if I'm sweaty and dirty, I must be having fun...
BoingBoing is offline
post thanked by:
kanga (05-12-2008)
Old 05-12-2008, 02:47 PM   #23 (permalink)
I fall a lot
 
Justin's Avatar
 
Default

if (!Dork)
{
exit thread;
}
else
{
press thanks;
}
Justin is offline
post thanked by:
el_d00der1n0 (05-12-2008), kanga (05-12-2008), Kish Me (05-12-2008)
Old 05-12-2008, 02:48 PM   #24 (permalink)
STR Veteran
 
el_d00der1n0's Avatar
 
Default

Quote:
Originally Posted by northshore View Post
Dude....you are REALLY bored.....I will only code if I have to.....AHHAHHAHAHAHA
dude. one word:

documentation documentation documentation



zzzzzzzzzzzzzzzz
__________________
My Blog
el_d00der1n0 is offline
post thanked by:
katonk (05-12-2008), northshore (05-12-2008)
Old 05-12-2008, 03:05 PM   #25 (permalink)
 
2wheel_lee's Avatar
 
Default

Quote:
Originally Posted by el_d00der1n0 View Post
dude. one word:

documentation documentation documentation



zzzzzzzzzzzzzzzz
Sometimes, CYA mode is no written documentation.
__________________
Speed has never killed anyone, suddenly becoming stationary... that's what gets you.

May the air be filled with tires!
2wheel_lee is offline
Old 05-12-2008, 04:23 PM   #26 (permalink)
STR Veteran
 
el_d00der1n0's Avatar
 
Default

Quote:
Originally Posted by 2wheel_lee View Post
Sometimes, CYA mode is no written documentation.

as you can see above though, i write self-documenting code...

we have some stupid doc system we have to force everything into. i'd rather chew glass...
__________________
My Blog
el_d00der1n0 is offline
post thanked by:
2wheel_lee (05-12-2008)
Old 05-12-2008, 05:26 PM   #27 (permalink)
Derailleurs R4 Failuers
 
hoovermd's Avatar
 
Default

Actually, it depends upon hpw slow your computer is
In truth, nothing is truly endless (except upgrading components)


Quote:
Originally Posted by BoingBoing View Post
Not true. There is a largest integer that a computer can handle. If you add one to it, you get a negative number and the loop ends. So the correct number of bikes is 2 to the 31 minus 1 or something like that.

Me, I've got 3.
Quote:
Originally Posted by el_d00der1n0 View Post
dude. one word:

documentation documentation documentation

zzzzzzzzzzzzzzzz
It was hard to write, it should be hard to read
__________________
Mark

Butters: That looks dangerous...
Cartman: Not getting busted always is.
hoovermd is offline
post thanked by:
el_d00der1n0 (05-12-2008)
STR sponsored links
Reply
  SoCalTrailRiders > Local Riding > General Discussion

Thread Tools

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 On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
PV: The axe is falling..... DDB@OCR Trail Talk 360 06-25-2008 05:58 AM
i.e. Bikes, Murrieta allison Bike Shop Reviews 18 06-07-2008 06:07 PM
Pivot Bikes & The Path Demo Days (3-29-08) aukmal Trailhead 4 03-29-2008 08:56 PM
Monday Joke: Personnel Memo: try not to cuss foofighter The Pub 3 01-14-2008 10:59 AM
Five Bikes Stolen From Mission Viejo Garage - Suspect's Description Shannon General Discussion 17 05-20-2007 01:52 PM

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC7


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82