Coffeehouse Thread

50 posts

HumanCompiler.Reproduce();

Back to Forum: Coffeehouse
  • User profile image
    Human​Compiler

    My wife had her first appointment earlier today.  Everything is normal and healthy.  They found the heartbeat immediately, which they said was unusual (in a good way).  This is our first.  Smiley  Just thought I'd have a little fun with our announcement to you all on Channel 9 with a little quick piece of code...

    public class FamilyMember : Baby
    {
    	public FamilyMember()
    	{
    		this.Parents = new Parent() { Parent.Parse("Erik"), Parent.Parse("Stacey") };
    		this.Gender = GenderType.Unknown;
    
    		setupTraits(this.Parents);
    	}
    	
    	private DevelopmentCycle cycle;
    	public DevelopmentCycle Cycle
    	{
    		get
    		{
    			if (cycle == null)
    				cycle = new DevelopmentCycle(this);
    			
    			return cycle;
    		}
    	}
    	
    	private HumanTraits traits;
    	public HumanTraits Traits
    	{
    		get
    		{
    			if (traits == null)
    				traits = new HumanTraits(10);
    			
    			return traits;
    		}
    	}
    	
    	private static void setupTraits(FamilyMember child, Parent[] parents)
    	{
    		for (int i = 0; i < parents[0].Traits.Count; i++)
    			child.Traits.Add(parents[0].Traits[i]);
    
    		for (int i = 0; i < parents[1].Traits.Count; i++)
    			child.Traits.Add(parents[1].Traits[i]);
    
    		child.Traits.MixItUp();
    	}
    }
    
    public static class Startup
    {
    	static void Main()
    	{
    		FamilyMember baby = new FamilyMember();
    
    		baby.FirstName = "TBD";
    		baby.MiddleName = "TBD";
    		baby.LastName = baby.Parents[0].LastName;
    		baby.Cycle.Start(Weeks.Eleven);
    		
    		MessageBox.Show("Baby is due 10/22/2007");
    		
    		Application.Run(baby);
    	}
    }

  • User profile image
    blowdart

    How you going to unit test your code? Smiley

  • User profile image
    Human​Compiler

    blowdart wrote:
    How you going to unit test your code? Smiley


    To the best of my knowledge, unit tests are done internally and I have no control over them.  Tongue Out

  • User profile image
    Dr Herbie

    HumanCompiler wrote:
    My wife had her first appointment earlier today.  Everything is normal and healthy.  They found the heartbeat immediately, which they said was unusual (in a good way).  This is our first.  Smiley 


    Congratulations!  Your life will never be the same again!
    First time's very scarey and very hard work, but definitely worth it.

    Make the most of your spare time in the comming months, you may not get a chance to sit down and rest for the next 4 or 5 years.

    Herbie

  • User profile image
    Massif

    Congrats.

    This has started me thinking what would be on the IHuman interface - but I daren't even go there for fear of imploding in a great ball of geekyiness.

    Hope it all goes well.

  • User profile image
    Human​Compiler

    Thanks, Dr. Herbie!  What's funny is, I've been using this time to catch up on side projects.  Expressionless  I haven't been sleeping much.  I guess I need to change that while I still can.  Wink

  • User profile image
    Human​Compiler

    Thanks, Massif...yes, I think you would asplode.  My first post already hit the geekiness barrier for this thread.  Expressionless

  • User profile image
    Sven Groot

    There's something decidedly odd about your code. FamilyMember is derived from Baby? That means all your family members are babies? And looking at the constructor it's apparently impossible to have a family member that doesn't have you and your wife as parents. Tongue Out You must have a strange family.

    In any case, congrats! Smiley

  • User profile image
    Human​Compiler

    Sven Groot wrote:
    

    There's something decidedly odd about your code. FamilyMember is derived from Baby? That means all your family members are babies? And looking at the constructor it's apparently impossible to have a family member that doesn't have you and your wife as parents. Tongue Out You must have a strange family.

    In any case, congrats! Smiley



    Um...code gen?  Wink

    In any case, thanks!  Smiley

  • User profile image
    blowdart

    HumanCompiler wrote:
    
    Sven Groot wrote:

    There's something decidedly odd about your code. FamilyMember is derived from Baby? That means all your family members are babies? And looking at the constructor it's apparently impossible to have a family member that doesn't have you and your wife as parents. You must have a strange family.

    In any case, congrats!



    Um...code gen? 



    I note there's no check to see if the parents are related. Are you from Alabama? Big Smile

  • User profile image
    Human​Compiler

    blowdart wrote:
    
    I note there's no check to see if the parents are related. Are you from Alabama?


    Indiana.  So not as bad.  No offense to anyone from Alabama.  Tongue Out

  • User profile image
    Rossj

    Congratulations!!

    My brother is in hospital today as his wife is giving birth to their first child , it must be 'talk about babies day' today - it is a life-changing time, I hope you make the most of it and enjoy it!!

    If you get stuck for names, Ross is a good name Smiley

  • User profile image
    Human​Compiler

    Thanks, Ross!  Hope it goes well for your brother and his wife.

    We don't have a guy name yet (I'll keep Ross in mind  Tongue Out), but we have a girl's name.  I actually had a dream a while back about having a daughter, so we're using the name from my dream if it's a girl.

  • User profile image
    Zeus

    Congrats dude ... I have a 4 (5 in august) year old running around me all day ... it's hard trying to do work when all he wants to do is get me to play with him :o

  • User profile image
    Massif

    HumanCompiler wrote:

    We don't have a guy name yet (I'll keep Ross in mind  ), but we have a girl's name.  I actually had a dream a while back about having a daughter, so we're using the name from my dream if it's a girl.


    I imagine Rory may be tempted to suggest Rory; I'll suggest Oscar.

    Why is it everyone always has their girls names sorted, but can't think of boys names? We're at least 5 years off having children, but we've figured out a girls name already.

    But then again, we're probably not going to get cats (my fiancee has allergies), and I've figured out cats names too... If you feel cruel you could always use of my cats names and call a son Tybalt.

    We used to live near someone who had four boys, and all their names began with M, I used to think that was aweful, but now I can see their point... Boys names just aren't as fun.

  • User profile image
    Raghavendra_​Mudugal

    God Bless You Both!. Smiley and happy days just around the corner.  Girl name -> "Marina" -> because where ever you go you carry your world with you.

  • User profile image
    cheong

    Congratulations. Smiley

    Nice code, but I think Baby.Parents(assuming you've corrected Baby is to be inherited from FamilyMember) should be Parent[2] unless Parents is a Collection object with it's collection of properties and methods. Tongue Out

    And is there any callback/delegate function that we can use to query the progress?

    Recent Achievement unlocked: Code Avenger Tier 4/6: You see dead program. A lot!
    Last modified
  • User profile image
    littleguru

    Congrats Erik! Smiley

    (btw. your code won't compile in C# Tongue Out)

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.