« first day (3969 days earlier)      last day (994 days later) » 

12:05 AM
@SAJW does hashing a password multiple times increase the security in the first place? Also, when you verify the password, how will you know how many times to hash the input password if the number of times is variable?
 
 
2 hours later…
1:46 AM
cbg
 
cbg
 
hows your pandas canonical going?
 
Ah almost done!
It's about melt
Will post later (maybe a few hours)!
Just so that more people online...
 
for rep?
 
Just for more viewers and maybe more people can suggest edits
 
1:50 AM
fwiw, few hours here will be morning and no one I know would use SO on a saturday morning
 
@python_user Ah
 
good luck with that
 
yeap!
 
2:15 AM
@python_user I'm done with the cannonical...
Not posting yet
maybe a bit later
 
2:59 AM
friday eve / weekend now, you would have more traffic on monday I guess
 
Saved matplotlib plots don't blit?
I recently found this out
 
 
3 hours later…
5:33 AM
@python_user the point of a canonical isn't to get rep; we're supposed to be trying to build a repository of information that's useful to others; rep is just a way of gamifying the process and @U12-Forward seems to have missed that memo.
@StarMan This needs a lot more context. I'm assuming pygame? It's possible that the images are cached when you start
@SAJW no, because you have to store the number of hash cycles with the password or you yourself won't be able to make use of it
@Code-Apprentice I assume they're talking about the rounds argument of this (or equivalent)
 
@roganjosh got it, a part of me still thinks like a rep hunter :p
 
5:56 AM
@roganjosh you have to store the number of hash cycles with the password hash*. Bad roganjosh.
 
I guys I am back
Gonna post now
 
Welcome Back
 
@roganjosh Yeah I am not necessarily doing this for rep, I am also almost reaching the rep cap.
 
Funny you should keep talking about everything in the context of rep anyway
@U12-Forward Enough of this. If you have something you think is a meaningful contribution to the site, just post it. You don't need to keep advertising this kind of stuff here
 
@roganjosh I know.
 
6:07 AM
If you know, why do you keep doing it?
 
@roganjosh Sorry
 
6:27 AM
rbrb
 
 
1 hour later…
7:35 AM
cbg. got a code organization question for you all.
top-level
  --some_folder (src? something else? i dunno)
    --folder1
      notebook1.ipynb
      py1.py
      py-common1.py
    --folder2
      notebook2.ipynb # i want this to be able to access the file in sibling folder but *also* be able to be run by opening the notebook directly
      py2.py
      py-common2.py
  readme.txt
  requirements.txt
My question is like this: essentially i want the convenience of being able to run files directly from their working directory while also being able to access imports from sibling folders. As is, if you use inits and write imports that way, the direct running of notebooks doesn't work. What is a good compromise that can get me what i want, or be as close to what i want.
I currently know two ways that let me keep this structure as is, but im willing to modify the structure a bit if it gets me something better. One option is to use inits, and change cwd in the notebooks (to top level) before running anything. Another is to keep imports without inits, and use sys.path.append to append the sibling folder. It's my understanding that both options are frowned upon
So anything better? perhaps a restructure that lets me follow best practices and still get me what i want, or something else
 
.ipynb embedded in a project? Get out!
I can only give hand-waving suggestions here. You're probably going to need to package this project, but I don't know exactly how you tell Jupyter that
 
Do you ever want to import the notebooks or only execute them?
(Can notebooks be imported?)
 
notebooks cant be imported in any sane manner
so no, they'll never be imported.
 
I don't think they can (or, I've not seen it) but they never played ball with imports when I tried it
 
@roganjosh hehe. im afraid it's basically been proven impossible to get my teammates to not use notebooks. it's just too convenient and comfortable for them. All im trying to do now is reduce my own headaches. but for the sake of discussion, let's say this is a critical part of the requirement that can't be altered
For what it's worth, i do agree with the convenience of notebooks, so it's not like i can even disagree with it
 
7:45 AM
Can you first simplify this by putting the notebooks into their own top-level directory? I don't use them, but I often have an "eda" (exploratory data analysis) directory on the top level
 
In that case I would turn folder1 and folder2 into sub-packages of some_folder. Basically, add an __init__.py to every folder, install some_folder, and use imports like from some_folder.folder1.py1 import whatever
 
i see. and yeah some restructure will be just fine.
 
I have a lot to say about the refactor here, and I don't know how much of it is just personal opinion vs. actual good practice :/
 
top-level
  --eda folder
    notebook1.ipynb
	notebook2.ipynb # but how would this import the sibling py files
  --some_folder (src? something else? i dunno)
    --folder1
      py1.py
      py-common1.py
    --folder2
      py2.py
      py-common2.py
  readme.txt
  requirements.txt
