« first day (1385 days earlier)      last day (3557 days later) » 

12:00 AM
good luck
are you using an IDE?
 
Yes. Pycharm master race ;p
 
I think pycharm makes virtual envs easy
 
That's why I love it ;p
 
It seems that the only IDE people use for python is PyCharm
 
That's true but I don't think there is something better right now
and free to use
 
12:03 AM
I spent a good amount of time on two separate occasions setting up Eclipse and Xcode for Python.
Clunky and painful enough to send me back to a text editor.
 
I was trying with Sublime Text but it was to hard to prepare everything what you can do with one click in pycharm
 
prepare as in virtual envs?
or just setting it up nice and fancy
 
Could do with something in between though - like yelling at me if I miss a colon after an if etc. Especially if it's in some place you find out only rarely (because it's nested, or in a function not often called..)
 
nice and fancy. There is no sense in making IDE from sublime when you can just download Pycharm
 
my sublime is nice and fancy
 
12:08 AM
You know.. There is plenty of ppl who write in vim/emacs nowadays... ;p
 
idk why
so ugly
 
idk too. I think they are very, very old and just don't like new things ;p
sublime is much better but I still like pycharm more
 
do you perhaps know why I can't change the font or size?
 
even on my old netbook
 
 
12:13 AM
I have exactly the same problem, at Ubuntu. I think they might screw up something in last update. All my fonts after last upd are bold now...
 
nvm, I solved it
 
how?
 
click on that and create a new one
I think the default one is write protected
 
So now I don't know what happened to my fonts...
I have a default selected but everything is bold
 
me too, I think it for some reason is not using the ones I want
show me
 
12:16 AM
Wow - "[I] can see myself out", thanks, Thomas‌​...
 
@OllieFord ehh, not sure what to make of that
sure is odd behaviour for SO
 
Omg, now my screenshot program don't want to work
I hate that Ubuntu 14.04
 
use lightshot in wine
that's what I do
shutter is a big clunk of meh
 
Heh, he described davidism as "thinking [he is a] self-promoted moderator" too
 
bloated for fast screenshotws
well SO can be discouraging to new users
 
12:20 AM
Merely for critiquing his answer in comments.. Because of course that's a job for mods.
 
Use wine for doing ss? Isn't that too much? ;p
 
@python nope
 
And yes, SO can be discouraging. But python community here seems to be nice
and they don't downvote so much
 
that is true
I first though this was a real time forum sort of thing
*thought
 
because it is ;p
 
12:30 AM
@Vader are you (or at least were) Engadget mod Vader?
 
I was never a mod
 
Too Broad: lacks a basic understanding of Flask and Flask-SQLAlchemy
cbg @DSM
 
DSM
@davidism: hilariously, I find myself wondering if a basic understanding of Flask is exactly what I need. Find myself in need of making a very lightweight web service prototype.
 
what does, Davidism?
 
DSM
12:33 AM
recbg, btw.
 
@corvid the question I cv-pls'd
 
buh? What is he doing in that question?
 
@DSM it's easy to get started, and you're in the right room :)
 
DSM
@davidism: How easy is it to construct/steal and build upon moderately complex little widget thingies? (You can see my familiarity with the technical terms.) I have in mind a treetable-like object with some quirks.
 
if the moderately complex widget thingies are a javascript library that uses ajax, then I'd say fairly easy
 
12:38 AM
Any idea why django-admin.py --version on Windows (version 7, 32-bit) would result in "Could not load Python dll"? I'm honestly not sure what it should respond with (I did it at this suggestion), but I'm pretty sure "Could not load Python dll" is not supposed to be it.
 
it's a matter of sending the tree data as json, and processing the json requests from actions on the widgets
@aliteralmind there is something wrong with your python installation
 
I've uninstalled python, restarted my computer, and re-installed Python THREE TIMES today. What do you recommend?
 
I have no idea about Windows, I recommend you install Ubuntu :)
 
