ascii

What is the use of '\b' (backspace)

笑着哭i 提交于 2020-01-23 08:30:09
问题 I'm taking a Python class right now, and I just learned about the backspace character. Like newline (\n), backspace is a special character with ASCII code 8. My teacher couldn't think of a reason to use that, but I'm curious as to how it's used. Maybe just historical reasons? When I tried print("Hellow\b World") , I got just got what I expected: Hello World . What's the reason for the backspace character, and how might it be used? Edit: I am aware that it isn't python specific, but when

Oracle中chr()和ascii()函数(附:常用字符与ascii对照表)

荒凉一梦 提交于 2020-01-23 00:32:23
Oracle中chr()和ascii()函数(附:常用字符与ascii对照表) 关键字:chr() chr()函数作用 :“特殊”字符特殊处理 在PLSql中可查询相对应的字码与特殊符 chr()函数示例: select chr(38) from dual; ascii()函数示例: select ascii('&') from dual; 比如“&”到底为什么在Oracle中成了特殊字符呢?经过查找,终于揭晓了答案:原来&这个字符在oracle的sql语句或存储过程中用来指定其后跟的是执行时要你输入的变量。如:select * from &AAA;则执行此语句时,系统会提示你给赋值。或者比如:insert into test(col1,col2,col3,TYPE) values(0,0,0,'&type'),在PL/SQL Developer的SQL Window 中执行这条语句时,会弹出一个Variables提示框,要求你输入变量'type'值。而如果执行:insert into test(col1,col2,col3,TYPE) values(0,0,0,chr(38)||'type') ,它就会乖乖的向表中插入这条数据。这下,所有疑虑就都云开雾散廖!~ 对特殊字符单独进行处理(加'或者chr(ascii))后,再用||连接其他字符。 下面是常见字符与ascii对照表

Swift 2 How to encode from ASCII to Hexadecimal

蓝咒 提交于 2020-01-22 03:00:09
问题 I have a simple ASCII string and i want to convert it to hexadecimal (base16). I'm using xCode 7 (so i'm on IOS9) but i can't find any solution anywhere. I tried to change the format of my string: StringToConvert(String(format: "%02hhx", $0)) Thanks for your help :) 回答1: "abcdefghijklmnopqrstuvwxyz0123456789".utf8.map{ $0 }.reduce("") { $0 + String($1, radix: 16, uppercase: false) } modify it by your needs "ABCD".utf8.map{ $0 }.reduce("") { $0 + "0x" + String($1, radix: 16, uppercase: false)

sqli lab5-6

我的未来我决定 提交于 2020-01-22 00:07:12
left()函数: left(database(),1)=‘s’ left(a,b)从左侧截取a的前b位,正确则返回1,错误则返回0 select left(database(),1)=‘s’; 前1位是否是s regexp函数:select user() regexp ‘r’ user()的结果是root,regexp为匹配root的正则表达式 like函数: select user() like ‘ro%’ 匹配与regexp相似。 substr(a,b,c) select substr() XXXX substr(a,b,c)从位置b开始,截取a字符串c位长度 ascii() 将某个字符串转化为ascii值 select ascii(substr((select database()),1,1)); 直接回显115 或者是: select ascii(substr((select database()),1,1)) > 110; 如果大于110,就会返回1,否则返回0. 6. chr(数字) 或者是ord(‘字母’) 使用python中的两个函数可以判断当前的ascii值是多少 对于security数据库: Less-05 猜列有3列 猜数据库 方法一 http://192.168.50.254/sqli/Less-5/?id=1'and left((select

(C) Program that prints all CP850 characters on the screen and in a file have different outputs

我们两清 提交于 2020-01-21 18:55:30
问题 The program is pretty simple, it helped me get all the ascii codes since my computer doesn't seem to follow the standards in the interwebs. The problem I'm finding is that the outputs on the file and on the cmd differ. I need to use the box characters for a project that prints a file and on the screen and the file output doesn´t have them apparently. #define _CRT_SECURE_NO_WARNINGS #include <stdlib.h> #include <stdio.h> #include <clocale> FILE* ascii; void main() { ascii = fopen("D://temp/

下划线命名转驼峰式命名工具类-Java两种实现方式性能对比

