Signup/Sign In

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

There are two ways

***var guid = Guid.NewGuid();***
or

***var guid = Guid.NewGuid().ToString();***
both use the Guid class, the first creates a Guid Object, the second a Guid string.
4 years ago
Another option is to use the params keyword

***public void DoSomething(params object[] theObjects)
{
foreach(object o in theObjects)
{
// Something with the Objects…
}
}***
Called like...

***DoSomething(this, that, theOther);***
4 years ago
In .NET Core 1.0, you can set this as a global setting in your Startup.cs file:

***using System.Buffers;
using Microsoft.AspNetCore.Mvc.Formatters;
using Newtonsoft.Json;

// beginning of Startup class

public void ConfigureServices(IServiceCollection services)
{
services.AddMvc(options =>
{
options.OutputFormatters.Clear();
options.OutputFormatters.Add(new JsonOutputFormatter(new JsonSerializerSettings(){
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
}, ArrayPool.Shared));
});
}***
4 years ago
Aside from the other answers...

I've found them helpful as a stepping-stone in refactoring god-classes. If a class has multiple responsibilities (especially if it's a very large code-file) then I find it beneficial to add 1x partial class per-responsibility as a first-pass for organizing and then refactoring the code.

This helps greatly because it can help with making the code much more readable without actually effecting the executing behavior. It also can help identify when a responsibility is easy to refactor out or is tightly tangled with other aspects.

However--to be clear--this is still bad code, at the end of development you still want one responsibility per-class (NOT per partial class). It's just a stepping-stone :)
4 years ago
You can also use the "plain TeX" method of indexing the actual ascii character in the current font:

***\char`\\
\char`\~***
I often use the former for writing macros that need the backslash in the typewriter font; \textbackslash will sometimes still use the roman font depending on the font setup. Of course, if you're using these a lot you should define your own macro for them:
***\newcommand\SLASH{\char`\\}***
4 years ago
**\input** is a lower level macro that simply inputs the content of the given file like it was copy&pasted there manually. \include handles the file content as a logical unit of its own (like e.g. a chapter) and enables you to only include specific files using **\includeonly{filename,filename2,...}** to save times.
4 years ago
Multiple sign-in is a feature that allows you to view the content of your other accounts while logged in to one. You cannot use some of the Google tools from two accounts at once, and they default to using the first account you signed in with.

Whichever account you sign in to first is the default account - the account Google will "default" to if there are any issues with supporting multiple accounts.
4 years ago
The **** tag will need to be set to **display:block** as it is an inline element and will ignore width.

so:

******
and then:

***
  •  something

  • ANDsomething else
  • ***
    4 years ago
    There is "opacity" which will make the background shine through:

    ***opacity: 0.5;***
    4 years ago
    The W3 specification that talks about these seem to suggest that ***word-break: break-all*** is for requiring a particular behaviour with CJK (Chinese, Japanese, and Korean) text, whereas ***word-wrap: break-word*** is the more general, non-CJK-aware, behaviour.
    4 years ago
    Try this:
    ***overflow: auto;***

    It worked for my problem..
    4 years ago
    Note that if your tarball already contains a directory name you want to change, add the **--strip-components=1** option:

    ***tar xf archive.tar -C /target/directory --strip-components=1***
    4 years ago