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
distortion park
Apr 25, 2011


cinci zoo sniper posted:

idgi then, visual studio code is pretty nice (especially compared to alternatives)

i like it but when i open a file in it i never have any idea what window/project it is going to open it in

Adbot
ADBOT LOVES YOU

distortion park
Apr 25, 2011


cinci zoo sniper posted:

it was mentioned by a fellow thread poster a few pages back first, so i'm toying with it. right now i agree that it is like the T bit in ETL.

the actual tech, basically, is Jinja-SQL compiler with some (havent experimented yet) schema testing capacity. since i work with analytics stuff, this is pretty good poo poo for our use case at least since isntead of writing like 2000 sloc sql script with a dozen levels deep subqueries you just lay poo poo down in a logical sequence, write basic validation tests for intermediate steps, and then you can just populate a schema on dwh with it or use it somewhere else. i really like the ability to abstract things like names and values into configs - we have a case where the same database can look differently in two different places, and i can just cross compile the script batches with different targets and provide people with wrokings cripts for everything

tl;dr in my current understanding (2 hours of work) its nothing complicated, magial, or grountbreaking. sql with jinja syntax sugar and barebones schema testing framework. my primary usecase for it is a presentable and explainable sql that can be easily replicated afterwards, since schemas are dime a dozen and representing some recursive garbage just in a bunch of straightforward selects is real nice when you need to deal with people who are not necessarily very strong in sql, or familiar with your data model, or have time and energy needed to traverse the atlass shrugged of sql scripts

I've had à look at this and still don't really get it. It seems like most of syntax benefits already exist in you just use views and ctes, and while the templating stuff could be useful how often are you actually able to reuse sql across schemas?

distortion park
Apr 25, 2011


im gonna fake my own death, move to belize south of france, and try to get a sweet remote consulting contract. wish me luck

distortion park
Apr 25, 2011


Slurps Mad Rips posted:

Nice?

edit: the city

probably somewhere near Marseille so that we can get direct trains back to london, not sure yet. Depends a bit on my gfs family.

