« first day (3442 days earlier)      last day (1499 days later) » 
00:00 - 16:0016:00 - 23:00

12:02 AM
@AMC too broad for the latter, no MCVE for the former
 
i feel like that question should be closed. stackoverflow.com/a/60748578/7658985
 
AMC
@AndrasDeak Ugh, that feels decent at best.
@αԋɱҽԃαмєяιcαη Agreed.
 
:D the op just copy/pasted my code to his question.
lol
@AMC no worries, i flagged his comment
 
AMC
12:17 AM
@αԋɱҽԃαмєяιcαη Yeah, I was confused by that, it makes no sense.
 
@AMC he just don't know what he's looking for. the issue in the website where he scrape. but he came to ask what's wrong in his code without providing additional details regarding the site. even he include the site without the keyword he looking for. and then he said "i figured it out"
 
AMC
@αԋɱҽԃαмєяιcαη I think there's a lot more he doesn't know.
 
:) let's see , he invited me to a chat
 
AMC
I don't see the point
It's a poor question
The fact that it's dragging on so much is proof that OP needs tutoring, or a guide, or whatever
this isn't the place for that
 
wim
12:47 AM
@αԋɱҽԃαмєяιcαη if you feel it should be closed, why have you answered it?
 
@wim I've answered it based on the origin state of the question itself.
after getting some additional details from the OP. i understood that he just don't know where the issue is.
 
wim
I feel like so many dumb "web scrapping" questions are not very useful content to keep on site. As long as those users keep getting spoon fed, they will keep coming back. It's "do my task for me". Better to ignore them.
 
AMC
@wim Agreed.
 
wim
It's nice to have a few good questions about how to use beautifulsoup on site but we don't need to tutor every beginner on how to use the tools available
 
AMC
Forget having to teach people how to use BeautifulSoup, what about the never-ending questions which all come down to the fact that OP is trying to scrape dynamically generated content using requests (or similar) and BeautifulSoup.
I'm going to write a freaking canonical/reference answer for those, it's just become too much.
 
wim
12:55 AM
there used to be "too localized" or "unlikely to help future readers" close reason, but it got removed or reworded for some reason
 
AMC
@wim "unlikely to help future readers" actually lives on in one of the off-topic reasons
That's more of a cool fact than an actual solution though, since IIRC my attempts at using that flag are almost always declined or contested.
 
@OakDev what do you mean
 
AMC
1:12 AM
@wim oh and I think the reason was that it was being abused
/overused
One of the reasons, IIRC
 
 
2 hours later…
3:17 AM
try:
    data['id'] =  # search for names
    data['num'] =  # search for num
    data['date'] =  # search for date
except:
    # assign value of "N/A" depending of except happens.
can that achieved without try/except each block of the code ?
etc. data['id'] got exception so it's will assign the following data['id'] = "N/A"
 
AMC
3:33 AM
@αԋɱҽԃαмєяιcαη What is data ?
 
Ops, my mistake. data = {}
empty dict
 
AMC
So you want to assign "N/A" if the key is not in the dict?
 
No, i want to assign "N/A" once the exception happens . depending it's happens on data['id'] or data['num'] or data['date']
 
 
2 hours later…
user11867329
5:30 AM
@αԋɱҽԃαмєяιcαη Why doesn't it center itself.
 
user11867329
Stays left (default)
 
6:50 AM
@αԋɱҽԃαмєяιcαη don't use bare excepts :)
anyway... why not use setdefault... eg: for key in ('id', 'num', 'date'): data.setdefault(key, 'N/A') or something?
or make it default upfront data = dict.fromkeys(('id', 'num', 'date'), 'N/A') then over write them with real values later on
 
7:30 AM
@OakDev how about no
 
@αԋɱҽԃαмєяιcαη Can you provide your "depending of except happens" or "search for names" logic? Otherwise, it seems dict.get is appropriate.
 
@αԋɱҽԃαмєяιcαη it should go without saying but it seems I have to say it: don't answer blatantly off-topic things in chat! (And neither on main, of course)
 
8:38 AM
cbg guys. Hope everyone is safe from the virus?
 
< safe and sound locked up at home
 
I'm not a fan of this being forced to WFH. I think the bamboo plant on my desk at work has died by now. :(
 
