|
Goat Bastard posted:Maybe I am the horror for expecting two references to the same thing to behave in the same way. You should read up on Java's and C++'s object model if you find that confusing. static vs dynamic dispatch Then read the following spoiler. In C++ everything is static dispatch unless you use the keyword 'virtual' in front of the method declaration. In Java all methods are automatically virtual, but data members aren't methods... Beef fucked around with this message at 15:53 on Mar 12, 2012 |
# ? Mar 12, 2012 15:51 |
|
|
# ? Apr 27, 2024 05:29 |
|
I'm not sure whether this makes me laugh or cry... Lets see here: quote:When the GA creates the transfer certificate, it gives it a one year validity range. It uses midnight UST of the current day as the valid-from date and one year from that date as the valid-to date. The leap day bug is that the GA calculated the valid-to date by simply taking the current date and adding one to its year. That meant that any GA that tried to create a transfer certificate on leap day set a valid-to date of February 29, 2013, an invalid date that caused the certificate creation to fail. I'm assuming they're not eating their own dogfood here?
|
# ? Mar 12, 2012 18:41 |
|
I'm becoming convinced that Microsoft, almost as a rule, never eats its own dogfood. It explains garbage like Sharepoint so tidily.
|
# ? Mar 12, 2012 20:14 |
|
Alternate theory, it's written in C++, uses GetSystemTime(), and they didn't read the warning hidden away in the SYSTEMTIME page about modifying the struct to get relative times.
|
# ? Mar 12, 2012 20:28 |
|
pokeyman posted:I'm becoming convinced that Microsoft, almost as a rule, never eats its own dogfood. Which is rather ironic considering that the term came from Microsoft.
|
# ? Mar 12, 2012 20:29 |
|
pokeyman posted:I'm becoming convinced that Microsoft, almost as a rule, never eats its own dogfood. They do use sharepoint. They also host all their email on exchange and 99% of their infrastructure is windows server.
|
# ? Mar 12, 2012 21:22 |
|
hobbesmaster posted:I'm not sure whether this makes me laugh or cry... You'd think they would learn after the Zune leap year bug in 2008.
|
# ? Mar 12, 2012 23:31 |
|
pokeyman posted:I'm becoming convinced that Microsoft, almost as a rule, never eats its own dogfood. A recruiter was talking about flying me out to redmond to interview with the "MS Office Team" for a SDET position. I was tempted but then I figured out the job was really about sharepoint and that tempered my interest level rather significantly.
|
# ? Mar 13, 2012 00:20 |
|
hieronymus posted:A recruiter was talking about flying me out to redmond to interview with the "MS Office Team" for a SDET position. I was tempted but then I figured out the job was really about sharepoint and that tempered my interest level rather significantly. I just did that in January (different team, though). You should go just for the sweet-rear end hotel they let you stay in.
|
# ? Mar 13, 2012 00:22 |
|
shrughes posted:You're saying that as if silently falling through would be a good thing. Which it is not. Crashing the program there is basically the only thing to do. In our C++ code every switch statement has a default case that calls a function unreachable() which prints a backtrace and crashes. I am blatantly stealing this for use in my own code.
|
# ? Mar 15, 2012 07:14 |
|
Chuu posted:I am blatantly stealing this for use in my own code. It might be useful to have __attribute__((noreturn)) (a GCC attribute) on that function. Our unreachable() is actually defined as a macro unreachable(msg, ...) (producing an expression which gets the noreturn property by calling abort()) for some reason.
|
# ? Mar 15, 2012 07:27 |
|
If that's because it gets compiled out in release builds, you might consider having it compile to __builtin_unreachable() in GCC and Clang.
|
# ? Mar 15, 2012 17:41 |
|
rjmccall posted:If that's because it gets compiled out in release builds, you might consider having it compile to __builtin_unreachable() in GCC and Clang. It's not. The breakpoint/stacktrace is compiled out, but that's no reason it couldn't have been a pair of functions. There's basically no reason why it's a macro, come to think of it.
|
# ? Mar 15, 2012 19:35 |
|
I just found this code in production. Let's play the "how many errors can you spot" game. php:<? if (isset($_POST['emailMessage'])) { if ($_POST['contact'] == 'librarian') { $strSQL = 'SELECT EMAIL from registration where id = \'' . $id. '\''; $result = $db->query($strSQL); $To = 'olddeveloper@company.com'; if ($db->num_rows($result) != 0) { $Registration = $db->fetch_assoc($result); $To = $Registration['EMAIL']; } } else { $To = $Email; } $message .= 'Name: ' . $_POST['name'] . "\r\n\r\n"; $message .= 'Email Address: ' . $_POST['email'] . "\r\n\r\n"; $message .= 'Subject: ' . $_POST['subject'] . "\r\n\r\n"; $message .= 'Message: ' . $_POST['message'] . "\r\n\r\n"; $mail = new Zend_Mail(); $mail->setBodyText($message); $mail->setFrom($_POST['email'], $_POST['name']); $mail->addTo('olddeveloper@company.com', 'Old Developer'); $mail->setSubject('Message from Company contact form'); //$mail->send(); $status = 'Message Sent!'; } ?>
|
# ? Mar 15, 2012 19:42 |
|
Zend_Mail does sanitisation in any way right..?
|
# ? Mar 15, 2012 19:47 |
|
Biowarfare posted:Zend_Mail does sanitisation in any way right..? quote:For security reasons, Zend_Mail filters all header fields to prevent header injection with newline (\n) characters. Double quotation is changed to single quotation and angle brackets to square brackets in the name of sender and recipients. If the marks are in email address, the marks will be removed. Fortunately, yes. That is not one of the horrors. (Unless the Zend_Mail docs are wrong, which could also be a horror )
|
# ? Mar 15, 2012 19:57 |
|
Haha how did that even come about, guy must have had some severe ADHD; checks if you're contacting the librarian, executes some SQL that doesn't actually take any parameters from $_POST anyway, if it's not going to the librarian it uses some magic $Email variable, ignores the result either way, then concludes by not sending an email and notifying the user that the email was sent. I bet he wrote it that way as a kind of "why isn't this working? i'll gradually hardcode things until it works..." fix for not using the right $_POST['x'] variable for an image, but couldn't figure out why the email never got sent anyway and just gave up.
|
# ? Mar 15, 2012 20:08 |
|
The Gripper posted:Haha how did that even come about For some background, the contact form is for a webapp that creates a custom donation site for libraries. A librarian can sign up for our service, then give the information to a volunteer to be the "program operator." The contact form is so that a donor can come to the site, and either ask the librarian or the person actually running the program questions. The $id that it uses to pull back the librarian's registration information is set by our header files. The $Email that's used if it's not contacting the librarian is also set by our header files. Those two are legit, and also properly secured and validated. As for the rest, I have no idea. He had to have tried to fix it, couldn't figure out why it wasn't working, thought he'd go back to it... and then it went into production untested.
|
# ? Mar 15, 2012 20:23 |
|
pokeyman posted:I'm becoming convinced that Microsoft, almost as a rule, never eats its own dogfood. Everyone there uses Firefox, Google, and has iPhones
|
# ? Mar 16, 2012 02:15 |
|
I can't tell if you're being serious.
|
# ? Mar 16, 2012 03:20 |
|
pokeyman posted:I can't tell if you're being serious. I can't say I'd blame them.
|
# ? Mar 16, 2012 04:02 |
|
pokeyman posted:I can't tell if you're being serious. While I heavily believe in dogfooding, I really don't understand the problem with using Firefox and Google and such. Probability says that there's probably someone there who uses Bing because he likes it better or because he believes in the company, but if your day job is hacking on PowerPoint or Kinect or something, why does it matter if you use Google? There's no sense in an "all employees must use Bing" policy. I bet that the same is true for most other places as well - there's probably a guy at Google who prefers GitHub instead of Google Code Hosting, and a guy at Apple who works exclusively on Windows or Linux. That said, the one thing that I'm disappointed in is that from my understanding, Microsoft has no commercial desktop products written in the .NET framework. A colleague who works at Xamarin says that SQL Server Management Server 2010 may have a small part of it that's written in WPF. In my opinion, you can't build a platform and make decisions for a platform if the first customer for your platform isn't yourself. If you're not in the trenches using the platform on a day to day basis, your only feedback about the quality of it is customer feedback, which isn't really that useful. In fact, I find myself disgusted at some of the new features in C# 4.0 which are plastered with the "Do Not Use" disclaimer - default function arguments, as an example.
|
# ? Mar 16, 2012 04:05 |
|
Visual Studio 2010 uses WPF, and SSMS uses a lot of stuff from VS, so I'd expect it to be more than a small part. I've been told by a friend who works on Office that antitrust concerns stopped them from using .NET, as it could be viewed as them using a near-monopoly to give their platform an unfair advantage. The settlement finally expired last May, but WinRT suggests that they're still not planning to use .NET for their desktop apps.
|
# ? Mar 16, 2012 04:24 |
|
Plorkyeran posted:I've been told by a friend who works on Office that antitrust concerns stopped them from using .NET, as it could be viewed as them using a near-monopoly to give their platform an unfair advantage. The settlement finally expired last May, but WinRT suggests that they're still not planning to use .NET for their desktop apps. OK, yeah, that's a fair answer. If it's a considerable risk for the company to build products on its own platform (ugh law) then it makes sense not to do it.
|
# ? Mar 16, 2012 04:37 |
|
Here's how dogfooding worked at eBay. Skype is such a lovely instant messenger that of course employees (outside of the Skype unit) didn't want to use it. Management didn't want to admit or was embarrassed to admit that the only way to get people to use Skype instead of AIM was by forcing them. So the "IT department" disallowed AIM usage due to a mysterious, unnamed, made-up "security flaw" in the client. Oddly that "security flaw" never got fixed even after years of updates to the official client.
|
# ? Mar 16, 2012 05:11 |
|
Suspicious Dish posted:While I heavily believe in dogfooding, I really don't understand the problem with using Firefox and Google and such. I don't have a problem with it either. I literally wasn't sure if crazylakerfan was being serious. quote:In fact, I find myself disgusted at some of the new features in C# 4.0 which are plastered with the "Do Not Use" disclaimer - default function arguments, as an example. You're not supposed to use default function arguments in C# 4.0?
|
# ? Mar 16, 2012 07:23 |
|
pokeyman posted:You're not supposed to use default function arguments in C# 4.0?
|
# ? Mar 16, 2012 07:29 |
|
pokeyman posted:You're not supposed to use default function arguments in C# 4.0? There are a few little wriggles with default function arguments. They're not specific to the C# implementation - in fact most optional-parameter implementations have a huge morass of odd behaviour under some conditions. As a quick example, this: code:
code:
code:
|
# ? Mar 16, 2012 07:37 |
|
Jabor posted:Then any existing code that just calls Butts() will still use the old default value - until they get recompiled. This is a pretty nasty trap if you're doing something where stuff might not get recompiled just because a library it uses is updated. You can get around it somewhat by using nullable defaults: code:
|
# ? Mar 16, 2012 08:26 |
|
http://www.jstree.com/documentation/dnd This is kind of subtle, I think. I mean, on the surface the page has a clean layout, it looks like it's very well documented and has nice examples with syntaxt highlighting and all. But look at the "Reorder only demo" Specifically the check_move function: First: Who the gently caress makes code examples with 1-character variable names? code:
And what in the gently caress is m.o? And a couple of lines later code:
The only one-character member names you are allowed to use in public interfaces are "x, y, z", "r, g, b" and "i, j, k", and those are all some kind of vectors.
|
# ? Mar 16, 2012 12:57 |
|
Wheany posted:The only one-character member names you are allowed to use in public interfaces are "x, y, z", "r, g, b" and "i, j, k", and those are all some kind of vectors. What about $ then?
|
# ? Mar 16, 2012 13:52 |
|
Wheany posted:I know it's good to have examples that actually do something real and the developers probably have a strong math background, but giving me something like that when I don't even know which parts are the framework and which parts are the payload isn't all that productive.
|
# ? Mar 16, 2012 14:21 |
|
Vanadium posted:What about $ then? Which $ do you mean? jQuery or Mootools?
|
# ? Mar 16, 2012 14:55 |
|
Suspicious Dish posted:In fact, I find myself disgusted at some of the new features in C# 4.0 which are plastered with the "Do Not Use" disclaimer - default function arguments, as an example. pokeyman posted:You're not supposed to use default function arguments in C# 4.0? Optional Parameters were added primarily to make COM interop less painful. They have some caveats otherwise (especially if you mix overloads and optional parameters with the same function).
|
# ? Mar 16, 2012 16:41 |
|
Zhentar posted:Optional Parameters were added primarily to make COM interop less painful. They have some caveats otherwise (especially if you mix overloads and optional parameters with the same function). Well optional parameters aren't the same as parameter defaults, though in C# I understand you can't do one without doing the other. That said, what are the caveats when using optional parameters in C#?
|
# ? Mar 16, 2012 17:11 |
|
The Gripper posted:
code:
|
# ? Mar 16, 2012 17:18 |
|
Scaevolus posted:Good luck calling a method on a null object. http://msdn.microsoft.com/en-us/library/b3h38hb0.aspx
|
# ? Mar 16, 2012 17:33 |
|
pokeyman posted:That said, what are the caveats when using optional parameters in C#? There are two main ones that I'm aware of. First, the default values are just syntactical sugar for the caller - that is, missing values are not filled in at runtime, but are added to the call site at compile time. This means if you want to change the default value of a parameter, you need to recompile any callers as well. Second, it adds a complication to overload resolution, and won't always behave how many people expect it to. If you make optional parameters using both overloads and default values, it gets hard to understand what your code will actually call. Also, default values and interfaces are... weird, at best.
|
# ? Mar 16, 2012 17:57 |
|
The Gripper posted:The worst is with concurrency frameworks and the like, where the most promising looking example is almost always some complex mathematical computation which probably looks clean and makes a lot of sense to someone that knows that particular math, but to anyone else it's difficult to separate "here's the code I need to use to implement this for my own use" from the "holy god m=p*x ^ 7; _,x=sub1(-y^(x)^add1(m));" part. I can't help but feel that a lot of code like this would be more readable if the mathparts could be written in - and rendered properly by the editor as - LaTeX.
|
# ? Mar 16, 2012 18:26 |
|
|
# ? Apr 27, 2024 05:29 |
|
Zhentar posted:Second, it adds a complication to overload resolution, and won't always behave how many people expect it to. If you make optional parameters using both overloads and default values, it gets hard to understand what your code will actually call. code:
code:
I've had to fix up code once or twice at work where someone has accidentally hidden one method with another this way.
|
# ? Mar 16, 2012 18:41 |