« first day (1650 days earlier)      last day (3288 days later) » 

12:55 AM
-1
Q: Track likes on my photos with instagram API

user99889I would like to track the number of likes on photos that I post to instagram via the python-instagram module using the instagram API.

seriously?
 
0
Q: Problems while plotting multiclass svm hyper planes?

ml_guyIm triying to plot different SVM aproaches in order to see how does the hyperplanes behave for the multiclass case, so I tried this: import numpy as np import matplotlib.pyplot as plt from sklearn.feature_extraction.text import TfidfVectorizer import numpy as np tfidf_vect= TfidfVectorizer(use...

 
 
1 hour later…
2:13 AM
Cabbage :-)
 
cbg @thefourtheye
 
Cabbage @JGreenwell :-)
 
ugh...building decision support systems...the one question I was hoping wouldn't be the final exam
 
@ZeroPiraeus Ah, you are correct. I was totally wrong.
 
Yeah. Was writing a further comment ... the bit about repr() being called on your supposed tuple is also a bit, er, interesting ;-)
 
2:27 AM
This is how it is actually done. hg.python.org/cpython/file/648dcafa7e5f/Python/…
 
user2555451
@iCodez - you shouldn't answer questions in comments, it leaves them in limbo... — DrCord 21 mins ago
 
user2555451
If that guy really thinks two sentences make a good answer, I don't know what to tell him.
 
lol, even I used to get that comment a lot :D
 
@iCodez Saw that ... contemplated commenting myself; have upvoted yours instead :-)
 
user2555451
What's interesting (sad?) is his comment got two upvotes. There must really be people on the site who think just "That's the way it is" is fine as an answer.
 
2:35 AM
I occasionally wonder about compiling some kind of "myths of SO" document (also including "self-answers are wrong" and "no visible effort is a close reason"). Not sure whether it'd be a Meta post, SOPython wiki page, or blog post though.
 
>>> dis(compile("print 1, abcd, 2", "string", "exec"))
  1           0 LOAD_CONST               0 (1)
              3 PRINT_ITEM
              4 LOAD_NAME                0 (abcd)
              7 PRINT_ITEM
              8 LOAD_CONST               1 (2)
             11 PRINT_ITEM
             12 PRINT_NEWLINE
             13 LOAD_CONST               2 (None)
             16 RETURN_VALUE
This proves that a tuple is not constructed :-)
 
DSM
Temporary cabbage. @iCodez: have to admit it -- I'm one of the upvotes on that comment. One of my pet peeves (and to be fair, I did this myself sometimes years ago) is giving answers as comments.
 
But if we do, (), it constructs a tuple
>>> dis(compile("print(1, abcd, 2)", "string", "exec"))
  1           0 LOAD_CONST               0 (1)
              3 LOAD_NAME                0 (abcd)
              6 LOAD_CONST               1 (2)
              9 BUILD_TUPLE              3
             12 PRINT_ITEM
             13 PRINT_NEWLINE
             14 LOAD_CONST               2 (None)
             17 RETURN_VALUE
 
Okay, I'm rapidly losing consciousness, so I'll leave you guys to debate comments-vs-answers :-)
rbrb all ...
 
DSM
Upside-down sleep for you!
 
user2555451
2:38 AM
@DSM - Huh. I honestly didn't consider that to be an answer. More of a "This is completely normal -- are you sure you want to be asking this?"
 
@ZeroPiraeus Rhubarb :-)
 
DSM
@iCodez: it's a reasonable enough question about how Python grammar works. It's not very interesting, I admit, but not all questions have neat answers. If I were bored enough to write one, it'd probably be that with some dis stuff thrown in like @thefourtheye did, and like Martijn does sometimes to pad out one of his python-internals answers..
 
@DSM Actually, after seeing the dis results, it looks very interesting to me :D
 
DSM
@thefourtheye: heh. Well, dis makes everything seem more interesting than it really is. :-) You could even add a trailing comma to see the PRINT_NEWLINE disappear..
 
Yup, I am not able to follow the source code after that :'(
Nope, I was successful in figuring this out :D
nl = (TYPE(CHILD(n, NCH(n) - 1)) == COMMA) ? false : true;
 
DSM
2:44 AM
Yep, looks like it!
 
