« first day (3459 days earlier)      last day (1480 days later) » 

12:39 AM
@Aran-Fey I'd like the have Hugh Jackman narrating Deadpool, in addition to the Deadpool character's narration.
 
 
2 hours later…
2:11 AM
Hi, guys what's a good book for numpy
I want to see more examples on how it's used so i'd prefer a book reference instead of the official documentation
I can't seem to think of ways I can use numpy for my use for now
 
2:56 AM
hi to all
 
AMC
@aderchox Have you given jazz a shot?
 
3:24 AM
la la la
I can't help reading numpy as rhyming with lumpy.. or saying it like that when I have to
 
3:56 AM
Morning/
anyone can help for this? i am trying to get 6 length encrypted code from any string using python base64. it should be decoded also
encoded_order_number = base64.b64encode(b'hello, how are you?')
print(encoded_order_number.decode("utf-8"))
decoded_order_number = base64.b64decode(encoded_order_number)
print(decoded_order_number.decode("utf-8"))
 
4:07 AM
are you asking to control length of encoded/decoded string via Base64 ?
 
 
1 hour later…
5:13 AM
do you want a hash of some sort? like an md5 hash but only 6 digits long @Jincowboy?
well.. anyway.. you can't get a 6 digit code for arbitrary length bytes objects
at least not one that you can decode and get the same data from
 
6:00 AM
def number2str(number, base):
    digit_chars = [chr(i) for i in range(ord('0'), ord('0') + base)]
    digits = []
    while number > 0:
        digit = number % base
        digits.insert(0, digit_chars[digit])
        number = (number - digit) // base
    return ''.join(digits)
>>> number2str(1163554, 64)
'4L4R'
That's a way you could compress integer values into a shorter representation ^ I saw in your snippet encoded_order_number, so I assume it's numbers you want to compress.
 
6:16 AM
@Todd i see that you usually within complicated things.
:P well done
 
=)
 
easier to shorten down numbers using other bases than arbitrary byte/character arrays.
 
that question is pain, I don't know why Wikipedia make such structure complicated. seems to prevent scraping
Hmm seems there's issue with in the following part
for x in dics.keys():
    b = dics[x]
    dics[x] = dict(zip_longest(b, com))
print(dics)
that was the concept
if i removed zip_longest , i will get the desired output missing some parts. but with it. I'm getting a None keys :(
 
you can just do for x in dics: that gives you an iterator over the keys.
or better: for k, v in dics.items():
The reason you're getting None keys is because 'com' is longer than 'b'
if you reverse them dict(zip_longest(com, b)) then you'll get None values instead
 
6:35 AM
i try to figure out where's the miss with the values.
 
probably when you're populating 'dics', your value being assigned is a shorter list than you expect?
 
it's should be not, as i do it in the order of states > provinces > cities
 
Hello
Can I ask a quick question in here?
 
states and provinces have no issue as they already within variable of dics
but for cities < there's the miss. i think at the point where am assigning N/A
@Milad sure, go ahead and ask
@Milad Just check the room rules and check An Illustrated Guide To Formatting Code In Chat, also you can practice in sandbox room
 
I have a class with an array as its member. But it behaves kind of weirdly. When I change the array inside an object it effects the other objects. Kind of.
I'm not sure how it works.
Am I missing something?
 
6:45 AM
Can you provide an example for the same.
 
oh sorry. let's format it.
How can I share code?
 
    here we go.. tinkering a bit.. adjusted the number2base function to include the widest range of ASCII printable characters that could represent an integer value unambiguously:
    def number2base93(number):
        BASE = 93
        digit_chars = [chr(i) for i in range(ord('!'), ord('!') + BASE)]
        digits = []
        while number > 0:
            digit = number % BASE
            digits.insert(0, digit_chars[digit])
            number = (number - digit) // BASE
        return ''.join(digits)
 
@Milad You can use dpaste.com for eg
 
@Milad If your code is longer than about 12 lines, use an external paste tool such as dpaste.com.
 
But I think that the way you have defined x, a is a class attribute shared among all instances of the class
So x2.a.append will affect x1.a.append
 
6:50 AM
@αԋɱҽԃαмєяιcαη thanks
Arrays are shared by reference?
How can I have separate arrays for each objects?
 
@Milad By using instance attributes, search for "Class vs Instance attributes"
E.g in your case it will be an instance attribute
class x:

    def __init__(self):
        self.a = []
 
@DeveshKumarSingh I see. Thanks so much.
 
No worries :)
@Todd You can also do digits.append(digit_chars[digit]) and return ''.join(digits[::-1]) to avoid the O(n) of each insert to O(1) of append
 
