Questions

Homebrew: Could not symlink, /usr/local/bin is not writable

While installing `tig`, `HomeBrew` is displaying the following issues while installing a dependency: ``` Error: The `brew link` step did not complete successfully The formula built, but is not symlin...

30 Oct at 07:36

Difference between spring @Controller and @RestController annotation

Difference between spring `@Controller` and `@RestController` annotation. Can `@Controller` annotation be used for both Web MVC and REST applications? If yes, how can we differentiate if it is Web MV...

21 Nov at 19:36

How do I escape spaces in path for scp copy in Linux?

I want to copy a file from remote to local system. Now I'm using scp command in linux system. I have some folders or files names are with spaces, when I try to copy that file, it shows the error messa...

29 Dec at 00:38

href="tel:" and mobile numbers

If I use `tel:` I should write the international phone code, like that. ``` <a href="tel:+6494461709">61709</a> ``` So far, so good, but I can't find information on how to write a cell phone number...

8 Apr at 09:46

Encrypting & Decrypting a String in C#

What is the most modern (best) way of satisfying the following in C#? ``` string encryptedString = SomeStaticClass.Encrypt(sourceString); string decryptedString = SomeStaticClass.Decrypt(encryptedSt...

1 Nov at 15:31

Prevent BODY from scrolling when a modal is opened

I want my body to stop scrolling when using the mousewheel while the Modal (from [http://twitter.github.com/bootstrap](http://twitter.github.com/bootstrap)) on my website is opened. I've tried to cal...

22 Feb at 14:16

How do I configure Notepad++ to use spaces instead of tabs?

Notepad++ keeps inserting tabs which later messes up my code. This doesn't just happen when I hit the tab key, but other times as well. I want it to use 4 spaces instead of tabs. How can I make Notep...

27 Jun at 20:13

Running multiple commands with xargs

``` cat a.txt | xargs -I % echo % ``` In the example above, `xargs` takes `echo %` as the command argument. But in some cases, I need multiple commands to process the argument instead of one. For exa...

13 Sep at 06:2

How to get package name from anywhere?

I am aware of the availability of [Context.getApplicationContext()](http://developer.android.com/reference/android/content/Context.html#getApplicationContext%28%29) and [View.getContext()](http://deve...

30 May at 19:2

How do I create a message box with "Yes", "No" choices and a DialogResult?

I want to make simple Yes/No choiced MessageBox, but I think it is nonsense to design a form for that. I thought I could use MessageBox, add buttons, etc. to accomplish this. It is simple, but since t...

1 Mar at 18:29

Website screenshots

Is there any way of taking a screenshot of a website in PHP, then saving it to a file?

9 Aug at 13:46

Do I need to explicitly call the base virtual destructor?

When overriding a class in C++ (with a virtual destructor) I am implementing the destructor again as virtual on the inheriting class, but do I need to call the base destructor? If so I imagine it's s...

24 Mar at 15:52

How to stop text from taking up more than 1 line?

Is there a word-wrap or any other attribute that stops text from wrapping? I have a height, and `overflow:hidden`, and the text still breaks. Needs to work in all browsers, before CSS3.

17 Jul at 16:50

What's the difference between a temp table and table variable in SQL Server?

In SQL Server 2005, we can create temp tables one of two ways: ``` declare @tmp table (Col1 int, Col2 int); ``` or ``` create table #tmp (Col1 int, Col2 int); ``` What are the differences betwee...

VSCode regex find & replace submatch math?

``` %s@{fileID: \(213[0-9]*\)@\='{fileID: '.(submatch(1)-1900)@ ``` I am using this regex search and replace command in vim to subtract a constant from each matching id. I can do the regex find in ...

5 Oct at 12:24

How to check if running as root in a bash script

I'm writing a script that requires root level permissions, and I want to make it so that if the script is not run as root, it simply echoes "Please run as root." and exits. Here's some pseudocode for...

1 Oct at 16:2

Reference requirements.txt for the install_requires kwarg in setuptools setup.py file

I have a `requirements.txt` file that I'm using with Travis-CI. It seems silly to duplicate the requirements in both `requirements.txt` and `setup.py`, so I was hoping to pass a file handle to the `i...

What's the difference between console.dir and console.log?

In Chrome the `console` object defines two methods that seem to do the same thing: ``` console.log(...) console.dir(...) ``` I read somewhere online that `dir` takes a copy of the object before log...

14 Aug at 14:10

Replace whole line containing a string using Sed

I have a text file which has a particular line something like ``` sometext sometext sometext TEXT_TO_BE_REPLACED sometext sometext sometext ``` I need to replace the whole line above with ``` Thi...

30 May at 09:14

The calling thread cannot access this object because a different thread owns it

My code is as below ``` public CountryStandards() { InitializeComponent(); try { FillPageControls(); } catch (Exception ex) { MessageBox.Show(ex.Message, "...

Running a cron every 30 seconds

Ok so I have a cron that I need to run every 30 seconds. Here is what I have: ``` */30 * * * * /bin/bash -l -c 'cd /srv/last_song/releases/20120308133159 && script/rails runner -e production '\''Son...

19 Dec at 07:25

C# Linq Group By on multiple columns

``` public class ConsolidatedChild { public string School { get; set; } public string Friend { get; set; } public string FavoriteColor { get; set; } public List<Child> Children { get; ...

8 Mar at 11:30

Replacing some characters in a string with another character

I have a string like `AxxBCyyyDEFzzLMN` and I want to replace all the occurrences of `x`, `y`, and `z` with `_`. How can I achieve this? I know that `echo "$string" | tr 'x' '_' | tr 'y' '_'` would wo...

15 Feb at 17:40

Evaluate empty or null JSTL c tags

How can I validate if a `String` is null or empty using the `c` tags of `JSTL`? I have a variable of name `var1` and I can display it, but I want to add a comparator to validate it. ``` <c:out value...

5 May at 10:29

What is the difference between bindParam and bindValue?

What is the difference between [PDOStatement::bindParam()](http://www.php.net/manual/en/pdostatement.bindparam.php) and [PDOStatement::bindValue()](http://www.php.net/manual/en/pdostatement.bindvalue....

12 Mar at 18:1