« first day (1957 days earlier)      last day (2885 days later) » 

12:01 PM
@Quill How many keys do you have left? =)
I don't know my typing speed so I can't calc it myself :(
 
@PeterPeter I believe that's not allowed. Once there was a bot here, quite a while ago, but the owner was asked to move it to another room.
 
@zʏᴀʙiɴ101 There's a website that can calculate your typing speed
 
Actually the same thing happened when I ran my own bot in here.
 
@Quill Well, I'd better go typing the chat transcript with a special offline program timing me. >_>
 
I tend to write pretty fast as long as I don't have to think about what I'm currently typing
 
12:08 PM
^^ actually a system of four websites representing four personal policies that limit your email responses to: two.sentenc.es, three.sentenc.es, four.sentenc.es, five.sentenc.es respectively.
Who here uses these?
 
0/10 they don't handle more than five
 
Just take a pre-determined amount, name it to your receiver(s), and tack on the sentenc.es signature to your messages. :P
 
@Quill An infinite number of keystrokes would be way scarier.
 
@Quill How many keys do you have left? =)
 
@zʏᴀʙiɴ101 294335994
 
12:20 PM
@zʏᴀʙiɴ101 No, you're supposed to set the signature as your signature
 
:P
@avocadjuic Yup.
 
12:33 PM
Let's assume.
At my age, a very fast typist with 60 WPM has ~266112000 keys left.
That's 532 programs to golf >_<
For 30 WPM that's halved to ~133056000 keys.
266 programs >_<
@Quill So, they suggest blogging every email. Some emails don't deserve to be blogged. >_>
@Quill 52 words per minute :)
 
nice
 
> 1 647 359 Tweets Left
> 76 Novels Left
> 461 Computer Programs Left
> 23 063 Love Letters Left
@Quill Ah, just forgot: typing test used here.
Or
> 1 153 151 Emails to your boss left
 
12:49 PM
-1 not realistic: at least 50% of all characters typed are chat messages
 
@NathanMerrill Not really. I wrote 10317 chat messages here.
What is the single line message maximum length in chat? :/
 
@zʏᴀʙiɴ101 500 characters per line
 
Thanks.
@NathanMerrill 10317 messages is 5158500 keystrokes maximum!
 
lets say you use 1/10th that
you've been here how long?
 
515850 keystrokes.
 
12:55 PM
chat user since 2015-12-26
 
@NathanMerrill Yup.
 
which is 165 days.
 
Yes.
3126.(36) keystrokes per day spent on chat messages.
 
therefore, we can expect you to type 1141122 keystrokes per year
you had 77 years left
 
@NathanMerrill Yes.
ohai @Rainbolt
 
12:59 PM
therefore, 87866394 chat strokes /230630390 total keystrokes
0.38098359023
 
@NathanMerrill 38.098359023% of keystrokes left if I started chatting just now? o_o
No, I don't believe that.
 
no, you're going to use 38% of all of your keystrokes chatting
 
@NathanMerrill Yes.
:O
 
assuming that 1. you use appx 50 keystrokes per message, 2. that the estimator was correct, and 3. that you will continue using chat like you have in the past 6 months
 
O_O
@_@
@Quill I'll waste 38% of my keystrokes chatting >_<
@Poke mon
 
1:02 PM
@zʏᴀʙiɴ101 that sounds worthwhile to me
 
@zʏᴀʙiɴ101 mon
 
I'd rather chat here than waste it in emails to bosses
 
Or novels.
That's a large waste of keystrokes.
@Quill let me calculate the amount of keystrokes you chat away...
@Quill you have posted 7270 messages here until now, right?
 
yeah, in here
 
The maximum length of a single line message is 500 chars.
Let's assume you use 1/10th of that.
363500 keystrokes.
You've been here for how long?
 
1:07 PM
@zʏᴀʙiɴ101 Another ~22.2k in other channels
 
