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.
 
  • Post
  • Reply
necrotic
Aug 2, 2005
I owe my brother big time for this!

Bruegels Fuckbooks posted:

You could just write a bunch of test scripts for postman that run through your api calls and verify that you're getting the expected results - this could act as an integration level test for your API. There are other tools that work similarly but postman comes to mind as widely available.

This is fine to a point, but reality never matches expectations. There's a high likelihood you don't cover everything, think you have with this approach (which you can do with regular testing anyway?), and then deploy it only to find the million edge cases with real data.

If you can capture the requests themselves for a period of time you could replay them in a test environment against both the old and new and verify that both databases match at the end. There's obviously a lot riding on being able to do that, but if possible its better than hand-crafting anything in a situation like this.

necrotic fucked around with this message at 00:59 on Jun 19, 2020

Adbot
ADBOT LOVES YOU

sausage king of Chicago
Jun 13, 2001
this is a dumb question, but it came up at my job a few days ago and just wanted opinions:

We have a controller that's called "coupons" and looks like /api/accounts/coupons. Coupons are associatd with customers - a customer can have a coupon.

We wanted expose an endpoint to void a coupon by customer id. a pr was submitted by person 1 with the endpoint being

code:
/coupons/void/customer/{customerId}
with the reasoning being this makes it clear that a coupon is being voided for that customer with that customer id

person 2 says it should be:

code:
/coupons?customerId={customerId}
with the reasoning being it should be a parameter since we don't have a coupon id to reference

person 3 says:

code:
/coupons/customer/{customerId}/void
since this is more RESTful and follows it being resource/action

which one seems to make the most sense?

raminasi
Jan 25, 2005

a last drink with no ice

Pollyanna posted:

We have an application that's behind a load balancer. We want to replace this application with one that responds identically, and therefore should behave identically, but that is based off of a completely different codebase and is otherwise a total rewrite. There's a particular approach I want to take in validating that our rewrite is a perfect drop-in replacement, but I don't recall the name.

As an engineer working on the replacement for this application, I want a tool that lets me compare the results of the same response made to two different applications/endpoints, so I can tell if the new solution is a drop-in replacement for the old solution.

Ideally, this could be done at the load balancer level (AWS if it matters) so that we could simply change the load balancer to always return the New Response instead of the Old Response.

Is there a name for this pattern/framework? Something along the lines of "experiment" or whatever? I could have sworn this existed, but I have no idea where to start looking.

I can't speak to whether this is sensible at the load balancer level or how to do it, but at the code level I've heard this called "experimenting" and there are libraries for it.

necrotic
Aug 2, 2005
I owe my brother big time for this!

sausage king of Chicago posted:

this is a dumb question, but it came up at my job a few days ago and just wanted opinions:

We have a controller that's called "coupons" and looks like /api/accounts/coupons. Coupons are associatd with customers - a customer can have a coupon.

We wanted expose an endpoint to void a coupon by customer id. a pr was submitted by person 1 with the endpoint being

code:
/coupons/void/customer/{customerId}
with the reasoning being this makes it clear that a coupon is being voided for that customer with that customer id

person 2 says it should be:

code:
/coupons?customerId={customerId}
with the reasoning being it should be a parameter since we don't have a coupon id to reference

person 3 says:

code:
/coupons/customer/{customerId}/void
since this is more RESTful and follows it being resource/action

which one seems to make the most sense?

Classic case of bike shedding. None of these are more correct, just pick one.

Although if I had to pick I'd go with the first, or the third, and not the middle.

Who doesn't love a little bike shedding?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

sausage king of Chicago posted:

this is a dumb question, but it came up at my job a few days ago and just wanted opinions:

We have a controller that's called "coupons" and looks like /api/accounts/coupons. Coupons are associatd with customers - a customer can have a coupon.

We wanted expose an endpoint to void a coupon by customer id. a pr was submitted by person 1 with the endpoint being

code:
/coupons/void/customer/{customerId}
with the reasoning being this makes it clear that a coupon is being voided for that customer with that customer id

person 2 says it should be:

code:
/coupons?customerId={customerId}
with the reasoning being it should be a parameter since we don't have a coupon id to reference

person 3 says:

code:
/coupons/customer/{customerId}/void
since this is more RESTful and follows it being resource/action