7:18 AM
insertions at position 0 are O(n)?
 
7:45 AM
you're right. insertions are very slow at 0
 
Inserts in general are O(n) since you need shifting of all elements to the right to accomodate elements. Also look at wiki.python.org/moin/TimeComplexity for time complexities of common python data structure operations
 
thanks for the ref
 
8:14 AM
@AMC you around?
 
@Permian didn't think of it as an edge case with my approach. Hopefully you got it right :)
 
8:41 AM
def number2base(number, ch_map="0123456789abcdef"):
    base     = len(ch_map)
    digits   = []
    while number > 0:
        digit = number % base
        digits.append(ch_map[digit])
        number = (number - digit) // base
    digits.reverse()
    return f"base_{base} repr: {''.join(digits)}"
There we go.. an arbitrary base encoder
number2base(8493579294502999475, [chr(i) for i in range(ord('!'), ord('~'))])
'base_93 repr: 1>oO?a`TN>'
 
8:52 AM
@Pherdindy that usually means you can't. I've seen your scraping stuff which tells me you might use pandas, but not numpy, no
 
@αԋɱҽԃαмєяιcαη Case closed.
 
\o/ thanks @IljaEverilä
 
9:50 AM
@Todd solved it finally. you know the issue was what? just to add this line com = iter(com)
 
@shad0w_wa1k3r it was the case i was missing
 
oh.. you mean the zip_longest() thing you had earlier?
 
i were testing via zip and zip_longest to see where the issue is. even i thought it can be related to order of dict but I'm using python 3.8.2 so it's not. then i came to iter where it's actually solved it
that was complicated structure really of wikipedia. if you look on the way how i get things off. you will smile :D
mickey mouse code.
 
 
3 hours later…
1:34 PM
Too late
 
I really wish it were possible to transform close-votes into dupe-votes.
Would have come in handy a lot of times.
 
@αԋɱҽԃαмєяιcαη off-topic how?
 
He's asking for getting things done within his code, which he himself didn't show
based on Now i want the code to do two thing 1- Check if there is anything new on the feed (A new blog post) 2- This check happens on every 24 hour. what should i do?
 
OK, but "off-topic" is not a close reason
 
alright, in such case, what shall we do?
too board?
 
be more specific with the close reason you think that applies
 
2:09 PM
alright.
 
there are 5 off-topic close reasons (+ custom) and 3 other ones
 
3:18 PM
urgh, isn't there some dupe that doesn't claim there is such a thing as a "JSON object"?
smells like raw strings... or is that teen spirit?
 
Aren't dicts in JS lingo "object"s? That would make "JSON object" a thing
 
JSON is a notation, so a JS lingo JSON object would be akin to a dict literal, I guess.
the alternative is that I have too much time on my hands and my pedantry is over 9000 today.
JSON object it is, then
 
Oh, well I've just popped in to see that this debate went better for me than my lack of using debuggers :P
 
When it comes out of json.loads I agree it's a dict. But when it's a string representation, dunno
 
I honestly don't know how else to refer to something that would be valid JSON
 
3:31 PM
JSON string?
 
@AndrasDeak well, before it comes out of json.load, iterating or accessing it is hogwash.
@AndrasDeak raw JSON string?
ducks
 
Mm, but once it's deserialized, with an intent to reserialize, I think it makes sense to talk about it as JSON. Then there's a huge group of newbies that have "a JSON" and it's not
In other news, my blue potatoes that I assumed had drowned (starting the personification early) have sprouted. Can't wait for my blue mash :)
 
Are they actually blue? Neat!
 
...and confusing :)
 
Bluish/purple. That was the start of my misadventure in the garden centre that got out of hand
 
3:41 PM
Umm... could serve them boiled and have people wonder why your beetroot is so anaemic :)
 
At the moment they've just broken the surface of the soil so it's been a tense 6 weeks to be confirmed they're not just waterlogged and rotted. In a week or so I'll need to start layering more soil on (hence I can only go on the photo on the packet for now)
@JonClements classic dinner party trick. Feed them raw potato and call it beetroot. Sadly, I've missed April 1st :P
 
@roganjosh you know what... I think a reason has come to light of why people don't turn up to your parties :)
 
Oh. I don't need the 6 PhDs working on this any more? Saves some pennies
 
4:04 PM
um.... fallen into 2 gotchas here
 
NLP:
If I have a list of substrings of a tokenized string, how do I get a sublist from the list starting at a phrase (a fixed order of strings, not just one string, although it could be one or more) and ending at another phrase (again, one or more; could be "or").
 
Did that "NLP" really have to go on a separate line?
 
