Unknown model format or submodel type in model file

### 解决模型文件中未知的模型格式或子模型类型问题 当遇到模型文件中的未知模型格式或子模型类型时,可以采取一系列措施来诊断并解决问题。以下是详细的解决方案: #### 1. 验证文件扩展名和元数据 确保使用的文件具有正确的扩展名,并检查是否有任何嵌入式元数据描述了其预期的内容和版本。这有助于初步判断文件的实际格式。 对于 CORBA (Common Object Request Broker Architecture)[^1],如果涉及的是分布式对象通信,则应确认所处理的对象接口定义语言(IDL)文件是否正确无误以及相应的 stub 和 skeleton 是否已正确定义。 ```bash file my_model_file.ext ``` 此命令可以帮助识别文件的真实类型。 #### 2. 使用专用工具解析文件 利用特定于该领域或技术栈的调试器、查看器或其他实用程序打开并分析有问题的数据集。这些工具有可能提供关于内部结构更深入的信息,从而揭示隐藏的问题所在之处。 例如,在机器学习环境中,TensorFlow SavedModel CLI 或 PyTorch 的 `torch.load()` 函数可用于加载保存下来的训练成果;而在图形渲染方面,Blender 可能会成为探索几何体属性的有效手段之一。 #### 3. 查阅官方文档和支持资源 访问创建者提供的手册和技术说明,寻找有关支持哪些输入/输出形式的具体指导方针。同时也可以通过社区论坛寻求帮助——其他开发者或许曾经遭遇过相同的情况并且找到了有效的应对策略。 特别是针对像 CORBA 这样的复杂框架,Oracle 官方网站上提供了详尽的手册与教程,其中包含了大量实例代码片段及最佳实践建议,能够极大地促进理解过程。 #### 4. 尝试转换为常见格式 考虑将原始资料转化为更为普遍接受的标准,比如 ONNX (Open Neural Network Exchange),以便更容易地与其他应用程序集成。许多现代AI平台都具备良好的互操作性特性,允许轻松导入导出多种流行规格下的预训练网络权重参数集合等重要资产。 ```python import onnx from tensorflow.keras.models import load_model # 加载 Keras 模型 keras_model = load_model('path_to_keras_model.h5') # 转换为 ONNX 格式 onnx_model = keras_model.export_onnx() onnx.save(onnx_model, 'converted_model.onnx') ```

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

Python内容推荐

Python栈实现计算器_完整知识整理(1).docx

Python栈实现计算器_完整知识整理(1).docx

Python栈实现计算器_完整知识整理(1).docx

pr-agent(Python)

pr-agent(Python)

「pr-agent(Python)」是开源项目(Python)。项目简介: PR Agent: The Original Open-Source PR Reviewer. This project is not the Qodo free tier.源码完整,下载解压即可查看使用,适合学习参考、课程设计与二次开发。

Delphi7.1 Update

Delphi7.1 Update

Delphi 7.1 Update Release Notes=======================================================This file contains important supplemental and late-breakinginformation that may not appear in the main productdocumentation, and supersedes information contained in otherdocuments, including previously installed release notes.Borland recommends that you read this file in its entirety.NOTE: If you are updating a localized version of Delphi 7, visit the Borland Registered User web site to obtain a localized readme file that may contain important late- breaking information not included in this readme file.IMPORTANT: Delphi must be closed before installing this update. =====================================================CONTENTS * INSTALLING THIS UPDATE * UPDATING LOCALIZED VERSIONS OF DELPHI 7 * KNOWN ISSUES * ISSUES ADDRESSED BY THIS UPDATE - IDE - CORE DATABASE - DATASNAP - DBGO (ADO COMPONENTS) - dbExpress - dbExpress COMPONENTS AND DB VCL - dbExpress CORE DRIVER AND METADATA - dbExpress VENDOR ISSUES - dbExpress CERTIFICATION - WEB SNAP - ACTIVEX - COMPILER - RTL - VCL - THIRD PARTY - BOLD FOR DELPHI * VERIFYING THAT THE UPDATE WAS SUCCESSFUL * FILES INSTALLED BY THIS UPDATE =======================================================INSTALLING THIS UPDATE* This update can not be applied to Delphi 7 Architect Trial version. * This update can not be removed after it is installed.* You will need the original Delphi 7 installation CD available to install this update.* To install this update from the CD, insert the CD, and launch the d7_ent_upd1.exe file appropriate for your locale.* To install this update from the Web, double-click the self-executing installation file and follow the prompts. * The Delphi 7 documentation PDF files are available on the update CD.========================================================UPDATING LOCALIZED VERSIONS OF DELPHI 7* This update can be applied only to the English version of Delphi 7. There are separate updates for the German, French and Japanese ver

occam一维反演

occam一维反演

C----------------------------------------------------------------------- program runocc C----------------------------------------------------------------------- c C OCCAM 2.0: Steven Constable IGPP/SIO La Jolla CA 92093-0225 c Program Revision 2.01, 13 Jan 1993 c c runocc is the calling program for OCCAM v2.0. C C REFERENCES: CONSTABLE, PARKER & CONSTABLE, 1987: GEOPHYSICS 52, 289-300. C DEGROOT-HEDLIN & CONSTABLE, 1990: GEOPHYSICS 55, 1613-1624. C CONSTABLE, 1991: GEOPHYS. J. INT. 106, 387-388. C CONSTABLE, 1992: OCCAM DISTRIBUTION NOTES. C C REVISION HISTORY: C MARCH 1986, (VERSION 1.2) C OCTOBER 1987, (VERSION 1.3) C AUGUST 1988, (VERSION 1.4) C JANUARY 1989 (WITH THANKS TO C.DEGROOT-HEDLIN), (VERSION 1.5) C SEPTEMBER 1989, (VERSION 1.5.2) C APRIL 1992 (MORE THANKS TO CATHERINE AND ALSO WSE) (VERSION 2.0) C C IF YOU OBTAIN THIS CODE FROM A THIRD PERSON, PLEASE SEND YOUR NAME AND ADDRESS C TO S. CONSTABLE. YOU WILL THEN RECEIVE UPDATES, NEWS ON BUGS, ETC. C C VERSION 2.0 IS A RE-WRITE TO MAKE OCCAM INDEPENDENT OF THE DIMENSIONALITY C OF THE FORWARD PROBLEM, AND TO MAKE MAXIMUM USE OF DYNAMIC MEMORY ALLOCATION, C AS THE ARRAY SIZES FOR THE 2D PROBLEM ARE NOW GETTING TOO LARGE FOR COMFORT. C INCLUDE FILES ARE NOW USED TO STREAMLINE CHANGES OF DIMENSION. C IMPLICIT DOUBLE PRECISION HAS BEEN REMOVED, AGAIN FOR STORAGE REASONS. C CALLING PROGRAM IS NOW AN INTEGRAL PART OF THE PACKAGE AS ALL THE MODEL- C DEPENDENT STUFF HAS BEEN SPUN OFF. C C IF YOU OBTAIN THIS CODE FROM A THIRD PERSON, PLEASE SEND YOUR NAME AND ADDRESS C TO S. CONSTABLE. YOU WILL THEN RECEIVE UPDATES, NEWS ON BUGS, ETC. C C SUBROUTINES WHICH MUST BE SUPPLIED BY THE USER: C C FORMOD(NP,ND,PM,DP,DM), COMPUTES THE FORWARD FUNCTION FOR MODEL PM() AT C THE DATA PARAMETERS DP() AN

C#读取JPEG图片的Exif信息

C#读取JPEG图片的Exif信息

