uri

淘宝UWP--自定义图片缓存

旧时模样 提交于 2020-02-11 19:48:02
一、应用场景 在淘宝应用首页,会有很多张图片,而这些首页图片不会经常改变,所以就需要缓存下来。这样就不必每次都从网络获取。 二、比较对象 1.系统缓存 对于系统缓存,我们不需要做什么处理。只需要把网络图片的URL赋值给Image控件就行了。这样系统就会在每次需要用到图片的时候,有限查找缓存里有没有之前下载好的。 2.自建缓存区域 自建缓存不给Image控件赋URL,而是把图片DownLoad下来,生成一个bitmap,然后把bitmap赋值给Image。同时将这个bitmap存储下来。当下次要用到这幅图的时候,就直接从存储的位置找到这幅图。 三、自建缓存方法 下边这段代码将uri[]数组中的图片下载下来,然后通过 WriteToFile()函数将图片保存到本地,同时,记下存储的文件名。 SoftwareBitmap sb = await DownloadImage(uri[i]); if (sb != null) {   //sb = await ReadFromFile(fileName[i]);   SoftwareBitmapSource source = new SoftwareBitmapSource();   await source.SetBitmapAsync(sb);   this.insideImage.Source = source;   sb = await

android打电话发短信

痴心易碎 提交于 2020-02-11 09:55:03
android体系中的应用程序层本身就集成了打电话发短信的功能.那么怎么使用呢? /*发短信*/ class SendMsgClickListener implements OnClickListener { public void onClick(View v) { //调用Android系统API发送短信 Uri uri = Uri.parse("smsto:15800001234"); Intent intent = new Intent(Intent.ACTION_SENDTO, uri); intent.putExtra("sms_body", "android..."); startActivity(intent); } } /*打电话*/ class SendCallClickListener implements OnClickListener { iphone5 public void onClick(View v) { //调用Android系统API打电话 Uri uri = Uri.parse("tel:15800001234"); Intent intent = new Intent(Intent.ACTION_CALL, uri); startActivity(intent); } } 最后不要忘了做这些操作是需要授权的

Nginx的安装、基本用法、与php-frm配置,配置文件的解释

坚强是说给别人听的谎言 提交于 2020-02-10 15:24:34
什么是Nginx Nginx 怎么读?---A: 恩静埃克斯 = Engine X---B: 恩静克思 [ˈendʒɪnks] Nginx是lgor Sysoev为俄罗斯访问量第二的rambler.ru站点设计开发的。从2004年发布至今,凭借开源的力量,已经接近成熟与完善。 Nginx功能丰富,可作为HTTP服务器,也可作为反向代理服务器,邮件服务器。支持FastCGI、SSL、Virtual Host、URL Rewrite、Gzip等功能。并且支持很多第三方的模块扩展。 Nginx的稳定性、功能集、示例配置文件和低系统资源的消耗让他后来居上,在全球活跃的网站中有12.18%的使用比率,大约为2220万个网站。 反正很牛逼。 Nginx常用功能 1、Http代理,反向代理 作为web服务器最常用的功能之一,尤其是反向代理。 Nginx在做反向代理时,提供性能稳定,并且能够提供配置灵活的转发功能。Nginx可以根据不同的正则匹配,采取不同的转发策略,比如图片文件结尾的走文件服务器,动态页面走web服务器,只要你正则写的没问题,又有相对应的服务器解决方案,你就可以随心所欲的玩。并且Nginx对返回结果进行错误页跳转,异常判断等。如果被分发的服务器存在异常,他可以将请求重新转发给另外一台服务器,然后自动去除异常服务器。 2、负载均衡 Nginx提供的负载均衡策略有2种

android--->Linkify介绍

大憨熊 提交于 2020-02-10 02:02:48
L inkify 是一个辅助类,通过 RegEx 样式匹配,自动地在 TextView 类(和继承的类)中创建超链接。 符合特定的 RegEx 样式的文本会被转变成可点击的超链接,这些超链接隐式地调用startActivity(new Intent(Intent.ACTION_VIEW, uri)),符合的文本会作为目标 URI 。 你可以指定任意的字符串样式为链接;方便地, Linkify 类提供了预置的通用内容类型(如电话号码和 e-mail 、 web 地址)。 本地的链接类型 Linkify.addLinks静态方法接受一个 View 来制作链接,还包括一个或多个支持的默认内容类型的位结果。 Linkify 类提供了一些内容类型:WEB_URLS、EMAIL_ADDRESSES、PHONE_NUMBERS和ALL. 接下来的代码片段显示如何为 TextView 制作链接显示 web 和 e-mail 地址为超链接。当点击时,它们会相应地打开浏览器或 e-mail 应用程序。 TextView textView = (TextView)findViewById(R.id.myTextView); Linkify.addLinks(textView, Linkify.WEB_URLS|Linkify.EMAIL_ADDRESSES); 你可以在 layout 资源里使用

android--->Linkify介绍

放肆的年华 提交于 2020-02-09 20:02:22
L inkify 是一个辅助类,通过 RegEx 样式匹配,自动地在 TextView 类(和继承的类)中创建超链接。 符合特定的 RegEx 样式的文本会被转变成可点击的超链接,这些超链接隐式地调用startActivity(new Intent(Intent.ACTION_VIEW, uri)),符合的文本会作为目标 URI 。 你可以指定任意的字符串样式为链接;方便地, Linkify 类提供了预置的通用内容类型(如电话号码和 e-mail 、 web 地址)。 本地的链接类型 Linkify.addLinks静态方法接受一个 View 来制作链接,还包括一个或多个支持的默认内容类型的位结果。 Linkify 类提供了一些内容类型:WEB_URLS、EMAIL_ADDRESSES、PHONE_NUMBERS和ALL. 接下来的代码片段显示如何为 TextView 制作链接显示 web 和 e-mail 地址为超链接。当点击时,它们会相应地打开浏览器或 e-mail 应用程序。 TextView textView = (TextView)findViewById(R.id.myTextView); Linkify.addLinks(textView, Linkify.WEB_URLS|Linkify.EMAIL_ADDRESSES); 你可以在 layout 资源里使用

Working with URI in JavaScript

北战南征 提交于 2020-02-08 05:11:47
问题 I have a URL like below : http://localhost:1692/fa/Help.aspx#Help the code below returns that : alert(document.URL); I only want to get the http://localhost:1692 part of this URL. How can I get it with jQuery or JavaScript? 回答1: Try this: alert( location.protocol + "//" + location.host ) 回答2: location.protocol + '//' + location.host And, if you want, you have these other properties: hash search - url querystring hostname - only the hostname (without port) port - only the port number pathname

Anatomy of G-WAN URI servlets

大憨熊 提交于 2020-02-07 08:26:07
问题 gwan/csp/strangesubfolder/inc.c can be visited via http://domainName.com/strangesubfolder/?inc I feel this servlet mapping strange but that suits my need. I can't find the mapping description in the gwan user's manual. Please correct me if I am wrong and confirm if it is the expected behavior. 回答1: Yes it is a standard feature. The '?' tells G-WAN that it is a servlet. If there's no '?' it will look for the file in WWW folder. Update: Now I understand your confusion. Since version release 3.3

Anatomy of G-WAN URI servlets

血红的双手。 提交于 2020-02-07 08:25:54
问题 gwan/csp/strangesubfolder/inc.c can be visited via http://domainName.com/strangesubfolder/?inc I feel this servlet mapping strange but that suits my need. I can't find the mapping description in the gwan user's manual. Please correct me if I am wrong and confirm if it is the expected behavior. 回答1: Yes it is a standard feature. The '?' tells G-WAN that it is a servlet. If there's no '?' it will look for the file in WWW folder. Update: Now I understand your confusion. Since version release 3.3

What is the difference between a URI and URL? [duplicate]

*爱你&永不变心* 提交于 2020-02-07 07:02:24
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: What's the difference between a URI and a URL? What is a URI, and what is the difference between URL and URI? 回答1: Conceptually, a URI identifies a resource, and a URL shows you how to find it. Thus URI deals with parsing, local/absolute paths, etc. and URL deals with connecting to streams and such. 来源: https://stackoverflow.com/questions/4428196/what-is-the-difference-between-a-uri-and-url

ContentResolver

為{幸葍}努か 提交于 2020-02-06 07:37:33
ContentResolver获取手机联系人 添加权限 < uses - permission android : name = "android.permission.WRITE_CONTACTS" > < / uses - permission > < uses - permission android : name = "android.permission.READ_CONTACTS" > < / uses - permission > package com . example . day10 ; import androidx . annotation . NonNull ; import androidx . appcompat . app . AppCompatActivity ; import android . Manifest ; import android . content . ContentResolver ; import android . content . pm . PackageManager ; import android . database . Cursor ; import android . net . Uri ; import android . os . Build ; import android . os . Bundle