« first day (2189 days earlier)      last day (2657 days later) » 

11:06 AM
do you think it's possible to make an acceptable challenge out of this?
 
@Lembik meh
I dno what the issue was, just started over being more careful and that bug is gone
 
cool
 
so after eliminating more stuff you get : gist.github.com/orlp/d920cd120429ad7e6e2b4cbdab9e68e3
 
it's correct but sadly very slow
numpy is dog slow it turns out
 
@Lembik well, have you tried with cython?
also I'm not done yet :)
 
11:14 AM
bpaste.net/show/1958ce943e82 it's 5 times slower than this basic python code
this is without cython.. maybe it's really fast with cython course once I put all the type declarations back
 
I'm not doing anything with numpy yet
 
that code I pasted is really the baseline
it also has the advantage that you can run it with pypy
pypy versus cython death match :)
 
In [8]: %timeit permorlp(npM)
1 loop, best of 3: 5.17 s per loop

In [9]: %timeit fast_glynn_perm(M)
1 loop, best of 3: 3.48 s per loop
it's surprising to me that numpy is slower than cpython
 
npM
and M
?
 
11:24 AM
npM = ortho_group.rvs(20)
M = npM.tolist()
the cpython code can't take a numpy array
 
@Lembik actually
we're constantly adding/subtracting twice something in v, right?
 
I suppose so
 
and then taking the product of all those
so what if we make a new v'
where each element is half of the regular v
the length of v is n
since each element is halved
the inner product is now effectively 2**-n as big
so we need to multiply the product by 2**n
but since we divide by 2**(n-1) at the end, we only need to multiply the total product by 2
so we can remove the entire scalar multiplication
 
Yo
 
11:38 AM
In [7]: %timeit permorlp(npM)
1 loop, best of 3: 3.52 s per loop

In [8]: %timeit fast_glynn_perm(M)
1 loop, best of 3: 2.93 s per loop
numpy sucks :)
 
@Lembik does it?
because last time fast_glynn_perm was 3.48
same time as numpy gets now
there's too much variance in your profiling
 
different matrix each time
but in any case it should be much faster, right?
 
what should be faster than what
 
numpy should be much faster than cpython as you are using np.prod for example
and the ints are not infinite size etc
 
why?
numpy is just c
cython is just c
 
11:41 AM
cpython or cython?
 
is fast_glynn_perm pure python?
not cython?
 
pure python
no cython is being used in these tests
it seems that numpy is just slow
 
wait
ortho_group.rvs(20)
how large is this matrix?
 
20 by 20
 
that's a bit small
 
11:44 AM
well it gives the timings I showed
it roughly doubles in time for every increase in 1 in dimension
I can make it 22 by 22 if you prefer
 
0
Q: convert tabs to spaces

mikWrite the shortest possible code which converts tabs to spaces in the input. Tab size should be supplied as a parameter or be hardcoded in the code in a single place. Spaces on output should point to the right column, e.g. (\t represents a tab character): a\tb aa\tb aaa\tb aaaa\tb should beco...

 
In [18]: %timeit fast_glynn_perm(M)
1 loop, best of 3: 18.7 s per loop

In [19]: %timeit permorlp(npM)
1 loop, best of 3: 21 s per loop
@orlp that's for 22 by 22
 
@Lembik out of curiosity
this is fast_glynn_perm with the vector bits numpyfied
@Lembik wait, are you testing in Python 2 or 3
you must be in Python 2
 
12:15 PM
yes python 2
I will use python 3 when theystop increasing the first decimal place :)
 
@Lembik huh
ah
 
I do find python development mysterious. There appears to be no plan for 3.x versions at least that I can see online
where do they even say what the plans for 3.7 are?
In [13]: %timeit fast_glynn_perm_np(npM)
1 loop, best of 3: 4.49 s per loop

In [14]: %timeit fast_glynn_perm(M)
1 loop, best of 3: 4.23 s per loop
 
are you testing in pypy?
or just regular ol' cpython
 
no pypy
just regular and boring
pure python would be much faster in pypy
 
