« first day (2821 days earlier)      last day (2015 days later) » 

12:00 AM
Does anyone know which site and post spurred this Parent Meta post is talking about?
 
not sure about the post but a comment on the mother meta post linked here
(interpersonal skills)
 
@justkelly_ok Woof, yeah. I agree that's entirely inappropriate for SO. I just pushed a change to remove questions from that site from the Hot Network sidebar. I'll ping folks internally to review the site's content more closely as well.
 
12:15 AM
@dylnan Did they mention us at all
Since PPCG occupies so much of HNQ
 
The best sites for HNQ are the sites where any title can be feasible - PPCG, puzzling! xD
And worldbuolding
 
12:41 AM
0
Q: Javascript Code

SFOJavaScript inline code that prompts the user to enter a number, pass the number to an external JavaScript function and let the function calculate and display the factorial of the number entered by the user.

 
 
1 hour later…
1:41 AM
0
Q: Add All Permutations of a Number

MilkyWay90You have to make something that takes in one input from a default I/O method (as an integer), and prints out the sum of all the permutations of that number (not necessarily unique) For example: 10 would return 11 because 10 can have 2 permutations (10 and 01), and the sum of those two numbers w...

0
Q: Given a string, calculate the number of columns it corresponds to

K Split XIn Excel, the columns range from A-Z, AA,AB,AZ,BA,..,BZ and so on. They actually each stand for numbers, but rather are encoded as alphabet strings. In this challenge, you will be given a string of alphabets, and you must calculate the column it corresponds to. Some tests: 'A' returns 1 (me...

 
2:41 AM
0
Q: Implement the UNIX `cat` program using only `bash` built-ins

ruiefWe define the most basic form of the UNIX cat program: Copy data from stdin to stdout verbatim. Data means arbitrary 8-bit binary data. The challenge: Implement cat using only bash built-in commands. The program may fork, but may not cause any program to exec, other than bash. I've been writing...

 
 
3 hours later…
5:54 AM
Does anybody know about Python subclassing and inheritance?
 
Anonymous
@DLosc I know a fair bit
 
I'm trying to make a custom Fraction type. Can you tell me what I'm doing wrong with the __init__ method?
class Frac(fractions.Fraction):
    def __init__(self, numerator=0, denominator=1):
        super().__init__(self, numerator, denominator)
 
0
A: Sandbox for Proposed Challenges

MegoGenerate an RSA key pair Given a positive integer \$N >= 3\$, output an RSA key pair (both the private and the public key) whose key length is \$N\$ bits. The RSA key generation algorithm is as follows: Choose an \$N\$-bit semiprime \$n\$. Let the prime factors of \$n\$ be \$p\$ and \$q\$. Co...

 
I get TypeError: object.__init__() takes no arguments
Shouldn't it be calling fractions.Fraction.__init__()?
 
Anonymous
Is this 2 or 3?
 
5:57 AM
3
3.7 specifically
 
Anonymous
Ok
 
Anonymous
You shouldn't be passing self to super().__init__
 
Oh, hm.
Okay, still getting the same error.
 
All I want in life is the ability to define an inner function which is able to return from its outer function
I don't even care which language at this point
 
Anonymous
So it looks like it's being weird because Fraction uses __new__ and not __init__
 
6:04 AM
Ohh.
Hm.
 
Anonymous
So long as you don't pass any extra args to the ctor, you don't need to call the superclass ctor
 
Anonymous
 
Yeah. Not sure exactly how I'm going to proceed because I want to be able to do Frac(1, 0) and get 1/0 (or maybe inf) as the result. I think I may have to write a __new__ method for my subclass, because otherwise fractions.Fraction.__new__ is going to raise a ZeroDivisionError and give me no opportunity to catch it.
 
Anonymous
Yeah that's gonna be rough
 
Thanks, though--that was a good catch and puts me on the right track.
 
Anonymous
6:09 AM
You might be better off writing a new fraction class from scratch
 
That's what I was originally going to do... then I thought I could piggyback off of a lot of Fraction's functionality by inheriting from it. On the other hand, now that I think of it, pretty much every function and operator is going to have to handle the 0-denominator case separately, so you're probably right.
Thanks again!
 
Anonymous
Welcome!
 
(Shameless plug: this is for a new language I'm working on called Spearmint. It's functional, concatenative, and is eventually going to be compilable into a [hopefully] competitive golfing language. And it will have rational numbers, as soon as I figure out the best way to program that.)
 
 
1 hour later…
7:27 AM
How it is annoying in Python, how often do I override built-in names by accident. I did this today: async for type, id, object in h.reply(msg) - every var is a built-in...
I can't understand how could someone seriously name a global built-in id, that's one of most common var names I would use.
 
 
2 hours later…
9:08 AM
@SpookClover Yeah. I have often done this with list (till I trained myself to use ls instead). Having an editor with syntax highlighting helps a LOT.
 
9:49 AM
@DJMcSpookem Took me a while to get to 20 bytes in Pip: Y#a-2PaLyPaRA1,vsXya. There may be a shorter way.
 
0
A: Sandbox for Proposed Challenges

u_ndefinedMinimum 1's to get 1-expression for n code-golf number Background Challenge is inspired by this question. The 1-expression is a formula that in which you add and multiply the number 1 any number of times. Parenthesis is allowed, but concatenating 1's (e.g. 11) is not allowed. Here is an exam...

 
10:23 AM
@Adám If I can take the array as its string representation, here's a regex-based answer in 38 bytes of Pip: aRx:`(\d+,)*\d+`_.",0"XMX(aMRxY',N_)-y. I'm not sure, but I think this may be shorter than any actual array-based solution. :P
 
