« first day (2329 days earlier)      last day (2497 days later) » 

5:12 PM
I have a really weird problem where my game in Processing/java is taking half a second or so to print a single frame, but when subtract the time at the beginning of my "do stuff each frame" loop from the time at the end, the most I get is 21 milliseconds or so, and even then it's rare - mostly 0 or 1
 
2
Q: Number of values between input and next highest square

Shayne03Given a positive square number as input. Output the number of values between the input and next highest square. Example Input: 1 Output: 2 Reason: The numbers 2 and 3 are between 1 and 4, the next highest square Input: 4 Output: 4 Reason: The numbers 5, 6, 7, 8 are between 4 and 9 Pleas...

 
@NewMainPosts >.>
 
> Plss
you just know it's going to be bad once you read the first word
 
1 message moved to Trash
 
it's a good puzzle actually though
 
5:16 PM
0
A: Sandbox for Proposed Challenges

GryphonAm I a special N-bonacci number? code-golf, fibonacci The N-bonacci sequence, originally invented by @DJMcMayhem in this question, is a sequence generated by starting with the integers 0 and 1, and then adding the previous N numbers to generate the next number. The special N-bonacci sequence is...

 
Haha, my name shows up in red in that sandbox post XD
 
Anyone here know about the PGraphics class in Processing?
 
Okx
@Downgoat just create a damn goat ok thanks
 
@LeakyNun Hahaha, I once had a dream that I went mountain climbing around the world, and for some strange reason I happened to run into El'endia Starman while I was up there. And somehow I could tell it was him, IDK
 
5:23 PM
@DJMcMayhem although you never met him?
 
Yeah.
I've never met any PPCG users.
 
@Downgoat correction: the "ow" was pronounced as /uː/, so your name would have been pronounced /duːngɔːt/ .
 
Although once a friend of mine found brain-flak (I never told him about it, and he never knew my username) and he realized it was me and asked me about it, then joined PPCG.
That was cool
 
@DJMcMayhem what is his handle?
 
5:25 PM
> Member for 19 days
 
Yeah, it was pretty recent
 
but his activity lasted for 3 days only
 
hmm do we have a "golf the english language" challenge?
 
Okx
NSP, DO YOUR THING:
oh it didn't work
 
How did I hit the rep cap on meta?!
 
5:35 PM
What did you post
@Okx Mate. The thing takes around 20 minutes
 
0
Q: PPCG-specific Mobile App: Feature Requests

