Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
hobbesmaster
Jan 28, 2008

i thought compilers all give up after a couple loops of that?

Adbot
ADBOT LOVES YOU

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

hobbesmaster posted:

i thought compilers all give up after a couple loops of that?
maybe they didn't in august of 2007?

Bloody
Mar 3, 2013

nah thats not even the hosed up code i was thinking of. i cant find the exact one im thinking of but found plenty of fun results like http://tgceec.tumblr.com/

brap
Aug 23, 2004

Grimey Drawer
if C# had anonymous classes I don't see what the point of moq would be most of the time

Bloody
Mar 3, 2013

c# does have anonymous classes

comedyblissoption
Mar 15, 2006

c# has anonymous types but not anonymous classes like in Java

an anonymous class like in Java will let you create an implementation for an interface and do stuff w/ it or return it from a function

anonymous classes are dumb and not a good feature imo

comedyblissoption
Mar 15, 2006

# of times I missed anonymous classes in C#: 0

Soricidus
Oct 21, 2010
freedom-hating statist shill
anonymous classes were mostly obsoleted by lambdas. they're still nice to have but i can see why you wouldn't miss them in a language that already had lambdas

Xarn
Jun 26, 2015

VikingofRock posted:

Wasn't there some discussion about allowing people to write their own error messages that the compiler would emit when a template substitution fails? Or did I dream that?

YeOldeButchere posted:

if not don't worry, you can probably accomplish something close enough using templates!

Ding ding ding ding*.


Right now you can do a lot of playing around with SFINAE, instantion stack cutting and static (compile-time) asserts to get semi-reasonable error messages, but it takes time, is unobvious and fiddly. (Plus there is always a problem where users want different error messages than developers of the library)


The ~great future~ theoretically holds concepts and easy-to-get sane error messages, but concepts have been the "next great thing" since C++11 and even the core workings have changed couple of times based on feedback from the committee. Basically they can either be highly complex, moderately complex and really hard to get into the language in backward compatible way or not really useful. I admit I have given up on watching what the final form will be until they actually get voted into draft.

-------
* Actually you don't want to write messages when template substitution fails, but rather when resolution fails, because reasons.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
I liked the class-like concepts proposal, that doubled as adapters. I forget who proposed it and I can't find the draft anywhere, but it was the best idea imo, gently caress concepts lite, I don't care if they are easy for compiler writers

gonadic io
Feb 16, 2011

>>=

hobbesmaster posted:

i thought compilers all give up after a couple loops of that?

Running out of stack space counts as giving up right?

Xarn
Jun 26, 2015

gonadic io posted:

Running out of stack space counts as giving up right?

IIRC, last time I tried code like that, Clang exited cleanly with nice error message. Admittedly I haven't tried other compilers, but that counts.

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD

GameCube posted:

should i bother asking the old guys if there was a reason they didn't just use Moq instead of writing every loving mock class by hand or should i just assume ignorance. what possible reason could you have for NOT using Moq

it's probably ignorance, but if you have a mock more complicated than a simple return value + verify then it's usually easier to write it out by hand anyway

Bloody
Mar 3, 2013

lay some sick yospinions on me about contracts
can i use them for input validation, or should i keep using if (condition) throw Exception?
if not, what are they for
i don't get it

GameCube
Nov 21, 2006

~Coxy posted:

it's probably ignorance, but if you have a mock more complicated than a simple return value + verify then it's usually easier to write it out by hand anyway

not when there's like... a billion freaking methods and you only need to customize like one of them. frick

GameCube
Nov 21, 2006

oh. moq doesn't support monoandroid. gently caress.

HoboMan
Nov 4, 2010

ok i got a weird bug and i can't find a single thing about it online: if the page is zoomed at all in chrome it completely breaks all of our javascript, what the hell?
it's not even trowing exceptions it's like the javascript just plain doesn't execute
works fine zoomed in ie too

Shaggar
Apr 26, 2006
chome is bad. stop using chome.

GameCube
Nov 21, 2006

oh man now i gotta write unit tests against some concurrent poo poo. this is gonna be fun. i am not sure what irony level i am on right now

HoboMan
Nov 4, 2010

Shaggar posted:

chome is bad. stop using chome.

ie8 is worse

VikingofRock
Aug 24, 2008




Shaggar posted:

chome is bad. stop using chome.

careful with that edge

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

GameCube posted:

oh man now i gotta write unit tests against some concurrent poo poo. this is gonna be fun. i am not sure what irony level i am on right now

if you can mock the scheduling so you can make sure to test edge cases then it's not that bad and actually useful

if not then lol your tests are worthless and non-repeatable and just lol

Shaggar
Apr 26, 2006

HoboMan posted:

ie8 is worse

use ie11 or edge

Bloody
Mar 3, 2013

Bloody posted:

