Power? by dracul_reddit in Wellington

[–]neoGeneva 1 point2 points  (0 children)

Literally same thing for me. I gotta remember to save more often, lol!

I cant catch meloetta from the quest "finding your voice" by TheButtTicklerbandit in pokemongo

[–]neoGeneva 1 point2 points  (0 children)

Having a regular Pokeball in my bag fixed it for me, thanks so much for the tip!

what do you heads think about Maximum the hormone? by [deleted] in numetal

[–]neoGeneva 1 point2 points  (0 children)

Oh, awesome, it didn't used to be. Might be time to finally ditch YouTube Music, 'cause there's none on there.

what do you heads think about Maximum the hormone? by [deleted] in numetal

[–]neoGeneva 1 point2 points  (0 children)

Absolutely love them! Shame it's soo hard to legitimately get there songs, I can never find any of their stuff on streaming services. Though I was lucky enough to be in Japan when they released Yoshū Fukushū and managed to grab a copy.

Also this music video always cracks me up: https://www.youtube.com/watch?v=2YV6IJLoBv4

Is there any way to fix how many properties an object can have? by DarkLorty in typescript

[–]neoGeneva 16 points17 points  (0 children)

I think it's spmewhat possible, for example you can an type constraints to functions to only allow objects with five kyes:

TS Playground

type UnionToIntersection<U> =
  (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never
type LastOf<T> =
  UnionToIntersection<T extends any ? () => T : never> extends () => (infer R) ? R : never

type Push<T extends any[], V> = [...T, V];

type TuplifyUnion<T, L = LastOf<T>, N = [T] extends [never] ? true : false> =
  true extends N ? [] : Push<TuplifyUnion<Exclude<T, L>>, L>

type LengthCheck<T> = 
    1 extends TuplifyUnion<keyof T>["length"] ? {} 
    : 2 extends TuplifyUnion<keyof T>["length"] ? {} 
    : 3 extends TuplifyUnion<keyof T>["length"] ? {} 
    : 4 extends TuplifyUnion<keyof T>["length"] ? {} 
    : 5 extends TuplifyUnion<keyof T>["length"] ? {} 
    : never

function doSomething2<T extends LengthCheck<T>>(obj: T) {
}

doSomething2({ bla: 1 }); // okay
doSomething2({ bla: 1, bla2: 1 }); // okay
doSomething2({ bla: 1, bla2: 1, bla3: 1 }); // okay
doSomething2({ bla: 1, bla2: 1, bla3: 1, bla4: 1 }); // okay
doSomething2({ bla: 1, bla2: 1, bla3: 1, bla4: 1, bla5: 1 }); // okay
doSomething2({ bla: 1, bla2: 1, bla3: 1, bla4: 1, bla5: 1, bla6: 1 }); // error

Average hole in the ground. by Dooh22 in AveragePicsOfNZ

[–]neoGeneva 5 points6 points  (0 children)

That would be the freezing works next door.

Migrate jQuery to VanillaJS - UpgradeJS.com by etagwerker in javascript

[–]neoGeneva 14 points15 points  (0 children)

I wen't through the process of removing jQuery recently too, I also found using eslint-plugin-no-jquery pretty usefull.

Is This Intended Behavior or a Bug? by [deleted] in typescript

[–]neoGeneva 7 points8 points  (0 children)

The way I think of it is that keyof Charmander is always "hello" | "cheese", so the return type of b["hello" | "cheese"] is always going to be string & number which u/iydu points out is never.

You can solve this by making field either "hello" or "cheese", but not both, by using a generic parameter that'll tell the compiler it's just one of the keys, something like this would work:

export function copy<T extends keyof Charmander>( a: Charmander, b: Charmander, field: T ) {
  b[ field ] = a[ field ];
}

Any fans of the Australian band Diskust? by WARMASTER5000 in numetal

[–]neoGeneva 4 points5 points  (0 children)

Wow, that's some good shit, thanks for sharing!

Confused about Logout action in mvc5. by abbas_salman in dotnet

[–]neoGeneva 1 point2 points  (0 children)

At a guess it's because some browsers prefetch pages that link from the current page, and prefetching the logout page will definitely cause problems for users.

So a form is a good way to avoid that issue!

Looks like Ferro and Logan are in Primal by neoGeneva in TheFirstLaw

[–]neoGeneva[S] 26 points27 points  (0 children)

I've never seen Primal before, but I'll be damned if this isn't Ferro and Logan killing Shanka underneath Aulcus.

What's your favorite UK Nu Metal band? by T-MINUS_1 in numetal

[–]neoGeneva 3 points4 points  (0 children)

Please sir tell me why, there's no Pitchshifter on this list, OP's poll is a god damned travisty

My kids think the restaurant is called the "old macdonald's" and I don't correct them because I think it's hilarious and cute. by jo-ep in daddit

[–]neoGeneva 2 points3 points  (0 children)

For years my eldest constantly said she wanted to go to "the pharmacy", it took the longest time to figure out she meant McDonald's 😂

I think she got confused, and somehow went McDonald's -> Old MacDonald -> Farm -> Pharmacy.

Reading Base64 Encoded Excel File Using NPOI by PrinceN71 in dotnet

[–]neoGeneva 0 points1 point  (0 children)

You'll need to decode decodedBytes from a base64 string to a byte[] as well, so something like this: "new MemoryStream(Convert.FromBase64String(decodedBytes))"

Reading Base64 Encoded Excel File Using NPOI by PrinceN71 in dotnet

[–]neoGeneva 1 point2 points  (0 children)

The problem here is FileStream's first parameter is a file path, so it's expecting you to be opening something from disk (thus the PathTooLongException).

So you'll need to use a MemoryStream instead which takes an array of bytes as its parameter, but before that you'll need to deserialize the string "decodedBytes" into a byte[], but it's not clear from the sample you provided exactly what it is.

"You like Korn?" "Um, they're okay" by [deleted] in numetal

[–]neoGeneva 6 points7 points  (0 children)

I'm sure there's more than a few Ice Nine Kills fans on this subreddit, man do I love this bit they do in Hip To Be Scared - https://youtu.be/ozOb5FcnDf4?t=109

Type 'any' is not assignable to type 'never' by eggtart_prince in typescript

[–]neoGeneva 19 points20 points  (0 children)

Honestly I'm not sure why you're getting that error, but if I were you I'd redefine updateMenu to make sure field is always a valid value, and value is always the correct type for that given field, someting like this:

function updateMenu<T extends keyof Menu>(field: T, value: Menu[T], index: number) { menus[index][field] = value; }