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
Tea Bone
Feb 18, 2011

I'm going for gasps.
I have a minifed javascript file that is flagging up 75.9% unused in chromes coverage check which adds up to about 700KB. I don't have access to the pre-minfied version and obviously, at this size it's unfeasible to remove all the unused code by hand.

Is there a tool I can feed the coverage checkreportto that will remove the unused code for me?

Adbot
ADBOT LOVES YOU

Paul MaudDib
May 3, 2006

TEAM NVIDIA:
FORUM POLICE

Biowarfare posted:

comedy option is to toss it in k8s, make sure your pipelines deploy new pods and deployments with selectors/metadata for versions + commit hashes + branch names etc, then you can automatically have a service proxy match /v1/ -> send to pods running v1, /v2/ -> send to pods running v2 etc automatically

We’re going to be using k8s (engineers want to play with tooling) so this sounds pretty much like what I want

Impotence
Nov 8, 2010
Lipstick Apathy

Paul MaudDib posted:

We’re going to be using k8s (engineers want to play with tooling) so this sounds pretty much like what I want

if you're going to be doing new fuckaround stuff try to start with decent practice instead of bolting it on afterward, like mtls, http2, http3/quic, grpc where possible, etc

timp
Sep 19, 2007

Everything is in my control
Lipstick Apathy
Goons, I need help!

I've recently found myself in an interim (and hopefully soon to be more permeant) marketing management position, and my #1 priority is to hire a person or company to help us unfuck all the various dev issues we have going on. Right now we have one guy from an agency and, while he's not bad, he's woefully outclassed when it comes to issues vs. time

Here are some of the issues we face. I unfortunately can't be too specific in this setting, but hopefully it's enough to get some info.

- Website design issues. I can't do poo poo on our site without it looking terrible. We need someone to help us define the CSS for every single page
- Website speed issues
- API integration between BigCommerce, NetSuite, etc.
- Other random website/development stuff as needed
- One guy at the company requested someone who knows some SQL too, though that's not as high priority

The main three platforms we need help with are Wordpress, BigCommerce, and NetSuite. Anyone who was super comfy with all three of those would be perfect.

So my question is: What sort of person or company should I be looking for? While we do need a wide range of platforms and systems worked on, I feel like there's something that sort of combines them all, and I'm hoping there's a word or category for it that I can use to start searching around. I'd also be more than happy to consider recommendations.

One other thing: The guy we have now is super vague about what he spends his retainer time doing, which I kinda feel like is bullshit. We need a person or company that doesn't mind documenting their work (even just a little, doesn't have to be a novel!) and being responsive to helping us fix lots of little problems in the short term and then working on bigger projects long term.

Tell me what to do please! And if I'm way off base with any of this, please set me straight.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

timp posted:



- Website design issues. I can't do poo poo on our site without it looking terrible. We need someone to help us define the CSS for every single page
- Website speed issues

How did these two get to where they are now?
Do you not have a brand style guide?
Are the speed issues from optimized code, or just too many features?

Basically, who makes the final call for what goes on the site, regardless of who builds it?

timp
Sep 19, 2007

Everything is in my control
Lipstick Apathy

The Merkinman posted:

How did these two get to where they are now?
Do you not have a brand style guide?
Are the speed issues from optimized code, or just too many features?

Basically, who makes the final call for what goes on the site, regardless of who builds it?

It's all real loose right now. Like I said I inherited this position, only because I was the last person left standing. Through what I would consider a series of miscommunication and management blunders, we now have a one person marketing department and a website that's, like, half-finished at best. From what I remember hearing when the site was being built last summer, there were a lot of disagreements about hosting. So a fancy NYC design company built the website and, at the last minute, our CEO didn't want them to host it, so they packed it up and shipped it to us and we set it up on Pantheon. Problems ever since, and they've gone largely unaddressed. But now that I'm Mr. Big Fancy Manager I'm making a few changes around here

But to answer your question, I guess me, with a little oversight every now and then from my boss, the CEO? Like I said, loosey goosey. I'm trying to unfuck ittttt :smithicide

e: Speed issues seem to be stemming from load order, based on the audits and my opinion as a longtime front end website guy. But I'm certainly not proficient in this sort of thing

Tei
Feb 19, 2011

timp posted:

- Website design issues. I can't do poo poo on our site without it looking terrible. We need someone to help us define the CSS for every single page
- Website speed issues
- API integration between BigCommerce, NetSuite, etc.
- Other random website/development stuff as needed
- One guy at the company requested someone who knows some SQL too, though that's not as high priority