lay some sick yospinions on me about contracts
can i use them for input validation, or should i keep using if (condition) throw Exception?
if not, what are they for
i don't get it

i have concluded that if/throw is a more convenient approach in c# because the contracts stuff freaked out and broke and wanted some plugin or something

Shaggar
Apr 26, 2006
if(nullcheck) throw ArgumentNullException forever.

Sapozhnik
Jan 2, 2005

Nap Ghost
There should be a Java compiler plugin that automatically inserts null checks for every parameter not annotated @Nullable

GameCube
Nov 21, 2006

for the first time in my professional career, i have found a use case for currying

of course it's in my unit tests so it's still not Production Currying. but still

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Mr Dog posted:

Barycentric rendering is poo poo-slow yes.

Apply a perspective transform first to get screen X,Y co-ordinates (but keep the Z around because you'll need it later), then sort the triangle's vertices by Y co-ordinate. Split the triangle into an upper half triangle and a lower half triangle with a horizontal line running through the middle vertex as the common edge.

For each scan line in each half triangle, determine the start and end of the scan line using Bresenham's line drawing algorithm. Then you're just drawing a series of horizontal lines. Do your Z-buffer test for each pixel and then apply perspective-correct interpolation to whatever vertex attributes (texture co-ordinates u,v for texturing and/or normals for lighting) and then stuff those into your "pixel shader".

yeah turns out solving the equation of a plane for Z is easier and faster than doing wacky barycentric calculations

GameCube
Nov 21, 2006

lol http://stackstatus.net/post/147710624694/outage-postmortem-july-20-2016

abraham linksys
Sep 6, 2010

:darksouls:
yo luigi thirty (and other people doing neat games/graphics rendering stuff), did you have a strong knowledge of geometry going into your project, or did you learn as you go?

i just make simple 2d games and have never written a custom renderer or anything, but have found myself busting out various googled equations i barely understand for things like physics calculations and animations and stuff, and i wish i had a better grasp on this stuff (especially since there are very few good general-purpose math libraries for javascript). i'd like to be able to do more complex stuff in my games but i'm scared off by some of the math, so i'm wondering if there are any good courses or tutorials or anything or if my best bet is to just continue trying to turn http://math.stackexchange.com/ answers into code

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

i switched out of the computer graphics course in school because after the first week everyone started busting out words like "vector" and "matrix". i thought "heh i got this" but then i realized they were not talking about science fiction

CPColin
Sep 9, 2003

Big ol' smile.

Nice. I ran into something like this when working on code that turns the BBCode-like tags into HTML. If you opened a bunch of identical tags, then closed one of them, the code found itself in O(2n) land.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

abraham linksys posted:

yo luigi thirty (and other people doing neat games/graphics rendering stuff), did you have a strong knowledge of geometry going into your project, or did you learn as you go?

i just make simple 2d games and have never written a custom renderer or anything, but have found myself busting out various googled equations i barely understand for things like physics calculations and animations and stuff, and i wish i had a better grasp on this stuff (especially since there are very few good general-purpose math libraries for javascript). i'd like to be able to do more complex stuff in my games but i'm scared off by some of the math, so i'm wondering if there are any good courses or tutorials or anything or if my best bet is to just continue trying to turn http://math.stackexchange.com/ answers into code

um i'm learning as i go geometry is hard

CPColin
Sep 9, 2003

Big ol' smile.
I got A's in four calculus courses in college and a C- in linear algebra, so I'm mostly copying and pasting!

Luigi Thirty
Apr 30, 2006

Emergency confection port.

i made some other optimizations in addition to ejecting barycentricism and now the renderer is INFINITELY FAST

Sapozhnik
Jan 2, 2005

Nap Ghost
linear algebra owns

Sapozhnik
Jan 2, 2005

Nap Ghost
linear algebra suffuses and perfuses DOOM's program code. or just any sort of real time computer graphics application in general really

who says math can't be metal as hell

Bloody
Mar 3, 2013

linear algebra is basically everything. Blas rules everything around me

HoboMan
Nov 4, 2010

i'm a for reals mathamagician, ama

Adbot
ADBOT LOVES YOU

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

Mr Dog posted:

linear algebra suffuses and perfuses DOOM's program code. or just any sort of real time computer graphics application in general really

who says math can't be metal as hell

i mean, carmack is like a genius savant in his domain which doesnt really disprove the idea that its extremely hard. no one could get the sort of performance doom got without specialty hardware with no OS in the way before doom came along. the moment someone starts talking about matrices and vectors my eyes glaze over. its so out of my wheelhouse. the last math i took was calc 1 my freshman year of college. i skipped every day because it was at 8am, showed up only for quizzes and tests, and just barely got the required credits with a c in the course. i dont remember jack poo poo from that course. i have to google whenever i need to remember what a logarithm is.

  • Locked thread