Questions

Find out which remote branch a local branch is tracking

> [How can I see which Git branches are tracking which remote / upstream branch?](https://stackoverflow.com/questions/4950725) How can I find out which remote branch a local branch is tracking?...

16 Mar at 00:55

Deserialize JSON into C# dynamic object?

Is there a way to deserialize JSON content into a C# dynamic type? It would be nice to skip creating a bunch of classes in order to use the `DataContractJsonSerializer`.

13 Aug at 19:42

Is there a simple way to delete a list element by value?

I want to remove a value from a list if it exists in the list (which it may not). ``` a = [1, 2, 3, 4] b = a.index(6) del a[b] print(a) ``` The above gives the error: ``` ValueError: list.index(x): ...

10 Apr at 11:2

How to search a Git repository by commit message?

I checked some source code into GIT with the commit message "Build 0051". However, I can't seem to find that source code any more - how do I extract this source from the GIT repository, using the com...

1 Apr at 17:1

Group By Multiple Columns

How can I do GroupBy multiple columns in LINQ Something similar to this in SQL: ``` SELECT * FROM <TableName> GROUP BY <Column1>,<Column2> ``` How can I convert this to LINQ: ``` QuantityBreakdown ( ...

7 May at 00:31

How can I start PostgreSQL server on Mac OS X?

### Final update: I had forgotten to run the `initdb` command. --- By running this command ``` ps auxwww | grep postgres ``` I see that `postgres` is not running ``` > ps auxwww | grep postgres...

27 Aug at 13:25

Fling gesture detection on grid layout

I want to get `fling` gesture detection working in my Android application. What I have is a `GridLayout` that contains 9 `ImageView`s. The source can be found here: [Romain Guys's Grid Layout](https:...

28 Dec at 08:49

Including all the jars in a directory within the Java classpath

Is there a way to include all the jar files within a directory in the classpath? I'm trying `java -classpath lib/*.jar:. my.package.Program` and it is not able to find class files that are certainly ...

8 Jun at 08:47

Get unique values from a list in python

I want to get the unique values from the following list: ``` ['nowplaying', 'PBS', 'PBS', 'nowplaying', 'job', 'debate', 'thenandnow'] ``` The output which I require is: ``` ['nowplaying', 'PBS', ...

2 Oct at 13:9

Use of PUT vs PATCH methods in REST API real life scenarios

First of all, some definitions: PUT is defined in [Section 9.6 RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6): > The PUT method requests that the enclosed entity be stored und...

20 Jun at 09:30

How to escape braces (curly brackets) in a format string in .NET

How can brackets be escaped in using `string.Format`? For example: ``` String val = "1,2,3" String.Format(" foo {{0}}", val); ``` This example doesn't throw an exception, but it outputs the string `f...

13 Jun at 23:48

Get property value from string using reflection

I am trying implement the [Data transformation using Reflection](https://web.archive.org/web/20210122135227/http://geekswithblogs.net/shahed/archive/2008/07/24/123998.aspx) example in my code. The `Ge...

24 Nov at 15:8

Can a local variable's memory be accessed outside its scope?

I have the following code. ``` #include <iostream> int * foo() { int a = 5; return &a; } int main() { int* p = foo(); std::cout << *p; *p = 8; std::cout << *p; } ``` And the...

What's the difference between HEAD^ and HEAD~ in Git?

When I specify an ancestor commit object in Git, I'm confused between `HEAD^` and `HEAD~`. Both have a "numbered" version like `HEAD^3` and `HEAD~2`. They seem very similar or the same to me, but ar...

31 Aug at 20:20

Collection was modified; enumeration operation may not execute

I can't get to the bottom of this error, because when the debugger is attached, it does not seem to occur. > Collection was modified; enumeration operation may not execute Below is the code. This is a...

How to parse XML and get instances of a particular node attribute?

I have many rows in XML and I'm trying to get instances of a particular node attribute. ``` <foo> <bar> <type foobar="1"/> <type foobar="2"/> </bar> </foo> ``` How do I access the v...

9 Apr at 10:35

What is the difference between <section> and <div>?

What is the difference between `<section>` and `<div>` in `HTML`? Aren't we defining sections in both cases?

2 Jan at 09:56

WebSockets vs. Server-Sent events/EventSource

Both [WebSockets](http://dev.w3.org/html5/websockets/) and [Server-Sent Events](https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events) are capable of pushing data to browse...

jQuery how to find an element based on a data-attribute value?

I've got the following scenario: ``` var el = 'li'; ``` and there are 5 `<li>`'s on the page each with a `data-slide=number` attribute . I now need to find the currently active slide number which ...

How to make links in a TextView clickable

I have the following TextView defined: ``` <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/txtCredits" android:autoLink="web" andr...

14 Sep at 13:52

How to get the browser to navigate to URL in JavaScript

What is the best (correct, modern, cross-browser, safe) way to get a web browser to navigate to a URL of your choice using JavaScript?

6 Feb at 14:54

Converting from a string to boolean in Python

How do I convert a string into a boolean in Python? This attempt returns `True`: ``` >>> bool("False") True ```

13 Jun at 02:49

How can I represent an 'Enum' in Python?

I'm mainly a C# developer, but I'm currently working on a project in Python. How can I represent the equivalent of an Enum in Python?

22 Sep at 16:3

How can I navigate back to the last cursor position in Visual Studio Code?

What is the keyboard shortcut to navigate back to the last cursor position in Visual Studio Code?

What's the difference between lists and tuples?

What's the difference between tuples/lists and what are their advantages/disadvantages?

9 Apr at 10:57