« first day (2258 days earlier)      last day (2915 days later) » 

wim
wim
17:05
'js' === 'j' + (![]+[])[!+[]+!+[]+!+[]]
javascript is the best language for wats , love it!!
oh! a crhistmas tree! beautiful!
16 hours ago, by Andras Deak
let me guess: (![]+[]) is "False" (when looked at through string goggles)
Haha, that's a new one Wim
Endless possibilities on insanity
i would say [] is a void set. ![] is the inverse of a void set, so everything. adding another void set [] to everything is still everything. thus (![]+[]) is everything expressed with a little redundancy.
wim
wim
Andras Dejavuak
Hi everybody, how would I go about doing a permutation base on index. for example I have a string t="111" how can I permutate going by index. Output should be like this [1,1,1] , [11,1], [1,11]. Yes, I'm getting ready for my first python interview.
every possible choice of every possible number of separators?
(~ combination with repetitions)
rhbarb folks
17:12
is more index and not the number. Another example string="243", desire output [2,4,3], [24,3], [2,43]
2 mins ago, by Andras Deak
every possible choice of every possible number of separators?
@David is the string length always 3?
sounds like you're asking for partitions
yes
always 3? why not hardcode it?
17:16
Odd to me that [111] and [243] aren't part of the outputs
@kevin is not part of the question
@MarioDekena That's how I have it, but I want to be fancy
I'm a senior network engineer that knows some python and this is going to be my first interview that will be testing my coding skill.
So I'm clueless about coding interviews.
def partition_util(input_string, start_index):
    if start_index == len(input_string):
        yield []
        return
    for end_index in range(start_index + 1, len(input_string) + 1):
        for partition in partition_util(input_string, end_index):
            yield [input_string[start_index : end_index]] + partition

def get_list_partitions(input_string):
    return [partition for partition in partition_util(input_string, 0)]
^like this?
It includes the original string but you can always remove that
and it returns partitions with strings in case of any leading 0's (you can cast those to ints if you want)
@David There are varieties of coding interviews. Preparation depends on the style of the interview you are walking in to
If an interviewer asks you a programming puzzle and you don't know the answer, console yourself with the fact that you don't want to work for someone that asks programming puzzles during interviews.
I think an important aspect on the coding part of the interview, is how you tackle the problem. From what my HR, and my Project manager tells me, they care about how you came up wit hthe solution, it's just bouns if you get the answer. Now if you are aimming for a higher coding position, of course they want the right answer too...
17:23
(it's usually best when they ask you problems that actually pertain to what you'll be doing)
^^
@Kevin If you have 2 eggs, and 3 candy, and Joe has 5 wins with his hockey team, but still is upset about losing, what color is my car?
when it is only 3, i would still hardcode it. its much easier to read simple code than code that was overcompilcated because someone got the impression that it had to be fancy
@MooingRawr easy. blue
could use some slicings though:
def partition(x):
    return [[x[0],x[1],x[2]],[x[:2],x[2]],[x[0],x[1:3]]]
