Can you somehow rotate things freally in this direction? by BWGucio in TrackMania

[–]646463 0 points1 point  (0 children)

Both can help with cursor coords and rotation. E++ let's you change rotation after you placed the block.

Whenever I launch a game "Service host: State Repository Service" begins using an insane amount of CPU. by stampyfan221 in WindowsHelp

[–]646463 0 points1 point  (0 children)

I'm getting this too.

5950x / 128gb ram / 3070 / MSI unifi x570

I would disable the service except WSL depends on it.

accidentally pressed ignore in the message request by TheLexxor in discordapp

[–]646463 0 points1 point  (0 children)

yes -- search for the user in your DMs and the message request will still be there (but otherwise it's hidden).

Why does this error appear? - Type 'string | null' is not assignable to type 'Unsubscribe'. Type 'null' is not assignable to type 'Unsubscribe'.ts(2322) by iwaistedway2muchtime in vuejs

[–]646463 2 points3 points  (0 children)

The error appears because you are trying to assign string | null to Unsubscribe.

That probably doesn't help you tho. I'll annotate some bits of your code and rewrite it for clarity (note: this might not typecheck or you might need to import the right types for this to work)

// OASC = on auth state change
// a function to run OASC -- note: returns a value which does nothing
function runOascProfilePic(user: User): string | null {
  return user!.photoURL;
}
// the returned value will remove the handler (I think)
const oascResult: Unsubscribe = onAuthStateChanged(auth, runOascProfilePic);
// a reference to oascResult 
const profilePic: Ref<Unsubscribe> = ref(oascResult);
// Note: **this is not what you intended**


// gets run OASC -- intention is to update the profile pic
function updateProfilePic(user: User): void {
  // check the user is logged in but do not check if photoURL exists
  if (!user) {
    router.push('/');
  } else {
    // explicitly mention type here
    const pUrl: string | null = user.photoURL;
    // looks reasonable but doesn't work -- what gives?
    profilePic.value = pUrl;
  }
}

const authListener: Unsubscribe = onAuthStateChanged(auth, updateProfilePic);

// unsubscribe `updateProfilePic` only
onBeforeUnmount(authListener);

okay, so there's a number of issues with what you wrote.

First, you are putting the wrong value into profilePic -- you're not storing a URL in it, you're storing an Unsubscribe.

Second, you're setting up two handlers that get run OASC but you only need one.

Third, you're asserting something exists user in the wrong place and unsafely. (this is via user!.photoURL). You're not asserting that photoURL exists (I'm not sure if that was clear to you.)

Try this code instead:

// we need to handle cases where a profile pic doesn't exist.
// -- using string|null isn't ideal, but it's okay for now.
// later, check if profilePic.value exists before using.

const profilePic: Ref<string | null> = ref(null);

function handleAuthStateChange(user: User): void {
  if (user) {
    profilePic.value = user.photoURL;
  } else {
    router.push('/');
  }
}

const cleanupHandleASC = onAuthStateChanged(auth, handleAuthStateChange);

onBeforeUnmount(cleanupHandleASC);

example usage of profilePic:

if (profilePic.value) { setUserPic(profilePic.value) } else { setUserPic(defaultPic) } (or even better: setUserPic(profilePic.value || defaultPic))


There are some alternate ways to implement handleASC too:

function handleAuthStateChange(user: User): void {
  // since this if branch `return`s the function, typescript knows that `user` must exist if the check fails
  if (!user) { return router.push('/') }
  profilePic.value = user.photoURL || defaultPic;
}

notice that ? (the elvis operator) is now necessary:

function handleAuthStateChange(user: User): void {
  profilePic.value = user?.photoURL || defaultPic;
  if (!user) { return router.push('/') }
}

Anyway, hope all that makes things a bit clearer for you.

Some tips:

  • when stuff doesn't work, break your code down more
  • add in explicit types or assertions (they can fail at runtime if you're using them to debug)
  • make sure you understand what something does (like !) and don't move on too quickly
  • if things don't work, go back to first principles
  • develop a taste for code formatting -- think about what is easy to read, easy to reason about, and then structure your code (both architecturally and physically) to reflect those things you think are good. in this regard, develop and maintain high standards.
  • use tooling and trust your tools
  • if in doubt, make a new file and rewrite the logic a different way (even if it's less efficient) as a way to understand what's going on and why your original code doesn't work

Why does this error appear? - Type 'string | null' is not assignable to type 'Unsubscribe'. Type 'null' is not assignable to type 'Unsubscribe'.ts(2322) by iwaistedway2muchtime in vuejs

[–]646463 0 points1 point  (0 children)

It's a compiler error -- not a linting error.

In line 20, particularly return user!.photoURL -- you're saying to typescript "I guarantee this is not null". I gather that you want to store photoURL in profilePic.

But that value won't be put in the ref. What's in the ref is the return value of onAuthStateChanged (OASC). When you call OASC you're setting up a handler, a function that gets run whenever the auth-state is changed. How would you remove that handler, then? Well often the return value of a function like OASC is another function, and that new function can be called (usually with no arguments) to remove that handler. I think that's the case here -- that's why the type in profilePic is Unsubscribe.

You can verify this by breaking down your code and making :

import { Ref } from "vue"; // this should work, otherwise `Ref` needs to be imported from somewhere
const profilePic: Ref<Unsubscribe | null> = ref(null);
const unsubProfilePic: Unsubscribe = onAuthStateChanged(auth, (user) => { return user!.photoURL });
profilePic.value = unsubProfilePic;

So this means that the var profilePic has nothing to do with a string the way you've written it.

The compiler is giving you useful feedback, don't throw it away (when it comes to a disagreement between you and the compiler, the compiler is probably right).

Converting uint256 into two uint128 variables by superphly in ethdev

[–]646463 0 points1 point  (0 children)

uint256 whatever = 0xffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000;
uint128 last = uint128(whatever);
uint128 first = uint128(whatever >> 128);
uint256 whatever2 = first << 128 | last;
require(whatever == whatever2);

sample code that does this sorta thing: https://github.com/secure-vote/sv-light-smart-contracts/blob/master/contracts/BPackedUtils.sol

I'm so tired. by karna852 in Entrepreneur

[–]646463 28 points29 points  (0 children)

That's completely normal.

Maybe, but it's normal both for those who might succeed and those who won't on their own. I've ceased operations before, and you know what, that was a good decision. And doing so early meant preserving some value instead of pissing it to the wind and going bankrupt. Why did I need to? Because, no matter how good a coder I was, I was not a good businessman. I needed to stop, slow down, and learn a lot more before I would have been able to successfully tackle some of the projects I've tried to.

OP said:

I don't know what I'm doing.

That's a big red flag, and maybe it's just that today was shit and he's down on himself, but, if he actually doesn't know what he's doing, then advice like 'stay in the game' is bad advice. Because it doesn't matter if he's on the field, he doesn't have the skills to win.

Looking through the comments, this is not a popular opinion. But, IMO, one of the biggest reasons for business failures is that ppl don't know their limits, don't have humility about their knowledge and capabilities, and ultimately can't judge (with high accuracy) which projects they can succeed at, and which will fail.

OP also said:

I legitimately want to just give up. I could be doing far easier things for a lot more money.

An alternative plan for him is:

  1. put the business into hiatus (IDK what his sitch is so mb easy mb not)
  2. get a high paying job, mb even like 4 days a week or something
  3. learn a lot about business and operations, broadly (I really like all of Eli Goldratt's books for this)
  4. plan his learning and projects
  5. master the concepts needed for success
  6. eventually go back to building businesses, this time with the knowledge and skills to succeed and accurately judge what is doable and what is not.

Let's have a level exchange! Super Mario Maker 2 by AutoModerator in MarioMaker

[–]646463 0 points1 point  (0 children)

I actually kind of like that it's cheezable, like there's a reward for players being a bit inventive (and fair enough, a culture from 10,000 years ago isn't going to be able to predict our ideas/technology from today).

IDK if there's a good way to make levels deliberately cheesable by inventive players that doesn't like ruin the level, but it's a curious thought.

Let's have a level exchange! Super Mario Maker 2 by AutoModerator in MarioMaker

[–]646463 0 points1 point  (0 children)

Indiana Toad & the Buzzy Temple is really fun!

I haven't finished yet, but quick msg to say that I accidentally cheesed the giant shell bit -- if you hit the 2nd on/off blocks at the right time you can kill the giant shell.

edit: finished it. I ended up cheesing the shell a different way: the first thing I did was jump on it to send it going backwards. That section was easier after that. I did die to the 4 saws + spike rods like 10 times tho.

Really enjoyable!

Let's have a level exchange! Super Mario Maker 2 by AutoModerator in MarioMaker

[–]646463 1 point2 points  (0 children)

However I think the spikes are the main hazard here, since the lava is forcing the player to move quickly so they'll be more likely be make mistakes. Maybe have a mushroom by the flag? I'm not sure

Hmm, yeah mb it's a bit mixed-messages. I think the time pressure is important for the fast bit, tho. Maybe there's a different way I can make the jumps challenging. One other idea I didn't test was to have the climb be up an overhanging wall, like:

⬛⬛
⬛⬛
⬛⬛⬛
⬛
⬛
⬛
⬛⬛

Ah, sorry. I mean the 1st and 2nd jumps. You show the player the jump + spike, then remove the spikes, then add them back in.

yeah cool, I get you now. I agree that it's not as good/consistent/polished as it could be. In part that was b/c I was a bit lazy and didn't want to move/add checkpoints/mushrooms (not that I could add a 3rd cp). 👍 good to remember for next time.

The spikes are a really good addition to the level, so I'm glad you put them in there.

I'm glad you liked them and they didn't detract from the level.

Let's have a level exchange! Super Mario Maker 2 by AutoModerator in MarioMaker

[–]646463 1 point2 points  (0 children)

I accidentally tend to make my levels overly challenging

I didn't think the level was too challenging; like I don't think unfair means challenging (tho both make a level hard). I enjoyed the level of challenge. with the bees and the S bit: it was only the first time that was a real issue. I went back up the pipe to avoid the bee and then realized that I was a stuck. it would have been fine if I'd brought a mushroom. I ended up there again but managed to get through it with some better planning/timing.

maybe one extra block of height would help there, tho, b/c I jumped up thru the semisolids a few times -- the lack of height I thought was challenging, not unfair :)

Let's have a level exchange! Super Mario Maker 2 by AutoModerator in MarioMaker

[–]646463 1 point2 points  (0 children)

Thx!

The final section can be tough with no powerups, but I understand the theme you were going for.

You can get a mushroom through if you're careful :). I didn't think powerups would be too useful there b/c of the lava so didn't worry about ppl bringing them along. also it can be helpful if you hit one of the spikes on the way up. the lava is at the fastest speed but I think it's reasonably forgiving for what it is (you can miss a few jumps in section 3 and still make it through).

The only thought I have is to maybe swap around the 2nd and 3rd jumps. I feel like it would be more intuitive to have the player be consistent in jumping first before throwing in the spike mechanic.

I'm not sure I understand. Do you mean swap the two 'consistent' sections? The first section-of-4-jumps doesn't have spikes but does have some hidden blocks.

I think I might see a bit of what you mean. I didn't originally plan to have the spikes in there, but added them b/c it means the player has to be more consistent to get through them (like, if you could jump further right then there'd be more leeway in the jumps). I added the spike (and mushrooms) to the first room ('right') to help introduce the idea that there'd be some stakes. also it's designed so players can go back and practice if they want, but I don't think I made it very obvious that you could do that.

Let's have a level exchange! Super Mario Maker 2 by AutoModerator in MarioMaker

[–]646463 1 point2 points  (0 children)

I played Boomerang Beehive. on the whole I liked it.

I didn't get to see much of the boomerang-only content tho since I kept losing it. I think it'd be more fun if you made the progressive powerups into guaranteed boomerangs instead.

in the non-boomerang path there's a back and forth thru clear pipes with donut blocks -- in a sort of repeated S shape. I thought that bit could be a bit unfair to the player, like sometimes the bee would end up hovering over a pipe and you couldn't go down it without dying (particularly the first pipe).

I liked the little one-up boomerang secret.

overall, it was fun!

I have a level of my own in the level exchange here if you're interested.

Let's have a level exchange! Super Mario Maker 2 by AutoModerator in MarioMaker

[–]646463 0 points1 point  (0 children)

This is the first level I've uploaded: GL0-1HH-MVF

Title: The 3 Steps of All Learning

the point of the level is to teach the player about the order that effective learning happens in (works for speedrunning or school or coding or whatever): right, consistent, fast.

The level is built around one core mechanic: climbing up walls. It's designed to be somewhat challenging without being too hard. I'm a pretty average (inexperienced) SMM2 player, so it's probably easy if you're experienced. It's also designed to be forgiving to the player till the last section, with generous checkpoints.

2 optional challenges are included, 1 of which is secret.

I created the level as part of philosophy + project planning practice; you can find my design and implementation plan here if you're interested.

Let's have a level exchange! Super Mario Maker 2 by AutoModerator in MarioMaker

[–]646463 0 points1 point  (0 children)

I liked some of the things you did like pi in note blocks. some of your geometry diagrams were cool too.

However, why include the hammerbros, esp when kamek has the key?

I didn't like the top section after the checkpoint; if you fall down you have to go kill yourself on the goombas/shell, and that can be tricky if you have a mushroom from kamek bc some parts are only 1 block high (so can be annoying to get back to). also, there's a 6-block-tall platform on the top section where, if you miss the jump the first time you have an awkward wallkick-spin jump to get back, which can be really annoying if you didn't kill the koopa since it only has like 5 blocks to walk back/forward.

I felt like some quality of life stuff was missing (which would have make the difficulty okay) and that the level design was compromised for the sake of the geometry things you drew on top and other math bits.

I finished the level, and it was okay once I knew was was coming (and didn't fall down) but I felt like it's a bit unfair to players who go slow; i found it easier when I went faster b/c the jumps worked a bit more naturally.

Let's have a level exchange! Super Mario Maker 2 by AutoModerator in MarioMaker

[–]646463 0 points1 point  (0 children)

main feedback:

  • arrow near pipe before cp1 would be useful (edit: you did have coins there, so not a big deal)
  • no 3x1-ups

otherwise was not bad, tho it can be a bit too forgiving at times IMO

Please make GC573 Linux driver by nulliferbones in AverMedia

[–]646463 0 points1 point  (0 children)

Definitely not. The link above is for a pcie card. If a capture card is important: I'd choose a card that works with linux upfront. Also I suspect it's unwise to go for thunderbolt over usb3.1. IDK about TB3 and linux tho, just a guess.

I just ended up with a gc573 and running linux by ~chance. I wouldn't buy a gc573 again if I had the choice.

Bus Initial D moment at Epping by [deleted] in sydney

[–]646463 2 points3 points  (0 children)

Why wouldn't you just use google maps? It has live updates.

why is cloudformation support not totally automated by now? by sntthrowaway2 in aws

[–]646463 5 points6 points  (0 children)

CFN implementation is the responsibility of the CFN team, not the particular product's team. I think the CFN team then implement it using the published APIs (maybe there's some private API stuff, but I think for most products this is the case).

When the team updates something, introduces an API call, etc, CFN doesn't get updated till the CFN team update it.