« first day (1725 days earlier)      last day (3223 days later) » 

3:43 AM
That's what I'm talking about.
 
 
2 hours later…
5:43 AM
Cbg all
 
6:23 AM
Early morning cabbage
 
Early morning cbg to you too
 
6:46 AM
Morning all
 
Hey up
 
cbg
 
yo fizzy
 
7:18 AM
Cbg
 
7:33 AM
Cbg
 
cbg
 
7:54 AM
Cabbage
 
baha
 
8:13 AM
cabbage
 
Hey up
 
@PM2Ring I think "best" is not well defined.
 
heya @Roman - long time no see
 
Salve!
I've been lurking around here and then.
My day job keeps me busy. Surprisingly, I've been busy coding in python. Had my life long wish fulfilled - I made my first GUI program. :)
 
:D
 
Awesome!
 
8:34 AM
It's very simple, displaying some "barcodes". I hope to extend it so that it will export pdfs or even be able to print them.
I've packed the thing on github: github.com/romunov/otf-barcode
 
@Kevin I read a good s-f story about that once, where a machine that could view the past was actually used to spy on people in the present, 0.1s ago
A voyeur's dream invention
 
I used tkinter for GUI elements. What do you guys use?
 
I use GTK2+ for GUI stuff. I guess tkinter's ok, and these days it's kind of the defacto standard for new GUI programmers, since it's often distributed with the standard libraries, but apparently it does have various short-comings. Ask Kevin about the details.
 
8:55 AM
I love this quote: "I thought my question would look a bit more authentic if I added a picture of the terminal."
4
 
Haha
 
That's a life destined for a successful career in marketing
 
@RobertGrant Add a pie chart and a 3D barplot and he or she's hired.
 
@RomanLuštrik How about a barplot of pie charts?
 
9:00 AM
I know a man, who shall remain nameless, who used pie charts as the points on a scatter plot.
So each point was a small individual pie chart.
 
Amazing
 
Some would call what he did an abomination, a sin against the natural order of things, but I'm sure with enough repentance he can be forgiven.
 
Everything is dose dependent.
 
That's almost too readable
 
9:04 AM
If datavis had its own version of "web scale", it would be that graph.
 
I will say that it's cool that you can do that programmatically
 
Well all I'll say is that DSM the author should have thought "Just because I can do something, doesn't mean I should..."
 
@Robert pretty sure that's done in Python/matplotlib btw.
 
I'm going to do something similar, except each point will be a scatter graph
 
9:11 AM
Or you could do nesting, every point is the graph itself.
 
Talk about inception. :)
 
9:25 AM
I wholehearedly abhor support this move to recursive graph plotting. If we follow it deeply enough, we will reach enlightenment
re-cbg by the way
@PM2Ring Hmm - I think the "Is there a canonical correct way of writing this?" at the end helps it sneak under the "primarily opinion" bar. But I'm notoriously soft on such things when there's obviously a decent level of understanding behind the question.
 
9:40 AM
@JRichardSnape wow - that's a heck of an answer :)
 
Which is that Jon?
The Holt-Winters thing?
 
yeah
You hunting a bounty or something :p
 
I got a bit over-involved TBH. I was bounty hunting (quite fancy the 10k), but then got a bit too fascinated by the stats behind it
I should probably cut it a bit TBH
(whispers and I'm not even sure the maths is entirely valid, but it is what one of the R gurus does)
Bit fed up though - did two "hard" questions yesterday and nary a vote or comment between them. I'm putting it down to absent OPs for now...
I also found how bl?!dy hard work R code is to follow. I'm not saying it's PHP for statisticians but... slinks away to avoid any R fanatics
 
Fee fye foe fum, I smell a non believer.
 
Ha - just checked your profile @RomanLuštrik :) I'd better shut up ;)
 
9:48 AM
:)
 
@JRichardSnape I tend to agree, which is why I didn't cv it before asking here.
 
Mmm - noticed the lack of CV and made that assumption. If we two agree, it must be OK. Or something like that
 
:)
 
R is...special...
 
@JRichardSnape If you're talking about the holt() function, I will have to agree.
 