@avocadjuic 29470 messages.
1473500 keystrokes.
chat user since 2015-04-13
It is 422 days from that day to today, but not including today.
3491.7061611374407582938388625592 keystrokes per day spent on chat messages.
Therefore, we can expect you to type 1274472 keystrokes per year.
Now, how much years you had left? >_>
According to your SE network profile, 73.
Therefore, 93036456 chat strokes / 294335994 total keystrokes
0.31608929215772366596794818101656
@Quill you'll waste 31% of your keystrokes chatting >_>
...
 
does that come with a site badge or just real life loneliness?
 
@Quill Nope.
 
@zʏᴀʙiɴ101 Hello :)
 
1:42 PM
How many of you care about getting resources for programming?
 
Welcome to Programming Puzzles & Code Golf chat, @TuxCrafting!
 
@TuxCrafting Hello
1
Programming resources

Proposed Q&A site for programmers looking after viable resources on different algorithms and techniques.

Currently in definition.

Would anyone be interested in an SE like this?
 
@Upgoat is Cheddar finished?
 
@Upgoat Hiiiiii!
 
2:19 PM
Chat mini-challenge (since chat is dead) -- Given an input string of ASCII, output the vowels aeiou in ascending order sorted by their number of occurrences in the input string. Case insensitive. Order between two letters that have the same number of occurrences is up to you. For example, "Programming Puzzles & Code Golf" should output aiueo.
 
@Bálint hai!
 
@Upgoat How's Cheddar?
 
PowerShell v4+, 115 bytes ... param($n)$b=@{};[char[]]'aeiou'|%{$b[$_]=$n.length-($n-replace$_).Length};-join‌​($b.GetEnumerator()|sort value).Name
 
Wait, PowerShell is .NET?
 
Yeah
It's a little bit different syntax than C# or F#, and it's a full shell as well, but you can get access to all of the .NET libraries
 
2:34 PM
@zʏᴀʙiɴ101 in my grilled cheese
 
@Upgoat What means?
@Upgoat What that means?
 
Just noticed that Photography has a design quite different from standard, including different links and a photo in the header from the "hall of fame"
 
@zʏᴀʙiɴ101 means my breakfast was very tasty
@trichoplax but they were one of the earlier sites though
 
But I meant the language Cheddar, not breakfast cheddar >_>
 
@Upgoat Are later designs more restricted? I just hadn't realised there was that much potential for variation from the basic theme
The image on the front page is the "image of the week" as voted for on meta. Seems a really nice idea. Doesn't translate directly for our site, but it made me wonder if there was some different thing that we could do here
 
2:47 PM
@avocadjuic avocadocentral.com
3
 
What are some difficult algorithm interview questions for a first year computer science student?
 
generate a list of primes
 
@trichoplax probably not restricted in the sense they can't do it. just SE is so backed up on site designs, they probably don't have the time
@flawr oh noi flagged that accidentky
>_> sorry
 
@Upgoat thanks for letting me now, don't worry=)
 
@Upgoat from what I've seen, they haven't been compromising quality for speed
 
2:55 PM
@Upgoat ಠ_ಠ
 
@NathanMerrill When checking factors of a number (say, n), check up to sqrt(n)
 
And as usual, you'll blame your hooves, I'm sure...
 
invalid flaaags
 
buttoms = portmanteau of "butt" and "bottoms"? :P
 
whoops >_>
 
2:56 PM
@JesterTran Or take an infinite list and perform sieving.
 
@JesterTran oh, are you a first year student? You don't want to do it that way. You should probably use sieve of eratosthenes
 
I tried to click edit but deleted instead
 
@flawr @NathanMerrill Thanks, time to learn that
 
@JesterTran Haskell ftw=)
 
@Upgoat You should get your hooves replaced with hands and feet
 
2:58 PM
@avocadjuic ew no
 
@flawr how does that work with generators?
 
@NathanMerrill could work, they key is lazy evaluation
 
hmmm...you could like keep a queue of increments
 
:30211808
 
