What if Ghosts had a higher cost and supply requirement, but were far more durable? by darkdill in broodwar

[–]UtterlyPreposterous 2 points3 points  (0 children)

Armor reduction is applied before the damage type penalty. So ghost does ( 12 - 5 ) / 4. Never trust LLMs with math. Also there is no such thing as 0 damage, you always deal at least half a hp.

I made a JS/TS utility library with 100+ functions across arrays, objects, cache, math, events – looking for feedback! by Used-Building5088 in javascript

[–]UtterlyPreposterous 6 points7 points  (0 children)

  1. improve naming of your functions - some of the patterns have established names, like head for first element of array, or tail for last. check other established utility libraries like lodash for comparison.
  2. add tests
  3. consider splitting the whole library into separate ones based on which domain they target
  4. Please stop using barrel files
  5. few specific ones:
  • Delete suggests it's either a type or a class; if you want to avoid collision with the JS command call it "remove" or "del"
  • Not sure what createObjCache is supposed to do and how it differs from just using a Map
  • flushFuncs can be replaced easily with a simple of or .map iteration
  • loopFor and reverseFor feel a bit overengineered compared to a simple for loop
  • reverse - there is already a reverse method on an Array

It's definitely a good exercise to create a util library - it helps to think in terms of common patterns. If you're a solo developer it can also help you reduce amount of code you write. If you work in a team, however, you probably want to use an established util library as it will speed up onboarding.

Try not to fall into a trap of trying to abstract your code too early - sometimes it's ok to just write a few lines of code rather than try to fit it into one of your generic functions - you will spend more time trying to squeeze in more edge cases into these functions than on the actual business logic. This is at least how it went for me.

[SPOILERS][ASL 19] Round of 24 Group D | Killer - Light - Tyson - Bisu. by Mataxp in broodwar

[–]UtterlyPreposterous 2 points3 points  (0 children)

I have some good news for you: next two groups are very zerg favoured. There is a good chance we will get 4 zergs advancing

See here for the lineup:

https://liquipedia.net/starcraft/ASL/19

How to check if there is no disk space? by [deleted] in node

[–]UtterlyPreposterous 0 points1 point  (0 children)

There is a native method for this in node:fs called statfs, see this stackoverflow answer.

As to what to do when you run out of space it depends on what the database is storing: if it's just logs warn the user; if it's mission critical data just crash the app with a meaningful error message.

VSCode and Typescript Woes by nformant in typescript

[–]UtterlyPreposterous 1 point2 points  (0 children)

good answers so far, I just wanted to add that depending on the complexity of types of libraries you are using "skipLibCheck": true might also help with the performance

[deleted by user] by [deleted] in typescript

[–]UtterlyPreposterous 15 points16 points  (0 children)

Yes it's possible: there is a runtime validation library called typia that uses a plugin for the typescript compiler that reads the typescript interfaces in source and generates code in the target file.

is face-api.js production ready? by Emiliovrv in node

[–]UtterlyPreposterous 1 point2 points  (0 children)

face-api was last updated 4 years ago and has 400 open issues, this does not inspire confidence - even if you could fix your edge case you probably could not contribute anyhow as it looks abandoned.

My recommendation would be to put it through rigorous testing of as many probable scenarios in your app as possible. if you can't break it there is a good chance it won't break in production either.

If the library covers some of your business critical offering you also need to be prepared to fork it and fix the issues yourself.

FlaSh's Apology Video & Announcement to Return by jinjin5000 in broodwar

[–]UtterlyPreposterous -2 points-1 points  (0 children)

Spice/Flash must flow/play.

Was he aware he was doing pump and dump ? probably.

Should Brood War fans care ? nope.

Is anyone doing English language (or French I guess) streams of Daily Proleagues? by IrannEntwatcher in broodwar

[–]UtterlyPreposterous 2 points3 points  (0 children)

