Counting the occurrences / frequency of array elements
In Javascript, I'm trying to take an initial array of number values and count the elements inside it. Ideally, the result would be two new arrays, the first specifying each unique element, and the sec...
- Modified
- 2 Jun at 08:50
Validation failed for one or more entities while saving changes to SQL Server Database using Entity Framework
I want to save my Edit to Database and I am using Entity FrameWork Code-First in ASP.NET MVC 3 / C# but I am getting errors. In my Event class, I have DateTime and TimeSpan datatypes but in my databas...
- Modified
- 11 Aug at 21:26
How to make Google Chrome JavaScript console persistent?
Since I'm building a dynamic site, I need to track the changes between pages, ie. Ajax calls, POST, GET stuff and similar stuff. I'm looking for the same functionality like in Firebug (where you can ...
- Modified
- 3 Nov at 02:58
How can I force div contents to stay in one line with HTML and CSS?
[I have a long text inside a div with defined width](http://jsfiddle.net/NXchy/): HTML: ``` <div>Stack Overflow is the BEST!!!</div> ``` CSS: ``` div { border: 1px solid black; width: 70px; }...
I can't install python-ldap
When I run the following command: ``` sudo pip install python-ldap ``` I get this error: > In file included from Modules/LDAPObject.c:9:Modules/errors.h:8: fatal error: lber.h: No such file or direct...
- Modified
- 21 Jul at 14:17
Cross-Domain Cookies
I have two webapps WebApp1 and WebApp2 in two different domains. 1. I am setting a cookie in WebApp1 in the HttpResponse. 2. How to read the same cookie from HttpRequest in WebApp2? I know it sou...
- Modified
- 25 Dec at 07:11
CSV in Python adding an extra carriage return, on Windows
``` import csv with open('test.csv', 'w') as outfile: writer = csv.writer(outfile, delimiter=',', quoting=csv.QUOTE_MINIMAL) writer.writerow(['hi', 'dude']) writer.writerow(['hi2', 'dude2...
Static Block in Java
I was looking over some code the other day and I came across: ``` static { ... } ``` Coming from C++, I had no idea why that was there. Its not an error because the code compiled fine. What is ...
Difference between DOMContentLoaded and load events
What is the difference between `DOMContentLoaded` and `load` events?
- Modified
- 30 Dec at 16:36
ASP.NET MVC on IIS 7.5 - Error 403.14 Forbidden
I'm running Windows 7 Ultimate (64 bit) using Visual Studio 2010 RC. I recently decided to have VS run/debug my apps on IIS rather than the dev server that comes with it. However, every time I try to ...
Is there a simple way to remove unused dependencies from a maven pom.xml?
I have a large Maven project with many modules and many `pom.xml` files. The project has changed and I suspect the pom's contain some unnecessary dependencies. Is there is a command which removes any ...
How to perform .Max() on a property of all objects in a collection and return the object with maximum value
I have a list of objects that have two int properties. The list is the output of another linq query. The object: ``` public class DimensionPair { public int Height { get; set; } public int ...
Programmatically generate video or animated GIF in Python?
I have a series of images that I want to create a video from. Ideally I could specify a frame duration for each frame but a fixed frame rate would be fine too. I'm doing this in wxPython, so I can r...
- Modified
- 15 Apr at 19:59
PHP exec() vs system() vs passthru()
What are the differences? Is there a specific situation or reason for each function? If yes, can you give some examples of those situations? PHP.net says that they are used to execute external progr...
Push method in React Hooks (useState)?
How to push element inside useState array React hook? Is that as an old method in react state? Or something new? E.g. [setState push example](https://stackoverflow.com/questions/41052598/reactjs-arra...
- Modified
- 25 Feb at 06:24
Error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
[https://github.com/affinelayer/pix2pix-tensorflow/tree/master/tools](https://github.com/affinelayer/pix2pix-tensorflow/tree/master/tools) An error occurred when compiling "process.py" on the above si...
- Modified
- 15 Feb at 09:51
Extracting specific selected columns to new DataFrame as a copy
I have a pandas DataFrame with 4 columns and I want to create a DataFrame that has three of the columns. This question is similar to: [Extracting specific columns from a data frame](https://stackov...
- Modified
- 31 Oct at 21:37
Convert array of indices to one-hot encoded array in NumPy
Given a 1D array of indices: ``` a = array([1, 0, 3]) ``` I want to one-hot encode this as a 2D array: ``` b = array([[0,1,0,0], [1,0,0,0], [0,0,0,1]]) ```
- Modified
- 30 Jul at 08:42
How do you change the launcher logo of an app in Android Studio?
I was wondering how to change the launcher icon in Android Studio.
How to install Python MySQLdb module using pip?
How can I install the [MySQLdb](http://mysql-python.sourceforge.net/MySQLdb.html) module for Python using pip?
How to Get the Current URL Inside @if Statement (Blade) in Laravel 4?
I am using Laravel 4. I would like to access the current URL inside an `@if` condition in a view using the Laravel's Blade templating engine but I don't know how to do it. I know that it can be done ...
- Modified
- 18 Nov at 00:46
How to execute a Python script from the Django shell?
I need to execute a Python script from the Django shell. I tried: ``` ./manage.py shell << my_script.py ``` But it didn't work. It was just waiting for me to write something.
- Modified
- 16 Feb at 11:54
How do I format a date with Dart?
I have an instance of `DateTime` and I would like to format that to a String. How do I do that? I want to turn the date into a string, something like "2013-04-20".
- Modified
- 25 Aug at 20:51
How to close git commit editor?
I just executed a command `$ git commit` and it opens a new editor. But I'm trying to close that new commit editor. How to do this? I'm using Git for Windows.
- Modified
- 29 Dec at 00:49
Getting the IP address of the current machine using Java
I am trying to develop a system where there are different nodes that are run on different system or on different ports on the same system. Now all the nodes create a Socket with a target IP as the I...