« first day (2150 days earlier)      last day (3023 days later) » 

00:14
In cpython' in ordre to be callable, an object must have __call__ in dict. Where __call__is an instance. If there's no code object, CPython jump to ob_type->tp_call and use the python arguments as the parameters. That's it.
@PeterVaro The problem is setting ->ob_type->tp_call.
00:59
@PM2Ring the guy I complained about yesterday, who hasn't given any feedback on my answer to his question since February? Well, finally, after my nth comment (n~6) he responded:D I managed to be annoying enough that it was simpler to stop ignoring me.
hmm, maybe just ~4
user6568562
user6568562
@tristan Finally, you know : D
what does he know?
user6568562
It's an expression as in Debian got no heart, you know
oh, no I don't, apparently:P
I'll go google
user6568562
01:10
Hey, come on. Tiny steps to SO, giant f*cking leaps in here, you know : D
yeah, I still don't get it, but I'm sure it's not you, it's me
24 hours ago, by Andras Deak
puts on his past 3 AM badge
what's up party people
\o
o/
~o~
oh nice -> ~o~
that's a good one
my dance skills are exclusively in ascii
01:14
that's impressive
not really, I've already given my full show
user6568562
@AndrasDeak It's an expression as in : you see ? And I talked a lot with tristan about Microsoft's Douchebaggery and its weird tendency to poke its own eye out. I was happy I made my first non-Apple non-Microsoft os workd and I thought I'd share it with him
01:28
Ah. So when I asked "what does he know?", I should've asked "finally what?".
I didn't know what to look at in the screenshot
frankly, my purple avatar is very distracting
Should I flag: http://stackoverflow.com/q/39312609/179081
to be migrated to cross validated?
As I got to the end of answering it,
it became very clear that it is a question about Stats/Machine learning.
Not a question about programming.
@Oxinabox if you already gave a proper answer and the question's fine too, I wouldn't bother with migration
unless you believe that a much better answer might be available there...
It almost certainly is.
I'm usually very reluctant with migraton suggestions anyway
the golden rule is "don't migrate crap", and I have an exceptionally high bar for what constitutes crap
I'm a programmer, with a bit of a specialty in machine learning.
People on Cross Validated tend to be Staticians (/machine learners) with a bit of an ability to program
01:34
@randomhopeful I suggest installing some gnome extensions and tinkering with the stylesheet:
cabbage
o/
@AndrasDeak thanks, I'll leave it.
:)
good night
01:38
Can someone please hammer this: this should be hammered with this
I love this chat-room, because everytime I joing it with an open-ended question, I end up answering it myself before I hit Enter.
I would help you hammer, but I don't have enough rep
Are people really that bad at searching?
I mean...seriously...that OP question, word for word lead to the answer in soooo many different links
01:52
Yeah, but then they have to actually do something.
And that's haaaaaaaaaaard.
sigh...
Yeah, that's crazy broad.
@MorganThrapp how did the move go
Pretty good. I've been moving stuff in since Wednesday, so it wasn't as bad as it could've been.
Today was furniture and the last car load of stuff and things.
Now I just have to unpack. Thankfully that doesn't involve driving, so I can drink while doing it.
eval...really?
good...changed.
02:13
Hi guys
howdy
this room reminds me old times mirc chats
02:31
@idjaw oh come on - you're not even tempted to throw in newlist = [dict(zip(['Name', 'City', 'email'], el)) for el in zip(*[iter(lst)] * 3)] for that one? :p
heheh
@NinjaPuppy I think I need to ease up on the "criteria to answer" and just answer things
@NinjaPuppy and that is a great answer :)
Have fun explaining it :)
Aw, c'mon not even one map call?
well, a familiar face just posted this
@MorganThrapp go for it :)
dooooooo it
do it do it
I'm on mobile or I would.
02:41
you can still do it
install the app
I have the app.
I'm mostly lazy. :P
oh hai there o/
@NinjaPuppy oh...I guess my answer ended up being similar to this o_o;
heheh
I avoided hard-coding numbers though...I feel icky when I do XD
02:45
Just do what I do. Instead of numbers use len and the right number of spaces.
Why do x=5 when you can do x=len(' ') . Way more readable.
what's more explicit????? brain 'splosion'
03:09
:O
Amazing stuff...
DSM
DSM
Evening cabbage for all.
o/ @DSM
cbg @DSM
03:59
I have a n*n list. x=[1, 2, 3, 4, 5, 6, 7, 8, 9]
given that i know n, how can i create a n*n matrix out of this looking like:
[[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
I know numpy should make it easy but I'm not too familiar with numpy yet
DSM
DSM
I'd use reshape.
@DSM amazing - strangely so would I :P
ok i have a little problem. i installed anaconda, created a py2.7 environment and used that environment as my project interpretor
I know that numpy is included there but I'm getting an error in pycharm saying ImportError: No module named numpy
04:19
unless you explicitly installed it into your environment - I wouldn't have thought it was there... anaconda's default will presumably have it though?
@NinjaPuppy figured it out. anaconda's default environments don't have numpy. just needed to pip it
Would there ever be a case where shutil.copy2 would fail with TypeError: Embedded NUL character when passed to os.path.join(directoryA, directoryB, 'filename' + '.ext')?
By the question I'm guessing yes... what does repr(directoryA) and repr(directoryB) show you?
I'm only getting the TypeError with two particular files; outputting the path passed to shutil.copy2 shows that there are 21 spaces being inserted at the end of the filename and directoryA, which occur after being passed to os.path.join but not before.
Strange... not seen that happen before...
04:29
Give me a minute or two to copy those files into a different directory and test them with repr; I'm doing a batch operation on a bigger set at the moment.
Umm... not a bad attempt
The assignment seems a bit odd - presumably the assignment is coming to using the base class methods later as a "correct" way to do it...
Yeah, it looks like the assignment was made for a more statically typed language and ported to python where duck typing works with minimal effort
Hmmm, it looks like the data is being given a whole lot of null characters. The difference between those files and the ones that work is that they don't have an album artist tag (so my code draws from the artist section)
The weird thing is that both values appear to be 'Kalafina' in file browsers (so it shouldn't make a difference), but when the artist is goes through a sanitization function, it gets a whole lot of \x00 values appended. The same string, coming from the album artist field doesn't have this issue...
04:50
You dealing with mp3 files or something?
Yeah, reorganizing ~20GB of files according to their metadata
IIRC - certain parts of those are zero padded to a fixed size... if I remember the mutagen library is quite useful for processing the metadata
is using mutagen :D
@NinjaPuppy That might be the reason... any idea where I should look to find the doc about that?
Nope - I just recall ages ago when I was trying to faff around doing something similar before I discovered the mutagen library...
Probably simplest for now to just remove nul chars
Dang. It looks like you're on the right track though; they're being padded to 29 utf-8 characters
04:54
Good... now if only I could remember where I put my keys... :)
Thanks for the help! Your keys are in your winter coat IIRC ;)
It turns out I tried the correct solution, but forgot that `strip` ignores null characters unless specified
It works now with .strip(' \t\r\n\0'). Awesome!
Cool... glad you solved it :)
05:44
@Karin grrr... annoying when people answer questions like that :(
06:02
yeah =[ I guess it's easy free rep
@Karin that would be worth :P
I wanted the OP to have a chance to add his own attempt in first
though the accepted answer is ...
too convoluted :P
what does that extra split do there
voted as too broad
OP also has such a diva attitude, goodness
Can tell schools have been and will be going back tomorrow can't we :)
06:12
I'm technically a student ;)
Well there's student and then there's student :)
true. but I guess I try to be sympathetic...most of us were young at some point :P
@user2284570 read the code that I linked, carefully... gist.github.com/pakt/c70073a0e0de1f47f579#file-rdwr-py-L67
@u
@user1107049 it does almost what you want. Instead of creating a function object, it creates a bytearray object with desired attributes, then uses (the stupidly named) read_dword to get a reference to a fake object. There is no stack protection that can help with this, it is all data-only operations well within allocated objects on heap.
@Karin Though it's the expectation that SO is a 'do your homework' website that is a problem. But by the time a user has a little bit of experience/rep with SO, their attitude improves and they seek help with their homework
@user1107049 I guess you're hacking into something. If so, I'd take 50 % for complete solution :P
@user1107049 sorry for wrong pings, perhaps you should get a new username :P
@user2284570 ^
I guess we should update room rules, state that "non-numeric user name is preferred"
06:40
@Karin "Stack Overflow is a question and answer site for professional and enthusiast programmers."
I read that also as "elementary school homework not allowed" :P
true =]
06:54
Cabbage
@idjaw Ah. That Project Euler problem again. I see DSM answered the OP's immediate question, and gave a hint that their algorithm is hopelessly inefficient. I'm tempted to link them to this question, but I guess it's better if the OP figures it out for themself. :)
cbg :)
Number guessing, tic-tac-toe and the usual stuff is all flooding back \o/ :p
Hi
I saw yet another broken-phone-diagnosis program yesterday, too.
That sounds vaguely interesting...
what's the analogy for that code
"I'm trying to brute-force a projecteuler questions before I improve my code."
it is like "I am trying to kill my first patient. Then I will start looking for a cure to cancer."
07:01
@NinjaPuppy If you're talking about the phone diagnosis stuff, it could be, but it's not. The code is invariable a horrible twisty maze of nested if... else. (Sorry about the triple ping)
if and else I've heard of those... :)
@AnttiHaapala I don't know which is worse, those "elementary school homework " questions, or those "I just started using Python and some huge complicated framework, and I don't know how to do some really elementary operation in Python".
Eg, they're using OpenCV to do some fancy image recognition, or NLTK to do deep text analysis, but they don't know what a tuple is.
@user2284570 I am not sure if the code above will work for this: it does access array out of bounds, yes, but the target is another valid C object there. It still has undefined behaviour according to C standards, but would work on all compilers and all options that I've seen.
@PM2Ring or the string interpolation question from that Vietnamese guy yesterday
-1
Q: I cannot figure out how to interpret `someday' as a date or time [Python]

lá»™c phanI am working on python with piece of about date-time.Its purpose is to list the files from specific date in the past util today. Unfortunately, I get this error: I cannot figure out how to interpret `someday' as a date or time Code: import os import datetime day = 3 hour = day * 24 today =date...

