Questions

Is there a way to check if int is legal enum in C#?

I've read a few SO posts and it seems most basic operation is missing. ``` public enum LoggingLevel { Off = 0, Error = 1, Warning = 2, Info = 3, Debug = 4, Trace = 5 }; if (s...

12 Feb at 20:23

Can't pickle <type 'instancemethod'> when using multiprocessing Pool.map()

I'm trying to use `multiprocessing`'s `Pool.map()` function to divide out work simultaneously. When I use the following code, it works fine: ``` import multiprocessing def f(x): return x*x def ...

SQL Server - transactions roll back on error?

We have client app that is running some SQL on a SQL Server 2005 such as the following: ``` BEGIN TRAN; INSERT INTO myTable (myColumns ...) VALUES (myValues ...); INSERT INTO myTable (myColumns ...) ...

SHA512 vs. Blowfish and Bcrypt

I'm looking at hashing algorithms, but couldn't find an answer. - - - Thanks.. I want to clarify that I understand the difference between hashing and encryption. What prompted me to ask the qu...

21 Jul at 08:44

jquery if div id has children

This `if`-condition is what's giving me trouble: ``` if (div id=myfav has children) { do something } else { do something else } ``` I tried all the following: ``` if ( $('#myfav:hasChildren...

30 Mar at 00:41

SVN Commit specific files

Is there any way to commit only a list of specific files (e.q. just one of the list of files that SVN wants to commit). I'm working on MAC OS X under Terminal, without any UI.

26 May at 13:19

Can constructors throw exceptions in Java?

Are constructors allowed to throw exceptions?

16 Feb at 20:47

Accessing an array out of bounds gives no error, why?

I am assigning values in a C++ program out of the bounds like this: ``` #include <iostream> using namespace std; int main() { int array[2]; array[0] = 1; array[1] = 2; array[3] = 3; ...

19 Mar at 12:32

Verifying that a string contains only letters in C#

I have an input string and I want to verify that it contains: - - - To clarify, I have 3 different cases in the code, each calling for different validation. What's the simplest way to achieve this ...

25 Apr at 21:26

Selectively suppress custom Obsolete warnings

I'm using the `Obsolete` attribute (as just suggested by fellow programmers) to show a warning if a certain method is used. Is there a way to suppress the warning similar to CodeAnalysis' `SuppressMes...

10 Apr at 22:43

How to copy a selection to the OS X clipboard

I have an area selected in Vim. How can I copy it into the OS X clipboard? (The OS X clipboard can be written to via a pipe to `/usr/bin/pbcopy`)

9 Dec at 20:20

How do I convert Word files to PDF programmatically?

I have found several open-source/freeware programs that allow you to convert .doc files to .pdf files, but they're all of the application/printer driver variety, with no SDK attached. I have found se...

3 Mar at 19:3

Graphical DIFF programs for linux

I really like Merge for a graphical DIFF program for the PC. I have no idea what's available for , though. We're running SUSE linux on our z800 mainframe. I'd be most grateful if I could get a few p...

28 Nov at 14:38

Could not install packages due to an EnvironmentError: [Errno 13]

In my MacOS Mojave terminal I wanted to install a python package with pip. At the end it says: ``` You are using pip version 10.0.1, however version 18.1 is available. You should consider upgrading v...

6 Sep at 13:59

Basic authentication with fetch?

I want to write a simple basic authentication with fetch, but I keep getting a 401 error. It would be awesome if someone tells me what's wrong with the code: ``` let base64 = require('base-64'); let ...

4 Jun at 07:34

Visual Studio 2017: Display method references

How can I display the references on top of a method declaration? I looked for it in the Visual Studio properties, but could not find it.

10 Aug at 11:24

Typescript react - Could not find a declaration file for module ''react-materialize'. 'path/to/module-name.js' implicitly has an any type

I am trying to import components from react-materialize as - ``` import {Navbar, NavItem} from 'react-materialize'; ``` But when the webpack is compiling my `.tsx` it throws an error for the above as...

18 Jan at 12:9

Raw SQL Query without DbSet - Entity Framework Core

With Entity Framework Core removing `dbData.Database.SqlQuery<SomeModel>` I can't find a solution to build a raw SQL Query for my full-text search query that will return the tables data and also the r...

27 Mar at 04:11

Angular 2: 404 error occur when I refresh through the browser

I have stored my single-page application in my server within a folder named as "myapp". I have changed the URL in the base to [http://example.com/myapp/`](http://example.com/myapp/%60). My project has...

29 Dec at 01:14

How to center content in a Bootstrap column?

I am trying to center column's content. Does not look like it works for me. Here is my HTML: ``` <div class="row"> <div class="col-xs-1 center-block"> <span>aaaaaaaaaaaaaaaaaaaaaaaaaaa</spa...

2 Dec at 22:19

Get User's Current Location / Coordinates

How can I store the user's current location and also show the location on a map? I am able to show pre-defined coordinates on a map, I just don't know how to receive information from the device. Als...

Relative frequencies / proportions with dplyr

Suppose I want to calculate the proportion of different values within each group. For example, using the `mtcars` data, how do I calculate the frequency of number of by (automatic/manual) in one go...

3 May at 07:57

Parcelable encountered IOException writing serializable object getactivity()

so I am getting this in logcat: ``` java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.resources.student_list.Student) ``` I know this means that...

17 Apr at 20:40

Build error: You must add a reference to System.Runtime

I'm preparing a brand new ASP.NET MVC 5.1 solution. I'm adding in a bunch of NuGet packages and setting it up with Zurb Foundation, etc. As part of that, I've added a reference to an in-house NuGet pa...

How can I use a batch file to write to a text file?

I need to make a script that can write one line of text to a text file in the same directory as the batch file.

18 Oct at 14:40