How to save to local storage using Flutter?

In Android, if I have the information I want to persist across sessions I know I can use SharedPreferences or create a SQLite database or even write a file to the device and read it in later. Is ther...

11 Dec at 09:28

Passing a function with parameters through props on reactjs

I have a function that comes from a parent all the way down to a the child of a child in a component hierarchy. Normally this wouldn't be too much of a problem, but I need to receive a parameter from ...

21 May at 12:55

C# trim within the get; set;

I am total MVC newbie coming from 10 years of webforms. Here is the code I have inherited: ``` namespace sample.Models { public class Pages { public int PageID { get; set; } ...

28 Dec at 20:34

Specifying Font and Size in HTML table

I am trying to specify the Font Face and Size for text in a table. It seems to respect the FACE= but ignores the SIZE=. For example, I have the HTML shown below. It correctly displays the text in Co...

28 Dec at 18:45

Upload files and JSON in ASP.NET Core Web API

How can I upload a list of files (images) and json data to ASP.NET Core Web API controller using multipart upload? I can successfully receive a list of files, uploaded with `multipart/form-data` cont...

28 Dec at 18:19

Get request origin in C# api controller

Is there a way how can I can get request origin value in the api controller when I'm calling some api endpoint with ajax call? For example I'm making this call from www.xyz.com: ``` $http({ ur...

What's the difference between markForCheck() and detectChanges()

What is the difference between `ChangeDetectorRef.markForCheck()` and `ChangeDetectorRef.detectChanges()`? I only [found information on SO](https://stackoverflow.com/a/37643737/1267778) as to the dif...

26 Jun at 21:18

Full text search in mongodb in .net

I have to search contents in all documents in particular collection of mongodb in .net mvc . I have tried with mongodb shell by creating index successfully like here . ``` db.collection_name.createI...

Angular 2 Routing run in new tab

I am working with a asp.net core application with angular2 and my routing is working fine. ``` <a target="target" routerLink="/page1" routerLinkActive="active">Associates</a> <a routerLink="/page2" ...

21 Apr at 16:57

What is the best way to delete a component with CLI

I tried using "ng destroy component foo" and it tells me "The destroy command is not supported by Angular-CLI" How do we properly delete components with Angular CLI?

28 Dec at 02:54

How to check if a dynamic object is null

I recently saw the following code, which puzzled me. Assuming `SomeClass` is your typical class (which does not override `ToString()`), is there a reason why the second part of the conditional would b...

16 May at 18:40

SQL Server date format yyyymmdd

I have a `varchar` column where some values are in `mm/dd/yyyy` format and some are in `yyyymmdd`. I want to convert all `mm/dd/yyyy` dates into the `yyyymmdd` format. What is the best way to do thi...

Unit testing a .NET Standard 1.6 library

I am having trouble finding up to date documentation on how to unit test a .NET Standard 1.6 class library (which can be referenced from a .NET Core project). Here is what my `project.json` looks lik...

Regex in React email validation

I'm trying to set an error for when the email isn't correct. When I'm checking if the string is empty the form alerts with the proper message. But when I'm checking if the email matches the regular ex...

27 Dec at 16:11

Passing a user defined table type to SQL function in Ormlite

I've to pass a table to a SQL function (till now I've passed to stored procedures and everything was fine) Consider the following snippet ``` var dataTable = new DataTable(); dataTable.Colum...

27 Dec at 15:56

Is there a limit to the number of nested 'for' loops?

Since everything has a limit, I was wondering if there is a limit to the number of nested `for` loops or as long as I have memory, I can add them, can the Visual Studio compiler create such a program?...

27 Dec at 17:57

ServiceStack Can not get real exception message

## Server Side `public class MyServices : Service { public object Get(Hello request) { throw new InvalidOperationException("test error message"); //return new HelloResponse { Result = "Hello, {0}!...

27 Dec at 09:22

Using IHostingEnvironment in .NetCore library

I build an ASP.NET Core application and I create a .NET Core Class Library for unit testing. I want to use `IHostingEnvironment` in my library (to get physical path of a file), so I've added this line...

2 Oct at 09:25

How to: Use async methods with LINQ custom extension method

I have a LINQ custom extension method: ``` public static IEnumerable<T> DistinctBy<T, TKey>(this IEnumerable<T> items, Func<T, TKey> property) { return items.GroupBy(property).Select(x => x.First...

Passing JSON type as parameter to SQL Server 2016 stored procedure using ADO.Net in ASP.Net Core project

Can someone give example how to pass JSON type as parameter to SQL Server 2016 stored procedure using ADO.Net in C# ASP.Net Core Web Api project ? I want to see example of SQL Server 2016 stored proc...

27 Dec at 00:25

How to import CSS modules with Typescript, React and Webpack

How to import CSS modules in Typescript with Webpack? 1. Generate (or auto-generate) .d.ts files for CSS? And use classic Typescript import statement? With ./styles.css.d.ts: import * as styles from...

console.log(result) prints [object Object]. How do I get result.name?

My script is printing `[object Object]` as a result of `console.log(result)`. Can someone please explain how to have `console.log` print the `id` and `name` from `result`? ``` $.ajaxSetup({ traditiona...

2 Oct at 01:52

Use Unity API from another Thread or call a function in the main Thread

My problem is I try to use Unity socket to implement something. Each time, when I get a new message I need to update it to the updattext (it is a Unity Text). However, When I do the following code, th...

20 Aug at 20:53

Interacting with WMI via .NET core

I need to get information about system such as: motherboard info, hdd info, e.t.c. in OS Windows. I can get it from wmi service. But I need to gather it with .NET core application. I know in .NET a...

26 Dec at 11:33

NuGet: where is AForge.Video.FFMPEG

Good day. I want to use `AForge.Video.FFMPEG` in my project. So, i try to find it on the NuGet. But i'm not found it here. So, here it exists: https://code.google.com/archive/p/aforge/downloads But, i...

17 Jul at 08:45