« first day (2823 days earlier)      last day (2014 days later) » 

12:02 AM
@Pavel (a=s)&&a+'<br>' again if s is empty string.
 
 
4 hours later…
3:51 AM
Quartata?
 
4:04 AM
i Pledge to my followers, in a legal binding contact, that I would not use bathroom signs in any capacity in my award winning "still lifes"
i hope this answers your question.
 
Now Were Cookin
 
absolutely ruining my day by imagining a website where they close my question for being about food on a tech site
 
this is the actual reason we got the new code of conduct
 
hm?
also that reminds me apparently some people drink avacado juice how wacky is that though
 
4:18 AM
class action on behalf of avocado juicers
I've used avocado oil before, but not really the same thing...
i cant see any "juice" that's not just throwing the thing in a smoothie which is kinda different
 
yeah but still
drinking an avodad smoothie is wackty as hecc
 
just a generic fat at that point
throw in a stick of "butter" instead if you want to play life on Hardcore Cardiac Arrest Mode
 
4:43 AM
Can't imagine how avocado juice tastes like. Gross texture I think
 
4:58 AM
yeah it doesnt seem like it would work at all texture-wise by itself
 
 
1 hour later…
6:06 AM
0
Q: IP address or not?

rv7 An IP address is a 32-bit numeric address written as four numbers separated by periods. Each number can be zero to 255. Input: An IP address for example, 1.160.10.240 Output: 0 or 1 This is code-golf, so fewest bytes will win!

 
6:49 AM
0
A: Sandbox for Proposed Challenges

l4m2Unicode encoder Do Invent your own Unicode 7.0.0 encoding (as efficient as possible) with score 317754. Shortest encode+decode program win. code-golf kolmogorov-complexity p.s. I'll expand it when posting, though

 
 
1 hour later…
8:07 AM
0
A: Sandbox for Proposed Challenges

Vedant KandoiIs the Circuit Possible? Write a program or function that takes input: all resistors available and a resistance value and outputs a truthy value of whether or not it is possible to get the resistance by using those resistors. Rules: Any format for input will do.The last number is the required ...

 
 
1 hour later…
9:34 AM
hi all
 
 
2 hours later…
12:04 PM
0
Q: Find the closest RGB color

VajuraInput: A valid 6 HEX digit color code wihout a # prefix Valid: 000000 FF00FF ABC123 Your job is to find to which one of these: Red: FF0000 Green: 00FF00 Blue: 0000FF White: FFFFFF Black: 000000 the input color is the closest too, in this case you try to only match it to blac...

 
12:20 PM
0
Q: Docker containers launching in 'exited' state by default

hackedI'm trying to launch a container through a custom image, that has been created by a Dockerfile. The issue is, by default my containers are launching in 'exited' state and I am not able to see the output in my browser while typing the ip of my server. I'm using AWS ec2 ubuntu 18.04 instance. ...

 
 
1 hour later…
1:23 PM
0
Q: Validate a barcode

Wais KamalA barcode of EAN-13 symbology consists of 13 digits (0-9). The last digit of this barcode is its check digit. It is calculated by the following means (the barcode 8923642469559 is used as an example): Starting from the second digit, sum up all alternating digits and multiply the sum by 3: 8 9 ...

 
 
2 hours later…
2:54 PM
Decided to learn Perl 6, am not regretting it. I got a BF interp working in half an hour as my first program. :D
 
most of perl6 i've written consists of a single sequence
if perl6 were nothing but perl5 + sequences, it would have had a lot more success
 
> if @tape[$pointer] ≠ 0 {

but unicode
 
Not sure why this post got closed:
5
Q: IP address or not?

rv7 An IP address is a 32-bit numeric address written as four numbers separated by periods. Each number can be zero to 255. Valid format: a.b.c.d where a, b, c or d, can be 0 or a natural number with no leading zeros. Output: 0 or 1 Test Cases: Input | Output | Reason ...

Perhaps it is a tiny bit vague on some corner cases, but nothing that can't be remedied surely?
 
@moonheart08 yeah, and unicode ;)
 
if only for the fact i get to use ⚛ in production code
 