9:57 AM
I think it's the name space stuff that gets me. I have to say the debugger was very good and allowed me to work out what the hell a fairly complex module was doing in a special case. But everything just seems accesible in hard to predict places
@RomanLuštrik I am. I suspect that the whole module is not written in "canonical style", shall we say
I've produced enough spaghetti code in my time to realise you can't lay all that at the door of the language
By the way - I'm open to critique of that answer from all angles - stats, R interpretation or python style (which I know is bad in some bits - it was late - probably should have properly vectorized / used pandas etc)
 
I'm a bit greenish in time series (forecasting) and python so I'll have to pass on this complex answer.
 
No probs
Wasn't trying to imply that you should critique - obvs entirely up to you.
 
10:47 AM
Urgh another day another Gartner report
Also: disconnect is a verb, people.
 
Yeah, wow an online dictionary :)
But I don't care if the Americans like it, I don't
And I'm also terrifyingly against words that are less precise than they could be, and consequently cause people to see connections that aren't there
Disconnect (v) gets used like that a lot
 
how about OED?
there is difference between "you don't like and do not say it"
 
morning everyone
 
and "you do not like it and others are not allowed to say it"
 
10:54 AM
morning @corvid
 
Does python have any framework similar to electron?
 
@AnttiHaapala looks like I'm not either of those, but yes that's correct - those statements are different :)
 
@RobertGrant there are no rules in natural language.
anything you use as a noun is a noun... :D
 
There are rules; that's how we understand each other :)
For example, in that instance, "understand" doesn't mean "giraffe"
 
no, they're no rules
 
10:58 AM
Because of a mutual rule
 
you just think of them as rules...
 
I just say cabbage the rules
 
you think ppl understand the word understand and giraffe similarly
but how do you know :D
 
Good example: you're using a specific definition of the word "rule" to prove a point that said definition makes redundent
You probably mean "law"
 
you just infer that because when they say "I understand", they possibly wouldn't mean a that they're giraffes because they do not particularly look like one.
 
11:00 AM
That and because, you know. We have one or two things in the world that rely on communication to accomplish.
 
will aliasing vim to a different version of vim cause any automatic calls to vim to use that vim?
 
@corvid just vim it in a way that makes the most vim
 
@corvid aliasing only affects your shell
 
I have misunderstood the meaning of many words in many languages, including those of the Finnish language...
 
wb @poke
 
11:02 AM
If you add a symlink into your PATH, that may be different
@JonClements Never gone. :P But thanks
 
So what? People cheat at poker but that doesn't mean poker has no rules.
 
welcome @MiteshBudhabhatti
 
Well I brew installed the new vim, but the system one still exists
 
Thanks @JonClements
 
well, check with which vim to see where the original vim is, and replace that symlink with a symlink to your version.
 
11:04 AM
First timer in stackoverflow chatroom
 
poker rules are normative, linguistics can be descriptive only, unless you want to have an artificial language.
 
$ which vim -> vim: aliased to /usr/local/bin/vim... hmm
 
Well - you chose a good room @Mitesh - we're a friendly bunch :)
 
... and most of the artificial languages will show what is the problem with artificial languages...
 
@AnttiHaapala the fact we understand each other kind of destroys your point that language has no rules
And also poker didn't appear fully formed: its rules gradually described a game that became poker, and now you teach people poker if they want to play
 
11:07 AM
I'd say every person speaking language X has their own set of internal rules that they'd adjust to become better understood by others...
 
When will the dreadful summer end and the winter return? :| This heat sucks. And there's still snow here too
 
@corvid You should remove the alias before running that command :P
 
@Mitesh so what kind of things are you working on at the mo'?
 
ah this is pretty interesting:
Native Esperanto speakers (Esperanto: denaskuloj or denaskaj esperantistoj) are people who have acquired Esperanto as one of their native languages. As of 1996, there were 350 or so attested cases of families with native Esperanto speakers. Estimates from associations indicate that there are currently around 1,000 Esperanto-speaking families, involving perhaps 2,000 children. In all known cases, speakers are natively bilingual, raised in both Esperanto and either the local national language or the native language of their parents. In all but a handful of cases, it was the father who used Esperanto...
@RobertGrant ^
 
