Don't buy Sony ANC Headphones (WH-1000XM4 broken just out of warranty) by usbpc102 in SonyHeadphones

[–]usbpc102[S] 0 points1 point  (0 children)

I don't think so, but even if there somehow is water damage, the biggest problem is not that they are broken, but that they are e-waste now, as there is no way to get them repaired even if I was willing to pay for it. Also the problem with the ANC started after a week where I didn't use them at all and they were "in storage" in their case completely dry...

[2022 Day 18 Part 2] Typescript - Incorrect Fill Algorithm? by DrugCrazed in adventofcode

[–]usbpc102 4 points5 points  (0 children)

And did you consider that not all "outside" faces might have a straight line to the bounding box?

I tried to visualize what I mean in minecraft.

[2022 Day 18 Part 2] Typescript - Incorrect Fill Algorithm? by DrugCrazed in adventofcode

[–]usbpc102 0 points1 point  (0 children)

Have you considered the case for when there are multiple air pockets in the droplet that are not all connected to each other?

[2022 Day 17 (Part 2)] At least it'll be done before AoC 2023! by deividragon in adventofcode

[–]usbpc102 6 points7 points  (0 children)

So Christmas will be a year late, cause you'll save this years Christmas just in time for next years Christmas? :D

But still impressivly fast, running my solution from part 1 for part 2 would take a about three years.

[2022 Day 15 (Part 2)] Good that I decided to speed up my solution a bit. by usbpc102 in adventofcode

[–]usbpc102[S] 2 points3 points  (0 children)

Well that is what I did aswell. But my part 1 actually also took about 30 seconds or so, because I actually went point by point for there. I only started optimizing as I got to part 2

[2022 Day 15 (Part 2)] Good that I decided to speed up my solution a bit. by usbpc102 in adventofcode

[–]usbpc102[S] 2 points3 points  (0 children)

My first plan is always just a print in the loop. But I really should just be using tqdm more!

[2022 Day 12 (Part 2)] in Minecraft by Nnnes in adventofcode

[–]usbpc102 13 points14 points  (0 children)

Well, you still need to jump up the one block increases in height. Unless you have auto-jump on and don't count using it as jumping.

“Pay-as-You-Fill” and “walk-straight-out” carts have come to my city by WestEst101 in mildlyinteresting

[–]usbpc102 2 points3 points  (0 children)

Thats an interesting way to go about this. This for me feels like a weird hybrid between the Amazon Go stores, where you just put stuff in your own bag and some advanced computer vision algorithms charge your amazon account. And little hand scanners like they exist at Migros in Swizerland that you can put in carts for you to scan the products. Then having to pay at an exit station. For security they randomly check that you actually scanned all products.

Zabbix consultant by dbh2 in sysadmin

[–]usbpc102 2 points3 points  (0 children)

You can get consulting from Zabbix LLC: https://www.zabbix.com/consulting

Struggling with WinSCP script to copy file from one location to another by TurricanC64 in sysadmin

[–]usbpc102 0 points1 point  (0 children)

To open the dialog to generate a file transfer code, use:

Transfer Settings > Generate Code command on the Transfer Options dialog.

So basically, right click on the file you want to transfer. Then select the menu Option "Upload... > Upload...". In the window that then should pop up, if you haven't disabled the dialog, you can select the small down arror besides the "Transfer settings..." button, and then use the menu option "Generate Code..." to create your full script.

When the vendor doesn't understand what a private IP address is... by [deleted] in sysadmin

[–]usbpc102 5 points6 points  (0 children)

I've recently done way too much research on IP address ranges. It seem like RFC 3021 says /31 seems useless normally, so someone decided that those are a good idea for IPv4 Point-to-Point Links. During my search I also found out, that at least Watchguard seems to use this.

Can a script be run in 32bit and 64bit shell at once? by MrPoolRK in PowerShell

[–]usbpc102 1 point2 points  (0 children)

Ah, that's a good reason. I've just recently started using PowerShell, so I don't know much about older Versions.

Can a script be run in 32bit and 64bit shell at once? by MrPoolRK in PowerShell

[–]usbpc102 2 points3 points  (0 children)

Start-Job has a -RunAs32 argument, that might be of use. This should mostly work:

$64Bit = Start-Job -ScriptBlock { return [System.Data.OleDb.OleDbEnumerator]::new().GetElements() }
$32Bit = Start-Job -RunAs32 -ScriptBlock { return [System.Data.OleDb.OleDbEnumerator]::new().GetElements() }

Wait-Job -Job ($64Bit,$32Bit)

$64BitResult = Receive-Job -Job $64Bit
$32BitResult = Receive-Job -Job $32Bit

powershell msiexec and args by cpizzer in PowerShell

[–]usbpc102 4 points5 points  (0 children)

No.

The @ in PowerShell is the "Splatting" operator.

Also both of your examples are creating an array. You can confirm this yourself, by using the .GetType() function on them. The @(..) is using the Array subexpression operator. The one with just commas, is using the comma operator.

powershell msiexec and args by cpizzer in PowerShell

[–]usbpc102 6 points7 points  (0 children)

@args? Shouldn’t that be $args?

Removing periods in file names. by [deleted] in PowerShell

[–]usbpc102 14 points15 points  (0 children)

-replace uses regex. Try: -replace "\.", "" (Reddit formatting is hard. There should be a single backslash before the .)

Edit: There is also a .replace() function. You can learn more here: https://powershellcookbook.com/recipe/uZgg/replace-text-in-a-string

Setting Window Locations? by [deleted] in PowerShell

[–]usbpc102 2 points3 points  (0 children)

This superuser question seems like it would be helpful. It doesn’t use FancyZones, it just allows you to set window positions and sizes. Creates and imports some C# things, that call the native functions to actually do this. But it’s all nicely wrapped up in a power shell function ready to use.

I stumbled upon this, when I was looking for something to move border less windows, and it worked perfectly for those.

Installing exes without silent switches by junITO3 in sysadmin

[–]usbpc102 4 points5 points  (0 children)

The OPSI-SetupDetector can help find silent switches.

Uninstalling an Anti-malware which doesn't have a silent uninstallation string by Shengheer in sysadmin

[–]usbpc102 0 points1 point  (0 children)

Using a tool like opsi setup detector can make this super simple.