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
Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy

NihilCredo posted:

we're doing xamarin on vs2017 for a few weeks and oh god i can't loving *blink* without something breaking in the build -> deploy -> debug toolchain. and the errors are always 'hope you find a stackoverflow answer 'cause you sure ain't figuring this one out on your own' level of useless

though tbf almost all the show-stoppers have come from the android sdk side of things rather than the .net one. also we started on vs2015 and things weren't much better

android sdk is garbage

ios sdk is also garbage

xamarin does a mediocre job of interfacing between them and visual studio

the end result is a steaming pile of garbage, but at least i can write .net everywhere

Adbot
ADBOT LOVES YOU

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy
ghost postin

Moreleth
Jun 11, 2001

lego my eggo
Write more Windows code! That'll solve the issues we face!

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Sweevo posted:

lol at part 2: "can't be bothered to type your own punch cards? submit your code to the typing pool and let a woman do it for you"

the thing i can't get over from all of these is just how much paper they went through

at least it sounds like they had recycling

GameCube
Nov 21, 2006

NihilCredo posted:

we're doing xamarin on vs2017 for a few weeks and oh god i can't loving *blink* without something breaking in the build -> deploy -> debug toolchain. and the errors are always 'hope you find a stackoverflow answer 'cause you sure ain't figuring this one out on your own' level of useless

though tbf almost all the show-stoppers have come from the android sdk side of things rather than the .net one. also we started on vs2015 and things weren't much better

speaking of crappy tooling, pro tip for vs2017 f# folks: the visualf# tools in the rtm are still the old buggy ones from the release candidate, you can actually get the latest version here: https://github.com/Microsoft/visualfsharp/wiki/Using-CI-Builds which fixes a ton of stuff (inline rename most notably)

i subscribed to the xamarin.android github project to stay on top of certain bugfixes and it kinda seems like they're bad at everything

Bloody
Mar 3, 2013

its open source - just contribute fixes

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy

Bloody posted:

its open source - just contribute fixes

i submitted a xamarin forms bug and pull request with a fix for an ios 10 rendering bug in september of last year

it got merged last month

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy
in the meantime i had to recompile xamarin forms on my own and change the references from the nuget package to point to my own assemblies so i could release an app that didn't look like poo poo

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen
u•ni•corn (yo͞oˈnĭ-kôrnˌ) n.

Bognar posted:

an app that didn't look like poo poo

redleader
Aug 18, 2005

Engage according to operational parameters

cis autodrag posted:

well, and if the compiler is genuinely loving up you should probably be finding out how to get that fixed rather than bitching about it :v:

but its almost never the compiler that is loving up.

i'm 95% sure that i ran into a bug in the sql server query optimizer a month or two ago. probably the most interesting thing i'll ever do or see

Hunter2 Thompson
Feb 3, 2005

Ramrod XTreme

JawnV6 posted:

for a while, "compiler" was a job title for some human who'd read your source and turn it into assembly. strict syntax wasn't a hard requirement, the person could often intuit what you meant

one of the MIT labs has a story about some military affiliated guy who would take hours on the system hunt-and-pecking his programs in, and would often skip semicolons that would take him even longer to debug. the hackers spent time making a syntax checker that would print a big flashing arrow on the offending line "RIGHT HERE DUDE"

There's a retelling of that story in Steven Levy's book "Hackers" and everybody here should go check it out from their local library and read that book if they haven't already.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

okay i wrote a keyboard interrupt handler today and now the control axes are separate from player movement and now i feel better about making something out of this thing

it converts movement keys (currently just WASD and J/M for forward speed up/down) into a three-axis vector and then multiplies the result by a directional movement speed vector. now the player object has lateral motion and a forward movement throttle, with the camera transform tied to the player object so we can smoothly move around the 3D space in any orientation or rotation. :toot:

at least i think that's how this is supposed to work

Arcteryx Anarchist
Sep 15, 2007

