Mint_21.3 drawing-area和goocanvas的FB笔记(五)

news2024/11/16 10:33:35

FreeBASIC SDL图形功能

SDL - Simple DirectMedia Layer 是完整的跨平台系统,有自己的窗口、直接捕获键盘、鼠标和游戏操纵杆的事件,直接操作音频和CDROM,在其surface上可使用gfx, openGL和direct3D绘图。Window3.0时代,各种应用程序在Pharlap、DJPP、4GW支持下均突破了常规内存进入了保护模式,因此那个时期是SDL突破性发展的时机,非常多的游戏程序用SDL做支撑(gtk/iup/libui有的功能sdl没有,而sdl有的能力其它的则没有),是开发游戏和工厂流程化应用绘图的优秀工具。C#, Lua, Rust, hollywood, beaflang, Ocamel, Python, 等众多语言有它的封装, Github上的最新稳定版是 2.30.1 , 三天前还在更新。

Github上各平台使用的SDL

游戏:wildfire 野火

DOSBOX: DOS simulator

Humble Bundle 各种游戏

valve 众多游戏

FreeBASIC 完美支持 SDL, 需要安装如下 .so 库文件(SDL, SDL2 二个版本)

#freebasic SDL
sudo apt install libsdl2-dev
sudo apt install libsdl2-ttf-dev
sudo apt install libsdl2-net-dev
sudo apt install libsdl2-mixer-dev
sudo apt install libsdl2-image-dev
sudo apt install libsdl2-gfx-dev
sudo apt install libsdl1.2-dev
sudo apt install libsdl-console-dev
sudo apt install libsdl-mixer1.2-dev
sudo apt install libsdl-gfx1.2-dev
sudo apt install libsdl-net1.2-dev
sudo apt install libsdl-pango-dev
sudo apt install libsdl-sge-dev
sudo apt install libsdl-sound1.2-dev

示例一:放三个图文件:free.jpg, basic.gif, horse.tga

SDL库可读取的的图形文件种类繁多,此示例是在原示例基础上修改的,读取 gif, tga, jpg三种格式的文件。程序首选获取SDL的版本号,初始化 sdl, 作为三个sdl surface装入图形文件并返回图形指针,然后在不同位置放置它们,最后flip显示它们。

' SDL_image example written by Edmond Leung (leung.edmond@gmail.com)
'
' free.jpg, basic.gif and horse.tga are taken from the official freeBasic
' website.

#include  "SDL\SDL.bi"
#include  "SDL\SDL_image.bi"

