Club PA 2.0 has arrived! If you'd like to access some extra PA content and help support the forums, check it out at patreon.com/ClubPA
The image size limit has been raised to 1mb! Anything larger than that should be linked to. This is a HARD limit, please do not abuse it.
Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it, follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!

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

18889919394100

Posts

  • jaziekjaziek Registered User regular
    Getting an old VB.Net "Web Site" dynamically compiled App_Code folder to work with a c# unit test project took like an entire work day, but I feel like it was worth it.

    Now starting on the gigantic refactor to turn this from one giant file full of static functions into something thats actually readable / extendable / testable.

    I've got a month, this is doable.

    Steam ||| SC2 - Jaziek.377 on EU & NA. ||| Twitch Stream
    ecco the dolphin
  • DehumanizedDehumanized Registered User regular
    we got the last of our code (a couple Xamarin projects were the holdouts) onto c#6 compilers this week

    gonna use the hell out of all of the new features

    bowenEchoecco the dolphincrimsoncoyote
  • MvrckMvrck Registered User regular
    Saeris wrote: »
    Mvrck wrote: »
    GnomeTank wrote: »
    Mvrck wrote: »
    So question for those of you familiar with ES6 (or anyone who has a better idea how to do this that I'm not thinking of):

    One of our client orgs needs custom form fields in addition to the standard questions we normally ask with our evaluations. They have four different types of forms they want to implement. This is a PHP/Javascript based app, and currently, the process for selecting and filling out a form goes like:

    * Select Milestone Type
    * Select Milestone
    * Complete form.

    Each type has a list of milestones. For some of those milestones, I need to inject up to dozens of new form fields. Ideally I'd like to store those fields in separate files per form and import them as needed. ES6 seemed like a great answer for this, except you have to call imports at the very start of a file, which means I can't determine which set of forms to import based off a variable once the milestone is selected.

    I feel like I'm missing a really dumb, easy solution for this but just don't see it.

    Not sure how you're really thinking ES6 is going to help here? I guess because of the CommonJS module support? If that's the case, think of import like a function, You can actually use it just about anywhere, even way post-load.

    Babel is giving me an error and failing when I'm trying to transpile it. But yes I was hoping to store the relevant form bits in a module as a function to import/export when needed based off what form was being called. Rather than having an extra 200 lines or so of code in browser. I guess I could just stick it in an HTML file and AJAX and paste it in?

    The `import` keyword is for static imports only, meaning the module path must be a string literal. (I thought it also had to be at the outermost scope too, but maybe not.) Dynamic imports are currently pending finalization of the spec, so every transpiler or module loader is going to implement them a little differently.

    Personally, I use SystemJS as a module loader, because it handles loading CJS modules and it aims to be spec-compliant for ES modules. There's also just the ES6 Module Loader polyfill (which SystemJS uses internally) if you don't need CJS/AMD/etc. support and you just want something to handle dynamic ES module imports.

    With that said, if you're worried about deferring loading for a few hundred lines of code, you probably don't need or want the overhead of a full module loader polyfill. Your best bet is probably just good old XHR for .js + eval (if the forms really need logic to back them up) or just XHR for .json + JSON.parse (if the forms are really just sets of data and all the logic resides in the main module).

    Yeah it was mostly "If it was there an available" I'd do it and use it. Mostly making sure I wasn't missing something dumb before I changed gears. Just went back to doing an AJAX request and appending the result.

    PwH4Ipj.jpg
  • EchoEcho Moderator mod
    Man, I just had a complete brainfart and forgot how constructors and inheritance work in C#. Stupid fragile base class problem.

    Echo wrote: »
    Let they who have not posted about their balls in the wrong thread cast the first stone.
    [Michael]
  • SpawnbrokerSpawnbroker Registered User regular
    Do any of you have any experience with using Selenium to test websites? A lot of what I do is programming ASP.NET web pages, would Selenium be usable in a C# test project as a way to write unit tests against the UI?

    Like when the user clicks a button, did this element unhide itself, etc.? I don't have much experience with testing because my company runs REALLY lean and they don't value testing very much, but this might save us some headaches.

    The only thing I'm worried about with Selenium is O365 and SharePoint authentication, hopefully they have a way to handle that.

    Battle.net: Spawnbroker#1471
    Steam: Spawnbroker
    Final Fantasy XIV: Spawn Broken
  • zeenyzeeny Registered User regular
    edited May 2016
    It does exactly what you want, but you shouldn't use it for "testing"(let alone unit testing). Limited monitoring and regression prevention is where we've found it does an ok job. Start light and adjust based on hotspots/critical parts of the UI or as post mortem actions.

    zeeny on
  • admanbadmanb the bored genie Seattle, WARegistered User regular
    edited May 2016
    Do any of you have any experience with using Selenium to test websites? A lot of what I do is programming ASP.NET web pages, would Selenium be usable in a C# test project as a way to write unit tests against the UI?

    Like when the user clicks a button, did this element unhide itself, etc.? I don't have much experience with testing because my company runs REALLY lean and they don't value testing very much, but this might save us some headaches.

    The only thing I'm worried about with Selenium is O365 and SharePoint authentication, hopefully they have a way to handle that.

    I have gone through the full O365 auth process in Selenium. It is... not super pleasant, but it works well enough.

    Totally for testing and not to make production software work, that's for sure!

    admanb on
  • jaziekjaziek Registered User regular
    We're using it for regression testing, and just for general alerting.

    It is super easy to get up and running, you can even just record actions in a browser and convert that to your language of choice.

    Rather than just having a nagios script which checks that the site is up, it runs through a selenium script to test certain features of the site every so often.

    Steam ||| SC2 - Jaziek.377 on EU & NA. ||| Twitch Stream
  • gavindelgavindel The reason all your software is brokenRegistered User regular
    I love how I get internal emails saying "Confidential only! Company doing thing! Do not share!" and I can find the exact announcement on the net ten minutes later. I think Ars Technica is reading the emails before I do.


  • DelmainDelmain Registered User regular
    gavindel wrote: »
    I love how I get internal emails saying "Confidential only! Company doing thing! Do not share!" and I can find the exact announcement on the net ten minutes later. I think Ars Technica is reading the emails before I do.

    Do you work for my company.

    syndalis wrote: »
    Apple is a terrible company.
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Delmain wrote: »
    gavindel wrote: »
    I love how I get internal emails saying "Confidential only! Company doing thing! Do not share!" and I can find the exact announcement on the net ten minutes later. I think Ars Technica is reading the emails before I do.

    Do you work for my company.

    I think that's every company

    Magic Box
    Academician Prokhor "Phyphor" Zakharov, Chief Scientist of China, Provost of the University of Planet - SE++ Megagame
    crimsoncoyote
  • TofystedethTofystedeth veni, veneri, vamoosi Registered User regular
    Now I'm trying to figure out what company you work for based on Ars headlines.

    steam_sig.png
    crimsoncoyotea5ehren
  • bowenbowen How you doin'? Registered User regular
    Wait is gavin the one who works for citrix?

    Ladies.
  • gavindelgavindel The reason all your software is brokenRegistered User regular
    I work as a technoshaman at a multinational conglomeration of synergy boosting efficiency platform production tools. I wanted to be a decker, but the only intern openings were for harnessing the black ERP beasts which slumber beneath the seas.

    ...Will I get in trouble if I imply that Satya Nadella is a high level dragon?


    ecco the dolphinEtheaInfidelmightyjongyojjae2123Polaritie
  • LD50LD50 Registered User regular
    Man, I really want to play in a Shadowrun game now.

  • TofystedethTofystedeth veni, veneri, vamoosi Registered User regular
    edited May 2016
  • gavindelgavindel The reason all your software is brokenRegistered User regular
    LD50 wrote: »
    Man, I really want to play in a Shadowrun game now.

    It may be a dystopia, but I get a stock package!


  • InfidelInfidel Heretic Registered User regular

    Well, I updated policy on PAdev and some other servers, hopefully that protects for now.

    Will have to check when they put out a tester PoC.

    OrokosPA.png
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
    crimsoncoyote
  • KakodaimonosKakodaimonos Registered User regular
    It has been a while since I've done straight C. Nice to see I'm still making the same mistakes.

    ecco the dolphinGrape Ape
  • zeenyzeeny Registered User regular
    Infidel wrote: »

    Well, I updated policy on PAdev and some other servers, hopefully that protects for now.

    Will have to check when they put out a tester PoC.

    Are you guys still on linode? If you can be arsed, dump that shit and move to scaleway. It's just too cheap for anything hobby.

  • bowenbowen How you doin'? Registered User regular
    zeeny wrote: »
    Infidel wrote: »

    Well, I updated policy on PAdev and some other servers, hopefully that protects for now.

    Will have to check when they put out a tester PoC.

    Are you guys still on linode? If you can be arsed, dump that shit and move to scaleway. It's just too cheap for anything hobby.

    holy shit I can like triple my server power for the same cost

    how in the world are they cheaper

    Ladies.
  • zeenyzeeny Registered User regular
    It's online.net baby. They are big, their servers are great and they are cheap.

  • bowenbowen How you doin'? Registered User regular
    Oh I need an invitation.

    What is this, 2005?

    Ladies.
  • KakodaimonosKakodaimonos Registered User regular
    Who needs classes when you have anonymous structs.

    I do miss casting everything to void *

    bowenmightyjongyoEtheacrimsoncoyoteGrape Apehtm
  • bowenbowen How you doin'? Registered User regular
    Everything's an object!

    Ladies.
    htm
  • zeenyzeeny Registered User regular
    bowen wrote: »
    Oh I need an invitation.

    What is this, 2005?

    Are they still doing this? I thought they were open sign up now;o/ They had invitation process until a couple of months ago, so they can control availability, but I didn't realize that's still the case. I can invite if you want, PM me if it's not coming up by the regular channel.

  • InfidelInfidel Heretic Registered User regular
    zeeny wrote: »
    bowen wrote: »
    Oh I need an invitation.

    What is this, 2005?

    Are they still doing this? I thought they were open sign up now;o/ They had invitation process until a couple of months ago, so they can control availability, but I didn't realize that's still the case. I can invite if you want, PM me if it's not coming up by the regular channel.

    Took a quick look, but what are their datacenter options?

    OrokosPA.png
    Play D&D 4e? :: Check out Orokos and upload your Character Builder sheet! :: Orokos Dice Roller
    The PhalLounge :: Chat board for Critical Failures IRC! :: #CriticalFailures and #mafia on irc.slashnet.org
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    bowen wrote: »
    Everything's an object sequence of bytes!

    Magic Box
    Academician Prokhor "Phyphor" Zakharov, Chief Scientist of China, Provost of the University of Planet - SE++ Megagame
    Kakodaimonosecco the dolphinEtheacrimsoncoyotebowenhtm
  • amnesiasoftamnesiasoft Thick Creamy Furry Registered User regular
    Phyphor wrote: »
    bowen wrote: »
    Everything's an object sequence of bytes!
    Except the internet. It's a series of tubes.

    steam_sig.png
    Jacobyhtm
  • DelmainDelmain Registered User regular
    Phyphor wrote: »
    bowen wrote: »
    Everything's an object sequence of bytes!
    Except the internet. It's a series of tubes a big truck, something you just dump something on.

    syndalis wrote: »
    Apple is a terrible company.
  • zeenyzeeny Registered User regular
    edited May 2016
    Infidel wrote: »
    zeeny wrote: »
    bowen wrote: »
    Oh I need an invitation.

    What is this, 2005?

    Are they still doing this? I thought they were open sign up now;o/ They had invitation process until a couple of months ago, so they can control availability, but I didn't realize that's still the case. I can invite if you want, PM me if it's not coming up by the regular channel.

    Took a quick look, but what are their datacenter options?

    It's all in France, afaik.

    Edit: https://www.scaleway.com/faq/general/ aye.

    zeeny on
  • Jimmy KingJimmy King Registered User regular
    edited May 2016
    whee! My final final test ever today! Already queueing up projects, some with more clarity on specifics than others.

    I've got a bunch of Udacity courses queued up - intro to operating systems, intro to programming languages, already started on intro to data analysis and have the rest of their data analysis and ML and NLP stuff queued up.

    Going to finally get more in tune with current front end js stuff... gulp, babeljs, etc. Probably will run through the Udacity course on that plus hit the front end guys here at work with questions and figure out something to do for a project.

    Definitely going to do something with Elixir and Phoenix and think I have a plan for that.

    Want to do something with React Native... I'm currently thinking maybe a simple mobile app for working with the digital ocean api.

    Want to play with Pyglet maybe... not sure on that.

    Want to do something with C or C++, but not sure... perhaps a simple game of some sort? Not even sure where to start there. Would love to do a simple Roguelike sort of thing, but I might be getting way ahead of myself there.

    Same boat for something with C# but with a better chance of having pretty pictures.

    Something with Go? Rust? No idea beyond I want to fiddle. I might just do a chain of basic algorithm shit with some of these languages just to play.

    I'll definitely have some C/C++ dev environment questions. Probably initially want to set up to be working on Win 10 but able to build for multiplatform. OSX and Linux dev environments are also an option, I have a macbook from work, for anything console only I can use my toy server for Linux stuff or setup a local VM for something fancier. Just trying to avoid VM out of laziness plus old computer and OSX due to not really liking to do much work on the laptop display and keyboard vs hooking up to real monitor, etc.

    Jimmy King on
    ecco the dolphin
  • EtheaEthea Registered User regular
    Jimmy King wrote: »
    I'll definitely have some C/C++ dev environment questions. Probably initially want to set up to be working on Win 10 but able to build for multiplatform. OSX and Linux dev environments are also an option, I have a macbook from work, for anything console only I can use my toy server for Linux stuff or setup a local VM for something fancier. Just trying to avoid VM out of laziness plus old computer and OSX due to not really liking to do much work on the laptop display and keyboard vs hooking up to real monitor, etc.

    VisualStudio is still my initial recommendation when it comes to C++ editors. As far as building multiplatform, do you want to build binaries on Windows that will execute on Linux/OSX, or do you just want to write code that 'could' be built on those OS's?

    ecco the dolphin
  • Jimmy KingJimmy King Registered User regular
    Ethea wrote: »
    Jimmy King wrote: »
    I'll definitely have some C/C++ dev environment questions. Probably initially want to set up to be working on Win 10 but able to build for multiplatform. OSX and Linux dev environments are also an option, I have a macbook from work, for anything console only I can use my toy server for Linux stuff or setup a local VM for something fancier. Just trying to avoid VM out of laziness plus old computer and OSX due to not really liking to do much work on the laptop display and keyboard vs hooking up to real monitor, etc.

    VisualStudio is still my initial recommendation when it comes to C++ editors. As far as building multiplatform, do you want to build binaries on Windows that will execute on Linux/OSX, or do you just want to write code that 'could' be built on those OS's?

    Ideally build the bins on Windows, but it's hardly a critical thing. I'm just getting a rough idea of what I can/should do and making way more plans than I really will have time for. Ideally I'd be compiling using gcc in the end, but especially early on, even that isn't critical. I mostly just want to keep my C skills from totally falling apart and build some more C and C++ knowledge and am generally a Linux guy as far as dev goes.

  • TofystedethTofystedeth veni, veneri, vamoosi Registered User regular
    edited May 2016
    Help, I'm having a problem with my ASP.net website.
    I moved it from an old, getting retired server to a new one. It went mostly without hitch. However, I've got at least one user at one of our remote sites who's getting an error. The error they're getting is a sqlclient exception, that login failed for the user.
    Here's the weird thing. The user that the login is failing for, is the AD service account that application pool for that site runs as to access the database. They authenticate to the website as their AD account, but it runs as the service account.
    The double weird thing, is that so far it's worked fine for everyone else.
    The triple weird thing, is that the site runs at least 2 queries against the same database before reaching the part where it's claiming to fail.
    Also, I had the DBA check the server, and there's no login failures for that account in the logs.

    Tofystedeth on
    steam_sig.png
  • bowenbowen How you doin'? Registered User regular
    Here's the weird thing. The user that the login is failing for, is the AD service account that application pool for that site runs as to access the database. They authenticate to the website as their AD account, but it runs as the service account.

    You should probably fix that part first, before attempting to troubleshoot or fix anything else.

    Ladies.
  • TofystedethTofystedeth veni, veneri, vamoosi Registered User regular
    bowen wrote: »
    Here's the weird thing. The user that the login is failing for, is the AD service account that application pool for that site runs as to access the database. They authenticate to the website as their AD account, but it runs as the service account.

    You should probably fix that part first, before attempting to troubleshoot or fix anything else.

    Fix what part? That's working as designed.

    steam_sig.png
  • durandal4532durandal4532 Registered User regular
    edited May 2016
    Filemaker problem time:

    I have a form from a website that spits out a bunch of information to a Filemaker database. There are 600 or so variables, all answers to this giant survey.

    What we've got working right now is
    Perform Script ["GetCell"; Parameter: List ("AZ1"; $scriptparam)]
    Set Field [ABCD::AZ1; Get(ScriptResult)]
    

    So you get the cell info from this giant infodump by running "GetCell" with the input of what field you're looking for, and the whole shebang of the data.

    Then you set the field that matches that data with the script result.

    So far, so good.

    The thing is, I want to do this like... 500+ times. And I don't want to do it by using this awful IDE to hand-select each goddamn field for 1000 lines of redundant code.

    I'm having trouble figuring out how I can use Filemaker to essentially write:
    for(i = 1; 1:10){
    Perform Script ["GetCell"; Parameter: List (Paste("AZ", i); $scriptparam)]
    Set Field [ABCD::Paste(AZ, i); Get(ScriptResult)]
    }
    

    I just want to increment, and change field Blah + i for a given record each time. Blah1 = a, Blah2 = b, Blah3 = c, etc.

    All the built-in assumptions seem to be that you're only ever going to increment across records, never fields. It is infuriating. Filemaker is infuriating!

    Edit: Wait, I think I have what I need to do most of this.
    Set Variable [$Count; Value: 0]
    Loop
    Exit Loop If [$Count = 10]
    Perform Script ["GetCell"; Parameter: List ("AZ"&$Count; $scriptparam)]
    Set Field By Name ["ABCD::" & "AZ" & $Count; Get(ScriptResult)]
    Set Variable [$Count; Value: $Count + 1]
    End Loop
    

    So yeah it's still going to be a little annoying because I'll need to alter the character portions of the field IDs, but at least I can go 1-20 on these things automatically, instead of assigning them all individually.

    durandal4532 on
    Take a moment to donate what you can to the International Rescue Committee, the National Immigration Law Center, the Southern Poverty Law Center, and the American Civil Liberties Union. There has never been a more urgent moment to do so.
    bowen
  • bowenbowen How you doin'? Registered User regular
    edited May 2016
    bowen wrote: »
    Here's the weird thing. The user that the login is failing for, is the AD service account that application pool for that site runs as to access the database. They authenticate to the website as their AD account, but it runs as the service account.

    You should probably fix that part first, before attempting to troubleshoot or fix anything else.

    Fix what part? That's working as designed.

    It shouldn't be using the same account as an actual user to access database stuff.

    It's also likely the cause of your issues, seeing as how no other user is having problems.

    Why? I dunno, maybe they changed something in the underlying protocol that wouldn't fire off warnings. (which would explain why the new server has issues but not the old one)

    bowen on
    Ladies.
  • TofystedethTofystedeth veni, veneri, vamoosi Registered User regular
    edited May 2016
    bowen wrote: »
    bowen wrote: »
    Here's the weird thing. The user that the login is failing for, is the AD service account that application pool for that site runs as to access the database. They authenticate to the website as their AD account, but it runs as the service account.

    You should probably fix that part first, before attempting to troubleshoot or fix anything else.

    Fix what part? That's working as designed.

    It shouldn't be using the same account as an actual user to access database stuff.

    It's also likely the cause of your issues, seeing as how no other user is having problems.

    Why? I dunno, maybe they changed something in the underlying protocol that wouldn't fire off warnings. (which would explain why the new server has issues but not the old one)

    I might not have been clear. The user enters their AD information into the login form, which it checks against the domain to verify their credentials are correct. Then it runs queries against the application DB to check if they have access (this being the queries that are being run as the service account that it later claims couldn't log in). That information goes into session variables, but their AD account isn't involved past that point.

    And as I said, for the several other people who've used it since the move it's worked fine.

    Tofystedeth on
    steam_sig.png
This discussion has been closed.