Questions

Bind failed: Address already in use

I am attempting to bind a socket to a port below: ``` if( bind(socket_desc,(struct sockaddr *) &server, sizeof(server)) < 0) { perror("bind failed. Error"); return 1; } puts("bind done"); `...

3 Jul at 15:42

How to ignore a property in class if null, using json.net

I am using [Json.NET](http://www.newtonsoft.com/json) to serialize a class to JSON. I have the class like this: ``` class Test1 { [JsonProperty("id")] public string ID { get; set; } [Jso...

1 May at 14:10

JAX-RS — How to return JSON and HTTP status code together?

I'm writing a REST web app (NetBeans 6.9, JAX-RS, TopLink Essentials) and trying to return JSON HTTP status code. I have code ready and working that returns JSON when the HTTP GET method is called fr...

23 Apr at 11:55

Include jQuery in the JavaScript Console

Is there an easy way to include jQuery in the Chrome JavaScript console for sites that do not use it? For example, on a website I would like to get the number of rows in a table. I know this is really...

19 Nov at 15:46

MySQL select 10 random rows from 600K rows fast

How can I best write a query that selects 10 rows randomly from a total of 600k?

16 Jun at 04:35

400 vs 422 response to POST of data

I'm trying to figure out what the correct status code to return on different scenarios with a "REST-like" API that I'm working on. Let's say I have an end point that allows POST'ing purchases in JSON ...

16 Dec at 00:12

POSTing JsonObject With HttpClient From Web API

I'm trying to POST a `JsonObject` using `HttpClient` from Web API. I'm not quite sure how to go about this and can't find much in the way of sample code. Here's what I have so far: ``` var myObject...

Describe table structure

Which query will give the table structure with column definitions in SQL?

7 Jun at 19:0

Validate a username and password against Active Directory?

How can I validate a username and password against Active Directory? I simply want to check if a username and password are correct.

5 Nov at 16:42

How can I write a ':hover' condition for 'a:before' and 'a:after'?

How can I write `:hover` and `:visited` condition for `a:before`? I'm trying `a:before:hover`, but it's not working.

How to convert an image to Base64 encoding

How can I convert an image from a URL to Base64 encoding?

2 Aug at 11:44

Run Stored Procedure in SQL Developer?

I am trying to run a stored procedure that has multiple in and out parameters. The procedure can only be viewed in my Connections panel by navigating ``` Other Users | <user> | Packages | <package> | ...

Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine

I created a windows application developed in .NET 3.5 in a 32 bit Windows 2008 server. When deployed the application in a 64 bit server it shows the error "Microsoft.Jet.OLEDB.4.0' provider is not reg...

31 Jan at 10:40

PHP - Get key name of array value

I have an array as the following: ``` function example() { /* some stuff here that pushes items with dynamically created key strings into an array */ return array( // now lets preten...

5 May at 00:7

How can I set NODE_ENV=production on Windows?

In Ubuntu it's quite simple; I can run the application using: ``` $ NODE_ENV=production node myapp/app.js ``` However, this doesn't work on Windows. Is there a configuration file where I can set th...

8 Mar at 04:38

How can I get a JavaScript stack trace when I throw an exception?

If I throw a JavaScript exception myself (eg, `throw "AArrggg"`), how can I get the stack trace (in Firebug or otherwise)? Right now I just get the message. : As many people below have posted, it is...

17 Mar at 18:36

Align button at the bottom of div using CSS

I want to align my button at the bottom right corner of my div. How can I do that? ![enter image description here](https://i.stack.imgur.com/p6hy8.png) Current css of div: ``` float: right; wid...

28 Apr at 10:33

Expanding a parent <div> to the height of its children

I have a page structure similar to this: ``` <body> <div id="parent"> <div id="childRightCol"> /*Content*/ </div> <div id="childLeftCol"> /*Content*/ </div> </div> </b...

13 Feb at 19:53

Get content of a cell given the row and column numbers

I want to get the content of a cell given its row and column number. The row and column number are stored in cells (here B1,B2). I know the following solutions work, but they feel a bit hacky. Sol 1...

14 Jan at 14:42

How to undo "git commit --amend" done instead of "git commit"

I accidentally amended my previous commit. The commit should have been separate to keep history of the changes I made to a particular file. Is there a way to undo that last commit? If I do something ...

16 Mar at 13:48

Streaming via RTSP or RTP in HTML5

I'm building a web app that should play back an RTSP/RTP stream from a server [http://lscube.org/projects/feng](http://lscube.org/projects/feng). Does the HTML5 video/audio tag support the rtsp or rt...

16 Nov at 00:43

Pass variables by reference in JavaScript

How do I pass variables by reference in JavaScript? I have three variables that I want to perform several operations to, so I want to put them in a for loop and perform the operations to each one. Pse...

Angular 2 TypeScript how to find element in Array

I have a Component and a Service: Component: ``` export class WebUserProfileViewComponent { persons: Person []; personId: number; constructor( params: RouteParams, private personService: P...

28 Feb at 02:13

Does Python have an ordered set?

Python has an [ordered dictionary](http://www.python.org/dev/peps/pep-0372/). What about an ordered set?

9 Mar at 15:1

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

I am trying to open a program for the first time on Windows XP Pro that uses PostgreSQL 9. I'm getting an error message that says : > A problem was encountered while trying to log into or create the ...

20 Sep at 18:17