Beta DecaySee main post here This [question] is intended as community submission describing the target functionality. This will likely change over time, but it will allow devs to have a end goal with their program. Obviously, this includes the standards (doing anything you would normally be able to do ...

 
Okx
it was meant to post something exactly after totallyhuman's message :(
 
@totallyhuman I could do with that rn. I've got a 5000 char long personal statement that I have to golf down to under 4000
 
How do you even get rep on meta?
 
5
Q: Create a checkerboard matrix

Stewie GriffinTake a positive integer n as input, and output a n-by-n checkerboard matrix consisting of 1 and 0. The top left digit should always be 1. Test cases: n = 1 1 n = 2 1 0 0 1 n = 3 1 0 1 0 1 0 1 0 1 n = 4 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 Input and output formats are optional. Outputting the ...

 
Okx
5:39 PM
@KritixiLithos It's equal to your main (non-meta) account rep
 
hi all
hi @ASCII-only
 
I am tempted to pose codegolf.stackexchange.com/questions/124424/… but for exact correlations
unless PPCG has a phobia of similar questions
which it might do
 
Quetiom: what do you think f(a as b: C) does to a and how do you think you would call this function?
 
I know that self-promotion is frowned upon in here, but this is the best brain-flak answer I have ever written
 
5:45 PM
;-; braingolf doesn't have floats
 
@Downgoat that's the function signature? Not knowing the language, I'd interpret it as either "f takes an a, casts it to b, and binds C to that" or as "f takes an argument named a to the caller, binds it to b in the scope of the function, and the argument has type C"
Presumably it's more useful if b is a destructuring expression or something.
 
oh gosh i can see deleted answers now... this is going to take getting used to
 
@Poke wut is dat grammar
brain explodes
 
It really isn't that hard to parse.
 
5:50 PM
There's just not capital letters or trailing punctuation.
@Poke TIL Dictionary.com could do that
 
TIL too
 
@LeakyNun "this is going to take getting used to" has mindblown me as well.
 
^ see my link above. it's a thing people say
 
English not your native language?
 
Yeah, it's a really common phrase here.
Sometimes it's "take some getting used to".
 
5:54 PM
∧ that's what I see more often
 
But it works either way, treating (getting used to) as a single compound that could probably be rendered as "adaptation" or "familiarization" without significantly changing the meaning.
 
0
A: Sandbox for Proposed Challenges

LembikCompute OEIS A005434 Consider a binary string S of length n. Indexing from 1, we can determine if S[1..i+1] matches S[n-i..n] exactly for all i in order from 0 to n-1. For example, S = 01010 gives [Y, N, Y, N, Y]. This is because 0 matches 0, 01 does not match 10, 010 matches 010, 0...

 
any comments gratefully received
 
user165474
6:11 PM
@Lembik I swear I've seem this challenge somewhere before... but I can't find it on main...
 
@HyperNeutrino not the linked question?
 
user165474
@Downgoat : Make the bytecount guesser in the PPCG Graduation Userscript account for commas. Currently, 1,356 bytes as a bytecount will make the userscript think it's 356 bytes.
 
user165474
@Lembik I'm apparently visually impared ಠ_ಠ yeah it was that one
 
user165474
Never mind, they're different. :P
 
@HyperNeutrino no problem and thanks for looking at it
 
6:13 PM
@ToxicFrog oh ok as is casting operator btw
 
user165474
@Lembik no problem. i'm just trying to determine if any answers can be trivially modified but I don't think so here
 
@HyperNeutrino I think they can
but they won't be optimal
 
@Downgoat Not really a fan of as operator.
 
@Phoenix like which part
 
The part where the operator is as and not something else.
 
6:16 PM
as is way better than the (type) var
 
@Downgoat so it's cast a to b, bind to C?
 
I'm not saying it should be (type) var
 
user165474
Hm. Yeah I personally think it would be different enough. I'd wait though for someone else to look at it because I don't necessarily have the best judgement :P
 
@Phoenix we might also do Type::var
 
I just think it should be some kind of arrow, like ->, or :>
@Downgoat That isn't bad either
 
6:17 PM
:: usually means scope resolution
 
@Phoenix for cast?
 
Yeah
 
@Downgoat this is better
 
@NathanMerrill Only in C(++)
:: is a good casting operator.
 
and all other languages that copy them
 
6:18 PM
Like what
 
Make type names compile-time functions so that Int(foo) evaluates to foo-as-Int or errors
 
don't fight against the trend unless there's a good reason to
 
(D probably)
 
@Phoenix I think ascii already has plans for those ops
 
I vote var as Int or Int(var)
I particularly like the latter because it looks like a constructor which is basically what casting is
 
6:19 PM
Name one popular language, other than C(++), that uses :: for namespaces.
 
We need 3-4 casts though: compile time cast, cast which returns null if fails, and dynamic (runtime) cast, (maybe even a runtime cast that is validated to never fail at compile time)
 
Java, does scope resolution for function references
 
@Phoenix Rust, apparently.
 
@Downgoat Runtime casts should be some kind of methods, like var.to<T>()
 
A cast that is known never to fail is not a runtime cast by definition.
 
6:20 PM
@Downgoat is the second cast a runtime cast?
 
@NathanMerrill java uses ., as does clojure.
 
And C#, C# uses . for namespaces
 
@ToxicFrog for namespaces. Java uses both . and :: for scope resolution, depending on the scope
 
~> is an operator that needs to exist for something. It's too fancy-looking not to.
 
6:22 PM
var~>Type anyone?
 
@Phoenix I'm pretty sure I've seen that in the wild but now I can't remember what language
Probably some library for Haskell or Scala
 
@NathanMerrill yeah
 
60
Q: Meaning of tilde-greater-than (~>) in version requirement?

AlexeyWhat's the meaning of ~> version requirement in gem specs? hanna-0.1.12 depends on [haml (~> 2.2.8)]

 
@Phoenix though VSL made a choice to not make any predefined variables or methods >_<
 
Ah
 
6:23 PM
0
Q: Are objects in Haskell valid if there is no input?

Wheat WizardWe allow both programs and functions. Some challenges, mostly kolmogorov-complexity challenges, do not require input. This means that for some challenges you can write a function that takes no input. In many languages this is rather straight forward. For example if a challenge asked you to out...

 
I was thinking ::, as?, as!, and as but idk if good idea
 
actually, why do you need different types of casts?
 
@Downgoat what about basic things like toString?
 
like, if you cast something to an integer as a runtime cast, you can still glean compile-time information from that
 
@Downgoat Can it not be anything with alphanumerics? Please?
 
6:25 PM
Things like Int::myDouble (compile-time), and let maybeWasDowncast: Goat? = myAnimal as? Goat (optional, returns nil if cast fails). then myAnimal as! Goat will bork if cannot be downcast. myAnimal as Thing will work for upcast and you have no fear of bork because compiler checks that it can always work
 
0
A: Sandbox for Proposed Challenges

GryphonAm I a Cullen Number? code-golf number math A Cullen Number is any number that is contained in the sequence generated using the formula C(n) = (n*2^n)+1. Your Task: Write a program or function that receives an input and outputs a truthy/falsy value based on whether the input is a Cullen Numb...

 
why would Int::myDouble be more safe than myAnimal as Goat
 
C++ question: Lets say I have a function void foo(int a) that has to take an int so that it can be stored in a std::map<int, std::function<void(int)>>, but it doesn't actually need the int. How can I signal to the compiler that I need to take 'a', but don't plan on using it so that I don't get warning C4100: 'a': unreferenced formal parameter?
 
is it true that C++ didn't support 64 bit ints before C++11?
 
Don't think so
 
6:27 PM
@DJMcMayhem You can delete the a.
 
@NathanMerrill I mean it's not overflow safe etc. but Int::myDouble will always be able to work. If I do myAnimal as Goat, myAnimal could be Dog in which there is no way of interpreting that as a Goat
 
what is "myDouble"?
a class that extends Int?
then casting it to myDouble isn't safe either
because you don't know that its a myDouble
 
@feersum So it won't produce that warning if I don't named the parameter?
 
myDouble isn't an object internally, it's just like a C Double
 
Right.
 
6:28 PM
@Lembik C99 formalized int64_t and uint64_t, and is usable from C++ as <cstdint>
I'm not sure when long long int was formalized in C++
But I'd be shocked if it was as late as C++11.
 
@ToxicFrog aha... so older versions of g++ might not have int64_t supported for C++?
 
Ah, that seems so obvious now
 
bah, this is why casting is a terrible term for "converting a type"
 
@feersum Thanks! :)
 