def fast_glynn_perm_np(M):
    v = M.sum(axis=0) / 2
    n = len(M)
    M = [np.array(r) for r in M]

    total = 0
    zs = 1
    for i in xrange(1, 2**(n-1) + 1, 2):
        total += np.prod(v)
        if zs: v -= M[0]
        else: v += M[0]
        zs = not zs
        total -= np.prod(v)

        old_grey = i ^ (i >> 1)
        new_grey = (i+1) ^ ((i+1) >> 1)
        r = (old_grey^new_grey).bit_length() - 1
        if old_grey < new_grey: v -= M[r]
        else: v += M[r]

    return total * 2
@Lembik this is the optimized numpy version of fast_glynn_perm
you can pass it a list np
 
12:22 PM
from scipy.stats import ortho_group is all you need to test this on your machine
 
cannot import name 'ortho_group'
@Lembik anyway, this is the last version
 
that's odd?
 
if this is still slower I think the numpy overhead is too big for these small vectors
 
I mean... what version of scipy do you have?
 
0.16.0
 
12:24 PM
ah.. you need 0.18. pip install scipy --user -U :)
 
but then my environment is destroyed :)
I'm done with this anyway
 
why so?
 
just test if that version is faster
if not too bad vOv
 
why is it destroyed?
(I am testing)
 
because I have all kinds of variables and functions defined
that I don't want to redefine
I mean I can try upgrading and see if I can reload the scipy module
by the way I always prefer python -m pip ... over pip ...
this way you make sure you get the right pip
so python3 -m pip ... for python3, etc
 
12:26 PM
that makes sense
 
@Lembik but really these are really small sizes to look at vectorization /numpy
usually you do those when you have hundreds ot thousands of elements
 
In [12]: %timeit fast_glynn_perm_np(npM)
1 loop, best of 3: 16.2 s per loop

In [13]: %timeit fast_glynn_perm(M)
1 loop, best of 3: 18.9 s per loop
woohoo :)
so are you neutral on whether this would make a passable challenge or not?
 
it's not really different from your last one tbh
complex numbers don't change anything for most languages
 
right.. the differences are a) how to vectorize which is only relevant to some languages and b) how to parallelize which is relevant to more
 
@Lembik by the way
this version I gave you
is significantly more precise
significantly
 
12:30 PM
the point is that to vectorize you need to implement complex numbers yourself and not use the builtin complex type
cool!
(re: precision)
I am talking myself into this :)
hmm.. assembly code golf :)
have we had anything like that?
 
but that's not what you want :)
 
no :)
interesting nonetheless
13
Q: Assembly Language Quine

Hoa Long TamWrite the shortest possible assembly-language quine. Use any ISA you want, unless it has a print-quine instruction or equivalent. Examples include x86, MIPS, SPARC, MMIX, IBM BAL, MIX, VAX, JVM, ARM, etc. You may link against the C standard library's _printf function (or the Java equivalent fo...

 
1:20 PM
0
A: Sandbox for Proposed Challenges

milesGenerate All Partition Keys Given a set of unique values, a partition of that set is a group of disjoint subsets such that each value is included in one and only one of those subsets. For example, there are five partitions of {a, b, c}. {a, b, c} {a, b} {c} {a, c} {b} {a} {b, c} {a} {b} {c} ...

 
1:35 PM
26
Q: Tips for golfing in Mathematica

alephalphaWhat general tips do you have for golfing in Mathematica? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Mathematica (e.g. "remove comments" is not an answer).

 
0
Q: Your very own C++ "for" instruction