@arne nice to hear. Safe here but still going out.
 
8:54 AM
I only go out to shop for food. being an introvert prepared me really well for this kind of situation
 
9:13 AM
You are in a better position then. I can't indoors all day everyday. I will lose my mind
 
is there a benefit of using else after try-except block rather than just writing in the try block?
try:
    print("hello")
except:
    print("something went wrong")
else:
    print("nothing went wrong")
i could have just written print("nothing went wrong") in the try block
to get the same result
 
Hello, guys
i have been searching for socket programming
the thing i want is to send/recv messages from client to server and vice versa without waiting for the other one to respond after the the first message has been send
 
@Manik but that's just one line. imagine you need more lines of code to be running. The issue is, you may accidentally catch an exception you weren't actually prepared to catch. (also, with a bare except like that, you'll definitely run into this problem. don't use bare excepts)
 
but i, unfortunately, can't find such, the closest thing i found was, client can send multiple messages with auto-response from the server.
 
The idea behind a try: except: block is, unless you're reraising the error, you're basically saying "i am prepared to handle whatever happens when this error arises in the codeblock inside try:." So, it's important to keep the least amount of code possible inside the try block, that you're actually capable of handling.
 
9:29 AM
Paritosh but for example in an app i would never want the whole code to stop for the user because of 1 error so i should use bare except like except Exception e: right?
 
and i dont want the server to auto-reply, i want the a normal communication between server and client without waiting for one to reply so the other can send the second message
 
sorry except Exception as e:
 
@Manik yes, that's better than a bare exception, though it really depends on the type of error that happens
 
@umerselmani Are you saying you want to send and receive at the same time?
 
yeah
 
9:42 AM
then it's probably easiest to use two threads, one for sending and one for receiving
 
cbg-ning
 
@Aran-Fey, in the multi client it is posibble, but for the client-server idk
 
@shad0w_wa1k3r are you around?
 
@Aran-Fey, alright i will try my best to figure it out, to do it
@Aran-Fey Thank you
 
@Manik you should still only handle exactly what you can in a try block, and have a single catch-all at the highest point where your app is called, with the except being more or less "something I was really not prepared for happened, I'll write it to the logs but keep the service running."
imo Paritosh is right on the money here chat.stackoverflow.com/transcript/message/48895482#48895482
 
9:53 AM
and don't try to handle exceptions you can't
don't be afraid to let it get propagated to something that can
 
lots of juniors I worked with have an irrational fear of stack traces. some will go as far as wrapping their code in try..excepts and doing a print(e); exit()... at least they got to pull the trigger ¯\_(ツ)_/¯
 
and if you think you have a chance of handling it, then sure, catch it, but if you can't, then re-raise it to give something else a chance
@Arne I can imagine they think exceptions are bad things
 
for sure
there is a german saying, "burned kid shies from fire", which seems to apply
 
stackophobia
 
ha, I'm adopting that
 
10:06 AM
@Arne meh... the old days of dealing with return values and all that :)
 
@JonClements stacktraces are so much better than getting a 2 and having to find out where that could have come from
kids don't know how good they got it these days! angirly weaves walking stick
 
indeed... and then if you forgot to check the return value etc...
 
The ecosystem sure Improved a lot. And I've only been around for 10 years!
 
10:33 AM
debugging C code that didn't check return values and had long jumps in it... oh wow... don't miss those days :)
 
10:59 AM
@umerselmani are you familiar with the socket programming howto?
@Manik Consider that if you suppress an unexpected exception, that means the app still does not work for the user. All you have done is made error detection and mitigation harder.
 
@MisterMiyagi, man i am trying to learn and implement at the same time, i hope i am learning something.
 
i assume people take the set(something) to make lookups O(1)?
but how long does the process of converting the something to a set take?
 
@Permian probably O(n)
 
user6568562
 
user6568562
11:15 AM
It's O(1) amortized, I believe
 
how would that work?
 
Miscommunication...
 
@AndrasDeak i would have thought O(n) as well
 
@Permian because it is. Can you consume an iterable without iterating it?
 
11:17 AM
It can be O(n) at best
 
What is the best way to iterate through a pandas series with lists
I can only think of a nested for loop
 
