0
votes

This post exists purely to house answers formerly attached to the formatting sandbox. You can safely ignore it.

623 Answers 623

1
6 7
8
9 10
21
1
vote
1
  • Cool, always wanted to try it myself Sep 17, 2012 at 16:27
1
vote

And this is a...

Spoiler!

1
vote

Multi-line spoiler:

Spoiler line 1 (note the two spaces at the end of this line and the next)

Spoiler line 2

1
vote

testing slashes escaping in backticks code in answers \, \\ and \a, \\a

4
  • I can show \ without using double slash \\
    – Himanshu
    Oct 12, 2012 at 5:09
  • @hims056 the things I discovered is in meta.stackexchange.com/a/150161/179635
    – ajax333221
    Oct 12, 2012 at 5:15
  • testing slashes escaping in backticks code in comments `, \` and \a, \\a
    – ajax333221
    Oct 12, 2012 at 5:21
  • \` will display `, \\` will display \`, \\hi will display \\hi, \\\hi will display \\\hi
    – ajax333221
    Oct 12, 2012 at 5:26
1
vote

Code:

this is
a test

Result:

this is a test

1
vote

Testing markdown. Thanks Arjan

valid XHTML

unfunny.

unfunny.

Oh gee look, you can so too underline in Stack Exchange sites:

 ̲u̲n̲d̲e̲r̲l̲i̲n̲e̲ ̲

 ̳u̳n̳f̳u̳n̳n̳y̳

 ̳u̳n̳d̳e̳r̳l̳i̳n̳e̳ ̳

  ̲̅M̲̅C̲̅M̲̅X̲̅C̲̅I̲̅X̲̅ ̲̅

  ̲̅m̲̅c̲̅m̲̅x̲̅c̲̅i̲̅x̲̅ ̲̅
6
  • Need some help?
    – Arjan
    Mar 11, 2011 at 9:56
  • @Arjan Sure... Looking in the markdown manual I wanted to see what the checkmark did. Also I want to post linebreaks in comments
    – mplungjan
    Mar 11, 2011 at 10:02
  • The [checkmark] is a named reference, just like [1] which is inserted when using the Insert Image button (which is to be preferred, to ensure that the image is uploaded to the Stack Exchange Pro account at Imgur, which does not expire images). So, you need [checkmark]: http://w3.org/Icons/valid-xhtml10 as well, as shown in that example. And you could rename checkmark to anything you like, as long as it's unique. Comments do not allow for newlines. (Though hitting Shift-Return might get you a newline while editing. It won't display though.)
    – Arjan
    Mar 11, 2011 at 10:07
  • See the "Basic Links" section in the help for many ways to define URLs for links, which also applies to images. Like the following would work too: ![valid XHTML checkmark](http://w3.org/Icons/valid-xhtml10)
    – Arjan
    Mar 11, 2011 at 10:13
  • Still not funny? ;-) Enjoy!
    – Arjan
    Mar 11, 2011 at 10:16
  • M̲M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅M̲̅atress springs!
    – Ry-
    Mar 20, 2012 at 23:17
1
vote
1
  • 2
    ​​​​​​​​​​​​​​​
    – brasofilo
    Sep 10, 2013 at 23:29
1
vote

Mouse over the left of the tower of hello

Yay you can follow instructions hello

Apparently <kbd> is immune to spoilers

hi

hi again

hi yet again

potato

why is this text drifting out

help

! spoilers don't work now?

! hey that's messed up


now they do?!?!

1
  • Apparently two or more spoiler blocks in a row stop being interpreted as spoiler blocks. Divide them with something else (e.g. with a <!---->) and they'll work (independently though, and they'll be visible as separate blocks too).
    – Andriy M
    Jul 11, 2013 at 8:36
1
vote

I've always wondered how to put a backtick in a backtick, now I know. Use 2 backticks as delimiters. ``` `.

SELECT `a` from `table` where `b`=`c`;

3
  • 1
    Documented here, Rocket.
    – Arjan
    Feb 4, 2013 at 17:52
  • @Arjan: Thanks for that link :-)
    – gen_Eric
    Feb 4, 2013 at 18:06
  • test this is a test int x
    – Thomas
    Feb 16, 2013 at 4:52
1
vote
starts with codez

w00t woot

2
1
vote

<pre><code> has highlighting too:

Look ma, <em style="xyz">highlighting<em>!
1
vote

Testing magical links to questions RegEx match open tags except XHTML self-contained tags and answers https://stackoverflow.com/a/1732454/851811 using the Share button.

2
1
vote

http://lmgtfy.com/?q=formatting+sandbox

http://jsfiddle.net/

4
  • /[[^]]*]/g ...
    – nhahtdh
    Mar 19, 2013 at 20:30
  • Test leading space ​ lead, test trailing space trail . Space ​ .
    – nhahtdh
    Apr 5, 2013 at 16:11
  • Two ​ jjj sdfsdfsdfsf
    – nhahtdh
    Apr 5, 2013 at 16:21
  • ---strike--- --test-- ~~another~~ ~~~test~~~
    – nhahtdh
    Aug 13, 2015 at 6:27
1
vote

what is this magic dust that causes things to appear

3
1
vote

Some code formatting for testing of the problem outlined here: What is Wrong with Code Formatting.

asyncTask.ContinueWith(task =>
{
    // Check task status.
    switch (task.Status)
    {
        // Handle any exceptions to prevent UnobservedTaskException.             
        case TaskStatus.RanToCompletion:
            if (asyncTask.Result)
            {
                // Do stuff...
            }
            break;
        case TaskStatus.Faulted:
            if (task.Exception != null)
                mainForm.progressRightLabelText = task.Exception.InnerException.Message;
            else
                mainForm.progressRightLabelText = "Operation failed!";
        default:
            break;
    }
}

This does not format correctly.

1
vote

Just testing:

Code formatting doesn't work well with NO-BREAK SPACE

-38 y1  +  35 y2  +  31 y3  = -3047

  11 y1 + -13 y2 + -34 y3 = 784

  34 y1 + -21 y2 + 19 y3 = 2949

But works with space (ASCII 32)

-38 y1  +  35 y2  +  31 y3  = -3047

11 y1  + -13 y2  + -34 y3  = 784

34 y1  + -21 y2  +  19 y3  = 2949
1
vote

>! hides all.

1
vote

I'd like to see if this causes a formatting problem as described here (this answer is thus a word for word copy of this answer):


I generally get a bad feeling about code that has one view model directly communicating with another. I like the idea that the VVM part of the pattern should be basically pluggable and nothing inside that area of the code should depend of the existence of anything else within that section. The reasoning behind this is that without centralising the logic it can become difficult to define responsibility.

On the other hand, based on your actual code, it may just be that the ApplicationViewModel is badly named, it doesn't make a model accessible to a view, so this may simply be a poor choice of name.

Either way, the solution comes down to a break down of responsibility. The way I see it you have three things to achieve 1) Allow the user to request to connect to an address, 2) Use that address to connect to a server 3) Persist that address. I'd suggest that you need three classes instead of your two.

public class ServiceProvider
{
    public void Connect(Uri address)
    {
        //connect to the server
    }
} 

public class SettingsProvider
{
   public void SaveAddress(Uri address)
   {
       //Persist address
   }

   public Uri LoadAddress()
   {
       //Get address from storage
   }
}

public class ConnectionViewModel 
{
    private ServiceProvider serviceProvider;

    public ConnectionViewModel(ServiceProvider provider)
    {
        this.serviceProvider = serviceProvider;
    }

    public void ExecuteConnectCommand()
    {
        serviceProvider.Connect(Address);
    }        
}

The next thing to decide is how the address gets to the SettingsProvider. You could pass it in from the ConnectionViewModel as you do currently, but I'm not keen on that because it increases the coupling of the view model and it isn't the responsibility of the ViewModel to know that it needs persisting. Another option is to make the call from the ServiceProvider, but it doesn't really feel to me like it should be the ServiceProvider's responsibility either. In fact it doesn't feel like anyone's responsibility other than the SettingsProvider. Which leads me to believe that the setting provider should listen out for changes to the connected address and persist them without intervention. In other words an event:

public class ServiceProvider
{
    public event EventHandler<ConnectedEventArgs> Connected;
    public void Connect(Uri address)
    {
        //connect to the server
        if (Connected != null)
        {
            Connected(this, new ConnectedEventArgs(address));
        }
    }
} 

public class SettingsProvider
{

   public SettingsProvider(ServiceProvider serviceProvider)
   {
       serviceProvider.Connected += serviceProvider_Connected;
   }

   protected virtual void serviceProvider_Connected(object sender, ConnectedEventArgs e)
   {
       SaveAddress(e.Address);
   }

   public void SaveAddress(Uri address)
   {
       //Persist address
   }

   public Uri LoadAddress()
   {
       //Get address from storage
   }
}

This introduces tight coupling between the ServiceProvider and the SettingsProvider, which you want to avoid if possible and I'd use an EventAggregator here, which I've discussed in an answer to this question

To address the issues of testability, you now have a very defined expectancy for what each method will do. The ConnectionViewModel will call connect, The ServicePRovider will connect and the SerttingsProvider will persist. To test the ConnectionViewModel you probably want to convert the coupling to the ServiceProvider from a class to an interface:

public class ServiceProvider : IServiceProvider
{
    ...
}

public class ConnectionViewModel 
{
    private IServiceProvider serviceProvider;

    public ConnectionViewModel(IServiceProvider provider)
    {
        this.serviceProvider = serviceProvider;
    }

    ...       
}

Then you can use a mocking framework to introduce a mocked IServiceProvider that you can check to ensure that the connect method was called with the expected parameters.

Testing the other two classes is more challenging since they will rely on having a real server and real persistent storage device. You can add more layers of indirection to delay this (for example a PersistenceProvider that the SettingsProvider uses) but eventually you leave the world of unit testing and enter integration testing. Generally when I code with the patterns above the models and view models can get good unit test coverage, but the providers require more complicated testing methodologies.

Of course, once you are using a EventAggregator to break coupling and IOC to facilitate testing it is probably worth looking into one of the dependency injection frameworks such as Microsoft's Prism, but even if you are too late along in development to re-architect a lot of the rules and patterns can be applied to existing code in a simpler way.

1
vote

Here is a link to a random .docx (now fixed)

Here is another and the linkifier is broke

1
vote

test answer with at least 30 characters

see, look, 30 characters

blah blah more chars

1
  • I like test ing
    – gen_Eric
    May 9, 2013 at 19:52
1
vote

n0 quallitee fltr!

tstng coments

29
  • 2
    ​‌‍           ​  ​‌‍           ​  ​‌‍           ​
    – Doorknob
    Apr 30, 2013 at 1:12
  • abc ​‌‍           ​  ​‌‍           ​
    – Doorknob
    Apr 30, 2013 at 1:13
  • abc ​‌‍           ​ ​‌‍           ​
    – Doorknob
    Apr 30, 2013 at 1:13
  • abc ​‌‍           ​‌‍          abab
    – Doorknob
    Apr 30, 2013 at 1:16
  • abc ​‌‍          ​‌‍         abab
    – Doorknob
    Apr 30, 2013 at 1:16
  • abc ​‌‍         ​‌‍        abab
    – Doorknob
    Apr 30, 2013 at 1:17
  • abc ​‌‍          ​‌‍         abab
    – Doorknob
    Apr 30, 2013 at 1:18
  • abc ​‌‍        ​‌‍       abab
    – Doorknob
    Apr 30, 2013 at 1:18
  • abc ​‌‍       ​‌‍      abab
    – Doorknob
    Apr 30, 2013 at 1:19
  • abc ​‌‍       ​‌‍      abab
    – Doorknob
    Apr 30, 2013 at 1:19
  • abc ​‌‍      ​‌‍     abab
    – Doorknob
    Apr 30, 2013 at 1:19
  • abc ​‌‍     ​‌‍    abab
    – Doorknob
    Apr 30, 2013 at 1:20
  • abc ​‌‍    ​‌‍   abab
    – Doorknob
    Apr 30, 2013 at 1:20
  • abc ​‌‍   ​‌‍  abab
    – Doorknob
    Apr 30, 2013 at 1:20
  • abc ​‌‍ ​‌‍ abab
    – Doorknob
    Apr 30, 2013 at 1:21
1
vote

Hoy ! This is a test !

La femme est un sujet sur lequel l'homme aime à s'étendre.

2
  • If you test for quality filter, there's none on Meta. :) May 23, 2013 at 17:47
  • La souris est en dessous de la table. Le chat est sur la chaise. Le singe est sur la branche. May 23, 2013 at 18:41
1
vote

3
  • @Kyle You missed the whole purpose of this test. I was testing to see if I could leave an entirely blank answer.
    – Piccolo
    May 2, 2013 at 7:33
  • 2
    Your test was a success. I was running a different test. Sorry. May 2, 2013 at 7:34
  • @KyleStrand Oh, I see. Never mind then.
    – Piccolo
    May 2, 2013 at 7:36
1
vote
  1. line of code
    another one
    
  2. line of code in a different block
    

Nope, they don't go seamlessly.

5
  • ---strike--- through?
    – Andriy M
    Jun 4, 2013 at 21:29
  • Multi line comment?
    – Andriy M
    Feb 25, 2014 at 18:30
  • Mid-word formatting.
    – Andriy M
    Jan 13, 2016 at 13:10
  • $$\sqrt{(a_1-b_1)^2+(a_2-b_2)^2+...+(a_n-b_n)^2}$$ ? Nope.
    – Andriy M
    Dec 20, 2016 at 13:58
  • [help/merging-accounts]? Nope.
    – Andriy M
    Feb 7, 2017 at 15:29
1
vote

#test { background:#f00; }
1
vote

Testing an HTML link:

http://wayback.archive.org/web/*/http://onemillionpeople.com

Testing a markdown link:
(Presumably it is automatically URL encoded?)

Link entered using the toolbar option: works great!

1
vote

! Spoiler block testing! Hello world

! Spoiler block testing! Test me

!Spoiler block testing! Yet Another test

! Spoiler block testing!

Hello world

Spoiler block testing!

Test me

Spoiler block testing!

Yet Another test


block with paragraph breaks testing-  

Spoiler block testing!
 √√√√√√√√√√√√√√√√√√√√√√√                                                                                                                               hm, It's cheating I know...

1
6 7
8
9 10
21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .