cd "C:\Program Files (x86)\Android\android-sdk\platform-tools"
adb backup -f C:\Users\M.Yankov\Desktop\data.ab com.mihyan.simpletracker
In the phone screen Enable dubug if asked
public class Program | |
{ | |
public static async Task Main(string[] args) | |
{ | |
Stopwatch timer = Stopwatch.StartNew(); | |
Task a = OperationSlow(); | |
Task b = OperationFast(); | |
await Task.Delay(5000); |
// ASP Net Core 2.2.2 | |
// Get registered services from WebHost instance. | |
// In case the IServiceCollection or ApplicationBuilder is not available in the current context. | |
// The method can be used in separate assembly | |
pulbic void TestMethod() | |
{ | |
using (IServiceScope scope = this.webHost.Services.GetRequiredService<IServiceScopeFactory>().CreateScope()) | |
{ | |
RoleManager<IdentityRole> roleManager = scope.ServiceProvider.GetRequiredService<RoleManager<IdentityRole>>(); |
msbuild ProjectFile.csproj /p:Configuration=Release ^ | |
/p:Platform=AnyCPU ^ | |
/t:WebPublish ^ | |
/p:WebPublishMethod=FileSystem ^ | |
/p:DeleteExistingFiles=True ^ | |
/p:publishUrl=c:\output | |
msbuild Solution.sln /p:Configuration=Release ^ | |
/p:DeployOnBuild=True ^ | |
/p:DeployDefaultTarget=WebPublish ^ |
public unsafe void Get(MyModel a) | |
{ | |
System.Runtime.InteropServices.GCHandle handle = System.Runtime.InteropServices.GCHandle.Alloc(a, System.Runtime.InteropServices.GCHandleType.Weak); | |
try | |
{ | |
IntPtr pointer = System.Runtime.InteropServices.GCHandle.ToIntPtr(handle); | |
string test = "0x" + pointer.ToString("X"); | |
} | |
finally | |
{ |
<?xml version="1.0" encoding="utf-8" ?> | |
<configuration> | |
<connectionStrings> | |
<add name="LocalDb" connectionString="Data Source=LENOVO-G710;Initial Catalog=PredicateBuilder;Integrated Security=True" providerName=""/> | |
</connectionStrings> | |
</configuration> |
using System; | |
using System.IO; | |
using iText.Kernel.Colors; | |
using iText.Kernel.Pdf; | |
using iText.Layout; | |
using iText.Layout.Element; | |
public class Program | |
{ |
When working with nullable booleans and using null condiional operator could be wrong:
Let's take the follwoing example:
bool? isRecording = savedInstanceState?.GetBoolean("isRecording");
if (isRecording)
- This won't compile. need another approach.
The condition if (isRecording == false)
will be true when the variable is equal to false and when it is null
.
It's logical to work like that since the default value of bool
is false
and the null
value is more suitable to false
.
But we should be careful if the logic need to be executed only if it's equal to false.