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");

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

Collision detection with complex shapes

Collision detection with complex shapes

I am wanting to make a game that has each level loaded from an image.I want to draw up the whole level in Photoshop, and then set it as the background and allow the player to walk over it.I want another invisible image to go over top which

How to get the insert ID in JDBC?

How to get the insert ID in JDBC?

I want to INSERT a record in a database (which is Microsoft SQL Server in my case) using JDBC in Java. At the same time, I want to obtain the insert ID. How can I achieve this using JDBC API? 1:If it is an auto generated key, then you ca

WPF Programming Methodology

WPF Programming Methodology

After 3 months programming my APP on WPF, I've second thought about the way I'm programming my app (I know it's maybe too late). On my APP I'm using an API of a software that my tool is managing. I've DAL that contain 16 classes, 3 of them

Sorting a vector of custom objects

Sorting a vector of custom objects

How does one go about sorting a vector containing custom (i.e. user defined) objects.Probably, standard STL algorithm sort along with a predicate (a function or a function object) which would operate on one of the fields (as a key for sorti

Android Shared preferences example [closed]

Android Shared preferences example [closed]

I want to retrieve user input in an app for later usage. For example, the user is prompted to enter all 7 days of the week and types into the editText box "Monday", "Tuesday" etc. Then later in the app a question will come up and ask what

What is an IndexOutOfRangeException / ArgumentOutOfRangeException and how do I fix it?

What is an IndexOutOfRangeException / ArgumentOutOfRangeException and how do I fix it?

I have some code and when it executes, it throws a IndexOutOfRangeException, saying, Index was outside the bounds of the array.What does this mean, and what can I do about it?Depending on classes used it can also be ArgumentOutOfRangeExce

Number of commands in Dockerfile

Number of commands in Dockerfile

I noticed that each line in the Dockerfile creates a separate image. Is there any limit on the number of images that are created? Should we try to do a oneliner of RUN cmd1 && cmd2 && cmd3 instead?How would this differ if we use a service l

SQLite database maximum storage capacity

SQLite database maximum storage capacity

I have a small question about storing data on a SQLite database. How many records in an SQLite database can we maximally store? Is there any limitation? If the data goes beyond this limitation what type of error does it give? Will the whole

QTimer::singleShot and QMetaMethod::invoke

QTimer::singleShot and QMetaMethod::invoke

In some Qt examples, I see they use QTimer::singleShot(0, this , SLOT(funcA())), why not to call the slot funcA directly? also the same question for using QMetaMethod::invoke to call function with parameters. 1:The following lines are al

Insertion-Order Dictionary (like Java's LinkedHashMap) in Swift?

Insertion-Order Dictionary (like Java's LinkedHashMap) in Swift?

Is there a standard swift class that is a Dictionary, but keeps keys in insertion-order like Java's LinkedHashMap? If not, how would one be implemented? 1:Didn't know of one and it was an interesting problem to solve (already put it in m

Understanding the WPF Dispatcher.BeginInvoke

Understanding the WPF Dispatcher.BeginInvoke

I was under the impression that the dispatcher will follow the priorityof the operations queued it and execute the operations based on the priorityor the order in which the operation was added to the queue(if same priority)until I was told

ImportError HDFStore requires PyTables No module named tables

ImportError HDFStore requires PyTables No module named tables

import pandas as pddfs = pd.HDFStore('xxxxx.h5')Server is giving error as"ImportError: HDFStore requires PyTables, "No module named tables" problem importing"I tried to install PyTables, which Requires Cython.I have Cython 0.21 installed, b

Adding an enum as a class property in HBM

Adding an enum as a class property in HBM

I am trying to create a class in HBM file which contains an Enum as a field.The HBM is similar to this: and let's say that this is the Enum:public enum myEnum{ a, b, c;}The problem is that in the DB I expected to see the String val

ORMlite Android foreign key support

ORMlite Android foreign key support

I am not clever from ORMlite documentation. Is is possible to declare in class, that this parameter is foreign key?e.g. I have table Customer:@DatabaseTable(tableName = "customer")public class Customer { @DatabaseField(id = true) priv

Enclosing class vs Declaring class

Enclosing class vs Declaring class

Are there any circumstances in which Class.getDeclaringClass could give a different result from Class.getEnclosingClass?I thought it may be to do with a subclass of the outer class instantiating an inner class that was not declared as stati

git, gitolite error push

git, gitolite error push

I just installed gitolite but when I push on the repository gitolite-admin I get an error:git pushCounting objects: 9, done.Delta compression using up to 2 threads.Compressing objects: 100% (6/6), done.Writing objects: 100% (7/7), 605 bytes

com.google.gson.internal.LinkedHashTreeMap cannot be cast to my object

com.google.gson.internal.LinkedHashTreeMap cannot be cast to my object

I have JSON file looks like { "SUBS_UID" : { "featureSetName" : "SIEMENSGSMTELEPHONY MULTISIM", "featureName" : "MULTISIMIMSI", "featureKey" : [{ "key" : "SCKEY", "valueType" : 0,

Upload to heroku without git

Upload to heroku without git

Im making a tiny web app, really just for personal testing, the app is built with php / mysql, i plan to host it on heroku, but i was wondering is it possible to host stuff on heroku without pushing from git. I am not too keen on using git

Changing cell color using apache poi

Changing cell color using apache poi

I'm using Apache POI to read data in a spreadsheet of part numbers. I look up the part number in our database, if we have a CAD drawing of the part I color the part number cell green, if we don't I color it red. After the processing is do

Symfony2 Doctrine2 trouble with optional one to one relation

Symfony2 Doctrine2 trouble with optional one to one relation

I have a problem with Doctrine2 in Symfony2 and two relationed entities.There is a user-entity that can (not must) have a usermeta-entity referenced which contains information like biography etc.The usermeta is optional because user is impo

Failed to load ApplicationContext for JUnit test of Spring controller

Failed to load ApplicationContext for JUnit test of Spring controller

I want to write a test case to check my controller (getPersons). This is a server side code. I have confusion what should i put inside @ContextConfiguration(locations={"file:src/main/webapp/WEB-INF/app-contest.xml"})Secondly, I'm getting so

Reading RTCP packets from an IP camera using FFMPEG

Reading RTCP packets from an IP camera using FFMPEG

I am using ffmpeg C++ library. I need to intercept RTCP packets from the camera in order to get the timestamp from the Sender Report. Is there any method or structure in the ffmpeg that gives me this information? I am completely stuck but I

Passing parent_id to a comment

Passing parent_id to a comment

In my app I have Posts which have comments. Now I also want to add comments to those comments (nested commenting).I currently do it like this, but it does not write my parent_id to the database:My comment link in my _comment.html.erb partia