« first day (1985 days earlier)      last day (2861 days later) » 

2:00 PM
I'm officially off the beach!
 
Anonymous
It's just the leftover value from for i in range(26)
 
And with my phone having 15% of battery. ._.
See you around.
 
…are you using your phone while at the beach?
 
@Mego I didn't actually know that if you declared a value in a for loop it stayed in scope. Oops, I guess my fake rage was misguided :P
 
Anonymous
2:04 PM
Yep, for i in range(a,b,c) essentially translates to int i; for(i = a; i < b; i += c) {} in C
 
given a square with sides of length 1, what's the average distance between any two points in the square?
 
@Mego Strange, I would think of something more like for(int i=a;...
Where the scope of i is limited to the loop
 
Let's try to get the least stars on this message!
(^ Classic star-bait)
 
It's not very effective…
 
Anonymous
@Katenkyo Back when Python was first being created, that sort of thing wasn't legal in C. The developers probably didn't see a reason to change it.
 
2:13 PM
^
I know from the GCC warnings
 
Anonymous
It was only in C99 and onwards that variable declaration inside a for loop statement became legal
 
C99 is so old :)
 
But yeah, doing --std=c99 all the time is annoying
(and then --pedantic --pedantic-errors)
 
Anonymous
Yeah, and until about a year ago, C90 with GNU extensions (called gnu90) was the default C mode. 5.1.0 changed that so that gnu11 is the default now.
 
Anonymous
It took 16 years to move past the old C standard for the default (and then they skipped 99 and went straight to 11!)
 
2:18 PM
@Mego Totally forgot it came that late in C. Thanks for the reminder :)
 
@PhiNotPi About that, could you provide the domain names in numerical form (i.e. convert to base 37)?
 
Anonymous
I'm so excited about trigraphs being removed in C++17 :D
 
I still don't get why C++ standard libraries are so ridiculously limited
 
Anonymous
There's big opposition in the working group against feature bloat
 
@Mego Why do they remove them?
 
2:24 PM
you don't even have a method in std::string to split a string. How is that not ridiculous?
 
@Fatalize same case for lua, they have a good rational
 
Anonymous
@Katenkyo Because it's 2016 and computers that can't use more than one locale/encoding don't exist anymore.
 
Anonymous
Some people in the C++ working group don't want a huge standard library because they see it as feature bloat. Other people want to sell their library solutions.
 
so they would rather rewrite built-ins that any sane language has themselves
and end up with things that are almost certainly worse
for everything
 
Anonymous
Yep, there's a lot of corporations involved with writing C/C++ standards
 
2:26 PM
> Should split return a table array, a list, or an iterator? Should the separator be a string, Lua pattern, LPeg pattern, or regular expression? How should empty separators be handled? How should empty values be handled? Should there be an argument to limit the number of splits? Should the separator be returned? This is more useful when the separator is a pattern, in which case the separator can vary:
 
Anonymous
Lots of different interests
 
@Mego Yes but need it for obfuscation!
I think the same thing apply for C++, as they want to make the core as light as possible
 
that's stupid
 
If you want to split string, just do a loop when you need it, it isn't hard to do
 
Anonymous
It's no small wonder that trigraphs are getting removed, considering that one of the largest corporations in the working group (IBM) vehemently opposed removing them in C++11 and C++14, and still opposes removing them in C++17.
 
Anonymous
2:27 PM
@Fatalize Welcome to politics
 
C++ is already a warmachine in terms of complexity, it's not a few standard built-ins added that are gonna make C++ much more bloated
 
Anonymous
The fact that Python has such a feature-rich standard library is in no small part due to the presence of a BDFL
 
Also, C is a sane language, but don't have it. Lua is a sane language, and don't have it. I think we can find many more, as I can only speak for the languages I know
 
C is a sane language for low level things
 
@Fatalize It's not only a new feature, the problem lies in that split absolutely can't be a perfect builtin that would satisfy anyone
 
