function getFileType(filePath){
var startIndex = filePath.lastIndexOf(".");
if(startIndex != -1)
return filePath.substring(startIndex+1, filePath.length).toLowerCase();
else return "";
注意:一定要用lastIndexOf()方法, 而不是indexOf()方法!
python 回调函数 参数 python回调函数
回调与事件驱动 回调函数有比较重要的意义:它在是事件驱动的体现 我们试想一个场景,如果我们触发了某个事件,比如点击事件 那么只要给这个点击事件绑定一个或多个处理事件,也就是回调函数 我们就可以在点击事件被触发后(结束后)调用相应的方法来处理后事 比如 普通回调
[python]
1. #在函数中使用回调
2. def click(callback):
3. #eval()可以
一、账号管理
默认账号:root 是个超级管理员账号(建议不使用) 一般用来创建用户1.创建用户并设置登录密码
命令:create user 用户名 identified by '密码';注:identified by会将纯文本密码加密作为散列值存储2.查看用户信息
命令:select host,user,password from user;user表中host列的值的