DSM
@davidism: so the idea is that for the low-level stuff you write in JS and then handle the higher-level logic/stateful stuff on the Python side?
@aliteralmind: you seem to be having a run of bad luck. :-( Unfortunately many of the people who'd be happy to help otherwise don't have a lot of Windows experience, and configuration issues are the ones which differ most between OS.
 
Ah well. As I wrote in this question a few hours ago, I can get it working with
python c:\applications\programming\python_341\Scripts\django-admin.py startproject mysite
 
12:45 AM
Flask is the backend, it gets requests to different urls from the clients and responds with, for example, HTML, or JSON. The frontend is HTML pages or some JavaScript app
 
But not without the "python" or the fully-qualified path to the py file.
At least there's a workaround. Thanks for the help, @DSM. That was a neat trick you taught me, commenting out the file and putting in a print.
This has been a rough day. That's for sure. Thanks again @DSM and @davidism.
 
@aliteralmind that sounds normal on windows, you won't be able to use straight django-admin.py unless it's on your path, and you can't use python scripts without the python first because windows doesn't parse the hashbang at the beginning.
so that full line is correct, if it works, use it :)
 
It's the only way I can figure... so use it I will! ;)
 
DSM
@aliteralmind: if you don't occasionally burn time uselessly then you're not trying things hard enough. :^)
 
what's happening is you're probably seeing commands written assuming you're using linux and bash, scripts and the PATH behave differently on windows
 
12:50 AM
@aliteralmind maybe you need to set your environment variables for python.
 
@Vader I think we've already been down that path, it sounds like he's just expecting scripts to work without python first, like they can in bash.
 
@davidism @Vader They did work without the python. I've already successfully gone through the Django tutorial, in which the first step says to use the command without "python". But now it doesn't work anymore.
 
ok, then you did mess up your paths :)
 
DSM
@davidism: okay, that makes sense. (I'm using sopy as my example code, and trying to follow what the various decorators do.)
 
Yeah, well, I thought they should've kicked into gear after three full re-installations...
 
DSM
12:56 AM
You know what they say about insanity.
 
@DSM sopy isn't doing any fancy widgets on the front end, it's just straight html POST forms, but it does provide a very good framework for all kinds of things, if I do say so myself :)
 
Anyway, I do have a workaround, so I'll just use that for now.
 
@davidism I did totally steal cough learn from a lot of things on the repo
 
DSM
@davidism: I'll probably have some stupid questions over the next few days, although I promise to RTM & various tutorials first.
 
you know, I can't think of any good flask tutorials besides the official one
 
DSM
1:05 AM
I found a handful on the Web, although (for obvious reasons) I can't speak to their quality yet.
 
the mega-tutorial is ok-ish
maybe I should write one, when I have mountains of free time
 
Rhubarb. :)
 
DSM
By Monday would be helpful.
@aliteralmind: rhubarb!
Looking at this web stuff when you usually do algorithms and math is a little mystifying. It's this alphabet soup of incomprehensibility.
 
@davidism Flask Web Development by Miguel Grinberg is pretty good, the book
I mean. It's not very in depth, but it's a good breadth of knowledge
 
1:17 AM
hi all, quick question. i'm trying to enter a string but i keep getting a name error
def main():
    text1 = input("Enter word 1: ")
    text2 = input("Enter word 2: ")
i tried eval(input()) and input().strip() but neither work
 
@DSM cv-pls'd before the edit, now it makes more sense
@annabananana7 on python2, use raw_input
 
ohhh
from text1 and text2, i want to count how many characters that occur in both words. this is the code i have so far but i get a weird error:
def count(text1, text2):
    count = 0
    for i in text1:
        for j in text2:
            if i == j:
                count += 1

    return count
 
DSM
In python 2, input is basically like eval(raw_input()) -- you're typing a string and then it's trying to evaluate it as Python code, as if you typed it at the console. If you type "orange", it looks for a variable called orange..
 
@DSM would i use eval(input()) in python 3?
i had python 3 at the beginning of the class then we had to switch to python 2 and i get a bit confused
 
DSM
Nope, there's no need to do the eval. eval is the "treat this as if it's Python code" command (from "evaluate"). You just want the string, so raw_input is what you want.
 
1:23 AM
@annabananana7 len(set(zip(text1, text2)))
 
gotcha
@corvid what does the zip do?
 
combines the two list as one
err sorry I did that wrong
 
i'm getting this if i run that code:
('The number of characters that occur in both', 'anna', 'and', 'banana', 'is', <function count at 0x02A18570>)
 