Anonymous
2:29 PM
The fact that there is a singular person who can make the final call makes it much easier to make changes and keep a focused direction
 
it's not really sane for high level programs
 
@Fatalize C is a sane High-Level language
@Mego Yep, not having to do a 300 person commitee for each decision helps a lot
 
Anonymous
In C and C++, there's a whole bunch of competing interests, and those get in the way of progress sometimes. Hell, just getting template <typename _T> std::string to_string(_T ); into the stdlib in C++11 was a nightmare of back-and-forth debates.
 
Anonymous
If you ever question why C and C++ move so slowly, take a look at the discussions in the working group during each standard cycle. They're insane.
 
which makes them ridiculously cumbersome to use nowadays
you have to use ten billion libraries to get functionalities that you have built-in in Java
it's so annoying
 
2:34 PM
Yes, but they come from a time when you didn't have 1Go of RAM and a 2GHz quad-core in your toaster
Back then, your core language had to be light for embedded programming, and for use on computers, because you didn't have space
 
this argument makes no sense for C++ though
 
And there's not so much that you can fit in 50 MB for instance
C++ is old too, its purpose was also to be light, while allowing much more things than C's structure were able to do (or at least, allow to do it much more simply)
 
Anonymous
C++ is in a position where it can't win now
 
^
 
Anonymous
It's missing a ton of modern features which will take ages to approve, document, and implement, and its (mostly) backward compatibility with C means that it will be forever shackled by an archaic language.
 
2:37 PM
Yep, oldies have to leave the seat to the new generation
 
Basically outside video games development I don't know any field where C++ leads
 
Anonymous
And if C++ were to try to catch up to modern languages and break backwards compatibility with C, it would be shrugged off as a futile attempt to remain modern in a world that has moved past it.
 
Anonymous
Even a lot of video game development is moving to C# and DSLs now
 
C++ lead in this is mostly because a lot of video games libraries are for C++
 
Anonymous
Aside from engine developers, almost nobody uses C++ anymore
 
2:41 PM
@uoɥʇʎPʎzɐɹC How would that help?
 
@PhiNotPi Python > JS
Guess how I'm doing it
 
.... I don't really have a clue.
 
Hint: machine learning
 
@uoɥʇʎPʎzɐɹC Hexagony > Python > JS
 
Hint: just a few lines of code
> The name is a portmanteau of "hexagon" and "agony", because I expect programming in it to be quite painful.
@Katenkyo
 
2:44 PM
Something like PyBrain?
 
yep
right on spot
 
Anonymous
People who use Unity program in C#. People who use(d) Unreal < 4 used UnrealScript (Unreal 4 uses C++ for scripting, so it's the minority here). People who use Havok use a Lua-like scripting language called Havok Script. Source uses VScript (another custom scripting language).
 
@uoɥʇʎPʎzɐɹC Still better than Python ^^
 
@Katenkyo yeah, does it have machine learning libraries?
or import antigravity
 
@uoɥʇʎPʎzɐɹC No, it's meant for real developpers, you have to do it by yourself :D
 
Anonymous
2:46 PM
Python is one of the top languages for mathematic and scientific programming
 
Vscript. That's a good name.
I dislike the "script" part though.
 
@Mego It's sad it wasn't created to be fast on top of that
 
How difficult is it for you to handle the base conversion vs me making a base 37 data set?
 
Anonymous
@Katenkyo It can be fast, though, with Cython or PyPy (when used correctly).
 
@Mego Yes, but natively I mean
 
Anonymous
2:47 PM
Just like C can be slow when used incorrectly.
 
Anonymous
@Katenkyo "natively" means nothing. There is no "official" implementation of Python - it's a language specification. CPython is the most popular (in no small part thanks to it being first), but there are a whole host of different implementations, each with their own strengths and weaknesses.
 
