Be there, for the square
Sometimes when you're lying in bed and reading a message, your phone screen will pop into landscape mode right in the middle of a sentence. Only being able to read left to right, you find yourself incapacitated, unable to process the text in front of you.
To ensure that...
I have a stupid question y'all. My prof just breezed through an argument and I'm lost af
We're working in Haskell, and he said the code (1::Integer)+2*(3::Double) causes a type error, which can be revealed through trivial analysis of (+) or (*).`
Consider the expression (1 :: Integer) + 2 * (3 :: Double). This will cause a type error, because the two different type constraints are inconsistent. One bit of trickiness is that the inconsistency could be revealed either in the analysis of (+) or (*). Provide both analyses.
I suppose it's like this 1. Consider the (+). --> (1::Integer) must have the same type as (2*(3::Double)) --> 2*(3::Double) has the type Integer. (etc) 2. Consider the (*). --> (2*(3::Double)) must have the same type as (3::Double) --> 2*(3::Double) has the type Double. (etc)
Either way, I think it's simple, don't overthink it.
Unpopular Topic Time -- Is PPCG dying? 19th Byte seems to have intermittent chat rather than the near-constant stream it used to have. We're getting maybe one or two challenges per day rather than the 5/day we used to have. Prominent figures are leaving or have left without a word. Even the Sandbox seems to be more sluggish than usual.
The chat sure have seemed a lot more dead than usual recently. Answers to challenges seem to more in line with what it's usually been. Challenge frequence seem to have gone down some yeah, but in fairness, the more challenges we have the harder it is to come up new unique ones
I am a contributor to all 3 of these issues as well
From what I've seen, the nature of the challenges have changed greatly over the past few years. It seems like people want to post harder and harder challenges, and that people avoid posting to avoid having questions marked as duplicates.
As a user who only started recently actually using this site - it seems fairly active to me, in everything except maybe new questions posted, which can be attributed to reasons above. But answers are plentiful
Also regarding the chat: I had been visiting this site for over 6 months before I even heard about this chat. I'd say that it needs some advertising to attract new visitors, and maybe some examples of things that are on-topic for the chat?
I don't feel as if the difficulty of challenges have increased in any meaingful way. There is still a healthy mix there I feel, with a bias towards easier challenges since those are easier to write and tend to get more answers
@J.Sallé Of course, but you can always put a twist on it to make it unique enough. I posted this challenge, which was almost a duplicate of this one before I put a twist on it
I tend to agree with Emigna -- I don't think the difficulty ratio of hard to easy challenges has changed, I just think there are fewer challenges overall.
Writing a good challenge isn't easy. And making one that isn't a duplicate or close to one is not trivial with the amount of challenges we have in total
At least that's my impression. I know there are people here who make it seem easy
Another thing could be that people end up here because they like coding and golfing, not because they like creating challenges. I agree that it's much more work to create a challenge compared to coming up with a solution (especially since you can get inspiration from other answers). But it's up to all of us to post challenges, and to leave feedback in the sandbox.
I try to have one challenge in progress most of the time, but the sandbox doesn't get the attention that it needs most of the time.
Personally, I think we could start "reviving" select challenges (in a language-of-the-month fashion or some such thing). People could suggest old(er) challenges they find interesting with a low number of answers and bump them (maybe after some editing so the challenge is up to current standards).
@J.Sallé and another approach could be answers:..4 created:..60d closed:0 locked:0 (ignoring whether an answer has been accepted, as well as upping the bar to 4)
I'm really sorry for being super help vampirey this morning, but I've been so frustrated. I'm getting an indentation error in ghci (haskell) on the line allp ::...
module Divisibility where -- | This module is filled with functions aimed at finding divisble numbers.
-- | Return a sublist comprised of the elements of a list that satisfies a predicate.
filter :: (a -> Bool) -> [a] -> [a] filter p [] = [] filter p (x:xs) | p x = x : filter p xs | otherwise = filter p xs
-- | divisibleBy checks that one number evenly divides the other through mods.
divisibleBy :: Num a => a->a->Bool let divisibleBy d n = (n `mod` d == 0)
ASCII Schedule / Calendar
(title suggestions welcome)
code-golf date ascii-art
Given a list of activities and their start time/date, output an ASCII-art calendar showing the activities on the appropriate days. All activities are guaranteed to be in the same month, no two activities will be on ...
We've got some pretty great challenges here. However, after a month or so, challenges get little to no activity. Since we aren't a Q&A site, we rarely get traffic via searches. I would love it if we could introduce users to high quality questions that they may not have found on their own.
I b...
(I didn't end up getting enough challenges posted/voted on)
The reason I chose the one-time "Tour" method vs a "challenge of a month" or something is due to the duration required. We've had so many programs here on PPCG to promote making challenges/answers, and none of them have lasted a long time
but since my method involved editing the questions themselves, it would naturally lead to discovery as people came across these questions
Anyways, I'm not saying all of this to dissuade you, but rather to take into consideration how your method should work
Supreme Sum String
Given an input string, return the word with the highest sum of each of its unicode characters.
Rules
The input should be seperated by whitespace
The value of each word is based on the sum of each character in the word's UTF-16 code
The output should be the first word with ...
Length of a UTF-8 byte sequence
Determine the length of a UTF-8 byte sequence given its first byte. The following table shows which ranges map to each possible length:
Range Length
--------- ------
0x00-0x7F 1
0xC2-0xDF 2
0xE0-0xEF 3
0xF0-0xF4 4
Notes: 0x80-0xBF are continua...
Related.
Earlier today, AdmBorkBork posted this question on TNB, asking whether or not PPCG was dying. In the following discussion, I have suggested we, as a community, could start "reviving" (for lack of a better term) select challenges, based on suggestions given by us.
The reasoning behind i...
Related.
Earlier today, AdmBorkBork posted this question on TNB, asking whether or not PPCG was dying. In the following discussion, I have suggested we, as a community, could start "reviving" (for lack of a better term) select challenges, based on suggestions given by us.
The reasoning behind i...
Trust the community and add a standard loophole
I think the community can handle the add-a-builtin problem (I may be very wrong). I think that if someone adds a feature to their language that is clearly meant to only solve one particular challenge, the community will probably downvote that answe...
Welcome to the Winter Pools challenge!
Game
In this challenge, you have to write a Python script in which you compete with your opponent to drain pools.
There are three pools- yours, your opponent, and a neutral one. You take it in turns with your opponent to drain water from one pool and put ...
@AdmBorkBork I think previously a lot of the 'constant stream' used to be noise and as we cleaned up on that it's just that now we're seeing more signal over noise
quality over quantity kinda thing
@quartata looking at the code for spam detection (findspam.py) it seems to be pretty hardcoded for SE if I'm not mistaken?
Inspired by this Stack Overflow question.
The challenge
Input
An array of square matrices containing non-negative integers.
Output
A square matrix built from the input matrices as follows.
Let \$N \times N\$ be the size of each input matrix, and \$P\$ the number of input matrices.
For clar...
@Quintec we encourage intra-language competition, that is, competition among answers in the same "language", as defined by PPCG's rules; "cheating" with an external (non-built-in) library isn't going to work there
(and, well, it isn't really that fun)
also, your "reference interpreter" won't really work :-D
Intro
A friend posed this question today in a slightly different way - "Can a single [Python] command determine the largest of some integers AND that they aren't equal?".
While we didn't find a way to do this within reasonable definitions of "a single command", I thought it might be a fun probl...
SpamRam is SE's first line of defense against spam. The exact details of how it blocks spam aren't public knowledge, but IP blocking is a factor. Just by blocking IPs that have posted spam that got red-flagged, a lot of spam never makes it onto SE.