How to identify which OS Python is running on?
What do I need to look at to see whether I'm on Windows or Unix, etc?
- Modified
- 30 Oct at 17:45
Create Generic method constraining T to an Enum
I'm building a function to extend the `Enum.Parse` concept that - - So I wrote the following: ``` public static T GetEnumFromString<T>(string value, T defaultValue) where T : Enum { if (string.Is...
- Modified
- 13 Apr at 00:37
Attempted to read or write protected memory. This is often an indication that other memory is corrupt
I'm hoping someone can enlighten me as to what could possibly be causing this error: > Attempted to read or write protected memory. This is often an indication that other memory is corrupt. I cannot...
- Modified
- 2 Nov at 02:49
intellij incorrectly saying no beans of type found for autowired repository
I have created a simple unit test but IntelliJ is incorrectly highlighting it red. marking it as an error No beans? ![enter image description here](https://i.stack.imgur.com/4cCFH.png) As you can s...
- Modified
- 12 Nov at 15:0
PHP file_get_contents() returns "failed to open stream: HTTP request failed!"
I am having problems calling a url from PHP code. I need to call a service using a query string from my PHP code. If I type the url into a browser, it works ok, but if I use file-get-contents() to mak...
- Modified
- 11 Sep at 09:29
How do you parse and process HTML/XML in PHP?
How can one parse HTML/XML and extract information from it?
- Modified
- 24 Dec at 15:45
Returning a file to View/Download in ASP.NET MVC
I'm encountering a problem sending files stored in a database back to the user in ASP.NET MVC. What I want is a view listing two links, one to view the file and let the mimetype sent to the browser de...
- Modified
- 24 Apr at 00:20
Error message 'Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.'
I have developed an application using [Entity Framework](http://en.wikipedia.org/wiki/ADO.NET_Entity_Framework), SQL Server 2000, Visual Studio 2008 and Enterprise Library. It works absolutely fine lo...
- Modified
- 20 Jun at 09:12
jQuery access input hidden value
How can I access `<input type="hidden">` tag's `value` attribute using jQuery?
- Modified
- 27 Nov at 11:12
How do I initialize a TypeScript Object with a JSON-Object?
I receive a JSON object from an AJAX call to a REST server. This object has property names that match my TypeScript class (this is a follow-on to [this question](https://stackoverflow.com/questions/22...
- Modified
- 5 Dec at 15:50
How to find the mysql data directory from command line in windows
In linux I could find the mysql installation directory with the command `which mysql`. But I could not find any in windows. I tried `echo %path%` and it resulted many paths along with path to mysql bi...
- Modified
- 24 Nov at 04:25
Java 8 Lambda function that throws exception?
I know how to create a reference to a method that has a `String` parameter and returns an `int`, it's: ``` Function<String, Integer> ``` However, this doesn't work if the function throws an excepti...
How to swap text based on patterns at once with sed?
Suppose I have 'abbc' string and I want to replace: - - If I try two replaces the result is not what I want: ``` echo 'abbc' | sed 's/ab/bc/g;s/bc/ab/g' abab ``` So what sed command can I use to...
What is the difference between id and class in CSS, and when should I use them?
``` #main { background: #000; border: 1px solid #AAAAAA; padding: 10px; color: #fff; width: 100px; } ``` ``` <div id="main"> Welcome </div> ``` Here I gave an `id` to the `...
Adding onClick event dynamically using jQuery
Due to a plugin being used, I can't add the "onClick" attribute to the HTML form inputs like usual. A plugin is handling the forms part in my site and it doesn't give an option to do this automaticall...
- Modified
- 5 Sep at 14:50
How to read a CSV file into a .NET Datatable
How can I load a CSV file into a `System.Data.DataTable`, creating the datatable based on the CSV file? Does the regular ADO.net functionality allow this?
JavaScript variable number of arguments to function
Is there a way to allow "unlimited" vars for a function in JavaScript? Example: ``` load(var1, var2, var3, var4, var5, etc...) load(var1) ```
- Modified
- 8 Apr at 09:50
How to create a new component in Angular 4 using CLI
In angular 2 I use ``` ng g c componentname ``` But It is not supported in Angular 4, so I created it manually, but it shows error that it is not a module.
- Modified
- 24 May at 07:17
When should I use File.separator and when File.pathSeparator?
In the `File` class there are two strings, [separator](http://docs.oracle.com/javase/8/docs/api/java/io/File.html#separator) and [pathSeparator](http://docs.oracle.com/javase/8/docs/api/java/io/File.h...
- Modified
- 13 Aug at 18:43
Cannot make a static reference to the non-static method
Building a multi-language application in Java. Getting an error when inserting String value from `R.string` resource XML file: ``` public static final String TTT = (String) getText(R.string.TTT); ``...
- Modified
- 7 May at 07:10
How to remove an app with active device admin enabled on Android?
I wrote an app with device admin enabled (DevicePolicyManager) and installed. But when I want to uninstall it, it returns failed with this message > WARN/PackageManager(69): Not removing package com....
- Modified
- 22 Jun at 03:30
How to access parent Iframe from JavaScript
Well, I have an IFrame, which calls a same domain page. My problem is that I want to access some information from this parent Iframe from this called page (from JavaScript). How can I access this Ifra...
- Modified
- 23 Jul at 14:54
MySQL Incorrect datetime value: '0000-00-00 00:00:00'
I've recently taken over an old project that was created 10 years ago. It uses MySQL 5.1. Among other things, I need to change the default character set from latin1 to utf8. As an example, I have ta...
- Modified
- 22 Feb at 22:23
How to run cron job every 2 hours?
How can I write a Crontab that will run my `/home/username/test.sh` script every 2 hours?
How to run test methods in specific order in JUnit4?
I want to execute test methods which are annotated by `@Test` in specific order. For example: ``` public class MyTest { @Test public void test1(){} @Test public void test2(){} } ``` I want...
- Modified
- 28 Oct at 10:59