@Mego (fork bombs, and mallocs in a loop doesn't slow down your comp (a))
 
PyPy is an almost native implementation of python that can be several times faster
 
@Mego Not well versed about python, only started touching it recently
And I don't see myself doing some real programs with it, it's boring to use :/
@uoɥʇʎPʎzɐɹC At least, he learnt and doesn't have to rely on a 20 yo documentation ^^
 
been away for minutes and still no answer! :)
 
2:51 PM
@Katenkyo imgur.com/CfSwf
 
@uoɥʇʎPʎzɐɹC and also slower sometimes :)
 
@uoɥʇʎPʎzɐɹC Have you been able to get any decent scores? The best I've personally done (~50 lines of Perl with no libraries) is only 1.42
 
@uoɥʇʎPʎzɐɹC Already knew that one, love the HTML :)
 
@Lembik Unless it's programming competitions or supercomputers, dev time is more important than run time
 
@uoɥʇʎPʎzɐɹC That's not quite true
 
2:53 PM
@PhiNotPi I'm still having technical trouble, even with Python
 
I mean..it's often true
 
but in my case I like to compute the optimal values for problems
 
Also dev time is more expensive than cpu time
 
and it's better to take 100 times less time on my desktop
so small computationally expensive scientific programming is slightly annoying in python
which is what I use :)
 
2:54 PM
doesn't make a difference if the original time was two nanoseconds
 
sure but in my case it is 2 days in python and 10 minutes in C
 
Anonymous
Worrying about optimal solutions is a job for the academics in their ivory towers. Us working folk just want to get the damn thing working.
 
:)
those things are not always different!
 
Anonymous
(disclaimer: I have a B.S. in C.S. and could arguably fall into the academic category)
 
what about nerds at home who like to solve stuff :)
 
2:56 PM
This python module is faster than C extensions :) grantjenks.com/docs/sortedcontainers
 
great!
 
Nov 21 '14 at 10:05, by Sp3000
>> Wants to get results fast
>> Uses brute force
>> Ends up taking longer than if I did it properly in the first place
 
Anonymous
However, my CS education was a good mixture of theoretical CS and getting-your-hands-dirty software engineering
 
cool..where was it?
 
Anonymous
Stephen F. Austin State University
 
2:57 PM
cool
 
in the universe
Content-Free Statements, from CrazyPython™!
 
Anonymous
Something like #4 in Texas for computer science (only UT, A&M, and Rice have better programs, last I heard, thanks to their massively larger funding)
 
People want to fit in and stand out at the same time
 
@PhiNotPi for the domain appraisal challenge, can I accept base input as arrays of integers in range(37) (Python), having specified the input conversion alphabet in the answer?
 
Good morning TNB!
Or evening for the rest of you who've been in this room for a while.
 
3:01 PM
Good afternoon part of TNB!
 
@zʏᴀʙiɴ101 Okay, sure.
 
@PhiNotPi Maybe add that as a rule into the challenge?
 
what's TNB? :confused:
 
You're talking about... taking input as [1,3,4] (or similar) instead of "acd" right?
 
Yeah.
@uoɥʇʎPʎzɐɹC The Nineteenth Byte!
 
3:03 PM
ok
 
@Mego (BS only ring a bell for BullShit in my head, making this sentence funny)
 
@zʏᴀʙiɴ101 Okay, I added an additional rule for that.
> As an alternative form of input, you can choose to accept a domain name as an array of integers, instead of a string of characters, as long as you specify your desired character-to-integer conversion.
Good enough?
 
Good enough.
 
@PhiNotPi Isn't that the same thing that I asked? Base 37 number conversion?
 
@uoɥʇʎPʎzɐɹC I was thinking you meant, interpret the domain as a base 37 number, and then convert it to one giant (decimal) number, which would be the input. AKA use base-37 to convert domain names to single integers.
 
3:09 PM
@PhiNotPi Yeah, input conversion.
 
I could just use base64 and wing it
 
