« first day (1993 days earlier)      last day (3171 days later) » 

01:54
I find the whole python 3 shift to be a travesty. So much wasted effort. Python 3 is definitely an improvement, but it comes with such a massive cost, it's hard to see how Guido (Python's creator) thought this was a good idea.
False
@speedplane anything in particular? I'm not sure what cost you are referring to...
How do I find an integer in a String?
@user3561871 any more specific example?
do you want to know the position or just get the numbers out?
@TadhgMcDonald-Jensen Yeah let me paste my code and say what i'm trying to achieve!
while(running):
        inp = raw_input("Enter quit, move, opponent \n")

        if inp != 'quit' and inp != 'move':
            num = int(re.search(r'\d+',inp).group())
            match = inp
        else:
            match = re.search(r'\D+',inp).group()
            #if match == 'opponent ':
             #   num = int(re.search(r'\d+',match).group())
              #  match = 'opponent'
            if match == 'quit':
                 sys.exit(0)
            elif match == 'move':
                if agentTurn:
Basically teh goal right now is, if a user inputs

opponent 7
It gets the string opponent and the integer value they enter
02:09
if there are only three options wouldn't it be easier to use if inp.startswith("opponent"):...
Yeah! The issue is that the integer doesn't get set into the variable sum.
That's been my issue for a while.
do you mean num instead of sum?
@TadhgMcDonald-Jensen The cost of the thousands of people-hours spent trying to rewrite code to python 3 compliant. This has slowed down the development of the language itself, it's ecosystem of libraries, and has made learning python harder.
user559633
disagree. people can stay in python 2 for some amount of time. at some point, to allow a language to develop and change, there had to be breaking changes.
correction, not "thousands" of people hours, but millions.
02:14
num yeah
@tristan I'm not against breaking changes per se, it's just that the benefit of the breaking changing in python 3 do not outweigh their costs.
user559633
in your opinion.
@user3561871 is match going to be equal to "opponent " or "opponent" (with or without space?) maybe you just need to check if match.strip() == "opponent"
user559633
i don't agree with all the python 3 changes (e.g. removing cmp or more contentiously, paying for unicode everywhere), but this is deep in the territory of "for my use cases..."
Tristan hates Unicode!
user559633
02:18
I don't hate it, but most of my code would be fine without needing/paying the cost for unicode strings. When some portion of my code goes into the unicode realm, I'm normally very aware of it for different reasons.
I've never seen any one so quick to jump to conclusions
user559633
Yes, by far the biggest breaking change in python 3 is it's change to unicode / strings. This is a good development (IMHO), but still not enough to justify the cost.
are you speaking from the point of view as someone that needs to rewrite their library to python 3?
I'm speaking from the point of view of someone who relies on a ton of libraries that need to be rewritten.
You have to check each one. Every time you upgrade the library, you risk changing the behavior of your app.
Plus my own code has to be rewritten.
Moving to python 3 will be a huge hassle when I'm forced to do it.
02:24
and why are you "forced" to move to python 3?
When all development stops in Python 2, when no new libraries are written for it, when you stop getting security updates for Python 2 code, when all the new and shiny stuff is only written for Python 3... then, I'll be "forced"
Admittedly, it may not be for another five years.
But it comes faster than you think.
whaaadduuuup people
user559633
bought a car
congrats!
cc?
user559633
thanks!
user559633
02:27
yezzur
nice!
when do you get it
user559633
next stop, getting the G off a GLI and making it the GCC
user559633
it's in my driveway right now
that was fast
user559633
that's what she said... :[
02:28
necessary
it's cool
user559633
pretty into it. i drove a GTI, jetta, and passat. the passat was just a jetta with a larger backseat and trunk. i had a mkiv gti (vr6) that i loved, but the GTI just seemed jerky without being fast enough to justify it
what did you think of the GTI. I never drove one
why do range object have a count method in python 3?
so you don't always have to count by 1.
user559633
really, the GTI seemed overpriced. the R might be nice, but i don't think that the base model GTI is worth $25k
02:32
no, whydoes range().count exist, like the method .count
wim
wim
weird. never noticed that .
user559633
@TadhgMcDonald-Jensen help(range(2).count)
wim
wim
I guess it can only ever return 0 or 1 right?
@TadhgMcDonald-Jensen

I got it to work!
user559633
what does range return after a call? (what does [1,1,2,3].count(1) do?)
02:33
@user3561871 stop posting blank lines for no reason
I already told you
Help on built-in function count:

