« first day (4481 days earlier)      last day (661 days later) » 

00:45
Is there a modern C++ variant of Steve Oualline's How Not To Program In C++?
I didn't know that was a thing that people needed help with :b
Y'know, I need to reinforce my modern C++ skills.
01:34
I got an idea for an alternate implementation for nullptr: Let the pointer point to itself.
That way, we can save the byte at address zero.
that would only work for smart-pointer objects that actually have a set address :P
versus raw pointers that you can copy around willy-nilly
That shouldn't be a big problem.
After all, C++ discourages raw pointers.
and you would very much not want to check if they're self-referential every time you copy one--especially since you might want to use a self-pointer in other circumstances anyways
also it lets you just fault if you try dereferencing it
@DannyuNDos if you're working on a system with little enough memory and memory virtualization and such that saving the byte at address 0 matters, you're going to want to write bare metal :P
Well – nullptr was a million-dollar mistake anyway.
Null safe type system go brr
01:42
^
the existence of null pointers isn't the mistake, it's cramming it into an oo type system
Not necessarily
imo kotlin has the perfect null safe type system, but it also has oo
Believe me, I'm writing an interpreter for my new programming language in C++, and its smart pointer inherits a std::map!
It's to check what containers use the pointer.
Freakin' ->*, I've never known I'd have to overload you!
no that's exactly what i was saying, hoare's billion dollar mistake was making every reference type nullable
which is what kotlin doesn't
02:50
Ah
 
1 hour later…
04:06
Anyone remember this numeral system I made?
I actually tried to perform addition, subtraction, and multiplication, and it turns out the worst-case complexity is super-exponential. Dang.
Guess too much compression led to that.
what do basic operations on the trees correspond to numerically
04:09
(Whole tree) = 2 ^ (Left tree) * (1 + 2 * (Right tree))
Recursively.
Hard to explain arithmetics.
ahh
so in a sense it's floating point without any underlying fixed point representation :P
That's a way to put it.
Wait, it's subtraction that sucks; addition and multiplication are still fast.
ah lol
yeah that makes sense
Wait, addition relies on subtraction. Now it's back to doom. :p
The fault of performing 10000000 - 1. That's where it gets super-exponential.
05:14
0
Q: How to divide the columns in a time series by their first value in R?

Ray TayekI have the code below working. But there must be a better way. file <- "http://s3.amazonaws.com/assets.datacamp.com/production/course_1127/datasets/tmp_file.csv" x <- read.csv(file = file) ts <- xts(x = x, order.by = as.Date(rownames(x), "%m/%d/%Y")) cd=coredata(ts) for (j in 1:length(names(ts))...

0
A: Sandbox for Proposed Challenges

Dannyu NDosSpell date in Japanese Objective Given a date, spell it out in Romanized Japanese. I/O Format The input format is MM/DD. The output format is <month spelling> <day spelling>; note the space. Otherwise flexible. You can freely mix cases in output. Mapping Months Month Spelling January Ichi...

@NewPosts Why can’t I flag this as off-topic?
okay I think I found it but the flag menu is unnecessarily difficult to navigate on mobile. If I select “belongs on another site” my only option is CGCC meta, I can’t say SO
that's why we have a "this is a so question" close reason instead :P
ah I missed that, thanks
@UnrelatedString vtc is a 3k privilege though
05:24
oh
lmao
There is no so question flag :p
You're best off mod flagging as needs moving
I was able to flag it as that despite not having 3k on any individual site
(I do have 3k total, but)
We need more challenges.
agreed
they're hard to do right but there's a lot to do there
And I need to post a challenge someday.
That said... Has there been any cops-and-robbers that involves a third party?
05:33
@Bbrk24 must be a flag that disappears once you can vtc
@DannyuNDos not strictly a natlang but I’m proud of my lojban consonant cluster TS type answer
1
A: Is it a valid consonant cluster in Lojban?

Bbrk24TypeScript Compiler, 427 bytes type R="l"|"r"|"m"|"n" type U="p"|"t"|"k"|"f"|"c"|"s"|"x" type V="b"|"d"|"g"|"v"|"j"|"z" type S="c"|"s"|"j"|"z" type G<T,W>=T extends W?0:T extends R?1:T extends U?W extends V?0:1:W extends U?0:1 type H<T,W>=T extends"x"?W extends"k"|"c"?0:G<T,W>:T extends"k"|"c"?W ...

If there really was a cops-and-robbers-and-<third party>, how should we call such challenge?
Rock-Paper-Scissors? Terran-Zerg-Protoss? Idk
How would it work?
@Bbrk24 Rock submissions sabotage Scissors submission, and so on.
That's a crude idea anyway
ooh
hard to think of an actual challenge for but it's a cool concept
05:41
I'd be better to be posted as a KoTH where submissions choose teams, though.
06:06
*It'd
06:37
Guess PLDI would have a hard time.
@UnrelatedString what type would a self-pointer be?
in this case i was thinking possibly something like a linked list struct where the next pointer is the first member
so it doesn't exactly point to itself-as-an-object, but it does point to its own address numerically
I was thinking something like this: T *p; p = reinterpret_cast<T*>(&p);
yeah casts work too :P
 
2 hours later…
08:40
CMC: given a positive even number n, output the descending odd numbers n-1...1 and the even numbers 2...n as a single list
09:01
N¹¡Þ for 4 in jelly
sort [1 .. n] by negate that many times
09:13
Dunno, [n-1,n-3..1]++[2,4..n] in Haskell?
09:24
Sort by negation if not divisible by 2
09:35
@lyxal 28 bits: µN$e
09:48
PyPy really should consider making an imitation of NumPy, SciPy, Matplotlib, and PyTorch in pure Python.
10:40
I doubt there would be much market for it, you'd get all of the inconvenience with little of the speed.
11:16
I'd happily take a version of sympy without ACE vulnerabilities
3
@lyxal 3 bytes (encoding makes it worse) port of Unrelated's Jelly
11:46
niiice
 
1 hour later…
13:05
numbers: Vector<Int> = [1, 2, 3, 4, 5, 6, 7]

numbers.map(
+--------+
| o      |
|  3 + _ |
|     o  |
| ..     |
---------+
)

numbers.filter(
      \       /
       \  x  /
        \ => /
        |<- |
        |x%2|
       |is 0 |
       |_____|
)


numbers.reduce(
x,y=
><-
x+
y
) // Would otherwise be x, y => <- x + y.
// <- is return stfu
Functional programming but it visually represents what's happening
in a sort of a way
the rectangle for map is supposed to be, well, a map
13:36
Wow
13:47
0
Q: Calculate euclidean distance on a torus

anatolygEuclidean distance between two lattice points (x1, y1) and (x2, y2) on a plane is: sqrt((x1 - x2)^2 + (y1 - y2)^2). Imagine now a lattice N by N replicated infinitely many times next to itself. The two points (x1, y1) and (x2, y2) also get replicated. Euclidean distance on a torus is then the min...

14:01
Anyone tried codon yet?
14:48
@Simd I'm always very skeptical about those types of claims. "No runtime overhead" in these 2 exteremly specific situations probably
Or needing to significantly change your program to make it compile efficiently
15:30
> Strings: Codon currently uses ASCII strings unlike Python's unicode strings.
that's a pretty massive, and IMO unacceptable in the modern era, limitation
yikes
gotta love how they buried that in the docs
 
3 hours later…
18:03
@lyxal What am I looking at
 
2 hours later…
19:43
0
A: Sandbox for Proposed Challenges

Joyal MathewA Graphical Degree Sequence? Write the shortest program to determine if a degree sequence is graphical. Given a sequence of numbers S, output a Boolean value representing whether or not a graph with S as its degree sequence exists. The degree sequence of a graph is a sequence representing the deg...

 
3 hours later…
22:15
@pxeger Wait, Ascii? As in 7 bit strings? Not even UTF-8?
@Bbrk24 cursed language ideas number who knows how many
22:42
@pxeger yikes not even arbitrary integer support. That'd lead to a few problems where people would try and use programs that work fine in python but start crashing in codon because people don't know variables pass int limits

« first day (4481 days earlier)      last day (661 days later) »