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
Luigi Thirty
Apr 30, 2006

Emergency confection port.

Sapozhnik posted:

C++ lets you get high on your own farts creating all sorts of very clever nonsense that does achieve any practical goal whatsoever.

my experience programming the Amiga

Adbot
ADBOT LOVES YOU

HoboMan
Nov 4, 2010

HoboMan posted:

ok so i'm using token auth with owin. how do i get the user name of the associated tokens credentials for logging purposes?

e: i've tried three stack overflow things and none of them have worked

in case anyone cares i figured it out and it's
C# code:
string userName = ((System.Security.Claims.ClaimsIdentity)User.Identity).Claims.First().Value;

HoboMan
Nov 4, 2010

so i only put the dev in devops. how would i have vs2015 also rename some files on publish? or is there some 3rd party deployment thing i should use instead?

Bloody
Mar 3, 2013

Deep Dish Fuckfest posted:

counterpoint: performance. no i will not tell you how i define performance or test for it or provide any data backing this as it is a well known fact which does not need justification

also some vague mumbling about system programming or some poo poo

oh hey it is my coworkers

oh no blimp issue
Feb 23, 2011

i like being the guy who knows the "stuff" about C++, then when your colleagues who program in lesser languages ask you why your poo poo always takes twice as long you turn to them and say "name mangling" or something, and it's defintiely not because you program in a poo poo language and try to be entirely too clever the entire time

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

oh no blimp issue posted:

i like being the guy who knows the "stuff" about C++, then when your colleagues who program in lesser languages ask you why your poo poo always takes twice as long you turn to them and say "name mangling" or something, and it's defintiely not because you program in a poo poo language and try to be entirely too clever the entire time

this is me except its that im the idiot who always fixes all the crusty stuff no one wants to touch so no one understands half of wtf i do.

Chalks
Sep 30, 2009

HoboMan posted:

so i only put the dev in devops. how would i have vs2015 also rename some files on publish? or is there some 3rd party deployment thing i should use instead?

You can use .targets files to add extra tasks into the msbuild process. This might be useful to you:

https://msdn.microsoft.com/en-us/library/ms366724(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/3e54c37h.aspx

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
come over to the PL thread for the hardcore c++ discussion. I'm currently trying to implement a subtly complex c++ library while attempting to rationalize and explain the c++ language in user-friendlier ways

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

oh no blimp issue posted:

i like being the guy who knows the "stuff" about C++, then when your colleagues who program in lesser languages ask you why your poo poo always takes twice as long you turn to them and say "name mangling" or something, and it's defintiely not because you program in a poo poo language and try to be entirely too clever the entire time

honestly you could probably just make poo poo up as you go. like, there's a pretty good chance you could convince people that something like "vapor lock" is an actual term used to describe a type of low-level concurrency bug. "yeah, i tried to squeeze as much performance out of this function since we call it real often, but there's a synchronization issue with our mutexes that creates a vapor lock in the l3 cache" would earn you a week

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


Alright so I figured out how to do joins using Dapper, sort of, but mapping the results out in the way I'm used to using them is confusing me

C# code:
class Mnemonic
{
  public string Name;
  public int Id;
}
class Format
{
   public Mnemonic Mnemonic; // derpy naming
   public string FormatId;
   public int IdCode;
}
// ...
string sql = "@
select f.id FormatId, f.midc IdCode,
'x' SPLIT,
m.mnemonic Name, m.Id
from mnemonics m, formats f
where f.mnemonic_id = m.id
";
IEnumerable<Format> allFormats = db.Query<Format, Mnemonic, Format>(sql, 
  (fmt, mne) => {fmt.Mnemonic = mne; return fmt; },
  onSplit: "SPLIT"
);
This gives me every row from the formats table with that row's mnemonic baked into the Format object, all well and good

I'm a little bit lost at how to twist that around such that I end up with a Mnemonic entity class that contains a list of Formats that have that Mnemonic as its mnemonic_id

I can do a linq GroupBy on the results of the above, but using that and the resulting double foreach doesn't really... feel right I guess???

C# code:
// pretend I overrode Equals and GetHashCode in class Mnemonic
var byMnemonic = from f in allFormats group f by f.Mnemonic;
foreach (var i in byMnemonic)
{
  Console.WriteLine("{0} ({1}", i.Key.Name, i.Key.Id);
  foreach (var j in i)
  {
    Console.WriteLine("\t{0} ({1})", j.FormatId, j.IdCode);
  }
}
(ed) retyped all this from memory so I probably buggered it up

Ciaphas fucked around with this message at 23:54 on Dec 1, 2016

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Toady posted:

i've never understood the personal anger over radar

if you set out to design a bug reporting system designed to discourage bug reports as much as possible, you'd end up with something a lot like radar.

