« first day (3049 days earlier)      last day (2124 days later) » 

00:24
Yeah im not like exclusively interested in crypto but i wanna learn as much as i can about how to do things
on my own
i mean not relying libs and stuff
or people
ahaha
but i do have a question
i'll likely use this either way but is this secure in the slightest
It's not hashed on purpose
but I just mean 16 digit binary strings as salt
whoops password2 is supposed to say password
how does that verify anything?
is choice from random?
whoops
import string
from random import *
yes choice is random
a random choice of characters could (theoretically) choose the same exact string 100000000 times in a row
00:30
but it doesnt
so...how does choosing random characters 2^16 times guarantee that you'll see one of the possibilities
you want to look at all permutations of 16 characters. not randomly choose them
then what would you reccomend? This works atleast like the 10 times i tried
@HunterGuimont ok well thats besides the point...you could choose the same string 5 times, and thus it will terminate without checking every possible salt
but of course it is sure to fail eventually
i just said what to do ^
1 min ago, by Alexander Reynolds
you want to look at all permutations of 16 characters. not randomly choose them
00:32
well yes but im not sure how
from itertools import permutations
try googling suggestions :)
yes thank you, im reading the documentation now
00:54
i can't get it to work
 
4 hours later…
 
1 hour later…
06:24
closed
06:49
times=[pd.to_datetime(i) for i in '09:14:00','10:15:00','11:15:00','12:15:00','13:15:00','14:15:00','15:15:00', '15:30:00']
how do i create a minutely HH:MM:SS instead of hard coding time like above
07:40
@shad0w_wa1k3r Thank you.
 
1 hour later…
08:57
Just seen a question from a new member closed in one minute with no comment other than the "put on hold" message. Is this common? The question could have been rescued ... stackoverflow.com/questions/54782276/…
Seems a bit intimidating for someone who doesn't know how SO works.
@holdenweb a comment appeared explaining what is wrong with the question. If OP improves on it, I will be more than happy to vote to reopen it. But I agree, it is prudent to comment on why the question is being closed and how to improve it, if possible.
09:13
@holdenweb bad questions should be closed fast (and, ideally, reopened when in good shape). People should leave comments, but it's not a requirement. After all, the potential problems with the question are listed in the yellow box
I notice a...um, make me feel strange question, stackoverflow.com/questions/54781749/…
Playing with tensorflow, but not even try what's happening for np.sqrt(2.0/9/64)...seriously
¯\_(ツ)_/¯
09:34
On my profile page SO have been advertising the same Senior Javascript Developer opening to me for about six months now. I wonder if they know something I don't?
@holdenweb what vaultah said. Putting on hold is part of rescuing. If OP edits the question is put into the reopen review queue.
And I often leave tabs open with salvageable questions I close
@pythonRcpp pd.datetime has a lot of helper methods, including ones that computes time ranges.
09:52
Hi,

Guys any idea of implementing polymer 3 webcomponents in a django project

stackoverflow.com/questions/54781173/use-polymer3-with-django
Got stuck by not able to import 3rd party elements due to relative path issue
10:41
with zipfile.ZipFile(pfile) as f:
        #next(f)
        for line in f:
          print "line read from zipfile"
is this not a a proper way to read a .zip file
i want to iterate over each line in somefile.zip
10:52
@pythonRcpp well does it work or not?
or let me rephrase: what happens, and what do you expect to happen based on the documentation?
i get TypeError: 'ZipFile' object is not iterable
11:29
@pythonRcpp If you read the docs, it says you're not doing it right - docs.python.org/3/library/zipfile.html#zipfile.ZipFile.open It gives you an object that you need to .open & then .read
12:14
somefile.zip doesn't have lines it it, it has zipped files in it. This documentation shows how to read a single file from the archive.
12:46
Isn't that the exact same link shadow posted?
Yeah, but he explained it better correctly :-p (I completely skipped over the "it has zipped files in it", and said "gives you an object" instead of the plural thing)
Ah, OK. I thought I missed something
13:04
No, it was me that missed the original link, otherwise I wouldn't have needed to repeat it!
13:28
:)
 
