Get real path from URI, Android KitKat new storage access framework [duplicate]

Get real path from URI, Android KitKat new storage access framework [duplicate]

This question already has an answer here: Android Gallery on Android 4.4 (KitKat) returns different URI for Intent.ACTION_GET_CONTENT 19 answers Before

Generic htaccess redirect www to non-www

Generic htaccess redirect www to non-www

I would like to redirect www.example.com to example.com. The following htaccess code makes this happen:RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]But, is there a way to do this in a gen

C# variance problem: Assigning List as List

C# variance problem: Assigning List as List

Look at the following example (partially taken from MSDN Blog):class Animal { }class Giraffe : Animal { }static void Main(string[] args){ // Array assignment works, but... Animal[] animals = new Giraffe[10]; // implicit... List

How do I match any character across multiple lines in a regular expression?

How do I match any character across multiple lines in a regular expression?

For example, this regex(.*)will match:abcdeBut how do I get it to match across multiple lines?abcdefghij 1:It depends on the language, but there should be a modifier that you can add to the regex pattern. In PHP i

Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273?

Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273?

double r = 11.631;double theta = 21.4;In the debugger, these are shown as 11.631000000000000 and 21.399999618530273.How can I avoid this? 1:These accuracy problems are due to the internal representation of floating point numbers and ther

How do I download a file over HTTP using Python?

How do I download a file over HTTP using Python?

I have a small utility that I use to download a MP3 from a website on a schedule and then builds/updates a podcast XML file which I've obviously added to iTunes.The text processing that creates/updates the XML file is written in Python. I u

How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?

How to configure an app to run correctly on a machine with a high DPI setting (e.g. 150%)?

I've created a simple Winforms application in C#. When I run the application on a machine with high DPI settings (e.g. 150%), the application gets scaled up. So far so good!But instead of rendering the fonts with a higher font size, all tex

How do I remove diacritics (accents) from a string in .NET?

How do I remove diacritics (accents) from a string in .NET?

I'm trying to convert some strings that are in French Canadian and basically, I'd like to be able to take out the French accent marks in the letters while keeping the letter. (E.g. convert é to e, so crème brûlée would become creme brulee)W

Is it possible to insert multiple rows at a time in an SQLite database?

Is it possible to insert multiple rows at a time in an SQLite database?

In MySQL you can insert multiple rows like this:INSERT INTO 'tablename' ('column1', 'column2') VALUES ('data1', 'data2'), ('data1', 'data2'), ('data1', 'data2'), ('data1', 'data2');However, I am getting an error when I tr

Quickly reading very large tables as dataframes in R

Quickly reading very large tables as dataframes in R

I have very large tables (30 million rows) that I would like to load as a dataframes in R. read.table() has a lot of convenient features, but it seems like there is a lot of logic in the implementation that would slow things down. In my c

Convert string representation of list to list

Convert string representation of list to list

I was wondering what the simplest way is to convert a string list like the following to a list:x = u'[ "A","B","C" , " D"]'Even in case user puts spaces in between the commas, and spaces inside of the quotes. I need to handle that as well t

Pass a PHP string to a JavaScript variable (and escape newlines) [duplicate]

Pass a PHP string to a JavaScript variable (and escape newlines) [duplicate]

This question already has an answer here: How to pass variables and data from PHP to JavaScript? 17 answers What is the easiest way to encode a PHP str

Using i and j as variables in Matlab

Using i and j as variables in Matlab

i and j are very popular variable names (see e.g., this question and this one). For example, in loops:for i=1:10, % do something...endAs indices into matrix:mat( i, j ) = 4;Why shouldn't they be used as variable names in Matlab? 1:Be

What does a “Cannot find symbol” compilation error mean?

What does a “Cannot find symbol” compilation error mean?

Please explain the following about the "Cannot find symbol" error:What does this error mean?What things can cause this error?How does the programmer go about fixing this error?This question is designed to be a comprehensive question about "

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

How to use sbt-eclipse to create Eclipse project files of a project?

How to use sbt-eclipse to create Eclipse project files of a project?

I followed the official documentation to set up the plugin in my sbt project:Added addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" %"2.5.0") to ~/.sbt/plugins/plugins.sbt filecded to a project and ran sbtIn sbt shell, typed ecl

ant and java 8 - “major version 52 is newer than 51, the highest major version supported by this com

ant and java 8 - “major version 52 is newer than 51, the highest major version supported by this com

I am trying to upgrade my ant project from java 7 to java 8.(the project deployed in "Eclipse Kepler" with "Java™ 8 support to Eclipse Kepler SR2")For that i downloaded ant 1.9.4 ( according this post http://wiki.eclipse.org/Ant/Java8) , an

Graphviz: Place edge label on the other side (II)

Graphviz: Place edge label on the other side (II)

related questions are:Graphviz: Place edge label on the other sideHow to place edge labels ON edge in graphvizConsider following dot file:digraph {0 -> 1 [ len=2, label="(1, 0)"];0 -> 1 [ len=0.5, dir=none, weight=10];1 -> 0 [ len=2, label=

The program 'rails' can be found in the following packages - issue with some app and RVM?

The program 'rails' can be found in the following packages - issue with some app and RVM?

I just downloaded an app code from github and when I am trying to run the command rails s, I am getting this error - The program 'rails' can be found in the following packages: * rails * ruby-railties-3.2This is specific to this app only, c

Vertically centering button using css

Vertically centering button using css

I am trying to make a simple input button center-align within a table cell.My markup is: XXXXXXXXX YYYYYYYY And may be viewed here:http://jsfiddle.net/tP4sD/I have done a table version showing you the la

Split button in .NET Winforms [closed]

Split button in .NET Winforms [closed]

I'm looking for a Split Button in .NET WinForms. The kind where one side is a button and the other side has a dropdown button. I see them used all over in windows, like in the Visual Studio Save As window, so I figured they've got to have

Missing makecert.exe

Missing makecert.exe

For some reason I am missing makecert.exe on my system. I searched the whole hard drive and it's not there. In particular, it's not in C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin where I believe it's supposed to be. I haven't found an

How do get the path of Program Files regardless of the architecture of the target machine

How do get the path of Program Files regardless of the architecture of the target machine

I'm programming in C#/.NET. I want to be able to return the Program Files directory from the target machine no matter what the architecture of the target machine is. To clarify, I want it to return C (or whatever drive the OS is on):/Progra

Runtime exception Android O with boot_completed

Runtime exception Android O with boot_completed

I'm trying to start an IntentService within my BOOT_COMPLETED receiver, but in Android O (API 26) I get:java.lang.RuntimeException: java.lang.IllegalStateException: Not allowed to start service Intent { act=intent.action.update cmp=packageN

Guice Performance on Android

Guice Performance on Android

As a Java developer I've become accustomed to having dependency injection available in applications. For Android though, I am especially wary of performance. What are the performance implications for using Guice in an Android app? I assu