« first day (1925 days earlier)      last day (2936 days later) » 

2:00 PM
and it is (?(condition)a|b).
 
2:10 PM
0
A: Sandbox for Proposed Challenges

El'endia StarmanInverse Square Probability code-golf It's a fairly well-known fact that the sum of the reciprocals of squares is equal to pi squared divided by 6. That is, This is the Basel problem and was solved by Euler in 1735. I was thinking about generating a random patchwork of squares and trying to d...

 
@VTCAKAVSMoACE You hve to have slashes around it.
like a regex literal
 
@quartata Oh. Okay.
 
0
A: Sandbox for Proposed Challenges

El'endia StarmanInverse Square Probability code-golf It's a fairly well-known fact that the sum of the reciprocals of squares is equal to pi squared divided by 6. That is, This is the Basel problem and was solved by Euler in 1735. I was thinking about generating a random patchwork of squares and trying to d...

 
@NewSandboxedPosts Penguins are cute, aren't they?
@quartata I now get:
Variable length lookbehind not implemented in regex
 
codez?
 
2:19 PM
vtc:~ vtcakavsmoace$ arp -a | perl -pe "/(?<=(?:vtcpikali\|0:1c:10:e5:d4:fa).+)\d{1,3}(\.\d{1,3}){3}/"
Also, first puzzling answer \o/:
0
A: Easy peasy riddle

VoteToClosePerhaps you are: Known since the ancient times I'm sort of a chameleon Sometimes I am ugly And sometimes worth a million This value, however, is nothing compared To what I can do if not handled with care You use me to leave a mark on a tree Or to free life of impurity My fa...

 
It's because of the .+
 
hwat
oh
 
What are you trying to match? You usually shouldn't need to abuse a lookbehind like that
 
Only In .NET™
 
2:21 PM
@quartata I'm trying to extract the IPv4 address out of something like:
android-8ef77cdcafc5d17 (192.168.0.4) at (incomplete) on en0 ifscope [ethernet]
officedesktop (192.168.0.5) at 20:10:7a:7a:f3:e9 on en0 ifscope [ethernet]
android-467a15c7e1842498 (192.168.0.7) at (incomplete) on en0 ifscope [ethernet]
vtc (192.168.0.19) at 78:31:c1:c6:ee:c8 on en0 ifscope permanent [ethernet]
vtcpikali (192.168.0.30) at 0:1c:10:e5:d4:fa on en0 ifscope [ethernet]
? (192.168.0.67) at (incomplete) on en0 ifscope [ethernet]
? (192.168.0.255) at (incomplete) on en0 ifscope [ethernet]
 
@El'endiaStarman Personally I think it'd be an amusing challenge if results had to be accurate but people would probably complain :P Ditto for time efficiency. In either case, it'd probably be fun to do as a side exercise though, out of the challenge
 
The /octocat is actually a wrapper to the /zen. Both show an enlightening tip, while /octocat shows an octocat saying the tip. It's cool.
 
Why not just /(?!<insert thing in ?: here>)\((.+?)\)/; $_ = $1
 
(The /octocat can be set to display any message by the ?s= parameter, see this.)
 
2:25 PM
@N3buchadnezzar Progress thus far - will be in for a while
 
@Sp3000 ಠ_ಠ
 
That should work, right?
 
It's 823 rows of text.
It's a skyscraper of text.
 
@VTCAKAVSMoACE nice :)
 
@quartata I don't know perl. ¯\_(ツ)_/¯ @Mars made this code.
 
2:30 PM
@Sp3000 Juat out of curiosity, do you know of any non-.NET libraries that implement .NET regex? Would be cool to use it in Python
 
@quartata Because MAC goes after
And hostname goes before
 
