« first day (2357 days earlier)      last day (2491 days later) » 

12:00 AM
I think I might try sorting the pixels by different things and seeing what happens
maybe I should make a room for my images
@ATaco would you be interested in seeing more better ones of these?
 
Probably.
 
Hmm I need to get familiar with PIL
 
ok brb making a new room

 my all colour images

I will post some all colour images I generated. if anyone else...
 
Question: in the language of math how would I say 'n is in the domain of function t'
 
Thats how
 
12:35 AM
There's a fancy symbol
 
@totallyhuman I actually could not find it, would you care to enlighten us?
 
This one: ∈ I think
 
Well that's element of
I think Downgoat was asking for element of the domain of
I could not find a symbol for domain of
 
f(x) = √(x) x ∈ [0, ∞)?
 
12:50 AM
Yes, if you know the domain is [0, ∞) ahead of time. I think what Downgoat was looking for was a symbol that represents the domain of an arbitrary function
 
@musicman523 isn't it R?
and lol I thought you were phi
 
@Riker ℝ is the Unicode symbol that represents the set of all real numbers
Downgoat asked for a symbol that represents "domain of T" where T is an arbitrary function
 
ye I thought it was also for domains of functions
 
I don't think so?
 
1:02 AM
That wouldn't make any sense
 
0
A: Sandbox for Proposed Challenges

musicman523Find the Second Zero code-golf number Challenge Given an integer in 32-bit two's complement format, return the index of the second zero digit in the binary representation, where an index of 0 represents the least significant bit, and an index of 31 represents the most significant bit. If there...

 
1:41 AM
I wonder which golfing langs have Arbitrary Precision Integer support.
 
I would imagine any that are implemented in python
Which AFAIK is many
 
Poor Japt.
 
Fun fact: this graph took 2 hours to make >_<
 
tikz?
 
yeah
 
1:50 AM
I've wasted so many hours in tikz
 
The horizontal arrows on the right are a pain in the ass to do in tikz so just hardcoded some (x,y) offsets for them
 
And I don't understand it at all.
 
though discovering tikz actually has docs was a huge step
 
You should try tikz golf. Its pretty crazy
 
oh my god what that is an actual thing? O_o
13
Q: Tips for golfing in TikZ

Wheat WizardTikZ is a Latex package used for drawing precise images in Latex documents. It has a massive specification and a boatload of features that may be useful for graphical-output style questions. What tips do people have for golfing in TikZ? As always, tips should be specific to to TikZ (e.g. "Remo...

holy shit
 
1:52 AM
You'd be amazed what's TC.
 
I'm not too surprised TikZ is TC because for loops and ifs
 
You can even take input
 
though I applaud anyone brave enough to golf in that monstrosity.
 
Best I can do is MathJS for "Things that shouldn't be TC but are"
 
@WheatWizard how long did that take you to write O_o
 
1:54 AM
Probably an hour total. I come back to it every so often
 
CMC: golf this
 
I would but I'm too busy right now, sorry
 
@WheatWizard BRB bountying
 
#RemoveWhitespace
 
@Downgoat Thanks.
 
43
Q: Attack, Decay, Sustain, Release

Luis MendoSound synthesizers use envelope generators to control how certain parameters of the sound (such as overall loudness) change with time. In many synthesizers an envelope is defined by four parameters, as represented in the following figure from Wikipedia: Attack time (A): time taken for the envel...

 
Fun fact, a % 256 == a & 255, but & is usually much faster.
Same applies for any 2^n
 
Many times compilers will make this optimization if the modulus (?) is a constant power of 2
 
(Although % will return a negative number when passed a negative n, & will not)
Sadly, Lua doesn't do that.
 
Is Lua a compiled or interpreted language?
 
2:19 AM
JIT Compiled.
(Well, some implementations are JIT compiled)
 
Remind me, what's the difference between that and interpreting?
I know Java is compiled to bytecode and then (JIT-compiled or interpreted?) to native machine code
 
JIT, Or, Just in Time Compiling, Does have a compile step prior to actually running things. This offers a great increase in speed when looping, and a minor increase inspeed generally.
JVM is JIT compiled to Machine code, depending on what it's running.
 
Okay that makes sense
How old is Lua as a language?
Looks like it got started in '93
 
1993, 24 years old.
 
I guess it could only rewrite x % (power of 2) to x & (1 less than that power of 2) if it knew for certain x would be nonnegative
 
2:24 AM
Although, you could just rewrite it as sign(x)*(x & 2^n)
 
Anonymous
@musicman523 There are 3 major methods of running code. Interpreted code is parsed and run by an interpreter. Ahead-of-time compiled code is translated into another language, and the resulting code is run. Just-in-time compiled code is sort of a hybrid of the two - the code is read and parsed like interpreted code, but as code paths are executed, they are compiled into a different language and run. Those compiled bits are saved for later executions so the compilation step only has to be run once.
 
multiplication is usually as slow as div/mod though
Thank you Mego!
 
Anonymous
The big difference between AOT compilation and JIT compilation is, if there are code paths that are never executed, JIT compilation doesn't have to pay the cost of compiling them
 
The downside is that JIT compilation can't make whole-program optimizations
 
And it has to compile at runtime.
 
Anonymous
2:26 AM
@musicman523 Not without an extra full-program parsing step
 
@Mego which I would think negates the other benefits of using JIT compilation
 
Anonymous
Not usually
 
JIT is usually better than just interpreting.
 
Wait, parsing step? Just parsing?
 
And it offers more flexibility than AOT.
 
Anonymous
2:27 AM
@musicman523 If the JIT compiler reads and parses the whole program first, it can make whole-program optimizations before running the code, but it's not usually done because the benefits aren't usually enough to offset the cost.
 
I've never written a JIT compiler or studied it in school which is why I don't know anything about it
I've written and studied interpreters and AOT compilers though
 
JIT is complicated.
 
JIT's not incredibly popular.
 
@ATaco Actually, Java 9 has an option for AOT compilation.
 
Oh that's cool
 
Anonymous
2:29 AM
JIT compilers compile statement-by-statement rather than whole programs, so it's usually slower than running a compiled program, but can make that up by not compiling everything, especially if there's a lot of dead code.
 
JIT is basically only used in JVM and .NET languages.
 
Anonymous
JIT is hard to do right, but it can be very beneficial
 
So basically only Java and C#
 
And Scala, Clojure, Lua, Kotlin, and any other JVM language (there are a lot)
 
Anonymous
Smalltalk is pretty famous for being one of the first JIT-compiled languages
 
2:31 AM
Does JIT necessarily require bundling a massive VM runtime?
 
if you JIT compile down to ASM, how do you send that to the CPU?
 
@musicman523 There are a lot, and there are a lot of .NET languages, but not many use them.
 
like, you can't modify the currently running program
 
@Phoenix Scala and Clojure are pretty popular (Scala especially is very popular right now), and Kotlin is growing
 
I suppose.
@NathanMerrill You can modify the currently tunning program.
 
2:32 AM
popularity of languages largely depends on who you hang out with
 
And Java and C# are still very big in industry
 
You can see this especially in the debugger.
 
Yeah, you can modify/add/remove instructions in memory at runtime
 
Visual Studio even has an option to attach a class to a currently running .NET application and let it do things.
 
@Phoenix I'm assuming that requires another level of abstraction
can you modify stuff at runtime, with say, C++?
 
Anonymous
2:34 AM
@NathanMerrill You can exec anything
 
Also, JVM and .NET both support reflection.
 
Anonymous
@NathanMerrill To some degree, but it's very very hard
 
right, but the JVM and .NET are huge abstractions over assembly.
 
Anonymous
You can load libraries at runtime with dlopen and whatever the equivalent is in the MS ecosystem
 
@NathanMerrill You would almost need to know ahead of time what the assembly around you would be, and modify it in memory
 
2:35 AM
@Mego is exec an assembly command?
 
As a JVM or .NET program is being run, the runtime is aware of what all the functions are called and stuff.
In fact, you can decompile .NET or JVM code back into C# or Java.
 
Anonymous
@NathanMerrill exec is a system call. It replaces the currently-running program with a new program.
 
It might look ugly, but the structure will all be there.
 
@Mego does it "return back" when the program finishes like a function?
 
It does not.
I suppose you could make it return back with some magic.
 
2:36 AM
Oh you mean the exec syscall
Not like python exec
 
Anonymous
@Phoenix There are some debugging settings you can use in the .NET C# compiler to preserve symbol names, so it doesn't even have to be ugly
 
Yeah no, the syscall exec literally overwrites the current address space with the new program (source: have implemented it)
 
Anonymous
@NathanMerrill Not by default, but like Phoenix said - with some magic, you can make it work. It's almost certainly not how most JIT compilers do it, but it's definitely possible to run arbitrary machine code at runtime.
 
@Mego The symbol names are preserved anyway.
Reflection has to work somehow.
 
@Mego that's cool
 
Anonymous
2:38 AM
@Phoenix I meant symbol names inside of local scopes that wouldn't be touched with reflection, like local variables inside of a function.
 
Ah
 
@Mego You cannot make the syscall exec return back to the original program in the normal way because it's no longer in memory
You could do one thing, though
 
You could store the orginial program somewhere else
 
Even if you could, say, load the program back into memory, change the entry point (the "main") to where you left off, and jump there
You wouldn't have any of your variables or things allocated in memory that were there before
The only way to do it would be to write the entire contents of memory to disk and then restore them
And then go back to where you left off in the original program
But it's not done. A better way would be to fork a new process running the same code. The parent process waits for the child process to exit, and the child process execs the new program
fork, wait, exec, and exit all being syscalls as well
Aaaaaaaaaaaaaaand I've killed the room. :)
 
😉
 
Anonymous
2:46 AM
@musicman523 Continuations are neat and do all things
 
@Mego Continuations are SO neat
I implemented lazy evaluation with continuations once, it was so much fun
 
3:03 AM
TikZ question: if I have these styles:
    ast/.style={ shape=rectangle, fill=white, draw=black },
    shrink/.style={ ast, below=-7mm, label=left:#1 }
does anyone know why TikZ would not apply any of the styles as defined by shrink
 
Nope, styles are out of my depth.
 
do you know how you would declare a TikZ macro or it's equivilent?
I optimally want equivilant of C: #define shrink(name) node[ast, below=-7mm, label=left:name]
 
I use \def
\def\shrink[#1]{node[ast, below=-7mm, label=left:#1]}
 
Hey C++ experts, when you manually call the destructor for an instance of a class does it free the memory or not?
 
Depends on how you have defined your destructor
 
3:12 AM
implicit
 
Oh no clue then. I usually define my own.
Just Valgrind it
 
good call
Weird result.....2 allocs, 1 free
But I only ever call new once...
 
I have an issue where my computer always allocs a static amount of memory for every program.
So it looks like I'm always leaking memory in Valgrind
 
That's so weird
What operating system are you running?
 
Arch Linux
I actually nuked it. So I'm running mac rn which does not have the problem
 
3:23 AM
Strange. I wonder if it's something with the OS or the implementation of malloc
 
It doesn't happen on every arch linux install
I don't know anyone else that has the problem
 
it really seems more like that is a "feature" than a bug with a particular install
 
come play stuff @goat and sundry chat.stackexchange.com/rooms/59120/codenames
 
that is really weird
 
I had a CS course in Data Structures and every lab I had to convince the TAs that my computer just leaks memory no matter what.
They would take off points for memory leaks.
 
3:27 AM
@musicman523 wel it depends on how you call your fields but you should use std::unique_ptr and std::shared_ptr not new
 
3:40 AM
0
A: Sandbox for Proposed Challenges

musicman523Is there a total ordering? code-golf string decision-problem TL;DR: Given a set of strings, determine whether the characters expose a total ordering based on location in the strings. In this challenge, strings are used as a predicate to determine the order in which characters should appear i...

 
3:58 AM
@Downgoat I learned old C++, not new C++, so I've never used any pointers but raw ones
@WheatWizard I guess the only way around that would have been to set up a VM and see if that also leaked, and write/run your programs in that
 
I was able to convince them so I didn't lose points
 
That works
 
Once I even was able to convince them that memory I was not supposed to leak was part of the standard leak
 
you monster! :P
For our data structures course you would submit your source code to a web server which would then compile and execute your code in a sandboxed environment with prewritten test cases
(And also throw everyone's code into MOSS to check for plagiarism)
 
We had that too, but not for labs
 
4:04 AM
What for, then?
 
For homeworks
 
Ah. Our class had 8 "assignments" which constituted labs and homeworks
When I took it, only 1 was a written assignment. The professor who taught it last semester did some that were just programming and some that were half and half
 
We had homework and labs every week. Ended up being no joke 50hrs of class work a week.
 
That's rough. Ours was first assignment = 1 week, and 2 weeks for all the other assignments
 
The were using Data structures as a strainer course for CS majors. Trying to get rid of as many people as possible
 
4:08 AM
Ours also ends up thinning the waters quite a bit
Not because they are trying to get rid of people, but simply because the people who fail are seriously not ready for junior-level courses
Last semester I believe the failure/withdrawal rate was 38%
 
Thats pretty steep
 
No wait, I think the professor said that was if he didn't curve the class
which he absolutely did
 
I don't know what ours was but a few people I know dropped CS because of it.
 
Yeah I know a few people who have dropped CS because of that course and the one before it, but I know many more have simply because they aren't in the next course
 
What do you mean?
 
4:12 AM
Because of the limitations on when courses are offered after data structures, there are few that make sense for CS majors to take, and I was in most of them and knew people in all of them
And the numbers definitely dropped significantly, even if some people are taking fewer CS courses at a time
 
Ah I see.
 
Our Intro to CS courses regularly handle 600 students and are growing (though many students are from other departments). We graduate about 120-150 per year
 
We have about the same
CS 1 is required for all students and there is only one section so it is a bit of a shitshow.
Actually CS majors don't have to take CS 1 ironically
 
Ah. My school offers CS 1 for non-majors and CS 1 & 2 for majors. In the fall CS 1 is larger, and in the spring CS 2 is larger; during these semesters, they each have 2 sections of just under 300 students each (taught by the same professor)
Although this fall they have 2 professors teaching CS1 so I'm not sure how that's going to work
Not all students are required to take a CS course though, so most don't unless they are EE, Comp. E, or an applied math major (or a CS major of course)
 
-1
Q: text to braille conversion

Divyalike this i want code for text to braille in mat-lab code please any one help me This program works on user input. So for example if a user inputs A, the braille combination is displayed. If a user inputs a word the braille combination of that word is displayed. The same goes for sentences. text...

 
4:19 AM
Anyone in our school of science and engineering is required to take CS 1 for sure. I don't know about other people because there are not a lot of them and I don't know any of them.
 
The school of engineering offers their own course in Matlab because the CS department doesn't teach one. They also started offering their own Intro to Programming in C/C++ because they thought (rightfully) that our Intro to CS courses don't do a good job
 
That makes more sense. My uni just teaches everyone how to write simple python scripts and expects people to use it. I feel like it might be more practical for engineers to do matlab and such.
 
Our Intro to CS 1 is really Intro to Object-Oriented Programming, and our Intro to CS 2 is really Exceptions and Data Structures
Which I think are both crummy topics to focus on for the first year
But that's changing soon
 
idk if I've already asked but how would you represent this in an equation: 'x is in domain of function f'
I am like 68% sure there is operator for
 
You did ask, but we didn't come up with a symbol for "domain of"
 
4:29 AM
I'm making an extra big image now :O full size with all the colours
 
$f:X\rightarrow Y;x \in X$
 
it will take about an hour maybe?
 
I don't think there is a domain of symbol
 
0
Q: Computers will never taste a refreshing cookie

fireflame241Inspired by github.com/JackToaster/Reassuring-Parable-Generator, in turn inspired by xkcd.com/1263. The possible words are derived from the reassuring.cfg of that repository. Having a look at the reassuring.cfg (use the 12th commit) is suggested to see the grammar the output matches (The output ...

 
@WheatWizard what is Y in this context?
 
4:33 AM
$x \in A\ where\ f:A\to B$ could work as well
Still don't have MathJax working :(
 
@Downgoat Y is the codomain
 
Did you mean domain or codomain?
I think Downgoat asked for domain
 
Y is the codomain X is the domain
 
@musicman523 Y is the codomain, X is the domain
 
codomain = range right
 
4:34 AM
oh yes right thank
brain
 
@Downgoat no, that's for surjective functions
 
@Downgoat range is a subset of codomain
 
@musicman523 A-ta.co is back up.
 
ninja'd
 
4:36 AM
@ATaco Thank you!
 
does this make any sense
 
@Downgoat yes
 
:D
 
$n$ is mapped to $t(n)$
 
kindof, It doesn't mean much
 
4:36 AM
I basically have:
 
It means literally nothing
 
Yeah, to me it means "mapping of n to t(n)" or in other words "t"
 
I want to say for all n in V(T), t(n) is defined
V = all nodes in graph T
 
Vertices
Gotcha
 
@Downgoat i wouldn't say this
 
4:37 AM
generating a big image!!
the anticipation...
 
@LeakyNun Yeah I realized
 
@DestructibleLemon what mean you this, mysterious lemon?
 

 my all colour images

I will post some all colour images I generated. if anyone else...
I'm making the max size one
 
@Downgoat just say $V(T)$ is a subset of the domain of $t$
 
Oh that's cool!
 
4:39 AM
@LeakyNun is there a syntax for domain of. or should I just do like:
 
not sure
what exactly do you need it for?
 
I can ask my mom in the morning
 
@LeakyNun I am writing a proof
 
@Downgoat just show me the whole context
 
Just write it in english
often english is easier to understand than symbols
 
4:40 AM
Are you required to use symbols?
 
wait shit should not have (n)
 
@Downgoat not enough context. show me where you define $t$.
 
it's defined as t(N) = (C, L, Xi)
 
and what do those symbols mean?
 
(C, L, Xi) are random variables defined elsewhere
 
4:42 AM
Oh god the memory haunts me
I had to write out an algorithm in pseudocode
That involved N_{ijk} and N_{ij} and X_i and all this nonsense
the horror
the horror
 
also I think I might have slightly messed up my older images :/
 
3
A: How to denote domain and range

MJDNotations vary. You should pick something straightforward, and state it clearly up front. One common choice would be $$\operatorname{dom} f\\ \operatorname{ran} f$$ another reasonable choice might be $$\mathscr{D}(f)\\\mathscr{R}(f)$$ Principia Mathematica used:

 
oh no D:
 
@Downgoat just use $\operatorname{dom}(t)$
 
I agree, I think "dom" is the most clear
 
4:44 AM
:O can I use the fancy D :P
 
Although the fancy D symbol is nice
 
>_< shit that sound inapproriate :P
ok so I ended up doing:
can I do like V(T) -> dom(t) as shorthand
wait = doesn't this mean V(T) = dom(t)
 
Why not V(T) subset of dom(t)?
 
because I am stupid :P
 
Thats the definition of subset :p
 
4:49 AM
I like $\mathscr{D}(f)$
 
I like it too but apparently I need some weird fonts install and LaTeX editor throws a lot of BORK ALERT 🚨 BORK ALERT 🚨 BORK ALERT
 
5:34 AM
ooo, the image should be done soon
 
5:49 AM
omg I just installed a Mac binary from latest source and it is apparently only for PowerPC macs
 
:/ that is annoying
 
like PowerPC is from like last generation
 
:/ is it borking computer?
ok I really should have put a loading bar on this image generator so I could tell how far through it is
 
great :| the makefile is so old it uses ancient flags for build >_<
 
6:02 AM
@Downgoat gcc --ancient? :P
 
gcc -x antikythera
 
Now I understand why we don't have flying cars yet— humanity is still using TeX
 
> There are a lot of IDEs for object-oriented languages, and a lot for HTML, but no IDE or IDE plugin for object-oriented HTML.
We should change that.
 
@Phoenix this is called React
 
<html extends="file2.oohtml">
 
6:11 AM
react:
 
@Downgoat Isn't React a JS library?
 
react: class MyHTMLElement extends MyOtherHTMLElement { ... }
@Phoenix it blurs the line between JS/CSS/HTML
really they are all one of the same
and then you can do:
<html>
    <MyHTMLElement> ... </MyHTMLElement>
</html>
React is really awesome— except for when it doesn't work then it's a piece of crap
 
 
4 hours later…
10:14 AM
@PhiNotPi Nice.
 
10:43 AM
@Cowsquack Is anything before the ^ in Carrot a string literal? i.e. would the Hello part of the following be considered a string literal? Hello^*1
 
@Cowsquack I keep reading your username as Cow-squack.
 
11:01 AM
oh wait cows quack is only in 5 rooms atm...o_o
 
@TheLethalCoder Right now, I would say yes. But later it will be different depending on the stack-mode.
right now, it always prepends the literal formed by the carets to the stack as a string, but later it might add a float, or push an element to an array, etc.
 
@Cowsquack Thought it might be at the moment...
 
if you want, I could give you a link of planned features that acts as an incomplete specsheet
 
Sure, I'm enjoying playing with Carrot. I'd love to see where you're going with it
 
Okx
@Phoenix how dare they. IDs are supposed to identify HTML, not classify it.
 
11:13 AM
@TheLethalCoder Here
 
@Cowsquack Thanks! Regards to your TODOs on the caret in array-mode would they not just append and prepend an item to the array for the caret and down-caret respectively?
 
that is a possibility, but I also thought about just performing the down/up caret on the last element of the array instead. Since I am not really sure, I added the TODOs there. What do you think is better?
 
Will you be adding the ability to access an array by index? (I haven't read through the entire doc yet) If so I'd say appending and prepending, if not on the last element.
 
11:49 AM
CMC: given a number $n$, output $i^n$ (imaginary unit)
 
@totallyhuman APL: 0J1∘*
 
Anonymous
@totallyhuman Actually, 2 bytes: ïⁿ
 
@totallyhuman Python, 33 bytes: lambda n:['1','i','-1','-i'][n%4]
 
Anonymous
Oh I misread
 
@Mego actually has a builtin for $i$?
 
Anonymous
11:54 AM
Yep
 
also would this be too trivial of a challenge for main?
 
Anonymous
If it's just integer powers, probably. With real/complex powers, probably not, but it's probably a dupe.
 
oh
man i cannot think of a good challenge
18
Q: Find i^n, given n

Kezz101The Challenge In as few characters as possible, find the value of i^n, given n, a positive integer greater than 0. This should be outputted as a String. For those that don't know, i is defined such that i^2=-1. So: i^1=i i^2=-1 i^3=-i i^4=1 This then repeats.. Rules If your language supp...

 
Anonymous
@totallyhuman You can shorten that to lambda n:[1,1j,-1,-1j][n%4]
 
or to lambda n:'1i--'[n%4::-2]
 
Anonymous
12:02 PM
Or lambda n:1j**n, or 1j.__pow__
 
Hi, what is the general consensus on taking multiple arguments as a list?
And what if you need to take 4 args, eg. m,n,a,b can you mix this to say accept m,n as single args and a,b as a list?
I had a look over at meta but could only find that it's acceptable to take a single arg as a singleton list :S
 
I believe if your language supports multiple arguments you should take them in as such but I'm not 100% on that. TBH probably best asking the challenge OP if taking input as a list would be fine instead of individual arguments.
 
@BruceForte you can
 
Thanks @LeakyNun! Saves me 6 bytes :D
I saw someone other doing it on the same challenge and nobody complained, but that's good to know
 
Anonymous
12:21 PM
IIRC it's acceptable to mix-and-match input methods unless the challenge specifically says otherwise
 
12:39 PM
@totallyhuman Thank you. I beat the currently accepted answer.
 
Nice
 
> outer
function (X, Y, FUN = "*", ...)
{
    if (is.array(X)) {
        dX <- dim(X)
        nx <- dimnames(X)
        no.nx <- is.null(nx)
    }
    else {
        dX <- length(X)
        no.nx <- is.null(names(X))
        if (!no.nx)
            nx <- list(names(X))
    }
    if (is.array(Y)) {
        dY <- dim(Y)
        ny <- dimnames(Y)
        no.ny <- is.null(ny)
    }
    else {
        dY <- length(Y)
        no.ny <- is.null(names(Y))
        if (!no.ny)
            ny <- list(names(Y))
CMC: guess the language (no cheating!)
 
o.O
 
It looks like R
 
@musicman523 bingo
 
12:47 PM
:)
 
@musicman523 do you know R?
 
@LeakyNun I learned it on some tutorial website for an hour or so before I no longer cared
But I've seen other R code before
 
If anyone here knows R: why is Y <- rep(Y, rep.int(length(X), length(Y))) used instead of Y <- rep(Y, each=length(X))?
 

« first day (2357 days earlier)      last day (2491 days later) »