@Permian the main point is that you don't convert if val in lst to if val in set(lst). This conversion only makes sense if you repeat the lookup a lot of times.
 
ah ok
 
@Pherdindy what is it you're trying to do?
 
ParitoshSingh, MisterMiyagi, Arne melon
 
11:22 AM
I'm trying to iterate through the list basically
 
to achieve... ?
 
so i can run conditions to categorize them by product
Then i'll place them in a merged dataframe to categorize my rows
 
can you .explode() the series, use that as a DF to then merge?
 
@Permian Also, most of the work of building a set from a list can run at C speed, so it is much faster than using a Python loop to build a set from the list items one by one.
 
I'll check it out. Not sure what methods exist to do my task
 
11:25 AM
@AndyK I am now
WFH, so diligently avoiding opening the browser & all of the distraction tabs :-p
 
@shad0w_wa1k3r and how's that working for you so far :p
 
today is more productive than yesterday which was more productive than the day before. I'm still not satisfied, but there's progress :D
 
11:55 AM
okay... note to self: don't do a .read() on a 900gb file
even with 64gb ram and a 128gb swap file - it's going to blow things up
 
no way ;)
 
who'd have thought it, hey? :p
 
64 gb ram, im jelly!
your personal setup?
 
okay... so now waiting for ACID stuff
postgres seems happy, redis is struggling a little
 
@JonClements isn't it too rash jumping to drugs just yet? It's only one mistake.
 
12:00 PM
where did you get
a 900gb file
 
@AndrasDeak :) I hope you know I meant it as per en.wikipedia.org/wiki/ACID
@Pherdindy oh... ya know... I work with data pretty much non-stop... just an extract from another DB etc...
 
that is some big amount of data for sure
 
yup... and some very nice info. in it
once I parse it anyway
and that's going to be a good 8/9tb needed
 
goodluck with that lol
 
thanks... it's already not looking too fun :)
So yeah... got a server going idle if anyone wants to minecraft again?
(got copies of the original world we had - not entirely sure if they're compatible with the latest stuff though)
that reminds me: @davidism if we go ahead with a sopython minecraft server, would you mind amending an A record to point to it under the sopy domain?
 
sorry wrong place to ask
 
Sam
Hey all
 
12:49 PM
need a downvote on an answer so I can get a palindromic rep :)
 
Spending some time going through books to try formalise my understanding. A practical question, though; if you were asked in an interview to implement a hash table in a whiteboard interview for python, would you reach to set up a linked list to deal with collisions or just go with a nested list? It seems to me that a nested list is probably the most idiomatic for the actual language?
 
@roganjosh could it be a trick question?
 
Or just ask for clarification off the bat, which seems a bit direct
@JonClements guess I'd never know that. Are you suggesting they may even be expecting me to start with dict?
 
yes
It probably goes like "dict.", "OK, now without a dict." "[more elaborate solution]" "OK, now [without stdlib thing making your job easier]" and so on (or so I imagine)
 
It all depends... my imaging is you realise there's a hash builtin and that you can define __hash__ on objects if needed
hashing algorithms are pretty hard to get right
and in Python - everything is pretty much a dict anyway
 
12:59 PM
You could implement a hash table the same way a dict does. :) See stackoverflow.com/q/327311/4014959
 
Yeah. It's one where I dont have any past experience about whether they would look more for idiomatic python, a demonstration of data structures or an evolving path through from the most simple dict (given that they'll have time constraints)
 
@roganjosh so is this for an actual interview?
 
Making a good hashing algorithm is hard. Making a hashing algorithm that passes an interviewer's five second sniff test is easy
 
@Kevin only if the interviewer isn't actually someone well versed in programming
 
"def hash_integer(x): return x % 256? I guess that's fine...?"
 
1:03 PM
@JonClements I'm imagining it in the context of an actual interview, but nothing lined up. I've messed up badly on this kind of thing in engineering interviews before, but I don't have a litmus test on a decent starting point if they said "build a hash table in python" that doesn't waste time
I've never done a whiteboard interview. For previous programming jobs they were set tasks as homework before the interview. Just trying to get a feel for it while reading :)
 
