« first day (1778 days earlier)      last day (3177 days later) » 

Air
12:09 AM
so I needed to use 95 as an obfuscated magic number...
len(subprocess.check_output(['python', '-c', 'import this']))/9
nailed it.
 
12:24 AM
I think Python is very similar to Swift. You!?
 
12:36 AM
@DonAlejandro, you've got it backwards; Swift was influenced by Python (among other languages).
 
 
3 hours later…
3:31 AM
Heya, Martijn. Still up at 4:30 AM again?
 
Dan
4:12 AM
cbg
 
Dan
@PatrickMaupin how's it going?
 
Not too bad. Behind as usual. Was considering going to bed, though -- it's 11 PM here. How about you?
 
@Cyphase You're absolutely right. I love the similarities in both language. More reason for me to pick up some Python when i'm ready! How long have you been coding Python?
 
Dan
@PatrickMaupin same time here, also tied up
@PatrickMaupin I switched my hosting provider a few days ago and their service has been less than acceptable
so now looking at webfaction
i have a node.js app that goes down every 20 minutes and remains unavailable (503) for 3-10 minutes on average each time
 
4:21 AM
@DonAlejandro, since dinosaurs roamed the Earth.
(over a decade)
 
Dan
i've changed every configuration setting i can think of and restarted node.js multiple times - i'm confident the problem isn't on my end
but anyhoo, that's been my past couple days and now haha
 
That sucks. I don't currently use any hosting.
You've got your own business, I take it?
 
Dan
@PatrickMaupin not really, i host websites for some nonprofits ran by personal friends, and i have a personal and professional blog for myself
i also spin up random web apps on occasion (usually python + flask, maybe a javascript library also depending on whether i'm feeling lazy)
for fun stuff
but it's not my full time job or anything, and i actually lose money on it
 
Ah. Your blog said you did digital forensics, and I guess I assumed that was the sort of thing that lent itself to small or one man shops.
 
Dan
but they're nonprofits so i tend to eat the measly $25 they may cost me annually for domain renewal, bandwidth, etc.
 
4:27 AM
As far as Python websites, have you looked at pythonanywhere.com ?
 
Dan
@PatrickMaupin I actually work for a large organization in their cyber services / forensic technology practice
 
That sounds like fun. How did you fall into that?
 
Dan
@PatrickMaupin i've actually run apps from their paid interface and really liked it, but i need a provider who can host the lamp stack, node.js, and python
@PatrickMaupin military, law enforcement, teaching, then got recognized somewhat in the field and was recruited by my current employer
in addition to investigations, incident response, etc., i do a fair bit of development (mostly in python) for internal tools
 
Dan
@PatrickMaupin that's good to know
@PatrickMaupin my processes got thrown in their pit or whatever a lot because i would exceed what i was paying for haha
but i was running a web app that collected and classified data then did machine learning, so it was fairly resource intensive
 
4:31 AM
Anyway, it stands to reason that for forensics, you'd be building specialized tools all the time. I build tools to help with hardware stuff (board development, JTAG debugging, etc.)
 
Dan
@PatrickMaupin very cool, we use jtag to read data from mobile devices
 
Makes sense.
 
Dan
@PatrickMaupin particularly to bypass android pass/gesture codes, or when a device is damaged and simply swapping the pcb into a new lcd/digitizer shell won't work
 
Security on most things approximates a joke.
 
Dan
@PatrickMaupin particularly if you get down to hardware
@PatrickMaupin as an example, once you extract a gesture.key file from an android device with a gesture/pattern lock, this is a script to crack it: gist.github.com/danzek/f9416b1404570754b10f
 
4:35 AM
My company claims to have some hardware solutions for security, but I don't work anywhere near that area...
I remember when we got acquired by them, and they came and gave a presentation about all the product lines, and described an FPGA that would basically eat itself no matter what you tried to do to it. I raised my hand and asked "how do you debug the code in the FPGA?" and all I got was "that's an excellent question -- I don't really know" :)
 
Dan
@PatrickMaupin cool
@PatrickMaupin nice
 
I guess you have to get it right the first time...
 
Dan
@PatrickMaupin during my brief time as a ph.d. student at purdue (i didn't finish), the forensics club was working on an fpga password cracker
@PatrickMaupin yeah, no kidding
 
I think our FPGAs are hardened against differential analysis.
 
Dan
@PatrickMaupin cool
 
4:47 AM
Anyway, rhubarb to all -- I'm off to bed.
 
Dan
@PatrickMaupin rhubarb
 
5:16 AM
Does python 3 eats more memory than python 2.

I was taking a huge input of space separated string. The string was accepted and mapped to 'int' in python 2 but python 3 was throwing runtime error on that same large input string?
 
Cabbage
@VineetKumarDoshi Strings in Python 2 are byte strings, but in Python 3 they are Unicode strings, so they can take up more space. That doesn't directly answer your question, but I guess it's relevant. :)
 
