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

:: (double colon) operator in Java 8

:: (double colon) operator in Java 8

I was exploring the Java 8 source and found this particular part of code very surprising://defined in [email protected] final OptionalInt reduce(IntBinaryOperator op) { return evaluate(ReduceOps.makeInt(op));}@Overridepubli

Flask view raises TypeError: 'bool' object is not callable

Flask view raises TypeError: 'bool' object is not callable

I am trying to debug a view in my Flask app that is return a 500 status with the error TypeError: 'bool' object is not callable in the traceback. The view calls login_user from Flask-Login then returns True to indicate that the login was su

Null pointer Exception - findViewById()

Null pointer Exception - findViewById()

Can anyone help me to find out what can be the issue with this program.In the onCreate() method the findViewById() returns null for all ids and this causes a null pointer exception later. I can not figure out why the findViewById() can not

How to check whether a string contains a substring in JavaScript?

How to check whether a string contains a substring in JavaScript?

Usually I would expect a String.contains() method, but there doesn't seem to be one. What is a reasonable way to check for this? 1:Here is a list of current possibilities:1. (ES6) includes—go to answervar string = "foo", substring = "

Hungarian Algorithm: How to cover 0 elements with minimum lines?

Hungarian Algorithm: How to cover 0 elements with minimum lines?

I am trying to implement the Hungarian algorithm in Java. I have an NxN cost matrix. I am following this guide step by step. So I have the costMatrix[N][N] and 2 arrays to track covered rows and covered cols - rowCover[N], rowColumn[N] (1

How to enable a preference in my android application when other preference is disabled?

How to enable a preference in my android application when other preference is disabled?

I have used PreferenceActivity to have preference in my android application. I want one preference say "pref 2" to be enabled when other preference say "pref 1" is NOT checked and "pref 2" to be disabled when "pref 1" is checked. i.e. exac

C# vs VB.NET - Handling of null Structures

C# vs VB.NET - Handling of null Structures

I ran across this and was wondering if someone could explain why this works in VB.NET when I would expect it should fail, just like it does in C#//The C# Versionstruct Person { public string name;}...Person someone = null; //Nope! Can't

Unix grep regex containing 'x' but not containing 'y'

Unix grep regex containing 'x' but not containing 'y'

I need a single-pass regex for unix grep that contains, say alpha, but does not contain beta.grep 'alpha' | grep -v 'beta' 1:^((?!beta).)*alpha((?!beta).)*$ would do the trick I think. 2:The other answers here show some ways you can

Listener for Done button on EditText?

Listener for Done button on EditText?

If I have an EditText and I want to listen for if the user presses the "done" button on the keypad.. how would I do this? 1:Code isfinal EditText edittext = (EditText) findViewById(R.id.edittext);edittext.setOnKeyListener(new View.OnKeyL

Filter child-records (hasMany association) with Ember.js

Filter child-records (hasMany association) with Ember.js

Is there any possibility to filter the hasMany records from a model record? I want to get the active projects, grouped by the customer.Customer modelDocket.Customer = DS.Model.extend({ name: DS.attr('string'), initial: DS.attr(

Google Maps Api Directions

Google Maps Api Directions

Can i mark two points on the google maps in my application and then calculate the direction on the map as well as turn by turn navigation ? 1:No the Map Activity doesn't provide such a feature. You have to request it via the Google Maps

How to count words within a text string?

How to count words within a text string?

On iOS, how can I count words within a specific text string? 1:A more efficient method than splitting is to check the string character by character.int word_count(NSString* s) { CFCharacterSetRef alpha = CFCharacterSetGetPredefined(kCFC

How to get file path in onActivityResult in Android 4.4

How to get file path in onActivityResult in Android 4.4

For android 4.3 and earlier I use this metod:Uri myUri = data.getData();Cursor cursor = getContentResolver().query(myUri,new String []{"_data"}, null, null, null);cursor.moveToFirst();String filePath = cursor.getString(cursor.getColumnIndex

How to make route drawing more efficient?

How to make route drawing more efficient?

This is the code I'm using to draw route. When i have 1000 of points, route severely slows ui. Maybe someone could provide a code snippet or a link which explains how to do route drawing more efficiently? I know that one way to solve this i

Google Chrome Silent Push Notifications

Google Chrome Silent Push Notifications

I've been reading through the docs for Chrome's implementation of the Web Push API here, and I noticed the API says "you promise to show a notification whenever you receive a push" and under limitations it's stated "you have to show a notif

Checking if server port is open from Android

Checking if server port is open from Android

I am trying to connect to a my remote server from my Android device. How do I check if a specific port on my server is open? Eg. how to check if port 80 is open on my server 11.11.11.11?Currently, I am using InetAddress to ping if the host

Make a pixel transparent in Matlab

Make a pixel transparent in Matlab

I have imported an image in matlab and before I display it how would I make the background of the image transparent? For example I have a red ball on a white background, how would i make the white pixels of the image tranparent so that only

JAVAFX event triggered when selecting a check box

JAVAFX event triggered when selecting a check box

My JavaFx FXML application has an issue.When I select a checkbox on a form, I want to execute a method based on the checkbox that was clicked. Is there any way that I can pass the name of the checkbox through to the method so I can perform

How to verify an attribute is present in an element using Selenium WebDriver?

How to verify an attribute is present in an element using Selenium WebDriver?

I have many radio buttons on my screen. When a radio button is selected, it has an attribute of checked. When the radio button is not selected, the checked attribute is not present. I would like to create a method that would pass if the ele

Simple_form how to make accept terms checkbox inline

Simple_form how to make accept terms checkbox inline

:boolean, :label => false, :boolean_style => :inline %> Accept true %> and true%>It ends up looking like thisWhat is the best way to line them up on the same line. 1:Here's a rather simple way: Accept true %> and true%>

Boolean true - positive 1 or negative 1?

Boolean true - positive 1 or negative 1?

I'm designing a language, and trying to decide whether true should be 0x01 or 0xFF. Obviously, all non-zero values will be converted to true, but I'm trying to decide on the exact internal representation.What are the pros and cons for each

Java 8 Lambda expressions for solving fibonacci (non recursive way)

Java 8 Lambda expressions for solving fibonacci (non recursive way)

I am a beginner in using Lambda expression feature in Java 8. Lambda expressions are pretty well useful in solving programs like Prime number check, factorial etc.However can they be utilized effectively in solving problems like Fibonacci w

mysql match against multiple words

mysql match against multiple words

Below is an example sql I am stuck with, it will not return a product named "iphone 4s", It returns 10 other result. Any help would be great thanks1st sql exampleSELECT * FROM products WHERE match(desc) against('+iphone +4s' IN BO

How to get your context in your phonegap plugin

How to get your context in your phonegap plugin

This is my plugin for android and one of my method requires a context, Is there a way how can I get this context?public class GaziruPlugin extends CordovaPlugin{@Overridepublic boolean execute(String action, JSONArray args, CallbackContext