« first day (2462 days earlier)      last day (2397 days later) » 

6:00 PM
8 mins ago, by betseg
arch was never mentioned :P
 
this triggers every possible UD in the C standard
 
@Mr.Xcoder can I assume the lists will always be the same length?
 
2 mins ago, by betseg
@Mr.Xcoder do the lists have the same number of elements?
2 mins ago, by Mr. Xcoder
@betseg yes, may assume that.
 
@Mr.Xcoder PowerShell, 41 bytes
 
@Mr.Xcoder derp, didn't notice that
 
6:02 PM
@AdmBorkBork now give it a go in Jelly :)
 
@Mr.Xcoder ઘ๗۶ඝٷૅǠ
:D
 
@AdmBorkBork ( ͡° ͜ʖ ͡°)
Someone pls try it in Jelly :c
\o/ palindrome reputation.
 
@Mr.Xcoder python, 50: Try it online!
im really bad at python
 
@Mr.Xcoder I would, but my brain no worky like that.
 
@betseg Not that bad, -5 bytes.
 
6:09 PM
i bring greetings.
 
Hello sir!
 
who is i?
 
@betseg I am the Laser-Eyed Dark Lord of Chaos.
 
o no
 
\o/ Python beats Powershell at array-manipulation! (cc @AdmBorkBork)
 
6:12 PM
lol
of course it does
Python > PowerShell
 
@ThomasWard I'm the Almighty Zaglo.
 
@ThomasWard In the context of golfing, Python < PowerShell
 
@Zaglo you're not almighty. You aren't Shog the dark lord of SE.
:p
@Mr.Xcoder True.
 
@Mr.Xcoder Jelly, 6 bytes ZEÐfFQ
 
@Mr.Xcoder Not surprising, it usually does. Slicing is not really a strong area for PowerShell.
 
6:15 PM
@AdmBorkBork I use absolutely no slicing.
I use zip
 
Zip, map, slicing, etc.
PowerShell has really none of those.
 
¯\_(ツ)_/¯ Then how is Powershell's strength?
 
it isn't. *shot*
 
@Mr.Xcoder It isn't?
 
@AdmBorkBork is outputting by $LastExitCode valid i/o?
 
6:19 PM
Then what is PowerShell's strength?
 
it's better than pure MS-DOS xD
 
@Pavel Possibly? I don't think it's ever come up.
 
@AdmBorkBork Well param($a)if($a){exit($a|?{$l-ne$_;$l=$_}).count-1} is shorter than param($a)if($a){($a|?{$l-ne$_;$l=$_}).count-1;exit}0 by two bytes.
 
56
A: Default for Code Golf: Input/Output methods

RainboltPrograms may output using their exit code... Exit codes are basically a return value for programs. If functions can output using their return values, it makes sense that programs should be able to do the same. Examples: Java exit codes C and C++ exit codes

 
@Mr.Xcoder The issue is it isn't an actual exit code.
 
6:21 PM
@Mr.Xcoder String manipulation and conversion, or things where you're converting types. PowerShell is strictly typed, but has tons of implicit casting. It's also really powerful at manipulation of things outside of programs (e.g., like an IP socket).
 
Then I dunno.
 
@Mr.Xcoder A script with exit 5 has an exit code of 1, but sets a global variable you can access to 5.
 
How do you dedupe a list in Jelly?
 
@AdmBorkBork posted to main, you can use the exit code or the stdout solution that you wrote.
@Adám @Mr.Xcoder @WheatWizard I posted my earlier CMC to main, if you care to put your solutions to it there.
 
@Pavel I already did.
(and upvoted) :P
 
6:30 PM
Well that was fast.
 
@AdmBorkBork Q.
 
How to get 10 rep for free: Answer one of my posts. I will upvote it unless it's obviously invalid.
 
@Mr.Xcoder Jelly, 3 bytes Try it online!
 
Nice.
 