i wasn't up at this time
 
and waste a bunch of neurons
 
@uoɥʇʎPʎzɐɹC Okay.... shrugs. Anyways, I've decided to allow it.
 
3:10 PM
I still need to find a way to convert the training data though...
so I still have to use base 64
 
Is it really that hard? As in, start with a running total of zero. Take the string, chop off one character at a time, convert it to a number 0-36, multiply the running total by 37 and then add the newest number to the running total.
 
^ If it isn't a golf I don't really see the point in doing minor conversions like that outside of your submitted code...
 
well you just solved my problem
and my SO question on it too.
go get some rep if you want it :)
@PhiNotPi
 
Anonymous
@Katenkyo Bachelor of Science :P
 
@uoɥʇʎPʎzɐɹC I don't know Python well enough to answer it.
 
3:15 PM
@FryAmTheEggman It has to do with neural networks and they only accept integers
 
Just parse it before you call the neural network?
 
@PhiNotPi map = {key: value, key2: value2} then total = 0 then for char in string: then total *= 37 then total += map[char]
boom python
@FryAmTheEggman I didn't know how and I was too lazy :P
 
Anonymous
Woohoo, 10k on PPCG
10
 
downvotes all of Mego's posts
 
Congrats! \o/
 
3:20 PM
Why not google "how to do base conversion"? lol that's got to be a dupe on SO... :P
 
@FryAmTheEggman Didn't notice the comment about > base 36, it's really obscure
 
Anonymous
Now I'm all set for the rep increase for privileges
 
it is a dupe
 
Anonymous
Which means we can have our site design now
 
yay
waits five months
waits another five months
@mego
 
Vi.
3:23 PM
How can [pseudo]-randomness requirement be formulated for [tag:codegolf]?
Means the series of number not be clearly patterned, but strong crypto-grade pseudorandom is not required.
 
Anonymous
@Vi. Require that each possible value has an equal probability of being chosen at each chocie (i.e. sampling from a uniform distribution)
 
Vi.
@Mego, This may rule out low quality, but still acceptable pseudorandom.
 
import urlib;urllib.get("https://www.random.org/integers/?num=1&min=1&max=10&col=1&base‌​=10&format=plain&rnd=new") for python true randomness
@Vi.
 
Anonymous
Depending on how large your range is, typical pseudorandom generation ((rand() % (high - low)) + low) is essentially uniform
 
Vi.
3:26 PM
Sometime like integers from 0 to 63.
 
i++ % n is also uniform but not random
 
Anonymous
Yeah that will be fine
 
uniformness is not enough
 
Vi.
Maybe general uniformness + uniformness for next value given any preset current value?
 
Anonymous
3:27 PM
Uniformness and independence would be the usual criteria, but PRNGs fail the independence criteria
 
or just import urlib;urllib.get("https://www.random.org/integers/?num=1&min=1&max=10&col=1&base‌​‌​=10&format=plain&rnd=new")
 
I like this PRNG algorithm for code golf: excamera.com/sphinx/article-xorshift.html
 
Vi.
Is stating exactly mathematically how far (by some metric) the distribution may deviate from uniform and independent too cumbersome for PPCG?
 
Anonymous
Interesting though probably not useful: if you have 2 independent random sources (regardless of quality), you can generate uniform random values
 
Anonymous
@Vi. Yes. Just say randomly sampled from a uniform distribution and we all get the point.
 
3:29 PM
@Mego really?
 
@Vi. and ... yes :)
 
Vi.
"randomly" -> Impossible without hardware RNG or external sources. "pseudorandomly" -> How much pseudo?
 
there might be a nice challenge for cracking RSA where the primes are chosen using bad PRNGs
 
Anonymous
@uoɥʇʎPʎzɐɹC Yep, just look up "uniform random two sources" for more info
 
3:35 PM
The Perl program I'm working on for the domain appraisal challenge prints out a scatter plot of guess vs. actual price and also a histogram of the errors.
I set my Windows command prompt to the 8x8 pixel font.
 
