Questions

How to master AngularJS?

I'm pretty new to AngularJS and I find it a bit awkward. The easy stuff is very easy, but the advanced things are significantly harder (directives, provider / service / factory...) The [documentation...

11 Sep at 11:25

CURL Command Line URL Parameters

I am trying to send a `DELETE` request with a url parameter using CURL. I am doing: ``` curl -H application/x-www-form-urlencoded -X DELETE http://localhost:5000/locations` -d 'id=3' ``` However, t...

14 Nov at 00:30

Twitter bootstrap remote modal shows same content every time

I am using Twitter bootstrap, I have specified a modal ``` <div class="modal hide" id="modal-item"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">x</...

Increase number of axis ticks

I'm generating plots for some data, but the number of ticks is too small, I need more on the reading. Is there some way to increase the number of axis ticks in ggplot2? I know I can tell ggplot to ...

21 Mar at 08:35

Disable resizing of a Windows Forms form

How do I turn off the user's ability to resize a Windows Forms form? I'm having it resize itself on a click.

16 Mar at 17:52

Does uninstalling a package with "pip" also remove the dependent packages?

When you use `pip` to install a package, all the required packages will also be installed with it (dependencies). Does uninstalling that package also remove the dependent packages?

22 May at 15:23

Getting the parent div of element

This should be really simple but I'm having trouble with it. How do I get a parent div of a child element? My HTML: ``` <div id="test"> <p id="myParagraph">Testing</p> </div> ``` My JavaScrip...

18 Oct at 20:31

How do I update a formula with Homebrew?

How do I update a formula? I ran `brew update`. However, `mongodb` is still outdated according to `brew outdated`: ``` mongodb (1.4.3-x86_64 < 1.6.5-x86_64) ```

19 May at 20:42

How to randomize two ArrayLists in the same fashion?

I have two arraylist `filelist` and `imgList` which related to each other, e.g. "H1.txt" related to "e1.jpg". How to automatically randomized the list of `imgList` according to the randomization of `f...

19 Jul at 19:28

When to use Cast() and Oftype() in Linq

I am aware of two methods of casting types to `IEnumerable` from an `Arraylist` in Linq and wondering in which cases to use them? e.g ``` IEnumerable<string> someCollection = arrayList.OfType<string...

25 Oct at 15:19

Git commit date

Other than parsing git log for the date string, is there a Git native way to report the date of a certain commit?

28 Sep at 16:24

How to get the list of files in a directory in a shell script?

I'm trying to get the contents of a directory using shell script. My script is: ``` for entry in `ls $search_dir`; do echo $entry done ``` where `$search_dir` is a relative path. However, `$se...

13 Mar at 06:18

How do you do a limit query in JPQL or HQL?

In Hibernate 3, is there a way to do the equivalent of the following MySQL limit in HQL? ``` select * from a_table order by a_table_column desc limit 0, 20; ``` I don't want to use setMaxResults if...

24 Mar at 13:35

What's better at freeing memory with PHP: unset() or $var = null

I realise the second one avoids the overhead of a function call (, is actually a language construct), but it would be interesting to know if one is better than the other. I have been using `unset()` f...

7 May at 12:7

How do I copy a string to the clipboard?

I'm trying to make a basic Windows application that builds a string out of user input and then adds it to the clipboard. How do I copy a string to the clipboard using Python?

4 May at 01:17

How to implement "select all" check box in HTML?

I have an HTML page with multiple checkboxes. I need one more checkbox by the name "select all". When I select this checkbox all checkboxes in the HTML page must be selected. How can I do this?

3 Feb at 09:33

Is there an equivalent for var_dump (PHP) in Javascript?

We need to see what methods/fields an object has in Javascript.

27 Nov at 11:29

How do I filter ForeignKey choices in a Django ModelForm?

Say I have the following in my `models.py`: ``` class Company(models.Model): name = ... class Rate(models.Model): company = models.ForeignKey(Company) name = ... class Client(models.Model)...

15 Nov at 01:21

Is there any way to specify a suggested filename when using data: URI?

If for example you follow the link: `data:application/octet-stream;base64,SGVsbG8=` The browser will prompt you to download a file consisting of the data held as base64 in the hyperlink itself. Is ...

9 Mar at 15:13

Signing a Windows EXE file

I have an [EXE](http://en.wikipedia.org/wiki/EXE) file that I should like to sign so that Windows will not warn the end user about an application from an "unknown publisher". I am not a Windows develo...

26 Jan at 14:42

BeanFactory vs ApplicationContext

I'm pretty new to the Spring Framework, I've been playing around with it and putting a few samples apps together for the purposes of evaluating Spring MVC for use in an upcoming company project. So fa...

.NET - Get protocol, host, and port

Is there a simple way in .NET to quickly get the current protocol, host, and port? For example, if I'm on the following URL: `http://www.mywebsite.com:80/pages/page1.aspx` I need to return: `http:/...

19 Jul at 08:57

Is the C# static constructor thread safe?

In other words, is this Singleton implementation thread safe: ``` public class Singleton { private static Singleton instance; private Singleton() { } static Singleton() { in...

10 Aug at 08:23

.NET Core Unit Testing - Mock IOptions<T>

I feel like I'm missing something really obvious here. I have classes that require injecting of options using the .NET Core `IOptions` pattern(?). When I unit test that class, I want to mock various v...

Multiple RUN vs. single chained RUN in Dockerfile, which is better?

`Dockerfile.1` executes multiple `RUN`: ``` FROM busybox RUN echo This is the A > a RUN echo This is the B > b RUN echo This is the C > c ``` `Dockerfile.2` joins them: ``` FROM busybox RUN echo This...

24 Dec at 01:26