« first day (1735 days earlier)      last day (3437 days later) » 

00:55
anyone seen a FutureWarning in pycharm before?
01:12
probably - but at 2am in the morning for most ppl.. you're unlikely to get any other response :)
02:25
cbg all
Cabbage nuppy :-)
don't spose my evil twin fancies making me a cup of tea? :p
Even I could use a cup of tea right now :D
The last two weeks have been very long, with less or no sleep.
I don't know how you manage :(
magic ? :p
Yes, that must be the only plausible explanation :D
02:57
@thefourtheye some Bonnie Tyler? youtube.com/watch?v=lcOxhH8N3Bo
I am on my mobile. And I have a meeting after sometime. I ll check that when I get back puppy :-)
make sure you do puppy :)
03:32
  iterable = xrange(10)

  ge = (x*x for x in iterable if not x % 2)

  mf = map(lambda x: x*x, filter(lambda x: not x % 2, iterable))
which is more readable? the former, ge or the latter, mf?
I'd go for ge. it's easier to read, in my opinion. Laurel. :)
Cabbage, potato! What is the server and channel on IRC about Python?
He who would cross over to IRC
Must answer me
These questions three
Ere the other side he see.
waits for the response
@AaronHall peas .. didn't get that. Laurel!
04:01
Ohhh!... well, ask me the questions, bridge keeper! I'm not afraid. @AaronHall
So, whats hot in the python world?
I'm going to sleep, people, have a great night!
Recursion is always hot in the Python world
More like a hot code path
04:27
Pep8? I saw that on Irc, laurel
04:47
Cbg all
05:21
Cabbage
cabbage
06:10
Is there a way to do this as a one liner
a=[[2,3],[2,3]]
c=[]
c.append([v[0] for v in a])
c.append([v[1] for v in a])
print c
[[2, 2], [3, 3]]
c = [list(p) for p in zip(*a)]
@vaultah thanks mate
But then we could do this also right list(zip(*a))
list(zip(*a)) will produce a list of tuples
[[2, 2], [3, 3]] is a list of lists
yes you are right
:D
But I have one doubt though
*a will produce only [2,3,2,3] right
or [2,3] and [2,3]
Sorry found out
Thangs again :D
hi..
sry
cbg
06:24
@AvinashRaj cbg
Why sry
for putting hi
forgeted the python chat room lang
Ha ha :)
@AvinashRaj why is not my name coming in top 50 users from Chennai
@VigneshKalai let me check :-)
06:53
cbg
07:05
Hey up
@VigneshKalai Change c in chennai with C
and also do the same for i also.
So ChennaI right @AvinashRaj
Chennai
Cbg :)
I got to 5000 yesterday :D
07:12
@AvinashRaj still no change
Hurray 5000
wait upto next monday.
Thanks for you timely respond wanted to see my name in that for a long time
cbg all, bugrit
Pineapples on your 5000, @IanClark. Still a little short myself (been busy lately)
@holdenweb I've just limped over the line :D - also haven't had the time to answer anything lately :(
Well I am happy to take my time - I don't regard SO as a competition
3
07:22
@holdenweb Yeh, I'd rather answer questions when I actually have the time to try and make them useful
07:55
Cbg
ast.literal_eval as an alternative to json.loads. I have to give it to the answerer, that's a novel approach.
08:18
Cabbage
cbg @JRichardSnape
08:33
Is it me that's backwards, or is it weird that you encode a string to bytes, and decode a string from bytes?
I guess actually my brain would prefer a syntax that doesn't use a direction to imply what it's doing, and just have "a string".to_bytes('UTF-8') or something
But I guess that's also dumb.
taps mic
There was a proposal to use to and from instead of encode and decode
Yeah that mail from Terry Jan Reedy basically says why I said it was dumb - there's a larger convention than just string<->bytes; different stuff goes to bytes and back
Not that that couldn't also be made simpler by changing it as well, but I guess it's a bigger change to alter a whole convention
But the discussion just tailed off anyway. Oh well. Another little speedbump for newbies and Rob :)
09:29
cbg(denizens, tone=shattered)
Oh buggerations
Need to step away from the triage queue.
09:48
What is the best way to create a new string out of multiple strings?
filename = "test"
filename + ".file"
or
"%s.file" % filename
I prefer format()
filename = "{basename}.{extension}".format(basename="filename", extension = "exe")
It is actually more like this case.
    list_file_location = os.path.join(temporary_directory,
                                      output_file_name + ".list")
