|
leper khan posted:A third party is /providing/ an API, and doesn't know if it works because I haven't provided them a working client application. If you give me the URI for it I'll write a twitter robot that tweets random information from it at Barack Obama.
|
# ? Oct 22, 2013 16:46 |
|
|
# ? May 17, 2024 19:00 |
|
Gonna have to say that this one belongs here: $460m loss due to technical mismanagement quote:13. Upon deployment, the new RLP code in SMARS was intended to replace unused code in the relevant portion of the order router. This unused code previously had been used for functionality called “Power Peg,” which Knight had discontinued using many years earlier. Despite the lack of use, the Power Peg functionality remained present and callable at the time of the RLP deployment. The new RLP code also repurposed a flag that was formerly used to activate the Power Peg code. Knight intended to delete the Power Peg code so that when this flag was set to “yes,” the new RLP functionality—rather than Power Peg—would be engaged. Never pass up an opportunity to make things worse: quote:In one of its attempts to address the problem, Knight uninstalled the new RLP code from the seven servers where it had been deployed correctly. This action worsened the problem, causing additional incoming parent orders to activate the Power Peg code that was present on those servers, similar to what had already occurred on the eighth server. Instead of a 1/8 failure rate, let's just make a consistent 8/8, consistency is always important. The entire SEC report on the incident is a great read, including that they had no sanity check on orders and were happily "selling" 3.15b in stock they didn't have.
|
# ? Oct 23, 2013 05:26 |
|
Amarkov posted:C#, like Java, does not support multiple inheritance from non-interface classes. So making an empty abstract base class severely limits your ability to modify things. However if you are using TDD or something similar, then you need to have the interface to Mock, but true i guess with nothing in the interface to mock is a bit stupid.
|
# ? Oct 23, 2013 07:43 |
|
TheresaJayne posted:However if you are using TDD or something similar, then you need to have the interface to Mock, but true i guess with nothing in the interface to mock is a bit stupid. To test stuff like that use inheritance, I was blown away by the TestableBar : Bar that overrides the virtual method Foo GetFooDependency to test. Art of Unittesting owns!
|
# ? Oct 23, 2013 08:37 |
|
zokie posted:To test stuff like that use inheritance, I was blown away by the TestableBar : Bar that overrides the virtual method Foo GetFooDependency to test. If you're using dependency injection (I don't know what .NET frameworks exist but I'm sure they exist) then you can keep the Bar class the same as it was before. In that case there's a SetFooDependency method that serves as a marker for whatever's providing the Bar that the Bar also needs a Foo. The difference between the test case and the actual code is that the provider used creates a Foo or MockFoo depending on the circumstances.
|
# ? Oct 23, 2013 11:45 |
|
This is more of a development bumblefuck than an actual horror of coding, but whatever. Basically I've worked myself out of stuff to do for my features of $PROJECT. So, I was told to go through a big rear end list of services exposed by $CLIENT for $PROJECT to consume, and a list of $CONTROLS for $PROJECT which make use of those services. Nothing was documented, and nobody could tell me poo poo except have fun and good luck. They said $RELATEDPROJECT used these services and my project's $CONTROLS will copy what $RELATEDPROJECT did, and to look in their source and talk to the guys in the shared office who work on that. Whee! One of the first things I found out is that we don't have documentation for these services that both $PROJECT and $RELATEDPROJECT consume. Then I found out that I needlessly replicated something that was already done, but since nobody knew it was done, it just sorta sat there in the ether. I then find out "Oh, $GUYWHOLEFT was doing all that stuff." Too bad nobody kept track of what he was doing and he didn't write anything down. Oh, and these $CONTROLS are a nice heady mix of Razor, jQuery, knockout, and server side generated html.
|
# ? Oct 23, 2013 20:06 |
|
That's a project management horror.
|
# ? Oct 23, 2013 20:15 |
|
Oh yeah we switched team leads around the time the guy who did undocumented stuff left
|
# ? Oct 23, 2013 20:36 |
|
Java code:
Java code:
|
# ? Oct 24, 2013 16:15 |
|
PHP.net was comprimised with a javascript injection exploit of some kind and blocked by google
Jewel fucked around with this message at 16:49 on Oct 24, 2013 |
# ? Oct 24, 2013 16:47 |
|
Does anybody know a good list or website about coding horrors or funny coding constructions? Lately a friend sent me some over and I'm having fun in guessing what the result will be. For example (in Python): quote:x = 1 (Allegedly) gives true2. Or (Java): quote:class A { prints out 1 (if I remember correctly).
|
# ? Oct 24, 2013 22:20 |
|
for the love of god use [code] tags
|
# ? Oct 24, 2013 22:43 |
|
Those are both incredibly obvious, but very small changes could be made to make them far less predictable. In the Python example, return x instead of True. In the Java example, call b.m(a) instead of a.m(b).
|
# ? Oct 24, 2013 22:45 |
|
Kalenden posted:Does anybody know a good list or website about coding horrors or funny coding constructions? http://thedailywtf.com/ Kalenden posted:Does anybody know a good list or website about coding horrors or funny coding constructions? ManoliIsFat fucked around with this message at 23:24 on Oct 24, 2013 |
# ? Oct 24, 2013 22:58 |
|
Kalenden posted:Does anybody know a good list or website about coding horrors or funny coding constructions? Here. That python one you shared won't even work since Python is whitespace-sensitive.
|
# ? Oct 24, 2013 23:02 |
|
And the java one will print 3, and I'm not sure why anyone would think otherwise?
|
# ? Oct 24, 2013 23:23 |
|
crazypenguin posted:And the java one will print 3, and I'm not sure why anyone would think otherwise? Because a similar program in C++ will print 1.
|
# ? Oct 24, 2013 23:48 |
|
crazypenguin posted:And the java one will print 3, and I'm not sure why anyone would think otherwise? I maybe have my retarded goggles on but why 3 - is Java method overloading weird?
|
# ? Oct 25, 2013 00:06 |
|
crazypenguin posted:And the java one will print 3, and I'm not sure why anyone would think otherwise? Because you're passing in a B (not up-cast), so it should print 2?
|
# ? Oct 25, 2013 00:07 |
|
Kilson posted:Because you're passing in a B (not up-cast), so it should print 2? I think so too but dont really do much java
|
# ? Oct 25, 2013 00:17 |
I use to work for this lovely company. There was literally nothing about that place that was not a coding horror. No source control, tests or qa, separate development environment, or sql sanitation. I could go on all day. Thankfully, I have found a much better place to work for since then.
|
|
# ? Oct 25, 2013 00:36 |
|
return0 posted:I maybe have my retarded goggles on but why 3 - is Java method overloading weird? Java decides which overloaded method signature to use based on the compile-time types: Java code:
When a method is overridden, the JVM always calls the override on most specific runtime type. The runtime type of (variable) "a" is (class) "B": Java code:
|
# ? Oct 25, 2013 00:44 |
|
Posting Principle posted:Because a similar program in C++ will print 1. Not if you include the implicit virtual keyword. Kilson posted:Because you're passing in a B (not up-cast), so it should print 2? But A doesn't have an overload that takes B. Java is single dispatch. return0 posted:is Java method overloading weird? No, it's pretty normal. Double dispatch implies a non-trivial run-time overhead cost. Zhentar fucked around with this message at 00:51 on Oct 25, 2013 |
# ? Oct 25, 2013 00:48 |
|
Zhentar posted:Not if you include the implicit virtual keyword. lmao i'm a loving idiot welp. public nonstatic Java methods are implicitly virtual Posting Principle fucked around with this message at 00:54 on Oct 25, 2013 |
# ? Oct 25, 2013 00:51 |
|
Sedro posted:It is the combination of overloads and overrides. Overloads happen at compile and overrides happen at runtime. Well how about that. I figured it found the specific runtime type first (being B), and only then applied the arguments, which would have caused it to print 2. Thanks for teaching me a new thing!
|
# ? Oct 25, 2013 03:29 |
|
Kilson posted:Well how about that. I figured it found the specific runtime type first (being B), and only then applied the arguments, which would have caused it to print 2. Thanks for teaching me a new thing! Remember internally overloads are actually getting name mangled as slightly different methods, so at compile time its determined which is being called. You can then override it at runtime, but its going to be looking for that specific parameter signature because the overloaded methods are actually different. Something like m_b(B b) and m_a(A a), though not so trivial. As Zhentar said it would require double dispatch to check parameter typing at runtime, an extra vtable lookup, so you don't want that for every case. But you can write a method to do the lookup manually when needed. Zaphod42 fucked around with this message at 16:03 on Oct 25, 2013 |
# ? Oct 25, 2013 15:51 |
|
Not really specific code, but I found out today the website manager for my fire company's website is all in flash for some godforsaken reason. Simple things like editing a news feed takes like 30 minutes for one little article because every edit I do has a 3 second lag. I'm definitely going to rebuild this site, but goddamn WTF ever thought a flash backend was a good idea?
|
# ? Oct 25, 2013 16:51 |
|
dwazegek posted:
If you think that's fun, check out some of the code for the Microsoft.VisualBasic library. The amount of crap they did just to make VB6 transitions to VB.Net is ridiculous.
|
# ? Oct 25, 2013 17:12 |
|
Ironsights posted:I'm definitely going to rebuild this site, but goddamn WTF ever thought a flash backend was a good idea? Rich Internet Applications was a horrible thing Macromedia threw their then-tremendous weight behind. If it's any consolation, it was probably at least as painful to develop as it is to use.
|
# ? Oct 25, 2013 20:55 |
PhonyMcRingRing posted:If you think that's fun, check out some of the code for the Microsoft.VisualBasic library. The amount of crap they did just to make VB6 transitions to VB.Net is ridiculous. It's been forever since I used VB6, and now you've got me curious what they did. Mind filling us in?
|
|
# ? Oct 25, 2013 21:06 |
|
Short but sweetcode:
|
# ? Oct 26, 2013 04:02 |
|
I work with some seriously smart people. But I also work on a huge codebase that has evolved over many years and, occasionally, been exposed to the tender ministrations of interns. And the smart people are sometimes pressed into service on technologies they are unfamiliar with. So every once in a while, I find something horrifying. Like today! See, we have an internal service. And we have a small, Django-based web interface for monitoring the status of this service. Today, I was asked to add a feature to this interface. What I expected to find:
What I found:
|
# ? Oct 26, 2013 04:22 |
|
ikanreed posted:Short but sweet Let's hope x is never actually null!
|
# ? Oct 26, 2013 04:38 |
|
ToxicFrog posted:
This is basically "client-side templating 101." Though really, "reconstruction of data" shouldn't be needed if you have an API that's spitting out a format your JS/templates consume, and it can get ugly if it's an ad-hoc implementation and not based on one of many libraries that do this. It's done so that no duplication of effort is required when making web applications that have lots of front-end interaction. You generally don't want to have to have both server- and client- side templates doing the same thing. (of course if this is a mostly static page with no rich interactivity then yeah it's way more effort than it's worth )
|
# ? Oct 26, 2013 05:12 |
|
code:
My Rhythmic Crotch fucked around with this message at 05:34 on Oct 26, 2013 |
# ? Oct 26, 2013 05:26 |
|
I'm confused by the </tr> without <tr> Does that return a table full of first_name last_name?
|
# ? Oct 26, 2013 05:29 |
|
I forgot the <tr>. It returns this:code:
|
# ? Oct 26, 2013 05:35 |
|
At a previous job, this is what the system did to look up a user's email address stored in a database: 1) In another database, look up the application ID in a different database to find the location of the database with the user information in it. 2) Convert the request to XML, and http post it to something running ASP.NET on the same server 3) The asp.net page converts the XML request into a different format of XML, and looks up the application ID in a database to find out what port the application is listening on. 4) asp.net does an http post back to the original application with the XML request. 5) The application reads the database information and request out of the XML, and retrieves the email address from the database, and packages it up in XML top send back to asp.net 5) asp.net converts the response XML into different XML, and returns it to the application. I'd been asked to look into why the system was too slow. I replaced all that with a function call.
|
# ? Oct 26, 2013 09:37 |
|
My Rhythmic Crotch posted:
Are these names entered into the database from a controlled source? How many customers do you have whose name is <script src="http://some.evilsite.ru/exploit.js"/> ?
|
# ? Oct 26, 2013 10:17 |
|
|
# ? May 17, 2024 19:00 |
|
It's for an internal application, thankfully. It's easy to inject SQL into it though. In fact other developers needed to get information out of that app, and just about the only way to do it was SQL injection. I built an API for it though, so it's all good now. Well, my API is okay, the old site is still as crufty as ever.
|
# ? Oct 26, 2013 17:17 |