« first day (1868 days earlier)      last day (3079 days later) » 

12:06 AM
wouldnt you have consider how to input as well like changing e for e in i to e for e in raw_input.split()?
 
no restrictions here so... not sure if cheating, but allowed input in code as a list
 
If I have an Object that uses some method on __init__ and then doesn't touch it again ever, does it make more sense to have that method be a regular instancemethod that draws parameters from the class, or to make it a classmethod that receives parameters as arguments from my new instance?
Assuming that the class and instance send about the same number of parameters.
I feel like it's a matter of taste, but I'm asking to see what you lot think.
 
 
5 hours later…
5:30 AM
Morning CBG all :)
 
and the silence has been shattered :p
 
That was a 5 hour streak :P
 
longest I've seen in a while lol
 
 
2 hours later…
7:33 AM
Cabbage
 
7:44 AM
I am currently doing this p = os.popen('python Link_CLassifier_Generic_multiple_country_std_input.py '+",".join(line[:3])).read()
But it is throwing end of line error
I found the issue yeah. but it lead to a another problem.
when I run python Link_CLassifier_Generic_multiple_country_std_input.py it will ask user input how to give that from program
 
8:37 AM
why would you run Python from Python? The usual and recommended approach is to import the code you want to run
 
I heard you like Python.
 
I heard this meme is pretty old
:P
 
@Augusta not sure I understand what you mean ... if the method is only useful within __init__ then just inline it there? so the first option I guess. don't leak outside the scope where it's used.
 
BTW before I forget, I realise you didn't get through the primaries in the elections @vaultah but I think it's great/I'm proud that you tried.
 
8:56 AM
Thanks mate. I'm satisfied with results: the total score of 1k+ is okay, considering my low meta participation, lousy first revision of my nomination, and involvement of <the user>
And thank you everyone who voted for me :-)
 
9:20 AM
Just wanted to create a wrapper for my programm
Sorry for late reply went for lunch
The wrapper is going to be the same thing but the program which it calls changes so wanted to do this.
 
I have a module (A) consisting a list of generic class definitions, and another module (B) which has app specific functions which initialize instances of these classes and returns them. Then I have a final module (C), which imports B, and uses the functions from B to create objects and manipulates them. Now, without importing the module A itself in C, is it possible to do isinstance checks in C corresponding to the classes declared in A? Something like isinstance(B.foo(), bar)?
 
9:36 AM
Reckon I need a bit more detail to understand that last line of code in context. Also, how did it go when you tried it?
 
@JRichardSnape I mean, from C, I just want to know which class's object some function in B returns. How'd I do that without importing A into C? And I tried and found a "patchy" solution, i.e., I can do isinstance(B.foo(), B.A.SomeClass), because A is in B's scope. But... that's so ugly.
lemme gist something, sec
 
i should better call you a live saviour — typhoid.99 54 mins ago
I ll take that :D
 
9:53 AM
@AwalGarg why don't you import A?
 
:/
It doesn't feel right
 
I think it's fine... What's your concern?
 
@vaultah My concern is that those classes won't actually be used for instantiation of objects in C. Is it really ok to import them just for checking parentage of an object?
 
@thefourtheye yeah dogs are considered to be live savior :P
 
It's similar to being required to import thirdpartylibrary.exceptions.LibException in your own code just to use it in except. Second import A doesn't introduce any performance drawbacks, because B imported it before @AwalGarg
 
10:04 AM
@vaultah oh, well I have worked with libraries much in Python so I didn't know that's a common pattern :P (and yeah, I do understand performance won't suffer here)
I'd import A then. thanks!
 
10:47 AM
guys i had a doubt regarding flask-wtf selectField dynamic updating... is it ok to ask that here?
 
@AwalGarg Sorry - had to do something else. Basically - I agree with vaultah :)
 
ok, np, thanks for looking! :)
 
@Ja8zyjits Sure - have a read of the room rules sopython.com/chatroom - In particular, you don't have to ask to ask! Dunno if there's many Flask people around, but you can take your chances
 