Personally, I have no idea what makes a good hash algorithm other than "even-ish distribution" and "try to make common values not hash to the same thing" and "...Something to do with locality?"
And there are light years between knowing these bullet points, and being able to determine whether on average a particular algorithm satisfies these bullet points, and being able to invent an algorithm from whole cloth that satisfies these bullet points
 
Didn't know you could make numerical literals more readable with underscores in between (since 3.6)
pre-commit black hook startled me a bit
 
@roganjosh depends who you might interview for
@roganjosh when I've done interviews, I've gone for the "looks promising - let's have a chat"
 
@JonClements I guess it's subjective really, it's just interesting to see that all you guys have defaulted to my custom hash function and not the linked list portion for solving collisions. That gives me a decent indication that the meat of the question is just acknowledging that part and the rest would be a discussion
 
all I'm looking for there is you as a person
 
1:12 PM
To answer the actual question, if I were asked to write a hash table with no other requirements (even if I ask point blank for more), then I'd use a nested list and the built-in hash(). If they want something more primitive, I'll put it in v2.0.
 
@Kevin The standard Python hash function isn't fantastic, but it is fast, and its collision avoidance & other properties are sufficient for its primary intended use: Python dicts & sets. There's some info about that in the dictobject.c source comments. There are other hash table algorithms that wouldn't work so well with the builtin hash, they'd need better collision avoidance & avalanching.
 
@roganjosh had I some decent £ behind me, I'd take you on as a padawan :p
when it comes to employment - it's about the person not always the skills
 
@Kevin thanks. That was my gut starting point because I thought starting with just suggesting dict comes across too smart :)
@JonClements that's very kind of you to say, thanks :)
 
a good employer will make resources necessary for you to train anyway
just remember it's you that gets through that first step and not your CV
 
The CV is required for step zero, though: "don't get auto-rejected by HR's automatic buzzword detector"
I've seen some people suggest putting every tech word you can think of at the bottom of your resume in 1 point font, the same color as the background
 
1:18 PM
true... but I've gone through CV's in my time and some are blatantly naff, some are brilliant and... some are just intruiging
 
The CV became a contentious issue with my sister, who recruits .NET developers. All the CVs there are a bombardment of tech and framework, but I'm not really a developer either
 
@roganjosh I'd hand wave the collision resolution by starting at "i + n*k, where n is number of misses" and then start babbling how a non-linear shift is better due to reasons but non-trivial though well-documented. Then flee through the nearest window, Adam West Batman style.
 
@MisterMiyagi well, it'd certainly make you an intriguing character :P
 
heh, I've walked out of a job interview once or twice :)
 
That probably makes some interesting stories...
 
1:28 PM
If all else fails, apply your interviewer repellent bat spray.
 
Sam
Hey guys I've got a little problem i cant seem to wrap my head around. If anyone has a few minutes spare I would appreciate the help repl.it/repls/MildSadEnvironments
^ little input and desired output stored in the link - in terms of my attempts, none of them worked so I saved the embarrassment of sharing :|
 
I'd expect a good coder to be able to describe a functional hash table at a white board, but I wouldn't expect their hash table to be state-of-the-art optimal. OTOH, I wouldn't expect anyone except a hashing expert to develop a good general purpose hash algorithm at a white board without access to relevant literature. If they had to create a hashing algorithm to go with their hash table, then I'd be satisfied with a simple algorithm that uses modulus.
 
@JonClements we're doing a Minecraft server again? Yeah, just let me know what to set up
 
Yesterday i attempted once again to acquire a Mojang account, and I failed again. But it turns out I can still play the game using my "legacy premium minecraft" credentials. bottom line: I can play, but I can't change account settings, such as my player skin
I guess I'll just continue to look like a character from a webcomic that stopped updating five years ago, forever
 
@Sam i dont really see a question there.
 
1:38 PM
@Kevin not sure I remember my login either
 
Sam
Ah shoot I've been toying around with that environment I didn't think it would have dynamically updated. Looks like the original post is gone. Let me get it back
 
"Combining sublists into lists iff the sublists share a common element" is a problem I've encountered before. I remember it being fairly tricky
 