Yay, I popped my Jelly cherry. (that's my first answer in Jelly)
 
6:34 PM
@AdmBorkBork The thing is that I do not understand how it works :D
 
1
Q: Count the changes in an array

PavelYour task today is to write a program or function that takes an array of integers, and counts the number of times, reading it left to right, that the value changes. This is easier to show with an example: [1 1 1 2 2 5 5 5 5 17 3] => [1 1 1 **2** 2 **5** 5 5 5 **17** **3**] => 4 Test case: Input...

 
@AdmBorkBork are you posting your solution to ^ or not? Because if you aren't I'm going to post the exit code solution (with credit) because it's cool.
 
@Pavel Yeah, I will. The regular one.
 
Ok then.
 
@Mr.Xcoder So = gives you something like [0, 0, 1, 0] where the two lists have a common element. Then x repeats the elements of the list that many times, and Q dedupes.
 
6:40 PM
@Mr.Xcoder CJam, 8: {:a.&:|}
 
@aditsu Salut! Nice... So glad to see you back!
 
@Mr.Xcoder Does my explanation make sense? That's how I built it to work, anyway. Maybe I'm taking advantage of some quirk in behavior.
 
@AdmBorkBork TBH I still don't have a clue, but I'll figure it out. My mind is quite slow ATM.
 
@Pavel Is this answer acceptable? It outputs nothing in place of 0, which is equivalent in brain-flak
 
@Mr.Xcoder Hi!
 
6:44 PM
@DJMcMayhem I'm going to go with yes
 
Sweet
Explanation soon
 
(sorry for multi-pings)
 
Thanks but WTH is that monster in the middle?
 
middle?
 
Nevermind :C
@H.PWiz It is very annoying how ←Lg returns -1 for []...
 
6:48 PM
Yes, but it's also what you would expect.
 
Yup.. Trying to fix my answer.
 
Yay, I came up with the same ITL answer.
 
I spent the last 2 minutes trying to come up with some pun regarding ITL and failed miserably D:
 
#commentvotebait
 
@cairdcoinheringaahing ITL be a difficult task
 
6:54 PM
@cairdcoinheringaahing Don't worry, ITL be alright
Now I think of one :P
 
@cairdcoinheringaahing TIL anagrams don't mean the same thing
 
... I spent the last 2 minutes trying to come up with a better approach than ITL
I today learned. --- Yoda.
 
@Mr.Xcoder Solution: Switch to MATL
 
@DJMcMayhem Yup...
 
@Mr.Xcoder Why is that a Gandalf quote? I don't remember him saying that
 
6:56 PM
First time I saw Gandalf mistaken for Yoda
7
 
@cairdcoinheringaahing Oh no sorry >.< I was talking about Yoda from star wars
 
@Mr.Xcoder Well, at least you didn't think it was something to with Star Trek
 
@Mr.Xcoder It's easy to mix up those two franchises - they both lead up to a horrific antihero saving the world/galaxy
 
pass you shall not!
 
Mistakes should I not make in the future.
 
6:58 PM
If a powershell script exists without explicitely calling exit, $LastExitCode is untouched from it's previous value, and this bothers me
 
Anonymous
@trichoplax Darth Vader and Gollum?
 
@Mego Spoilers!
 
Anonymous
@trichoplax RotJ came out in 1983. RotK came out in 1955. We're far past spoiler territory here.
 
I know :P Shockingly close initials by the way
And indeed full words...
 
7:05 PM
@trichoplax Sam was the real unsung hero. Gollum just slipped.
 
Even more similar, as both antiheros got a new name too...
 
this is conspiracy theory level stuff
 
Precious my Nineteenth the Byte...
 
@HelkaHomba Sam was the best character
 
@Mego <-- has not watched Lord of the Rings but still intends to at some point
 
7:06 PM
:O
 
next up: darth vader's shiny suit is actually to hide that his skin sparkles in the sun
 
@Pavel That's unforgiveable
 
@Pavel that's heresy.
 
@Pavel You definitely should.
 
Eh, it's pretty forgivable.
 
7:07 PM
@DJMcMayhem I'm working on it okay too much good stuff came out before I was born
 
@J.Salle I mean, if he's read the books that's enough
 
More forgivable than not seeing Star Wars (4-6 at least).
 
@Riker that's true
 
anybody here watched the new blade runner?
 
@Riker I have
 
7:07 PM
cool
I'm interested in it, not sure
 
@HelkaHomba I agree. Hard to call Darth Vader the real hero with any seriousness too :)
 
@Pavel Wait, was that really before you were born? 2003?
 
@Riker Not yet, but I mean to.
 
1
Q: Approximate My Squares