SygmeiYour very own C++ "for" instruction Assuming you have the following input : a, b, c, d Input can be in one-line using any format "a/b/c/d" or "a,b,c,d" etc.. You can also have 4 inputs. You must code the following C++ behaviour : for (int i = <a>; i <b> <c>; i += <d>) { std::cout << i <<...

 
I love that this will win the Rookie of the year - Challenge, while this won the Less is more category last year. The tasks are absolutely identical (but the challenges themselves are very different).
 
1:54 PM
do we have a challenge on bead/abacus/gravity sort?
 
Random question: Does anyone know where I can get Linux laptops other than System76?
 
Huh. My website that I created specifically to share desktop backgrounds isn't super mobile friendly. Who woulda thunk.
Also, I don't know HTML and CSS. So ... that may play a role, too.
And also, it's apparently a decade old. Wow.
 
2:19 PM
i got an 89/100 for mobile friendly
and my website is blank
so...
Well I beat google so there's that
 
i think the 15% of the 25% loss on mobile speed is because the css is at the top of the site
 
2:35 PM
@AdmBorkBork I assume you are TimmyD?
 
@Fatalize You don't go around calling Superman Clark Kent, do you?
 
I have an amazing picture but it's not super on-topic is it OK if I post it
 
@Downgoat In the past when I've run into a situation like this I just make sure it doesn't get one-boxed
 
@Poke Ahaha.
 
Then people are free to click on it if they're interested
 
2:40 PM
 
What
 
Doat goat quack quack
 
@Poke Fill out the form and send the report to webmaster-at-google-dot-com :p
@Poke Reminds me of this comic I saw, where Lois Lane is browsing (a parody of) Facebook, sees a picture of Superman, and there's a little tooltip that says "Would you like to tag Clark Kent?"
 
3:04 PM
._. apparently I missed this
is this coming to PPCG? that would mean modifying the userscript
 
I was just on SO yesterday and did not see that so it must be literally brand new
 
i still have the old design
 
> blamecaching
 
It is still in proposal stages so not active yet but they have a meta about it
 
I have the old design, too
 
3:07 PM
@Downgoat ah ok
i remember seeing that last week
 
Though like why is SE making bars and not PPCG site design ಠ_ಠ we will hit ONE YEAR without design....
 
We already got our new design. They removed the "Beta" tag.
 
Sheesh stop about the design. We asked for almost 25 things on top of the design
5
I estimated about 2 years (between graduation and design)
 
Except that design is done by graphic designers and the other stuff is not
So I don't see why the other stuff should slow it down
Granted there probably is some CSS or whatever to do in applying it
 
Because the other stuff is the rate limiting step not the design
 
3:14 PM
The design has to be the final thing?
 
Furthermore they won't start on any of that until they get through th design backlog
@BusinessCat ?
I mean the other stuff will take longer than the design itself
 
So, they won't give us the design until everything is done?
 
No because we asked them not to
 
I see
 
@quartata we did? im new so i dont know :)
 
3:19 PM
I personally don't want any design as long as I haven't got 35K rep... I dunno why rep requirements are much higher with a design than without one.
 
Grace asked us if we wanted to graduate right away and then get this stuff with the design or graduate when we get the stuff then get our design late. We chose the former
 
Just got this in an email:
 
@ErikTheOutgolfer I think the better question is why rep requirements are so much lower without a design than with one :P
500 rep to close posts is way way too low IMO
 
@mbomb007 lol
 
Flash. Ugh
 
3:23 PM
Well when the site first comes out they need people who can do that as fast as possible
When the site just hasn't graduated for 5 years, you're right, it's too low.
 
wait am i going to lose privs when we get a design
lame
 
the second most popular pc game uses flash as the ui, and the most popular one used it until last year, sooo... the situation is bad
 
If you're referring to CSGO that's just because VGUI sucks
 
@betseg eh?
 
It's only the HUD anyways
 
3:25 PM
@betseg What game?
 
@TuxCopter CSGO and DOTA2
 
DOTA2 uses Flash?
 
DOTA switched to a HTML5 UI
 
huh. TIL
 
LoL is almost certainly more popular than Dota2
 
3:26 PM
@betseg Where are you getting your statistics?
 
@quartata 750 to "see vote counts" is a bit too much I think though.
 
@EriktheOutgolfer That's the same as in beta
 
Also, expanded usercards are another thing that I think should only need 1 rep.
 
@GabrielBenamy @Poke ...on steam
 
@betseg Steam is not the only source of PC games.
 
3:27 PM
Pretty sure that Candy Crush and Farmville are still way up on the popularity list.
 
What about StarCraft, which is pretty much the national sport of Korea? Or Overwatch?
 
iirc Minecraft was on the top of the list one year
 
@betseg Pretty sure this is your first mention of steam
 
@Poke yep
 
@TuxCopter A lot of Source 1 games newer than OrangeBox use either Flash or Awesomium (HTML5 renderer) for menus and HUD. This is becase VGUI2, the in-house GUI, sucks and is painful to style
Now Source 2 seems to have something better since Dota 2 doesn't use either. We dont know what it is yet though since the SDK is not out
 