merely interacting with radar is unpleasant. it's slow, has a fairly confusing ui, and does a good job of losing data if you're foolish enough to try to save a draft. it sometimes just doesn't work at all. when you're filing a bug report you're often in a bad mood to begin with, and having to deal with a terrible tool to submit the bug report doesn't help.

it is soulless. any responses you receive from apple are carefully constructed to make you believe that there is not a person at the other end. even accurate and useful responses that had to have been written specifically for a given radar are written to sound like something a front-line support person copy and pasted from a set of stock responses, and there's no indication about who it came from. this may seem like a silly thing to complain about, but dehumanizing the responders is pretty much exactly what you'd want to do if you wanted to make it easy to hate them.

it's a black hole. the only responses i've ever gotten to radars filed are:

1. years of silence
2. closed as duplicate of a thing i can't see and then no further updates
3. a request for a repro case that i already supplied in the original bug report, and then silence when i point that out
4. a "working as intended" response

#4 is sometimes useful. often it says just enough to make it clear that they correctly understood the bug report, but not enough to convey why the behavior is intended. the rest are a giant waste of my time. the end result of this is that "please file a radar" comes off as "please do free work for the richest company in the world in the vain hope that it might somehow help you"

i will say though that some coworkers have had better luck; in particular most of our radars against dev tools get meaningful responses and often bug fixes, and as a result that's the only thing i'm still willing to put in the effort for

ThePeavstenator
Dec 18, 2012

:burger::burger::burger::burger::burger:

Establish the Buns

:burger::burger::burger::burger::burger:
Just had the one guy that shows up to class in a suit do his current events speech as a defense of far-right-wing nationalism in Europe. This is a data security course.

ThePeavstenator fucked around with this message at 00:37 on Dec 2, 2016

jesus WEP
Oct 17, 2004


ThePeavstenator posted:

Just had the one guy that shows up to class in a suit do his current events speech as a defense of far-right-wing nationalism in Europe. This is a data security course.

no no, i was asking "are bytes masked, why?"

Potassium Problems
Sep 28, 2001

ThePeavstenator posted:

Just had the one guy that shows up to class in a suit do his current events speech as a defense of far-right-wing nationalism in Europe. This is a data security course.

Sir, this is AWS customer support

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


ThePeavstenator posted:

Just had the one guy that shows up to class in a suit do his current events speech as a defense of far-right-wing nationalism in Europe. This is a data security course.

"you see in a firewall the aim is to keep foreign packets out....'

Mahatma Goonsay
Jun 6, 2007
Yum
so I was playing around with vs code today and and seemed pretty good. especially compared to atom which is super slow.

JawnV6
Jul 4, 2004

So hot ...

Elias_Maluco posted:

edit: being such a terrible programmer as I am, I really cant understand how people can choose emacs, vim and stuff like that over an IDE
there's just so much of "programming" that happens outside of an IDE, like why get hung up on how much of it you can do in a single tool

Sapozhnik
Jan 2, 2005

Nap Ghost
every problem is an iceberg problem when you do high-ish level programming in C

gently caress my life

Bloody
Mar 3, 2013

JawnV6 posted:

there's just so much of "programming" that happens outside of an IDE, like why get hung up on how much of it you can do in a single tool

b/c visual studio is really really good

Shaggar
Apr 26, 2006

HoboMan posted:

in case anyone cares i figured it out and it's
C# code:
string userName = ((System.Security.Claims.ClaimsIdentity)User.Identity).Claims.First().Value;

User.Identity.Name should work

theodop
Dec 30, 2005

rock solid, heart touching
LMO have you tried the new InterSystems Eclipse IDE? I have literally Nobody Else to talk to about this exciting development

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Mahatma Goonsay posted:

so I was playing around with vs code today and and seemed pretty good. especially compared to atom which is super slow.

i write elixir, erlang, elm, js, python and rust in vs code. it's good

i still use idea for java and scala tho

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Sapozhnik posted:

C++ is a tool for turning imaginary problems into real ones.
C++ is a tool where the most obvious answer to every single question is always wrong.
C++ lets you get high on your own farts creating all sorts of very clever nonsense that does achieve any practical goal whatsoever.

Or, in short,


If you want to do fun and clever programming stuff then learn you a haskell or something.

b-but but

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

theodop posted:

LMO have you tried the new InterSystems Eclipse IDE? I have literally Nobody Else to talk to about this exciting development

no. we make our own ide in-house that has features for all our extra architecture on top of mumps

jesus WEP
Oct 17, 2004


LeftistMuslimObama posted:

no. we make our own ide in-house that has features for all our extra architecture on top of mumps

:eyepop:

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

ThePeavstenator posted:

Just had the one guy that shows up to class in a suit do his current events speech as a defense of far-right-wing nationalism in Europe. This is a data security course.

sir, the question was, is this your handwriting?

HoboMan
Nov 4, 2010

Shaggar posted:

User.Identity.Name should work

tried that. it's null every time