Stan StrumInspired by this video by tecmath. An approximation to the square root of any number x can be found by taking the integer square root s (i.e. the largest integer such that s * s ≤ x) and then calculating s + (x - s^2) / (2 * s). Let us call this approximation S(x). (Note: this is equivalent to a...

 
7:08 PM
@DJMcMayhem no, I think i got the release date wrong
 
@DJMcMayhem don't think so, pavel's older than me and that movie is when I was 1
 
I thought it came out in the 90s
 
lol no
hm
2001, 2002, 2003 for movies
 
No, Fellowship was 2001, ROTK was 2003, so I'm guessing TTT was 2002
 
yep
 
7:09 PM
So Fellowship was before @Riker was born
 
interesting: both the LOTR movies and the new star wars ones have come out around dec 16-19
@DJMcMayhem yes
TTT was 3 days after
 
Anonymous
@DJMcMayhem Really they all were out before most of us were born. They were books before they were movies.
 
@Riker Did you watch it on release day?
:P
 
@Riker Lots of movies come out around holidays (obligatory youtu.be/BqSRfhQ3Ivc)
 
Anonymous
Wait Riker was born in 2002? imminent old feeling
 
7:10 PM
@Mego I was born in 2003 lol
:P
 
Anonymous
Oh ye gods no
 
@DJMcMayhem nope
 
Anonymous
I watched all 3 movies when they came out...
 
@Mego step right up, see this ancient piece of history
 
Anonymous
7:11 PM
There's always an xkcd...
 
Anonymous
Kids these days, being young and not old like me
 
> being young
think kids have already done that
 
Anonymous
Except I'm not even old - I just feel old compared to you kids :P
 
I'm guessing you're younger than me, if that helps...
 
Actually, this one is probably better
 
Anonymous
7:13 PM
I'm 23 :P
 
@trichoplax I mean, you're also tied with admborkbork for oldest user right? :p
 
The Nintendo Wii has been around for the majority of my life o_O
 
@DJMcMayhem Ha ha that last one...
 
@Mego Pfft, when I was your age, I was already 25.
14
 
@EriktheOutgolfer Whoops I voted to undelete yours instead of editing mine, sorry!
 
7:14 PM
tfw harry potter is from before the turn of the millenium
 
Anonymous
@DJMcMayhem xkcd has been around for the majority of my life. This is a good thing.
 
@Mr.Xcoder and you ninja'd me
 
I think xkcd has been around for the majority of most peoples lives
 
removed the undelete vote
 
Wait no
That's not true
 
7:15 PM
@DJMcMayhem according to that it's 21 :p
 
Ah
I couldn't find it
 
@DJMcMayhem Thinking that says something about your age :P
 
Anonymous
@Riker Well yeah. The books are set a few years before the year each was released.
 
@EriktheOutgolfer Yup thanks... Count truthy elements using identity seems just crappy.
 
@Mego that is true
 
Anonymous
7:16 PM
Book 1 was released in 1997, and is set in 1991
 
It's true for me though, and I'm not 21
 
guess who's probably the oldest person in here lol
 
Lol that's ≥ 10 years before my birth.
@EriktheOutgolfer Trichoplax?
 
well, my money is on admborkbork
 
Actually, it might be mınxomaτ.
 
7:18 PM
I'm relatively old too..
 
Everything relative is :P
 
admborkbork is 35/36
 
@Mr.Xcoder "Everything is relative" is a line in this song which I remember from when I was little: youtube.com/watch?v=xYA0pkcYIfg
 
I'm younger than 25 FTR.
 
7:20 PM
@mınxomaτ Just a wild stab, sorry for making you old :P
 
@EriktheOutgolfer Almost 36. About another month.
 
People who haven't seen me in person tend to think I'm much older.
 
It's because of your 1337 hacker skillz
 
@mınxomaτ well, I guess you're almost 35 or something?
 
...what
 
7:21 PM
because you "remember a 1988 song from when you were little"
 
1 min ago, by mınxomaτ
I'm younger than 25 FTR.
 
or you just listened to it later?
@mınxomaτ hmm
 
@EriktheOutgolfer that was me, and I wish I was only 35 :p
 
So aditsu should be ≥ Adm?
 
7:23 PM
definitely >
> I wish I was only 35
 
Damn that 001...
 
I guess nobody in here would've guessed aditsu is so old already :p
 
I had some kind of guess since I know he has relocated to another country sometime in the past.
 
hmm, is the chat history limited? I remember there was one guy older then me, but can't find the relevant messages
 
CMC: Find the integer sqrt of an integer.
@aditsu Can't you search for that message?
 
7:27 PM
@Mr.Xcoder CJam: mQ
 
@Mr.Xcoder jelly, 2 bytes: ƽ
 
@Mr.Xcoder that's why I asked if the history is limited
 
@aditsu No, the history is not limited.
 
@aditsu I think there are currently bugs related to that
 
ಠ_ಠ Pyth, 4 bytes: s@Q2
@_@ It's just amazing how many important overloads @ has in Pyth. @ on lists + ints gets the element at a certain index, on 2 lists it gets the intersection and for integers it returns the nth root.
 
7:31 PM
@Mr.Xcoder Python3, 40 bytes: import math;f=lambda x:int(math.sqrt(x)) (TIO)
 
@ThomasWard Why not just lambda k:int(k**.5)?
 
because i'm horrid at golfing :)
newer to golfing, sue me
 
what mr xcoder said
 
that works :P
 
@ThomasWard No, I just taught you a new trick tacitly shh. Welcome to PPCG! :P
 
7:33 PM
@ThomasWard well, nobody would probably hire you as a golfer with skills as amazing as yours, if that's even a position ;p
 
@EriktheOutgolfer I'd much rather encourage Thomas rather than politely criticising him...
 
@Mr.Xcoder I don't think I ever sent the answer to this so here it is: {∊((∊⊃⍵)=∊⊃⌽⍵)⊆⊃⍵} (probably reinvented the wheel a couple times there ¯\_(ツ)_/¯ )
 
Wow, many... Inclusion signs
 
@Mr.Xcoder Thanks to your assist/response, Python 3, 19 bytes (TIO says 21 because i have f=, and i'm not pro at making TIO work with lambdas...); TIO
 
7:34 PM
most of them are monadic though
 
but i learned something :)
 
Anonymous
@J.Salle If the wheel was a square :P
 
because I forgot about decimal powers being a thing :p
 
@Mego maybe a cube?
 
@Mr.Xcoder well, that was referring to his current skills...if he gets to be active in here over time his skills will start to improve, so that's in fact an encouragement ;-)
2
 
Anonymous
7:35 PM
@Mr.Xcoder √≈
 
@Mr.Xcoder I didn't take it as criticism :)
 
@ThomasWard f= is usually not included in the byte count unless the function is recursive, so yours is 19 bytes.
@ThomasWard I was joking nonetheless.
 
@Mr.Xcoder Good to know :)
grrrr too many emails >.<
 