♀尐吖头ヾ 提交于 2020-01-20 20:50:28
背景 将数据库字段映射到Java实体类时遇到的问题,如 user_id 需要映射成 userId 。 talk is cheap , show me the code 一共两种实现方式: 操作字节数组,性能较高,可读性较差 使用String类提供的方法实现,性能较低 高性能实现方式 /** * 将下划线命名转换成驼峰式命名 * 例:user_id -> userId * ASCII表 * Dec Char Dec Char Dec Char Dec Char * --------- --------- --------- ---------- * 0 NUL (null) 32 SPACE 64 @ 96 ` * 1 SOH (start of heading) 33 ! 65 A 97 a * 2 STX (start of text) 34 " 66 B 98 b * 3 ETX (end of text) 35 # 67 C 99 c * 4 EOT (end of transmission) 36 $ 68 D 100 d * 5 ENQ (enquiry) 37 % 69 E 101 e * 6 ACK (acknowledge) 38 & 70 F 102 f * 7 BEL (bell) 39 ' 71 G 103 g * 8 BS (backspace) 40 (

(HDOJ2000)--ASCII码排序

偶尔善良 提交于 2020-01-20 04:42:18
ASCII码排序 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 285216 Accepted Submission(s): 110827 Problem Description 输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。 Input 输入数据有多组,每组占一行,有三个字符组成,之间无空格。 Output 对于每组输入数据,输出一行,字符中间用一个空格分开。 Sample Input qwe asd zxc Sample Output e q w a d s c x z #include<stdio.h> main(){ char data[3]; int i,j,minIndex; char temp; while(scanf("%c%c%c",&data[0],&data[1],&data[2])!=EOF){ for(i=0;i<3;i++){ minIndex=i; for(j=i+1;j<3;j++){ if(data[j]<data[minIndex]){ minIndex=j; } } if(minIndex!=i){ temp=data[minIndex]; data[minIndex

Sqli-Labs less 5-6

大憨熊 提交于 2020-01-20 00:31:22
less 5 前置基础知识: 1. left()函数: left(database(),1)=‘s’ left(a,b)从左侧截取a的前b位,正确则返回1,错误则返回0 例如上例中就是先查询database()数据库,从左面看他第一个字母是否是s,如果是则返回1,错误则返回0; 2. regexp函数:select user() regexp ‘r’ user()的结果是root,regexp为匹配root的正则表达式 例如上例中就是把查询到的user用户也就是root和r从左至右进行比较,相同是1,不同是0. 3. like函数: select user() like ‘ro%’ 匹配与regexp相似。 与上个函数类似,唯一不同就是加一个% 4. substr(a,b,c) select substr() XXXX substr(a,b,c)从位置b开始,截取a字符串c位长度 例 如select substr((select database()),1,1)='s’; 匹配第一个字符是否是 s 5. ascii() 将某个字符串转化为ascii值 进入正题: 首先用?id=1试探:(这关依旧是在源码处加入了输出sql语句的代码) 然后输入错误的?id=1‘观察:显示报错,所以一定存在注入漏洞。 再输入:http://192.168.5.100/sqli-labs/Less-5/

xls的读写

不想你离开。 提交于 2020-01-18 01:06:52
import xlrd # 读取xls文件 # 打开xls文件 data = xlrd.open_workbook('x1.xls') print(type(data)) # 获取表Sheet1 table = data.sheet_by_name(u'Sheet1') print(type(table)) # 获取行数据 arr = table.row_values(0) print(arr) # 获取列数据 arr2 = table.col_values(0) print(arr2) # 统计行数 rows_count = table.nrows print(rows_count) # 统计列数 cols_count = table.ncols print(cols_count) # 获取单元格的值 v00 = table.cell(0, 0).value print(v00) import xlwt # 写入xls文件 # 新建xls,并设置ascii编码 workbook = xlwt.Workbook(encoding='ascii') # 新建sheet表 worksheet = workbook.add_sheet('my sheet') # 向表中写入数据’中文汉字‘ worksheet.write(0, 0, label='中文汉字') # 保存xls,并设置名称

How do I convert an ascii code to the escaped 'screen friendly' view?

丶灬走出姿态 提交于 2020-01-17 08:21:11
问题 In C# .Net I'm looking to convert an ascii value (13, 16 etc) to its escaped view (eg \n, \r, \t etc) for a selector. Is there a built in way to do this or do I have to resort to using a look up table? 回答1: Not that I'm aware of... but it would be a very small lookup table anyway. It may be easiest to use a switch statement, in fact: public static string Escape(char c) { switch (c) { case '\n': return "\\n"; case '\r': return "\\r"; case '\t': return "\\t"; case '\b': return "\\b"; // etc