How to pass multiple parameters to a get method in ASP.NET Core
How can I pass in multiple parameters to Get methods in an MVC 6 controller. For example I want to be able to have something like the following. ``` [Route("api/[controller]")] public class PersonCon...
- Modified
- 27 Sep at 23:54
How can I clone an SQL Server database on the same server in SQL Server 2008 Express?
I have an MS SQL Server 2008 Express system which contains a database that I would like to 'copy and rename' (for testing purposes) but I am unaware of a simple way to achieve this. I notice that in ...
- Modified
- 27 Nov at 22:21
How do you clear the console screen in C?
Is there a "proper" way to clear the console window in C, besides using `system("cls")`?
- Modified
- 21 Oct at 20:21
Deleting specific rows from DataTable
I want to delete some rows from DataTable, but it gives an error like this, > Collection was modified; enumeration operation might not execute I use for deleting this code, ``` foreach(DataRow ...
- Modified
- 16 Mar at 05:48
Count the items from a IEnumerable<T> without iterating?
``` private IEnumerable<string> Tables { get { yield return "Foo"; yield return "Bar"; } } ``` Let's say I want iterate on those and write something like processing #n of...
- Modified
- 22 Feb at 17:23
Adjust width of input field to its input
``` <input type="text" value="1" style="min-width:1px;" /> ``` This is my code and it is not working. Is there any other way in HTML, JavaScript, PHP or CSS to set minimum width? I want a text input...
- Modified
- 27 Jul at 13:51
Common elements comparison between 2 lists
Given two input lists, how can I create a list of the elements that are common to both inputs? For example: for inputs `[1,2,3,4,5,6]` and `[3,5,7,9]`, the result should be `[3, 5]`; for inputs `['thi...
Find an element in a list of tuples
I have a list 'a' ``` a= [(1,2),(1,4),(3,5),(5,7)] ``` I need to find all the tuples for a particular number. say for 1 it will be ``` result = [(1,2),(1,4)] ``` How do I do that?
Java: How to set Precision for double value?
I was working with numbers recently and I had a situation where I want to set the precision of a double value say to 6 digits or 4 digits, depending on the value stored in the database. For example, ...
- Modified
- 13 Feb at 03:31
C compiler for Windows?
I'm fine working on Linux using gcc as my C compiler but would like a Windows solution. Any ideas? I've looked at [Dev-C++ from Bloodshed](http://en.wikipedia.org/wiki/Dev-C%2B%2B) but looking for mor...
- Modified
- 18 Jul at 21:30
"unrecognized selector sent to instance" error in Objective-C
I created a button and added an action for it, but as soon as it invoked, I got this error: ``` -[NSCFDictionary numberButtonClick:]: unrecognized selector sent to instance 0x3d03ac0 2010-03-16 22:2...
- Modified
- 13 Apr at 16:5
Convert UTF-8 encoded NSData to NSString
I have UTF-8 encoded `NSData` from windows server and I want to convert it to `NSString` for iPhone. Since data contains characters (like a degree symbol) which have different values on both platforms...
Column name or number of supplied values does not match table definition
In the SQL Server, I am trying to insert values from one table to another by using the below query: ``` delete from tblTable1 insert into tblTable1 select * from tblTable1_Link ``` I am getting the ...
- Modified
- 19 Oct at 22:4
Best practices for adding .gitignore file for Python projects?
I'm trying to collect some of my default settings, and one thing I realized I don't have a standard for is .gitignore files. There's a great thread showing a [good .gitignore for Visual Studio project...
Using AES encryption in C#
I can't seem to find a nice clean example of using AES 128 bit encryption. Does anyone have some sample code?
- Modified
- 22 Mar at 17:25
Creating a copy of a database in PostgreSQL
What's the correct way to copy entire database (its structure and data) to a new one in pgAdmin?
- Modified
- 11 Jan at 21:17
Java Serializable Object to Byte Array
Let's say I have a serializable class `AppMessage`. I would like to transmit it as `byte[]` over sockets to another machine where it is rebuilt from the bytes received. How could I achieve this?
- Modified
- 4 Aug at 17:1
Hibernate throws org.hibernate.AnnotationException: No identifier specified for entity: com..domain.idea.MAE_MFEView
Why am I getting this exception? ``` package com.domain.idea; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Join...
- Modified
- 1 Mar at 10:40
Check a radio button with javascript
For some reason, I can't seem to figure this out. I have some radio buttons in my html which toggles categories: ``` <input type="radio" name="main-categories" id="_1234" value="1234" /> // All <inp...
- Modified
- 20 Sep at 17:13
Regex match one of two words
I have an input that can have only 2 values `apple` or `banana`. What regular expression can I use to ensure that either of the two words was submitted?
- Modified
- 28 Jul at 18:0
How to create an object property from a variable value in JavaScript?
I want to add a new property to 'myObj', name it 'string1' and give it a value of 'string2', but when I do it it returns 'undefined: ``` var myObj = new Object; var a = 'string1'; var b = 'string2'; ...
- Modified
- 28 Feb at 06:25
How to open/run .jar file (double-click not working)?
I can't open or run my .jar file. I just installed java, but I tried to open the .jar with other programs first, so the double-click defaults to something else and I can't change it back. ``` java -...
Check if key exists and iterate the JSON array using Python
I have a bunch of JSON data from Facebook posts like the one below: ``` {"from": {"id": "8", "name": "Mary Pinter"}, "message": "How ARE you?", "comments": {"count": 0}, "updated_time": "2012-05-01",...
Convert a bitmap into a byte array
Using C#, is there a better way to convert a Windows `Bitmap` to a `byte[]` than saving to a temporary file and reading the result using a `FileStream`?