|
It's kind of annoying that they don't exclude interfaces and annotations. Bean is included with spring .
|
# ? Apr 12, 2016 15:15 |
|
|
# ? Jun 5, 2024 11:10 |
|
No but real talk how is that REST monstrosity not in the title?
|
# ? Apr 12, 2016 15:35 |
|
code:
|
# ? Apr 12, 2016 15:39 |
|
How does that even work?
|
# ? Apr 12, 2016 15:46 |
|
Probably in a way the original developer didn't expect!
|
# ? Apr 12, 2016 15:54 |
|
It just returns DateTime.Now (after pointlessly overwriting something on the method-local stack with it). In C# you can use the resulting value of an assignment expression in a parent expression just like in C. I'd guess that the author originally thought they were overwriting a pointer but DateTime is a struct not a class, so it's a value type and no implicit pointers are involved. Oh and it wouldn't work if DateTime were a class, either, unless the argument was declared with an out keyword, so someone took the C in C# too literally.
Munkeymon fucked around with this message at 16:04 on Apr 12, 2016 |
# ? Apr 12, 2016 16:01 |
|
Just found this lovely little bit of code in production:code:
code:
|
# ? Apr 13, 2016 15:05 |
|
I'm trying to picture what that maybe used to do and I'm drawing a blank.
|
# ? Apr 13, 2016 15:42 |
|
I like how the test doesn't even test if the string is trimmed.
|
# ? Apr 13, 2016 16:06 |
|
CPColin posted:I'm trying to picture what that maybe used to do and I'm drawing a blank. The code is so old that the CVS history is long gone, probably lost when we moved to SVN and then Git. Our code base is old as gently caress. HardDisk posted:I like how the test doesn't even test if the string is trimmed. That also made me laugh.
|
# ? Apr 13, 2016 22:10 |
|
My guess would be that it used to have a static counter in it, so that every time you called it you'd get back a unique name for your namespace. Which explains why the test would be calling it twice with the same input, for example. Not sure why someone would come along and remove that though, unless they fundamentally misunderstood the purpose or something.
|
# ? Apr 14, 2016 02:04 |
|
Jabor posted:fundamentally misunderstood the purpose or something. Knowing some of my former colleagues this was the most likely case.
|
# ? Apr 14, 2016 09:35 |
|
There's a page where you can enter stuff to search by So here's the beginning of the function that gets called when you click search C# code:
|
# ? Apr 14, 2016 15:46 |
|
Oopsie. http://www.independent.co.uk/life-s...e-a6984256.html quote:“I run a small hosting provider with more or less 1535 customers and I use Ansible to automate some operations to be run on all servers,” wrote Marco Marsala. “Last night I accidentally ran, on all servers, a Bash script with a rm -rf {foo}/{bar} with those variables undefined due to a bug in the code above this line.”
|
# ? Apr 14, 2016 19:15 |
|
I have an axe to grind, so I blame Bash.
|
# ? Apr 14, 2016 19:27 |
|
sucks to be him, but i'm going to laugh anyway because it was the backup script, and that's just too good
|
# ? Apr 14, 2016 19:31 |
The best part is at the bottom when he swaps if and of when running dd. It might be a troll, but it's pretty funny regardless. VikingofRock fucked around with this message at 19:44 on Apr 14, 2016 |
|
# ? Apr 14, 2016 19:31 |
|
I'm taking a (grad-level) parallel programming class, and all our graphs are supposed to be done in a way such that the values get larger when they get faster (e.g. y axis is op/ns as opposed to ns/op). This isn't wrong, but it's so weird to me since outside this class I don't think I've ever seen people measure performance that way. The only place I can think of where this is standard is frames per second, and even then for most optimization purposes I see people measure (nano/milli)seconds per frame anyway. I guess processor-level operation speeds are also measured this way (e.g. FLOPS, the name MIPS), but most benchmark systems, and most results I've seen online and in papers, tend to do it the other way. I don't know why, but it somewhat unreasonably bothers me, even if it's equivalent and I'm sure there are frameworks I'm not aware of that do it this way.
|
# ? Apr 14, 2016 21:51 |
|
Isn't your X axis core or thread count? Certain things make a lot more sense if larger is faster. If you're trying to determine if a parallel algorithm is superlinear, it would be difficult to determine from a 1 core run taking 100s and an 8 core run taking 14s. Much easier to tell if the graph shows 10ops/sec to 78ops/sec. I mean, ignoring that it's obvious that we're checking against 12.5 or 80.
|
# ? Apr 14, 2016 22:11 |
|
Jsor posted:I'm taking a (grad-level) parallel programming class, and all our graphs are supposed to be done in a way such that the values get larger when they get faster (e.g. y axis is op/ns as opposed to ns/op). This isn't wrong, but it's so weird to me since outside this class I don't think I've ever seen people measure performance that way. The only place I can think of where this is standard is frames per second, and even then for most optimization purposes I see people measure (nano/milli)seconds per frame anyway. If anything it's the other approach that's weird. We talk about performance in terms of "speed", and speed is distance/time by definition.
|
# ? Apr 15, 2016 00:53 |
|
Fnords/second is easily the more common when fnords are the sub-computations that are being run in parallel rather than in sequence. The alternative can get confusing. For instance, ray tracing performance is almost always measured in rays per second or intersections per second. Someone instead stating that they have reduced the average computation time per intersection test from 10ns to 5ns by doubling the number of CPUs used would be very easy to misread as stating that there's an improvement for each individual test (due to better locality or whatever) rather than the intended meaning of getting linear scaling with CPU count. For evaluations of the final results in the same field I've seen seconds per frame (100ms), frame per second (10 FPS) and time to final image (1h) in papers. I've never seen anyone specify results in images per hour, but I wouldn't be terribly surprised if someone did. Speculatively, I'd say that non-real time problems are often more naturally framed as "how long do I have to wait", while real time problems are often more naturally framed as "how fast does it go". Xerophyte fucked around with this message at 02:45 on Apr 15, 2016 |
# ? Apr 15, 2016 02:39 |
|
In parallelisation it is very common to graph "speedup". That is, how much faster the parallel implementation is for a given thread count, compared to the sequential one (or even just the parallel implementation with one thread, to measure scaling). Nothing unusual or horrible there.
|
# ? Apr 15, 2016 09:29 |
|
I am crying. Troll or not it is absolute gold. http://serverfault.com/questions/769357/recovering-from-a-rm-rf Imagine if that is his real name too.
|
# ? Apr 15, 2016 12:00 |
|
jiggerypokery posted:I am crying. Troll or not it is absolute gold. http://serverfault.com/questions/769357/recovering-from-a-rm-rf Imagine if that is his real name too. It's gone now, but yeah, I think my advice to him would be to look into another industry, because he is probably done in this one.
|
# ? Apr 15, 2016 15:16 |
|
That's odd they deleted it entirely, I guess they hate being covered by the news. Unless maybe it was discovered to be a hoax? Would make some sense, especially after the 'dd' comment the author made at one point.
|
# ? Apr 15, 2016 15:19 |
|
I think I remember Bryan Cantrill saying in a talk that Solaris did something clever to rm without technically breaking POSIX: if the command's effective targets include /bin/rm, it fails without deleting anything.
|
# ? Apr 15, 2016 16:01 |
|
Doc Hawkins posted:I think I remember Bryan Cantrill saying in a talk that Solaris did something clever to rm without technically breaking POSIX: if the command's effective targets include /bin/rm, it fails without deleting anything. Modern rm versions usually set "--preserve-root" by default, which means rm will not just remove / without you really trying.
|
# ? Apr 15, 2016 16:05 |
|
It smelt like a troll to me, drat good one too. I just hope it wasn't malicious, i.e using someone elses name because that guy is hosed.
|
# ? Apr 15, 2016 16:48 |
|
Hollow Talk posted:Modern rm versions usually set "--preserve-root" by default, which means rm will not just remove / without you really trying. But it will remove /* so it's not as good as it could be.
|
# ? Apr 15, 2016 18:47 |
|
Dylan16807 posted:But it will remove /* so it's not as good as it could be. True, but that's slightly harder to get from screwed up variables than a space or empty string.
|
# ? Apr 15, 2016 22:13 |
|
The real horror is that bash will continue merrily when you use undefined variables. poo poo should crash.
|
# ? Apr 16, 2016 02:49 |
|
Shinku ABOOKEN posted:The real horror is that bash will continue merrily when you use undefined variables. poo poo should crash. It will if you're not a reckless dev and properly include code:
|
# ? Apr 16, 2016 03:08 |
|
It was a hoax by some douchnozzle looking to get his book noticed: http://www.trymodern.com/article/596/this-guy-did-not-delete-his-entire-company-in-one-click
|
# ? Apr 16, 2016 05:27 |
|
Obsurveyor posted:It will if you're not a reckless dev and properly include I consider those useful debugging tools. Declaring your variables with proper flow control is what I would actually recommend for production scripts.
|
# ? Apr 16, 2016 07:00 |
|
C++ code:
|
# ? Apr 17, 2016 23:29 |
|
Bonfire Lit posted:
Aside from the whole "why are you setting array_capacity in the same line as you're declaring this other poo poo", are there actually any good use cases for a C array of raw pointers in C++ code nowadays? I also can't fathom why they're doing the "bitwise and not 3" there.
|
# ? Apr 18, 2016 01:54 |
|
Klades posted:I also can't fathom why they're doing the "bitwise and not 3" there. Along with the "+4", they're probably trying to round up to the nearest multiple of 4.
|
# ? Apr 18, 2016 01:57 |
|
it really should be (array_size+3)&~3 but yeah it's a pretty common and well-known trick
|
# ? Apr 18, 2016 02:05 |
Also it sets array_capacity to a potentially larger number than the actual allocation.
|
|
# ? Apr 18, 2016 06:39 |
|
|
# ? Jun 5, 2024 11:10 |
|
Klades posted:Aside from the whole "why are you setting array_capacity in the same line as you're declaring this other poo poo", are there actually any good use cases for a C array of raw pointers in C++ code nowadays? I see people using arrays of pointers to fake multidimensional arrays in the most nasty way. It is terrible and bad and probably confuses the compiler horribly. In C++, you can probably use some template magic to define a class that gives a nicer multidimensional array interface.
|
# ? Apr 18, 2016 06:45 |