declare sub blitImage _
   (byval img as SDL_Surface ptr, byval x as integer, byval y as integer)

	dim shared video as SDL_Surface ptr

	dim freeImg as SDL_Surface ptr, basicImg as SDL_Surface ptr, horseImg as SDL_Surface ptr

	dim version as const SDL_version ptr
	version = IMG_Linked_Version()

	' display the version number of the SDL_image being used
	print "Using SDL_image version number: "; SDL_VERSIONNUM(version->major, _
   	version->minor, version->patch)

	' initialise sdl with video support
	if (SDL_Init(SDL_INIT_VIDEO) < 0) then
   		print "Couldn't initialise SDL: "; *SDL_GetError()
	end if

	' check to see if the images are in the correct formats
	if (IMG_isJPG(SDL_RWFromFile("data/free.jpg", "rb")) = 0) then
   		print "The image (free.jpg) is not a jpg file."
	end if
	if (IMG_isGIF(SDL_RWFromFile("data/basic.gif", "rb")) = 0) then
   		print "The image (basic.gif) is not a gif file."
	end if

	' set the video mode to 1024x768x32bpp
	video = SDL_SetVideoMode(1024, 768, 32, SDL_HWSURFACE or SDL_DOUBLEBUF)
	
	if (video = NULL) then
   		print "Couldn't set video mode: "; *SDL_GetError()
	end if

	' load the images into an SDL_RWops structure
	dim freeRw as SDL_RWops ptr, basicRw as SDL_RWops ptr
	freeRw = SDL_RWFromFile("data/free.jpg", "rb")
	basicRw = SDL_RWFromFile("data/basic.gif", "rb")

	' load the images onto an SDL_Surface using three different functions available
	' in the SDL_image library
	freeImg = IMG_LoadJPG_RW(freeRw)
	horseImg = IMG_Load("data/horse.tga")
	basicImg = IMG_LoadTyped_RW(basicRw, 1, "gif")

	dim done as integer
	done = 0

	do while (done = 0)
   		dim event as SDL_Event
   
   		do while (SDL_PollEvent(@event))
      		if (event.type = SDL_QUIT_) then done = 1
      			if (event.type = SDL_KEYDOWN) then
        	 		if (event.key.keysym.sym = SDLK_ESCAPE) then done = 1      
      		end if
   		loop

   		dim destrect as SDL_Rect
   		destrect.w = video->w
   		destrect.h = video->h
   
   		' clear the screen with the colour white
   		SDL_FillRect(video, @destrect, SDL_MapRGB(video->format, 255, 255, 255))
   
   		' draw the images onto the screen

		blitImage freeImg, 170, 205

   		blitImage horseImg, 345, 330 
		blitImage freeImg, 445, 335 
   		blitImage basicImg, 450, 360 
		
		blitImage freeImg, 650, 215 
   		blitImage basicImg, 650, 240 		

		blitImage freeImg, 150, 455 
   		blitImage basicImg, 150, 480 		
	
		SDL_Flip(video)
	loop

	SDL_Quit

' sub-routine used to help with blitting the images onto the screen
sub blitImage _
   (byval img as SDL_Surface ptr, byval x as integer, byval y as integer)
	dim dest as SDL_Rect
   	dest.x = x
   	dest.y = y
   	SDL_BlitSurface(img, NULL, video, @dest)
end sub

示例二:对网络的支持,访问百度站点并取得首页面前部分内容(对于现代编程,这好像是非常基本的能力)。

''
'' simple http get example using the SDL_net library
''

#include once "SDL/SDL_net.bi"

const RECVBUFFLEN = 8192
const NEWLINE = !"\r\n"
'const DEFAULT_HOST = "www.freebasic.net"
const DEFAULT_HOST = "www.baidu.com"

declare sub gethostandpath( byref src as string, byref hostname as string, byref path as string )
	
	
	'' globals
	dim hostname as string
	dim path as string
	
	gethostandpath command, hostname, path
	
	if( len( hostname ) = 0 ) then
		hostname = DEFAULT_HOST
	end if
	
	'' init
	if( SDLNet_Init <> 0 ) then
		print "Error: SDLNet_Init failed"
		end 1
	end if
                         
	'' resolve
	dim ip as IPAddress
    dim socket as TCPSocket
    
    if( SDLNet_ResolveHost( @ip, hostname, 80 ) <> 0 ) then
		print "Error: SDLNet_ResolveHost failed"
		end 1
	end if
    
    '' open
    socket = SDLNet_TCP_Open( @ip )
    if( socket = 0 ) then
		print "Error: SDLNet_TCP_Open failed"
		end 1
	end if
    
    '' send HTTP request
    dim sendbuffer as string
    
	sendBuffer = "GET /" + path + " HTTP/1.0" + NEWLINE + _
				 "Host: " + hostname + NEWLINE + _
				 "Connection: close" + NEWLINE + _
				 "User-Agent: GetHTTP 0.0" + NEWLINE + _
				 NEWLINE
				 
    if( SDLNet_TCP_Send( socket, strptr( sendbuffer ), len( sendbuffer ) ) < len( sendbuffer ) ) then
		print "Error: SDLNet_TCP_Send failed"
		end 1
	end if
    
    '' receive til connection is closed
    dim recvbuffer as zstring * RECVBUFFLEN+1
    dim bytes as integer
    
    do 
    	bytes = SDLNet_TCP_Recv( socket, strptr( recvbuffer ), RECVBUFFLEN )
    	if( bytes <= 0 ) then
    		exit do
    	end if
    	
    	'' add the null-terminator
    	recvbuffer[bytes] = 0
    	
    	'' print it as string
    	print recvbuffer;
    loop
    print
                         
	'' close socket
	SDLNet_TCP_Close( socket )
	
	'' quit
	SDLNet_Quit

