substr

Oracle数据库密码策略脚本

不想你离开。 提交于 2019-12-05 07:03:19
这里我们介绍两个脚本utlpwdmg.sql与undopwd.sql,这两个脚本是Oracle数据库软件提供的正式脚本,第一个脚本用于指定Oracle默认 的profile并提供了一个密码的验证函数,提供部分对新密码的验证;第二个脚本是将之前的改变做回原来状态。 我这里是11g数据库中的脚本,其提供的控制如下: 密码长度不低于8位 密码不能跟用户名一致 密码不能跟用户名反过来的字符一致 密码不能跟服务器名一致 包含了一些数据字典的验证,不能与其一致,比如(oracle123,database1等) 密码不能跟oracle(1..100)一致 密码至少包含一个数字与字母 密码跟旧密码至少三个以上字符不同 密码使用周期 密码过期时间 .. 第一个脚本提供了两个函数用于密码验证,一个是11g的,另一个是之前老版本的(当然我们可以自己写验证函数) 函数如下: Rem Rem $Header: rdbms/admin/utlpwdmg.sql /st_rdbms_11.2.0/1 2013/01/31 01:34:11 skayoor Exp $ Rem Rem utlpwdmg.sql Rem Rem Copyright (c) 2006, 2013, Oracle and/or its affiliates. Rem All rights reserved. Rem Rem NAME

Show 1k instead of 1,000

送分小仙女□ 提交于 2019-12-05 05:47:54
function restyle_text($input){ $input = number_format($input); $input_count = substr_count($input, ','); if($input_count != '0'){ if($input_count == '1'){ return substr($input, +4).'k'; } else if($input_count == '2'){ return substr($input, +8).'mil'; } else if($input_count == '3'){ return substr($input, +12).'bil'; } else { return; } } else { return $input; } } This is the code I have, I thought it was working. apparently not.. can someone help since I can't figure this out. Try this: http://codepad.viper-7.com/jfa3uK function restyle_text($input){ $input = number_format($input); $input_count

R: how to display the first n characters from a string of words

[亡魂溺海] 提交于 2019-12-05 05:40:16
I have the following string: Getty <- "Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty, and dedicated to the proposition that all men are created equal." I want to display the first 10 characters. So I began by splitting the string into individual characters: split <- strsplit(Getty, split="") split I get all the individual characters as this point. Then I make a substring of the first 10 characters. first.10 <- substr(split, start=1, stop=10) first.10 And here is the output: "c(\"F\", \"o\"" I am not understanding why this prints

字符md5快速查找

落花浮王杯 提交于 2019-12-05 03:17:36
//分类 const tagMap={ }; function findTag(s) { let pos=1; let tag=s.substr(0,pos); while (tagMap[tag]){ pos++; tag=s.substr(0,pos); } return pos-1; } function set(s1,callback) { const pos=findTag(s1); const tag=s1.substr(0,pos); const d=s1[pos]; const arr=tagMap[tag]; if(arr){ if(arr.indexOf(s1.substr(pos))===-1){ const arr1=[] const arr2=[] arr.forEach(function (str) { if(str[0]===d){ arr2.push(str.substr(1)) }else{ arr1.push(str) } }) if(arr2.length===0){ tagMap[tag].push(s1.substr(pos)); }else{ tagMap[tag]=arr1; arr2.push(s1.substr(pos+1)) tagMap[tag+d]=arr2; } }else{ } }else{ tagMap[tag]=[]

【2019年8月】OCP 071认证考试最新版本的考试原题-第31题