@quartata Not that I know of, sorry (not really something I'd know)
 
@quartata Apparently not
According to a quick google search
 
@MarsUltor I don't see what that has to do with anything. This should just capture the first thing in parens (i.e the ipv4 address) if the hostnme isn't xyz
@MarsUltor bummer
 
@quartata Yeah, but it matches either hostname or MAC
not just hostname
 
2:34 PM
All he wants is the Ip address
 
@El'endiaStarman Actual challenge suggestion this time: what's the expected output for 1.644? (or would the result depend on your system/language capabilities?)
 
@quartata Only for his MAC/hostname
 
I thought he wanted everything that wasn't his hostname?
 
@quartata No, just the IP for his hostname, I think
 
Wow, talk about overkill. Just use ifconfig
 
2:38 PM
No, I'm finding an external computer.
For getting my own IP, I use:
ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
 
My bad
@quartata But basically he wants the IP of a certain MAC/hostname
 
Yeah - basically, I have a RPi with a wireless card that I plug into my computer for power. All the access I have is over ssh.
 
Right. So why not just do /<hostname> \((.+?)\)/
 
On some networks, which I might not be able to join yet, I use my computer as a router, which it automatically joins with a random IPv4. I then tell it over xrdp to go to a different wifi (because I can't figure out how to do that with command line. ;P), give it a password, then switch over.
@quartata Not all networks I normally go to have hostname resolution. ;P
Some of them have MAC, some of them have hostname, some of them have both, some of them have neither.
(for neither I just connect with my phone over USB ethernet)
 
@Sp3000 How did you do that? =)
 
2:44 PM
But ultimately the first thing in parens is the IP right?
 
@quartata Yup.
But only specific lines on the arp -a output.
 
So just use a plain old lookahead for hostname or MAC address + \((.+?)\)
 
Will that remove the parens as well?
 
@N3buchadnezzar Aforementioned factorisation - Pre-factorise all 3 and 5-digits (only takes a few seconds), then iterate over 16P8 hex strings of length 8 - take first 3 for first number, last 5 for second number. Look up their factorisations and combine to give the factorisation of the product. Then, using the factorisation of the product, look for other 3 hexdigit numbers that divide the product.
Unfortunately it doesn't save that much (16P8 times an average of 100-200 factorisations per number is still a lot)
 
/(?=hostname|mac)\((.+?)\)/; print $1 and run with -ne
 
2:47 PM
oh
Fancy.
 
About as plain as it gets, to be honest :P
 
@Sp3000 Fancy! My approach for finding the ideal 8 hex to iterate over failed though
 
This isn't the same though :P
 
@quartata It just output all of it.
 
Make sure bash isn't messing with your backslashes
 
2:50 PM
@N3buchadnezzar A little messy, but if you want to peruse: link
 
put the code in a file and run with perl -n code.pl to be sure
 
@quartata Okay (sorry, my internet decided to take a break).
@quartata There is now no output... because the internet died and not everything has come back to ARP-detectable levels.
 
@VTCAKAVSMoACE Yoke him with a wag and say "Gee, gee!"
:P
Wait, hold on, the internet connection doesn't go.
 
@Sp3000 your notation seems to differ a bit from mine, but interesting approach
 
There's surely a better way though :/
(also should probably have said: Python 3 + sympy)
 
3:00 PM
@zyabin101 try to recompile the .es6
 
@ArtOfCode Looks like dark magic.
 
@PhiNotPi It's Rails, it might as well be
 
@Sp3000 Yeah, I asked on stack overflow. Hopefully they have some ideas
 
@EᴀsᴛᴇʀʟʏIʀᴋ :OOOOOOOO
@Downgoat I don't want to download Babel just for that.
 
3:03 PM
63
A: Add a console to Stack Snippets

canonA duplicate of this question came up on meta.SO where I suggested a solution, copied here: I whole-heartedly agree. If the point of these snippets is to enable us to demo functionality and display its output inline, the output pane needs to be adapted to (optionally) mirror logged messages. Wh...

@zyabin101 it is online.
 
@zyabin101 you can do that online
 
@N3buchadnezzar Hmm the one answer so far gives a fair point - early exiting when it's impossible the maximum product of one side is smaller than the minimum product of the other might help
Not sure how much by though
 
@Sp3000 It would still need 10^14 iterations
@Sp3000 Also I was not quite sure how to find the upper and lower bounds
 
@Downgoat Still no.
 
3:10 PM
@zyabin101 hm... lemme take a look, can you post your code?
 
gist: Matilda, a chatbot for Stack Exchange chatrooms., 2016-05-06 12:21:54Z
// vihanb's chatbot framework <https://github.com/vihanb/SEChatbot/>
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var Talk = function Talk(text) {
  document.getElementById("input").value = text;document.getElementById("sayit-button").click();
};
var Data = function Data(text, instance) {
  return text.replace(/\$([A-Za-z$_]+[A-Za-z$_0-9]*)/g, function (_, v) {
    return instance[v];
  });
};

var Chatbot = function Chatbot(Name, _x, onmessage) {
  if (Name === undefined) Name = "a Chatbot";

  var _this = this;

  var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

  var _ref$Startup = _ref.Startup;
  var Startup = _ref$Startup === undefined ? "Hi my name is $Name!" : _ref$Startup;

  _classCallCheck(this, Chatbot);

  this.Name = Name;
  this.Options = { Startup: Data(Startup, this), UID: CHAT.CURRENT_USER_ID };
  this.onmessage = onmessage || function () {
    return void 0;
  };

  this.Queue = [];
  // Private
  var Called = Symbol("Called");

  this[Called] = new Set();

  // Startup
  Talk(this.Options.Startup);

  // Read
  setInterval(function () {
    [].concat(_toConsumableArray(document.getElementsByClassName("message"))).filter(function (message, index, transcript) {
      if (_this[Called].has(message)) return false;else _this[Called].add(message);
      return (message.parentElement.parentElement.className.match(/user-(\d+)/) || [0, UID])[1] != UID && index > transcript.map(function (t) {
        return t.textContent.trim();
      }).lastIndexOf(_this.Options.Startup);
    }).forEach(function (message) {
      return _this.onmessage.call({
        "Text": message.textContent.trim(), /*.replace(/\b[a-z\.]+(?:com|org|net|xyz)/g, "http://$&")*/
        "HTML": message.innerHTML,
        "Raw": message,

        "User": message.parentElement.parentElement.getElementsByClassName("username")[0].textContent.trim(),

        "Mentions": [].concat(_toConsumableArray(message.querySelectorAll(".mention"))).map(function (m) {
          return (m.textContext || "").slice(1);
        }),

        "Speak": function Speak(Text) {
          return _this.Queue.push(Text);
        },
        "Reply": function Reply(Text) {
          return _this.Queue.push(":" + message.id.split("-")[1] + " " + Text);
        },
        "Star": function Star(Text) {
          return message.querySelector(".meta > .stars > .vote").click();
        },

        "super": _this
      });
    });
  }, 2100);

  setInterval(function () {
    if (_this.Queue[0]) Talk(_this.Queue.shift());
  }, 2500);
};

// Matilda-specific data starts here.
var matilda = new Chatbot("Matilda", { UID: 183551, Startup: "Hello, I'm $Name." }, function() {
  
});
 
I just came up with a problem that's so nasty I'm not sure I want to post it. In particular, let us say this would be a problem such that waving the language must already exist rule makes sense.
 
Try to determine what the following lines of C99 code do on a little-endian system:
 
TL;DR problem statement: Smallest metacircular compiler
 
int64_t data[1];
*data = 0;
return fread(data, 6, 1, inFile) && *data == 30956777667127;
 
3:12 PM
wait gists onebox again?
 
@quartata You won't believe it, but yes. ( ͡° ͜ʖ ͡°)
 
LegionMamma: Invokes undefined behavior (endianness)
 
@quartata apparently. :P
@Joshua .... I think that exists in many esolangs.
 
I think that's just a couple bytes in Emmental or Mascarpone although I'd have to see a more detailed spec
 
^
@Joshua would a interpreter also work? compilers are hard.
also, a self-compiler is simple: 0 bytes.
 
3:17 PM
What?
 
Compiles into the language of the compiler which is the same as the language of the compilee.
 
The full version was going to block that by a declaration of "if your langauge has a library function to invoke the compiler it fails" and 0 bytes machine code crashes on 99% of architectures; LegionMammal: I give up
 
Compiler in bf for bf: ""
examples:
 
too fast s/it fails/you can't use it/
 
Well, for most languages.
 
3:19 PM
the empty solution in bf is not valid: in no known platform is the empty binary a bf compiler
 
Wait, I didn't realize you literally meant compile
 
but for another language, like my language FOG, "^" is a compiler.
^^
Like, compiling is weird.
What does it compile to?
 
any executable binary for any well-known platform
 
closed as unclear what you are askign
define executable
 
3:21 PM
machine code
 
Oh, that's not too bad.
 
@EᴀsᴛᴇʀʟʏIʀᴋ Then it would be unclear what you asking :P
 
The problem is theoretically interesting but rather too hard for golf
 
@Joshua define machine code :P
 
3:23 PM
I'll bite; there exists a CPU that can execute it
 
@Joshua Not really. For a simple language like Bf its pretty easy
 
Do you want to play around on the C9 QPixel instance? :-)
 