If the last character in print statement is COMMA, then don't print the newline
 
DSM
One of the ugliest bits of Python syntax. I was happy to see it go.
 
Agreed. Yay to print as a function :-)
 
DSM
:-)
Okay, time for me to shut it down. Super-busy day tomorrow at work, but I figured I should be a man and own up to my upvotes. ;-) Evening rhubarb for all!
 
Rhubarb @DSM. Have a nice evening :-)
 
2:49 AM
heh...glad my BI/Database professor is a programmer. Doesn't mark me down for certain comments that could be seen as fairly negative toward management and certain other user classes
adios @DSM and @ZeroPiraeus
also, that's neat @thefourtheye. I actually wondered about that myself when I moved to python (print "", or + or .; print can be weird when interpolating stuff)
 
Yup, I always thought we construct a tuple and print it. The comma should have been a hint that a tuple is not constructed...
 
user2555451
One neat thing about the Python 2.x print is it would not evaluate the next argument until the current one was printed. So, you could print a bunch of time consuming functions at once and get live results (instead of waiting until they all complete).
 
half the time I have to put query results into threading output anyway, with some small micro processing band-aid somebody had to have, so I'd rather just be able to use python 3 ;)
 
@iCodez But it is line buffered, so we will not practically see any difference, right?
rbrb Badminton time
 
3:24 AM
cbg
 
@Ffisegydd ehhhh , I dint ask any questions yesterday.. Was it a typo?? edit: yes it was.. sorry ;just read..
 
 
4 hours later…
6:58 AM
Cbg
 
7:12 AM
That would be...amazing.
And I turned the job down :(
stares tearfully at his empty hand
But yeah, actually they're still looking to fill the position I think, so if it's still around in 9 months maybe I'll see you there :)
 
Cbg
 
@vaultah cbg
 
YouTube is 10 years old today oO
 
Wow, that's crazy
 
good morning :)
 
7:21 AM
Cbg :)
 
got so much help here yesterday and learned so much... really pumped about it :) so gonna work on my new assignment a lot before ever asking anything(maybe i can do it all on my own this time )
 
@StephanKetterer cool :)
We like helping people who seem to really be trying to understand it, not just pass a homework assignment so they can become a manager with a technical background one day.
 
oh.. i want to learn programming.. just for the sake of it..fascinating stuff.. also since computers are used for pretty much anything ...might be a decent idea to be able to do more than press a button on the front
 
Agreed :)
 
7:30 AM
If you are wondering how things are going:
This is a Public Service Announcement (via @boltclock) #stackoverflow http://t.co/P6d8mlCnyA
 
i have a string like {1.01787e+08|1.019e+08}
i wanted first to find out that it is the case, and then split it :)
    if area.count('e')==2:
        help=area.split(str="|")
pretty sure the first line is correct (probably not very elegant)
damn i think i know my mistake
the str is wrong, should have just used "
"|"
 
You can just do split('|')
Yeah :)
 
one day i will look at the docs of those things and it will be super clear to me :P
 
You can do split(sep='|'), but it's easier just to use the above method
 
7:39 AM
Cbg
 
@MartijnPieters Enjoying it so far? Got your head around it yet? :p
 
Cbg Jon
 
can i ask, have any of you more advanced people any tips what to use to program ? i mean i have 2 big screens due to poker, but other than that ?
 
Do you mean software wise? Or hardware wise?
 
@JonClements I'm getting there; there are loads of processes to pick up.
 
7:43 AM
both, i use sublime text 2 right now.. watched some tutorials won it
i like the colors better on my eyes than just a whitespace
 
Don't worry about hardware wise for now.
As far as software, a lot of IDEs/editors are customisable.
I'd stick with ST while you're learning. You don't really need a fully blown project-based IDE like PyCharm yet.
 
@Martijn have many sock accounts received ritual katana decapitation... ?
 
As of just right now 6.
no, 7.
 
Not even double digits... bah... you're useless :p
 
7:47 AM
They are all quitting and self-deleting before me.
 
Gotta be faster than Ninja... no mercy... don't let them walk away... off with their heads! :)
 
retracts vote for Jon Clements
 
(unless their name is Robert Grant of course... coughs)
 
@JonClements don't you mean unless their name starts with Robert Grant? :)
 