3:15 PM
it’s so unreadable
I mean it doesn’t look like an atom except in certain fonts
doesn’t look like anything at all
 
I just noticed it's an actual atom, not an atom in the programming sense
 
3:45 PM
Ok, the IP address post above has been edited to clarify, can we get some attention and re-open votes if you think the issues have been addressed?
 
Is there a way to avoid the creation of the temporary variable @a in this code?
@a = '1234' =~ /./g;
$b = \@a;
 
i don't know perl 5, but try

$b = \('1234' =~ /./g);
 
Which doesn't work:
 
RIP. idk then
 
$b = \('1234' =~ /./g);
print $b, "\n";
print ${$b}, "\n";
produces
SCALAR(0x55deadbeef123456)
4
 
3:51 PM
yeah
 
deadbeef hmmmmmm
 
Just an example...
 
actually a nice trick in codegolf
 
not real output, alright. Deadbeef would be strange in real output
 
3:52 PM
What is a nice trick?
 
${\map ...}
to fetch the last value of an iteration without needing a variable assignment
 
@primo How does \ (create reference) work in that case?
 
it creates a list of scalar references, which when dereferenced returns only the last
 
Ok.
 
4:08 PM
I figured it out: $a = [ '1234' =~ /./g ];
Reason: Arrays auto flatten.
 
[ ... ] creates an array reference
also commonly seen in golf @{[ ... ]}
 
What is that used for, again?
 
for example:
print "@{[a..z]}"
embedding a (typically space separated) list directly into a string
or just an anonymous array
 
Is it absolutely necessary to wrap anonymous array in @{[...]} in order to use it like this?
print @{[1,2,3,4]}[2];
 
print [1,2,3,4]->[2];
-> also deferences
(of course, list would be preferable)
print+(1,2,3,4)[2];
phantom plus, because the parenthesis are bound to print
 
4:19 PM
Ok..... so arrays can be indexed as usual, just that the parentheses are usually bound to print.
That's the reason why I was getting all those compilation error.
 
ahh, now i see your original question
 
What is the behavior of + on array/string/etc.?
 
nothing!
$a = 'a';
$b = 'b';
print $a.-$b;
minus, however, does have function
oh yeah. array or list coerced to a scalar context will return its length
 
You can also do $#arr to get the lenth
iirc
 
@Pavel length-1.
 
4:33 PM
right
As long as people are talking about perl, why does keys %ENV work but not keys (1 => 2, 3 => 4)?
Experimental keys on scalar is now forbidden at (eval 17)[/usr/share/perl5/perl5db.pl:738] line 2.
Type of arg 1 to keys must be hash or array (not list) at (eval 17)[/usr/share/perl5/perl5db.pl:738] line 2, near "4)"
From what I can tell when you pass a hash variable to a function it gets interpreted in list context anyway
 
print keys {1 => 2, 3 => 4};
still a warning
i'm not sure why it doesn't like to do it
 
Same problem, and %ENV isn't a hash reference.
 
I was thinking maybe it's a hashref but..?
 
print keys %{{1 => 2, 3 => 4}};
fat fingers
 
Ok, I can do it by dereferencing a hashref literal. But I'm not sure why I can't just use a regular hash literal. How does perl even tell the difference between %{{1 => 2, 3 => 4}} and (1,2,3,4)?
 
4:45 PM
0
A: Sandbox for Proposed Challenges

Stephen LeppikChoose an Outcome for Maximum Drama code-golf decision-problem The premise of this is simple: A 10% chance is pretty unlikely, but everyone knows that a one-in-a-million chance is a sure thing! So, write code that implements the following "dramatic" probability rules: Take in a floating po...

 
one results in a list, the other results in a hash
 
Bet whenever you pass anything into a subroutine as a parameter it gets interpreted in list context, no?
Which is why the parameters of a subroutine are always a single list, @_.
 
f($a, $b)
@_ is a list of two scalars
f(@a, %b)
@_ is a list with the first element an array, and the second a hash
na, that can't be right
 
No, @_ is flattened
 
yeah
 
4:50 PM
Mysteries of Perl context
 