4:38 PM
how about that question i feel it's seeking debug ?
 
I know it is not permitted to ask for help on my recently posted question, but it is urgent. I don't want to link it here but can you PLEASE check it?
 
@kahveciderin i don't use pygame at all.
 
I guess it is not about pygame
And that was the quickest I can draw the graphics for the ai project
The problem is, when I call this function repeatedly, it does not generate the result randomly:
 
@kahveciderin i thought that you aware about room rules, Please check formatting guide and you can practice in sandbox. Pay attention for If your question is eligible for a bounty (>= 48 hours old) and hasn't received a useful response, then you may link to it.
 
@kahveciderin the rule does no exist to punish people but rather to make sure that there aren't parallel dialogues going on, which is a duplication of effort
In addition, please see the guide in the top right for formatting code in chat. However, please do not repeat code related to your existing problem unless 48 hours passed and you've still not got assistance
 
4:56 PM
I'll repeat it if I do not die in 48 hours waiting for an answer.
thanks anyway
 
Thanks for understanding
 
5:43 PM
@αԋɱҽԃαмєяιcαη They haven't even asked a single question in that wall of text. oO
 
@αԋɱҽԃαмєяιcαη I meant the "question" you linked to.
 
@MisterMiyagi ah got it. yes he just asking people to read and figure out
lol
 
@kahveciderin Consider that to find your question, one has to go through your SO profile. Which isn't exactly welcoming for professional help on Python.
 
I know what you mean but that half sounds like "please link your question instead"
 
5:50 PM
I'd rather not draw more attention to the question. I went with a shot against the bow but left the remainder because it's quiet and also because I was outside on a mobile. If it generates more chat then I might need to move the lot :/
 
just boot if they try again
 
No, NLP did not have to go on a separate line
 
May I have help with understanding Kadane's algorithm implemented in Python? garysnotebook.com/20190730_1
 
You can't be more of a jerk than "I know I mustn't thing but urgent"
rbrb for a while
 
6:01 PM
If my question has been forgotten, don't revive it. I'll ask on the more appropriate channel.
 
AMC
@αԋɱҽԃαмєяιcαη I am now, why?
 
@AMC Was searching about the JS question which you shared early . but found it
 
AMC
@αԋɱҽԃαмєяιcαη Oh yeah the attempt at a canonical/reference answer. It's a WIP.
Speaking of, I should probably work on it now.
 
@Matthew If you have a question, feel free to just ask it provided that it is on topic. You may want to take a look at the room rules if you haven't already.
 
6:49 PM
the moment when you deep in regex. you just understand that before you was wasting much time :(
 
AMC
@αԋɱҽԃαмєяιcαη Were you asking about the canonical web scraping QA for this question ?
 
Yes.
actually there's others too as well
:D this is just the last one i answered along the day
I keep receiving the same question daily.
 
I hope you keep giving the same answer
 
:| review the profile. on each single post. i keep repeat :(
 
good job
make sure to copy-paste answers where applicable
 
7:00 PM
I can't even tell when Andras is sarcastic anymo- nevermind
 
I do but guess what? martjin warned me to not do this :( he asked me to change in it
a lot of question where i flag for duplicate which within the same concern of why bs4 is not shown objects which is rendered by JS but after the question got closed. i found it's reopened and even received answer with the same do not use bs4 for JS websites
 
@αԋɱҽԃαмєяιcαη it's like you completely missed the multiple very clear suggestions you got here telling you to stop answering dupes
 
Meh... not sure what to think of the Queen's speech... she didn't even say biggliest once! :p
 
I won't bother you with "I know you're trying to help" anymore
@JonClements She clearly didn't memorize her lines :(
 
You'd have thought after 68 years she'd have gotten the hang of that by now :p
 
7:08 PM
I liked the reference to her childhood address 110 years ago
 
From No Such Thing as a Fish: when they tried to film her public address at Xmas... the producer held up a placard saying "smile" and she spotted it and immediately frowned in anger during her speech
 
@AndrasDeak Will stop it from now on.
 
sure you will
 
I don't care
 
7:10 PM
@roganjosh She has done a few non-Queen like videos though... that one for the Olympics and was it with Harry for the Invictus games in response to something from Obama?
 
@JonClements After parachuting for the Olympics, she moved on a bit. Hysteresis can be weird, so I'm not sure what we have in store...
 
AMC
@αԋɱҽԃαмєяιcαη Yup, that's why I wanted to find or write a decent canonical/reference QA. It seems really common.
 
 
2 hours later…
8:54 PM
hi cabbage patch
 

« first day (3459 days earlier)      last day (1480 days later) »