Fun Shoe
https://www.bitsrc.io

what is this

Star War Sex Parrot
Oct 2, 2003

got my lovely compiler project to a point where it's outputting MIPS code (lol) and seems to work well enough

Star War Sex Parrot
Oct 2, 2003

code generation is another Visitor pattern pass of the AST

Star War Sex Parrot
Oct 2, 2003

I have a new found respect for multi-dimensional array accessing

LordSaturn
Aug 12, 2007

sadly unfunny

cis autodrag posted:

they call it "pqa" for "programmer qa" but it's the same concept and i try to avoid epic-isms itt if there's a similar general concept

this is interesting but no, we didn't have that, either

if it didn't break the build and qa thought it fixed the ticket, you were done, buster

VikingofRock posted:

I feel this same way when people talk about battling the compiler. The compiler is there to help you; it's not your enemy. Same with code review.

winsock.h can eat my entire rear end

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

I hope you like modules in your modules cause we like modules?

code:
const bit = require('bit-js');
const isString = bit('is-string'); // <component-id>

console.log(isString('It\'s the bit')); // true
ehhhhhhh..... of course it was written in Javascript.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
I wonder if any of these people ever take a step back and try to answer "what problem is my product actually solving?"

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Jabor posted:

I wonder if any of these people ever take a step back and try to answer "what problem is my product actually solving?"

I dunno. I feel like these people have really bought into the idea that all we need to solve code reuse problems is to make a module system good enough, but then they always build this kludgey collection of names, strings and dependencies which tooling can't really help with, and they never run with it long enough to actually make the tools mature either.

So all you have is a long trail of failed javascript projects which had nice theoretical ideas but we're completely divorced from their actual workflows, so rather than the tools fitting into clear existing workflows and optimising them, they just force a sub par different way of doing things that they probably won't even dog food for long enough to prove the concept.

yet someone probably 'invested' in them so I don't know what the gently caress. Maybe it's like how Google does new projects even if they're the flakiest ever about any non-core product.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

POLYGONS.EXE doesn't seem to start on the NEC ProSpeed/386. hmm

might have to fiddle with compiler settings to get it to work on a 386. it shouldn't need more than the 1.5MB of available RAM.

or maybe DOS/32A doesn't like the system, that would suck.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

LordSaturn posted:

this is interesting but no, we didn't have that, either

if it didn't break the build and qa thought it fixed the ticket, you were done, buster


winsock.h can eat my entire rear end

jesus, you were here a really long time ago

Luigi Thirty
Apr 30, 2006

Emergency confection port.

paging eschaton

http://www.ebay.com/itm/162402056700

someone sold an SGI Indy on ebay recently with a bunch of mocap data for unreleased acclaim sports games plus a copy of Nichimen N-World 3.1 3D

VikingofRock
Aug 24, 2008




LordSaturn posted:

winsock.h can eat my entire rear end

I just looked that poo poo up and :lol:.

I get the impression that programming Windows stuff is full of poo poo like that, confirm / deny?

oh no blimp issue
Feb 23, 2011

battling the compiler invariably means that the person is getting errors and has to fix them

oh no blimp issue
Feb 23, 2011

oh no blimp issue posted:

battling the compiler invariably means that the person is getting errors and has to fix them

turn on -Wall, -Wpedantic and -Werror to really gently caress these people over

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Luigi Thirty posted:

paging eschaton

http://www.ebay.com/itm/162402056700

someone sold an SGI Indy on ebay recently with a bunch of mocap data for unreleased acclaim sports games plus a copy of Nichimen N-World 3.1 3D

would've been nice if someone interested in archiving had won that storage unit auction instead of someone looking to profit from it

I guarantee you it's causing equipment to be destroyed because "we don't know what's on it"

go play outside Skyler
Nov 7, 2005


quick C++ question: what happens to memory when I create a static vector, add stack objects to it, and then clear the list?