Of course that's what I meant!
 
7:50 AM
do you guys sometimes have to look up a method or how to use it ? or is there just a number low enough to remember them all eventually?
 
Just as a hypothetical, if I targeted someone by creating a load of sockpuppets with names that are anagrams of the target's name, and used them to upvote the target, would that get the target's account deleted?
I'm trying to figure out future issues :)
@StephanKetterer I look them all up still, just using google
 
@StephanKetterer You remember the tools quickly enough.
 
@StephanKetterer docs.python.org/3
 
Cabbage guys, I'm a young graduate working in a small animation studio and looking for an internship to help me during some months. I never recruted anyone before, so what would be the good questions to ask during an interview? Do you have any idea what kind of "writing code exercize" I could hask him/her to do, in Python obviously?
 
@DrHaze are you looking for someone to do what you're doing, or to do stuff that isn't in your field?
 
7:54 AM
Someone doing the same stuff as me, developping and consolidating the animation pipeline.
 
Do you want specific technical questions or general interview questions?
Or a mixture of both? i.e. general technical questions? :P
 
In that case I'd suggest you first coming up with stuff that's appropriate to your job, as it's hard to gauge the right level (for other people; I'm a beginner so I couldn't do it anyway) and also, you have to be able to understand the answer.
 
It consists in adding multiple little scripts to Maya to help our artists open/save their files, do increments, bake their animations etc...
 
i would probably ask what would you do if you had not the faintest idea how to complete your task :)
 
This isn't hard stuff and I'll be able to guide him. I'm looking for general questions
A mixture could be fine too :3
 
7:59 AM
1) Write a loop that sums the numbers from 1 to 100
2) Some variation of Fizzbuzz
3) Someone else chip in
(1) Just checks that they know anything about programming and aren't just bluffing
(2) ...pretty much does the same. Maybe you could skip it if someone else has a better alternative
 
what is bluffing in that context ? :)
 
Bluffing as in they've just applied for the job and they can't program
 
Ask them to go through logical tests without necessarily needing code.
 
ok i got that.. but what is the endgame then ? :)
 
Hiring or not hiring
 
8:01 AM
"sorry i got hit on the head by a rock and now have amnesia"
 
Oh no, it's to just constantly ask for help
And by the time the internship's up maybe they've learned some stuff, but either way the company probably won't sack them, so they'll have it on their CV
And they'll constantly go for nontechnical tasks
 
Make that 9.
 
NOOOOO! Not the glorious Robert Grant the 9th!
 
I wonder what's going to happen when Martijn realises that he himself is a sockpuppet that we all share on the AI server? Some kind of OverflowError?
 
Ok guys, thank you for your suggestions :)
 
8:09 AM
oh.. somehow i already finished my next assignment..obviously with horrible structure.. i have the problem of not really putting things in one loop, rather several loops after another..i think that is probably "bad technique"
 
In general, maybe.
Sometimes you may need to iterate over a sequence more than once.
But in general you should iterate as few times as possible for efficiency.
 
i wrote that in like 90 mins, instead of the several days i needed in the past to get nowhere :)
 
Okay you should try to minimise the amount of code in the try.
 
i am sure you can write the same logic in 3 lines
 
Why do you even need a try except loop there anyway?
 
8:11 AM
you mean i could just do an else:
and delete the try except structure
did i understand that correctly?
 
I don't know what you're trying to do and don't have time to go into it. But having so much code in a try block is inviting trouble in the future.
 
ok thanks, noted !
 
@StephanKetterer try rewriting it a few times, as you say.
 
must probably look the ... to you... but getting anything to work is already pretty big for me :P
 
Yeah that's cool!
I can't see anything on pastebin anyway, so don't worry about that :)
 
8:19 AM
ah.. so giddy now that things start to get going :)
wow, next little assignment finished again :)
 
Is enumerate just a zip with range(len(input))?
YES! First hard (wasn't so hard) codeeval worked first time.
 
@RobertGrant I don't think so. list(enumerate(i ** 2for i in range(10))) also works. Probably its not based on len at all.
 
8:35 AM
Oh, that's clever. I guess it's a generator.
 
@Robert it's best to think of it as zip(itertools.count(), iterable)
 
Sure
 
@Robert Thank you so much for your help, was able to finish 3 little assignments(just a few lines of code) already today.. would not have been possible without your help
 
@StephanKetterer pleasure; don't forget @JRichardSnape also gave you quite a few useful pointers :)
 
very true :)
 
