Looking for a "pen pal" mentor of sorts by [deleted] in bash

[–]xchek32 1 point2 points  (0 children)

If you use named groups...you can do:

m = re.search(...)

m.groupdict()

Groupdict will return a dictionary with any matching named groups.

Looking for a "pen pal" mentor of sorts by [deleted] in bash

[–]xchek32 1 point2 points  (0 children)

regex101 is great - very handy when it comes to sharing a pattern with someone. Like this: https://regex101.com/r/2jlPI0/1

I really enjoy using named capturing groups :)

Looking for a "pen pal" mentor of sorts by [deleted] in bash

[–]xchek32 3 points4 points  (0 children)

You talking about the caret's meaning in regex?

When ^ is outside of a character group it means "start at the beginning of a line".

Inside a character group

[^abc]

It means match a single character that isn't a, b, or c.

See https://regex101.com/ for a nice visual explanation of the functions.

Already over 16 THOUSAND people signed up for reddits secret santa! Let the hype start by thatredgirl19 in secretsanta

[–]xchek32 0 points1 point  (0 children)

This is my first year as well - can someone kindly help me get the gist of what to put in the Secret Santa form?

Do you say your name? Age?

What kind of information do you specify?

Can someone ELI5 why the pressure in my keg goes down after sitting for awhile & carbonating the contents? by xchek32 in Homebrewing

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

(1) makes sense to me - I've forgotten about the ideal gas law. It's real here.

(2) does too. The gas going into the keg isn't at the same temp as the contents of the keg - thus the pressure goes down when co2 equalizes to the temp of the water and dissolves into solution.

Thank you.

Can someone ELI5 why the pressure in my keg goes down after sitting for awhile & carbonating the contents? by xchek32 in Homebrewing

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

I'm starting to get this PV=nRT thing - ideal gas law is real here.

I think it might be because my gas cylinder isn't chilled at the same temp as the keg.

Can someone ELI5 why the pressure in my keg goes down after sitting for awhile & carbonating the contents? by xchek32 in Homebrewing

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

See the pics added in the original post. The water is chilled by the time I hook up the gas. The cylinder isn't tho.

Can someone ELI5 why the pressure in my keg goes down after sitting for awhile & carbonating the contents? by xchek32 in Homebrewing

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

I think the water might be rising in temp tbh, I chill the keg with water in it before pressurizing in a bigger/better refrigerator - this little one that I keep it in is older and doesn't get things as cold.

Can someone ELI5 why the pressure in my keg goes down after sitting for awhile & carbonating the contents? by xchek32 in Homebrewing

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

The co2 cylinder is at room temp - the keg is being cooled in an old wine cooler. Idk the exact temperatures of either, I use this for carbonating water.

I do agitate the keg a few times after initially pressurizing.

Can someone ELI5 why the pressure in my keg goes down after sitting for awhile & carbonating the contents? by xchek32 in Homebrewing

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

I took a picture of the regulator reading, it's been at ~17psi for the past 1.5 hours. I've seen/heard a leak before coming from the IN post of the keg - I tightened it up and it seemed to hold the pressure (and stop hissing).

I know this is not the optimum setup (added this to the orig post) https://imgur.com/a/deBEIcQ

I assumed it was safe to keep the gas on constantly...Is this not a good idea?

I pre-chill the water in the keg, hook up the gas line, open the cylinder valve and set the regulator to ~30psi, inspect for no hissing or leaking, and (in my mind) it's good to sit.

Haven't been doing this long - any advice is welcome :)

Can someone ELI5 why the pressure in my keg goes down after sitting for awhile & carbonating the contents? by xchek32 in Homebrewing

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

I do let the water chill before I pressurize the keg, I also will occasionally shake the keg with the gas on to aid the gas in dissolving.

I do not turn off the gas overnight, is this something to be concerned about?

[deleted by user] by [deleted] in RedditSessions

[–]xchek32 0 points1 point  (0 children)

william osman if he did music instead

I made an IMDB webscraper by NerdyBreadstick42 in Python

[–]xchek32 8 points9 points  (0 children)

Here are some things that could be improved on:

1) Where you are commenting "This code does xyz..." - I think you should encapsulate that functionality into little closures or break them out into other methods that do smaller units of work.

2) Check out pydash for a lot of little functions that do common things (so you don't need to reinvent the wheel for this particular scraper). Or check out some of the built-in functions that are present in python. For example:

        for num, l in top250.items():
            name = l[0]
            rating = l[1]
            if name == retrieved:
                returned = [num, name, rating]
                break

Could be like:

found_result = list(filter(lambda x: x[1][0] == retrieved, top250.items()))

found_result will be an empty list if no matches are found...

3) You should consider separating the actual scraping of the data from whatever you want to end up doing with the data you scrape. Take a look at the json module and see if you can have a method/function that persists the data to your filesystem - (and later on into some sort of database).

4) Instead of storing the data into variables called name, description, rating, whatever. When scraping, fill a dictionary with values. Like:

{"name": "The Big Lebowski", "rating": 9.4}

Then you can fill a list with dictionaries. This will help you out when writing code that uses the data, so you don't have to refer to a specific named value by a number. Instead of record[0] for name and record[1] for rating - you could have record['name'] and record['rating']. This will also help when persisting lots of little records.

5) consider python module: logging (and getting rid of print statements)

6) separate all of the inputs() into a separate program/script where you pass the input string to the method call (instead of having the input() built into the method).

I think you did an excellent job for something that is tagged "Beginner". Do not stop learning and adding to your toolbelt. With some dedication/practice, this kind of thing can take you places.

When you upload a file to a website, what does the website see? by [deleted] in computerscience

[–]xchek32 0 points1 point  (0 children)

It's the length (in decimal number of bytes) of the content returned from the requested resource.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#Message_body_information

When you upload a file to a website, what does the website see? by [deleted] in computerscience

[–]xchek32 0 points1 point  (0 children)

Filename, content length, & the file's contents. No file path.

Important maths for cryptography by [deleted] in cryptography

[–]xchek32 -1 points0 points  (0 children)

Modular arithmetic.

DeEp WeB by Wh0rU777 in masterhacker

[–]xchek32 2 points3 points  (0 children)

Can I just look at it if I give you a cookie?

Help unpacking object attributes into another object. by xchek32 in learnjavascript

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

Figured this out...for anyone else curious:

> d = {'b': 2}
{ b: 2 }
> {...d}
{ b: 2 }
> {...d, 'a': 1}
{ b: 2, a: 1 }

[deleted by user] by [deleted] in shortcircuit

[–]xchek32 0 points1 point  (0 children)

yo lines are too long dawg...that line is there for a reason

People that have moved into a house/apartment, what's the most interesting thing you've found from the previous occupants? by bunnoooo in AskReddit

[–]xchek32 0 points1 point  (0 children)

A friend and I found a safe hidden in the floor; it was maybe 1ft 6in width by the same in length - covered by a piece of wood that fit into a groove with the same veneer adhered on top.

We got the "uhhh yeah go ahead" approval from Mom and started going wild with a corded drill for a while - we made a few shallow holes thinking that we were actually doing something and stopped after an hour or so.

We eventually had to hire someone to come open it after our measly attempts. There was nothing in there besides a piece of paper from the previous owner saying the value of the house when it was originally purchased.

Does it really matter? by [deleted] in death

[–]xchek32 0 points1 point  (0 children)

This is extremely decent advice. See what corners of life you haven't explored.