code:
struct BlobInfo {
  Point position;
  float size;
}

void calledInALoop() {
  static vector<BlobInfo> blobs;

  for (int i = 0; i < blobs.size(); i++) {
   //do something with the previous blobs
  }

  blobs.clear();

  for (int i = 0; i < 10; i++) {
    BlobInfo newBlob;
    newBlob.position = Point(..., ....);
    newBlob.size = ...;
    blobs.push_back(newBlock);
  }
}
asking for a friend... he is very confused by C++

go play outside Skyler fucked around with this message at 13:31 on Mar 8, 2017

comedyblissoption
Mar 15, 2006

AFAIK the memory "metadata" (its current size, the current array capacity, the pointer to the array, and any other bookkeeping) for the Vector is allocated statically. typically the actual data part of the Vector is going to be stored in an array that is dynamically allocated on the heap. the location and size of this dynamically allocated array on the heap can change as you add elements.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

go play outside Skyler posted:

quick C++ question: what happens to memory when I create a static vector, add stack objects to it, and then clear the list?

code:

struct BlobInfo {
  Point position;
  float size;
}

void calledInALoop() {
  static vector<BlobInfo> blobs;

  for (int i = 0; i < blobs.size(); i++) {
   //do something with the previous blobs
  }

  blobs.clear();

  for (int i = 0; i < 10; i++) {
    BlobInfo newBlob;
    newBlob.position = Point(..., ....);
    newBlob.size = ...;
    blobs.push_back(newBlock);
  }
}

asking for a friend... he is very confused by C++

the values in a vector are guaranteed to be contiguous in memory. clear will destroy the objects and set the size of the vector to 0, but it's capacity shouldn't change.

are you asking if the destroyed objects are nulled in the vector's memory space? because that sounds like it's implementation defined. check the standard if you're really curious; I wouldn't assume anyone has it memorized.

go play outside Skyler
Nov 7, 2005


leper khan posted:

the values in a vector are guaranteed to be contiguous in memory. clear will destroy the objects and set the size of the vector to 0, but it's capacity shouldn't change.

are you asking if the destroyed objects are nulled in the vector's memory space? because that sounds like it's implementation defined. check the standard if you're really curious; I wouldn't assume anyone has it memorized.

my main question was: is it "correct" and will it cause memory leaks?

e: so i guess that means no memory leaks?

comedyblissoption
Mar 15, 2006