@AnttiHaapala So when we want to communicate (relatively) unambiguously we co-operate by using compatible internal rule sets. Robert Grant's not implying that natural languages must have (or require) a set of definitive prescriptive rules enforced from on high... although the French have the Académie française...
 
11:11 AM
@AnttiHaapala wow, weird
 
the children did not speak it according to the external rules anymore
@PM2Ring this all started as a discussion on whether "disconnect" can be a noun or not :D
 
Actually whether I like it as a noun or not :)
 
Re-cabbage
(Cabbage'd earlier only for the carpool to arrive early :))
 
I can even imagine that there are people who'd say this word and "disconnection" are separate, as "disconnection" is an act of "disconnecting", and "disconnect" (n) is something similar to "discontinuity"
 
11:17 AM
Yes, or inconsistency
Or lack of communication
Or any of a number of things that a very vague word papers over
grumbles
 
is no one else going to say hi to @Mitesh? :p
 
@MiteshBudhabhatti cbg
 
@MiteshBudhabhatti cbg
 
Bah, I have to download Python 2
 
@MiteshBudhabhatti cabbage!
 
11:21 AM
@RobertGrant NOOOOOOOOOOOOO
 
guys :| how do I explain why code reusability is important to a beginner programmer?
 
@corvid it isn't
what makes you think it is :d
 
because there's nearly identical code to do something nearly identical which you could just add parameters to
 
it is not code reusability
it is code reuse
different thing.
 
11:26 AM
Hey up
 
What's going down in Fizzy town?
 
it is not important to write your code now so that it will be reusable tomorrow for possibly something else, but it is worthwhile to not write some code twice if you could reuse 1 for the 2 cases right now
 
But that can go too far if you end up with one function with all the parameters to describe your entire system, sort of thing.
State machiney
 
I guess, but the example was making a searcher to filter on a property. Seems easier just to make a component rather than rewrite it every time
 
a function with a function parameter
actually, then you'd notice they're in the stdlib
filter, itemgetter, attrgetter...
 
11:31 AM
@JonClements can I ask a favor
 
@VigneshKalai rule number 1, ask, don't ask if you can ask or not
 
d = {'list_{}'.format(idx):val for idx, val in enumerate(iter(lambda i=iter(main_list): list(islice(i, 2)), []), 1)}
What does this do
can you explain
main_list = ['1029', '2314', '466754', '6345', '3456' ....]
Actually jon cement answered it in comment just wanted to recreate it
 
"jon cement" - now that's a cool super hero name :p
 
>>> d
{'list_3': ['3456'], 'list_2': ['466754', '6345'], 'list_1': ['1029', '2314']}
 
Sorry typo
 
11:34 AM
iter(lambda i=iter(main_list): list(islice(i, 2)), []) is an ugly way to group by 2 items
 
I know what it provides just what happens underneath
 
@AnttiHaapala ugly? :p
 
list(islice(i, 2)) will take 2 next items from iterator i and turn them into a list
iter(main_list) will turn the main list into an iterator
then iter(lambda ..., [])
will make an iterator that will call the given function repeatedly until it returns an item that compares equal to the second value - the empty list
then the items of this iterator are enumerated over with enumerate(iter, 1); numbers start from 1
 
but when i ran this it showed global name 'islice' is not defined
 
finally the {} dict comprehension turns them into a dictionary with 'list_nnnn' -> [nth list].
@VigneshKalai you need to know that the islice resides in the itertools module,
so add from itertools import islice ;)
 
11:39 AM
@AnttiHaapala sorry did not know that
thanks for the detailed explanation mate
 
in python 2 there are much more i-functions like that, in python 3 only islice
 
So err.... why ugly?
 
@JonClements because it is very hard to parse... python oneliners are very awkward to parse...
 
makes sense to me :)
 
like "where do you start"
not like lisp - "the innermost parentheses"
 
11:46 AM
yo @Kevin
 
Morning
 
Sup
 
Morning, Kevin.
 
Morning morning morning. The morning sun is reflecting off the cars in the parking lot and blinding me
They never told me about this when I got the desk next to the window.
 
12:01 PM
Wear shades in the office. Look super cool.
 
I was going to answer stackoverflow.com/questions/31265139/… but it got too messy.
 