@Jri
@JRichardSnape thanks....
dpaste.com/0R9FJ8T my code , iam trying to update my SelectField from my views
the SelectFiled is in a class which is a FormField to another class say AddressForm which is a FormField to CustomerForm. Iam finding it difficult to update the SelectField from my views..
 
cabbage
 
11:02 AM
hey up @pm2
 
G'day, Richard. I guess the Americans are still recovering from Thanksgiving.
 
Could well be. Still a bit early there, too. 6am after a day stuffed with Turkey even on the east coast!
 
Here's some contemporary British folk music from a young Derbyshire lass, Bella Hardy: The Herring Girl.
 
@Ja8zyjits Not my area of expertise, I'm afraid. You might get more joy later when the Americans arrive. A general thought - you might need to add a bit more about your overall app structure.
 
@JRichardSnape Good point. :)
 
11:08 AM
@PM2Ring She's really good. Gets a good airing on the Wednesday night folk show on BBC radio 2 over here.
 
@JRichardSnape thanks (i thanked you initially for permitting me to begin, that question was for everyone in here)... I shall try at some other place...
 
@Ja8zyjits Cool - thanks for following the guidelines here, you never know - someone might come along later who can help you out. Good luck!
 
@JRichardSnape Her voice has a few rough edges, but the emotion Bella puts into her delivery more than compensates for that, IMHO. Anyway, technical polish isn't a prerequisite for performing folk music. And it's wonderful to see young people writing songs of that calibre.
 
11:34 AM
Does the link in my comment look like a decent dupe target? stackoverflow.com/questions/33956342/…
 
Cabbage!
 
11:48 AM
Hi, Poke. It's quiet in here tonight.
 
Anyone use numexpr? I've discovered a nasty where, as compared to numpy it gives different results for * when multiplying by float 0.0. Just wondered if anyone had come across that before? I found it because pandas started doing inexplicable things...
 
@JRichardSnape No, I've never used it, but that sounds scary.
 
Yeah - very nasty. As the incumbent (albeit new) goto Python debugger here, a colleague showed me a program that gave numerically order of magnitude different answers each time it was run
 
@PM2Ring I would have been here earlier, but I was visiting a customer.
 
He'd found that changing the pandas column into a numpy array and then doing the same operations was numerically stable, but allegedly thats what pandas was doing under the hood
Long story short, I found that sometimes (but not every time) float1 *0.0 was giving x.xxxE-314 - so I immediately thought floating point error
I guessed it was some undefined behaviour in the underlying C, but seemed odd that it did this on his machine, but not mine (same versions etc). Turned out he had this numexpr installed (I found the branch point in the pandas code) and that was what made the difference.
So, I'm just wandering round trying to find if it's known behaviour. Might ask DSM if he rocks up later.
cbg @poke, BTW
 
11:59 AM
o/
 
That inconsistent behaviour makes it sound like it could be a pointer-related bug.
 
yeah - could be. Although the magnitude (10**-314) made me think unchecked overflow. I'll browse through the bug list and see whether I can get a smaller MCVE to demo it.
> technical polish isn't a prerequisite for performing folk music
This amuses me. Thankfully not, in my case :) It does amuse me when her accent comes through a bit.
 
12:15 PM
is it possible to server which computers apart from localhost can access?
python -m SimpleHTTPServer
 
@JRichardSnape Some of the most technically proficient musicians play folk music. But IMHO the ability to present your folk music's tradition (whether as a faithful representation or in a new interpretation) to the audience and to channel your emotions is far more important than mere technical skill on your instrument.
Bella's accent may sound provincial to Britons but to the rest of us it's simply charming: it makes her sound authentic (whatever that means :) ). And I bet the Americans love it... presuming they can understand her. :)
@AbhishekBhatia Certainly. But it's probably not a good idea to do it with such a simple server. You should use something a bit more robust if you intend to expose it to the actual Internet. However, your ISP may not allow you to host a publicly-accessible HTTP server unless you upgrade your account. OTOH, some ISPs allow users to run a low-traffic server at no additional charge, but the site will be on their servers, not on your local machine.
@AbhishekBhatia: Take a look at stackoverflow.com/questions/4717426/…
 