....I guess I should go write that parallelized sieve of Sundaram blog post real quick...
 
2:59 PM
@Upgoat 0/10 No ping
 
so, if you're on the number 50, you'd have a queue, where 2->52, 3->51,...
 
@El'endiaStarman You haven't already?
 
@avocadjuic I've said multiple times that I should or that I want to, but I've just never gotten around to it.
 
@flawr may or may not be me
2
 
and you peek the top of the queue, and see if the number maches the next number
the problem is that that requires O(N) memory
 
3:01 PM
@Upgoat is Cheddar finished? >_>
 
er, the sieve already requires that
huh, a generator for the sieve is actually really cool
 
What is a generator?
 
they allow for infinite lists
so, in python:
 
100/10
 
def range():
    x = 0
    while True:
         yield x
         x = x+1
 
3:02 PM
> Look at that bug!!!
 
@NathanMerrill Not x++, x = x + 1 >_>
 
@NathanMerrill ooooh, ok
 
@Upgoat Is this a picture from you after a party?
 
@Bálint yes
 
@zʏᴀʙiɴ101 thanks
 
3:03 PM
actually me after an intense debugging session with node
 
@Upgoat At least you were safe
@Upgoat I feel your pain
 
\o/ @Bálint You replied!
 
@JesterTran when the function is first called, it goes then stops at the "yield" function. Then, on next iteration, it resumes at the yield, and continues
 
@NathanMerrill Basically xrange
 
(instead of pinging)
 
3:04 PM
@avocadjuic range() in python 3 :)
 
@zʏᴀʙiɴ101 I'm trying to get used to it
 
It's a bit more finicky than pinging
 
meant to add the 3 XP
 
My first resource recommendation proposal for SE sites was shut down, because it's not clear, so I made this instead:
1
Programming resources

Proposed Q&A site for programmers looking after viable resources on different algorithms and techniques.

Currently in definition.

 
3:05 PM
@flawr Saw you join. I'm on Freezone >>Speed<<
 
@zʏᴀʙiɴ101 do you have node installed
 
Area 51 is live?!
 
@Upgoat I don't.
 
@JesterTran What do you mean by "live"?
 
;_;
 
3:06 PM
But I can try using C9 for that.
 
@mınxomaτ I'm coming=)
 
hi all
 
jam, let me tear off a fresh workspace...
 
any haskellers in?
 
@Lembik hi part of all
 
3:07 PM
@Upgoat I only installed node, to try out UglifyJS (or something like that)
 
@Bálint I heard about people wanting an area51.stackexchange in the past and now it's happening
 
I'll call it complete when I know it works on most systems
 
@JesterTran It's quite an old "SE"
 
@Bálint :'(
 
3:08 PM
Anyone here has Windows and node for @Upgoat?
He needs to make it work on Windows.
 
anyone who does have node installed run: bash <(curl -s cheddar.vihan.org/install)
 
linux only?
 
@Lembik I may count as one.
 
@Upgoat I'm not sure if I want a software on my computer, wich is essentially made by a goat
 
idk should work on Mac and Windows bash
 
3:09 PM
@Zgarb great :)
@Zgarb Given a long bitstring (represented any way you like), how would you write code to count the number of set bits in each window of length 20, say?
 
@Bálint &df avocad juic also made parts of it
 
@Upgoat Even better
 
@Upgoat I have a bash shell on my windows machine (though git), are there any linux dependencies in the actual project
 
@Lembik Golfed or pretty?
 
@Zgarb pretty!
 
3:11 PM
@NathanMerrill realpath or readlink
 
I am trying to get my head round haskell :)
I mean in a purely functional style
 
@Upgoat TIL juic can program, also &df?
 
@Lembik does the concept of functional make sense?
 
@Lembik That's nice
 
@NathanMerrill I think so
@Bálint :)
 
3:12 PM
or is it a specific technique that Haskell is using
 
@NathanMerrill it refers to mutability I think
 
