答:
SWI-Prolog 84

This version prints the list, instead of trying to find an appropriate binding for a term in a predicate.

```<code>s([],O):-O=[_|_],sum_list(O,0),print(O).
s([H|T],P):-s(T,[H|P]).
s([_|T],O):-s(T,O).
</code>```

Input method

```<code>s([8,-7,5,-3,-2,4],[]).
</code>```

For the record, this is the version that finds a binding to satisfy the predicate:

```<code>s(L,O):-s(L,0,O),O=[_|_].
s([],0,[]).
s([H|T],S,[H|P]):-R is H+S,s(T,R,P).
s([_|T],S,O):-s(T,S,O).
</code>```

Input method

```<code>s([8,-7,5,-3,-2,4],O).
</code>```

Previous revision contains an incomplete solution that didn't manage to remove empty set.

Title: Golf the Subset-Sum Problem

Body:
SWI-Prolog 84

This version prints the list, instead of trying to find an appropriate binding for a term in a predicate.

s([],O):-O=[_|_],sum_list(O,0),print(O).
s([H|T],P):-s(T,[H|P]).
s([_|T],O):-s(T,O).

Input method

s([8,-7,5,-3,-2,4],[]).

For the record, this is the version that finds a binding to satisfy the predicate:

s(L,O):-s(L,0,O),O=[_|_].
s([],0,[]).
s([H|T],S,[H|P]):-R is H+S,s(T,R,P).
s([_|T],S,O):-s(T,S,O).

Input method

s([8,-7,5,-3,-2,4],O).

Previous revision contains an incomplete solution that didn't manage to remove empty set.


问:
Output a Magical 8 Trapezium
Your task is to output a Magical 8 Trapezium:

```<code>        1 × 8 + 1 = 9
       12 × 8 + 2 = 98
      123 × 8 + 3 = 987
     1234 × 8 + 4 = 9876
    12345 × 8 + 5 = 98765
   123456 × 8 + 6 = 987654
  1234567 × 8 + 7 = 9876543
 12345678 × 8 + 8 = 98765432
123456789 × 8 + 9 = 987654321
</code>```

Output in your chosen language in the fewest bytes possible.

Note the number of spaces at the start of each line to maintain the trapezium shape.

Trailing spaces are allowed.

You can use × or the letter x - whichever you prefer.

答:
Javascript (using external library) (143 bytes)

```<code>n=>_.Range(1,9).WriteLine(v=>_.Range(0,10-v).Write("",x=>" ")+_.Range(1,v).Write("")+" x 8 + " + v + " = "+_.Range(10-v,v).Reverse().Write(""))
</code>```

Link to lib: https://github.com/mvegh1/Enumerable/

Explanation of code: Create range 1 to 9, and for each value, write a line corresponding to the complex predicate. The predicate is passed the current integer value, and creates a range spanning 10-currentValue elements, in order to create that many spaces. Those spaces are concatenated with the formula part of the line, and then that is concatenated with the tailend of the range matching the number of elements as the frontend, in reverse order.

Note: In the image, the first line is off by one space because the console added a quotation mark since the return value is a string. The actual value is formatted correctly

ContentLicense: CC BY-SA 3.0

Title: Output a Magical 8 Trapezium

Body:
Javascript (using external library) (143 bytes)

n=>_.Range(1,9).WriteLine(v=>_.Range(0,10-v).Write("",x=>" ")+_.Range(1,v).Write("")+" x 8 + " + v + " = "+_.Range(10-v,v).Reverse().Write(""))

Link to lib: https://github.com/mvegh1/Enumerable/

Explanation of code: Create range 1 to 9, and for each value, write a line corresponding to the complex predicate. The predicate is passed the current integer value, and creates a range spanning 10-currentValue elements, in order to create that many spaces. Those spaces are concatenated with the formula part of the line, and then that is concatenated with the tailend of the range matching the number of elements as the frontend, in reverse order.

Note: In the image, the first line is off by one space because the console added a quotation mark since the return value is a string. The actual value is formatted correctly


问:
Showcase of Languages

Notes

This thread is open and unlocked only because the community decided to make an exception. Please do not use this question as evidence that you can ask similar questions here. Please do not create additional showcase questions.

This is no longer a popularity-contest, nor are snippet lengths limited by the vote tally. If you know this thread from before, please make sure you familiarize yourself with the changes.

This thread is dedicated to showing off interesting, useful, obscure, and/or unique features your favorite programming languages have to offer. This is neither a challenge nor a competition, but a collaboration effort to showcase as many programming languages as possible as well as possible.

How this works

All answers should include the name of the programming language at the top of the post, prefixed by a #.

Answers may contain one (and only one) factoid, i.e., a couple of sentences without code that describe the language.

