`
sillycat
  • 浏览: 2564141 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

DiveIntoPython(十五)

阅读更多
DiveIntoPython(十五)

英文书地址:
http://diveintopython.org/toc/index.html

Chapter 16.Functional Progamming

16.1.Diving in
The following is a complete Python program that acts as a cheap and simple regression testing framework. It takes unit tests that you've written for individual modules, collects them all into one big test suite, and runs them all at once.

example 16.1.regression.py
import sys, os, re, unittest

def regressionTest():
    path = os.path.abspath(os.path.dirname(sys.argv[0]))  
    files = os.listdir(path)                              
    test = re.compile("test\.py$", re.IGNORECASE)         
    files = filter(test.search, files)                    
    filenameToModuleName = lambda f: os.path.splitext(f)[0]
    moduleNames = map(filenameToModuleName, files)        
    modules = map(__import__, moduleNames)                
    load = unittest.defaultTestLoader.loadTestsFromModule 
    return unittest.TestSuite(map(load, modules))         

if __name__ == "__main__":                  
    unittest.main(defaultTest="regressionTest")

example 16.2.Sample output of regression.py
E:\book\opensource\python\diveintopython-5.4\py>python regression.py -v
info should fail with no object ... ok
info should return known result for apihelper ... ok
info should honor collapse argument ... ok
info should honor spacing argument ... ok

...snip...

fromRoman(toRoman(n))==n for all n ... ok
toRoman should fail with non-integer input ... ok
toRoman should fail with negative input ... ok
toRoman should fail with large input ... ok
toRoman should fail with 0 input ... ok
soundex should give known result with known input ... ok

----------------------------------------------------------------------
Ran 81 tests in 0.593s

OK

16.2.Finding the path
When running Python scripts from the command line, it is sometimes useful to know where the currently running script is located on disk.
The key to it is sys.argv. As you saw in Chapter 9, XML Processing, this is a list that holds the list of command-line arguments. However, it also holds the name of the running script, exactly as it was called from the command line, and this is enough information to determine its location.

example 16.3.fullpath.py
import sys, os

print 'sys.argv[0] =', sys.argv[0]
pathname = os.path.dirname(sys.argv[0])
print 'path =', pathname
print 'full path =', os.path.abspath(pathname)

Regardless of how you run a script, sys.argv[0] will always contain the name of the script, exactly as it appears on the command line. This may or may not include any path information, as you'll see shortly.

os.path.dirname takes a filename as a string and returns the directory path portion. If the given filename does not include any path information, os.path.dirname returns an empty string.

os.path.abspath is the key here. It takes a pathname, which can be partial or even blank, and returns a fully qualified pathname.

example 16.4.Further explanation of os.path.abspath
>>> import os
>>> os.getcwd()
'E:\\book\\opensource\\python\\diveintopython-5.4\\py'
>>> os.path.abspath('')
'E:\\book\\opensource\\python\\diveintopython-5.4\\py'
>>> os.path.abspath('.ssh')
'E:\\book\\opensource\\python\\diveintopython-5.4\\py\\.ssh'
>>> os.path.abspath('E:\\book\\opensource\\python\\diveintopython-5.4\\py\\.ssh')
'E:\\book\\opensource\\python\\diveintopython-5.4\\py\\.ssh'
>>> os.path.abspath('.ssh/../foo/')
'E:\\book\\opensource\\python\\diveintopython-5.4\\py\\foo'

os.getcwd() returns the current working directory.

Calling os.path.abspath with an empty string returns the current working directory, same as os.getcwd().

It normalizes the path by making it as simple as possible. If you just want to normalize a pathname like this without turning it into a full pathname, use os.path.normpath instead.

example 16.5.Sample output from fullpath.py
E:\book\opensource\python\diveintopython-5.4\py>python fullpath.py
sys.argv[0] = fullpath.py
path =
full path = E:\book\opensource\python\diveintopython-5.4\py

E:\>python E:\book\opensource\python\diveintopython-5.4\py\fullpath.py
sys.argv[0] = E:\book\opensource\python\diveintopython-5.4\py\fullpath.py
path = E:\book\opensource\python\diveintopython-5.4\py
full path = E:\book\opensource\python\diveintopython-5.4\py

If the script is run from the current directory without giving any path, os.path.dirname will simply return an empty string. Given an empty string, os.path.abspath returns the current directory, which is what you want, since the script was run from the current directory.

sys.argv[0] includes the full path of the script. You can then use the os.path.dirname function to strip off the script name and return the full directory name, and os.path.abspath simply returns what you give it.

example 16.6.Running scripts in the current directory
import sys, os, re, unittest

def regressionTest():
    path = os.getcwd()      
    sys.path.append(path)   
    files = os.listdir(path)

Instead of setting path to the directory where the currently running script is located, you set it to the current working directory instead. This will be whatever directory you were in before you ran the script, which is not necessarily the same as the directory the script is in.

Append this directory to the Python library search path, so that when you dynamically import the unit test modules later, Python can find them. You didn't need to do this when path was the directory of the currently running script, because Python always looks in that directory.

The rest of the function is the same.

This technique will allow you to re-use this regression.py script on multiple projects. Just put the script in a common directory, then change to the project's directory before running it. All of that project's unit tests will be found and tested, instead of the unit tests in the common directory where regression.py is located.

16.3.Filtering lists revisited
Python has a built-in filter function which takes two arguments, a function and a list, and returns a list.

The function passed as the first argument to filter must itself take one argument, and the list that filter returns will contain all the elements from the list passed to filter for which the function passed to filter returns true.

example 16.7.Introducing filter
>>> def odd(n):
... return n % 2
...
>>> li = [1,2,3,5,9,10,256,-3]
>>> filter(odd,li)
[1, 3, 5, 9, -3]
>>> [e for e in li if odd(e)]
[1, 3, 5, 9, -3]
>>> filteredList = []
>>> for n in li:
... if odd(n):
... filteredList.append(n)
...
>>> filteredList
[1, 3, 5, 9, -3]

odd uses the built-in mod function “%” to return True if n is odd and False if n is even.

filter takes two arguments, a function (odd) and a list (li). It loops through the list and calls odd with each element. If odd returns a true value (remember, any non-zero value is true in Python), then the element is included in the returned list, otherwise it is filtered out. The result is a list of only the odd numbers from the original list, in the same order as they appeared in the original.

example 16.8.filter in regression.py
files = os.listdir(path)                               
test = re.compile("test\.py$", re.IGNORECASE)          
files = filter(test.search, files) 

Either way, files will end up with the names of the files in the same directory as this script you're running.

If the regular expression matches, the method will return a Match object, which Python considers to be true, so the element will be included in the list returned by filter. If the regular expression does not match, the search method will return None, which Python considers to be false, so the element will not be included.

example 16.9.Filtering using list comprehensions instead
files = os.listdir(path)                              
test = re.compile("test\.py$", re.IGNORECASE)         
files = [f for f in files if test.search(f)]

>>> files = os.listdir("")
>>> test = re.compile("test\.py$", re.IGNORECASE)
>>> files = [f for f in files if test.search(f)]
>>> files
['apihelpertest.py', 'kgptest.py', 'odbchelpertest.py', 'pluraltest.py', 'romantest.py', 'soundextest.py']

16.4.Mapping lists revisited
You're already familiar with using list comprehensions to map one list into another. There is another way to accomplish the same thing, using the built-in map function. It works much the same way as the filter function.

example 16.10.Introducing map
>>> def double(n):
... return n*2
...
>>> li = [1,2,3,5,9,10,256,-3]
>>> map(double,li)
[2, 4, 6, 10, 18, 20, 512, -6]
>>> [double(n) for n in li]
[2, 4, 6, 10, 18, 20, 512, -6]
>>> newList = []
>>> for n in li:
... newList.append(double(n))
...
>>> newList
[2, 4, 6, 10, 18, 20, 512, -6]

map takes a function and a list[8] and returns a new list by calling the function with each element of the list in order. In this case, the function simply multiplies each element by 2.

example 16.11.map with lists of mixed datatypes
>>> li = [5,'a',(2,'b')]
>>> map(double,li)
[10, 'aa', (2, 'b', 2, 'b')]

As a side note, I'd like to point out that map works just as well with lists of mixed datatypes, as long as the function you're using correctly handles each type.

example 16.12.map in regression.py
filenameToModuleName = lambda f: os.path.splitext(f)[0]
moduleNames = map(filenameToModuleName, files)

And as you saw in Example 6.17, “Splitting Pathnames”, os.path.splitext takes a filename and returns a tuple (name, extension). So filenameToModuleName is a function which will take a filename and strip off the file extension, and return just the name.

Calling map takes each filename listed in files, passes it to the function filenameToModuleName, and returns a list of the return values of each of those function calls. In other words, you strip the file extension off of each filename, and store the list of all those stripped filenames in moduleNames.

16.5.Data-centric programming

16.6.Dynamically importing modules

example 16.13.Importing multiple modules at once
import sys,os,re,unittest

This imports four modules at once: sys (for system functions and access to the command line parameters), os (for operating system functions like directory listings), re (for regular expressions), and unittest (for unit testing).

example 16.14.Importing modules dynamically
>>> sys = __import__('sys')
>>> os = __import__('os')
>>> re = __import__('re')
>>> unittest = __import__('unittest')
>>> sys
<module 'sys' (built-in)>
>>> os
<module 'os' from 'C:\Python26\lib\os.pyc'>

The built-in __import__ function accomplishes the same goal as using the import statement, but it's an actual function, and it takes a string as an argument.

example 16.15.Importing a list of modules dynamically
>>> moduleNames
['sys', 'os', 're', 'unittest']
>>> modules = map(__import__,moduleNames)
>>> modules
[<module 'sys' (built-in)>, <module 'os' from 'C:\Python26\lib\os.pyc'>, <module 're' from 'C:\Python26\lib\re.pyc'>, <module 'unittest' from 'C:\Python26\lib\unittest.pyc'>]
>>> modules[0].version
'2.6.4 (r264:75706, Jan 22 2010, 16:41:54) [MSC v.1500 32 bit (Intel)]'
>>> import sys
>>> sys.version
'2.6.4 (r264:75706, Jan 22 2010, 16:41:54) [MSC v.1500 32 bit (Intel)]'

Surprise, you wanted to import them, and you did, by mapping the __import__ function onto the list. Remember, this takes each element of the list (moduleNames) and calls the function (__import__) over and over, once with each element of the list, builds a list of the return values, and returns the result.

16.7.Putting it all together

example 16.16.The regressionTest function
def regressionTest():
    path = os.path.abspath(os.path.dirname(sys.argv[0]))  
    files = os.listdir(path)                              
    test = re.compile("test\.py$", re.IGNORECASE)         
    files = filter(test.search, files)                    
    filenameToModuleName = lambda f: os.path.splitext(f)[0]
    moduleNames = map(filenameToModuleName, files)        
    modules = map(__import__, moduleNames)                
load = unittest.defaultTestLoader.loadTestsFromModule 
return unittest.TestSuite(map(load, modules)) 

example 16.7.Step 1:Get all the files
>>> import sys,os,re,unittest
>>> path = r'E:\book\opensource\python\diveintopython-5.4\py'
>>> files = os.listdir(path)
>>> files
['apihelper.py', 'apihelper.pyc', 'apihelpertest.py', 'apihelpertest.pyc', 'argecho.py', 'autosize.py', 'BaseHTMLProcessor.py', 'BaseHTMLProcessor.pyc', 'builddialectexamples.py', 'colorize.py', 'dialect.py', 'fibonacci.py', 'fileinfo.py', 'fileinfo.pyc', 'fileinfo_fromdict.py', 'fullpath.py', 'kgp', 'kgptest.py', 'kgptest.pyc', 'LICENSE.txt', 'makerealworddoc.py', 'odbchelper.py', 'odbchelper.pyc', 'odbchelpertest.py', 'odbchelpertest.pyc', 'openanything.py', 'openanything.pyc', 'parsephone.py', 'piglatin.py', 'plural', 'plural-rules.en', 'plural.py', 'plural.pyc', 'pluraltest.py', 'pluraltest.pyc', 'pyfontify.py', 'regression.py', 'roman', 'roman.py', 'roman.pyc', 'romantest.py', 'romantest.pyc', 'search.py', 'soundex', 'soundex.py', 'soundex.pyc', 'soundextest.py', 'soundextest.pyc', 'statsout.py', 'statsout.pyc', 'temp.py', 'unicode2koi8r.py', 'urllister.py', 'urllister.pyc']

files is a list of all the files and directories in the script's directory.

example 16.18.Step 2:Filter to find the files you care about
>>> test = re.compile("test\.py$",re.IGNORECASE)
>>> files = filter(test.search,files)
>>> files
['apihelpertest.py', 'kgptest.py', 'odbchelpertest.py', 'pluraltest.py', 'romantest.py', 'soundextest.py']

This regular expression will match any string that ends with test.py. Note that you need to escape the period, since a period in a regular expression usually means “match any single character”, but you actually want to match a literal period instead.

example 16.19.Step 3:Map filenames to module names
>>> filenameToModuleName = lambda f:os.path.splitext(f)[0]
>>> filenameToModuleName('romantest.py')
'romantest'
>>> moduleNames = map(filenameToModuleName,files)
>>> moduleNames
['apihelpertest', 'kgptest', 'odbchelpertest', 'pluraltest', 'romantest', 'soundextest']

example 16.20.Step 4:Mapping module names to modules
>>> sys.path.append(r"E:\book\opensource\python\diveintopython-5.4\py")
>>> sys.path.append(r"E:\book\opensource\python\diveintopython-5.4\py\kgp")
>>> moduleNames
['apihelpertest', 'kgptest', 'odbchelpertest', 'pluraltest', 'romantest', 'soundextest']
>>> modules = map(__import__,moduleNames)
>>> modules
[<module 'apihelpertest' from 'E:\book\opensource\python\diveintopython-5.4\py\apihelpertest.pyc'>, <module 'kgptest' from 'E:\book\opensource\python\diveintopython-5.4\py\kgptest.pyc'>, <module 'odbchelpertest' from 'E:\book\opensource\python\diveintopython-5.4\py\odbchelpertest.pyc'>, <module 'pluraltest' from 'E:\book\opensource\python\diveintopython-5.4\py\pluraltest.pyc'>, <module 'romantest' from 'E:\book\opensource\python\diveintopython-5.4\py\romantest.pyc'>, <module 'soundextest' from 'E:\book\opensource\python\diveintopython-5.4\py\soundextest.pyc'>]
>>> modules[-1]
<module 'soundextest' from 'E:\book\opensource\python\diveintopython-5.4\py\soundextest.pyc'>

example 16.21.Step 5:Loading the modules into a test suite
>>> load = unittest.defaultTestLoader.loadTestsFromModule
>>> map(load,modules)
[<unittest.TestSuite tests=[<unittest.TestSuite tests=[<apihelpertest.BadInput testMethod=testNoObject>]>, <unittest.TestSuite tests=[<apihelpertest.KnownValues testMethod=testApiHelper>]>, <unittest.TestSuite tests=[<apihelpertest.ParamChecks testMethod=testCollapse>, <apihelpertest.ParamChecks testMethod=testSpacing>]>, <unittest.TestSuite tests=[]>]>, <unittest.TestSuite tests=[<unittest.TestSuite
...snip...
>>> unittest.TestSuite(map(load,modules))

That's what the loadTestsFromModule method does: it introspects into each module and returns a unittest.TestSuite object for each module. Each TestSuite object actually contains a list of TestSuite objects, one for each TestCase class in your module, and each of those TestSuite objects contains a list of tests, one for each test method in your module.

Finally, you wrap the list of TestSuite objects into one big test suite. The unittest module has no problem traversing this tree of nested test suites within test suites; eventually it gets down to an individual test method and executes it, verifies that it passes or fails, and moves on to the next one.

example 16.22.Step 6:Telling unittest to use your test suite
if __name__ == "__main__":                  
    unittest.main(defaultTest="regressionTest")
分享到:
评论

相关推荐

    dive into python

    7.4.1. 校验十位数和个位数 7.5. 松散正则表达式 7.6. 个案研究:解析电话号码 7.7. 小结 8. HTML 处理 8.1. 概览 8.2. sgmllib.py 介绍 8.3. 从 HTML 文档中提取数据 8.4. BaseHTMLProcessor.py 介绍 8.5. ...

    Dive into Deep Learning中文版1

    深度学习的发展有着悠久的历史,从20世纪五六十年代开始,到现在已经成为人工智能领域的核心技术之一。 深度学习的特点 深度学习有很多特点,例如: * 能够 Learn complex and abstract representations of data ...

    受激拉曼散射计量【Stimulated-Raman-Scattering Metrology】 附Matlab代码.rar

    1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

    MMC整流器技术解析:基于Matlab的双闭环控制策略与环流抑制性能研究,Matlab下的MMC整流器技术文档:18个子模块,双闭环控制稳定直流电压,环流抑制与最近电平逼近调制,优化桥臂电流波形,高效

    MMC整流器技术解析:基于Matlab的双闭环控制策略与环流抑制性能研究,Matlab下的MMC整流器技术文档:18个子模块,双闭环控制稳定直流电压,环流抑制与最近电平逼近调制,优化桥臂电流波形,高效并网运行。,MMC整流器(Matlab),技术文档 1.MMC工作在整流侧,子模块个数N=18,直流侧电压Udc=25.2kV,交流侧电压6.6kV 2.控制器采用双闭环控制,外环控制直流电压,采用PI调节器,电流内环采用PI+前馈解耦; 3.环流抑制采用PI控制,能够抑制环流二倍频分量; 4.采用最近电平逼近调制(NLM), 5.均压排序:电容电压排序采用冒泡排序,判断桥臂电流方向确定投入切除; 结果: 1.输出的直流电压能够稳定在25.2kV; 2.有功功率,无功功率稳态时波形稳定,有功功率为3.2MW,无功稳定在0Var; 3.网侧电压电流波形均为对称的三相电压和三相电流波形,网侧电流THD=1.47%<2%,符合并网要求; 4.环流抑制后桥臂电流的波形得到改善,桥臂电流THD由9.57%降至1.93%,环流波形也可以看到得到抑制; 5.电容电压能够稳定变化 ,工作点关键词:MMC

    Boost二级升压光伏并网结构的Simulink建模与MPPT最大功率点追踪:基于功率反馈的扰动观察法调整电压方向研究,Boost二级升压光伏并网结构的Simulink建模与MPPT最大功率点追踪:基

    Boost二级升压光伏并网结构的Simulink建模与MPPT最大功率点追踪:基于功率反馈的扰动观察法调整电压方向研究,Boost二级升压光伏并网结构的Simulink建模与MPPT最大功率点追踪:基于功率反馈的扰动观察法调整电压方向研究,Boost二级升压光伏并网结构,Simulink建模,MPPT最大功率点追踪,扰动观察法采用功率反馈方式,若ΔP>0,说明电压调整的方向正确,可以继续按原方向进行“干扰”;若ΔP<0,说明电压调整的方向错误,需要对“干扰”的方向进行改变。 ,Boost升压;光伏并网结构;Simulink建模;MPPT最大功率点追踪;扰动观察法;功率反馈;电压调整方向。,光伏并网结构中Boost升压MPPT控制策略的Simulink建模与功率反馈扰动观察法

    STM32F103C8T6 USB寄存器开发详解(12)-键盘设备

    STM32F103C8T6 USB寄存器开发详解(12)-键盘设备

    2011-2020广东21市科技活动人员数

    科技活动人员数专指直接从事科技活动以及专门从事科技活动管理和为科技活动提供直接服务的人员数量

    Matlab Simulink仿真探究Flyback反激式开关电源性能表现与优化策略,Matlab Simulink仿真探究Flyback反激式开关电源的工作机制,Matlab Simulimk仿真

    Matlab Simulink仿真探究Flyback反激式开关电源性能表现与优化策略,Matlab Simulink仿真探究Flyback反激式开关电源的工作机制,Matlab Simulimk仿真,Flyback反激式开关电源仿真 ,Matlab; Simulink仿真; Flyback反激式; 开关电源仿真,Matlab Simulink在Flyback反激式开关电源仿真中的应用

    基于Comsol的埋地电缆电磁加热计算模型:深度解析温度场与电磁场分布学习资料与服务,COMSOL埋地电缆电磁加热计算模型:温度场与电磁场分布的解析与学习资源,comsol 埋地电缆电磁加热计算模型

    基于Comsol的埋地电缆电磁加热计算模型:深度解析温度场与电磁场分布学习资料与服务,COMSOL埋地电缆电磁加热计算模型:温度场与电磁场分布的解析与学习资源,comsol 埋地电缆电磁加热计算模型,可以得到埋地电缆温度场及电磁场分布,提供学习资料和服务, ,comsol;埋地电缆电磁加热计算模型;温度场分布;电磁场分布;学习资料;服务,Comsol埋地电缆电磁加热模型:温度场与电磁场分布学习资料及服务

    ibus-table-chinese-yong-1.4.6-3.el7.x64-86.rpm.tar.gz

    1、文件内容:ibus-table-chinese-yong-1.4.6-3.el7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/ibus-table-chinese-yong-1.4.6-3.el7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、更多资源/技术支持:公众号禅静编程坊

    基于51单片机protues仿真的汽车智能灯光控制系统设计(仿真图、源代码)

    基于51单片机protues仿真的汽车智能灯光控制系统设计(仿真图、源代码) 一、设计项目 根据本次设计的要求,设计出一款基于51单片机的自动切换远近光灯的设计。 技术条件与说明: 1. 设计硬件部分,中央处理器采用了STC89C51RC单片机; 2. 使用两个灯珠代表远近光灯,感光部分采用了光敏电阻,因为光敏电阻输出的是电压模拟信号,单片机不能直接处理模拟信号,所以经过ADC0832进行转化成数字信号; 3. 显示部分采用了LCD1602液晶,还增加按键部分电路,可以选择手自动切换远近光灯; 4. 用超声模块进行检测距离;

    altermanager的企业微信告警服务

    altermanager的企业微信告警服务

    MyAgent测试版本在线下载

    MyAgent测试版本在线下载

    Comsol技术:可调BIC应用的二氧化钒VO2材料探索,Comsol模拟二氧化钒VO2的可调BIC特性研究,Comsol二氧化钒VO2可调BIC ,Comsol; 二氧化钒VO2; 可调BIC

    Comsol技术:可调BIC应用的二氧化钒VO2材料探索,Comsol模拟二氧化钒VO2的可调BIC特性研究,Comsol二氧化钒VO2可调BIC。 ,Comsol; 二氧化钒VO2; 可调BIC,Comsol二氧化钒VO2材料:可调BIC技术的关键应用

    C++学生成绩管理系统源码.zip

    C++学生成绩管理系统源码

    基于Matlab与Cplex的激励型需求响应模式:负荷转移与电价响应的差异化目标函数解析,基于Matlab与CPLEX的激励型需求响应负荷转移策略探索,激励型需求响应 matlab +cplex 激励

    基于Matlab与Cplex的激励型需求响应模式:负荷转移与电价响应的差异化目标函数解析,基于Matlab与CPLEX的激励型需求响应负荷转移策略探索,激励型需求响应 matlab +cplex 激励型需求响应采用激励型需求响应方式对负荷进行转移,和电价响应模式不同,具体的目标函数如下 ,激励型需求响应; matlab + cplex; 负荷转移; 目标函数。,Matlab与Cplex结合的激励型需求响应模型及其负荷转移策略

    scratch介绍(scratch说明).zip

    scratch介绍(scratch说明).zip

    深度学习模型的发展历程及其关键技术在人工智能领域的应用

    内容概要:本文全面介绍了深度学习模型的概念、工作机制和发展历程,详细探讨了神经网络的构建和训练过程,包括反向传播算法和梯度下降方法。文中还列举了深度学习在图像识别、自然语言处理、医疗和金融等多个领域的应用实例,并讨论了当前面临的挑战,如数据依赖、计算资源需求、可解释性和对抗攻击等问题。最后,文章展望了未来的发展趋势,如与量子计算和区块链的融合,以及在更多领域的应用前景。 适合人群:对该领域有兴趣的技术人员、研究人员和学者,尤其适合那些希望深入了解深度学习原理和技术细节的读者。 使用场景及目标:①理解深度学习模型的基本原理和结构;②了解深度学习模型的具体应用案例;③掌握应对当前技术挑战的方向。 阅读建议:文章内容详尽丰富,读者应在阅读过程中注意理解各个关键技术的概念和原理,尤其是神经网络的构成及训练过程。同时也建议对比不同模型的特点及其在具体应用中的表现。

    day02供应链管理系统-补充.zip

    该文档提供了一个关于供应链管理系统开发的详细指南,重点介绍了项目安排、技术实现和框架搭建的相关内容。 文档分为以下几个关键部分: 项目安排:主要步骤包括搭建框架(1天),基础数据模块和权限管理(4天),以及应收应付和销售管理(5天)。 供应链概念:供应链系统的核心流程是通过采购商品放入仓库,并在销售时从仓库提取商品,涉及三个主要订单:采购订单、销售订单和调拨订单。 大数据的应用:介绍了数据挖掘、ETL(数据抽取)和BI(商业智能)在供应链管理中的应用。 技术实现:讲述了DAO(数据访问对象)的重用、服务层的重用、以及前端JS的继承机制、jQuery插件开发等技术细节。 系统框架搭建:包括Maven环境的配置、Web工程的创建、持久化类和映射文件的编写,以及Spring配置文件的实现。 DAO的需求和功能:供应链管理系统的各个模块都涉及分页查询、条件查询、删除、增加、修改操作等需求。 泛型的应用:通过示例说明了在Java语言中如何使用泛型来实现模块化和可扩展性。 文档非常技术导向,适合开发人员参考,用于构建供应链管理系统的架构和功能模块。

Global site tag (gtag.js) - Google Analytics