The Coding Lounge

Veroland

Executive Member
Joined
Aug 24, 2005
Messages
6,304
Code:
while (thisThread.isRunning) {
  try {
    Socket s = new Socket(yourBoss);
    SocketWriter sw = new SocketWriter(s);

    sw.connect();
    sw.sendText("I see coders with too much time on their hands!");

    sw.disconnect();
  } catch (AnyDamnExcpetion e) {
  }
 

dequadin

Expert Member
Joined
May 9, 2008
Messages
1,434
Code:
while (thisThread.isRunning) {
  try {
    Socket s = new Socket(yourBoss);
    SocketWriter sw = new SocketWriter(s);

    sw.connect();
    sw.sendText("I see coders with too much time on their hands!");

    sw.disconnect();
  } catch (AnyDamnExcpetion e) {
  }

SocketWriter?

Code:
Socket s  = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

try { s.Connect(yourBoss); }
catch (SocketException ex) {}

string message = String.Format("I see {0} has too much time on their hands", 
lazyCoder.Name.ToString().Trim());

try { s.Send(ASCIIEncoding.ASCII.GetBytes(message)); }
catch (SocketException ex) {}
 

dequadin

Expert Member
Joined
May 9, 2008
Messages
1,434
Code:
System.Console.WriteLine("W                 w   TTTTTTTTTTTTTTTT  FFFFFFFFFFFFF   ????? ");
System.Console.WriteLine(" W               w           T          F              ?     ?");
System.Console.WriteLine("  W             w            T          F                   ? ");
System.Console.WriteLine("   W     w     w             T          FFFFFF             ?  ");
System.Console.WriteLine("    W   w w   w              T          F                  ?  ");
System.Console.WriteLine("     W w   w w               T          F                     ");
System.Console.WriteLine("      W     w                T          F                  ?  ");
 

guest2013-1

guest
Joined
Aug 22, 2003
Messages
19,800
Code:
while (thisThread.isRunning) {
  try {
    Socket s = new Socket(yourBoss);
    SocketWriter sw = new SocketWriter(s);

    sw.connect();
    sw.sendText("I see coders with too much time on their hands!");

    sw.disconnect();
  } catch (AnyDamnExcpetion e) {
  }

Throw New Exception("Won't compile, Invalid Syntax Line 10")
 

dequadin

Expert Member
Joined
May 9, 2008
Messages
1,434
Code:
public class HomeTimeChecker
    {      
        private DateTime _HomeTime;

        public HomeTimeChecker(DateTime HomeTime)
        {            
            this._HomeTime = HomeTime;           
        }

        public bool HomeTimeYet(ref TimeSpan TimeTillICanGoHome)
        {
            TimeTillICanGoHome = this._HomeTime.Subtract(DateTime.Now);

            if (TimeTillICanGoHome.TotalMilliseconds > 0)
                return true;
            else
                return false;
        }
             
        static void Main(string[] args)
        {
            DateTime homeTime = new DateTime(
                DateTime.Now.Year,
                DateTime.Now.Month,
                DateTime.Now.Day,
                16,
                30,
                0);

            HomeTimeChecker myHomeTime = new HomeTimeChecker(homeTime);

            TimeSpan timeTillICanGoHome = new TimeSpan();
            System.Console.WriteLine("Checking Home Time .....");
            Random sleepTime = new Random();
            while (myHomeTime.HomeTimeYet(ref timeTillICanGoHome))
            {
                int nextCheck = sleepTime.Next(30000);
                System.Console.WriteLine("Not yet :( {0}:{1}:{2}.{3} left.... will check again in {4} seconds", 
                    timeTillICanGoHome.Hours.ToString(),
                    timeTillICanGoHome.Minutes.ToString(),
                    timeTillICanGoHome.Seconds.ToString(),
                    timeTillICanGoHome.Milliseconds.ToString(),
                    (nextCheck/1000).ToString());
                Thread.Sleep(nextCheck);
            }

            System.Console.WriteLine("Home time :)");
            System.Console.ReadLine();            
        }
    }
 

guest2013-1

guest
Joined
Aug 22, 2003
Messages
19,800
Code:
public class HomeTimeChecker
    {      
        private DateTime _HomeTime;

        public HomeTimeChecker(DateTime HomeTime)
        {            
            this._HomeTime = HomeTime;           
        }

        public bool HomeTimeYet(ref TimeSpan TimeTillICanGoHome)
        {
            TimeTillICanGoHome = this._HomeTime.Subtract(DateTime.Now);

            if (TimeTillICanGoHome.TotalMilliseconds > 0)
                return true;
            else
                return false;
        }
             
        static void Main(string[] args)
        {
            DateTime homeTime = new DateTime(
                DateTime.Now.Year,
                DateTime.Now.Month,
                DateTime.Now.Day,
                16,
                30,
                0);

            HomeTimeChecker myHomeTime = new HomeTimeChecker(homeTime);

            TimeSpan timeTillICanGoHome = new TimeSpan();
            System.Console.WriteLine("Checking Home Time .....");
            Random sleepTime = new Random();
            while (myHomeTime.HomeTimeYet(ref timeTillICanGoHome))
            {
                int nextCheck = sleepTime.Next(30000);
                System.Console.WriteLine("Not yet :( {0}:{1}:{2}.{3} left.... will check again in {4} seconds", 
                    timeTillICanGoHome.Hours.ToString(),
                    timeTillICanGoHome.Minutes.ToString(),
                    timeTillICanGoHome.Seconds.ToString(),
                    timeTillICanGoHome.Milliseconds.ToString(),
                    (nextCheck/1000).ToString());
                Thread.Sleep(nextCheck);
            }

            System.Console.WriteLine("Home time :)");
            System.Console.ReadLine();            
        }
    }

Response.Write "OMG, or just like 2 lines of code in ASP!"
 

Necuno

Court Jester
Joined
Sep 27, 2005
Messages
58,567
Lounge.Enter(Necuno);
Necuno.Beer = Bar.GetBeer(Beer.BlackLabel, 1);
 

JHatman

Banned
Joined
Oct 28, 2008
Messages
2,008
Code:
#include "Wife.h"
#include "Scooters.h"

void main() {
     int iSelection;
     double dValue;
     cout << "Duties for the wife tonight.  Please select." << endl;
     cout << "--------------------------------------------" << endl;
     cout << "1.  Make Tea." << endl;
     cout << "2.  Cook dinner." << endl;
     cin >> iSelection;
     cout << endl;

     if (iSelection ==1) {
          Wife makecofeenow;
               cout << "How many sugars?" << endl;
               cin >> dValue;
               cout << endl;
               cout << makecofeenow(dValue) << endl;
           
     }

     elseif (iSelection ==2) {
          Wife makedinnernow;
          Scooters plsbringpizzawifelazy;
               cout << "What would you like to eat?" << endl;
               cout << "1.  Pasta." << endl;
               cout << "2.  Aah sod it, lets order pizza." << endl;
               cin >> iSelection;
               cout << endl;

               if (iSelection == 1) {
                    cout << makedinnernow(iSelection) << endl;
                    cout << endl;
               }
               elseif (iSelection == 2) {
                    cout << plsbringpizzawifelazy(iSelection) << endl;
                    cout << endl;
               }
     }

}
 
Last edited:

Project X

Expert Member
Joined
May 16, 2006
Messages
1,615
#include <wtf>
int main
{ cout << "why are you guys saying ramdom things?" << endl;
}
 

dequadin

Expert Member
Joined
May 9, 2008
Messages
1,434
long const TAR = long.MaxValue;

do
{
Coffee morningCuppa = new Coffee();

while (morningCuppa.Strengh != TAR)
morningCuppa.Add(MORE);

morningCuppa.Drink();
}while(this.stillAsleep);
 

FarligOpptreden

Executive Member
Joined
Mar 5, 2007
Messages
5,396
long const TAR = long.MaxValue;

do
{
Coffee morningCuppa = new Coffee();

while (morningCuppa.Strengh != TAR)
morningCuppa.Add(MORE);

morningCuppa.Drink();
}while(this.stillAsleep);

Code:
Person me = Context.User;

if (me.Guess == new Guess("Shouldn't TAR be an enumeration?"))
{
    Response.Write("Rather use something like 'morningCuppa.Strenth != Strenth.TAR'...");
}
else
{
    me.Hide();
}

Response.End();
 

dequadin

Expert Member
Joined
May 9, 2008
Messages
1,434
/* TODO: Consider refactoring code.
* Find way to enumerate coffee strength. This could pose a problem because
* the coffee strength is an analog value, need to have a meeting with the
* client to decide on granularity.

* EDIT: Still no word from client...
* EDIT: Been two months and now they want Hot Chocolate, enum situation still * not resolved......
*/
 

foozball3000

Executive Member
Joined
Oct 28, 2008
Messages
5,827
Dim Object myCouch = new Object(LivingInComfort.Couch.Blue)
myCouch.Items.Add(me)
 

FarligOpptreden

Executive Member
Joined
Mar 5, 2007
Messages
5,396
/* TODO: Consider refactoring code.
* Find way to enumerate coffee strength. This could pose a problem because
* the coffee strength is an analog value, need to have a meeting with the
* client to decide on granularity.

* EDIT: Still no word from client...
* EDIT: Been two months and now they want Hot Chocolate, enum situation still * not resolved......
*/

Code:
Person me = Context.User;

me.Suggestions.Add(new Suggestion("Why not create a base class for Beverage, with sub-classes for Hot and Cold and build it further from there?"));

foreach (Suggestion s in me.Suggestions)
{
    Response.Write(s.SuggestionText);
}

Response.End();
 

dequadin

Expert Member
Joined
May 9, 2008
Messages
1,434
Dim Object myCouch = new Object(LivingInComfort.Couch.Blue)
myCouch.Items.Add(me)

// Please use generics, and C#
Object<LivingInComfort.Couch> myCouch = new Object<LivingInComfort.Couch>();
myCouch.Items.Add(new LivingInComfort.Couch(Blue));
 
Top