uri

Android how can i get thumb image of video file from gallery

那年仲夏 提交于 2019-12-23 18:12:25
问题 I need to show the selected video file from gallery in my listview. I have successfully fetched the uri of video file but i am not able to get the thumb image of video file. Here is the code i have used for fetching image of video file from uri, but is causes the app to crash. Is there any other way to get image of video file..? please assist me if it can be achieved in any other way.... public static String getFileMetaData(Context context,String uri){ Uri queryUri = Uri.parse(uri); // Get

Image source UriKind

為{幸葍}努か 提交于 2019-12-23 17:27:14
问题 I have a project it's name is 'xx'. I create a folder "images" that have this path : xx\bin\Debug\images\ images contain only one photo it's name is "1.jpg" the MainWindow contain Image control; I set this code to load the image source but it doesn't work why ??: private void Image_MouseDown(object sender, MouseButtonEventArgs e) { Image i = sender as Image; ; BitmapImage b = new BitmapImage(new Uri(@"images\1.jpg",UriKind.Relative)); i.Source=b; } How can I load the Image source by code ??

URL和URI的区别

∥☆過路亽.° 提交于 2019-12-23 15:53:07
初学java,最近被一个概念搞得头晕脑胀,就是url和uri的概念和区别,网上查了一大通,发现各种回答眼花缭乱,有百科直接粘贴的,有胡说八道的,有故意绕来绕去的,我估计他自己都没搞懂,按照马士兵的说法就是,通通都是一些冠冕堂皇的套话,说了等于没说,本来就是一个很抽象的概念,还用很抽象的的方式来答复,这不是让人虐心吗?经过我潜心研究了一番,把他们的区别分享给大家,我相信很多新手都不会一下子明白这两个概念的,老鸟勿喷! 首先给大家举个例子,有一家公司的总经理,某天,给了我一张名片,上面写了他的头衔,北京XXX公司总经理 张三,还有他的办公室地址,北京市海淀区长安街35号北京XXX公司总经理办公室,那么,我以后给我的朋友吹牛,我认识北京XXX公司的总经理张三,我的朋友都知道北京XXX公司的总经理是一个叫张三的人,那么,这个头衔就和张三对应起来了,只要一说到这个头衔,大家都知道说的是张三,反应到网络世界,这个头衔就叫做URI,只要你给我一个URI,我就知道它代表了什么,比如,http://www.sina.com.cn代表了新浪网,admin@qq.com代表了某一个人的qq邮箱,你的qq号也是一个URI(腾讯服务器内可以识别就是你的QQ账户),URI就是网络资源的头衔,通过URI标记可以把网络世界里面的每一个事物都加以标记并区分开来。 好的,现在出现了一个问题

error - java.lang.IllegalArgumentException: URI scheme is not “file”?

坚强是说给别人听的谎言 提交于 2019-12-23 13:09:48
问题 I am receiving the following error when trying to access font file : 011.08.31 12:12:42.704 ERROR [PDFOutputHandler] - Unable to resolve Unicode font java.lang.IllegalArgumentException: URI scheme is not "file" at java.io.File.<init>(File.java:366) at com.xx.reports.output.handler.PDFOutputHandler.addUnicodeFont(PDFOutputHandler.java:393) at com.xx.reports.output.handler.PDFOutputHandler.renderOutput(PDFOutputHandler.java:104) at com.xx.reports.output.handler.PDFOutputHandler.renderOutput

Given a Uri and a UriTemplate, how to get template parameter values?

╄→尐↘猪︶ㄣ 提交于 2019-12-23 12:35:00
问题 If I have access to both a Uri and the UriTemplate on which is is based, what is the neatest way to discover the values that have replaced the parameters in the template? For example, if I know: var uriTemplate = new UriTemplate("/product-catalogue/categories/{categoryName}/products/{product-name}"); var uri = new Uri("/product-catalogue/categories/foo/products/bar"); is there a built-in way for me to discover that categoryName = "foo" and productName = "bar"? I was hoping to find a method

How may I bypass LWP's URL encoding for a GET request?

南楼画角 提交于 2019-12-23 12:28:46
问题 I'm talking to what seems to be a broken HTTP daemon and I need to make a GET request that includes a pipe | character in the URL. LWP::UserAgent escapes the pipe character before the request is sent. For example, a URL passed in as: https://hostname/url/doSomethingScript?ss=1234&activities=Lec1|01 is passed to the HTTP daemon as https://hostname/url/doSomethingScript?ss=1234&activities=Lec1%7C01 This is correct, but doesn't work with this broken server. How can I override or bypass the

Registering a custom URI protocol to handle custom resource loading from XAML

折月煮酒 提交于 2019-12-23 10:16:40
问题 I'm working on a project where loose bits of XAML (and some associated IronPython code) will be dynamically loaded and executed by a client application. The client will be using a custom WCF service (and some local caching) to retrieve the XAML, backing scripts, and related resources (icons, images, etc..). I would like to register a custom URI protocol/scheme to make it easier for the developers of the dynamic packages to reference their resources, like the following: <UserControl xmlns=

Can a path in a URI contain unicode?

北战南征 提交于 2019-12-23 09:29:23
问题 Is it possible for a valid URL to contain non-escaped Unicode characters? 回答1: Yes, the subset of ASCII (and therefore Unicode) that is allowed unescaped in URIs, such as letters and numbers. But the majority of the Unicode character set has to be percent-encoded. 回答2: URI and URL do not natively support unescaped non-ASCII Unicode characters, however many servers do allow percent-encoded UTF-8 or localized Ansi octets to be used (but no way of specifying which is actually used). For

Absolute URL from relative path

百般思念 提交于 2019-12-23 09:26:45
问题 I've got a base URL and some relative URIs in that document I want to have the absolute path of. E.g. base = https://example.com/some/path.html?query=string and relative URIs in that document: index.html → https://example.com/some/index.html .. → https://example.com/ ../../../../abc → https://example.com/abc abc/.. → https://example.com/some/ //example.org/ → https://example.org/ ftp://example.net/ → ftp://example.net/ In Java you have the class URL accomplishing that: URL abs = new URL(new

Should a given URI in a RESTful architecture always return the same response?

白昼怎懂夜的黑 提交于 2019-12-23 08:51:20
问题 This is kind of a follow-up question to this one. So is having a unique response for any given URI a core tenant of RESTful architecture? A lot of discussion here tends that direction, but I haven't seen it anywhere as a "hard and fast" rule. I understand the value of it (for caching, crawling, passing links, etc), but I also see things like the twitter API violate it (A request to http://api.twitter.com/1/statuses/friends_timeline.xml will vary based on the username given), and I understand