How do I (or can I) SELECT DISTINCT on multiple columns?
I need to retrieve all rows from a table where 2 columns combined are all different. So I want all the sales that do not have any other sales that happened on the same day for the same price. The sale...
- Modified
- 22 Aug at 00:7
How do I read CSV data into a record array in NumPy?
Is there a direct way to import the contents of a CSV file into a record array, just like how R's `read.table()`, `read.delim()`, and `read.csv()` import data into R dataframes? Or should I use [csv.r...
- Modified
- 13 Jun at 07:55
How to convert Java String into byte[]?
Is there any way to convert Java `String` to a `byte[]` ( the boxed `Byte[]`)? In trying this: ``` System.out.println(response.split("\r\n\r\n")[1]); System.out.println("******"); System.out.println...
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c
I have a socket server that is supposed to receive UTF-8 valid characters from clients. The problem is some clients (mainly hackers) are sending all the wrong kind of data over it. I can easily distin...
- Modified
- 6 Jul at 19:4
HTTP status code for update and delete?
What status code should I set for `UPDATE` (`PUT`) and `DELETE` (e.g. product successfully updated)?
- Modified
- 21 Jun at 20:30
How to create dictionary and add key value pairs dynamically in Javascript
From post: [Sending a JSON array to be received as a Dictionary<string,string>](https://stackoverflow.com/questions/2494294/sending-a-json-array-to-be-received-as-a-dictionarystring-string/7196027#719...
- Modified
- 2 Sep at 14:4
Unable to resolve dependency tree error when installing npm packages
When trying to install the npm packages using `npm i` command, I am getting the following exception: [](https://i.stack.imgur.com/x8N3W.png) I have tried reinstalling the Node.js package and setting t...
- Modified
- 11 Aug at 09:28
Why is "using namespace std;" considered bad practice?
I have heard `using namespace std;` is bad practice, and that I should use `std::cout` and `std::cin` directly instead. Why is this? Does it risk declaring variables that share the same name as someth...
- Modified
- 4 Jul at 21:5
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 ```
Adding a newline into a string in C#
I have a string. ``` string strToProcess = "fkdfdsfdflkdkfk@dfsdfjk72388389@kdkfkdfkkl@jkdjkfjd@jjjk@"; ``` I need to add a newline after every occurence of "@" symbol in the string. My Output sho...
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated
I have many users on my web site (20000-60000 per day), which is a download site for mobile files. I have remote access to my server (windows server 2008-R2). I've received errors before, but I am...
- Modified
- 13 Jun at 20:53
How to exit in Node.js
What is the command that is used to exit? (i.e terminate the Node.js process)
- Modified
- 14 Aug at 03:9
Is there any way to kill a Thread?
Is it possible to terminate a running thread without setting/checking any flags/semaphores/etc.?
- Modified
- 21 Nov at 15:55
Is it possible to break a long line to multiple lines in Python?
Just like C, you can break a long line into multiple short lines. But in [Python](http://en.wikipedia.org/wiki/Python_%28programming_language%29), if I do this, there will be an indent error... Is it ...
- Modified
- 7 Feb at 05:44
Constructing pandas DataFrame from values in variables gives "ValueError: If using all scalar values, you must pass an index"
This may be a simple question, but I can not figure out how to do this. Lets say that I have two variables as follows. ``` a = 2 b = 3 ``` I want to construct a DataFrame from this: ``` df2 = pd.D...
How to get the identity of an inserted row?
How am I supposed to get the `IDENTITY` of an inserted row? I know about `@@IDENTITY` and `IDENT_CURRENT` and `SCOPE_IDENTITY`, but don't understand the implications or impacts attached to each. Can s...
- Modified
- 25 Oct at 14:35
Using openssl to get the certificate from a server
I am trying to get the certificate of a remote server, which I can then use to add to my keystore and use within my Java application. A senior dev (who is on holidays :( ) informed me I can run this: ...
- Modified
- 6 Apr at 10:6
Using an HTML button to call a JavaScript function
I am trying to use an HTML button to call a JavaScript function. Here's the code: ``` <input type="button" value="Capacity Chart" onclick="CapacityChart();"> ``` It doesn't seem to work correctly ...
- Modified
- 23 Jul at 11:44
How do I split a string into a list of characters?
How do I split a string into a list of characters? [str.split](https://docs.python.org/3/library/stdtypes.html#str.split) does not work. ``` "foobar" → ['f', 'o', 'o', 'b', 'a', 'r'] ```
How can I develop for iPhone using a Windows development machine?
Is there any way to tinker with the iPhone SDK on a Windows machine? Are there plans for an iPhone SDK version for Windows? The only other way I can think of doing this is to run a Mac VM image on a ...
How to change the figure size of a seaborn axes or figure level plot
How do I change the size of my image so it's suitable for printing? For example, I'd like to use to A4 paper, whose dimensions are 11.7 inches by 8.27 inches in landscape orientation.
- Modified
- 21 Nov at 20:41
Setting Authorization Header of HttpClient
I have an HttpClient that I am using for a REST API. However I am having trouble setting up the Authorization header. I need to set the header to the token I received from doing my OAuth request. I sa...
- Modified
- 4 Jun at 18:31
Regular Expressions: Is there an AND operator?
Obviously, you can use the `|` (pipe?) to represent `OR`, but is there a way to represent `AND` as well? Specifically, I'd like to match paragraphs of text that contain ALL of a certain phrase, but i...
How to add an image to a JPanel?
I have a [JPanel](http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JPanel.html) to which I'd like to add JPEG and PNG images that I generate on the fly. All the examples I've seen so far ...
How do I link a JavaScript file to a HTML file?
How do you properly link a JavaScript file to a HTML document? Secondly, how do you use jQuery within a JavaScript file?
- Modified
- 20 Sep at 23:18