Sam
I have some list of lists: x = [[0, 0, 1], [2, 3, 4], [5, 6, 7, 0], [8, 9, 10, 3]]
And what I want to achieve is basically look at each sublist and see if there are any column elements between any of them, if so merge them into single sub lists. The response from the above example would look like
y = [[0, 0, 1, 5, 6, 7, 0], [2, 3, 4, 8, 9, 10, 3]]
 
kevin's crystal ball is on point
but yeah, sounds painful
 
Sam
At least I'm not the only one who thinks this
 
1:42 PM
@davidism if you can setup an A record to point to 167.99.148.113
 
mc.sopython.com ok?
 
whatever you fancy
 
I think I did something like: Create a multidict that maps values to the index of each list that contains it. So you might have something like {0: [0, 2], 1: [0], 2: [1], ..}, for example. Create a graph, labeling each node with one of the indices, and draw edges between any nodes that belong in the same value in the multidict. Then compute the components/islands of that graph.
 
haven't configured the server yet and won't be until later today
(so no rush)
 
Linode domain manager won't let me add a cname to an ip address, it says it needs a valid hostname
 
1:46 PM
Trying to remember why I did this in the first place... If it was for an Advent of Code question, you could find a hundred implementations online :-)
Searching through five years worth of AoC problems might be more work than just writing a solution from scratch though
 
oh, duh, it's because you asked for an A record, not a CNAME
 
is there a way for me to pull in a commit from a remote branch to use in my current branch but not submit that commit when I push later?
 
It mystifies me that ten year olds can successfully set up minecraft servers
It's the "futzing with DOS configuration files in order to get DOOM to play with sound" of the modern generation
 
But with google
 
I know I can cherry pick the commit in and then "cherry pluck?" it out when I push. but the idea is I just want to use this commit code temporarily while I develop on this branch but not that the commit code be "part" of the branch when I push it. Is there any convenience git commands for something like that?
 
1:50 PM
actually to be fair, i already found the solution to that, there's an SO question on it. though now im just trying to understand the approach
 
@AlexBollbach Sounds a bit like squashing
 
FWIW, here are some pretty good intros to the topic of (non-crypto) hash design: ticki.github.io/blog/… & papa.bretmulvey.com/post/124027987928/hash-functions
 
devroom.io/2011/07/05/git-squash-your-latests-commits-into-one TLDR: rebase back up to the commit before the one you don't want
Or do you rebase one commit lower than that... Dang fencepost errors
Don't listen to me, listen to the article
 
thing is I want to use the commit to develop with. but I want that commit not to really be in the branch.
 
@roganjosh An advantage we didn't have, to be sure. But I had the advantage of a dad in the tech industry, so I'll call it even
I can't claim that I walked ten miles uphill in the snow to find the soundblaster manual
 
2:00 PM
wow, mcpublic / nerd.nu is still going, I was playing minecraft on their servers 10 years ago
they're on revision 25 of pve now
 
I had a grandfather that indulged me in computers but would occasionally phone up to say that he found a load of virus files in a "weird folder" - win32 and deleted them all... so stuff stopped working :P
My intro to computers was an equal measure of "why won't Monkey Island play?" And "what's grandad foobar'd this time?". It's a shame I didn't delve much more but I never really had any sense of what programming was as a kid tbh
 
@roganjosh my experience was similar in that, as a twelve year old, my first experience with programming was creating a web page that archived Mortal Combat fatalities. We moved and I lost interest and nearly two decades passed until I began to write code again.
 
2:15 PM
I wrote a couple VB scripts in elementary school but I don't think I wrote anything actually useful until I got a TI-83+ in high school and used it to automate my algebra homework
Essentially, it took me five years to learn what a loop is
I remember quite clearly that my earliest work would ask you your age and respond with "haha, you're old" if the number was above a particular threshold. John Carmack I was not.
 
I had a friend that use to program things on a graphing calculator as well, this would have been in middle school. I was mystified. Creating stuff with HTML is one thing but actually getting code to do something remained a mystery for a long time.
 
@JonClements one thing I haven't seen mentioned (maybe I missed it?) is that IR35 has been pushed back. Not sure if that affects your setup but that's a big change to go under the radar and affects our industry pretty heavily
 
I think everyone goes through a stage of assuming that programming is literal magic. Most people never exit that stage.
 
