How to avoid "ConcurrentModificationException" while removing elements from `ArrayList` while iterating it?
I'm trying to remove some elements from an `ArrayList` while iterating it like this: ``` for (String str : myArrayList) { if (someCondition) { myArrayList.remove(str); } } ``` Of co...
What is causing this error - "Fatal error: Unable to find local grunt"
I removed the old version of grunt first, then I installed the new grunt version, and then I got this error: > D:\www\grunt-test\grunt grunt-cli: The grunt command line interface. (v0.1.4)Fatal err...
- Modified
- 30 Nov at 03:1
How to check if a file contains a specific string using Bash
I want to check if a file contains a specific string or not in bash. I used this script, but it doesn't work: ``` if [[ 'grep 'SomeString' $File' ]];then # Some Actions fi ``` What's wrong in m...
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated
I have many users on my web site (20000-60000 per day), which is a download site for mobile files. I have remote access to my server (windows server 2008-R2). I've received errors before, but I am...
- Modified
- 13 Jun at 20:53
Update a submodule to the latest commit
I have a project A which is a library and it is used in a project B. Both projects A and B have a separate repository on github BUT inside B we have a submodule of A. I edited some classes on the li...
- Modified
- 28 May at 02:3
Is the Javascript date object always one day off?
In my Java Script app I have the date stored in a format like so: ``` 2011-09-24 ``` Now when I try using the above value to create a new Date object (so I can retrieve the date in a different format...
- Modified
- 10 Jan at 13:45
How to use IntelliJ IDEA to find all unused code?
When I am in a .java file, the unused code is usually grayed out or has a green underline saying this code will probably (probably because of some weird JNI/Reflection corner cases) be unused. But I h...
- Modified
- 27 Dec at 01:5
No route matches "/users/sign_out" devise rails 3
I've installed devise on my app and applied the following in my `application.html.erb` file: ``` <div id="user_nav"> <% if user_signed_in? %> Signed in as <%= current_user.email %>. This ...
- Modified
- 5 Aug at 20:42
How to diff one file to an arbitrary version in Git?
How can I diff a file, say `pom.xml`, from the master branch to an arbitrary older version in Git?
'too many values to unpack', iterating over a dict. key=>string, value=>list
I am getting the `too many values to unpack` error. Any idea how I can fix this? ``` first_names = ['foo', 'bar'] last_names = ['gravy', 'snowman'] fields = { 'first_names': first_names, 'las...
- Modified
- 11 Mar at 03:2
Convert a python dict to a string and back
I am writing a program that stores data in a dictionary object, but this data needs to be saved at some point during the program execution and loaded back into the dictionary object when the program i...
- Modified
- 17 Feb at 01:46
How to search in commit messages using command line?
> [How to search through all commits in the repository?](https://stackoverflow.com/questions/746684/how-to-search-through-all-commits-in-the-repository) Is there a way to search through commit...
Why doesn't os.path.join() work in this case?
The below code will not join, when debugged the command does not store the whole path but just the last entry. ``` os.path.join('/home/build/test/sandboxes/', todaystr, '/new_sandbox/') ``` When I ...
Why would you use String.Equals over ==?
I recently was introduced to a large codebase and noticed all string comparisons are done using `String.Equals()` instead of `==` What's the reason for this, do you think?
How do I run a terminal inside of Vim?
I am used to Emacs, but I am trying out Vim to see which one I like better. One thing that I like about Emacs is the ability to run a terminal inside Emacs. Is this possible inside of Vim? I know th...
- Modified
- 31 Dec at 12:30
How to recursively list all the files in a directory in C#?
How to recursively list all the files in a directory and child directories in C#?
JavaScript open in a new window, not tab
I have a select box that calls `window.open(url)` when an item is selected. Firefox will open the page in a new tab by default. However, I would like the page to open in a new window, not a new tab....
- Modified
- 5 May at 01:40
How do you change the datatype of a column in SQL Server?
I am trying to change a column from a `varchar(50)` to a `nvarchar(200)`. What is the SQL command to alter this table?
- Modified
- 21 Oct at 00:19
How should I choose an authentication library for CodeIgniter?
I see there are [a few](http://codeigniter.com/wiki/Category:Libraries::Authentication/). Which ones are maintained and easy to use? What are their pros and cons?
- Modified
- 24 May at 03:37
Can Rails Routing Helpers (i.e. mymodel_path(model)) be Used in Models?
Say I have a Rails Model called Thing. Thing has a url attribute that can be set to a URL somewhere on the Internet. In view code, I need logic that does the following: ``` <% if thing.url.blank? %>...
- Modified
- 24 Jul at 20:36
How can I generate a list of files with their absolute path in Linux?
I am writing a shell script that takes file paths as input. For this reason, I need to generate recursive file listings with full paths. For example, the file `bar` has the path: ``` /home/ken/foo/b...
- Modified
- 8 Feb at 19:13
Why docker container exits immediately
I run a container in the background using ``` docker run -d --name hadoop h_Service ``` it exits quickly. But if I run in the foreground, it works fine. I checked logs using ``` docker logs hadoop...
- Modified
- 1 Feb at 03:1
What does axis in pandas mean?
Here is my code to generate a dataframe: ``` import pandas as pd import numpy as np dff = pd.DataFrame(np.random.randn(1,2),columns=list('AB')) ``` then I got the dataframe: ``` +------------+---...
receiving error: 'Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN' while using npm
I am using npm v1.0.104/node 0.6.12 on ubuntu - I am receiving the error copied below while attempting to install any new modules via npm (I tested socket.io earlier using http, not https though & am ...
- Modified
- 15 Dec at 11:24
Difference between ApiController and Controller in ASP.NET MVC
I've been playing around with ASP.NET MVC 4 beta and I see two types of controllers now: `ApiController` and `Controller`. I'm little confused at what situations I can choose a particular controller...
- Modified
- 29 Feb at 07:16