There are numerous programming problems are related to tree structure.
example, displaying the hard drive, displaying a dropbox content, categorization, tree editors etc.,
example, displaying 1,000 records in a tree will fail. however it can be resolved via breadcrumb which is very efficient as...
Language idea: foo(a, b) is syntax sugar for foo(a)(b) and (a,b)=> is a=>b=>. If a function normally takes two operators, you can call it with one, save that result for later, and then call it with the second operator. The uselessness of this feature is astounding, I'm sure, but intresting to consider anyway.
With credit, it's still a lot shorter than lua's default solution of TitleCase = function(s)return s:gsub('(%w)(%w*)',function(x,y)return x:upper()..y:lower() end)end
@Pavel Actually, it returns an ambivalent function. Used monadically, it does the expected PCRE replace on the given string(s). Used dyadically, it reads from the right-arg file and outputs to the left-arg file.
When the function is called, it substitutes s (the only protoexpression it has access to), with the argument. We'll say "Hello, world!" for this case. then, the expression is gsub("Hello, world!", '(%w)(%w*)', #(upper(x)..upper(y))). This is satisfactory for gsub to run (because it thinks the third argument is a function, not a protoexpression), so it passes the replacement args in each case to the function, which substitues x and y for each match. If that makes any sense.
I was going to do another text dump on my protoexpressions, but chatexchange was like "That's a little large there taco", and I was like "Yeah, good point"
I have rules for valid email address.
A username must begin with an alphabetic character. It may be followed by any number of additional alphanumeric characters or any of the following special characters: . (period), - (hyphen), _ (underscore), or + (plus).
A domain name must end with an alphabe...
I need a program that will accept numerical inputs from the user until
they enter a zero. The program will track some information about the numbers the user inputs
and will display these after the user has finished entering new values. It will also perform some
basic statistics on the inputs and ...
Sets the the function that's called when a string is called to print its self and its arguments, then return the last argument it was passed, which is another string.
[sum(comb(3*k,3*i) for i in range(1,k+1))*(1/2)**(3*k) for k in range(1, ...: 10)] Out[9]: [0.125, 0.328125, 0.330078125, 0.333251953125, 0.333282470703125,
[sum(comb(3*k,3*i) for i in range(0,k+1))*(1/2)**(3*k) for k in range(1 ...: ,10)] Out[10]: [0.25, 0.34375, 0.33203125, 0.33349609375, 0.33331298828125, 0.33333587646484375,
@orlp it's where you plot a number using the horizontal axis as the real axis and the vertical axis as the imaginary axis, and then read of its polar form by pretending that you're using the polar coordinates
Why do people keep posting a link to the sandbox below their question? Isn't the sandbox supposed to serve the OP as a way of getting feedback on a challenge? It seems like a lot of people are mistaking (or am I?) the purpose of the sandbox as a golden ticket to success. Is there an unspoken rule...