Thanks .. I'll google a bit about unicode vs byte strings
 
Ok. I just did a quick test, and I'll post some actual numbers in a moment.
 
Hi all. How do I pass an instance variable as an argument to lambda?
 
In 32 bit Python, an empty byte string takes 24 bytes, and each additional character takes 1 byte. An empty unicode string takes 28 bytes, and each additional ASCII character takes 4 bytes; I assume non-ASCII chars also take 4 bytes, but I haven't tested them yet.
 
5:29 AM
Wow thanks
 
To get that info I used the sys.getsizeof() function.
 
Thanks for sharing this function .. will help in future a lot :)
 
Not a problem. But please don't "star" things in here, unless they're really important... or really funny. :)
 
Ok .. I am very new to chat ... thought star is kind of upvote :)
 
Well, a star is a kind of upvote, but the policy of this room is to not over-use them, otherwise we get too much stuff in the star list
 
5:43 AM
Yea, don't knock my 4-star message out of there :P.
 
:) ok ... cyphase
 
@The_Diver Could you write a small example to illustrate your problem? You can paste code in here if it's less than about a dozen lines (make sure you format it with Fixed Font to preserve indentation). If it's bigger than that then you should paste it on an external site & just post the link here.
@Cyphase Or my 10-pointer. :)
 
You've got 14 points on the board :).
 
@PM2Ring: self.web.get('127.0.0.1')
wdw(self.web, 5).until(lambda self.web: self.web.find_element_by_id('account')).click()
 
Hey up all
 
5:58 AM
G'day, Fizzy.
 
@PM2Ring: I'm writing a webdriver and the code waits till the element to be found,otherwise after 5 secs it raise timeout exception. My problem is that lambda self.web: gives syntax error
 
I don't have enough context to be sure this will do what you want, but try this:
wdw(self.web, 5).until(lambda s=self.web: s.find_element_by_id('account')).click()
 
@PM2Ring: Thank you so much
@PM2Ring : I have another question. I have made a samply,py file for testing this line:
wdw(self.web, 5).until(lambda s=self.web: s.find_element_by_id('account')).click()
@PM2Ring: and I have noticed that the sample one's wait code works faster than the wait code in the main.py file. In the main file I have a lot if assignments. Could it because of slow speed of main file?
 
6:21 AM
It's hard to say what's happening without seeing code. But the speed of find_element_by_id()depends on the complexity of the page that it's searching. Maybe you should try to reproduce your problem with a MCVE and post it on the main SO site.
 
@PM
@PM2Ring Thanks
 
6:38 AM
cbg, Antti
 
The result is still returning an invalid password response. Not too worried about injection attacks as its only for a college project. Just need to work out why it wont decrypt the password when im trying to log in — Ricky92d 15 hours ago
if I was a teacher in college, I'd make them fail for that :D
 
6:53 AM
Cruel, but fair.
Or just do an injection attack on the system and fail them because their database is full of trash. :)
Should we give the OP time to add some Java code to this question, or close it before someone writes an answer? stackoverflow.com/q/32283304/4014959
 
 
2 hours later…
8:48 AM
cbg
 
9:00 AM
Hey up
 
There was a "fun" one earlier today, but I think the HV OP eventually got the message. stackoverflow.com/q/32282657/4014959 Check out the revision history to see the original question title. :)
 
akljskljfdaklsjdfaskldjf
answered a regex question
and now ppl are like telling "the question was not about how to do it right, but how to do it wrong"
 
I was watching that regex question, @AnttiHaapala. Your answer was the best implementation, but it didn't address the asker's lack of understanding about basic grouping.
 
since I added it the 3rd
 
Well, if it rises to the top it will be the first one seen
 
can't believe kasra has now more rep than me :d
maybe I should start answering again
 
9:55 AM
@morrna fixed
and in any case cbg @morrna :D
 
 
2 hours later…
11:33 AM
I made a set of tuple classes for java
really really really ugly
and useful :D
 
write once, read never
 
yes
but this is in a sense better than python's, because it knows the types of the elements
at compile time
however I couldn't even say this in the java room
folks there would probably say "that's not proper java" :D
the java way is that for every single kind of pair you have in your program, you'd write your own class
 
 
1 hour later…
1:26 PM
It's funny that the OP is trying to claim that rotate() is the predecessor of tilt()
 