len(set(text1).intersection(set(text2)))
it's because your function is named count. Change your variable name
 
i changed my variable to char and i still get the same error
 
1:26 AM
@annabananana7 the reason you're getting <function count at ...> is because you've shadowed an outer variable (the function name) with an inner variable
time to play some ultimate frisbee, rhubarb all
 
@corvid where do i put the len(set()) ?
 
DSM
rhubarb
@anna: do you see why your original code wouldn't give you the answer you wanted? Instead of if i == j:, try print i, j. You're looping over every possible pair of letters, so AA, 'AB` will give you AA, AB, AA, and AB.
 
i'm not following
 
DSM
>>> count = 0
>>> for let1 in "AA":
...     for let2 in "AB":
...         print let1, let2
...         if let1 == let2: count += 1
...
A A
A B
A A
A B
>>> count
2
We counted "AA" twice, so we think there are two letters in common.
 
oh i see
 
DSM
1:38 AM
You also need to decide what you want to do with "AA" and "AA". Do they have two letters in common, or only one? Etc.
Once you know exactly what question you're asking, you can write code to answer it.
Okay, time to hit the road. Rhubarb to all!
 
still can't figure it out :(
i tried for i in text1:
if i in text2:
but it still doesn't work
 
1:56 AM
you're just trying to find the letters that occur in both?
 
yes
ahh forgot the break, got it!
 
@annabananana7 Glad to have been of help :-)
 
haha thanks!
 
But when you say you are getting type error, please post the actual error message as well.
 
this one? TypeError: cannot concatenate 'str' and 'int' objects
 
2:08 AM
Oh, yeah. But you included the error message in that comment. Sorry, I didn't see that :( I remember seeing only, I am getting a type error
 
haha yeah, i pressed send before i pasted the error
 
 
3 hours later…
5:13 AM
cbg()
 
Hi @vaultah
 
 
1 hour later…
6:45 AM
I'm getting a syntax error in the line where I set quizzes to 0
 
@aliteralmind missing ) on line above
 
And you don't seem to need parentheses on the last line at all
 
I was so busy thinking what was wrong with that I never noticed the above line
 
Sorry mis-@ there completely
 
 
1 hour later…
7:56 AM
Hi everyone
 
Hello @yakudza_m
 
user50049
@SufiDeveloper Uhhh, saywhat?
 
8:13 AM
Hi @Tim I'm one of the admins of sopython.com. We had a lot of continual ssh login attempts from him but the website itself seems to be holding up fine. Unfortunately @JonClements (who owns the server and takes care of it and I believe made the original flag for mod intervention) doesn't seem to be about right now.
 
user50049
Oh that's unfortunate. Very, very unfortunate. Linus speaking of monkeys comes to mind when I think of people doing that sort of 'research'.
 
user50049
@SufiDeveloper While we can't really do anything based on what you do when it comes to other sites, we can and will curtail disruptions in chat. If your activities there lead to a disruption being created here, then you'll likely find yourself unable to use chat or the main site for a considerable amount of time.
 
Oh actually based on the log's he's still trying to bruteforce the ssh login...12+ hours later. Woo for perseverance.
 
user50049
8:37 AM
Someone has a ginormous carbon footprint. Tsk Tsk.
 
having a weird thing! my script was runnning when but today, each division return 0
has someone ever seen that? python 3.2.3
 
@Bestasttung what do you mean? Do you mean 2/3 is returning 0?
 
yep
 
Are you sure you're not accidentally using 2.x?#
Also what type are your numbers? Floats or ints?
 
humm
you were right i was running my script with python myscript.py, and now with python3 myscript.py it works
i was sure it worked yesterday without invoking python3
i got #! /usr/bin/python -v 3.2.3 at the begining of my file
maybe something wrong with this syntax
 
8:42 AM
Possibly, just looking it up.
Incidentally: be careful when you type shebang into Google...
 
Eh
Why?
 
unfortunately i have no virtual env on this computer
 
Hashtags?
 
For a second I thought one of the websites was...well...something else...
@Bestasttung are you using Windows or *nix?
 
8:44 AM
Unix :)
Ubuntu here 12.04, but my opersonnal is 14.04, no problem with taht, and i'm handling it with virtual env
 
If you're using python filename.py then the shebang doesn't matter anyway
 
