This post exists purely to house answers formerly attached to the formatting sandbox. You can safely ignore it.
623 Answers
Multi-line spoiler:
Spoiler line 1 (note the two spaces at the end of this line and the next)
Spoiler line 2
testing slashes escaping in backticks code in answers \
, \\
and \a
, \\a
-
-
-
testing slashes escaping in backticks code in comments
`,
\` and\a
,\\a
Oct 12, 2012 at 5:21 -
\` will display
`,\\` will display
\`,\\hi
will display\\hi
,\\\hi
will display\\\hi
Oct 12, 2012 at 5:26
Testing markdown. Thanks Arjan
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̲̅ ̲̅
-
-
@Arjan Sure... Looking in the markdown manual I wanted to see what the checkmark did. Also I want to post linebreaks in comments 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 renamecheckmark
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.)– ArjanMar 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:

– ArjanMar 11, 2011 at 10:13 -
-
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
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?!?!
-
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 MJul 11, 2013 at 8:36
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`;
-
1
-
-
starts with codez
w00t woot
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.
-
Now in comments stackoverflow.com/q/1732348/851811 and answers stackoverflow.com/a/1732454/851811 using the
Share
button. Feb 21, 2013 at 12:15 -
It works only for questions and only in posts, not comments. Note that it even works for questions from other sites e.g. try pasting gaming.stackexchange.com/q/4999/7652 in a post and see. Feb 21, 2013 at 12:52
what is this magic dust that causes things to appear
-
Stack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack ExchangeStack Exchange– nneonneoMar 9, 2013 at 21:35
-
-
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.
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
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.
Here is a link to a random .docx (now fixed)
Here is another and the linkifier is broke
test answer with at least 30 characters
see, look, 30 characters
blah blah more chars
n0 quallitee fltr!
tstng coments
-
2
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Hoy ! This is a test !
La femme est un sujet sur lequel l'homme aime à s'étendre.
-
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
-
@Kyle You missed the whole purpose of this test. I was testing to see if I could leave an entirely blank answer.– PiccoloMay 2, 2013 at 7:33
-
2
-
line of code another one
line of code in a different block
Nope, they don't go seamlessly.
Testing an HTML link:
http://wayback.archive.org/web/*/http://onemillionpeople.com
Testing a markdown link:
(Presumably it is automatically URL encoded?)
- Simple URL still needs encoding
- [complex URL link](http://www.example.com/downloads/Some Band - En français avec des caractères spéciaux (2013) [7'' EP].zip)
- complex URL encoded already
- http://www.example.com/downloads/Some Band - En français avec des caractères spéciaux (2013) [7'' EP].zip
- [some spaces already encoded](http://www.example.com/downloads/Some+Band+-+En+français+avec+des+caractères+spéciaux+(2013)+[7'' EP].zip)
- Trips on non-ASCII chars
Link entered using the toolbar option: works great!
! 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...