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
Dylan16807
May 12, 2010

cool av posted:

it's not separated from our other server costs so I can't give a real number, but not enough to notice a difference with a few thousand users who opted to use voice. In any case I don't exactly recommend rolling your own if you've found a library that looks suitably usable.

I just checked and I used 16bit mono at 8kbps (small b) compressed with gzip like a simpleton and nobody complained about quality so... idk. you probably wouldn't want to stream music to your friends on it.

edit: sorry, 8000 samples per second so I guess it's 16KBps

well if it works, it works, but 8bit audio at 16KHz will sound vastly better than 16bit at 8KHz

Adbot
ADBOT LOVES YOU

Dylan16807
May 12, 2010

Powerful Two-Hander posted:

I just spent several hours trying to get a stupid toy project to work using typescript in visual studio and I'm sure this thing is great but jfc is the packaging a disaster zone.

I got a very basic ts compilation working so thought "ok now ill start calling some libraries" and idk maybe I'm doing it wrong but after npm making GBS threads libraries everywhere, separate packages for types that are the incompatible with the library they're for, import statements that import into the typed file but then throw an error on page load and mysterious fixes like "Oh if you use the default target it won't work, change it to es5" I just gave up and stuck the libraries in as static files and wrote vanilla js to call them.

edit: am I terrible or is the tooling terrible? maybe it's both

libraries in typescript are an awful pain that I had to go through recently

a few notes from that process:

the "module" keyword in typescript is not real modules, is incompatible with real modules, and should never be uttered. it was added a long time ago, works in a different way, and has also been renamed to "namespace" while sitting around ready to shoot you in the foot

once you remove that keyword, imports/exports will (silently) turn a file into a module. also modules are rigidly a single file each, so they're incompatible with compiling everything into one file, you can't split a module across multiple files, and you need explicit imports and exports between every file

but once you set up for using modules, you have to deal with there being half a dozen different module loading systems that all work in different ways. I went with ES2015 so I could cross my fingers and avoid using a module loader or webpack. I had to end all my imports with ".js" to make that work in the browser, but thankfully the typescript tooling understands that ".js" actually means ".ts". the libraries I downloaded were using commonJS but editing all their imports to end in .js made them work as ES2015 modules.

then finally I could write script type="module" src="main.js" (cloudflare hates that sentence)

alternatively I could have set up even more compilation steps and dependencies to get libraries to load

in short: javascript tooling is awful and typescript punts to javascript for modules

Dylan16807 fucked around with this message at 10:13 on Mar 4, 2021

Dylan16807
May 12, 2010

mystes posted:

Javascript tooling is awful but I don't think using typescript really makes it significantly more complicated than it already is?

yeah if the choice is between Javascript and typescript then do typescript, it's not making things worse

Dylan16807
May 12, 2010

DELETE CASCADE posted:

afaik this is just how it has to work given the constraints of the postgres storage engine

they probably have good reason for not adding it yet, sure, but the end result is still that they don't have the feature

Dylan16807
May 12, 2010

DELETE CASCADE posted:

but it does have the feature? it simply doesn't work exactly like mysql does, because postgres isn't mysql

locking the table, copying the rows into a new table in the order you like, and then swapping the tables is something you could quickly code up for any database engine

that's not clustered indexes as an actual feature. as a feature it needs to stay clustered over time

Dylan16807
May 12, 2010

Jeoh posted:

do i have severe burnout? no, it must be a rare medical condition
very suddenly being unable to even use words sounds like it goes well beyond "burnout", at least as people normally understand it

and he's not blaming it on a preexisting condition, the story's pretty clear he did it to himself

even if his description of the problem is dumb

Dylan16807
May 12, 2010

Antigravitas posted:

They've done it.

They've made curl | bash dumber.

well it fetches the entire script before execution, and it uses https

so as far as installing on windows goes it's not really any worse than download exe, run exe

Dylan16807
May 12, 2010

Xarn posted:

git reflog

Now yer the git wizzard

yeah, fixing the commit graph can be a giant pain in the rear end but you can put the instructions for retrieving stuff from the reflog on a post-it

Dylan16807
May 12, 2010

redleader posted:

i would like to know more. loving up stashes is something i have done that's resulted in me losing work
git fsck, I think?

or to make a shell nightmare with some help from stack overflow:

git log --no-walk=sorted --format='%H' --min-parents=3 --reverse $(git fsck | awk '/dangling commit/ {
print $3}') | while read hash; do git log -1 --pretty=reference $hash; git stash show $hash; echo; done