where output_file_name is an function argument
If it's one single addition then using + is fine.
If it's lots then every time you do it you make a new string object and it's slow.
Path(filename).with_suffix('.list')
As soon as you start doing file i/o, it takes a whole lot of slow to matter.
Sorry, I forgot to say: "cbg, y'all"
10:00
Oh and Path.with_suffix is a solution using pathlib
@WayneConrad cbg
Cbg all
Even the god makes mistake
-3
A: NDB not clearing memory during a long request

Guido van RossumYou could call gc.collect() at the start of each request.

10:23
I got my gold on triage @IntrepidBrit. After the first 1000 it gets... Well, no better at all actually
10:58
Ah, I had missed that this is a long running request. Sorry. Indeed, NDB's context cache keeps collecting more objects. If it's a specific model class, you can just put _use_cache = False in the class body to avoid caching it at all. Or you can call ndb.get_context().clear_cache() at the top of your loop. — Guido van Rossum Aug 24 '12 at 21:04
@JRichardSnape I considered shooting for review badges on the H&I queue.
I think I got through 5 reviews before giving up.
That's the only queue I don't have silver and gold badges for..
Didn't see that so the god made a silly mistake :P
@JRichardSnape I haven't even achieved the bronze one yet ;)
You absolute snot nosed bugger! Just got a 3D printing review from someone, marked me down on "print quality" (their file needed constant tinkering) and "speed" (I have one of the fastest response and turn around times on the marketplace)
I actually expedited his order too, no extra cost.
grumble grumble moan moan
11:15
Oh yeah! @Intrepid would it be possible to 3d print a city model?
How easy would it be, what would you need, etc
I don't see why not
Basically, all one needs is an .stl file of the model that you want to print
We've basically got LIDAR data to 1m resolution for the entirety of Bath.
So xyz effectively.
I assume there's some way to convert that to stl
That's pretty yamming awesome
What format is your LIDAR data in?
The data isn't public yet so I can't share it but they plan to release the whole UK as open data
It's in a Digital Surface Model. Basically an ascii file with a header.
Cool. Well, there are a number of CAD packages that interface nicely with Python
So you could use something like FreeCad to convert that data into objects
11:19
Hmm ok. I was more thinking of the logistics. We'd have to print it in pieces and assemble it
Well, depends on how big you want it to be
For example, you could use the stereolithography printing technique on a mammoth printer to print a high quality resin
I'll see if I can find the video I'm thinking of
Awesome
I was thinking maybe a metre in width. Just do the city centre.
:o
They took the video down!
Don't worry, I've got a copy of it for presentations
Depending on how flush you were feeling, you could use that method to generate an accurate 3D model
So if you use a machine like that, you could print huge swathes of the city, and maybe print a "clippy base" for ease of transport and assembling the city
How detailed is the LIDAR data?
Because if it's super detailed - you could always wait for this bad boy technology to come out: bit.ly/1Hhucvz
It's 1m resolution in xy and 0.15m in z
Bearing in mind I've got maybe 20-30 square kilometres of data (but would only print a bit of one)
11:32
Looks like I've been SC cleared with BigCorp \o/
i have some issues with encode and decode in python
Congrats!
Hey Sunil
Hi InterpidBrit
I am using python 2.7
when I input string out of 128 range like ü
then python breaks
Yep.
You need to be using unicode maybe?
i tried this
def encodeStr(varName):
return varName.encode(encoding='unicode-escape',errors='strict')


