« first day (2821 days earlier)      last day (2142 days later) » 

7:00 AM
Re-cbg everyone
 
7:25 AM
Cbg @Simon
 
7:55 AM
cbg
 
Evening folks
 
8:16 AM
@Cosmo Cbg
 
user10043886
8:35 AM
Hi, what is the use of & in np.arange(len(statevector)) & mask where mask is any natural number and statevector is np array [1,2,3,4,5]?
 
probably elementwise binary and (for bools it would be elementwise logical and for sure)
Compare your result with [num&mask for num in range(6)] to be sure
 
user10043886
thanks
 
@Simon sup?
 
8:52 AM
Shopping :|
 
RIP
 
9:11 AM
Hi, I'm thinking of writing a module that will hopefully make it's way to PyPI (it's my first time writing such a module). I'm definitely going to be using 3.x, but was wondering if there was any advice on minor version to target to reach a wide audience. Should I write it for the lowest version of 3.x that has all the features I need in, or should I write it for 3.6/3.7 being the latest version of python?
 
What changes in your module would target 3.6/3.7 at the exclusion of lower versions?
Things like relying on dictionary order and f strings?
 
every other line is breakpoint() ;)
 
Well that definitely helps us narrow down the options to a definitive answer :)
@AndrasDeak very soon we could find ourselves debating whether ass expressions might narrow down the audience
 
I should probably start calling them asspressions for short
 
I definitely prefer the former :)
list_ass_split came back to me again this morning. Have you seen the video of Richard Dawkins reading his "fanmail"?
 
9:25 AM
nope
 
I'm not going to link it because it's full of profanity but it's hilarious. You can find it easy enough on youtube. One of the comments: "Your famed intelligence is nothing but a fart of god"
 
lol :D
I'll look it up sometime, thanks
 
9:38 AM
I prefer f strings for formatting, but can deal with the more standard .format. So would good advice be to write it and see which is the earliest version I can get it and it's depenencies to run on?
 
mm, I can only give my personal opinion on this but using features that deliberately restrict the audience for the sake of some syntactic convenience is not worth it.
 
9:59 AM
That makes sense
 
10:25 AM
it's not just syntactic convenience
 
For f strings?
 
yup
 
Well they are apparently faster, but without a tight loop what am I missing?
 
you're missing that "apparently faster" == "not just syntactic convenience"
 
ok, I'll take that, but it's not a module-defining feature
 
10:27 AM
no, it isn't :)
 
I should have been more explicit, I guess, considering I'm the one usually banging on about speed :P
 
yup :P
 
10:48 AM
python seriously needs a string method that strips a certain substring from the start/end. I don't want to know how many bugs my code has because I used some_string.rstrip(whatever) instead of if some_string.endswith(whatever): some_string = some_string[:-len(whatever)]
 
some_string.rsplit(whatever,1)[0]
not exactly clear, though
 
I'm curious what problems you're trying to solve that leads to that issue?
Or put differently, I don't think I encounter this issue much, if ever, in my line of work
 
I'm working on a script for a card game and I'm implementing a Card.from_name method. If the card name ends with +, you get the upgraded version of the card returned. I coded it like this, and it was wrong:
is_upgrade = name.endswith('+')
name = name.rstrip('+')
The user enters Card.from_name('Axe Fighter++++++++++++') and my code is like "sure, that card exists"
 
Hello, is here anyone who can guide me to the right direction? I am using (or at least trying to use) docs.python.org/2/library/socketserver.html to have a TCP Server for Flash clients to communicate with Django. Is there a chance to get the requesting user identity, just like we do in consumers (websocket) with @channel_session_user_from_http ?
 
@Aran-Fey yeah, ok, that makes sense :)
 
11:07 AM
stackoverflow.com/questions/51222063/… the question doesn't make sense and already had one nonsensical answer.
 
An OP earlier pinged Martijn out of the blue like "I'm sure you know this, please take a look at my question". I asked them to stop pinging people for attention, and they told me to stop trying to censor them. I don't get how you can even confuse common courtesy with censorship.
 
Are you suggesting I shouldn't have pinged you?
 
No no, don't worry :)
It was just something I wanted to share because it honestly blew my mind
 
Oh, well surprise of humanity is something of a banality these days :P
 
11:27 AM
hi
I have an elementary question:D
 
Hi, go for it
 