8:40 AM
@RobertGrant Cool - I told you it would get easier :)
 
4
A: Sort a string in lexicographic order python

unutbuYou could use a 2-tuple for the key: text='aAaBbcCdE' sorted(text,key=lambda x:(str.lower(x),x)) # ['A', 'a', 'a', 'B', 'b', 'C', 'c', 'd', 'E'] The first element in the tuple, str.lower(x) is the primary key (making a come before B), while x itself breaks ties (making A come before a).

please upvote unutbu^
 
Sorry - that was aimed at @StephanKetterer, thanks for the nod @RobertGrant
 
(the cmp answer is too close to that in score)
 
cabbage to all, by the way
 
Yes, giving credit has got easier; you're right :D
 
8:42 AM
:D
 
@RobertGrant it is not a generator, it is an iterable/iterator.
a generator has a .send method
 
Cabbage!
 
and cbg
 
cbg @JRichardSnape and @poke
 
8:56 AM
cbgcbg
 
just out of curiosity, anyone have any experience with pymongo?
 
Yarp
 
should not have said that :)
 
inb4 "hur hur use a real database"
 
i am gonna remember you when i have question:{
 
8:59 AM
Mornin'
 
cbg @IntrepidBrit :)
 
Don't worry about it, I just won't answer :)
 
@AnttiHaapala ah okay, yeah
 
oh that udacity course uses mongodb, so it is not really my choice :)
 
It's glorious outside
I think that I must be ill or something.
Oh no, wait! Is it undergrad examination time?
 
9:01 AM
Oh... St George's Day...
 
Ah, St. George's Flag. Unfortunately hijacked publicly by racists :/
 
It's kinda odd that it's okay to be proud of being Irish, Welsh or Scottish... but displaying some English pride is skewed as racist or something...
 
Strength through unity. Unity through faith. I'm a God-fearing Englishman and I'm goddamn proud of it!!!
 
Yeah it's weird how it's normal to see flags hung outside houses in the States, whereas the connotation is now so negative that you only expect a white vest-clad, Stella swigger to live in a house in the UK with a St George's cross outside
 
Fantastic film.
 
9:05 AM
@AnttiHaapala love that movie
 
me too
gotta watch it again soon :D
 
@AnttiHaapala Cracking film
 
In 6 months and more like 12? days CARRIER LOST--
 
@JonClements Yeah. I've never understood it either. I blame the media. Seems a safe bet
 
lol :D
 
9:06 AM
Oh, no that's not the right day
 
can't count months like that really
6 months and 13 days I guess
>>> datetime.date(2015, 11, 5) - datetime.date(2015, 10, 23)
aaah.. but 6 months 12 days and ending at midnight
 
Time is weird. Nearly as weird as the false constructs we have invented to describe it.
 
S'not false if it's a construct srly?
 
I was being intentionally poetic, you're allowed to say false things if that's the case.
 
continuous variables, eh
 
9:11 AM
We should measure time in Planck seconds to avoid confusion.
 
To avoid confusion? I can envision a scenario where people ask questions like: "How can you measure a second with a plank anyhow?"
 
Are we up to Plan ck already? I've only just abandoned Plan B. Is Plan ck fully backwards compatible
 
@IntrepidBrit Doesn't it vary from what type of wood it is?
 
Only if you use balsa
It's all down to grain densities I think
 
I don't know why I put up with you lot. I should go somewhere else where they don't defecate over my genius. Somewhere where I'm APPRECIATED!
Brb a sec
 
9:20 AM
@Ffisegydd Have a horrible feeling it's going to take much longer than a second to find that place matey :p
 
anyone know a good rabbitmq python 3 lkib
 
@JonClements Certainly nowhere within walking distance of Brizzol anyhow :P
 
@Antti you mean something more direct API than celery?
 
I am returned to you.
 
yes, and I mean the commonly accepted definition of good, with which celery does not comply
 
9:22 AM
Oh... so no one else wanted you then... and now you're back, hey? :p
 