I set my Windows command prompt to Lucida Console (having no choice of TrueType font except this).
 
And my Bash prompt to the APL font :D
I love the APL font :)
 
Anonymous
That seems broken, even for Windows
 
Why windows??? @PhiNotPi
why not *nix??
 
3:43 PM
@uoɥʇʎPʎzɐɹC shrugs
 
Vi.
Minimal code to generate RSA key as cops, cracking that poor man's RSA as robbers?
 
@uoɥʇʎPʎzɐɹC For me, because USB modem.
 
but everything is more compatible and the terminal is so much better
also half dev tools don't work on windows
 
The USB modem I use only has support for Windows. :/
 
 
3:47 PM
AWW
A LIL HAMSTER
 
"i'm a bird with a hamster hat"
 
The problem I've run into is that it's hard to figure out the difference between a $1 domain and a $100 domain. I've looked at both domain length and also what fraction of the domain is an English word.
 
@AlexA. Do you have a hamster hat?
 
Anonymous
@Vi. I could see something like that being interesting. Cops post public keys, less bits = better score. Robbers try to find private keys, with more bits = better score.
 
Anonymous
3:49 PM
So cops are incentivized to post weaker keys, and robbers are incentivized to crack harder keys
 
@FryAmTheEggman hi
 
Hello, was my edit OK? It seemed like stuff from your other challenge.
 
yes although I will add back the 1-indexing in another form
 
Anonymous
Cop winner is the poster with the smallest uncracked key at the end of some period, robber winner is the poster with the most points (each crack is worth <number of bits in public key> points).
 
thank you
 
Anonymous
3:50 PM
I'll sandbox that challenge later - no swiping! :P
 
@FryAmTheEggman now I just need some answers :)
 
Anonymous
For now, I have appointments to tend to
 
Sure, and no problem, don't know how I missed it the first time I read through it... :P
 
me neither!
 
@Lembik for your runs question
you didn't specify the alphabet
 
3:52 PM
:)
@orlp I don't think I need to do I?
@orlp you are free to try a larger alphabet if you think it might help
 
@Lembik well... would there a difference between an alphabet of [0, 1] and [a-z]?
 
@orlp I think not
I assume that larger alphabets are just worse
do you think that is wrong?
 
I don't know
I don't fully understand runs
 
oh ok.. they are just intervals that are periodic really
we just want them to be maximal
where periodic just means some prefix is repeated over and over again
is there some part I can make clearer?
 
I registered for a demo of jor1k, a JavaScript PC emulator. I'm excited for it.
 
3:59 PM
@Lembik I think yes, but I don't know how
 
@orlp oh you think with a larger alphabet you can potentially get more runs?
time to try out pyth.herokuapp.com/… :)
but I would be very surprised
 
.-. I just accidentally closed the emulator...
 
@orlp added a tiny bit of clarification to the question
please let me know if it does/does not help
 
so, apparently if you do <ul><li>A<li>B</li></li></ul>, chrome will interpret it as <ul><li>A</li><li>B</li></ul>
 
@Lembik well the thing is, adjacent runs get merged into one bigger run, right?
 
4:03 PM
it also doesn't matter how nested the second li is
 
so I figured that maybe larger alphabets can have better separation of runs
(merged if same period)
 
@orlp a run has to be a periodic word
@orlp it's harder to make periodic words the more letters you have
at least that is my intuition
I feel this needs some code .. we could just test all strings of length 10
with 2 and 3 different letters
 
4:28 PM
@Lembik what is a 7-length string with 4 runs?
for 6-length I have 001100 I believe
 
@orlp 001001 is for 6
both had 3 runs
 
wait
I'm confused
in 001100
we period 1
we have 00, 11 and 00
 
@Zgarb ghc is version 7.6.3-10. libghc-parsec3-dev (the only installed package that matches libghc-parsec*) is version 3.1.3-3build1.
 
@orlp right... 00 is a period word
11 is a periodic word and so is 00
0011 is not a periodic word
we are just splitting the string into periodic words
for strings of length 7-14 I have relied on Peter Taylor
let me see if I can make one with 4 runs now
 
oh right
00 11 and 00 is already 3
I get that
so both 001100 and 001001 are fine?
 
4:31 PM
yes
@orlp 1100100
has 4 runs
phew :)
 
what is the 4th?
oh
nvm
 
[[0, 2], [2, 4], [5, 7], [1, 7]] where the right end is exclusive
if that is helpful
 
fixed my script
 
oh cool
 
0
Q: Cannonball Conundrum

DerpfacePythonLifted too many cannonballs, too tired to write a backstory. - DerpfacePython Your task is to, with an input number n, find the second-smallest cannonball number of order n (which is a number which is both a n-gonal number and n-gonal pyramid number). The smallest number, in case you were wonde...

 
4:39 PM
Raining pretty hard where I'm at :/
 
(0, 0, 1, 1, 0, 0, 1, 1)
5 for 8
 
nice.. can I copy it into the question?
please
 
10 for 14
(0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1)
 
I am adding examples
very cool
how long does it take to find the one for n = 10?
 
instant
2^n
 
4:48 PM
even better
:)
 
but I'm not certain my script is bug-free
so take these results with a grain of salt
 
@Lembik hi, I already gave you the code to calculate these things
 
ok.. they are consistent with what peter taylor got
@aditsu you did thanks.. it's a little slow for larger n
 
yeah..
 
-5
Q: From incrementing to decrementing

fluHere's a counter which increments its value in the following sequence: 0, 1, 2, 3, 4, 5, 0, 1, ... class Counter { public: Counter() : m_value(0) {} void advance() { ++m_value %= 6; } int value() { return m_value; } private: int m_value; }; What is the smallest change (fewest c...

 
4:49 PM
0000100110010011
0000110110011011
0010011001001100
0010011001001111
0010100101101011
0010110100101101
0011001001100100
0011001101100110
0011001111001100
0011011001101100
0011011001101111
0100101101001011
0101101001011010
0110011011001100
all maximal results for n = 16
 
@aditsu and no one is very confident their code is right :)
 
(minus isomoprhism by swapping 0/1)
 
is everybody getting the same results?
 
that's what we are checking now
 
either my code is incorrect
 
4:51 PM
I think I have the values up to 18, they're not in OEIS
 
or the pyth answer is incorrect
my code says 0000100110010011 has 11 runs
Pyth says 10
 
@aditsu I did try very hard to make sure they wouldn't be :)
@orlp that's very interesting
 
my answer says 10
 
1 sec
 
@orlp could you list the runs?
 
4:53 PM
@Downgoat where are you?
 
@aditsu we can put them in the OEIS after the challenge. Actually one of my previous questions needs us to do that too
 
@Dennis Ok, thanks. I have ghc version 7.10.3-9 and libghc-parsec3-dev version 3.1.9-4
 
0000100110010011
1 1 4
1 6 7
1 8 9
1 10 11
1 13 14
1 15 16
2 1 4
3 3 8
3 9 15
4 5 12
7 3 16
format is
period, start index (1-based), end index (1-based, inclusive)
 
@orlp you have [1, 4] twice
 
4:57 PM
@aditsu with different periods
 
yes, they shouldn't be
 
@Dennis Could you pull Grime? I've made some changes and improved the debug logging.
 
you only take the minimal period
 
oh
 
it's the same run
 
4:59 PM
I can't even read it.. what does 7 3 16 mean? I feel one of those number is the length :)
 
@Lembik 7 is period
3 is 1-based index of start
 
oh!
thanks
 
16 is 1-based index of end (inclusive)
 

« first day (1985 days earlier)      last day (2861 days later) »