首页 文章 精选 留言 我的

精选列表

搜索[信息技术服务],共10022篇文章
优秀的个人博客,低调大师

学生信息管理系统JavaWeb

前言: 最近期末的Java大作业大部分都是要Gui(Swing技术) 书本教的也是 Swing技术,但是那界面实在是不忍直视,如果真的要做桌面应用之类的 根本轮不到Java的Swing,所以我觉得还是不要让Java干他不擅长的事 比较好,因此我也觉得没必要做这个课程设计,刚好最近学了Tomcat就 决定做一个简单的学生管理系统,目的无非是为了完成任务还有巩固一下 Eclipse中配置Tomcat JavaWeb项目。 不过做完了之后感觉真的是简陋无疑,不过这几天碰到的坑坑洼洼还是让我 受益匪浅的。 运用知识: 前端: 1. HTML,JS,CSS,Bootstrap 后台: 2. Java基础 3. Tomcat简单使用 4. Http协议了解 5. Servlet知识 数据存储: 6. XML实现数据的存储和读入(Dom4j读取) 单元测试: 7. Junit5 GitHub地址: https://github.com/jjc123/-Student-management-system--Javaweb 前台结构: 1. 登陆界面(直接拷贝网络的,实现了背景图片轮播) 2. 学生管理系统界面(Bootstrap框架) 后台结构: 1. Servlet(实现前后台交互) 2. Java各种类实现增删改查操作

优秀的个人博客,低调大师

Python WMI获取Windows系统信息

1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 #http://www.cnblogs.com/liu-ke/ 4 import wmi 5 import os 6 import sys 7 import platform 8 import time 9 10 def sys_version(): 11 c = wmi.WMI () 12 #获取操作系统版本 13 for sys in c.Win32_OperatingSystem(): 14 print "Version:%s" % sys.Caption.encode("UTF8"),"Vernum:%s" % sys.BuildNumber 15 print sys.OSArchitecture.encode("UTF8")#系统是32位还是64位的 16 print sys.NumberOfProcesses #当前系统运行的进程总数 17 18 def cpu_mem(): 19 c = wmi.WMI () 20 #CPU类型和内存 21 for processor in c.Win32_Processor(): 22 #print "Processor ID: %s" % processor.DeviceID 23 print "Process Name: %s" % processor.Name.strip() 24 for Memory in c.Win32_PhysicalMemory(): 25 print "Memory Capacity: %.fMB" %(int(Memory.Capacity)/1048576) 26 27 def cpu_use(): 28 #5s取一次CPU的使用率 29 c = wmi.WMI() 30 while True: 31 for cpu in c.Win32_Processor(): 32 timestamp = time.strftime('%a, %d %b %Y %H:%M:%S', time.localtime()) 33 print '%s | Utilization: %s: %d %%' % (timestamp, cpu.DeviceID, cpu.LoadPercentage) 34 time.sleep(5) 35 36 def disk(): 37 c = wmi.WMI () 38 #获取硬盘分区 39 for physical_disk in c.Win32_DiskDrive (): 40 for partition in physical_disk.associators ("Win32_DiskDriveToDiskPartition"): 41 for logical_disk in partition.associators ("Win32_LogicalDiskToPartition"): 42 print physical_disk.Caption.encode("UTF8"), partition.Caption.encode("UTF8"), logical_disk.Caption 43 44 #获取硬盘使用百分情况 45 for disk in c.Win32_LogicalDisk (DriveType=3): 46 print disk.Caption, "%0.2f%% free" % (100.0 * long (disk.FreeSpace) / long (disk.Size)) 47 48 def network(): 49 c = wmi.WMI () 50 #获取MAC和IP地址 51 for interface in c.Win32_NetworkAdapterConfiguration (IPEnabled=1): 52 print "MAC: %s" % interface.MACAddress 53 for ip_address in interface.IPAddress: 54 print "ip_add: %s" % ip_address 55 print 56 57 #获取自启动程序的位置 58 for s in c.Win32_StartupCommand (): 59 print "[%s] %s <%s>" % (s.Location.encode("UTF8"), s.Caption.encode("UTF8"), s.Command.encode("UTF8")) 60 61 62 #获取当前运行的进程 63 for process in c.Win32_Process (): 64 print process.ProcessId, process.Name 65 66 def main(): 67 sys_version() 68 cpu_mem() 69 #disk() 70 #network() 71 #cpu_use() 72 73 if __name__ == '__main__': 74 main() 75 print platform.system() 76 print platform.release() 77 print platform.version() 78 print platform.platform() 79 print platform.machine() 注:转载需注明出处及作者。 流柯