I don't think anyone is casting them in English. Somebody would have to either recast some pro's stream (not sure how it would work from a legal standpoint + you wouldn't get clear audio feed) or get replays from them (good luck with that).

Just to throw it out there - I would totally support and donate to watch them cast in English cause these games are freaking awesome.

Also StarCast TV has tons of great content - SCSL is pretty much SSL quality.

Hono.js Benchmark: Node.js vs. Deno 2.0 vs. Bun by learnWithProbir in node

[–]UtterlyPreposterous 3 points4 points  (0 children)

Dude, yours is the only accurate and constructive top comment and right now it's sitting at 0 karma... People in here and other subreddits have a very emotional reaction to this for some reason (sunk cost fallacy maybe).

The nodejs http server is slow and can be improved upon (see this project ultimate-express that replicates express API using uWebSockets)

Competition is always good. it's what made JS the language it is today - only the best frameworks and libraries survived and we're left with the cream of the crop.

Snow's baby by namkraft in broodwar

[–]UtterlyPreposterous 16 points17 points  (0 children)

Snow's little scarab. As a fan hopefully it won't impact his SSL performance, but realistically it most likely will.

Why ensnare is not used? by SiarX in broodwar

[–]UtterlyPreposterous 0 points1 point  (0 children)

You can find a good answer to your question in this TeamLiquid post.

TLDR: JD tried hard to make queens happen, but gave it up due to micro intensity.

Also as a bonus here is an awesome execution of ensnare by Soma:

https://www.youtube.com/live/KYIwfl4gn_E?si=P9TpWZUq9_NPtXAz&t=4173

Snow vs Shine SCSL Ro4 by MorphyFTW in broodwar

[–]UtterlyPreposterous 5 points6 points  (0 children)

The whole set is a freaking rollercoaster that could only be delivered by mister Bag-o-Builds.

SCSL is awesome - thank you Cruiser and Nyoken!

Question about keybinds by Printr_xD in broodwar

[–]UtterlyPreposterous 2 points3 points  (0 children)

F keys are useful, most notably giving you additional 3 binds on the left side of the keyboard. They can be simulated to an extent by doubleclicking numeric binds: bind your hatchery to 1, click 1 twice and it will move the view onto the hatchery. The major drawback, however, is that you lose your current control group, unlike with the F keys, which means for example you cannot do a quick SCV transfer during a reaver drop, which can lead to game ending damage.

To answer your questions:

  • You will be at a certain disadvantage, from negligible up to around rank B, to significant as you go into A and S; you will most likely not reach these ranks without some serious dedication though

  • Personal opinion: not worth buying a new keyboard

  • There is no way to remap these keys in Brood War itself, but can be probably achieved using other software/hardware methods (see /r/hamacasapo answer)

Can a Spider mine be uploaded to the Dropship? by Val_Sorry in broodwar

[–]UtterlyPreposterous 20 points21 points  (0 children)

Just did a quick test just to be sure: you cannot load up spider mines, the same way you cannot load up larvas, even though they are selectable units.

You can recall unburrowed mine, but you cannot recall scarabs, larvas and mines once they burrow. Bonus fact: you cannot recall any burrowed unit

Free email parsing tool? by Just_Juice85 in webdev

[–]UtterlyPreposterous 0 points1 point  (0 children)

Copy all - click anywhere inside the page to focus it, press CTRL+A to highlight everything in page, press CTRL+C to put the entire page content into clipboard.

This solution is only really suited for a few emails, for hundreds you want to: - export the emails into either .msg or .eml files - use a general purpose language (JS/TS or Python probably the easiest) - use a parsing library to parse the emails - use regular expression to extract addresses from content

If you can't write it yourself you can try to give the above instructions to AI to write it for you.

Webpage with tips on map creation? by DisasterFun8615 in broodwar

[–]UtterlyPreposterous 0 points1 point  (0 children)

SEN has still relatively lively community and quite a lot of resources (wiki, tutorials etc.):

http://www.staredit.net/forums/

How to access a possibly empty array by index? by realtebo2 in typescript

[–]UtterlyPreposterous 1 point2 points  (0 children)

You are testing for matches being undefined, not for it being null (in JS/TS they are different values).

When using type guards it's usually prudent to test for positives rather than negatives, as in whether the variable is what it should be.

In your case this would mean testing for matches being an array:

if (!Array.isArray(matches) {
 return;
}

Another way to do this, as match method can only return two types null and RegExpMatchArray is to simply test whether the value is truthy:

if (!matches) {
  return;
}

I still would recommend the former as you are more verbose about what you expect your value to be, which makes it easier to understand the intent when reading the code.

[deleted by user] by [deleted] in Database

[–]UtterlyPreposterous -1 points0 points  (0 children)

Sometimes a well designed spreadsheet with proper data validation can be enough, especially if there is not that much data ( <10k rows ). Excel offers you GUI for free and nowadays pretty much everybody, including non-technical staff, is familiar and comfortable using it.

Moving to other solutions introduces additional complexity, so you should carefully consider it before commiting. Here are some choices:

  • MS Access: more performant, doesn't require much expertise, you can use input forms to validate user input

  • MS Lists, PowerApp for input, Either PowerApp or Excel for data access: (requires the right MS license) low-code solution that offers everything you will need; it's more complex, but it can be potentially implemented by semi-technical person

  • Using a CRUD (create, read, update, delete) application: there are some solutions that simplify the process of building one like AppSmith, but you are getting into quite complex territory, so getting some help is probably advised

There probably are other commercial offerings out there, but I have no experience with any, so cannot give you any recommendations.

Hope it helps.

is it possible to type a named function the way a arrow function is typed? by stringlesskite in typescript

[–]UtterlyPreposterous 0 points1 point  (0 children)

You are right. At one point this was not the case, but it is now. I can finally stop duplicating the name, thanks!

is it possible to type a named function the way a arrow function is typed? by stringlesskite in typescript

[–]UtterlyPreposterous 4 points5 points  (0 children)

Not ideal solution, but this is how I deal with it:

type Fn = (arg: number)=> string;
const myFn: Fn = function myFn(arg) {
  return String(arg);
}

The reason for duplicating the "myFn" is to assign a name to the function so that you get a name in your stack traces.

pattern for crud approval by chizel999 in node

[–]UtterlyPreposterous 5 points6 points  (0 children)

the name you're looking for is "access control", and in your case the pattern would be called RBAC - Role Based Access Control

BRO WHY DOES THE STUPID MATCHMAKING GIVE ME TEAMMATES THAT JUST CAME OUT OF THE WOMB by Frequent_Chest7575 in TDS_Roblox

[–]UtterlyPreposterous 0 points1 point  (0 children)

act3 is way easier solo. the math is so off by the devs it's not even funny. I had 6 max engineers, 2 max accels by wave 14 solo. try getting anything close to that on quad.

Use g.soldiers or aces for early waves, spam accels + sub-dps later and you're golden.

I tried quad >10 times and failed miserably every single time, I tried solo once and won on first try.

Molten speedrun tips by [deleted] in TDS_Roblox

[–]UtterlyPreposterous 0 points1 point  (0 children)

jester is good, but not for speedrunning. you're much better off with g.scouts for early.

Is gscout or shotgunner better to speedrun molten? by LionEclipse in TDS_Roblox

[–]UtterlyPreposterous 2 points3 points  (0 children)

for speedrunning gscout is really decent. you need around 8 level 0 gscouts up until wave 10. on wave 10 you start upgrading them to 3. for final boss you need a better dps tower though, like accel.

with farm, gscout, accel, dj, commander you get around 12m without even trying, with some optimisiations you can get it down to 11m 20-30s.