New around here? Register your SA Forums Account here!

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
Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

Sagacity posted:

"Ooh, we had such a lovely honeymoon on {C65C4E6B-7D7A-4F38-8305-0D4C90776202}"

mongolia actually did this for their postal system

https://qz.com/705273/mongolia-is-changing-all-its-addresses-to-three-word-phrases/

Adbot
ADBOT LOVES YOU

cinci zoo sniper
Mar 14, 2013




Powerful Two-Hander posted:

one of our terrible databases lets you choose a city and a state separately despite the two being directly related in the reference tables so you constantly get stupid poo poo like one person seeing "Paris, Paris, France" and another seeing "Paris, Texas, USA" depending on how they queried it

also the data is riddled with duplicates.

replace all addresses with guids imho

yeah this is usually a poo poo show, with the surprising exception of kazakhstan. their most recent postal code system slaps unique identifier on each building, which owns extremely

Shaggar
Apr 26, 2006
every mailbox in the us has a unique id that's zip+someid

Powerful Two-Hander
Mar 9, 2004

Mods please change my name to "Tooter Skeleton" TIA.




this owns

edit:

quote:

Stade de France is at reporter.smoker.received.

smokah's French vacation

mystes
May 31, 2006

Shaggar posted:

every mailbox in the us has a unique id that's zip+someid
By mailbox do you just mean PO boxes? Because I don't think every apartment or house has a unique ZIP+4 code.

Edit: Never mind, you're talking about an 11 digit code that includes the zip+4.

mystes fucked around with this message at 20:06 on Mar 19, 2019

The Fool
Oct 16, 2003


the +4 digits don't correspond to anything specific, they could be a city block, a single building, or a single high volume recipient.

USPS does have a barcode format that specifies the exact delivery point

brand engager
Mar 23, 2011

This android thing we develop for at work has a bunch of classes split into a view, presenter and an interface class connecting them. Also a bunch of @Inject all over from some dependency injection library/framework. Not a big fan of it because it makes following the actual control flow weird and time consuming

brand engager
Mar 23, 2011

developers be writing softed wares

brand engager
Mar 23, 2011

oh also none of those interfaces have more than one concrete implementation, since each one only gets used between the closely-related view and presenter classes. All the code uses the abstract interface type to call with though for whatever reason

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

brand engager posted:

oh also none of those interfaces have more than one concrete implementation, since each one only gets used between the closely-related view and presenter classes. All the code uses the abstract interface type to call with though for whatever reason

this is actually really good for cutting down on circular dependencies. which doesn't sound important at the toy-app stage, but being able to only compile stuff you've changed instead of having to build the world every time is pretty important once your app is sizeable

VikingofRock
Aug 24, 2008




raminasi posted:

i literally could not function without a comprehensible history graph, especially when prototyping new stuff. like this is not too uncommon:

- ok i need to create feature X
- that's gonna require refactor A, let me do that
- hm this is really two refactors, let me split it into A and B (shuffle commits around)
- ok now let me actually do X
- hm looks like i need some more stuff in A, let me update it (shuffle commits around)
- you know the "right" way to do B is slightly more involved and will touch some other systems, let me do that too (shuffle commits around)
- gently caress gotta update some packages (shuffle commits around)
- sweet now i can finish X

if i'm not juggling my personal history, i have to open a PR with all this poo poo in one big unreviewable pile of garbage, and then either squash-merge into one big bang commit that does multiple entirely different things, or normal-merge some history that's completely useless for a blame or a bisect. or i can open multiple, separate PRs, one after the other, each which is reviewable on its own merits, as a smaller unit of work.

I just started working somewhere that uses perforce and I'm having trouble squaring it with this kind of work flow. E.g. today I was writing some tests when I noticed that some existing code was broken, and then it turned out that the fix strongly suggested a small refactor. In git I would split that into 3-ish commits (something like fix + add tests for bug, refactor, add new tests). I'm not sure what the "right" perforce workflow is, though. Should I be splitting this work into multiple workspaces? Are large changelists just considered more acceptable?

pseudorandom
Jun 16, 2010



Yam Slacker

VikingofRock posted:

I just started working somewhere that uses perforce and I'm having trouble squaring it with this kind of work flow. E.g. today I was writing some tests when I noticed that some existing code was broken, and then it turned out that the fix strongly suggested a small refactor. In git I would split that into 3-ish commits (something like fix + add tests for bug, refactor, add new tests). I'm not sure what the "right" perforce workflow is, though. Should I be splitting this work into multiple workspaces? Are large changelists just considered more acceptable?


