Can't connect to Postgresql on port 5432
I have PostgreSQL 9.3 installed on a server running Ubuntu Server 14.04. If I ssh into the server via terminal, I'm able to connect with psql. But when I try to configure pgAdmin III to do the remote...
- Modified
- 19 Jul at 18:51
Pandas KeyError: value not in index
I have the following code, ``` df = pd.read_csv(CsvFileName) p = df.pivot_table(index=['Hour'], columns='DOW', values='Changes', aggfunc=np.mean).round(0) p.fillna(0, inplace=True) p[["1Sun", "2Mo...
Conda uninstall one package and one package only
When I try to uninstall `pandas` from my `conda` virtual env, I see that it tries to uninstall more packages as well: ``` $ conda uninstall pandas Using Anaconda Cloud api site https://api.anaconda.o...
iOS 10: "[App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction"
I sometimes get this message in the logs of Xcode 8b3 when running my app, everything seems to work, but I'd like to know where this comes from. Google did not help at all.
- Modified
- 24 Jul at 14:35
Limit to 2 decimal places with a simple pipe
I have found an example which limits a number to 2 decimal places AND turns the figure into a currency amount- eg £2.55. ``` {{ number | currency : 'GBP' : true : '1.2-2'}} ``` Is there a simple pi...
How can I add an extension method to many classes?
I have about 1000 classes in which i need to count the number of properties of. I have the following code: ``` public static int NumberOfProperties() { Type type = typeof(C507); r...
- Modified
- 19 Jul at 11:8
How to get request cookies in Web API authorization attribute?
In .NET there are two `AuthorizeAttribute` classes. One defined in `System.Web.Http` namespace: ``` namespace System.Web.Http { // Summary: // Specifies the authorization filter that veri...
- Modified
- 19 Jul at 09:24
FluentValidation modify error message in Must function
Inside class that is responsible for validation I have simple rule: ``` RuleFor(u => u.Id) .Cascade(CascadeMode.StopOnFirstFailure) .NotEmpty().WithMessage("Id is required") .Must(Validat...
- Modified
- 19 Jul at 09:32
Why can arrays not be trimmed?
On the MSDN Documentation site it says the following about the `Array.Resize` method: > If newSize is greater than the Length of the old array, a new array is allocated and all the elements are copied...
- Modified
- 20 Jun at 09:12
The ADO.NET provider with invariant name 'MySql.Data.MySqlClient' is either not registered in the machine or application config file
I have an asp.net solution using entity framework 6 to mysql server. now I have to work on that solution on a new machine, but I have some problems: 1) when building the solution I get error: []...
- Modified
- 19 Jul at 17:9
Cast from IEnumerable to IEnumerable<object>
I prefer to use `IEnumerable<object>`, for LINQ extension methods are defined on it, not `IEnumerable`, so that I can use, for example, `range.Skip(2)`. However, I also prefer to use `IEnumerable`, fo...
- Modified
- 23 May at 11:47
SignInManager,what it is and how,when to use?
I am exploring SignInManager class. But the information given on MSDN is very useless. It only tells what are the methods and properties provided. What I am looking for is, 1. What is SignInManager? ...
- Modified
- 23 Jan at 05:20
C# - Downloading from Google Drive in byte chunks
I'm currently developing for an environment that has poor network connectivity. My application helps to automatically download required Google Drive files for users. It works reasonably well for small...
- Modified
- 19 Jul at 04:30
How to Logout of Owin Providers?
I am following [this tutorial](https://dzone.com/articles/using-owin-external-login) yet it does not tell you how to logout. I tried to do ``` Request.GetOwinContext().Authentication.SignOut(Microso...
- Modified
- 21 Jul at 16:30
formGroup expects a FormGroup instance
I have an Angular 2 RC4 basic form example on Plunkr that appears to throw the following error (In Chrome DEV console) Here's the plunkr [https://plnkr.co/edit/GtPDxw?p=preview](https://plnkr.co/edi...
- Modified
- 18 Jul at 19:42
Getting all types that implement an interface in .NET Core
Using reflection, How can I get all types that implement some specific interface in ? I have noticed that the methods usable in .NET 4.6 are not available anymore. For example, this code doesn't work...
- Modified
- 18 Jul at 18:10
How to get input text value on click in ReactJS
I am learning ReactJS and I want to understand how to get the input text values in ReactJS using simple onclick event. I have followed there tutorial and although i am able to get the parameter of tex...
- Modified
- 18 Jul at 18:3
How do I disable a test using pytest?
Let's say I have a bunch of tests: ``` def test_func_one(): ... def test_func_two(): ... def test_func_three(): ... ``` Is there a decorator or something similar that I could add to the...
Difference between decimal.Round and Math.Round
What is the difference between Math.Round and decimal.Round functions in C# ?
- Modified
- 18 Jul at 17:28
HttpClient: The uri string is too long
Given the following attempt to post data to a web service that generates PDF files, [PDF rocket](https://www.html2pdfrocket.com/) (). I get the error `POST` ``` using (var client = new HttpClient()...
- Modified
- 19 Jul at 07:51
How do you unit test ASP.NET Core MVC Controllers that return anonymous objects?
I'm having trouble unit testing ASP.NET Core MVC controllers that return anonymous objects. The unit testing is set up in a separate project and calls the controller methods from the main project dire...
- Modified
- 23 May at 12:26
How to get cookie in ServiceStack
I have been trying to read a cookie in servicestack but get > "The type 'Cookie' is defined in an assembly that is not referenced. You must add a reference to assembly ..." I have alredy added th...
- Modified
- 18 Jul at 13:38
What does {{{0}}} on string.Format do?
In the namespace `MS.Internal`, there is a class named `NamedObject`. It has a weird block of code: ``` public override string ToString() { if (_name[0] != '{') { // lazily add {} around the...
- Modified
- 20 Jul at 06:39
Enable-Migrations Exception calling "SetData" with "2" argument(s)
I created a library based on .NET 4.6.2 version. To the library, I've added the EntityFramework version 6.1.3 package. I created a model as follow ``` using System; using System.ComponentModel.Data...
- Modified
- 18 Jul at 12:56
proper way to sign .net core assembly
I'm trying to sign a .net core lib, and I'm just not sure if I did everything correctly 1) using VS Command Promp I called `sn -k mykey.snk` 2) copied `mykey.snk` to myproject folder 3) in `project.js...
- Modified
- 30 Aug at 07:15