|
How much of a hack do you have to be to have to use someone else's linear interpolation function? If you didn't take intro to algebra you probably should not be coding games.
|
# ? Sep 25, 2014 15:09 |
|
|
# ? Jun 8, 2024 07:05 |
|
Corla Plankun posted:How much of a hack do you have to be to have to use someone else's linear interpolation function? Eh, basic functions like that are so commonly used that reinventing them for every project would just end up leading to lots of bugs from typos. You might as well say, "a library sort function? If you can't implement bubble sort on your own then you probably should not be coding anything." Using a math library instead of rolling your own poo poo so you can stroke your coding penis does not qualify as a coding horror. Far more coding horrors stem from people trying to reinvent the wheel instead of making use of either the standard library or third party libraries.
|
# ? Sep 25, 2014 15:22 |
|
Corla Plankun posted:How much of a hack do you have to be to have to use someone else's linear interpolation function? I use std::swap, what do you think about that.
|
# ? Sep 25, 2014 15:24 |
|
hobbesmaster posted:I use std::swap, what do you think about that. Go back to algorithms 101 you scrub.
|
# ? Sep 25, 2014 15:28 |
|
It would literally take me less time to write it than it would to find a library. If you already have a library for it built in then go hog wild!
|
# ? Sep 25, 2014 15:50 |
|
Jewel posted:If you take a look at those equations, you can probably see something massively wrong straight away. They're all wrong. But they weren't wrong? Messy, yes, but not really wrong. The only thing I'd say was wrong with it was those unnecessary bounds checks at the start, but you didn't fix those.
|
# ? Sep 25, 2014 16:47 |
|
Vanadium posted:What does bash parse functions out of environment variables in the first place? It's the only way to export shell functions to subshells. Well, I suppose you could also put them in a magic file somewhere, but you couldn't do something nice like using a proper IPC mechanism, because you do not control how your subshells are started (consider something like the -exec action to find(1)). At the end of the day, it comes down to parsing the functions as text, and the environment is really the only sensible place to put them if you want this feature. The problem is not as much this dumb feature, as the fact that the feature (and its bugs) were forced upon people who ask for just /bin/sh, expecting just a POSIX shell. Now, on good Unices, /bin/sh is not going to be bash (it's dash on Ubuntu and I think Debian, and something similar on *BSDs), but CentOS/Red Hat seems afflicted. Stupid operating systems.
|
# ? Sep 25, 2014 16:48 |
|
Something I noticed today (typed in from memory so probably not 100% accurate):code:
|
# ? Sep 25, 2014 16:50 |
|
That return line is something else alright
|
# ? Sep 25, 2014 17:01 |
|
Isn't that whole thing justcode:
|
# ? Sep 25, 2014 17:03 |
|
Jewel posted:Isn't that whole thing just It's supposed to be a sign extension from 31 to 32 bits, yes. But obviously the author didn't trust that the simple way to do it (shift left, then right) would work. As for the thought process (if any) that led to doing it twice, and to the utterly insane last expression - I have no idea. The fun bit? There are probably some chips in your smartphone, and your car, that were tested using the software containing this beauty.
|
# ? Sep 25, 2014 17:17 |
|
Came here to vent.... Working with a third party XML API. When you submit XML booleans are in any of these formats Yes : No Y : N 1 : 0 True : False TRUE : FALSE On : Off All are case sensitive, and the responses differ from the requests. All the documentation says for each field is something like, "Use this to indicate such and such", it doesn't tell you what to use for any of them. The only way to do it is trial and error on each and every one, oh yeah, if the value is wrong you don't get an error, it just ignores it and sets it to the default value, but nowhere in the docs does it say what the default value is, for some its true, others its false. I emailed them and they said to get a developer to respond its like $150 per hour with a half hour minimum and they won't talk to me, the questions have to come from my client via a scheduled phone call. Its like they went out of their way to make this as frustrating as possible. Their constants are the same way. Some are camel case, some are all lower case, some are all caps, they don't list the values anywhere. gently caress YOU. Shoot me now.
|
# ? Sep 25, 2014 17:28 |
|
Also remember that in as1 the built-in xml parser was worse than one written in as. Slow as gently caress as1. Anything from that era should be scrutinized carefully. As for the current js dudes copying as1: you're just now finding out that js developers aren't the smartest people on the block?
|
# ? Sep 25, 2014 17:47 |
|
Zopotantor posted:But obviously the author didn't trust that the simple way to do it (shift left, then right) would work. Unless you compile with -O0 and can guarantee this will never change, this isn't an unreasonable fear. The rest is still comedy though (especially leaving in the line of code that they think won't work, heh).
|
# ? Sep 25, 2014 17:48 |
|
tef posted:It's not bash related, it's just a high impact vuln coming out soon: I don't have any details beyond a) it's happening, and b) good luck with AWS this weekend Yeah, here's a little bit of info on what Amazon is planning starting tomorrow: http://www.theregister.co.uk/2014/09/25/amazon_readies_global_glory_reboot/ Bizarrely the comments have some useful info.
|
# ? Sep 25, 2014 18:55 |
|
Scaramouche posted:Yeah, here's a little bit of info on what Amazon is planning starting tomorrow: We're currently scaled up to almost double as they work through all of this
|
# ? Sep 25, 2014 19:17 |
|
Corla Plankun posted:How much of a hack do you have to be to have to use someone else's linear interpolation function? Yeah who needs LAPACK, I've taken linear algebra I'll just rewrite all of these libraries myself in something reasonable like Ruby or PhP
|
# ? Sep 25, 2014 19:46 |
|
Corla Plankun posted:It would literally take me less time to write it than it would to find a library. If you already have a library for it built in then go hog wild! If you're making games and don't already have a library with lerp in it, what are you doing?
|
# ? Sep 25, 2014 20:13 |
|
QuarkJets posted:Yeah who needs LAPACK, I've taken linear algebra I'll just rewrite all of these libraries myself in something reasonable like Ruby or PhP That's certainly an interesting comparison.
|
# ? Sep 25, 2014 21:05 |
|
So I'm a CJ dealing with a product escalation right now. We have a data team that has created stored routines for MySQL, which they've been using for a while. Now we have a product that has started to use these routines, because they need the same kind of data. Turns out, in the event of an error the data team's routines force a mysql error in the form of making a select for an invalid column from a non-existent table. They neglected to tell the other team about this. So there are three kinds of "values" that these things return:
So now there's a scramble and I probably have to stay late.
|
# ? Sep 25, 2014 21:33 |
|
Buildbot posted:Properties load speedup
|
# ? Sep 25, 2014 22:22 |
|
Working on some code cleanup today, I found this.code:
code:
I implemented a validation routine to match the company specs that the value must always be exactly a 6 digit number. Another service that all communication to the outside has to pass through was supposed to send us the 6 digit number so we could check it against the one in the document. That other service uses LDAP as their backing data store which stores the BAC as an 11 or 17 digit number with zeros padded in front. They send this number directly to us without reducing it back to the agreed upon and company standards size. I fought against changing my code on the basis that the clients shouldn't be sanitizing the data sent from the service when the service is the one sending it wrong. Unfortunately, I was overruled for political reasons. At the time that we found out about the problem, I was busy fixing my senior coworkers' multi-threading issues. Since I was busy with the multi-threading issues, one of the seniors decided he was going to work with the guy from the service and fix it. Rather then fixing the regular expression to match 6 digits prefixed by either 11 or 17 0's, he chose to do it that way. This is part of why my job makes me want to drink.
|
# ? Sep 26, 2014 15:48 |
|
Jewel posted:easings... Having had to implement our own parametrized easings (because why not...) this is particularly interesting: http://greweb.me/2012/02/bezier-curve-based-easing-functions-from-concept-to-implementation/
|
# ? Sep 26, 2014 16:36 |
|
eithedog posted:Having had to implement our own parametrized easings (because why not...) this is particularly interesting: http://greweb.me/2012/02/bezier-curve-based-easing-functions-from-concept-to-implementation/ Yeah, I wrote my own C# easing library since then and it's super parameterised and generic and you can pass in your own bezier curve if you want to and it'll work great, so that's fun. I'm gonna be releasing on github in a day or two so check it out. It doesn't have direct bezier support but it's so generic that it's no different to plug in a bezier than it is a predefined provided easing function. Edit: Sneak edit to say I released it at http://github.com/Jewelots/Betwixt There's more info in my post in the gamedev thread that I'm not gonna copypaste here. Jewel fucked around with this message at 05:57 on Sep 27, 2014 |
# ? Sep 26, 2014 16:46 |
|
I don't think I've talked about this probable horror from my old job yet. When the iPad came out we had to do some work to make the horrifying frame-using monstrosity that was (and still is!) the UI work. In the end, it worked about as well as it did on the desktop, which meant it was clunky and unforgivably slow for what it did, but whatever. Then the apps came. Every site had to have an app because apps are the new thing and everyone loves apps because apps apps apps apps apps! Make the site not suck and pitch that to our clients? Nah, we have to have an app. So someone made an app that was basically a webview with a set address and that got rejected because the reviewer saw it for what it was. The way around this was to staple a local file cache to the webview, apparently, because that's what we did. The central horror came in during the setup process. There was a special touch sequence (basically an easter egg) in the app that would pop up an alert with a path in it which was, IIRC the path in the device filesystem that app lived in, and there was a hexed SHA or MD5 component of the path became part of the configuration to tell the file cache where to store stuff. The main reason the cookie-cutter copies of the app were rejected on first submission for a while was that the hash component of the path was transcribed wrong and whoever built it didn't bother to check to make sure it worked the second time they built it because that involved deploying it to the iPad, which involved mindless repetitive work in iTunes, which of course is painful and impossible to automate because iTunes. Just to be clear, it'd go 1) configure and build Client.app 2) deploy to iPad* 3) use easter egg to get hash value 4) configure and build Client.app 5) deploy again* 6) check 7) submit to app store. No, the easter egg was not disabled in the submitted version. I checked. Hundreds were made and it looks like ~4 of them are still in the store I think I already mentioned the production environment, which was really the essence of *optional: wish firey death upon the iTunes team and their entire families
|
# ? Sep 26, 2014 19:48 |
|
KARMA! posted:Also remember that in as1 the built-in xml parser was worse than one written in as. Slow as gently caress as1. It's a home-rolled XML parser too, that implements quasi-XML with weird behavior like this "ignore whitespace" property: http://hg.mozilla.org/tamarin-redux/file/default/core/XMLParser16.cpp Of course we have to reimplement it in Shumway and other Flash Players with 100% accuracy because real-world content depends on the quirks.
|
# ? Sep 27, 2014 07:45 |
|
Vanadium posted:I think I get how people end up injecting environment variables, but who thought it would be a good idea to interpret random strings found at arbitrary places in the environment as functions at startup? I've been using the first two options because I didn't know about the function export mechanism, but if I had I'd be pretty heavily invested in it by now. This feature of Bash is in the oldest available source code released in August 1996, and probably a few years older than that. That's back when people entrusted their passwords to telnet. The real horror is that the vulnerability of this plainly documented feature is only now being "discovered". Gazpacho fucked around with this message at 09:57 on Sep 27, 2014 |
# ? Sep 27, 2014 09:45 |
|
Maybe the people who want to rewrite the entire userland to run on node.js somehow are on to something.
|
# ? Sep 27, 2014 10:18 |
|
Gazpacho posted:In my bashrc I have several interactive scripts that use "xargs bash -c" to run smaller scripts on each of a series of input records. In these smaller scripts, I have three options: I can use only plain old commands, or I can (re)define functions directly within them, or I can use the mechanism involved in this vulnerability to export functions from my interactive shell through xargs into the script. The issue isn't the idea of inheriting function definitions, it's the implementation. You're supposed to be exporting functions to the subshell with export -f. The issue is that the code to do this was brain-dead, roughly equivalent to this: code:
|
# ? Sep 27, 2014 11:54 |
|
Or if the legions of broken programs that pass an unsanitized attacker-controlled environment to bash didn't actually do something so idiotic...
|
# ? Sep 27, 2014 19:16 |
|
I am finding it teeth-grindingly annoying right now that you cannot define a MATLAB function inside a script file.
|
# ? Sep 27, 2014 20:14 |
|
I agree that it's annoying, but it is also a nice little "push" to get people to write complicated things as functions-with-subfunctions instead of weird monolithic scripts. I have re-used a ton of things I've written because Matlab obliged me to write functions instead of scripts.
|
# ? Sep 27, 2014 21:00 |
|
pseudorandom name posted:Or if the legions of broken programs that pass an unsanitized attacker-controlled environment to bash didn't actually do something so idiotic... They didn't. They passed an environment to /bin/sh, in which they knew that important shell variables (like PATH) were not tampered with. Bash pretends to be /bin/sh, but is not, resulting in this mess.
|
# ? Sep 27, 2014 21:20 |
|
Basically any bit of code needs to be prepared for any other code it might invoke directly or indirectly to take completely random data it can get somehow get its hands on and execute that data as trusted code in turn, or it's the first bit of code's fault. Programs like web servers implementing CGI are in the wrong for trying to co-opt environment variables to pass information about the environment other invoked programs are running in, since everybody knows that without exception all environment variables exist to store shell scripts in for bash's benefit and need to be formatted/escaped/sanitized with bash's specific quirks in mind.
|
# ? Sep 27, 2014 22:09 |
God drat I hate myself, just found something like this:code:
|
|
# ? Sep 29, 2014 20:54 |
|
Manslaughter posted:If you can't see it, whoever wrote this used return instead of break and I spent way too long trying to figure out why DoAVeryImportantFourthThing wasn't being called. These are the worst problems to find.
|
# ? Sep 29, 2014 21:04 |
|
http://espn.go.com/blog/nfcwest/post/_/id/41811/how-to-identify-nfls-best-quarterbacks posted:The late Don Smith never claimed his passer-rating formula was perfect. Bolding mine. This would be a fun project. I don't know if any sort of calculation I could come up with would be able to beat a 10,000 line algorithm though .
|
# ? Sep 29, 2014 23:21 |
|
If player.lastname="manning" then pass.quality="rocket laser arm"
|
# ? Sep 29, 2014 23:30 |
|
I like that the 10,000 lines is one of the formula's algorithms.
|
# ? Sep 30, 2014 00:15 |
|
|
# ? Jun 8, 2024 07:05 |
|
Knyteguy posted:Bolding mine. Imagine you've got a nontechnical superior asking you for the biggest semi-defensible LOC count you could come up with. Calling into a library? Include the library's wc -l count. Don't go gettin' fancy with some grep -c ';' nonsense, we want a big number.
|
# ? Sep 30, 2014 00:18 |