@Lembik to an extent. If you have a non-functional language, you can still make a function functional, as long as you don't mutate the variables passed to you (or any globals)
 
@NathanMerrill Right if you are willing to suffer you can do anything :) I mean Haskell is implemented in C and then run in machine code :)
 
def map(list):
    new_list = []
    for i in list:
        new_list.append(i+2)
    return new_list
 
@avocadjuic &df is supposed to become disapproval face but Gboard is messing me up:|
 
3:15 PM
for example, the above function is functional, even though new_list.append() is not functional
 
@Upgoat Why?
 
@NathanMerrill I think the key word was "pure" above :)
I mean that was an important part of "purely functional"
 
@quartata either Hilary or trump in office isn't exactly desirable
 
Reality check. Having Bernie as president would be great, but his viewpoint is extreme (and a little unrealistic). History has shown that in the fight between a democratic extremist vs a republican, the republican wins. (Granted this will probably change in a decade but still)
I hate to say it but I would be much more concerned about the odds of Trump winning if Bernie was nominee.
 
3:17 PM
"his viewpoint is extreme" wat
 
@Fatalize For America
 
oh right
 
extreme == radical changes
 
not that extreme though
 
@Lembik Something like this may be the simplest solution.
 
3:17 PM
Yeah I know from a worldwide perspective it looks pretty tame but we're operating in a 1950s mindset basically
 
@quartata hmm... I am not sure I understand. Are you worried about what Bernie would do if elected or worried that he won't be elected?
 
He could advocate for strict gun control
 
@Zgarb oh thanks!!
 
@Lembik Neither. I'm saying he probably wouldn't win if he was nominee
 
its not about how extreme the viewpoint is, but how many changes it would cause in america
 
3:18 PM
@quartata that was my latter point
 
Oh, OK. My bad
 
I prefer extreme left as they always get moderated
 
@quartata Really? Because practically every poll shows that Bernie has a better chance of defeating Trump than HRC does.
 
@Fatalize upset hillbillies? :/
 
extreme right sometimes actually implements it
 
3:18 PM
@TimmyD Lemme put it like this:
Bernie would attract the hardcore blue states but Hilary would also attract those since let's face it they would rather have anyone but Trump
 
@TimmyD Her Royal Clintonness?
 
@Lembik Hillary Rodham Clinton
 
Bernie would not win in the swing states because he's too left but Hilary would do significantly better because she's more of a centralist
 
@TimmyD I know! Humor clearly not working :)
 
The only thing Bernie would get over Hilary is the youth vote, which is (sorry) unreliable and relatively small
 
3:20 PM
@quartata in a year where a near fascist reality TV host has been chosen as the primary winner, predictions seem tricky :)
 
Also I hate to say this but California isn't as liberal as we look; I don't think Bernie would do too well here (as the primary showed). I suspect there would be something similar in New York
 
May 5 at 20:40, by TimmyD
The US is so far right-leaning as a whole that Hillary Clinton is considered a left candidate.
 
yep
The US is a country where proposing 6 weeks paid maternity leave makes you a socialist
 
@Lembik Thinking a bit further, I think this is actually more idiomatic (use splitAt instead of take and drop).
 
^^ a commie*
 
3:21 PM
@Lembik I know :(
It's really rather absurd all in all
 
@Zgarb thanks so much
@quartata can you imagine what they make of paid paternity leave in Europe :)
 
@Lembik Whats wrong with socialists?
 
communists!
@flawr it's a dirty word in the US
 
Dirty as fuck?
 
@flawr and it is used interchangeably with communist and terrible person
@flawr that depend how you do it? :)
 
3:23 PM
@Lembik uncensored=)
@Fatalize You are a prolog expert, right?
 
@flawr on that site maybe, in reality no lol
never used Prolog outisde PPCG
 
Do you mind if I ask you something about it anyway?
 
go ahead
 
As an exercise I'd like to implement "quicksort" in prolog (being aware that it is not gonna be that "quick")
 
