Questions

Member '<member name>' cannot be accessed with an instance reference

I am getting into C# and I am having this issue: ``` namespace MyDataLayer { namespace Section1 { public class MyClass { public class MyItem { ...

25 Aug at 19:32

How do I execute a stored procedure once for each row returned by query?

I have a stored procedure that alters user data in a certain way. I pass it user_id and it does it's thing. I want to run a query on a table and then for each user_id I find run the stored procedure o...

6 Apr at 04:31

How to hide close button in WPF window?

I'm writing a modal dialog in WPF. How do I set a WPF window to not have a close button? I'd still like for its `WindowState` to have a normal title bar. I found `ResizeMode`, `WindowState`, and `Win...

22 Apr at 05:51

Good Python modules for fuzzy string comparison?

I'm looking for a Python module that can do simple fuzzy string comparisons. Specifically, I'd like a percentage of how similar the strings are. I know this is potentially subjective so I was hoping...

How to suppress scientific notation when printing float values?

Here's my code: ``` x = 1.0 y = 100000.0 print x/y ``` My quotient displays as `1.00000e-05`. Is there any way to suppress scientific notation and make it display as `0.00001`? I'm going to us...

23 May at 19:11

How to skip iterations in a loop?

I have a loop going, but there is the possibility for exceptions to be raised inside the loop. This of course would stop my program all together. To prevent that I catch the exceptions and handle them...

22 Oct at 14:32

Setting custom UITableViewCells height

I am using a custom UITableViewCell which has some labels, buttons and image views to be displayed. There is one label in the cell whose text is a `NSString` object and the length of string could be v...

How do you find all subclasses of a given class in Java?

How does one go about and try to find all subclasses of a given class (or all implementors of a given interface) in Java? As of now, I have a method to do this, but I find it quite inefficient (to say...

2 Oct at 13:15

Lists in ConfigParser

The typical ConfigParser generated file looks like: ``` [Section] bar=foo [Section 2] bar2= baz ``` Now, is there a way to index lists like, for instance: ``` [Section 3] barList={ item1, ...

27 Nov at 22:18

How to find the kth largest element in an unsorted array of length n in O(n)?

I believe there's a way to find the kth largest element in an unsorted array of length n in O(n). Or perhaps it's "expected" O(n) or something. How can we do this?

15 Sep at 02:37

Hidden features of Windows batch files

What are some of the lesser know, but important and useful features of Windows batch files? Guidelines: - - - Clarification: We refer here to scripts that are processed by cmd.exe, which is the de...

23 May at 12:34

Reading Excel files from C#

Is there a free or open source library to read Excel files (.xls) directly from a C# program? It does not need to be too fancy, just to select a worksheet and read the data as strings. So far, I've ...

26 Sep at 18:42

Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`

Recently, when I compile my scss files I get an error. The error message says: > Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist` First, as the me...

12 Sep at 14:36

How to get argument types from function in Typescript

I may have missed something in the docs, but I can't find any way in typescript to get the types of the parameters in a function. That is, I've got a function ``` function test(a: string, b: number)...

How to remove an unpushed outgoing commit in Visual Studio?

I accidentally pushed a staged change in a new branch in Visual Studio 2017 to my local repository. It hasn't been pushed to the remote repository. I want to get rid of it but can't find a way to do t...

/bin/sh: apt-get: not found

I am trying to change a dockerFile to work with aspell. I have a bash script that I want to wrap in a dock > Step 4: Wrap the script in a Docker container.The sample SDK we downloaded earlier contains...

22 Sep at 21:15

How do I format all files in a Visual Studio Code project?

Is there a way to format all files in a project without formatting each one individually?

18 May at 13:19

How to unit test with ILogger in ASP.NET Core

This is my controller: ``` public class BlogController : Controller { private IDAO<Blog> _blogDAO; private readonly ILogger<BlogController> _logger; public BlogController(ILogger<BlogCon...

What’s the purpose of the HTML "nonce" attribute for script and style elements?

W3C says there is a new attribute in HTML5.1 called `nonce` for `style` and `script` that can be used by the Content Security Policy of a website. I googled about it but finally didn't get it what ac...

How to POST form data with Spring RestTemplate?

I want to convert the following (working) curl snippet to a RestTemplate call: ``` curl -i -X POST -d "email=first.last@example.com" https://app.example.com/hr/email ``` How do I pass the email par...

28 Sep at 07:23

Swagger UI Web Api documentation Present enums as strings?

Is there a way to display all enums as their string value in swagger instead of their int value? I want to be able to submit POST actions and put enums according to their string value without having...

JavaScript: Difference between .forEach() and .map()

I know that there were a lot of topics like this. And I know the basics: `.forEach()` operates on original array and `.map()` on the new one. In my case: ``` function practice (i){ return i+1; }...

3 Apr at 21:14

How to make the webpack dev server run on port 80 and on 0.0.0.0 to make it publicly accessible?

I am new to the whole / world so apologies if my question sounds silly. So I am playing around with [reactabular.js](https://github.com/reactabular/reactabular). Whenever I do a `npm start` it always...

Setting environment variable in react-native?

I am using react-native to build a cross-platform app, but I do not know how to set the environment variable so that I can have different constants for different environments. Example: ``` developme...

23 Apr at 10:18

How to add 'libs' folder in Android Studio?

I need help in creating the 'libs' folder in Android Studio for my project (It is not auto-generated in my project). When I want to create a folder, it gives me lots of options, like AIDL, Assets, JN...

23 May at 06:29