Yeah... that did make me laugh :)
... yet...
0
A: Take a picture based on the scale of detection- Python + OpenCV

lá»™c phanimport cv2 def diffImg(t0, t1, t2): d1 = cv2.absdiff(t2, t1) d2 = cv2.absdiff(t1, t0) if ((d1 > 300).any() or (d2 >150).any()): print "movement" return cv2.bitwise_and(d1, d2) cam = cv2.VideoCapture(0) incfilename = 1 winName = "Movement Indicator" # ...

well I guess the latter is apparent plagiarism :D
copied almost verbatim from here or perhaps some opencv manuals without explanation
07:14
Looks close enough - I've deleted the answer
Hmm, an entry to a bridge design competition:
in Helsinki... must be the stupidest architects ever. I was looking at that tram platform thing, and it sure looked odd but couldn't realize why... until it occurred to me that not only it is less safe to walk onto the platform island in the middle, but now also they would need to modify all the trams to have doors on the left side as well... :D
didn't it occur to them when they were doing that animation...
@AnttiHaapala I understand newbies getting confused by stuff like that. And it looks like he realises that he needs to use some special syntax to tell find to use the contents of someday rather than its name. But they way he asked the question does make him look pretty clueless.
but yeah, it is Vietnam.
E.g. in Vietnam no one uses Linux. Pirated Windows is the gold standard of computing.
Slightly better than being stupid enough to pay for Windows I guess? :p
07:30
well...
then every computer is full of viruses
because they can't update their windozes
My dad upgraded from Win 7 to Win 10 on his laptop, and he hates Win 10, but he waited too long before he asked me how to roll it back to Win 7, so now he's stuck with Win 10. He's still running XP on his desktop, and hoping that Norton will be enough to protect him...
upgrade him to Ubuntu
that's what I did with my dad
as a bonus I now know how to fix his computer.
(I guess added is superfluous there as one seldom subtracts a bonus...)
@AnttiHaapala It looks like he slept in that jacket. :)
@AnttiHaapala "added bonus" is a bit redundant, but it's still a common expression.
Hey up, Fizzy.
it is common, a million flies cannot be wrong...
Hey up
07:39
s/Hey up/cbg/g
@Ffisegydd ^ you should thank Finland for making BoJo look good!
@AnttiHaapala He's grudgingly coming to accept that Linux might be ok. I've used it a couple of times to recover his desktop machine when it became unbootable. I wrote a simple Bash script to manipulate restore point files so you can easily roll back to earlier configs than "Last known good configuration".
@Karin last chat before going to bed :? :D
just got home XD
_:D:D
good morning then
@PM2Ring BoJo doesn't need help to look good. Look at that magnificent face...
07:44
@Ffisegydd BoJo is PM2's dad?
@AnttiHaapala I don't think so. :) FWIW, it's Father's Day here.
here it's on the second sunday of November,
exactly 26 weeks after our Mother's Day
off to bed. rbrb! \o
Night, Karin.
@AnttiHaapala Our Mother's Day is also in May.
@Karin gn
how is the flag flying custom in Australia...
do people usually fly it every day
08:00
Yeah sorry misping there, was on my phone :P
@AnttiHaapala No. Not many private individuals here have a flag & flagpole. Lots of people fly "toy" flags on Australia Day (26th of January), but apart from that we're not really a big flag-flying nation.
here, pretty much even every small house used to have a pole, but not any more
but even new apartment buildings would have one, the service company would take care of flying the flag :P
In the cities, many large commercial building do have flagpoles, and of course all government buildings do, but police stations generally don't. And organizations for people from the armed services, eg the RSL are rather keen on flying the flag.
Our next-door neighbour has a flagpole, but they mostly fly the Boxing Kangaroo flag; they only fly the national flag on special occasions.
hehe
it is not common to fly the flag year round here though.
A lot of people here would like us to have a new flag that doesn't contain the British Union Jack, but that idea is not popular with the RSL: they say that we should keep the flag that our servicemen fought & died under.
08:14
stupid NZ didn't change their flag, the new design would have been much better.
It's annoying that their flag is so similar to ours.
South Africa did change their flag, well, for a reason, but they also got rid of the Union Jack in process.
08:40
Afrikaans is a daughter language of Dutch and—unlike Netherlands Dutch, Belgian Dutch and Surinamese Dutch—a separate standard language rather than a national variety. As an estimated 90 to 95% of Afrikaans vocabulary is ultimately of Dutch origin, there are few lexical differences between the two languages; however, Afrikaans has a considerably more regular morphology, grammar, and spelling. There is a degree of mutual intelligibility between the two languages, particularly in written form. Afrikaans acquired some lexical and syntactical borrowings from other languages such as Malay, Khoi and...
somehow I got to here :P
it is so fun to realize that I can understand Afrikaans, reading the first column there:
"Hy het op die lughawe aangekom" yeap, he has to the airport arrived.
yeah, I can pretty much get most of the Norwegian that the politicians talk, yet I only have studied Swedish in school. But then...
I need to triangulate Afrikaans with Swedish/German/English
Though, English is not really useful at all, too many false friends.
so "Hy het op die lughawe aangekom"
is quite close to the German "Er hat am Flughafen angekommen", though one notices that it is not the word flight but air in Dutch (luft in Swedish / German)... and the person pronoun is closer to English he.
naturally it should be much easier for Poke, (and Martijn, which goes without saying)
09:06
@AnttiHaapala Then it shouldn't work. It's not whether it write to a region which is allocated or not. It's about writing between the lower and the upper limit of a buffet. The aim is security in order to prevent attackers corrupting data of other memory regions. And there's a 15000$ bounty for anyone who can bypass it.
between the lower and upper limit of a buffer?
hmm then that one does not work, if indeed it secures out-of-bound writes/reads...
Though recently I have been able to perform arbitrary out of bound reads. It might works if there's a bug, but it's very unlikely
And due to a patch refusal i can still read arbitrary memory address in python but i can't perform writing since the object is created with a bug in the buffer() python function
hmm
lol, you've been solving this for one month? :D
@AnttiHaapala No this isn't my only activity.
and I guess you wouldn't reveal me the originator of the bounty :P
:P naturally, no...
09:29
@AnttiHaapala They replied It's completely useless for opening a shell. That's why i'm very intersted by a 64 bits version of this tinyurl.com/q7duzxj
Though there's no shell installed and posix.system() always returns -1
Because the system() C function alaways returns -1
naturally
so what is the aim of the exploit :? :D
what do you need to do
@AnttiHaapala no i just won"t use any exploit i didn't wrote myself :D
I mean...
how should you be able to exploit that bug to get the bounty?
stupid to say that "open a shell" if there is no shell :D
@AnttiHaapala you can download binaries in the non executbale ram
09:43
Then mprotect()
hmm, I guess this is NaCl
10:02
@AnttiHaapala correct. But with a non public abi as cpu target.
So you can only use existing binaries since there's no sdk
For buiding nexe targeting the x32 abi
10:18
cabbage
too broad / tutorial request stackoverflow.com/questions/39315252/… and it has an answer that's a YoueTube link. :(
@PM2Ring in [matlab] similar questions often get comments along the lines of "I have a friend whose PhD topic is this"
Wow - repcapped the first time in... well... probably this year...
February last year! wow
I've been slacking
chasing cats instead of answering stuff:P
Bah typo in peer pressure comment on link-only answer:( Now it'll stay like that forever:D
NO
I can edit my comment on a deleted post :OOO
Time for a huge bug report on meta;)
10:35
If you can see it you can still edit it... had the normal comment edit window expired?
@NinjaPuppy no, of course not. It would be hopeless otherwise:)
I still would've expected it to be frozen once deleted
Same reason you can still edit your answer when deleted...
it could still be of course
@NinjaPuppy I can...?
I was under the impression that I can't
it's consistent then:)
Deleted posts can be edited if you can see them...
Oh, OK. Thanks for the clarification:)
haha, now I found a meta question of mine that I asked 9 months ago, and has been viewed 38 times so far:D
although it's no longer relevant...
I mean, it never was, I'm just wiser now:P
10:39
lol
@AndrasDeak Being able to edit self-deleted answers is a very handy feature. Say you just posted an answer, then moments later you notice a major flaw that's worthy of downvotes. You still want to answer the question, but you need time to repair your answer. So you self-delete, fix your post, and undelete.
10:58
@PM2Ring Of course, I just thought it doesn't work like that, for some reason:)
Unrelated: I need >=1 times 2 cents, please. I posted a meta bug-report about semi-transparent images potentially breaking with certain sizes. Now I bumped into it and realized that imgur itself does the conversion, so it's their bug. Still, others might run into the same issue later on SO...
so do you think I should delete it (since it's not an SO bug), or answer it (to have some trail of information to the problem)?
My 2 cents: self-answer, saying it's an imgur bug.
thank you:)
user6568562
11:23
Morning everyone
hi guys is there anyway to resolve loop import problem in python?
@randomhopeful hey
@pinokio you mean circular imports?
user6568562
@AndrasDeak Yo Andras [ : What up ?
@pinokio have you googled "python circular import"?
11:25
long-time-cabbage
@randomhopeful not much, what about you?
@Withnail cbg
user6568562
All cool, went for a swim, earlier. Summer's moving out
Summer's pretty much shipped out in London.
@randomhopeful in the sea?
yes but they told me avoid circular import in your code but i think there is a way to solve from python language
11:27
Morning cabbage.
cbg, Morgan
@pinokio the best way to solve is to avoid it, right?
Was a shock to the system coming back here from the Adriatic, I can tell you that. :D
@andras
user6568562
11:28
@AndrasDeak Yeah, good ol mediterranean
@randomhopeful nice:)
the suspense is killing me
user6568562
@MorganThrapp Yo [ :
Nice work, Liturgist. :)
Most people would use an editor and type the desired code. — Liturgist 6 mins ago
@AnttiHaapala OK, this seems to work. However, there's a problem for the second part of virtual memory
File "main.py", line 111, in read_byte
return m2[addr]
IndexError: cannot fit 'long' into an index-sized integer
@pinokio Can we assume that you've read and understood this: stackoverflow.com/questions/744373/… ?
11:41
The reason is my Cpython use long for anything above 0x7fffffff instead of unsigned int
@PM2Ring no
12:19
o/
Afternoon all
Struggling to find a clean answer to something. I have an integer i, I want to get the index of a dataframe for row i, how does one do this?
The only way I've identified seems very dirty: slicing one row from the dataframe to return a new dataframe, then referencing the index from that:
data['<CLOSE>'][i:i+1].index
12:43
@AnttiHaapala So in my case id(x) returns long if address is >0x7fffffff
@AnttiHaapala Isn't this something which you wanted recently?
@cardycakes object[i:i+1] is usually equivalent to object[i]
I'd assume dataframes do the same
this doesn't answer your question, but still
doesn't data.index[i] work?
@user2284570 Python doesn't have unsigned ints, so if you want values greater than 0x7fffffff to be represented as positive integers then you're going to get a long on 32 bit Python 2.
13:13
@AndrasDeak hi there. Yeah that works... Was over-complicating it I guess. Thank you!
no worries:)
General question. If you have some data and you are deriving additional columns from it, would you say it's best practice to derive the ones you need as per the requirement, or append the actual data with a whole bunch to reduce on computation?
13:33
:facepalm: The OP of this question just self-hammered to an incorrect dupe target. I siuppose I should've searched for an applicable target, but I'd already decided to be a Nice Guy & fix their code for them. So I un-hammered it. :)
user6568562
13:59
@AndrasDeak I just got aware of this little gem : D This is genius Thank you !

« first day (2150 days earlier)      last day (3023 days later) »