|
HoboMan posted:idk, knowing if one of my util functions throws exceptions or just eats them at a glance would be p useful Or it rethrows the exception as runtime unchecked exception, because the function signature gets really annoying really fast.
|
# ? Jul 21, 2016 18:27 |
|
|
# ? May 24, 2024 01:35 |
|
checked exceptions as a list of recoverable exceptions in a function that if it fails you must try to recover sounds pretty useful to me. just another way to enforce code rules on your project without having to really remember what they are i would never put them in a plugin though, you have to make too many assumptions about Other People's Code. that's where they get really miserable to deal with
|
# ? Jul 21, 2016 18:36 |
|
Xarn posted:Or it rethrows the exception as runtime unchecked exception, because the function signature gets really annoying really fast. Nah. Just declare "throws Exception" and that fixes the function signature problem.
|
# ? Jul 21, 2016 18:51 |
|
HoboMan posted:it's hard to advocate for though since it's basically making the use of exceptions for program flow this this this the only legitimate reason to throw an exception is when something happens that is out of both your scope and your control, like an IO error. everything else is a bug one of my predecessors literally used exceptions as gotos everywhere. in at least two instances he used a try - throw - catch where an if then else would have worked whenever i have to read his code i remember that he quit because he got cancer and I try to feel bad for him, but for some reason I seem to quietly go on to my next task and skip over the actual "feeling bad" part
|
# ? Jul 21, 2016 19:14 |
|
so bad coding can give you cancer? or is it just in exceptional cases
|
# ? Jul 21, 2016 19:19 |
|
i still have no loving idea how to use async poo poo in c# and its extremely frustrating. i think i might even finally have a use case for it too
|
# ? Jul 21, 2016 19:46 |
|
what kind of async stuff like my only experience with .net stuff has been the bastardized form of C++/cli but don't you just connect signals to delegates or w/e?
|
# ? Jul 21, 2016 19:52 |
|
speaking of async, UGH for my concurrency testing bullshit i'm starting five tasks at once and trying to wait for them all to complete but Task.WaitAll is returning before they all complete. HOW COME
|
# ? Jul 21, 2016 19:53 |
|
Bloody posted:i still have no loving idea how to use async poo poo in c# and its extremely frustrating. i think i might even finally have a use case for it too - anything that returns a task is awaitable - await is only available in methods marked async
|
# ? Jul 21, 2016 19:57 |
|
there are tons of gotchas with async like by default if you're doing async stuff w/in a transactionscope weird poo poo will happen so you need to specify that the transactionscope will be doing async poo poo.
|
# ? Jul 21, 2016 20:00 |
|
code:
GameCube fucked around with this message at 20:49 on Jul 21, 2016 |
# ? Jul 21, 2016 20:11 |
|
nextIndex is outside the scope of that lambda and hilarity ensues or something
|
# ? Jul 21, 2016 20:13 |
|
hobbesmaster posted:what kind of async stuff lol i dont even really know. i have a custom i/o device that slowly chugs away and right now its handled in its own tx thread so it doesnt slow down everybody else but sometimes this causes a mess and dealing with the threads when i flush or close is also sometimes making poo poo crash in exciting ways and async seems like the magic handwaves to make it all go away
|
# ? Jul 21, 2016 20:14 |
|
ive had really good help from the gray c# thread and they seem to know that async/await stuff
|
# ? Jul 21, 2016 20:15 |
|
ulmont posted:Nah. Just declare "throws Exception" and that fixes the function signature problem. I think that at that point, everyone would rather have unchecked exception. In other words, I am all for it.
|
# ? Jul 21, 2016 20:21 |
|
hmm actually i wonder if an exception is getting thrown in those tasks that i'm not seeing. wouldn't WaitAll throw that exception though. gently caress
|
# ? Jul 21, 2016 20:29 |
|
FUUUUUUUUUUUUUUUUUCK i just removed the transactions and this poo poo is still broken as gently caress (yay, not my fault?) but there is some magic db bullshit going on and the dba is out today~ i might actually have to postpone a release gently caress
|
# ? Jul 21, 2016 20:37 |
|
nah just ship it broken like everybody else
|
# ? Jul 21, 2016 20:43 |
|
yeah. you're not thinking agile enough
|
# ? Jul 21, 2016 20:44 |
|
NumberFormatException is the best exception.
|
# ? Jul 21, 2016 20:50 |
|
yup greythread solved it in five seconds. can't wait on an async void
|
# ? Jul 21, 2016 21:16 |
|
GameCube posted:yup greythread solved it in five seconds. can't wait on an async void Async void??? Who did an async void? That's kind of verbotten except for very special circumstances.
|
# ? Jul 21, 2016 21:24 |
|
i did without realizing it
|
# ? Jul 21, 2016 21:30 |
|
the only bad thing about checked exceptions is that they don't work very well with java's implementation of lambdas, where what you want is for the lambda to be able to throw any exception that the parent method can handle, but actually it can only throw what its interface declares, and for the standard ones that's nothing. hope you didn't want to do any io in that foreach!
|
# ? Jul 21, 2016 21:36 |
|
why do my unit tests occasionally just halt with no given reason not abort, not fail, just halt. stops everyone else from executing too. wtf
|
# ? Jul 21, 2016 22:15 |
|
Bloody posted:why do my unit tests occasionally just halt with no given reason Werent you testing multithreded stuff? I guess you just found a deadlock.
|
# ? Jul 21, 2016 22:17 |
|
nah like the test execution halts, not like it hangs. resharper just gives me the little hand and marks the un-run tests "inconclusive"
|
# ? Jul 21, 2016 22:20 |
|
sounds like u have a halting problem
|
# ? Jul 21, 2016 22:57 |
|
wish you'd halt and catch fire
|
# ? Jul 21, 2016 23:46 |
|
exceptions are probably bad b/c they're this extra side channel that people often forget about and arent forced to think about this extra side channel can often make composing stuff together and creating abstractions a lot more complicated people (including standard libraries) often abuse exceptions for what should be normal control flow no one can agree upon what should be normal control flow and what should be exceptions sometimes you end up having to handle both exceptions and return results for error handling the alternative is just returning error results on the stack in the vast majority of cases, but maybe that might be bad too for its own reasons. i haven't used it enough to decide yet.
|
# ? Jul 22, 2016 00:08 |
|
Mr Dog posted:what concrete application are you interested in well, graphics is the thing i keep telling myself ill learn when theres time so basically a vector is a function describing a "line" in n dimensions (which i will just mentally limit to 3 to keep my head unexploded) and when you want to rotate the vector, you're really multiplying it by another vector that represents the "path" of the rotation. this isn't really different from normal multiplication of functions other than that it's a pain in the rear end so matrices can be used as a shorthand form of vector multiplication? does that get near to the idea?
|
# ? Jul 22, 2016 02:34 |
|
well the path actually needs an extra dimension and is called a quaternion
|
# ? Jul 22, 2016 02:35 |
|
LeftistMuslimObama posted:well, graphics is the thing i keep telling myself ill learn when theres time the transformation is represented as a matrix, not as a vector. (rotations can be represented as a vector of n + 1, but that's wizard poo poo) applying the transformation to a vector means multiplying the matrix (n by n) by the vector (1 by n) which gives you a new vector (1 by n) if X and Y are matrices, and V is a vector, X * (Y * V) = (X * Y) * V so it's common to multiply the transformations together, which is equivalent to compositing the functions EDIT: typo LordSaturn fucked around with this message at 03:46 on Jul 22, 2016 |
# ? Jul 22, 2016 02:40 |
|
LordSaturn posted:the transformation is represented as a matrix, not as a vector. (rotations can be represented as a vector of n + 1, but that's wizard poo poo) ok, im sort of following. but why do i need two matrices? if i have this line and i want to rotate it on the screen, isnt that just one transformation?
|
# ? Jul 22, 2016 02:53 |
|
LeftistMuslimObama posted:ok, im sort of following. but why do i need two matrices? if i have this line and i want to rotate it on the screen, isnt that just one transformation? X can be your camera rotation, Y can be the rotation of the line. Z can be the rotation of the object the line is part of, Q can be the translation due to screen shake, etc etc etc. multiply your total transformation once, then multiply it by every vertex to transform them
|
# ? Jul 22, 2016 03:48 |
|
LordSaturn posted:X can be your camera rotation, Y can be the rotation of the line. Z can be the rotation of the object the line is part of, Q can be the translation due to screen shake, etc etc etc. multiply your total transformation once, then multiply it by every vertex to transform them got it. i need a matrix for each "thing" that is happening each frame that changes how the line should be displayed, and since camera movement, movement of the object the line is part of, movement of the scene the line is contained in, etc are all different transformations of the line relative to its screen position they are all separate functions that need to be multiplied together (composed?).
|
# ? Jul 22, 2016 03:53 |
|
actually if you wanna throw in a translation you gotta go to augmented matrices/vectors for all affine transformations i think
|
# ? Jul 22, 2016 03:53 |
|
trying to learn myself a scala and so far it's ok but im still on babby's first web scraper and not getting any deeper than map/filter so far
|
# ? Jul 22, 2016 04:00 |
|
LeftistMuslimObama posted:got it. i need a matrix for each "thing" that is happening each frame that changes how the line should be displayed, and since camera movement, movement of the object the line is part of, movement of the scene the line is contained in, etc are all different transformations of the line relative to its screen position they are all separate functions that need to be multiplied together (composed?). yes. now instead of a line, pretend every vertex is actually a vector drawn from the origin to its point. because it is. Bloody posted:actually if you wanna throw in a translation you gotta go to augmented matrices/vectors for all affine transformations actually this might be true. all I know you can do for sure is scaling and rotation
|
# ? Jul 22, 2016 04:11 |
|
|
# ? May 24, 2024 01:35 |
|
LeftistMuslimObama posted:got it. i need a matrix for each "thing" that is happening each frame that changes how the line should be displayed, and since camera movement, movement of the object the line is part of, movement of the scene the line is contained in, etc are all different transformations of the line relative to its screen position they are all separate functions that need to be multiplied together (composed?). Don't worry so much about lines, we're just talking about points here. Rotate all the vertices in an object and you'll rotate the object. A vector tells you the position of a point. Transforming that vector tells you the new position of that point. The reason matrices are useful in this situation is that you don't have to, say, scale everything and then rotate everything. You can combine the scaling and the rotation into one matrix ahead of time, and then you only need to apply that one matrix to do both things simultaneously, which is more efficient. The whole discussion actually bottoms out fairly quickly if you're just talking about 3D space because about the only things you can do with 3x3 matrices is rotation, scaling, reflection, and I guess shearing. Beyond that they're not very useful, again, if you just stick to strictly 3D space and ignore the final paragraph of this post. You can't move things using a matrix, because a matrix can only represent a linear function f(v), and remember how f(Av) = A f(v) must hold for all vectors v and numbers A for that function to be linear? Well, set A = 0. Then f(0 * v) = 0 * f(v), so f(0) = 0 must always always hold. If f(0) gives you something other than 0, then f isn't a linear function and you can't represent it as a matrix. Well, that means you can't move things around with a matrix, you'd have to move from 0 to some place other than 0. Matrices aren't useful here. ... well, sort of. Except you can do a hack where you model everything in four dimensions, and then you can cook up a 4x4 matrix that moves the camera, rotates the camera, and then does a perspective transformation of everything from 3D onto the 2D plane of your screen. Which is much faster than doing all these things separately and keeping track of them all separately. But that's getting a little bit ahead of things, and that's taking a very applied-computer-graphics-programming-oriented view of things as opposed to a pure mathematical view of what's actually going on. Perspective transformation involves dividing both X and Y by Z which is an extremely non-linear operation but the trick there is that the actual division doesn't happen until you re-interpret your 4D space back into 3D... well, 2D at this point... by dividing X Y and Z by the fourth dimension co-ordinate. It all seems very simple to me after having read up a bit on it but I can see how this would seem incredibly confusing if you're diving straight in and trying to understand the entire stack of concepts all at once Sapozhnik fucked around with this message at 04:19 on Jul 22, 2016 |
# ? Jul 22, 2016 04:16 |