What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 131 Stack Exchange communities.

As per Jeff's suggestion in this comment:

You can use this question as a formatting sandbox. You can

  • edit this question itself (Community Wiki questions such as this one require 100 reputation to edit) - minor edit updated
  • post answers to this question (Since this question is protected this requires earning 10 reputation on this site)
  • post comments to this question or its answers

Beware that since the changes to syntax highlighting in December 2010, and the inline hints added March 2011, no syntax highlighting is applied unless the question's tags or an inline hint enable it. So, to test highlighting here in the sandbox:

  1. Set some language tags to this question:

    • See the explanation and the list of languages.

    • Adding clashing tags, such as both and , enforces a fallback to default, which is different from "no highlighting". (These tags are currently set on this question.)

  2. Or: on the start of a line, specify a language inline using <!-- language: lang --> hints, and indent the code 4 spaces as usual. There is a full list of hints (scroll down a little).

    <!-- language: lang-html -->
    
        While not hinted otherwise: <html></html> source <b>goes</b> "here".
    
    <!-- language: lang-js -->
    
        var a = 3;
        while (not (a > 0)) {
            alert("JavaScript code <b>goes</b> here.");
        }
    
  3. Or:

    • Save your post.

    • Use something like Firebug (Firefox), Web Inspector (Safari, Chrome) or Developer Tools (Internet Explorer 8) to edit the resulting HTML. To open Chrome Dev Tools, press F12

    • Find the <pre> element and add the attribute class="prettyprint", or change it into something more specific, like class="lang-vb prettyprint".

    • Run the following in the location bar: javascript:prettyPrint();

share|improve this question
2  
What have you tried?‮What have you tried? –  nicael Jul 4 at 16:18
1  
@nicael You're at it again... –  DatEpicCoderGuyWhoPrograms Jul 14 at 0:01
1  
‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮flaoting comment! ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ ‮ –  nicael Sep 26 at 13:31
1  
This is a test comment sent from in emacs with Stack-Mode –  Jonathan Leech-Pepin Nov 17 at 14:55

311 Answers 311

<pre><code> has highlighting too:

Look ma, <em style="xyz">highlighting<em>!
share|improve this answer

what is this magic dust that causes things to appear

share|improve this answer

Markdown tables? Who needs 'em?1

╔════════════════════════════════╦═════════════════════╗
║         Major Column 1         ║    Major Column 2   ║
╠══════════╤══════════╤══════════╬══════════╤══════════╣
║ Mn Clm 1 │ Mn Clm 2 │ Mn Clm 3 ║ Mn Clm 4 │ Mn Clm 5 ║
╠══════════╪══════════╪══════════╬══════════╪══════════╣
║          │          │          ║          │          ║
╟──────────┼──────────┼──────────╫──────────┼──────────╢
║          │          │          ║          │          ║
╟──────────┴──────────┼──────────╫──────────┴──────────╢
║                     │          ║                     ║
╟──────────┬──────────┴──────────╫─────────────────────╢
║          │                     ║                     ║
╚══════════╧═════════════════════╩═════════════════════╝

Too bad the vertical spacing's a little off though...


1Just kidding. Markdown tables would be great. As would be footnotes, now that I think about it. Or even just small text so I don't have to abuse <sub>

share|improve this answer

Acabáis de entrar en una de nuestras góticas basílicas, y es la hora en que con toda pompa se oficia ante los fieles. Los cánticos sagrados y las plegarias fervorosas adquieren resonancia en los ángulos del templo. Las flores silvestres esparcidas por todo el pavimento «ofrecen mil olores al sentido». El incienso que arde en los pebeteros del altar suspende por algunos instantes vuestro pensamiento, y os pone en deseo de reclinar la cabeza para recibir en plácido desmayo las tristes y graves melodías del órgano. Todo es paz y sosiego. Los ruidos mundanales no quieren vibrar en aquella atmósfera seráfica.

Si oís al orador de que ahora estoy tratando, experimentaréis sensaciones análogas. Parece que no vive en medio de la lucha de creencias y doctrinas cuyo fragor conturba nuestros ánimos, y su oratoria es, pudiéramos decir, extramundana. En los momentos más críticos de la contienda, cuando el coraje inyecta de sangre los ojos de los héroes y la muerte cierne sus alas sobre el campo de batalla, levántase un orador con severo continente, saca del bolsillo una encíclica romana, y da comienzo á su lectura, que impasible y tranquilo hace prolongar un buen lapso de tiempo. ¡Quién lo diría! Esta lectura es la lluvia copiosa y refrescante que apaga los ardores de la tierra. En adelante, los oradores se levantan á hablar entumecidos, y la sesión figura padecer de reumatismos.

Sigamos con el agua. No escucháis los ruidos medrosos y solemnes de poderosa catarata que se despeña, sino el susurro monótono del arroyo que serpea entre yerbas aromáticas, y al cual acompaña el no menos triste y monótono rumor que el viento produce en los árboles. En vano anheláis nuevas y variadas emociones. El orador, como la Naturaleza, languidece sin morir jamás. Navegamos por el mar Muerto, sin que un soplo de la brisa hinche nuestras velas.

Muchas veces me he preguntado: ¿qué actitud pensaría tomar el Sr. Perier dentro de la Convención francesa? Después de las enrojecidas palabras de Marat, ¿cómo sonarían sus discretas disertaciones? De aquella Montaña partían torrentes espumosos y violentos huracanes. ¡Qué cefirillos tan suaves llegarían si el Sr. Perier se viera en ella!

Las distancias que de su homónimo Casimiro Perier le separan son inmensas. Aquel orador, cuya energía borrascosa tiranizaba á todas las fracciones de la Cámara, se hubiera visto en grave aprieto ante la cristiana mansedumbre de su tocayo. ¡Bienaventurados los mansos, porque ellos poseerán la tierra!

Para figurarse con cierta exactitud á este orador, es indispensable haber contemplado mucho tiempo un cielo siempre límpido, que si primero serena y dulcifica nuestro espíritu, luego empezará á causarnos tedio y concluirá por abrumarnos. ¡Con qué ansia pedimos entonces á ese cielo que en sus senos profundos condense los vapores que recibe y un momento nos cubra al astro del día! ¡Ay! ¡en el cielo del pensamiento del Sr. Perier jamás ha estallado tempestad alguna!

La dicción es correcta y el ademán sosegado; pero le falta color y animación.batallador, ni mucho menos para engolfarse en el laberíntico juego de la ironía y la sátira.

Nada hay que nos disguste tanto como el gracejo del Sr. Moret cuando graceja. Con aquel rostro afeminado, con aquellos ojos que, aun queriendo reflejar malicia, siguen expresando la misma amable inocencia, con aquel aire soñador, con aquella voz conmovida y temblorosa que frecuentemente se anuda en la garganta, produciendo un movimiento de simpatía en el auditorio, ¿aspira el Sr. Moret á ser zumbón? ¿No comprende que el chiste que sale de su boca suena como un suspiro?

Abandone el ilustre orador esa forma, que se hizo para almas más revueltas y tempestuosas que la suya; nagrias que puedan herir ninguna susceptibilidad.

share|improve this answer

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.

share|improve this answer

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
share|improve this answer

This is a test for strikethrough.

share|improve this answer

The original standard for mailto: links, RFC 1738, says this:

A mailto URL takes the form:

mailto:<rfc822-addr-spec>

where <rfc822-addr-spec> is (the encoding of an) addr-spec, as specified in RFC 822 [1].

Under that definition, no proper name could be included.

But the mailto: section of RFC 1738 has been superseded by RFC 2368, which allows (among other things, including predefined subject lines) for an RFC 822 mailbox specification—which includes a proper name.

TL;DR: mailto:Fred Foo<foo@example.com> should work (and does, for me; you may have to encode the space, i.e., mailto:Fred%20Foo<foo@example.com>).

share|improve this answer

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.

share|improve this answer

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

Here is another and the linkifier is broke

share|improve this answer

test answer with at least 30 characters

see, look, 30 characters

blah blah more chars

share|improve this answer

n0 quallitee fltr!

tstng coments

share|improve this answer
2  
​‌‍           ​  ​‌‍           ​  ​‌‍           ​ –  Doorknob Apr 30 '13 at 1:12

Hoy ! This is a test !

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

share|improve this answer

share|improve this answer
2  
Your test was a success. I was running a different test. Sorry. –  Kyle Strand May 2 '13 at 7:34
  1. line of code
    another one
    
  2. line of code in a different block
    

Nope, they don't go seamlessly.

share|improve this answer

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!

share|improve this answer

! 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...

share|improve this answer

Can I get text to properly flow around images? We'll the raw HTML suggested in the editing help doesn't seem to work. And the regular way to embed images doesn't flow correctly, so I'm not sure what to do. Ask a meta-question, I guess. enter image description here

share|improve this answer

  • Is this off the edge?
  • share|improve this answer

    Does this still work?

    share|improve this answer

    This is without a language::

    # comment me
    echo "sjngm"
    var="foo"
    num=80
    for line in (`cat bar.txt`) do
    done
    

    This is with language: lang-sh:

    # comment me
    echo "sjngm"
    var="foo"
    num=80
    for line in (`cat bar.txt`) do
    done
    

    This is with language: lang-c:

    # comment me
    echo "sjngm"
    var="foo"
    num=80
    for line in (`cat bar.txt`) do
    done
    

    This is with language: lang-xml:

    # comment me
    echo "sjngm"
    var="foo"
    num=80
    for line in (`cat bar.txt`) do
    done
    

    This is with language: lang-none:

    # comment me
    echo "sjngm"
    var="foo"
    num=80
    for line in (`cat bar.txt`) do
    done
    

    This is with language: lang-i-am-a-banana...

    # comment me
    echo "sjngm"
    var="foo"
    num=80
    for line in (`cat bar.txt`) do
    done
    

    ... which falls back to language: lang-default

    # comment me
    echo "sjngm"
    var="foo"
    num=80
    for line in (`cat bar.txt`) do
    done
    
    share|improve this answer

    You must log in to answer this question.

    protected by Oded Nov 17 at 15:36

    Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

    Would you like to answer one of these unanswered questions instead?

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