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
pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Xarn posted:

uuuugh why not use a loving loop?

Why would it be a loop? Should be a bunch of if else.

Adbot
ADBOT LOVES YOU

QuarkJets
Sep 8, 2008

Xarn posted:

uuuugh why not use a loving loop?

It's called loop unrolling, scrub :smugdog:

Xerophyte
Mar 17, 2008

This space intentionally left blank

pokeyman posted:

Why would it be a loop? Should be a bunch of if else.

Given that it's looping over an array (of interval minima in descending order? sheesh, who stores intervals backwards?), yes, there should be a loop in there somewhere.

I can't JS, but that entire block can basically be replaced with your local equivalent of
code:
for_each (thing in d)
  if (v >= thing.v) return thing.p
or a binary search, if you're feeling especially competent.

I'm surprised that switch statement even parses but apparently JS is fine with non-constant cases.

Doom Mathematic
Sep 2, 2008

duck monster posted:

2 lines of code is what it replaced. For this abomination.

...Code review??

ToxicFrog
Apr 26, 2008


duck monster posted:

This is by the new recruit thats replaced our node.js TCP edge server that could handle 40K connections without breaking a sweat with a PHP abomination filled with SQL interpolations and other "Didnt PHP coders learn this lesson in the 90s?!" horrors that pegs the server on 80 connections, and nobody can convince the boss that he's incompetent.

Holy poo poo, where I work checking in something that increases serving latency by 0.1ms is a Big loving Deal

senrath
Nov 4, 2009

Look Professor, a destruct switch!


duck monster posted:

nobody can convince the boss that he's incompetent.

Are you sure he's not related to your boss? Because it sounds like he's related to your boss.

Itaipava
Jun 24, 2007
Actually have you ever seen your boss and that guy in the same room at the same time?

dougdrums
Feb 25, 2005
CLIENT REQUESTED ELECTRONIC FUNDING RECEIPT (FUNDS NOW)

Doom Mathematic posted:

...Code review??

Coding Horrors: …Code review??

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Oh I see, shoulda read it closer.

redleader
Aug 18, 2005

Engage according to operational parameters

ToxicFrog posted:

Holy poo poo, where I work checking in something that increases serving latency by 0.1ms is a Big loving Deal

and where i work, performance objectives are "doesn't die from the 30s sql timeout"

more falafel please
Feb 26, 2005

forums poster

ToxicFrog posted:

Holy poo poo, where I work checking in something that increases serving latency by 0.1ms is a Big loving Deal

I can't use the current profiling solution to compare two implementations of a thing because using it adds ~1ms over 10,000 iterations and that's too much noise for the data to be useful

gnatalie
Jul 1, 2003

blasting women into space
current coding horror is a new hire who wants to rename the production database because he doesn't like it. gave him the business casual "that's a stupid idea and you're on your own if it fucks everything up", luckily he works at our subsidiary and doesn't report to me lol

Volmarias posted:

Quietly revert the changes and get him assigned to some kind of pet project for someone who won't actually be there next year.

agreed

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

candy for breakfast posted:

current coding horror is a new hire who wants to rename the production database because he doesn't like it.

Is it a racial slur or something?

wolfman101
Feb 8, 2004

PCXL Fanboy
The feels bad when you sealed and get U defiler, G defiler, and Sphinx and proceed to fail to draw G defiler at all in 5 games. The U defiler drew once the turn before you were going to win anyways and once to immediately eat removal. The Sphinx showed up in 2 wins but in the 3 losses only showed up once near the end of a game only to be hard countered by the flying deathtoucher

There was also a loam elf that showed up once at the end of a game.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

candy for breakfast posted:

current coding horror is a new hire who wants to rename the production database because he doesn't like it.

i remember being young and wanting to rename things for no good reason. that's a lesson only experience can teach you.

Absurd Alhazred
Mar 27, 2010

by Athanatos

wolfman101 posted:

The feels bad when you sealed and get U defiler, G defiler, and Sphinx and proceed to fail to draw G defiler at all in 5 games. The U defiler drew once the turn before you were going to win anyways and once to immediately eat removal. The Sphinx showed up in 2 wins but in the 3 losses only showed up once near the end of a game only to be hard countered by the flying deathtoucher

There was also a loam elf that showed up once at the end of a game.

:confused: Is this some C# poo poo?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

candy for breakfast posted:

current coding horror is a new hire who wants to rename the production database because he doesn't like it. gave him the business casual "that's a stupid idea and you're on your own if it fucks everything up", luckily he works at our subsidiary and doesn't report to me lol

Guessing "master"

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Absurd Alhazred posted:

:confused: Is this some C# poo poo?

I'm going to guess magic the gathering and wrong thread, but I'm nowhere near current on that game

LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer

leper khan posted:

I'm going to guess magic the gathering and wrong thread, but I'm nowhere near current on that game

I've never played Magic, but my immediate thought when I read this exchange was "I bet MTG is Turing complete", and what do you know:
https://arxiv.org/abs/1904.09828
https://www.murphyandhislaw.com/blog/mtg-turing-complete
https://www.toothycat.net/~hologram/Turing/index.html

duck monster
Dec 15, 2004

Volmarias posted:

Quietly revert the changes and get him assigned to some kind of pet project for someone who won't actually be there next year.

I did, and he flipped the gently caress out and reverted it back, and then the boss yelled at me.

duck monster
Dec 15, 2004

Doom Mathematic posted:

...Code review??

We do code review.

This fucker codes on the production server.

I cant convince the boss.

ToxicFrog posted:

Holy poo poo, where I work checking in something that increases serving latency by 0.1ms is a Big loving Deal

I hear you. But what can I do?

duck monster fucked around with this message at 08:06 on Sep 9, 2022

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
You might find it productive to go over your boss's head to their boss. (Don't let your boss find out though). They're not going to care about this guy being a total moron (that's your boss's job to deal with, and if you complain to them about it they're mostly just going to be annoyed with you), but if you phrase it in terms of stuff they do care about you can probably get support for things like locking down production so the only thing allowed to modify it is an automated push from whatever's committed to source control.

More importantly, when this guy then throws a tantrum and your boss gets on your case, you can get his boss to then put him in his place.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

duck monster posted:

We do code review.

This fucker codes on the production server.

I cant convince the boss.

do you not have colleagues who agree with you about this? Can't you all go to your boss and present a united front, say "coding on the production server is an extremely bad practice for (list of reasons)"

If you already did and the boss is still determined to let the guy just do whatever he likes then tbh maybe it's time to :sever:

Doom Mathematic
Sep 2, 2008

duck monster posted:

We do code review.

This fucker codes on the production server.

I cant convince the boss.

I hear you. But what can I do?

Okay so, one, deploy to production over the top of this person's changes, instantly trashing any changes they've made. Do this repeatedly every time they touch production, until they get the message. You have a deployment process, right? Which this person is circumventing?

Two, if your boss doesn't care who has direct access to production, then implicitly you are free to gate that access as you see fit. So do that. Don't ask. You clearly don't need permission.

DaTroof
Nov 16, 2000

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

ToxicFrog posted:

Holy poo poo, where I work checking in something that increases serving latency by 0.1ms is a Big loving Deal

My team just got a mandate to prioritize a performance improvement because latency in one of our vendor integrations is costing the company $8000 a day. A process that makes ~6000 web API requests needs to run in less than 5 minutes. It currently takes about 3 hours. And the problem is clearly the fault of our own code and not a network thing

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

DaTroof posted:

My team just got a mandate to prioritize a performance improvement because latency in one of our vendor integrations is costing the company $8000 a day. A process that makes ~6000 web API requests needs to run in less than 5 minutes. It currently takes about 3 hours. And the problem is clearly the fault of our own code and not a network thing