Ive been doing the sums and the reduced CoL and the fact that we currently live off about 2/3 our combined pay means it really does look like this will happen. On job sites there seem to be plenty of suitable remote positions (although some are probably US only but don't mention it). I really need to talk to a good agent/recruiter but have so little trust in them.

distortion park
Apr 25, 2011


Bloody posted:

how do you do code generation well

like without having massive strings of boilerplate that you concatenate magic words into

how do adults solve this

adults solve it with massive strings of boilerplate sql that you concatenate other massive strings of sql into afaict

distortion park
Apr 25, 2011


creating/altering/deleting sprocs at runtime can help improve code organisation and performance!

distortion park
Apr 25, 2011


the superior vcs (hg) solves the rewrite issue but marking commits as unpublished or published. As long as you don't push your history you can rewrite it but after that it's much more restrictive.


(there's also a 3rd "don't push this commit" state to make it easy to manage wip stuff)

distortion park
Apr 25, 2011


the main thing that prevents me getting really bad imposter system from SA and random blog posts are seeing big companies we work with constantly gently caress stuff up

distortion park
Apr 25, 2011


the talent deficit posted:

Thread has like the worst instincts ever: phd? c++?? gamedev???

thats why its the terrible programmer thread

distortion park
Apr 25, 2011


I made (started)a game once. It was meant to be a roguelike, but in space. Got to the point where you could move your ship and shoot (with a cool animation!) and there were asteroids and enemies with different ais. It was fun and easier than I expected but I'm sure if I did it as a job it would quickly become like any other job

distortion park
Apr 25, 2011


carry on then posted:

lol if the school u went to didn't lock the computers down so hard all .exes had to be on an allowed list to even run

yeah you had to rename .exes to notepad.exe or they wouldn't work.

distortion park
Apr 25, 2011


CRIP EATIN BREAD posted:

wrap your domain objects in view models. sure it's duplicate effort but it at last they are splitting concerns.

code:
class FooModel(x: Foo) : Foo() by x {
  @MyAnnotation
  override val bar() = x.bar()
}
this will delegate all property calls you dont override to the wrapped object, so there's way less boilerplate whne creating adapters like that in Kotlin

woah this is neat.

distortion park
Apr 25, 2011


Fiedler posted:

i think we've misunderstood each other. i'm suggesting that you use a sql server database project, which does *not* involve storing sequential alter scripts.


no, database projects support this scenario just fine. if you have two logically disjoint applications living in the same database (which you shouldn't), then regardless each application gets its own separate database project. during deployment, ensure that "drop objects not in source" is disabled, and you can deploy changes to either application at any time.

in another scenario, you have logically disjoint applications and, in addition, some stored procedures that aggregate data from both. here you can add a third database project that contains the stored procedures, and have that database project reference the other database projects in "same database" mode.

in another scenario, you have applications that share some parts of the data model and not others. in this case the common parts of the data model can live in their own, unified database project, while the non-shared parts still each get their own sqlproj and reference the common sqlproj.

contra your previous suggestion, the visual studio database tools team that created database projects was very well aware of scenarios involving multiple apps in one database.

What happens if you have non-.net users of the database. Or users accessing the db directly from their own sql. This sort of thing is great if you have a super structured and locked down development process, but for some (a lot?) of places the dbs are designed first for an unknown number of eventual consumers and it would just me much better if ssms /sql server supported that use case with versions, tracing, object reference paths etc. You can roll your own versions of some of those but it would be so much nicer if they were built in

distortion park
Apr 25, 2011


surely you're using the projects in your. Net solutions though, otherwise what's the point of splitting them up into n^2 different projects?

distortion park
Apr 25, 2011


DELETE CASCADE posted:

uh i'm pretty sure the sane world is the exact opposite of this. the app doesn't own the database, and the data in it is far more important than whatever stupid hack the app team wants this sprint

besides, the app team devs are probably not sql design/optimization experts

Yeah letting the applications control the data structures is a surefire way to end up with a lovely db, loads of duplication and misrecs everywhere

distortion park
Apr 25, 2011


If your app needs a different data shape you can write a sproc to give it to you

distortion park
Apr 25, 2011


cinci zoo sniper posted:

on 80% of our web projects a database level not null condition on a field is technically impossible, because the php orm used shits it’s bed immediately

curse of the orm strikes again

distortion park
Apr 25, 2011


Bulgakov posted:

fired fired fired fired fired fired

your all fired

You seem to have fired yourself which is definitely going to break something

distortion park
Apr 25, 2011


Finster Dexter posted:

lmao ezpz. as a backend dev I just store everything as UTC and make the frontend dopes worry about time zone conversions

idk if you're joking but this doesn't work with e.g. dst

distortion park
Apr 25, 2011


Chalks posted:

As long as the front end is always sending you data in UTC or with time zone information attached you're fine, yeah?

You need to know the timezone if you want to calculate time between two values, 1 hour before a time, bucket events into 5 min bins, calculate sales by month etc correctly. Idk maybe your application is fine and you do no operations on the timezones on the backend but it's really hard to get things right from a business logic perspective without timezone information

E: sorry you said with timezone information. In that case you're fine I think

distortion park
Apr 25, 2011


Corla Plankun posted:

i know that feel

its always the last line bc the file was truncated when it was being pulled onto the cluster hth

Or the vendor stuck a disclaimer in the last line lol

distortion park
Apr 25, 2011


TheFluff posted:

there were many things that drove people to make everything a webapp but one of them is that native apps are only really native on one platform. writing good crossplatform gui apps that actually look and feel native on the supported platforms is a pain in the rear end. javascript is bad but so is wxwidgets.

Of course, web apps don't look or feel native either (they look and feel like rear end) so it isn't a very good reason

distortion park
Apr 25, 2011


Do a string concatenation then a substring index

distortion park
Apr 25, 2011


Maybe I'm a moron but boy do I hate Spring. Java is a perfectly good language but using spring you don't get to write any, just gently caress around with endless combinations of hard to debug attributes and configuration.

distortion park
Apr 25, 2011


PierreTheMime posted:

i support a team that uses Spring to setup their database connection, but never bothered to configure the possibility of a connection failure, so in all envs it will occasionally throw an ugly JDBC trace and then “succeed” after doing gently caress all with their data for a while and offer no useful logs. their answer to my question of “why don’t you add custom error handling” is “yes but we use spring and can’t change it” which is the dumbest poo poo

this same team ends all their shell scripts with exit 0 and never logs any errors so any issue is hours of manual debugging and I want to shoot them all into the sun

I don't get why you would use it just for database access, it's like 1000x harder to get working than a normal connection string

E: http://samatkinson.com/why-i-hate-spring/
I agree 100%

distortion park fucked around with this message at 17:05 on Dec 8, 2018

distortion park
Apr 25, 2011


PierreTheMime posted:

they do a lot of etl work and from the looks of it it’s helpful there, but I’m not sure of their specifics. I just get to see the crap that breaks and is externally accessible

they also just realized they’ve been printing pii for a year+ and no one at any level of review caught it so my quibbles are the least of their problems

I do a lot of etl work and it seems awful. Trying to debug a spring app that someone else wrote is hard enough, but of the problem is with types not lining up in one of the magic steps you're just straight up screwed

distortion park
Apr 25, 2011


My experience with kubernetes (well openshift) is that writing the configuration sucks hard but is still better than all the previous deployment processes. Openshift can do CI as well which is cool

distortion park
Apr 25, 2011


TheFluff posted:

the most obvious use case for lateral joins (which is pretty much exaclly what i had going on in this case) is when you need a regular inner join with a complex condition that usually looks something like "join only the first three rows of the right hand table ordered by some criteria". if you are selecting only one column from one row from the right hand table, you can do this with a subquery instead (or with an aggregation, like max()/GROUP BY), but if you want something more complex than that, then a lateral join is usually the way to go.

in my case we have a table that should really be 1-to-1 with the users table, but because of terrible programming it's soft-deletable and that constraint can't be enforced, so i was writing something like (bowdlerized and probably makes no sense taken out of context)

SQL code:
SELECT posters_with_avatars.id
FROM users
CROSS JOIN LATERAL (
  SELECT forumsposters.id, avatars.uploaded_at
  FROM forumsposters
  INNER JOIN avatars ON (forumsposters.id = avatars.poster_id)
  WHERE forumsposters.user_id = users.id
  -- use non-deleted forums poster if one exists, otherwise most recently deleted one
  ORDER BY forumsposters.deleted_at DESC NULLS FIRST
  LIMIT 1
) AS posters_with_avatars
WHERE
  users.is_disabled = FALSE AND
  posters_with_avatars.uploaded_at BETWEEN ('2018-01-01' AND '2018-06-01') AND
  EXISTS (
    SELECT *
    FROM probations
    WHERE
      probations.user_id = users.id AND
      probations.created_at BETWEEN (
        posters_with_avatars.uploaded_at AND
        posters_with_avatars.uploaded_at + INTERVAL '3 days'
      )
  )
e: https://explainextended.com/2009/07/16/inner-join-vs-cross-apply/

If I understood this correctly I think this is similar to a t sql window function?

distortion park
Apr 25, 2011


redleader posted:

the tsql equivalent is CROSS/OUTER APPLY

You're right. I've always joined then done row_number to achieve this and have no idea why

distortion park
Apr 25, 2011


my experience with ES is that it's good at what it does but it's really hard to use as a primary data store. As long as you can recreate the indexes from a more reliable source it's fine

distortion park
Apr 25, 2011


galenanorth posted:

They told me that whether I need a Home Occupation License would depend on how much money the business makes. I said "I have no idea" and they said they needed an estimate but redirected me toward a customer service desk for public works which connects to a bunch of permit offices, since I'd need a permit if I'm working from home, before I could answer. In all likelihood, yes, I need a permit for working at home even working from a computer, since they didn't have a favorable reaction when I told them the business essentially sells data in spreadsheet form. It's really annoying and I'd wish I'd known I'd need apartment manager permission at the outset

That's hosed up.

distortion park
Apr 25, 2011


dick traceroute posted:

ctps: turns out you shouldn't create hundreds of thousands of instances of HttpClient in a tight loop
who knew

It implements IDisposable but that's a trick, disposing it doesn't help!!!! SqlConnection on the other hand is fine with doing this

e: "fine"

distortion park
Apr 25, 2011


animist posted:

does anybody actually use self-documenting features of REST apis? github's api has a million extra annotations on every message and they seem pretty pointless to me

I've used it to scrape data off apis backing website frontends

distortion park
Apr 25, 2011


eschaton posted:

remember how one of the promises of SOAP was that enterprise middleware would be created to work with services in a completely content agnostic manner

lol

distortion park
Apr 25, 2011


Aramoro posted:

I mean getting contractors to gently caress up your services is very much in the Uber ethos.

I have never understood the logic behind trying to get contractors to unfuck a codebase they have never seen before.

once the refactor is finished (lol) you won't need them anymore

distortion park
Apr 25, 2011


CRIP EATIN BREAD posted:

i mean i dont call someone a "loving idiot" but i will often come up with "what the gently caress were you thinking?" or "gently caress why did you do that?"

both seem kind of aggressive to me although i suppose it depends on the context and tone.

distortion park
Apr 25, 2011


DONT THREAD ON ME posted:

im not really opposed to open offices in theory, because in theory i like my coworkers and we’re working on something we care about and the serious collaboration ive done has always been my best work.

in reality i hate my coworkers and we’re making garbage and i need a place to drink

If they aren't used to reduce space used per employee and have plenty of soft furnishings etc they can be OK but that's like 1 in 100

distortion park
Apr 25, 2011


animist posted:

someone just needs to add some tiny syntax change to maven so that you can write your xml in a thing that looks like gradle and then all the flighty aesthetic devs will come back

how about a groovy script which generates the xml then runs maven

distortion park
Apr 25, 2011


idk if this would work in your case, but if it's an internal site you might be able to get away with displaying top 50 in client on their initial search, then streaming the rest to the client in the background so that you don't have to do any caching serverside. 110k rows might be small enough that you can the just do all the sorting etc clientside.

Adbot
ADBOT LOVES YOU

distortion park
Apr 25, 2011


Bloody posted:

.net core 1 seemed super rushed and half-baked tbh

the whole thing sucked. they briefly had some lovely json project/reference file thing as well. fortunately they fixed that with the new xml one.

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