def decodeStr(varName):
if varName is None:
return ''
return unicode(varName,'unicode-escape')
this is working fine .. i encode data and decode same data
now , when i save encoded data into database it save data as //x43d
11:38
And what character set are you using in your database?
@Ffisegydd welcome, my son. Welcome to the machine.
by default python 2.7 use ascii
Corporate high five!
11:45
any solution ?
Your value as a contractor did just go up as well :)
@SunilGarg as long as you've stated your problem simply and succinctly, someone will answer if they can.
@SunilGarg So what's the problem? You've converted the string to unicode, stored it to the database?
Cabbage!
yes i encoded it with unicode
and stored into database
but in database it shows //x34t
11:52
Hey up poke
like this
@SunilGarg is the thing you're using to save to the database re-encoding it?
In other words: are you using your brain to track down where the change is happening? :)
yes
when i make query
query is in string format
Okay great. Just try and put stuff on one line rather than lots of tiny little statements on multiple lines, as it pushes stuff up unnecessarily :)
user559633
cbg
11:58
good morning you kitty cats
cbg all
The United lounge in Terminal 2 is very swish. I've just had some unarguably edible food!
user559633
@holdenweb Which airport?
why aren't you eating a cinnabon in shame like other people at the airport?
@tristan Heathrow @corvid I am reaping the benefits of being an experienced world traveller
user559633
@holdenweb Ah, good to know.
12:03
Having spent many miserable hours in various airports all over the world, I feel I am entitled to a few happy hours now
cabbage
And the booze is free, so I am on G&T the second and last
user559633
@holdenweb How much was the upgrade?
What upgrade? I'm flying Economy Plus as a gold member. Gets lounge privileges for international flights only
@Ffisegydd sounds like congratulations are in order, Fizzy - do you know now when you can start work?
Oh yeah my (cheap) health insurance over here lets me into the SA airport lounges.
12:07
I've just been Googling for a good article about the structured programming principle of not burying your input routines in the guts of your program, but I couldn't find anything appropriate. Any suggestions? I left the OP the comment below, but it'd be nice if I could give them a link that went into a bit more depth.
@zhangyi: It's generally good policy to handle user input in the outermost parts of your code (when practical) rather than doing it in the inner parts of your code. I like to think of my user input routines as border guards that only let good input into the inner sanctum of my code. Users are unpredictable critters and there's no telling what mischief they'll get up to. :) — PM 2Ring 1 hour ago
Sounds like a deal
being in airports a lot is how I inherited the ability to sleep sitting down nearly on command
user559633
@holdenweb Ah, is it a mileage thing? If it's a frequent flier benefit, I may start consolidating on the airlines I take
@corvid as soon as it is on command, I'm finding you and commanding you to sleep
Nooooo (zzz)
12:08
@holdenweb yeah it's weird actually, but it doesn't extend to anywhere like heathrow :)
@tristan Yeah, I've been flying United at every available opportunity for about ten years now. This is the return leg of a flight I booked to bring me here in May, 'cos I knew I was going to OSCON.
I booked some cheapo flight to get back here again for $633 - if I'd flown United that would have secured next year's gold membership, but I'd have had to pay $1,700 for the privilege. Airline pricing makes no sense to me.
user559633
@holdenweb Charge what you can, with price fixing with other airlines. Airline pricing makes sense to me :)
The same mathematicians who create the algorithms that now run wall street are doing airline pricing, I think. Even the airlines don't understand how it works now.
It's becoming more and more obvious that these nanosecond trades contribute absolutely nothing to the economy, and yet still everyone acts as though it makes some kind of sense.
So I presume the same is true for airlines. Anyway, I wasn't about to ignore an $1,100 price differential, nice though the lounges (sometimes) are.
hrmph... I hate it when there's no repositories or documentation on what I am trying to do :\
12:14
It's not that nanosecond trades have been allowed; they've just not been banned :)
(Therefore they don't have to add to the economy; they just have to make money)
user559633
@holdenweb Because the world sees the inversion of import this as progress
user559633
Or at least career security
There's a great article on airline pricing; let me find it
I googled an error and there were literally 0 results on google... that's a first
Bah I can't find that PDF. I wonder if Google scrubbed it, as it was on ITA's Lisp code related to airline pricing and routing, and Google bought ITA.
12:29
I sense I'm missing something trivial but I can't grasp where the problem lies exactly. I have a program that works fine.
class Planets:
    def __init__(self, r):
        self.name = "Not rock planet"
        self.r = r
        print("Initial r of {} is {}".format(self.name, self.r))
        self.nthensheate()

    def nthensheate(self):
        self.r = 3
        print("Trying to change R = 5")
        self.changeR(value = 5)
        print("Value of R = {}".format(self.r))

    def changeR(self, value):
        self.r = value

if __name__ == "__main__":
    x = Planets(3)
    # print(x.r)
If I move nthensheate to a separate file, I'm unable to import the function so that the program would still work. Any tips what the import statement would look like?
I tried from planets_functions import nthensheate but as mentioned above, doesn't work.
user559633
@RomanLuštrik You mean if you move the method on the inside of your class to a different file?
You generally keep all methods in the same definition
user559633
nthensheate is a bound method to your Planets object. You can move it to a different file, but you'd have to get an reference to your Planets object. It's likely more trouble than it's worth
Yeah I don't get this :) Are you a Java programmer?
Gotcha, keep things under one class and have a nap.
Thanks a bunch!
12:32
Yeah agreed, it'd be lots of hassle. Also for the future a function like changeR is very unpythonic
user559633
@RomanLuštrik What do you mean? If you want to overcomplicate things for yourself, Python is happy enough to let you do that.
I spent an hour yesterday to come up with a themed example and you guys solved it in 10 seconds.
They do that here :)
user559633
@RomanLuštrik Heh, yeah, thank you for asking a specific question.
user559633
You're more than welcome to come about and ask questions like that
12:33
Can't trust these R programmers...
@Ffisegydd They're the worst. D:
Coming over here... Stealing our data science...
@Roman: Sometimes it makes sense to put methods in a different file: you want to be able to add "plug-in" methods to a class. I can show a way to do that if you like. But there's probably a better way to do what you want.
@PM2Ring You don't need to go to all that trouble. This is my first project, and is small. I'll manage it the "compact" way.
@Ffisegydd Yeah, changeR() is a bit dumb, but I'm assuming it's just a simplified example.
12:36
Bear in mind that I appreciate all your help. I will make sure you're in the eulogy.
@PM2Ring surely just planets.r = ? is better
@RobertGrant Surely.
user559633
@AvinashRaj Hey, we don't nitpick each other's grammar or syntax in here. If he wants to lowercase to say chennai, it's fine.
So what is the deal with microsoft and google working together on angular?
12:38
@tristan others'
user559633
@RobertGrant thanks :)
(I have no idea if that's right, or of how to tell it's right)
:D
Hope I didn't undermine your point
Yeah that does look better - just wondering if the 'we' makes it plural
user559633
@RobertGrant it's all good. it's weird in the past 24 hours i've had to mention that we don't nitpick on city capitalization.
I've seen people genuinely correct m8 and u and stuff like that before though, but yeah. City capitalisation is a new one.
user559633
I'm pretty sure it's an ego thing to demand ones city name is capitalized and nationalism to the extend of telling others how to communicate is not something I find tolerable.
user559633
12:42
Not using internet speak like u/wot is fine.
But then you can't tell someone not to do it or you're just as bad, so then you implode. It's a whole thing.
user559633
@VigneshKalai You can type it as 'chennai.' @AvinashRaj is not a room owner and does not make the rules here.
@RobertGrant Use Chomsky's transformational approach. Change the pronominal thingy "other" to a noun -> "each man's syntax" sounds right "each men's syntax" sounds weird.
I'm actually really annoyed that I can't find that ITA PDF - it's really interesting
@PM2Ring mmm interesting. I struggle because "each" implies a singular, one at a time approach, whereas other doesn't, necessarily. But yeah, does sound right.
@tristan Unless you're talking about cities like Bath - if you don't capitalize it can get confusing. :)
user559633
12:46
@PM2Ring For clarification sure. For the reasons I'm bringing it up, no.
cbg all
Morning, Jon.
Evening, Jon.
Afternoon me :)
We may be many things, but we're not timezoneists.
12:51
Too broad? stackoverflow.com/q/31475134/4014959 FWIW, I managed to convince the OP to move his code block into his question : he originally posted it as an answer!
It doesn't seem too broad. The correct Python answer is the same (I think) as the correct Ruby answer: "let exceptions bubble up. Only catch them when needed. If you don't know if you need to catch an exception, then you don't."
In accordance with the ancient programmer proverb: Never test for an error condition that you don't know how to handle.
4
:)
user559633
@PM2Ring That's...amazing.
It's amusing and deep at the same time.
user559633
It should be considered one of the ten commandments for software contractors too.
13:03
Google says that it's known as Steinbach's Rule or Steinbach's Guideline for Systems Programming, but it doesn't say who Steinbach is or was.
Very cool rule
@tristan room owner?
I don't know why you use room owner ..
user559633
@AvinashRaj Actually, I owe you an apology. I thought you were telling him to fix his capitalization of a city name, but I didn't realize that it was for a query.
user559633
So, my bad, I messed up, I'm sorry.
13:13
it's ok..
user559633
:)
Kudos for owning up
user559633
Cheers and cbg Vignesh
@tristan I think you'll find that cbg should be spelt with a capital C.
13:18
:P
user559633
I think you'll find that the big mistake was actually calling it as a built-in and not a function
:)
I just about made it through my ML coursework
@Ffisegydd If you spelled it with a K, you're close to KGB.
SC CLEARANCE MONITORING DETECTED PHRASE CLOSE TO KGB. CLEARANCE REVOKED
user559633
Actually the secret of the KGB is that in 1997 the RuNO CARRIER
13:29
Can Makefiles be made in pretty much any scripting language?
(a week later) Guys, it's been 6 days and he hasn't continued. I'm going to google this Runo aircraft carrier
@corvid A Makefile is for make. However, there are other make-like languages, but they don't typically call their files "Makefile". For example, Ruby's make-like language is called "rake"; it uses a file "Rakefile".
user559633
@corvid with GNU make, it just has to follow the syntax.
Mine's in javascript, does that make it a Jakefile? Who is Jake and how did he get my files? And why is Jason encoding and decoding my data?
4
corvid is stretching his wings while Kevin is on vacation, he'll come back to find his role has been filled.
It's aliiiiiiiiiiiiiveeeeeee
Looks like you carved a monster out of soap with a potato peeler Great 3D printing dude!
user559633
@IntrepidBrit "close enough"
user559633
@corvid JSON Vorhees, start running little crow
13:37
Don't you be making fun out of Greyfriar's Bobby!
Aaah cool
Psh, there are always crows hanging out in those movies
Except I can't read Greyfriars without thinking of Billy Bunter
user559633
user559633
[annoying]
13:41
It's like that hachiko statue
@RobertGrant twitch
Celebrity Death Match - Bobby vs Hachiko vs Fido!
CDM was awesome
Must. not. stop. working. to. watch. CDM
13:50
:)
Sometimes I love that Youtube is blocked
What I wouldn't give to have internet to be distracted by ;-;
Anonymous have targeted Katie Hopkins. At least they're doing some public good.
That exists? What kind of companies do that?
Wow, she sounds like a celeb version of Karl Pilkington
(Although no one should be targeted by Anonymous.)
14:06
She's an awful human being.
user559633
@Ffisegydd What is a Katie Hopkins
Oh well, that's okay :)
I just saw a very cute avatar on SE.Mathematics. Some background: ZFC is Zermelo–Fraenkel set theory with the axiom of choice ... the most common foundation of mathematics. Here's Ernst Zermelo:
user559633
Also, I just finished watching an episode of An Idiot Abroad :)
And here's the avatar:
14:09
Awesome I'll check that out later. Have to leave the office now
By workable, I mean, it "works," but I don't think it's very maintainable.
I prefer mixins myself.
just got "hi"'d on communicator...
I have a permanent note specifically asking people not to do that.
user559633
Hah, I wish I could convince or bring that up with people I work with.

