How to take the nth digit of a number in python

I want to take the nth digit from an N digit number in python. For example: ``` number = 9876543210 i = 4 number[i] # should return 6 ``` How can I do something like that in python? Should I chang...

23 Sep at 01:0

Can I generate script of a migration with EF code first and .net core

I'm building a MVC application with .Net Core and I need to generate the script of a migration. With EF6 I did run the command ``` update-database -script ``` but when I try to do the same with .net ...

Convert Graphql to SQL?

We have existing SQL Server database and we are using C#. Lets say our mobile client send a graphql to server. How can I convert this SQL, so that my client get the data what he expect?

22 Sep at 15:47

Postgres: check if array field contains value?

I'm sure this is a duplicate question in the sense that the answer is out there somewhere, but I haven't been able to find the answer after Googling for 10 minutes, so I'd appeal to the editors not to...

22 Sep at 15:45

Using Pipes within ngModel on INPUT Elements in Angular

I've an HTML INPUT field. ``` <input [(ngModel)]="item.value" name="inputField" type="text" /> ``` and I want to format its value and use an existing pipe: ``` .... [(ngModel)]="i...

RabbitMQ + C# + SSL

I'm trying to use C# to get RabbitMQ 3.6.2 to use SSL/TLS on Windows 7 against Erlang 18.0. I'm running into errors when I'm enabling SSL in my C# code. I have gone through the steps to set up SSL/T...

21 Mar at 18:47

Unable to create a constant value of type 'System.Char'

I'm getting the following error trying to group and sum some values via LINQ in EF6: > Unable to create a constant value of type 'System.Char'. Only primitive types or enumeration types are supported...

22 Sep at 15:11

Create UserControl in non-UI thread Silverlight 5 browser application

I have a Silverlight 5 browser application. There is a class ``` public class ActivityControl:UserControl { public void LoadSubControls() { //Creates Other UserControls, does calculatio...

How to mock function returning void task

I have a function ``` public Task DoSomethingAsync(); ``` which I want to mock for testing purposes. What is the right way to implement the return value of such a method. If it would return `Task...

22 Sep at 12:45

How to overlay items in StackPanel or ListView?

I am making a card game and I want to display cards in player's hand half-covered be each other. How can I do that using ListView or StackPanel? Here is an example how I would like to display player h...

22 Sep at 17:48

C# How to add a property setter in derived class?

I have a requirement where I have a number of classes all derived from a single base class. The base class contains lists of child classes also derived from the same base class. All classes need to ...

22 Sep at 11:19

How to filter "Include" entities in entity framework?

Entities: ``` public class Room { public Room() { this.Reservations = new HashSet<Reservation>(); } public int Id { get; set; } public decima...

nvm uninstall doesn't actually uninstall the node version

So I'm trying to clear out older versions of node.js. I start with: ``` $ nvm ls v0.10.30 v4.2.3 -> v6.6.0 system ``` I don't want the older versions, so I then do: ``` $ nvm...

22 Sep at 09:16

How do I kill the process currently using a port on localhost in Windows?

How can I remove the current process/application which is already assigned to a port? For example: `localhost:8080`

How to set image width to be 100% and height to be auto in react native?

I am trying to display list of images in a scrollview. Width should be 100%, while height should be automatic, keeping aspect ratio. The searches I did pointed to various solutions which give fullscr...

22 Sep at 06:37

Access template reference variables from component class

``` <div> <input #ipt type="text"/> </div> ``` Is it possible to access the template access variable from the component class? i.e., can I access it here, ``` class XComponent{ somefunction(...

Request Permission for Camera and Library in iOS 10 - Info.plist

I have implemented a WKWebView in an app. there's a file input in the shown web page where it should import an image from photos. Whenever i press on that input and select either "Take Photo" or "Phot...

22 Sep at 10:25

Copying Content files on build with Visual Studio Code

I'm working on a C# project that has Content files. In MonoDevelop, I can set the type to `Content` and the `Build Action` to `Copy if Newer`. I can do something similar in Visual Studio. How do I do...

22 Sep at 01:47

Controlling DateTime parameter formatting in WebAPI 2

So I have a WebAPI 2 controller written in C# that takes among other things a query parameter of type DateTime. This is an API that returns all values from the data store based on a date filter. Somet...

20 Jun at 11:33

How to center modal to the center of screen?

How to center modal to the center of screen? This is my html and js code It works in Chrome console, but when I refresh this page - it doesn't work ``` $('.modal').css('top', $(window).outerHeight() ...

Difference between using gradlew and gradle

What is the difference between using `gradlew` and `gradle` or are they the same?

31 Jan at 04:9

Is there a way to combine Docker images into 1 container?

I have a few Dockerfiles right now. One is for Cassandra 3.5, and it is `FROM cassandra:3.5` I also have a Dockerfile for Kafka, but t is quite a bit more complex. It is `FROM java:openjdk-8-fre` an...

21 Sep at 21:4

How to launch MS Edge from c# winforms?

The executable MicrosoftEdge.exe cannot be launched directly like other EXEs in windows. I confirmed that from my own experience, and by reading [this](http://answers.microsoft.com/en-us/insider/forum...

20 Mar at 10:18

Should I avoid using Dependency Injection and IoC?

In my mid-size project I used static classes for repositories, services etc. and it actually worked very well, even if the most of programmers will expect the opposite. My codebase was very compact, c...

The pipe 'async' could not be found

I am trying to build a simple blog with Angular 2 and Firebase and I am having issues using async pipe in a component. I get the error in the console. > zone.js:344Unhandled Promise rejection: Templat...