I define a new language Gxsldjfn where the only valid program is the empty program, which takes any input and produces no output. If a non-empty program is passed to a Gxsldjfn interpreter, undefined behavior results. Here is the shortest Gxsldjfn self-interpreter: ""
 
Only 8 instructions so it would be easy to transpile
 
@LegionMammal978 It is not a programming language.
 
3:24 PM
LegionMam: You lose; not turing complete
 
@LegionMammal Does it have integers?
 
Apparently I'm the only one taking the challenge idea seriously
 
indeed
If I got more takers I would ask it for real; but it is nasty
 
@quartata what challenge?
 
Anyways @Joshua you can sandbox it
 
3:26 PM
@ArtOfCode Solver is an op on your QPixel IRC channel ~_~
Is a proper chanserv in works?
 
@zyabin101 It's there, in theory, but it isn't connecting to the IRC server because there's no entry for the servername... or something like that.
 
Kenny Lau: Smallest meta-circular compiler outputing machine code
 
which I haven't been able to find how to fix
 
@zyabin101 yes stop asking about it every day pls
 
@Joshua You can ping someone by using @someone.
 
3:28 PM
no one should be using irc yet anyways
 
I define a new language Psdfljkdf where the only valid program is the empty program, which takes a string as input. If there are no numbers ([0-9]+) in the input, then there is no output. If there is a single number in the input, then it outputs 1 if the number is prime, or 0 otherwise. If there are multiple numbers in the input, then it outputs their sum. If a non-empty program is passed to a Psdfljkdf interpreter, undefined behavior results. The shortest Psdfljkdf self-interpreter is "".
 
