How to check if an environment variable exists and get its value?
I am writing a shell script. In this shell script, I am have a variable that either takes a default value, or the value of an environment variable. However, the environment variable doesn't have to be...
Curious slowness of EF vs SQL
In a heavily multi-threaded scenario, I have problems with a particular EF query. It's generally cheap and fast: ``` Context.MyEntity .Any(se => se.SameEntity.Field == someValue && se....
- Modified
- 5 Sep at 08:56
C# VisualStudio project rebuild giving /platform:anycpu32bitpreferred can only be used with /t:exe, /t:winexe and /t:appcontainerexe
I have a windows application and using cheetah for config transformations i.e app.config.debug, app.config.test, etc., When the project is built in debug mode , it works fine but when teamcity change...
- Modified
- 2 Sep at 15:30
angular 2 how to return data from subscribe
This is What I Want To Do. ``` @Component({ selector: "data", template: "<h1>{{ getData() }}</h1>" }) export class DataComponent{ this.http.get(path).subscribe({ res => return res; ...
- Modified
- 21 Feb at 20:2
How to remove or hide Toolbar item in specific page error: System.IndexOutOfRangeException: Index was outside the bounds of the array
I am trying to `Remove()` or `Clear()` `ToolbarItems`. Here is my code where I am creating `ToolbarItem` in MainPage.cs ``` public partial class MainPage : MasterDetailPage { public ToolbarItem c...
- Modified
- 30 Sep at 03:57
npm ERR! Error: EPERM: operation not permitted, rename
When I execute `npm install` I get this error > npm ERR! Error: EPERM: operation not permitted, rename C:\projects******\node_modules\react-async-script' -> 'C:\projects*******\node_modules.react-as...
Keep-Alive appears in HTTP header on Debian/Mono - not on Windows
I've been tasked with setting up a based C# application on . The application is compiled with and I've installed (using mono's Debian repository). The application starts up fine (under it's own u...
- Modified
- 2 Sep at 13:41
How to concatenate multiple column values into a single column in Pandas dataframe
This question is same to [this posted](https://stackoverflow.com/questions/11858472/pandas-combine-string-and-int-columns) earlier. I want to concatenate three columns instead of concatenating two col...
Elasticsearch : Root mapping definition has unsupported parameters index : not_analyzed
Hi all I am trying to create schema Test. ``` PUT /test { "mappings": { "field1": { "type": "integer" }, "field2": { "type": "integer" }...
- Modified
- 20 Jul at 23:7
Detect previous path in react router?
I am using react router. I want to detect the previous page (within the same app) from where I am coming from. I have the router in my context. But, I don't see any properties like "previous path" or ...
- Modified
- 2 Sep at 09:25
Enable raw SQL logging in Entity Framework Core
How do I enable the logging of DbCommand raw SQL queries? I have added the following code to my Startup.cs file, but do not see any log entries from the Entity Framework Core. ``` void ConfigureServ...
- Modified
- 2 Sep at 01:9
Object.hasOwnProperty() yields the ESLint 'no-prototype-builtins' error: how to fix?
I am using the following logic to get the i18n string of the given key. ``` export function i18n(key) { if (entries.hasOwnProperty(key)) { return entries[key]; } else if (typeof (Canadarm) !=...
- Modified
- 28 Mar at 01:58
Class Not Found: Empty Test Suite in IntelliJ
I'm just starting the computer science program at my college, and I'm having some issues with IntelliJ. When I try to run unit tests, I get the message ``` Process finished with exit code 1 Class not...
- Modified
- 21 Sep at 14:28
How can I alias a default import in JavaScript?
Using ES6 modules, I know I can alias a named import: ``` import { foo as bar } from 'my-module'; ``` And I know I can import a default import: ``` import defaultMember from 'my-module'; ``` I'd lik...
- Modified
- 3 Oct at 18:16
EntityFramework Core database first approach pluralizing table names
We have existing database with pluralized table names. For Example `Documents`. I am trying to use new `EF Core` and `Asp.Net Core` with database first approach based on this article [here](https://do...
- Modified
- 14 Jan at 02:2
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
I'm setting up a new server and keep running into this problem. When I try to log into the MySQL database with the root user, I get the error: > ERROR 1698 (28000): Access denied for user 'root'@'loca...
Using Sql Spatial Data (C#) to find the "visual" center of irregular polygons
I'm drawing regions (using `SqlGeometry`/`SqlGeography` and translating them to the WPF `LocationCollection` equivalent) on the Bing Maps WPF Control and needed to label them. I got the labels drawn ...
- Modified
- 13 Sep at 09:21
How Does This List Assignment Work?
I have seen this code example and it looks like it assigns an array initializer to a List. I thought it would not work but somehow it compiles. Is {} not an array initializer? Children is of type ILis...
How do I create a custom SynchronizationContext so that all continuations can be processed by my own single-threaded event loop?
Say you're writing a custom single threaded GUI library (or anything with an event loop). From my understanding, if I use `async/await`, or just regular TPL continuations, they will all be scheduled o...
- Modified
- 1 Sep at 12:23
"Unable to cast object of type 'System.Net.Http.Formatting.JsonContractResolver' to type 'Newtonsoft.Json.Serialization.DefaultContractResolver'."
We have a WEB API project that recently was moved to a new server. I'm running my project after making some additions to its' payload, but it suddenly throws the following error: > Unable to cast obj...
Render a View inside a View in Asp.Net mvc
How do I render a full fledged view (not partial view) inside another view? Scenario, I have different controller and want the exactly same view to render which is already there under other controlle...
- Modified
- 1 Sep at 10:19
What is the difference between "yield return 0" and "yield return null" in Coroutine?
I'm new and a bit confused about "`yield`". But finally I understand how it worked using `WaitForSeconds` but I can't see the difference between of "`yield return 0`" and "`yield return null`". are...
- Modified
- 1 Sep at 12:31
Moment js get first and last day of current month
How do I get the first and last day and time of the current month in the following format in moment.js: > 2016-09-01 00:00 I can get the current date and time like this: `moment().format('YYYY-MM-DD...
- Modified
- 23 May at 12:3
"CSV file does not exist" for a filename with embedded quotes
I am currently learning Pandas for data analysis and having some issues reading a csv file in Atom editor. When I am running the following code: ``` import pandas as pd df = pd.read_csv("FBI-CRIM...
- Modified
- 1 Jan at 11:5
How to strip out header from base 64 image in C#?
I have following base 64 image: ```csharp var image='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA0gA...'; ``` I am using `Convert.FromBase64String()`to convert this to bytes: ```csharp ...