count(...) method of builtins.range instance
    rangeobject.count(value) -> integer -- return number of occurrences of value
Iknow in python 2 it returns a list and it is the list.count method... oh it is a standard sequence method isn't it...
user559633
that's why range().count exists.
wim
wim
@tristan that's stupid reason
because it doesn't exist on xrange
@davidism Why does it bother you.
xrange doesn't exist in python 3
02:35
it's not a discussion, just don't do it
user559633
@wim xrange returns a generator
Not against the rules @davidism
wim
wim
no shit
user559633
@wim i shit you not. there is no shit
@user3561871 sorry, using the argument "it's not against the rules", while not in the rules, is against the rules
02:37
@user3561871 davidism is a room owner. Best not piss him off.
I wake up. cursing user3561871
cbg Antti
wim
wim
>>> inspect.isgenerator(xrange(3))
False
Or cursing myself for forgetting computer on
@tristan you get a 2016?
user559633
02:38
Oh weird. Is it a type of generator? I assumed it doesn't have a .count() because count demands having all the elements
wim
wim
it's a good question, why does range.count exist on python3 when xrange.count didn't on python2
user559633
xrange does lazy evaluation
wim
wim
so does range in python3
user559633
@idjaw 2013, wouldn't street park a '16
wim
wim
so what
newlines

newlines

I love newlines
02:39
@tristan xrange returns neither a generator not iterator
user559633
so i guess i'm out of 40 yard line guesses :0
user559633
@AnttiHaapala it's its own object, but i thought it lazily evaluated
Not sure what else you expected to happen there.
wim
wim
it is lazily evaluated
the weird thing is that range.__contains__ should do the same job as range.count , so I don't know why it needs 2 methods (just one returns bool and the other int but who cares)
@wim it is not interesting at all. Sequences in python have usually count. Xrange didn't. So it was added in 3
wim
wim
02:42
where is the spec for sequences?
user559633
well, this is fun tonight
count is actually there
en.m.wikibooks.org/wiki/Python_Programming/Sequences damn that wikibook on python programming is baaaad
wim
wim
02:45
ok, antti is right
>>> collections.abc.Sequence.count.__doc__
'S.count(value) -> integer -- return number of occurrences of value'




\n
DSM
DSM
Did I miss something? Are newlines a thing now? You kids and your whitespace.
wim
wim
it appears to make your avatar bigger. I like that.
user559633
check your whitespace privilege
5
wim
wim
and every can read your rep



ooh yeah
user559633
it's pretty obnoxious though.
02:50
Rep not important only italics important
wim
wim
what means italics?
user559633
@wim words from italy
wim
wim
pfff
why I only get 1 gold badge for python. I should have 5 of them by now.
DSM
DSM
It looks like Martijn might have been the first person ever in the room to use the word italics. (sigh) He beats everyone to everything.
wim
wim
did you get swag at 100k DSM
user559633
02:54
yeah well, i'm the first one to use the word looks frantically at dictionary Pogonotrophy
wim
wim
did you mean gentrify?
DSM
DSM
Yep! Although so far no one's come up to me and recognized me from the shirt.
And I'm the first in the internet to use ereyesterdaily and nihhitis
wim
wim
oh yeah , well I'm the first one to say UUID('b710b4bc-1804-4898-95e6-87fe6f57c9e6')
DSM
DSM
regrets += 1
02:58
@wim now you've revealed your mac address to all competing intelligence services of the worlf
wim
wim
but I don't use a mac ;)
it was v4 not v1
@DSM I am pretty sure your avatar is not helping either...
 
2 hours later…
04:47
Dear Friends, please advise in this pickle based issue -- stackoverflow.com/questions/36308088/…
05:14
@Anes you just ned t reopne the file for reading in bytes
open(file_Name,'rb')
05:28
also to get rid of duplicate entries just use a set
 
1 hour later…
user2743227
06:43
anyone here?
user2743227
/who
07:10
Rawr.
I've been AFK for 2-3 days. 1. Is Antti better? 2. Have we discussed native Linux support on Windows yet?
07:38
dear friends i got error in sqlite3 in code : http://pastebin.com/raw/ceLGz80u

as db = sqlite3.connect('data/mydb') sqlite3.OperationalError: unable to open database file

please advise
07:49
wrong directory, wrong permissions?
08:29
You're opening an in-memory database, followed by trying to open one from the hard-drive
Pick either an in-memory database OR one from the filesystem
Sup Brit.
Sup Fizzeh
1) He was ill? 2) I know I've not, but I've not been in the room much either (not been doing much python development)
1) Appendicitis, been in for an OP I think. 2) It looks really cool. Being able to natively use Linux commands in a Windows shell, having access to apt, curl, grep, ssh, etc.
@IntrepidBrit I am following this tutorial : pythoncentral.io/introduction-to-sqlite-in-python
@Anes does 'data/mydb' even exist?
08:33
oh sorry , I just take memory only
Well, have you heard that Canonical and Windows are collaborating and going one further? Ubuntu are looking to run on Windows.
In particular, the directory will need to exist before you can create the file mydb
@Ffisegydd My doubt is i have a daisy player app in python
I'm not sure how I feel about that
@Intrepid that's exactly what I'm talking about
@Anes I don't have the time to help so there's no point explaining it to me.
08:35
can use memory database for same , I supply this as deb file
?
Fizzy - Fair enough! I chatted to someone the other day who didn't realise the two were linked.

I'm not sure how well it'll really work, since Windows love not giving you full control of your OS. But since getting some half decent command line tools would rock.
But I do worry about "Embrace, Extend, Extinguish".
@Anes I don't know what that means. But from the instructions you linked us to:
"We can use the argument ":memory:" to create a temporary DB in the RAM or pass the name of a file to open or create it."
I've emphasised the pertinent word
@IntrepidBrit I think it's a good step forward personally, but then I use Windows the majority of the time so it's a win from my point of view.
I currently am stuck developing on Windows, because every Linux distro is now crashing my work computer
(apparently there's something in the nouveau drivers that's doing it)
I guess we'll wait and see how it goes. But unlike previous systems in the past, I think Windows will struggle to join it then beat it
I doubt they want to (well they'd like to, but I don't think it's realistic that they would)
I think instead they've realised that they can learn/steal from Linux.
09:01
I wonder how they'll handle the licensing issues
Cabbage!
@poke what's your thoughts on the Ubuntu/Windows news? (As a self-proclaimed happy Windows dev)
I’m excited over the possibility, as that allows a much easier way to utilize Unix workflows on Windows systems. But I’m also very curious in how this technically works. If you look at the screenshots, you can see that you have an actual Unix filesystem within that bash, so that seems a bit weird to me (normal drives are available at /mnt/<driveletter>; so no idea where the other common system directories are—probably some virtual path within the Ubuntu subsystem)
Public service announcement: lack of research ≠ too broad.
It's not even a subset.
09:07
At the same time, I’m a bit concerned as this makes cross platform too easy.
@MartijnPieters There are many ways to achieve that. Since we don't longer have the "lack of research efforts", I find it the most suitable. — Maroun Maroun 27 mins ago
bzzzt
@poke yeah and vice versa you can get the Linux filesystem at C:\Users\poke\AppData\Something\Something\Darkside
Getting real cross platform support working on Unix and Windows is a difficult thing and comes down to education and keeping certain standard so it is truly cross platform (e.g. not assuming a Unix environment but keeping it open). There are many projects who did this really well (Python is a prime example, and Node is also pretty good at this).
I think the thing I'm most happy for is ssh...
Oh man scp too...
But there are also a lot of other systems that assume a Unix environment far too much. Ruby is a prime example. Getting anything less simple running on Windows is a terrible experience. It already starts with the fact that Ruby has to be installed in a path without spaces or things become possibly unstable.
I fear that now, instead of actually working toward real cross platform compatibility, by fixing those wrong assumptions, people tend to say “well, use the Ubuntu subsystem on Windows” to evade this whole situation.
09:11
Yeah that's a valid point that I hadn't considered.
And that’s a bad thing. Because it might be “native” but it’s also just “quote native unquote”.
They said they ship real Ubuntu binaries, so it’s native Ubuntu, but not native Windows.
So tl;dr, I’m really curious how this develops, how this actually works under the hood, what restrictions are there, and how this will impact everything. It makes certain things a lot easier for development on Windows, but it will probably also alienate the real Windows-based development.
I wonder if this could make compiling Python libraries on Windows easier :/ but then the Python version it was compiled against would be the Ubuntu version, not the Windows version, so probably not.
I mean when you have to get C/FORTRAN compilers involved (numpy et al.)
yeah, the things you do within the Ubuntu shell will be limited to that exact shell. It’s not native Windows; it’s native Ubuntu :/
And of course now when we're discussing Python with people we'll have to ask "So are you using cmd.exe, PowerShell, or Ubuntu-Bash-In-Windows?"
We should have bets on how long it'll take to get the first "I installed my Python library but can't find it." being caused by installing on Windows and trying to use Ubuntu or vice versa.
09:26
MongoDb: The update() method either modifies specific fields in existing documents or replaces an existing document entirely.
So, update with one field just blows away all of your documenyt
Except that one field....
I don't understand why people use this ... Even MySQL is better ...
@Ffisegydd PowerShell and cmd.exe luckily have no difference.
@Carpetsmoker It’s a difference concept. You can’t compare them.
Or, well, you can, but you shouldn’t.
Well, that, I understand... It's more the incomprehensible documentation and awkward commandline interface...
(which crashes)
Cabbage
@Carpetsmoker Why? Because MongoDB is web scale NSFW
SyntaxError: Unexpected identifier at q.js
That all I get. Not even a column number, line number, nothing.
Well, that's not true. It also prints the time.
09:42
@IntrepidBrit I have mixed feelings about the Bash / Ubuntu in Windows thing. On the one hand it could be very convenient, and it could expose lots of people to a decent CLI and the joys of Linux who wouldn't otherwise check it out. But my gut feeling is that if it works well then it will reduce the number of people installing a stand-alone Linux, which would be bad for Linux in general. And if it doesn't work well it will give people a bad impression of Linux.
I wonder what the limitations are going to be. Like, can I run an X window system from it?
I used to run OpenBox on Windows
Or maybe it was Blackbox ... something with Box anyway...
dosbox
;)
09:47
@poke Good question. Maybe they don't need X; after all, GTK and Qt are cross-platform. But I don't imagine there'd be a lot of motivation to write some of the smaller Linux GUI frameworks to use the Windows API instead of X. Mind you, writing in raw X isn't exactly a lot of fun...
I wasn’t talking about usefulness, only whether it’s possible, or if there are going to be some limitations on what you can do.
I don’t think it makes much sense to run a GUI environment in a Windows window labeled “Ubuntu Bash” :P
@PM2Ring I'll be interested to follow progress, but I have a sense of it reinforcing the Windows hegemony.
OTOH, there is Cygwin/X "X Windows - on Windows!" and Xming X Server for Windows
Hello Guy, I need little bit help in creating exe file from a project source. I am using pyinstaller, But when i run created exe file it showed fatal error "app returned -1".
can someone please tell me how include dependent files in exe
@poke Sure, just doing Bash doesn't actually need X, just Linux-style console handling.
09:52
@PM2Ring omg
There's also VcXsrv Windows X Server, which I just saw here: superuser.com/questions/99303/…
I used to use Xming to get FORTRAN PGPLOTs over PuTTY.
@Karan It is in the docs - google "include dependencies pyinstaller". Unfortunately I have to leave now. But if you're sure your problem is missing included dependencies - one of my old answers here may help.
Rhubarb peeps.
Seeya, Richard.
rhubarb!
09:56
thanks Richard. i will check
10:49
> Hi, I stumbled on to your-website-while doing some-research-on your industry and I noticed that you were not currently taking-advantage-of-S-E-O-for your business.
> Cut a long story short I think I can help your-website-rank on-SearchEngines-a lot easier. I have compiled a website-audit which lists all the areas that your-website-needs improvement.
> Would you be interested in this-no-cost-18 Page-Website-Audit with-no-obligation? Please reply with your phone number and the best time to cal.
What’s with that dash-overuse?!
cbg! @Carpetsmoker update with one field just blows away all of your document when you don't specify any update operator.
Fun fact: The domain they mentioned in the subject is a domain that I neither own, nor that anyone owns. It doesn’t even exist.
Every time someone sends an email containing the words "Kind Regards", I kill a puppy.
morning
@RobertGrant and just in time, I see;)
@poke to avoid spam filters?
"website", "research", "SEO", "audit", "no obligation" all removed as such
@AndrasDeak But “taking-advantage-of-S-E-O-for” is like the worst SEO ever.
They are bad at their job!
10:55
why?
I can’t search for SEO in my mail account and find that email
oh
but SEO is the devil:P but if you read the email, you could realize that it would change your life forever
or they believe that gmail/your-provider-of-choice filters SEO, while the user themselves might be interested
Yeah, for the domain that nobody owns!
I wonder if they could really optimize it so that domain appears on search engines..
10:56
why not?
just a few hundred spam posts on SO:P
That would be quite impressive
I don’t think any search engine will pick up a website that does not resolve to a server.
possible, I don't know anything about how those work
google probably doesn't...you could try Bing:P
or Altavista
Lycos
@user3100115 You need to use $set ... I figured it out ... But the docs were very unclear on that imhop
Mysteriously corrupted MongoDb is fixed :-)
yay :)
11:01
I wonder what the reason is for this btw:
            $all_elements = json_decode(json_encode($page['fields']), true);
Why would you want to do that?
deep copy of an object
That's a very non-obvious way of doing that .. surly there are better methods in PHP?
Plus, it's only used in a foreach loop for displaying − it's never modified...
No idea if there’s a better way in PHP, but it’s a way; it’s actually a common solution in JavaScript to go through json
if it’s not modified, then that’s weird
DSM
DSM
Good old parse/stringify! Woke-up-early cabbage for all.
It's one of those PHP apps with indentation all over the place, so that should say a thing or two about the devs who wrote it (...although it's hardly the worst I've seen)
This is still some of my "favourite" PHP code encountered in the wild: tmp.arp242.net/wtf.png
(well, PHP/JS)
11:13
@Carpetsmoker You're not the first. stackoverflow.com/questions/30605638/… :)
@RobertGrant please take time to consider the impact of your remarks on puppy lovers worldwide. Kind Regards, Richard
@user3100115 And probably won't be the last ... I find the wording of the db.collection.update docs rather confusing (and I actually read them before issuing the command!)
@user3100115 I like how that questions links to Wikipedia for Python and MongoDB but not to the mentioned manaual for update_one().
To be fair, the “core” Mongo manual mentions those operators: docs.mongodb.org/manual/reference/method/…
@poke just noticed that. :) yes it mentioned but the fact is that shell methods actually lagged behind the other drivers in implementing the method.
11:34
@JRichardSnape: I saw some incredible fiddle playing on YouTube a few days ago: the classic bluegrass piece Orange Blossom Special performed by Rhonda Vincent & the Rage. Also check out this version by the Bistodeau Family Band. The Bistodeau girls are (understandably) not as fast as Rhonda as friends, but they still do some interesting stuff.
@PM2Ring Ahh, orange blossom. I continue to use that to guage how out of practice I am :) Wow - they re fast though!
They sure are! I was impressed enough by the solos, but they can even maintain that speed while interacting in those duets!
I also stumbled across this gem: The Who at Albert Hall doing Baba O'Riley, with Nige on violin.
@PM2Ring That's pretty cool stuff ... I need more bluegrass in my life ...
@PM2Ring neat:)
ooooh leftie fiddler, nice
that looks just as wrong as watching a leftie cut anything with a knife
I really like the solo the leftie takes (although they're all pretty amazing and the unison stuff even more so). My dad plays fiddle left handed. It doesn't get less weird to look at with time - I can vouch for that.
11:42
:)
How to add content in each line with python my code is not working fine
with open('testfile', 'r+') as f:
#contents = f.read()
print f.readlines()[-5:]

with open('testfile', 'a+') as f:
f.writelines('[email protected]')
DSM
DSM
Did you look at the documentation for writelines?
not yet sorry
DSM
DSM
...
@Carpetsmoker Here's a rather cute clip: the Amber Dixieland Bluegrass band, featuring the diminutive Amber Godin née Alexander on Banjo, playing at her wedding. Her husband Jeremiah is on the double bass. They're playing another bluegrass classic: Foggy Mountain Breakdown. It's not their best performance on YouTube, but it is very cute. :)
11:50
@MartijnPieters @JonClements uh oh, someone should handle this
@AnttiHaapala is that spam?
well unintentional spam, do not flag :D
@Anes Well, you should have look at the documentation for writelines **before** coming here. I admit that the name of the writelines method is a bit misleading, since it doesn't actually add a newline character to the end of the strings that it writes.
11:51
so what should the handling be?
@AnttiHaapala oooh
@PM2Ring ok
well, there's disclosed affiliation in his profile, so the only question is whether the advertisement is called-for
oop, deleted now
I was going to say "it just looked NAA to me"
yeah
me too ... damn carpetsmoker deleted it; I was going to write a comment there :d
@PM2Ring I wish I learned to play the violin when I was little. I really like it as an instrument.
@Anes: Also, you have been to this room several times, so you should know by now how to indent your code. And please try to improve the quality of your questions. Otherwise, your questions will be ignored, or even worse, you will get kicked out.
11:56
yeah I tried violin in my old days, the song was called "cutting frozen pigs with rusty bandsaw"
or something
heh

« first day (1993 days earlier)      last day (3171 days later) »