Dylan16807 fucked around with this message at 11:52 on Sep 20, 2021

Dylan16807
May 12, 2010
the only thing I can find talking about Fibonacci backoff is a paper that doesn't even compare it with plain old exponential, only "BEB" which delays by a random number between zero and 2^n-1

is it actually better than an exponential backoff of 1.6^n?

Dylan16807
May 12, 2010

Share Bear posted:

ive generally just been doing it in spurts rather than as a daily thing so ive not been reading the posts to avoid spoilers

i like that day 8 part 1 has the most bewildering problem statement, it's longer than the others by a lot, and yes i know its a simple initial answer that's basically "write a parser"

8's such a weird balance of difficulty

it's like "here is an essay on owls" "part 1 draw a circle" "part 2 draw the rest of the owl"

Dylan16807
May 12, 2010

Xarn posted:

xml is good if the person defining the format did their homework and you have proper schema


On a different topic, this is really loving stupid.
Go code:
  for i := 0; i < 100000; i++ {
    println(i)
    defer println(i)
  }

I'm just glad it doesn't print the equivalent of 1 2 3 3 3 3

Dylan16807
May 12, 2010

pokeyman posted:

how is that useful in yaml beyond what a schema does in other formats? or is it just a security vulnerability delivery vehicle

jwcc is json with commas and comments

his objection to JSON5 is that he doesn't like unquoted strings as values, but JSON5 doesn't have unquoted strings as values?

JSON5 is good, it doesn't add anything you couldn't parse with javascript eval, it just makes things less annoying

Dylan16807
May 12, 2010

Carthag Tuek posted:

json5 objects can have unquoted strings as keys (without spaces, cant start with num etc)

it can, but the complaints in the post don't apply to that kind of use

you wouldn't put naked keywords as keys, and there is no ambiguity about spaces

Dylan16807
May 12, 2010

redleader posted:

what the hell is json5? is it on any standards tracks, or is it just more frontend dumb poo poo?

json5 is basically "let's make json be less different from actual javascript object notation"

so you can actually write Infinity and NaN, and you can do stuff like trailing commas and comments and unquoted keys

it doesn't try to add new types or anything

Dylan16807
May 12, 2010

chaosbreather posted:

rails is great because what if it should? what if time and pagination and joins and all the thousands of little web footguns out there, anything that made you go 'oh here we go', was all just already there, and built in at the highest level without you doing anything?
it's nice to have all those little functions, but why not some organization? like put that one on time.now

Dylan16807
May 12, 2010

rotor posted:

pipefail? more like postfail, am i right or am i right?

the thread will continue going as long as every post is a 0 out of 5

Dylan16807
May 12, 2010

polyester concept posted:

i can't imagine what the code behind magic the gathering would be like. some of the cards are wildly specific like "gain 1 land if one of your other creatures is wearing a hat", and then suddenly the devs have to add a "has_hat" check on every card dating back 30 years

cinci zoo sniper posted:

ccgs have by far the simplest code of all games, because it's literally just a calculator with some sfx slapped on. sure, it's a chore to edit 500 card json declarations by hand to extend "properties" list of 37 cards with "has_hat", but like 95% of "wildly specific" card mechanics i can think of are trivially implementable as a list membership check.

has_hat is easy because that's in the silly set and they didn't even try to code it

in theory all they need to track is basically name, cost, type, rules text, and then they have to make a thousand different hooks for when different categories of events happen

but they apparently have awful spaghetti codebases, even on the new client that came out a couple years ago. they had entire sets that were implemented in the beta, taken out on launch day, and then 2-3 years later "oh no we changed too much we'd have to re-code those cards from scratch and it would take months"

Dylan16807
May 12, 2010
even if I'm on a short lived branch I'd still like git to note down which thing is which in a merge other than "I hope the main one was first"

and when it's a long-lived branch that can be even more important/confusing

Dylan16807
May 12, 2010
are any database engines trying to add the features you'd need in this situation?

if you can add columns without downtime, you should be able to widen a column without downtime. juggling old and new versions should be something the database does behind the scenes.

Dylan16807
May 12, 2010

Sapozhnik posted:

oh yeah of course, requests from the outside world come from "downstream" and they flow "upstream". because that's the direction water flows along a stream, up. obviously.

i want to fist fight whatever loving googleoid came up with this nomenclature in a parking lot

