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
Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

BiohazrD posted:

so in visual studio with the entity designer, is there any difference between



and just creating a direct many to many mapping?

Those are direct many-to-many mappings. Like, that is how you do it.

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

holy poo poo javascript is insanely awful why does this get used for anything

HoboMan
Nov 4, 2010

Bloody posted:

holy poo poo javascript is insanely awful why does this get used for anything

hobbesmaster
Jan 28, 2008

Bloody posted:

holy poo poo javascript is insanely awful why does this get used for anything

because it was in netscape and then internet explorer

Bloody
Mar 3, 2013

im just trying to post some poo poo to my webapi and either the sending it part is getting hosed up or the webapi part is hosed up and i dont know and its all terrible

Bloody
Mar 3, 2013

i just want to send an array of strings to a server why is this so stupid

Sapozhnik
Jan 2, 2005

Nap Ghost
post teh codes

javascript is bad for a whole bunch of reasons but xhrs aren't really one of them. if it's really proving to be a pain in the dick then use a polyfill for the new Request API.

Bloody
Mar 3, 2013

i think the javascript part is fine now but the webapi part is insanely retarded. it absolutely refuses to do anything at all with the body of a post request. it hits the post controller and just nulls out the parameter no matter what and wont read anything from the request content even though it will tell me there is poo poo in there

Bloody
Mar 3, 2013

oh jk its posting mangled garbage to the server. thanks, javascript

30 TO 50 FERAL HOG
Mar 2, 2005



Finster Dexter posted:

Those are direct many-to-many mappings. Like, that is how you do it.

okay but if you can go into the designer and skip the intermediate table and create a many to many, does it just create that table and abstract it from the user in that case?

this is more of a visual studio question, i get many to many, im just curious about why visual studio does what it does in this case

HoboMan
Nov 4, 2010

webdev makes me want to be dead

HoboMan
Nov 4, 2010

HTML code:
<html xmlns="http://www.w3.org/1999/xhtml" style="overflow:hidden">
i can't breathe

jesus WEP
Oct 17, 2004


lol

jony neuemonic
Nov 13, 2009

Mr Dog posted:

post teh codes

javascript is bad for a whole bunch of reasons but xhrs aren't really one of them. if it's really proving to be a pain in the dick then use a polyfill for the new Request API.

whatwg-fetch is really good, yeah.

jony neuemonic
Nov 13, 2009

HoboMan posted:

HTML code:
<html xmlns="http://www.w3.org/1999/xhtml" style="overflow:hidden">
i can't breathe

haha, jesus christ.

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

HoboMan posted:

HTML code:
<html xmlns="http://www.w3.org/1999/xhtml" style="overflow:hidden">
i can't breathe

Lol

Bloody
Mar 3, 2013

i made a firefox plugin and a webapi service hell yeah

Bloody
Mar 3, 2013

now i need to figure out some acceptable degree of "close enough" string matching for cross-referencing part numbers because i just know there's probably a lot of stupid edge cases

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.
fuckfuckfuck I can't believe I am having an argument with someone that is saying you should always use == instead of === in js. May DOuglas Crockford boil up from the depths of hell and consume thy flesh, o javascript

jony neuemonic
Nov 13, 2009

Finster Dexter posted:

fuckfuckfuck I can't believe I am having an argument with someone that is saying you should always use == instead of === in js. May DOuglas Crockford boil up from the depths of hell and consume thy flesh, o javascript

what exactly is their line of thinking there?

i've heard (and can kind of understand) arguments that you should know how == and != work and when they're appropriate, since there's no strict equivalent for any of the other relational operators so you're going to have to get your head around wacky js coercion sooner or later. but even then, "when they're appropriate" is usually "almost never" and everyone still says to use === and !==.

abraham linksys
Sep 6, 2010

:darksouls:
using double-equals is so uncommon in js these days that when flow recommended using it for null-checks they had to give a paragraph of bolded text explaining why, lol

(thankfully, as bad as double-equals is, at least null != 0 and undefined != 0...)

Bloody
Mar 3, 2013

webapi projects build into a dll i guess? how do i host this on a local machine outside of launching it from the debugger. do i have to gently caress around a bunch with iis or something? i just wanna hit run

Shaggar
Apr 26, 2006

BiohazrD posted:

so in visual studio with the entity designer, is there any difference between



and just creating a direct many to many mapping?

don't use entity framework and double don't use the entity designer to design things.

qntm
Jun 17, 2009
need a drop-in replacement for == in your scripts? no problem, just use this, lovingly copied from the ECMAScript standard

JavaScript code:
"use strict";

// <[url]http://www.ecma-international.org/ecma-262/5.1/#sec-8[/url]>
var type = function(x) {
	// The `typeof` operator gives us almost what we want
	return typeof x === "function" ? "object" : x === null ? "null" : typeof x;
};

var isPrimitive = function(a) {
	return type(a) !== "object";
};

// <[url]http://www.ecma-international.org/ecma-262/5.1/#sec-8.12.8[/url]>
var defaultValue = function(o, hint) {
	if(hint === undefined) {
		if(o instanceof Date) {
			hint = String;
		} else {
			hint = Number;
		}
	}

	if(hint === String) {
		var toString = o.toString;
		if(toString instanceof Function) {
			var str = toString.bind(o).call();
			if(isPrimitive(str)) {
				return str;
			}
		}
		var valueOf = o.valueOf;
		if(valueOf instanceof Function) {
			var val = valueOf.bind(o).call();
			if(isPrimitive(val)) {
				return val;
			}
		}
		throw new TypeError("Cannot convert object to primitive value");
	}

	if(hint === Number) {
		var valueOf = o.valueOf;
		if(valueOf instanceof Function) {
			var val = valueOf.bind(o).call();
			if(isPrimitive(val)) {
				return val;
			}
		}
		var toString = o.toString;
		if(toString instanceof Function) {
			var str = toString.bind(o).call();
			if(isPrimitive(str)) {
				return str;
			}
		}
		throw new TypeError("Cannot convert object to primitive value");
	}
	throw new Error("This can't happen");
};

