Why does an image captured using camera intent gets rotated on some devices on Android?

Why does an image captured using camera intent gets rotated on some devices on Android?

I'm capturing an image and setting it to image view.public void captureImage() { Intent intentCamera = new Intent("android.media.action.IMAGE_CAPTURE"); File filePhoto = new File(Environment.getExternalStorageDirectory(), "Pic.jpg");

Difference between require, include, require_once and include_once?

Difference between require, include, require_once and include_once?

In PHP:When should I use require vs. include?When should I use require_once vs. include_once? 1:There are require and include_once as well.So your question should be... When should I use require vs. include?When should I use require_once

PhantomJS; click an element

PhantomJS; click an element

How do I click an element in PhantomJS?page.evaluate(function() { document.getElementById('idButtonSpan').click(); });This gives me an error "undefined is not a function..."If I instead return document.getElementById('idButtonSpan');an

Relative imports for the billionth time

Relative imports for the billionth time

I've been herehttp://www.python.org/dev/peps/pep-0328/http://docs.python.org/2/tutorial/modules.html#packagesPython packages: relative importspython relative import example code does not workUltimate answer to relative python importsRelativ

Making TextView scrollable on Android

Making TextView scrollable on Android

I am displaying text in a textview that appears to be too long to fitinto one screen. I need to make my TextView scrollable. How can I dothat?Here is the code:final TextView tv = new TextView(this);tv.setBackgroundResource(R.drawable.splash

Passing data between controllers in Angular JS?

Passing data between controllers in Angular JS?

I have a basic controller that displays my products,App.controller('ProductCtrl',function($scope,$productFactory){ $productFactory.get().success(function(data){ $scope.products = data; });});In my view I'm displaying this

What are the Xms and Xmx parameters when starting JVMs? [duplicate]

What are the Xms and Xmx parameters when starting JVMs? [duplicate]

This question already has an answer here: How is the default Java heap size determined? 7 answers Please explain the use of Xms and Xmx parameters in J

How do I set up NSZombieEnabled in Xcode 4?

How do I set up NSZombieEnabled in Xcode 4?

How do I set up NSZombieEnabled and CFZombieLevel for my executable in Xcode 4? 1:In Xcode 4.x press ⌥⌘R(or click Menubar > Product > Scheme > Edit Scheme) select the "Diagnostics" tab and click "Enable Zombie Objects": This turns releas

Increase heap size in Java

Increase heap size in Java

I am working on a Windows 2003 server (64-bit) with 8 GB RAM. How can I increase the heap memory maximum? I am using the -Xmx1500m flag to increase the heap size to 1500 Mb. Can I increase the heap memory to 75% of physical memory (6 GB Hea

How to enable assembly bind failure logging (Fusion) in .NET

How to enable assembly bind failure logging (Fusion) in .NET

How do I enable assembly bind failure logging (Fusion) in .NET? 1:Add the following values toHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\FusionAdd:DWORD ForceLog set value to 1DWORD LogFailures set value to 1DWORD LogResourceBinds set value to

How do I create a transparent Activity on Android?

How do I create a transparent Activity on Android?

I want to create a transparent Activity on top of another activity.How can I achieve this? 1:Add the following style in your res/values/styles.xml file (if you don’t have one, create it.) Here’s a complete file:<?xml version="1.0" encodi

How can I parse a JSON file with PHP?

How can I parse a JSON file with PHP?

I tried to parse a JSON file using PHP. But I am stuck now.This is the content of my JSON file:{ "John": { "status":"Wait" }, "Jennifer": { "status":"Active" }, "James": { "status":"Active", "a

Can PHP PDO Statements accept the table or column name as parameter?

Can PHP PDO Statements accept the table or column name as parameter?

Why can't I pass the table name to a prepared PDO statement?$stmt = $dbh->prepare('SELECT * FROM :table WHERE 1');if ($stmt->execute(array(':table' => 'users'))) { var_dump($stmt->fetchAll());}Is there another safe way to insert a table

Saving Android Activity state using Save Instance State

Saving Android Activity state using Save Instance State

I've been working on Android SDK platform, and it is a little unclear how to save an application's state. So given this minor re-tooling of the 'Hello, Android' example:package com.android.hello;import android.app.Activity;import android.os

Execute .sql schema in psycopg2 in Python

Execute .sql schema in psycopg2 in Python

I have a PostgreSQL schema stored in .sql file. It looks something like:CREATE TABLE IF NOT EXISTS users ( id INTEGER PRIMARY KEY, facebook_id TEXT NOT NULL, name TEXT NOT NULL, access_token TEXT, created INTEGER NOT NULL);Ho

Python unittest.TestCase object has no attribute 'runTest'

Python unittest.TestCase object has no attribute 'runTest'

For the following code:import unittestclass Test(unittest.TestCase): def test1(self): assert(True == True)if __name__ == "__main__": suite = unittest.TestSuite() suite.addTest(Test()) unittest.TextTestRunner().run(suite)U

maven-compiler-plugin exclude

maven-compiler-plugin exclude

I have a following problem.I would like to exclude some .java files (**/jsfunit/*.java) during the test-compile phase and on the other side I would like to include them during the compile phase (id i start tomcat with tomcat:run goal)My pom

Run “mvn package” on “Build project” in Eclipse

Run “mvn package” on “Build project” in Eclipse

I have maven java project in eclipse. I right click project, choose "Build project" and I want "mvn package" get invoked automatically. Is it possible? 1:Rightclick on your pom.xml and choose "Run as" -> "Maven build.." and put in Goals:

Saving in-memory H2 database to disk

Saving in-memory H2 database to disk

How can I save/load full embedded h2 in-memory database to some file or directory in binary mode for faster loading.I want to use this for caching data so I don't have to run all the lines of create table/insert clauses every time. 1:Ins

Wait for n seconds, then next line of code without freezing form

Wait for n seconds, then next line of code without freezing form

Hi I am trying to find a method of waiting a number of milliseconds before moving to the next line of code,I have looked into Thread.Sleep but this will freeze the main form, I would like this to remain active.I tried timers and stopwatches

Running Neo4j purely in memory without any persistence

Running Neo4j purely in memory without any persistence

I don't want to persist any data but still want to use Neo4j for it's graph traversal and algorithm capabilities. In an embedded database, I've configured cache_type = strong and after all the writes I set the transaction to failure. But my

Change a make variable, and call another rule, from a recipe in same Makefile?

Change a make variable, and call another rule, from a recipe in same Makefile?

I have already seen How to manually call another target from a make target?, but my question is a bit different; consider this example (note, stackoverflow.com changes the tabs to spaces in display; but tabs are preserved in source, if you

When to use touchmove vs mousemove?

When to use touchmove vs mousemove?

I build a web mobile game, it runs on browsers (PC/Mobile).Do I need to use the touchmove or not?How can I run the touchmove event like the mousemove event? 1:For parity between desktop and touch you have the following equivalences:mouse

Left outer join on two files in unix

Left outer join on two files in unix

I need to join two files on two fields. However i should retrieve all the values in file 1 even if the join fails its like a left outer join. File 1:01|a|jack|d02|b|ron|c03|d|tom|eFile 2:01|a|nemesis|f02|b|brave|d04|d|gorr|houtput:01|a|jack

Why does Visual Studio start localdb and how can I stop that?

Why does Visual Studio start localdb and how can I stop that?

I'm trying to optimize my Visual Studio experience and my machine in general. I noticed that I have two instances of SQL Server running, one of which is LocalDB. This gets started by Visual Studio. I would rather it didnt start local db