What the heck is a "perpendicular bisector"?
 
@PM2 interesting problem, reminds me of a few things in crystallographic physics.
 
"ignore the perpendicular bisector bit;" Why did he edit it in, then...
 
Something evenly splits a line/plan in two at a normal/90 degs?
:P
 
12:12 PM
Pretty sure an irrational slope guarantees that you get no lattice points ever
Except perhaps at x=0
 
@PM2Ring interesting, but a time hoover.
 
@Ffisegydd Yeah. I did the necessary algebra, assuming they could give the slope and a point on the line in rational form, but when they couldn't even do that I gave up. :) As I mentioned in the comments, they could convert those floats to rationals using continued fractions, but the denominators tend to get huge if you want good approximations on your floats, so exact lattice point intersections are far & few between.
 
Yeah in crystallography you can assume that N is infinite :P
 
@Kevin Sure. Of course, Python floats can't be irrational, but if you do convert them to fractions with 15 decimal digits of precision you're likely to get outrageously large denominators, so you're unlikely to get many lattice point intersections.
 
What a mess.
 
12:19 PM
But I bet we have a bit of an XY problem here, and they'd actually be happy with lattice points that are close to the line, so we could use (relatively) small denominators in the approximations of those floats. But I've gotten sick of the game of a zillion questions trying to get the OP question sufficiently well-specified to be able to answer it. :)
 
If OP defines "not rational" as "a fraction with a really big denominator", then I am bothered by his imprecise language and no longer wish to work on his problem. If he defined "not rational" as "not expressible as the ratio of integers", then my comment has already answered his problem. Either way, I'm done.
 
@Kevin After the OP's latest comment I suspect that his desired line is the perpendicular bisector of the line AB, where A & B are both lattice points.
 
I wonder why he said the slope was probably not rational, then... Because the perpendicular bisector of a line segment that passes through lattice points, will have a provably rational slope
...Unless the line segment has a slope of 0
 
@Kevin Yeah, that threw me too, since from the comments it seems like he knows that the product of the slopes of two perpendicular lines is -1.
 
Your comment is perceptive @Kevin. I suspect he has not thought of that. I suspect also that, in fact, his statement that "the slope may not be rational" is because he couldn't prove that it would be rational, but in fact I bet it is. I further suspect this is a problem from some coding puzzle site - anyone looked at the latest Euler...
 
12:30 PM
There are indeed PE questions involving lattice points, although I can't identify whether he's working on any particular one
 
Can he make the leap from the slope of the original line being rational due to integer co-ordinate intersection and the project being -1 to the slope of the perpendicular being rational? I'm not sure...
 
He says "this isn't homework, its just hobby coding", but I guess that doesn't preclude it being something for a coding puzzle site.
 
The 3D cube lattice point PE question where you stand at the origin and how many points can you see is my favourite solve so far. I think the lattice had side 10**9 if memory serves.
 
I remember that one but I don't think I ever finished it.
 
particularly pleasing as I wrote the algorithm on paper during a dull meeting and it just worked when I tried it out
 
12:33 PM
Qs involving coprimality make my head spin
 
true that - they are hard to conceptualise. I think that's why I gravitate towards them. There's a certain way to look at them that Euler encourages, I think.
Ye Gods, that sounds pompous on re-reading. Apologies.
 
Probably a dumb question but... is there a math function in the standard library to get the negative integer representation of a number?
 
Haha. I know what you mean though
 
@corvid needs an MCVE ;)
a.k.a. I don't get what you mean :)
 
Have you tried multiplying by negative one?
 
12:38 PM
not python related at all, (except that this would save me from writing python), but how do I make a CMD/wscript in Windows that would open an URL in the browser that I want as opposed to what the default happens to be, obviously this should consult the registry to see what browsers are installed and where... :/
 
If you're going to say, "no, the negative integer representation of an already negative number should be negative too", then have you tried multiplying the absolute value by negative one?
 
@Kevin der. Can't believe I didn't think of that. Was thinking of the math library
 
Talking about lattice points & irrationals, I learned a cute thing earlier today on SE.mathematics. 163*(pi - e) ~= 69. To be a little more precise, its a little over 68.99966, and 69/(pi - e) is a little over 163.00079. But 163 has a much cooler expression that's almost an integer: exp(pi*sqrt(163)) ~= 262537412640768743.999999999999250
 
