PHP error: "The zip extension and unzip command are both missing, skipping."

When I run a `composer update` I get this error message: ``` Loading composer repositories with package information Updating dependencies (including require-dev) Failed to download psr/log from d...

22 Dec at 02:13

mcrypt is deprecated, what is the alternative?

The mcrypt-extension is [deprecated](http://php.net/manual/en/migration71.deprecated.php#migration71.deprecated.ext-mcrypt) will be removed in PHP 7.2 according to the comment posted [here](https://bu...

How can I get the first two digits of a number?

I want to check the first two digits of a number in Python. Something like this: ``` for i in range(1000): if(first two digits of i == 15): print("15") elif(first two digits of i ==...

22 Dec at 15:10

Getting ASP.Net Core shutdown triggering ApplicationStopping event in IISExpress

I'm aware there is a previous question on this, also there is a GitHub issue: [https://github.com/aspnet/Hosting/issues/846](https://github.com/aspnet/Hosting/issues/846) which appears to be resolved ...

EntityFramework code first: Set order of fields

I am using EntityFramework with the "Code first" approach with migrations. I have successfully generated tables from my models, but the columns are being added in an alphabetical order rather than th...

Remove double curly brackets from JObject that have been added during deserialization

I have a JSON string that starts and ends with curly brackets "{}". I then deserialize the object but when this is done I see that I now have double curly brackets at the start and the end "{{}}". M...

21 Dec at 15:35

An item in IEnumerable does not equal an item in List

I just can't figure out why the item in my filtered list is not found. I have simplified the example to show it. I have a class Item... ``` public class Item { public Item(string name) { ...

21 Dec at 20:44

Restore a deleted file in the Visual Studio Code Recycle Bin

Using Visual Studio Code Version 1.8.1 how do I restore a deleted file in the recycle bin?

13 Sep at 18:4

How to solve InaccessibleObjectException ("Unable to make {member} accessible: module {A} does not 'opens {package}' to {B}") on Java 9?

This exception occurs in a wide variety of scenarios when running an application on Java 9. Certain libraries and frameworks (Spring, Hibernate, JAXB) are particularly prone to it. Here's an example f...

Angular2 module has no exported member

For a website with authentication in Angular2, I want to use a component of the authentication submodule in the main app component. However, I keep getting the following error: `app/app.component.ts...

21 Dec at 13:59

How does Entity Framework generate a GUID for a primary key value?

When we run the ASP.NET application and register the user, Entity Framework automatically sets the unique id (PK) in AspNetUser table: [](https://i.stack.imgur.com/lVe4q.png) The same is true for ot...

Using IReadOnlyCollection<T> instead of IEnumerable<T> for parameters to avoid possible multiple enumeration

My question is related to [this one](https://stackoverflow.com/q/24880268/197591) concerning the use of `IEnumerable<T>` vs `IReadOnlyCollection<T>`. I too have always used `IEnumerable<T>` to expose...

How to use LINQ to find a sum?

I have this structure: ``` private readonly Dictionary<string, Dictionary<string, int>> _storage = new Dictionary<string, Dictionary<string, int>>(); ``` key: Firmware(string): key: Device(stri...

21 Dec at 12:11

EF Core: Using ID as Primary key and foreign key at same time

I have two entities, `Prospect` and `Person`, what I'm trying to do is use `Prospect.ID` as the primary key on `Prospect` table and as the foreign key of `PersonID`, my idea is use the same ID for bot...

How to select records where field is missing from an Azure Storage Table?

I'm attempting to process records that were inserted into Azure Table Storage prior to the addition of a new attribute. The [LINQ support is limited](https://learn.microsoft.com/en-us/rest/api/storage...

21 Dec at 12:0

C# how to "register" class "plug-ins" into a service class?

All these years have passed and still no good answer. Decided to [revive](https://stackoverflow.com/questions/73537998/c-sharp-how-to-register-class-plug-ins-into-a-service-class-as-of-today) this qu...

1 Sep at 07:7

Floating point division returns integer numbers

I want to calculate the average of two floating point numbers, but whatever the input, I am getting an integer returned. What should I do to make this work? ``` public class Program { public sta...

21 Dec at 10:0

Configure launchSettings.json for SSL in debug - ASP.NET Core / Visual Studio Code

I am following [this](https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/index) tutorial to add Facebook authentication to my web app. As part of the process I am trying to ...

pandas - find first occurrence

Suppose I have a structured dataframe as follows: ``` df = pd.DataFrame({"A":['a','a','a','b','b'], "B":[1]*5}) ``` The `A` column has previously been sorted. I wish to find the ...

31 Jan at 08:51

Anonymous Types C#

I understand that anonymous types have no pre-defined type of its own. Type is assigned to it by the compiler at the compile type and details of type assigned at compile time can't be known at code le...

27 May at 09:47

Is it true that async should not be used for high-CPU tasks?

I was wondering whether it's true that `async`-`await` should not be used for "high-CPU" tasks. I saw this claimed in a presentation. So I guess that would mean something like ``` Task<int> calculat...

20 Dec at 16:13

Entity Framework Core add unique constraint code-first

I can't find way to add a unique constraint to my field with using attribute: ``` public class User { [Required] public int Id { get; set; } [Required] // [Index("IX_FirstAndSecond",...

DTO vs. Domain Model, project organization

I have a project with a repository, a service layer, using EF6 and code-first POCOs. In the CustomerRepository, I am doing several projection queries that return objects. I understand that the code-fi...

ServiceStack DateTime Handling

I am having a problem with the DateTime format that is being utilized by ServiceStack. For example I have a simple request object like this. ``` public class GetAllUpdatedStudents : IReturn<GetAll...

20 Dec at 14:27