@flawr The U.S. is still suffering the effects of McCarthy and the Second Red Scare. That was really not that long ago (1950s).
 
3:26 PM
@Zgarb it would be great if one could ask pure functional programming challenges
what languages other than haskell exist to answer those sorts of challenges?
 
For that I'd like to write a "function" that partitions a list in to two sublists (one greater or equal pivot element, one smaller)
But I have trouble on how to go about that.
 
"function" triggered
 
What do you call it then
 
what have you done yet?
@flawr Predicates
 
partition(_,[],_,_).
partition(P, L, [H|A], B) :- partition(P, [H|L], A, B) ,H =< P.
partition(P, L, A, [H|B]) :- partition(P,[H|L],A,B), P < H.
 
P : pivot, L: list, A,B are the sublists, but this approach doesn't work at all as A,B are not anchored
 
pivoting(H,[],[],[]).
pivoting(H,[X|T],[X|L],G):-X=<H,pivoting(H,T,L,G).
pivoting(H,[X|T],L,[X|G]):-X>H,pivoting(H,T,L,G).
 
0
Q: Replicating the blind watchmaker experiments in r

ComteIn Chapter 3: Accumulating Small Change of the blind watchmaker Richard Dawkins sets a computer the task of writing the phrase 'Methinks it is like a weasel' a phrase from Hamlet. He restricts the program to only read 26 capital roman letters and a spacebar, to workout how many trials it would ta...

 
19 stars to graduation update
 
@flawr you call recursively your predicate with [H|L] as second argument
 
3:29 PM
@Lembik You can write purely functional code in many languages (like Python), but I think most languages that require it are Haskell or ML derivatives.
 
but your end condition is the empty list
 
@Zgarb is there an objective way to judge if python code is purely functional?
 
[H|L] is one element bigger than L
so you just get an infinite loop cause the second argument gets infinitely large
 
I am trying to work out if one can make a challenge that doesn't exclude all other languages
 
@flawr partition(_,[],[],[]).
partition(P, [H|T], [H|A], B) :- partition(P, T, A, B), H =< P.
partition(P, [H|T], A, [H|B]) :- partition(P, T, A, B), P < H.
Your end condition was wrong, if L is the empty list then A and B are also empty, not anything
and you got the H part wrong in the 2 other rules
You want to recursively check the first element of L, so you have [H|T] in the head of the predicate
then you call recursively on the tail T
 
3:33 PM
@Fatalize ah now i see, i was not really thinking recursively
@Fatalize Thank you very much!
 
@flawr you're welcome :)
 
Still taking my very first steps=)
 
they are the hardest, once you "get it" it becomes much easier
 
@Fatalize After the second line, I could add a cut, right?
 
also you should probably put the H <= P and P < H at the beginning of the rules
so that the recursive call is last for tail-recursion
@flawr Generally you don't want to add cuts ! if it's not needed
 
3:37 PM
@Lembik I guess so, if one uses the (somewhat obscure) Wikipedia definition. If you ban all side effects and variable re-assignment, and require that objects are immutable, I think you should always end up with purely functional code.
 
Doesn't the interpreter optimze that?
@Fatalize Oh ok.
 
But it may be difficult to adapt to all languages.
 
@Zgarb Functional BrainFuck
 
@Lembik this drastically depends on the granularity you want
 
@flawr As an example of why you don't want to add a cut such as partition(P, [H|T], [H|A], B) :- !, partition(P, T, A, B), H =< P.
 
3:38 PM
I can make a single statement functional
 
?- partition(3,Z,[1,2,3],[4,5]).
Z = [1, 2, 3, 4, 5] ;
Z = [1, 2, 4, 3, 5] ;
Z = [1, 2, 4, 5, 3] ;
Z = [1, 4, 2, 3, 5] ;
Z = [1, 4, 2, 5, 3] ;
Z = [1, 4, 5, 2, 3] ;
Z = [4, 1, 2, 3, 5] ;
Z = [4, 1, 2, 5, 3] ;
Z = [4, 1, 5, 2, 3] ;
Z = [4, 5, 1, 2, 3] ;
false.
without a cut
 
