4:32 AM
0

LaTeX Fractions Inspired by a TeX SE question. LaTeX uses \frac{a}{b} to represent a/b, which is very unintuitive. Now you have a piece of paper (as in "research paper") which happens to use the a/b format, and your task is to convert it to the LaTeX format. [to be continued]

4:47 AM
@NewMetaPosts oooh, character development

1 hour later…
6:07 AM
hey, codegolf.stackexchange.com/questions/209266/… so for this answer I need to make the function so that it only takes one parameter?

6:25 AM

can I make "b" a default parameter?
like it does not need to be passed while calling the function and its set to 10 by default?

@ManishKundu it seems so
20

I have a function: cost(X, model, reg = 1e-3, sparse) And I need to pass this function to another one under the form: f(X, model) f(X, model, reg = reg) I am using lambda to do this: f = lambda X, model: cost(X, model, sparse = np.random.rand(10,10)) And python complains that lambda got ...

@ManishKundu great!

yeah

6:28 AM
Also, today I learnt lambdas can have default parameters like normal functions.

btw you cannot keep the "f=" part in header if your function is recursive

@ManishKundu really? huh. I didn't know that
I need to check meta then
to actually revise what our rules are
because I've clearly either forgotten/never knew that
lol this clarifies both issues discussed here.

ah nice!

7:22 AM
CMQ: What would be a useful result of multiplying two strings?
Useful as in "an efficient feature for a golfing language"

Interleave or intercalate
AKA join chars of left with right as separator
interleave would be equivalent to flat zip

@JohnDvorak interleaving seems like a good idea.

1

I have some sorted list in python (sorted by the second element); example: list = [(13,18),(6,12),(5,10),(4,3),(1,2),(0,0)]. I have to pick some elements from this list, such that sum of second numbers in elements will be highest possible (maximisation), but the sum of first numbers in elements w...

4 hours later…
11:10 AM
1

You are James and four of your friends (Bjarne, Eich, Rossum, Ada) are called for an interview. There are n interviewers, and they can each serve one person at a time, alphabetically. Each round of interview takes 20 min. Let's take n = 2, So, the first round started with Ada and Bjarne, takes...

1 hour later…
12:32 PM
hithere

Punch I just hit you.

@RaghuRanganathan hello

hello there

12:36 PM
Interviewer's room is hard
Hey wait a minute

Maybe it's not that hard

yeah depends on string builtins really

Chooses golfing language
Although I can't solve it in 1+ definitely
@RaghuRanganathan How does your solution work anyway
Don't know Ruby looks so cryptic to me

it adds the main name to the array, then maps all the strings that are lesser in value than the main name to 1
then it adds all the 1's

12:48 PM
Oh

(That's my idea btw)

@petStorm Good to know that

my original solution was to split the array into groups of c
then find which one the main name was in
then find it's index

(That's Arnauld's original idea btw)

yepp
the previous one
I came up with the splitting myself and realized it was terrible

3 hours later…
4:00 PM
1

The task is simple. You are given a string with alphanumeric words (say "Hello world, this are tests"). You have to return the mode of the lengths of words in the string. In this case, output is 5, as it's the most often length of words in the string. Regex to check alphanumeric words in input: /...

4:48 PM
0

Source Code Byte Frequency Write a program that get a single byte character as an input and prints the frequency of that byte in the program's source code as an output. Examples: Assuming my program is: ab#cd%b then the output of the program should be (each line is a separate execution): input ...

5:12 PM
-1

The task is no easy but also not that hard. You are given a blog title (say "How to make your website better"). You have to return the slug version of the title. In this case, the output is "how-to-make-your website-better" Sample I/O: Constraints: Input can contain special characters, emojis etc...