10:39 AM
Ooh, actually, I have a function submission (takes an array, returns an array) that's also 38 bytes and is quite elegant: {Y{a>0?#gMX:fMUg}Va{a>0?g+^0XyfMUg}Va}. It uses language features, like recursion and the binary version of eval, that I rarely get to use in golf. Fun!
Wait, no, I misread the spec. Shoot. The actual CMC is harder than what I solved. :(
 
 
4 hours later…
2:32 PM
I can’t do this neatly
there is a test case that is just 60000+ question marks
oh
ofcourse
if there are 9+ question marks there’s no restriction anymore
no, that’s wrong
 
3:17 PM
In your opinion is it possible a server that "translate names to ip numbers " or it would be a name server be hacked .
Is it possible the page of Google or Bing is seen but the ip address is not by Google .???
Or Bing???
I was thinking on that when I insert the password on one site mail; if someone replicate login page would have my password too
 
 
2 hours later…
BMO
5:04 PM
@RosLuP Sure, someone could spoof the DNS server you're trying to reach.
This can also be used for good purposes, one of them would be so called dns-blackholing which can be used to prevent malware/ads/tracking/...
 
 
1 hour later…
6:18 PM
-2
Q: I am trying to code the Abelian Sandpile. I dont know why this code in't running well

Ajiimport numpy as np x = np.random.randint(0,7,(3,3)) #while any(element >= 4 for element in np.nditer(x)): while ([[x[i,j]>=4 for i in range(x.shape[0])] for j in range(x.shape[1])]): #if x[i,j] >= 4: if i > 0: x[i - 1, j] += 1 if j > 0: x[i, j - 1] += 1 if i < 2: x[i + 1, j] += 1 ...

 
7:12 PM
@EriktheOutgolfer APL (Dyalog Unicode), 10 bytes ⊢≡(=/¨⍳∘⍴)
 
7:25 PM
@Adám already outgolfed. Feels like a shorter solution should be possible but from the half hour I spent on that I didn't find anything
 
@dzaima I saw that, but figured you'd be interesting in a novel (?) approach.
@dzaima Oh, silly me, it isn't outgolfed: ⊢≡=/¨∘⍳∘⍴
Sometimes I think ⍳⍴ should be its own primitive.
 
@Adám there are way too many things that I feel like should be primitives
 
@dzaima Part of the beauty of APL is that all possible problems can be reduced to so few primitives.
 
7:50 PM
@Adám I've thought that a few times as well ...
 
 
1 hour later…
9:10 PM
@dzaima the idioms, for example, eh?
and yeah, monadic ⍳∘⍴ as its own primitive wouldn't be a golfing thing, but a real typing saver
 
9:23 PM
0
A: Sandbox for Proposed Challenges

flawrNot All Sums Are Equal code-golfmathnumerical-analysissum Introduction When computing the sum of a list of floating pont values, the order in which we add up the summands matters. A good way to reduce errors, is beginning with the summand with the least modulus and working your way up to the n...

 

« first day (2821 days earlier)      last day (2015 days later) »