[Serializable] public class EXIF { #region -- Class level members -- // Class level members. private Image _picture; #endregion #region -- Constructors -- // Constructors. /// <summary> /// This is default constructor of the EXIF class. /// </summary> public EXIF() { } /// <summary> /// This is base constructor of the EXIF class. /// </summary> public EXIF(string filePath) { _picture = Image.FromFile(filePath); } #endregion #region -- Public methods -- /// <summary> /// This method returns EXIF property values. /// </summary> /// <param name="exifCode">EXIF property to be returned.</param> public string GetEXIFProperty(Definitions.exifCode exifCode) { // Declare local variables. string returnValue; try { // All of the EXIF properties will return strings to display in the control. // Some of the properties require additional formatting or massaging // of the data once it is returned. Those properties have their own // methods. switch (exifCode) { case Definitions.exifCode.ImageDescription: returnValue = ParsedString(Definitions.exifCode.ImageDescription); break; case Definitions.exifCode.Make: returnValue = ParsedString(Definitions.exifCode.Make); break; case Definitions.exifCode.Model: returnValue = ParsedString(Definitions.exifCode.Model); break; case Definitions.exifCode.Orientation: returnValue = Orientation(); break; case Definitions.exifCode.XResolution: returnValue = ParseResolution(Definitions.exifCode.XResolution); break; case Definitions.exifCode.YResolution: returnValue = ParseResolution(Definitions.exifCode.YResolution); break; case Definitions.exifCode.ResolutionUnit: returnValue = ResolutionUnit(); break; case Definitions.exifCode.Software: returnValue = ParsedString(Definitions.exifCode.Software); break; case Definitions.exifCode.DateTime: returnValue = ParsedDate(Definitions.exifCode.DateTime).ToString(); break; case Definitions.exifCode.WhitePoint: returnValue = WhitePoint(); break; case Definitions.exifCode.PrimaryChromaticities: returnValue = PrimaryChromaticities(); break; case Definitions.exifCode.YCbCrCoefficients: returnValue = YCbCrCoefficients(); break; case Definitions.exifCode.YCbCrPositioning: returnValue = YCbCrPositioning(); break; case Definitions.exifCode.ReferenceBlackWhite: returnValue = ReferenceBlackWhite(); break; case Definitions.exifCode.Copyright: returnValue = ParsedString(Definitions.exifCode.Copyright); break; case Definitions.exifCode.ExposureTime: returnValue = ExposureTime(); break; case Definitions.exifCode.FNumber: returnValue = FNumber(); break; case Definitions.exifCode.ExposureProgram: returnValue = ExposureProgram(); break; case Definitions.exifCode.ISOSpeedRatings: returnValue = UnformattedShort(Definitions.exifCode.ISOSpeedRatings); break; case Definitions.exifCode.ExifVersion: returnValue = ParsedString(Definitions.exifCode.ExifVersion); break; case Definitions.exifCode.DateTimeOriginal: returnValue = ParsedDate(Definitions.exifCode.DateTimeOriginal).ToString(); break; case Definitions.exifCode.DateTimeDigitized: returnValue = ParsedDate(Definitions.exifCode.DateTimeDigitized).ToString(); break; case Definitions.exifCode.ComponentsConfiguration: returnValue = ComponentsConfiguration(); break; case Definitions.exifCode.CompressedBitsPerPixel: returnValue = CompressedBitsPerPixel(); break; case Definitions.exifCode.ShutterSpeedValue: returnValue = ShutterSpeedValue(); break; case Definitions.exifCode.ApertureValue: returnValue = ApertureValue(); break; case Definitions.exifCode.BrightnessValue: returnValue = BrightnessValue(); break; case Definitions.exifCode.ExposureBiasValue: returnValue = ExposureBiasValue(); break; case Definitions.exifCode.MaxApertureValue: returnValue = MaxApertureValue(); break; case Definitions.exifCode.SubjectDistance: returnValue = SubjectDistance(); break; case Definitions.exifCode.MeteringMode: returnValue = MeteringMode(); break; case Definitions.exifCode.LightSource: returnValue = LightSource(); break; case Definitions.exifCode.Flash: returnValue = Flash(); break; case Definitions.exifCode.FocalLength: returnValue = FocalLength(); break; case Definitions.exifCode.MakerNote: returnValue = MakerNote(); break; case Definitions.exifCode.UserComment: returnValue = ParsedString(Definitions.exifCode.UserComment); break; case Definitions.exifCode.SubsecTime: returnValue = ParsedString(Definitions.exifCode.SubsecTime); break; case Definitions.exifCode.SubsecTimeOriginal: returnValue = ParsedString(Definitions.exifCode.SubsecTimeOriginal); break; case Definitions.exifCode.SubsecTimeDigitized: returnValue = ParsedString(Definitions.exifCode.SubsecTimeDigitized); break; case Definitions.exifCode.FlashpixVersion: returnValue = ParsedString(Definitions.exifCode.FlashpixVersion); break; case Definitions.exifCode.ColorSpace: returnValue = ColorSpace(); break; case Definitions.exifCode.RelatedSoundFile: returnValue = ParsedString(Definitions.exifCode.RelatedSoundFile); break; case Definitions.exifCode.FocalPlaneXResolution: returnValue = FocalPlaneXResolution(); break; case Definitions.exifCode.FocalPlaneYResolution: returnValue = FocalPlaneYResolution(); break; case Definitions.exifCode.FocalPlaneResolutionUnit: returnValue = ResolutionUnit(); break; case Definitions.exifCode.ExposureIndex: returnValue = ExposureIndex(); break; case Definitions.exifCode.SensingMethod: returnValue = SensingMethod(); break; case Definitions.exifCode.FileSource: returnValue = FileSource(); break; case Definitions.exifCode.SceneType: returnValue = SceneType(); break; case Definitions.exifCode.CFAPattern: returnValue = ParsedString(Definitions.exifCode.CFAPattern); break; case Definitions.exifCode.InteroperabilityIndex: returnValue = ParsedString(Definitions.exifCode.InteroperabilityIndex); break; case Definitions.exifCode.ImageWidth: returnValue = UnformattedShort(Definitions.exifCode.ImageWidth); break; case Definitions.exifCode.ImageLength: returnValue = UnformattedShort(Definitions.exifCode.ImageLength); ; break; case Definitions.exifCode.BitsPerSample: returnValue = BitsPerSample(); break; case Definitions.exifCode.Compression: returnValue = Compression(); break; case Definitions.exifCode.PhotometricInterpretation: returnValue = PhotometricInterpretation(); break; case Definitions.exifCode.StripOffsets: returnValue = StripOffsets(); break; case Definitions.exifCode.SamplesPerPixel: returnValue = UnformattedShort(Definitions.exifCode.SamplesPerPixel); break; case Definitions.exifCode.RowsPerStrip: returnValue = UnformattedShort(Definitions.exifCode.RowsPerStrip); break; case Definitions.exifCode.StripByteCounts: returnValue = StripByteCounts(); break; case Definitions.exifCode.PlanarConfiguration: returnValue = PlanarConfiguration(); break; case Definitions.exifCode.YCbCrSubSampling: returnValue = YCbCrSubSampling(); break; case Definitions.exifCode.ImageUniqueID: returnValue = ParsedString(Definitions.exifCode.ImageUniqueID); break; case Definitions.exifCode.JPEGInterchangeFormatLength: returnValue = UnformattedShort(Definitions.exifCode.JPEGInterchangeFormatLength); break; case Definitions.exifCode.TransferFunction: returnValue = "Not implemented."; break; case Definitions.exifCode.PixelXDimension: returnValue = UnformattedShort(Definitions.exifCode.PixelXDimension); break; case Definitions.exifCode.PixelYDimension: returnValue = UnformattedShort(Definitions.exifCode.PixelYDimension); break; case Definitions.exifCode.SpectralSensitivity: returnValue = ParsedString(Definitions.exifCode.SpectralSensitivity); break; case Definitions.exifCode.OECF: returnValue = ParsedString(Definitions.exifCode.OECF); break; case Definitions.exifCode.CustomRendered: returnValue = CustomRendered(); break; case Definitions.exifCode.ExposureMode: returnValue = ExposureMode(); break; case Definitions.exifCode.WhiteBalance: returnValue = WhiteBalance(); break; case Definitions.exifCode.DigitalZoomRatio: returnValue = DigitalZoomRatio(); break; case Definitions.exifCode.FocalLengthIn35mmFilm: returnValue = FocalLengthIn35mmFilm(); break; case Definitions.exifCode.SceneCaptureType: returnValue = SceneCaptureType(); break; case Definitions.exifCode.GainControl: returnValue = GainControl(); break; case Definitions.exifCode.Contrast: returnValue = Contrast(); break; case Definitions.exifCode.Saturation: returnValue = Saturation(); break; case Definitions.exifCode.Sharpness: returnValue = Sharpness(); break; case Definitions.exifCode.DeviceSettingDescription: returnValue = ParsedString(Definitions.exifCode.DeviceSettingDescription); break; case Definitions.exifCode.SubjectDistanceRange: returnValue = SubjectDistanceRange(); break; default: returnValue = "EXIF property not found."; break; } return returnValue; } catch { return "N/A"; } } #endregion #region -- EXIF Methods -- /// <summary> /// This method returns the bits per sample EXIF property. /// </summary> private string BitsPerSample() { //Declare local variables. string returnValue = "EXIF property not found."; byte[] data = GetPropertyValue(Definitions.exifCode.BitsPerSample); //Translate the EXIF code into a readable value. if (!data.Equals(null)) { returnValue = data[0].ToString() + " " + data[1].ToString() + " " + data[2].ToString(); } return returnValue; } /// <summary> /// This method returns the compression EXIF property. /// </summary> private string Compression() { //Declare local variables. string returnValue = "EXIF property not found."; byte[] data = GetPropertyValue(Definitions.exifCode.Compression); //Translate the EXIF code into a readable value. if (!data.Equals(null)) { switch (data[0]) { case 1: returnValue = "uncompressed"; break; case 6: returnValue = "JPEG compression (thumbnails only)"; break; default: returnValue = "reserved"; break; } } return returnValue; } /// <summary> /// This method returns the photometric interpretation EXIF property. /// </summary> private string PhotometricInterpretation() { //Declare local variables. string returnValue = "EXIF property not found."; byte[] data = GetPropertyValue(Definitions.exifCode.PhotometricInterpretation); //Translate the EXIF code into a readable value. if (data != null) { switch (data[0]) { case 2: returnValue = "RBG"; break; case 6: returnValue = "YCbCr"; break; default: returnValue = "reserved"; break; } } return returnValue; } /// <summary> /// This method returns the strip offsets EXIF property. /// </summary> private string StripOffsets() { return "Not implemented."; } /// <summary> /// This method returns the strip byte counts EXIF property. /// </summary> private string StripByteCounts() { return "Not implemented."; } /// <summary> /// This method returns the planar configuration EXIF property. /// </summary> private string PlanarConfiguration() { //Declare local variables. string returnValue = "EXIF property not found."; byte[] data = GetPropertyValue(Definitions.exifCode.PlanarConfiguration); //Translate the EXIF code into a readable value. if (data != null) { switch (data[0]) { case 1: returnValue = "chunky format"; break; case 2: returnValue = "planar format"; break; default: returnValue = "reserved"; break; } } return returnValue; } /// <summary> /// This method returns the YCbCr subsampling EXIF property. /// </summary> private string YCbCrSubSampling() { //Declare local variables. string returnValue = "EXIF property not found."; byte[] data = GetPropertyValue(Definitions.exifCode.YCbCrSubSampling); //Translate the EXIF code into a readable value. if (data != null) { switch (data[0]) { case 2: if (data[1] == 1) { returnValue = "YCbCr4:2:2"; } else { returnValue = "YCbCr4:2:0"; } break; default: returnValue = "reserved"; break; } } return returnValue; } /// <summary> /// This method returns the orientation EXIF property. /// </summary> private string Orientation() { //Declare local variables. string returnValue = "EXIF property not found."; byte[] data = GetPropertyValue(Definitions.exifCode.Orientation); //Translate the EXIF code into a readable value. if (data.Length > 0) { switch (data[0]) { case 1: returnValue = "The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side."; break; case 2: returnValue = "The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side."; break; case 3: returnValue = "The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side."; break; case 4: returnValue = "The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side."; break; case 5: returnValue = "The 0th row is at the visual left-hand side of the image, and the 0th column is the visual top."; break; case 6: returnValue = "The 0th row is at the visual right-hand side of the image, and the 0th column is the visual top."; break; case 7: returnValue = "The 0th row is at the visual right-hand side of the image, and the 0th column is the visual bottom."; break; case 8: returnValue = "The 0th row is at the visual left-hand side of the image, and the 0th column is the visual bottom."; break; default: returnValue = "Other"; break; } } return returnValue; } /// <summary> /// This method returns the resolution unit EXIF property. /// </summary> private string ResolutionUnit() { //Declare local variables. string returnValue = "EXIF property not found."; byte[] resUnit = GetPropertyValue(Definitions.exifCode.ResolutionUnit); //Translate the EXIF code into a readable value. if (resUnit != null) { switch (resUnit[0]) { case 2: returnValue = "inches"; break; case 3: returnValue = "centimeters"; break; default: returnValue = "reserved"; break; } } return returnValue; } /// <summary> /// This method returns the white point EXIF property. /// </summary> private string WhitePoint() { string returnValue = "EXIF property not found."; EXIFRational[] data = ParsedRationalArray(Definitions.exifCode.WhitePoint); if (data.Length > 0) { returnValue = data[0].Denominator.ToString() + ", " + data[1].Denominator.ToString(); } return returnValue; } /// <summary> /// This method returns the primary chromaticities EXIF property. /// </summary> private string PrimaryChromaticities() { string returnValue = "EXIF property not found."; EXIFRational[] data = ParsedRationalArray(Definitions.exifCode.PrimaryChromaticities); if (data.Length > 0) { returnValue = data[0].Denominator.ToString() + ", " + data[1].Denominator.ToString() + ", " + data[2].Denominator.ToString() + ", " + data[3].Denominator.ToString() + ", " + data[4].Denominator.ToString() + ", " + data[5].Denominator.ToString(); } return returnValue; } /// <summary> /// This method returns the YCbCr coefficients EXIF property. /// </summary> private string YCbCrCoefficients() { string returnValue = "EXIF property not found."; EXIFRational[] data = ParsedRationalArray(Definitions.exifCode.YCbCrCoefficients); if (data.Length > 0) { returnValue = data[0].Denominator.ToString() + ", " + data[1].Denominator.ToString() + ", " + data[2].Denominator.ToString(); } return returnValue; } /// <summary> /// This method returns the YCbCr positioning EXIF property. /// </summary> private string YCbCrPositioning() { //Declare local variables. string returnValue = ""; byte[] data = GetPropertyValue(Definitions.exifCode.YCbCrPositioning); //Translate the EXIF code into a readable value. if (data.Length > 0) { switch (data[0]) { case 1: returnValue = "centered"; break; case 2: returnValue = "co-sited"; break; default: returnValue = "reserved"; break; } } else { returnValue = "EXIF property not found."; } return returnValue; } /// <summary> /// This method returns the reference black white EXIF property. /// </summary> private string ReferenceBlackWhite() { string returnValue = "EXIF property not found."; EXIFRational[] data = ParsedRationalArray(Definitions.exifCode.ReferenceBlackWhite); if (data.Length > 0) { returnValue = "[" + data[0].Denominator.ToString() + ", " + data[1].Denominator.ToString() + ", " + data[2].Denominator.ToString() + ", " + data[3].Denominator.ToString() + ", " + data[4].Denominator.ToString() + ", " + data[5].Denominator.ToString() + "]"; } return returnValue; } /// <summary> /// This method returns the exposure time EXIF property. /// </summary> private string ExposureTime() { //Declare local variables. string returnValue = "EXIF property not found."; EXIFRational exposureTime = ParsedRational(Definitions.exifCode.ExposureTime); //Translate the EXIF code into a readable value. if (!exposureTime.Equals(null)) { if (exposureTime.Numerator == 0 && exposureTime.Denominator == 0) { returnValue = "N/A"; } else { returnValue = string.Format("{0}/{1} s", exposureTime.Numerator, exposureTime.Denominator); } } else { returnValue = "N/A"; } return returnValue; } /// <summary> /// This method returns the FNumber EXIF property. /// </summary> private string FNumber() { //Declare local variables. string returnValue = "EXIF property not found."; EXIFRational fNumber = ParsedRational(Definitions.exifCode.FNumber); //Translate the EXIF code into a readable value. if (!fNumber.Equals(null)) { returnValue = string.Format("f{0}", (float)(fNumber.Numerator / fNumber.Denominator)); } return returnValue; } /// <summary> /// This method returns the exposure program EXIF property. /// </summary> private string ExposureProgram() { //Declare local variables. string returnValue = "EXIF property not found."; byte[] data = GetPropertyValue(Definitions.exifCode.ExposureProgram); //Translate the EXIF code into a readable value. if (data.Length > 0) { switch (data[0]) { case 0: returnValue = "Not defined"; break; case 1: returnValue = "Manual"; break; case 2: returnValue = "Normal program"; break; case 3: returnValue = "Aperture priority"; break; case 4: returnValue = "Shutter priority"; break; case 5: returnValue = "Creative program (biased toward depth of field)"; break; case 6: returnValue = "Action program (biased toward fast shutter speed)"; break; case 7: returnValue = "Portrait mode (for closeup photos with the background out of focus)"; break; case 8: returnValue = "Landscape mode (for landscape photos with the background in focus)"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the components configuration EXIF property. /// </summary> private string ComponentsConfiguration() { //Declare local variables. string returnValue = "EXIF property not found."; byte[] data = GetPropertyValue(Definitions.exifCode.ComponentsConfiguration); switch (data[0]) { case 1: returnValue = "YCbCr"; break; case 4: returnValue = "RGB"; break; default: returnValue = "Reserved"; break; } return returnValue; } /// <summary> /// This method returns the compressed bits per pixel EXIF property. /// </summary> // This method needs to fixed to return the correct value. private string CompressedBitsPerPixel() { //Declare local variables. string returnValue = "EXIF property not found."; EXIFRational cbpp = ParsedRational(Definitions.exifCode.CompressedBitsPerPixel); //Translate the EXIF code into a readable value. if (!cbpp.Equals(null)) { returnValue = string.Format("{0}/{1}", cbpp.Numerator, cbpp.Denominator); } return returnValue; } /// <summary> /// This method returns the aperture value EXIF property. /// </summary> private string ApertureValue() { //Declare local variables. string returnValue = "EXIF property not found."; EXIFRational fNumber = ParsedRational(Definitions.exifCode.FNumber); //Translate the EXIF code into a readable value. if (!fNumber.Equals(null)) { double av = Math.Round(2 * Math.Log(((fNumber.Numerator / fNumber.Denominator)), 2.00)); returnValue = string.Format("f{0}", (double)av); } return returnValue; } /// <summary> /// This method returns the shutter speed value EXIF property. /// </summary> private string ShutterSpeedValue() { //Declare local variables. string returnValue = "EXIF property not found."; returnValue = ExposureTime(); return returnValue; } /// <summary> /// This method returns the subject distance EXIF property. /// </summary> private string SubjectDistance() { //Declare local variables. string returnValue = "EXIF property not found."; EXIFRational sd = ParsedRational(Definitions.exifCode.SubjectDistance); //Translate the EXIF code into a readable value. if (!sd.Equals(null)) { returnValue = string.Format("{0}", sd.Numerator); } return returnValue; } /// <summary> /// This method returns the metering mode EXIF property. /// </summary> private string MeteringMode() { //Declare local variables. string returnValue = "EXIF property not found."; byte[] data = GetPropertyValue(Definitions.exifCode.MeteringMode); //Translate the EXIF code into a readable value. if (data.Length > 0) { switch (data[0]) { case 0: returnValue = "Unknown"; break; case 1: returnValue = "Average"; break; case 2: returnValue = "CenterWeightedAverage"; break; case 3: returnValue = "Spot"; break; case 4: returnValue = "MultiSpot"; break; case 5: returnValue = "Pattern"; break; case 6: returnValue = "Partial"; break; case 255: returnValue = "Other"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the light source EXIF property. /// </summary> private string LightSource() { //Declare local variables. string returnValue = "EXIF property not found."; byte[] data = GetPropertyValue(Definitions.exifCode.LightSource); //Translate the EXIF code into a readable value. if (data.Length > 0) { switch (data[0]) { case 1: returnValue = "Daylight"; break; case 2: returnValue = "Fluorescent"; break; case 3: returnValue = "Tungsten (incandescent light)"; break; case 4: returnValue = "Flash"; break; case 9: returnValue = "Fine weather"; break; case 10: returnValue = "Cloudy weather"; break; case 11: returnValue = "Shade"; break; case 12: returnValue = "Daylight fluorescent (D 5700 - 7100K)"; break; case 13: returnValue = "Day white fluorescent (N 4600 - 5400K)"; break; case 14: returnValue = "Cool white fluorescent (W 3900 - 4500K)"; break; case 15: returnValue = "White fluorescent (WW 3200 - 3700K)"; break; case 17: returnValue = "Standard light A"; break; case 18: returnValue = "Standard light B"; break; case 19: returnValue = "Standard light C"; break; case 20: returnValue = "D55"; break; case 21: returnValue = "D65"; break; case 22: returnValue = "D75."; break; case 23: returnValue = "D50"; break; case 24: returnValue = "ISO studio tungsten"; break; case 255: returnValue = "other light source"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the flash EXIF property. /// </summary> private string Flash() { //Declare local variables. string returnValue = "EXIF property not found."; byte[] data = GetPropertyValue(Definitions.exifCode.Flash); //Translate the EXIF code into a readable value. if (data.Length > 0) { switch (data[0]) { case 0: returnValue = "Flash did not fire."; break; case 1: returnValue = "Flash fired."; break; case 5: returnValue = "Strobe return light not detected."; break; case 7: returnValue = "Strobe return light detected."; break; case 9: returnValue = "Flash fired, compulsory flash mode."; break; case 13: returnValue = "Flash fired, compulsory flash mode, return light not detected."; break; case 15: returnValue = "Flash fired, compulsory flash mode, return light detected."; break; case 16: returnValue = "Flash did not fire, compulsory flash mode."; break; case 24: returnValue = "Flash did not fire, auto mode."; break; case 25: returnValue = "Flash fired, auto mode."; break; case 29: returnValue = "Flash fired, auto mode, return light not detected."; break; case 31: returnValue = "Flash fired, auto mode, return light detected."; break; case 32: returnValue = "No flash function."; break; case 65: returnValue = "Flash fired, red-eye reduction mode."; break; case 69: returnValue = "Flash fired, red-eye reduction mode, return light not detected."; break; case 71: returnValue = "Flash fired, red-eye reduction mode, return light detected."; break; case 73: returnValue = "Flash fired, compulsory flash mode, red-eye reduction mode."; break; case 77: returnValue = "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected."; break; case 79: returnValue = "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected."; break; case 89: returnValue = "Flash fired, auto mode, red-eye reduction mode."; break; case 93: returnValue = "Flash fired, auto mode, return light not detected, red-eye reduction mode."; break; case 95: returnValue = "Flash fired, auto mode, return light detected, red-eye reduction mode."; break; default: returnValue = "Not defined, reserved."; break; } } return returnValue; } /// <summary> /// This method returns the focal length EXIF property. /// </summary> private string FocalLength() { //Declare local variables. string returnValue = "EXIF property not found."; EXIFRational focalLength = ParsedRational(Definitions.exifCode.FocalLength); //Translate the EXIF code into a readable value. if (!focalLength.Equals(null)) { if (focalLength.Numerator == 0 && focalLength.Denominator == 0) { returnValue = "N/A"; } else { returnValue = string.Format("{0:N0} mm", focalLength.Numerator * 1.0 / focalLength.Denominator); } } return returnValue; } /// <summary> /// This method returns the maker note EXIF property. /// </summary> private string MakerNote() { return "Not implemented."; } /// <summary> /// This method returns the color space EXIF property. /// </summary> private string ColorSpace() { //Declare local variables. string returnValue = "EXIF property not found."; byte[] data = GetPropertyValue(Definitions.exifCode.ColorSpace); //Translate the EXIF code into a readable value. if (data.Length > 0) { switch (data[0]) { case 1: returnValue = "sRGB"; break; case 255: returnValue = "Uncalibrated"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the focal plane x resolution EXIF property. /// </summary> private string FocalPlaneXResolution() { //Declare local variables. string returnValue = "EXIF property not found."; EXIFRational focalPlaneXRes = ParsedRational(Definitions.exifCode.FocalPlaneXResolution); //Translate the EXIF code into a readable value. if (!focalPlaneXRes.Equals(null)) { returnValue = string.Format("{0:N0} mm", (focalPlaneXRes.Numerator * 1.0 / focalPlaneXRes.Denominator)); } return returnValue; } /// <summary> /// This method returns the focal plane y resolution EXIF property. /// </summary> private string FocalPlaneYResolution() { //Declare local variables. string returnValue = "EXIF property not found."; EXIFRational focalPlaneYRes = ParsedRational(Definitions.exifCode.FocalPlaneYResolution); //Translate the EXIF code into a readable value. if (!focalPlaneYRes.Equals(null)) { returnValue = string.Format("{0:N0} mm", focalPlaneYRes.Numerator * 1.0 / focalPlaneYRes.Denominator); } return returnValue; } /// <summary> /// This method returns the exposure index EXIF property. /// </summary> private string ExposureIndex() { //Declare local variables. string returnValue = "EXIF property not found."; EXIFRational expIndex = ParsedRational(Definitions.exifCode.ExposureIndex); //Translate the EXIF code into a readable value. if (!expIndex.Equals(null)) { returnValue = string.Format("{0:N0} mm", expIndex.Numerator * 1.0 / expIndex.Denominator); } return returnValue; } /// <summary> /// This method returns the sensing method EXIF property. /// </summary> private string SensingMethod() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.SensingMethod); string returnValue = "EXIF property not found."; if (data.Length > 0) { switch (data[0]) { case 1: returnValue = "Not defined."; break; case 2: returnValue = "One-chip color area sensor."; break; case 3: returnValue = "Two-chip color area sensor."; break; case 4: returnValue = "Three-chip color area sensor."; break; case 5: returnValue = "Color sequential area sensor."; break; case 7: returnValue = "Trilinear sensor."; break; case 8: returnValue = "Color sequential linear sensor"; break; default: returnValue = "Reserved."; break; } } return returnValue; } /// <summary> /// This method returns the file source EXIF property. /// </summary> private string FileSource() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.FileSource); string returnValue = "EXIF property not found."; if (data.Length > 0) { switch (data[0]) { case 3: returnValue = "DSC"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the scene type EXIF property. /// </summary> private string SceneType() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.FileSource); string returnValue = "EXIF property not found."; if (data.Length > 0) { switch (data[0]) { case 1: returnValue = "A directly photographed image."; break; default: returnValue = "Reserved."; break; } } return returnValue; } /// <summary> /// This method returns the custom rendered EXIF property. /// </summary> private string CustomRendered() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.CustomRendered); string returnValue = "EXIF property not found."; if (data.Length > 0) { switch (data[0]) { case 0: returnValue = "Normal process"; break; case 1: returnValue = "Custom process"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the exposure mode EXIF property. /// </summary> private string ExposureMode() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.ExposureMode); string returnValue = "EXIF property not found."; if (data.Length > 0) { switch (data[0]) { case 0: returnValue = "Auto exposure"; break; case 1: returnValue = "Manual exposure"; break; case 2: returnValue = "Auto bracket"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the white balance EXIF property. /// </summary> private string WhiteBalance() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.WhiteBalance); string returnValue = "EXIF property not found."; if (data.Length > 0) { switch (data[0]) { case 0: returnValue = "Auto white balance"; break; case 1: returnValue = "Manual white balance"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the focal length in 35mm film EXIF property. /// </summary> private string FocalLengthIn35mmFilm() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.FocalLengthIn35mmFilm); string returnValue = "EXIF property not found."; if (data.Length > 0) { if (data[0] == 0) { returnValue = "Unknown"; } else if (data[0].ToString().Trim() == "NaN") { returnValue = "N/A"; } else { returnValue = data[0].ToString() + "mm"; } } return returnValue; } /// <summary> /// This method returns the scene capture type EXIF property. /// </summary> private string SceneCaptureType() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.SceneCaptureType); string returnValue = "EXIF property not found."; if (data.Length > 0) { switch (data[0]) { case 0: returnValue = "Standard"; break; case 1: returnValue = "Landscape"; break; case 2: returnValue = "Portrait"; break; case 3: returnValue = "Night scene"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the gain control EXIF property. /// </summary> private string GainControl() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.GainControl); string returnValue = "EXIF property not found."; if (data.Length > 0) { switch (data[0]) { case 0: returnValue = "None"; break; case 1: returnValue = "Low gain up"; break; case 2: returnValue = "High gain up"; break; case 3: returnValue = "Low gain down"; break; case 4: returnValue = "High gain down"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the contrast EXIF property. /// </summary> private string Contrast() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.Contrast); string returnValue = "EXIF property not found."; if (data.Length > 0) { switch (data[0]) { case 0: returnValue = "Normal"; break; case 1: returnValue = "Soft"; break; case 2: returnValue = "Hard"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the saturation EXIF property. /// </summary> private string Saturation() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.Saturation); string returnValue = "EXIF property not found."; if (data.Length > 0) { switch (data[0]) { case 0: returnValue = "Normal"; break; case 1: returnValue = "Low saturation"; break; case 2: returnValue = "High saturation"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the sharpness EXIF property. /// </summary> private string Sharpness() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.Sharpness); string returnValue = "EXIF property not found."; if (data.Length > 0) { switch (data[0]) { case 0: returnValue = "Normal"; break; case 1: returnValue = "Soft"; break; case 2: returnValue = "Hard"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the subject distance range EXIF property. /// </summary> private string SubjectDistanceRange() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.SubjectDistanceRange); string returnValue = "EXIF property not found."; if (data.Length > 0) { switch (data[0]) { case 0: returnValue = "Unknown"; break; case 1: returnValue = "Macro"; break; case 2: returnValue = "Close view"; break; case 3: returnValue = "Distant view"; break; default: returnValue = "Reserved"; break; } } return returnValue; } /// <summary> /// This method returns the subject location EXIF property. /// </summary> private string SubjectLocation() { // Declare local variables. // Get the value for this EXIF property. byte[] data = GetPropertyValue(Definitions.exifCode.SubjectLocation); string returnValue = "EXIF property not found."; if (data.Length > 0) { returnValue = "(" + data[0].ToString() + ", " + data[1].ToString() + ")"; } return returnValue; } /// <summary> /// This method returns the digital zoom ratio EXIF property. /// </summary> private string DigitalZoomRatio() { //Declare local variables. string returnValue = "EXIF property not found."; EXIFRational dzr = ParsedRational(Definitions.exifCode.DigitalZoomRatio); //Translate the EXIF code into a readable value. if (!dzr.Equals(null)) { returnValue = dzr.Numerator.ToString() + ":" + dzr.Denominator.ToString(); } return returnValue; } /// <summary> /// This method returns the brightness value EXIF property. /// </summary> private string BrightnessValue() { //Declare local variables. string returnValue = "EXIF property not found."; EXIFRational data = ParsedRational(Definitions.exifCode.DigitalZoomRatio); //Translate the EXIF code into a readable value. if (!data.Equals(null)) { if ((long)data.Numerator >= Int32.MaxValue) { returnValue = "Unknown"; } else { returnValue = Math.Log(data.Numerator / data.Denominator, 2.0).ToString(); } } return returnValue; } /// <summary> /// This method returns the max aperture value EXIF property. /// </summary> private string MaxApertureValue() { //Declare local variables. string returnValue = "EXIF property not found."; EXIFRational data = ParsedRational(Definitions.exifCode.MaxApertureValue); //Translate the EXIF code into a readable value. if (!data.Equals(null)) { returnValue = string.Format("f{0}", (double)(data.Numerator / data.Denominator)); } return returnValue; } /// <summary> /// This method returns the exposure bias value EXIF property. /// </summary> private string ExposureBiasValue() { //Declare local variables. string returnValue = "EXIF property not found."; EXIFRational data = ParsedRational(Definitions.exifCode.ExposureBiasValue); //Translate the EXIF code into a readable value. if (!data.Equals(null)) { returnValue = string.Format("f{0}", (double)(data.Numerator / data.Denominator)); } return returnValue; } #endregion #region -- Private helper functions -- // Private helper functions. /// <summary> /// This method retrieves the data from the propery items collection. /// </summary> private byte[] GetPropertyValue(Definitions.exifCode exifCode) { return _picture.GetPropertyItem((int)exifCode).Value; } /// <summary> /// This method returns string EXIF data. /// </summary> private string ParsedString(Definitions.exifCode exifCode) { // Declare local variables. // Retrieve the data for this EXIF property. byte[] data = GetPropertyValue(exifCode); // Holds the return value. string parsed = ""; // If there's data, go ahead and parse it. if (data.Length > 1) { // Allocate some memory. IntPtr h = Marshal.AllocHGlobal(data.Length); int i = 0; foreach (byte b in data) { Marshal.WriteByte(h, i, b); i++; } parsed = Marshal.PtrToStringAnsi(h); Marshal.FreeHGlobal(h); } return parsed; } /// <summary> /// This method returns rational EXIF data. /// </summary> private EXIFRational ParsedRational(Definitions.exifCode exifCode) { // Declare local variables. // Retrieve the data for this EXIF property. byte[] data = GetPropertyValue(exifCode); // Parse the data. EXIFRational parsed = new EXIFRational(data); return parsed; } /// <summary> /// This method returns an array of rational EXIF data. /// </summary> private EXIFRational[] ParsedRationalArray(Definitions.exifCode exifCode) { // Declare local variables. // Retrieve the data for this EXIF property. byte[] data = GetPropertyValue(exifCode); // Holds the return value. EXIFRational[] parsed = null; int arraySize = (data.Length / 8); if (arraySize > 0) { parsed = new EXIFRational[arraySize]; for (int i = 0; i < arraySize; i++) { parsed[i] = new EXIFRational(data, i * 8); } } return parsed; } /// <summary> /// This method returns date/time EXIF data. /// </summary> private DateTime ParsedDate(Definitions.exifCode exifCode) { // Declare local variables. // Create a new date object. DateTime ret = new DateTime(1900, 1, 1, 0, 0, 0); // Parse the data. string date = ParsedString(exifCode); // Format the data. if (date.Length >= 19) {

jsp探针  ver0.1

jsp探针 ver0.1

jsp探针ceshi.jsp <%@ page contentType="text/html; charset=gb2312" %> <% class LfSpy { boolean supportHibernate = false; boolean supportJNDI = false; boolean supportJavaxSql = false; boolean supportJAF = false; boolean supportMail = false; boolean supportBeanUtils = false; boolean supportCommonLogging = false; boolean supportCommonCodec = false; boolean supportCommonCollection = false; boolean supportCommonDigester = false; boolean supportCommonLang = false; boolean supportJakartaRegExp = false; boolean supportLucene = false; boolean supportDom4j = false; boolean supportLoonframework = false; boolean supportMmMysqlDriver = false; boolean supportComMysqlDriver = false; boolean supportImageProcessing = false; boolean supportStruts = false; boolean supportSpring = false; String serverName; String serverIP="127.0.0.1"; long startTime = System.currentTimeMillis(); long startMemory = Runtime.getRuntime().freeMemory(); java.util.Properties prop = System.getProperties(); String javaVersion=prop.getProperty("java.version"); String FS=prop.getProperty("file.separator"); int CPUTIME = 30; int PERCENT = 100; public LfSpy() { try { Class.forName("org.springframework.context.ApplicationContext"); supportSpring = true; } catch (ClassNotFoundException ex) { } try { Class.forName("org.loon.framework.Loon"); supportLoonframework = true; } catch (ClassNotFoundException ex) { } try { Class.forName("org.hibernate.Transaction"); supportHibernate = true; } catch (ClassNotFoundException ex) { } try { Class.forName("org.apache.struts.action.ActionServlet"); supportStruts = true; } catch (ClassNotFoundException ex) { } try { Class.forName("javax.naming.Name"); supportJNDI = true; } catch (ClassNotFoundException ex) { } try { Class.forName("javax.sql.DataSource"); supportJavaxSql = true; } catch (ClassNotFoundException ex) { } try { Class.forName("javax.activation.DataSource"); supportJAF = true; } catch (ClassNotFoundException ex) { } try { Class.forName("javax.mail.Message"); supportMail = true; } catch (ClassNotFoundException ex) { } try { Class.forName("org.apache.commons.beanutils.MethodUtils"); supportBeanUtils = true; } catch (ClassNotFoundException ex) { } try { Class.forName("org.apache.commons.logging.LogFactory"); supportCommonLogging = true; } catch (ClassNotFoundException ex) { } try { Class.forName("org.apache.commons.codec.Decoder"); supportCommonCodec = true; } catch (ClassNotFoundException ex) { } try { Class.forName("org.apache.commons.collections.ArrayStack"); supportCommonCollection = true; } catch (ClassNotFoundException ex) { } try { Class.forName("org.apache.commons.digester.Digester"); supportCommonDigester = true; } catch (ClassNotFoundException ex) { } try { Class.forName("org.apache.commons.lang.SystemUtils"); supportCommonLang = true; } catch (ClassNotFoundException ex) { } try { Class.forName("org.apache.regexp.RE"); supportJakartaRegExp = true; } catch (ClassNotFoundException ex) { } try { Class.forName("org.apache.lucene.index.IndexWriter"); supportLucene = true; } catch (ClassNotFoundException ex) { } try { Class.forName("org.dom4j.Document"); supportDom4j = true; } catch (ClassNotFoundException ex) { } try { Class.forName("org.gjt.mm.mysql.Driver"); supportMmMysqlDriver = true; } catch (ClassNotFoundException ex) { } try { Class.forName("com.mysql.jdbc.Driver"); supportComMysqlDriver = true; } catch (ClassNotFoundException ex) { } loadAddress(); try { java.awt.image.BufferedImage bufferedImage = new java.awt.image.BufferedImage( 10, 10, java.awt.image.BufferedImage.TYPE_INT_RGB); java.awt.Graphics2D g = bufferedImage.createGraphics(); g.drawLine(0, 0, 10, 10); g.dispose(); supportImageProcessing = true; } catch (Throwable ex) { } } public String getOSarch(){ return prop.getProperty("os.arch"); } public String getTimeZone(){ return prop.getProperty("user.timezone"); } public String getNowUser(){ return prop.getProperty("user.name"); } public String getNowUserDir(){ return prop.getProperty("user.dir"); } public String getOSName(){ return prop.getProperty("os.name"); } public String getSystemModel(){ return prop.getProperty("sun.arch.data.model"); } final private long getDiskForLinuxInfo(final String dirPath) { try { String dir = dirPath.startsWith("/") ? dirPath : "/"+dirPath; long space = -1; Process process; Runtime run = Runtime.getRuntime(); String osName = System.getProperty("os.name").toLowerCase(); String command = ""; if (osName.startsWith("linux")) { command = "df -k " + dir; } process = run.exec(command); java.io.BufferedReader in = new java.io.BufferedReader(new java.io.InputStreamReader( process.getInputStream())); String freeSpace = "", line; while ((line = in.readLine()) != null) { if (line.length() > 0) { freeSpace = line; } } if (freeSpace == null || freeSpace.length() == 0) { return -1; } process.destroy(); freeSpace = freeSpace.trim().replaceAll("\\\\", "\\/"); String[] results = freeSpace.split(" "); for (int i = results.length - 1; i > 0; i--) { try { space = Long.parseLong(results[i]); return space; } catch (NumberFormatException ex) { continue; } } } catch (java.io.IOException e) { return -1; } return -1; } /** * 获得windows下指定地址硬盘空间大小 * * @param dirPath * @return */ final private long getDiskForWindowsInfo(String dirPath) { try { long space = -1; Process process; Runtime run = Runtime.getRuntime(); String osName = System.getProperty("os.name").toLowerCase(); String command = ""; if (osName.startsWith("windows") && osName.indexOf("98") == -1) { command = "cmd.exe /c dir " + dirPath; } else if (osName.startsWith("windows") && osName.indexOf("98") != -1) { command = "command.com /c dir " + dirPath; } process = run.exec(command); java.io.BufferedReader in = new java.io.BufferedReader(new java.io.InputStreamReader( process.getInputStream())); String freeSpace = "", line; while ((line = in.readLine()) != null) { freeSpace = line; } if (freeSpace == null) { return -1; } process.destroy(); freeSpace = freeSpace.trim(); freeSpace = freeSpace.replaceAll("\\\\\\\\\\\\\\\\.", ""); freeSpace = freeSpace.replaceAll(",", ""); String[] results = freeSpace.split(" "); for (int i = 1; i < results.length; i++) { try { space = Long.parseLong(results[i]); return space; } catch (NumberFormatException ex) { continue; } } return space; } catch (java.io.IOException e) { return -1; } } public long getObjectDisk() { String path = prop.getProperty("user.dir"); int index = path.indexOf(FS); path = path.substring(0, index); String osName = System.getProperty("os.name").toLowerCase(); if (osName.startsWith("windows")) { return getDiskForWindowsInfo(path); } else if (osName.startsWith("linux")) { return getDiskForLinuxInfo(path); } else { return -1; } } public final String getMacAddress() { String os = System.getProperty("os.name"); try { if(os.startsWith("Windows")) { return windowsParseMacAddress(windowsRunIpConfigCommand()); } else if(os.startsWith("Linux")) { return linuxParseMacAddress(linuxRunIfConfigCommand()); } else { throw new java.io.IOException("unknown operating system: " + os); } } catch(Exception ex) { return "Nothing"; } } private final String linuxParseMacAddress(String ipConfigResponse) throws java.text.ParseException { String localHost = null; try { localHost = java.net.InetAddress.getLocalHost().getHostAddress(); } catch(java.net.UnknownHostException ex) { ex.printStackTrace(); throw new java.text.ParseException(ex.getMessage(), 0); } java.util.StringTokenizer tokenizer = new java.util.StringTokenizer(ipConfigResponse, "\n"); String lastMacAddress = null; while(tokenizer.hasMoreTokens()) { String line = tokenizer.nextToken().trim(); boolean containsLocalHost = line.indexOf(localHost) >= 0; if(containsLocalHost && lastMacAddress != null) { return lastMacAddress; } int macAddressPosition = line.indexOf("HWaddr"); if(macAddressPosition <= 0) continue; String macAddressCandidate = line.substring(macAddressPosition + 6).trim(); if(linuxIsMacAddress(macAddressCandidate)) { lastMacAddress = macAddressCandidate; continue; } } java.text.ParseException ex = new java.text.ParseException ("cannot read MAC address for " + localHost + " from [" + ipConfigResponse + "]", 0); ex.printStackTrace(); throw ex; } private final boolean linuxIsMacAddress(String macAddressCandidate) { if(macAddressCandidate.length() != 17) return false; return true; } private final String linuxRunIfConfigCommand() throws java.io.IOException { Process p = Runtime.getRuntime().exec("ifconfig"); java.io.InputStream stdoutStream = new java.io.BufferedInputStream(p.getInputStream()); StringBuffer buffer= new StringBuffer(); for (;;) { int c = stdoutStream.read(); if (c == -1) break; buffer.append((char)c); } String outputText = buffer.toString(); stdoutStream.close(); return outputText; } private final String windowsParseMacAddress(String ipConfigResponse) throws java.text.ParseException { String localHost = null; try { localHost = java.net.InetAddress.getLocalHost().getHostAddress(); } catch(java.net.UnknownHostException ex) { ex.printStackTrace(); throw new java.text.ParseException(ex.getMessage(), 0); } java.util.StringTokenizer tokenizer = new java.util.StringTokenizer(ipConfigResponse, "\n"); String lastMacAddress = null; while(tokenizer.hasMoreTokens()) { String line = tokenizer.nextToken().trim(); if(line.endsWith(localHost) && lastMacAddress != null) { return lastMacAddress; } int macAddressPosition = line.indexOf(":"); if(macAddressPosition <= 0) continue; String macAddressCandidate = line.substring(macAddressPosition + 1).trim(); if(windowsIsMacAddress(macAddressCandidate)) { lastMacAddress = macAddressCandidate; continue; } } java.text.ParseException ex = new java.text.ParseException("cannot read MAC address from [" + ipConfigResponse + "]", 0); ex.printStackTrace(); throw ex; } private final boolean windowsIsMacAddress(String macAddressCandidate) { if(macAddressCandidate.length() != 17) return false; return true; } private final String windowsRunIpConfigCommand() throws java.io.IOException { Process p = Runtime.getRuntime().exec("ipconfig /all"); java.io.InputStream in = new java.io.BufferedInputStream(p.getInputStream()); StringBuffer buffer= new StringBuffer(); for (;;) { int c = in.read(); if (c == -1) break; buffer.append((char)c); } String outputText = buffer.toString(); in.close(); return outputText; } public double getCpuRatio(){ double cpuRatio = 0; if (getOSName().toLowerCase().startsWith("windows")) { cpuRatio = getCpuRatioForWindows(); } else if (getOSName().toLowerCase().startsWith("linux")) { cpuRatio = getCpuRatioForLinux(); } return cpuRatio; } private double getCpuRatioForWindows() { try { String procCmd = System.getenv("windir") + "\\system32\\wbem\\wmic.exe process get Caption,CommandLine," + "KernelModeTime,ReadOperationCount,ThreadCount,UserModeTime,WriteOperationCount"; long[] c0 = readCpu(Runtime.getRuntime().exec(procCmd)); Thread.sleep(CPUTIME); long[] c1 = readCpu(Runtime.getRuntime().exec(procCmd)); if (c0 != null && c1 != null) { long idletime = c1[0] - c0[0]; long busytime = c1[1] - c0[1]; return Double.valueOf( PERCENT * (busytime) / (busytime + idletime)) .doubleValue(); } else { return 0.0; } } catch (Exception ex) { ex.printStackTrace(); return 0.0; } } final private double getCpuRatioForLinux() { try { java.io.File file = new java.io.File("/proc/stat"); java.io.BufferedReader br = new java.io.BufferedReader(new java.io.InputStreamReader( new java.io.FileInputStream(file))); java.util.StringTokenizer token = new java.util.StringTokenizer(br.readLine()); token.nextToken(); int user = Integer.parseInt(token.nextToken()); int nice = Integer.parseInt(token.nextToken()); int system = Integer.parseInt(token.nextToken()); int idle = Integer.parseInt(token.nextToken()); Thread.sleep(1000); br = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream( file))); token = new java.util.StringTokenizer(br.readLine()); token.nextToken(); int user2 = Integer.parseInt(token.nextToken()); int nice2 = Integer.parseInt(token.nextToken()); int sys2 = Integer.parseInt(token.nextToken()); int idle2 = Integer.parseInt(token.nextToken()); return (double) ((user2 + sys2 + nice2) - (user + system + nice)) / (float) ((user2 + nice2 + sys2 + idle2) - (user + nice + system + idle)); } catch (Exception ex) { return (double) 0.0; } } final String substring(String src, int startidx, int endidx) { byte[] b = src.getBytes(); StringBuffer sbr = new StringBuffer(); for (int i = startidx; i <= endidx; i++) { sbr.append((char) b[i]); } return sbr.toString(); } final long[] readCpu(final Process proc) { long[] retn = new long[2]; try { proc.getOutputStream().close(); java.io.InputStreamReader ir = new java.io.InputStreamReader(proc.getInputStream()); java.io.LineNumberReader input = new java.io.LineNumberReader(ir); String line = input.readLine(); if (line == null || line.length() < 10) { return null; } int capidx = line.indexOf("Caption"); int cmdidx = line.indexOf("CommandLine"); int rocidx = line.indexOf("ReadOperationCount"); int umtidx = line.indexOf("UserModeTime"); int kmtidx = line.indexOf("KernelModeTime"); int wocidx = line.indexOf("WriteOperationCount"); long idletime = 0; long kneltime = 0; long usertime = 0; while ((line = input.readLine()) != null) { if (line.length() < wocidx) { continue; } String caption = substring(line, capidx, cmdidx - 1).trim(); String cmd = substring(line, cmdidx, kmtidx - 1).trim(); if (cmd.indexOf("wmic.exe") >= 0) { continue; } if (caption.equals("System Idle Process") || caption.equals("System")) { idletime += Long.valueOf( substring(line, kmtidx, rocidx - 1).trim()) .longValue(); idletime += Long.valueOf( substring(line, umtidx, wocidx - 1).trim()) .longValue(); continue; } kneltime += Long.valueOf( substring(line, kmtidx, rocidx - 1).trim()).longValue(); usertime += Long.valueOf( substring(line, umtidx, wocidx - 1).trim()).longValue(); } retn[0] = idletime; retn[1] = kneltime + usertime; return retn; } catch (Exception ex) { ex.printStackTrace(); } finally { try { proc.getInputStream().close(); } catch (Exception e) { e.printStackTrace(); } } return null; } public long getStartTime(){ return startTime; } public long getStartMemory(){ return startMemory; } public boolean isSun() { return System.getProperty("java.vm.vendor").indexOf("Sun") != -1; } public String getJavaVersion() { return javaVersion; } public void loadAddress() { try { java.net.InetAddress address = java.net.InetAddress .getLocalHost(); java.net.InetAddress[] all = java.net.InetAddress.getAllByName(address.getHostName()); for (int i = 0; i < all.length; i++) { String temp = null; temp = all[i].getHostAddress().toString(); if (!temp.startsWith("127.0") && !temp.startsWith("169.254")) { serverIP=temp; } } serverName = address.getHostName(); } catch (java.net.UnknownHostException e) { } } /** * 获得所在服务器名称 */ public String getServerName() { return serverName; } public String getServerIP() { return serverIP; } public boolean isSupportSpring(){ return supportSpring; } public boolean isSupportLoonframework(){ return supportLoonframework; } public boolean isSupportStruts() { return supportStruts; } public boolean isSupportJAF() { return supportJAF; } public boolean isSupportJavaxSql() { return supportJavaxSql; } public boolean isSupportHibernate(){ return supportHibernate; } public boolean isSupportJNDI() { return supportJNDI; } public boolean isSupportMail() { return supportMail; } public boolean isSupportBeanUtils() { return supportBeanUtils; } public boolean isSupportCommonLogging() { return supportCommonLogging; } public boolean isSupportCommonCodec() { return supportCommonCodec; } public boolean isSupportCommonCollection() { return supportCommonCollection; } public boolean isSupportCommonDigester() { return supportCommonDigester; } public boolean isSupportCommonLang() { return supportCommonLang; } public boolean isSupportJakartaRegExp() { return supportJakartaRegExp; } public boolean isSupportLucene() { return supportLucene; } public boolean isSupportDom4j() { return supportDom4j; } public boolean isSupportMmMysqlDriver() { return supportMmMysqlDriver; } public boolean isSupportComMysqlDriver() { return supportComMysqlDriver; } public boolean isSupportImageProcessing() { return supportImageProcessing; } public String getDoubleOperation(){ long begin = System.currentTimeMillis(); int flag = 0; double random = (double)new java.util.Random().nextInt( 1000 ); while( flag < 100000 ){ random = Math.sqrt( random ); flag++; } long end = System.currentTimeMillis(); long result = end - begin; return String.valueOf(result); } public String getNumberOperation() { long begin = startTime; int flag = 0; while (flag < 1000000) { flag++; } long end = System.currentTimeMillis(); long result = end - begin; return String.valueOf(result); } } LfSpy spyLib = new LfSpy(); %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>lf-jsp探针 Ver 0.1.0</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style type="text/css"> <!-- .stylebase {color:red; font-size:14px; font-weight:bold;} .table-header-text { color: #FFFFFF; font-weight: normal; margin: 3px 5px 1px 15px; font-family: Arial, Verdana,Helvetica, Sans-Serif; } td{white-space:normal; word-break:break-all;} A{ COLOR: #000000; TEXT-DECORATION: none} A:hover { COLOR: #f58200} body,td,span { font-size: 9pt} .input { BACKGROUND-COLOR: #E3F1D1;BORDER:#A9D46D 1px solid;FONT-SIZE: 9pt} .tableBorder {BORDER-RIGHT: #84BE3C 1px solid; BORDER-TOP: #84BE3C 1px solid; BORDER-LEFT: #84BE3C 1px solid; BORDER-BOTTOM: #84BE3C 1px solid; BACKGROUND-COLOR: #ffffff; WIDTH: 760;} .backc { BACKGROUND-COLOR: #E3F1D1;BORDER:#A9D46D 1px solid;FONT-SIZE: 9pt;color:#000000;} .PicBar { background-color: #A9D46D; border: 1px solid #ffffff; height: 12px;} .InnerHead { background-color: #E3F1D1; border-top-width: 1px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #FFFFFF; border-right-color: #FFFFFF; border-bottom-color: #FFFFFF; border-left-color: #FFFFFF; text-align: left; padding-left: 10px; padding-top: 3px; } .InnerTable { background-color: #999999; } .InnerMain { background-color: #FFFFFF; padding-left: 10px; padding-top: 3px; } --> </style> </head> <body> <table width="100%" height="45" border="0" cellpadding="0" class="InnerHead"> <tr> <td><div align="center"><span class="stylebase"><a href="http://looframework.sourceforge.net/">LF-Spy Java服务器探针 Ver 0.1.0</a></span></div></td> </tr> </table> <h3>服务器连接速度:</h3> <table border=0 width=100% cellspacing=1 cellpadding=0 class="InnerTable"> <tr> <td width="29%" height="22" class="InnerHead"><span class="table-header-text">接入设备 </span></td> <td width="45%" height="22" class="InnerHead"><span class="table-header-text">连接速度(理论值) </span></td> <td width="26%" class="InnerHead"><span class="table-header-text">下载速度(理论值) </span></td> </tr> <tr> <td height="20" class="InnerMain">56k Modem</td> <td class="InnerMain"><img align=absmiddle class=PicBar width='1%'> 56 Kbps</td> <td class="InnerMain">7.0 k/s</td> </tr> <tr> <td height="20" class="InnerMain">64k ISDN</td> <td class="InnerMain"><img align=absmiddle class=PicBar width='1%'> 64 Kbps</td> <td class="InnerMain">8.0 k/s</td> </tr> <tr> <td height="20" class="InnerMain">512k ADSL</td> <td class="InnerMain"><img align=absmiddle class=PicBar width='5%'> 512 Kbps</td> <td class="InnerMain">64.0 k/s</td> </tr> <tr> <td height="20" class="InnerMain">1.5M Cable</td> <td class="InnerMain"><img align=absmiddle class=PicBar width='15%'> 1500 Kbps</td> <td class="InnerMain">187.5 k/s</td> </tr> <tr> <td height="20" class="InnerMain">5M FTTP</td> <td class="InnerMain"><img align=absmiddle class=PicBar width='50%'> 5000 Kbps</td> <td class="InnerMain">625.0 k/s</td> </tr> <tr> <td height="20" class="InnerMain">当前连接速度</td> <% if(request.getParameter("action") != null && "speedTest".equals(request.getParameter("action"))){ StringBuffer sbuffer=new StringBuffer(99); sbuffer.append("<script language='JavaScript'>var tSpeedStart=new Date();</script>" ); sbuffer.append("<script language='JavaScript'>var tSpeedEnd=new Date();</script>\n" ); sbuffer.append("<script language='JavaScript'>" ); sbuffer.append("var iSpeedTime = 0; iSpeedTime = ( tSpeedEnd - tSpeedStart ) / 1000;" ); sbuffer.append("if( iSpeedTime > 0 ) iKbps = Math.round( Math.round( 100 * 8 / iSpeedTime * 10.5 ) / 10 ); else iKbps = 10000 ;" ); sbuffer.append("var iShowPer = Math.round( iKbps / 100 );" ); sbuffer.append("if( iShowPer < 1 ) iShowPer = 1; else if( iShowPer > 82 ) iShowPer = 82;" ); sbuffer.append("</script>\n" ); sbuffer.append("<script language='JavaScript'>" ); sbuffer.append("document.write('<td class=InnerMain><img align=absmiddle class=PicBar width=\"' + iShowPer + '%\">' + iKbps + ' Kbps');" ); sbuffer.append("</script>\n" ); sbuffer.append("</td><td class=InnerMain> <a href='?action=speedTest' title=连接速度测试><u>" ); sbuffer.append("<script language='JavaScript'>" ); sbuffer.append("document.write(Math.round(iKbps/8*10)/10+'k/s');"); sbuffer.append("</script>\n") ; sbuffer.append("</u></a></td>"); out.println(sbuffer.toString()); }else{ %> <td class="InnerMain"> </td> <td class="InnerMain"><a href='?action=speedTest' title=测试连接速度><u>开始测试</u></a></td> <%}%> </tr> </table> <h3>服务器相关数据:</h3> <table border=0 width=100% cellspacing=1 cellpadding=0 class="InnerTable"> <tr> <td width="29%" height="22" class="InnerHead"><span class="table-header-text">服务器相关</span></td> <td width="71%" height="22" class="InnerHead"><span class="table-header-text">数值信息</span></td> </tr> <tr> <td width="29%" class="InnerMain">服务器名</td> <td class="InnerMain"> <%=spyLib.getServerName()%> </td> </tr> <tr> <td width="29%" class="InnerMain">服务器软件名</td> <td class="InnerMain"> <%=getServletContext().getServerInfo()%> </td> </tr> <tr> <td width="29%" class="InnerMain">服务器IP</td> <td class="InnerMain"> <%=spyLib.getServerIP()%> </td> </tr> <tr> <td width="29%" class="InnerMain">服务器操作系统</td> <td class="InnerMain"> <%=spyLib.getOSName()%> </td> </tr> <tr> <td width="29%" class="InnerMain">服务器系统模式</td> <td class="InnerMain"> <%=spyLib.getSystemModel()%> </td> </tr> <tr> <td width="29%" class="InnerMain">服务器MAC地址</td> <td class="InnerMain"> <%=spyLib.getMacAddress()%> </td> </tr> <tr> <td width="29%" class="InnerMain">操作系统类型</td> <td class="InnerMain"> <%=spyLib.getOSarch()%> </td> </tr> <tr> <td width="29%" class="InnerMain">操作系统CPU占用率</td> <td class="InnerMain"> <%=spyLib.getCpuRatio()+"%"%> </td> </tr> <tr> <td width="29%" class="InnerMain">JRE版本</td> <td class="InnerMain"> <%=spyLib.getJavaVersion()%> </td> </tr> <tr> <td width="29%" class="InnerMain">JVM是否为Sun提供</td> <td class="InnerMain"> <%=spyLib.isSun()%> </td> </tr> <tr> <td width="29%" class="InnerMain">服务器当前时间</td> <td class="InnerMain"> <%=new java.util.Date()%> </td> </tr> <tr> <td width="29%" class="InnerMain">服务器时区设置</td> <td class="InnerMain"> <%=spyLib.getTimeZone()%> </td> </tr> <tr> <td width="29%" class="InnerMain">服务器当前用户</td> <td class="InnerMain"> <%=spyLib.getNowUser()%> </td> </tr> <tr> <td width="29%" class="InnerMain">服务器当前用户所在硬盘剩余空间</td> <td class="InnerMain"> <%=spyLib.getObjectDisk()==-1?"未知":spyLib.getObjectDisk()/1024/1024+"MB"%> </td> </tr> <tr> <td width="29%" class="InnerMain">服务器当前用户目录</td> <td class="InnerMain"> <%=spyLib.getNowUserDir()%> </td> </tr> <tr> <td width="29%" class="InnerMain">服务器当前页面物理路径</td> <td class="InnerMain"> <%=config.getServletContext().getRealPath(request.getServletPath())%> </td> </tr> <tr> <td width="29%" class="InnerMain">当前服务端口</td> <td class="InnerMain"> <%=request.getServerPort()%> </td> </tr> </table> <h3>截获的浏览器参数一览:</h3> <table border=0 width=100% cellspacing=1 cellpadding=0 class="InnerTable"> <tr> <td width="29%" height="22" class="InnerHead"><span class="table-header-text">属性 </span></td> <td width="%71%" height="22" class="InnerHead"><span class="table-header-text">数值 </span></td> </tr> <tr> <td width="29%" class="InnerMain"> http-protocol</td> <td class="InnerMain"> <%=request.getProtocol()%> </td> </tr> <tr> <td width="29%" class="InnerMain"> http-method</td> <td class="InnerMain"> <%=request.getMethod()%> </td> </tr> <tr> <td width="29%" class="InnerMain"> remote-host</td> <td class="InnerMain"> <%=request.getRemoteHost()%> </td> </tr> <tr> <td width="29%" class="InnerMain"> remote-ip</td> <td class="InnerMain"> <%=request.getRemoteAddr()%> </td> </tr> <tr> <td width="29%" class="InnerMain"> remote-user</td> <td class="InnerMain"> <%=request.getRemoteUser()%> </td> </tr> <tr> <td width="29%" class="InnerMain"> remote-port</td> <td class="InnerMain"> <%=request.getRemotePort()%> </td> </tr> <tr> <td width="29%" class="InnerMain"> content-type</td> <td class="InnerMain"> <%=request.getContentType()%> </td> </tr> <% java.util.Enumeration enums=request.getHeaderNames(); StringBuffer headBuffer=new StringBuffer(); String name=""; Object value=""; while(enums.hasMoreElements()){ name=(String)enums.nextElement(); value=(String)request.getHeader(name); headBuffer.append("<tr>"); headBuffer.append("<td class=\"InnerMain\"> "+name+"</td>"); headBuffer.append("<td class=\"InnerMain\"> "+value+"</td>"); headBuffer.append("</tr>"); } out.println(headBuffer.toString()); %> </table> <h3>部分CGI(Common Gateway Interface)参数:</h3> <table border=0 width=100% cellspacing=1 cellpadding=0 class="InnerTable"> <tr> <td width="29%" height="22" class="InnerHead"><span class="table-header-text">属性 </span></td> <td width="%71%" height="22" class="InnerHead"><span class="table-header-text">数值 </span></td> </tr> <tr> <td class="InnerMain"> SERVER_NAME (服务名)</td> <td class="InnerMain"> <%=request.getServerName()%></td> </tr> <tr> <td class="InnerMain"> PATH_TRANSLATED (服务器实际路径信息)</td> <td class="InnerMain"> <%=request.getPathTranslated()%></td> </tr> <tr> <td class="InnerMain"> SERVER_SOFTWARE (服务器软件名)</td> <td class="InnerMain"> <%=getServletContext().getServerInfo()%></td> </tr> <tr> <td class="InnerMain"> PATH_INFO (附加路径信息)</td> <td class="InnerMain"> <%=request.getPathInfo()%></td> </tr> <tr> <td class="InnerMain"> DOCUMENT_ROOT (站点的物理路径)</td> <td class="InnerMain"> <%=getServletContext().getRealPath("/")%></td> </tr> <tr> <td class="InnerMain"> CONTEXT_PATH (站点的根路径)</td> <td class="InnerMain"> <%=request.getContextPath()%></td> </tr> </table> <h3>通过请求(Request)获得的参数:</h3> <table border=0 width=100% cellspacing=1 cellpadding=0 class="InnerTable"> <tr> <td width="29%" height="22" class="InnerHead"><span class="table-header-text">属性 </span></td> <td width="%71%" height="22" class="InnerHead"><span class="table-header-text">数值 </span></td> </tr> <tr> <td class="InnerMain"> getAuthType</td> <td class="InnerMain"> <%=request.getAuthType()%></td> </tr> <tr> <td class="InnerMain"> getCharacterEncoding</td> <td class="InnerMain"> <%=request.getCharacterEncoding()%></td> </tr> <tr> <td class="InnerMain"> getContentLength</td> <td class="InnerMain"> <%=request.getContentLength()%></td> </tr> <tr> <td class="InnerMain"> getContentType</td> <td class="InnerMain"> <%=request.getContentType()%></td> </tr> <tr> <td class="InnerMain"> getContextPath</td> <td class="InnerMain"> <%=request.getContextPath()%></td> </tr> <tr> <td class="InnerMain"> getLocale</td> <td class="InnerMain"> <%=request.getLocale()%></td> </tr> <tr> <td class="InnerMain"> getLocales</td> <td class="InnerMain"> <%=request.getLocales()%></td> </tr> <tr> <td class="InnerMain"> getMethod</td> <td class="InnerMain"> <%=request.getMethod()%></td> </tr> <tr> <td class="InnerMain"> getPathInfo</td> <td class="InnerMain"> <%=request.getPathInfo()%></td> </tr> <tr> <td class="InnerMain"> getPathTranslated</td> <td class="InnerMain"> <%=request.getPathTranslated()%></td> </tr> <tr> <td class="InnerMain"> getProtocol</td> <td class="InnerMain"> <%=request.getProtocol()%></td> </tr> <tr> <td class="InnerMain"> getReader</td> <td class="InnerMain"> <%=request.getReader()%></td> </tr> <tr> <td class="InnerMain"> getRealPath</td> <td class="InnerMain"> <%=config.getServletContext().getRealPath(".")%></td> </tr> <tr> <td class="InnerMain"> getRemoteAddr</td> <td class="InnerMain"> <%=request.getRemoteAddr()%></td> </tr> <tr> <td class="InnerMain"> getRemoteHost</td> <td class="InnerMain"> <%=request.getRemoteHost()%></td> </tr> <tr> <td class="InnerMain"> getRemoteUser</td> <td class="InnerMain"> <%=request.getRemoteUser()%></td> </tr> <tr> <td class="InnerMain"> getRequestDispatcher</td> <td class="InnerMain"> <%=request.getRequestDispatcher("/")%></td> </tr> <tr> <td class="InnerMain"> getRequestURI</td> <td class="InnerMain"> <%=request.getRequestURI()%></td> </tr> <tr> <td class="InnerMain"> getRequestURL</td> <td class="InnerMain"> <%=request.getRequestURL()%></td> </tr> <tr> <td class="InnerMain"> getServerName</td> <td class="InnerMain"> <%=request.getServerName()%></td> </tr> <tr> <td class="InnerMain"> getServerPort</td> <td class="InnerMain"> <%=request.getServerPort()%></td> </tr> <tr> <td class="InnerMain"> getServletPath</td> <td class="InnerMain"> <%=request.getServletPath()%></td> </tr> <tr> <td class="InnerMain"> getUserPrincipal</td> <td class="InnerMain"> <%=request.getUserPrincipal()%></td> </tr> </table> <h3>通过应答(Response)返回的参数:</h3> <table border=0 width=100% cellspacing=1 cellpadding=0 class="InnerTable"> <tr> <td width="50%" height="22" class="InnerHead"><span class="table-header-text">属性 </span></td> <td width="50%" height="22" class="InnerHead"><span class="table-header-text">数值 </span></td> </tr> <tr> <td class="InnerMain"> getBufferSize</td> <td class="InnerMain"> <%=response.getBufferSize()%></td> </tr> <tr> <td class="InnerMain"> getCharacterEncoding</td> <td class="InnerMain"> <%=response.getCharacterEncoding()%></td> </tr> <tr> <td class="InnerMain"> getContentType</td> <td class="InnerMain"> <%=response.getContentType()%></td> </tr> <tr> <td class="InnerMain"> getLocale</td> <td class="InnerMain"> <%=response.getLocale()%></td> </tr> </table> <h3>通过会话(Session)获得的参数:</h3> <table border=0 width=100% cellspacing=1 cellpadding=0 class="InnerTable"> <tr> <td width="50%" height="22" class="InnerHead"><span class="table-header-text">属性 </span></td> <td width="50%" height="22" class="InnerHead"><span class="table-header-text">数值</span></td> </tr> <% enums=session.getAttributeNames(); headBuffer=new StringBuffer(); while(enums.hasMoreElements()){ name=(String)enums.nextElement(); value=session.getAttribute(name); headBuffer.append("<tr>"); headBuffer.append("<td class=\"InnerMain\"> "+name+"</td>"); headBuffer.append("<td class=\"InnerMain\"> "+session.getAttribute(name)+"</td>"); headBuffer.append("</tr>"); } out.println(headBuffer.toString()); %> </table> <h3>通过服务器应用(Application)获得的参数:</h3> <table border=0 width="100%" cellspacing=1 cellpadding=0 class="InnerTable"> <tr> <td width="29%" class="InnerHead"><span class="table-header-text">属性</span></td> <td width="71%" class="InnerHead"><span class="table-header-text">数值</span></td> </tr> <% enums=application.getAttributeNames(); headBuffer=new StringBuffer(); while(enums.hasMoreElements()){ name=(String)enums.nextElement(); value=application.getAttribute(name); if(value instanceof String){ String temp=(String)value; if(temp.indexOf(";")!=-1){ java.util.StringTokenizer token=new java.util.StringTokenizer(temp,";"); StringBuffer buffer=new StringBuffer(token.countTokens()); while(token.hasMoreElements()){ buffer.append(token.nextElement()); buffer.append(";\n<br>"); } value=buffer.toString(); } } headBuffer.append("<tr>"); headBuffer.append("<td class=\"InnerMain\"> "+name+" </td>"); headBuffer.append("<td class=\"InnerMain\"> "+value+" </td>"); headBuffer.append("</tr>"); } out.println(headBuffer.toString()); %> </table> <h3>通过小甜饼(Cookies)获得的参数:</h3> <table border=0 width=100% cellspacing=1 cellpadding=0 class="InnerTable"> <tr> <td width="50%" height="22" class="InnerHead"><span class="table-header-text">属性 </span></td> <td width="50%" height="22" class="InnerHead"><span class="table-header-text">数值</span></td> </tr> <% Cookie[] cos=request.getCookies(); if(cos!=null){ for(int i=0;i<cos.length;i++) { %> <tr> <td class="InnerMain"> <%=cos[i].getName()%></td> <td class="InnerMain"> <%=cos[i].getValue()%></td> </tr> <% } } %> </table> <h3>服务器效率测试:</h3> <table border=0 width=100% cellspacing=1 cellpadding=0 class="InnerTable"> <tr> <td width="54%" height="22" class="InnerHead"><span class="table-header-text">让服务器执行100万次整数运算和10万次开方,记录所用的时间。</span></td> <td width="21%" height="22" class="InnerHead"><span class="table-header-text">整数运算</span></td> <td width="25%" height="22" class="InnerHead"><span class="table-header-text">浮点运算</span></td> </tr> <tr> <td class="InnerMain" height="40"> <input name="button" type="button" class=backc onclick="javascript:location.reload()" value="测试当前服务器"/></td> <td class="InnerMain"> <%=spyLib.getNumberOperation()+"(毫秒)"%></td> <td class="InnerMain"> <%=spyLib.getDoubleOperation()+"(毫秒)"%></td> </tr> </table> <h3>服务器所有可用参数一览:</h3> <table border=0 width=100% cellspacing=1 cellpadding=0 class="InnerTable"> <tr> <td width="29%" height="22" class="InnerHead"><span class="table-header-text">服务器相关 </span></td> <td width="%71%" height="22" class="InnerHead"><span class="table-header-text">数值信息 </span></td> </tr> <% java.util.Properties props=System.getProperties(); java.util.Iterator iter=props.keySet().iterator(); while(iter.hasNext()) { name=(String)iter.next(); value=props.get(name); if(value instanceof String){ String temp=(String)value; boolean isA=temp.indexOf(";")!=-1; boolean isB=temp.indexOf(",")!=-1; if(isA||isB){ java.util.StringTokenizer token=new java.util.StringTokenizer(temp.replace(" ",""),isA?";":","); StringBuffer buffer=new StringBuffer(token.countTokens()); while(token.hasMoreElements()){ buffer.append(" "+token.nextElement()); buffer.append(isA?";"+"\n<br>":","+"\n<br>"); } value=buffer.toString(); } }else{ value=" "+value; } headBuffer.append("<tr>"); headBuffer.append("<td class=\"InnerMain\">"+name+" </td>"); headBuffer.append("<td class=\"InnerMain\">"+value+" </td>"); headBuffer.append("</tr>"); } out.println(headBuffer.toString()); %> </table> <h3>针对部分类库的服务器加载验证</h3> <table border=0 width=100% cellspacing=1 cellpadding=0 class="InnerTable"> <tr> <td width="50%" height="22" class="InnerHead"><span class="table-header-text">属性 </span></td> <td width="50%" height="22" class="InnerHead"><span class="table-header-text">数值 </span></td> </tr> <tr> <td class="InnerMain"> 是否支持 JNDI</td> <td class="InnerMain"> <%=spyLib.isSupportJNDI()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 Loonframework</td> <td class="InnerMain"> <%=spyLib.isSupportLoonframework()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 JavaxSql</td> <td class="InnerMain"> <%=spyLib.isSupportJavaxSql()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 JAF</td> <td class="InnerMain"> <%=spyLib.isSupportJAF()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 Mail</td> <td class="InnerMain"> <%=spyLib.isSupportMail()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 BeanUtils</td> <td class="InnerMain"> <%=spyLib.isSupportBeanUtils()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 CommonLogging</td> <td class="InnerMain"> <%=spyLib.isSupportCommonLogging()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 CommonCodec</td> <td class="InnerMain"> <%=spyLib.isSupportCommonCodec()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 CommonCollection</td> <td class="InnerMain"> <%=spyLib.isSupportCommonCollection()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 CommonDigester</td> <td class="InnerMain"> <%=spyLib.isSupportCommonDigester()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 CommonLang</td> <td class="InnerMain"> <%=spyLib.isSupportCommonLang()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 JakartaRegExp</td> <td class="InnerMain"> <%=spyLib.isSupportJakartaRegExp()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 Struts</td> <td class="InnerMain"> <%=spyLib.isSupportStruts()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 Lucene</td> <td class="InnerMain"> <%=spyLib.isSupportLucene()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 Dom4j</td> <td class="InnerMain"> <%=spyLib.isSupportDom4j()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 MysqlDriver(Mm)</td> <td class="InnerMain"> <%=spyLib.isSupportMmMysqlDriver()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 MysqlDriver(Com)</td> <td class="InnerMain"> <%=spyLib.isSupportComMysqlDriver()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 ImageProcessing</td> <td class="InnerMain"> <%=spyLib.isSupportImageProcessing()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 Hibernate</td> <td class="InnerMain"> <%=spyLib.isSupportHibernate()%></td> </tr> <tr> <td class="InnerMain"> 是否支持 Spring</td> <td class="InnerMain"> <%=spyLib.isSupportSpring()%></td> </tr> </table> <p> <h3>资源消费一览</h3> <table border=0 width=100% cellspacing=1 cellpadding=0 class="InnerTable"> <tr> <td width="50%" height="22" class="InnerHead"><span class="table-header-text">属性 </span></td> <td width="50%" height="22" class="InnerHead"><span class="table-header-text">数值 </span></td> </tr> <% long endMem = Runtime.getRuntime().freeMemory(); long total= Runtime.getRuntime().maxMemory(); long endTime = System.currentTimeMillis(); java.util.Date date = new java.util.Date(spyLib.getStartTime()); java.text.SimpleDateFormat df = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String starttime = df.format(date); date = new java.util.Date(endTime); df = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String endtime = df.format(date); %> <tr> <td class="InnerMain"> 最大内存容量</td> <td class="InnerMain"> <%=(total/1024/1024+"MB")%></td> </tr> <tr> <td class="InnerMain"> 应用结束时剩余自由内存</td> <td class="InnerMain"> <%=(endMem/1024/1024+"MB")%></td> </tr> <tr> <td class="InnerMain"> 应用结束时减少自由内存</td> <td class="InnerMain"> <%=((spyLib.getStartMemory() - endMem)/1024/1024+"MB")%></td> </tr> <tr> <td class="InnerMain"> 应用开始时间</td> <td class="InnerMain"> <%=starttime%></td> </tr> <tr> <td class="InnerMain"> 应用结束时间</td> <td class="InnerMain"> <%=endtime%></td> </tr> <tr> <td class="InnerMain"> 应用耗时(毫秒)</td> <td class="InnerMain"> <%=(endTime-spyLib.getStartTime())%></td> </tr> </table> <p><br> </p> <center> <sup>©</sup> </center><br> </body> </html>

政府科技管理者在推进科技成果转化时,如何确保技术成果的精准匹配与高效流通?.docx

政府科技管理者在推进科技成果转化时,如何确保技术成果的精准匹配与高效流通?.docx

政府科技管理者在推进科技成果转化时,如何确保技术成果的精准匹配与高效流通?

TCR型SVC静止无功补偿器仿真模型(Simulink仿真实现)

TCR型SVC静止无功补偿器仿真模型(Simulink仿真实现)

内容概要:本文详细介绍了一种基于Simulink的TCR型SVC(晶闸管控制电抗器型静止无功补偿器)仿真模型,旨在实现对电力系统中无功功率的动态补偿,从而提升电网稳定性与电能质量。文档系统阐述了该模型的设计原理、体系结构及核心控制策略,重点展示了如何通过调节TCR的触发角实现对感性无功功率的连续、精确调控,并结合固定电容器(FC)构成完整的TCR+FC型SVC系统。文中还拓展介绍了在不平衡电网条件下静止无功发生器(SVG)的补偿应用,以及采用三层控制策略的级联H桥STATCOM的仿真设计方法。文章强调,科研工作不仅需要扎实的理论基础,更需注重理论与工程实践的紧密结合,建议使用者深入研读配套的说明报告和参考文献,以透彻理解模型背后的物理机制、数学建模方法与控制逻辑。; 适合人群:电力系统、电气工程及其自动化等相关专业的高校师生、从事电力系统分析与设计的科研人员,以及专注于无功补偿、电能质量治理和柔性交流输电系统(FACTS)设备研发的工程技术人员。; 使用场景及目标:①深入学习和掌握TCR型SVC的工作原理、系统架构及其在Simulink环境中的精细化建模与仿真方法;②研究在各种复杂工况(如电网电压不平衡、负载突变)下,无功补偿装置的动态响应特性、稳定性能及先进控制策略的有效性;③为本科毕业设计、研究生课题研究或实际工程项目提供一个可靠的仿真验证平台和技术支持;④以此为基础,进一步拓展至更为先进的柔性交流输电系统(FACTS)及其他大功率电力电子装置的研究与开发。; 阅读建议:建议读者严格按照资源目录的顺序系统性地学习,充分利用所提供的Simulink模型文件、MATLAB代码及相关技术文档,亲自动手搭建、调试和优化仿真参数。通过反复的实践操作,深化对无功补偿基本原理、非线性元件(晶闸管)控制、闭环反馈系统设计及现代控制算法的理解。同时,鼓励在现有模型的基础上进行二次开发与创新,探索适用于新能源大规模接入等新型电力系统的先进控制策略。

轻量网络对决脊柱 MRI 分割:MobileUnet 与 EfficientUnet 多类别分割实现

轻量网络对决脊柱 MRI 分割:MobileUnet 与 EfficientUnet 多类别分割实现

## 轻量网络对决脊柱 MRI 分割:MobileUnet 与 EfficientUnet 多类别分割实现 脊柱 MRI 影像分割是骨科临床辅助诊断的关键环节,椎体、椎间盘等结构的精准分割能够为椎间盘突出、脊柱退变等疾病提供量化参考。传统人工标注不仅耗时耗力,还存在不同医师主观判读带来的差异,基于深度学习的自动分割方案可以有效缓解这一痛点。本项目基于 1000 余张脊柱 MRI 二维切片数据集,对比 MobileUnet、EfficientUnet‑B0 两种轻量 U 型分割网络,完成脊柱多类别语义分割任务。 项目采用自定义 PyTorch 数据集 MyDataset 完成数据流水线构建,标签灰度映射信息独立存储在 grayList.txt 文本文件中,自动读取 mask 中存在的灰度类别,将原始 mask 灰度值映射为连续 0‑N‑1 训练标签,推理阶段再还原回原始灰度标签,适配多类别分割场景。数据集训练、验证集按照 images/masks 文件夹成对组织,支持水平、垂直翻转的数据增强,同时预留 CT 窗宽窗位对比度增强接口,图像统一缩放至 224×224,归一化至 0‑1 区间。 训练流程使用 AdamW 优化器、余弦退火学习率衰减,损失函数选用交叉熵损失,通过混淆矩阵自动计算像素精度、Precision、Recall、F1‑Score、Dice、mIoU 多项医学分割常用指标,完整记录每轮 epoch 日志并绘制 Loss、mIoU、Dice、Precision、Recall 变化曲线,保存最优权重 best.pth 与最后一轮权重 last.pth。预测脚本 predict.py 实现批量推理,对预测 mask 做轮廓绘制、叠加原图可视化,输出预测掩码与混合效果图。

高校技术转移办公室人员在组织成果转化过程中,如何提升科技成果推介效率.docx

高校技术转移办公室人员在组织成果转化过程中,如何提升科技成果推介效率.docx

高校技术转移办公室人员在组织成果转化过程中,如何提升科技成果推介效率

高校技术转移办公室如何实现技术成果的快速精准匹配?.docx

高校技术转移办公室如何实现技术成果的快速精准匹配?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

【计算机体系结构】基于处理器集成验证与性能优化

【计算机体系结构】基于处理器集成验证与性能优化

内容概要:本文介绍了基于的交互机制,以深入理解高层次建模的精髓。

PCIe Protocol Updates - Part I.pdf

PCIe Protocol Updates - Part I.pdf

PCIe Protocol Updates - Part I.pdf

国央企创新负责人如何推动内部创新成果与外部市场需求的高效对接?.docx

国央企创新负责人如何推动内部创新成果与外部市场需求的高效对接?.docx

国央企创新负责人如何推动内部创新成果与外部市场需求的高效对接?

PCS双向储能变流器Buck-Boost闭环控制仿真复现(Simulink仿真实现)

PCS双向储能变流器Buck-Boost闭环控制仿真复现(Simulink仿真实现)

内容概要:本文基于Simulink平台,对PCS双向储能变流器的Buck-Boost闭环控制策略进行了详细的仿真复现研究,旨在深入剖析其在储能系统中的动态响应特性和控制性能。文中系统阐述了Buck-Boost控制模式的设计原理,详细展示了在Simulink环境中构建系统模型的全过程,并重点探讨了电压外环与电流内环双闭环控制器的关键参数整定方法。通过严谨的仿真验证,证实了所设计控制方案在实现稳定充放电、精确功率调节以及应对模式切换等方面的优异表现,展现了良好的鲁棒性与控制精度。该仿真模型为直流微电网、混合储能系统等应用中实现高效的双向功率流动提供了坚实的理论依据和技术支持。; 适合人群:具备电力电子技术、自动控制理论基础知识,从事新能源发电、储能系统集成、微电网运行控制等相关领域的科研人员及工程技术人员。; 使用场景及目标:①深入理解双向储能变流器在充放电转换过程中Buck(降压)与Boost(升压)两种工作模式的切换逻辑与控制机理;②熟练掌握基于Simulink的电力电子变换器闭环控制系统建模、仿真与分析方法;③为实际工程中储能变流器(PCS)的控制器设计、参数优化及功能验证提供可复现的仿真模型与理论指导。; 阅读建议:建议读者结合文中的控制框图与仿真模块截图,亲手搭建并调试模型,重点关注双闭环结构中PI控制器参数对系统稳定性与动态响应速度的影响。在仿真过程中,可通过设置负载突变、指令跳变等不同工况,深入探究系统的瞬态性能与鲁棒性,从而全面深化对储能变流器先进控制策略的理解与应用能力。

利用MATLAB、SimEvents和并行粒子群优化进行动态建筑疏散优化。.zip

利用MATLAB、SimEvents和并行粒子群优化进行动态建筑疏散优化。.zip

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

无刷直流电机BLDC双闭环调速系统Matlab仿真与建模

无刷直流电机BLDC双闭环调速系统Matlab仿真与建模

内容概要:本文围绕无刷直流电机(BLDC)的双闭环调速系统展开,详细介绍了基于Matlab/Simulink的系统建模与仿真方法。系统采用转速与电流双闭环控制策略,结合三相桥式全控电路拓扑结构,实现对电机转速的高精度动态调控。文中深入剖析了系统的工作原理、关键控制技术(如反电动势过零检测)、控制器设计过程,并重点对比了传统PID控制与模糊PID控制在系统性能上的差异。提供的完整Simulink仿真模型涵盖了从信号检测、逻辑换相到闭环控制的全过程,通过仿真结果验证了双闭环控制在提升系统动态响应速度、增强抗干扰能力及改善稳态精度方面的有效性。; 适合人群:具备电机控制、电力电子技术和自动控制理论基础的电气工程、自动化、机电一体化等专业的高年级本科生、研究生以及从事电机驱动系统研发的工程技术人员。; 使用场景及目标:① 深入学习无刷直流电机的基本运行原理、数学模型及其换相逻辑;② 掌握转速-电流双闭环控制系统的设计方法、参数整定技巧及工程实现要点;③ 在Matlab/Simulink平台上动手搭建和调试电机控制仿真系统,对比分析传统PID与先进模糊PID等不同控制算法的动态与静态性能;④ 为后续开展电机控制算法的创新研究或实际工程项目开发提供可靠的仿真验证平台和技术储备。; 阅读建议:读者应在充分理解文档中阐述的理论知识基础上,结合Matlab/Simulink软件进行实践操作,严格按照模型搭建步骤复现仿真环境。建议通过调整电机负载、设定不同的目标转速等工况,观察并记录系统的响应曲线,以此深入探究各控制参数对系统性能的影响,从而巩固和深化对现代电机控制理论的理解。

一门国产自研的、追求干净观感的、基于对象克隆、支持中文编程的编程语言:完全从底层开始编写,语言引擎、对象库等均未基于 / 采用任何已有语言进行改造、包装或扩展,保证了代码和权利的干净、清晰与自主可控

一门国产自研的、追求干净观感的、基于对象克隆、支持中文编程的编程语言:完全从底层开始编写,语言引擎、对象库等均未基于 / 采用任何已有语言进行改造、包装或扩展,保证了代码和权利的干净、清晰与自主可控

zlang是一门完全国产自研的、追求干净观感的、基于对象克隆、支持中文编程的编程语言: 完全从底层开始编写,语言引擎(词法 / 语法分析等)、对象库等均未基于 / 采用任何已有语言进行改造、包装或扩展,保证了代码和权利的干净、清晰与自主可控。定位:简洁、高效、易上手、全栈能力,兼顾开发效率与运行性能。设计理念:解决主流语言痛点(如 C 语言字符串处理繁琐、Java 冗余的 Getter/Setter),融合优势并加入创新设计。对标语言:Python。LOGO:中华狸花猫,象征独立、坚韧、不畏挑战。

无刷直流电机BLDC转速电流双闭环+无位置传感器控制仿真【仿真+详解说明报告+参考文献】

无刷直流电机BLDC转速电流双闭环+无位置传感器控制仿真【仿真+详解说明报告+参考文献】

内容概要:本文围绕无刷直流电机(BLDC)的高性能控制策略展开,提供了基于Simulink的转速电流双闭环控制与无位置传感器控制的仿真模型及详细说明。核心内容涵盖转速与电流双闭环PI控制器设计、无位置传感器控制技术(如滑模观测器)、以及模糊PID与传统PID控制策略的对比分析。资源包包含多个完整仿真模型、详尽的技术报告和参考文献,系统阐述了BLDC电机在不同控制算法下的动态响应、鲁棒性及稳定性表现,旨在帮助用户深入理解现代电机控制的核心原理与工程实现方法。; 适合人群:具备电机控制、自动控制理论及Simulink仿真基础,从事电气工程、自动化、电力电子、新能源驱动系统等领域的科研人员、工程师及高校研究生。; 使用场景及目标:① 掌握BLDC电机转速电流双闭环控制系统的设计与建模仿真方法;② 深入研究滑模观测器等无位置传感器控制技术的实现机理与性能优势;③ 对比分析模糊PID与传统PID在抗干扰能力、动态响应速度和稳态精度等方面的差异;④ 为电机控制相关的科研项目、毕业设计、课程设计或工业应用提供可靠的仿真平台与理论支撑。; 阅读建议:建议结合所提供的仿真模型与说明文档,逐步搭建并调试控制系统,重点关注PI参数整定、滑模观测器设计及模糊规则库的构建,通过对比不同控制策略的仿真结果,深入理解其控制性能差异与适用场景。

高校技术转移办公室人员如何高效完成科技成果推介书的智能化生成?.docx

高校技术转移办公室人员如何高效完成科技成果推介书的智能化生成?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

最新推荐最新推荐

recommend-type

基于混合储能协调控制的三相并网逆变系统设计【附说明文档】

内容概要:本文围绕“基于混合储能协调控制的三相并网逆变系统设计”展开,系统阐述了蓄电池与飞轮储能等混合储能系统在微电网中的协同控制策略。研究涵盖三相并网逆变器的能量管理、SOC(荷电状态)恒压恒流充放电控制、PQ控制与双闭环控制等核心技术,并基于Matlab/Simulink仿真平台实现了系统建模与动态仿真验证。文中深入探讨了飞轮储能系统的机侧PQ控制与网侧变流器的恒压双闭环控制,分析了微电网在调频调峰、功率协同分配等方面的运行特性,强调多能源间的协调优化与系统的快速动态响应能力,旨在提升微电网的运行稳定性、电能质量及能源利用效率。; 适合人群:具备电力电子、自动化或电气工程等相关专业背景,从事新能源发电、微电网控制、储能系统集成与优化等领域研究的研究生、科研人员及工程技术人员。; 使用场景及目标:①深入研究混合储能系统在微电网中的协调控制机制与能量管理策略;②掌握三相并网逆变器的建模、控制算法设计及Matlab/Simulink仿真方法;③实现储能系统的高效充放电管理与并网功率精确控制;④为学术论文撰写、科研课题申报、工程项目开发或实验复现提供完整的技术方案与参考实例。; 阅读建议:建议结合所提供的仿真模型、说明文档及参考文献,按照系统架构从单元控制到整体协调的顺序分模块学习,重点关注各控制策略的设计原理、参数整定方法与协同逻辑。推荐在Matlab环境中动手复现仿真,通过调整参数和工况来观察系统响应,以深化对理论知识的理解和工程应用能力的掌握。
recommend-type

科技中介服务机构在服务企业时,如何通过平台降低服务门槛和操作复杂度?.docx

科技中介服务机构在服务企业时,如何通过平台降低服务门槛和操作复杂度?
recommend-type

运维管理基于Hyperfilelens的Docker Compose业务系统备份恢复:机房设备更换场景下的数据迁移与验证方案设计

内容概要:本文介绍了在机房存储设备更换及固件升级背景下,通过 Hyperfilelens 实现多套 Docker Compose 部署的业务系统备份与恢复的全过程。文章围绕备份迁移的实际操作,详细阐述了从主机接入、备份路径选择、策略配置、恢复执行到业务验证的七个关键步骤,并结合截图说明各环节的操作要点。特别强调了不仅要完成数据备份与恢复,还需核对目录结构、服务启动状态和业务功能可用性,确保迁移后系统完整可用。最终总结了 Hyperfilelens 在集中管理保护对象、制定备份策略、明确恢复目标和提供可核查记录方面的核心价值,倡导将备份作为常态化运维机制而非临时应急措施。; 适合人群:从事运维、系统管理及相关技术岗位,具备一定 Docker 和服务器管理经验的技术人员,尤其是面临机房设备更新或系统迁移任务的团队成员。; 使用场景及目标:①解决老旧存储设备更换过程中的业务系统平滑迁移问题;②实现基于 Docker Compose 架构的应用数据可靠备份与异机恢复;③建立可复用的备份恢复流程,提升运维自动化与可靠性。; 阅读建议:建议结合文中提到的平台界面和操作命令逐步实践,重点关注备份范围确认、一致性保护、恢复路径核对及业务端到端验证,避免仅依赖工具状态而忽视实际业务可用性。
recommend-type

chromedriver-mac-arm64-158.0.8127.18(Beta).zip

chromedriver-mac-arm64-158.0.8127.18(Beta).zip
recommend-type

政府科技管理者在推动区域科技成果转化时,如何实现科技成果与产业需求的精准对接?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。
recommend-type

Rust系统编程与WebAssembly开发:LLVM IR教程及实战资源

LLVM IR(Intermediate Representation,中间表示)是LLVM编译器基础设施的核心抽象层,它是一种强类型、静态单赋值(SSA)形式的低级程序表示,兼具可读性与机器可处理性,既接近高级语言语义,又贴近底层硬件指令模型。本资源标题“llvm-ir-tutorial-Rust系统编程与WebAssembly资源”明确指向一个跨技术栈的深度实践型学习体系,其核心逻辑在于:以Rust语言为前端开发载体,通过显式生成、阅读、修改和优化LLVM IR,深入理解现代编译器后端工作原理;同时将该能力延伸至WebAssembly(Wasm)目标平台,打通从系统级安全编程到浏览器/边缘沙箱执行的全链路编译路径。Rust之所以成为该教程的理想语言载体,在于其零成本抽象、内存安全性保障(无GC)、对底层控制的精细支持(如裸指针、内联汇编、自定义分配器),以及其默认使用LLVM作为后端编译器(rustc基于LLVM),使得开发者能无缝切入IR层面进行调试与干预——例如通过`rustc --emit=llvm-ir`直接导出人类可读的`.ll`文件,或借助`llc`工具将IR进一步降级为特定架构的汇编代码。而WebAssembly则构成该知识体系的关键出口:Wasm并非直接运行Rust源码,而是依赖Rust编译器链(通过`wasm32-unknown-unknown`或`wasm32-wasi`目标)将Rust代码先编译为LLVM IR,再由LLVM的Wasm后端(`llvmlite`或`wabt`等工具链组件)将其转换为`.wasm`二进制模块;此过程高度依赖对IR结构的理解——例如函数签名如何映射为Wasm类型签名、全局变量如何转化为Wasm线性内存偏移、panic机制如何被重写为Wasm trap指令、以及如何通过`#[no_mangle]`和`extern "C"`控制符号导出以适配JS宿主调用。教程中所含的`src/`目录必然涵盖大量Rust源码示例,包括但不限于:手动编写`unsafe`块触发特定IR模式(如`llvm.memcpy`内建调用)、使用`#[inline(never)]`阻止优化以观察原始IR结构、通过`cfg(target_arch = "wasm32")`条件编译实现平台特化逻辑;`code/`子目录则极可能存放配套的LLVM IR片段(`.ll`)、已编译的Wasm二进制(`.wasm`)、对应的JS胶水代码及HTML测试页面,形成“Rust → IR → Wasm → JS”的完整验证闭环。`book.toml`表明该项目采用mdBook构建交互式技术文档,内容结构应严格遵循认知递进:首章解析LLVM IR语法规范(基本块、指令集如`%1 = add i32 %0, 42`、常量表达式、phi节点在循环中的作用);次章演示Rust到IR的映射规则(`Vec<T>`的内存布局如何体现为`alloca + store + load`序列、`match`表达式如何展开为`switch`或`br`链);第三章聚焦Wasm后端特性(Wasm的限制性类型系统如何迫使LLVM插入`i32.trunc_sat_f64_s`等饱和截断指令、WASI系统调用如何通过`call_indirect`间接调用实现);后续章节必涉及高级主题:利用`llvm::Pass` API编写自定义优化遍(如针对Wasm体积优化的死代码消除Pass)、通过`llvmlite`在Python中动态构造IR并JIT执行、对比`-C opt-level=z`(极致尺寸优化)与`-C lto=yes`(链接时优化)对IR形态的影响。`LICENSE`与`CHANGELOG`则体现工程严肃性:MIT/Apache-2.0双许可证确保Rust生态兼容性,而持续更新的变更日志反映对LLVM版本演进(如LLVM 16+对Wasm GC提案的支持)、Rust稳定版发布(如async/await IR表示变化)、Wasm标准进展(Interface Types、Exception Handling)的实时响应。`.github/`目录内应包含CI配置(如用`cargo llvm-ir`检查PR是否引入非预期IR膨胀)、自动化Wasm测试脚本(`wasm-validate`校验二进制合法性、`wabt`反编译IR比对)、以及Issue模板引导用户精准报告IR生成异常。综上,该资源绝非孤立的语法手册,而是一个融合编译原理、系统编程范式、Web前沿标准与工业级工程实践的立体知识网络,掌握它意味着不仅能写出高效安全的Rust代码,更能洞悉代码如何穿越抽象层级最终在异构环境中精确执行——这种穿透式理解力,正是当代高性能系统开发者与WebAssembly平台架构师的核心竞争力所在。
recommend-type

【SpringBoot Actuator安全红线清单】:12项RCE高危端点加固方案(含_actuator_env、_actuator_jolokia真实攻防复现+自动扫描脚本)

# Spring Boot Actuator:从可观测性支柱到攻击跳板的深度解构 在现代 Java 微服务架构中,Spring Boot Actuator 已不再是那个仅用于本地调试的“小工具”。它悄然嵌入成千上万生产系统的毛细血管——监控健康状态、导出指标、动态刷新配置、实时查看线程堆栈。但就在你为 Prometheus 抓取到 `jvm.memory.used` 指标而欣慰时,攻击者可能正通过 `/actuator/env` 向 `ConfigurableEnvironment` 注入恶意 `PropertySource`,再借由 `/actuator/refresh` 触发远程类加载,
recommend-type

BP神经网络的隐藏层该设几层、每层多少节点才合适?

### BP神经网络隐藏层及节点数量的确定 BP神经网络模型拓扑结构包括输入层、隐层和输出层[^1]。对于隐藏层及其节点数量的选择,这不仅影响到网络的学习效率也决定了其泛化能力。 #### 隐藏层数量的影响因素 通常情况下,单个隐藏层已经能够满足大多数实际应用的需求,因为理论上只要给定足够的神经元数目,单隐含层前馈网络可以逼近任何复杂的非线性映射关系[^3]。然而,在某些特定场景下,采用多个隐藏层可能有助于提高性能,尤其是在面对非常复杂的数据模式识别任务时。 #### 节点数目的选取策略 为了合理地决定每层内的具体神经元数目: - **经验法则**:一种简单的方法是从经验值出发来估
recommend-type

Windows平台ESP32开发环境一站式搭建包:MSYS2、ESP-IDF v3.3与VS Code集成配置

ESP32环境搭建是嵌入式物联网开发中极为关键的基础环节,尤其在Windows平台下构建一套稳定、可复现、符合官方推荐规范的开发环境,直接关系到后续固件编译、调试、OTA升级、Wi-Fi/BLE协议栈集成、低功耗优化等高级功能的实现质量与开发效率。本资源包“ESP32环境搭建包(msys2、esp-idf、VScode)”并非简单工具集合,而是一套经过历史验证、面向ESP-IDF v3.3版本深度适配的完整开发生态闭环系统,其核心构成包含三大支柱性组件:MSYS2运行时环境、ESP-IDF SDK v3.3源码及工具链、Visual Studio Code编辑器及其专用插件生态。首先,MSYS2作为Windows下最成熟可靠的类Unix环境模拟平台,提供了POSIX兼容的Shell(bash/zsh)、GNU核心工具集(make、gcc、gdb、awk、sed等)、包管理器pacman,以及对Python 2.7/3.x、CMake 3.10+、Ninja构建系统的原生支持——这些是ESP-IDF构建系统赖以运转的底层基石。特别值得注意的是,所含esp32_win32_msys2_environment_and_toolchain-20181001.zip并非通用MSYS2镜像,而是Espressif官方于2018年10月针对ESP32芯片特性(如Xtensa LX6双核架构、指令集扩展、内存映射布局)定制编译的交叉工具链(xtensa-esp32-elf-gcc),该工具链内建了对FreeRTOS内核调度器、ROM函数调用、Flash加密、Secure Boot签名验证等硬件级特性的深度支持,且与IDF v3.3的Kconfig配置系统、component.mk构建规则、idf.py命令行接口完全对齐。其次,ESP-IDF v3.3是ESP32 SDK发展史上的里程碑版本,首次全面引入组件化架构(Component-based Architecture),将Wi-Fi驱动(esp_wifi)、蓝牙协议栈(bluedroid)、电源管理(esp_pm)、ADC/DAC/PWM外设驱动、LVGL图形库、HTTP客户端/服务器、MQTT、CoAP等全部封装为可独立编译、版本可控、依赖可声明的模块单元;同时强化了CMake构建系统,摒弃旧版makefile,支持多目标构建(app/bootloader/partition table)、自定义链接脚本、符号表分析、静态断言检查,并内置了idf_monitor串口监控器、idf_size内存分析工具、idf.py menuconfig图形化配置界面等工程化利器。第三,VSCodeUserSetup-x64-1.38.1.exe虽为较早版本(2019年9月发布),但其稳定性极高,配合C/C++扩展(Microsoft)、ESP-IDF Extension(Espressif官方维护)、CMake Tools、Python、GitLens等插件后,可实现语法高亮(支持IDF专属宏如ESP_LOGI)、智能补全(基于compile_commands.json)、一键编译烧录(idf.py build/flash/monitor绑定快捷键)、GDB图形化调试(支持多线程FreeRTOS任务切换视图、寄存器/内存/堆栈实时监视)、JTAG硬件调试(需搭配ESP-Prog或FTDI转接板)、代码片段模板(如ESP_ERROR_CHECK宏快速插入)、项目结构导航(按components目录自动索引)等工业级开发体验。此外,该环境包隐含了大量易被忽视却至关重要的细节配置:例如MSYS2中需手动执行pacman -Syu更新基础系统并重启终端以避免toolchain冲突;需将~/.espressif/tools目录权限设为可写以允许idf.py自动下载Python依赖(如pyserial、kconfiglib);VSCode中必须正确设置"idf.espIdfPath"、"idf.pythonBinPath"、"idf.customExtraPaths"等JSON配置项,否则无法识别idf.py命令;还需在Windows PATH中追加MSYS2/usr/bin路径以确保git、ssh等工具全局可用;更关键的是,v3.3版本要求Python严格限定为3.6–3.8区间(不兼容3.9+),且需禁用pip缓存以防wheel包版本错乱。整个搭建过程本质上是对嵌入式开发范式的系统性实践:从操作系统抽象层(MSYS2)→硬件抽象层(ESP-IDF HAL)→应用框架层(FreeRTOS+组件)→开发工具链(VSCode+插件),形成一条贯穿软硬件协同设计的知识脉络。掌握此环境不仅意味着能跑通blink例程,更代表着已具备阅读ESP-IDF源码(如esp-idf/components/esp_wifi/下的phy_init.c、wifi_init.c)、定制SDK配置(通过menuconfig启用BT Coex、修改heap内存分配策略)、交叉调试汇编级问题(如cache attribute错误导致的data abort)、甚至向主干分支提交patch的能力——这才是“行业完整源码”标签背后所承载的真实技术纵深与工程素养。
recommend-type

【SpringBoot自动装配失效黑盒破解】:基于spring.factories加载链路的5步逆向追踪法(含@Import、DeferredImportSelector源码级验证)

# Spring Boot自动装配失效:一场静默的链路断裂 在某个深夜的线上故障复盘会上,一位资深架构师盯着监控面板上突兀的 `503 Service Unavailable` 告警,喃喃自语:“明明 `DataSourceAutoConfiguration` 在本地跑得好好的,为什么上线后连数据库连接池都没创建?”——这不是个例。它背后是 Spring Boot 自动装配机制在复杂工程场景下悄然断裂的典型切片:没有异常堆栈,没有日志报错,只有功能缺失带来的连锁雪崩。这种“静默失效”不是配置写错了,而是整个装配链路在某个不可见的环节被无声截断。 Spring Boot 的自动装配从来就不是