which one seems to make the most sense?

Paint it red.

"More RESTful" isn't a thing.

Kilson
Jan 16, 2003

I EAT LITTLE CHILDREN FOR BREAKFAST !!11!!1!!!!111!
edit: nevermind, I found the source of my problem

Kilson fucked around with this message at 03:45 on Jun 19, 2020

Volguus
Mar 3, 2009

sausage king of Chicago posted:

this is a dumb question, but it came up at my job a few days ago and just wanted opinions:

We have a controller that's called "coupons" and looks like /api/accounts/coupons. Coupons are associatd with customers - a customer can have a coupon.

We wanted expose an endpoint to void a coupon by customer id. a pr was submitted by person 1 with the endpoint being

code:
/coupons/void/customer/{customerId}
with the reasoning being this makes it clear that a coupon is being voided for that customer with that customer id

person 2 says it should be:

code:
/coupons?customerId={customerId}
with the reasoning being it should be a parameter since we don't have a coupon id to reference

person 3 says:

code:
/coupons/customer/{customerId}/void
since this is more RESTful and follows it being resource/action

which one seems to make the most sense?

code:
DELETE /coupons/customer/{customerId}
But like others have said: #1 can work, #3 can work or just paint it red. I'd rather paint it rainbow than go with #2, but that can work too.

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'

sausage king of Chicago posted:

this is a dumb question, but it came up at my job a few days ago and just wanted opinions:

We have a controller that's called "coupons" and looks like /api/accounts/coupons. Coupons are associatd with customers - a customer can have a coupon.

We wanted expose an endpoint to void a coupon by customer id. a pr was submitted by person 1 with the endpoint being

code:
/coupons/void/customer/{customerId}
with the reasoning being this makes it clear that a coupon is being voided for that customer with that customer id

person 2 says it should be:

code:
/coupons?customerId={customerId}
with the reasoning being it should be a parameter since we don't have a coupon id to reference

person 3 says:

code:
/coupons/customer/{customerId}/void
since this is more RESTful and follows it being resource/action

which one seems to make the most sense?

Option 3. If at some point you need to void specific coupons by id, you’d just slap it on the end.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Kilson posted:

edit: nevermind, I found the source of my problem

I think the point is that you can't game the system by figuring out what the inputs are and then coding directly to them.

Good that you found it though!

Nigel Tufnel
Jan 4, 2005
You can't really dust for vomit.
I’m currently learning React through Codecademy but, having previously learned Python through Codecademy and been unimpressed with where it left me once I finished the course, is there a better resource people recommend for learning React?

I ultimately want to build a little text based card game if that matters. Maybe a little personal todo app with no login etc gubbins.

The Fool
Oct 16, 2003


Maybe try https://www.freecodecamp.org ?

Their front end section does react and ends with some projects that give you a better grasp of how to build something.

dupersaurus
Aug 1, 2012

Futurism was an art movement where dudes were all 'CARS ARE COOL AND THE PAST IS FOR CHUMPS. LET'S DRAW SOME CARS.'

Nigel Tufnel posted:

I’m currently learning React through Codecademy but, having previously learned Python through Codecademy and been unimpressed with where it left me once I finished the course, is there a better resource people recommend for learning React?

I ultimately want to build a little text based card game if that matters. Maybe a little personal todo app with no login etc gubbins.

I've always thought pretty highly of the official React docs and tutorials, and it looks like they might have improved the later

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
I get in the rut of watching videos of learning a language then totally forgetting. But udemy has some decent react tutorials

Look Around You
Jan 19, 2009

Maybe I’m doing it wrong but I’ve never used code academies or anything like that. I just use official docs and maybe google to find (textual) sites explaining stuff. I can’t watch videos about programming, it just doesn’t work for me.

Empress Brosephine
Mar 31, 2012

by Jeffrey of YOSPOS
Yeah I don't know why i watch videos I don't seem to retain the knowledge, but I never do when it comes to programming lol

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I think I've asked about Markdown-based note taking stuff in here before since it fits with programmer culture, but I wanted to check in again after playing around with it a little more. I've particularly been trying Boost Note. It reached a point where I think I want to have my stuff show up on my phone so I'm looking at the synchronization alternatives. It looks like all the tools that synchronize support either/and/or a proprietary cloud system and one or more general cloud services (Dropbox). I'm wondering if there's any support a non-cloud, network-based solution? I'm talking, like, SSH. It doesn't seem like it. Furthermore, I get the strong message that I should stop being a grandpa and just sync on Dropbox.