丶灬走出姿态 提交于 2019-12-04 23:05:33
Choose two Examine the data in the CUST NAME column of the CUSTOMERS table: CUST_NAME ------------------------------ Renske Ladwig Jason Mallin Samuel McCain Allan MCEwen Irene Mikkilineni Julia Nayer You want to display the CUST_NAME values where the last name starts with Mc or MC. Which two WHERE clauses give the required result? A) WHERE INITCAP (SUBSTR(cust_name, INSTR(cust_name,' ') +1 ) ) IN ('MC%', 'Mc%) B) WHERE UPPER (SUBSTR(cust_nane, INSTR(cust_name, ' ') +1 ) ) LIKE UPPER('MC%') C) WHERE INITCAP(SUBSTR(cust_nane, INSTR(cust_name,' ') +1 ) ) LIKE 'Mc%' D) WHERE SUBSTR(cust_name

SQL注入:盲注

会有一股神秘感。 提交于 2019-12-04 21:12:51
盲注简介 所谓的盲注就是在服务器没有错误回显的时候完成的注入攻击。 服务器没有错误回显,对于攻击者来说缺少了非常重要的“调试信息”。 盲注分类 1.布尔盲注 布尔很明显Ture和Fales,也就是说它只会根据你的注入信息返回True和Fales,也就没有了之前的报错信息。 2.时间盲注 界面返回值只有一种,True。无论输入和值,返回情况都会按正常的来处理。加入特定的时间函数,通过查看web页面返回的时间差来判断注入的语句是否正确。 盲注需要掌握的函数 length() 函数 返回字符串的长度 substr() 截取字符串 (语法:SUBSTR(str,pos,len);) ascii() 返回字符的ascii码 [将字符变为数字wei] sleep() 将程序挂起一段时间n为n秒 if(expr1,expr2,expr3) 判断语句 如果第一个语句正确就执行第二个语句如果错误执行第三个语句 注入步骤 1.猜解数据库名称长度 id=1'and(length(database()))>n 2.猜解数库名称 and (ascii(substr(database(),1,1)))=115--+ 返回正常,说明数据库名称第一位是s 3.猜表名 and (ascii(substr((select table_name from information_schema.tables where

Is this a good substr for C?

霸气de小男生 提交于 2019-12-04 19:15:31
See also C Tokenizer Here is a quick substr() for C that I wrote (yes, the variable initializations needs to be moved to start of the function etc, but you get the idea) I have seen many "smart" implementations of substr() that are simple one liner calls strncpy()! They are all wrong (strncpy does not guarantee null termination and thus the call might NOT produce a correct substring!) Here is something maybe better? Bring out the bugs! char* substr(const char* text, int nStartingPos, int nRun) { char* emptyString = strdup(""); /* C'mon! This cannot fail */ if(text == NULL) return emptyString;

Using PHP's substr() with special characters at the end results in question marks

三世轮回 提交于 2019-12-04 15:59:56
问题 When I use the substr() function in PHP, I get an question mark (a square with a question mark - depending on the browser) at the end of the string when this last character was a special one, like ë or ö, etc... $introtext = html_entity_decode($item->description, ENT_QUOTES, "UTF-8"); $introtext = substr($introtext, 0, 200); How can I escape this? 回答1: If your string has multibyte encoding (like UTF-8) does, you should use mb_substr to avoid problems like this: $introtext=mb_substr($introtext

How to delete the last character in the text? [duplicate]

♀尐吖头ヾ 提交于 2019-12-04 15:08:53
Possible Duplicate: remove last character from string I want to delete the last character in the text.. For example My string: example text Second : example tex How? Use substr $text = 'Example Text'; $text = substr($text, 0, -1) substr takes three arguments, the original text, start and length, it return the substring from the original text starting at start with the given length. If length is negative, that number of characters will be excluded from the string, that's why whe are using the value -1, to exclude the last char from the string. Use substr , which gets a substring of the original

[CISCN2019 华北赛区 Day2 Web1]Hack World

≯℡__Kan透↙ 提交于 2019-12-04 14:09:15
知识点:题目已经告知列名和表明为flag,接下来利用ascii和substr函数即可进行bool盲注 eg: id=(ascii(substr((select(flag)from(flag)),1,1))<128) 0x01 看了网上的源码发现: <?php $dbuser='root'; $dbpass='root'; function safe($sql){ #被过滤的内容 函数基本没过滤 $blackList = array(' ','||','#','-',';','&','+','or','and','`','"','insert','group','limit','update','delete','*','into','union','load_file','outfile','./'); foreach($blackList as $blackitem){ if(stripos($sql,$blackitem)){ return False; } } return True; } i f(isset($_POST['id'])){ $id = $_POST['id']; }else { die(); } $db = mysql_connect("localhost",$dbuser,$dbpass); i f(!$db){ die(mysql_error()); }