« first day (1910 days earlier)      last day (3261 days later) » 
00:00 - 15:0015:00 - 00:00

00:00
That code doesn't change the...you know, nevermind :)
oh I see I think. Gosh that's ugly. My way is better
the way you're doing it is O(n^2) at least
Is video a unique key? You could pre-process _sorted to make it decent
eg:
input = ['abc_1', 'sss_2', 'dada_3']
and then output is:
['abc_1', 'dada_3', 'sss_2']
sort by most visit..,,
humbb..
good_sorted = {str(x['video']): x['visit'] for x in _sorted}
sorted_video = sort(_video, key=lambda x: good_sorted[x[5:]])
unless video's value isn't unique, in which case he needs a better solution.
convert the sorted data structure to directly map video numbers as strings to their position, then use that to look up the sort key for the number for each video
user559633
garlicDB
00:05
@tristan agree
00:18
@AdamSmith, yup that videos has a unique key..
Well there's your answer then
not yet sir..

>>> good_sorted = {x['video']: x['visit'] for x in _sorted}
>>> good_sorted
{1: 2, 2: 1, 3: 2}

am getting error, if i try it with sorted_video
watches clock 30 minutes UGH.
I'm not usually that guy but I don't have anything I can dive into for a half hour of work
user559633
there goes 4 minutes for you
user559633
00:29
mildly nsfw language i guess.
user559633
warning: don't click if you're a child or get your knickers in a twist over rough language
@tristan I just finished marathoning RLM's entire movie review playlist.
user559633
@davidism I haven't watched many "half in the bags," but once i'm no longer homeless, i'm going to set up a projector and just go through them all
could you please take a look at the following question that got recently deleted?
I am probably missing smth, but I think it deserves to stay on SO, what do you think?
@alecxe it sounds really broad
00:39
really?
really
there is a specific example there..
I am not sure, asking for an advice..should I bring it up on meta?..
I don't think it's too broad, and I can't figure out why it was deleted.
The "specific example" being "there's a spelling mistake"?
Yeah I strongly disagree with "too broad," which is probably justification for a meta question
@davidism The specific example being "Here's a module that does spell checking, how do I wrap that into a CI service?"
00:40
I'm not saying it shouldn't be undeleted, but I can see why it was and closed as well.
As opposed to "How do i do spell checkz?"
When you put it that way, it makes sense.
I voted to reopen and undelete.
I voted both to undel and reopen. Thanks @alecxe
It's not even asking for an outside recommendation, library, etc. The question boils down to How can I integrate PyEnchant with pylint or flake8?
Thanks guys, may be the wording was confusing
00:43
it is now undeleted, one more vote to reopen
@tristan my favorites from them are the "Wheel of the Worst" episodes of "Best of the Worst". Watching other people suffer through awful "movies" is wonderful.
user559633
i'm a peasant, so i really like the popular plinkett reviews. i have the baby's day out review on a local mirror. oh wow, they have it back up now.
DSM
DSM
Ooh, random fact: a friend of mine showed up in the background in their video from a convention they attended.
@alecxe that screenshot is gigantic though. If you have a Retina Mac you need to scale it down before posting.
@davidism good point, pointed it to the *medium sized screenshot
01:46
@davidism, @AdamSmith, my question was solved with this.. http://stackoverflow.com/a/33988120/3445802

with changing `_sorted` to list first.
02:18
Is it possible to have my application automatically install other packages when it is installed (using pip)?
@DSM Just saw your suggestions for my golf. Good catch on the q=len(x), that was left over from a previous revision when I was using it twice, but I forgot to inline it.
I was able to inline q too to save 2 more.
DSM
DSM
@MorganThrapp: oh, hey! You can remove the () from the argument to max (just flip the second sign).
@DSM Oh, awesome! I figured there was some math trick to do that. :P
DSM
DSM
02:36
Below 80. Not bad.
Yeah, I'll take it.
If I can get within a few points of double whatever Martin Büttner scored, I consider it a win.
I just voted to reopen [this question(stackoverflow.com/questions/34668127/…) - does anyone else agree that the referenced "dupe" answer doesn't really cover the question?
@holdenweb There, I reopened it :-)
Thanks
You are welcome :)
02:45
Hadn't realised you were in the room or I'd have asked you first!
@davidism Hmm, I thought that would work, but I'm getting a Could not find a version that satisfies the requirement error.
That's an issue with the library on PyPI, not with the requirements.
Oh, well I'll check it out a little bit more, thanks :)
@holdenweb I am in IST. From 6ish in the morning till 11ish at night, I'll be around
@michaelpri What did you put in install_requires?
02:47
I get the error on speech_recognition
that's because it's SpeechRecognition, no underscore
facepalm Duh, thanks for that :)
Can't believe I didn't realize that...
 