'':::::
sub gethostandpath( byref src as string, byref hostname as string, byref path as string )
	dim p as integer
	
	p = instr( src, " " )
	if( p = 0 or p = len( src ) ) then
		hostname = trim( src )
		path = ""
	else
		hostname = trim( left( src, p-1 ) )
		path = trim( mid( src, p+1 ) )
	end if
		
end sub

示例三:SDL 对 gfx 的支持。画任意线条,非常经典的dos年代的一款demo

''
'' simple http get example using the SDL_net library
''

#include once "SDL/SDL_net.bi"

const RECVBUFFLEN = 8192
const NEWLINE = !"\r\n"
'const DEFAULT_HOST = "www.freebasic.net"
const DEFAULT_HOST = "www.baidu.com"

declare sub gethostandpath( byref src as string, byref hostname as string, byref path as string )
	
	
	'' globals
	dim hostname as string
	dim path as string
	
	gethostandpath command, hostname, path
	
	if( len( hostname ) = 0 ) then
		hostname = DEFAULT_HOST
	end if
	
	'' init
	if( SDLNet_Init <> 0 ) then
		print "Error: SDLNet_Init failed"
		end 1
	end if
                         
	'' resolve
	dim ip as IPAddress
    dim socket as TCPSocket
    
    if( SDLNet_ResolveHost( @ip, hostname, 80 ) <> 0 ) then
		print "Error: SDLNet_ResolveHost failed"
		end 1
	end if
    
    '' open
    socket = SDLNet_TCP_Open( @ip )
    if( socket = 0 ) then
		print "Error: SDLNet_TCP_Open failed"
		end 1
	end if
    
    '' send HTTP request
    dim sendbuffer as string
    
	sendBuffer = "GET /" + path + " HTTP/1.0" + NEWLINE + _
				 "Host: " + hostname + NEWLINE + _
				 "Connection: close" + NEWLINE + _
				 "User-Agent: GetHTTP 0.0" + NEWLINE + _
				 NEWLINE
				 
    if( SDLNet_TCP_Send( socket, strptr( sendbuffer ), len( sendbuffer ) ) < len( sendbuffer ) ) then
		print "Error: SDLNet_TCP_Send failed"
		end 1
	end if
    
    '' receive til connection is closed
    dim recvbuffer as zstring * RECVBUFFLEN+1
    dim bytes as integer
    
    do 
    	bytes = SDLNet_TCP_Recv( socket, strptr( recvbuffer ), RECVBUFFLEN )
    	if( bytes <= 0 ) then
    		exit do
    	end if
    	
    	'' add the null-terminator
    	recvbuffer[bytes] = 0
    	
    	'' print it as string
    	print recvbuffer;
    loop
    print
                         
	'' close socket
	SDLNet_TCP_Close( socket )
	
	'' quit
	SDLNet_Quit

'':::::
sub gethostandpath( byref src as string, byref hostname as string, byref path as string )
	dim p as integer
	
	p = instr( src, " " )
	if( p = 0 or p = len( src ) ) then
		hostname = trim( src )
		path = ""
	else
		hostname = trim( left( src, p-1 ) )
		path = trim( mid( src, p+1 ) )
	end if
		
end sub

示例四:SDL 对open_GL的支持。简单的三角形, 颜色glColor3f 后面带3个float参数; glVertext3f,  顶点描述后面带3个float参数。