I regret even mentioning that it was up
 
(Should be a programming language)
 
It is, by meta consensus.
But actually, it's a joke language.
 
@LegionMammal978: Not turing complete; rejected
 
3:29 PM
@Joshua No, non-truing-complete languages are allowed by our standards
 
^
@KennyLau ihaichu
@zyabin101 nope.
Stuck HW is 0 bytes.
 
@zyabin101 Why?
 
The winner for the cat program was 0 bytes
 
@quartata Hybserv is sitting on the server, if you're any better at figuring out errors than I.
 
3:30 PM
fixed
 
@zyabin101 Wouldn't that mean that Bubblegum is also a joke language?
 
@LegionMammal978 Nope.
It has an actual feature.
 
@zyabin101 But Psdfljkdf does too; it can add numbers and test their primality.
 
The "programming" part of Bubblegum is basically a joke :P
 
@LegionMammal978 here
@EᴀsᴛᴇʀʟʏIʀᴋ hi
 
@KennyLau You need to remove the trailing newline for the empty program.
 
I got here trying to come up with a metric for programming power that isn't easy to cheat. A lot of the golfing languages have absurd power because their interpreters are attuned to their problems. It tends to match nasty languages, which is kind of the intention.
 
@LegionMammal978 here
 
@Joshua Idea: restrict languages such that only languages created before 2011-01-27 19:00:00Z (when the PPCG private beta started) are allowed.
 
@ArtOfCode We're gonna be switching to a different ircd
 
3:38 PM
@quartata Another one? Already switched it to hybrid, if that helps?
 