优秀的个人博客,低调大师

python监控服务器信息

本文转载自http://www.linuxtone.org/thread-29256-1-1.html 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 #coding:utf-8 #by_wangyi #by:QQ917611 #QQ群:251289157 import psutil import time import os import sys import re stats = [ 0 , 1 ] stoptimes = 2 if len (sys.argv)> 1 : interface = sys.argv[ 1 ] else : interface = 'eth0' class Monitor: def __init__( self ,user_uid,stoptime): self .user_uid = user_uid self .stoptime = stoptime if user_uid = = 0 : print "请使用root用户运行此脚本" exit() def meminfo( self ,used_vm,free_vm,buffers,cached): total = psutil.virtual_memory().total / 1024 / 1024 used = used_vm - (buffers + cached) free = total - used print "totalmem:%sM" % total print "usedmem:%sM" % used print "freemem:%sM" % free def diskinfo( self ): list = [] for i in psutil.disk_partitions(): list .append(i[ 1 ]) for k in range ( len ( list )): total = "%-15s分区\ttotal:%s" % ( list [k],psutil.disk_usage( list [k]).total / 1024 / 1024 / 1024 ) used = "used:%s" % (psutil.disk_usage( list [k]).used / 1024 / 1024 / 1024 ) free = "free:%s" % (psutil.disk_usage( list [k]).free / 1024 / 1024 / 1024 ) print "%sG\t%sG\t%sG" % (total,used,free) def cpuinfo( self ): with open ( '/proc/loadavg' )asf: loadavg = f.read() print "5分钟cpuload:%s" % (loadavg.split()[ 0 ]) print "10分钟cpuload:%s" % (loadavg.split()[ 1 ]) print "15分钟cpuload:%s" % (loadavg.split()[ 2 ]) print "当前运行proc:%s" % (loadavg.split()[ 3 ].split( '/' )[ 0 ]) print "最后运行pid:%s" % (loadavg.split()[ 4 ]) print '当前cpu%s' % (psutil.cpu_percent()) def flowinfo( self ): f = open ( '/proc/net/dev' , 'r' ).readlines() for i in f: if re.search(interface,i): rx = i.split( ':' )[ 1 ].split()[ 0 ] tx = i.split()[ 8 ] stats[ 0 ] = rx stats[ 1 ] = tx used_vm = psutil.virtual_memory().used / 1024 / 1024 free_vm = psutil.virtual_memory().free / 1024 / 1024 buffers = psutil.virtual_memory().buffers / 1024 / 1024 cached = psutil.virtual_memory().cached / 1024 / 1024 if __name__ = = '__main__' : user_uid = os.geteuid() stoptime = 2 task = Monitor(user_uid,stoptime) print "servermeminfo:\n" task.meminfo(used_vm,free_vm,buffers,cached) print "==================================" print "serverdiskinfo:\n" task.diskinfo() print "===================================" print "servercpuinfo:\n" task.cpuinfo() print "===================================" print "serverflowinfo:\n" task.flowinfo() RX_one = float (stats[ 0 ]) TX_one = float (stats[ 1 ]) time.sleep(stoptimes) task.flowinfo() RX_two = float (stats[ 0 ]) TX_two = float (stats[ 1 ]) RX_rate = round ( float (RX_two - RX_one) / 1024 , 2 ) TX_rate = round ( float (TX_two - TX_one) / 1024 , 2 ) print time.strftime( "%Y-%m-%d%H:%M:%S" ), 'RXbytes=' ,RX_rate, 'KB' print time.strftime( "%Y-%m-%d%H:%M:%S" ), 'TXbytes=' ,TX_rate, 'KB'

优秀的个人博客,低调大师

android用户界面-提示信息Toast