I personally would go for a company. One not too small or too big. Ask then to bid for the contract.
Don't get the best bid, because that may be somebody that calculated wrong. Is time to build a relation that can long and be profitable for both parts.

Maybe divide the task into small tasks. Try them with something small with a bit of design and a lot of programming. If they excel, ask them more. If they fail, find somebody else.

Fixing or unfucking somebody else website could be hard work. Not a fancy job.

kedo
Nov 27, 2007

Agreed, you want a company, not a freelancer. You're in for a tough slog because a lot of what you just posted are red flags for anyone who might be willing to take on the project. Few people are interested in maintaining a site they didn't build, and even fewer will want to work with a company that fired their last designers/devs over what sounds like your company not honoring part of a contract (reading between the lines here). Get ready to pay out the nose!

You may be hard pressed to find a firm that has expertise in WP, BigCommerce and NetSuite, so I'd say pick the one or two that are most important to you and search around for a good shop that has the necessary experience. WP is clearly going to be the most important of the three, as the site is built on it and the other two are just integrated in via APIs, so in theory a good WP developer should be able to figure out what's going on with those integrations (assuming there's at least a minimal amount of documentation).

My two cents as someone who would normally fit the bill for this project (if I weren't already totally booked): I wouldn't touch this with a ten thousand foot pole. Steel yourself for either dealing with this shitheap for the next several years without any real fixes, or tossing the entire thing in the trash and starting from scratch. Picking up a half finished project is something no one wants to do.


e: \/ \/ \/

kedo fucked around with this message at 15:21 on Jul 22, 2021

Pollyanna
Mar 5, 2005

Milk's on them.


That sounds like red flags for the entire company, not just the project/product.

timp
Sep 19, 2007

Everything is in my control
Lipstick Apathy
Thanks for the advice everyone; I think I'm going to start researching mid-sized website development companies, get some quotes and go from there. As a former agency employee I'm fully aware of the nightmare headache some of these problems are, and my hope is that I can help to sort out all the problems, prioritize them, and task them out. In other words, protect the dev from the bullshit and just give them clearly defined projects.

Pollyanna posted:

That sounds like red flags for the entire company, not just the project/product.

You're not entirely wrong there! But I've actually been given a surprising about of budget and freedom to do my bidding, so I'm optimistic I can turn things around a bit. I have to be.

If any goons here are looking for an opportunity feel free to DM me; as you can see it's not an ideal situation, but you'd be working with me and I promise not to be a total oval office :)

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen
Get on fetlife and recruit a masochist imo.

frogbs
May 5, 2004
Well well well

timp posted:

So a fancy NYC design company built the website and, at the last minute, our CEO didn't want them to host it, so they packed it up and shipped it to us and we set it up on Pantheon.

Man, to me this sounds like at least part of this is a company/culture problem. You can have good developers but if decisions from the top don't do them any favors then you're way more likely to end up with something that won't work quite right (speaking from experience!).

kedo posted:

Agreed, you want a company, not a freelancer.

Yeah, get an established company with multiple developers so you aren't depending on one person. It'll be expensive but worth it in the long run!

timp posted:

You're not entirely wrong there! But I've actually been given a surprising about of budget and freedom to do my bidding, so I'm optimistic I can turn things around a bit. I have to be.

Oh that's good!

Paul MaudDib
May 3, 2006

TEAM NVIDIA:
FORUM POLICE
We're using Java, Spring Web/MVC and Jersey for JSON serialization/deserialzation for data flow to a web frontend.

Is there a good way to deal with "sparse" query parameters in an HTTP request? We have a "search" method which could have a very large number of possible arguments, and most likely only a couple will ever be populated. Obviously the API consumers do not need to send every possible request parameter every time, but on the application side that would be ugly to handle if we had to manually list every single possible request parameter in a @RequestParam(required=false) myParam type scenario.

The way I'm currently implementing this is that I'm only putting the "common" parameters that will always be populated or are agnostic between different kinds of requests (API access token, sort order, etc) in the actual (spring-mapped) method parameters and getting the others from the HttpServletRequest request parameters. I can take the object we're querying on, use reflection to get the field names, and then construct other variations on those fields (eg for a numeric type you might have: field, fieldLessThan, fieldGreaterThan, for a string type you might have field, fieldLike, etc).

That way we don't have to deal with high-dimensional sparse request parameters, but we also don't have to allow full arbitrary query-writing privileges from a frontend.

Is there a better way?

The other way we could probably do this is to abandon the idea of a general "WidgetService" with broad queries that could be used between different parts of the program, and just narrowly tailor API queries directly to the use-cases - eg instead of "WidgetService/search" we have "WidgetService/widgetListingSearch" and it only includes the stuff needed by the query for that specific page. Both of them have different kinds of pain I guess - the general search you will have to be careful not to break any existing functionality but the widgetListingSearch you potentially have a lot more controller methods that need to be maintained...

Pedestrian Xing
Jul 19, 2007

Paul MaudDib posted:

Is there a good way to deal with "sparse" query parameters in an HTTP request? We have a "search" method which could have a very large number of possible arguments, and most likely only a couple will ever be populated. Obviously the API consumers do not need to send every possible request parameter every time, but on the application side that would be ugly to handle if we had to manually list every single possible request parameter in a @RequestParam(required=false) myParam type scenario.

@RequestParam?

quote:

When an @RequestParam annotation is declared as a Map<String, String> or MultiValueMap<String, String>, without a parameter name specified in the annotation, then the map is populated with the request parameter values for each given parameter name.

Could also look at using a custom HandlerMethodArgumentResolver to turn all eligible query params into a custom DTO and pass it into your controller methods.

Sab669
Sep 24, 2009

stupidnewbie.jpg: I just recently started a job working with Angular and a bunch of other things I've never even so much as looked at. I've got a tiny app that just presents data pulled from an API. My component's HTML looks like this:

code:
    <div class="spinner-border text-success progress-spinner" role="status" *ngIf="!isDataLoaded">
        <span class="sr-only">Loading Loan Quotes...</span>
    </div>
This was working, now it's throwing an error in my console saying "Can't bind to 'ngIf' since it isn't a known property of 'div'."

If I change it to use [ngIf] instead of *ngIf, my app works but now VSCode gives me a red squiggly with the same error as above.

I googled around and all I could find were like 5 year old posts saying to import { CommonModule } from '@angular/common';, but that did not fix the issue.

Anyone know what dumb thing I'm missing/doing wrong? :(

Sab669 fucked around with this message at 13:57 on Jul 28, 2021

MikeJF
Dec 20, 2003




If it's the app root module you import BrowserModule, if it's a module designed to exist as a child you import CommonModule instead. Is that it? (How did you set up this tiny app? Did you use ng to generate the workspace?). I assume your component is imported to the module properly, that could cause similar.

There's a lot of things that might go wrong, though, a snippet is difficult to diagnose from.

MikeJF fucked around with this message at 14:53 on Jul 28, 2021

Sab669
Sep 24, 2009

It's not the app-root, just some dashboard component that'll be used as a sort of navigation menu at the top of any given page.

I actually was just given an existing little app and basically told "Rip out everything you don't need, and add a component to show this data", for better or worse. I made no changes to the app-component.ts for what I'm doing.

The original app I started with only has 3 imports in this dashboard component and *ngIf works just fine there;

code:
import { Component, OnInit } from '@angular/core';
import { Base } from 'src/app/shared/classes/Base';
import { FormGroup } from '@angular/forms';
All I did to this dashboard component was remove FormGroup, as what I'm developing won't need a <form> on it. It really couldn't get much more simple - here's the entire class

code:
import { Component, OnInit } from '@angular/core';
import { Base } from 'src/app/shared/classes/Base';

@Component({
  selector: 'app-dashboard',
  templateUrl: './dashboard.component.html',
  styleUrls: ['./dashboard.component.css']
})

export class DashboardComponent extends Base implements OnInit {  
  //Privileges and things
  public readEnterprisePrivilege: string = 'read-enterprise-data';

  public readEnterpriseQuote: boolean = this.doesCurrentUserHaveAccessToThisResource(this.readEnterprisePrivilege);
  //Config vars
  public isDataLoaded: boolean = false;
  public loadingDataErrorMessage: string = "";

  ngOnInit(): void {
    console.log('readEnterpriseQuote: ' + this.readEnterpriseQuote);
  }
}
(this.doesCurrentUserHaveAccessToThisResource() is defined in the Base class)

Sab669 fucked around with this message at 15:31 on Jul 28, 2021

MikeJF
Dec 20, 2003




Can you quote the module?

Sab669
Sep 24, 2009

I'm not sure what you're asking

MikeJF
Dec 20, 2003




The module file that imports the components and bootstraps the app, can you quote that code?

Sab669
Sep 24, 2009

Ah, yea, ended up being an issue with app-module.ts; was able to figure it out. Thanks

kedo
Nov 27, 2007

I'm on semi-sabbatical at the moment and am not coding enough to really make use of this, but is anyone here using https://copilot.github.com/?

Violator
May 15, 2003


kedo posted:

I'm on semi-sabbatical at the moment and am not coding enough to really make use of this, but is anyone here using https://copilot.github.com/?

Haven't used it yet, but a lot of people were pissed. "I didn't consent to AI learning from my code!!!" It was also leaking passwords and internal API information from some major folks (like AirBNB if I remember?) because it learned from their codebase and found that stuff. Hopefully that was fixed. :O

Full Circle
Feb 20, 2008

kedo posted:

I'm on semi-sabbatical at the moment and am not coding enough to really make use of this, but is anyone here using https://copilot.github.com/?

It's a fun novelty and definitely impressive. At it's current state it's basically the equivalent of searching stackoverflow and copy-pasting the top answer. Here's a sample I just ran:

Input:
code:
// React button that increments a counter
Output:
code:
var React = require('react');
var ReactDOM = require('react-dom');

var Counter = React.createClass({
  getInitialState: function() {
    return {count: 0};
  },
  onClick: function() {
    this.setState({count: this.state.count + 1});
  },
  render: function() {
    return (
      <div>
        <h1>Counter: {this.state.count}</h1>
        <button onClick={this.onClick}>Click me!</button>
      </div>
    );
  }
});

ReactDOM.render(<Counter />, document.getElementById('app'));
The "taking our jobs" hand-wringing is pretty silly though. Word your request slightly wrong and you get absolute garbage answers. For instance when I tried to ask it for a functional rather than class component is started spitting out random jest test cases.

LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer
https://insights.stackoverflow.com/survey/2021#top-paying-technologies-other-tools

I didn't know Svelte was that popular. Does it live up to the hype? I really like how it looks much closer to an HTML document than React.

worms butthole guy
Jan 29, 2021

by Fluffdaddy
I didn't know ruby was still relevant

foghorn
Oct 9, 2006

Haters gunna hate.

kedo posted:

I'm on semi-sabbatical at the moment and am not coding enough to really make use of this, but is anyone here using https://copilot.github.com/?

It’s good for getting basic skeleton functions built out, but it might actually take more time and effort to validate and debug what it spat out than if you typed it yourself.

Also, fun story, it was auto-completing people’s API keys for a while there. Like, valid, working API keys for different services.

Remember kids, don’t commit your keys! And always rotate exposed creds!

Pollyanna
Mar 5, 2005

Milk's on them.


Golang making less than Ruby was a trip to me.

And godddammit I’d love to have a Clojure job :negative:

spiritual bypass
Feb 19, 2008

Grimey Drawer

LifeLynx posted:

https://insights.stackoverflow.com/survey/2021#top-paying-technologies-other-tools

I didn't know Svelte was that popular. Does it live up to the hype? I really like how it looks much closer to an HTML document than React.

Svelte is easy to use and performant. You should give it a try

Summit
Mar 6, 2004

David wanted you to have this.

Pollyanna posted:

Golang making less than Ruby was a trip to me.

And godddammit I’d love to have a Clojure job :negative:

Literally all of the salaries on there seem hilariously underpaid to me, and I’m in Minnesota. People don’t actually work in development for 50K anymore do they? I made more than that for my first job like 10 years ago.

lunar detritus
May 6, 2009


Summit posted:

Literally all of the salaries on there seem hilariously underpaid to me, and I’m in Minnesota. People don’t actually work in development for 50K anymore do they? I made more than that for my first job like 10 years ago.

It's a global survey, which probably also explains why some languages look better paid than others.

Chenghiz
Feb 14, 2007

WHITE WHALE
HOLY GRAIL
$JOB has explicitly forbidden us from using Copilot at work due to legal concerns. Also, the example that Full Circle posted raises an interesting point, being library functionality that has been obsolete for several years, that Copilot has no sense of whether the code it's learned is valid in whatever version of the framework, library, or maybe even language it's being written for. Seems like a thorny problem to solve.

LifeLynx
Feb 27, 2001

Dang so this is like looking over his shoulder in real-time
Grimey Drawer

rt4 posted:

Svelte is easy to use and performant. You should give it a try

The main thing stopping me is that Next.js seems much more stable and feature-complete than SvelteKit. But being able to write HTML syntax without things like putting it in a return statement or using className, updating state without relying on useState/useEffect hooks, and other things are so tempting.

Vincent Valentine
Feb 28, 2006

Murdertime

Full Circle posted:



The "taking our jobs" hand-wringing is pretty silly though. Word your request slightly wrong and you get absolute garbage answers. For instance when I tried to ask it for a functional rather than class component is started spitting out random jest test cases.

Anything short of science-fiction level AI is not going to give the answers you actually want. We know this because we are often given tasks as humans and perform them to the letter only to find out that the person who asked for the thing didn't actually know what they wanted.

But this goes to something that I think came up in this very thread like 6 years ago: AI is never going to take our jobs, because it will just become another type of programming language to tell the AI what you want in a specific enough manner to get usable results.

Summit
Mar 6, 2004

David wanted you to have this.
I have to question if people saying AI coding is going to replace development actually do this job. The actual writing code is the easy part. Figuring out what the hell the product owner(s) actually want is most of the difficulty.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!

Summit posted:

I have to question if people saying AI coding is going to replace development actually do this job. The actual writing code is the easy part. Figuring out what the hell the product owner(s) actually want is most of the difficulty.

What happens if you tell the AI that you want "seven red lines, all of them strictly perpendicular, some with green ink and some with transparent"?

worms butthole guy
Jan 29, 2021

by Fluffdaddy
Is there a good book for learning asp.net?

Tei
Feb 19, 2011

Vincent Valentine posted:

Anything short of science-fiction level AI is not going to give the answers you actually want. We know this because we are often given tasks as humans and perform them to the letter only to find out that the person who asked for the thing didn't actually know what they wanted.

But this goes to something that I think came up in this very thread like 6 years ago: AI is never going to take our jobs, because it will just become another type of programming language to tell the AI what you want in a specific enough manner to get usable results.

From my position a Compiler is a specialized AI system to generate assembler code withouth actually knowing how to write assembler.

Programming is not going to lose jobs, but machine learning is going to ocuppy jobs that could have been for programmers.

Imagine a system to balance a traffic system. You can put in a room a bunch of traffic experts and programmers, and they may write a system with rules and a UI to make the traffic in the city better. But you can also try to solve the problem with machine learning, by feeding it a log of previous decisions and the result ( we did this and this is how affected the output) until it "learns" by itself to take decisions.

I think more and more systems will have a machine learning AI solution, where previously they would have been produced a complex software with a lot of rules carefully balanced by technicians and scientist.

Combat Pretzel
Jun 23, 2004

No, seriously... what kurds?!
How does everyone go about making things printable?

I'm trying to design the report pages to be reactive to screen and print, but every browser has its quirks in how it handles printing. What pissed me off yesterday was when I describe the page format in CSS, Microsoft ChrEdge for instance reacts to it in the print preview and adjusts parameters, whereas Chrome, which is almost the same browser, minus MS modifications, shits all over it (and looking for the cause of it leads to an "active" entry on Google's bugtracker that goes 9 years back). Means if I say the page is A4 portrait, ChrEdge selects said paper format (if the driver/printer supports it) and locks out the orientation setting, whereas Chrome picks the default letter format of the default print driver, last used orientation and also fucks up the layout royally. Firefox also ignores the page (and orientation) format, but at least they have the courtesy of rearranging the page layout to look proper.

