Merge two (or more) lists into one, in C# .NET
Is it possible to convert two or more lists into one single list, in .NET using C#? For example, ``` public static List<Product> GetAllProducts(int categoryId){ .... } . . . var productCollection1 ...
Gradient borders
I'm trying to apply a gradient to a border, I thought it was as simple as doing this: ``` border-color: -moz-linear-gradient(top, #555555, #111111); ``` But this does not work. Does anyone know wh...
How to calculate the number of days between two dates?
1. I am calculating the number of days between the 'from' and 'to' date. For example, if the from date is 13/04/2010 and the to date is 15/04/2010 the result should be 2. How do I get the result usin...
- Modified
- 9 Aug at 13:52
Automapper: Update property values without creating a new object
How can I use automapper to update the properties values of another object without creating a new one?
- Modified
- 3 Mar at 20:28
Size of character ('a') in C/C++
What is the size of character in C and C++ ? As far as I know the size of char is 1 byte in both C and C++. [In C:](https://web.archive.org/web/20000000000000/http://www.ideone.com/e3Yo1Kyf) ``` #in...
In Python, how do I convert all of the items in a list to floats?
I have a script which reads a text file, pulls decimal numbers out of it as strings and places them into a list. So I have this list: ``` my_list = ['0.49', '0.54', '0.54', '0.55', '0.55', '0.54', '0....
Is it better practice to use String.format over string Concatenation in Java?
Is there a perceptible difference between using `String.format` and String concatenation in Java? I tend to use `String.format` but occasionally will slip and use a concatenation. I was wondering if ...
- Modified
- 18 Apr at 10:18
Running Internet Explorer 6, Internet Explorer 7, and Internet Explorer 8 on the same machine
Like everyone else, I need to test my code on Internet Explorer 6 and Internet Explorer 7. Now Internet Explorer 8 has some great tools for developer, which I'd like to use. I'd also like to start tes...
- Modified
- 19 Oct at 23:16
Can you overload controller methods in ASP.NET MVC?
I'm curious to see if you can overload controller methods in ASP.NET MVC. Whenever I try, I get the error below. The two methods accept different arguments. Is this something that cannot be done? ...
- Modified
- 25 May at 02:24
Exception messages in English?
We are logging any exceptions that happen in our system by writing the Exception.Message to a file. However, they are written in the culture of the client. And Turkish errors don't mean a lot to me. ...
- Modified
- 14 Jan at 16:34
Hidden Features of Xcode
With a huge influx of newbies to Xcode, I'm sure there are lots of Xcode tips and tricks to be shared. What are yours?
- Modified
- 6 May at 17:23
Null or default comparison of generic argument in C#
I have a generic method defined like this: ``` public void MyMethod<T>(T myArgument) ``` The first thing I want to do is check if the value of myArgument is the default value for that type, somethi...
Android adding simple animations while setvisibility(view.Gone)
I have designed a simple layout.I have finished the design without animation, but now I want to add animations when textview click event and I don't know how to use it. Did my xml design looks good or...
- Modified
- 2 Sep at 23:12
How do I plot in real-time in a while loop using matplotlib?
I am trying to plot some data from a camera in real time using OpenCV. However, the real-time plotting (using matplotlib) doesn't seem to be working. I've isolated the problem into this simple exampl...
- Modified
- 5 Apr at 13:0
break out of if and foreach
I have a foreach loop and an if statement. If a match is found i need to ultimately break out of the foreach. ``` foreach ($equipxml as $equip) { $current_device = $equip->xpath("name"); if (...
- Modified
- 13 Jul at 14:34
load and execute order of scripts
There are so many different ways to include JavaScript in a html page. I know about the following options: - - [1](https://stackoverflow.com/questions/1213281/does-javascript-have-to-be-in-the-head-t...
- Modified
- 23 May at 12:10
HTML Entity Decode
How do I encode and decode HTML entities using JavaScript or JQuery? ``` var varTitle = "Chris' corner"; ``` I want it to be: ``` var varTitle = "Chris' corner"; ```
- Modified
- 11 Dec at 17:31
In Python, how do you convert seconds since epoch to a `datetime` object?
The `time` module can be initialized using seconds since epoch: ``` >>> import time >>> t1=time.gmtime(1284286794) >>> t1 time.struct_time(tm_year=2010, tm_mon=9, tm_mday=12, tm_hour=10, tm_min=19, ...
Any shortcut to initialize all array elements to zero?
In `C/C++` I used to do ``` int arr[10] = {0}; ``` ...to initialize all my array elements to 0. Is there a similar shortcut in Java? I want to avoid using the loop, is it possible? ``` int arr[...
- Modified
- 20 Dec at 18:38
How to set HttpResponse timeout for Android in Java
I have created the following function for checking the connection status: ``` private void checkConnectionStatus() { HttpClient httpClient = new DefaultHttpClient(); try { String url =...
- Modified
- 19 Jun at 14:13
How do I profile memory usage in Python?
I've recently become interested in algorithms and have begun exploring them by writing a naive implementation and then optimizing it in various ways. I'm already familiar with the standard Python mod...
Programmatically get own phone number in iOS
Is there any way to get own phone number by standard APIs from iPhone SDK?
- Modified
- 18 Dec at 09:14
Copy tables from one database to another in SQL Server
I have a database called foo and a database called bar. I have a table in foo called tblFoobar that I want to move (data and all) to database bar from database foo. What is the SQL statement to do thi...
- Modified
- 8 Dec at 02:19
How do I pass a string into subprocess.Popen (using the stdin argument)?
If I do the following: ``` import subprocess from cStringIO import StringIO subprocess.Popen(['grep','f'],stdout=subprocess.PIPE,stdin=StringIO('one\ntwo\nthree\nfour\nfive\nsix\n')).communicate()[0]...
- Modified
- 15 Jan at 04:5