Doesn't help if you want negative 0 though ;)
 
12:40 PM
A friend who's been working with Python just got a job with Ruby. He's completely new to it. I looked at his code. I asked him what was up with all the ends. He sputtered!
 
@AnttiHaapala include path to the executable e.g. "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" http://sopython.com
 
If only Python used one's complement, we could have integer negative zero.
 
worked on my system where firefox is default (so explorer will invoke firefox)
 
@Kevin In that case, your brain may melt when you learn about the Möbius inversion formula. :)
 
@JRichardSnape ... this would be run from autorun.inf... on user n.n.'s machine...
 
12:44 PM
@AnttiHaapala Ah, so you don't know the paths
 
exactly, and then I will have some preferential ordering
 
@PM2Ring Just picture that scene from Raiders of the Lost Ark where the guy's face melts
 
:) It's actually not as scary as it may first appear.
 
I had to look up the "d | n" notation for summation. Haven't seen that before.
 
I can't believe I just had to ask what it works means..
 
12:56 PM
@JRichardSnape headache, I need to code this and I do not want to even test it in windows
 
Usually I have to ask about what it does not work means.
 
@martijn, I've been there. Usually when I give 25% of a solution in a comment, and the remaining 75% is a huge logical leap, and the OP responds right away saying "thanks that fixed it"
 
@MartijnPieters cv'd :D
@Kevin hem, the problem is "it works" is in question
 
Ah, that's something else then :-)
 
see the question, the expression is an utter WTF
 
1:00 PM
That Q is in desperate need of expected/actual output
"I expected it to crash with <some error>, but instead it gave me <value>!"
 
@Kevin doesn't help
>>> v_1
'palsldasda'
>>> v_2
'sdasdlasdl'
it splits at some l there...
if there are too many l's then...
 
wb @Morgan
 
it crashes obviously because the last split produces too many values to unpack
 
@JonClements Thanks. :)
 
@Kevin as it turns out, they tried to split a string in two equal halves.
They did this by replacing all l characters by commas.
Then replacing the first two commas with l.
Then reverting the string, replace the first two commas with l again.
 
1:04 PM
Like replacing a light bulb by rotating the ladder.
 
Then revert the string and split on the one remaining comma.
@Kevin yes, and by first setting the house upside down.
And cutting the ladder to exactly the right size.
Then asking how to extend this process to other houses and light bulb fittings.
And also not actually explaining you are changing a lightbulb.
 
I hitherto dub particularly obtuse XY problems "lightbulb problems"
 
@MartijnPieters "This ladder is too short, how do I buy a new house?"
 
Ha ha
All lost your brain there
 
@MorganThrapp :-D
 
1:11 PM
@MartijnPieters Wow! My theory: the OP's only ever seen examples of str.split() being used for splitting lines in CSV files, and doesn't realise that it can take other args apart from a comma.
 
What's weird is it's not as though comma is the default param for split
 
But he'd only that if he'd read actual docs...
 
welcome @joe.dawley
 
Perhaps he codes exclusively by copy/paste, and couldn't find any existing algorithms that use .split("l")
 
@JonClements thanks. first time here.
 
1:13 PM
@PM2Ring yeah, but they weren't trying to split the string on a specific character even. They just wanted to divide the string into two halves...
 
Or perhaps he thinks you can only split on characters that have some kind of special "seperatorness" quality. spaces, commas, pipes, etc
I could imagine a hypothetical language being weirdly strict about that sort of thing
 
But he shouldn't be using split() anyway, since he really wants to get two substrings by position.
 
@MartijnPieters then based on their observations, 'the string'/2 should've been on their list
 
@MartijnPieters Yep.
 
gotta run for a bit - rbrb
 
1:16 PM
Anyway, do you think it is that bad how i wrote it to resolve the problem? — udarH3 6 mins ago
I just showed the post to my colleagues to marvel over.
The attempt to solve it sure was creative.
 