12:39 PM
 
^^ wha?
 
Is there a short version of isinstance(foo, list) or isinstance(foo, tuple)? Any class from which both list and tuple extend?
 
Here's a little gem: A snippet of Susan Tedeschi jamming with Japanese guitarist Shoka Okubo. Little By Little
@idjaw :)
 
@PM2Ring hey! you are from India?
 
@AwalGarg No, I'm not. I'm from (and in) Australia.
 
12:52 PM
o.O Tata Indicom is an Indian ISP and that IP is from the same circle route as mine :/
 
@AwalGarg but you are.. that's a dynamic pic
 
oh, goddamit
nice one
 
Just because a URL ends with .jpg that doesn't mean it has to be the address of a static image sitting on the HD of a server.
 
yep :)
 
@AwalGarg Yes. isinstance(foo, (list, tuple))
 
12:55 PM
ooh, nice, thanks!
 
@PM2Ring Thanks! just what I needed this morning :)
 
The first time I saw a Danasoft sign it gave me a bit of a jolt, until I figured out what was going on.
@idjaw Shoka Okubo is great. And her bass player Juna Serita is great, too. Here's some more of their work: I Can't Quit You Baby
 
@PM2Ring Following yr link, python -m SimpleHTTPServer shows me the fileserver but ` ./ngrok http 80` doesn't
It loads a wordpress website.
 
1:10 PM
Cbg
 
@PM2Ring :D:D:D
 
@PM2Ring you're awesome, that managed to get my daughter to settle down too. Everyone wins!
 
@AbhishekBhatia Sorry, I'm not familiar with ngrok. But you may be able to get some help on superuser. Do you have a static IP address?
 
How can I check that?
 
:27152963 My guess is that it's a simple CGI script which gets your details from the headers your browser sends when it attempts to download what it thinks is an image at http://www.danasoft.com/sig/socabbage.jpg
 
1:14 PM
I running on it a HPC.
 
1:28 PM
@AbhishekBhatia You'd (probably) know if you have a static IP address since your ISP would've told it to you when you first set up your connection so that you could enter it into your modem / router. Static IPs used to be the norm, but these days they tend to be dynamic and so you get a new one each time you reboot your modem, or when your current IP expires after a certain time period. But even if your ISP normally provides dynamic IP addresses you may be able to get a static one if you pay more.
Having a static address makes it a bit simpler to host stuff: you just need to tell people your public IP address and they can access your machine (once you've set up your firewall and port forwarding).
That little sign I posted earlier tells you your IP address. If you reboot your modem and the number stays the same then you (probably) have a static IP. If you type "what's my IP" into Google, it will show you your public IP address. Also see whatismyip.com
Anyway, this stuff is getting rather off-topic for the Python room. :)
 
I wonder if any of the other regulars from the US didn't get today off...
 
CBG all happy weekend
 
1:53 PM
@idjaw Here's another one you and your daughter may enjoy: A Little Ray of Sunshine. This song was a big hit in Australia in 1970, and it's become a perennial favourite.
 
well this song got me in the feels
 
only one more vote needed to close this dupe: stackoverflow.com/questions/33956342/…
 
done
 
2:12 PM
Oh hey look it's Kevin! I'm not the only one, it seems.
 
I'm at home today so I may wander off at any moment
 
It seems I was wrong!
 
@Kevin I don't think that would be the case. Check code again.
 
2:19 PM
Yep time for video games
 
@PeterVaro @idjaw @JohanLarsson Here's one of the greatest ever electric blues-rock recordings: Johnny Winter's cover of The Rolling Stones' Stray Cat Blues
 
ty ty
 
@PM2Ring I'm not really a huge fan of this kind of electric blues as you called it.. but thanks :)
I prefer like this more:
 