or a function functional
 
@Zgarb Many languages are multi-paradigm though
 
or a program functional
 
but with you only get
partition(3,Z,[1,2,3],[4,5]).
Z = [1, 2, 3, 4, 5] ;
false.
which is less general :p
 
3:39 PM
@avocadjuic Yes, but the goal seems to be to ban the non-functional parts.
 
Oh now I see, thank you very much for the example!!!
 
@Zgarb ban?
 
making a program functional is easy: simply don't read/write a file, a window, network, or console
 
10 mins ago, by Lembik
@Zgarb is there an objective way to judge if python code is purely functional?
 
@flawr This also shows that your predicate is well-made, because it works in multiple directions with only a single implementation :p
 
3:41 PM
making a function functional is also simple: never modify parameters, or variables outside the scope of the function
(as well as the side effects listed with a program)
 
@Zgarb Hmm, that would probably need IDE-level variable recognition (?)
 
@Fatalize I appreciate your help, can I give you a tip in form of a virtual piece of chocolate?
 
@flawr if you used CLPFD for the inequalities, you could even get the following behavior:
partition(_,[1,2,3,4],A,B).
A = [1, 2, 3, 4],
B = [] ;
A = [1, 2, 3],
B = [4] ;
A = [1, 2],
B = [3, 4] ;
A = [1],
B = [2, 3, 4] ;
A = [],
B = [1, 2, 3, 4].
or this:
partition(I,Z,[1,2,3],[4,5]).
I = 3,
Z = [1, 2, 3, 4, 5]
 
What is CLPFD?
 
Pretty cool predicate all around :p
Constraint Logic Programming in Finite Domains
 
3:44 PM
@Zgarb interesting
 
That soulds like way too much thinking for me
 
1 hour ago, by TimmyD
Chat mini-challenge (since chat is dead) -- Given an input string of ASCII, output the vowels aeiou in ascending order sorted by their number of occurrences in the input string. Case insensitive. Order between two letters that have the same number of occurrences is up to you. For example, "Programming Puzzles & Code Golf" should output aiueo.
 
@TimmyD , shortest code wins.
 
@flawr You've seen probably that normal arithmetic in Prolog uses is and the right side of is must be fully unified, e.g. 2 is Z*Z doesn't work
 
What's the high score? :/
 
3:45 PM
whereas in CLPFD 4 #= Z*Z will tell you that Z is either 2 or -2
 
@zʏᴀʙiɴ101 My PowerShell entry, 115 bytes
(it's also the only entry)
 
1. [:30213675] >_>
2. [:30213683] >_>
 
@Fatalize Oh cool. Is this what you used for Brachylog?
 
@flawr yes, by default all arithmetic in Brachylog uses that, instead of low-level arithmetic
 
Can I bother you with another question? append([1,2,3],4,L). produces L = [1, 2, 3|4], what does that actually say?
(I just found this when I wanted to use append([1,2,3],[4],L). instead.)
 
3:49 PM
that L is a list that starts with 1, 2, 3 and then the rest is 4
which isn't a list so it's a bit dumb
but Prolog doesn't care about types mostly
?- append([1],test,Z).
Z = [1|test].
 
Ah ok, I realized that prolog doesn't really care about what something is. In one of my very first exercises I got a result like 1+1+1+1+1+1+0
(calculating the length of a list, and using = instead of is)
 
Prolog is homoiconic and things like 1+1 or [a|b] are just constructs to it that it matches
so that things like this also work:
Z = 1+A+3, A =5.
Z = 1+5+3,
A = 5.
 
Right, that was really confusing first=)
 
I would guess so, considering the way = works in most languages :p
 
why don't they make the local stack bigger???
=P
 

« first day (1957 days earlier)      last day (2885 days later) »