5 minutes.. 300 seconds. 6000 request. 20 requests per second? 50ms per request?

Lol isn't that typical ping latency?

DaTroof
Nov 16, 2000

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

leper khan posted:

5 minutes.. 300 seconds. 6000 request. 20 requests per second? 50ms per request?

Lol isn't that typical ping latency?

It's possible to run the requests in parallel, but right now they run consecutively at an artificial max of 1 per second.

Polio Vax Scene
Apr 5, 2009



sounds like an easy fix as long as the requests aren't dependent on each others results and you don't need to worry about being rate limited

still I would have a hard time resisting the urge to change them all into a bundled single request, throwing that many over the pipes all at once just feels dirty

Macichne Leainig
Jul 26, 2012

by VG
I tried to use quotes in my new title and it's almost better how it is getting all unicode hosed.

Any other thoughts? I used to be Protocol7 if you hate me

DaTroof
Nov 16, 2000

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

Polio Vax Scene posted:

sounds like an easy fix as long as the requests aren't dependent on each others results and you don't need to worry about being rate limited

It's mostly easy, except the results need to modify the state of an independent process.

quote:

still I would have a hard time resisting the urge to change them all into a bundled single request, throwing that many over the pipes all at once just feels dirty

Unfortunately, that's not an option here. The vendor's API only lets us send one transaction per request, even though their own business rules are the reason we need to process hundreds of transactions per minute :negative:

Absurd Alhazred
Mar 27, 2010

by Athanatos

LOOK I AM A TURTLE posted:

I've never played Magic, but my immediate thought when I read this exchange was "I bet MTG is Turing complete", and what do you know:
https://arxiv.org/abs/1904.09828
https://www.murphyandhislaw.com/blog/mtg-turing-complete
https://www.toothycat.net/~hologram/Turing/index.html

:stare:

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

It's not a high hurdle to clear. The x86 MOV instruction is Turing complete (PDF).

quote:

Thus, while it has been known for quite some time that x86 has far too many instructions, we can now contribute the novel result that it also has far too many registers.

Absurd Alhazred
Mar 27, 2010

by Athanatos

Zopotantor posted:

It's not a high hurdle to clear. The x86 MOV instruction is Turing complete (PDF).

That one I remember.

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


Everything is Turing complete until proven otherwise, and those results are the really interesting ones.

Ranzear
Jul 25, 2013

Zopotantor posted:

It's not a high hurdle to clear. The x86 MOV instruction is Turing complete (PDF).

Baba is You can implement Busy Beavers and Conway's Game of Life, either of which means it's Turing complete.

Xarn
Jun 26, 2015

ultrafilter posted:

Everything is Turing complete until proven otherwise, and those results are the really interesting ones.

Volmarias
Dec 31, 2002

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

Macichne Leainig posted:

I tried to use quotes in my new title and it's almost better how it is getting all unicode hosed.

Any other thoughts? I used to be Protocol7 if you hate me

It actually does look good.

duck monster posted:

We do code review.

This fucker codes on the production server.

I cant convince the boss.

I hear you. But what can I do?

Whose nephew are they?

ultrafilter
Aug 23, 2007

It's okay if you have any questions.


ultrafilter posted:

Everything is Turing complete until proven otherwise, and those results are the really interesting ones.

I always liked the general recursive functions as a model of computation that illustrates how little you need to get Turing completeness. The requirements are as follows:
  1. A function that returns zero.
  2. A function that adds one to its argument.
  3. A function that selects the kth item from a list of n elements.
  4. Recursion in one argument.
  5. Function composition.
  6. The ability to loop until something is equal to zero.

Doom Mathematic
Sep 2, 2008
I'm not Turing-complete. There's a bunch of computable functions I couldn't do at all.

Adbot
ADBOT LOVES YOU

lifg
Dec 4, 2000
<this tag left blank>
Muldoon
I’m turning complete, and you’ll excuse, me I’m going to recurse myself.

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