@PeterVaro Fair enough. Here's something more to your taste: Derek Trucks and Susan Tedeschi on acoustic guitars covering Elmore James's version of Rollin' and Tumblin'
 
cbg, a weird question, anyone ever used sqlalchemy's sa.Table with autoload=True and aiomysql?
autoload=True requires an engine, but the one that aiomysql.sa.create_engine returns does not fit (AttributeError: 'Engine' object has no attribute 'run_callable')
 
2:33 PM
@PM2Ring way way way closer to what I like :)
how but Charlie Parr? (not quite blues though)
(I like this folk very much, super talented!)
 
@PeterVaro John Lee Hooker's sound (especially his rhythm) is very close to the sound of music from Mali in Africa. Some musicologists consider Mali to be one of the original sources of the music that became the blues, although of course a lot got lost or distorted in the translation to America.
Here's some (relatively) recent music from Mali: Ali Farka Touré & Toumani Diabaté - Kaira, being played on guitar and the kora, the traditional West African harp-lute. You should be able to hear its similarity to the blues.
 
well, as much as I've learnt from modern music theory, I believe the whole rythmic complexity of blues and jazz as well, coming from the african polyriythmic culture of the old tribes
where the drummers could have 8/13 and 5/7 rythms at the exact same song layered upon each other
that is what blues's and jazz's off-beat tones and rythms are imitating
 
Agreed. However, it was often hard for the Africans to maintain their musical traditions when they were sent to America: in some cases they could be executed for merely possessing drums, what to speak of playing them: the slave owners were afraid that the drums would be used for transmitting secret messages of rebellion. So musical knowledge had to be shared and passed down in secret.
@PeterVaro Lovely stuff!
 
3:10 PM
rhubarb
 
The unicode code chart lists "Dog Dirt" as a synonym for "Pile of Poo" 💩💩
 
DSM
3:36 PM
Morning cabbage, all.
 
cbg, DSM
 
DSM
My SO swag arrived yesterday! I'm wearing the shirt now. Feel like I should take the day off from work and answer pandas questions all day..
 
nice
 
DSM
"The error was: error" <- thanks, program.
 
I feel like I should take time to read rhettinger.wordpress.com/2011/05/26/super-considered-super ...
super() is confusing :/
 
3:47 PM
I never received SO swag ;___;
 
@vaultah I wonder how long until "X considered Y" is considered a relic of time forgotten. A lot of up and coming programmers probably don't even know what a GOTO is.
 
wow - Jessica Jones == AWESOME!
@Ffisegydd I got two of the new logo SO shirts the other week :)
 
@DSM Mine hopefully arrives before Christmas too
 
DSM
4:02 PM
@JonClements: no spoilers, I'm only halfway through yet.
 
How big is the box?
No, wait, don’t tell me.
 
@DSM I made the mistake of binge watching it - Tennent is fantastic :)
 
@DSM oh wow, I thought that was RE swag box, not that show… >_<
 
Heh.
 
“I got two of the new logo SO shirts the other week” – “no spoilers, I'm only halfway through yet.”
 
4:04 PM
hey guys
 
I thought you were making a clever/sarcastic joke.
 
My question makes a lot more sense with that context.
 