@Dodge lots of copy/paste for my MySpace :) I never questioned it, just made my profile super awesome
 
One thing I miss about that age of ignorance is the infinite potential of schoolyard rumors about video games. Beat the Elite Four 100 times with Magikarp, and you'll warp to a completely new map with 1000 new Pokemon, you say? Sounds totally plausible to 12 year old me, and not a complete waste of developer man hours for no profit
 
2:23 PM
The rumours are helped along greatly by Misingno being an actual thing, and clever cable disconnects legitimately cloning pokemon
 
And the extremely elaborate buffer overflow you can execute to get Mew without a cheat device. But I didn't hear about that one until college.
 
.. kevin'd
 
As an elder millennial I missed much of the Pokemon craze, sadly
 
fresh cbg everyone
@AndrasDeak that's regarding?
 
It appears that you were replying to a question that started with "Quick, since mods are asleep [...] help me with CSS"
 
2:36 PM
Ah ok. got it.
Noted. thanks @Kevin
@JonClements the point where am asking about is here bpaste.net/MCZA i just was looking to know if i can try/except one time without repeating the block
 
Sam
@Kevin Thanks i'll take a look :)
 
@MisterMiyagi like the following bpaste.net/MCZA
 
You can't jump back into a try block and make it pick up from where it left off
 
so am into the correct way?
 
I agree with Jon that it's prudent to specify which type of exceptions you're catching, but other than that, basically
 
2:43 PM
I'd probably move that to a helper that runs your expression and returns N/A otherwise.
 
If all of your assignment statements had identical structure, maybe you could do something with a for loop... But alas, the second try-catch is significantly different from the first and third
 
"a helper that runs your expression and returns N/A otherwise" may indeed be useful.
 
pretty sure all methods of passing multiple lines of code into a function will be messier than a couple of similar try...except statements
 
Perhaps a more look-before-you-leap option is possible
rather than div.find(...).text in a try-except to catch the AttributeError that occurs when find returns None, you could do (div.find(...) or foobar).text, where foobar is a div object you created earlier, whose text is "N/A"
 
2:51 PM
@Aran-Fey my personal sweetspot meter rates the break-even point of cases at around three-ish, give or take twenty.
 
I'm assuming you can create html nodes from nothing in BeautifulSoup. I don't actually know whether this is the case.
 
aka "good thing I don't do web scraping myself"
incidentally, I think monads would be very nice here. I blame the FP crowd for not selling them properly.
 
You can sort of create html docs in Beautiful soup, but probably better to use lxml's E factory
 
Here's another LBYL approach that admittedly does not cut down on line count:
for div in divs:
    if span := div.find("span", class_="DrName"):
        provider['Name'] = span.text
    else:
        provider['Name'] = "N/A"
    #etc
 
@MisterMiyagi negative seventeen sounds perfect
 
2:55 PM
Hmm, I wonder if provider['Name'] = span.text if (span := div.find("span", class_="DrName")) else "N/A" works... but perhaps it's a little too cute for production-quality code
 
for some reason, my head has a problem parsing ternary with asspression. which is strange, seeing how ternary is out of order anyways.
 
I'm 95% sure it's legal syntax, FWIW
 
give or take 20%?
 
Parting thought: I would do provider = {} inside the for loop, even though I'm pretty sure keeping it outside doesn't hurt anything, just because it makes more sense to me semantically.
 
@Kevin yes since it's not kind of append to list/tuple. so yes it can be under for loop.
 
3:05 PM
@MisterMiyagi My confidence levels can only meet or exceed 100% if an angel descends on a cloud blasting a trumpet and declaring how correct I am
(The angel in this case has somewhere between three and twenty three mouths, which makes simultaneous trumpet-playing/declarations easy)
 
I worry that when I use the term "semantically", people assume that it means "caring an unnecessary amount about pointless details" when I really mean it to mean "pertaining more to the intent of the algorithm than its behavior". I worry about this because, 99% of the time when an ordinary person says "semantics!", they do so in order to dismiss someone that's fretting about ostensibly unimportant implementation details
Putting provider = {} inside the loop doesn't change the algorithm's behavior, but it changes its meaning
 
at first, the OP said it's a list. then he said it's a dict. there was a miss
 
