Test if a vector contains a given element
How to check if a vector contains a given value?
Interface defining a constructor signature?
It's weird that this is the first time I've bumped into this problem, but: How do you define a constructor in a C# interface? Some people wanted an example (it's a free time project, so yes, it's a...
- Modified
- 14 Jul at 19:52
Unnamed/anonymous namespaces vs. static functions
A feature of C++ is the ability to create unnamed (anonymous) namespaces, like so: ``` namespace { int cannotAccessOutsideThisFile() { ... } } // namespace ``` You would think that such a featu...
- Modified
- 6 Dec at 18:57
*ngIf and *ngFor on same element causing error
I'm having a problem with trying to use Angular's `*ngFor` and `*ngIf` on the same element. When trying to loop through the collection in the `*ngFor`, the collection is seen as `null` and consequen...
- Modified
- 1 Feb at 11:7
How to check if a dictionary is empty?
I am trying to check if a dictionary is empty but it doesn't behave properly. It just skips it and displays without anything aside from the display the message. Any ideas why ? ``` def isEmpty(self, ...
- Modified
- 5 Jan at 13:9
What is a user agent stylesheet?
I'm working on a web page in Google Chrome. It displays correctly with the following styles. ``` table { display: table; border-collapse: separate; border-spacing: 2px; border-color: ...
- Modified
- 26 Apr at 14:22
What does the ^M character mean in Vim?
I keep getting the `^M` character in my `.vimrc` and it breaks my configuration.
- Modified
- 25 Oct at 13:9
What is the equivalent of Java's final in C#?
What is the equivalent of Java's `final` in C#?
- Modified
- 6 Mar at 10:48
Can I add extension methods to an existing static class?
I'm a fan of extension methods in C#, but haven't had any success adding an extension method to a static class, such as `Console`. For example, if I want to add an extension to `Console`, called '`Wri...
- Modified
- 29 Jan at 09:45
How can I check if an element exists in the visible DOM?
How do you test an element for existence without the use of the `getElementById` method? I have set up a [live demo](http://jsbin.com/apawi5/3) for reference. I will also print the code on here as we...
- Modified
- 15 Dec at 04:51
What's the difference between HEAD, working tree and index, in Git?
Can someone tell me the difference between HEAD, working tree and index, in Git? From what I understand, they are all names for different branches. Is my assumption correct? I found this: > A single g...
- Modified
- 11 Jan at 21:24
How can I create a "Please Wait, Loading..." animation using jQuery?
I would like to place a "please wait, loading" spinning circle animation on my site. How should I accomplish this using jQuery?
How to convert Milliseconds to "X mins, x seconds" in Java?
I want to record the time using `System.currentTimeMillis()` when a user begins something in my program. When he finishes, I will subtract the current `System.currentTimeMillis()` from the `start` var...
Is there a NumPy function to return the first index of something in an array?
I know there is a method for a Python list to return the first index of something: ``` >>> xs = [1, 2, 3] >>> xs.index(2) 1 ``` Is there something like that for NumPy arrays?
Looping through array and removing items, without breaking for loop
I have the following for loop, and when I use `splice()` to remove an item, I then get that 'seconds' is undefined. I could check if it's undefined, but I feel there's probably a more elegant way to ...
- Modified
- 19 Sep at 19:8
How to make the first option of <select> selected with jQuery
How do I make the first option of selected with jQuery? ``` <select id="target"> <option value="1">...</option> <option value="2">...</option> </select> ```
How to update the value stored in Dictionary in C#?
How to update value for a specific key in a dictionary `Dictionary<string, int>`?
- Modified
- 1 Feb at 07:0
What is the difference between Integrated Security = True and Integrated Security = SSPI?
I have two apps that use Integrated Security. One assigns `Integrated Security = true` in the connection string, and the other sets `Integrated Security = SSPI`. What is the difference between `SSPI...
- Modified
- 8 Aug at 21:2
How can I indent multiple lines in Xcode?
When I select multiple lines of code and want to indent them as usual with key, it just deletes them all. I come from Eclipse where I always did it that way. How's that done in Xcode? I hope not line...
- Modified
- 13 Mar at 20:46
What is the difference between 'it' and 'test' in Jest?
I have two tests in my test group. One of the tests use `it` and the other one uses `test`. Both of them seem to be working very similarly. What is the difference between them? ``` describe('updateAll...
- Modified
- 28 Nov at 10:35
Smooth scrolling when clicking an anchor link
I have a couple of hyperlinks on my page. A FAQ that users will read when they visit my help section. Using Anchor links, I can make the page scroll towards the anchor and guide the users there. Is ...
- Modified
- 14 Mar at 17:49
OS X: equivalent of Linux's wget
How can I do an HTTP GET from a Un*x shell script on a stock OS X system? (installing third-party software is not an option, for this has to run on a lot of different systems which I don't have contro...
Merging dictionaries in C#
What's the best way to merge 2 or more dictionaries (`Dictionary<TKey, TValue>`) in C#? (3.0 features like LINQ are fine). I'm thinking of a method signature along the lines of: ``` public static Dict...
- Modified
- 19 Dec at 11:56