2 hours later…
m8_
m8_
15:05
Morning! I'm trying to make a derived column using df['Count'] = df.shape[1] - df.count(axis=1), but I only want this to include specific columns by name. So right now it will calculate all 4 columns in my df, but let's say I only want to include two specific columns. Is that possible?
Slice the dataframe in the last term?
\o cbg
m8_
m8_
Hm, ok. My initial thought was to split off the columns of interest in a new df and run the shape - count line on the new df, then add the derived column back. Not sure if that's smart though
Yeah that worked and wasn't too verbose...I think
15:24
what word best describes going up the call stack when traveling a bst using recursion
@davidism Closed
@TGrif Is there any difference between Raw and Unsecured Project of flask AND express? Regardless of making it secure by my self — Hossein Asmand 8 hours ago
Huh? Which is more secure, my unlocked house, or my neighbour's unlocked house?
@Rick Why a BST in particular? I'd usually just say "when the recursive call returns" or similar. Unless I'm misunderstanding your question.
15:44
I'm trying to describe the process of checking if a BST is valid using recursion. I'm having a hard time describing how we compare the right node to the parent value of the bifurcated frame
I need to be able to explain it as a property of the graph and I'm having a hard time doing that.
the left and right are easy enough. we go to the furthest left node to get our lower bound value, but in visiting every subsequent adjacent element and comparing it to the parent that I am having a hard time explaining
if this was a list I could simply say a successive list of values
16:38
figured it out.
17:30
hello I need some advice
is it better to use flask-sqlalchemy or just sqlalchemy and flask separately?
cabbage
flask-sqlalchemy is more convenient, and it does let you use the sqlalchemy stuff as well, if you choose.
oh...there's a package named flask-sqlalchemy? TIL
ok so I am building a rest api, but it's not only to support database operations but also processing operations. What I mean by that is the payload on the http requests to the live route act as inputs to some functions whose output needs to be put into the database. I plan on achieving this by having the api offload the request into a message queue and it can be handled by a dedicated processing program which will do the sql write once done. However I still want users to be able to get data
from the db route
my routes are api/v1/db/ and api/v1/live
17:43
I am working on django project . I want to take input from user and process it instead of storing in database. How can I do this
17:58
@ManishGupta You may want to read up on Django documentation or at least take a look at the tutorial, then you'll know that it's possible & pretty basic Django functionality.
@ex080 And your question is?
@ManishGupta How familiar are you with Django?
18:13
my question is should I use flask-sqlalchemy on the flask side and a separate instance of sqlalchemy for other apps in my stack that may want to crud from db
@ex080 I'm no Flask expert, but it's your choice. If you think flask-sqlalchemy will be better in flask app, then use that, otherwise continue using just sqlalchemy.
If you end up using both (sqlalchemy & flask-sqlalchemy) then you may have to keep a tab on the correct versions to use
I don't want to make a recommendation due to lack of experience with sqlalchemy & flask, but in your case, I might stick with vanilla sqlalchemy, since you'll be using just that for other CRUD operations, and it's better to not have dependency issues & / or separate code for CRUD in the flask app & other places.
@Code-Apprentice started couple of days ago
@shad0w_wa1k3r ok that's solid advice, i'll start with sqlalchemy for now and see where it takes me
good luck
18:37
cbg
@ex080 shadow walker nailed it, flask is very great about not forcing you to use any tool for integration, a minimalist approach to frameworks so to speak. You can stick with your existing sqlalchemy code just fine.
@ManishGupta you don't have to use a database in your django app. I agree with the earlier comment that you read the documentation and work through the tutorial.
18:53
@ParitoshSingh cbg. thanks for the advice I will do just that
cbg
urllib3 seems to have a delay on the first connection. All connections afterwards are quick/instant. Can anyone explain why or how to get around this?

Searching finds: https://stackoverflow.com/questions/45783655/first-https-request-takes-much-more-time-than-the-rest which gives info for requests but the same work arounds dont work in urllib3
19:11
Are you making multiple connections to the same host? I assume urrlib3 internally holds a connection to the server open after the initial request
Anybody know of any good first-person text-based game I can use as a reference? The reference doesn't have to be coded in python.
19:47
My latest safari into the internet outside of SO has made me realize just how easy it is to have a productive and useful discussion on SO, whereas trying to have a discussion on other parts of the internet usually just turns into a flame war. So shoutout to the SO community for being mature. Crazy how a lot of people call us "elitist" and "toxic", innit?
I dont even know what a first person text based game is
Aran u r right
I joined a discord group on react and JS and they were super toxic
so I came back here
it's a nice place we have here, all things considered :)
m8_
m8_
Hey all, I have two dataframes. I am trying to count how many times a specific value appears in df2 for all IDs in df1. df2 can have duplicate IDs. Can someone help with a generic formula?
I've been trying to use join and groupby, but no dice
something like this new_df = df1.join(df2.groupby(['ID', 'Value']).size().rename('Count'), on='ID')
but it gives an error because they are not equal lengths
In my experience, discussions on SO mostly boil down to one experienced user correcting less experienced (but louder) users
Or arguments between inexperienced users
Well, most of the time it goes like "this part of your answer is wrong" "oh yeah, you're right, thanks"
doesn't even qualify as a discussion on SO I guess
19:53
Yeah, none of those are discussions though
recently, my attempts to correct people have earned me responses like "you just want to start a petty argument" "you're a troll" etc
@Aran-Fey yes the connections are all to the same server but they close the connection after each flow.
hmm, no clue what the problem could be, then :(
np, thanks
@Aran-Fey hey, nice to see you
19:59
Hello neighbor, nice to see you too :)
20:21
Is there a quick way to write constructors in classses?
I hate writing self.x = x
If you're in 3.7, there's dataclasses. If not, attrs might be up your alley
ill keep that in mind, I was looking more for a ide side shortcut or syntax sugar
20:44
@ex080 Well, you could do self.__dict__.update(**kwargs), but that's generally considered to be bad style. See stackoverflow.com/q/9728243/4014959
21:25
cabbages

« first day (3049 days earlier)      last day (2124 days later) »