Perhaps I should give my audience the benefit of the doubt, because they're not ordinary people. Techies have a much better chance of being familiar with the syntax/semantics distinction than a random person on the street
 
the op don't care at all about any hints you provide. he just were looking to have the code works without paying attention to his wrongs
 
3:17 PM
@Kevin did you just argue semantics about semantics?
 
Recursive overthinking is extremely on brand for me
 
@AMC were asking him for providing MCVE and got an rude comment which is deleted :(
 
the ol' "shut up and go away if you're not going to help me"?
 
hey guys. How's the wfh going?
 
@Aran-Fey something like that
interesting to know, are you guys with higher rep. able to see deleted comments ?
 
3:23 PM
I prefer the "can't", not "won't", help variation. It's always better when they insinuate that you're arguing because you're too stupid to know the real problem
 
Yup. I think once you hit 10k, the only way to level up is to get a diamond
 
@inspectorG4dget adjusting to having Monty (my cat) sprawled all over me, no matter where I try to go. It's only for the heated blanket, though. He's fickle
 
oops! 25k gets you site analytics - the ability to run analytical queries on SO. But past that, you /will/ need to get more engaged on the platform a diamond
@roganjosh does Monty chew cables? that's pretty much the reason I've been apprehensive about getting adopting a cat
 
@roganjosh That instantly rustles my jimmies 110%
 
3:26 PM
@αԋɱҽԃαмєяιcαη here's more reading material: stackoverflow.com/help/privileges
 
@inspectorG4dget nah, I've never had a cat chew cables
 
@roganjosh not even on your setpoint device?
 
@roganjosh Hmm, I usually experience the opposite. Like when you're trying to tell an OP that they need to provide an MCVE - you literally cannot help them until they do
(but they make it sound like you won't because... you're just an awful person or something)
 
@inspectorG4dget still a big road :P
 
I try to preclude the possibility of OPs calling me dumb by playing dumb from message #1. "Please, explain further the question so that I, your simple servant, can comprehend"
"I don't understand" is polite speak for "you didn't explain it clearly enough"
 
3:31 PM
@inspectorG4dget no cables, ever. And this is 30 years of having cats
 
I once had a guy ask me for help with his homework in a different programming language because it was "like python" (AFAICT, the similarity was for-loops); and then yelled at me for not "wanting" to do his homeswork for him
@roganjosh damn! I'm somewhat jealous :)
 
@inspectorG4dget Cats are more into the scratching walls and achieving world dominance business.
 
:d Meow Meow time
 
@MisterMiyagi I thought cutting ties to your mouse was how they enslaved you to start with
 
no, the big one just sleeps on my hand if I use the mouse too much.
it's like an inverted belly rub.
 
3:33 PM
could you guys help me out to understand this part of cipher/data logic in that answer
 
Yeah, scratching everything in sight if they get bored is a big thing, but not biting cables. Rabbits, on the other hand...
 
@Aran-Fey Sometimes, I get the impression we're asking for MCVEs just because. "Stop pestering me, MCVE lawyer, and start helping me!"
 
@Kevin ha, I haven't tried that approach. I can't handle jimmies over 100% russled unless an angel descends on a cloud with at least 27 mouths playing trumpets to declare that I'm right. I just have to leave.
 
70% of the time when I ask for an MCVE, it turns out that I could have answered their question by guessing what they were really asking for based on their original post. But I've been burned too may times on the other 30% of cases where I answer and the OP replies with "no, this isn't what I wanted at all"
Not asking for an MCVE is essentially a voluntary 30% pay cut
 
Not to mention that MCVE-less questions don't belong on SO. Or maybe they do nowadays. Who knows
 
3:40 PM
@inspectorG4dget conclusive proof of cable safety. Note that my legs have to bend as he treats the bed as a Risk board
 
@Aran-Fey MCVE-less debugging questions don't, because we only accept answerable question. If a debugging question is answerable it contained an MCVE by definition.
 
@αԋɱҽԃαмєяιcαη The cipher part is simply taking a sequence of one byte ints, and combining successive pairs into two byte ints.
 
@Kevin There are the cases where you can answer the question, but the OP doesn't realise because they haven't clearly defined the problem to themselves.
 
Looks like the data part is a fairly simple XOR cipher. The key is shorter than the ciphertext, so it uses modulus to "loop back around" once i exceeds the length of key
Oops, when I said "combining successive pairs into two byte ints" I meant "combining successive pairs into unicode characters that are each two bytes wide"
 
Hey guys, I need help. Is it possible to create an array like we create a list? Por example: to create a list we use "[]" and we can put how many elements we want in that list. Is it possible to do the same in an array without specifing the number of rows and columns?
 
3:44 PM
I missed the chr() call the first time around
Kind of pointless to convert to unicode there, since they're calling ord in the data section, but w/e
 
@JoãoJúlio a numpy array?
 
yes!
 
It is possible but ill-advised
 
It is? Possible, I mean?
 
You can append to a numpy array
 
3:46 PM
@JoãoJúlio You can do np.array([2, 4, 3]) if that's what you mean
@roganjosh you really can't
 
Are you going for the technical angle of it being copied?
 
yes, very much
It's markedly a different array. Same as creating a string with varying length by using += on it.
 
Because numpy.append is a thing, it's just terrible.
 
yes
 
A minor miracle: OP does a reversal after accusing me of being rude and not wanting to help. physics.stackexchange.com/questions/536998/… I suppose that initial comment of mine could sound condescending, but that wasn't my intention.
 
3:48 PM
Ok, then can we meet half way? :) I was gonna go to that, we just started at opposite ends of the spectrum :)
 
