|
yaoi prophet posted:Perl. The reason and binds weaker than assignment is so you can do something like It's notable that the 'and' and 'or' operators were put into the language for this purpose; '&&' and '||' have the roughly the precedence they have in C.
|
# ? Feb 11, 2013 22:28 |
|
|
# ? May 25, 2024 03:49 |
|
I don't know if it's a horror, but I really hate the trend in webapps of putting everything in a given layer in a single directory. I know it's easy, but do you really need to add that 75th model to the same model directory as those 74 other models? Do all those 74 models really belong together? Maybe it would be easier to understand your application if you had some separation in your features rather than a giant directory full of files.
|
# ? Feb 11, 2013 22:31 |
|
yaoi prophet posted:Perl. The reason and binds weaker than assignment is so you can do something like Ruby also has this (presumably PHP and Ruby both inherited it from Perl); the idea is basically that &&/|| are for boolean logic operations, and and/or are for control flow.
|
# ? Feb 11, 2013 22:44 |
|
The Gripper posted:I submitted this to our internal bugtracker as part of a repro for a toolchain bug, only remembered I'd named everything in the stupidest possible way after I'd hit submit. Eventually, everyone does something like that once, to some degree of severity or another. I haven't yet, but I have done the "DELETE FROM foo" ...5 seconds later... "gently caress, that was production / gently caress, I didn't include a where clause and that was production" A friend and former boss of mine once accidentally dropped a production database.
|
# ? Feb 11, 2013 22:49 |
|
Something else I found floating around my webspace. This screenshot a couple years ago when Sony was getting hacked every day. Someone linked me to a CAPTCHA they were using for one of their sites. It looked a little funny so I hit view source. Welp.
|
# ? Feb 11, 2013 22:51 |
The best CAPTCHA. No algorithm would be able to decipher those "images". It's like hiding the kids' presents inside the tree. Actually maybe it sometimes does just stick plain letters out there to expose brute forcing programs or something?
|
|
# ? Feb 11, 2013 22:54 |
|
e: removed
xtal fucked around with this message at 03:27 on Feb 28, 2013 |
# ? Feb 11, 2013 23:48 |
|
Steve French posted:Ruby also has this (presumably PHP and Ruby both inherited it from Perl); the idea is basically that &&/|| are for boolean logic operations, and and/or are for control flow. Ok, that makes slightly more sense. I haven't really used any Perl derivatives, so the usage of those operators used for control flow didn't click. I thought they saw Python using 'and'/'or'/etc and just decided to tack them on at the end of the list, because PHP.
|
# ? Feb 12, 2013 00:01 |
|
I liked the Mise Institute's old validation question for tagging articles. It always asked the same thing, "What is 2 + 3?" (bottom of the page)
|
# ? Feb 12, 2013 00:56 |
|
Steve French posted:Ruby also has this (presumably PHP and Ruby both inherited it from Perl); the idea is basically that &&/|| are for boolean logic operations, and and/or are for control flow. What's the advantage of these over an "if" clause?
|
# ? Feb 12, 2013 01:24 |
HappyHippo posted:What's the advantage of these over an "if" clause? The entire point of Perl is to allow the most trivial things to be written in as many entirely different ways as possible.
|
|
# ? Feb 12, 2013 01:31 |
|
HappyHippo posted:What's the advantage of these over an "if" clause? It's extremely concise and readable once you know the idiom?
|
# ? Feb 12, 2013 01:31 |
|
HappyHippo posted:What's the advantage of these over an "if" clause? well, it's convenience becomes more apparent when you have to chain multiple "if success then" statements together. I can effectively say something like: code:
|
# ? Feb 12, 2013 01:37 |
|
I find that stylistically in ruby it makes more sense sometimes to do "A and B" instead of "B if A" or "if A; B; end", in situations where A is a significant operation. For example if A was to perform a database operation, or call some computationally expensive method, I'd probably use and. If A were some simple boolean logic, I'd be more inclined to use if.
|
# ? Feb 12, 2013 05:26 |
|
Steve French posted:I find that stylistically in ruby it makes more sense sometimes to do "A and B" instead of "B if A" or "if A; B; end", in situations where A is a significant operation.
|
# ? Feb 12, 2013 05:29 |
|
het posted:In terms of convention (in Perl at least) it probably partially originates with shell scripting, where using && and || for conditional execution of successive commands is not uncommon. Yeah that too for sure (earlier examples of "or die" also); I was just giving an example of when I find myself using and instead of if.
|
# ? Feb 12, 2013 05:34 |
|
Ithaqua posted:A friend and former boss of mine once accidentally dropped a production database. Happily the site hadn't launched and everything was recalculable.
|
# ? Feb 12, 2013 08:52 |
|
I once physically dropped the production database. On the floor.
|
# ? Feb 12, 2013 10:20 |
|
nielsm posted:The entire point of Perl is to allow the most trivial things to be written in as many entirely different ways as possible. For example, Perl lets you write the conditionals on the right. foo() if bar(); Perl also has a built in negative conditional. foo() unless baz(); As another example, Perl lets you define quote operators on the fly. print q~This is a 'single-quoted' string. ~ . qq~And this is a "double-quoted" string with $interpolation.~ This means that you can do freaky incorrect things just to screw with people, like die qq#How'd you do that? "$bad" should never be "$good". Stop that.\n# unless $bad eq $good;
|
# ? Feb 12, 2013 11:15 |
|
zootm posted:I did this not long after starting my current job. In hindsight having about 12 windows open to devo and 1 open to prod basically amounts to "database roulette." Some people set up their terminals so that terminals pointing at a production machine have unmissable bright red backgrounds or red text or something.
|
# ? Feb 12, 2013 13:23 |
|
qntm posted:Some people set up their terminals so that terminals pointing at a production machine have unmissable bright red backgrounds or red text or something.
|
# ? Feb 12, 2013 14:59 |
|
qntm posted:Some people set up their terminals so that terminals pointing at a production machine have unmissable bright red backgrounds or red text or something. I've done the partially red prompt for root, hadn't seen this though.
|
# ? Feb 12, 2013 15:23 |
|
Destroyenator posted:I was actually talking to someone about this as a why-don't-they-do-this feature for SSMS a couple of weeks ago. I've worked on web projects that have had different CSS stylings for local vs uat vs live and it's such a useful feature. You may wanna take a look at this http://www.ssmstoolspack.com/ There's an option to do just that, though it only changes the background color in the connection bar of a query window. Saved my rear end a few times, though. I also prefer to open up a new instant of SSMS if I need to deal with production databases, just so there's no confusion between having multiple connections open.
|
# ? Feb 12, 2013 17:03 |
|
I have this:code:
|
# ? Feb 12, 2013 17:35 |
|
Munkeymon posted:I have this: I used to do something like that because I expected C-e to go to the end of the line.
|
# ? Feb 12, 2013 17:58 |
|
I only connect to our prod server through RDC in an 800x600 window. I find the irritation of being trapped in a tiny window and unable to maximize it helps me remember not to do anything stupid.
|
# ? Feb 12, 2013 18:40 |
|
Ithaqua posted:Eventually, everyone does something like that once, to some degree of severity or another. I haven't yet, but I have done the "DELETE FROM foo" ...5 seconds later... "gently caress, that was production / gently caress, I didn't include a where clause and that was production" Once, on a production system I was working with, one of the app support guys ran something like: code:
|
# ? Feb 12, 2013 19:11 |
|
..btt posted:Once, on a production system I was working with, one of the app support guys ran something like: That's a nicely layered horror you've got there buddy!
|
# ? Feb 12, 2013 20:30 |
|
..btt posted:Once, on a production system I was working with, one of the app support guys ran something like: Is one of the layers to this horror that the passwords are stored in plain text?
|
# ? Feb 12, 2013 21:18 |
|
While I am currently working on a system that did store passwords in plain text (we're totally replacing auth, thank god), the above snippet was just for brevity.
|
# ? Feb 12, 2013 22:27 |
|
When I'm writing a delete statement, I start off by writing "WHERE butts='Yes' AND farts=4" then go back and fill in the DELETE FROM once I'm happy with how the rest of it looks.
|
# ? Feb 13, 2013 01:50 |
|
I start off by writing "SELECT * FROM", run the query several times until I know it hits only the stuff I want to delete, and then change it to a DELETE FROM.
|
# ? Feb 13, 2013 03:06 |
|
I have a Kinect sensor attached to my computer and I wrote an app that sits between my PC and the database server and it only allows me to run destructive commands if I do a little voodoo dance and say a magic word can we get off this please
|
# ? Feb 13, 2013 04:04 |
|
Bunny Cuddlin posted:I have a Kinect sensor attached to my computer and I wrote an app that sits between my PC and the database server and it only allows me to run destructive commands if I do a little voodoo dance and say a magic word can we get off this please https://www.youtube.com/watch?v=Mx-Y8KFFHpE
|
# ? Feb 13, 2013 04:08 |
|
code:
|
# ? Feb 13, 2013 18:24 |
|
Internet Janitor posted:It is unfortunate that such gag languages are almost always sugar for essentially ALGOL semantics. Couldn't brogrammers brogram in a functional or declarative style? Is a little creativity so much to ask for in my extended jokes? Wheany posted:BroseF, the F is for "functional" Brolog, obviously.
|
# ? Feb 13, 2013 19:40 |
|
qntm posted:Some people set up their terminals so that terminals pointing at a production machine have unmissable bright red backgrounds or red text or something.
|
# ? Feb 13, 2013 23:59 |
|
Wikipedia helpfully explains how to calculate the date of Easter Sunday in MS Excel using what appears to be the most convoluted method possible: =DATE(A1,INT((MOD((19*(MOD(+A1,19))+(INT(A1/100))-(INT(INT(A1/100)/4))-(INT((INT(A1/100)-(INT((INT(A1/100)+8)/25))+1)/3))+15),30)+MOD((32+(2*MOD(INT(A1/100),4))+(2*INT(MOD(A1,100)/4))-(MOD((19*(MOD(+A1,19))+(INT(A1/100))-(INT(INT(A1/100)/4))-(INT((INT(A1/100)-(INT((INT(A1/100)+8)/25))+1)/3))+15),30))-(MOD(MOD(A1,100),4))),7)-(7*INT(((MOD(+A1,19))+(11*MOD((19*(MOD(+A1,19))+(INT(A1/100))-(INT(INT(A1/100)/4))-(INT((INT(A1/100)-(INT((INT(A1/100)+8)/25))+1)/3))+15),30))+(22*MOD((32+(2*MOD(INT(A1/100),4))+(2*INT(MOD(A1,100)/4))-(MOD((19*(MOD(+A1,19))+(INT(A1/100))-(INT(INT(A1/100)/4))-(INT((INT(A1/100)-(INT((INT(A1/100)+8)/25))+1)/3))+15),30))-(MOD(MOD(A1,100),4))),7)))/451))+114)/31),MOD((MOD((19*(MOD(+A1,19))+(INT(A1/100))-(INT(INT(A1/100)/4))-(INT((INT(A1/100)-(INT((INT(A1/100)+8)/25))+1)/3))+15),30)+MOD((32+(2*MOD(INT(A1/100),4))+(2*INT(MOD(A1,100)/4))-(MOD((19*(MOD(+A1,19))+(INT(A1/100))-(INT(INT(A1/100)/4))-(INT((INT(A1/100)-(INT((INT(A1/100)+8)/25))+1)/3))+15),30))-(MOD(MOD(A1,100),4))),7)-(7*INT(((MOD(+A1,19))+(11*MOD((19*(MOD(+A1,19))+(INT(A1/100))-(INT(INT(A1/100)/4))-(INT((INT(A1/100)-(INT((INT(A1/100)+8)/25))+1)/3))+15),30))+(22*MOD((32+(2*MOD(INT(A1/100),4))+(2*INT(MOD(A1,100)/4))-(MOD((19*(MOD(+A1,19))+(INT(A1/100))-(INT(INT(A1/100)/4))-(INT((INT(A1/100)-(INT((INT(A1/100)+8)/25))+1)/3))+15),30))-(MOD(MOD(A1,100),4))),7)))/451))+114),31)+1) It also provides this method: =ROUND(DATE(A1,4,1)/7+MOD(19*MOD(A1,19)-7,30)*14%,0)*7-6 I wonder which one I should use
|
# ? Feb 14, 2013 02:32 |
|
Oh man, it's just been pointed out to me I was using sequential integers for session ids.
|
# ? Feb 14, 2013 16:49 |
|
|
# ? May 25, 2024 03:49 |
|
Zombywuf posted:Oh man, it's just been pointed out to me I was using sequential integers for session ids. So was I until this last update, happens to the best of us
|
# ? Feb 14, 2013 18:35 |