No toes were harmed! Well, aside from that confidently incorrect user elsewhere on the post.
I know if I were to setup the V2L feature on my car to power my home it would look like this (the manual way). But there would be a physical interlock that prevents mains power from being on while this is plugged in.
Depended case by case. Sometimes it was exclusive, sometimes not. Usually it was "the common areas in the basement are yours to use but not exclusively" whereas they wouldn't be generally going upstairs. So I guess we could (and would) invade their shared space but not the other way around ha.
Fortunately only a few weirdos over the year.
I manage my G502 with Piper, which does support the G915. While it'll do LEDs, I manage the LEDs on mine via OpenRGB.
Whoops! Didn't notice that typo. I wouldn't even dream of subjecting my steam deck to the same 900 mods as my PC.
I wouldn't really be able to tell with the information it provides. But that 1KW figure does factor in the camera array since I can access it idle.
Go
Re-familiarizing myself with Go. The solution to Part 2 is fairly simply, the whole packing of the sequence into a single integer to save on memory was an optimization I did afterwards based on looking at other solutions. I thought it was cool.
package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
type SequenceMap struct {
Data map[int32]int
}
func PackSeq(numbers [4]int8) int32 {
var packed int32
for i, num := range numbers {
packed |= int32(num+9) << (i * 5)
}
return packed
}
func UnpackSeq(packed int32) [4]int8 {
var numbers [4]int8
for i := range numbers {
numbers[i] = int8((packed>>(i*5))&0x1F) - 9
}
return numbers
}
func NewSequenceMap() SequenceMap {
return SequenceMap{make(map[int32]int)}
}
func (m *SequenceMap) Increment(seq [4]int8, val int) {
pSeq := PackSeq(seq)
acc, ok := m.Data[pSeq]
if ok {
m.Data[pSeq] = acc + val
} else {
m.Data[pSeq] = val
}
}
func (m *SequenceMap) Has(seq [4]int8) bool {
pSeq := PackSeq(seq)
_, ok := m.Data[pSeq]
return ok
}
type Generator struct {
Secret int64
LastPrice int8
ChangeSequence []int8
}
func NewGenerator(Secret int64) Generator {
var ChangeSequence []int8
return Generator{Secret, int8(Secret % 10), ChangeSequence}
}
func (g *Generator) Mix(value int64) *Generator {
g.Secret = g.Secret ^ value
return g
}
func (g *Generator) Prune() *Generator {
g.Secret = g.Secret % 16777216
return g
}
func (g *Generator) Next() {
g.Mix(g.Secret * 64).Prune().Mix(g.Secret / 32).Prune().Mix(g.Secret * 2048).Prune()
Price := int8(g.Secret % 10)
g.ChangeSequence = append(g.ChangeSequence, Price-g.LastPrice)
g.LastPrice = Price
if len(g.ChangeSequence) > 4 {
g.ChangeSequence = g.ChangeSequence[1:]
}
}
func ParseInput() []int64 {
if fileInfo, _ := os.Stdin.Stat(); (fileInfo.Mode() & os.ModeCharDevice) != 0 {
fmt.Println("This program expects input from stdin.")
os.Exit(1)
}
scanner := bufio.NewScanner(os.Stdin)
var numbers []int64
for scanner.Scan() {
line := scanner.Text()
num, err := strconv.ParseInt(line, 10, 64)
if err != nil {
fmt.Printf("ERROR PARSING VALUE: %s\n", line)
os.Exit(1)
}
numbers = append(numbers, num)
}
return numbers
}
func main() {
numbers := ParseInput()
m := NewSequenceMap()
sum := int64(0)
for i := 0; i < len(numbers); i += 1 {
g := NewGenerator(numbers[i])
tM := NewSequenceMap()
for j := 0; j < 2000; j += 1 {
g.Next()
if len(g.ChangeSequence) == 4 {
if !tM.Has([4]int8(g.ChangeSequence)) {
tM.Increment([4]int8(g.ChangeSequence), 1)
if g.LastPrice > 0 {
m.Increment([4]int8(g.ChangeSequence), int(g.LastPrice))
}
}
}
}
sum += g.Secret
}
fmt.Printf("Part One: %d\n", sum)
var bestSeq [4]int8
bestPrice := 0
for pSeq, price := range m.Data {
if price > bestPrice {
bestPrice = price
bestSeq = UnpackSeq(pSeq)
}
}
fmt.Printf("Part Two: %d\n", bestPrice)
fmt.Printf("Best Sequence: %d\n", bestSeq)
}
Javascript
Reused my logic from Day 16. For part two I manually changed the bytes (i on line 271) to narrow in on a solution faster, but this solution should solve it eventually.
https://blocks.programming.dev/Zikeji/c8fdef54f78c4fb6a79cf1dc5551ff4d
I gifted my mom my Flip 3 when I migrated off (I couldn't tolerate the cameras on it). She only broke it once early on by dropping it with the screen open, but that's what the accidental protection is for. Other than that, she uses it daily and it still is going strong.
Mine takes a minute or so? I single-dose grind my espresso so by the time my portafilter is ready the machine is ready.
Check any guides or info on the phone regarding it. As others are saying, it's stored separately and should survive. However, in my case at least, I can only register an esim on the factory rom, so the recommendation on mine is to register esim before switching.
Zikeji
0 post score0 comment score
The US government does not force us to use a KYC (ID verification / know your customer) provider, at least - not a basic web hosting provider. That could change whenever though, and I'm not sure if Racknerd has any special circumstances.
As for why would a company do this - to prevent fraud and abuse. If a customer signs up and uses a stolen credit card, who do you think is on the hook for that loss? Not the victim, not the bank - us.
Why would they use a stolen card if they'll just end up getting their services cancelled one might ask - abuse. They'll setup servers, create phishing pages, and immediately start sending out spam emails. Or distribute malware, or host illegal content, etc.
This creates more work for us and negatively impacts the reputation of our network, and harms our legitimate customers.
So yeah, if something so much as looks out of place on their order / information (such as using a VPN to place the order) we will usually start a ID verification. We'll usually suspend them to lock them out while we wait on their response, or in extreme cases - immediately cancel and refund.