@Joshua I think TC is a good criteria in this case
@ArtOfCode Hybrid doesn't hve svsnick without an extension
 
@Joshua Yeah, there's definitely some overfitting to the types of language we normally have :P (Proof: gs2 has a single byte command to map the rest of the program over each line, because of how anarchy golf problems are often presented)
 
don't worry inspircd is really easy to set up
 
@quartata I think hybserv does that, but I just haven't managed to get it to connect.
@quartata excellent
 
I got it working out of the box on Ubuntu basically
 
3:41 PM
@LegionMammal978: Nah. If somebody can pull this off in gs2 they deserve the win.
 
@Sp3000 What does that mean exactly, 'mapping the result over each line'?
 
svsnick is a server to server command that lets me change nicknames which the qpixel nickserver wll need
 
@Sherlock9 Sorry, brain autocomplete. I meant rest
 
@Doorknob github repo for kfibot?
 
@quartata "Heh, it's mine!"
 
3:42 PM
@Sp3000 Oh, so since most anarchy golf problems are multi-line, gs2 has a builtin that essentially maps "the following code" to every line of the input?
 
Yeah
 
"Well, I host my code on GitHub. I have to host my code on GitHub, so..."
 
@Sherlock9 yes it's lines-mode
@zyabin101 ??????
 
Hmm. Neat
 
bring "Let me..." brang "find..." plock "the repo..." pluck jumps in box
 
3:44 PM
@Sherlock9 it also has words-mode which splits by spaces
 
@zyabin101 in your console, what is the output for CHAT.CURRENT_USER_ID
 
@Downgoat 183551
 
I don't know if I'm wandering into nutty territory here, but is there a reason that I rarely see gs2 answers on PPCG?
 
@zyabin101 hm... Okay... The error comes when you also don't supply the UID?
 
@Downgoat Yup.
 
3:54 PM
0
Q: How to transform an directed graph into many single linked lists

user13371 Question: transform an directed graph into single linked lists Condition: 2.1 the graph is represented by adjacency list; 2.2 the processus should be as quick as possible and should not take up much storage 2.3 when adding an edge, the graph should create new linked lists as quickly as possib...

 
4:10 PM
@NewMainPosts this problem is actually pretty interesting, if only it was in the proper format
@PhiNotPi ^ any ideas on how to turn a digraph into a list of linked lists?
*minimal set of linked lists
 
I swear, these XKCD substitutions are really confusing me
every time I read something CS related I keep getting confused why they're saying "contiguous spaaaaaace"
 
Solution: sledgehammer to the monitor
 
Great, now every instance of "car" is replaced with "cat"
This makes reading lisp code difficult
> [divisor (cat (prime-divisors num))]
 
I've already suggested a simple fix for this. The rest is in your hands.
 
Unfortunately a sledgehammer to my monitor makes the code even more difficult to read
 
4:18 PM
Less confusion though.
 
self driving car -> uncontrollably swerving cat
 
Besides, it's Saturday. Go get some fresh air ;)
 
ok
@Geobits What is this "air" you speak of
 
It's the stuff between the ground and space. You should check it out some time.
 
@quartata Link?
 
4:20 PM
So, brainstorming ideas for a KOTH challenge - go!
 
@ArtOfCode Numbers, hammers and signposts.
 
@ArtOfCode Uh... take turns either punching your opponent in the face or kneeing them in the gut. Last man standing wins, round robin.
 
> Bernard "Bernie" Sanders is an American politician and the junior United States elf-lord from Vermont. He is a airbender for the Democratic nomination for President of the United States in the 2016 eating contest.
7
accurate
 
4:23 PM
The best part about is is that my chat messages just look like I'm saying "uncontrollably swerving cat -> uncontrollably swerving cat"
identity cat
 
SFRUITW'd //o\\
 
@quartata feel da bern ♡ 🔥
 
@zyabin101 Why are you constantly saying this. What does that even mean?
8
 
@aditsu yeah you better vote for bernie or he'll air blast you into space
 
@mınxomaτ Fastest runner up in the West.
I don't like getting a message to the starboard second.
 
4:26 PM
So.... it's like a terrible replacement for star-ninja'd...?
 