DSM
I'm afraid I'm not nearly so witty. :-(
 
Actually I thought poke was making the joke, not you Uhh...don't put yourself down buddy!
 
:(
 
DSM
4:10 PM
There is one thing which came in the box which I'm not sure of the purpose of. I've thought of googling but I kind of like the mystery.
 
Pic? I'm intrigued.
 
DSM
(Flashback to HHGTTG's "something your aunt gave you".)
 
picture or it doesn’t exist?
 
Paint us a word picture.
 
Do you only get swag at 100k, or is there some at 50k too?
 
4:12 PM
100k
 
I didn't realise this was 100k swag, I thought it was for something like the elections :o
 
DSM
It's some soft quasi-fabric thing, and it's orange. If it were solid it would be useful as a pencil holder, maybe. Could be a cozy for a small water bottle?
 
How big is it?
 
Now I'm intrigued...
 
DSM
Palm-sized.
 
4:13 PM
I know what it definitely sounds like, but I got in trouble the other day with flags and don't want a repetition of that.
 
So are we not doing hats this year? I haven't been following meta recently...
 
Doesn't usually start until next week or so?
 
I thought it started right after Thanksgiving, maybe December 1st. Can't remember...
 
5:10 PM
> 25 passed in 0.06 seconds
Redis = ❤
 
DSM
Aaaargh
So there's a project at work I said would take about fifteen weeks. Somehow my three weeks of vacation were forgotten in the scheduling of this. Then two other projects were assigned, which -- and this is hard for management to grasp -- cannot be worked on in parallel at 100% productivity. And now because of a governmental budget timing issue, client wants results in (what is for me) three work weeks. :-/
 
:[
 
D:
 
cbg
@MattDMo 100k, 200k , ...
 
5:27 PM
@Avinash yeah, I knew about the higher ones, I just wasn't sure if there was an earlier one before 100k. Oh well. I'm almost up to 40k, I'll just keep plugging away :) My next goal is the Python gold badge...
 
@MattDMo cool. :-)
 
I get it that newbies aren't supposed to ask for tutorial selection advice on SO and I get why. But let's say you're a noob who wants to ask experts for tutorials or suggestions. Where are you supposed to go?
Or tool suggestions, IDE suggestions, editor wars, whatever.
 
Programmers or chatrooms
 
well I would say that these chatrooms would be an excellent place...
the phantom downvoter strikes again
 
These chatrooms have pretty low discoverability. I still can't figure out how to reach them from the main site, or how I did in the first time. A game of hide-and-seek and a magical wardrobe may have been involved.
 
5:41 PM
theres a chat button when you click on the SE button on the main navbar (top left)
 
And there goes my childlike innocence and imagination (RE: SO UX choices)
 
ruining childlike imagination since 1996
 
Oooo... 63336 rep - nicely palindromic ;)
 
:)
how are you going to keep it like that?
 
quick, someone downvote one if his answers
 
5:48 PM
@RNar :(
 
I kid. I would never do that.
at least, not in a way that would allow you to blame me
i love how people immediately saw that this question was from project euler haha
 
@RNar You pick up on these things after a while - especially after you've already worked through it yourself :)
 
Im still trying to work through the first 50, gotta keep chugging along
 
Think I stopped after about 200
 
some of my solutions are so redundantly brute-forced though
 
DSM
5:54 PM
Oct 30 '14 at 16:44, by DSM
@AureliusPhi: yep. Made it through a fair number of them but eventually stopped when I realized I was spending more time looking up half-remembered theorems that I couldn't remember the specifics of than coming up with clever algorithms.
 
@RNar That's by design though. If your brute force works < ~10 secs or so, it's a correct answer.
Not all brute-forces are created equal.
 
@DSM thankfully (or maybe not so much...) I dont have any actual comp-sci education so theres no theorums that I can recall in my disposal
 
I enjoyed taking a couple of Calculus classes as an undergrad 20-ish years ago, but not much of it has stuck with me. I kind of trailed off on Project Euler when a first reading of the problem produced a "WTF?" followed by a lot of googling and visiting Wolfram. I'm done now...
 
fair enough, although I know for a fact there are way better solutions to some of them
 
6:06 PM
If your solutions are working fast enough, your solution is probably the same as the 'correct' solution. I guess the first couple can be solved in alternative ways (the first problem in particular is solvable without a computer), but that goes away quick.
 
6:31 PM
so... I just noticed that self is not some essential name for the instance object in class methods. I named it pep8isCrap and it worked too. How bad would it be if I call it this instead of self? :P
 
im always tempted to do that since I started with c++ programming where this was actually a keyword to point to the instance
but I always find self more readable for some reason
 
Gonna try the N American crowd (looks toward dsm) - anyone used numexpr with pandas? Discovered a strange behaviour on behalf of a colleague and would like to run it past someone before reporting...
 
6:54 PM
@JRichardSnape oh... use df.query quite a bit - what's up ?
 
Using names other than self seems like not using 4 space indenting. You can do it, but there are merits to being a sheeple in programming.
 
the PEP 0008 gods are going to smite you
 
Screw PEP8.
 
I don't actually know what's in PEP8, but it's nice having a 'standard' coding standard.
The PEP committee is probably going to make less stupid decisions than your dumbass manager.
 
/me hides
 
7:03 PM
@joncle numerical differences between runs into orders of magnitude with exactly the same program and data on multiplication (element by element) of two columns
Traced it to the use of numexpr package which it uses for an optimisation if installed only
 
@JRichardSnape the exact usage of it?
 
@QuestionC NOBODY knows whats in PEP8
seems like the general standard is like "yo, is that readable? alright, good shit man, keep it up"
 
@joncle done that silly thing of starting a conversation when I have to leave :( will dpaste tomorrow and discuss in more depth. Sorry.
 
no worries - take care :)
 
DSM
Just got back from getting my chicken tikka.. but it's Black Friday here so the mall was too busy to eat in.
 
7:13 PM
i cant imagine how busy it gets on black friday
 
I don't understand why everyone has to do it in person. You can do it online on Cyber Monday and not risk the black eye
 
and people also fail to realize that the sales go on for the whole weekend anyways
(usually)
 
7:28 PM
I just noticed the sopython team is listed higher than the javascript one
 
thats because sopython is the best team
obviously.
 
I respectfully disagree
 
I want to join the best team too!
 
JOIN US!!!
 
js is crap :P (don't post this in the JS room though ^^)
 
7:33 PM
@AwalGarg, first you insult the PEP gods, now the JS crowd, you are tempting faith today
 
@RNar But I still love python :D
 
7:49 PM
Javascript is better than Python because my browser doesn't run Python. =)
 
@DSM your predictability remains on your Friday meal then :)
 
DSM
#tradition
Plus this is the last Friday for a while that I'll be eating meat at all, so I have to savour it. :-)
 
python can't run jQuery either so it's clearly inferior
 
DSM
@MorganThrapp: you haven't had any golfing questions for a while! I'm actually accomplishing things at work again. :-(
 
7:54 PM
@AwalGarg :O
 
People are accomplishing things at work the day after thanksgiving?
 
naw
 
DSM
@QuestionC: Thanksgiving was a month and a half ago. :-)
 
@nick I love both the languages equally anyways :)
 
I secretly love Haskell but I refuse to admit it
 
7:56 PM
@DSM There is a legen....wait for it...dary one that didn't have a python answer, unless you count Pyth.
 
@DSM My post-thanksgiving itis must have been worse than I thought.
 
8:19 PM
@DSM Yeah, I've had actual work recently. :/
 
those esoteric langs screw things up fro real languages
 
Yeah, I want to learn an esolang at some point. Maybe while the gf is in Lonoke for two weeks.
London. Stupid mobile not letting me edit.
 
8:32 PM
@Morgan if you press the menu button you can press "Edit last" to edit your last message.
The More You Know - Sponsored by Fizzy Cola.
 
What's the best approach to self-answered questions that aren't very good answers?
 
@QuestionC suppose it depends on whether it was an intentional "I will write a Q and then write an A especially for it"
Or whether it was "Here is my Q. Oh wait, I now found an A."
 
The former.
 
DSM
How does accepting an answer to your own question work? Do you get rep? [Answer: no.]
 
"Not very good" in this case is subjective of course. I'm not a fan of any answer where I use the scroll wheel more than once.
 
DSM
8:45 PM
I think I'd hold it to a slightly-higher-than-normal standard for answers but not greatly so.
 
I'll just write something better(?) when I get home and let come what may.
 
9:39 PM
cbg
 

« first day (1868 days earlier)      last day (3079 days later) »