In Python 2.7.1 it is 8.6
 
So have you tested that rotate() method?
BTW, I just vtc'ed that as a dupe.
 
I'm trying that now.
Wait, how do you do that?
 
Try this:
import turtle
t = turtle.Turtle()
t.rotate(30)
t.write('text')
turtle.done()
 
Nope.
It is horizontal itself :(
 
1:37 PM
Ok. Comment out the t.rotate(30) command. It should open a turtle window, render 'text' in the middle of the screen, just above & to the right of the turtle triangle, and then wait for you to close the window.
 
Yep it does.
But for rotate it is AttributeError
 
Maybe stackoverflow.com/a/18099424/4014959 is using a weird custom version; he does call it pyturtle...
 
Err. This is docs for pyturtle. pygraph.readthedocs.org/en/latest/13pyturtle.html in "English" :P
 
I vote we give up. :)
 
I vote for that too!
 
1:45 PM
And anyway, the OP still hasn't told us what version he's using.
 
Yep. And he expect us to remain there for that long also.
 
The accepted answer at the dupe target says "turtle.py could be updated to take advantage of it." It doesn't say that turtle will automatically gain that rotate method.
 
But that is a quote from another page. :( Anyway let's leave it.
 
Ugg. The answer there looks bad too.
 
1:51 PM
Yeah, he's a new answerer in , still hasn't quite got the hang of it all the time.
It's enough of an answer that I left it.
 
WoW 2 answers written today after a gap of 1 month and both accepted!
 
Oh dear. I wonder how many people try to kill Bash processes with ctrl-z, and think they've succeeded because they see a Stopped message... stackoverflow.com/q/32286049/4014959
 
@BhargavRao Nice. Almost as nice as getting an accept a month after you wrote the answer, which happened to me last week. :)
 
cbg @Jon
@PM2Ring Yep! I had an accept after 3 months once with a comment that 8Now I understand your answer*
 
2:02 PM
:)
 
Speaking of accepts, I just got one for this: stackoverflow.com/a/32285982/4014959 . The code in the OP is interesting, though. I guess it could be simplified a bit using a metaclass, but I don't know them well enough to suggest anything helpful.
 
With that example, it looks like what they really want is a class with methods.
Actually, I have no idea what they want. XY problem?
Nice answer though.
 
Everytime I see XY, I remember PM's XYWTF :D
 
Ah yes, I remember it like it was yesterday. ... It was yesterday.
 
2:10 PM
laurel
 
hey @ZeroPiraeus!
congrats on the gold badge :)
 
And Kevin is outside the top 5 on the starboard. A new low for him or for us?
 
@davidism Maybe it is an XY problem. Their closure-based approach may be good for what they're trying to do, but it's hard to know without seeing more code. OTOH, if the rest of their code looks like that I don't want to see it. :)
 
@BhargavRao Thanks very much for the helpful suggestions, I appreciate it. I agree, I should add explanation and links to my answers. Very good advise. — Joe R 4 mins ago
Then why dont you add it? :/
 
2:26 PM
@BhargavRao It looks like the OP wanted to modify the dict in place. Maybe. :)
 
Ugg. store them back another dictinory (sic)
 
Wotcha @davidism :-)
Gold badge? You mean the Python one? That was a while back now ...
 
Hmmm. Confused OP :(
 
Is there a policy on material misstatements in answers?
 
2:31 PM
Example?
 
@ZeroPiraeus I do remember ;)
 
An answer where the questioner was extremely interested in the big-O runtime of an algorithm, and the runtime was mis-represented. No malice, but it's wrong. I've left a comment. Should I perhaps do more, and if so, how long should I wait?
 
Yep a comment is good. But remember to include relevant details in the comment. Few people comment Hey your answer is wrong! and instantly are misunderstood by the OP.
 
@BhargavRao Oh brother!
I guess the title of this mess ought to be reverted, too.
 
@PM2Ring cv'd it
 
2:44 PM
@BhargavRao Now on hold
 
My heart skips a beat when I see comments like Your code works exactly for me. Can you please help me further more.
 
cbg @Antti
 
@PatrickMaupin link
 
@AnttiHaapala Here's the link: stackoverflow.com/a/32217540/3577601
 
2:59 PM
@PatrickMaupin Definitely never modify a wrong answer. Comment, and if the answer's autor doesn't respond, downvote & write your own answer.
 
@PatrickMaupin you have 2 answers yourself?
 
He makes the mistake of thinking that a line like 'indirect_descendants[predecessor].update(descendants[node])' is linear time.
 