2 hours later…
05:08
Cbg
In coursera.org, I see lot DS&algo courses(good quality) in Java. Algo 1 & 2 looks best among them
But I want to use python for DS&algo
Any good DS&ALGO course using python on internet? Currently am using JS, but horrible type coersion rules in JS, so I want to use python
05:31
CBG all.
Cabbage @The6thSense
Hi Puppy :). How is the name ?.
Awesome :-) Manoj Night Shyamalan would be so happy to see your name
05:46
any one who can help me out with python
flask
06:31
@thefourtheye I liked that movie a lot :) and your suggestion made me change my name:).
06:53
@hussain just ask your question.
@The6thSense Awww :-)
But I still don't know why you choose that name. Keeping it a secret ?
user559633
M Night Shamwow
@The6thSense Mine?
yes yours.
Tristian you make it sound like a chinese dish :P.
07:10
@The6thSense Lord Shiva already took the third eye. I didn't want either me being his competition or him being mine. So I picked the next possible eye :D
07:29
Umm by guess was correct :).
Hello, Everyone!
CBG!
So I want to predict the number of orders I get for today based on the previous day data. This is my first time in to M.L. and ANN and stuff. So could you guys narrow down which tool/library should I use for this ? I was researching on internet and I came up with PyBrain, scikit, etc.. I'm sure where to start actually.
@d-coder are you just using the previous days data? Because that's not going to give very good results.
You need a lot of data over time, stretching back months/years, ideally.
user559633
I'm a very young earth creationist. The world was born when I woke up this morning.
I can get a months data
@d-coder more. MORE!
08:11
Umm.. two months data!
You get a months data? Great. Your data is for the Christmas period, we're not currently in the Christmas period though, so there's a significant chance it could give inaccurate predictions.
user559633
1 month's data is probably enough to learn the basics with though.
No. I think I have two months data approx.
user559633
Datas.
The basic basics, possibly. But even for the basics I'd say you need 6 months at least.
08:12
to be precise 1 month and 25 days.
Well I can live with the error margins in predictions as of now. But I need a start!
You should probably start reading books on machine learning then.
If you find a book/tutorial on ML with Python then chances are they will use scikit-learn. That's not a bad place to start.
I want to stick with Python and it's libs.
Then again you may not even need machine learning.
You'd probably get okay to great results using just statistics.
Neural Networks are for what purposes actually ?
@d-coder In your place I would try learning concepts/theories first and then choose the PL.
08:17
Networking neurals. Listen, no one here has the time to spend explaining all of this stuff to you. This is advanced stuff. It's going to require that you put in a non-trivial amount of legwork yourself.
I see
People do entire degrees/doctorates on this subject, so you're going to have to sit down and do your own research because otherwise we'd end up giving you multiple many-hour lecture sessions, and I doubt you can afford my rates.
No kidding!
user559633
No, he's kidding. Machine learning and neural networks are quite easy and you should be able to learn it within a few hours. Just don't start using libraries because then you'll end up confusing yourself.
@tristan O_o
08:21
I wonder why so many people are trying to get into data science.
user559633
You're just operating on arrays. How hard can it be?
user559633
@khajvah That data science money and those groupies.
I got into it for the groupies to help mankind.
user559633
Same but whatever the opposite of helping is. You think I'm kidding.
No I don't.
08:23
It's gonna be tough learning curve..
So any books that you can suggest here for free :P
No.
Go buy them.
Or find tutorials/courses on the internet.
@khajvah : Thanks!
user559633
machine learning 101: [input data] => {{ a miracle happens / computer does magic }} => [output data]
That simple huh!?
user559633
08:25
Yup. That's it.
Dude, don't give out the secret!
user559633
import numpy and update your resume to say "big data"
LOL!
Wish it was that simple!
;___;
@d-coder Don't wish that. It wouldn't be challenging/interesting
08:26
I have fidgeting around this M.L. and ANN a bit.
user559633
excel crashes welp, looks like i'm big data now
@tristan Reminds me of a guy who was very happy that he riced GCC.
thank you all! Gotta update my resume now ! :)
user559633
@d-coder /me adds "technical trainer" to resume
user559633
@khajvah "riced GCC?"
08:30
@tristan Whatever the term was for internal compiler errors
user559633
oh, he tristan'd it
He "'d it.
user559633
gcc.js
user559633
also, you really have to fuck up your syntax pretty bad to get GCC to barf errors at you
user559633
08:32
@khajvah welp. i'm going back to bed
user559633
not kidding. rhubarb
08:56
Cbg
@tristan that's exactly my understanding. You just missed the "follow a Spark tutorial exactly and post on the author's blog whenever anything doesn't quite work"
Turns out MySQL already had that, which I never knew
Lesson learnt: read the article before replying
09:13
I didn't see; don't worry :)
I thought itebook was the best site for free ebooks. Well lets see this archive then.
@The6thSense archive.org is legal. (I don't know about itebook)
09:29
Umm I also don't know that :p.
Cabbage!
Cbg! Happy new (late) year all
@IanClark Happy new cabbage to you too!
@poke Yeah, waiting for a t-shirt :P
:P
09:35
@poke o/ - no I haven't, is this a yearly thing they do?
Yeah, it is
@poke don't try to take it on Chrome on Android. Surveymonkey have botched something and you'll get frustrated quickly as focus keeps going back to the last text box (regardless of what widget you are on now).
@IanClark it is a yearly thing to do.
@MartijnPieters Cbg Martijn, hny - sweet :)
@IanClark: the result of last year's survey: stackoverflow.com/research/developer-survey-2015
JavaScript is the most popular :(
09:53
How many pennies are there ?:P.
I wrote 300
My guess is 540
I said 400
Umm no one around 500
I want a t-shirt, so either it's around 300 or I need 100k reputation
10:00
I just thought that you could get about 30 coins lying flat in the middle of it, and stacked about 20 coins high (which might be way off; hard to estimate) which would give 600 coins if stacked as a cuboid, but then the thing curves in at the bottom so I removed some :)
Also 30 is probably too many
I counted the papers next to the thing
@khajvah 100k is too far :( and 300 pennies is too low :P.
Lets see who agrees with my count
I just did a rough estimation.
I counted how many open packages of 50 pennies there are on the table..
@poke How many in each packages did you assume there were?
It’s written on the package.
10:04
Smart
oh wow missed that. I counted them but assumed there were 20 in each
I guess I should get 100k reputation
That was the missing piece of the puzzle:(. Poke I think you did it :).
@khajvah count me in 100k it is or we could wait for next year :p.
Found something weird today
'\0' * 16 produces junk value some times
That too only number 16
Junk?
Yup. I think it outputs the memory contents
10:18
I get '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
Yup, I even got that only
But when we run Python as a server (which does Crypto operations) it produces junk
The value changes whenever we restart the server
It feels like the problem is with crypto ?
Not sure what the actual problem is.
Worst part is I am not able to reproduce it locally.
@thefourtheye Crypto is written in C++ right?
10:23
Is there OS difference between server and local or is there any other variation ?
@The6thSense what?
I was asking if there is any platform difference between his local and server. Since he is not able to reproduce it in is local system.
hello all
10:28
I want to dynamically include get or post or delete in the requests method like resp = requests.< method >(url, data=payload) is that possible ?
simplest way would be requests.request(method, url, data=payload)
getattr(requests, HTTP_METHOD)(url, data=payload)
Could explain it ?
cool thanks @bereal
requests_status = data['requests_status']
ip_address = data['hardware_detail'][0]['ip_address']
payload = {
'name': 'Simon',
'ip_address': '127.0.0.3',
'payload_version': 'v21.0'
}
resp = requests.request(requests_status, url, data=payload)
Actually, bereal's way is better. I didn't know the API :D
10:32
so i dont have to write long code .. thanks all.. love this community
Yeah bereal's answer is quite good :).
brb all :)
@thefourtheye For example?
They use some .so files.
It is internal code. I tried to reproduce it locally, but I couldn't
10:48
odd
Cabbage from amongst the dreamy spires of Oxford
Yes, today is long winded meeting day for Snapey
Woohoo, Oxford
11:23
@Kevin ans: they don't. The Enterprise is actually fitted with giant skis.
12:00
cbg
@thefourtheye which python
@thefourtheye python version please
Cabbage @AnttiHaapala :-) I tried in 2.7.10, 2.7.11 and 2.7.6
and got it in all of them?
did you use any extension mdoules
windows, linux?
did you include any modules?
Wait, I think there were no extension modules.
12:04
could be damn serious
I am not sure about the modules. Let me check now
@AnttiHaapala Exactly. I told the same thing to guy who brought that issue to me
But I was not able to reproduce it
So I didnt have much to go with
@AnttiHaapala Okay, there are only two files. libcrypto.so and libssl.so
12:24
hi all! can you guys suggest some python libraries for processing tweets.
I used tweepy for fetching it from twitter.
@kmario23 "processing" is a broad term. What do you wanna do with them?
Now, I need to do analysis on the data. Specifically, I want to track how far tweets hop from user to user.
I recommend Python
8
Like, how the influence of follower counts affects retweet count of a particular tweet.
Definitely Python
12:29
@khajvah I kinda have vague idea about getting the counts by parsing JSON. After that don't know how to proceed.
@kmario23 You realize that you are asking to design an algorithm for you,right?
@RobertGrant yes I'm doing it in python only.
@kmario23 then you should be all set
@khajvah Yes, I do. But I want to know whether there are libs in python for doing such things.
@kmario23 libs/programs tackle specific problems. Your problem is too broad. Design your algorithm, break it down into pieces and then search for libs.
12:34
Python and a developer, you need.
@khajvah I understand.
@RobertGrant Yoda, is that you? :D
@thefourtheye is it python, or some web ide?
prolly broken build
13:06
cbg
13:44
@AnttiHaapala Python only. I also suspected that. Thats why I downloaded the source code of 2.7.11 and 2.7.10 from official website and compiled
Also I tried with Mac as well.
There was an installer and it installed the binaries
user559633
@RobertGrant it has insert on duplicate, which is kind of the same thing.
Yeah
Still, sounds as though it'd save a lot of time
(For those not using an ORM)
user559633
the SO survey was sort of careers? careers. careers.
user559633
for those using ORM, throw in some broth, add a potato, and baby you got a race condition bug going
user559633
13:53
in postgres or engines with transactions, you can lock on your select/insert, which is my understanding of how others (and myself) have been doing "upsert"
user559633
but now it's just there as a keyword
user559633
@JRichardSnape morning sir
So I have a python script that prints out values I store in my database. One of them is a bytes string of some sort. Is there a way I can print without the surrounding b'' ? ( I don't want to decode)
@tristan Morning tips hat
@Programmer decode only when printing
user559633
13:57
@Programmer when you print you get the b'' and don't want to decode? print(var[2:-1])
user559633
yolo i woke up 15 minutes ago
nevermind
user559633
no, it was a hilarious ruse
>>> s = b"123"
>>> print(str(s)[2:-1])
123
Welp tristan's suggestion is clearly the best so far.
user559633
you'll never catch me! twirls moustache and grabs onto a rope tied to a hot air balloon that takes him and his pipe hat away
13:59
balloon sinks pitifully to earth due to an overload of non-functional gears glued to it
user559633
haha steampunk hot air balloon is the name of my new ska band
I feel silly now. Thanks
To be clear, this is probably not an approach you should seriously use.
user559633
@Programmer mine will work if you're getting it back in a container. kevin's will work if you're actually getting a byte encoded thing back. you should decode.
user559633
man, the media really does not want to report on that ^
user559633
danger of google being the only way to find content on the internet -- they can censor to their narrative
user559633
it was a hypothetical "this could be evil" when they were pretending that no one was selling confederate flags, but now it's actually a thing worth talking about. eh, but probably not a thing to talk about in here.
@Kevin Why is it even allowed to do str(b'123')
I can't think of any use of it.
I assume it's because forbidding dumb things is hard work and the language devs don't feel like doing it
user559633
14:05
we're all manchildren here.
@Kevin Well they allowed it in the first place.
Hmm is there any built-in type where str(thing) raises an exception? It would be weird if everything but bytes worked.
right
Well I get b'-----BEGIN RSA PRIVATE KEY....' and I want to store the literal key without the b'' included because when I output it later, I get "b'-----BEGIN RSA PRIVATE KEY....'" which seems to complicate things
user559633
oh man, called that from downtowwwwwn
14:08
Ok, that's the basis of my not-completely-BS answer: str(instance_of_object_class) works, so it would be a violation of the liskov substitution principle to make str(instance_of_bytes_class) not work, since bytes inherits from object.
@Programmer did you really do str(byte)?
@Kevin yeah, makes sense.
No, but I realize I should just decode.
what was a canonical dup for questions like 'why doesn't if a = b or c work as I expect'?
@bereal there's a couple on sopython
Morning cabbage.
user559633
@khajvah what's with all the "really"
@BhargavRao mfw 100+ upvotes
@BhargavRao thanks
user559633
14:16
you seem to be having a hard time believing people are doing things
Also as JonCle said, @bereal Check this out sopython.com/canon
@tristan Taking the joke seriously
It's hard to detect sincerity on the Internet and doubly hard to detect it here in our foul den of snark.
To be fair, I assumed it was bad practice, which is why I kept looking at other options.
user559633
@Kevin SNARK. Oh, I had it written down here as...snacks.
14:17
@BhargavRao yep. Turns out, I even have that very question in my favs on SO.
Lol, happens :)
just saw an SO answer that says literally: "First, Kill yourself. Then you've completed the task! Well done."
So, is flask a decent choice for a publication/subscription model web application? I like flask, but I've never really done async with it
already deleted
@corvid node.js, my friend
user559633
14:27
@corvid for webdev? you could just hook it to redis and have the client watch something like "/stream". there's also server sent events
Hmm, how should I rephrase the google query "electronics stores near me" so that it doesn't include stores that sell nothing but appliances? I need, like, a variety pack of resistors.
"hobbyist electronics"? Oh hey there's a Radio Shack nearby. I thought they ceased to exist.
R adio S hack
DSM
DSM
14:44
Morning cabbage for all.
Happy New Year and morning cbg to all! :) Been a while since I've been here. How you all doing?
DSM
DSM
What am I supposed to do with "do you believe in aliens?"
I'm pretty sure I used to get Radio Shack batteries as a geeky young kid in the 80s. Purple with a stripe, right?
@DSM Answer it?
14:48
@DSM I can neither confirm nor deny the allegations about my origins
DSM
DSM
Is "Yes, but I think the nearest alien life is likely so far away we'll never know they're there" a yes or an effective no?
It's a rational position. Effective no. They are at practical infinity
DSM
DSM
This survey doesn't end!
user559633
@DSM That's a 'yes'
user559633
And isn't there a strong belief that bacteria existed at some point on Mars?
14:53
Certainly there's a strong belief that the conditions were right, where bacteria could have arisen.
But from our sample size of one, we don't know how likely it is that life could emerge in even extremely favorable conditions.
The "kick-off event" of self-replicating amino acids might be a one in a zillion chance even if you supply the heat and the primordial goo and maybe a couple lightning strikes
I'll just re-simulate all possible universe states as I did the other day for poke and fizzy...... ;)
"I work with a lot of legacy code." I got to answer "completely disagree". Win!
@idjaw I am so jealous. 80% of my job is legacy code.
Does "still using by own balls of mud" count as "completely agree" there?
DSM
DSM
@MorganThrapp's the local expert on simulating entire universes.
14:58
@DSM See, that's my position and I answered yes.
@DSM I said "Yes in the sense that somewhere in the universe they exist, no in the sense of crop circles."
"Yes but we'll never interact" is closer to "yes" than "no" in my book
00:00 - 15:0015:00 - 00:00

« first day (1910 days earlier)      last day (3261 days later) »