Best way to flatten JS object (keys and values) to a single depth array
I have written this small function to get all keys and values of an object and store them into an array. The object might contain arrays as values... `Object { 0: [1,2,3,4] }` to `[0,1,2,3,4]` conver...
- Modified
- 17 Oct at 10:36
Is it safe to store a JWT in localStorage with ReactJS?
I'm currently building a single page application using ReactJS. I read that one of the reasons for not using `localStorage` is because of XSS vulnerabilities. Since React escapes all user input, would...
- Modified
- 11 Mar at 17:9
Always encrypted with Entity Framework and Includes fails to materialise query
I am having issues getting always encrypt to play nice with Entity Framework. I am targetting .Net 4.6.1, have enabled `Column Encryption Setting=Enabled` in my connection string and i can successful...
- Modified
- 30 Apr at 12:50
xunit test for IFormFile field in Asp.net Core
I have an Asp.net Core method with below definition. I want to create XUnit Test for this function, how could I mock `IFormFile`? Controller: Xunit Test But, I got empty image in the target path.
- Modified
- 6 May at 20:45
MySql.Data.MySqlClient.MySqlException using ServiceStack ORMLite
I am working with ServiceStack evaluating the ORMLite provider with MySql for use on a.NET Core 1.1 project. I am running into a curious issue I am not sure what the problem is and looking for some gu...
- Modified
- 23 May at 07:21
'DataFrame' object has no attribute 'sort'
I face some problem here, in my python package I have install `numpy`, but I still have this error: > Anyone can give me some idea.. This is my code : ``` final.loc[-1] =['', 'P','Actual'] final.inde...
Is the popular "volatile polled flag" pattern broken?
Suppose that I want to use a boolean status flag for cooperative cancellation between threads. (I realize that one should preferably use `CancellationTokenSource` instead; that is not the point of thi...
- Modified
- 14 Jun at 19:9
This is Sparta, or is it?
The following is an interview question. I came up with a solution, but I'm not sure why it works. --- Without modifying the `Sparta` class, write some code that makes `MakeItReturnFalse` return...
- Modified
- 20 Apr at 20:21
Kotlin Data Class from Json using GSON
I have Java POJO class like this: ``` class Topic { @SerializedName("id") long id; @SerializedName("name") String name; } ``` and I have a Kotlin data class Like this ``` data cla...
- Modified
- 15 Apr at 04:23
Automatically HtmlEncode strings when the model is serialized with Json.Net
Is there a way to configure Json.Net to automatically encode all strings like `HtmlEncode(myString)` when the model is serialized?
- Modified
- 5 May at 15:52
VirtualBox Cannot register the hard disk already exists
I created a virtual disk file . Then I moved it into another folder. I tried to update VM settings (right click on virtual machine -> settings -> Storage -> Controller SATA tab, path). I wanted to se...
- Modified
- 22 May at 14:0
The create-react-app imports restriction outside of src directory
I am using create-react-app. I am trying to call an image from my public folder from a file inside my `src/components`. I am receiving this error message. > ./src/components/website_index.js Module n...
- Modified
- 6 Feb at 18:18
Twilio callback is not working in my .NET service
I am developing an SMS service which is expected to send SMS. Apart from that, I need to track status of the SMS. I am using Twilio as an SMS provider, and ServiceStack to implement Service Layer. I...
- Modified
- 22 May at 12:24
C# RabbitMQ wait for one message for specified timeout?
Solutions in [RabbitMQ Wait for a message with a timeout](https://stackoverflow.com/questions/3760100/rabbitmq-wait-for-a-message-with-a-timeout) and [Wait for a single RabbitMQ message with a timeout...
Bind All data in Jquery Datatables from View To Controller
Im binding my Data in View to Controller, so later I could do what I want with the data. In my View, im using `dataTable` and `@Html.EditorForModel()` to render my View. View ``` <form action="xx" ...
- Modified
- 31 May at 08:10
Missing Create GUID in Visual Studio Enterprise 2017?
> Where can I find Create GUID options in Visual Studio 2017? I'm using Visual Studio Enterprise 2017 Edition and I'm not finding the Create GUID options from the Tools menu.
- Modified
- 22 May at 03:41
Grpc.Core.RpcException method is unimplemented with C# client and Java Server
I am having trouble finding the source of this error. I implemented a simple service using protobuf: ``` syntax = "proto3"; package tourism; service RemoteService { rpc Login(LoginUserDTO) return...
- Modified
- 21 May at 22:15
FromBluetoothAddressAsync IAsyncOperation does not contain a definition for 'GetAwaiter' error
I am working on a simple BLE UWP. I've been referring to "[Windows UWP connect to BLE device after discovery](https://stackoverflow.com/questions/35420940/windows-uwp-connect-to-ble-device-after-disco...
- Modified
- 10 May at 22:28
"EF BB BF" at the beginning of JSON files created in Visual Studio
I have a bunch of `JSON` files set as `Embedded resource` in one of my projects. I'm using `Newtonsoft.Json` to parse these files: ``` public static string ReadStringFromStream(string streamName) { ...
await Task.CompletedTask for what?
I created UWP app with [Windows Template Studio](https://blogs.windows.com/buildingapps/2017/05/16/announcing-windows-template-studio/) that introduced at Build2017. Below class is a part of generate...
- Modified
- 21 May at 11:20
Need to set Debug-specific Environment Variable in VS.NET 2017
All, I apologize if this is the world's dumbest question. I found this: [https://stackoverflow.com/a/155363/463196](https://stackoverflow.com/a/155363/463196) I can't find the menu item when follow...
- Modified
- 23 May at 12:34
How to suppress InMemoryEventId.TransactionIgnoredWarning when unit testing with in-memory database with transactions?
I'm using an EF Core in-memory database and I'm trying to run a unit test on a method that uses transactions: ``` using (var transaction = await _context.Database.BeginTransactionAsync()) { _conte...
- Modified
- 19 Nov at 12:3
What's the difference between DataContext and BindingContext
I have been studying databinding techniques in numerous different WPF/MVVM resources. I thought I had a fairly strong grasp on the purpose and use of the `DataContext` object. But then I came across [...
View Component as a Tag Helper does not get Invoked
Invoking a View Component as a Tag Helper was introduced in ASP.NET Core 1.1. (See [“Invoking a view component as a Tag Helper”][1]). But the following only returns the _Test for VC_ part of the view....
- Modified
- 3 May at 05:12
Pass through authentication with ASP Core MVC, Web API and IdentityServer4?
I have been working on migrating a monolithic ASP Core MVC application to use an service architecture design. The MVC front-end website uses an `HttpClient` to load necessary data from the ASP Core W...
- Modified
- 19 May at 19:34