2:53 AM
0

Sandbox Notes Any other/better tags? Is my math right? Knot Function code-golf knot-theory function A function \$f : [0,1] \to \mathbb R^3\$ is considered a loop function if the following conditions hold: It is continuous. \$f(0) = f(1)\$. It is injective everywhere else. ...

3:17 AM
Hmmmm
0

I honestly can't believe this challenge does not already exist. The challenge Write a function. The specifics Your program must define some sort of callable function. This includes anything commonly known as a function, a lambda function, or a subroutine. All of these types of callables will...

I hope this one gets reopened soon (or, at least, that it gets reopened at all). I like it.
The big ambiguity I see is whether you have to literally write a function and assign that function to a name or variable, or whether you merely have to assign any function to a name or variable.

also what assignment means. The jelly answer relies on implicit assignment to the previous expression variable

The fundamental problem is that it relies on the notion of a function being well-defined in your language.
Yeah, that's true.
Although I don't see any reason why the Jelly answer wouldn't count. The problem states that "The function must be assigned to some sort of variable", and the Jelly code does, in fact, cause the function to be assigned to some sort of variable.
I guess a bigger problem is that that rule technically rules out, say, C, where it's impossible to assign a variable to a function.

You can have a function pointer in C

You can write "int f() { return 0; }", but that fails to assign f to a variable
Right, a variable can contain a function pointer, but it can't contain a function.
Well, actually, I guess a variable could contain a struct (or even a long integer) that's big enough that it actually contains an entire function.

@TannerSwett the challenge includes indirect assignment specifically for that case, though that does conflict with the variable part

3:26 AM
I forget, can a struct in C contain an array (as opposed to a pointer to an array)?

in ruby REPL any expression gets assigned to _. In Haskell it's called it. The rule is basically useless.

Anyway, if the question were open at the moment, I'd submit 3 bytes of Haskell:
x=x

@TannerSwett how would that work? Besides the the single trailing array, that just doesn't make sense

Actually, in the Haskell REPL... shoot, I don't remember exactly how this works.

just submit the 0-byte solution, which assigns the identity function to the id variable.

3:28 AM
If you open up GHCi and type 0, then ask for the type of "it", what does it say?
If it says that it :: (Num a) => a, then there you go. That's a function.

It should give you Int IIRC

@dzaima Well, presumably, if a struct contained an array of 1,000 ints, that would be essentially the same as having 1,000 fields of type int.

Prelude> 0
0
Prelude> :t it
it :: Num p => p
well then...
In Haskell, 0 is a function.
Also, TIL I still have a functioning Haskell RE on this machine

Yeah. So if you count GHCi as a programming language, then 0 is a valid 1-byte answer.

Answerers can choose the environment, not just language

3:32 AM
It creates a function called it which takes a Num instance and applies its fromInteger function to 0 :: Integer.
I guess the question is whether or not this counts as writing a function, though.

If your code only works on Unix machines with exactly 3141592 bytes of memory, so be it
It definitely counts as writing a function

@TannerSwett if the array size is variable though, those ints would push around the offsets of the other fields, making accessing them impossible. anyways, about the second case, though i have no idea how the dereferencing works, this does work

Yeah, I guess so, since Haskell doesn't really have a built-in function called 0. You've written a number (albeit a short one), and that number is a function, so you've written a function.
As opposed to i=id in Haskell, where you're merely referring to a preexisting function instead of "writing" a function.
@dzaima Right, I mean a constant-length array.

@TannerSwett just int is[100]; seems to work for that
@NewMainPosts would a 0-byte answer in Canvas count? In Canvas every line is a function, and functions are "named" ⁹, ⁸, etc, depending on in which line they're in

So yeah, a struct in C certainly can contain an array.
Anyway, I thought of a challenge. It's a specific-language challenge, and I've heard that those are often frowned upon, so I may not submit it.

3:41 AM
@TannerSwett language-specific challenges are frowned upon if there's no good reason for it to be language-specific

The challenge is: using the combinators B, C, I, K, S, W, write a Church numeral for a number which is at least as large as Graham's number.

hmm, would int*f; count as a function in C? It's just that the caller must cast it to a function pointer and the behavior of it is undefined :p

I'm going to give it a dumb title like "Can you build Graham's number out of bwicks?"
:D
Fun fact: a Polish person would consider "bciksw" to be a totally pronounceable word.

Anonymous
3:56 AM
@TannerSwett Haskell blurs the line between literals and functions which return those literals. 0 is an instance of Num, but it is also satisfies Num a => () -> a. In fact, in Haskell, those two mean exactly the same thing.

Anonymous

What do you mean by "functions which return those literals"? A literal is a piece of source code; a function can't return it.

Anonymous
s/constant/literal/g

4:14 AM
0

Find a mistake in this code- unsigned int i; for(i = 100; i >=0; --i) printf(“%d\n”, i); Find a mistake in this code- int find_max(int* arr, unsigned int size) { int max; for(unsigned int i =0; i < size; ++i) { max = (max > arr[i]) ? max : arr[i]; } return max; }

4:34 AM
0

A cursor position is valid if either of its two sides touches whitespace (i.e. a space or a newline(CR+LF or LF, depending on your OS)). The input will always consist of valid cursor positions. This takes one input(a character matrix), and for a cursor on the up right corner of the input, can th...

2 hours later…
6:54 AM
0

2 hours later…
8:26 AM
@Mego really?? TIL!

8:40 AM
@TannerSwett This has my +1 as

9:34 AM
0

This challenge is about Haskell point-free style functions. Although you don't need to know Haskell language to do this challenge, Haskellers will have an advantage here. In this challenge you will have to create a point-free style Haskell code generator. This generator will take a polynomial f...

1 hour later…
10:55 AM
0

Alice is intern in a company that uses Brainfuck as a primary language for both client-side and server-side development. Alice just have written her first code and she's a bit nervous as she's getting ready for her fist code review. Alice wants to make her code properly formatted and look nice, ...

3 hours later…
1:44 PM
@lirtosiast Aha, I didn't know about that tag.
I'll go ahead and post the question, then. Thanks!

@UnrelatedString alright, I've added you (nah, you don't actually need any sort of commitment, that's why the place is mostly inactive :D)

By the way, for the "write a function" challenge...
Does anyone think that 0 does not count as a "function created by you" in Haskell? I think it does, pretty much unambiguously.
There are two questions, of course: is it a function, and is it "created by you"?
I say that it's definitely a function. It has a parameter (albeit a parameter which is passed implicitly), and it returns a value which varies depending on the parameter.

0 is definitely a function in Haskell

A single occurrence of 0 in a program can return different values at different times.

Not sure about the "Created by you" part though

1:51 PM
I also think it definitely counts as "created by you". An expression such as 4890053241987308641563 is certainly "created by you", and there's no fundamental difference between that and 0.

That's good enough for me

The expression 0 is (I assume) parsed the same way as any other nonnegative integer literal: the parser loops through the digits and performs arithmetic in order to determine a number. So it's a user-written function; it's just a very short one.
I guess it's not a valid Haskell submission, though, since it doesn't give the function a name. You'd have to do something like x=0.
And I guess then you may as well do x=x.

2:06 PM
By the way, anyone know offhand of a language which is on TIO which is functional and dynamically typed (like Python and Lua, but unlike Haskell) and where function application can be written as juxtaposition (like Haskell, but unlike Python and Lua)?

@TannerSwett Yeah but so can (+) and that is definitely not created by you

Just for the convenience of being able to write expressions like s i i (s i i) instead of s(i)(i)(s(i)(i)).

@TannerSwett APL

@SriotchilismO'Zaic Right, well, (+) is a library function; it's defined in the Prelude. 0 isn't a library function.

Yeah I'm not saying it is not made by you
I'm just saying that is not a good reason

2:09 PM
It's not a good reason for what? I'm not sure I understand.

the fact that 0 can take on multiple values is not a good reason that it is made by you

Oh. Well, that's not a claim I was making.

I stated that 0 is a function because it can take on multiple values. Separately from that, I also gave an argument that 0 is "made by you".

That's fair
I think the reason 0 is a function is really because it is lazy
I think the multiple values is less important than the lazy.
0 :: Int is still a function

2:16 PM
I think that's right. In fact, I'm pretty sure you can say that in Haskell, every expression denotes a function.
Since expressions always denote thunks, never evaluated values.

Not technically, you can get eager eval in haskell
but most the time yes

Could you give an example of an expression that denotes an evaluated value or something other than a function?

Uh, I am a little busy right now, I just know there are ways to have strict eval.

nod
Hmmmm, I just noticed that the /// interpreter on TIO seems to have a bug in how it interprets backslashes. I can't figure out what it's doing.
No, scratch that.
I was just forgetting how /// works. :D
I ran /a/\/\/\//aaa and expected it to output /////////.
But after the first replacement, that program becomes /////////, and ///////// doesn't output itself; it runs forever.

yep, /// is the shortest infinite loop in ///

3:05 PM
spent a couple hours messing with fonts, trying to get things to look okay after finally updating to linux mint 19. settled on setting scaling factor to 0.9 and adding a * { font-size: 10pt !important; } to some css file..

3:54 PM
Does anybody here read runes? @J.Sallé?

0

Given a date between 2010-01-01 and 2099-12-31 as three integers (please state your order if not [year,month,day]), answer with Tesco's corresponding five-digit Burger Relish Best Before End date number. The format is simply the last two digits of the year, followed immediately by three digits...

@J.Sallé Is the logo for this year's Dyalog User Meeting upside down?

IIRC, the Mjölner pendant usually has the runes right side up when it's pointing down
Although I've seen it both with the runes right side up and upside down

Which way is "pointing down"? Is the point the wide end which tapers to a point, or the narrow end which is squared off?

4:06 PM
@TannerSwett The former. The head of the hammer traditionally points to the ground

Oh right, I forgot that Mjölnir is a hammer.
I have forgotten what NetHack has taught me.

4:58 PM
codegolf.stackexchange.com/a/187726/78849 Someone want to give this guy the Welcome + TIO intro? I would but don't know how to covert a Kotlin func into a working program in TIO

@Adám by the way, are they supposed to mean anything? The transliteration of the runes would be either iawnrg?h or h?grnwai, where the ? is a rune I've never seen before, although it looks like a nyd rune.

@J.Sallé No idea. I'm usually not involved in the design process for the user meeting logos. I can ask a couple of people, though.

Also, the last rune in the image suggests those are Anglo-saxon Futhork runes instead of the scandinavian Elder Futhark, even though the difference is not very noticeable
@Adám No need, I was just curious
For the record, using the same anglo-saxon futhork, Dyalog APL ←→ ᛞᚼᛚᛟ‬ᚷ‬ ᚨᛈᛚ.
And I just found out that Wikipedia now features articles in Old English. Down the rabbit hole I go.

5:19 PM
@J.Sallé Hey, I can almost read that.

Hah! Old English is, not surprisingly, very similar to modern English
Although there are many factors that make it closer to the germanic languages, I guess

@J.Sallé My brain switches to Danish mode, though there are lots of "English loan words"… It may be a visual thing due to frequent Æs.

Yeah, exactly! Danish also has þorns, right?
Or is it norwegian?

@J.Sallé Icelandic.

Oh yeah. I mix them up all the time
Whoa, they also allow you to switch fonts to use Futhork. This is great.
Good bye, friday productivity.

5:24 PM
Actually, now that I think about it (I didn't when I first read it), "Hēr man mæg findan" triggers multiple of my languages. Hēr (Da. Her=En. Here) man (Dan. man=En. one) mæg (Yi. mäg=En. can) findan (En. find+Sw. -a).

Also not surprising, since all those languages stem from Proto-Indo-European and Proto-Germanic

@J.Sallé They are all Germanic.

The pronunciation is very similar as well. That sentence reads almost exactly like "Here man may find..."

@J.Sallé But "man" would be "one" in current English usage. Da./Sw./Yi. still use that cognate in that kind of context.

Yeah, I don't mean it makes perfect sense, just the pronunciations are very, very similar.

5:31 PM
@J.Sallé Yeah, especially considering spelling conventions that have survived in the more conservatively spelled languages. In Danish, "mig" is pronounced like the English word "my" (it means "me", though), but you see the final "g" giving the sound of the modern final "y" in "may".
In fact, Danish has the word "mægler" with the first syllable "mæg" pronounced exactly like English "may".

So I wrote a Church numeral for (a number larger than) Graham's number, out of the BCIKSW combinators. I plopped it into GHC... unsurprisingly, it doesn't typecheck. :D

I think one of my life goals is to learn most of these languages
The european ones for sure.

I'm trying to get it to typecheck by doing various type signature tricks. Only limited success so far.
@J.Sallé What are "these languages"?

0

It seems as of recent, there have been a lot a Jimmys falling to their death, as can be seen here, and here where you were asked to determine if Jimmy would fall. It is time we put a stop to this madness and try to save Jimmy. Jimmy has three body parts /, o, and \ arranged like this /o\ Plat...

I know Spanish pretty well, and I learned a bunch of Polish on a whim. Now I'm studying German.

5:36 PM
@NewMainPosts Classic Jimmy

So I'm getting a pretty well-rounded exposure to Indo-European languages. :D

@TannerSwett well... all of them.

That's a lot. :D

I'm mostly into european languages though
I speak Portuguese, English and Spanish pretty well, and I can understand a lot of German although I don't speak it very well

Lately, the hardest part about learning Polish has been just the sheer number of vocabulary words.

5:45 PM
My target languages for the immediate future are finishing German, then starting one of the Scandinavian languages

@TannerSwett All you need is Kurwa

Also Klingon
@TannerSwett all the freaking diacritics make me dizzy
A friend of mine had a Polish surname, which contained 13 letters. 2 of them were vowels.
12 or 13, can't remember exactly

Nah, Polish is easy. Let's learn some Polish right now.
English: ninety happy bees
Polish: dziewięćdziesiąt szczęśliwych pszczół

That's what I'm talking about. I can't even begin to imagine how pszcz sounds

I just really get stuck on memorizing the vocabulary

5:49 PM
Well, it's /pʂt͡ʂ/.

@MilkyWay90 Polish or languages in general?

And /ʂ/ is more or less the "sh" sound of English.

@J.Sallé Languages in general
Also the trills
I have no idea how to do a trill

So if you respelled pszczół in English, it'd be something like... pshchoo.

@TannerSwett I think I just knotted my tongue

5:51 PM
@J.Sallé English

The most important takeaway is that if someone is speaking Polish to you and they say pszczół, you should say "Na zdrowie!"

I see

Here's another one.
English: I am reading the description of the game.
Polish: Czytam opis gry.

@J.Sallé Qapla'

Yeah, languages like Polish aren't very descriptive like English or even Portuguese

5:53 PM
Every time I attempt to do a trill, my throat feels like dying. I wonder what I'm doing wrong

It's because of this I'm not multilingual

I mean, are you trying to do trills from your throat? 'Cause that doesn't sound like the right way to do it.

I think they're talking about uvular trills? Like the German ch in Achtung

That's a trill? I thought it was /x/. Unvoiced velar fricative.

5:55 PM
I'm like trying to move my tongue to the back of my mouth then vibrate it to the front
I'm trying to do /r/

@TannerSwett my example might've been bad. >.>

Iiiiif I understand correctly, doing an alveolar trill (/r/, the one that Spanish is famous for) involves keeping most of your tongue in a particular place while also relaxing the tip of your tongue.
Which is hard to do if you're not used to it.

@J.Sallé Perhaps you mean /ʀ/

I can't believe that the "th" sound of English would be easier for (say) Spanish and German speakers than the /r/ sound is for English speakers.

@J.Sallé My father had a colleague named Trnka.

5:58 PM
Making the "th" sound just involves keeping your tongue in a particular position. None of this relax-just-the-tip-of-your-tongue nonsense. :D

Do you feel a vibration in your throat while doing a trill?

Me? Dunno, I can't do it.

@TannerSwett th was one of the hardest digraphs I had to learn when studying English, along with the rl in world

I can do a bilabial trill, and I don't think that produces a feeling of vibration in my throat.

@Adám I can't pronounce that without mangling it

6:00 PM
In any case, I don't think it really matters. Your throat's not doing anything special.

Well, since my first language is Portuguese, I never had much trouble with trills, I guess.

If you can do Danish stød, you can do anything.

Since my first language was English, th was really easy

Isn't the Danish ø the same as the German ö?

@MilkyWay90 was were

6:01 PM
Anyway, I've learned a lot about the physics of airfoils since the last time I thought about the /r/ sound. So I need to spend a few minutes thinking about the sound in light of my new knowledge. :D

The hardest digraph I know from the scandinavian languages is the Swedish sj

@J.Sallé Pretty much, although not always a re-sound.
@J.Sallé Sometimes, it is spelled "k", btw.

And it makes me mad because you can pronounce it in like 3 or 4 different ways

The counterintuitive part is how in order to do an /r/, you have to somehow make it so that the airflow over your tongue lifts up on the tip of your tongue.

@J.Sallé But it doesn't matter.

6:03 PM
It doesn't?

@J.Sallé No, I think the variations are just for ease, never meaning-bearing. Unlike stød,

Since my first language <s>was<s>is English, th was really easy

@TannerSwett oh god i never realized that. also it is only now that i realize english doesn't have this fancy r

@MilkyWay90 were really easy.

6:05 PM
@MilkyWay90 ð and þ

@dzaima because english upper lips are stiff? :)

@ngn the tongues rather than the lips, I guess

@Adám In English I don't think it's plural
Th is a singular noun

@MilkyWay90 But there are two, so maybe it'd be ths were easy

6:06 PM
But it represents two different digraphs

@Adám If there was an s at the end, yes

@J.Sallé Opposite, no? The digraph represents two different monographs(?).

Two different phonemes.

@Adám yes, that. I meant two different sounds
Or phonemes, yes. The terminology gets me every time

To be precise, it represents either of two different phonemes, as opposed to a "digraph" like "st", which represents a string of two consecutive phonemes. :D
Oh boy, where were we.

6:08 PM
@TannerSwett Well, no, because I think th always represents one of the two monographs, but the phoneme isn't necessarily tied fully to the symbol.

I don't know but I like it here.

I should be figuring out how this manufacturing execution system works.

If you were to say that "The two phonemes was really easy," that would be wrong
@TannerSwett What's that?

@TannerSwett is it for work?

6:09 PM
Yeah, it's for work.

Oh, okay

Not important then

It's a piece of software that helps you figure out what's going on in a factory.
Right. :D

Clearly TNB takes precedence

Speaking of Polish...

6:09 PM
"Not important then?"

In Polish, "one bee" is a singular noun phrase, and "two bees" is a plural noun phrase, but "five bees" is a singular noun phrase.
The only numbers which create plural noun phrases are the ones that end in "two", "three", or "four" when written out in English.
In other words, numbers whose decimal expansions end in 2, 3 or 4 but not in 12, 13 or 14.
So the way you say it is essentially, "A five of bees is flying by."

@TannerSwett That's... odd

Yup.

That's Polish

Speaking of grammar, you shouldn't have a comma after a short prepositional phrase

6:12 PM
@MilkyWay90 Welcome to non-english languages!

@dzaima English is odd, though

I don't think Portuguese has many oddities like that...
Some words don't have a plural form, but other than that I can't think of anything else

@MilkyWay90 Did I write a comma after a short prepositional phrase?

@TannerSwett if you follow the etymology, that kind of makes sense

@TannerSwett "In Polish***,***"

6:14 PM
"a five of" = "a fist of"

@MilkyWay90 Oh yeah.
I don't think I've heard of that rule before.

12,13,14 in slavic languages (i guess polish too) are usually 2-on-top-of-10, etc
so it's the 10 that matters for the grammatical case

I also recently found out why the counting noun "dozen" exists.

Although I've been thought <4 words = short prepositional phrase, not <=4

@MilkyWay90 by the way (changing subjects slightly) I made some comments on the cicada chatroom. Don't know if you noticed or not, just saying.

6:18 PM
I don't see that page saying "don't use commas after short prepositional phrases", just "do use commas after long prepositional phrases" and "don't use commas after restrictive appositives".

@J.Sallé Oh, thanks
Me and my friend have been working on it
@J.Sallé The more up-to-date version is docs.google.com/document/d/…
But it's more like a messy sketch pad

Hah, I don't mind. I'll take a look

Do you have a gitlab account so I can add you as a collaborator to the gitlab cicada wiki?

No, but that can be easily remedied. Gimme a sec

6:38 PM
@TannerSwett the polish sneeze sound is apsik :)

7:17 PM
@ngn Well, that's weird. :D
Then again, English is weird too.
If we don't want any weirdness, then we should all speak Interlingua.

@TannerSwett Why Interlingua?
@TannerSwett Oh whoops

Interlingua is designed to be easy to learn for speakers of European languages, especially Romance languages.
"Interlingua es un lingua auxiliar international naturalistic basate super le vocabulos commun al major linguas europee e super un grammatica anglo-romance simple, initialmente publicate in 1951 per International Auxiliary Language Association (IALA)." ia.wikipedia.org/wiki/Interlingua

@TannerSwett i.e. screw the rest of the world

7:25 PM
@ngn there's always Esperanto

@J.Sallé same thing, it's based mostly on romance vocab

Indeed

As much as it'd be nice to create a language that's immediately readable to speakers of any language, I don't think it's going to happen.
The vocabulary of Lojban is based on Mandarin, English, Hindi, Spanish, Russian, and Arabic. As a result, most of the words don't look familiar to anyone at all.

Yeah. Languages that use abjads instead of alphabets (or vice versa) would be almost mutually exclusive

Since four of those languages are Indo-European, maybe they should have just tried to come up with some kind of "unified Indo-European" vocabulary.
The Indo-European languages have diverged quite a lot thanks to numerous sound changes; I wonder if you could apply even more sound changes to pull them back together again.

7:31 PM
esperanto?
lojban?

I'm suggesting "some kind of "unified Indo-European" vocabulary"

@TannerSwett For a language

I once had the thought to try to create a language that's a blend of English and Spanish.

@TannerSwett Spanglish?

7:35 PM
Yeah.
The confusing thing about doing that is that the two languages are related in multiple different ways.
They're both derived from Indo-European, and English also has a lot of loanwords from Old French, and it also has a lot of loanwords from Latin.

Fun fact, English is already a mix of gaelic and old french

English is a mix of more than that.

8:00 PM
@AdmBorkBork Jan 18 '16. You went deep for that one

I remember some things sometimes.

To be fair, that's pretty funny and easy to remember

I'm just lucky the word English was in the filename, else I wouldn't have found it.

Wait a second
you're just quoting yourself!
I see right through this ruse

8:21 PM
@TannerSwett I think you're setting the goal too high. As an English speaker, Lojban words are significantly easier to remember than Japanese words when I put in some effort. Also the Lojban algorithm is inefficient-- it doesn't know about morpheme boundaries, and ranks words purely on similarity of the longest sequence of letters. Not to mention Lojban gismu are very restricted in their form.

@Poke I quote myself all the time. Half the time I'm right, even.

9:01 PM
@ConorO'Brien have you actually used Haskell?

@flawr yes, and I really didn't enjoy it
I should give it another try, my last serious attempt was like a year ago

@ConorO'Brien Ah too bad. I just recently found a lecture and a talk that were really interesting after having learned a little bit of Haskell, and I think they improved my understanding a lot. One was about lambda calculus and the lecture about category theory (see the links in of Monads and Men).

1 hour later…
10:19 PM
Anybody know how to decode QR codes like this one ^
It's too low-quality for a phone to gues

10:49 PM
contrast filters probably help
alternatively you could manually recreate the pattern that you think it is

@MilkyWay90 maybe do some TV regularized reconstruction?

11:06 PM

I haven't even tried before, yes it seems to work fin on mine too
@MilkyWay90 ^

This is not okay
@MilkyWay90 Mathematica, 16 bytes: BarcodeRecognize (reference.wolfram.com/language/ref/BarcodeRecognize.html)