Ear3nd1lEärendil the Mariner, father of ElrondRegistered Userregular
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?
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?
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.
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.
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.
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.
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
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
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.
Ear3nd1lEärendil the Mariner, father of ElrondRegistered Userregular
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!!!"
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.
TFS is a blight upon this earth. It is a monument to humanity's folly and it should not exist.
Steam: Spawnbroker
+2
Options
SmasherStarting to get dizzyRegistered Userregular
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?
0
Options
Monkey Ball WarriorA collection of mediocre hatsSeattle, WARegistered Userregular
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
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.
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.
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.
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 .
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 .
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 .
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.
Ear3nd1lEärendil the Mariner, father of ElrondRegistered Userregular
I've been on both sides of coding interviews and they suck for everyone.
+7
Options
gavindelThe reason all your softwareis brokenRegistered Userregular
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.
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...
Posts
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?
You can build rest APIs in swagger and dump them out in most of the sinatra based frameworks
http://editor.swagger.io/
https://any-api.com/ has a whole lot of them -- depends on what you're hoping to demo, I guess.
GitHub has an open one you can use. Also NOAA has some for weather/forecast data
https://www.weather.gov/documentation/services-web-api
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.
https://www.githubstatus.com/
This is probably the only time in my professional career that I am happy my current project uses TFS.
Ah, yep: https://aws.amazon.com/ec2/pricing/on-demand/#Data_Transfer somehow missed this.
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/
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>
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!!!"
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.
It gets more disdain from me because I haven't used SVN since 2007 but I was using TFS six months ago.
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.
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.
It's a Visual Studio solution file that has a bunch of ASP pages and the codebehind uses VB.
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.
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 .
Thanks again .
Absolutely, glad I could help.
I guess at the end of the day coding interviews are still bullshit and we collectively need to think of something better.
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.