I have a list like
A= [['a','b'],['c','d']
I want to assign its first column to another list
I used this code
svm_x = svm_data[:][0]
but it gives me the first row of my list
 
These are definitely lists and not numpy arrays?
 
I want it to be like B = ['a','c']
yes they are lists
 
So, you don't want to "assign" values, you want to take the first item from each sublist?
new_list = [item[0] for item in original_list]
 
11:32 AM
oh thanks
 
Well, does that give your expected output?
It's very possible I'm misunderstanding your intention, so check the output first :)
svm_x = svm_data[:][0] is a mix of numpy thinking and python, but not useful in either. svm_data[:] basically copies the list contents, and then you take the [0] index of that result.
 
@Aran-Fey flag and ignore (this is not to say I assume you did anything else)
 
@roganjosh yes it is ok
 
nevermind, roganjosh already covered it
bottom line is that nested lists are not arrays/matrices
 
:)
 
11:43 AM
nested lists can also bite you with shallow copies if you mutate them, so 1. watch out, 2. consider using numpy if you want to handle those nested lists as multidimensional arrays
 
11:53 AM
@AndrasDeak Meh. He wasn't rude, just blockheaded.
 
"no longer needed"
 
stackoverflow.com/questions/51222818/… here I am describing my problem, just in case someone can spit a word about it guys.. :/
 
note to others: this ^ is fine because they asked here first
 
@AndrasDeak trust me, nothing is fine when googling since March :P
 
heh
you could've picked up flask by now ;)
 
12:06 PM
What are the odds of not finding a single solution, freaking worldwide... I have to start chasing the lottery for being in this situation -_-
 
if there's any chance that solutions for python 3 would differ it's worth adding to your question
 
I hope this will make 'em stop bouncing.. ty
 
I don't know any django (or web dev for that matter) but is it not possible to just get in there and print everything about self in the policy-file-request case? What are its attributes, anything where such info may hide
 
@CDoc certainly I look at that question and know I can't answer it. But is there a way to take it out of your specific problem and make it more general? You clearly know what you're doing but it might be making it too niche
 
@roganjosh I don't wanna play "smartass" but, is there anything more general than "all I need to know is which Django user is requesting the "policy-file-request""? :/
 
12:14 PM
eh, you're probably right on that
 
Looking for any guidance for months... and the only one who wrote a post about it in a random google-results' blog... has a buggy contact form hahahahaahha
I can't even contact the only person who talked about such a problem :P
Elon Musk was an illegal alcohol supplier in his parties. I have faith. :P
 
Elon Musk would probably suggest quantum tunneling to solve the issue
 
People go to Mars and I can't see a freaking user in Django... -_- HAHAHAHAHA
 
12:30 PM
@CDoc obligatory xkcd.com/979
 
1:22 PM
Does anyone has any experinece using sqlite3 in multi-process environment
I dont mean multiprocessing module but two different python script run from command line?
 
Yes, but I'm not sure it will qualify for a technical answer. What's your question?
@yasar ?
 
2:34 PM
recbg
@yasar yes to some extent.
hint: don't
 
@AnttiHaapala mm, is a blanket "don't" warranted? I think there is something of a stigma around SQLite3 that might be a bit more extreme than how things play out. I'm curious why you say this?
 
multiprocessing... it means that there are 2 things happening to the sqlite database concurrently.
 
One could be a reader
 
... yes... but this is like "is one bathroom enough for 700 people" :D
... "depends"...
 
Well, if they can do their business in <5 secs, the answer is "yes" :P
 
2:45 PM
even then, hope that they're not in a hurry.
 
But, on a more serious note, the asker clarified it wasn't the multiprocessing module
 
3:13 PM
I was going to ask if it was a good idea
Sorry I had to leave for something
I want to have 2-3 python scripts running at the same time inserting rows to it
 
If you have multiple scripts writing to the DB, then no, it's not a good idea
 
weekend cabbage
 
4:10 PM
@roganjosh Ok, I will switch to mysql then
 
 
1 hour later…
5:13 PM
Hi, I installed Python 3.7.0 from here and restarted my Windows computer. I earlier had Python 3.3.0 in my PC under C:/Python33 folder. Earlier when I launched python.exe it showed version 3.3.0, but even after the update, it is showing 3.3.0
I have even run Repair tool of the installation file and it ran successfully.
Any help?
 