but it's very much unclear what João meant
 
@AndrasDeak sorry, my question wasn't very well written. What I mean is, if it is possible to create a empty array and start appending elements like a list?
 
@JoãoJúlio don't do this. If you don't know the size beforehand then you should use a list. If you know the final size beforehand then you can initiative an array with the correct dimensions. You also need to know the datatype beforehand to initialise the array properly
 
cool. the answer is, never ever do that, it's a horrible idea in every sense of the word, since an array has to allocate a memory location, then reallocate the entire array to a new memory location for every single item added.
 
@JoãoJúlio OK, so the answer is what we discussed above: you can but you shouldn't. Arrays have fixed size, so when you "append" you're really allocating a contiguous block of new memory for a completely new array. The worst example is appending to an array in a loop. It works, but it has terrible performance due to the high memory overhead. What you do is collect the parts in a python list, and convert to an array once at the end.
 
3:52 PM
looks like we've found that "half way" point you mentioned roganjosh. :P
evening cbg!
 
This raises the question for me, though, of why you want to do this?
Because you could have misconceptions here. Will each sub-array be of the same length?
Cbg Paritosh :)
 
@JoãoJúlio Stack Overflow co-founder Joel Spolsky calls that sort of thing a Shlemiel the Painter algorithm
 
@roganjosh I'm impressed. But yes, please bend knees and protect... the motherland
 
I've been annoyingly afflicted by a Shlemiel the Painter problem lately. I've been working through a 300-item youtube playlist on my phone. The mobile interface has no obvious way to save your place, so every day I have to scroll further and further through a slowly loading playlist, starting from the top every time
I have a cynical feeling that there is a way to save my place... But only if I download the app. I hate downloading apps for things that could easily be a website.
 
Kevin'd on my response to Kevin :/
 
3:58 PM
I'm taking a class of Data Structures and Algoritms, and we have an exercise that the main goal is to implement a Stack algoritm but instead of using a list to put all the elements of that stack, we want to use an array. So that's why I was asking if it is possible to create an empty array like we create an empty list.
 
There is no way that the app add would be so annoying by accident. I think it'll be very deliberate
 
I use the YouTube app on an Android phone. It's ok, but I'm not sure if it has that functionality.
 
If my jimmies rustle any further, then I'll probably try to figure out how to view the desktop site on my phone. You can bookmark your place in a playlist on the desktop site.
 
I think youtube deliberately degrades the performance and interactions of its mobile site
and i don't even have a tinfoil hat on!
 
@JoãoJúlio maybe a deque?
 
3:59 PM
can you elaborate on "we want to use an array" part?
as in, whose idea is this, yours or your teacher's?
 
00:00 - 16:0016:00 - 23:00

« first day (3442 days earlier)      last day (1499 days later) »