I mean what in the gently caress.

When I look somewhat deeper into things, I keep running into PDF generators, that forcibly rerender all the HTML in background(?). How does that work? I want the pages to be printable out of the browser, not make users download a PDF instead. Will the generated PDF be opened directly in print preview?

Adbot
ADBOT LOVES YOU

Tei
Feb 19, 2011

Combat Pretzel posted:

How does everyone go about making things printable?

I'm trying to design the report pages to be reactive to screen and print, but every browser has its quirks in how it handles printing. What pissed me off yesterday was when I describe the page format in CSS, Microsoft ChrEdge for instance reacts to it in the print preview and adjusts parameters, whereas Chrome, which is almost the same browser, minus MS modifications, shits all over it (and looking for the cause of it leads to an "active" entry on Google's bugtracker that goes 9 years back). Means if I say the page is A4 portrait, ChrEdge selects said paper format (if the driver/printer supports it) and locks out the orientation setting, whereas Chrome picks the default letter format of the default print driver, last used orientation and also fucks up the layout royally. Firefox also ignores the page (and orientation) format, but at least they have the courtesy of rearranging the page layout to look proper.

I mean what in the gently caress.

When I look somewhat deeper into things, I keep running into PDF generators, that forcibly rerender all the HTML in background(?). How does that work? I want the pages to be printable out of the browser, not make users download a PDF instead. Will the generated PDF be opened directly in print preview?

Using html to print is always going to run in problems, but theres things you can do to *influence* that the result is better. Things like hinting page changes.

HTML is not designed to be printer friendly, you have PDF for that. PDF have full control of the printing and can solve most egregious problems. You can render a PDF using PDF based primites, but you could have sections rendered from a HTML using a library that do the conversion from HTML to PDF, usually that saves time and don't break layouts. Generally doing so mean you can't use all the CSS, but a limited set the library can understand. And/or like in emails, rely on dumb DHTML 4.0 syntax or even HTML 3.0 syntax to get things trough.

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