I always put everything in 1 answer
the deprecated part can be at the bottom if it got upvotes :D
 
@AnttiHaapala Yeah, that was probably a mistake. I answered with some unoptimized code, other guy answered with a bogus answer, I fixed my answer, other guy answered with a new working (but mischaracterized answer) claiming much better big-O time than mine, and I dumped the new code I was working on into a second answer, much as he did. Then later, I edited that and added in the run-time analysis.
 
@PatrickMaupin also, ping the OP with @ mareocraft ;)
Question OP does not see the comments you write
 
3:03 PM
That's good to know. Interestingly, although she awarded the bonus early (I thought I had another 5 days for optimization), she didn't actually accept an answer yet.
Will she see the edits I've been making to my own answer?
 
Posting multiple answers to one question is bad etiquette. The system lets you do it, but it's better to incorporate them into one. Use the <hr> and other formatting devices to delineate sections.
 
only "a new answer", "a new comment to your question", "upvote to question" and "you were @ pinged in a comment"
 
Ahhh, that explains a lot.
 
in any case, you probably are right, O(V+E) does not seem right at all for anything...
 
3:08 PM
Hey up all
 
Hiya Fizzy
 
cbg, Fizzy
@AnttiHaapala There is code at the bottom of my answer that can be run to determine the number of operations. If you build a maximally connected graph, it is based on A000292. I think that's close enough to n**3 to call it that for practical purposes.
 
@PatrickMaupin it is not "close enough", it is O(n**3)
 
Exactly :)
 
3:11 PM
n*(n+1)*(n+2)/6 = n**3/6 + some shit
which is between Cn**3 and Dn**3 for some C, D and n > something.
 
Except, in this case, it's minus some shit, because it's based on the number of nodes - 3
 
it does not matter
it is still within the 2 constants.
 
+ (Negative Shit)
 
Exactly. But I don't even play a big O specialist on TV, so it's annoying when someone who claims to says that it's linear.
Because big-O-wise, n**3 is nowhere near n
 
basically, the easy part of O(n) is that in polynomials you can take only the term of largest degree...
and remove all constants from it
 
3:14 PM
I guess Python lets a lot of people think that things like indirect_descendants[predecessor].update(descendants[node]) execute in constant time.
 
if you have n ** 3 for n = k - 3, it does not matter, it is O(k^3) still,
it could, if update does increment a constant number of counters
depends on whatever the update does.
 
No, he's updating a set from a list. It's not a constant, it depends on the number of items in the list.
 
yes
in that case it is not constant
In mathematics, big O notation describes the limiting behavior of a function when the argument tends towards a particular value or infinity, usually in terms of simpler functions. It is a member of a larger family of notations that is called Landau notation, Bachmann–Landau notation (after Edmund Landau and Paul Bachmann), or asymptotic notation. In computer science, big O notation is used to classify algorithms by how they respond (e.g., in their processing time or working space requirements) to changes in input size. In analytic number theory, it is used to estimate the "error committed" while...
the beginning of that section "Example" says very clearly how to clean up Big-O
 
Yeah, I looked at that, and even understood part of it. That's why in my analysis code, I only updated a counter for the major function. And you're right, the error approaching n**3 is ever-decreasing.
 
that is to say O(n**3 + n**2) you can say
but it does not matter really, as the n**2 part does not really matter at all, the n**3 dominates
so the first question is "what's the fastest growing term", possibly then followed by "what are the constant factors"
 
3:21 PM
Right. That's what I thought, but I was a bit timid -- you've given me the confidence to update my answer :)
 
@BhargavRao Oh well, we tried.
 
So dupe is good!
 
@AnttiHaapala So what are the downsides to removing my deprecated answer? Sure I lose 20 points, and we lose a bit of conversation, but would it be clearer to do that at the end?
 
don't know besides it, but at least for the future, please do not add 2 answers to 1 question :D
 
OK, I won't.
But I'm wondering about removing this one -- the other one is quite long enough, and answers the question fully, I think.
 
3:31 PM
It must be "default args in lambdas" week. I just wrote an answer that needed one. Not for doing a GUI callback - for doing a silly functional primes generator. )
 
@BhargavRao Q:How to obfuscate Python code?
Rewrite it in Perl. — Mark Rushakoff Nov 1 '10 at 3:50
 
I remember him forever!
 
Whenever people talk about Big O notation I think of this Big O :)
Maybe I'll start calling it Orbison notation...
 
https://www.youtube.com/watch?v=ph374fJqFPE
Is this problems actual in 2015?
 
3:43 PM
Yes, the GIL still exists, no I'm not going to watch the whole video to see specifically what they're referring to, no you should not worry about it until you notice a real problem.
 