"Hey, got a second?"
- (breaks concentration) 'yeah, what can i do for you?'
*5 minutes later*
I don't think all version of communicator let them see the notes
14:20
"Hi" nothing for minutes... "What can I do for you?" nothing for minutes more... the communicator window gets buried, I go back to work, they mention the building burning down, could I please push the release pressure button, but it's too late, there goes Springfield, because they wanted to just "hi" me.
Doh!
Dumb namespace collisions. That should emit some kind of error...
Namespaces can collide in python?
They can in javascript, child_process.exec and shelljs/global was colliding on exec
Rbrb :)
14:43
@RomanLuštrik Let me try that again without providing any links whatsoever. If you want to keep some methods in a separate script, the Pythonic way to do that, in my opinion, is to stick those in a class in the other script, and use that class as a mixin. You can also monkeypatch the methods directly onto the class, but in my humble opinion, that's far less maintainable. If you want to know more, Google is your friend, but you may have to do some digging.
Sometimes I wonder if people actually read exception messages (re: cv-pls)
this user has been asking really basic questions lately, I get the impression that no, they don't read
@corvid How did that happen? o.O
@thefourtheye it's because javascript probably shouldn't be doing what I am trying to do probably
No, I mean, you would be referring to the function with the object, right?
15:20
@davidism Done
15:31
nah, require('shelljs/global') somehow injects itself into the global namespace, and var exec = require('child_process').exec conflicted
15:46
You mean it shadows the exec from shelljs?
Air
Air
Good morning, all. How do I woke up today?
My cup of caffeine seems to be lying down on the job
@Air caffeine drip?
> Do I have to like “Monty Python’s Flying Circus”?
> No, but it helps. :)

« first day (1735 days earlier)      last day (3437 days later) »