I do love trains.
 
@Ffisegydd steady... that was so dripping with sarcasm, I've got it coming out the monitor and it running over my desk...
 
I decided that I couldn't give up on my community outreach just yet. I will help you all become decent human beings, even if it kills you.
 
surely it will kill me
 
I wasn't even being sarcy!
 
9:24 AM
Why would I want to be human?!
 
I think it's a great idea to be able to do your first and last hours of work in the day on the train as you commute
 
changing species from crazy Finn to a decent human (H. sapiens decens) would mean some kind of genetic therapy, anything like that would come with high risk
 
@BobbyG the issue with that is that you're not always guaranteed a seat.
 
Travelling by train is the most civilised way to travel, imho. It's the only form of transport that doesn't cost me money.
 
Train is stupidly expensive where I live
 
9:27 AM
I would want to become a member of parliament here...
 
in germany, trains right now get killed by dirt cheap long distance busses
 
free domestic flights on Finnair, with platinum status :P
 
@StephanKetterer I got a coach from Leeds->Kent for £21 (fine - it took 6 hours)... but the train would have been 4 and was £150
 
no offense, how many airports does finland has ?
 
@JonClements The closer you get to London, the more they rinse you of your hard earned cash :(
 
9:29 AM
yeah Jon , same here.. and even the busses offer free wifi
german train system is a joke
 
@StephanKetterer well Finnair sells tickets to 16 airports
 
Up here in Scotland the train is slightly more expensive than taking the bus - and, much, much faster
 
though some of them are seasonal, in Lapland
 
Is that a strip club?
awaits the rotating knives
 
Here's a question about Finland: I know it's considered one of the Nordic countries, but it shouldn't be considered as "Scandinavia". I was wondering about the distinction?
 
9:32 AM
@AnttiHaapala i think i either severely underestimated the size of finland, or you guys just like to build airports
 
@Robert yes... you get to sit on an old bearded gentlemen's lap and told you've been naughty...
 
Going to a strip club dressed as Santa would be quite a good visual joke
 
@IntrepidBrit depends, the Scandinavia in its strictest definition refers to the scandinavian peninsula
 
i know a lot of people from northern countries come to germany because the booze is much cheaper
and they want to drive their sport cars on our roads
 
Which is fair enough
Although not at the same time
 
9:34 AM
or the area that was sweden until norway split off
 
@Robert okay... but we don't have enough funds in the sopython coffers to pay for your bail... so be careful :p
 
Don't worry, in a south african jail I won't last long anyway
 
just out of curiously , can you get in jail for speeding in the united states?
 
We had a lot of tough financial decisions to make at the Quarterly RO Ski Retreat.
 
@IntrepidBrit then it can be the sweden + norway + denmark as they speak (almost) mutually intelligible language and there was the movement of pan-scandinavism that sought to unite these countries...
and then there is the "scandinavia" that the "americans" think off
 
9:36 AM
@JonClements: well into the double digits now. I'll stop counting again now.
 
@AnttiHaapala *Americans and Brits.
 
well, brits learned it from americans I guess :D
 
Martijn you should buy a gong for your desk to strike whenever you get a sockpuppet.
 
@Martijn Did you sing this to yourself when you achieved mod stauts? youtu.be/68ugkg9RePc?t=34s
 
@Ffisegydd Not sure I want to attract that much attention to my office hour activities. :-P
@IntrepidBrit I did. But in this version: youtube.com/watch?v=aWB4e1Xly04
 
9:40 AM
@MartijnPieters Whoooooa. Trippy.
@AnttiHaapala I'm guessing the pan-Scandinavian efforts didn't work out then?
 
well, not in that form :D
but now the nordic countries have much more closely knit cooperation than just EU would require
 
@MartijnPieters I expect triple digits by the end of the week! :p
 
@JonClements Stop creating socks, Jon. This is serious business, not a race! :-P
 
@AnttiHaapala I think that's the way the EU should work. All share an interference free frameworks (like free-trade, etc) - but closely work with partners on topics of interest.
 
@Martijn sighs... okay... just don't kill the 10k I'm creating for next election, okay? :p
Apparently - the first youtube video was uploaded 10 years ago today
That doesn't sound right... I'm fairly sure Google Video existed around then trying to already step into the market
Me at the zoo is the first video to have been uploaded to YouTube. It was uploaded at 8:27 pm on Saturday, April 23, 2005 by the site's cofounder Jawed Karim, with the username "jawed". Described by The Observer as "poor-quality", the nineteen-second video was shot by Yakov Lapitsky at the San Diego Zoo, featuring Karim in front of the elephants, professing his interest in their "really, really, really long trunks". == Transcript == The transcript of the video is this: Alright, so here we are in front of the, uh, elephants. Uh. The cool thing about these guys is that, is that they have really...
 
9:56 AM
@IntrepidBrit it also goes to aid the movement of people, for example, a Finn does not need any documents for travelling to Denmark, Iceland... a car driver needs a driver's license ofc, so it is much like the CTA, and there was no requirement for residence permit even before EU, also naturalization in any of these countries requires only 2 yrs.
 
That's quite sensible
 
Hi guys. I need a bit of help with setting up pyperl. Is this the right place to ask questions?
 
wouldn't hurt to have extra passports so I guess if I did live in Sweden, could get the passport there too :D
double the amount of embassies to go to in case of trouble :D
 
@AnttiHaapala Yeah. That makes sense, especially since there's many cultural similarities (compared to the rest of the world)
 
@Hamster whyyy oh whyy
@Hamster guess it works only on CPython up to 2.5
 
10:18 AM
arhghghghghghgh my row counts are off by one.... just one... weeps
 
@JonClements for most jobs, that level of accuracy would be amazing :)
 