This is your suggestion right roganjosh?
 
FWIW I've become a proponent of the src/ paradigm because it does put my mind at ease that I really am using the installed package and not local imports
@ParitoshSingh I think so. Give me a couple of mins to sense-check
 
7:49 AM
so my mouse isn't working again - arhghghgh
 
@Aran-Fey oh. that could work actually. just installing it would help.
 
@Aran-Fey I should probably add that the advantage of this solution is that it lets you keep the current file structure, but it's not necessarily a good idea to do that. Mixing executable files with importable files is a bit of an odd design, and depending on how this is used, might lead to some unexpected behavior.
 
@ParitoshSingh yes. Then you can add a setup.py file, and install it with the -e flag
 
@JonClements how's your vim skills. :P
 
not that I chased it around the floor wagging my tail and ate it or anything burps (and looks innocent)
@ParitoshSingh pretty much :q! :p
heh... now I'm super confused - unplugged it, plugged it back in and now it works again - wtf
 
7:54 AM
have you tried turning it off and on again ;)
 
It's far less baffling than why Apple decided that the charging point of a wireless mouse should be on the bottom
 
rofl, that's pretty amusing
 
because form > function, duh
 
@roganjosh oh - seen tweets with images of that
 
also.. im almost afraid to ask... is their charging port a lightning cable? :P
 
7:56 AM
@ParitoshSingh soon enough you'll need to be going at exactly 88mph and have a clock tower near by...
 
make sure to set the correct date before doing that!
 
I'm kinda ashamed to say that I made my company buy me the mouse and I only used it for 1 day. It's... yeah. In my defence, they've forced me to use a Mac
@ParitoshSingh we also had to buy peripherals to make anything connect. I have an adapter (not Apple) to plug in a USB. I'll have to think about the ridiculous scenario where I have 3 different connectors in a chain. What was I doing that day...? <ponders>
 
8:14 AM
boy oh boy... I so wanna do destinationstartrek.com
(the Admiral package - but it'd completely yam up my finances and getting on the property ladder - but it's such a sweet temptress...)
 
"Please note: there will be a £1 charge per order" hahaha. I guess the £2999 didn't quite cover it all
That's set me off
 
if they announce Patrick Stewart is going to be there though.. I'd break
@roganjosh laurel
or just pay for a day entry and autograph maybe
wow... okay.. so Kate Mulgrew is £65 for an autograph? Yeah... not doing that approach then
 
8:34 AM
But... it's Janeway..!
 
maybe... but spending 5 seconds putting your signature on a bit of something...
oh wait... there's a remote autograph service - you can send in an item and have it signed and have it sent back
got a little Voyager model sitting in a box somewhere... might be worth having that signed by "Janeway"
 
Hahaha, so you pay for a docusign?
This racket just gets better :P
 
8:50 AM
apparently so :)
not a fan of signatures anyway... but wow... wouldn't it be so awesome to have a photo with Sir Patrick or Shatner, and signed?
right - gotta run for a bit - you still up for some duking today @roganjosh?
 
If we are, it'll have to be now-ish I think?
 
do people still sell autographed things on ebay for a higher price?
 
<only just realised that I deleted WhatsApp months ago>
 
this slightly reminds of me a reddit post where they sell epic games accounts with "GTA 5" (which was free)
 
I mean, I can't just realise what I actually did, but it can come back to bite.
 
9:05 AM
hii guys
 
hello
 
buddy i want to master web scraping
i know the basics and want to be a professional
do you have any idea
 
I think there is one user who does web scraping for a job, not sure, I might be wrong, maybe if they see you could get relevant responses
 
when he comes online
 
@IswarChand There is no schedule for anyone. I can also sense that you have a misunderstanding about this chat
In other words; you're not waiting on a particular person and this isn't a substitute for a tutorial or research. Your question will be answered if and/or when someone feels they want to
 
9:15 AM
i this this allows us to talk on problem related to the chat room name
yup i got it
actually i was scraping a web page using selenium but it is too slow and finding hard to get proper and professional knowledge
like any book or tutorial so that i could feel confident
optimized code
 
9:41 AM
optimized scraping feels like an oxymoron :/
 
raf
Any atom user here? Looking for a updated answer of this question:
https://stackoverflow.com/q/29879947/7673979
14
Q: how to sync Packages and settings for multiple computer in Github Atom Editor

Shan KhanI have installed Github Atom Editor in my Personal PC and Office PC. I want to sync the settings and packages to my dropbox account so when i log in the office PC it automatically download or update all the packages and settings to my Home PC

 
How is this related to python, @raf?
 