Oh sorry for big video
i mean GIL-battles
 
I've never heard about that, but again I wouldn't worry about it until you actually observe a problem in your own code.
 
this weird behaviour with Signals in multithreaded programs
 
Take a look at multiprocessing
multiprocessing is a package that supports spawning processes using an API similar to the threading module. The multiprocessing package offers both local and remote concurrency, effectively side-stepping the Global Interpreter Lock by using subprocesses instead of threads. Due to this, the multiprocessing module allows the programmer to fully leverage multiple processors on a given machine. It runs on both Unix and Windows.
 
If anyone's interested, O'Reilly's "Fluent Python" eBook is the deal of the day - 50% off if you use the code "DEAL" shop.oreilly.com/product/0636920032519.do?code=DEAL
 
3:53 PM
rhubarb time
 
rbrb PM
 
that's when it's cool to have safaribooksonline.
Fluent Python is quite good.
 
Got it yesterday, haven't started reading it yet.
 
Cabbage all
 
4:10 PM
cbg JRS
 
Not here for long - just passing through. might try out that e-book...
 
I'm considering making a new avatar with Watto from SW-I and leaving comments like "No mcves - no answers" and "mind trick don't work on me - only stack traces".
 
4:47 PM
rbrb
 
Green bean
rbrb
 
5:03 PM
> In python3 this approach gives you TypeError: 'list' object is not callable
 
5:21 PM
Quite nice talk regarding PEP-8 and notion of "pythonic" youtube.com/watch?v=wf-BqAjZb8M
 
@bereal I looked at the sampler online -- it all seemed quite basic. Did they save the good stuff for the real book, or is it all basic?
 
@PatrickMaupin well, it's definitely more advanced than the sample, but it's not that I like it for its revelations. It's more about structuring and general aesthetic attitude.
one thing I didn't know so far, is ABCMeta.register()
But generally, a very good overview of what's Python beyond the tutorial, similar to what Effective C++ is for C++.
And some nice links to articles and videos, at least, in my Safari version.
Yet to check out the asyncio chapter, have little experience with it.
 
5:55 PM
Hmm, maybe I'll get it. Haven't bought a Python book in a decade....
OTOH, I had to enable script execution on 10 domains just to get O'Reilly to tell me I need to create an effing login
What century are they in?
 
I pay like 10E per month for Safari subscription, that allows reading 5 books per month, kinda enough for me. </ads>
 
But I only buy maybe one technical book every 3 years any more.
And that's not happening either. I guess after people like me stopped buying books, O'Reilly had to turn stupid and evil.
 
I've never had beef with O'Reilly. In fact I love the fact that their ebooks are DRM free and they're happy for you to share them.
 
6:11 PM
Yeah, that's all good. I never had a beef with them in the past, either. But I haven't ordered from them in awhile, and like I said -- I have to enable script execution on 10 domains and create a login. Not barriers for repeat customers; huge barriers for casual customers.
But I'm a known curmudgeon.
 
I didn't read that far back :P that's a bit annoying.
 
And if there's a non-evil reason for them to want my google contacts if I try to log-in with google so I don't have to remember another login, well they should 'splain it up front.
@Sanchit It's a bit early to be asking here -- did you read the room rules?
 
sorry I didn't read. I'll check them right away
 
The rules can be found here if you missed them.
 
6:41 PM
They're cute when they're little...
 
 
1 hour later…
7:51 PM
Lounge: Never Change.
 
@MartijnPieters Wow I don't think I've ever had a flag handled in under a minute before
 
@durron597 luck of the draw.
 
Actually you only deleted two of the three posts.
 
@durron597 I hadn't seen the 3rd one yet.
 
Ah lol :)
 
7:57 PM
I was handling a duplicate post auto-flag, actually.
 
ahhhh gotcha.
Yeah the third one was just slightly different.
 
I deleted the dupe, saw that the original wasn't anything useful either and nuked it too.
See, if the Joomla post had but included a link to the package, it'd have been nuked on the spot.
 
I saw all three of them in /tools/new-answers-to-old-questions
 
It only survived because it didn't have an active link (the 'example here' part didn't count).
For all I knew the acronym was a common Joomla technique.
an actual link would have helped there, funnily enough.
 
there's one particular spam that's pretty common where they don't put links
"Long Path Tool" I think
 
8:01 PM
Yes, we recognise those and nuke on sight.
 
anyway, just wanted to laugh at how quick you got something I had literally just clicked "submit flag" on... thanks for your hard work. catch you later.
 

« first day (1778 days earlier)      last day (3177 days later) »