I'm not familiar with py3.7, but I think your file python.exe is the 3.3.
Try going into your terminal and, when you type something like "python", hit tab multiple times, it'll show you all the possibilities you've got. Maybe the correct alias for this python version is python37.exe. Who knows.
 
5:46 PM
@GaurangTandon perhaps uninstall python3.3
new python 3.7 should be better with existing other versions
python3.3 is very old, beyond end-of-life and unless some program installed it with itself, then you shouldn't need it any more
to make it clear: it is possible to have several versions of python installed at the same time.
 
hello everyone
does anyone know how to parse an soap xml response against a local xsd schema file?
i have googled the entire internet
 
cbg
How would a search term like "the entire internet" help you with a programming problem @MichaelEvanchik?
:P
 
heh
well here is the stack overflow post , after i gave up

https://stackoverflow.com/questions/51216683/soap-xml-response-validate-with-xsd-file
 
Also, does anyone know why I can't change Python 3.6 to Path?
 
i know it can be done with outside frameworks like libxml2 etc, but if you read closely , thats not the point
 
5:56 PM
C:\Users\Me\AppData\Local\Programs\Python\Python36-32.exe
is what I tried.
 
PATH is a list of directories, not a list of paths to executables
should work if you add C:\Users\Me\AppData\Local\Programs\Python
 
Thanks for the help, but it doesn't work.
 
Need to rename the exe I guess
 
6:11 PM
?
Maybe I should try downloading 2.7?
 
Well, the exe is named Python36-32.exe so the command to start it is python36-32
 
Nope, doesn't work.
 
6:26 PM
cmd shell is case-insensitive, right?
@3141 NO
 
7:14 PM
Wait, what are you NO-ing about @AndrasDeak
 
7:28 PM
python 2.7
 
Oh, I see.
 
@3141 Have you restarted your terminal/IDE/whatever you're using to start python? Changes to environment variables don't take effect until you do
 
I tried all cases by the way.
Have restarted, still not functional.
 
@3141 Sometime when you changes the environment variable, you need to restart your machine. Maybe, restart your machine. If it still doesn't work, print your path please and show us it.
Cbg
 
7:51 PM
I have re-started and am still unsuccessful.
 
8:07 PM
Can you print your path
 
Sure
C:\Users\Me\AppData\Local\Programs\Python.exe
 
:/
2 hours ago, by Aran-Fey
PATH is a list of directories, not a list of paths to executables
 
@3141 that's what directed replies are for
 
You need to capture in going to system-advanced system-environment variable
Check internet how to set or display environment
 
That's what I am doing.
 
8:13 PM
@3141 what's "that" that you're doing? What Aran told you 2 hours ago? Because clearly not.
 
You have one value.... it's not possible
Yours programs added values in your Path
 
When I type path into the cmd prompt it gives me the path I just posted. When I try to type python into the command it does not accept it as a function.
 
you didn't post a directory
 
My fault, I meant path.
 
It is your fault. Asking for help when you're ignoring the help will lead us nowhere other than the land of frustration
 
8:16 PM
Well now the terminology is correct but the path is still wrong
2 hours ago, by Aran-Fey
should work if you add C:\Users\Me\AppData\Local\Programs\Python
 
assuming the executable is there
 
Well, I added said path about an hour and a haf ago.
 
Then why isn't it showing up in your PATH?
 
Well, it is, and when I type path into cmd, it gives me the path. But the cmd has no python functionality.
That is my problem. I don't think I made it clear originally.
 
Take screenshot from your os
 
8:25 PM
So you purposely only posted a part of your PATH earlier?
 