requests go one way, and the product goes the other way

I think it makes sense that the way the water flows is the direction the product goes

Dylan16807
May 12, 2010
async works okay in javascript but I'm not thrilled about what it looks like to trigger a promise manually

code:
let resolve_callback;
let promise = new Promise((resolve, reject) => { resolve_callback = resolve; });

Dylan16807
May 12, 2010
also it sucks that you have to misuse generators if you want to be able to resume a javascript function on demand

I miss lua coroutines which can suspend at any point without needing colored functions

Dylan16807
May 12, 2010

redleader posted:

wait, hold the phone. promises are also just colored functions

what's your alternative

"threads" was already said, and that's a good answer

if a function awaits, you pause the entire stack. when it resumes, the whole stack resumes. if you want to split off a task, you use some kind of alternate syntax for the function call, and you get back a promise/generator/thread you can wait on and maybe do other things with.

you can create equivalent behavior with promises, by saying every function returns a promise and it gets awaited by default (also awaiting a completed promise happens synchronously, unlike javascript). if you want to split off a task, you use a different syntax that won't await. this way you can write normal synchronous code and it will work the same way it always has, and you can transparently call a function that awaits without your code having to know anything about awaiting. and the automatic promises are just an implementation detail.

Dylan16807
May 12, 2010

Sagacity posted:

InternetOfTwinks posted:

Modal editing is really not that complicated, I had the basics pretty much down in like, a week or two
I'm not sure that's the ringing endorsement you might think it is
my rating is that modal is perfectly fine right from the start, as long as arrow keys work

I don't know if I would prefer it but it didn't cause any significant problems

Dylan16807
May 12, 2010

mondomole posted:

One thing that has tripped me up is that JSON numbers are specified as f64. So in many libraries even if you do the equivalent of get<u64>(field), you end up getting (u64)get<f64>(field), e.g. 53 bit precision integers. You can get around this by passing around strings instead of numbers but you definitely have to know to do this or you'll run into crazy subtle errors.

JSON doesn't specify the numbers as anything, the closest is the RFC noting that f64 will give you "good interoperability"

Dylan16807
May 12, 2010

Private Speech posted:

Pascal is a language with zero redeeming features

pascal has good strings :colbert:

Dylan16807
May 12, 2010

Sapozhnik posted:




least unhinged emulator developer

this doesn't show the horrible loud noise it makes, also this is my favorite part:

"one of the only ways to dump your games on an unmodded system is to use god2iso"

Dylan16807
May 12, 2010

N.Z.'s Champion posted:

the most common solution is to use lz-string compressToUTF16/decompressFromUTF16

is that better than using normal compression and throwing it at base32768?

Dylan16807
May 12, 2010

ynohtna posted:

I'd do something like:
Go code:
r := rune(binary.BigEndian.Uint16(b))
Gotta be explicit about endian assumptions.

it's also worth looking at how that function is implemented. just one real line:

Go code:
return uint16(b[1]) | uint16(b[0])<<8

Dylan16807
May 12, 2010

tef posted:

the justification for han unification wasn't "these are the same characters" it was "if we rank the world by gdp then we're poo poo out of space for cjkv"
that table ranks CJK as second place out of ten. they weren't shunning it for that reason

unicode had a huge change in goal at some point. at the time they only wanted to encode "modern" characters and said it would be "unreasonable" to include all "obsolete/rare" characters. at least in that context, unification makes plenty of sense


tef posted:

i know people complain about han unification but can you imagine if latin letters had multiple possible code points depending on 𝙷𝙾𝚆 𝙸𝚃 𝙻𝙾𝙾𝙺𝚂
people wouldn't be very upset if those were gone, and you can't encode a versus a or 4 versus 4 in unicode

Dylan16807
May 12, 2010
grep every single file for the names of some of the bad columns

Dylan16807
May 12, 2010
Markdown can't even consistently format: 3.

Half the implementations will turn it into a 1, and half will leave it as 3.

Adbot
ADBOT LOVES YOU

Dylan16807
May 12, 2010

tef posted:

either way it's funny that people are like "stored procs? don't you know the idea of keeping application behaviour in the database is outdated!" and "using a json column? don't you know that the database is exactly the place application concerns should go"
I don't think I've ever seen "put different things in different columns" described as "application concerns" before

tef posted:

programmers: how dare this garbage collector stop the world

also programmers: brb, stopping the world, running a migration
garbage collector runs several thousand times more often

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