17:25
And this is why Joe gets paid the big bucks, not because he got the answer correct, but he threw an answer and looked confident doing so.
@idjaw Whatttttt's........your quest?
I think I said cabbage about ten hours ago. Just about to rhubarb abd this is hte first time I've had chance to get back to this window :-(
rbrb, holden:(
\o hiya hold how goes it
@MooingRawr rhododendron, because ice cream doesn't have any bones
17:26
I had one doubt. Is the amount of memory consumed on doing import x; x.y and from x import y is same?
@KevinMGranger GENIUS! when can you start?
welp off for lunch cya around
@MarioDekena that's pretty cool
@MooingRawr It goes. Just had a senior dev hand his notice in. Not best pleased about that. That's the kind of day I've had
@MoinuddinQuadri "import x; x.y" is 14 bytes, "from x import y" is 16 bytes. so no, its not the same
CANT COUNT TODAY :D
I don't think they had code golfing in mind...
you can check sys.getsizeof(x) vs sys.getsizeof(y) in the two respective cases?
(in the former case x is bound to a local name, not y)
that's how it seems to layman me, anyway
rhubarb for now
17:30
It is much more complex. But you are going now else I would have tried to explain :P
rhubrb Andras
Rhubarb (Rheum rhabarbarum) is a species of plant in the family Polygonaceae. It is a herbaceous perennial growing from short, thick rhizomes. It produces large poisonous leaves that are somewhat triangular, with long fleshy edible stalks and small flowers grouped in large compound leafy greenish-white to rose-red inflorescences. In culinary use, fresh raw leaf stalks (petioles) are crisp (similar to celery) with a strong, tart taste. Although rhubarb is not a true fruit, in the kitchen it is usually prepared as if it were. Most commonly, the stalks are cooked with sugar and used in pies, crumbles...
DSM
DSM
@holdenweb: look on the bright side, now you get to interview new candidates!
@MoinuddinQuadri Never mind the names, study the bytecode: pastebin.com/V2NGXqeY
Which would be great if I didn't already have four vacancies for new devs
So I'm interviewing anyway
DSM
DSM
I can empathise. We're trying to hire as well and it's tough to find someone with the right level of skills for our needs.
Actually I am working on the patch for a library. With latest version of the library it is consuming 20 MB extra. And I am sure that the issue is related to one new module added in the library. In the init.py of module abc, it is mentioned from xyz import *. In other file, ppp function is imported as from abc import ppp where ppp is the function from xyz file
I think the issue is because __init__.py import everything from a file
DSM
DSM
17:35
That seems unlikely to me. The difference in memory usage should be of order the number of extra names floating around, which shouldn't be anywhere near 20 MB.
Twist: the xyz module contains a 19.99 MB list containing millions of prime numbers for no reason. ppp doesn't refer to it, so it gets quickly garbage collected if you import only ppp, but it hangs around forever if you import *.
Kevin: You have a point. I have seen similar dict in the code.
I was partly joking, but if you really do have a multimegabyte object in the module, that's something to investigate.
DSM
DSM
I'm doubtful. Even if you don't import the name, objects at module scope are still accessible.
>>> from xyz.data import y
>>> x
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'x' is not defined
>>> y
10
>>> getattr(getattr(sys.modules["xyz"], "data"), "x")
range(0, 1000000)
Oh, that's surprising to me. I thought the garbage collector would be a little more thorough than that.
DSM
DSM
17:43
I'm not saying it couldn't be the cause somehow, but it wouldn't be among my first few guesses.
I guess it's impractical to partially collect a module because what if you import it again later? Most of the time it's better to keep it cached just in case, I suppose.
What is "from x import y" actually doing, then? (if it seems like everything in the module level is still accessible)
Loading the module, putting the module in the big invisible module cache where all modules live, and putting y in your namespace
Yeah -- seems like the main difference between the two is the size of the namespace
which I don't think would explain some massive memory difference
This seems to follow Python's usual practice of "we can make it more difficult to access <thing>, but people can still get to it if they try real hard"
17:49
@DSM: when you do getattr(getattr(sys.modules["xyz"], "data"), "x") I think it should reload the value from the module, and not reading it from cache
DSM
DSM
@MoinuddinQuadri: why? Python doesn't explicitly reload modules even using import.
I choose to believe that the language devs have a good reason for implementing things the way they are now
DSM
DSM
You have to directly ask for a module to be reloaded.
import xyz

#do some stuff
xyz = reload(xyz) #iirc
def load_module():
from x import y

imports the module on demand. when you do `getattr(sys.modules["xyz"], "data")` it should be performing the same
DSM
DSM
17:52
I don't think either of those things are true.
I think I should check the documents. Never dived deeply into these imports
In python3 apparently reload() was moved to imp module
DSM
DSM
@MarcusS: yep.
>>> import do_a_print
hello, I've been executed!
>>> import do_a_print
>>> del do_a_print
>>> import do_a_print
>>> import imp
>>> imp.reload(do_a_print)
hello, I've been executed!
<module 'do_a_print' from '/home/dsm/coding/impo/do_a_print.py'>
Times like these I wish "X should do Y" didn't have the two contradictory meanings of "X does not do Y, but I wish it did" and "According to my mental model, X does Y"
DSM
DSM
You have to explicitly call reload to trigger any activity again, otherwise you just get the cached version.
@Kevin: time for KevinLang!
17:55
"The train should get here on time", said the man. Given this information, is the train habitually late, or habitually punctual?
DSM
DSM
@Kevin: I'd bet 80%+ habitually punctual, given my own usage patterns.
"The train should get here on time!" shouted the man at the apologetic conductor.
"The train _should_ get here on time..." muttered the man as he tapped his watch
"The train should get here on time" chirped the man to his companion. "it always does"
DSM
DSM
So make a PR, don't just whine.
(Wait, that suddenly seems weird to me. Do other people say "don't just X" to mean "don't let X be your only action"?)
Yeah.
DSM
DSM
18:03
Whew.
The city rejected my plan to grease up all the rails :-(
Even after I submitted my proof-of-concept using the neighboring city's rail system. There were only a few dozen injuries!
DSM
DSM
Plus it was KevinTown's-equivalent-of-Shelbyville anyhow, so no great loss, what?
That'll teach them to live in Shelbyville or equivalent.
wim
wim
So now that Kevin is off of gist, next step is to get davidism off of shitbucket
He'll be a harder nut to crack, I wager.
18:08
@holdenweb ;( i wonder why he quit...
Too much job satisfaction.
"I'm actually totally job satiated now. Thanks"
What's so bad about bitbucket? Last I recall, it had free private repos (in contrast to github's $7/month thing)
wim
wim
It's not bad. But github is better
wim
wim
better UI
bigger community
18:10
I really wish that JS also had some getDefault behavior like python does :\ such a useful utility
@corvid make a patch or create your own utility library ;)
wim
wim
particularly in open source, being on github is huge. if you are on bitbucket, everyone just ignores you
+1 for wim
I don't expect my Advent of Code repository to become the Hot New Thing of open source, though
I want to put some of my stuff on gitlab just out of principle
18:13
@MooingRawr I've asked him to detail his reasons as fully as possible. I have an idea the corporate culture needs some realignment, and I'm hoping his email will give me some ammunition for those discussions
@Kevin I've drawn ideas from your day 11, thought nothing fitted what i wanted to do
Anyway, for now, bugrit. Too tired to think about it. Enjoy your morning/afternoon/evening/whatever. Rhubarb, all
@holdenweb take care hope u feel better
18:26
recbg
@idjaw nice hat:P
:D
I updated my dev story and didn't get a hat for that
weird
Blame caching? I'm not familiar with silly kinds of hats
hahaha
fantastic
Don Hertzfeldt is as masterful as his name is hard to spell
18:39
WTF do all the noobs post their functions and classes with big-ass indentation errors? Seriously!
"Eh, I'm sure the readers can figure it out"
At least the indentation errors are sometimes ambiguous enough that you can just CV it :)
Alternatively: "I looked at the preview window for one tenth of a second and didn't see any problems, time to submit"
Thanks, python, for allowing else on almost everything!
Need a "don't multiply lists when initializing a matrix because weakref" dupe here, can't find one for the life of me
found it @ sopython!
"unexpectedly" eluded me
wim
wim
18:50
that has nothing to do with weakref
awww
I was trying to be concise
hmm, right
wim
wim
dupe target is correct though
I guess somehow weak ref got mixed in my head with shallow copy:/
at least I didn't write anything stupid in the comment
deleted it, anyway
so, no hat for dupehammer assist this year:P
unless something I non-dupe-CVd got hammered later and one of my secret hats are due to that
There is a hat for "participate in successfully closing or deleting a question"
Though it looks to me more like a snow ghost than a hat
it's a yeti
18:57
it's a yeti (Abominable Snowman)
I just googled about "yeti" :P
wim
wim
easy to geti the yeti
@MoinuddinQuadri it's like a winter sasquatch, a.k.a. bigfoot
wim
wim
since SO front page questions is just an eternal burning pile of excrement
Roses are red, the close vote hat is a yeti,
2 days ago, by Kevin
Happy solstice, here's a box of uncooked spaghetti
18:59
*golf clap*
wim
wim
-1 too many syllables
I don't color inside the lines B-)
wim
wim
no hat for bad poetry
after using ansible for a few months, and going back to puppet.....wtf puppet....ugh
For the sake of mental hygiene, I won't link to the Sasquatch scene from Tenacious D. Consider it linked.
19:02
puppet: let's make a super expressive DSL so you can actually only use the boring parts and express all of your specific configurations in hiera anyway
^^
ugh
PSA from Randall ^ (see alt text)
i know 100 digit of pi
actually i used to know... but its still 50 for sure ;)
wim
wim
I know 1000 digits of pi
not in order, though
For the umpteenth time: "badger badger badger" don't qualify as digits.
DSM
DSM
19:09
I can do about thirty or so based on one of those mnemonic poems I learned as a kid.
@wim if you do, i am impressed, tried going beyond 100 at some point. but history lessons wasnt boring enough
I know 1000 digits of pi in order, but I'm not sure what decimal place it starts from
DSM
DSM
@Kevin: well-played.
wim
wim
@DSM hmph. that is isomorphic to my joke.
That joke only partially works because it hasn't yet been proven that pi contains all possible finite digit sequences.
Sorry for my only-potentially-correct joke.
DSM
DSM
19:12
@wim: not quite, I think, 'cause Kevin's made me think about pi's normality and yours made me think about the fact contiguity wasn't specified.
wim
wim
which numbers are known to be normal?
> It is not even known if fundamental mathematical constants such as pi (Wagon 1985, Bailey and Crandall 2003), the natural logarithm of 2 ln2 (Bailey and Crandall 2003), Apéry's constant zeta(3) (Bailey and Crandall 2003), Pythagoras's constant sqrt(2) (Bailey and Crandall 2003), and e are normal, although the first 30 million digits of pi are very uniformly distributed (Bailey 1988).
wim
wim
@Kevin technically incorrect. the worst kind of incorrect.
I know however many are in this unfortunately catchy music video
i like this better
19:16
Furthermore, it's possible for a number to not be normal, but still contain every possible finite digit sequence. Consider the irrational number 0.1X2X3X4X5X6X7X8X9X10X11X... Where each X represents one million zeroes. You can't say that that's uniformly distributed.
The latter video is part of the audio for the first one, and lacks the silly costumes and impromptu rap
Proving that pi is normal is sufficient, but not necessarily necessary, to prove my joke correct.
wim
wim
Proving the joke is funny, however, is non-trivial (left as an exercise for the reader)
Wow, just saw this beautiful answer on math stack exchange:

- most of what it contains is garbage,

- you have no way of knowing what is and isn't garbage a priori, and

- the only way to refer to a part of the string that isn't garbage is to describe its position in the string, and the bits required to do this themselves constitute a (terrible) encoding of the string. So finding this location is exactly as hard as finding the string itself (that is, finding the answer to whatever question you wanted to ask).
Reminds me of:
"The Library of Babel" (Spanish: La biblioteca de Babel) is a short story by Argentine author and librarian Jorge Luis Borges (1899–1986), conceiving of a universe in the form of a vast library containing all possible 410-page books of a certain format and character set. The story was originally published in Spanish in Borges' 1941 collection of stories El Jardín de senderos que se bifurcan (The Garden of Forking Paths). That entire book was, in turn, included within his much-reprinted Ficciones (1944). Two English-language translations appeared approximately simultaneously in 1962, one by James...
Which reminds me of:
Snow Crash is Neal Stephenson's third novel, published in 1992. Like many of Stephenson's other novels it covers history, linguistics, anthropology, archaeology, religion, computer science, politics, cryptography, memetics and philosophy. Stephenson explained the title of the novel in his 1999 essay In the Beginning... was the Command Line as his term for a particular software failure mode on the early Apple Macintosh computer. Stephenson wrote about the Macintosh that "When the computer crashed and wrote gibberish into the bitmap, the result was something that looked vaguely like static on a broken...
19:21
@wim sounds like a Qiaochu answer?
wim
wim
and he also mentioned the library of babel right after
wow, you guys are good !
Reminds me a lot of that equation that draws pictures
I have a name >:-I
Sounds interesting until you see that it must necessarily be able to draw any picture you feed it based on its encoding, and so it becomes a "contains everything therefore nothing" kind of thing again
Oh, that equation. I know the one you mean now.
19:26
Tupper's self-referential formula is a formula that, when graphed in two dimensions at a specific location in the plane, can be "programmed" to visually reproduce the formula itself. == History == It was defined by Jeff Tupper. It is used in various math and computer science courses as an exercise in graphing formulae. While it is called "self-referential", Tupper did not name it as such. The formula was published in his 2001 SIGGRAPH paper discussing methods related to the GrafE formula-graphing program Tupper developed. == Formula == The formula is an inequality defined as: ...
DSM
DSM
I seem to remember a story (could be Feynman, could be someone else, but Feynman comes to mind 'cause I know he played around with decimal patterns) where the protagonist was asked about whether or not some series of numbers could be a secret message. He replied that the numbers really were what you got if you divided 1/119 (or something) and so the digits didn't provide any more information than the numbers 1 and 119 would.
Yeah that formula cheats by cramming all of the data into k
@Kevin AWLP (audible laughter was produced)
I'm just a sophisticated algorithm for making gifs.
"sophisticated"
I lol'd too but it seems weird to say "lol" since most of the time nowadays it doesn't actually mean what it implies D:
19:28
Exactly, that's why we have ALWP
man that one talk by Feynman
he mentions a thing that I wish more people would talk about because I think it's really important
but it doesn't really have a name
from youtube.com/watch?v=Cj4y0EUlU-Y&t=2m20s to end (concept summarized @ 5:30+)
One time during an IRL conversation I described how a comical book only managed to make me exhale through my nose slightly harder and my friend questioned what that meant and I said "you know, the thing you actually do instead of laughing out loud when you type 'lol'" and he insisted that he had never heard of such a thing before and that I was being weird.
But if such a thing doesn't exist, why did I have the bowl? why is there a second acronym to describe actually laughing?
DSM
DSM
Inflation.
This is the closest thing I've had to a personal experience with the supernatural. <friend> is from the alternate dimension of exclusively sincere acronyms.
@MarcusS haha, these trivia are great:D
also, people have soooo much time on their hands
DSM
DSM
19:36
> All this went on in the first few weeks before we got each other straightened out. Anyway, one day I'm piddling around with the computing machine, and I notice something very peculiar. If you take 1 divided by 273 you get .004115226337... It's quite cute, and then it goes a little cockeyed when you're carrying; confusion occurs for only about three numbers, and then you can see how the 10 10 13 is really equivalent to 114 again, or 115 again, and it keeps on going, and repeats itself nicely after a couple of cycles. I thought it was kind of amusing.
DSM
DSM
I was right, it was Feynman.
Ordinarily when I read stories like "my uncle has lived in a house for twenty years and experiences poltergeist activity on a monthly basis, but he's a quiet guy and doesn't want to make a fuss about it", my first inclination is to get the OP to press the uncle for more detail, maybe make a little money off the Million Dollar Paranormal Challenge, but now that it's me in that position, I don't really feel like forcing <friend> to show me his dimension portal. That's not what friends do.
DSM
DSM
@Kevin: I think we're now up to about seven people you've told stories about. Soon there will be enough to feed to the Ultra Cross-Correlator(tm).
wim
wim
Me 5 years ago -->
11
Q: Interesting pattern in the decimal expansion of $\frac1{243}$

wimThere appears to be an interesting pattern in the decimal expansion of $\dfrac1{243}$: $$\frac1{243}=0.\overline{004115226337448559670781893}$$ I was wondering if anyone could clarify how this comes about?

19:40
@DSM Seven is... About right, I think. Might be tricky putting each story in the correct friend bucket.
wim
wim
> If you take 1 divided by 273 you get .004115226337
You have no way of knowing whether only-sincere-lols-friend is the same person as owns-a-pacman-machine friend
DSM
DSM
@wim: yeah, so everybody makes typos. :-)
wim
wim
well, I get 0.003663003663003663
The same typo 3 times in a row, though?
DSM
DSM
If you made it only once in a row you'd catch the problem.
@Kevin: true. The three in my head are ex-nemesis, ACL guy, and danGerous man.
19:42
"I therefore asked for permission to use Arabic numerals in my letters." Feynman is the king of sass.
"Remember when I broke into every safe on the base to prove how lax security was?"
@DSM Ok, here's a freebie: those are all different people.
DSM
DSM
Hmmph, already knew that.
Feb 12 '15 at 21:29, by Kevin
They are indeed three different people.
Once I've said it three times, then you'll know for sure that it's true.
I don't know that it's true.
DSM
DSM
You act like I don't actually have a Kevin case file which I consult and update as needed.
@MarcusS: if I tell you that I know it's true, will you know then? ;-)
I now know it to be true.
19:48
The Official Junior Detective Kevin Doxxing Cluebook doesn't have any blank spaces for friends and family info. You must be using a third party system.
Not sure why you'd bother, you can't mail it in and get a decoder ring unless it's Official.
Had only heard it twice before -- you really do need that third one
Ok seriously, I have eaten a lot of cereal in my lifetime and I have yet to come across a single decoder ring
I would have had a field day with one of those -- where are they? >:o
Man, I haven't seen any cereal with a prize inside since the 90s
...I must be tired, I have no idea why but I saw "decoder ring" and thought you were talking about cereal
Maybe "mail it in"
That is traditionally where you get decoder rings. That and mailing in ovaltine box tops.
...ovaltine comes in boxes?
19:52
Not sure, I'm basing that on half-remembered scenes from A Christmas Story.
I'll know for sure by the end of December. That film is unavoidable.
I feel like I can't trust my senses anymore now.
wim
wim
why aren't comments allowed in JSON? serious question
it's really flippin' annoying for apps that use json configuration files
e.g. sublimetext
DSM
DSM
Aaargh I was about to post that
Kevin'd
19:54
That's a really long post to just say "use YAML"
Capital, now we just have to convince the sublimetext devs to integrate jsmin into their project.
DSM
DSM
People don't say "capital" in that sense enough these days. Or wear monocles.
I wish there was a reduced subset of YAML that removed silly thing like key back-references and whatnot. But the name RAML is already taken.
so did anyone solve the today's AOC yet without brute forcing?
wim
wim
can't access plus.google.com at WimCorp
DSM
DSM
19:56
Kevin, I think.
I converted my part 2 to O(n)
@MarcusS O(n) on input?
wim
wim
I was busy shaving my yak
@AnttiHaapala Yeah I ended up with a solution with worst-case O(2^(number of "rotate by letter" commands)) behavior but the input just happens to give best-case O(N) behavior
wim
wim
19:58
@MarcusS can you paste the content here
@AnttiHaapala I guess it depends on the contents of the instructions -- so maybe O(len(instructions))
plus O(n) per rotation etc
I don't see backtracking
I guess my solution is sort of isomorphic to BFS, kind of?
kindasortaBFS?

« first day (2258 days earlier)      last day (2915 days later) »