Aside from the factoid, answers should consist of snippets of code, which can (but don't have to be) programs or functions.

The snippets do not need to be related. In fact, snippets that are too related may be redundant.

Since this is not a contest, all programming languages are welcome, whenever they were created.

Answers that contain more than a handful of code snippets should use a Stack Snippet to collapse everything except the factoid and one of the snippets.

Whenever possible, there should be only one answer per programming language. This is a community wiki, so feel free to add snippets to any answer, even if you haven't created it yourself. There is a Stack Snippet for compressing posts, which should mitigate the effect of the 30,000 character limit.

Answers that predate these guidelines should be edited. Please help updating them as needed.

Current answers, sorted alphabetically by language name

$.ajax({type:"GET",url:"https://api.stackexchange.com/2.2/questions/44680/answers?site=codegolf&filter=withbody",success:function(data){for(var i=0;i<data.items.length;i++){var temp=document.createElement('p');temp.innerHTML = data.items[i].body.split("\n")[0];$('#list').append('
' + temp.innerText || temp.textContent + '');}}})```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><base href="http://codegolf.stackexchange.com"><ul id="list"></ul></code>```

答:
Maple

Length 15

```<code>type(1,posint);
</code>```

Type checking is an important aspect of input handling for procedures and commands.

```<code>> type(1,posint);
  true
</code>```

Length 14

```<code>plot3d(cos(x))
</code>```

3D plots are very useful for visualizing mathematical surfaces.

Length 13

```<code>Matrix(10,10)
</code>```

or

```<code><<1,2>|<3,4>>
</code>```

Matrices are one of Maple's fundamental data structures. It is possible to perform many common operations, including numerous operations in Linear Algebra on matrices. There are several calling sequences for making a new Matrix. Above are two of the most common:
The Matrix command generates a new Matrix with r rows and c columns:

```<code>Matrix(r,c);
</code>```

The shorthand notation < > can also be used to input a matrix.

```<code><<1,2>|<3,4>>;
</code>```

Length 12

```<code>f:=x->2*x+12
</code>```

A function can represent a function call, or application of a function or procedure to arguments. In the example above, a new function called 'f' is created that takes an argument 'x', and returns 2 times the argument plus 12.

```<code>> f:=x->2*x+12;
> f(4);
  20
</code>```

Length 11

```<code>assume(x>0)
</code>```

The assume routine sets variable properties and makes it possible to set relationships between variables. A common use is shown in the example above: the assume routine declares that a variable 'x' is a positive real constant. Applying such an assumption makes it possible for Maple to simplify expressions such as:

```<code>> type(1,posint);
  true
</code>```0

Which returns 'x' only after an assumption is placed on the variable 'x'.

Length 10

```<code>> type(1,posint);
  true
</code>```1

The D command serves different purposes. It is primarily a differentiation command, similar to one of Maple's most used commands, diff, but it is also more general in two ways: it can represent derivatives evaluated at a point and can differentiate procedures.

Length 9

```<code>> type(1,posint);
  true
</code>```2

Euler's identity states that exp(I*Pi) + 1 = 0. In Maple's 1-D code, this is 9 characters long, however using 2-D Math notation, this can be displayed using 3 characters (4 if you count the space needed for the implicit multiplication of I and Pi):

Length 8

```<code>> type(1,posint);
  true
</code>```3

This is the first entry that uses one of the most important parts of Maple: plotting. Even though it is possible to construct a plot with less characters, i.e. plot(), this example gives a much more interesting result: the plot of the Cosine Integral.

This certainly isn't the last time you'll see a plot in this list as there are many more interesting expressions and plot variants in Maple. Some other interesting 8-character plots include:
Sine Integral:

```<code>> type(1,posint);
  true
</code>```4

Exponential Integral:

```<code>> type(1,posint);
  true
</code>```5

Natural Logarithm:

```<code>> type(1,posint);
  true
</code>```6

Length 7

```<code>> type(1,posint);
  true
</code>```7

When evaluating symbolic expressions, Maple returns results in an exact symbolic form. This means that the results are not approximated to any number of digits, rather the result is the exact value for the result. This is also what is known as having results with "infinite precision"!

```<code>> type(1,posint);
  true
</code>```8

Length 6

```<code>> type(1,posint);
  true
</code>```9

The rand command returns a random integer sampled uniformly from the range 0 to 10^12−1. Maple can also sample from numerous other statistical distributions.

```<code>plot3d(cos(x))
</code>```0

Length 5

```<code>plot3d(cos(x))
</code>```1

Maple supports arbitrary precision arithmetic. For example, here's Pi to 314 digits:

```<code>plot3d(cos(x))
</code>```2

Length 4

```<code>999!
</code>```

Maple can work with very large integers. The Factorial operator computes factorials for given values. The number of digits of 999! is:

```<code>> length(999!);
  2565
</code>```

Length 3

```<code>x$5
</code>```

The $ operator can be used to create a sequence for a given expression. For example,

```<code>> x$5
  x, x, x, x, x
> i^2$(i=1..3)
  1, 4, 9
</code>```

Length 2

```<code>x:
</code>```

Using the colon operator suppresses output for entered commands.

Length 1

```<code>∞
</code>```

Maple is a symbolic computation engine, so you can use the infinity character in computations for integrals, limits, etc. Also, results from symbolic computations can be considered to have "infinite" precision since Maple doesn't approximate purely symbolic results (see Length 7 example).

Factoid:

Maple is a mathematical programming language and computation environment. However, the name “Maple” is not an acronym for Mathematical Programming Language, it’s a reference to its Canadian heritage.

Title: Showcase of Languages

Body:
Maple

Length 15

type(1,posint);

Type checking is an important aspect of input handling for procedures and commands.

> type(1,posint);
  true

Length 14

plot3d(cos(x))

3D plots are very useful for visualizing mathematical surfaces.

Length 13

Matrix(10,10)

or

<<1,2>|<3,4>>

Matrices are one of Maple's fundamental data structures. It is possible to perform many common operations, including numerous operations in Linear Algebra on matrices. There are several calling sequences for making a new Matrix. Above are two of the most common:
The Matrix command generates a new Matrix with r rows and c columns:

Matrix(r,c);

The shorthand notation < > can also be used to input a matrix.

<<1,2>|<3,4>>;

Length 12

f:=x->2*x+12

A function can represent a function call, or application of a function or procedure to arguments. In the example above, a new function called 'f' is created that takes an argument 'x', and returns 2 times the argument plus 12.

> f:=x->2*x+12;
> f(4);
  20

Length 11

assume(x>0)

The assume routine sets variable properties and makes it possible to set relationships between variables. A common use is shown in the example above: the assume routine declares that a variable 'x' is a positive real constant. Applying such an assumption makes it possible for Maple to simplify expressions such as:

simplify( sqrt( x^2 ) )

Which returns 'x' only after an assumption is placed on the variable 'x'.

Length 10

D[1](f)(x)

The D command serves different purposes. It is primarily a differentiation command, similar to one of Maple's most used commands, diff, but it is also more general in two ways: it can represent derivatives evaluated at a point and can differentiate procedures.

Length 9

exp(I*Pi)

Euler's identity states that exp(I*Pi) + 1 = 0. In Maple's 1-D code, this is 9 characters long, however using 2-D Math notation, this can be displayed using 3 characters (4 if you count the space needed for the implicit multiplication of I and Pi):

Length 8

plot(Ci)

This is the first entry that uses one of the most important parts of Maple: plotting. Even though it is possible to construct a plot with less characters, i.e. plot(), this example gives a much more interesting result: the plot of the Cosine Integral.

This certainly isn't the last time you'll see a plot in this list as there are many more interesting expressions and plot variants in Maple. Some other interesting 8-character plots include:
Sine Integral:

plot(Si)

Exponential Integral:

plot(Ei)

Natural Logarithm:

plot(ln)

Length 7

cos(Pi)

When evaluating symbolic expressions, Maple returns results in an exact symbolic form. This means that the results are not approximated to any number of digits, rather the result is the exact value for the result. This is also what is known as having results with "infinite precision"!

> cos(Pi);
  -1
> evalf[5]( cos(Pi) );
  -1.
> cos(Pi/4);
  sqrt(2)/2
> evalf[5]( cos(Pi/4) );
  .70710

Length 6

rand()

The rand command returns a random integer sampled uniformly from the range 0 to 10^12−1. Maple can also sample from numerous other statistical distributions.

> rand();
  395718860534

Length 5

1.*Pi
1.0*π

Maple supports arbitrary precision arithmetic. For example, here's Pi to 314 digits:

> evalf[314](Pi);
  3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063

Length 4

999!

Maple can work with very large integers. The Factorial operator computes factorials for given values. The number of digits of 999! is:

> length(999!);
  2565

Length 3

x$5

The $ operator can be used to create a sequence for a given expression. For example,

> x$5
  x, x, x, x, x
> i^2$(i=1..3)
  1, 4, 9

Length 2

x:

Using the colon operator suppresses output for entered commands.

Length 1

∞

Maple is a symbolic computation engine, so you can use the infinity character in computations for integrals, limits, etc. Also, results from symbolic computations can be considered to have "infinite" precision since Maple doesn't approximate purely symbolic results (see Length 7 example).

Factoid:

Maple is a mathematical programming language and computation environment. However, the name “Maple” is not an acronym for Mathematical Programming Language, it’s a reference to its Canadian heritage.


问:
Print the Nth non-palindromic number
A palindromic number (in case you don't know) is a number which reads the same backwards and forwards (example, 11). The first 15 non-palindromic numbers are: 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26. This is A029742. I constantly need these numbers, but my sticky note pad is very small, so your code must be as short as possible.

Rules

Each submission must be a full program or function (e.g. in C, you can't just define a function without headers, but you can define a function WITH necessary headers
).

If it is possible, provide a link to a site where your program can be tested.

Your program must not write anything to STDERR.

You can take input as an argument or from STDIN (or the closest alternative in your language).

Programs are scored according to bytes. The usual character set is UTF-8, if you are using another please specify.

Standard loopholes are forbidden.

Test Cases

```<code>1
==> 10

-----

5
==> 15

-----

12
==> 23
</code>```

Scoring

This is code-golf, so least bytes wins.

Submissions

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```<code># Language Name, N bytes
</code>```

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

```<code># Ruby, <s>104</s> <s>101</s> 96 bytes
</code>```

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

```<code># Perl, 43 + 2 (-p flag) = 45 bytes
</code>```

You can also make the language name a link which will then show up in the leaderboard snippet:

```<code># [><>](http://esolangs.org/wiki/Fish), 121 bytes
</code>```

Leaderboard

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

/* Configuration */

var QUESTION_ID = 79251; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 53406; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}</code>```

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
C++ (GCC), 148 bytes

It's 1-based and the algorithm is really naive

```<code>#import <iostream>
using namespace std;int n,i=1;string s;main(){cin>>n;while(s=to_string(i+1),(n+=equal(begin(s),end(s),s.rbegin()))-i++);cout<<i;}
</code>```

Title: Print the Nth non-palindromic number

Body:
C++ (GCC), 148 bytes

It's 1-based and the algorithm is really naive

#import <iostream>
using namespace std;int n,i=1;string s;main(){cin>>n;while(s=to_string(i+1),(n+=equal(begin(s),end(s),s.rbegin()))-i++);cout<<i;}


问:
Open the browser to http://codegolf.stackexchange.com
Your job is to open a browser window of the default browser to http://codegolf.stackexchange.com.

Your code must open the browser itself, and cannot rely on an open one.

This is code-golf, so the shortest answer in bytes wins.

Moderator note: A large number of answers to this challenge use the URLs http://ppcg.lol or http://ppcg.ga. These URLs did direct to https://codegolf.stackexchange.com at the time, but have since expired. By this meta discussion, they have been allowed to stay, with the note that they are currently invalid.

答:
Cheddar, 65 bytes

```<code>cheddar.internal(cheddar.uid).require("open").c("http://ppcg.ga")
</code>```

Accesses cheddar internals and then calls upon open package and calls it with string to PPCG. Make sure you have open npm package installed

ContentLicense: CC BY-SA 4.0

Body:
Cheddar, 65 bytes

cheddar.internal(cheddar.uid).require("open").c("http://ppcg.ga")

Accesses cheddar internals and then calls upon open package and calls it with string to PPCG. Make sure you have open npm package installed


问:
"Hello, World!"
So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with hello-world, and counting). While this is not the most interesting code golf in the common languages, finding the shortest solution in certain esolangs can be a serious challenge. For instance, to my knowledge it is not known whether the shortest possible Brainfuck solution has been found yet.

Furthermore, while all of <s>Wikipedia</s> (the Wikipedia entry has been deleted but there is a copy at archive.org
), esolangs and Rosetta Code have lists of "Hello, World!" programs, none of these are interested in having the shortest for each language (there is also this GitHub repository). If we want to be a significant site in the code golf community, I think we should try and create the ultimate catalogue of shortest "Hello, World!" programs (similar to how our basic quine challenge contains some of the shortest known quines in various languages). So let's do this!

The Rules

Each submission must be a full program.

The program must take no input, and print Hello, World! to STDOUT (this exact byte stream, including capitalization and punctuation) plus an optional trailing newline, and nothing else.

The program must not write anything to STDERR.

If anyone wants to abuse this by creating a language where the empty program prints Hello, World!, then congrats, they just paved the way for a very boring answer.

Note that there must be an interpreter so the submission can be tested. It is allowed (and even encouraged) to write this interpreter yourself for a previously unimplemented language.

Submissions are scored in bytes, in an appropriate (pre-existing) encoding, usually (but not necessarily) UTF-8. Some languages, like Folders, are a bit tricky to score - if in doubt, please ask on Meta.

This is not about finding the language with the shortest "Hello, World!" program. This is about finding the shortest "Hello, World!" program in every language. Therefore, I will not mark any answer as "accepted".

If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainfuck-derivatives like Alphuck), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.

As a side note, please don't downvote boring (but valid) answers in languages where there is not much to golf - these are still useful to this question as it tries to compile a catalogue as complete as possible. However, do primarily upvote answers in languages where the authors actually had to put effort into golfing the code.

For inspiration, check the Hello World Collection.

The Catalogue

The Stack Snippet at the bottom of this post generates the catalogue from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```<code>## Language Name, N bytes
</code>```

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

```<code>## Ruby, <s>104</s> <s>101</s> 96 bytes
</code>```

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

```<code>## Perl, 43 + 2 (-p flag) = 45 bytes
</code>```

You can also make the language name a link which will then show up in the snippet:

```<code>## [><>](https://esolangs.org/wiki/Fish), 121 bytes
</code>```

/* Configuration */

var QUESTION_ID = 55422; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 8478; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,<]*(?:<(?:[^\n>]*>[^\n<]*<\/[^\n>]*>)[^\n,<]*)*),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });
    else console.log(body);
  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    lang = jQuery(''+lang+'').text();

    languages[lang] = languages[lang] || {lang: a.language, lang_raw: lang, user: a.user, size: a.size, link: a.link};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.lang_raw.toLowerCase() > b.lang_raw.toLowerCase()) return 1;
    if (a.lang_raw.toLowerCase() < b.lang_raw.toLowerCase()) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body {
  text-align: left !important;
  display: block !important;
}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 500px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}</code>```

<link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/codegolf/all.css?v=ffb5d0584c5f">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
Node.js REPL, 20 bytes

```<code>throw"Hello, World!"
</code>```

Output:

```<code>> throw"Hello, World!"
Hello, World!
</code>```

Title: "Hello, World!"

Body:
Node.js REPL, 20 bytes

throw"Hello, World!"

Output:

> throw"Hello, World!"
Hello, World!


答:
C, 84 bytes

Function f(n) takes integer n and returns n-th non-palindromic number (1 based).

```<code>g(n,r){return n?g(n/10,r*10+n%10):r;}s;f(n){for(s=9;n--;g(++s,0)==s&&s++);return s;}
</code>```

Test it on Ideone!

It's fairly trivial code, thus there is probably space for improvement.

Title: Print the Nth non-palindromic number

Body:
A palindromic number (in case you don't know) is a number which reads the same backwards and forwards (example, 11). The first 15 non-palindromic numbers are: 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26. This is A029742. I constantly need these numbers, but my sticky note pad is very small, so your code must be as short as possible.

Rules

Each submission must be a full program or function (e.g. in C, you can't just define a function without headers, but you can define a function WITH necessary headers
).

If it is possible, provide a link to a site where your program can be tested.

Your program must not write anything to STDERR.

You can take input as an argument or from STDIN (or the closest alternative in your language).

Programs are scored according to bytes. The usual character set is UTF-8, if you are using another please specify.

Standard loopholes are forbidden.

Test Cases

```<code>1
==> 10

-----

5
==> 15

-----

12
==> 23
</code>```

Scoring

This is code-golf, so least bytes wins.

Submissions

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```<code># Language Name, N bytes
</code>```

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

```<code># Ruby, <s>104</s> <s>101</s> 96 bytes
</code>```

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

```<code># Perl, 43 + 2 (-p flag) = 45 bytes
</code>```

You can also make the language name a link which will then show up in the leaderboard snippet:

```<code># [><>](http://esolangs.org/wiki/Fish), 121 bytes
</code>```

Leaderboard

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

/* Configuration */

var QUESTION_ID = 79251; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 53406; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/ b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}</code>```

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

Body:
C, 84 bytes

Function f(n) takes integer n and returns n-th non-palindromic number (1 based).

g(n,r){return n?g(n/10,r*10+n%10):r;}s;f(n){for(s=9;n--;g(++s,0)==s&&s++);return s;}

Test it on Ideone!

It's fairly trivial code, thus there is probably space for improvement.


问:
Convert exponents into ASCII art

Task

Your task is to convert strings like this:

```<code>abc^d+ef^g + hijk^l - M^NO^P (Ag^+)
</code>```

To strings like this:

```<code>   d   g       l    N P    +
abc +ef  + hijk  - M O  (Ag )
</code>```

Which is an approximation to abcd+efg + hijkl - MNOP (Ag+)

In words, raise the characters directly next to carets to the upper line, one character for one caret.

Specs

Extra trailing whitespaces in the output are allowed.

No chained carets like m^n^o will be given as input.

A caret will not be followed immediately by a space or by another caret.

A caret will not be preceded immediately by a space.

All carets will be preceded by at least one character and followed by at least one character.

The input string will only contain printable ASCII characters (U+0020 - U+007E)

Instead of two lines of output, you are allowed to output an array of two strings.

To those who speak regex: the input string will match this regex:

```<code>/^(?!.*(\^.\^|\^\^|\^ | \^))(?!\^)[ -~]*(?<!\^)$/
</code>```

Leaderboard

var QUESTION_ID=86647,OVERRIDE_USER=48934;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
Python 3, <s>157</s> <s>101</s> <s>98</s> <s>85</s> <s>83</s> 74 bytes

This solution keeps track of whether the previous character was ^, then decides whether to output to the first or second line based on that.

Outputs as an array of ['firstline', 'secondline'].

a=['']*2
l=0
for c in input():x=c=='^';a[l]+=c*x;a[~l]+=' '*x;l=x
print(a)
```

Saved <s>13</s> 15 bytes thanks to @LeakyNun!

Saved 7 bytes thanks to @Joffan!

Title: Convert exponents into ASCII art

Body:
Python 3, <s>157</s> <s>101</s> <s>98</s> <s>85</s> <s>83</s> 74 bytes

This solution keeps track of whether the previous character was ^, then decides whether to output to the first or second line based on that.

Outputs as an array of ['firstline', 'secondline'].

a=['']*2
l=0
for c in input():x=c=='^';a[l]+=c*x;a[~l]+=' '*x;l=x
print(a)

Saved <s>13</s> 15 bytes thanks to @LeakyNun!

Saved 7 bytes thanks to @Joffan!


问:
Golf the Subset-Sum Problem

Task

Given a list of space-delimited integers as input, output all unique non-empty subsets of these numbers that each subset sums to 0.

Test Case

Input:  8 −7 5 −3 −2

Output: -3 -2 5

Winning Criterion

This is code-golf, so the shortest code in bytes wins!

答:
Python, 120

I'm a character worse than Keith's solution.  But... this is too close to not post.  One of my favorite features of code-golf is how dissimilar similar-length solutions can be.

```<code>l=raw_input().split()
print[c for c in[[int(j)for t,j in enumerate(l)if 2**t&i]for i in range(1,2**len(l))]if sum(c)==0]
</code>```

Title: Golf the Subset-Sum Problem

Body:
Python, 120

I'm a character worse than Keith's solution.  But... this is too close to not post.  One of my favorite features of code-golf is how dissimilar similar-length solutions can be.

l=raw_input().split()
print[c for c in[[int(j)for t,j in enumerate(l)if 2**t&i]for i in range(1,2**len(l))]if sum(c)==0]


答:
V, <s>15</s> 14 bytes

```<code>ÄÒ +òf^xxé kPj
</code>```

Try it online!

A fairly straightforward solution. The perfect challenge for V!

Explanation:

```<code>Ä                "Duplicate this current line
 Ò               "Replace this line with spaces
   +             "Move to the beginning of the next line
    ò         ò  "Recursively (The second ò is implicit):
     f^          "  Find a caret
       xx        "  Delete two characters. The second will be saved into the main register
         é       "  Insert a space
           k     "  Move up
            P    "  Paste from the main register
             j   "  Move down
</code>```

Conveniently, based on how the recursion works, this will run once for every single caret.

Title: Convert exponents into ASCII art

Body:
Task

Your task is to convert strings like this:

```<code>abc^d+ef^g + hijk^l - M^NO^P (Ag^+)
</code>```

To strings like this:

```<code>   d   g       l    N P    +
abc +ef  + hijk  - M O  (Ag )
</code>```

Which is an approximation to abcd+efg + hijkl - MNOP (Ag+)

In words, raise the characters directly next to carets to the upper line, one character for one caret.

Specs

Extra trailing whitespaces in the output are allowed.

No chained carets like m^n^o will be given as input.

A caret will not be followed immediately by a space or by another caret.

A caret will not be preceded immediately by a space.

All carets will be preceded by at least one character and followed by at least one character.

The input string will only contain printable ASCII characters (U+0020 - U+007E)

Instead of two lines of output, you are allowed to output an array of two strings.

To those who speak regex: the input string will match this regex:

```<code>/^(?!.*(\^.\^|\^\^|\^ | \^))(?!\^)[ -~]*(?<!\^)$/
</code>```

Leaderboard

var QUESTION_ID=86647,OVERRIDE_USER=48934;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

Body:
V, <s>15</s> 14 bytes

ÄÒ +òf^xxé kPj

Try it online!

A fairly straightforward solution. The perfect challenge for V!

Explanation:

Ä                "Duplicate this current line
 Ò               "Replace this line with spaces
   +             "Move to the beginning of the next line
    ò         ò  "Recursively (The second ò is implicit):
     f^          "  Find a caret
       xx        "  Delete two characters. The second will be saved into the main register
         é       "  Insert a space
           k     "  Move up
            P    "  Paste from the main register
             j   "  Move down

Conveniently, based on how the recursion works, this will run once for every single caret.


Title: Convert exponents into ASCII art

Body:
Ruby, 47 + 1 (-n flag) = 48 bytes

puts$_.gsub(/\^(.)|./){$1||" "},gsub(/\^./," ")

Run it like so: ruby -ne 'puts$_.gsub(/\^(.)|./){$1||" "},gsub(/\^./," ")'


答:
Pyth, 17 bytes

```<code>CcsmX~Z1j;d;cQ\^2

             Q      input string
            c \^    split on '^'
   m                map for sections d:
    X      ;          insert a space at index:
     ~Z1                the old value of Z (initially 0), before setting Z to 1
                      into:
        j;d             the section joined on spaces
  s                 concatenate
 c              2   chop into groups of 2
C                   transpose
</code>```

Returns an array of 2 strings.  (Prepend j to join them with a newline.)

Try it online.

Title: Convert exponents into ASCII art

Body:
Pyth, 17 bytes

CcsmX~Z1j;d;cQ\^2

             Q      input string
            c \^    split on '^'
   m                map for sections d:
    X      ;          insert a space at index:
     ~Z1                the old value of Z (initially 0), before setting Z to 1
                      into:
        j;d             the section joined on spaces
  s                 concatenate
 c              2   chop into groups of 2
C                   transpose

Returns an array of 2 strings.  (Prepend j to join them with a newline.)

Try it online.


答:
Javascript, 190 bytes

Late to the party, but I was piqued by @jdstankosky 's comment and decided to take a different approach. Here's a Javascript entry that mauls a template and evals itself along the way.

```<code>t="a*b=c ";u="";r=u;for(i=1;i<10;i++){a=0;u=u+t;r+=u.split(' ').map(x=>x.replace('a',++a).replace('b',i)).map(x=>x.replace('*','x').replace('c',eval(x.substr(0,3)))).join(' ')+'\n'}alert(r);
</code>```

Un-golfed version (slightly older version in which a function returns the table instead of a script alerting it, but the same principles apply):

```<code>function f()
{
    t="a*b=c "; // template for our multiplication table
    u="";r="";  // tmp- and return values
    for(i=1;i<10;i++)
    {
        a=0;    // is auto-incremented in MAP
        u=u+t;// extend the template once per iteration
        v=u.split(' '); // Smash the template to pieces
        w=v.map(x=>x.replace('a', ++a).replace('b', i)) // MAP replaces the A and B's with the correct numbers
        w=w.map(x=>x.replace('*', 'x').replace('c', eval(x.substring(0,3)))).join(' '); // second map evals that and replaces c with the answer, makes the asteriks into an X
        r=r+w+'\n'  // results get concatenated
    }
    return r;
}
</code>```

Title: Print this Multiplication Table

Body:
Write shortest code to print the following Multiplication Table:</p>

```<code>1×1=1
1×2=2  2×2=4
1×3=3  2×3=6  3×3=9
1×4=4  2×4=8  3×4=12 4×4=16
1×5=5  2×5=10 3×5=15 4×5=20 5×5=25
1×6=6  2×6=12 3×6=18 4×6=24 5×6=30 6×6=36
1×7=7  2×7=14 3×7=21 4×7=28 5×7=35 6×7=42 7×7=49
1×8=8  2×8=16 3×8=24 4×8=32 5×8=40 6×8=48 7×8=56 8×8=64
1×9=9  2×9=18 3×9=27 4×9=36 5×9=45 6×9=54 7×9=63 8×9=72 9×9=81
</code>```

Body:
Javascript, 190 bytes

Late to the party, but I was piqued by @jdstankosky 's comment and decided to take a different approach. Here's a Javascript entry that mauls a template and evals itself along the way.

t="a*b=c ";u="";r=u;for(i=1;i<10;i++){a=0;u=u+t;r+=u.split(' ').map(x=>x.replace('a',++a).replace('b',i)).map(x=>x.replace('*','x').replace('c',eval(x.substr(0,3)))).join(' ')+'\n'}alert(r);

Un-golfed version (slightly older version in which a function returns the table instead of a script alerting it, but the same principles apply):

function f()
{
    t="a*b=c "; // template for our multiplication table
    u="";r="";  // tmp- and return values
    for(i=1;i<10;i++)
    {
        a=0;    // is auto-incremented in MAP
        u=u+t;// extend the template once per iteration
        v=u.split(' '); // Smash the template to pieces
        w=v.map(x=>x.replace('a', ++a).replace('b', i)) // MAP replaces the A and B's with the correct numbers
        w=w.map(x=>x.replace('*', 'x').replace('c', eval(x.substring(0,3)))).join(' '); // second map evals that and replaces c with the answer, makes the asteriks into an X
        r=r+w+'\n'  // results get concatenated
    }
    return r;
}


答:
MATL, 18 bytes

```<code>94=t1YSt~&vG*cw~Z)
</code>```

Try it online!

```<code>94=    % Take input implicitly. Create logical array of the same size that contains
       % true for carets, false otherwise
t      % Push a copy of this array
1YS    % Circularly shift 1 unit to the right. This gives an array that contains true
       % for the elements right after a caret (superindices), and false for the rest
t~     % Push a copy and negate
&v     % Concatenate vertically. This gives a 2D, 2-row array
G*     % Push the input again, multiply with broadcast. This gives a 2D array in
       % which the first row contains the superindices (characters after a caret)
       % and 0 for the rest; and the second row contains the non-superindices and
       % 0 for the superindices
c      % Convert to char
w      % Swap. Brings to top the array containing true for carets and false otherwise
~      % Negate
Z)     % Use as logical index to remove rows that contain carets. Display implicitly
</code>```

Title: Convert exponents into ASCII art

Body:
MATL, 18 bytes

94=t1YSt~&vG*cw~Z)

Try it online!

94=    % Take input implicitly. Create logical array of the same size that contains
       % true for carets, false otherwise
t      % Push a copy of this array
1YS    % Circularly shift 1 unit to the right. This gives an array that contains true
       % for the elements right after a caret (superindices), and false for the rest
t~     % Push a copy and negate
&v     % Concatenate vertically. This gives a 2D, 2-row array
G*     % Push the input again, multiply with broadcast. This gives a 2D array in
       % which the first row contains the superindices (characters after a caret)
       % and 0 for the rest; and the second row contains the non-superindices and
       % 0 for the superindices
c      % Convert to char
w      % Swap. Brings to top the array containing true for carets and false otherwise
~      % Negate
Z)     % Use as logical index to remove rows that contain carets. Display implicitly


答:
Perl, 21 + 1 = 22 bytes

```<code>say'';s/\^(.)/♥[A\1↓/
</code>```

Run with the -p flag. Replace ♥ with a raw ESC byte (0x1b), and ↓ with a vertical tab (0x0b).

The vertical tab is Martin Ender’s idea. It saved two bytes! Thanks.

Title: Convert exponents into ASCII art

Body:
Perl, 21 + 1 = 22 bytes

say'';s/\^(.)/♥[A\1↓/

Run with the -p flag. Replace ♥ with a raw ESC byte (0x1b), and ↓ with a vertical tab (0x0b).

The vertical tab is Martin Ender’s idea. It saved two bytes! Thanks.


答:
Python (2), <s>76</s> <s>68</s> 67 Bytes

-5 Bytes thanks to @LeakyNun

-3 Bytes thanks to @KevinLau-notKenny

-1 Byte  thanks to @ValueInk

-0 bytes thanks to @DrGreenEggsandIronMan

```<code>import re
lambda i,s=re.sub:[s("(?<!\^).\^?"," ",i),s("\^."," ",i)]
</code>```

This anonymous Lambda function takes the input string as its only argument and returns the two output lines separated by a newline. To call it give it a name by writing "f=" before it.

Pretty straightforward regex: The first part replaces the following by a space: any character and a <s>carrot</s> caret or only a char, but only if there is no caret before them. The second part replaces any caret in the string and the char after it by a space.

Title: Convert exponents into ASCII art

Body:
Python (2), <s>76</s> <s>68</s> 67 Bytes

-5 Bytes thanks to @LeakyNun

-3 Bytes thanks to @KevinLau-notKenny

-1 Byte  thanks to @ValueInk

-0 bytes thanks to @DrGreenEggsandIronMan

import re
lambda i,s=re.sub:[s("(?<!\^).\^?"," ",i),s("\^."," ",i)]

This anonymous Lambda function takes the input string as its only argument and returns the two output lines separated by a newline. To call it give it a name by writing "f=" before it.

Pretty straightforward regex: The first part replaces the following by a space: any character and a <s>carrot</s> caret or only a char, but only if there is no caret before them. The second part replaces any caret in the string and the char after it by a space.


答:
JavaScript (ES6), <s>56</s> 55 bytes

```<code>s=>[/.(\^(.))?/g,/\^.(())/g].map(r=>s.replace(r,' $2'))
</code>```

Regexps to the rescue of course. The first one replaces all characters with spaces, unless it finds a caret, in which case it deletes the caret and keeps the character after it. (These characters are guaranteed to exist.) The second is the obvious one to replace each caret and its following character with a space.

Edit: Saved 1 byte thanks to @Lynn who devised a way to reuse the replacement string for the second replace allowing the replace to be mapped over an array of regexps.

Title: Convert exponents into ASCII art

Body:
JavaScript (ES6), <s>56</s> 55 bytes

s=>[/.(\^(.))?/g,/\^.(())/g].map(r=>s.replace(r,' $2'))

Regexps to the rescue of course. The first one replaces all characters with spaces, unless it finds a caret, in which case it deletes the caret and keeps the character after it. (These characters are guaranteed to exist.) The second is the obvious one to replace each caret and its following character with a space.

Edit: Saved 1 byte thanks to @Lynn who devised a way to reuse the replacement string for the second replace allowing the replace to be mapped over an array of regexps.


问:
Visualize chain rule

Definition

The chain rule with two functions state that:

```<code>D[f(g(x))] = f'(g(x)) * g'(x)
</code>```

Or, alternatively:

```<code>D[f1(f2(x))] = f1'(f2(x)) * f2'(x)
</code>```

The chain rule with three functions state that:

```<code>D[f(g(h(x)))] = f'(g(h(x))) * g'(h(x)) * h'(x)
</code>```

Or, alternatively:

```<code>D[f1(f2(f3(x)))] = f1'(f2(f3(x))) * f2'(f3(x)) * f3'(x)
</code>```

Et cetera.

Task

Given an integer between 2 and 21, output the chain rule with that many functions, either in the first form or in the second form.

Please specify if you are using the second form.

Specs

The format of the string must be exactly that stated above, with:

all the spaces kept intact

a capitalized D

a square bracket immediately following D

the asterisk kept intact

One extra trailing space (U+0020) is allowed.

Leading zeros in the function names in the second form (e.g. f01 instead of f1) is allowed.

Testcases

If you use the first form:

```<code>input output
2     D[f(g(x))] = f'(g(x)) * g'(x)
3     D[f(g(h(x)))] = f'(g(h(x))) * g'(h(x)) * h'(x)
</code>```

If you use the second form:

```<code>input output
2     D[f1(f2(x))] = f1'(f2(x)) * f2'(x)
3     D[f1(f2(f3(x)))] = f1'(f2(f3(x))) * f2'(f3(x)) * f3'(x)
</code>```

Leaderboard

var QUESTION_ID=86652,OVERRIDE_USER=48934;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
JavaScript (ES6), 89 bytes

f=n=>--n?f(n).replace(/x/g,`${c=(n+15).toString(36)}(x)`)+` * ${c}'(x)`:`D[f(x)] = f'(x)`
```

<p>Or 75 bytes using the second form:</p>

<pre class="lang-javascript prettyprint-override"><code>f=n=>n>1?f(n-1).replace(/x/g,`f${n}(x)`)+` * f${n}'(x)`:`D[f1(x)] = f1'(x)`
</code>```

Or 82/64 bytes if I'm allowed an extra 1 * term:

f=n=>n?f(n-1).replace(/x/g,`${c=(n+14).toString(36)}(x)`)+` * ${c}'(x)`:`D[x] = 1`
f=n=>n?f(n-1).replace(/x/g,`f${n}(x)`)+` * f${n}'(x)`:`D[x] = 1`
```

Title: Visualize chain rule

Body:
JavaScript (ES6), 89 bytes

f=n=>--n?f(n).replace(/x/g,`${c=(n+15).toString(36)}(x)`)+` * ${c}'(x)`:`D[f(x)] = f'(x)`

Or 75 bytes using the second form:

f=n=>n>1?f(n-1).replace(/x/g,`f${n}(x)`)+` * f${n}'(x)`:`D[f1(x)] = f1'(x)`

Or 82/64 bytes if I'm allowed an extra 1 * term:

f=n=>n?f(n-1).replace(/x/g,`${c=(n+14).toString(36)}(x)`)+` * ${c}'(x)`:`D[x] = 1`
f=n=>n?f(n-1).replace(/x/g,`f${n}(x)`)+` * f${n}'(x)`:`D[x] = 1`


问:
Determine number of connected components
You are given a graph represented through an adjacency list. For example, the input

```<code>1-2 2-3 3-4 4-1
</code>```

would correspond to the graph with nodes 1, 2, 3 and 4, where 1 is connected to 2, 2 is connected to 3, 3 is connected to 4, and 4 is connected to 1 (forming a square).

The task is to determine the number of of connected components of the graph represented by an inputted adjacency list. A "connected component" is a set of nodes from which there is no path to any other node that is not in the set.

Example:

Intput: 1-2 2-3 4-5

  Output: 2

Language of your choice - shortest code possible.

答:
Sage, 77

```<code>len(Graph([t.split('-')for t in raw_input().split()]).connected_components())
</code>```

Body:
Sage, 77

len(Graph([t.split('-')for t in raw_input().split()]).connected_components())


答:
Python 2, 174 bytes

i=input()+1
a=lambda x:'('.join(['f%d'%e for e in range(x,i)])+'(x'+')'*(i-x)
print'D[%s] = %s'%(a(1),' * '.join(["f%d'%s%s)"%(e+1,'('*(i-e-2>0),a(e+2))for e in range(i-1)]))
```

Lots of room left to be golfed here. Uses the second form (f1, f2, etc.).

Title: Visualize chain rule

Body:
Definition

The chain rule with two functions state that:

```<code>D[f(g(x))] = f'(g(x)) * g'(x)
</code>```

Or, alternatively:

```<code>D[f1(f2(x))] = f1'(f2(x)) * f2'(x)
</code>```

The chain rule with three functions state that:

```<code>D[f(g(h(x)))] = f'(g(h(x))) * g'(h(x)) * h'(x)
</code>```

Or, alternatively:

```<code>D[f1(f2(f3(x)))] = f1'(f2(f3(x))) * f2'(f3(x)) * f3'(x)
</code>```

Et cetera.

Task

Given an integer between 2 and 21, output the chain rule with that many functions, either in the first form or in the second form.

Please specify if you are using the second form.

Specs

The format of the string must be exactly that stated above, with:

all the spaces kept intact

a capitalized D

a square bracket immediately following D

the asterisk kept intact

One extra trailing space (U+0020) is allowed.

Leading zeros in the function names in the second form (e.g. f01 instead of f1) is allowed.

Testcases

If you use the first form:

```<code>input output
2     D[f(g(x))] = f'(g(x)) * g'(x)
3     D[f(g(h(x)))] = f'(g(h(x))) * g'(h(x)) * h'(x)
</code>```

If you use the second form:

```<code>input output
2     D[f1(f2(x))] = f1'(f2(x)) * f2'(x)
3     D[f1(f2(f3(x)))] = f1'(f2(f3(x))) * f2'(f3(x)) * f3'(x)
</code>```

Leaderboard

var QUESTION_ID=86652,OVERRIDE_USER=48934;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

Body:
Python 2, 174 bytes

i=input()+1
a=lambda x:'('.join(['f%d'%e for e in range(x,i)])+'(x'+')'*(i-x)
print'D[%s] = %s'%(a(1),' * '.join(["f%d'%s%s)"%(e+1,'('*(i-e-2>0),a(e+2))for e in range(i-1)]))

Lots of room left to be golfed here. Uses the second form (f1, f2, etc.).


答:
Cheddar, <s>77</s> <s>72</s> 67 bytes

```<code>l->l.chars.vfuse.replace("^\n"," ").lines.map(j->"%-2s"%j).turn(3)
</code>```

No regex!

I love this answer as it is a wonderful demonstration of Cheddar's abilities. Mainly thanks to the replace function added by Conor. The PR to dev was never made so the replace function only exists on this branch (update: I made the PR and now it's on the latest beta branch which you can install with npm install -g cheddar-lang)

I have found a way to golf it but unfortunately an oversight results in this happening when item lengths are not the same:

```<code>["   denifednud   denifednug       denifednul    denifednuN denifednuP    denifednu+ ", "abcdenifednu +efdenifednu  + hijkdenifednu  - Mdenifednu Odenifednu  (Agdenifednu )"]
</code>```

I could have saved a lot of bytes using regex, and in fact I just made regexes for Cheddar... the only problem is that there are no regex functions :/

Explanation

```<code>l->                    // Function take input as `l`
   l.chars             // Get array of chars in input
   .vfuse              // Join with newlines
   .replace("^\n"," ") // Replace `^\n` with a space globally
   .lines              // Get the lines (see below for more details on what this returns)
   .map(j->            // Loop through each "line" `j` is arg
       "%-2s"          // C-like printf format.
                       // think of as: padRight(j, " ", 2)
                       // see below for more details
        % j            // Pass j as the string to insert
   ).turn(3)           // Turn the string 270 degrees (see below)
   .vfuse              // Vertically fuse to get result (this is not needed as we can output an array of the lines)
</code>```

To get a better understanding. This is what .lines returns for 1^2

```<code>["1", " 2"]
</code>```

the .turn with rotate this:

```<code>1
 2
</code>```

into:

```<code> 2
1
</code>```

Another example which will make it more clear:

```<code>1
 2
2
 2
</code>```

becomes:

```<code> 2 2
1 2
</code>```

Why format?

What the %-2s is doing is pretty simple. % specifies we are starting a "format", or that a variable will be inserted into this string at this point. - means to right-pad the string, and 2 is the max-length. By default it pads with spaces. s just specifies it's a string. To see what it does:

```<code>"%-2s" % "a"  == "a "
"%-2s" % " a" == " a"
</code>```

Title: Convert exponents into ASCII art

Body:
Cheddar, <s>77</s> <s>72</s> 67 bytes

l->l.chars.vfuse.replace("^\n"," ").lines.map(j->"%-2s"%j).turn(3)

No regex!

I love this answer as it is a wonderful demonstration of Cheddar's abilities. Mainly thanks to the replace function added by Conor. The PR to dev was never made so the replace function only exists on this branch (update: I made the PR and now it's on the latest beta branch which you can install with npm install -g cheddar-lang)

I have found a way to golf it but unfortunately an oversight results in this happening when item lengths are not the same:

["   denifednud   denifednug       denifednul    denifednuN denifednuP    denifednu+ ", "abcdenifednu +efdenifednu  + hijkdenifednu  - Mdenifednu Odenifednu  (Agdenifednu )"]

I could have saved a lot of bytes using regex, and in fact I just made regexes for Cheddar... the only problem is that there are no regex functions :/

Explanation

l->                    // Function take input as `l`
   l.chars             // Get array of chars in input
   .vfuse              // Join with newlines
   .replace("^\n"," ") // Replace `^\n` with a space globally
   .lines              // Get the lines (see below for more details on what this returns)
   .map(j->            // Loop through each "line" `j` is arg
       "%-2s"          // C-like printf format.
                       // think of as: padRight(j, " ", 2)
                       // see below for more details
        % j            // Pass j as the string to insert
   ).turn(3)           // Turn the string 270 degrees (see below)
   .vfuse              // Vertically fuse to get result (this is not needed as we can output an array of the lines)

To get a better understanding. This is what .lines returns for 1^2

["1", " 2"]

the .turn with rotate this:

1
 2

into:

 2
1

Another example which will make it more clear:

1
 2
2
 2

becomes:

 2 2
1 2

Why format?

What the %-2s is doing is pretty simple. % specifies we are starting a "format", or that a variable will be inserted into this string at this point. - means to right-pad the string, and 2 is the max-length. By default it pads with spaces. s just specifies it's a string. To see what it does:

"%-2s" % "a"  == "a "
"%-2s" % " a" == " a"


答:
JavaScript (ES6), 194 bytes

n=>{s="D[";for(i=1;i<=n;i++)s+="f"+i+"(";s+="x";s+=")".repeat(n);s+="] = ";for(i=1;i<=n;i++){s+="f"+i+"'(";for(j=i+1;j<=n;j++)s+="f"+j+"(";s+="x";s+=")".repeat(n-i+1);if(i-n)s+=" * ";}return s;}
```

<p>31 bytes saved thanks to @LeakyNun.</p>

<p>It's an anonymous lambda function.
I'm sure there's some way to shorten this...</p>

<h2>Ungolfed</h2>

<pre class="lang-javascript prettyprint-override"><code>var chain = function(n) {
    var str = "D["; // derivative symbol
    for (var i = 1; i <= n; i++) {
        str += "f"+i+"("; // put in n functions, each labeled f1(, f2(, etc.
    }
    str += "x"; // add in the function input, usually "x"
    for (var i = 0; i < n; i++) {
        str += ")"; // add in n end parentheses
    }
    str += "] = "; // add in the end bracket and the equals operator
    for (var i = 1; i <= n; i++) {
        str += "f"+i+"'("; // add in all n of the outer functions with the prime operator
        for (var j = i+1; j <= n; j++) {
            str += "f"+j+"("; // add in all of the inner functions
        }
        str += "x"; // add in the input, "x"
        for (var j = 1; j <= n; j++) {
            str += ")"; // close the parentheses
        }
        if (i !== n) {
            str += " * "; // the multiplication of all of the outer primed functions
        }
    }
    return str;
};
</code>```

Title: Visualize chain rule

Body:
JavaScript (ES6), 194 bytes

n=>{s="D[";for(i=1;i<=n;i++)s+="f"+i+"(";s+="x";s+=")".repeat(n);s+="] = ";for(i=1;i<=n;i++){s+="f"+i+"'(";for(j=i+1;j<=n;j++)s+="f"+j+"(";s+="x";s+=")".repeat(n-i+1);if(i-n)s+=" * ";}return s;}

31 bytes saved thanks to @LeakyNun.

It's an anonymous lambda function.
I'm sure there's some way to shorten this...

Ungolfed

var chain = function(n) {
    var str = "D["; // derivative symbol
    for (var i = 1; i <= n; i++) {
        str += "f"+i+"("; // put in n functions, each labeled f1(, f2(, etc.
    }
    str += "x"; // add in the function input, usually "x"
    for (var i = 0; i < n; i++) {
        str += ")"; // add in n end parentheses
    }
    str += "] = "; // add in the end bracket and the equals operator
    for (var i = 1; i <= n; i++) {
        str += "f"+i+"'("; // add in all n of the outer functions with the prime operator
        for (var j = i+1; j <= n; j++) {
            str += "f"+j+"("; // add in all of the inner functions
        }
        str += "x"; // add in the input, "x"
        for (var j = 1; j <= n; j++) {
            str += ")"; // close the parentheses
        }
        if (i !== n) {
            str += " * "; // the multiplication of all of the outer primed functions
        }
    }
    return str;
};


答:
Ruby, 72 bytes

Second form. Port to Ruby from @Neil answer.

f=->n{n>1?f[n-1].gsub(?x,"f#{n}(x)")+" * f#{n}'(x)":"D[f1(x)] = f1'(x)"}
```

Title: Visualize chain rule


问:
Generate a Stack Exchange Favicon
Do you recognize the PPCG logo?
it looks like this, when you do an ascii art of it.

```<code>+---+
|PCG|
+---+
   v
</code>```

Now, In this Code Golf, You will make a code, that makes logos for other sites, similar to the PPCG logo.

What You should do

The "Shortened" string will be the string, with all upper case letters and numbers in the input string.(Which would be PPCG when the input string is Programming Puzzles & Code Golf)

The "Box" (

```<code>+---+
|   |
+---+
   v
</code>```

)
should fit the Shortened string perfectly.(No bigger or smaller)

Also the v part should be exactly 1 down and 1 left to the down right +.

Then output the box which has the shortened string in it.

Example

Stack Overflow:

```<code>+--+
|SO|
+--+
  v
</code>```

Area 51:

```<code>+---+
|A51|
+---+
   v
</code>```

Rules

You may assume that the input contains at least one digit or upper case letter.

Standard code-golf rules apply.

答:
Haskell, 107 Bytes

This answer is heavily based on the answer by Zylviij and the comments by nimi. I would have added more comments to that answer, but alas, I don't have enough rep.

o n=t++'|':f++"|\n"++t++(f>>" ")++"v"where f=[c|c<-n,any(==c)$['0'..'9']++['A'..'Z']];t='+':(f>>"-")++"+\n"
```

Additional tricks used:

Replaced intersect by its implementation so the import can be dropped. (Side note: the implementation is nearly verbatim the library one, I couldn't find a shorter version.)

Moved the helper functions into the where clause so functions can use the n parameter internally.

After that, (#) was short enough to be inlined.

Put everything on one line to limit extra whitespace.

Title: Generate a Stack Exchange Favicon

Body:
Haskell, 107 Bytes

This answer is heavily based on the answer by Zylviij and the comments by nimi. I would have added more comments to that answer, but alas, I don't have enough rep.

o n=t++'|':f++"|\n"++t++(f>>" ")++"v"where f=[c|c<-n,any(==c)$['0'..'9']++['A'..'Z']];t='+':(f>>"-")++"+\n"

Additional tricks used:

Replaced intersect by its implementation so the import can be dropped. (Side note: the implementation is nearly verbatim the library one, I couldn't find a shorter version.)

Moved the helper functions into the where clause so functions can use the n parameter internally.

After that, (#) was short enough to be inlined.

Put everything on one line to limit extra whitespace.


问:
Interquartile Mean

Task

Given (by any means) a sorted floating point dataset, return (by any means and within 1‰ of the correct value) the interquartile mean.

One possible algorithm

Discard the lowest and highest quarters of the data points.

Calculate the average (sum divided by count) of the remaining data points.

Note: If the dataset size is not evenly split-able in four, you will have to weigh the datapoints that are shared by sub-sets. See Example evaluation 2 below.

Example evaluation 1

Given {1, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 38}

Data count is 12, so we remove lowest and highest 3 datapoints:
{<s>1, 3, 4,</s> 5, 6, 6, 7, 7, 8, <s>8, 9, 38</s>}

Average of the remaining 6 datapoints:
(5 + 6 + 6 + 7 + 7 + 8) / 6 = 6.5

Example evaluation 2

Given {1, 3, 5, 7, 9, 11, 13, 15, 17}

Count is 9, so each quarter has 2¼ datapoints:
{<s>1, 2, (0.25×5),</s> (0.75×5), 7, 9, 11, (0.75×13), <s>(0.25×13), 15, 17</s>}

Average of the remaining 4.5 datapoints:
(0.75×5 + 7 + 9 + 11 + 0.75×13) / 4.5 = 9

答:
Java <s>146</s> 126 Bytes

Such java much verbose!

```<code>float m(float[]n){float r=0;int l=n.length,i=l/4;r-=(n[i])*(l%4)/4;r+=n[i*3]*(4-(l%4))/4;for(;i<l*3/4;r+=n[i],i++);return r/l*2;}
</code>```

Older Ungolfed partially readable with test cases

```<code>/**
 *
 * @author rohan
 */
public Golf{

float m(float[]n){
//declarations
float r=0;
int x,i=0,l=n.length;
//sum the array
for(float m:n){r+=m;}
//remove the excess
for(;i<l/4;r-=n[i]+n[l-i-1],i++);
//weight the quartiles
r-=(n[l/4]+n[l*3/4])*(l%4)/4;
//return the sum/length but multiply by two since only half of the set is averaged
return r/l*2;
    }
static void interQuartileMean(float... set){
    System.out.println(new Golf().m(set));
}
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    //test cases pass with flying colours
        interQuartileMean(1, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 38);
        interQuartileMean(1, 3, 5, 7, 9, 11, 13, 15, 17);
    }

}
</code>```

Title: Interquartile Mean

Body:
Java <s>146</s> 126 Bytes

Such java much verbose!

float m(float[]n){float r=0;int l=n.length,i=l/4;r-=(n[i])*(l%4)/4;r+=n[i*3]*(4-(l%4))/4;for(;i<l*3/4;r+=n[i],i++);return r/l*2;}

Older Ungolfed partially readable with test cases

/**
 *
 * @author rohan
 */
public Golf{

float m(float[]n){
//declarations
float r=0;
int x,i=0,l=n.length;
//sum the array
for(float m:n){r+=m;}
//remove the excess
for(;i<l/4;r-=n[i]+n[l-i-1],i++);
//weight the quartiles
r-=(n[l/4]+n[l*3/4])*(l%4)/4;
//return the sum/length but multiply by two since only half of the set is averaged
return r/l*2;
    }
static void interQuartileMean(float... set){
    System.out.println(new Golf().m(set));
}
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    //test cases pass with flying colours
        interQuartileMean(1, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 38);
        interQuartileMean(1, 3, 5, 7, 9, 11, 13, 15, 17);
    }

}


问:
Add two numbers
Input: Two integers. Preferably decimal integers, but other forms of numbers can be used. These can be given to the code in standard input, as arguments to the program or function, or as a list.

Output: Their sum. Use the same format for output integers as input integers. For example, the input 5 16 would lead to the output 21.

Restrictions: No standard loopholes please. This is code-golf, answer in lowest amount of bytes wins.

Notes: This should be fairly trivial, however I'm interested to see how it can be implemented. The answer can be a complete program or a function, but please identify which one it is.

Test cases:

```<code>1 2 -> 3
14 15 -> 29
7 9 -> 16
-1 8 -> 7
8 -9 -> -1
-8 -9 -> -17
</code>```

Or as CSV:

```<code>a,b,c
1,2,3
14,15,29
7,9,16
-1,8,7
8,-9,-1
-8,-9,-17
</code>```

Leaderboard

var QUESTION_ID=84260,OVERRIDE_USER=8478;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
Ruby, 17 bytes

```<code>def f(i,j)i+j;end
</code>```

Functions in Ruby return the last evaluated expression.

Title: Add two numbers

Body:
Ruby, 17 bytes

def f(i,j)i+j;end

Functions in Ruby return the last evaluated expression.


问:
Print a Lego piece
This challenge is a simple ascii-art one. Given two inputs, describing the height and width of a Lego piece, you have print an ASCII art representation of it.

Here is how the Lego pieces are supposed to look:

```<code>(4, 2)

___________
| o o o o |
| o o o o |
-----------

(8, 2)

___________________
| o o o o o o o o |
| o o o o o o o o |
-------------------

(4, 4)

___________
| o o o o |
| o o o o |
| o o o o |
| o o o o |
-----------

(3, 2)

_________
| o o o |
| o o o |
---------

(1, 1)

o
</code>```

If you can't tell from the test-cases, the top and bottom are width*2+3 underscores and dashes, and each row has pipes for the sides, o's for the little things, and everything is separated by spaces.

The only exception for this is (1, 1), which is just a single o.

You will never get 0 for any of the dimensions.

This is code-golf, so shortest code in bytes wins!

var QUESTION_ID=84050,OVERRIDE_USER=31343;function answersUrl(e){return"http://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"http://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
Cinnamon Gum, 32 bytes

```<code>0000000: 6c07 d5f5 7a5d 9cdf 5ae6 52ae 4050 0c35  l...z]..Z.R.@P.5
0000010: 18d9 052f 0082 9b42 e7c8 e422 5fe4 7d9f  .../...B..."_.}.
</code>```

Non-competing. Try it online. Input must be exactly in the form [width,height] with no space in between the comma and the height.

Explanation

The string decompresses to this:

```<code>l[1,1]&o;?&`p___~__~
%| ~o ~|
%---~--~
</code>```

The first l stage maps [1,1] to o (the special case) and everything else to the string

```<code>`p___~__~
%| ~o ~|
%---~--~
</code>```

The backtick then signals the start of a second stage; instead of outputting that string, CG chops off the backtick and executes the string. The p mode then repeats all the characters inside the tildes first parameter (width) times and then afterwards repeats the characters inside the percent signs second parameter (height) times. So for [4,2] it turns into this:

```<code>___________
%| o o o o |
%-----------
</code>```

and then into:

```<code>___________
| o o o o |
| o o o o |
-----------
</code>```

Title: Print a Lego piece

Body:
Cinnamon Gum, 32 bytes

0000000: 6c07 d5f5 7a5d 9cdf 5ae6 52ae 4050 0c35  l...z]..Z.R.@P.5
0000010: 18d9 052f 0082 9b42 e7c8 e422 5fe4 7d9f  .../...B..."_.}.

Non-competing. Try it online. Input must be exactly in the form [width,height] with no space in between the comma and the height.

Explanation

The string decompresses to this:

l[1,1]&o;?&`p___~__~
%| ~o ~|
%---~--~

The first l stage maps [1,1] to o (the special case) and everything else to the string

`p___~__~
%| ~o ~|
%---~--~

The backtick then signals the start of a second stage; instead of outputting that string, CG chops off the backtick and executes the string. The p mode then repeats all the characters inside the tildes first parameter (width) times and then afterwards repeats the characters inside the percent signs second parameter (height) times. So for [4,2] it turns into this:

___________
%| o o o o |
%-----------

and then into:

___________
| o o o o |
| o o o o |
-----------


答:
Python 2, 79 bytes

f=lambda n:0**n*"D[x] ="or f(n-1).replace("x","f%d(x)"%n)+1%n*" *"+" f%d'(x)"%n
```

<p>Outputs with numbered functions.</p>

<p>Builds the output by repeatedly replacing each <code>x</code> with <code>fn(x)</code>, then appending <code>* fn'(x)</code>. The <code>*</code> is omitted for <code>n==1</code>.</p>

<p>Compare to the iterate program (92 bytes):</p>

<pre class="lang-python prettyprint-override"><code>r="D[x] = ";n=0
exec'n+=1;r=r.replace("x","f%d(x)"%n)+"f%d\'(x) * "%n;'*input()
print r[:-3]
</code>```

96 bytes:

n=input();r='';s='x'
while n:s='f%d(%%s)'%n%s;r=" * f%d'"%n+s[2:]+r;n-=1
print"D[%s] = "%s+r[3:]
```

Outputs with numbered functions.

Accumulates the nested function f1(f2(f3(x))) in s and the right-hand-side expression in r. The string formatting is clunky; f-strings from 3.6 would do better.

Title: Visualize chain rule

Body:
Python 2, 79 bytes

f=lambda n:0**n*"D[x] ="or f(n-1).replace("x","f%d(x)"%n)+1%n*" *"+" f%d'(x)"%n

Outputs with numbered functions.

Builds the output by repeatedly replacing each x with fn(x), then appending * fn'(x). The * is omitted for n==1.

Compare to the iterate program (92 bytes):

r="D[x] = ";n=0
exec'n+=1;r=r.replace("x","f%d(x)"%n)+"f%d\'(x) * "%n;'*input()
print r[:-3]

96 bytes:

n=input();r='';s='x'
while n:s='f%d(%%s)'%n%s;r=" * f%d'"%n+s[2:]+r;n-=1
print"D[%s] = "%s+r[3:]

Outputs with numbered functions.

Accumulates the nested function f1(f2(f3(x))) in s and the right-hand-side expression in r. The string formatting is clunky; f-strings from 3.6 would do better.


问:
Render "Digital Clock Style" Numbers
Write the shortest program which will take a string of numbers (of up to at least 20 length) as input, and display the output using the standard digital clock style numbers.  For instance for input 81, a solution with ascii output would give:

```<code> _
|_|  |
|_|  |
</code>```

Graphical output is also acceptable, if it helps.

答:
Bash, 11 characters

```<code>toilet "$i"
</code>```

Yes I know, I'm cheating.

You need to have toilet installed.

ContentLicense: CC BY-SA 2.5

Title: Render "Digital Clock Style" Numbers

Body:
Bash, 11 characters

toilet "$i"

Yes I know, I'm cheating.

You need to have toilet installed.


问:
Do X without Y
Usually, it is said that "Doing X without Y" can be a trap to beginners writing challenges (source). However, I am cocky and think that I can definitely make an X without any Ys. Randomly. Oh yes, this will be good.

Challenge: Given an odd integer n greater than or equal to 1, output an ex of side length n made of random printable ascii characters sans "y" and "Y", and the space. All allowed characters must have a nonzero chance of occurring, but not necessarily uniform. This is a code-golf so the shortest code in bytes wins. You should, however, randomize each char--that is, the struts of the ex shouldn't be equal, unless if by chance.

The chars to appear

```<code>!#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXZ[\]^_`abcdefghijklmnopqrstuvwxz{|}~"
</code>```

Constructing the ex

Side length 1:

```<code>x
</code>```

Side length 3:

```<code>x x
 x
x x
</code>```

Side length 5:

```<code>x   x
 x x
  x
 x x
x   x
</code>```

etc.

Example outputs

```<code>input
output
empty line

3
h 2
 ^
9 5

1
:

5
D   1
 W z
  W
 q j
W   1
</code>```

Example implementation

You do not need to handle invalid inputs.

function generate(sideLength){
    var result = "";
    var INNER = "@"
    for(var i = 0; i < sideLength; i++){
        var p = i < sideLength / 2 ? i : sideLength - i - 1;
        result += " ".repeat(p) + ((sideLength / 2 | 0) == p ? "" : INNER) + " ".repeat(Math.max(sideLength - p * 2 - 2, 0)) + INNER + "\n";
    }

    return result.replace(RegExp(INNER, "g"), function(e){
        let c = "y";
        while(c === "y" || c === "Y"){
            c = String.fromCharCode((Math.random() * 94) + 33 | 0);
        }
        return c;
    });
}

function print(v){
    output.innerHTML = "";
    output.appendChild(document.createTextNode(v));
}

function update(){
    var n = Number(input.value);
    if(n !== Math.floor(n)) print("error: " + n + " is not an integer.");
    else if(n % 2 === 0)    print("error: " + n + " is not odd.");
    else if(n < 1)          print("error: " + n + "is less than one.");
    else                    print(generate(n));
}

input.onchange = update;

update();```
<pre class="snippet-code-css lang-css prettyprint-override"><code>* {
  font-family: Consolas, monospace;
}

#output {
  white-space: pre;
}</code>```

<input id="input" min=1 value=1 type=Number>

```

答:
Pyth, <s>28</s> <s>27</s> <s>26</s> 25 bytes

```
<s>jmuXGHO-rF"!~""Yy"{,d-tQd*;Q</s>
<s>VQuXGHO-rF"!~""Yy"{,N-tQN*d</s>
<s>VQuXGHO-r\!\~"Yy"{,N-tQN*d</s>
<s>VQuXGHO-r\!\~"Yy",N-tQN*d</s>
VQuXGHO-r\!\[DEL];"Yy",N-tQN*d
```

Try it online!

Title: Do X without Y

Body:
Pyth, <s>28</s> <s>27</s> <s>26</s> 25 bytes

<s>jmuXGHO-rF"!~""Yy"{,d-tQd*;Q</s>
<s>VQuXGHO-rF"!~""Yy"{,N-tQN*d</s>
<s>VQuXGHO-r\!\~"Yy"{,N-tQN*d</s>
<s>VQuXGHO-r\!\~"Yy",N-tQN*d</s>
VQuXGHO-r\!\[DEL];"Yy",N-tQN*d

Try it online!