but here is a working computer, i have some long scp to do so i'm running some personnal script :p
 
As you've chosen to use the python interpreter
 
I thought the shebang only matters if you run the file directly
such as source filename.py or whatever the syntax is.
 
8:45 AM
ah ok get it, it usefull when i do ./filename.py
 
Exactly.
 
ok tahnk you @Ffisegydd
 
Do you understand why it gave you 0 on Python 2?
 
yep
 
Ok cool.
 
8:46 AM
entire division / in python 2.x and that was removed in python 3, you need to do // to have this
with integer of course :)
 
Yeah you use // to force integer division.
And you can use // with floats too, it'll first convert them to int type I believe.
In [37]: 2.5 // 3.0
Out[37]: 0.0
 
ok
doesn't cast it in int
the return
>>> int(2.5 / 3.0)
0
 
9:22 AM
@Ffisegydd lucky you were around :)
 
@TimPost @Ffisegydd Sorry I didn't want to come up that way. I'll not bother here on chat and send every loophole or security issue I found to the Sopython owners directly. Have a good day.
 
@SufiDeveloper Nobody asked you to "test" sopython.com, and nobody wants you to do so. Your behaviour is completely unacceptable. Please desist.
 
@SufiDeveloper when you told us that you were going to do some testing davidism said politely "Thanks but no thanks" and yet you did it anyway. What davidism said still stands: we don't want you to security test the website.
 
@Ffisegydd I didn't see that before because Davidism didn't ping me for me to notice, and I already left the chatroom. If this is what you want I'll stop. Anyway the 12+ hours of SSH cracking attempts or whatever wasn't me. I don't put SSH cracking at first when I check vulnerability vectors. And really 12+, me? Look at my history, I was on Hangouts and before busy in something else. I didn't test it for more than 30 minutes at best as I wanted to continue the following day. Again, sorry.
If it's possible show the suspect ip you got in the log, I'm sure it's not mine.
 
9:54 AM
Cbg all :)
 
cbg @Ian
 
@Zero are you up really late or awake really early?
 
The former ... sleep patterns completely shot at the moment :-/
With a bit of luck I'll make it to mid-evening and then sleep for twelve hours - that should sort everything out.
 
O_o
It like 6am there?
 
9:57 AM
Yep. Also, yes that is what I look like in the mirror ...
 