// <[url]http://www.ecma-international.org/ecma-262/5.1/#sec-9.1[/url]>
// `preferredType` is optional
var toPrimitive = function(x, preferredType) {
	return isPrimitive(x) ? x : defaultValue(x, preferredType);
};

// <[url]http://www.ecma-international.org/ecma-262/5.1/#sec-9.3[/url]>
var toNumber = function(x) {
	return isPrimitive(x) ? +x : toNumber(toPrimitive(x, Number));
};

// <[url]http://www.ecma-international.org/ecma-262/5.1/#sec-11.9.3[/url]>
var doubleEquals = function(x, y) {
	var typeX = type(x);
	var typeY = type(y);
	if(typeX === typeY) {
		if(typeX === "undefined") {
			return true;
		}
		if(typeX === "null") {
			return true;
		}
		if(typeX === "number") {
			return x === y;
		}
		if(typeX === "string") {
			return x === y;
		}
		if(typeX === "boolean") {
			return x === y;
		}
		return x === y;
	}
	if(x === null && y === undefined) {
		return true;
	}
	if(x === undefined && y === null) {
		return true;
	}
	if(typeX === "number" && typeY === "string") {
		return doubleEquals(x, toNumber(y));
	}
	if(typeX === "string" && typeY === "number") {
		return doubleEquals(toNumber(x), y);
	}
	if(typeX === "boolean") {
		return doubleEquals(toNumber(x), y);
	}
	if(typeY === "boolean") {
		return doubleEquals(x, toNumber(y));
	}
	if((typeX === "string" || typeX === "number") && typeY === "object") {
		return doubleEquals(x, toPrimitive(y));
	}
	if(typeX === "object" && (typeY === "string" || typeY === "number")) {
		return doubleEquals(toPrimitive(x), y);
	}
	return false;
};

AWWNAW
Dec 30, 2008

Bloody posted:

webapi projects build into a dll i guess? how do i host this on a local machine outside of launching it from the debugger. do i have to gently caress around a bunch with iis or something? i just wanna hit run

install IIS then set the project properties to run on IIS under a virtual directory. or self host with OWIN or some bullshit

Luigi Thirty
Apr 30, 2006

Emergency confection port.

hmm, it looks like my rotation methods don't work as well as i thought. specifically, X Y and Z should be roll, pitch, and yaw.

X is roll, Y is yaw, and Z doesn't do anything. i can get the right forward vector for movement but scene rotation doesn't really work right at all! :downs:

30 TO 50 FERAL HOG
Mar 2, 2005



Shaggar posted:

don't use entity framework and double don't use the entity designer to design things.

but i thought microsoft could do no wrong

cinci zoo sniper
Mar 15, 2013




thinking about trying to write a simple rpg game to check out a new language. c++, c#, or java - thoughts?

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

kalstrams posted:

thinking about trying to write a simple rpg game to check out a new language. c++, c#, or java - thoughts?

c++ but do it all with templates and implement a modding script language using boost::spirit

Sapozhnik
Jan 2, 2005

Nap Ghost
your compiler has died of dysentery

cinci zoo sniper
Mar 15, 2013




Mr Dog posted:

your compiler has died of dysentery
:pusheen:

Bloody
Mar 3, 2013

c#

Bloody
Mar 3, 2013

AWWNAW posted:

install IIS then set the project properties to run on IIS under a virtual directory. or self host with OWIN or some bullshit

I wanna just self host it's going to run on a random desktop and only ever serve like two people on our lan

mystes
May 31, 2006

kalstrams posted:

thinking about trying to write a simple rpg game to check out a new language. c++, c#, or java - thoughts?
Rust. Then when the next version comes out, you came write another rpg in it to check out another new language!

VikingofRock
Aug 24, 2008




mystes posted:

Rust. Then when the next version comes out, you came write another rpg in it to check out another new language!

Changes between Rust versions are very minimal though? Usually it's just a few stabilizations of methods in the standard library.

mystes
May 31, 2006

VikingofRock posted:

Changes between Rust versions are very minimal though? Usually it's just a few stabilizations of methods in the standard library.
I guess it's more stable now then? It seemed like before every time I looked at it they had deleted half the features from the language and changed everything since the previous time.

Edit: Oh, I guess that after they released 1.0 they stopped doing stuff like that?

mystes fucked around with this message at 06:10 on Jul 28, 2016

LordSaturn
Aug 12, 2007

sadly unfunny

kalstrams posted:

thinking about trying to write a simple rpg game to check out a new language. c++, c#, or java - thoughts?

c#

unity owns

VikingofRock
Aug 24, 2008




mystes posted:

I guess it's more stable now then? It seemed like before every time I looked at it they had deleted half the features from the language and changed everything since the previous time.

Edit: Oh, I guess that after they released 1.0 they stopped doing stuff like that?

Yeah they mostly stopped doing stuff like that once it hit beta, and there have been almost no breaking changes since 1.0 (IIRC the breaking changes have all been minor bug fixes). It's been pretty drat stable for around a year and a half now.

hobbesmaster
Jan 28, 2008

Mr Dog posted:

your compiler has died of dysentery

Adbot
ADBOT LOVES YOU

cinci zoo sniper
Mar 15, 2013




LordSaturn posted:

c#

unity owns
eh im not fan of unity, but monogame seemed to be pretty chill for something simple. i felt like coming within an arrow shot from unity, i'd go straight for ue4 i think

  • Locked thread