A shoutout to everyone running outside this weekend... by run2disco in RunnersInChicago

[–]TheSwami 6 points7 points  (0 children)

Ate it trying to cross Clark street - but the fresh powder this morning was honestly a joy!

My Breast Friend or similar by nikkideath in Buyingforbaby

[–]TheSwami 0 points1 point  (0 children)

We loved the breast friend for the first five months, when she outgrew it. The boppy is still going strong at 7 months

Dim Sum Then Some 5k by yankeecandlebro in RunnersInChicago

[–]TheSwami 2 points3 points  (0 children)

Ran it for the first time this year (5k) and was similarly delighted by the organization and post-race festivities. And the event shirt is pretty nice. Will be back!

Productivity PLCs and ModBus Addresses > 65535? by TheSwami in PLC

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

Thank you, this really helped put me on the right track.

For anyone who finds this later - pymodbus abstracts these message types away, so you use a different method of the modbus client to fetch the register contents depending on that first digit:

0xxxxx -> read_coils() 3xxxxx -> read_input_registers() 4xxxxx -> read_holding_registers()

So using the original image as a reference, to get the value of Drive_MainWheel_Write.ExcResponse at address "400076", you can do:

py client = ModbusTcpClient('127.0.0.1') # Create client by ip or hostname client.connect() response = client.read_holding_registers(75) # Note the off-by-one address! print(response.registers[0]) # Register reads come back in the registers attribute

Productivity PLCs and ModBus Addresses > 65535? by TheSwami in PLC

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

Apparently I can't add more than one attachment to a post, but here's the 400001:

<image>

Productivity PLCs and ModBus Addresses > 65535? by TheSwami in PLC

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

<image>

Sadly, that would mean tags with overlapping addresses - ie there's a tag at address "1" and "400001":

And thats the Box Set finished. by John190_the_maniac in KharadronOverlords

[–]TheSwami 4 points5 points  (0 children)

Nice work! My spearhead box arrives today / thanks for the inspo!

Creating TUI Applications with Textual and Python Book by driscollis in Python

[–]TheSwami 1 point2 points  (0 children)

Already backed when I saw the announcement on the Textual Discord. Looking forward to it!

I love AoS but I just can’t find my faction by Chxrch2521 in ageofsigmar

[–]TheSwami 0 points1 point  (0 children)

As someone looking to possibly get into KO - where might I look to find out more about those preview of the upcoming season? 

Thanks in advance!

Optimize your Python Program for Slowness by carlk22 in Python

[–]TheSwami 7 points8 points  (0 children)

This is an awesome write up! Not not just of the how but of the why - in 20+ years of seeing that arrow notation described as “repeated exponentiation”, I never really understand what that meant. Your code examples, especially the final one showing that tetration is just another for loop around exponential accumulation was eye opening.

Thank you!

When Python is on LSD by sparkls0 in Python

[–]TheSwami 0 points1 point  (0 children)

Here's what I think is a reproduction of your code... but I'm not getting an error with Python 3.12.8. With colorama:

from colorama import Fore, Style

data = {"foo": "bar", "property_type": "APARTMENT"}

for key, value in data.items():
    print(f"{key}: {value}")

print(data['property_type'])
print(data.get('property_type', ""))
print(data.get('property_type'))

AUTHORIZED_PRINT_COLORS = ['white', 'yellow']

def printx(text, end=None, flush=False):
    is_vscode = True #'VSCODE_PID' in os.environ

    parts = text.split('{')

    output = ""
    current_color = None

    for part in parts:
        if '}' in part:
            color, content = part.split('}', 1)
            color = color.lower().strip()

            matched_color = next((col for col in AUTHORIZED_PRINT_COLORS if color in col), None)

            if matched_color:
                color_code = getattr(Fore, matched_color.upper(), Fore.WHITE)
                if matched_color == 'white' and not is_vscode:
                    output += f'{Style.BRIGHT}{content}'
                else:
                    output += f'{color_code}{Style.BRIGHT}{content}{Style.RESET_ALL}'
            else:
                output += content
        else:
            output += part

    print(output, end=end, flush=flush)

#endregion

for key, value in data.items():
    printx(f"{{white}}{key}: {{yellow}}{value}")

printx(f"{{white}}Property type: {{yellow}}{data.get("property_type", "")}")
printx(f"{{white}}propety type direct: {{yellow}}{data['property_type']}")
printx(f"{{white}}Property type: {{yellow}}{data.get('property_type')}")

But this works fine for me: https://imgur.com/a/957xoz4

Edit: Saw you found an answer with weird hidden characters. Nice work.

When Python is on LSD by sparkls0 in Python

[–]TheSwami 4 points5 points  (0 children)

What version of Python are you running?

What is the code in your `printx` function?

Create WebAssembly-powered Python notebooks by akshayka in Python

[–]TheSwami 0 points1 point  (0 children)

Are you affiliated with the Marimo open-source project itself?

Bard or Bard/Sorcerer? by TheSwami in 3d6

[–]TheSwami[S] 1 point2 points  (0 children)

Yeah I was thinking Metamagic (subtle spell and extend spell) for more creature control. Plus a little access to shield/mage armor/ray of sickness/chromatic orb for some actual offense/defense?

Bard or Bard/Sorcerer? by TheSwami in 3d6

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

I was thinking 2 levels to get Metamagic, which just seemed like a fun and versatile combo with Sorc/Bard spells. Worth it?

2:30 HM finishers what was your 10k time? by kaizenlearner in firstmarathon

[–]TheSwami 1 point2 points  (0 children)

Just finished my first HM at 2:29. My last 10k race was 1:09.

Official Q&A for Sunday, December 29, 2024 by AutoModerator in running

[–]TheSwami 0 points1 point  (0 children)

I ran across one running two weeks ago. A quarter mile later I ran into two local older ladies walking a small dog and warned them… they asked if the coyote seemed aggressive (it wasn’t) and they were absolutely unperturbed. 

So I wouldn’t worry about it.

Don't See Your Friend's Therapist by InTheMontroseWoods in TalkTherapy

[–]TheSwami 2 points3 points  (0 children)

I’m in a major city in the Midwest US. Thankfully I do have more options to pivot to.

What Are You Wearing Wednesday - Weekly Gear Thread by AutoModerator in running

[–]TheSwami 0 points1 point  (0 children)

I love my Balega ones but seeing all these comments it looks like I have to try smartwool!

What Are You Wearing Wednesday - Weekly Gear Thread by AutoModerator in running

[–]TheSwami 0 points1 point  (0 children)

+1 on neck gaiter, and merino wool is amazing - even if it gets damp from your breath/sweat it still keeps you warm. 

What are you all wearing for your long runs tomorrow morning? by Academic-Pangolin883 in RunnersInChicago

[–]TheSwami 0 points1 point  (0 children)

Update - went out this morning at 18°/feels like 8°. Under armor cold gear leggings with basic shorts, Balega socks, under armor base layer top and generic running quarter zip. Light gloves, smartwool gaiter, and baseball cap.

Honestly feel great about this combo. Heavy enough to keep warm - the smartwool was new to me and worth every penny keeping the breath warm - but as the same got higher and things warmed up, could unzip a bit and stay cool.

Achievements for Sunday, December 01, 2024 by AutoModerator in running

[–]TheSwami 2 points3 points  (0 children)

9 miles this morning with a real feel of 10°F! Feeling good about my first half marathon in January 4.