How to window.scrollTo() with a smooth effect
I can scroll to 200px using the following ``` btn.addEventListener("click", function(){ window.scrollTo(0,200); }) ``` But I want a smooth scroll effect. How do I do this?
- Modified
- 13 Aug at 19:18
Python 3 - ValueError: not enough values to unpack (expected 3, got 2)
I have a problem with my Python 3 program. I use Mac OS X. This code is running properly. ``` # -*- coding: utf-8 -*- #! python3 # sendDuesReminders.py - Sends emails based on payment status in sprea...
- Modified
- 15 Feb at 20:18
What is the purpose of external static constructors in C#?
Accordingly to the section "10.12 Static constructors" of "C# Language Specification. Version 5.0" static constructor can be marked with "extern" modifier and in this case it's said to be an . The or...
- Modified
- 23 May at 12:2
Servicestack cannot parse JSON array with leading whitespace
Using ServiceStack v4.5.6.0, JSON array cannot be parsed correctly when leading space exists. ``` var test1 = "[{}, {}]"; var test1Result = JsonSerializer.DeserializeFromString<JsonArrayObjects>(test...
- Modified
- 16 Feb at 19:9
Can DateTime tear in a 64 bit environment?
In C# setting a value to a variable is atomic as long as its size is at most `native int` (i.e. 4 bytes in a 32-bit runtime environment and 8 bytes on a 64-bit one). In a 64-bit environment that inclu...
- Modified
- 18 Feb at 12:5
How to validate array in Laravel?
I try to validate array POST in Laravel: ``` $validator = Validator::make($request->all(), [ "name.*" => 'required|distinct|min:3', "amount.*" => 'required|integer|min:1', "description.*" ...
The equivalent of wrap_content and match_parent in flutter?
In Android `match_parent` and `wrap_content` are used to resize the widgets automatically relative to their parent to the content the widget contains. In Flutter it seems by default all widgets are s...
- Modified
- 26 Dec at 09:53
Why doesn't F# Compile Currying into Separate Functions?
So I'm trying to learn F# and as I learn new things I like to look at the IL to see what's happening under the covers. I recently read about Currying, an obvious fundamental of the language. Accordi...
Does a pass-through async method really need the await/async pattern?
Let's say I have an method that calls another async method immediately or similar: ``` //Main method public async Task<int> Foo1( int x ) { var result = await DoingSomethingAsync(x ); retur...
- Modified
- 21 Feb at 15:33
How Do I Connect to a Redis Sentinel that requirespass with ServiceStack.Redis?
I have a simple redis cluster on my local machine that consists of: - - - I am using to connect with no problems so far. Today I added a password to each of them using the `requirepass 42` setting...
- Modified
- 15 Feb at 18:26
phone number should be a string or some numeric type that have capacity to save phone number?
We want to store 10 digit mobile number i.e.9999999999. Should it be numeric or string datatype? We don't want to do any calculative or manipulation operation on this Which is better memory and perfo...
- Modified
- 12 Nov at 11:28
Cannot instantiate proxy of class error
I am doing a simple unit test where when creating a Course, the Title field cannot be empty. I am having to test it with a service class that has Dependency Injection with UnitOfWork. When I debug my ...
- Modified
- 16 Feb at 06:38
ASP.NET MVC enum argument in controller mapping
ASP.NET MVC provides simple templates for controller methods such as `Details`, and can have something like: This can be accessed by: `http://localhost:port/Controller/Details/id` What I'm trying to d...
- Modified
- 7 May at 08:26
Referencing a .NET Standard library from a Windows Class Library
There are two projects in my solution currently: a and another class library that targets I'm using Visual Studio 2015 Update 3. I've added a reference to the .NET Standard project from the other p...
- Modified
- 15 Feb at 16:11
React Router v4 - How to get current route?
I'd like to display a `title` in `<AppBar />` that is somehow passed in from the current route. In React Router v4, how would `<AppBar />` be able to get the current route passed into it's `title` p...
- Modified
- 15 Feb at 15:28
Vertical Align Center in Bootstrap 4
I am trying to center my Container in the middle of the page using Bootstrap 4. I have been unsuccessful thus far. Any help would be appreciated. I have built it at [Codepen.io](http://codepen.io/cms...
- Modified
- 26 Jan at 14:21
How to fix - The requested resource does not support http method 'POST'
Below is WebAPI action. On googling about the below error:- > The requested resource does not support http method 'POST' I got number of links & updated my api accordingly but still I am getting th...
- Modified
- 23 May at 12:17
SystemExit: 2 error when calling parse_args() within ipython
I'm learning basics of Python and got already stuck at the beginning of argparse tutorial. I'm getting the following error: ``` import argparse parser = argparse.ArgumentParser() args = parser.parse_...
- Modified
- 29 Sep at 14:37
Bouncy Castle CTS Mode for Blowfish Engine not working as expected
Perhaps my expectations are wrong. I am not an cryptography expert, I'm just a simple user. I have exhaustively tried to make this work with no success so far. I'm trying to port a Legacy Encryption ...
- Modified
- 20 Jun at 09:12
How to mount a single file in a volume
I am trying to dockerize a PHP application. In the dockerfile, I download the archive, extract it, etc. Everything works fine. However, if a new version gets released and I update the dockerfile, I ha...
- Modified
- 6 Oct at 00:19
Add new element to existing JSON array with jq
I want to append an element to an array in a JSON file using the `jq``add` command, but it's not working. `report-2017-01-07.json` file: ``` { "report": "1.0", "data": { "date": "20...
Laravel Migration Error: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
`php artisan make:auth` > [Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access v...
- Modified
- 22 Apr at 16:5
ImportError: No module named tensorflow
Please help me with this error I have installed the tensorflow module on my server and below is it's information ``` 15IT60R19@cpusrv-gpu-109:~$ pip show tensorflow Name: tensorflow Version: 1.0.0 S...
- Modified
- 23 May at 11:46
How to install PHP intl extension in Ubuntu 14.04
I have a hard time to find exact method to install PHP intl extension in . I tried with `sudo apt-get install php5-intl` but displays error `Unable to locate package`. I really need this extension f...
- Modified
- 13 Nov at 12:22
Does a Stream get Disposed when returning a File from an Action?
I'm writing a string to a `MemoryStream` I need to return the stream to the Controller Action so I can send it off as a file for download. Normally, I wrap the Stream in a using statement, but, in t...
- Modified
- 20 Nov at 21:39