you're not even on the starboard
 
@zyabin101 and the S is for Strange and nonsensical non-sequitur?
 
@aditsu Second.
TFRUITW'd ///o\\\
@aditsu This time, the T means third.
 
@zyabin101 ಠ_ಠ
 
4:31 PM
And the slashes are middle fingers I assume. Because really.
 
@Geobits no, they are his legs - xkcd.com/1530
 
@aditsu ^_^
 
That's much less offensive than my version though :/
 
I think it makes more sense visually
 
Yea, but it deserves multiple birds.
 
4:33 PM
Starred just to scare people that will check the starboard
 
>_>
 
yay
the URL gives it away though
 
blue link is too tempting
people click on it before reading
 
is scary spider gone? I'm scared to scroll down
 
@Fatalize what does your avatar represent?
 
4:36 PM
oops posting that scrolled down shit
pls make it go away I don't like
 
@quartata cough sledgehammer cough
 
>_< somebody just had to eleven it
 
oh it's gone phew
@ArtOfCode Thank ye
 
anytime :P
 
@quartata are you arachnophobic?
I found some nightmare fuel on google images ^___^
 
4:39 PM
Kinda? I'm scared of any flying insects and spiders larger than your garden variety tiny house spider
 
@quartata yes it exists
 
@Doorknob ok
 
Hrmph, I keep getting ERROR :Closing Link: 127.0.0.1 (Non-TS server) when trying to connect my Ruby thingy
@VTCAKAVSMoACE the actual fuck
 
4:43 PM
@quartata Some kid drew it. xD
 
lol, best typo ever
 
I'm not sure that was a typo...
 
New on Parenting.SE: "How to tell my child that that's not what Buzz Lightyear does?"
 
@VTCAKAVSMoACE It's Parenting.SE.
 
4:44 PM
<.<
 
how to kid plz halp kthx
 
(to any parenting.se regulars that might be here: sorry not sorry)
 
@ArtOfCode could you at least fix the typo please? :p
better, thanks :)
 
You
Also, hi.
 
4:52 PM
the heck
 
well, I definitely don't want to be your friend
 
You
Gives everyone a pi
 
@You ._.
 
Dammit, I forgot that every single IRC server has to implement things differently when it comes to server-to-server
 
You
@Maltysen What? It tastes soo good!
 
4:53 PM
bleh
 
@You there?
 
I'd rather just use a module, but I don't think there is one for Ruby.
I know there's a Python one though.
 
:29513213 wtf TMI for sure
 
@quartata you should just use python then :P
 
4:54 PM
@Maltysen But I'm integrating it with Ruby on Rails
So I need to use Ruby
 
@quartata flask?
 
A flask would certainly help my mood if nothing else ;)
 
Oh sure, I'll just port these 1000+ (a good chunk of which isn't even mine) lines of Rails code to Flask
 
1
Q: Are these strange communication habbits of urban teenagers normal?

ideasman42Being a teenager now, unlike when I was young has some differences regarding communication regarding mobile phones / internet. I have noticed some strange behavior in teenagers (around 15), which I find a bit baffling. Its a mix of small things, so will list in dot point. Plans for meeting/ca...

 
4:56 PM
good. go do it. :P
 
what the actual
 
^ with the ending word
 
Aren't you proud? I censored myself :D
 
Can you clarify what the urban had to do with it -- have you noticed suburban or rural teens behaving differently? — Erica ♦ 1 hour ago
lel
 
4:58 PM
^
As a suburban teenager, this is fairly normal among everybody I know... — Eᴀsᴛᴇʀʟʏ Iʀᴋ 35 secs ago
 
what if in a parallel universe
the chat in parenting.SE is laughing about our questions
0
A: Are these strange communication habbits of urban teenagers normal?

Rory AlsopI think you are interpreting things slightly differently to the way I would. When I was young, there was no mobile communication device, so you planned your meetings carefully, sometimes with backup plans, otherwise you just wouldn't meet your friends. Nowadays there are so many ways to connect...

 

« first day (1925 days earlier)      last day (2936 days later) »