• suckface (unregistered)

    Must... Not... Be.... Hypnotized..... By.... Backupscript... thud

  • (cs)

    Based on my experience, where most DBAs automatically dismiss anything suggested by a developer, I was not surprised to hear that they passed on the revised code.

  • Sleepyhead (unregistered)

    And I thought I wanted to go to sleep before I read this...

  • Tomtidom (unregistered)

    T h i s

    i s

    a

    v e r y

    n i c e

    s c r i p t

    i n d e e d ! ! !

  • (cs)

    Looping is not a proven technology, and Thom is right not to trust it. Looping takes work away from the programmer and is therefore a threat to job security. Loops are for the lazy. The only legitimate use of looping is the for-case paradigm.

  • (cs)

    A 2-dimensional line, what a script! :S

  • Mike-RaWare (unregistered)

    This script reminds me of this simple piece of code.

  • 50% Opacity (unregistered)

    I think that's the most beautiful script I ever saw on here. I really like the pattern it makes when it scrolls by.... _

  • (cs) in reply to 50% Opacity
    50% Opacity:
    I think that's the most beautiful script I ever saw on here. I really like the pattern it makes when it scrolls by.... *_*
    It reminds me of everybody's first BASIC program:
    10 PRINT "your name or other string that is not an integer divisor of the screen width goes here, with optional trailing space";
    20 GOTO 10
    
    Used to spend ages watching the patterns those things made as the screen scrolled, tweaking the string length to get the best temporal aliasing effects...
  • SoonerMatt (unregistered) in reply to jpaull
    jpaull:
    Based on my experience, where most DBAs automatically dismiss anything suggested by a developer, I was not surprised to hear that they passed on the revised code.

    I must be very fortunate to work in my environment. Our db team does a very similar "quantity" of coding as our web team. There are always several ways to accomplish a task and we generally agree on whether something should be written in PL/SQL or on our end.

    Our dba's are generally consulted in problem solving and ideas freely flow back and forth. It has to be admitted that as I gain more experience and knowledge I am able to offer more ideas.

  • Ignacio (unregistered)

    Actually, Thom's script is more efficient.

  • Chrisos (unregistered) in reply to SoonerMatt
    SoonerMatt:
    I must be very fortunate to work in my environment. Our db team does a very similar "quantity" of coding as our web team. There are always several ways to accomplish a task and we generally agree on whether something should be written in PL/SQL or on our end.

    Our dba's are generally consulted in problem solving and ideas freely flow back and forth. It has to be admitted that as I gain more experience and knowledge I am able to offer more ideas.

    I thought when you went to Heaven, that rules of the afterlife say you can no longer communicate with all of us left behind...

  • JD (unregistered)

    All our DBAs have been laid off due to the global economic downturn. The reasoning behind this was that most of our developers can work with a DB but none of our DBAs can write code. So the DBAs are out and the developers now have to administer the DBs themselves.

    Things are running better than ever and productivity is at an all time high.

  • Dirk Diggler (unregistered)

    You've got the wrapping set incorrectly. When it's properly set and you sit arms length away from the monitor and stare past the screen, an image of a naked lady appears in 3D.

  • (cs)

    WHAT WAS THE PROBLEM that Andrew fixed??! I like hearing about problems slightly more than beeing reminded that not all people think in loops.

  • Anonymous (unregistered) in reply to Dirk Diggler
    Dirk Diggler:
    You've got the wrapping set incorrectly. When it's properly set and you sit arms length away from the monitor and stare past the screen, an image of a naked lady appears in 3D.
    Damn, that ASCII chick is HOT!
  • (cs)

    Also, when someone does scripting as beautifully as this, why only give us a tiny line? Give us everything! I want to see nakedness as well, but my screen resolution is too high :(

  • (cs)

    Truth is beauty. Beauty is truth. The first script is much prettier to look at, and thus it is the more elegant of the two.

  • (cs) in reply to JD
    JD:
    All our DBAs have been laid off due to the global economic downturn. The reasoning behind this was that most of our developers can work with a DB but none of our DBAs can write code. So the DBAs are out and the developers now have to administer the DBs themselves.

    Things are running better than ever and productivity is at an all time high.

    Cool! More money for me six months from now when the whole mess needs to be cleaned up! I think I'll buy a boat next summer....

  • (cs) in reply to Andy Goth
    Andy Goth:
    Looping is not a proven technology, and Thom is right not to trust it. Looping takes work away from the programmer and is therefore a threat to job security. Loops are for the lazy. The only legitimate use of looping is the for-case paradigm.
    For all other cases, recursion must be used!
  • (cs) in reply to sqlblindman
    sqlblindman:
    Truth is beauty. Beauty is truth. The first script is much prettier to look at, and thus it is the more elegant of the two.
    I can cite a couple of ex-girlfriends who put the lie to that. Both were very pleasant to the eye, and both would rather climb a greased flagpole and get to lie than stand on the ground and have to tell the truth.
  • i'm seeing double (unregistered)

    Replacing one line of code with four lines? You call that efficient??

  • Dirk Diggler (unregistered) in reply to Code Dependent
    Code Dependent:
    sqlblindman:
    Truth is beauty. Beauty is truth. The first script is much prettier to look at, and thus it is the more elegant of the two.
    I can cite a couple of ex-girlfriends who put the lie to that. Both were very pleasant to the eye, and both would rather climb a greased flagpole and get to lie than stand on the ground and have to tell the truth.
    Send pics or it never happened.
  • (cs) in reply to Dirk Diggler
    Dirk Diggler:
    Code Dependent:
    sqlblindman:
    Truth is beauty. Beauty is truth. The first script is much prettier to look at, and thus it is the more elegant of the two.
    I can cite a couple of ex-girlfriends who put the lie to that. Both were very pleasant to the eye, and both would rather climb a greased flagpole and get to lie than stand on the ground and have to tell the truth.
    Send pics or it never happened.
    Of the greased flagpole?
  • (cs) in reply to suckface
    suckface:
    Must... Not... Be.... Hypnotized..... By.... Backupscript...
    Why resist? It's Inevitable!
    suckface:
    *thud*
    See? Told you so. Now what will you do?
  • Anonymous (unregistered) in reply to sqlblindman
    sqlblindman:
    I think I'll buy a boat next summer....
    Good idea, you'll need somewhere to live when your wife kicks you out because you can't find any work.
  • (cs) in reply to dkf

    look...at...all...the...pret...ty...pat...terns....must...re...sist...in...san...i...ty...fail...ing....leave...ing...now....

  • mauhiz (unregistered)

    What pains me most is not the script itself, but the mindset of the person who wrote it. "I must not miss any integer in the next 119"

    Oh wait, maybe he wrote a script with a loop to generate this command line?

  • No, really (unregistered) in reply to sqlblindman
    sqlblindman:
    JD:
    All our DBAs have been laid off due to the global economic downturn. The reasoning behind this was that most of our developers can work with a DB but none of our DBAs can write code. So the DBAs are out and the developers now have to administer the DBs themselves.

    Things are running better than ever and productivity is at an all time high.

    Cool! More money for me six months from now when the whole mess needs to be cleaned up! I think I'll buy a boat next summer....
    In my experience, only about 50% of dbas are capable of doing their own job well, which is about identical to the percent of developers who could do the job just as well.

    The reason is that a good developer knows what's going on behind the scenes in a db at least as well as a dba.

  • (cs) in reply to Dirk Diggler
    Dirk Diggler:
    When it's properly set and you sit arms length away from the monitor and stare past the screen, an image of a naked lady appears in 3D.
    Truth is booty?
  • (cs) in reply to Dirk Diggler
    Dirk Diggler:
    You've got the wrapping set incorrectly. When it's properly set and you sit arms length away from the monitor and stare past the screen, an image of a naked lady appears in 3D.

    Ohh...a sailboat!

  • (cs) in reply to Dirk Diggler
    Dirk Diggler:
    You've got the wrapping set incorrectly. When it's properly set and you sit arms length away from the monitor and stare past the screen, an image of a naked lady appears in 3D.
    I don't even see the code. All I see is blonde, brunette, red-head.
  • Baha (unregistered) in reply to Havstein
    WHAT WAS THE PROBLEM that Andrew fixed??! I like hearing about problems slightly more than beeing reminded that not all people think in loops.
    The problem was right by, but not right at, the end.

    Specifically, "$WORKSAPCE/ewprd117". They transposed the 'A' and the 'P', which, most likely, meant that it pointed to a variable that did not exist, rather than $WORKSPACE which was used 117 other times or so.

    And before you ask, I found it via removing all newlines, then did find/replace for the common text that was repeated so many times. Did it just because I wanted to know the reason why this WTF came to light myself.

  • (cs) in reply to SoonerMatt
    SoonerMatt:
    jpaull:
    Based on my experience, where most DBAs automatically dismiss anything suggested by a developer, I was not surprised to hear that they passed on the revised code.

    I must be very fortunate to work in my environment. Our db team does a very similar "quantity" of coding as our web team. There are always several ways to accomplish a task and we generally agree on whether something should be written in PL/SQL or on our end.

    Our dba's are generally consulted in problem solving and ideas freely flow back and forth. It has to be admitted that as I gain more experience and knowledge I am able to offer more ideas.

    Please answer the following question:

    Lying about my work environment makes me feel:

    (1) Sorry. (2) Not sorry.

  • Patsie (unregistered)

    Okay, is it me, or is nobody seeing that the script doesn't do what it advertises... It starts off with a file= and in the loop continues with FILE= At least the DBA's script worked

  • T604 (unregistered) in reply to SoonerMatt

    Wow, every job I've ever had the dbas would say "We don't write stored procedures" you write it and give it to us to maintain. I've always wondered what it is they do? Write create/alter sql and then sit around waiting for indexes to corrupt? I can never understand how their pay is on the same scale (or better) than a developers.

  • (cs) in reply to Patsie
    Patsie:
    Okay, is it me, or is nobody seeing that the script doesn't do what it advertises... It starts off with a file= and in the loop continues with FILE= At least the DBA's script worked
    I noticed that as well. I gave the submitter/poster/editor the benefit of the doubt and assumed that the script was executing in a UNIX-like environment with [*ugh*] case-insensitive environment variables... :-X Either that, or the poster/editor is a Windows-y user and doesn't realize case is important. ;D Either way, you get the point. And the Windows-y users never will. ;D
  • cb (unregistered)

    Just curious... Isn't "file=$WORKSPACE/ewprd*_$DATECODE.dmp" somewhat likely to work? :-"

  • (cs)

    Of course they passed on the script! That wouldn't pick $WORKSAPCE/ewprd117_$DATECODE.dmp up correctly. You always have to make sure the corner cases are covered, so sometimes a generic script just isn't sufficient.

  • Patsie (unregistered) in reply to cb
    cb:
    Just curious... Isn't "file=$WORKSPACE/ewprd*_$DATECODE.dmp" somewhat likely to work? :-"
    Depends entirely on where and how this 'file' variable is used. If it's used in a tool with file globbing, then yes, most likely that would work. (i.e. unix tools like ls and rm) But if it's a non-file globbing tool, then unforetunately not.
  • (cs) in reply to cb
    cb:
    Just curious... Isn't "file=$WORKSPACE/ewprd*_$DATECODE.dmp" somewhat likely to work? :-"
    Well $WORKSPACE/ewprd*_$DATECODE.dmp would likely result in a space delimited list of existing files matching that pattern. If the files do not yet exist then it wouldn't likely work. Also, the space delimiters might need to be replaced with commas if subsequent code relies on that (though it would be pretty easy to do). I'm thinking there is probably a much better solution all together. However, if the DBA team didn't like that revision it's probably because they aren't very familiar with shell scripting (or whatever language this is) and wanted to keep the script as simple (even if that means redundant) as possible.
  • (cs) in reply to Patsie
    Patsie:
    cb:
    Just curious... Isn't "file=$WORKSPACE/ewprd*_$DATECODE.dmp" somewhat likely to work? :-"
    Depends entirely on where and how this 'file' variable is used. If it's used in a tool with file globbing, then yes, most likely that would work. (i.e. unix tools like ls and rm) But if it's a non-file globbing tool, then unforetunately not.
    Isn't globbing typically handled by the shell in UNIX[es]? The only caveat is that the tools would need to be able to handle many files passed in many arguments, would need to be able to parse a single space delimited argument (and the environment variable would need to be quoted), or the environment variable would need spaces replaced with commas. :-/ I think.
  • A DBA (unregistered) in reply to T604

    Well, not sure about your guy's place, but we sure do write a lot of code... Most of our DBAs though actually came from our development department, so maybe we're odd...

    As far as making more, I've found that to be the case only for the lower level developers and DBAs. It tends to balance out once a person knows what they're doing. Unfortunately, that seems to be pretty rare for developers AND DBAs.

    See "No, really"'s comment, though I think 50% is too generous...

  • No, really (unregistered) in reply to A DBA

    Yeah, you're right, 50% is definitely too generous... barely 50% of any profession can do their own job well, and I've found that goes moreso for tech jobs :)

    Of the developers who actually ARE good at their job, however, I would say most of them could switch to a dba position and do very well at it with minimal training.

  • CynicalTyler (unregistered)
    It accomplished the exact same thing in four little lines.
    Idiot! You increased the code size by a factor of four!
  • Level 2 (unregistered)

    The script is probably generated and the file variable is filled from a select from some system table. Make sure that the script is regenerated each time before it is run, and it will still work correctly if an ewprd119 thingie is added to the database. Or even when at some time ewprd45 no longer exists.

    Not a WTF.

  • (cs) in reply to xtremezone
    xtremezone:
    Either that, or the poster/editor is a Windows-y user and doesn't realize case is important. ;D Either way, you get the point. And the Windows-y users never will. ;D
    I'm not sure what you're getting at. Are you confusing Windows with Visual Basic, maybe?

    Regardless, the fact is that case is only important when it is. If it doesn't matter, then it doesn't matter.

  • Loren Pechtel (unregistered)

    Everyone knows you unroll loops to make it faster!

  • C. F. Martin (unregistered) in reply to DaveK
    DaveK:
    50% Opacity:
    I think that's the most beautiful script I ever saw on here. I really like the pattern it makes when it scrolls by.... *_*
    It reminds me of everybody's first BASIC program:
    10 PRINT "your name or other string that is not an integer divisor of the screen width goes here, with optional trailing space";
    20 GOTO 10
    
    Used to spend ages watching the patterns those things made as the screen scrolled, tweaking the string length to get the best temporal aliasing effects...

    I remember my 1st bag-o-weed...

    Captcha= modo (an anagram of DOOM)

  • (cs) in reply to Code Dependent
    Code Dependent:
    xtremezone:
    Either that, or the poster/editor is a Windows-y user and doesn't realize case is important. ;D Either way, you get the point. And the Windows-y users never will. ;D
    I'm not sure what you're getting at. Are you confusing Windows with Visual Basic, maybe?

    Regardless, the fact is that case is only important when it is. If it doesn't matter, then it doesn't matter.

    rEm Respond to Windows user.
    eChO nO, %usERnamE%, I'M nOT conFUSIng WiNDOws wIth visuAL BAsiC.
    ECho I wAs sIMpLY eXpRESsing my dISTasTe in cASe-insENSitivITY. 
    Case is important. Languages that ignore it are generally lazy languages used by lazy programmers. And environments that ignore it are weakened by it. I'm technically a Windows and Linux user, though I much prefer Linux for 99% of everything. I'd sure like to rid myself of Windows entirely, but unfortunately game developers don't yet give Linux the attention it deserves. :(

Leave a comment on “The Backup Snippet”

Log In or post as a guest

Replying to comment #:

« Return to Article