Click here to Skip to main content
15,910,130 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: Nice usage of foreach Pin
Rob Grainger24-Feb-09 3:06
Rob Grainger24-Feb-09 3:06 
GeneralRe: Nice usage of foreach Pin
Luc Pattyn24-Feb-09 3:31
sitebuilderLuc Pattyn24-Feb-09 3:31 
GeneralRe: Nice usage of foreach Pin
PIEBALDconsult24-Feb-09 16:21
mvePIEBALDconsult24-Feb-09 16:21 
GeneralRe: Nice usage of foreach Pin
Luc Pattyn24-Feb-09 16:36
sitebuilderLuc Pattyn24-Feb-09 16:36 
GeneralRe: Nice usage of foreach Pin
itsravie2-Mar-09 23:23
itsravie2-Mar-09 23:23 
GeneralRe: Nice usage of foreach Pin
Soundman32.225-Feb-09 6:12
Soundman32.225-Feb-09 6:12 
GeneralRe: Nice usage of foreach Pin
JasonPSage27-Feb-09 7:14
JasonPSage27-Feb-09 7:14 
GeneralIf File exist Pin
Yusuf11-Feb-09 4:13
Yusuf11-Feb-09 4:13 
I am supporting a legacy asp/vb COM app Dead | X| with little or no documentation

I upgraded a server with some bug fixes, as usual something did not work. roll sleeve up and let us dig for clue. The COM app logs extensively to the event log, but there is no single entry. I checked all settting and there is no configuration issues.

I gave up and started to look into the code why it is not logging and I came across

If FileExists("C:\WriteLog.Txt") Then
      Dim objData As New Data
      Dim icnt As Integer
      icnt = 0
      Do While Not FileExists(uploadPath) Or FileLen(uploadPath) = 0
        If Not FileExists(uploadPath) Then
          Call objData.WriteToNTLog("No file", 2)
        Else
          Call objData.WriteToNTLog("Length 0", 2)
        End If
      Loop
      ' note that path to exe is quoted to allow spaces in path spec
      Call objData.WriteToNTLog("""" & GetImageMagickPath() & "convert"" """ 
& uploadPath & """" & opStr & " """ & thumbPath & """", 4)
    End If


WHYConfused | :confused: check C:\WriteLog.txt before wrting to the event log. I am sure the app use to log to that file then they changed it to log to the eventlog. But why leave the file check there? The app has a configuration file and why not set logging flag in the app configuration file. Confused | :confused: Dead | X| Mad | :mad:

Yusuf

GeneralRe: If File exist Pin
Tony Pottier12-Feb-09 4:29
Tony Pottier12-Feb-09 4:29 
GeneralRe: If File exist Pin
oggenok6412-Feb-09 6:45
oggenok6412-Feb-09 6:45 
GeneralRe: If File exist Pin
Yusuf12-Feb-09 8:15
Yusuf12-Feb-09 8:15 
GeneralRe: If File exist Pin
Donsw17-Feb-09 2:37
Donsw17-Feb-09 2:37 
GeneralRe: If File exist Pin
dojohansen10-Mar-09 22:23
dojohansen10-Mar-09 22:23 
GeneralRe: If File exist Pin
Yusuf11-Mar-09 3:41
Yusuf11-Mar-09 3:41 
GeneralSomewhat of a jem... Pin
cliran6-Feb-09 0:47
cliran6-Feb-09 0:47 
GeneralRe: Somewhat of a jem... Pin
PIEBALDconsult6-Feb-09 4:39
mvePIEBALDconsult6-Feb-09 4:39 
GeneralRe: Somewhat of a jem... Pin
«_Superman_»6-Feb-09 17:00
professional«_Superman_»6-Feb-09 17:00 
GeneralRe: Somewhat of a jem... Pin
PIEBALDconsult7-Feb-09 3:52
mvePIEBALDconsult7-Feb-09 3:52 
GeneralRe: Somewhat of a jem... Pin
Thomas Weller8-Feb-09 2:52
Thomas Weller8-Feb-09 2:52 
GeneralRe: Somewhat of a jem... Pin
supercat99-Feb-09 8:09
supercat99-Feb-09 8:09 
GeneralRe: Somewhat of a jem... Pin
leppie11-Feb-09 4:48
leppie11-Feb-09 4:48 
GeneralTrue/False Dichotomy Pin
Geoff Field2-Feb-09 15:31
Geoff Field2-Feb-09 15:31 
GeneralRe: True/False Dichotomy Pin
PIEBALDconsult2-Feb-09 16:05
mvePIEBALDconsult2-Feb-09 16:05 
GeneralRe: True/False Dichotomy [modified] Pin
Geoff Field2-Feb-09 16:09
Geoff Field2-Feb-09 16:09 
GeneralRe: True/False Dichotomy Pin
PIEBALDconsult2-Feb-09 16:24
mvePIEBALDconsult2-Feb-09 16:24 

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.