ArcticZombie
Sep 15, 2010
Syncthing is available on Android I think, not sure about iOS. It’s sort of DropBox but peer-to-peer between your devices.

Edit: Oh wait I think you might’ve meant a markdown editor that supports syncing. I’ll leave this suggestion here anyway.

ArcticZombie fucked around with this message at 22:07 on Jun 23, 2020

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



I'm just going to leave an invite link to the GDN CoC Discord here for no particular reason https://discord.gg/G8Rb6T

Munkeymon fucked around with this message at 13:55 on Jun 25, 2020

Mr Shiny Pants
Nov 12, 2012

Munkeymon posted:

I'm just going to leave an invite link to the GDN CoC Discord here for no particular reason https://discord.gg/G8Rb6T

Thanks, I was wondering about this.

AgentCow007
May 20, 2004
TITLE TEXT

Munkeymon posted:

I'm just going to leave an invite link to the GDN CoC Discord here for no particular reason https://discord.gg/G8Rb6T

Link's dead

cr0y
Mar 24, 2005



New to this but I want to send SMS to users, just a couple, mostly for notification type stuff. What are some cheap/free options out there? (USA if it matters)

Slimy Hog
Apr 22, 2008

cr0y posted:

New to this but I want to send SMS to users, just a couple, mostly for notification type stuff. What are some cheap/free options out there? (USA if it matters)

AWS sns is free for 100 messages a month

The Fool
Oct 16, 2003


Twilio pricing is quite reasonable I thought

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



AgentCow007 posted:

Link's dead

https://discord.gg/hBV4Vk

Plank Walker
Aug 11, 2005
Not sure what keywords to look up, but let's say I had a 3d globe model, and a UV mapping that looked like:


If I wanted to place an image for example across the atlantic ocean, how would I derive the warping needed to fit it across the seam? Looking to do this programatically outside of a 3d editor, i.e. given a point on the globe and an image, place a 10x10 image at that point on it and unwrap to texture.

Any pointers to things to look up would be appreciated, in an endless google loop of the basics of UV mapping but not sure how to articulate the reverse case.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


The easiest way is to compute the inverse of the Mercator projection, but there's a pretty big caveat. There's no way to map a flat image onto the surface of a sphere while preserving distances, so you're going to have to either mess with the source image or accept some distortion.

nielsm
Jun 1, 2009



Plank Walker posted:

Not sure what keywords to look up, but let's say I had a 3d globe model, and a UV mapping that looked like:


If I wanted to place an image for example across the atlantic ocean, how would I derive the warping needed to fit it across the seam? Looking to do this programatically outside of a 3d editor, i.e. given a point on the globe and an image, place a 10x10 image at that point on it and unwrap to texture.

Any pointers to things to look up would be appreciated, in an endless google loop of the basics of UV mapping but not sure how to articulate the reverse case.

Assuming you're working with triangulated meshes and not mathematical spheres, what you'd do is map each vertex in your model onto a position on the texture. Some shared vertices can have the same coordinate, while in other places you'd have to have "seams" in the model with adjacent triangles not sharing vertices. There's probably a clever way to do it without manually mapping everything.

Xerophyte
Mar 17, 2008

This space intentionally left blank
What is under your control here? There are a lot of ways to map from the plane to the sphere. I wouldn't use an orange peel projection like that one if I had a choice specifically because it's quite complicated to map between the sphere and the projection.

If that's what you're stuck with then that is specifically the "interrupted Goode homolosine projection". It consists of a sinusoidal and Mollweide projection joined at 40°44′ latitude, and each hemisphere split at specific longitudes. It is analytically reversible by using those things, but doing all that does not sound like huge fun to me. You can also map a triangulated sphere to it and then project your splat texture triangle-by-triangle, but that sounds even more painful.