Shaggar
Apr 26, 2006
thats weird. The way it should work is ClaimsIdentity has a property called NameClaimType. This is the claim type it uses to populate the Name property. So when you call ClaimsIdentity.Name its basically enumerating its claims for a claim where the type==NameClaimType and then it returns the string value of the matching claim. If it doesn't find a match it returns null. So either your NameClaimType is set wrong or (more likely) you aren't populating the right claim in the claim list.

Taking the first claim off the list like you're doing is not reliable since claim order is not guaranteed. I would suggest trying to figure out why the Name prop is returning null. To do this debug your poo poo and put a break somewhere that the User is established and then do the following:
On the ClaimIdentity, check the value of NameClaimType. This is probably something like "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
Then enumerate the list of claims and check to see if there is a claim with a type that matches the value specified in NameClaimType.

If there is not a claim that matches, it means you are probably not getting the right claims. Check ur authentication configuration.
If there is a claim that matches, but the value is null, it means your authentication system isn't returning a value for name. Check to see how the claim is being mapped to make sure the right field from the identity provider is being mapped to the value of the name claim.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

not engineered here syndrome runs rich in this company

HoboMan
Nov 4, 2010

Shaggar posted:

thats weird. The way it should work is ClaimsIdentity has a property called NameClaimType. This is the claim type it uses to populate the Name property. So when you call ClaimsIdentity.Name its basically enumerating its claims for a claim where the type==NameClaimType and then it returns the string value of the matching claim. If it doesn't find a match it returns null. So either your NameClaimType is set wrong or (more likely) you aren't populating the right claim in the claim list.

Taking the first claim off the list like you're doing is not reliable since claim order is not guaranteed. I would suggest trying to figure out why the Name prop is returning null. To do this debug your poo poo and put a break somewhere that the User is established and then do the following:
On the ClaimIdentity, check the value of NameClaimType. This is probably something like "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
Then enumerate the list of claims and check to see if there is a claim with a type that matches the value specified in NameClaimType.

If there is not a claim that matches, it means you are probably not getting the right claims. Check ur authentication configuration.
If there is a claim that matches, but the value is null, it means your authentication system isn't returning a value for name. Check to see how the claim is being mapped to make sure the right field from the identity provider is being mapped to the value of the name claim.


oh do I have to manually add the claim to the identity?

like in the auth grant code put in:
C# code:
identity.AddClaim(new Claim(ClaimTypes.Name, context.UserName));
?

that seems silly

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

LeftistMuslimObama posted:

no. we make our own ide in-house that has features for all our extra architecture on top of mumps

haha of course

LordSaturn
Aug 12, 2007

sadly unfunny

LeftistMuslimObama posted:

no. we make our own ide in-house that has features for all our extra architecture on top of mumps

if you make a MUMPS IDE, it had better be called SALK

HoboMan
Nov 4, 2010

HoboMan posted:

oh do I have to manually add the claim to the identity?

like in the auth grant code put in:
C# code:
identity.AddClaim(new Claim(ClaimTypes.Name, context.UserName));
?

that seems silly

ok so this works just dandy in a controller, but what do i do outside of one?

e: nvm it's
C# code:
 System.Web.HttpContext.Current.User.Identity.Name 
e2: let me just say all the stack overflow answers for this are are really dumb. "Oh, you are getting a null there? Well really you should just implement this class that exposes all the properties you want and have everything inherit from it!" when literally that one line of code will do you.

HoboMan fucked around with this message at 18:40 on Dec 2, 2016

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

LordSaturn posted:

if you make a MUMPS IDE, it had better be called SALK

lol. It's called EpicStudio in deference to InsterSystems' CachéStudio. We distribute it to our customers too.

during your time i assume you were either using cachestudio or possibly suffering through the pain that was %ZMSP or *gasp* the breeze editor.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
you should use emacs instead and say that the e stands for epic

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

MALE SHOEGAZE posted:

you should use emacs instead and say that the e stands for epic

epic mumps and crap solution

Sapozhnik
Jan 2, 2005

Nap Ghost

LeftistMuslimObama posted:

epic mumps and crap solution

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

LeftistMuslimObama posted:

not engineered here syndrome runs rich in this company

ugh. same.

we're starting to get over it though

Shaggar
Apr 26, 2006

HoboMan posted:

oh do I have to manually add the claim to the identity?

like in the auth grant code put in:
C# code:
identity.AddClaim(new Claim(ClaimTypes.Name, context.UserName));
?

that seems silly

if you're creating the claims identity within your own authentication system then yes. That's part of using claims identity. If something else is creating the identity then it should be setting that up for you. How are you authenticating users right now?

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill

Sapozhnik posted:

every problem is an iceberg problem when you do high-ish level programming in C

gently caress my life

lol ikr

"what, you want popen but also capturing stderr? sorry we didn't implement that but have fun rolling your own with pipe and fork and exec and select. btw you'll also have to reimplement shell argument parsing and" :suicide:

  • Locked thread