you got me
most people would probably write this, though:
%h = (1 => 2, 3 => 4);
print keys %h;
 
i always feel bad when I can't figure out these sorts of Perl things but i feel a little better seeing primo stumped too
 
Here's another one I've been thinking about . If you include Data::Dump, pp (1,2,3) will print (1,2,3). However, if you say my $str = pp (1,2,3), it will assign it to $str and not print it.This is probably less of a mystery and more "Pavel doesn't understand perl context correctly".
 
it's been a while since i've visited perlguts
looks like pp returns a string value in a scalar context, without emitting it
makes sense, i guess
 
@primo I guess my question is how does pp know what context it's in. If I'm defining a perl sub, how do I check what context I'm in?
There's a wantarray to check for list context but I can't find anything else
 
5:00 PM
print STDERR "$out\n" unless defined wantarray;
that looks like it
wantarray would be list context
 
So wantarray is true in list context, false in sacalar context, and undefined in... idk-what-to-call-it context when you don't use the result.
I'm assuming that hash context and list context are the same thing, which makes my earlier problem about keys slightly more confusing.
 
i don't know that keys is actually a sub
 
keys %hash = 200 will cause additional memory to be allocated for the keys of %hash, to store up to 200.
  DB<1> print \&keys
CODE(0x55fe50f7fa20)
Looks like a sub though
 
i have no idea, but i suspect magic
 
I'm tempted to ask a stackoverflow question titled WTF is keys
/me considers finding the Perl source
 
5:09 PM
there's a freenode irc for core devs, i'll see if i can dig it up
i don't have it in my chanel list anymore
you could ask at #perl though, someone might be able to point you in the right direction
 
Bah, freenode blocked by firewall
Ok, got it to work anyway
@primo I was told to read about "prototypes"
 
I vaguely understand how they work now but I don't think I'll ever be using them
 
not sure how that can distinguish
keys %h = 200;
from
keys %h;
i don't think it's the answer you're looking for
 
10:29:42 AM <Grinnz> that's because it's an lvalue
10:29:51 AM <Grinnz> nothing to do with prototypes
Now I'm more confused
 
i think Grinnz has got it right
 
Yep
 
5:36 PM
1
Q: The Written Digits Sequence

Jonathan AllanHere's a reasonably trivial sequence which is not in the Online Encyclopedia of Integer Sequences. Start with an empty sequence then define each term as the number of characters required to write out, in English, all of the digits of the sequence so far without spaces.* For reference the number...

 
 
1 hour later…
6:41 PM
hi all
 
6:52 PM
0
A: Sandbox for Proposed Challenges

Jonathan AllanSale! \$38\%\$ Off All Codegolf While Stocks Last! This is a restricted-sourcekolmogorov-complexitycode-golf challenge to produce a fixed output with no input. The output format, however, is flexible - it may be printed to standard out, printed to standard error, returned as a list of character...

 
Comments would be appreciated on this proposed challenge ^ :D
Time to travel home, maybe I'll see comments and/or votes once I get back (I think it seems to be in reasonable shape already, but just wanted to run it past a few people)
(thanks...)
 
Ugh, why can't npm, bower, etc., use the computer's certificate store rather than relying on their own?
 
 
3 hours later…
9:34 PM
0
Q: What Inning is it?

VeskahGoal In light of the World Series being around the corner, I need a program that can read the box scores and tell me what inning it is. This is complicated slightly because baseball uses an odd method to record the score. They don't write down the at-bat team's score for the inning until they've...

 
 
2 hours later…
11:46 PM
Does anyone know call/cc is, and if so could anyone explain it to me?
 
ngn
@arcfide ^
 
@ngn I don't think that ping will work
 
ngn
@dzaima why?
 
@ngn one has to have been in a room in the last week to be pingable, and @arc isn't showing anything
 
Anonymous
@LeakyNun call/cc is the way that you "return" from a function in Scheme (and related languages). Unlike direct style, where a function returns a value to an enclosing scope, continuation-passing style passes a function as an extra param, which is then invoked with the result of the function you're calling. It's kind of like using callbacks everywhere (like pre-Promise JS).
 

« first day (2823 days earlier)      last day (2014 days later) »