在程序中创建toast的步骤说明如下 1、调用toast的静态方法makeText()添加现实文本和时长。 2、调用toast的show()显示。 实例如下: /Chapter04_UI_Toast/src/com/amaker/test/MainActivity.java 代码 packagecom.amaker.test; importandroid.app.Activity; importandroid.os.Bundle; importandroid.view.View; importandroid.view.View.OnClickListener; importandroid.widget.Button; importandroid.widget.Toast; publicclassMainActivityextendsActivity{ /**Calledwhentheactivityisfirstcreated.*/ privateButtonb1,b2; @Override publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.main); b1=(Button)findViewById(R.id.Button01); b2=(Button)findViewById(R.id.Button02); finalintl=Toast.LENGTH_LONG; finalints=Toast.LENGTH_SHORT; finalStrings1="我多显示一会儿!"; finalStrings2="我少显示一会儿!"; b1.setOnClickListener(newOnClickListener(){ publicvoidonClick(Viewv){ Toastt1=Toast.makeText(getApplicationContext(),s1,l); t1.show(); } }); b2.setOnClickListener(newOnClickListener(){ publicvoidonClick(Viewv){ Toastt2=Toast.makeText(getApplicationContext(),s2,s); t2.show(); } }); } } 本文转自linzheng 51CTO博客,原文链接:http://blog.51cto.com/linzheng/1080701

优秀的个人博客,低调大师

Android 得到照片位置信息

目前Android SDK定义的Tag有: TAG_DATETIME时间日期 TAG_FLASH闪光灯 TAG_GPS_LATITUDE纬度 TAG_GPS_LATITUDE_REF纬度参考 TAG_GPS_LONGITUDE经度 TAG_GPS_LONGITUDE_REF经度参考 TAG_IMAGE_LENGTH图片长 TAG_IMAGE_WIDTH图片宽 TAG_MAKE设备制造商 TAG_MODEL设备型号 TAG_ORIENTATION方向 TAG_WHITE_BALANCE白平衡 String sFileName="/sdcard/DCIM/Camera/1.JPG"; try{ ExifInterface exif = new ExifInterface(sFileName); String sModel=exif.getAttribute(ExifInterface.TAG_MODEL); Toast.makeText(PhotoCatActivity.this,"1.JPG Exif:"+sModel, Toast.LENGTH_SHORT).show(); } catch(Exception ee){ } 经纬度得到的数据格式是 "num1/denom1,num2/denom2,num3/denom3",如何得到真正的经纬度呢? public Location exif2Loc(String flNm) { String sLat = "", sLatR = "", sLon = "", sLonR = ""; try { ExifInterface ef = new ExifInterface(flNm); sLat = ef.getAttribute(ExifInterface.TAG_GPS_LATITUDE); sLon = ef.getAttribute(ExifInterface.TAG_GPS_LONGITUDE); sLatR = ef.getAttribute(ExifInterface.TAG_GPS_LATITUDE_REF); sLonR = ef.getAttribute(ExifInterface.TAG_GPS_LONGITUDE_REF); } catch (IOException e) {return null;} double lat = dms2Dbl(sLat); if (lat > 180.0) return null; double lon = dms2Dbl(sLon); if (lon > 180.0) return null; lat = sLatR.contains("S") ? -lat : lat; lon = sLonR.contains("W") ? -lon : lon; Location loc = new Location("exif"); loc.setLatitude(lat); loc.setLongitude(lon); return loc; } //------------------------------------------------------------------------- double dms2Dbl(String sDMS){ double dRV = 999.0; try { String[] DMSs = sDMS.split(",", 3); String s[] = DMSs[0].split("/", 2); dRV = (new Double(s[0])/new Double(s[1])); s = DMSs[1].split("/", 2); dRV += ((new Double(s[0])/new Double(s[1]))/60); s = DMSs[2].split("/", 2); dRV += ((new Double(s[0])/new Double(s[1]))/3600); } catch (Exception e) {} return dRV; } 如何根据经纬度得到具体的地址? public final String getAddress(double latitude, double longitude) { Geocoder gc = new Geocoder(this, Locale.getDefault()); StringBuilder sb = new StringBuilder(); try { List add = gc.getFromLocation(latitude, longitude, 1); if (add.size() > 0) { Address ad = add.get(0); sb.append(ad.getAddressLine(0)); sb.append(ad.getAddressLine(1)); sb.append(ad.getAddressLine(2)); } } catch (Exception e) { } return sb.toString(); } 本文转自 netcorner 博客园博客,原文链接: http://www.cnblogs.com/netcorner/p/7279984.html ,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册