QuickLuaTour翻译流水账(31-38)

-- Example 31   --[[

  Standard Libraries

  Lua has standard built-in libraries for common operations in
  math, string, table, input/output & operating system facilities.

  External Libraries

  Numerous other libraries have been created: sockets, XML, profiling,
  logging, unittests, GUI toolkits, web frameworks, and many more.

]]

------- Output --------


-- 例子 31   --[[
  标准库

  Lua 有许多用于通用操作的标准的内建库,比如数学
  字符串,表,输入/输出和操作系统的工具

  外部库

  现有的其它的库有N多:sockets, XML, 性能分析,
  日志,单元测试,图形界面工具,web框架等等

]]


-- Example 32  -- Standard Libraries - math.

-- Math functions:
-- math.abs, math.cos, math.asin, math.atan, math.atan2,
-- math,ceil, math.cos, math.cosh, math.deg, math.exp, math.floor,
-- math.fmod, math.frexp, math,huge, math.ldexp, math.log, math.log10
-- math.max, math.min, math.modf, math.pi, math.pow, math.rad,
-- math.random, math.randomseed, math.sin, math.sinh, math.sqrt,
-- math.tan, math.tanh

print(math,sqrt(9), math.pi)


------ Output ------

3          3.1415926535898


-- Example 33  -- Standard Libraries - string.

-- String functions:
-- string.byte, string.char, string.dump, string.find, string.format,
-- string.gfind, string.gsub, string.len, string.lower, string.match,
-- string.rep, string.reverse, string.sub, string.upper

print(string.upper("lower"), string.rep("a", 5), string.find("abcde", "cd"))

------ Output ------

LOWER aaaaa  3         4


-- Example 34  -- Standard Libraries - table.

--Table functions:
-- table.concat, table.insert, table.maxn, table.remove, table.sort

a={2}
table.insert(a,3);
table.insert(a,4);
table.sort(a,function(v1,v2) return v1 > v2 end)
for i,v in ipairs(a) do print(i,v) end

------ Output ------

1      4
2      3
3      2


-- Example 35  -- Standard Libraries - input/output.

-- IO functions:
-- io.close, io.flush, io.input, io.lines, io.open, io.output, io.popen,
-- io.read, io.stderr, io.stdin, io.stdout, io.tmpfile, io.type, io.write,
-- file:close, file:flush, file:lines, file:read,
-- file:seek, file:setvbuf, file:write

print(io.open("file doesn't exist", "r"))


------ Output ------

nil     file doesn't exist: No such file or derectory   2


-- Example 36  -- Standard Libraries - operating system facilities.

-- OS functions:
-- os.clock, os.date, os.difftime, os.execute, os.exit, os.getenv,
-- os.remove, os.rename, os.setlocale, os.time, os.tmpname

print(os.date())

------ Output ------

06/20/12 11:48:30


-- Example 37  -- External Libraries
-- Lua has support for external modules using the 'require' function
-- INFO:A dialog will popup but it could get hidden behind the console.

require("iuplua")
ml = iup.multiline
    {
        expand="YES",
        value="Quit this multiline edit app to continue Tutorial!",
        border="YES"
    }

dlg = iup.dialog{ml; title="IupMultiline", size="QUARTERxQUARTER",}
dlg:show()
print("Exit GUI app to continue!")
iup.MainLoop()


------ Output --------
Exit GUI app to continue!


-- Example 38   --[[
  to learn more about Lua scripting see
  Lua Tutorials: http://lua-users.org/wiki/TutorialDirectory
  "Programing in Lua" Book: http://www.inf.puc-rio.br/~reberto/pil2/

  Lua 5.1 Reference Manual:
      Start/Programs/Lua/Documentation/Lua 5.1 Reference Manual

  Examples Start/Programs/Lua/Examples
]]


------ Output -------

]]
 
基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明,该项目是个人毕设项目,答辩评审分达到98分,代码都经过调试测试,确保可以运行!欢迎下载使用,可用于小白学习、进阶。该资源主要针对计算机、通信、人工智能、自动化等相关专业的学生、老师或从业者下载使用,亦可作为期末课程设计、课程大作业、毕业设计等。项目整体具有较高的学习借鉴价值!基础能力强的可以在此基础上修改调整,以实现不同的功能。 基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指挥8种手势识别源码+数据集+模型+详细项目说明基于pytorch实现中国交通警察指
内容概要:本文档详细介绍了Python反爬虫技术的各种应对策略,包括基础和高级方法。基础部分涵盖User-Agent伪装、IP代理池、请求频率控制等,其中涉及使用fake_useragent库随机生成User-Agent、设置HTTP/HTTPS代理、通过随机延时模拟正常访问行为。动态页面处理方面,讲解了Selenium和Pyppeteer两种自动化工具的使用,可以用于加载并获取JavaScript渲染后的网页内容。对于验证码问题,提供了OCR识别简单验证码、Selenium模拟滑块验证码操作以及利用第三方平台破解复杂验证码的方法。登录态维持章节介绍了如何通过Session对象保持登录状态,并且演示了Cookie的保存与读取。数据加密对抗部分探讨了JavaScript逆向工程和WebAssembly破解技巧,如使用PyExecJS执行解密脚本。最后,高级反爬绕过策略中提到了WebSocket数据抓取和字体反爬解析,确保能够从各种复杂的网络环境中获取所需数据。 适合人群:有一定Python编程经验,从事数据采集工作的开发人员。 使用场景及目标:①帮助开发者理解并掌握多种反爬虫绕过技术;②为实际项目中的数据抓取任务提供有效的解决方案;③提高爬虫程序的成功率和稳定性。 其他说明:在学习过程中,建议结合具体案例进行实践,同时注意遵守网站的robots协议及相关法律法规,合法合规地进行数据采集活动。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值