If you can choose your mapping freely then the easiest mapping to work with is the Equirectangular projection, commonly called "latlong" in CG, where you basically just rescale latitude and longitude to be in [0, 1] and use them directly as UV coordinates. The problem with latlong images are that they have extreme distortion as you get near the poles. There are a bunch of more complex projections that distort less, but they're varying degrees more annoying to work with. Mappings between Sphere, Disc, and Square is a paper from a few years back with a few classes of projection that are reasonably low distortion, plus code for projecting and deprojecting.

To handle splatting an image into a UV space texture, you're basically looking at projecting a hull of the image onto the sphere -- it doesn't need to be a fancy hull, a subdivided rectangle will do -- cutting the hull polygons at the UV seam lines and then projecting the hull into UV-space by projecting each vertex of it. Then you draw the image onto your projected hull and presto. How well subdivided your hull needs to be depends on how big your image is and how distorting the mapping is.

All that said: are you sure you need to project the image onto the texture? For interactive applications this sort of thing would usually be done with decals, which has the added benefit of avoiding filtering artifacts as you project the splat image into UV space. Another possible simplification if you're stuck with some horrid hard-to-reverse map projection is to use a separate, more easily computed UV space for the splats with a transparent default image.

Batterypowered7
Aug 8, 2009

The mist that chills you keeps me warm.

I'm working on a project for a network security course and I'm hoping goons might be able to provide some guidance.

Tools to use: SNORT, Wireshark

I've been given a large (nearly 1gb) PCAP file for which I'm supposed to write a few SNORT rules that do the following:

1) A rule that simply catches all connections. (To be labeled "Other")
code:
alert tcp -> any any (msg: "other"; sid: 1000005; rev: 001;)
alert udp -> any any (msg: "other"; sid: 1000006; rev: 001
2) A rule(s) to catch C&C behavior. (Completed)
code:
alert tcp any any -> any any (msg: "CNC"; content: "cnc"; http_uri; sid: 1000007; rev: 001;)
alert tcp any any -> any any (msg: "CNC"; content: "botSELECT *"; sid: 1000008; rev:001;)
3) A rule(s) to catch suspected malicious scanning connections. (Completed)
code:
 alert tcp any any -> any any (msg:"Scanning"; flags: FPU; sid:1000009; rev:001;)
4) A rule(s) to catch suspected DDOS connections. (I have a rule written but I'm not sure if it's doing what I need it to do.)
code:
alert tcp any any -> any any(msg:"DDOS"; flags: S; flow: stateless; detection_filter: track by_dst, count 80, seconds 1; sid: 1000010; rev: 001;)
alert tcp any any -> any any(msg: "DDOS"; flow: stateless; content: "GET"; nocase; http_method; detection_filter: track by_dst, count 105, seconds 1; metadata: service http; sid: 1000011; rev: 001;)
The project rubric provides stats for each connection type.

Total unique cnc connections: 80 (catching 75 with my rules)
Total unique ddos connections: 185 (catching 177 with my rules)
Total unique scan connections: 14004 (catching more than 14004, but false positives are allowed)
Total unique other connections: 16274
Total unique connections: 30543

Full points are awarded for identifying at least 80% of each type of connection.

I'm seeking help with two things:

1) Writing the rule to label all connections "other".
2) Sanity checking my DDOS rule.

Would anyone be able to help?

Figured it out. Huzzah.

Batterypowered7 fucked around with this message at 01:55 on Jul 5, 2020

Edgar Allan Pwned
Apr 4, 2011

Quoth the Raven "I love the power glove. It's so bad..."
how can I use programming to make better things happen in my community? I'm actually thinking about gun violence, or even voting, or relief during covid.but everything I think of comes down to data collecting and I wonder if I'm not thinking of something.

gun violence - no idea. I noticed a lot of organizations try to get the youth interested in something other than guns (like music) but I guess I'm more concerned of guns in circulation and getting them out. or gang violence?


voting - if the state has a list of registered voters, you could somehow collect who has been removed over time. I know a lot of States are flushing users out.

covid - I can only imagine data collection, but of course the data is hosed anyways.

KillHour
Oct 28, 2007


Edgar Allan Pwned posted:

how can I use programming to make better things happen in my community? I'm actually thinking about gun violence, or even voting, or relief during covid.but everything I think of comes down to data collecting and I wonder if I'm not thinking of something.

gun violence - no idea. I noticed a lot of organizations try to get the youth interested in something other than guns (like music) but I guess I'm more concerned of guns in circulation and getting them out. or gang violence?