@ToxicFrog it would be interesting to find out when!
 
6:29 PM
@Lembik looks like you're right that long long int wasn't introduced until @C++11 en.cppreference.com/w/cpp/language/types
 
I'd vote that you keep the two terms and syntax different
because converting an int into a double is a completely different process than casting an int into a MyInt
 
@Lembik I'm not sure what happens if you #include <cstdint> and then declare a uint64_t in code that's going to be compiled by a pre-C++11 C++ compiler.
 
@ToxicFrog very interesting!
I'll ask SO :)
 
@Lembik looking at stdint.h, and boost cstdint.hpp, it looks like the answer is "depending on the exact header and compiler in use, you either get long int, you get a compile-time error because it tries to be long long int, or you get a compile-time error because uint64_t isn't defined"
At least on *nix, I have no idea if windows even has <stdint.h>
 
I wonder which g++ version add C++11 support
 
6:33 PM
gcc.gnu.org/projects/cxx-status.html probably has the answer
"long @long gcc 4.3"
(it didn't get support for C++11 all at once, so different features from it will show up in different gcc releases)
 
hmm ok
 
Follow up C++ question: Which looks better? void foo(int &) {...} or void foo(int&) {...}
 
Based on a quick skim of that page, it started getting C++11 support in 4.3 and finished in 4.8.1.
@DJMcMayhem I prefer the former, but long and bitter wars have been fought over this, to no resolution
Er
The latter
But I'm not always consistent about this in my own code.
 
is there an unsigned long long?
 
signed and unsigned can be applied independent of other modifiers, yes.
(this is what uint64_t turns into -- int64_t is signed long long)
en.cppreference.com/w/cpp/language/types -- scroll down to "Integer Types" and it has all the details.
It's shockingly readable for being part of the C++ standard.
 
6:38 PM
ah ok
@ToxicFrog do you think g++ supported int64_t and long long at the same time?
I find it hard to tell
 
@Lembik int64_t is just a typedef for long long int
So it depends on when <stdint.h> got added to glibc's headers
 
@ToxicFrog ok so both came in in g++ 4.3?
long long was added in 4.3
 
Question: is there a FAQ somewhere that digs into the details of the different types of puzzles/contests questions that PPCG allows/supports? You know, [code-golf] vs [popularity-contest] vs [fastest-code]?
 
@quartata do you know where the starting inventories are stored for each role? I can't find them
not in src/invent.c, and not in the <role>.des files
 
If not, do we need one? Best I've found is the descriptions on the TAGS page.
 
6:47 PM
@BradC That's actually a great idea! I'm not aware of one
 
@Lembik it looks like gcc 4.5 added a builtin <stdint.h> for platforms where libc doesn't have one, but that was in 2010; it showed up in various libc implementations long before
 
@ToxicFrog interesting.. so long long was first
 
@Lembik in gcc/g++ specifically, yes
But consider that, e.g., glibc added <stdint.h> in 1997
 
@ToxicFrog thanks!
 
i have just created my noisiest piece of noise: lambda n:n==1and[1]or[[1,0]*(n/2)+[1]*(n%2),[0,1]*(n/2)+[0]*(n%2)]*(n/2)
 
6:48 PM
@totallyhuman is this for the checkerboard quesiton?
 
@ToxicFrog oh so g++ had it long after glibc did?
 
is there a way to get Haskell's zip to pad the shorter list instead of chopping the longer one?
 
uh huh
 
(golfily)
 
@Lembik so, piecing together the different standards pages and changelogs
It looks like gcc got long long int support sometime <= 1988
 
6:49 PM
@DJMcMayhem I'm newer to the site, so am not particularly qualified to make one
 
i'm definitely missing something but...
 
glibc added <stdint.h> and thus int64_t in 1997, although there were probably pre-glibc implementations before that
C99 standardized <stdint.h>
 
@BradC I'd be willing to make one
 
g++ added long long int support in 2008, in version 4.3
And starting in 2010 with version 4.5, gcc and g++ started including a built in <stdint.h> for platforms that didn't have a conforming libc
 
perfect... thanks
 
0
A: Sandbox for Proposed Challenges

ChristianSolve an Anagram [code-golf], [permutation], [string] You will be given a string of lowercase ASCII letters. Using this dictionary file (link to be posted), your task is to solve the anagram. To solve an anagram, you must output all words or sets of words that can be formed using each letter fro...

 
@ToxicFrog I am writing some code that uses 64 bit integers and __builtin_ctz on them
and I want to release it
but I was worried that requiring c++11 might be too much
 
@DJMcMayhem Cool, thanks. If/when we have one, we should link it from the FAQ list in meta, and also perhaps from the top of the sandbox
 
@NewSandboxedPosts I'd love some feedback on that :)
 
@Christian Too bad he's a bot :(
 
6:55 PM
@Lembik aah
 
@ToxicFrog if it has more than 64 bits will it give the same answer?
for __builtin_ctz I mean
 
I lost rep today from a vote on my post and it said something like "User was removed"; what's that about?
I don't mean a downvote, I mean I lost rep that I previously got from an upvote
 
@DJMcMayhem That's about 5 more than I would have found, so probably a good start.
 
@Christian that happens when the user who gave you the upvote has his/her account deleted
 
6:59 PM
@BradC Yeah, I perused through every single tag on the site, haha
 
@Lembik I don't know anything at all about __builtin_ctz, sorry
 

« first day (2329 days earlier)      last day (2497 days later) »