''
'' gltest.bas - freeBASIC opengl example, using GLUT for simplicity
'' by Blitz
''
'' Opengl code ported from nehe's gl tutorials
''

#include once "GL/gl.bi"
#include once "GL/glu.bi"
#include once "GL/glut.bi"

''
declare sub         doMain           ( )
declare sub         doShutdown		 ( )



    ''
    '' Entry point
    ''
    doMain
    

    

'' ::::::::::::
'' name: doRender
'' desc: Is called by glut to render scene
''
'' ::::::::::::
sub doRender cdecl
    static rtri as single
    static rqud as single
    
    glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT
    glPushMatrix
    
    glLoadIdentity
    glTranslatef -1.5, 0.0, -6.0
    glRotatef rtri, 0, 1, 0
         
    glBegin GL_TRIANGLES
		glColor3f   1.0, 0.0, 0.0			'' Red
		glVertex3f  0.0, 1.0, 0.0			'' Top Of Triangle  Front)
		glColor3f   0.0, 1.0, 0.0			'' Green
		glVertex3f -1.0,-1.0, 1.0			'' Left Of Triangle  Front)
		glColor3f   0.0, 0.0, 1.0			'' Blue
		glVertex3f  1.0,-1.0, 1.0			'' Right Of Triangle  Front)
		glColor3f   1.0, 0.0, 0.0			'' Red
		glVertex3f  0.0, 1.0, 0.0			'' Top Of Triangle  Right)
		glColor3f   0.0, 0.0, 1.0			'' Blue
		glVertex3f  1.0,-1.0, 1.0			'' Left Of Triangle  Right)
		glColor3f   0.0, 1.0, 0.0			'' Green
		glVertex3f  1.0,-1.0,-1.0			'' Right Of Triangle  Right)
        glColor3f   1.0, 0.0, 0.0			'' Red
		glVertex3f  0.0, 1.0, 0.0			'' Top Of Triangle  Back)
		glColor3f   0.0, 1.0, 0.0			'' Green
		glVertex3f  1.0,-1.0,-1.0			'' Left Of Triangle  Back)
		glColor3f   0.0, 0.0, 1.0			'' Blue
		glVertex3f -1.0,-1.0,-1.0			'' Right Of Triangle  Back)
		glColor3f   1.0, 0.0, 0.0			'' Red
		glVertex3f  0.0, 1.0, 0.0			'' Top Of Triangle  Left)
		glColor3f   0.0, 0.0, 1.0			'' Blue
		glVertex3f -1.0,-1.0,-1.0			'' Left Of Triangle  Left)
		glColor3f   0.0, 1.0, 0.0			'' Green
		glVertex3f -1.0,-1.0, 1.0			'' Right Of Triangle  Left)
    glEnd
    
    glColor3f 0.5, 0.5, 1.0
    glLoadIdentity    
    glTranslatef -1.5, 0.0, -6.0
	glTranslatef 3.0,0.0,0.0	
	glRotatef rqud, 1.0, 0.0, 0.0
	
	glBegin GL_QUADS
		glVertex3f -1.0, 1.0, 0.0
		glVertex3f  1.0, 1.0, 0.0
		glVertex3f  1.0,-1.0, 0.0
		glVertex3f -1.0,-1.0, 0.0
	glEnd    

    glPopMatrix            
    glutSwapBuffers
    
    rtri = rtri + 2.0
    rqud = rqud + 1.5
    
end sub



'' ::::::::::::
'' name: doInput
'' desc: Handles input
''
'' ::::::::::::
sub doInput CDECL ( byval kbcode as unsigned byte, _
              byval mousex as integer, _
              byval mousey as integer )
              
    if ( kbcode = 27 ) then
        doShutdown
        end 0
    end if

end sub



