As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/

[Programming] Mirror, mirror, on the wall, show the git diff for them all

194959799100

Posts

  • bowenbowen How you doin'? Registered User regular
    Echo wrote: »
    It feels weird to use anonymous types in C#, but damn if it isn't handy for making quick JSON objects.

    Got example code? I think I could use this actually.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • EchoEcho ski-bap ba-dapModerator mod
    edited May 2016
    var response = new
    {
      LoginStatus = "challenge",
      Authentication = new
      {
        Email = user.IsEmailAuthenticationEnabled,
        App = user.IsGoogleAuthenticatorEnabled,
        Phone = user.PhoneNumberConfirmed
      }						
    };
    
    return Json(response);
    

    Echo on
  • bowenbowen How you doin'? Registered User regular
    Interesting, I haven't used that yet, but it seems right up my alley.

    Can you generate an anon type from the Json on the other end?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • EchoEcho ski-bap ba-dapModerator mod
    edited May 2016
    I've been using [FromBody] for that.
    [HttpPost]
    public async Task<IActionResult> LoginAjax([FromBody] LoginViewModel model, Guid clientGuid, string returnUrl = null)
    {
    

    It grabs properties from the POST (I think it requires JSON, actually) and sticks matching properties into whatever you give the [FromBody] attribute.

    Echo on
  • bowenbowen How you doin'? Registered User regular
    hmm I'm using nancy, looks like you're using MCF or something like that?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • bowenbowen How you doin'? Registered User regular
    http://www.newtonsoft.com/json/help/html/QueryJsonDynamic.htm

    though that looks pretty close to what I want

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • LD50LD50 Registered User regular
    At some point you might as well start using Rails :P.

  • bowenbowen How you doin'? Registered User regular
    Langauges that need their runtimes installed can go fuck themselves.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • EchoEcho ski-bap ba-dapModerator mod
    http://stackoverflow.com/a/6905037/2075613 has some stuff about deserializing JSON to an anonymous type.

  • LD50LD50 Registered User regular
    bowen wrote: »
    Langauges that need their runtimes installed can go fuck themselves.

    Like c#?

  • bowenbowen How you doin'? Registered User regular
    LD50 wrote: »
    bowen wrote: »
    Langauges that need their runtimes installed can go fuck themselves.

    Like c#?

    Not since like 2002.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • LD50LD50 Registered User regular
    bowen wrote: »
    LD50 wrote: »
    bowen wrote: »
    Langauges that need their runtimes installed can go fuck themselves.

    Like c#?

    Not since like 2002.

    You can package ruby into standalone executables too, it's just not normally done because most ruby use is server-side where people want more control over the environment.

  • bowenbowen How you doin'? Registered User regular
    your momma wants more control over the environment!

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • NogsNogs Crap, crap, mega crap. Crap, crap, mega crap.Registered User regular
    Holy butts: https://hyperdev.com

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • urahonkyurahonky Registered User regular
    Nogs wrote: »

    Very cool stuff!

  • EchoEcho ski-bap ba-dapModerator mod
    edited June 2016
    Anyone know how I can get the base URL for the site in MVC 6? All the googlin' only gives me old stuff that's changed in MVC 6.

    Echo on
  • NogsNogs Crap, crap, mega crap. Crap, crap, mega crap.Registered User regular
    react europe is going on right now for those interested, here is live stream:

    https://www.youtube.com/watch?v=kDXHzLOPv2s

    rotate.jpg
    PARKER, YOU'RE FIRED! <-- My comic book podcast! Satan look here!
  • zerzhulzerzhul Registered User, Moderator mod
  • DelmainDelmain Registered User regular
    @skippydumptruck is a frogram now, please welcome him

  • skippydumptruckskippydumptruck begin again Registered User regular
    Delmain wrote: »
    @skippydumptruck is a frogram now, please welcome him

    merging this thread into my usual forum browsing

  • urahonkyurahonky Registered User regular
  • EchoEcho ski-bap ba-dapModerator mod
    zerzhul wrote: »

    So today I spent nearly two hours looking for a bug in all the wrong places.

    I'm working on the login page for this web app. The backend has all the code necessary for 2FA via app, phone and email, but it's not implemented on the frontend yet. My job is to wire that up and use ajax stuff so it's all a single page for the login.

    I write JS stuff that sends some JSON with login credentials, and a method in the controller that accepts that and validates it and returns some JSON with the login state. That works just fine, and if the account doesn't have 2FA enabled it logs in properly.

    Then I start on the bits to handle 2FA. I write the JSON receiver in the controller first, and I can log in with 2FA by just posting the auth code in a regular form. Great, now to hook that up to the jQuery bits. I write a new function for the ajax call, but realize it's identical to the bit for the first auth, so I change that to a single function that takes an additional URL argument.

    Now the login bit works, but not the 2FA. The only different thing is the URL. In hindsight this was the obvious warning bell, but for some reason I decide it's the javascript bits that are wrong, because the 2FA validation method apparently gets no data whatsoever from the ajax call.

    90 minutes later: oh look, I forgot the [FromBody] that populates the input model from the JSON in the request.

  • SarksusSarksus ATTACK AND DETHRONE GODRegistered User regular
    edited June 2016
    I am two weeks into my first internship and it is a mixture of joy and misery.

    I am using internal libraries to bring shit in COBOL files to the database, and the code for that was like the SMALLEST part of the actual task. Most of my time was spent being abused by the build system, SVN, build path fuckery, deploying* to Tomcat, talking to the REST API, and testing. And I have to use Eclipse.

    I still have to figure out how to better test the code I wrote. I'd like to do more than eyeball a few entries and make sure nothing was mangled. I miss Python's zip function from itertools.

    But it was really cool making a request to the API and seeing the database fill up with everything. One step closer to leaving COBOL behind! And I am gonna write hella documentation in the internal wiki about the stuff I figured out.

    *copying the .war file to the test server

    Sarksus on
  • ecco the dolphinecco the dolphin Registered User regular
    Sarksus wrote: »
    ... the code for that was like the SMALLEST part of the actual task.

    I hate to break it to you, but... this is actually quite normal...

    Penny Arcade Developers at PADev.net.
  • hippofanthippofant ティンク Registered User regular
    Sarksus wrote: »
    ... the code for that was like the SMALLEST part of the actual task.

    I hate to break it to you, but... this is actually quite normal...

    Most programs work perfectly... at doing something other than what you need them for.

  • SpawnbrokerSpawnbroker Registered User regular
    Had my third (and hopefully final) interview with a company I'm pretty excited for today.

    I feel like I'm not exactly what they're looking for, but also that the person they're looking for doesn't exist, if that makes sense.

    They want someone who knows SharePoint inside and out, can write custom C# SharePoint code, modify CSS/master pages, and also knows how to plan and architect a server farm for a global company from an administration standpoint.

    There are maybe 10 people in the world that fit this job description I think. That being said, I think I'm doing pretty well and hope I get an offer. But I won't be upset if I don't, it just won't be a surprise.

    Steam: Spawnbroker
  • ecco the dolphinecco the dolphin Registered User regular
    Had my third (and hopefully final) interview with a company I'm pretty excited for today.

    I feel like I'm not exactly what they're looking for, but also that the person they're looking for doesn't exist, if that makes sense.

    They want someone who knows SharePoint inside and out, can write custom C# SharePoint code, modify CSS/master pages, and also knows how to plan and architect a server farm for a global company from an administration standpoint.

    There are maybe 10 people in the world that fit this job description I think. That being said, I think I'm doing pretty well and hope I get an offer. But I won't be upset if I don't, it just won't be a surprise.

    Yeah

    When I'm looking for jobs, I like to keep in mind that the list of skills that they put forth is their "ideal" candidate. And just like your "perfect" partner, they only exist in your dreams.

    Our job is to let them down gently, and bring them back to reality =P

    Penny Arcade Developers at PADev.net.
  • SarksusSarksus ATTACK AND DETHRONE GODRegistered User regular
    Sarksus wrote: »
    ... the code for that was like the SMALLEST part of the actual task.

    I hate to break it to you, but... this is actually quite normal...

    Yeah it's a big change from school where 94% of the work was code with the remaining 6% being the one semester we had to use makefiles.

  • RendRend Registered User regular
    Sarksus wrote: »
    Sarksus wrote: »
    ... the code for that was like the SMALLEST part of the actual task.

    I hate to break it to you, but... this is actually quite normal...

    Yeah it's a big change from school where 94% of the work was code with the remaining 6% being the one semester we had to use makefiles.

    In school they tell you what to write and how to write it though, which eliminates the most massive portion of work: thinking

  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    hippofant wrote: »
    Sarksus wrote: »
    ... the code for that was like the SMALLEST part of the actual task.

    I hate to break it to you, but... this is actually quite normal...

    Most programs work perfectly... at doing something other than what you need them for.

    Crashing. Most programs are good at crashing

  • DehumanizedDehumanized Registered User regular
    edited June 2016
    Dehumanized on
  • LD50LD50 Registered User regular


    I've edited code on a tablet before. It was not an enjoyable experience, and now swiftkey's user dictionary has a bunch of method calls in it.

  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited June 2016
    Coding on a tablet is... pretty much the worst possible thing

    Well, I guess a phone might be worse

    Phyphor on
  • admanbadmanb unionize your workplace Seattle, WARegistered User regular
    Phyphor wrote: »
    Coding on a tablet is... pretty much the worst possible thing

    Well, I guess a phone might be worse

    Try coding on a phone through no editor other than TFS Online.

    Sometimes bugs have to be fixed.

  • LD50LD50 Registered User regular
    Yeah, it's not something I want to have to do again. I get a little nostalgic chuckle every time I see whatever.someMethod pop up in my suggestions though.

  • JasconiusJasconius sword criminal mad onlineRegistered User regular
    I turned on Unity for the first time in years and it's easy enough now to actually get something done without needing to know half of Unity's classes. Kind of fun almost. And the automatic Visual Studio integration is just dandy

  • urahonkyurahonky Registered User regular
    vim editing on a cell phone.

  • bowenbowen How you doin'? Registered User regular
    I don't think anything is ever urgent enough to use VIM, or a cell phone for text editing.

    I wouldn't even offer that up as an option.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • SarksusSarksus ATTACK AND DETHRONE GODRegistered User regular
    bowen wrote: »
    I don't think anything is ever urgent enough to use VIM, or a cell phone for text editing.

    I wouldn't even offer that up as an option.

    edit text in Vim via Twilio's text message API no matter your phone or your network

  • Alistair HuttonAlistair Hutton Dr EdinburghRegistered User regular
    If I had a bluetooth keyboard then vim on a phone would just be vim on a slightly smaller screen than normal.

    I have a thoughtful and infrequently updated blog about games http://whatithinkaboutwhenithinkaboutgames.wordpress.com/

    I made a game, it has penguins in it. It's pay what you like on Gumroad.

    Currently Ebaying Nothing at all but I might do in the future.
This discussion has been closed.