the vector as used above will not cause memory leaks. using a static vector doesn't cause memory leaks just because it is static. a static vector won't ever be "freed" AFAIK (maybe there's special rules on program exit? I have no clue)

if you're new to C++, you have to be aware of the memory unsafety pitfalls of using vectors. look up reference invalidation and iterator invalidation with vectors.

the golden rule of thumb is to not hold any reference to the data while doing any operation that could invalidate references. using an iterator is equivalent to holding a reference to the data.

operations that can invalidate references will include adding to the vector, compacting the vector, clearing the vector, removing elements from the vector, etc. basically anything that could invalidate a reference by marking that memory as freed. you could think of it as "mutating" the array.

an illustrative example of use after free of potentially terrible things happening:
https://monoinfinito.wordpress.com/2015/04/14/c-invalidating-references-to-elements-in-a-vector/
code:
void do_something(const int&);
#include <vector>
 
void foo() {
    std::vector<int> v = {1,2,3,4,5};
    const int &num = v.at(1);
    v.push_back(42);
    do_something(num);
}

comedyblissoption fucked around with this message at 15:12 on Mar 8, 2017

ultravoices
May 10, 2004

You are about to embark on a great journey. Are you ready, my friend?

carry on then posted:

the thing i can't get over from all of these is just how much paper they went through

at least it sounds like they had recycling

paper/wood pulp was almost comically cheap until the first oil crisis, maybe 1/10th to 1/6th of the price now.

crazypenguin
Mar 9, 2005
nothing witty here, move along

go play outside Skyler posted:

quick C++ question: what happens to memory when I create a static vector, add stack objects to it, and then clear the list?

assuming BlobInfo and Point are just plain old data, you're fine. there are no allocations going on except the one vector does internally to hold all the data, and vector manages that fine

your blobs are constructed on the stack, and then copied into the vector

HoboMan
Nov 4, 2010

i specifically fixed our program throwing 4 or 5 random exceptions that get ignored on start up so that there are none at all and debugging is less annoying

now we have successfully stapled a react web app to this project there are 30 such exceptions

go play outside Skyler
Nov 7, 2005


comedyblissoption posted:

the vector as used above will not cause memory leaks. using a static vector doesn't cause memory leaks just because it is static. a static vector won't ever be "freed" AFAIK (maybe there's special rules on program exit? I have no clue)

if you're new to C++, you have to be aware of the memory unsafety pitfalls of using vectors. look up reference invalidation and iterator invalidation with vectors.

the golden rule of thumb is to not hold any reference to the data while doing any operation that could invalidate references. using an iterator is equivalent to holding a reference to the data.

operations that can invalidate references will include adding to the vector, compacting the vector, clearing the vector, removing elements from the vector, etc. basically anything that could invalidate a reference by marking that memory as freed. you could think of it as "mutating" the array.

an illustrative example of use after free of potentially terrible things happening:
https://monoinfinito.wordpress.com/2015/04/14/c-invalidating-references-to-elements-in-a-vector/
code:
void do_something(const int&);
#include <vector>
 
void foo() {
    std::vector<int> v = {1,2,3,4,5};
    const int &num = v.at(1);
    v.push_back(42);
    do_something(num);
}

wow, thanks. that actually makes a lot of sense!

Bloody
Mar 3, 2013

go play outside Skyler posted:

quick C++ question: what happens to memory when I create a static vector, add stack objects to it, and then clear the list?

code:
struct BlobInfo {
  Point position;
  float size;
}

void calledInALoop() {
  static vector<BlobInfo> blobs;

  for (int i = 0; i < blobs.size(); i++) {
   //do something with the previous blobs
  }

  blobs.clear();

  for (int i = 0; i < 10; i++) {
    BlobInfo newBlob;
    newBlob.position = Point(..., ....);
    newBlob.size = ...;
    blobs.push_back(newBlock);
  }
}
asking for a friend... he is very confused by C++

well you'll get some kinda error because newBlock is undefined

Bloody
Mar 3, 2013

but ya now idk how collections work. does push_back copy the BlobInfo? im broken by reference-laden garbage collected stuff and have no idea how anything works

VikingofRock
Aug 24, 2008




Bloody posted:

but ya now idk how collections work. does push_back copy the BlobInfo? im broken by reference-laden garbage collected stuff and have no idea how anything works

Yes, push_back copies into the vector. If this is unacceptable, and you are using a modern version of C++, use emplace_back instead to construct the element in-place in the vector.

Edit: In general, insertion into C++ containers usually involves copying. However, in C++11 or more recent, there are usually "emplace" methods to do stuff in place, and you can always explicitly move stuff with std::move if you wanna move into the container instead. I.e. vec.emplace_back(std::move(foo));

Edit: Actually, I think emplace_back might be strictly better to use than push_back, since it'll move / construct in place when possible but will fall back to a copy when necessary. But a higher-level C++ person would need to confirm that for me.

VikingofRock fucked around with this message at 19:02 on Mar 8, 2017

Adbot
ADBOT LOVES YOU

Fergus Mac Roich
Nov 5, 2008

Soiled Meat
it'll copy the BlobInfo in the above code but if it's called with an rvalue, for example if you were returning the value from a function or std::move-ing it, it'll be moved instead. this is assuming the appropriate constructors for the type being placed in the vector are available, because in C++ you can, for example, delete your copy constructor.

  • Locked thread