Questions

How to change value of a request parameter in laravel

I need to change value of my request parameter like this: ``` $request->name = "My Value!"; ``` I use this code but does not work: ``` $request->offsetSet('img', $img); ```

20 Mar at 19:24

ServiceStack MQ server shutdown does not wait for worker background threads to complete

I'm using ServiceStack MQ (ServiceStack.Aws.Sqs.SqsMqServer v4.0.54). I'm running MQ server inside a Windows Service. When the Windows service is about to shutdown, I would like to wait for all ...

23 Apr at 00:38

ServiceStack request parameters missing

I'm doing a service with ServiceStack, and I'm having a problem. I don´t see the request parameters, so, when I call the method, all parameters of the request are null. Here is the code: ``` public c...

23 Apr at 00:21

Algorithm To Calculate Different Types Of Memory

I am trying to calculate memory. I have calculated Available, InUse, Free, and Cached with the following code ``` ObjectQuery wql = new ObjectQuery("SELECT * FROM Win32_OperatingSystem"); ...

25 Apr at 15:48

Sequential await VS Continuation await

I was wondering what is the best/correct way of writing asynchronous code that is composed of two (or more) async and dependent (the first have to finish to execute second) operations. Example with a...

22 Apr at 15:44

When should I use curly braces for ES6 import?

It seems to be obvious, but I found myself a bit confused about when to use curly braces for importing a single module in ES6. For example, in the React-Native project I am working on, I have the foll...

31 Dec at 02:0

How to mention @channel(All the team members) using slack api while post message

I want to post a message in slack using api. How can I mention all the team members of a channel just like @channel in slack?

22 Apr at 13:37

Transient errors during SQL Server failovers

We have a client application accessing a SQL Server database (mirrored and clustered) through a C# dll with retry logic on specific error numbers. We are having issues during fail overs where transie...

25 Apr at 14:35

How to use ASP.net Core 1 "SignInManager" without EntityFramework

I'm looking to implement ASP.net authentication via the SignInManager but without the EntityFramework. I have built my own database layer using SQLClient and want to just create whatever calls is nee...

Omitted setter vs private setter?

What is the difference between a property with a omitted setter and a property with a private setter? ``` public string Foo { get; private set; } ``` vs ``` public string Foo { get; } ```

22 Apr at 11:16

Package php5 have no installation candidate (Ubuntu 16.04)

When i try to install php5 in Ubuntu 16.04 by using following code: ``` sudo apt-get install php5 php5-mcrypt ``` I get following error: ``` Reading package lists... Done Building dependency tree ...

12 Jul at 19:7

How to get dates between two dates in C#

I would like to get dates between two dates. Instead of expected different dates, I get and . What would be the problem with the code below? `StartDate` value is `01/04/2016 00:00:00` `EndDate` valu...

20 Oct at 11:16

Authenticating socket io connections using JWT

How can I authenticate a socket.io connection? My application uses a login endpoint from another server (python) to get a token, how can I get use that token whenever a user opens a socket connection ...

16 Feb at 17:47

'PDFsharp cannot handle this PDF feature introduced with Acrobat 6' error while opening PDF file

I use PDFsharp (v1.32) for merging several PDF files. I open documents using this code: ``` PdfDocument inputDocument = PdfReader.Open(pdfFilePath, PdfDocumentOpenMode.Import); ``` And while openin...

22 Apr at 13:30

In ServiceStack, how can I InitSchema of OrmLiteAuthRepository to a Named connection?

We're using the built in OrmLiteAuthRepository in ServiceStack, which has the InitSchema implementation: ``` public void InitSchema() { this.hasInitSchema = true; using (IDbConnection dbConn = th...

22 Apr at 07:55
22 Apr at 07:18

How to display full output in Jupyter, not only last result?

I want Jupyter to print all the interactive output without resorting to print, not only the last result. How to do it? Example : ``` a=3 a a+1 ``` I would like to display > 3 4

25 Apr at 08:53

Why would I not use SqlBulkCopy.EnableStreaming?

The documentation says that it uses less memory, and my ad hoc performance tests show that it is faster. So why would I ever choose to not enable streaming? Reference: [SqlBulkCopy.EnableStreaming Pr...

22 Apr at 06:20

Is there any command to pass a list of keys and get a list of hashes in Redis?

The only way I know to get a list of hashes is to put `HGETALL key` command in a loop for given keys. But, is there any single command to pass a list of keys and get a list of hashes in Redis? This wo...

22 Apr at 04:1

ValueError when checking if variable is None or numpy.array

I'd like to check if variable is None or numpy.array. I've implemented `check_a` function to do this. ``` def check_a(a): if not a: print "please initialize a" a = None check_a(a) a = np...

3 Oct at 01:47

Fluent Assertions: Approximately compare a classes properties

I have a class `Vector3D` that has the properties `X`, `Y` and `Z` of type double (it also has other properties such as `Magnitude`). What is the best way of approximately comparing all the propertie...

22 Apr at 01:9

Printing a java map Map<String, Object> - How?

How to I print information from a map that has the object as the value? I have created the following map: ``` Map<String, Object> objectSet = new HashMap<>(); ``` The object has its own class with...

21 Apr at 23:38

ServiceStack.Funq.Quartz cannot instantiating type?

ServiceStack.Funq.Quartz Sample Code is ``` public class MyServices : Service { public object Any(Hello request) { return new HelloResponse { Result = "Hello, {0}!".Fmt(request.Name)...

21 Apr at 23:39

How do I make a struct immutable?

All over Stack Overflow and the internet I see that it is a good design principle to keep structs immutable. Unfortunately, I never see any implementation that actually causes these structs to be tru...

21 Apr at 20:50

nameof() operator for static string

I understand the use of the `nameof()` operator for exception handling, logging, etc. But I do not understand the example below coming directly from some Microsoft code. How is that more useful than

5 May at 15:53