'' ::::::::::::
'' name: doInitGL
'' desc: Inits OpenGL
''
'' ::::::::::::
sub doInitGL
    dim i as integer
    dim lightAmb(3) as single
    dim lightDif(3) as single
    dim lightPos(3) as single
    
    ''
    '' Rendering stuff
    ''
    glShadeModel GL_SMOOTH
	glClearColor 0.0, 0.0, 0.0, 0.5
	glClearDepth 1.0
	glEnable GL_DEPTH_TEST
	glDepthFunc GL_LEQUAL
    glEnable GL_COLOR_MATERIAL
	glHint GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST
    
    ''
    '' Light setup ( not used at the moment )
    ''
    for i = 0 to 3
        lightAmb(i) = 0.5
        lightDif(i) = 1.0
        lightPos(i) = 0.0
    next i

    lightAmb(3) = 1.0
    lightPos(2) = 2.0
    lightPos(3) = 1.0    
	
    glLightfv GL_LIGHT1, GL_AMBIENT, @lightAmb(0)
	glLightfv GL_LIGHT1, GL_DIFFUSE, @lightDif(0)
	glLightfv GL_LIGHT1, GL_POSITION,@lightPos(0)
	glEnable GL_LIGHT1

    ''
    '' Blending ( not used at the moment )
    ''
    glColor4f 1.0, 1.0, 1.0, 0.5
    glBlendFunc GL_SRC_ALPHA, GL_ONE

end sub



'' ::::::::::::
'' name: doReshapeGL
'' desc: Reshapes GL window
''
'' ::::::::::::
sub doReshapeGL CDECL ( byval w as integer, _
                        byval h as integer )
    
    glViewport 0, 0, w, h 
    glMatrixMode GL_PROJECTION
    glLoadIdentity
    
    if ( h = 0 ) then
        gluPerspective  80/2, w, 1.0, 5000.0 
    else
        gluPerspective  80/2, w / h, 1.0, 5000.0
    end if
    
    glMatrixMode GL_MODELVIEW
    glLoadIdentity

end sub

'':::::
sub initGLUT
    ''
    '' Setup glut
    ''
    glutInit 1, strptr( " " )    
    
    glutInitWindowPosition 0, 0
    glutInitWindowSize 640, 480
    glutInitDisplayMode GLUT_RGBA or GLUT_DOUBLE or GLUT_DEPTH
    glutCreateWindow "FreeBASIC OpenGL example"
    
    doInitGL
    
    glutDisplayFunc  @doRender
    glutIdleFunc     @doRender
    glutReshapeFunc  CAST(Any PTR, @doReshapeGL)
    glutKeyboardFunc CAST(Any PTR, @doInput)

end sub

'':::::
sub doInit
    
	''
	'' Init GLUT
	''
	initGLUT    
	
end sub

'':::::
sub shutdownGLUT

	'' GLUT shutdown will be done automatically by atexit()

end sub

'':::::
sub doShutdown
    
	''
	'' GLUT
	''
	shutdownGLUT
	
end sub

'' ::::::::::::
'' name: doMain
'' desc: Main routine
''
'' ::::::::::::
sub doMain
    
    ''
    '' 
    ''
    doInit
    
    ''
    ''
    ''
    glutMainLoop
    
end sub


SDL 对鼠标、键盘、joysticker的响应都比较好。以前研究鼠标鉴相时拆过几个滚球鼠标,通过串口可以读取字节形式的位置信息,游戏操纵杆还没拆过,有时间了拆解一个研究一下它的button和位置实现,估计和早期原理图有很多不同。SDL内容太多,先熟悉它的功能和应用领域,没有做更深入的学习,以后用的话还要多补补课。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1502289.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

11.Node.js入门

一.什么是 Node.js Node.js 是一个独立的 JavaScript 运行环境&#xff0c;能独立执行 JS 代码&#xff0c;因为这个特点&#xff0c;它可以用来编写服务器后端的应用程序 Node.js 作用除了编写后端应用程序&#xff0c;也可以对前端代码进行压缩&#xff0c;转译&#xff0c;…

win11中微软商店如何使用微信支付?microsoft store支付教程

Microsoft Store是由微软公司提供的一个数字分发平台&#xff0c;用于购买和下载Windows操作系统及其相关应用、游戏、音乐、电影、电视节目和其他数字内容。该平台最初是作为Windows 8的一部分引入的&#xff0c;后来也适用于Windows 10和其他Microsoft平台。 以下是Microsof…

ROS——用VirtualBox虚拟一台计算机

打开软件后会出现这个界面&#xff0c;点击新建 然后出现这个界面 名称可以自己任取 &#xff0c;点击文件夹后边的箭头会出现这个界面&#xff0c;点其他可以自己选择虚拟机位置&#xff0c;默认C盘 版本和类型因为我们需要的是 Ubuntu&#xff0c;所以类型选择Linux&#xf…

Neo4j 新手教程 环境安装 基础增删改查 python链接 常用操作 纯新手向

Neo4j安装教程&#x1f680; 目前在学习知识图谱的相关内容&#xff0c;在图数据库中最有名的就是Neo4j,为了降低入门难度&#xff0c;不被网上很多华丽呼哨的Cypher命令吓退&#xff0c;故分享出该文档&#xff0c;为自己手动总结&#xff0c;包括安装环境&#xff0c;增删改查…

LeetCode146题:LRU缓存(python3)

代码思路&#xff1a; Python 默认是用 dict 存储属性的&#xff0c;每次用 . 访问属性都需要查字典。如果声明 slots 就不会创建字典&#xff0c;而是改用指针偏移量直接拿到属性对象。所以即节省了内存&#xff08;没有字典&#xff09;又节省了时间&#xff08;省去查字典的…

k8s-生产级的k8s高可用(1) 24

高可用集群 实验至少需要三个master&#xff08;控制节点&#xff09;&#xff0c;一个可以使外部可以访问到master的load balancer&#xff08;负载均衡&#xff09;以及一个或多个外部节点worker&#xff08;也要部署高可用&#xff09;。 再克隆三台主机 清理并重启 配置两…

Vue 项目性能优化指南:提升应用速度与效率

&#x1f90d; 前端开发工程师、技术日更博主、已过CET6 &#x1f368; 阿珊和她的猫_CSDN博客专家、23年度博客之星前端领域TOP1 &#x1f560; 牛客高级专题作者、打造专栏《前端面试必备》 、《2024面试高频手撕题》 &#x1f35a; 蓝桥云课签约作者、上架课程《Vue.js 和 E…

Pinctrl子系统_04_Pinctrl子系统主要数据结构

引言 本节说明Pinctrl子系统中主要的数据结构&#xff0c;对这些数据结构有所了解&#xff0c;也就是对Pinctrl子系统有所了解了。 前面说过&#xff0c;要使用Pinctrl子系统&#xff0c;就需要去配置设备树。 以内核面向对象的思想&#xff0c;设备树可以分为两部分&#x…

7. 镜面网格

E . 镜面网格 E.镜面网格 E.镜面网格 每次测试时限&#xff1a; 2 秒 每次测试时限&#xff1a;2 秒 每次测试时限&#xff1a;2秒 每次测试的内存限制&#xff1a; 256 兆字节 每次测试的内存限制&#xff1a;256 兆字节 每次测试的内存限制&#xff1a;256兆字节 题目描述 给…

深度学习与人类的智能交互:迈向自然与高效的人机新纪元

引言 随着科技的飞速发展&#xff0c;深度学习作为人工智能领域的一颗璀璨明珠&#xff0c;正日益展现出其在模拟人类认知和感知过程中的强大能力。本文旨在探讨深度学习如何日益逼近人类智能的边界&#xff0c;并通过模拟人类的感知系统&#xff0c;使机器能更深入地理解和解…

每日OJ题_牛客HJ86 求最大连续bit数(IO型OJ)