@AnttiHaapala I think you are stuck if you can't guarantee that either the programs you want to run are in their "default" locations on the file system so you can use the path, or that they are correctly in the users PATH environment variable so you can invoke directly (i.e. chrome.exe http://sopython.com). I mean - you could search the whole filesystem for each browser, but that seems excessive.
 
Not sure I can answer that comment right now, don't want to discourage the creative process there.
 
OPs that post weird roundabout solutions are kind of endearing to me... I definitely like them better than the members of the 1 rep horde that don't post any prior efforts at all.
 
@Kevin I call that sort of thing "interface superstitions". It mostly applies to regular users, not coders, but coders can acquire such weird notions, too. Some interface superstitions are only partially conscious, eg, fiddling with the mouse to make the computer go faster while you're waiting for something. Of course, throwing thousands of mouse events into the input stream doesn't actually speed things up, but the average user doesn't know that.
 
@PM2Ring having said that, wobbling your mouse at the top of a window to make it scroll faster does work in Windows
I assume something to do with pointer acceleration being misused
 
1:19 PM
Stupid Windows. :)
 
I suspect that mouse wiggling (in non-scrolling contexts) causes more window-painting events to trigger, which at least makes animation look less choppy, even if it's not faster per se
 
Nah it's unbelievably faster
 
@Kevin Yeah. You can't fault him for lack of creativity. :)
 
But yeah, mouse wiggling during scrolling is objectively faster.
 
Oh sorry I see what you mean
 
1:21 PM
The mobius inversion is fantastic. Code it up kevin. You will thank PM2 forever. It unlocks advanced levels ;)
 
I'll remember it for next time.
 
I do remember that in certain cases causing interrupts caused the system to check for changes more often and you'd get feedback faster. Using mouse movements to trigger those interrupts was a proven method.
Can't remember where that was used, too long ago to remember details like that.
 
Ok, I'll pay that.
 
Now let's determine whether pressing the keys extra hard when you're angry will make it more likely for your task to succeed.
 
@Kevin Of course it does. It's the Erlich effect.
 
1:41 PM
Running a python2 easy_install when I've prepended python2 dir and its scripts dir to the path doesn't do what I want. Bah.
Oh, duh!
Fixed.
 
Hi, @MorganThrapp. Yesterday you asked about defining functions inside other functions. After I logged off I remembered another common use case.
When doing GUI stuff it's common to create the GUI as a class that gets instantiated once. All the stuff needed to lay out & set up the GUI widgets gets done in the __init__ method. It can be convenient to define helper functions inside the __init__ method, since those functions have access to __init__'s local variables.
 
@PM2Ring That's actually really good to know, because I'm about to start working on a GUI. Thanks!
 
Eg, here's a function that simplifies GTK label creation that adds the label to the current box object:
    def add_label(labelstr=None):
        label = gtk.Label(labelstr)
        box.pack_start(label)
        label.show()
        return label
 
Nice. Yeah, I ended up doing it yesterday so that I could memoize a set of options so that I didn't have to hit the database as often.
 
A potential downside to nested function definitions is that the work of defining the inner function has to be done every time the outer function is called, but that's irrelevant when the outer function is only going to be called once. And in other cases, when you're using nesting to create a closure you want the inner function to be redefined so that it gets "connected" to the current local vars of the outer function.
 
1:49 PM
@PM2Ring Hmmmm, how bad of a hit is redefining an inner function?
I'm considering just using a dict as a default parameter and using that to cache.
Because it doesn't need access to the variables of the outer function.
 
@MorganThrapp I'm not sure. Maybe Martijn will enlighten us.
 
Looking for a tool, tutorial...? stackoverflow.com/questions/4777243/…
 
Yeah p. much, voted
 
@MorganThrapp That sounds fine to me. But be aware that many people dislike using mutable default parameters, and consider them a bug waiting to happen. But I see them as a perfectly valid Python feature, although I guess it's a good idea to comment them when you use them, so that people reading your code realise that you know what you're doing.
 
If we're talking specifically about writing a memoization decorator, the inner function won't be redefined every time you call the memoized function; it only gets redefined each time you use the @memoize statement.
So, most likely, only once
 
1:59 PM
What Kevin said. When you call a decorated function, you're actually calling the function that got returned by the decorator.
 

« first day (1725 days earlier)      last day (3223 days later) »