user559633
Morning :) (it's 6am for me)
 
Was complaining yesterday about (and got help with) nump.nan:s being able to repeat themselves as keys in dictionaries:In [43]: set(tuple(id(np.float64(np.nan)) for _ in range(1000000)))
Out[43]: {43998928, 44564656, 44564816, 47577984}
I can't shake how disturbing that is, and it seems not related to np.nan != np.nan
Anyone have a clue where to dig for the root of it which seems to be specifically 64bit float nans in numpy randomly getting new id
 
I think you need to adjust your mentality a bit.
NaNs are exactly what they say they are: they're Not a Number
They're what you get when something isn't correct, when your script can't handle something.
And so (at least the way I think about it) is that it makes sense that nans have different ids.
Because if I get two nan's from different situations/methods/reasons then they're different objects
And so it makes sense to give them different ids, even though they both represent the same "Not a Number" idea.
 
I would be OK with that, but sometimes different id and only sometimes for some data-types?
 
Does (C)Python sometimes re-use id numbers though? For other things apart from NaNs? (This is a question to the group as I can't remember)
 
10:13 AM
IDs in CPython are memory addresses, if an object is garbage collected, it's possible a new object will be assigned that address and thus have the same id
In Jython - all object IDs will be unique as it uses an incrementing counter
 
Yes, since np.float64(np.nan) isn't getting bound to anything, its memory location becomes free to be reused while the generator is running.
 
hands @Jon a gold star
hands @Zero a gold star and a sleeping pill
 
@Ffisegydd can I get a caffeine pill? I'm knackered :)
 
So np.nan is a single reference to a value always in memory, but since the float64 creates a new object the issue arises?
 
@deinonychusaur yep.
I think I'll get an actual (abeit instant) coffee.
Not down with all this space-age pills malarkey.
 
10:20 AM
Thanks, less distressed now, but still, it is a "feature" that is an open goal for silent errors.
@ZeroPiraeus you deserve better than instant!
 
@deinonychusaur it's a design implementation. You shouldn't rely on np.nan for keys. They are nans after all, can't trust the crafty bar stewards...
Though this quite interesting and I don't understand it:
 
@deinonychusaur My local coffee shop, while very good and very local, doesn't open for a while yet.
 
It was a pandas data-frame that was missing values that was the root of all this, but sure I've learned my lesson hard and will never trust a nan in my life, ever again
 
In [67]: d = {np.float(np.nan):i for i in range(10)}

In [68]: d
Out[68]: {nan: 9}

In [69]: d = {np.float64(np.nan):i for i in range(10)}

In [70]: d
Out[70]:
{nan: 0,
 nan: 1,
 nan: 6,
 nan: 4,
 nan: 8,
 nan: 9,
 nan: 7,
 nan: 3,
 nan: 5,
 nan: 2}
I think I'll ask DSM about that later. There's a difference between np.float and np.float64.
 
@Ffisegydd yep had that as well testing. Think it is the result of some optimizations under the hood
 
10:27 AM
It seems that np.float is just an alias to the builtin python float.
 
10:48 AM
cbg all
You don't need to pass in np.nan to np.float; just use np.nan directly.
ick, except you got 10 different nan values there.
which is actually what you'd expect as nan is never equal to anything, including itself.
I'm surprised it has a __hash__ at all then.
but np.nan is just the built-in type float, yes.
and np.float is an alias for float.
np.float64 is certainly different; there is a np.float32 as well.
 
Interestingly enough, both float("nan") and np.nan hash to zero. If there's a non-arbitrary reason for that, I don't know it.
 
(and 16 and 128 bits too)
 
Oh, and this is delightful:
 
@ZeroPiraeus np.nan is float('nan').
 
>>> hash(float("inf"))
314159
>>> hash(float("-inf"))
-271828
@MartijnPieters Nope :-)
 
10:56 AM
That is to be expected, actually.
float('inf') and float('-inf') are two distinct values.
 
>>> np.nan is float("nan")
False
Yes, but those digits don't remind you of anything ... ?
 
nice easter egg :)
 
I see you've kept digging around this, I was indeed using the nan:s directly but I suppose the array was 64-bit and I needed to put parts of it into dict at a time or something like that.
 
@ZeroPiraeus type(np.nan) is float
@ZeroPiraeus Ah! Not paying attention there. Cool!
 
@MartijnPieters Ah, my mistake. Yes, you're right - faulty thinking on my part. float("nan") is not float("nan").
 
11:04 AM
>>> float('nan') is float('nan')
False
 
In [70]: float(0) is float(0)
Out[70]: False
 
Clearly we should be able to intern floats ;-)
 
Which is why np.nan exists, I'd say.
For numpy apps, interning NaN is a good idea.
 
Yes, I suppose it would be.
 
11:08 AM
Yes, but sadly there is only one np.nan and no np.nan64
So, never trust a nan or inf again.
 
Which reminds me of a favourite saying: "A NaN, a flan, a canal: Fanana!"
Such a shame "blan" isn't a word.
 
I will now stop my second day nan-highjacking this chat, take a break outside, and get over this nan-gate
 
@deinonychusaur nope. But then again you should never use nan as a dictionary key anyway.
Wheee
if (!Py_IS_FINITE(v)) {
    if (Py_IS_INFINITY(v))
        return v < 0 ? -271828 : 314159;
    else
        return 0;
}
but no special case for NaN.
 
@MartijnPieters noted. In my case they should have been filtered out before anyhow.
 
I think that's a limit of the implementation.
 
11:20 AM
Nan has hash 0 so what other cases are there?
 
@deinonychusaur I guess that's the only non-finite double that is not infinity.
I more meant that it should set an error condition (the C equivalent of raising an exception), for TypeError.
I wonder what the implications are for one value of the float() type raising TypeError for float.__hash__.
 
It would be poetic if the hash for NaN were 1j ...
 
:-P
sorry, no can do, must be an integer.
 
Yeah, but it'd make Euler smile in heaven to get those three together :-)
 
I think part of my issue with these nan:s is actually with the dicts. I alway saw them as a type of a hash-map. They after all do require their keys to have a __hash__() method. But the dict doesn't use the hash
I suppose dicts are id-maps for objects that have a hash-function
 