Make sure your next table is under by one then average them. MATHS! SAVING THE DAY ONCE MORE!
 
@AnttiHaapala trying to do less perl and more python
 
@Hamster how about 0 and 100 %
I haven't seen a perl program in ages, for all what it is worth, it died already
 
10:22 AM
haha - Im afraid it will have to be a gradual process. Too much perl in place at where I am
 
then you're screwed :d
what field is this?
 
@AnttiHaapala Open a gif file in a text editor... you'll get the same effect :)
 
tech. domain industry
 
@JonClements true.
#!/usr/bin/perl -w

GIF89a�^@�^@��^@^@^@^@^@^@�^A^A�^B^B�^C^C�^D^D�^E^E�^F^F�^G^G�^H^H� �
ah sorry for pasting a code sample without using pastebin ;)
 
Wow... almost readable perl code... don't get to see that, that often :p
 
10:28 AM
@Hamster so you're trying to run Perl from Python?
 
Yep
If we have any hope of getting out of Perl, this will be it.
I cant rewrite all the Perl stuff into Python atm because there is not enough time allocated in this project to do it.
 
Then do rm *.pl?
 
Hells yeah. First kickstarter has arrived
 
ooooooooo?
 
Sheer nostalgia book
 
10:41 AM
aww sweet :)
 
Guys on another note... Coming from a OO Perl background, is there any good books you guys would recommend for me to read to get me into my first Python job?
 
Programming Python by Mark Lutz is quite good.
 
Why do I always feel tired after a relatively good night's sleep? :(
Always feel more awake when running on empty
 
@JonClements that's adrenaline and caffeine working for ya :)
Why am I talkin' like one o' those Merkins hoo types like a hick?
hooboy!
 
yee haa pardner!? :p
luss go mosey d'on to 'e bar?
 
10:55 AM
Got to give a presentation on "a complex problem" for an interview in two weeks time. Niiiiiiiddddddaaaaaabbbbbbbaaaaaa!
 
I'm pretty sure the TV show Frasier was invented solely to portray an inversion of the stereotype that Americans are less sophisticated than Brits
That and, you know. Money.
 
@Ffisegydd good job on making a sumerian goddess sound like a cowboy shout out :p
 
user4433485
Cabbage Everyone!
 
wb @Katherina!
 
Cabbage Katherina!
 
user4433485
10:58 AM
How is my lovely community doing?
 
Busy, annoyed, stressed, something like that
Me at least.
 
@Katherina errr.... which one are you talking about... you in the right room? :p
 
How are you? Recovered from your accident yet?
 
user4433485
I am okay I feel better, except for the ribs, it hurts when I laugh
 
:/
 

« first day (1650 days earlier)      last day (3288 days later) »