3:30 PM
Hello
 
World of Warcraft still is really big, and World of Tanks is huge, too. Neither of those are Steam.
 
@L.Serné olleH
 
I personally consider using Flash in a webpage to be far worse than using Flash for what it was meant for
 
The original intent of Flash is not to embed in webpages?
 
Exactly my thoughts
According to Wikipedia it was designed because the web emerged: en.wikipedia.org/wiki/Adobe_Flash#History
Actually it was a modification of an existing digital drawing tool
 
3:34 PM
@TuxCopter Not Shockwave, at least
 
Anonymous
WoW, WoT, LoL, Overwatch, Hearthstone, Minecraft, and Runescape are all games with huge playerbases that aren't on Steam
 
What CS:GO uses probably actually is Shockwave judging by the file extensions
 
@Mego Fascinating that three of those are from Blizzard, who apparently still has a license to print money.
 
Private companies have licenses to print money
?
 
Anonymous
@AdmBorkBork Yep :P They really did it right with Overwatch - one-time cost to play, MTX that are only cosmetic and easily unlockable through gameplay (except for the rarest ones)
 
3:37 PM
 
Anonymous
And good, fun, engaging, balanced gameplay
 
Hehe
 
Yeah. Overwatch was my personal pick for GOTY 2016.
 
@L.Serné It's a metaphor
 
@L.Serné I believe it was a figure of speech
 
Anonymous
3:38 PM
@L.Serné "Printing money" is an idiom referring to something that is so wildly popular and sells so well that the owners might as well be printing money
 
Thanks for the explanation
 
Anonymous
For example, Overwatch is so popular and has earned Blizzard so much money that they might have made less money if they printed it
 
Anonymous
20 million players in 5 months is insane
 
Wow. I guess I've been living under a stone then. I never heard of that game...
 
Anonymous
3:47 PM
@quartata Did you ever get a reference for me for the APL code page(s)?
 
Does anyone know why this room is called "The Nineteenth Byte"?
 
36
A: Let's think of a creative name for our chatroom

dmckeeWell, the traditional generic name for the country club bar is "the nineteenth hole", which suggests The Nineteenth Byte or something like that.

 
Anonymous
@L.Serné In golf, the "nineteenth hole" is a slang term for the closest bar to the golf course (the "watering hole", as bars are sometimes called). After a round of golf, golfers will go to the bar to have a few drinks and hang out. The Nineteenth Byte is a pun off of that (for code golf), plus it's 19 bytes long.
 
Ah, I see
Makes sense now
 
@Mego Ask Adam about it, I couldn't find a good reference
 
4:02 PM
challenge idea: take a randomly arranged tetris grid (no holes). Identify the maximum number of pieces you can remove while maintaining the same grid outline
 
Sounds interesting
I don't think different versions of Tetris use different shapes, but you might want to define the shape of the pieces in the actual question.
 
There are Tetris-like games with different shapes, but they're unofficial
 
@NathanMerrill If there are no holes then the lines would be removed and you'd be left with an empty grid :] Might be more clear to just use "tetrominoes" and leave tetris the game out of it
 
hmmm, yeah
 
wat
4:28 PM
Trump isn't just ruining the USA. He's ruining the world. (EPA)
...shit
apparently this exists
let me fix that real quick
 
@font-face {
    font-family: 'khaya';
    src: url('{{!}}/fonts/khaya.eot'); /* {{!}} = root dir */
    src: url('{{!}}/fonts/khaya.woff') format('woff');
    src: url('{{!}}/fonts/khaya.ttf')  format('truetype');
    src: url('{{!}}/fonts/khaya.svg')  format('svg');
}
halp the font face don't work but everything should be ok
 
4:43 PM
Seems okay to me
Maybe the issue is caused by something else?
 
The font displays correctly in the ImageMagick font viewer but for some reason it don't works on the webpage
 
If you use it on a webpage with no other CSS active, does still display incorrectly?
 
Yep
 
Browser?
 
Nope, it don't works on Chrome and Edge too
 
4:49 PM
0
Q: A boring version of yourself

