uri

UriMatcher not recognizing pattern

做~自己de王妃 提交于 2019-12-24 21:30:26
问题 I'm having trouble with matching URIs in my ContentProvider . It will match paths with one or two "tags" (not sure what the correct term is), for example it can recognize box/# . But as soon as I add a second tag, for example box/#/item , I throw an InvalidArgumentException and my app crashes. I've read in several threads on here that this issue can sometimes be solved by changing the order of the URIs added to the UriMatcher ; I tried this, but to no avail. Anyone know what the problem is? I

codeigniter uri segment not working properly getting output as 0

纵饮孤独 提交于 2019-12-24 21:22:44
问题 localhost/backend/administrator/authentication/8218/0 In codeigniter, I want to fetch these values 8218 and 0. My code is: class Administrator extends Controller { function Administrator() { parent::Controller(); $this->load->library('uri'); } function authentication() { echo $seg1= $this->uri->segment(3); echo $seg2 = $this->uri->segment(4); echo $this->uri->total_segments(); } } I am not getting any output, but I got out put as '0' when I used $this->uri->total_segments(); my config.php

How to launch Skype in HoloLens from Unity through script

◇◆丶佛笑我妖孽 提交于 2019-12-24 19:56:29
问题 I have read a question similar to this one, but years ago. I just want to know if there is now an option or some code to put in my Unity app to run Skype from HoloLens. I have tried putting the Skype uri by code, but it only works on my PC, not on my HoloLens. It just exit my App and I have to open Skype manually, so it is not the thing I really want. Anyone knows what to do? 回答1: You cannot open up or run Skype from within your own app. It works on your Desktop because that Skype is the full

sleuth+zipkin自定义采样率

我的梦境 提交于 2019-12-24 19:17:49
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 问题背景 zipkin原生提供的采样率设置,仅能针对全局进行设置,无法做到精细化设置,比如,有些接口我们觉得比较重要,所以想采样率高一点,有些接口很简单,我们希望不采集或者采集率设置低一点,原生是没办法做到的,需要完成这个功能,需要我们重写他的采样率计算器。 配置重写 下面的是他原生的配置,由于它是使用了@ConditionalOnMissingBean注解的,也就是容器中不存在这个Bean的时候,才初始化他自己默认的配置,因此我们可以重写他的配置。 @Bean @ConditionalOnMissingBean public Sampler defaultTraceSampler(SamplerProperties config) { return new PercentageBasedSampler(config); } 重写配置如下 @Bean Sampler percentageLocalSampler(SamplerLocalProperties samplerLocalProperties){ return new PercentageLocalSampler(samplerLocalProperties); } 1 2 3 4 5 在Config类上面添加

nginx 常见正则匹配符号表示

浪尽此生 提交于 2019-12-24 17:52:58
nginx 常见正则匹配符号表示 1 2 3 4 5 6 7 8 9 10 11 1、^: 匹配字符串的开始位置; 2、 $:匹配字符串的结束位置; 3、.*: .匹配任意字符,*匹配数量0到正无穷; 4、\. 斜杠用来转义,\.匹配 . 特殊使用方法,记住记性了; 5、(值1|值2|值3|值4):或匹配模式,例:(jpg|gif|png|bmp)匹配jpg或gif或png或bmp 6、i不区分大小写   一.正则表达式匹配,其中: * ~ 为区分大小写匹配 * ~* 为不区分大小写匹配 * !~和!~*分别为区分大小写不匹配及不区分大小写不匹配 二.文件及目录匹配,其中: * -f和!-f用来判断是否存在文件 * -d和!-d用来判断是否存在目录 * -e和!-e用来判断是否存在文件或目录 * -x和!-x用来判断文件是否可执行 三.rewrite指令的最后一项参数为flag标记,flag标记有: 1.last 相当于apache里面的[L]标记,表示rewrite。 2.break本条规则匹配完成后,终止匹配,不再匹配后面的规则。 3.redirect 返回302临时重定向,浏览器地址会显示跳转后的URL地址。 4.permanent 返回301永久重定向,浏览器地址会显示跳转后的URL地址。 使用last和break实现URI重写,浏览器地址栏不变。而且两者有细微差别

Perl::Dancer how to include a file path as a parameter in the URI

社会主义新天地 提交于 2019-12-24 16:01:58
问题 I'm new to the Dancer framework and web apps in general. I have a Dancer project in which I have a route that accepts multiple parameters. So far, no sweat. However, if one of the parameters has a file path as its value then the route is not found. I have tried encoding the parameter string as follows to eliminate the forward slashes: $paramString =~ s/\//%2F/g; and this does encode the slashes as expected (I print it out in the log to make sure). However, after the parameter string is

how to detect the end of outgoing ringtone?

一个人想着一个人 提交于 2019-12-24 16:01:12
问题 I want to make a call with my program and after that recognize the call status . I want to detect the end of outgoing ringtone. How to detect the end of outgoing ringtone ? I use of Flowing code for make call . EditText ed = (EditText) findViewById(R.id.txtcall); Uri uri = Uri.fromParts("tel", ed.getText().toString(), null); callIntent = new Intent(Intent.ACTION_CALL,uri); startActivity(callIntent); 回答1: Following code snippet can help you in finding the phone call current statue whether its

How to convert CURL into URI in Elasticsearch

淺唱寂寞╮ 提交于 2019-12-24 15:40:21
问题 I have a curl command for elasticsearch aggregation as below. curl -XGET "http://localhost:9200/employee/_search?search_type=count&pretty" -d '{ "aggregations": { "profile": { "terms": { "field": "_type" }, "aggs": { "hits": { "top_hits": { "size": 1 } } } } } }' I want to search these above curl into my htmlpage in browser, how to convert this into normal url like URI search in elasticsearch ? Please help me to convert above to url ? 回答1: You can use the source query string parameter in

Remove subdomains from URI

风流意气都作罢 提交于 2019-12-24 14:34:14
问题 I want to remove subdomain names from a URI. Example: I want to return 'baseurl.com' from the Uri "subdomain.sub2.baseurl.com". Is there a way of doing this using URI class or is Regex the only solution? Thank you. 回答1: This should get it done: var tlds = new List<string>() { //the second- and third-level TLDs you expect go here, set to null if working with single-level TLDs only "co.uk" }; Uri request = new Uri("http://subdomain.domain.co.uk"); string host = request.Host; string

C# FTP上传文件至服务器代码

老子叫甜甜 提交于 2019-12-24 14:10:36
/// <summary> /// 上传文件 /// </summary> /// <param name="fileinfo">需要上传的文件</param> /// <param name="targetDir">目标路径</param> /// <param name="hostname">ftp地址</param> /// <param name="username">ftp用户名</param> /// <param name="password">ftp密码</param> public static void UploadFile(FileInfo fileinfo, string targetDir, string hostname, string username, string password) { //1. check target string target; if (targetDir.Trim() == "") { return; } target = Guid.NewGuid().ToString(); //使用临时文件名 string URI = "FTP://" + hostname + "/" + targetDir + "/" + target; ///WebClient webcl = new WebClient(); System.Net