Not sure if I understand you perfectly, but I believe what I would do for that would be create a new Task stream off of your Development ("master") stream, then make three change-lists for each "commit".

I see no reason for using additional workplaces, however when I was using Perforce we used workspaces VERY conservatively, so most of my knowledge comes from only using one workspace.

gonadic io
Feb 16, 2011

>>=
I'm making a twitter app. All calls to twitter have to include both app credentials and user credentials (if you're acting on behalf if a user).

This is fine when I'm running it on my own comp, and would be fine with a server model where the user clicks an oauth thing on my page, gives me their user creds and I make the requests.

However let's say I wanted to make it clientside. The trouble is, whether I did it via a script on a page or via a browser plugin, some user would be able to access the app creds and then flaunt their rate limit to get the app banned.

Is there a way to solve this? There are other browser plugins that block people on twitter, I wonder how they handle this.

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

gonadic io posted:

I'm making a twitter app. All calls to twitter have to include both app credentials and user credentials (if you're acting on behalf if a user).

This is fine when I'm running it on my own comp, and would be fine with a server model where the user clicks an oauth thing on my page, gives me their user creds and I make the requests.

However let's say I wanted to make it clientside. The trouble is, whether I did it via a script on a page or via a browser plugin, some user would be able to access the app creds and then flaunt their rate limit to get the app banned.

Is there a way to solve this? There are other browser plugins that block people on twitter, I wonder how they handle this.

route the twitter calls from the client through your own server/web app/whatever

Feisty-Cadaver
Jun 1, 2000
The worms crawl in,
The worms crawl out.

VikingofRock posted:

I just started working somewhere that uses perforce and I'm having trouble squaring it with this kind of work flow. E.g. today I was writing some tests when I noticed that some existing code was broken, and then it turned out that the fix strongly suggested a small refactor. In git I would split that into 3-ish commits (something like fix + add tests for bug, refactor, add new tests). I'm not sure what the "right" perforce workflow is, though. Should I be splitting this work into multiple workspaces? Are large changelists just considered more acceptable?

def not multiple workspaces, unless your depot is crazy small. you can't really merge stuff b/w workspaces

like pseudorandom said if you can split them into reasonable multiple changelists, that makes code review slightly easier. otherwise, dehumanize yourself and face to cvs, basically.

cinci zoo sniper
Mar 14, 2013




Boiled Water posted:

i wasn't laughed until now

my favourite code comment in this company was “who coded this?”

gonadic io
Feb 16, 2011

>>=

DaTroof posted:

route the twitter calls from the client through your own server/web app/whatever

Not much point having anything clientside if I do this. Maybe that's just how it has got to be

VikingofRock
Aug 24, 2008




pseudorandom posted:

Not sure if I understand you perfectly, but I believe what I would do for that would be create a new Task stream off of your Development ("master") stream, then make three change-lists for each "commit".

I see no reason for using additional workplaces, however when I was using Perforce we used workspaces VERY conservatively, so most of my knowledge comes from only using one workspace.

I guess my more general problem is what do I do if I start working on feature B, and then I realize that it depends on feature A which is unimplemented and in the same file? Is it possible to submit the two features as two separate changelists, without throwing away my work on feature B?

Sorry if I'm getting some of the terminology wrong or overlooking something obvious; I've only been working with perforce for about a week.

Stringent
Dec 22, 2004

The internet is the universal sewer.

VikingofRock posted:

I guess my more general problem is what do I do if I start working on feature B, and then I realize that it depends on feature A which is unimplemented and in the same file? Is it possible to submit the two features as two separate changelists, without throwing away my work on feature B?

Sorry if I'm getting some of the terminology wrong or overlooking something obvious; I've only been working with perforce for about a week.

Best advice I can give is get used to throwing work away, and consider it ammunition for meetings to come.

gonadic io
Feb 16, 2011

>>=

gonadic io posted:

Not much point having anything clientside if I do this. Maybe that's just how it has got to be

Related to that, does anybody have some advice for how to accept work from users without being overloaded? I have e.g., a limit of 100 concurrent users and see when (if) I get there what the server load looks like? I'm on a free tier gcp machine so I don't think I need to be too worried about cost.

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

gonadic io posted:

Related to that, does anybody have some advice for how to accept work from users without being overloaded? I have e.g., a limit of 100 concurrent users and see when (if) I get there what the server load looks like? I'm on a free tier gcp machine so I don't think I need to be too worried about cost.

The workload should be almost entirely network throughput limited if you are simply proxying requests and responses. I'd expect even a free tier box to handle 100 concurrent users just fine as long as there's enough network throughput available.

edit: The free tier GCP instance are limited to 1GB of egress data a month. That may be a factor.

necrotic fucked around with this message at 16:32 on Mar 20, 2019

Aramoro
Jun 1, 2012




Came across something I hadn't see before. A Github repo for a Vue component, nothing exciting there. Standard readme and a total stranger has created a PR with a Code Review making changes to camel case stuff etc. What kinda weirdo goes around code reviewing strangers libraries?

gonadic io
Feb 16, 2011

>>=

necrotic posted:

The workload should be almost entirely network throughput limited if you are simply proxying requests and responses. I'd expect even a free tier box to handle 100 concurrent users just fine as long as there's enough network throughput available.

edit: The free tier GCP instance are limited to 1GB of egress data a month. That may be a factor.

Hmm noted. It's just a few calls to twitter with no body per user, so maybe a KB or two including the headers. I'll just start slow and see how my usage looks like.

Thanks for the advice

gonadic io
Feb 16, 2011

>>=

Aramoro posted:

Came across something I hadn't see before. A Github repo for a Vue component, nothing exciting there. Standard readme and a total stranger has created a PR with a Code Review making changes to camel case stuff etc. What kinda weirdo goes around code reviewing strangers libraries?

Last time I asked a SO question about rust, somebody driveby edited my post only converting "rust" to "Rust"

aardvaard
Mar 4, 2013

you belong in the bog of eternal stench



https://github.com/massgov/DOT

when you don't trust your contractors so you host parts of your government website on github's free hosting

pseudorandom
Jun 16, 2010



Yam Slacker

VikingofRock posted:

I guess my more general problem is what do I do if I start working on feature B, and then I realize that it depends on feature A which is unimplemented and in the same file? Is it possible to submit the two features as two separate changelists, without throwing away my work on feature B?

Sorry if I'm getting some of the terminology wrong or overlooking something obvious; I've only been working with perforce for about a week.

Shelve the feature B change list, work on feature A and submit it when done. Unshelve feature B, resolve any merge conflicts from A, and continue working on B.

This is similar to the git stash feature. It'll save the edits you've made in the B change list, but revert the on-disk file back to the unchanged state. You can then check out that file in the Feature A change list and make any edits you'd like. Once you've submitted A, unshelving will bring back the saved edits so you can continue working on B.

gonadic io posted:

I'm making a twitter app. All calls to twitter have to include both app credentials and user credentials (if you're acting on behalf if a user).

This is fine when I'm running it on my own comp, and would be fine with a server model where the user clicks an oauth thing on my page, gives me their user creds and I make the requests.

However let's say I wanted to make it clientside. The trouble is, whether I did it via a script on a page or via a browser plugin, some user would be able to access the app creds and then flaunt their rate limit to get the app banned.

Is there a way to solve this? There are other browser plugins that block people on twitter, I wonder how they handle this.

Does Twitter not have something similar to public app key + private app secret? If I'm reading the Twitter docs right, they give you an "access token" and an "access token secret"; if the APIs you wish to access only require the "access token", which I'm assuming is safe to put in a public client, then you should be safe to publish that.

pseudorandom fucked around with this message at 17:29 on Mar 20, 2019

gonadic io
Feb 16, 2011

>>=

pseudorandom posted:

Does Twitter not have something similar to public app key + private app secret? If I'm reading the Twitter docs right, they give you an "access token" and an "access token secret"; if the APIs you wish to access only require the "access token", which I'm assuming is safe to put in a public client, then you should be safe to publish that.

Hmmmm actually I think you're right. The app secret is not actually put in the request, but is encrypted and then put there. So I think that means I can have the clients request a token valid only for their request.

I hadn't noticed this before because the library I'm using was abstracting this away. I think I can still do most of the calls client side, and only provide then tokens from the server. Great I'll give that a go!

My source is https://developer.twitter.com/en/docs/basics/authentication/guides/authorizing-a-request

AggressivelyStupid
Jan 9, 2012

Aramoro posted:

Came across something I hadn't see before. A Github repo for a Vue component, nothing exciting there. Standard readme and a total stranger has created a PR with a Code Review making changes to camel case stuff etc. What kinda weirdo goes around code reviewing strangers libraries?

I regularly revert edits to a fairly highly voted answer of mine on stack overflow that are exactly that

I even followed the languages style guide from the documentation

Falcorum
Oct 21, 2010

Aramoro posted:

Came across something I hadn't see before. A Github repo for a Vue component, nothing exciting there. Standard readme and a total stranger has created a PR with a Code Review making changes to camel case stuff etc. What kinda weirdo goes around code reviewing strangers libraries?

People looking to pad a CV with worthless crap

Shaggar
Apr 26, 2006

AggressivelyStupid posted:

I regularly revert edits to a fairly highly voted answer of mine on stack overflow that are exactly that

I even followed the languages style guide from the documentation

how do other users edit snack on overflow posts? wouldn’t they need to be an admin?

simble
May 11, 2004

you just need enough reputation and you can do stuff

https://stackoverflow.com/help/privileges

VikingofRock
Aug 24, 2008




pseudorandom posted:

Shelve the feature B change list, work on feature A and submit it when done. Unshelve feature B, resolve any merge conflicts from A, and continue working on B.

This is similar to the git stash feature. It'll save the edits you've made in the B change list, but revert the on-disk file back to the unchanged state. You can then check out that file in the Feature A change list and make any edits you'd like. Once you've submitted A, unshelving will bring back the saved edits so you can continue working on B.

This is exactly what I was looking for; thanks. I had totally missed the shelve command.

feedmegin
Jul 30, 2008

Lutha Mahtin posted:

wales is actually a country tho lol

It's about as much a country as say Texas. Hell Texas has more powers over stuff like taxation than Wales does.

Shaggar
Apr 26, 2006
wales, Scotland, etc.. are more like counties than states.

FlapYoJacks
Feb 12, 2009
code:

awscli==1.16.72
boto3==1.9.1
botocore==1.12.62         # via awscli, boto3, s3transfer
docutils==0.14            # via awscli, botocore, python-daemon
jmespath==0.9.4           # via boto3, botocore
s3transfer==0.1.13        # via awscli, boto3
six==1.12.0               # via docker, docker-pycreds, python-dateutil, websocket-client
urllib3==1.24.1           # via botocore, requests

That will surely not break things in the future! :allears:

Ellie Crabcakes
Jan 31, 2008

Stop emailing my boyfriend Gay Crungus

Shaggar posted:

wales, Scotland, etc.. are more like counties than states.
:rolleye:

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

brand engager posted:

This android thing we develop for at work has a bunch of classes split into a view, presenter and an interface class connecting them. Also a bunch of @Inject all over from some dependency injection library/framework. Not a big fan of it because it makes following the actual control flow weird and time consuming

brand engager posted:

oh also none of those interfaces have more than one concrete implementation, since each one only gets used between the closely-related view and presenter classes. All the code uses the abstract interface type to call with though for whatever reason

is this the first time you've encountered an inversion-of-control MVC framework? i had a similar reaction when i first tried to learn android but it makes more sense the more you read about how apps work in android. either way it's how the android API is structured so you will pretty much have to learn to live with it

the dependency injection stuff, it depends on a number of factors whether it is good or not (i don't have a lot of experience with this). there are a lot of valid reasons for an android app to use one but again it depends on the specifics

Corla Plankun
May 8, 2007

improve the lives of everyone

ratbert90 posted:

code:
awscli==1.16.72
boto3==1.9.1
botocore==1.12.62         # via awscli, boto3, s3transfer
docutils==0.14            # via awscli, botocore, python-daemon
jmespath==0.9.4           # via boto3, botocore
s3transfer==0.1.13        # via awscli, boto3
six==1.12.0               # via docker, docker-pycreds, python-dateutil, websocket-client
urllib3==1.24.1           # via botocore, requests
That will surely not break things in the future! :allears:

idgi but i feel like i should

FlapYoJacks
Feb 12, 2009

Corla Plankun posted:

idgi but i feel like i should

The requirements.txt file is hard coding version requirements. which will break things in the future very easily. Also there’s no reason to hard code those versions.

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006
setting specific versions for libraries is pretty normal and allows you to build the same thing again reliably. allowing any version can introduce unexpected changes in functionality

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