9:57 AM
@MisterMiyagi i mean as the project scale increases ,the script get more error prone starts misbehaving
 
raf
@roganjosh sorry, I didn't understand where to ask about it
 
It's not disruptive so I'll leave it be for now
 
is there any machine learning library for web scraping
to make things easier for large scale projects
 
@IswarChand If you are just looking for building a large project that happens to do web scraping, you should look for general guides on building robust software. Error handling and robust software isn't specific to web scraping.
 
ok ,checking
 
11:08 AM
@SAJW The old functions in hashlib are still useful, but it's better to avoid md5 & sha1 for new projects. But say if you want to download a file from some old archive that only supplies md5 &/or sha1 hashes. Then you need those functions to validate that the file's not corrupt. Also, md5 & sha1 are still safe to use in things like HMAC. And of course, you can still use them for things where security isn't an issue, eg searching for file duplicates. Blake2b tends to be much faster, though.
 
11:46 AM
@SAJW Here's a post on using a secret number of iterations for passwords: crypto.stackexchange.com/q/60860 Basically, there's little benefit in having a variable / secret iteration count. If you want more security, it's easier to just use a longer salt.
 
 
1 hour later…
12:58 PM
@PM2Ring hi :)
 
 
1 hour later…
2:01 PM
That may or may not be a dumb question. But can I install scrypt only for one venv?
oh, I oversaw it is part of hashlib...
 
 
1 hour later…
3:07 PM
@roganjosh No. Matplotlib Funcanimation
 
 
2 hours later…
4:42 PM
@IswarChand there are lots of articles and videos you can check out. why dont you watch/read them, and then try writing your own?
 
5:17 PM
I feel like there should be at least 1 or 2 years between those two
 
@roganjosh How did you have 3 different connectors in a chain? Mouse, printer, external SSD, phone charger?
 
 
3 hours later…
8:03 PM
Is there a prettier way to check if a generator is empty than any(True for _ in gen)?
 
could catch a stop iteration if you wanted, or use next with a sentinel. dunno if you'd find either of those prettier
if next(gen, sentinel) is sentinel: that kind of deal might be cleaner perhaps?
 
Hmm. I think the any is more readable than next
 
not list(gen)?
more destructive though
 
8:18 PM
I want to evaluate as little as possible because it's a bit expensive (it does date/time math)
 
I see
I guess mine is also unsafe for infinite generators
 
It's a pity that generators don't have a peek method.
 
peekable generators have come up before, I think someone had something along those lines
 
more-itertools has that I think
 
yeah, that popped up in my chat search
I can't find anything better so it must have been that
 
8:29 PM
how would a peek work? i suppose you could tee and iterate on one once?
 
> On Windows, this function always works, since there’s no window manager policy involved.
The Gtk devs lie as naturally as they breathe
 
or is it something more fundamental, like generators that support peek always have to store what their next item would be somewhere upfront
 
@Aran-Fey This brings me back to high-school biology tests with "relational analysis". Claim is "A, therefore B". You have to tell if this is +++, ++-, +-, -+, or -- in terms of truth value...
 
It's straightforward to do with an iterable class. I guess you could do it with a generator function by storing the next value as a function attribute.
 
@ParitoshSingh the tricky part is peeking into arbitrary generators, so yeah
 
8:33 PM
mm yeah, makes sense
 
I think y'all are overthinking it. Just pop off the next element and cache it
 
That's pretty much what a tee would do, right?
 
@Aran-Fey the problem i see with this, is what if i ran peek multiple times. you'd need to make sure what's the actual state the thing was in, instead of just pop + cache every time peek was ran
so you do need logic to handle that properly
 
@AndrasDeak Tbh I'm not awake enough to figure out how you'd implement that with tee. Seems overengineered to me
Just do something like this
 
yep, that should do the trick
 
8:55 PM
from itertools import tee

class PeekableIter:
    def __init__(self, itr):
        self._itr = itr

    def __iter__(self):
        return self._itr

    def __next__(self):
        return next(self._itr)

    def peek(self):
        self._itr, copy = tee(self._itr)
        return next(copy)
something like that
it's also too late for me to consider potential overhead from many peeks
alternatively you could tee in __init__, but then you have to advance the peeked one when you advance the original
 
def peekable(itr):
    def gen():
        for x in itr:
            gen.peek = x
            yield x
    return gen
 
@AndrasDeak Oh, that's elegant. I think tee internally optimizes repeated tees, so there shouldn't be much overhead
 
 
3 hours later…
11:52 PM
@PM2Ring what do you want to peek? I don't understand.
 

« first day (3969 days earlier)      last day (994 days later) »