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/
Options

[Programming] Page overflow to new thread

1910121415101

Posts

  • Options
    Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    edited July 2019
    Anyone here familiar with C# MVC and Web API?

    This project I'm working on is an MVC app that server-side renders a React app, for reasons. On the dashboard, I have a component that pulls summary sales data and it has buttons to switch time periods for the reports (Week, Month, Year, etc). I don't want to send all of that back to the server to render when someone changes the time period, so I was hoping to add a simple Web API endpoint. The problem is that the controllers are MVC controllers and handle the authentication in the ControllerBase class. If I use a Web API controller, I won't have access to the auth stuff. Is there a way to add an endpoint to an existing MVC controller to be called like a REST API?

    I'm sure I could just add a public method to the controller, but I'm not sure how to handle the authentication. I've never done an endpoint without a JWT.


    EDIT: I guess it is just as simple as adding a public method to the controller... who knew?

    Ear3nd1l on
  • Options
    AngelHedgieAngelHedgie Registered User regular
    So, here's a question - anyone know of a good free REST API suitable for use in a corporate demo?

    XBL: Nox Aeternum / PSN: NoxAeternum / NN:NoxAeternum / Steam: noxaeternum
  • Options
    bowenbowen How you doin'? Registered User regular
    So, here's a question - anyone know of a good free REST API suitable for use in a corporate demo?

    You can build rest APIs in swagger and dump them out in most of the sinatra based frameworks

    http://editor.swagger.io/

    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
  • Options
    Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    I believe Postman has something also that lets you build a basic demo of a REST API for testing and front-end development.

  • Options
    djmitchelladjmitchella Registered User regular
    So, here's a question - anyone know of a good free REST API suitable for use in a corporate demo?

    https://any-api.com/ has a whole lot of them -- depends on what you're hoping to demo, I guess.

  • Options
    TelMarineTelMarine Registered User regular
    So what's the deal with Rust...happen to be hearing about it more recently. Does anyone here use it? Worth looking into?

    3ds: 4983-4935-4575
  • Options
    schussschuss Registered User regular
    So, here's a question - anyone know of a good free REST API suitable for use in a corporate demo?

    GitHub has an open one you can use. Also NOAA has some for weather/forecast data

  • Options
    a5ehrena5ehren AtlantaRegistered User regular
    schuss wrote: »
    So, here's a question - anyone know of a good free REST API suitable for use in a corporate demo?

    GitHub has an open one you can use. Also NOAA has some for weather/forecast data

    https://www.weather.gov/documentation/services-web-api

  • Options
    templewulftemplewulf The Team Chump USARegistered User regular
    Does anyone have any backup options on Windows 10, especially that takes into account git repositories?

    Since git already has a file history, I kind of expect that Windows File History will end up duplicating some data. Are there any alternatives, or is the built in WFH fine for source controlled projects?

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • Options
    dporowskidporowski Registered User regular
    templewulf wrote: »
    Does anyone have any backup options on Windows 10, especially that takes into account git repositories?

    Since git already has a file history, I kind of expect that Windows File History will end up duplicating some data. Are there any alternatives, or is the built in WFH fine for source controlled projects?

    Dumb question, since I'm a Mac guy, but you can't tell it to explicitly exclude certain folders? I tend to drop my git repos under a single master /src (or /git or w/e floats your boat) then exclude that + all subfolders.

  • Options
    templewulftemplewulf The Team Chump USARegistered User regular
    dporowski wrote: »
    templewulf wrote: »
    Does anyone have any backup options on Windows 10, especially that takes into account git repositories?

    Since git already has a file history, I kind of expect that Windows File History will end up duplicating some data. Are there any alternatives, or is the built in WFH fine for source controlled projects?

    Dumb question, since I'm a Mac guy, but you can't tell it to explicitly exclude certain folders? I tend to drop my git repos under a single master /src (or /git or w/e floats your boat) then exclude that + all subfolders.

    It's definitely possible, but I'd like to be able to just pull everything from a backup.

    It's a small thing, but being able to conjure up my folder structure with everything in it would save a bit of hassle compared to doing an individual git clone on every project.

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • Options
    EchoEcho ski-bap ba-dapModerator mod
    I had some git repos in Dropbox once. :rotate:

  • Options
    Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    edited July 2019
    Apparently GitHub is having issues today.

    https://www.githubstatus.com/
    Git Operations					Degraded Performance
    API Requests					Degraded Performance
    Issues, PRs, Dashboard, Projects		Degraded Performance
    Notifications					Operational
    Gists						Degraded Performance
    GitHub Pages					Operational
    

    This is probably the only time in my professional career that I am happy my current project uses TFS.

    Ear3nd1l on
  • Options
    urahonkyurahonky Registered User regular
    Does anyone know if you pay for bandwidth if you use ECS Fargate to deploy an application? Looking at the pricing page it only mentions vCPU and RAM, but I have to assume that you have to pay for any data going in and out of that application.

  • Options
    urahonkyurahonky Registered User regular
    urahonky wrote: »
    Does anyone know if you pay for bandwidth if you use ECS Fargate to deploy an application? Looking at the pricing page it only mentions vCPU and RAM, but I have to assume that you have to pay for any data going in and out of that application.

    Ah, yep: https://aws.amazon.com/ec2/pricing/on-demand/#Data_Transfer somehow missed this.

  • Options
    JasconiusJasconius sword criminal mad onlineRegistered User regular
    edited July 2019
    is there some sort of tool where I can create a quick mock SQL table, and then do live edit/result of a query?

    I am not a very good SQL user and have trouble doing complex queries... thinking some sort of immediate feedback SQL statement editor would help me feel out my more difficult query problems

    Jasconius on
  • Options
    bowenbowen How you doin'? Registered User regular
    Jasconius wrote: »
    is there some sort of tool where I can create a quick mock SQL table, and then do live edit/result of a query?

    I am not a very good SQL user and have trouble doing complex queries... thinking some sort of immediate feedback SQL statement editor would help me feel out my more difficult query problems

    https://www.db-fiddle.com/
    http://sqlfiddle.com/

    For more:

    https://fiddles.io/

    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
  • Options
    vamenvamen Registered User regular
    What a cluster this week has been. I'm sure much of it is just being so new to all this, but man...my head.
    So I've recently taken over managing all of our web apps after my boss quit...I'm a DB guy with no programming experience, so it's been interesting.
    None of our stuff was on any manner of course control so I finally was trying to get around to that. I had used Git at home when messing around but I have to use TFS at work. Thankfully, we had a server all setup and ready to go. But man, it really started hitting the fan when I added my first site to source control.

    When I did all this Friday, it was fine. I came in Monday and suddenly I can't open any files because it will crash VS. Spent all day trying to get around that with no luck, so right now I just have installed a newer, trial version of VS so I can at least access my files in the meantime.

    Suddenly a bunch of code that was deployed and working fine is showing that it is broken with red squiggles. So I tried to just get rid of the source control, which caused all sorts of oddities and now I always get a warning that I was once using source control but am not now, but can't reconnect to it (which I don't want to currently). I completely deleted the project from the TFS server, unbound links, cleared the cache, deleted the solution connection files, etc. But everything is still a mess.

    TL:DR - Tried to do the responsible thing and setup sites on source control and just made everything much worse =p.

    </rant>

  • Options
    Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    God I hate TFS. I can almost picture the planning meeting when they came up with the idea...

    Monkey #1: "Hey, do you remember Visual Source Safe?"
    Monkey #2: "Oh yeah, that was awful."
    Monkey #1: "I've got a great idea for something that takes everything you hate about VSS and makes it worse!"
    Monkey #2: "Ship it!!!"

  • Options
    vamenvamen Registered User regular
    I don't know much about it - except my programmer friends all seem to hate it - but so far, I am not a fan. Even using command-line stuff for Git was 100x smoother than my experience with TFS so far.

  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    edited July 2019
    TFS is ballsack. It's a sweet mercy that ADO supports Git.

    admanb on
  • Options
    templewulftemplewulf The Team Chump USARegistered User regular
    admanb wrote: »
    TFS is ballsack. It's a sweet mercy that ADO supports Git.

    We used TFS in a corporate Windows environment, and it seemed okay. About as functional as Subversion, I guess.

    Is there a particular reason it gets more disdain than SVN or CVS?

    Twitch.tv/FiercePunchStudios | PSN | Steam | Discord | SFV CFN: templewulf
  • Options
    OrcaOrca Also known as Espressosaurus WrexRegistered User regular
    templewulf wrote: »
    admanb wrote: »
    TFS is ballsack. It's a sweet mercy that ADO supports Git.

    We used TFS in a corporate Windows environment, and it seemed okay. About as functional as Subversion, I guess.

    Is there a particular reason it gets more disdain than SVN or CVS?

    I have tried to use it as a bugtracker and it is garbage.

  • Options
    admanbadmanb unionize your workplace Seattle, WARegistered User regular
    edited July 2019
    templewulf wrote: »
    admanb wrote: »
    TFS is ballsack. It's a sweet mercy that ADO supports Git.

    We used TFS in a corporate Windows environment, and it seemed okay. About as functional as Subversion, I guess.

    Is there a particular reason it gets more disdain than SVN or CVS?

    It gets more disdain from me because I haven't used SVN since 2007 but I was using TFS six months ago.

    admanb on
  • Options
    SpawnbrokerSpawnbroker Registered User regular
    TFS is a blight upon this earth. It is a monument to humanity's folly and it should not exist.

    Steam: Spawnbroker
  • Options
    SmasherSmasher Starting to get dizzy Registered User regular
    I tried asking this in the Windows thread a while back but nobody had an answer; perhaps someone here can point me in the right direction.

    I wear headphones with the system volume set fairly low (20%) and yet periodically run across a video or whatever with sound so loud that feels like it's blowing out my eardrum. If the whole video is like that I can guard against it by just lowering my volume before I start the video and adjusting afterward, but all too often it's a random moment with no warning.

    What I'm looking for is either some program or relatively inexpensive piece of hardware that will set a cap on the maximum volume output by the computer, without distorting or quieting any sound below that amplitude. Does anything like that exist?

  • Options
    Monkey Ball WarriorMonkey Ball Warrior A collection of mediocre hats Seattle, WARegistered User regular
    edited July 2019
    Smasher wrote: »
    I tried asking this in the Windows thread a while back but nobody had an answer; perhaps someone here can point me in the right direction.

    I wear headphones with the system volume set fairly low (20%) and yet periodically run across a video or whatever with sound so loud that feels like it's blowing out my eardrum. If the whole video is like that I can guard against it by just lowering my volume before I start the video and adjusting afterward, but all too often it's a random moment with no warning.

    What I'm looking for is either some program or relatively inexpensive piece of hardware that will set a cap on the maximum volume output by the computer, without distorting or quieting any sound below that amplitude. Does anything like that exist?

    A lot of sound card drivers have built in normalization features, so you might want to start there, though I find that kind of stuff is often very hit or miss. Most sound drivers are kind of bad, not sure why.

    Monkey Ball Warrior on
    "I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
  • Options
    vamenvamen Registered User regular
    edited July 2019
    I've done some searches for this and mostly found tutorials that use drag-and-drop stuff that doesn't apply, or that uses Bootstrap, which I'm not really ready to get into yet.

    What do you think would be a good method for a multivalue dropdown box in VB.net? The page in question uses a bunch of ASP for dropdowns, but this new one needs to be able to select multiple items, or have little checkboxes so they can check multiple items.

    I'm also not really sure the ideal way to store that data. The page currently saves a single record row in a DB. I figure I'll need a new table that has a row tied to the record ID for each option they select, but I'm not sure the best way to tie that record to the new table.
    I'd even be fine using SelectMethod="multiple" for the asp:dropdownlist right now, but I'm not sure how to store that data. It errors out currently, no doubt because I haven't adjusted the code to deal with however it is trying to store multiple items... I assume "1,2,3", etc.

    I realize this is all pretty vague...sorry about that. I barely even know how to ask what I need at this point =p. Figuring all of this stuff out has been a whirlwind.

    EDIT - Are there any sort of good services out there where you can hire a freelance coder? I'd totally pay out of my own pocket to go over some of this stuff with a professional for a few hours just to get some suggestions/insight on things. I feel like I'm trying to build a house without knowing how to lay a foundation, put up walls, or hang a door.

    vamen on
  • Options
    Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    Are you talking WebForms? Or Razor?

  • Options
    vamenvamen Registered User regular
    I don't even know what Razor is...I'm super new at all this =).
    It's a Visual Studio solution file that has a bunch of ASP pages and the codebehind uses VB.

  • Options
    Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    edited July 2019
    Yeah, that's WebForms. I haven't used in in about ten years, but I think what you are looking for is <asp:ListBox>, not <asp:DropdownList>

    https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.listbox?view=netframework-4.8

    I'm guessing this is a project you inherited? If you are starting from scratch, there are much easier stacks to use.

    Ear3nd1l on
  • Options
    vamenvamen Registered User regular
    Ear3nd1l wrote: »
    Yeah, that's WebForms. I haven't used in in about ten years, but I think what you are looking for is <asp:ListBox>, not <asp:DropdownList>

    https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.listbox?view=netframework-4.8

    I'm guessing this is a project you inherited? If you are starting from scratch, there are much easier stacks to use.

    Yea, my old boss left and they aren't replacing him. He made all of our web apps. I have no experience beyond a little HTML and CSS, so trying to keep stuff running and adding new features has been quite an ordeal. And, I'm not expect, but his code feels like sort of a disaster, not even counting there is not a single comment ANYwhere.

    Thanks for the link, I'll have a look at that and see if it will do the trick. Much appreciated.

  • Options
    Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    You're welcome. And it sucks getting thrown into a situation like that, I'm sorry.

  • Options
    vamenvamen Registered User regular
    Ear3nd1l wrote: »
    You're welcome. And it sucks getting thrown into a situation like that, I'm sorry.

    I don't mind.
    Well, that's not right. But I'm glad to get the experience. I've been wanting to get into web stuff/coding for a while, so this is ... I won't say a GOOD way to do it. But a way =).

  • Options
    vamenvamen Registered User regular
    Not quite how I pictured it in my head, but this will definitely work. I still have to figure out how I want to get the actual data into a database, but I've got the lists working at least, so that's progress!
    Thanks again =).

  • Options
    Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    vamen wrote: »
    Not quite how I pictured it in my head, but this will definitely work. I still have to figure out how I want to get the actual data into a database, but I've got the lists working at least, so that's progress!
    Thanks again =).

    Absolutely, glad I could help.

  • Options
    ASimPersonASimPerson Cold... and hard.Registered User regular
    I did a phone screen today where the candidate straight-up admitted he learned Python to make coding interviews easier. While I hate coding interviews as much as the next guy, nothing about the job I'm hiring for involves Python on any way. That said, I also have to admit that the questions I ask are more about the algorithm and data structures used rather than implementing a hash table from scratch, but for some reason I still feel a bit torn between that seeming somewhat intellectually dishonest and learning Python myself to see if it'd help me with my own interviews.

    I guess at the end of the day coding interviews are still bullshit and we collectively need to think of something better.

  • Options
    Ear3nd1lEar3nd1l Eärendil the Mariner, father of Elrond Registered User regular
    I've been on both sides of coding interviews and they suck for everyone.

  • Options
    gavindelgavindel The reason all your software is brokenRegistered User regular
    Take your pick on the candidate merry go round. Nothing quite like being an excellent fit for the job until you wiff a question on a data structure you haven't seen since sophomore year...except maybe hiring somebody who has all of those data structures memorized and can't code in the real world with three people helping and a map.

    We just don't have a good handle on how to assess programming ability in a short timeframe outside of gut checks and black magic.

    Book - Royal road - Free! Seraphim === TTRPG - Wuxia - Free! Seln Alora
  • Options
    dporowskidporowski Registered User regular
    I would mind the concept of a coding interview less if they didn't tend to take place in the equivalent of a bare-bones text editor. Spend more time counting braces...

This discussion has been closed.