SygmeiA boring version of yourself Have you ever dreamed of a boring version of you which types the text you just typed ? No ? Because that's exactly what I'm challenging you to do ! The program needs to check how many time it took for the user to input a text at program launch and then retype the t...

 
Hehe, already commented on that
Beat the bot
 
@TuxCopter try this:
@font-face {
    font-family: 'khaya';
    src: url('{{!}}/fonts/khaya.eot'); /* {{!}} = root dir */
    src: url('{{!}}/fonts/khaya.woff') format('woff'),
              url('{{!}}/fonts/khaya.ttf')  format('truetype'),
              url('{{!}}/fonts/khaya.svg')  format('svg');
}
 
Still don't work
 
@TuxCopter edited the last comma to a semi colon
 
Still don't work.
 
wat
5:01 PM
how to /etc/hosts?
 
@mbomb007 changing line 8 to:

factors = sorted(list(primefac(n)))

fixes 65 and 80
 
@PeterTaylor I just realized I've always worked with prime or GF(2) fields
damn, prime power fields are substantially uglier
 
wat
wtf
 
TIL: U+00AD SOFT HYPHEN
 
5:09 PM
Unicode has like 50 varieties of hyphen
 
ik, but that one is cool.
 
What about it exactly
Wait why can't I type it
 
let's say i have this document (- will simulate a 00ad): lo-rem ip-sum do-lor sit a-met
it will render like tihs if:
lorem ip-
sum do-
lor sit a-
met
 
@flawr Update: Implemented all the "simple" algorithms. Now implementing a better version of my challenge answer, too. It's currently a command line tool in C, but it should be easily callable from the then-to-be UI. Incidentally, because of the auto-masking for the simple methods, it can be used as a neat "magic wand" tool, too.
 
5:36 PM
@primo I didn't see this message, but I figured it out.
What was most surprising to me was that string concatenation is faster than multiplying by the correct power of 10 then adding.
 
wat
That's a strange graph
Since when do graphs lean backwards?
 
5:52 PM
@wat it means time has split into two timelines
 
6:13 PM
@mbomb007 seems like such a small portion of the time taken that it shouldn't make much difference
21s locally, I imagine because multithreading is better utilized on the repl.it server
 
@TuxCopter can we start moving away from intentional misspelling by now
@wat btw your HTTPS cert is rejected by my browser
Are you using letsencrypt or startssl?
 
0
Q: Make (and don't run) a Evil quine

AnamneI hope you like quines, because this is another one! The difference here is that this particular quine, is well, special... Your task is to make a program that produces itself, next to itself. The code should modify itself to add another copy of it after its original position in memory. This new...

 
@orlp I've only worked with prime or characteristic 2 fields before, but I have used field towers over GF(2) for an AES . They're not much uglier over GF(p) than over GF(2): once your base field is anything other than GF(2) you lose the ability to do it all with bit hacks.
 
6:37 PM
@PeterTaylor well, the field size and polynomial in AES has been chosen for those bithacks
or at least
it's a fixed size field
with a convenient polynomial
that can be studied to get equivalent bit hacks
it's a different story for arbitrary sized fields where you need to find an irreducable polynomial yourself and implement everything in terms of polynomials
@PeterTaylor Basically I tried to do a small self-contained Python version of your answer, and gave up. It really seems that the easiest way to go about these finite fields is to first build prime field polynomials, implement all ops, and then use those to build the prime power fields
 
ugh, I guess I picked the wrong time to start a bounty :-P
I have best-of-PPCG bounties to compete with
hmm, how do those work when the reward is for a question? you can't award a bounty to a question, only to an answer
 
0
A: Sandbox for Proposed Challenges

Greg MartinMore cowbell! You are providing tech support to the Bruce Dickenson as he produces a Blue Öyster Cult recording session. When he asks for more cowbell, you can give it to him. Your task Write a program or function that takes a string (or equivalent in your language) as input, and outputs a rel...

 
6:52 PM
@ais523 The prize in a challenge category is a challenge in honor of the winner. I'm making one of them.
 
ah right
 
I'm making yours @ais523 :)
 
@quartata What were they? Also, why only 25?
:D
 

« first day (2189 days earlier)      last day (2657 days later) »