slash

Linux常用命令简述--ls

吃可爱长大的小学妹 提交于 2020-04-15 13:13:18
【推荐阅读】微服务还能火多久?>>> 一、ls介绍 ls命令是list的简写,用来显示指定目录里的文件及文件夹清单;ls 命令不仅可以查看linux文件夹包含的文件,还可以查看文件权限,目录信息等等 二、常用选项介绍 1、命令格式 ls [选项]... [文件|目录].. 2、常用选项 -a, --all 不隐藏任何以. 开始的项目 -A, --almost-all 列出除. 及.. 以外的任何项目 --author 与-l 同时使用时列出每个文件的作者 -c 配合-lt:根据ctime 排序并显示ctime(文件 状态最后更改的时间) 配合-l:显示ctime 但根据名称排序其他情况:按ctime 排序 -C 每栏由上至下列出项目 --color[=WHEN] 控制是否使用色彩分辨文件。WHEN 可以是 "never"(默认)、"always"或"auto"其中之一 -d, --directory 当遇到目录时列出目录本身而非目录内的文件 -f 不进行排序,-aU 选项生效,-lst 选项失效 -g 类似-l,但不列出所有者 --group-directories-first 在文件前分组目录。此选项可与--sort 一起使用, 但是一旦使用--sort=none (-U)将禁用分组 -G, --no-group 以一个长列表的形式,不输出组名 -h, --human

使用SSE2指令集加速字符替换

怎甘沉沦 提交于 2020-03-23 20:59:50
3 月,跳不动了?>>> 本文地址: https://www.laruence.com/2020/03/09/5412.html 转载请注明出处 这个算是一个比较有用的性能优化技巧吧,主要是刚刚在 重构Yaf_Loader 的时候又用到,想着这个操作比较常见,就专门拎出来做个小分享。 我们在写代码的时候,在字符串处理的时候,可能会遇到这样的需求,就是把一个目标字符串中所有出现的某个字符a替换为另外一个字c. 比如对于Yaf_Loader中,在处理命名空间的类名的自动加载的时候,我需要把所有的\替换为_, 一般通常的写法会是: char *pos = class_name; size_t len = class_name_len; while ((pos = memchr(pos, '\\', len - (pos - class_name)))) { *pos++ = '_'; } 而目前SIMD指令的支持已经非常普遍,尤其SSE2,基本当代的CPU都支持, 可以通过cat /proc/cpuinfo来看cpu支持的SIMD指令集: cat /proc/cpuinfo | grep flags flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts

使用SSE2指令集加速字符替换

纵饮孤独 提交于 2020-03-20 23:27:58
3 月,跳不动了?>>> 本文地址: https://www.laruence.com/2020/03/09/5412.html 转载请注明出处 这个算是一个比较有用的性能优化技巧吧,主要是刚刚在 重构Yaf_Loader 的时候又用到,想着这个操作比较常见,就专门拎出来做个小分享。 我们在写代码的时候,在字符串处理的时候,可能会遇到这样的需求,就是把一个目标字符串中所有出现的某个字符a替换为另外一个字c. 比如对于Yaf_Loader中,在处理命名空间的类名的自动加载的时候,我需要把所有的\替换为_, 一般通常的写法会是: char *pos = class_name; size_t len = class_name_len; while ((pos = memchr(pos, '\\', len - (pos - class_name)))) { *pos++ = '_'; } 而目前SIMD指令的支持已经非常普遍,尤其SSE2,基本当代的CPU都支持, 可以通过cat /proc/cpuinfo来看cpu支持的SIMD指令集: cat /proc/cpuinfo | grep flags flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts

Comparing getPath(), getAbsolutePath(), and getCanonicalPath() in Java

六眼飞鱼酱① 提交于 2020-02-25 15:34:33
1. Overview The java.io.File class has three methods — getPath() , getAbsolutePath() and getCanonicalPath() — to obtain the filesystem path. In this article, we'll have a quick look at the differences between them and discuss a use case where you may choose to use one over the others. 2. Method Definitions and Examples Let's start by going over the definitions of the three methods, along with examples based on having the following directory structure present in the user's home directory: |-- baeldung |-- baeldung.txt |-- foo | |-- foo-one.txt | \-- foo-two.txt \-- bar |-- bar-one.txt |-- bar

django - url with automatic slash adding

人盡茶涼 提交于 2020-02-23 09:35:54
问题 I'm using django admin on my website. When I enter url without slash after admin (http://example.com/admin) I receive 404 error. I thought that django automatically added slash on the end of url. Of course when I enter url ended with slash it works fine. What I am doing wrong, or which settings I have to change. Thanks for any ideas. 回答1: Try setting APPEND_SLASH to true in settings. On second thoughts, I think the default setting is true. http://docs.djangoproject.com/en/dev/ref/settings/

Encode or somthing to escape slash (/) input in php?

守給你的承諾、 提交于 2020-01-30 12:11:14
问题 I'm stack here. I want to create a file and i use title_input as file_name, but i have problem when create the file to specific folder. Example: $file_name="Multi purpose Day/Night Security"; $myfile = fopen($_SERVER['DOCUMENT_ROOT']."/myweb/product/".$file_name.".php", "wb") or die("Unable to open file!"); Error: Warning: fopen(C:/Program Files/xampp/htdocs/myweb/product/Multi-Purpose Day/Night Security.php): failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs

How to use Nginx to separate variables with slashes

北城以北 提交于 2020-01-16 03:40:09
问题 I'd like to be able to use www.example.com/profiles/1234567890 instead of www.example.com/profiles?id=1234567890 but was unable to figure out how to do so. I found an apache equivalent here: Turn text after slashes into variables with HTACCESS but I don't know how to get it to work in Nginx. I only need the one variable which is id . Additionally, is it possible to do a rewrite such that www.example.com/id/1234567890 points to www.example.com/profiles/1234567890 but the url doesn't change?

ZF2 route parameters with slash

被刻印的时光 ゝ 提交于 2020-01-13 04:23:28
问题 Is it possible to assemble a route with parameters containing forward slashes? Config: 'someroute' => array( 'type' => 'Zend\Mvc\Router\Http\Segment', 'options' => array( 'route' => 'someroute/:path', 'defaults' => array( 'controller' => 'Controller', 'action' => 'index' ), 'constraints' => array( 'path' => '(.)+' ) ) ) Controller: $path = 'some/subdirectory'; $this->url('someroute', array('path' => $path)); Results in: http://host.name/someroute/some%2Fsubdirectory 回答1: Using rawurldecode()

htaccess simple Redirect doesn't work with trailing slash

≯℡__Kan透↙ 提交于 2020-01-11 11:34:31
问题 I find a lot of answers to this question (and I have read dozens of them), but they are all about more advanced stuff with patterns and such stuff. I just need a very simple and basic redirect for static urls. If I add a trailing slash to the url, the redirect doesn't work and I just can't figure out why. Example: RewriteEngine On Redirect 301 /content https://www.example.com/site/content.html Redirect 301 /content/ https://www.example.com/site/content.html https://example.com/content does