目录 牛客HJ86 求最大连续bit数 解法代码 牛客HJ86 求最大连续bit数 求最大连续bit数_牛客题霸_牛客网 解法代码 #include <iostream> using namespace std; int main() {int n 0, cnt 0, ret 0;cin >> n;for (int i 0; i < 32; i){if (n & (1 <…

uniapp富文本编辑-editor-vue2-vue3-wangeditor

前言 除了“微信小程序”&#xff0c;其他小程序想要使用editor组件实现富文本编辑&#xff0c;很难vue3项目 官方组件editor&#xff0c;在初始化时有点麻烦&#xff0c;建议搭配第三方组件wangeditor 写在前面 - editor组件缺少editor-icon.css 内容另存为editor-icon.css…

Springboot+vue的物业管理系统(有报告)。Javaee项目,springboot vue前后端分离项目。

演示视频&#xff1a; Springbootvue的物业管理系统&#xff08;有报告&#xff09;。Javaee项目&#xff0c;springboot vue前后端分离项目。 项目介绍&#xff1a; 本文设计了一个基于Springbootvue的物业管理系统&#xff0c;采用M&#xff08;model&#xff09;V&#xff…

【Haproxy】Haproxy的配置和应用

HAProxy介绍 HAProxy是法国开发者威利塔罗(Willy Tarreau)在2000年使用C语言开发的一个开源软件&#xff0c;是一款具备高并发(一万以上)、高性能的TCP和HTTP负载均衡器&#xff0c;支持基于cookie的持久性&#xff0c;自动故障切换&#xff0c;支持正则表达式及web状态统计&a…

server win搭建apache网站服务器+php网站+MY SQL数据库调用电子阅览室

一、适用场景&#xff1a; 1、使用开源的免费数据库Mysql&#xff1b; 2、自己建网站的发布&#xff1b; 3、使用php代码建网站&#xff1b; 4、使用windows server作为服务器&#xff1b; 5、使用apache作为网站服务器。 二、win server 中apache网站服务器搭建 &#xff0…

AlexNet 网络结构详解

一、基本了解 什么是过拟合&#xff1f; 解决方法 AlexNet网络结构通过使用dropout方法&#xff0c;使一些神经元失活&#xff0c;变相的减少了网络训练的参数化&#xff0c;从而实现减少过拟合。 二、AlexNet网络结构的详细解释 他是由上下两组GPU进行运算的&#xff0c;所以…

数据结构 - 栈和队列

本篇博客将介绍栈和队列的定义以及实现。 1.栈的定义 栈是一种特殊的线性表&#xff0c;只允许在固定的一端进行插入和删除数据&#xff0c;插入数据的一端叫做栈顶&#xff0c;另一端叫做栈底。栈中的数据遵守后进先出的原则 LIFO (Last In First Out)。 插入数据的操作称为压…

遥感卫星影像数据产品级别概述及卫星影像获取

1986年&#xff0c;美国航空航天局&#xff08;NASA&#xff09;定义了一系列数据处理"级别"&#xff0c;用以区分源于其地球观测系统&#xff08;EOS&#xff09;卫星获取的影像生成的标准数据产品。给定任何数据产品&#xff0c;我们可以根据其级别来判断其在生产过…

机器学习--循环神经网路(RNN)2

在这篇文章中&#xff0c;我们介绍一下其他的RNN。 一.深层RNN 循环神经网络的架构是可以任意设计的&#xff0c;之前提到的 RNN 只有一个隐藏层&#xff0c;但 RNN 也可以是深层的。比如把 xt 丢进去之后&#xff0c;它可以通过一个隐藏层&#xff0c;再通过第二个隐藏层&am…

初识Hive

官网地址为&#xff1a; Design - Apache Hive - Apache Software Foundation 一、架构 先来看下官网给的图&#xff1a; 图上显示了Hive的主要组件及其与Hadoop的交互。Hive的主要组件有&#xff1a; UI&#xff1a; 用户向系统提交查询和其他操作的用户界面。截至2011年&…