« first day (2540 days earlier)      last day (2467 days later) » 

3:00 PM
(closer to 2s)
on TIO it's 0.7s
TIO is really fast
actually the amount of time it takes is really fluctuating a lot (because server load and stuff)
2e6 -> 3287488864020
0.096874 (not counting compile time, c++)
2e6 -> 246466969796...?
my solutions are getting a different answer from yours D:
i'd check with my friend's but it's not fast enough for that large of an input size
Jelly is not fast enough for 2e6 either :(
3:07 PM
well it's jelly
... I don't see what you're implying :P Not like it is interpreted in Python, which is compiled to C then interpreted, which is then translated into Assembly :P
Jelly is not the fastest language out there :P
shhh don't summon Dennis
3:09 PM
No, it's the algorithm that is not fast enough.
yeah that also
Sorry wrong algorithm :\
@Rod Ha... haha :)
246466969796
0.078493
(2e6)
3:10 PM
Same answer now.
I get 0.244-ish
Rod
Rod
in C or python?
c++
in python it takes ~0.425
Rod
Rod
"sys. time"?
n = 10000000 ~= 1e+07
ans = 5495501355063
time (s) = 0.496323
[Finished in 2.6s]
3:12 PM
time.time
run:
n = 100000000 ~= 1e+08
ans = 476028425259175
time (s) = 5.99075
[Finished in 10.2s]
I use timeit.timeit usually
mine runs 1e7 in 1.4s (C++)
I won \o/
3:13 PM
BTW never put :\ in C++ code, especially at the end of a line comment.
1e8 takes 15.8s
wait what
mine is faster for 1e7 but slower for 1e6 and 1e8
The first time is run time, second time is compile time.
o
gj that's fast :D
can you send code
i want to see how you did it. i'll send my soln too
[if you want]
run:
n = 100000000 ~= 1e+08
ans = 476028425259175
time (s) = 3.7157
[Finished in 6.2s]
(improved)
1e8 times out on TIO for my python solution :p
hm so my python solution is faster than yours but your c++ solution is faster than mine
makes sense i guess?
3:16 PM
My Python solution have a worse algorithm.
code
https://tio.run/##hVHBbhoxED2vv2JED3hLI5qeKrzLBeXUalOFY4mQ4zXBxHiQ11sSIfLrZOylAXLJYS37zZv3Zt6qzebqUanD4Ytxyra1hkJ6L1/G7AT80yqgP0cMNsFruT7H1NKjwzFjxgVQ6JqgnzceKijhWv8UrAn1aNRJFQ@Idgy1DBJ4NbjOBRsOIRGSeap/A6ocSSXsdgtpG73fi85gLY3jOexYRp3b5QvUqBvXDxCWGhZoLW6NewRrnIYt@icYzViWHBS2AYoCetMgfQDfOkfMmeuJjwRHvr14q9ITXo9PXmP7YHWe4P7M9d87LaqneaBNonIJJ5DTipnFOFE8pGuo/J2wuIsRNLEHbgj7IcDAV/qKEioBg4FJS2ZmQbYUxV9zn8d0g3GtFkDLK1xvsDFBE6uTIckVSSUdQddOagUDwnJiZUlodU@c4EmFoDgQlXkFQ@JQI38fNjdE2LNOW1xOdjkYlLRTMvhM7jLnLo0UbbweQyXxWAxmrYE3@X8Gy7r0@Xm4cNVlnpPf5Pft5Nd0/ufmbj69mZx@0Z4dDm8
(I didn't implement segmented sieve)
Awww, did I miss the first podcast?
Yes...
Yeah :/ Me too
3:19 PM
I think the speakers were Americans, which inconvenience all of us in Europe :P
doesn't putting \ at the end of a line cause the next line to be a part of the current line (line continuation)?
Yeah I know, just a joke
@HyperNeutrino are you building a chatbot?
What's the stuff in the Sandbox then?
3:20 PM
that was me talking to myself that's an old chatbot; I booted it up to try to get the TIO query thing working
ಠ_ಠ I just found new HTML I have to parse for JHTBot
o lol rip
What is JHTBot? Why is it useful?
2
Q: Finding Lonely Primes

OkxLonely primes (as I call them) are primes, where given a number grid with width w ≥ 3, are primes which do not have any other primes adjacent to them orthogonally or diagonally. For example, if we take this grid where w = 12 (primes highlighted in bold): 1 2 3 4 5 6 7 8 9 10 ...

@user202729 It's basically aimed to be a learning resource for JHT
3:24 PM
But we already have resources page and everything...
¯\_(ツ)_/¯ It's got a lot of features. You can just ping it in the Sandbox with @JHTBot help and it'll respond
lol I tried making my c++ solution faster and now it segfaults for 1e8
@HyperNeutrino Is my code really faster than yours, or is it my computer?
probably faster; I'm using TIO for runtime so idk
TIO is not TimeItOnline...
3:30 PM
yeah
your computer might be faster than Dennis's TIO server computer; idk
what if you try running this on your computer

https://tio.run/##jZFBboMwEEXX@BRTVaogNAG6NeEEUXddVaiyjEMHgUGxiRRFnJ2OTdJUbRdBYOzH/39GgxyGdS3lPD@ilu1YKcixN/agRFewGzMnk1js1OazYGw0qGvQolNmEFKBsRVnDLWFTqAOIzizwJ00Z4FEDUXht5Q6Sgsu5ihasIZYraw79/tKnMIna57h9W23i@hL21MNlyK0gS2kfMmshBXvGmLISjin04Uih31/gBBJ@cIBYUVPvqWygHHsGwpwD@GDt2O5kGDxkL8hnzdx2i6@BmJiF2HgfU1Jsow7MLnFdUaiUEPilCsIfdNuiSiKeRndvgy/q6N7I2U/WshzPxx6KV21/0xY/Z2wuk34mmHVxh4/jJJULkvTlIa7oNGxZGFr@l@/ZFf0U/bdyzTPDtD1BQ

if you trust me to not break your computer, of course :P
runs 1e6 in around 30-40 ms
Woo, Dyalog license approved. Only took a week.
1e6 segfaults
Doesn't segfault for me
using namespace std; :\
3:33 PM
why does vector<int> not segfault but int[] does?
Stack overflow
(I meant, int[] allocates memory on stack)
@user202729 Dennis specifically insists people not using TIO for timing.
3:34 PM
@Pavel only in fastest-code...
(or restricted-time)
Has anyone made a quantum programming language? I don't mean a language for programming quantum computers, I mean a language in which control flow can go multiple directions at once and then have the various results "interfere" with each other. Things like print statements would cause collapse of the program's "waveform."
@HyperNeutrino I switched to vector...
ಠ_ಠ using namespace std;
1000000
561892644
147
@Mr.Xcoder I said it before.
Oh seems like I am blind
3:35 PM
what's wrong with that ಠ_ಠ
what is this
See stack overflow
if I don't use it, then my IRL friends yell at me
if I do use it, then my internet friends (citation-needed) yell at me
1785
Q: Why is "using namespace std" considered bad practice?

akbiggsI've been told by others that writing using namespace std in code is wrong, and that I should use std::cout and std::cin directly instead. Why is using namespace std considered a bad practice? Is it inefficient or risk declaring ambiguous variables (variables that share the same name as a functi...

guess I should listen to you guys then :p
@PhiNotPi I've seen one before but I can't recall it's name or much about it
3:36 PM
Everyone I know IRL use namespace std...
Then you need to remember not to declare next global variable, and so on...
The y1 is particularly dangerous.
(although this one is special - it may be in global namespace without using namespace std)
@user202729 Same :(
@PhiNotPi Cardinal allows simultaneous execution of codes along the IPs IIRC
Not sure if that counts
My algorithm on Windows:
n = 1000000 ~= 1e+006
ans = 64986402084
time (s) = 0.157
(slower?)
0
A: Sandbox for Proposed Challenges

J. SalléSolve the Square-Sum problem Based on these (very good) Numberphile videos: The Square-Sum problem and its extra footage. The Problem: Given a list of integer numbers [1,n] where n≥15; n≠18, 19, 20, 21, 22, 24, your task is to arrange those numbers in a way such that the sum of two consecutiv...

BTW... do you know _GLIBCXX_DEBUG? Do you think that's useful?
3:46 PM
eww, this code has not one but two errors: dxr.mozilla.org/comm-central/source/mailnews/base/src/…
why not m_levels[i]--;
@RegexUsers Is there a way to replace matches in a string with the result of another regex? Something like this?
what exactly is it that you want to do?
If it matched amp, replace that with an & symbol, otherwise replace with a @ symbol
@HyperNeutrino that's not a big fault given the two blatant errors
3:51 PM
ok :p
the worst bit is that I actually read this when it was originally checked in
@cairdcoinheringaahing oh so you want to replace &amp; with & and &zwnj; with @?
what language are you using?
just use import html; html.unescape
3:52 PM
lollll
zwnj is a zero-width ? ? ?
ok
anyway gtg o/
how many zero-widths are there? can they be used to make a bf derivative?
zero-width non-joiner
is zero-width
@Neil Good luck with that. There are only 3:
> U+200B ZERO WIDTH SPACE (U+200B) ​ arial_unicode_ms
U+200C ZERO WIDTH NON-JOINER (U+200C) ‌ arial_unicode_ms
U+200D ZERO WIDTH JOINER (U+200D) ‍ arial_unicode_ms
3:56 PM
plenty enough for a whitespace derivative
esolangs.org/wiki/Ook! uses three unique tokens, so it can be transcribed directly into zwfk
...
so just make a programming language where the code is always zero pixels wide
@Neil Zero-width fuck?
that's a Brainfuck derivative. Brainfuck sucks.
Uh... So... in that case... you need at least 3 substitution.
(for the general case)
3:58 PM
@user202729 not if you transliterate into Ook! (3 tokens)
1. $ -> ~~~&amp;&&zwnb;@
@HyperNeutrino ಠ_ಠ It doesn't remove HTML tags
lol well of course not it just unescapes HTML escape codes
you have to remove tags yourself
or should I call it &zwbf; ?
3:59 PM
2. (&amp;|zwnb;)(.*~~~.*\1)(.) -> \3\2\3 (replace all)
3. ~~~.* ->
(hopefully correct)
2
A: Greeting The User

bioweaselVim, 38 Bytes i)^[8a-*^[r(9hR^_^^[Yo| Welcome User! |^[p Shoutout to the homies in the comments Original: i)-\*^[vhyl2pa^_^\*-^[vhyl2pa(^[Vyo| Welcome User! |^[p Where ^[ is the ESC key

(I read some of Martin's post about regex on SO)
@totallyhuman What about it?
sigh ok then
onlypost containing homies on ppcg
4:01 PM
alternatively, I could recode Whitespace to use zero-width white space
oh dear
nonononono abort mission
please don't make a zero width language >:|
That's what we've been talking about for the past 10 minutes :P
yes i've read
CMC: using bash on TIO, make a file in the cwd with the content: lol
@totallyhuman Bash, 3 bytes: lol File is named bash.tio.
...dang it
to be fair you can't check the output later
also it's .code.tio i think
4:19 PM
cwd = current working directory?
I think the shortest is echo lol>a other than Neil's idea
doesn't work on tio for some reason
yes it does
o.O
or it does
nvm
doesn't work in my fancy jelly bash shell
that's the issue >_>
Q: What is the multicharacter equivalent of [^] in Python regex? I.e. match anything except the argument
misunderstood nvm
4:23 PM
isn't it still [^...]
No. [^abc] wouldn't match bca, but the anything except would
i'm confused
oh i get what you want. hm..
Let's say that (%string) matches anything except string. It would match foobar, foobarbaz and hello, but not string, substring or stringend
4:27 PM
ah
(?!abc) i think
hmm i wonder what tio would look like with unifont
It should match the testing2
I see why they say you shouldn't use regex to parse HTML
you're not even at the hard part
lol
^_^
@Poke I'm not very good at regex :P
4:30 PM
it's when you have stupid stuff like <div>a<div>b</div>c</div>
a href="([^"]+)"[^>]*>(.*?)</a>
do that if you have to
@totallyhuman I decided to go with this, as < becomes &lt;
;-; is unifont not a font i can import
;-; that's why I don't use regex unless absolutely necessary
Regex is great. When you understand it. :P
4:33 PM
regex is a necessary evil
I'll put a /s in there for you
and that's the best way to put it :P
@Mr.Xcoder How? By using regex :P
I feel trolled /s
s/$/ \/s/
4:35 PM
(?!.*string)?
@totallyhuman s/s\/\$\/ \\\/s\//s\/\$\/ \\\/s\/g/g :P
wtaf
i'm not going to try and parse that
It's a more complicated version of s/$/g/g
CMP: AWSD or ⟵↑↓⟶?
4:39 PM
@Mr.Xcoder AWSD
I wonder if html.replace('<a href="([^"]+)"[^>]*>([^<]+)</a>', '[{}]({})') actually does anything in BrainFlak. It looks like it should.
Hi, I'm trying to first time post an answer to a question using C# but I'm a little unsure. Does anyone have a second to explain what I need to include in my answer? I tried reading around and finding examples, but I'm still a little unsure.
language, byte count and code
a trifecta shall suffice
Do I need to put the entire C# program in?
Welcome to the site! You need to include your language, your code and your byte count (assuming it's a code golf questions)
@CJ1992 What's the challenge you're going to answer?
4:42 PM
@CJ1992 is your submission a function or a program?
It's a program, It might not even be correct if I'm honest (It does it, but it's not exactly very golfy, and quite close to the example. :/ ). It's my first time trying to submit so it could very well just be wrong. Let me get the question back up.
@cairdcoinheringaahing How about regexr.com/3j57u
It was about comparing integers that were input as strings.
18
Q: Compare two numbers given as strings

CharlieI have a problem at work. I need to compare two numbers that come as strings from two different databases. The numbers may come with leading zeroes and/or leading/trailing spaces. So I may have "0001 " from one database and " 1 " from the other one. I solved the problem in C# with the following...

this one
alright
what does your program look like?
4:46 PM
@cairdcoinheringaahing You just have the worst luck when it comes to being ninja'd. :-(
@AdmBorkBork Yep. I was trying not to onebox though :P
@totallyhuman rextester.com/live/SLZ29995 At the moment it has some test numbers in it
I also broke it somehow :)
so the meat of the code is fine
Okay that's good news at least
just a couple things: input cannot be taken from a variable, you can either make it a function taking two arguments or a program reading from STDIN (or command line args)
4:49 PM
Okay
fixing that would make your code a valid submission
So, if I understand I count all of it? Even namespace etc
@CJ1992 This may help
@cairdcoinheringaahing ninja'd me :(
Yes! I ninja;d someone :P
4:51 PM
Thanks, I found the one for tips in C# but didn't think about finding a beginners guide :)
@cairdcoinheringaahing I can't tell what you mean by that
ಠ_ಠ It really does summon you, doesn't it? It's not a joke, right?
well DJ (sorry) counts as a ping so i don't see why not
@cairdcoinheringaahing Did you see my regex? Does it do what you want?
Okay well I'm going to head off home and then work on this code a bit more. Thank you for your help!
4:57 PM
@AdmBorkBork Oh yeah, forgot to reply, sorry. Yes, it does work. Thanks!
Woo! I made a regex do a thing!
@CJ1992 No problem! Hope you decide to continue to golf!
This is a momentous occasion for me.
^(?!.*string).+$ also works, of course
Mine's golfier. :p
4:59 PM
actually mine is for single-line strings, because I can safely remove the $
Mine's not actually golfier, I just wanted to say so.
@AdmBorkBork Don;t try to beat Neil at regex, he knows Retina :P
mine might be golfier for multiline strings too, but I hadn't made the effort to check
When you get a URL the wrong way round: [https://example.com](testing<) ಠ_ಠ
wait... do we have a deltas challenge?
5:08 PM
Increments, deltas and ... What's the third synonym?
@totallyhuman Somewhere, but it may be an old one
differences?
@cairdcoinheringaahing Incremential differences?
@Mr.Xcoder Yeah, totallyhuman got it (differences)
@totallyhuman I think, if someone posted it, the question would be what challenge to close it as a dupe of. We have a lot of challenges which require taking the differences, the doing something to that array
5:53 PM
@Mr.Xcoder hjkl
 
1 hour later…
7:02 PM
0
Q: Integer triangles with perimeter less than n

Peter KageyDefinition An "integer triangle" is one with integer coordinates. For example the following triangle is an integer triangle: (0, 0), (0, 1), (1, 2) with perimeter 1 + sqrt(2) + sqrt(5) ≈ 4.650. Task The goal of this challenge is to count all integer triangles (up to congruence) with perimete...

7:24 PM
> Joerg Arndt: Why such a contorted formula for this trivial sequence?
@Adám :( ^
8:05 PM
tfw code review has mathjax
what
i demand a refund
@totallyhuman We deliberately disabled ours, so that may be why :P
this is ridiculous
on my
idk what
we need mathjax back now
@cairdcoinheringaahing that was when it was slightly buggy
request to re-vote on mathjax
i'm sure if we brought it up again, the vote would be in favour
Just create a new meta post
...i don't really have a good history with meta posts
it is allowed to get a new vote on an old issue though
Downvotes only mean people disagree with the post
@JonathanAllan Husk is another language, nothing to do with Jelly, you can calm down :)
8:11 PM
ಠ_ಠ SE changed chat and broke JHTBot
what
they actually modified chat.SE code??
Yep, changed the way that we log in (no external, observable changes though)
also i'm writing a meta post 'cause screw it
they should make a Sandbox for Meta Posts
haha
sandbox for everything!
even blog posts!
8:14 PM
That's like each site having a Sandbox before you post a question. We have a Sandbox as our challenges can require work before posting, normal questions don't
Sorry to be the buzzkill :/
i had an implicit \s anyways :P
\s? Don't you mean /s?
sandbox for sandbox posts
i like using \s 'cause i'm escaping from the non-sarcastic situation
> Viewing this information about users with over 80,000 reputation requires a Stack Overflow Gold Account. Please log in to your gold account or join us.
ಠ_ಠ SO users have no imagination
8:19 PM
anybody wanna draft an example of an expression that looks ridiculously better with mathjax?
@cairdcoinheringaahing What..?
@totallyhuman Integrate[x^2, {x, 3, 5}]
@Mego who removed Doorknob from the speakers? (referring to the podcast)
something with square roots, exponents, sum, etc...
@Pavel didn't ask for mathematica code :P
@totallyhuman Go over to Math.SE for about 10 minutes, that should be enough :P
8:21 PM
true
@totallyhuman Definite integral of x squared by dx from 3 to 5
Haha. Some SE employees really do have a sense of humour :P
actually... i should probably find an actual expression from a ppcg question
or answer
2
Q: 3D ASCII Block Building

James HoldernessChallenge Write a program that takes an 11x11 array of integers, and constructs a 3D ASCII block building, where each value in the array represents the height of a column of blocks at the coordinates matching the array position. A negative height is a "floating" column - only the top block is vi...

@NewMainPosts Prediction: Charcoal will smash everyone else
8:24 PM
if it has ASCII in the title then almost always yes :P
agh i looked up latex and i found latex submissions
How about mathjax?
ohhh
93
A: Calculate the number of primes up to n

DennisC, 0.026119s (Mar 12 2016) #include <math.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #define cache_size 16384 #define Phi_prec_max (47 * a) #define bit(k) (1ULL << ((k) & 63)) #define word(k) sieve[(k) >> 6] #define sbit(k) ((word(k >> 1) >

Just look for a Dennis answer :P
Φ(y, c) = Φ(⌊y / mc⌋ mc, c) + Φ(y % mc, c) = ⌊y / mc⌋ φ(mc) + Φ(y % mc, c)
8:28 PM
@EriktheOutgolfer I personally believe golfing languages do compete amongst each other on some level, even if it is not the golden-rule that they do.
I see why Dennis is our supreme memelord highest rep user. Some of his posts are just astoundingly good that it's close to impossible to not upvote.
18
A: How many steps does it take from n to 1 by subtracting the greatest divisor?

DennisJelly, 9 bytes ÆṪÐĿÆFL€S Try it online! or verify all test cases. Background The definition of sequence A064097 implies that By Euler's product formula where φ denotes Euler's totient function and p varies only over prime numbers. Combining both, we deduce the property where ω den...

already uses latex though
but imagine it without latex o0
@totallyhuman Uses pictures, rather than latex
pictures of latex :P
eh i'll do example in an answer maybe
@totallyhuman Use the fastest code example
8:32 PM
no i'll let an answerer come up with one
@JonathanAllan thanks for reminding me to do it in Husk :P
(yeah, that map list of functions over the same argument builtin might be useful...)
@EriktheOutgolfer Useful for Jelly or Husk? Cause Jelly already has that
Jelly doesn't exactly have that, more like repeating the argument a number of times and then applying the same number of functions with the tie and each quicks
posting...
waiting half an hour for NMP to wake up...
8:43 PM
> Given n and m, where n is the number of bananas and m is the number of angry beavers, calculate the list of angry bananas b.
2017 — 2018 RIP JHTBot
@totallyhuman posting what?
read up
I did, I don't quite understand the context
46 mins ago, by totallyhuman
we need mathjax back now
45 mins ago, by totallyhuman
request to re-vote on mathjax
MathJax is old and slow.
> Please vote on the answers with approaches, not on the question based on your opinion on Mathjax.
Written by someone who's been downvoted on Meta, clearly :P
KaTeX is more compatible and faster: khan.github.io/KaTeX
@mınxomaτ Yeah, these days I'd much rather use Katex
Lol Ninja'd
But unfortunately that's SE's choice
8:55 PM
@mınxomaτ that requires SE dev intervention though :(
@cairdcoinheringaahing :P
Haha, the KaTeX page uses SE posts as an example :P
@Cyoce All Java class files are headed with 0xCAFEBABE. — Addison Crump Feb 27 '16 at 19:44
@totallyhuman As well it should. MathJax really needs to be deprecated.
post so on meta.SE then lol
I definitely agree. Made a dummy website just to see how to use Katex instead.
8:56 PM
where art thou @NewMetaPosts
Still brewing their coffee :P

« first day (2540 days earlier)      last day (2467 days later) »