@3141 "well it is" <- I don't believe you
you really need to get your act together because we need convincing evidence that our time (mostly Aran's time for now) is not wasted helping you
 
Sorry, screenshot coming up.
 
you should be capable of reproducing output from your shell without having to take a photo as evidence
 
I type in path, this is my result:
 
shouldn't you be typing echo %PATH%?
 
8:28 PM
There's a path command that prints it out for you, I checked
 
cool, thanks
 
`PATH=C:Users\Me\AppData\Local\Programs\Python.exe
 
lol
@Aran-Fey does it print it in that format^ ?
 
Again,I'm really sorry for wasting your time here. Probably a really stupid noob errror on my part
 
Yes, except for the backtick at the start
 
8:30 PM
Being a noob is fine. Not being able to read and follow that after an additional reminder is not fine.
 
Sorry, typo from me
 
backtick's fine, I figured that
 
I added that in an hour ago.
 
So that's all of the output?
 
Still no functionality though.
All of it.
 
8:31 PM
of course no functionality, since your path doesn't contain a directory
2 hours ago, by Aran-Fey
PATH is a list of directories, not a list of paths to executables
that step is borked ^
 
Where's the C:\Users\Me\AppData\Local\Programs\Python that you claimed shows up?
 
having the directory on your path is a necessary but insufficient condition for it to work
@Aran-Fey he didn't say it shows up; did he?
(and then some red herring with path vs directory, ignore that)
 
Oh, I may have misunderstood that, alright
 
so 1. make it so that what Aran said 2 hours ago actually sticks, 2. see if it starts working
 
I thought this was in response to my "Why doesn't it show up?"
 
8:35 PM
Ok, I see. I tried to implement his message but screwed up, hence all this confusion.
 
@AndrasDeak I saw what you did there active reading or something ;)
 
I deleted the whole Path variable and replaced it with one path.
Oof.
Would I be correct in saying that the default path variable is C:\Windows\System32
 
@rene I was counting on it :D
 
Yo, maybe you guys might know this. Is there some trick to finding a few of the largest eigenvalues and eigenvectors of a matrix?
 
@3141 `C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Win‌​dowsPowerShell\v1.0` on my machine
 
8:44 PM
@3141 there seem to be a lot of google hits
Depends on bits and win version
@Mikhail numpy.linalg.eig?
I don't think there's a "k largest" at least in numpy
Perhaps something in scipy, but I wouldn't bet on it
 
That gives them all. Also, I have a really big matrix (my matrix is bigger than your matrix). Also I want to roll my own algorithm in some more performant language :-)
 
this is the python room
how about researching typical methods?
 
Yeah, so you guys might know the underlying algorithm. Most numerical methods classes are taught in python :-)
 
I do know some methods
 
( ͡° ͜ʖ ͡°)
 
8:51 PM
Go read about them, it'll be good for you
 
Yeah, I found a few.
I guess the underlying problem I have is the need to multiply a six dimensional tensor (~35 TB) by another tensor of the same size. Then do this a bunch of times. I need to somehow compress the initial tensor.
Really, trying to solve for A in Ax=b from known x & b pairs, where A is too big to form.
 
you wanted performant; fortran is as good as it'll get
 
++C is faster
 
nope
 
(I almost worked for an HPC company)
Anyways everything is going to be JS in a the next few months, so I'm just trying to flesh out the best way to do this inversion. My experience with conjugate gradient and friends (gmres), says its not possible as the system has too many elements...
 
9:08 PM
I'm not sure what kind of answer you're expecting here.
 
Some discussion
 
I already gave you two suggestions, and this is still the python room. Not the linear algebra room.
numerical linear algebra, for that matter
 
Those python functions are nice but I'll need to roll my own because I can't actually form the matrix in memory. Looks like its doing some power iterations.
 
My problem is solved. Thanks so much for all your help Andras and Aran. Sorry for all the frustration caused, absolutely my fault.
 
@3141 it's fine as long as you try to be as informative as you can in the future. I'm glad it's sorted out now
 
9:14 PM
Thanks. Rbrb!
 
rhubarb
@Mikhail have you considered the Arnoldi method?
I don't know if it's applicable, I just want to make sure you're paying attention
I guess "matrix doesn't fit in memory" is a pretty rough constraint on applicable methods
 
Indeed, some kind of sampling needs to happen.
Like its pretty easy to find the average of 100 petabytes of data if you sample only 1% of it :-)
 
so your problem probably falls in the category of "dig in scientific literature for days and hope for the best"
which leads me back to my earlier question: what kind of answer are you expecting here?
 
Some discussion
 
The reason I may seem agitated is because it really gets my goat when someone asks "how do I print something?" when they really mean "I want to create a picture with characters resembling Chinese calligraphy, also it has to support unicode complete with the 'barf with one eye closed' emoji to be introduced in 2020"
 
9:29 PM
Yeah, but the later question has a clear answer, mine doesn't :-)
 
it's not about clarity, it's about specificity
 

« first day (2821 days earlier)      last day (2142 days later) »