voting - if the state has a list of registered voters, you could somehow collect who has been removed over time. I know a lot of States are flushing users out.

covid - I can only imagine data collection, but of course the data is hosed anyways.

Volunteer for a nonprofit that has goals similar to yours. They always need people to do boring IT monkey poo poo and they can never afford it.

If you're looking for something big and splashy like "I made an algorithm to solve X!", you're basically looking at getting a PhD in computational sociology and going into a field that doesn't pay squat, so good luck.

KillHour fucked around with this message at 17:37 on Jul 4, 2020

Dominoes
Sep 20, 2007

Make an army of bots to turn the tide in the favor of your cause, or counter opposite bots.

I mean this partly jokingly, but I speculate this will be an increasing ubiquitous factor in public sentiment over the next few years/decades.

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

yeah or like, advanced distributed k-pop video submission systems

Mr Shiny Pants
Nov 12, 2012

Edgar Allan Pwned posted:

how can I use programming to make better things happen in my community? I'm actually thinking about gun violence, or even voting, or relief during covid.but everything I think of comes down to data collecting and I wonder if I'm not thinking of something.

gun violence - no idea. I noticed a lot of organizations try to get the youth interested in something other than guns (like music) but I guess I'm more concerned of guns in circulation and getting them out. or gang violence?


voting - if the state has a list of registered voters, you could somehow collect who has been removed over time. I know a lot of States are flushing users out.

covid - I can only imagine data collection, but of course the data is hosed anyways.

Go outside and talk to people.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Edgar Allan Pwned posted:

how can I use programming to make better things happen in my community?

Take a look at Code for Social Good. There are probably some projects there you can contribute to.

Tryzzub
Jan 1, 2007

Mudslide Experiment

Edgar Allan Pwned posted:

how can I use programming to make better things happen in my community? I'm actually thinking about gun violence, or even voting, or relief during covid.but everything I think of comes down to data collecting and I wonder if I'm not thinking of something.

gun violence - no idea. I noticed a lot of organizations try to get the youth interested in something other than guns (like music) but I guess I'm more concerned of guns in circulation and getting them out. or gang violence?


voting - if the state has a list of registered voters, you could somehow collect who has been removed over time. I know a lot of States are flushing users out.

covid - I can only imagine data collection, but of course the data is hosed anyways.

Seconding the nonprofit idea, as well as any community orgs that align with your interests. These places already have problems that need tech solutions.

Keep in mind a lot of it may be fairly routine, such as “we need someone to maintain our website” or a programmatic way to get a cut of data.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Edgar Allan Pwned posted:

how can I use programming to make better things happen in my community? I'm actually thinking about gun violence, or even voting, or relief during covid.but everything I think of comes down to data collecting and I wonder if I'm not thinking of something.

gun violence - no idea. I noticed a lot of organizations try to get the youth interested in something other than guns (like music) but I guess I'm more concerned of guns in circulation and getting them out. or gang violence?


voting - if the state has a list of registered voters, you could somehow collect who has been removed over time. I know a lot of States are flushing users out.

covid - I can only imagine data collection, but of course the data is hosed anyways.

Last time I wondered about this, more specifically along the lines of "let's do a hackathon to make apps that help <causes>", it was pointed out to me that anything requiring any maintenance whatsoever is probably just going to be a burden, unless you're also signing up to perpetually maintain the thing. That shut down the idea pretty quick.

The correct answer is to find an org you want to help and go ask them what they need. Let them know your particular talents. The most helpful thing might be "make an app" or at least "can you make a spreadsheet that does X", but it might just be "carry these reams of paper to the office upstairs".

csammis
Aug 26, 2003

Mental Institution

pokeyman posted:

"carry these reams of paper to the office upstairs".

Goons do have a particular talent for carrying printers...

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

csammis posted:

Goons do have a particular talent for carrying printers...

Really, goons would be very effective at digging wells.

Adbot
ADBOT LOVES YOU

AgentCow007
May 20, 2004
TITLE TEXT
What might be involved in writing a backend for a service that rents game servers? I followed a SaaS tutorial for express and mongo for basic login/payment functionality, but I'm not really sure where to start with automatic server provisioning, scheduling, etc.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply