Questions

How can I use String substring in Swift 4? 'substring(to:)' is deprecated: Please use String slicing subscript with a 'partial range from' operator

I have the following simple code written in Swift 3: ``` let str = "Hello, playground" let index = str.index(of: ",")! let newStr = str.substring(to: index) ``` From Xcode 9 beta 5, I get the follo...

23 Jun at 00:56

ServiceStack ORMLite LeftJoin confusion

I have a simple Vendor -> Product relation with the following setup (non-relevant properties elided): ``` public class Vendor { public Guid Id { get; set; } public bool IsDeleted { get; set; ...

Why am I getting "Permission denied" when activating a venv?

I just started a new python project and created a venv inside the project folder by running `virtualenv venv` in the terminal. However, when I run `venv/bin/activate` I get a permission denied error. ...

30 Dec at 16:51

curl: (7) Failed to connect to port 80, and 443 - on one domain

This question shows research effort; it is useful and clear I have checked the cURL not working properly When I run the command `curl -I https://www.example.com/sitemap.xml` ``` curl: (7) Failed t...

24 Aug at 10:7

EPplus To Insert X Number of Blank Rows

I have an instance where if a cell value is between 15 and 25 then I need to insert 10 blank rows, if the cell value is > 30 I need to insert 25 blank rows Rather than simply typing the same syntax ...

7 Aug at 14:48

Writing to two different files with HDF5

I've a small library in C that makes use of HDF5 to write data (v. 1.8.14) under Windows. That lib is then used by a C# app that does some other stuff and then needs to write quite a lot of data. I n...

How to install pandas in pycharm

I am trying to install the `pandas` package in pycharm. I get the following error: `unable to find vcvarsall.bat` (i tried to install via the `cmd` but also via the `project interpreter`). I tried to ...

7 Aug at 14:5

Make Pandas DataFrame apply() use all cores?

As of August 2017, Pandas [DataFame.apply()](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.apply.html) is unfortunately still limited to working with a single core, meaning t...

3 Jun at 21:55

System.ServiceModel not found in .NET Core project

I have a .NET Core xUnit project. I'm trying to call a WCF service from it but get the following exception: ``` System.InvalidOperationException occurred HResult=0x80131509 Message=An error occu...

7 Aug at 10:43

Escape special characters in insert (from dynamically created table) in ormlite

I am using C#, I created a table, using ServiceStack.OrmLite, corresponding to a class type created in run-time. To be clear, I did the following: - `db.CreateTableIfNotExists(employeeType);` Thi...

How do I provide ILogger<T> in my unit tests of .NET Core code?

Given a class with a constructor signature of ``` public Foo(ILogger<Foo> logger) { // ... } ``` that I want to test, I need some way to provide an `ILogger<Foo>` in the test. It's [been asked ...

How to set Python3.5.2 as default Python version on CentOS?

Is there a way to set the Python 3.5.2 as the default Python version on CentOS 7? currently, I have Python 2.7 installed as default and Python 3.5.2 installed separately. I used the following command...

ASP MVC Url Encode double escape sequence

I want to encrypt the Id part of a given url and I used [SHA-1](https://en.wikipedia.org/wiki/Secure_Hash_Algorithms) for that. This algorithm convert the id to the following string: > NxVhIhrfbZNzyx...

7 Aug at 07:9

Azure Function timer configure through app settings

I am working on Azure functions timer Job , i need to get the cron expression from the appsettings. Please let me know, how can i get the value from the appsettings in the Azure functions. I want to r...

16 Mar at 00:59

What happened to HasColumnName for EF Core?

So I am trying to map an internal property to my database and according to this [article online](https://www.codeproject.com/Articles/1166099/Entity-Framework-Storing-complex-properties-as-JSO) this i...

Centering in CSS Grid

I'm trying to create a simple page with CSS Grid. What I'm failing to do is center the text from the HTML to the respective grid cells. I've tried placing content in separate `div`s both inside and ...

9 Aug at 19:34

npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\Nuwanst\package.json'

I just want to install socket.io to my project which is located on 3.chat folder. But when I run following command it shows following Warnings.And its not created a node_modules directory inside my pr...

Do I need to lock singleton in ASP.NET Core?

Here is my code: public class RouteSingleton { private IDictionary _dealCatLinks; private IDictionary _sectionLinks; private IDictionary _categoryLinks; private IDictionary _materi...

Device.OnPlatform deprecated

Inside the constructor of my `ContentPage` I try to set a platform dependent padding value: ``` Padding = new Thickness(5, Device.OnPlatform(20, 5, 5), 5, 5); ``` Visual Studio underlines `Device.O...

5 Aug at 20:35

AutoMapper: What is the difference between ForMember() and ForPath()?

I am reading AutoMapper's `ReverseMap()` and I can not understand the difference between `ForMember()` and `ForPath()`. Implementations was described [here](https://github.com/AutoMapper/AutoMapper/wi...

4 Dec at 13:50

Kotlin Android start new Activity

I want to start another activity on Android but I get this error: > Please specify constructor invocation; classifier 'Page2' does not have a companion object after instantiating the `Intent` class....

SQLite Data Adapter not displaying data

I'm trying to fill a data grid view in my windows form application but nothing is being returned from the database when I execute the select query. I've looked at other questions about this topic on t...

4 Aug at 23:38

React - check if element is visible in DOM

I'm building a form - series of questions (radio buttons) the user needs to answer before he can move on to the next screen. For fields validation I'm using yup (npm package) and redux as state manage...

4 Aug at 20:22

Integrations tests with ASPNetCore and ServiceStack

I have an ASP.Net Core 1.1 project that is using ServiceStack Core. I am trying to write a basic integration test that looks like so: ``` [TestFixture] public class BasicStartupTest { TestServer ...

4 Aug at 15:13

How to create a MVC MvcHtmlString in ASP.NET Core

I wonder if someone can help with demonstrating how to create a IHtmlContent or HtmlString in ASP.NET Core, similar to what I previously have done in MVC5. I would normally declare a new MvcHtmlString...

7 May at 05:51