@ThomasWard Also we usually make it tio-byte-count compatible by putting f= in the header using `f=\`: Try it online!
 
7:37 PM
d'oh
'header'
@Mr.Xcoder As I said, learning more each day :)
 
Anonymous
For just sqrt, you can shorten it to .5.__rpow__ and drop the lambda bit, but I don't know how to floor it without needing a lambda and thus making it longer
 
@Mego yeah that's why you need a lambda
 
Yup flooring ruins everything.
 
unless it's some golfing language which can easily do that
 
Anonymous
Python needs builtin function composition :/
 
7:38 PM
Also Python's __...__ functions are evil.
 
^
 
@Mr.Xcoder Thanks to your assist/response, Python 2 and Python 3, 19 bytes; TIO (WITH the header now heh)
 
Anonymous
int.(.5).__rpow__ would work if . worked for composition
 
@Mr.Xcoder yes, they are. It's especially evil when you're defining them for custom classes...
 
@Mego definitely, it can be useful outside code golf as well
 
7:38 PM
PITA.
@Mr.Xcoder Raising to the nearest int is also equally evil. But usually irrelevant :)
 
I am very annoyed by the fact that __import__('module') never saves bytes over from module import* or import module...
 
Grr, Jelly
 
@Mr.Xcoder fun fact: that works perfectly in Py2 too xD
 
@ThomasWard I know, that is supposed to work, but it is ungolfy unfortunately :'-(
 
chat search definitely has some problems..
 
7:41 PM
indeed.
python isn't the best for golfing :P
BUT, i took it as an attempt to learn more :)
 
@J.Salle umm, you can just use a train for 5 bytes: ⌊*∘.5
2
 
so blah.
 
@ThomasWard Glad I could help. Maybe solving another CMC would make you learn more?
:D
 
probably. Provided i'm not busy yelling at the FCC.
... for the fifteenth time.
 
7:43 PM
is there a data query thing for chat?
 
@EriktheOutgolfer that's not the CMC I was answering
 
@J.Salle but that's where you replied to
 
CMC: (I know it is a dupe) Compute the deltas of a given list. (PS: PLS let Thomas solve it if they want to in Python)
 
@EriktheOutgolfer I'm working with a frequency coordinator to get my consulting business a handful of frequencies for our radios when we are deploying on-site for consulting work and spread-out work in a client's locations. They've returned the application twice, even though the Coordinator verified it's valid as an itinerant business. sooo...
 
Jelly, 4 bytes: _@2\ /s
 
7:44 PM
The deltas are the differences between consecutive elements: [1, 2, 5, 3] -> [1, 3, -2]
 
@EriktheOutgolfer I just noticed that, I used the CMC widget and probably missclicked
 
Jelly Question -- I have a range [1,2,3,4,5] and a list [0,1,1,0,0] ... how do I get [0,2,3,0,0] from that?
 
@AdmBorkBork Multiplication.
 
@aditsu There's El'endia's TNBDE but not sure how recently it's been updated. I guess it would work for any older messages though
 
Anonymous
7:44 PM
@aditsu ppcg.starmaninnovations.com/tnbde/
 
Thanks!
 
cool, thanks
 
Anonymous
In Actually, that would be ♀*, since * alone is dot product for two lists
 
Why easier? That's the expected result from vectorization, isn't it?
 
7:47 PM
hmm, I'm getting similar results
 
@LuisMendo Well vectorization's purpose is making things easier
 
@LuisMendo ...to a newbie in golfing languages stuff is a bit different
 
I guess it's my Matlab background that makes it seem almost obvious :-)
 
well, it's very obvious for me too, from my apl-based background
(mostly jelly)
 
Jelly control flow is very different from PowerShell control flow.
 
7:50 PM
PowerShell control flow is mostly normal procedural control flow
 
Lol numpy deltas are shorter than manual pure python deltas... facedesk my life was a lie
 
Are you using the zip trick?
 
@LuisMendo yes of course.
 
Heh. That wasn't obvious to me at all. I saw it here
 
@LuisMendo for those who know python well enough it's pretty obvious
 
7:53 PM
@LuisMendo It's friggin' 15 bytes shorter than zip...
 
My Python is rather a little Worm
 
Although it is not very helpful otherwise, as you have to create a LC nonetheless and wastes lots of bytes when used repeatedly...
 
@AdmBorkBork I want this to be the first sentence in the Jelly docs.
 
Anonymous
@LuisMendo Well there's your problem. You're using something from the entire wrong phylum!
 
Haha
 
7:56 PM
@Mego Hehe. Are they different as much up the tree as phylum? :-O
 
@Mr.Xcoder Funky, 14 bytes a=>a::fold(@-)
 
<-- doesn't know how to make a loop in jelly despite looking it up twice
 
What type of loop?
 
Anonymous
@LuisMendo Yep! There are several different worm phyla - Annelida (segmented worms) is probably the most well-known
 
Any loop. Let's say it's a while loop
 
7:57 PM
@Pavel it's easy, the links go to the left of the quick
 
@Pavel , ¿,...
 
Also in Proton, if zip were to actually work properly, deltas would be way shorter. Instead, it ends up being longer than Python because of the overhead to fix the error ._.
 
@ATaco what is the :: operator doing
 
@Pavel you can see the syntax is <body><condition>¿
 
@Pavel While loop is ¿.
 
7:57 PM
@Pavel Works like Lua's : operator.
 
@LuisMendo if you're talking about earthworms, yes. Pythons are from the phylum Chordata, earthworms are Annelids
 
so two links go to the left of ¿, first is what is executed while the condition is true, second is the condition itself
 
@ATaco idk what that is but generally :: is some kind of member access
 
Indexes, but if it's a function applies the table as the first argument to it.
 
@Mr.Xcoder That would be a great beginner task for brain-flak if anyone wants some help trying it out
 
7:59 PM
@DJMcMayhem Oh sure, Let me try it!
 
So in this case it's equivalent to a.fold(a,@-)
 
@Mr.Xcoder Sweet. Do you already know the basic (nil|mon)ads?
 
@DJMcMayhem Do I take input from STDIN in standard Python-format lists?
 
huh that syntax for operator functions looks interesting
 

« first day (2462 days earlier)      last day (2397 days later) »