Click here to Skip to main content
15,867,308 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: None Pin
Mohamad M. Mohamad7-Nov-13 4:09
Mohamad M. Mohamad7-Nov-13 4:09 
GeneralRe: None Pin
thatraja7-Nov-13 4:38
professionalthatraja7-Nov-13 4:38 
GeneralRe: None Pin
Thanks78727-Nov-13 17:38
professionalThanks78727-Nov-13 17:38 
GeneralRe: None Pin
Keith Barrow11-Nov-13 22:29
professionalKeith Barrow11-Nov-13 22:29 
GeneralIt's taking a while but at least its working its way through that import (comments not added/edited by me) Pin
JMK8924-Oct-13 22:58
professionalJMK8924-Oct-13 22:58 
GeneralBlast you Vilmos and Your Clever Cleverness! Pin
Nagy Vilmos23-Oct-13 23:31
professionalNagy Vilmos23-Oct-13 23:31 
GeneralRe: Blast you Vilmos and Your Clever Cleverness! Pin
PIEBALDconsult24-Oct-13 17:42
mvePIEBALDconsult24-Oct-13 17:42 
GeneralLets poll no matter what time of the day Pin
virang_2123-Oct-13 13:01
virang_2123-Oct-13 13:01 
C#
public static bool checkPolTime(string SFDCStartTime)
       {
           string configSFDCStartTime = string.Empty;
           string configSFDCAMPM = string.Empty;
           int len = 0;
           len = SFDCStartTime.Length;
           //Reading from Config File
           if (len > 7)
           {
               configSFDCStartTime = SFDCStartTime.Substring(0, 5);
               configSFDCAMPM = SFDCStartTime.Substring(6, 2);
           }
           else
           {
               configSFDCStartTime = SFDCStartTime.Substring(0, 4);
               configSFDCAMPM = SFDCStartTime.Substring(5, 2);
           }

           //Reading System Time
           string systemSFDCStartMin = string.Empty;
           string systemSFDCStartSec = string.Empty;
           string systemSFDCAMPM = string.Empty;

           string time = DateTime.Now.ToString();
           string[] splitchr = { " " };
           string[] strarr = time.Split(splitchr, StringSplitOptions.None);
           string s = strarr[0];
           len = s.Length;

           if (len == 9)
           {
               splitchr[0] = ":";
               strarr = time.Split(splitchr, StringSplitOptions.None);
               s = strarr[0];
               len = s.Length;

               if (len == 11)
               {
                   systemSFDCStartMin = time.Substring(10, 4);
                   systemSFDCStartSec = time.Substring(15, 2);
                   systemSFDCAMPM = time.Substring(18, 2);
               }
               else if (len == 12)
               {
                   systemSFDCStartMin = time.Substring(10, 5);
                   systemSFDCStartSec = time.Substring(16, 2);
                   systemSFDCAMPM = time.Substring(19, 2);
               }
           }
           else if (len == 10)
           {
               splitchr[0] = ":";
               strarr = time.Split(splitchr, StringSplitOptions.None);
               s = strarr[0];
               len = s.Length;

               if (len == 12)
               {
                   systemSFDCStartMin = time.Substring(11, 4);
                   systemSFDCStartSec = time.Substring(16, 2);
                   systemSFDCAMPM = time.Substring(19, 2);
               }
               else if (len == 13)
               {
                   systemSFDCStartMin = time.Substring(11, 5);
                   systemSFDCStartSec = time.Substring(17, 2);
                   systemSFDCAMPM = time.Substring(20, 2);
               }
           }

           return true;

       }

Zen and the art of software maintenance : rm -rf *

Math is like love : a simple idea but it can get complicated.

GeneralRe: Lets poll no matter what time of the day Pin
Bernhard Hiller23-Oct-13 20:51
Bernhard Hiller23-Oct-13 20:51 
GeneralRe: Lets poll no matter what time of the day Pin
Kornfeld Eliyahu Peter23-Oct-13 21:02
professionalKornfeld Eliyahu Peter23-Oct-13 21:02 
GeneralRe: Lets poll no matter what time of the day Pin
OriginalGriff23-Oct-13 21:25
mveOriginalGriff23-Oct-13 21:25 
GeneralI don't know how to label this pattern. Pin
Andy Brummer23-Oct-13 11:54
sitebuilderAndy Brummer23-Oct-13 11:54 
GeneralRe: I don't know how to label this pattern. Pin
Brisingr Aerowing23-Oct-13 12:54
professionalBrisingr Aerowing23-Oct-13 12:54 
GeneralRe: I don't know how to label this pattern. Pin
Andy Brummer23-Oct-13 15:58
sitebuilderAndy Brummer23-Oct-13 15:58 
GeneralRe: I don't know how to label this pattern. Pin
Freak3023-Oct-13 22:43
Freak3023-Oct-13 22:43 
GeneralCatastrophic Failure! Pin
Brisingr Aerowing18-Oct-13 11:15
professionalBrisingr Aerowing18-Oct-13 11:15 
GeneralRe: Catastrophic Failure! Pin
PIEBALDconsult18-Oct-13 13:27
mvePIEBALDconsult18-Oct-13 13:27 
JokeRe: Catastrophic Failure! Pin
Matt T Heffron18-Oct-13 13:51
professionalMatt T Heffron18-Oct-13 13:51 
GeneralRe: Catastrophic Failure! Pin
PIEBALDconsult18-Oct-13 14:04
mvePIEBALDconsult18-Oct-13 14:04 
GeneralRe: Catastrophic Failure! Pin
Brisingr Aerowing18-Oct-13 14:25
professionalBrisingr Aerowing18-Oct-13 14:25 
GeneralRe: Catastrophic Failure! Pin
vonb22-Oct-13 1:07
vonb22-Oct-13 1:07 
GeneralRe: Catastrophic Failure! Pin
Argonia23-Oct-13 4:49
professionalArgonia23-Oct-13 4:49 
GeneralRe: Catastrophic Failure! Pin
Brisingr Aerowing23-Oct-13 12:55
professionalBrisingr Aerowing23-Oct-13 12:55 
GeneralRe: Catastrophic Failure! Pin
BillW335-Nov-13 4:35
professionalBillW335-Nov-13 4:35 
GeneralRe: Catastrophic Failure! Pin
Sentenryu5-Nov-13 6:12
Sentenryu5-Nov-13 6:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.