11:32 AM
@deinonychusaur Dicts require two items: the __hash__ and __eq__
because a hash is not unique, certainly not after mapping it to the hash table size.
 
True but neither affect how they behave in the dict
 
So the hash maps to a slot, if there is an object already there then the objects are either equal or they are not.
And that's where the NaN value fails, it is never equal.
@deinonychusaur They absolutely affect how they behave.
because you can now never delete NaN keys, or update their associated values.
or retrieve their associated values.
all you can do is add more.
 
Been a while since I watched this now so I can't remember how far it goes into that aspect of the implementation, but anyway it's a good video.
 
ok was wrong
If they have the same hash and the existing key agrees they are equal, then they are equal. Finally I think I get it.
 
12:03 PM
@deinonychusaur as you're working with pandas you may come across NaT which is "Not a Time" and is the temporal version of NaN (just a small FYI)
 
Today's pet peeve: people that name their filename objects file, or vice versa.
 
@Kevin what, people that name their file filename objects?
as opposed to people naming their file objects filename, right?
 
Ex. this guy has with open(file, 'r') as filename:
 
Ah I see.
Yes that's...peeving...
 
Yeah, that's pretty vice versa alright.
 
12:15 PM
My guess is, the initial thought process was, "I want to use execfile. What should I name the first argument? Well, file, of course, that's what I want to execute."
then "with open(x) as y typically has identifiers filename and file. Hmm, I get a NameError when I do with open(filename) as file. I guess with open(file) as filename is the correct form. "
 
12:41 PM
Today I learned that 3.X doesn't treat exec as a statement.
 
nope, exec() is a function now, just like print().
 
I think I like it better that way. I wonder why it was a statement to begin with?
 
cbg for all
 
cbg @Peter :-)
 
@Kevin have you received my message from last night?
 
12:47 PM
Yep, added
 
nice ;)
 
Why don't you two make a wiki for your 'films-to-watch'?
 
@Ffisegydd there are so many "you have to watch this before you die" stuffs out there
I don't think we need another one :P
(even if it is the ONLY TRUE ONE)
 
Yeah but everyone disagrees with everyone else :P
You could put the list together on sopython ;)
 
yeah, well -- for me my own IMDB ranked and watch list is more than enough
 
12:49 PM
Yesterday I finished watching early 90's supernatural drama Twin Peaks. On the whole, it reminds me a lot of LOST. In particular, its rotating cast, and its tendency not to answer all of the questions the narrative raises.
 
@Ffisegydd that is another story, and well, I absolutely support it, to have a film-section on sopython
even if it is so offtopic
 
Pssh we had a wiki post that discussed people's beards.
 
@Kevin that is one of the classics I could't watch through
I have problems with the first season for start.. it is just so.. early '90s for me..
 
It felt a little "soap opera" at times, especially in the second season, since the whole murder mystery was (mostly) resolved.
 
@Ffisegydd :D:D okay, then it is settled. we will add a movie/tv shows entry
@Kevin but worth watching it in 2014?
 
12:52 PM
@PeterVaro The only time it felt dated to me was a scene where Dale is talking with a fellow FBI agent, who has this giant monolith of a laptop on the conference room desk.
 
Almost every other week I long for the occation when I decide to rewatch Twin Peaks
It is always worth it
 
@PeterVaro I'll give a tentative "yes". It's fairly consistent, so if you didn't enjoy the beginning, I think you'll feel the same for the rest.
 
well.. I will try it again -- maybe I've changed a lot since last time I tried..
btw, watch this video, I really liked it:
 
I think I'm going to check out the prequel, Fire Walk With Me, to see if I can get some closure on the more prominent unsolved mysteries.
Not that I'm too hopeful, since I stumbled upon an article saying, "twenty years after the end of the series and we still don't know why [REDACTED for super mega spoilers]"
 
@PeterVaro Not sure how you'd get hold of it, but if you can you'd really enjoy bbc.co.uk/programmes/b03b51db
That was an awesome documentary
lunch, rbrb
 
12:59 PM
@PeterVaro that is a very nice clip indeed
 

« first day (1385 days earlier)      last day (3557 days later) »