Questions

iOS UIImagePickerController result image orientation after upload

I am testing my iPhone application on an iOS 3.1.3 iPhone. I am selecting/capturing an image using a `UIImagePickerController`: ``` UIImagePickerController *imagePicker = [[UIImagePickerController a...

How to post data to specific URL using WebClient in C#

I need to use "HTTP Post" with WebClient to post some data to a specific URL I have. Now, I know this can be accomplished with WebRequest but for some reasons I want to use WebClient instead. Is that ...

24 Mar at 16:22

When to use NSInteger vs. int

When should I be using `NSInteger` vs. int when developing for iOS? I see in the Apple sample code they use `NSInteger` (or `NSUInteger`) when passing a value as an argument to a function or returnin...

27 May at 18:40

How to deserialize a JObject to .NET object

I happily use the [Newtonsoft JSON library](http://james.newtonking.com/pages/json-net.aspx). For example, I would create a `JObject` from a .NET object, in this case an instance of Exception (might o...

What is a MIME type?

I have been reading about how to build plug-ins and this "MIME type" keeps getting discussed in it. I have tried to look into it and know that it is Multipurpose Internet Mail Extensions (MIME) but no...

23 Sep at 19:15

How to count lines of Java code using IntelliJ IDEA?

How to count lines of Java code using IntelliJ IDEA?

12 Feb at 12:15

How do I concatenate two arrays in C#?

``` int[] x = new int [] { 1, 2, 3}; int[] y = new int [] { 4, 5 }; int[] z = // your answer here... Debug.Assert(z.SequenceEqual(new int[] { 1, 2, 3, 4, 5 })); ``` --- Right now I use ``` int[]...

14 Oct at 21:42

How to best display in Terminal a MySQL SELECT returning too many fields?

I'm using [PuTTY](https://www.putty.org/) to run: ``` mysql> SELECT * FROM sometable; ``` `sometable` has many fields and this results in many columns trying to be displayed in the terminal. The fi...

17 Feb at 14:58

C# version of java's synchronized keyword?

Does c# have its own version of the java "synchronized" keyword? I.e. in java it can be specified either to a function, an object or a block of code, like so: ``` public synchronized void doImporta...

How do you generate dynamic (parameterized) unit tests in Python?

I have some kind of test data and want to create a unit test for each item. My first idea was to do it like this: ``` import unittest l = [["foo", "a", "a",], ["bar", "a", "b"], ["lee", "b", "b"]] c...

Pass props to parent component in React.js

Is there not a simple way to pass a child's `props` to its parent using events, in React.js? ``` var Child = React.createClass({ render: function() { <a onClick={this.props.onClick}>Click me</a...

1 Aug at 15:7

How to POST raw whole JSON in the body of a Retrofit request?

This question may have been asked before but no it was not definitively answered. How exactly does one post raw whole JSON inside the body of a Retrofit request? See similar question [here](https://s...

Understanding Spring @Autowired usage

I am reading the spring 3.0.x reference documentation to understand Spring Autowired annotation: [3.9.2 @Autowired and @Inject](http://docs.spring.io/spring/docs/3.0.x/reference/beans.html#beans-auto...

23 Mar at 15:42

What is PEP8's E128: continuation line under-indented for visual indent?

Just opened a file with Sublime Text (with Sublime Linter) and noticed a PEP8 formatting error that I'd never seen before. Here's the text: ``` urlpatterns = patterns('', url(r'^$', listing, name...

15 Mar at 15:10

Python Requests - No connection adapters

I'm using the [Requests: HTTP for Humans](http://docs.python-requests.org/en/latest/) library and I got this weird error and I don't know what is mean. ``` No connection adapters were found for '192....

10 Feb at 12:29

Datepicker: How to popup datepicker when click on edittext

I want to show datepicker popup window. I have found some examples but i am not getting it properly. I have one edittext and i want that when i click on edittext the datepicker dialog should popup and...

31 Jul at 10:4

Cast from VARCHAR to INT - MySQL

My Current Data for ``` SELECT PROD_CODE FROM `PRODUCT` ``` is ``` PROD_CODE 2 5 7 8 22 10 9 11 ``` I have tried all the four queries and none work. ([Ref](http://dev.mysql.com/doc/refman/5.5/en...

26 Aug at 01:33

Where is HttpContent.ReadAsAsync?

I see in tons of examples on the web using the new `HttpClient` object (as part of the new Web API) that there should be `HttpContent.ReadAsAsync<T>` method. However, [MSDN](http://msdn.microsoft.com/...

7 Oct at 13:55

Select random lines from a file

In a Bash script, I want to pick out N random lines from input file and output to another file. How can this be done?

11 Apr at 05:24

Node.js EACCES error when listening on most ports

I'm testing out an app (hopefully to run on heroku, but am having issues locally as well). It's giving me an EACCES error when it runs http.Server.listen() - but it only occurs on some ports. So, lo...

6 Feb at 18:13

Best practices for SQL varchar column length

Every time is set up a new SQL table or add a new `varchar` column to an existing table, I am wondering one thing: what is the best value for the `length`. So, lets say, you have a column called `na...

30 May at 14:41

Should URL be case sensitive?

I noticed that ``` HTTP://STACKOVERFLOW.COM/QUESTIONS/ASK ``` and ``` http://stackoverflow.com/questions/ask ``` both works fine - actually the previous one is converted to lowercase. I think...

7 Mar at 17:34

How to only get file name with Linux 'find'?

I'm using find to all files in directory, so I get a list of paths. However, I need only file names. i.e. I get `./dir1/dir2/file.txt` and I want to get `file.txt`

7 Dec at 10:18

css ellipsis on second line

CSS `text-overflow: ellipsis` on second line, is this possible? I can't find it on the net. example: what I want is like this: ``` I hope someone could help me. I need an ellipsis on the second li...

1 Mar at 02:55

How to open in default browser in C#

I am designing a small C# application and there is a web browser in it. I currently have all of my defaults on my computer say google chrome is my default browser, yet when I click a link in my applic...