Comment On The Backup Snippet

Generally speaking, Andrew tries his best to avoid the DBA team. It's not just because database administrators tend to be a unique breed (his colleagues were certainly no exception), but because of the "things" that he'd heard about the team. The sort of "things" that keep developers up at night and make them regret not becoming an accountant. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: The Backup Snippet

2008-12-17 08:05 • by suckface (unregistered)
Must... Not... Be.... Hypnotized..... By.... Backupscript...
*thud*

Re: The Backup Snippet

2008-12-17 08:06 • by 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.

Re: The Backup Snippet

2008-12-17 08:06 • by Sleepyhead (unregistered)
And I thought I wanted to go to sleep *before* I read this...

Re: The Backup Snippet

2008-12-17 08:07 • by 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
!
!
!

Re: The Backup Snippet

2008-12-17 08:11 • by 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.

Re: The Backup Snippet

2008-12-17 08:13 • by kennytm
A 2-dimensional line, what a script! :S

Re: The Backup Snippet

2008-12-17 08:14 • by Mike-RaWare (unregistered)
This script reminds me of this simple piece of code.

Re: The Backup Snippet

2008-12-17 08:17 • by 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.... *_*

Re: The Backup Snippet

2008-12-17 08:21 • by DaveK
235140 in reply to 235138
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...

Re: The Backup Snippet

2008-12-17 08:23 • by SoonerMatt (unregistered)
235143 in reply to 235131
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.

Re: The Backup Snippet

2008-12-17 08:36 • by Ignacio (unregistered)
Actually, Thom's script is more efficient.

Re: The Backup Snippet

2008-12-17 08:39 • by Chrisos (unregistered)
235146 in reply to 235143
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...

Re: The Backup Snippet

2008-12-17 08:48 • by 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.

Re: The Backup Snippet

2008-12-17 08:49 • by 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.

Re: The Backup Snippet

2008-12-17 08:49 • by 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.

Re: The Backup Snippet

2008-12-17 08:50 • by Anonymous (unregistered)
235152 in reply to 235148
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!

Re: The Backup Snippet

2008-12-17 08:52 • by Havstein
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 :(

Re: The Backup Snippet

2008-12-17 08:57 • by 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.

Re: The Backup Snippet

2008-12-17 08:59 • by sqlblindman
235156 in reply to 235147
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....

Re: The Backup Snippet

2008-12-17 09:09 • by HypocriteWorld
235157 in reply to 235134
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!

Re: The Backup Snippet

2008-12-17 09:16 • by Code Dependent
235158 in reply to 235155
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.

Re: The Backup Snippet

2008-12-17 09:17 • by i'm seeing double (unregistered)
Replacing one line of code with four lines? You call that efficient??

Re: The Backup Snippet

2008-12-17 09:25 • by Dirk Diggler (unregistered)
235160 in reply to 235158
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.

Re: The Backup Snippet

2008-12-17 09:46 • by Code Dependent
235163 in reply to 235160
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?

Re: The Backup Snippet

2008-12-17 09:47 • by dkf
235164 in reply to 235130
suckface:
Must... Not... Be.... Hypnotized..... By.... Backupscript...
Why resist? It's Inevitable!
suckface:
*thud*
See? Told you so. Now what will you do?

Re: The Backup Snippet

2008-12-17 09:59 • by Anonymous (unregistered)
235168 in reply to 235156
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.

Re: The Backup Snippet

2008-12-17 10:01 • by Steeldragon
235169 in reply to 235164
look...at...all...the...pret...ty...pat...terns....must...re...sist...in...san...i...ty...fail...ing....leave...ing...now....

Re: The Backup Snippet

2008-12-17 10:08 • by 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?

Re: The Backup Snippet

2008-12-17 10:11 • by No, really (unregistered)
235171 in reply to 235156
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.

Re: The Backup Snippet

2008-12-17 10:13 • by DaveAronson
235172 in reply to 235148
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?

Re: The Backup Snippet

2008-12-17 10:34 • by ebs2002
235174 in reply to 235148
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!

Re: The Backup Snippet

2008-12-17 10:38 • by operagost
235175 in reply to 235148
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.

Re: The Backup Snippet

2008-12-17 10:47 • by Baha (unregistered)
235176 in reply to 235150
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.

Re: The Backup Snippet

2008-12-17 10:55 • by xtremezone
235177 in reply to 235143
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.

Re: The Backup Snippet

2008-12-17 10:55 • by 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


Re: The Backup Snippet

2008-12-17 10:55 • by T604 (unregistered)
235179 in reply to 235143
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.

Re: The Backup Snippet

2008-12-17 10:58 • by xtremezone
235180 in reply to 235178
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

Re: The Backup Snippet

2008-12-17 11:04 • by cb (unregistered)
Just curious... Isn't "file=$WORKSPACE/ewprd*_$DATECODE.dmp" somewhat likely to work? :-"

Re: The Backup Snippet

2008-12-17 11:08 • by Krenn
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.

Re: The Backup Snippet

2008-12-17 11:13 • by Patsie (unregistered)
235190 in reply to 235184
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.

Re: The Backup Snippet

2008-12-17 11:16 • by xtremezone
235191 in reply to 235184
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.

Re: The Backup Snippet

2008-12-17 11:18 • by xtremezone
235193 in reply to 235190
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.

Re: The Backup Snippet

2008-12-17 11:26 • by A DBA (unregistered)
235195 in reply to 235179
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...

Re: The Backup Snippet

2008-12-17 11:32 • by No, really (unregistered)
235198 in reply to 235195
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.

Re: The Backup Snippet

2008-12-17 11:33 • by CynicalTyler (unregistered)
It accomplished the exact same thing in four little lines.
Idiot! You increased the code size by a factor of four!

Re: The Backup Snippet

2008-12-17 11:35 • by 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.

Re: The Backup Snippet

2008-12-17 11:38 • by Code Dependent
235204 in reply to 235180
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.

Re: The Backup Snippet

2008-12-17 11:42 • by Loren Pechtel (unregistered)
Everyone knows you unroll loops to make it faster!

Re: The Backup Snippet

2008-12-17 12:03 • by C. F. Martin (unregistered)
235215 in reply to 235140
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)

Re: The Backup Snippet

2008-12-17 12:04 • by xtremezone
235216 in reply to 235204
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. :(
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment