« first day (1418 days earlier)      last day (3521 days later) » 

12:11 AM
no one calls me smart :(
 
Maybe you just need to do a bit more of the "counting out the number of miles to the abandoned mine where Timmy is trapped by scratching the ground with your paw" ...
 
I only do that if they pay in scooby snacks up front - otherwise the kid gets it
-1
A: Inheriting a python class while adding a property

Michael PetchI have had to do this in my own code. the setattr function which takes the an object, name of a property and a value and sets it without calling any functions that may have been overridden by a child class. Replace: self.prop = prop with: setattr(self, 'prop', prop)

In a comment, just said to this guy, they're exactly the same
he said "No they're not"
I asked him to clarify why not
he now seems to have retracted the comment :)
Don't even see how it's remotely related to the quite confusing until a use-case is stated question
 
12:35 AM
@Zero got in another using ast - yay me... won't get the votes it deserves though, but oh well
 
ast is one of those modules I know exists, and am happy it does if I ever need it, but know very little about and am not strongly tempted to delve into.
 
It comes in useful when the moon is blue
 
Of course, ast.yellowify(heavenly_body) ...
 
Why yellow it? Thought it's meant to be Mr Blobby coloured?
 
I had completely forgotten about Mr Blobby ... thank you so much for dragging that peak of British culture back into my conscious mind :-P
 
12:45 AM
blobby blobby blobby!
I'm up late... you gotta suffer with me matey... that's what mates are for :p
Did have a nice kebab though
 
Still watching Feynman lectures ... and imagining Noel Edmonds' vile smirking face inching into view in the background ...
 
I use to like Noel's House Party
Was better than Strictly Come Dancing, or Come Dancing On Ice, or Britain's Got Talent or whatever the beep is on now
 
Wasn't it on more or less when DW is on now?
 
I can't remember if it was on/after Jim Davidson's generation game
 
I have some recollection that it was either immediately before or immediately after the lottery ...
 
12:49 AM
Saturday nights use to be awesome
Gladiators/Big Break/Generation Game/Noel's House Party
oh those were the days :)
Or maybe it's just because I was much younger and I'm looking through rose-tinted specs
 
puts on best diplomatic hat ... I think this is an area where our tastes differ :-)
 
phew - something we can disagree on at last... I was starting to worry :p
 
Mind you, I would have been in my early twenties at the time, and therefore the most intellectually snobbish period of my life.
 
Peasants like you get out of that stage do you? Sniffs
 
Says the cartoon dog.
 
12:54 AM
wags tail innocently
Why do all the good/interesting questions come at 1am :(
 
Hi guys
ok.... \x27 how would I turn that back into a single quote in python?
 
@Johnston you've gotta be kidding ...
 
har har har
@ZeroPiraeus Just tell me ... what do you call this format of \x27
 
I suppose I'd call it a hex escape, if I was going to call it anything ...
 
I keep getting confused between the different ways of encoding....
 
1:04 AM
Maybe keeping this handy will help?
 
it's not encoding - that's just escaping :)
 
Here's my problem.
btw thank you that is very helpful
But you can unescape it right?
 
What does unescape mean to you?
 
User types in a single quote... I send it to the command line. bash can't handle a single quote. I turn it into a \x27.. I need to turn it back in order for it to be in it's original form.
 
Bash can handle it if you escape it properly to start with
 
1:09 AM
Okay, maybe this is where you're getting confused - \x27 is ' in a Python string.
 
@JonClements I thought it could if I did something like this:
ulimit -t 2;getcode() {
cat <<SWIFT
$1
SWIFT
}; getcode 'import Foundation
println("hi there it's great to meet you")' | xcrun swift -v -sdk $(xcrun --show-sdk-path --sdk iphonesimulator) -
By putting it in a bash heredoc I thought it would ignore it
 
why would it?
 
I read that If you unsure about the quotes, just use the bash's heredoc feature: Sorry I meant heredoc
 
Classic
Not sure why I keep listening to it though :)
 
beautifully green and crunchy cabbage for all the people of the dark council!
 
1:22 AM
no no no... we're not the "dark" council
we need to be more subtle
the "Council against White"
no-one will ever guess!
@Peter I wrote an answer using ast - yay me... always like 'em cos I never get to use it
 
I think you have to contact @Ffisegydd and @davidism -- they are responsible for our naming conventions..
@JonClements ?
 
@Peter darn... keep forgetting I'm just the Chairman now...
 
-- a very good one, I must say ;)
 
I just sit in the corner and sleep... it's remarkably difficult work, I must say
but the multi million pound salary and supply of biscuits makes up for it...
 
:D
am I the shitface because I don't respond to facebook challenges?
 
1:29 AM
I ignore facebook most of the time
 
I mean, I didn't ask for being asked.. I just hate this..
 
You're not referring to this ice bucket thingy?
 
this whole facebook-challenge thingy is all about "showing yourself" -- not serving any good..
@JonClements nope, there is a hungarian challenge in the last weeks
 
ahhh
I just ignore all that rubbish
 
it is about writing a hungarian poem and challenge other 10 (!)
 
1:31 AM
zpStr* = "no thanks";
that's hungarian isn't it? :)
oh wait... or is that hungarian notation
 
@JonClements I think I will do that too.. after all, it has to be stopped at some point, otherwise it keeps challenging over and over again, doesn't it?
@JonClements that was a very bad one :D:D:D:D:D:D
 
I just use it to say happy birthday, arrange meet ups and share some photos now and then
 
is this the end of the day, or the beginning for you?
 
don't use it to play games/chat/whatever
@Peter not sure
I had a snooze in the afternoon which probably wasn't a good idea
but don't have to do anything until 10am... so all is good I guess
 
I only use it for chatting -- and put up some quotes I like randomly as status messages..
@JonClements believe it or not, I'm almost back to completely normal
 
1:34 AM
1) go to facebook, put up random status message, 2) get anger management relieve by visiting the python room, 3) walk coltrane, 4) do work stuff? :p
 
I get up around 3-4 AM and go to bed at 7-8 PM
@JonClements that's pretty much it :D
 
I wouldn't say that's normal... but okay... brb
 
:D:D:D:D:D:D:D:D
rhubarb to you ~
 
1:45 AM
you off?
 
no, I'm still here
 
oh... well, I'm not off yet :)
 
you said, quote: "brb"
 
how's the C room going - haven't checked there for a while
oh... the brb was that puppies have to use the toilet occasionally
 
what a well-trained doggy, who's the good boy, who's it?
:)
 
1:47 AM
ME ME ME!
is it ME, is it ME
wags tail
 
do you ever had a dog? (btw)
 
Use to have boxers and labs
looking after a rescue dog at the moment
 
rescue dog?
 
those that end up in kennels cos the bastards that had them just threw 'em out or mis-treated 'em
 
(aaaahh.. boxers are amazing, I really love them -- but only without the cut ears..that is just terrible..)
 
1:49 AM
normally they cut the tails on boxers
 
which is okay, I guess
 
hell no
 
no?
I never had problem with their short tails, but with the ears..
@JonClements so let me get this straight -- you are now having one, or willing to have one?
 
I have a problem with both - it's mutilation to certain people's "tastes" of what dogs should like, and I'm dead against such things
I'm baby sitting one for a while until it finds a more permanent home
 
me too, but dog with short fur, and long tail can get their tails injured very often
 
1:51 AM
then worry about it when it's injured, don't mutilate it to start with
 
@JonClements oh I see.. that's very kind of you
@JonClements fair enough, I absolutely understand your point
 
it works for now because I'm at home pretty much all day
but I'll have to start travelling and I don't want the fella to be left alone
he's already been abandoned
I don't want him to have that feeling again
 
I used to have a boxer when I was 14, she was called Jenny
unfortunately our neighbour chased away when she was a little puppy
(you see, she was in the garden, while I was at school)
@JonClements so what will you do about it?
 
Find him a more permanent home with the aid of the rescue centre
he was on the equivalent of a dog's Death Row...
 
oh nooo..
I don't know actually who to blame for all the large amount of "returned" dogs..
 
1:56 AM
@davidism cbg
 
is it the parents? the adverts? or simply poeple with wrong judgements?
 
cbg
 
cbg @davidism
I mean, sure, bringing a dog into the urban life is not an easy thing, and it is not a short project either
but it is a well known fact -- why people not accept that?
Jon? still here?
 
yup
was just looking at some notes
@davidism did you get the note about postgres ?
 
Yeah, although I'm not sure if we can set up replication.
I only have create database access to the postgres server.
 
2:03 AM
'cos it's a shared postgres?
I thought WF recently introduced private mysql/postgres instances
(But then they count towards your 512mb, instead of using the shared one, which counts as 0)
If we've got an available resource not being used, then let's use it in some way... I'm up for the cheaper the better if we can :)
 
@JonClements I'm not sure if you know the answer for this, but let's just give it a try: I created a type, something like: struct { void *p; char d[]; } and my attempt is to store two generic values, with a single malloc call. So it is like: mystruct = malloc(stuct_size + data1_size + data2_size) and then memcpy(mystruct->d, data1, data1_size); and then mystruct->p = mystruct->d + data1_size; and at last memcpy(mystruct->p, data2, data2_size);.. and while I can retrieve
the first data, I cannot do the same on the second one -- is it some kind of alignment issue?
 
don't wanna think about C and memory allocations at 3am :)
 
(I mean, when I malloc a space separately to "p" it works fine)
 
Oh, I can compile a postgresql instance, not really what I had in mind.
 
@JonClements grr.. but fair enough
 
2:08 AM
@davidism what are your thoughts then?
 
Not really sure. Mostly was just offering a way to not use Linode while we don't need it.
Nidaba will need Linode when it's running, but it's not yet, I'm assuming everyone just has their own local dev instances with whatever they're trying out.
 
Ok I think I've figured most things out. There is one thing that is really bugging me here. I am sending a post request which I urlencode with urllib. The line the user enters is let pattern = "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9]‌​)[0-9]{11}|6(?:011|5[0-9]{2})[0-9]{12}|(?:2131|1800|35\\d{3})\\d{11})$" a regex. I use urllib.unquote(run_this) to decode the url encoded string. In that regex it is changing \\d to \d which is causing an error.
 
we don't have backups enabled on sopython.com - maybe you could set up an rsync job @davidism?
but then, we've got the code in github anyway... ummm
@davidism I'm quite happy paying what I am, because at some point we may need it, and it'd be awkward to downscale and upscale again
 
OK
 
the only thing that may be useful is use of email
I'm paying google apps for work for two accounts at the moment for the sopython.com
Might be worth pointing the MX records at WF
I'm extremely anti about setting up an email server on sopython.com as they're notoriously difficult to get right, and if you get it wrong, bad things happen
 
2:23 AM
Damn it's the heredoc that is escaping it
 
 
2 hours later…
4:03 AM
ahh.. live performance:
 
4:43 AM
woot... birds are chirping, and the cockerel is doing its noise - time to get up I guess :)
 
4:53 AM
note to self: stop getting places that are next to farms
 
5:48 AM
@Jerry cbg
 
@JonClements Cabbage!
sorry for the late reply :s
 
no worries :)
 
6:39 AM
Cbg()
 
cbg
@Ffisegydd STEWIE!!!!!!!!!!!!!
take a wild guess at who was working all night, and is going to bed in a minute
 
@Jerry cbg , where have you been?
 
now those are called admins no one else ;) zdnet.com/rebooting-on-mars-7000033213
 
6:56 AM
@Jon Briiiiiiiiiiiiiiian! And I guess you? :P
 
oh good guess Stewie, good guess
 
is this a thing we have to worry about?
 
There's a few things I want to go through later re: the room... but that's not that important it can't wait until I can properly verbalise and not holding my eyes open with matchsticks
 
Ok. Any particular agenda?
 
Gimme 4 hours
see you then, I'm flaking
 
7:01 AM
Cool
Bai @Jon
 
rbrb
 
using Redis now
 
@Swordy I've been here. You haven't been here lol
 
U weren't since the past 1 week
 
7:25 AM
I was here. I have put a line in the other chat almost everyday
 
I just love this: Open Source Report Card
4
I know it is just a toy, and I shouldn't have to take it seriously, but still I like reading what it says about me :)
 
7:40 AM
Morning all :)
 
@PeterVaro Nice! Apparently I push at 4 am!? (I'm sure I never did) I guess that's a timezone thing lol
 
@Ffisegydd nfw
 
@Peter nfw really? I obviously didn't zoom that far in :P
 
@Ffisegydd I killed it ;)
I have nothing left just black white display
@Jerry it tries to guess the timezone based on your GH profile settings..
 
@PeterVaro Oh, I never noticed I didn't have a location. That turned 4 am into 4 pm :)
that reminds me, I have a few pushes to do
 
8:45 AM
Hi folks, I am in the organizing committee of PyCon X (don't want to disclose the name). So, I am looking for suggestions on who the keynote speaker should be. Any advice?
 
Why don't you want to disclose the name?
 
Lol I have no particular reason. So, X = Singapore
 
I gues.. this is what we call trust..
 
@Peter the arrow is pointing past her left shoulder
Look at it when he releases the tension, it slides behind her (our of shot)
Or it seems to anyway
 
hmm.. yeah.. although from this angle, I'm not 100% sure.. anyway.. it is still brave
 
8:59 AM
Cabbage!
Can anyone recommend a simple example of a generator function which is easy to understand but shows benefits when compared to generating list first?
 
Infinite fibonacci generator?
(Can't generate an infinite list)
 
Yeah, I am thinking more about example which can be done using list, but for example takes a lot of memory.
 
Infinite is a lot of memory :P
def fibo():
    a, b = 0, 1
    while True:
        yield a
        a, b = b, a + b
 
9:39 AM
Can someone look at stackoverflow.com/q/25640515/3005188 and give opinion on whether my answer is sensible? EAFP is a standard and commonly used coding style within Python but one of the other answerers (who's answer was wrong until I pointed it out to him but let's not get sidetracked here :P) disagrees.
 
9:52 AM
hi I am new to this chat room. Can anybody help me to choose driver for mongodb
 
A driver?
 
What do you mean by a driver?
 
to create a connection between mongodb and python
 
9:53 AM
i have to use a large database
 
Ah I see, yeah pymongo is good.
 
oh thanks
 
I've used pymongo previously. It's got a simple API which is similar to the actual mongodb language that you would use in the console
 
is there any framework like thing, am not sure
 
look in the alternative drivers link on the above page. There are a bunch of framework tools.
 
9:57 AM
thanks
 
If you can share a teamviewer session. I can click it for you.
just kidding :)
anyone knows why pandas read_csv could throw out this error:
ValueError: No columns to parse from file
 
so nice of u, anyways thanks again for the help
 
I'm raking my brains on this.
 
@user994572 have you selected the correct delimiter?
Have you checked it's the correct file and there's actually data there?
 
I have a simple read_csv line and it goes on to throw this thing.
yes..let me show the line I used
df = pd.read_csv(filepath, header=None, parse_dates=[[0,1]])
 
9:59 AM
i think ur csv does not have any value
 
I checked the data is there.
 
Should you have a nested list with parse_dates?
 
yes...all the examples do that.
Looking for a solution I got to this place: github.com/pydata/pandas/blob/master/pandas/parser.pyx#L487
 
@user994572 not true, not all examples use it. It depends on how you want to parse the dates.
[[0,1]] means you're combining columns 0 and 1 and treating them as one date, is that correct?
 
right
 
10:02 AM
Ok, have you checked the delimiter? The default is sep=','
 
all my data is like this
2014.09.02,20:00,11.8,132.3,69.1,23,117.11
 
ok
 
I'd like to combine the first two as datetime.
one more thing I forgot to say:
 
use something like this
df = pd.read_csv('xyz.csv')
df=df.fillna('0')
 
this works for the first time or a few number of times.
The setup is like this: Another application writes the CSV file and this program reads it.
 
10:04 AM
Has the other application closed the file? Or does it still have it open?
 
Yes...when it closes the file, python watchdog lets me know that the directory has been modified and I will then go and read the file.
I've made sure that the other application doesn't write the CSV file exclusively ie. shared access.
 
Can you copy the file into a new file that isn't being accessed at all by your other applications and try it? As a test
 
ok. I will try that.
 
And if that doesn't work, copy a few lines of the file into a gist or something and I'll save it and try it here
 
ok...thanks.
 
10:18 AM
i don't like name things .. particularly apppppppp
 
1 message moved to Trash
 
@Ffisegydd, your suggestion to save it in a separate directory and test, worked.
 
@rajasimon please see sopython.com/pages/chatroom for the chatroom rules. Please don't link your recently asked questions looking for attention here.
 
@Ffisegydd oh . my bad....
 
@user994572 right ok :/ in that case something strange is going on between your applications :/
 
10:19 AM
@Ffisegydd now thats what i was referring to yesterday ;)
 
so this does look like a race condition between the producer and consumer.
Is there an os-independent library in python to see if the file that I am trying to access is in use by other applications ?
 
7
Q: Check if a file is not open( not used by other process) in Python

zengwkeI my application, i have below requests: 1. There has one thread will regularly record some logs in file. The log file will be rollovered in certain interval. for keeping the log files small. 2. There has another thread also will regularly to process these log files. ex: Move the log files to oth...

Possibly
But they are system dependent
 
My system independent method - lock files :)
/trolling
 
Don't use files, just keep everything in RAM :D
If you need multiple data? Copy it.
 
Write lock files TO RAM
 
10:22 AM
Copy. That is a simple and good idea.
but when trying to copy if it says that the file is already in use or something. I'll be back to square one.
i'll give it a shot.
Thanks @Ffisegydd
 
I love it when sarcasm and jokes leads to the solution of a problem :)
@user994572 no problem
 
It's as my mum always says - many a truth spoken in jest
 
10:49 AM
cbg
(late, forgot, oops)
 
cbg
Are there other commands that would have the same effect as rm -rf /
 
In bash? Or Python?
 
@Johnston Why? Are you trying to obfuscate the command so you can trick someone into destroying their computer?
 
@MartijnPieters No. I am trying to think of ways to protect myself
 
cbg
omg :D
 
11:04 AM
@Johnston Don't allow random scripts to have root privileges?
 
@Johnston yes there are.
say you have a command foo
what does it do?
os.system('rm -rf /')
@Johnston on unix system you can generally assume that
a program that resides in /bin, /usr/bin, /usr/local/bin or so, will do the thing that you expect it to do, that's it.
 
if it geniunely resides in there, and hasn't been maliciously alias'd :)
 
it is hard to alias if you have a full path.
 
But not impossible.
 
it is impossible, if you do not have the privileges to already do whatever you want
 
11:08 AM
Agreed - see my response about not allowing random scripts to have root privileges ;)
 
Can you stop a REPL from having root privileges? Save you are allowing a user to use a repl... Can you stop the repl from doing os.system("/rm -rf /")
 
@Johnston do not give the user the root password...
 
I mean I know based on yesterdays convo with @MartijnPieters I need to use a VM.
os.system would still need to enter the root password? Obviously it would need root access. but I guess if you didn't run the python script as root then it can't do root things.
 
@Johnston If you are using a throw-away VM, why would you care?
 
11:15 AM
@MartijnPieters You're right.
 
Apart from not giving the python process privileges to clear the root file system, if they somehow managed to swing that anyway, you are tearing down the VM after a timeout and the next one you spin up is fresh and new and not altered anyway.
 
VM is the only way to go.
 
I think the best course of action for you is to not allow anyone access any system of yours for now :D
 
Its like that guy said. Don't try and sandbox python... put python in a sandbox.
 
bc there is no way to sandbox python
as such
there are too many holes
 
11:17 AM
Right.
 
if not else
then if you allow your program to do anything at all, tehn it can always consume all your memory if you do not set a resource limit :P
 
I should not be, but still am amazed from time to time to see what crap gets upvotes anyway.
 
@MartijnPieters way to build the suspense. .. for example?
 
x = 'a'
while True:
    x = x * 2
 
@AnttiHaapala Right but I could preface the thing with ulimit
 
11:20 AM
yes, but no sandboxing within python can help you with that easily
 
hmm ok
geeez. I better figure out this vm thing
 
11:36 AM
TREMBLE MONGODB! When postgresql 9.4 comes there is no reason to use mongo
 
0
Q: How to create flask form to get data dynamically from db and write back in db selected data only

jayprakashstarI want to create a form in flask such way that i can upload image and put name of image and select location of image from my db and then display all images from that place and can select some images and can write their data in db. something like that https://drive.google.com/file/d/0ByF5SjLL_-y...

The person commenting isn't helping there either..
 
Nice drawing though. haha
It's not like they would come to some sort of solution after that discussion
How can I get base64 to encode "♠" I am getting an error UnicodeEncodeError: 'ascii' codec can't encode character u'\u2660' in position 127: ordinal not in range(128)
Just nvm that.
 
12:02 PM
Base64 encoding is for binary data. :-) So encode that explicitly to a binary string.
 
@MartijnPieters ok...
 
(Personally, I hate VMs. Feels like cheating ;) )
 
@MartijnPieters What am I looking for in order to do that?
 
@Johnston unicodestring.encode() gives you a byte string.
(the python 2 str type is a byte string, it's characters are bytes in the range 0-255).
 
12:13 PM
(Why are you wanting to b64 a spade character?)
 
@MartijnPieters Aha.... I am getting really confused.
@IntrepidBrit Oy.
 
'\x00\x01\x02\x03...\xff' is the legal range of a Python 2 string.
A is just the ASCII codepoint, it's the integer value 65 really.
 
@IntrepidBrit I have a repl online for Swift. swiftstub.com I need to take the user input and send it to the compiler in a vm. certain characters get mucked along the way.
like a user types length%10 == somevar
 
@Johnston Righto, makes sense
 
user559633
@AnttiHaapala why do you say that there will be no reason to use mongo after pg 9.4?
 
12:18 PM
@MartijnPieters once I encode it... How do I get it "back"? I would think it would be just decode
 
@Johnston If you decoded the Base64 data back to bytes, then yes, you can decode to Unicode.
 
Cbg :)
 
OK!
 
stackoverflow.com/posts/25644070/revisions damn that was an awful post...
Still is pretty bad even after my edit.
 
12:25 PM
This would have sufficed: "So, Is there any way to call Java API from Python?"
 
user559633
At least the asker will definitely appreciate the help @Ffisegydd
 
12:52 PM
I used the following to get the lxml version :
>>> from lxml import etree
>>> etree.LXML_VERSION
and got
(3, 3, 5, 0)
what does this mean?
 
It's version 3.3.5.0
 
and what is the latest one?
I messed up some updates and wasn't able to start ipython. Had to install it again :(
 
@Swordy don't know, Google?
 
The latest version is lxml 2.2.8, released 2010-09-02 (changes for 2.2.8). Older versions are listed below. huh?? o_O
yeah mine's the latest :)
The official site hasn't updated it
 

« first day (1418 days earlier)      last day (3521 days later) »