« first day (1798 days earlier)      last day (3375 days later) » 

00:46
Twisted got some money from the PSF to aid the conversion.
I'm aiming for a reversal on a rather bad question on Programmers.SE that's related to Python. Feedback welcome: programmers.stackexchange.com/q/297532/102438
reversal in what sense?
01:02
Although based on the history of programmers.SE, it's not likely: programmers.stackexchange.com/help/badges/50/reversal
They've managed to delete every reversal somehow.
Okay, give me a sec, I'll look
have chat session with online class right now
01:18
ok, tell them to vote it up. I'll wait here.
:D (I'm a big fat joker, in case it wasn't quite apparent.)
There is only one other developer and he is more ASP.NET in this class
....which is weird as it is a class on "building secure software and information systems"
also (without really looking at it) you might add a reference to the next logical question:
87
Q: What is the difference between a 'function' and a 'procedure'?

rprGenerally speaking, we all hear about the "functions" or the "procedures" in programming languages. However, I just found out that I use these terms almost interchangeably (which is probably very wrong). So, my question is: What is the difference in terms of their functionality, their purpose an...

We need a few people willing to invest in some downvotes: stackoverflow.com/a/492620/541136
There, I just bought ten downvotes for you, JGreenwell.
I don't sell my votes :P ;)
or buy them
except with liquor
I didn't buy them from you, I bought them for you.
This site would be better if we'd spend downvotes more freely.
I'm trying to do that, but changing from being a rep-hoarder is hard.
01:34
course now your making me try to figure out if python abstract methods can be static methods
should work...
didn't seem to work in 2.7
>>> import abc
>>> class Foo(metaclass=abc.ABCMeta):
...     @staticmethod
...     @abc.abstractmethod
...     def foo():
...         print('foo')
...
>>> Foo()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Can't instantiate abstract class Foo with abstract methods foo
>>> Foo.foo()
foo
Python 3 works ^^^^
I default to 2.7 but 3 worke.....yep, beat me to that
I'm going to + that post cause it made me think (of something only semi-related) but that still counts
I shouldn't have answered it, and wouldn't have except for the reversal badge which encourages it.
or do whatever you like
Also it is making remember a debate about if a script that contains only comments could be considered a procedure (as no commands are executed)
Is a script with only comments a procedure?
Sure, why not.
Do nothing. Done. Procedure over.
I'm open to that being incorrect.
01:51
the definition of a procedure (depending on which one you look at) states that it performs (executes) a set of commands in order - so no commands no procedure. Then there is the view you had. Mine which was the interpreter still had to parse the comments to realize they were to be ignored and this could be considered a form of execution (I was all of 17 at the time - so young so naive)
And then the database guy who proceeded to state it was a waste of space, obviously invalid and therefore left in error - which meant it could not possibly be a procedure.
Is Null a value?
no it is the absence of value....depending on the language
Are comment characters instructions to the interpreter to ignore what follows? Thus are they semantically commands?
command: do nothing
....I think me and the other developer on this chat, I'm doing for a class, are losing our minds a little bit
what's the class?
02:02
software systems security (ie. building secure code from ground up)
2 devs, 1 database guy, and then 1 networking guy and a person looking for a more "managerial degree" both of whom took this as an elective
at least on chat
So everyone's nominally a technologist? What are you losing your minds over?
someone just asked "are injection attacks really that bad?"
Tell them about Bobby Tables?
oh, I'm just letting the DB guy have fun at this point
02:08
hehe
or use sqlalchemy and don't send raw SQL queries
so going to cite that in a paper
cite which?
the comic strip
02:29
It's popular in some circles.
that should popup when you type "import antigravity"
03:01
Call me cap'n obvious.
03:54
Good night everybody!
we don't want this on permanent display: 31.media.tumblr.com/tumblr_m4sdowVyzk1rn95k2o1_500.gif
 
2 hours later…
05:26
Hey up all
05:44
Cbg!
06:04
I wonder if you could use SQLAlchemy to migrate your table structure and data to a different database
Possibly even a different dbms
Hi all
@vaultah cbg
06:49
Morning all
@RobertGrant I'm going to go with "probably". takes seat slightly on yes side of fence
^^ :) deathmatch
07:14
Can you let an inner function mutate a variable in the parent? repl.it/BJBz
07:30
Yes, switch to py3k and use nonlocal
Doesn't that code also do it?
Cbg :)
@Ffisegydd wat wat?
Never trust someone who has # Doing stuff in place for actual code.
07:40
Hmmm.
considers making 300000 1KB files
I like the nebulous "something else" @RobertGrant.
Ok, I have found out that Python does close the files. I checked that with Linux's lsof command. I'll dig more into this and post a solution (might be of interest for other people) — Daniel 2 mins ago
-_-
1900 profile views 🎆
07:57
@JRichardSnape I'm better at eliminating possibilities than suggesting them :)
08:13
Essential skillz, Bobby. Becomes an interesting issue then. Tempted to suggest he puts a delay in the loop and checks it still happens...
But could be easily sniped into a non-issue. Ah, the trials of Snape
anyone working on odoo
No but I've heard of it. Looks cool but expensive
@JRichardSnape it's not easy being that awesome, I'm sure
Roflcopter
waits for kick
Has anyone attempted CI with Jenkins for Plone or odoo?
@PavanKumarN If you have a question then please just ask once you've read our rules sopython.com/chatroom
08:23
Cabbage
@poke cbg
user4433485
heya folk!
I'm quickly falling in love with this RESTful API.
morning all
Hey up mucka.
09:06
Ahh good... it's stopped raining for a bit... wasn't looking forward to having more water damage...
user4433485
here as well
user4433485
raining for days now
@Katherina so - where's my coffee - I'm still waiting! :p
user4433485
sorry:P i've been ill for couple days
Mmmmmm, coffee......
user4433485
09:15
:D
09:40
Variation on a theme. One for the dict merge guy... stackoverflow.com/questions/32648732/…
09:58
"dict merge guy" - don't see Marvel/DC taking that up as a new super hero name :p
I thought Aaron was taking it as his nom de plume
cbg
Hello.
s = 'reliance india limited corp'
print ' '.join(s.split())
slist = s.split()
Hi @cyclic
10:12
trying to print ngram, lenth greater then equal to 2
@cyclic please explain what you actually want in detail, along with solid examples of the code you're using, the example input, and the expected output.
@Ffisegydd sure
input
s = 'reliance india limited corp'
output should be:
result = [''reliance india', ' india limited', 'limited corp']
And do you have any code, other than what you've linked so far?
not yet, let me write the my way of doing
Sorry but I don't understand what you're saying there.
10:18
I think you might need to look up what join() does - I would say it's not doing what you would like it to do, right?
@JRichardSnape yeah, using join I could not do what I want
@cyclic if you're interested in n-grams and NLP you should look up nltk.org
for input string
`'reliance india limited corp' `

I was trying to get this result

`output = ['reliance india', 'india limited', 'limited corp','reliance india limited','india limited `corp','reliance india limited corp']`
It will provide some methods/examples.
Definitely if you want to go futher, don't "roll your own" NLP - follow Ffisegydd's advice
10:20
nltk I know, but without using it, is there any other python function to do this
@cyclic not difficult to write your own...
You could write your own, but you should be using NLTK or another, similar NLP library.
For this particular task, it's quite easy to write your own.
(Very BBC Fizzy - other libraries are available)
But yeah... nltk with come in useful for other stuff you may not think you want right now... but probably will...
^^^
I've become addicted to using ^ I must stop
10:22
^_^
In [7]: sentence = 'this is a foo bar sentences and i want to ngramize it'

In [8]: n = 6

In [9]: sixgrams = ngrams(sentence.split(), n)

In [10]: for grams in sixgrams:
   ....:       print grams
this did what I want, but I guess each time I have to change the value of n and reiterate
@cyclic then wrap it all in a function?
10:24
@cyclic that's what loops are for? :p
yeah, that is one option. But I wanted to know if any better alternative if available
That looks pretty nice to me
Wrap it in a for loop is probably obvious (cyclic's using nltk there for ngrams probably)
for will be easier to understand, but you could put it in a list comprehension too, probably...
I'd stick it all in a generator with a for loop inside, but that's probably a bit too complicated.
yeah, list comprehension is better way to do
Anyone want to help me parse this comment?
My idea: if for( or while) work on readline : temp files got index but you don't save anywhere. While condition returned None , is not an error. — dsgdfg 1 min ago
10:32
It's almost...zen.
I'm having problems parsing what they are trying to say there.
I can see why
Something about reading a load of temp files and skipping ones that aren't there any more?
Do you think they are the downvoter, or just helpfully suggesting a list of words you might wish to reorder...
sentence = 'this is a foo bar sentences and i want to ngramize it'
nlen = len(sentence.split(' '))
for n in range(2, nlen):
	sixgrams = ngrams(sentence.split(), n)
	for grams in sixgrams:
        	print grams
my way of doing, I appreciate if someone has better approach compare to this
10:34
@cyclic That's the style - if you want them in one big list, initialise an empty list outside the loop and append to it inside
BTW - that's a much better place to start from than the code you posted initially
thanks Buddy
@JRichardSnape I know who the downvoter is.
even if they deny it vehemently.
@MartijnPieters Oh, of course you do. I never thought of that...
@JRichardSnape moderators cannot see individual votes.
But ninjas just know?
10:45
But I can see that the individual in question has voted once today and lost 1 point when they did so. :-)
Right in a 2 minutes timeslot where I received a downvote.
and therein lies the dangers of releasing metadata
@JRichardSnape yup.
There is a 0.01% chance the voter in question had voted on something else without leaving feedback.
Of course. In a court of law that's what you'd argue. In a civil case, you might argue that but you'd lose.
I wonder whether dsgdfg is potentially a colleague of the OP there and they're actually doing something slightly different and have posted an MCVE that fails on C and E
I can't understand it, anyway. Try as I might
Nope, not making any sense at all.
@JRichardSnape they are too geographically dispersed for that to be likely.
Another theory dashed
10:54
true loop returned none. — dsgdfg 1 min ago
And I'm out.
You tried. Returns are diminishing from almost zero to....
Hello
How's it going?
same old, same old :)
10:59
Ca
Ahhh - OP got that pointless try...except code from a book - yumpu.com/en/document/view/39456143/…
Amazing how often googling a complete quoted code block from on here yields someone elses code...
A lot of my learning comes from reading and writing out others code
Quite surprised that's in an O'Reilly text
@Jacobadtr nothing wrong with that at all. I always appreciate a link to the original, though, if I'm being asked about it. One for reasons of fair attribution, second because often it's being misapplied (not directed at you, by the way, just a general observation)
11:04
@JRichardSnape Sure, that makes sense.
Can anyone tell me why I have a syntax error with this?

> outputFileObj = open(outputFilename, 'w')
Looks OK to me - are you sure that's what's causing your error? You're not typing in the > at the start are you?
Note that if you're using the standard interpreter - a SyntaxError will often (maybe always) have a little ^ above the message showing you where in the offending line the interpreter encountered the error.
Cabbage
I'm not typing the '>', I couldn't remember how to make code appear on here.

The little ^ is beneath the j of 'Obj'
Are syntax purely a problem with that line, or should I be looking elsehwere in the code for a problem?
*syntax errora
...sigh * errors
11:23
Could also be a problem on the previous line I guess
Best just to use something like dpaste.com and show us all the code - much easier to diagnose
I'm also voting for the real error being on the previous line - probably a missing closing parenthesis or bracket.
Nailed it...
Thanks
So was it a missing closing parenthesis?
Yep
And it found another one :)
@PM2Ring CSS Rules mean you win: declared after and more specific
11:30
:) It's nice when crystal ball debugging works.
I need to be told to give up on trying to get someone to update there out of date answer.
Someone please tell me to walk away
@PM2Ring nice work.
@Oxinabox Walk away. Everyone is wrong on the internet
Thanks, Richard.
So true
@Oxinabox Just write your own answer. And if you like, you can explain why you believe the other answer to be faulty.
11:42
Done.
But now to disengage
--
I need to convince someone to pay for me to go to PyCon or SciPy conference.
I'd start with your employer :)
Yeah. Well in my case my university.
They will pay for me to got to conferences
What i need to do is work out a topic that can go into my PhD, and which is best published at Scipy
12:00
> I made an unbeatable AI, but I want to make it “dumber”
only on SO…
I like that :)
Much harder to make a realistic player than a perfect player
Hence those counterstrike bots that would just spin round in circles and kill you as soon as you walked round the corner
xD
This one time I had to implement AI in a game real quick
Wrote some really dumb code to do that, and surprisingly, it resembled human behavior
So satisfying
At uni, we had a project in which we built Chaturaji. We also had to build AIs for it. The complexity of the game made it super hard, so after trying different strategies, we also implemented a random AI.
Our random AI was able to beat every other AI we or other groups implemented.
Haha, that's awesome!
12:04
The Chaotic Neutral strategy
Fun fact: we called the AI “Easy AI” because we thought random behavior would be terrible for that game…
Haha, the other teams must have been pissed
At my college, we had an AI competition for gomoku, which is exceedingly difficult to brute force due to its large board. We might even have played on a board of infinite size.
My AI was able to beat me fairly consistently, but I got knocked out of the first round when it started making irrelevant moves and basically handing the win to its opponent. Still don't know what went wrong there.
TGIF cabbage
@Kevin Is that like Connect Four?
12:09
There's no gravity aspect involved, so no
It's more like tic tac toe, but requiring five in a row
Gotcha
@Oxinabox You're doing Machine Learning? (I snooped at your profile). Surely you can find something in that case!
I had an advantage going into the competition because I played it with my friend every day in high school math class on graph paper. So I knew the general strategies of "try to get three in a row with both ends open" and "try to produce multiple threatening lines with one move"
Turns out, such things are hard to implement in an AI.
Look at the pseudocode for minmax on Wikipedia and ask yourself, "ok, which line do I modify to get 'try to get three unblocked in a row?'"
You may as well try to get to Facebook from "Hello World"
12:14
Ha, I got totally, hopelessly nerdsnaped on that arbitrary precision floating point question @PM2. I did try to caveat appropriately, though and even got in a recommendation for mpmath. On a bright note - I did find many pretty mathematical pictures of various complex functions on the mpmath website. So time not totally wasted.... :p
It's a nice looking answer, but I noticed a couple of simple typos in the 1st paragraph. And I don't know Java, so I only glanced briefly at the code.
Just had a carvery lunch. I am stuffed.
Gammon and beef FTW.
12:30
So jealous of EU people being ahead of me in the day. Only got here 30 min ago T_T
user4433485
I've got the same with Indians
Btw what is Gammon?
user4433485
a tauren?;3
It's a joint of pork.
Gammon is hind leg of pork after curing by dry-salting or brining. It may or may not be smoked. Like bacon, it needs to be cooked before it can be eaten. It may be sold on-the-bone or boned and rolled. It may be served as a roasted joint, or as steaks or rashers. It differs from ham in that ham is cured after being cut from the carcass, and the curing process for ham may be different. Gammon hock (or knuckle) is the foot end of the joint, and contains more connective tissue and sinew. Joints of cooked gammon are often served at Christmas. The words gammon, ham and bacon are sometimes used i...
Oh, I've never heard of it
user4433485
12:32
oh lol
It's also known as "a ham" in USA.
>>> import sys
>>> (sys.float_info.dig, sys.float_info.mant_dig)
(15, 53)
How reasonable is it to assume that most Python installs will have the same output as this?
I did not disprove that hypothesis
(Win7 64bit, Python 3.5)
No idea what those constants do or whether OS etc is relevant.
I'm on win7 with Python 3.4 and got the same result
@Kevin I got the same too
Ubuntu 14.04, Python 3.4
12:34
You only need 2 points to draw a line, and you've got 4, I'd call that certain.
I suspect that CPython pulls the values straight from the floats.h C file, so anything built from the same source ought to show the same result
Sounds reasonable
What do they signify?
"maximum number of decimal digits that can be faithfully represented in a float" and "float precision: the number of base-radix digits in the significand of a float" respectively
Internally, floats are represented as sign * significand * (base ** exponent). I'm assuming dig and mant_dig are equivalent to significand and exponent respectively
What if I want 16dp? Another reason why Python sucks.
12:42
What would you need that precision for?
SCIENCE.
Whoops, I think I got the numbers backward.
Pfft science. All of your ideas are still theories since you can't prove them universally true. Us mathematicians on the other hand...
It seems likely that the value whose documentation mentions "significand" is probably related to the significand and not the exponent
Go back to feeling smart and guffawing when you say "1 == 0.999999..."
12:45
I know the proof of that, but I still think it's dumb lol
Mathematicians also can't prove anything universally true because they have to depend on unproven axioms such as "0 = 0" and "1 is the successor of 0". pfft.
I love that 0.999999 thing
morning everyone, looks like smart people conversation is happening
(I actually don't know if either of those are axioms, but w/e)
I thought hero was the successor to 0
12:46
Physics is to maths as sex is to masturbation.
All we know for sure is that hero > zero
What would physics be without math? :^)
>>> "hero" > "zero"
False
uh oh, conflicting evidence
@Programmer A lot of talk about Phlogiston and the luminiferous aether, I assume
Don't forget the split human jaw
I'm still waiting for some evidence that anything regarding string theory is true lol
12:51
I'm waiting for evidence that solipsism is false. All you P-zombies haven't been very convincing so far
@PM2Ring Ta for the heads up on the typos - fixed (although there are probably more - I've moved things around in that answer too much, but I've had enough of it now)
No worries, Richard.
I need content to consume. Anything exciting I can do/read?
Hmm, I can't figure out how to find the maximum number of digits of the exponent of a float.
@RobertGrant War and Peace
12:53
War and Peace yes, but I was hoping for something a little shorter
@Kevin Look at the floating point spec
agar.io :o
or do you want to do it programatically / at runtime?
I would prefer to do it programmatically, as a matter of principle
How does a website like curse request to open an application?
12:56
Maybe there's a custom url scheme
They use the CIA API.
@Kevin What's wrong with sys.float_info ?
sys.floatinfo(max=1.7976931348623157e+308, max_exp=1024, max_10_exp=308, min=2.2250738585072014e-308, min_exp=-1021, min_10_exp=-307, dig=15, mant_dig=53, epsilon=2.2204460492503131e-16, radix=2, rounds=1)
Yeah, that's where I got the mantissa, but I didn't see anything for exponent
Mantissa is a great word.
max_10_exp = 308
12:58
Maybe I can derive it from one of the max values
I like mantissa, and abcissa
I also like ordinate
Mantissa sounds like a terrible super villain name. Prepare to meet your doom, Integer Man!
FWIW, CPython floats are always (AFAIK) IEEE 754-1985 binary64 (aka doubles). See Wikipedia for details.
Yeah it sounds a bit like something those giant robots would fight in Pacific Rim
12:59
@Ffisegydd Sounds like someone who's recently become a priest
P.s. I love Pacific Rim and can't wait for #2
Didn't that get canceled?
How did you know I was recently ordained?
FWIW - my understanding is that CPython float is synonymous with double from the spec too

« first day (1798 days earlier)      last day (3375 days later) »