网站建设做哪个科目/青岛官网seo

网站建设做哪个科目,青岛官网seo,智能科技 光速东莞网站建设,有哪个网站做正品港货一、简单版本 LineChart.tsx // src/component/LineChart/LineChart.tsx import React, {useEffect,useRef,useImperativeHandle,forwardRef,useMemo,useCallback, } from react; import * as echarts from echarts/core; import type { ComposeOption } from echarts/core; …

一、简单版本 

  •  LineChart.tsx
// src/component/LineChart/LineChart.tsx
import React, {useEffect,useRef,useImperativeHandle,forwardRef,useMemo,useCallback,
} from 'react';
import * as echarts from 'echarts/core';
import type { ComposeOption } from 'echarts/core';
import type { LineSeriesOption } from 'echarts/charts';
import type {GridComponentOption,TooltipComponentOption,LegendComponentOption,
} from 'echarts/components';
import { SVGRenderer } from 'echarts/renderers';
import ResizeObserver from 'resize-observer-polyfill';
import classNames from 'classnames';
import { numberWithCommas } from '@/utils/numberWithCommas';
import './LineChart.css';// 注册必要组件
const { LineChart: ELineChart } = require('echarts/charts');
const {GridComponent,TooltipComponent,LegendComponent,
} = require('echarts/components');echarts.use([ELineChart,GridComponent,TooltipComponent,LegendComponent,SVGRenderer,
]);type ECOption = ComposeOption<| LineSeriesOption| GridComponentOption| TooltipComponentOption| LegendComponentOption
>;export interface IChartData {date: string;value: number | string;
}interface ExtraDataItem {data: IChartData[];rgbColor: number[];colorPrefix?: string;labelPrefix?: string;
}interface LineChartProps {data: IChartData[];extraData?: ExtraDataItem[];rgbColor?: number[];xAxisName?: string;yAxisName?: string;valueUnit?: string;isEmptyTipsVisible?: boolean;labelPrefix?: string;colorPrefix?: string;labelProcessor?: (data: IChartData) => string;renderTooltip?: (params: any) => string;name?: string;isOriginX?: boolean;height?: string;yAxisTextAlign?: 'left' | 'center' | 'right';
}export interface LineChartHandle {showLoading: () => void;hideLoading: () => void;getInstance: () => echarts.ECharts | null;
}const LineChart = forwardRef<LineChartHandle, LineChartProps>(({data,extraData = [],rgbColor = [255, 150, 0],xAxisName = '日期',yAxisName = '流水金额(元)',valueUnit = '元',isEmptyTipsVisible = false,labelPrefix,colorPrefix,labelProcessor,renderTooltip,name = 'tmp',isOriginX = false,height = '200px',yAxisTextAlign = 'center',
}, ref) => {const chartRef = useRef<HTMLDivElement>(null);const chartInstance = useRef<echarts.ECharts | null>(null);const observerRef = useRef<ResizeObserver | null>(null);// 修改后的x轴数据处理逻辑const xAxisData = useMemo(() => {const dataSources = [data, ...extraData.map(item => item.data)];const validData = dataSources.find(d => d?.length) || [];return validData.map((item: IChartData) =>(isOriginX? item.date: item.date.split('-')[2]), // 直接取日期部分(第三个分割项));}, [data, extraData, isOriginX]);// 修改系列配置保留完整数据对象const createSeries = useCallback((color: number[],seriesData: IChartData[],seriesName?: string,): LineSeriesOption => ({name: seriesName || 'tmp',data: seriesData, // 保留完整数据对象type: 'line',encode: {x: 'date',  // 指定x轴字段y: 'value',  // 指定y轴字段},// 其他保持不变的配置...smooth: true,symbol: 'circle',symbolSize: 8,areaStyle: {color: {type: 'linear',x: 0,y: 0,x2: 0,y2: 1,colorStops: [{ offset: 0, color: `rgba(${color.join(',')},0.7)` },{ offset: 1, color: `rgba(${color.join(',')},0)` },],},},itemStyle: {color: `rgb(${color.join(',')})`,borderColor: 'white',borderWidth: 2,},}), []);// 获取图表配置const getOptions = useCallback((): ECOption => {const yAxisCache: Record<string, boolean> = {};return {grid: {// left: 40,left: 60, // 增加左侧间距right: 30,bottom: 60, // 足够空间防止裁剪top: 40,},xAxis: {name: `{offset|${xAxisName}}`,nameLocation: 'end',nameGap: 5,nameTextStyle: {rich: {offset: {lineHeight: 24, // 增加行高实现下移padding: [8, 0, 0, 0], // 调整上边距align: 'center',color: '#999',fontSize: 12,},},},data: xAxisData,axisLine: {lineStyle: { width: 1, color: '#D5D9E0' },},axisLabel: { color: '#999' },axisTick: { alignWithLabel: true },axisPointer: {show: true,type: 'line',lineStyle: {type: 'dashed',color: `rgb(${rgbColor.join(',')})`,},},},yAxis: {name: yAxisName,nameTextStyle: {color: '#999',fontSize: 12,padding: [0, 0, 0, 0],align: yAxisTextAlign,},type: 'value',splitLine: {lineStyle: {color: '#E6E9F0',type: 'dashed',},},axisLine: { show: false },axisLabel: {color: '#999',margin: 0,interval: 1, // ✅ 正确间隔控制formatter: (value: number) => { // ✅ 移除index参数let result = String(value);if (value >= 1e8) result = `${(value / 1e8).toFixed(1)}亿`;else if (value >= 1e7) result = `${(value / 1e7).toFixed(1)}kw`;else if (value >= 1e4) result = `${(value / 1e4).toFixed(1)}w`;return `${result}${valueUnit}`; // ✅ 直接返回结果}},axisTick: { show: false },},// 在图表配置中修改tooltip配置项tooltip: {trigger: 'axis',backgroundColor: 'rgba(17,18,18,0.7)', // 加深背景色textStyle: {color: '#fff', // 明确设置字体颜色fontSize: 12,lineHeight: 17, // 增加行高},// 修改tooltip formatter部分formatter: (params: any) => {if (renderTooltip) return renderTooltip(params);const firstParam = params?.[0];if (!firstParam) return '';// 安全访问数据const dataIndex = firstParam.dataIndex;const dateValue = firstParam.data?.date || '';// 正确解析日期格式const [year, month, day] = dateValue.split('-');const partial = isOriginX? [dateValue]: [`${month}月${day}日`]; // 直接使用分割后的月日// 处理主数据if (data?.length && data[dataIndex]) {const currentData = data[dataIndex];// 带2位小数(银行金额常用格式)const moneyFormat = new Intl.NumberFormat('zh-CN', {style: 'decimal',});const value = labelProcessor?.(currentData) || moneyFormat.format(Number(currentData.value));partial.push(`${colorPrefix ? `<div class="color-dot" style="background:${colorPrefix}"></div>` : ''}${labelPrefix || ''} ${value} ${valueUnit}`,);}// 处理额外数据extraData?.forEach(item => {if (item.data[dataIndex]) {const currentValue = item.data[dataIndex].value;const value = numberWithCommas(Number(currentValue));partial.push(`${item.colorPrefix ? `<div class="color-dot" style="background:${item.colorPrefix}"></div>` : ''}${item.labelPrefix || ''} ${value} ${valueUnit}`,);}});return partial.join('</br>');},padding: [8, 18, 8, 18],},series: [...(extraData?.map(item =>createSeries(item.rgbColor, item.data, item.labelPrefix),) || []),createSeries(rgbColor, data, name),],};}, [xAxisData, rgbColor, extraData, data, name, isOriginX, xAxisName, yAxisName, yAxisTextAlign, valueUnit, renderTooltip, labelProcessor, colorPrefix, labelPrefix, createSeries]);// 初始化图表useEffect(() => {if (!chartRef.current) return;chartInstance.current = echarts.init(chartRef.current, null, {renderer: 'svg',});chartInstance.current.setOption(getOptions());// 响应式处理const resizeHandler = () => chartInstance.current?.resize();observerRef.current = new ResizeObserver(() => resizeHandler());observerRef.current.observe(chartRef.current);return () => {observerRef.current?.disconnect();chartInstance.current?.dispose();};}, [getOptions]);// 更新图表useEffect(() => {chartInstance.current?.setOption(getOptions());}, [getOptions]);// 暴露组件方法useImperativeHandle(ref, () => ({showLoading: () => {chartInstance.current?.showLoading({text: '',color: '#FF9600',});},hideLoading: () => chartInstance.current?.hideLoading(),getInstance: () => chartInstance.current,}));return (<div className="line-chart" style={{ height }}><div ref={chartRef} className="chart" /><div className={classNames('empty-tips', { 'empty-tips--visible': isEmptyTipsVisible })}>暂无数据, 本月活跃大神的数据将在当月2号6时以后更新.</div></div>);
});export default LineChart;
  • LineChart.css
/* src/components/LineChart/LineChart.css */
.line-chart {width: 100%;position: relative;/* 添加最小高度防止内容塌陷 */min-height: 120px;
}.chart {width: 100%;height: 100%;/* 修复图表可能出现的模糊问题 */transform: translateZ(0);
}.empty-tips {/* 优化空状态样式 */position: absolute;width: 80%;max-width: 280px;padding: 16px;left: 50%;top: 50%;transform: translate(-50%, -50%);background: rgba(0, 0, 0, 0.65);border-radius: 8px;color: #fff;font-size: 14px;text-align: center;line-height: 1.5;opacity: 0;transition: opacity 0.3s;pointer-events: none;
}.empty-tips--visible {opacity: 1;/* 添加轻微动画 */animation: fade-in 0.3s ease;
}/* 新增tooltip容器样式 */
.echarts-tooltip {box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;border-radius: 8px !important;backdrop-filter: blur(4px);
}.color-dot {/* 优化颜色点显示 */width: 10px;height: 10px;border-radius: 50%;margin-right: 6px;box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);/* 修复对齐问题 */display: inline-flex;vertical-align: baseline;
}@keyframes fade-in {from { opacity: 0; transform: translate(-50%, -45%); }to { opacity: 1; transform: translate(-50%, -50%); }
}
  • DashboardPage.tsx
// src/pages/Dashboard/index.tsx
import React, { useRef } from 'react';
import LineChart, {IChartData, LineChartHandle} from '@/component/LineChart';const DashboardPage = () => {const chartRef = useRef<LineChartHandle>(null);// 示例数据const data: IChartData[] = [{ date: '2024-05-01', value: 12345670 },{ date: '2024-05-02', value: 2345678 },{ date: '2024-05-03', value: 3456789 },{ date: '2024-05-04', value: 0 },];const extraData = [{data: [{ date: '2024-05-01', value: 5000000 },{ date: '2024-05-02', value: 600000 },{ date: '2024-05-03', value: 700000 },{ date: '2024-05-04', value: 0 },],rgbColor: [100, 200, 255],colorPrefix: '#64c8ff',labelPrefix: '辅助流水',},];return (<div style={{ padding: 24 }}><h2>数据看板</h2><div style={{ marginTop: 20, height: '500px' }}><LineChartref={chartRef}data={data}extraData={extraData}rgbColor={[255, 150, 0]}height="100%"xAxisName="日期"yAxisName="流水金额(元)"valueUnit="元"colorPrefix="#FF9600"labelPrefix="主要流水"/></div></div>);
};export default DashboardPage;

二、优化版本,价格interval

  • LineChart.tsx
// src/components/LineChart/LineChart.tsx
import React, {useEffect,useRef,useImperativeHandle,forwardRef,useMemo,useCallback,
} from 'react';
import * as echarts from 'echarts/core';
import type { ComposeOption } from 'echarts/core';
import type { LineSeriesOption } from 'echarts/charts';
import type {GridComponentOption,TooltipComponentOption,LegendComponentOption,
} from 'echarts/components';
import { SVGRenderer } from 'echarts/renderers';
import ResizeObserver from 'resize-observer-polyfill';
import classNames from 'classnames';
import { numberWithCommas } from '@/utils/numberWithCommas';
import './LineChart.css';// 注册必要组件
const { LineChart: ELineChart } = require('echarts/charts');
const {GridComponent,TooltipComponent,LegendComponent,
} = require('echarts/components');echarts.use([ELineChart,GridComponent,TooltipComponent,LegendComponent,SVGRenderer,
]);type ECOption = ComposeOption<| LineSeriesOption| GridComponentOption| TooltipComponentOption| LegendComponentOption
>;export interface IChartData {date: string;value: number | string;
}interface ExtraDataItem {data: IChartData[];rgbColor: number[];colorPrefix?: string;labelPrefix?: string;
}interface LineChartProps {data: IChartData[];extraData?: ExtraDataItem[];rgbColor?: number[];xAxisName?: string;yAxisName?: string;valueUnit?: string;isEmptyTipsVisible?: boolean;labelPrefix?: string;colorPrefix?: string;labelProcessor?: (data: IChartData) => string;renderTooltip?: (params: any) => string;name?: string;isOriginX?: boolean;height?: string;yAxisTextAlign?: 'left' | 'center' | 'right';interval?: number; // 日期间隔步长,例如:2就代表每隔一天 (01,03,05,...)
}export interface LineChartHandle {showLoading: () => void;hideLoading: () => void;getInstance: () => echarts.ECharts | null;
}const LineChart = forwardRef<LineChartHandle, LineChartProps>(({data,extraData = [],rgbColor = [255, 150, 0],xAxisName = '日期',yAxisName = '流水金额(元)',valueUnit = '元',isEmptyTipsVisible = false,labelPrefix,colorPrefix,labelProcessor,renderTooltip,name = 'tmp',isOriginX = false,height = '200px',yAxisTextAlign = 'center',interval = 1,
}, ref) => {const chartRef = useRef<HTMLDivElement>(null);const chartInstance = useRef<echarts.ECharts | null>(null);const observerRef = useRef<ResizeObserver | null>(null);// 修改后的x轴数据处理逻辑const xAxisData = useMemo(() => {const dataSources = [data, ...extraData.map(item => item.data)];const validData = dataSources.find(d => d?.length) || [];return validData.map((item: IChartData) =>(isOriginX? item.date: item.date.split('-')[2]), // 直接取日期部分(第三个分割项));}, [data, extraData, isOriginX]);// 修改系列配置保留完整数据对象const createSeries = useCallback((color: number[],seriesData: IChartData[],seriesName?: string,): LineSeriesOption => ({name: seriesName || 'tmp',data: seriesData, // 保留完整数据对象type: 'line',encode: {x: 'date',  // 指定x轴字段y: 'value',  // 指定y轴字段},// 其他保持不变的配置...smooth: true,symbol: 'circle',symbolSize: 8,areaStyle: {color: {type: 'linear',x: 0,y: 0,x2: 0,y2: 1,colorStops: [{ offset: 0, color: `rgba(${color.join(',')},0.7)` },{ offset: 1, color: `rgba(${color.join(',')},0)` },],},},itemStyle: {color: `rgb(${color.join(',')})`,borderColor: 'white',borderWidth: 2,},}), []);// 获取图表配置const getOptions = useCallback((): ECOption => {const yAxisCache: Record<string, boolean> = {};return {grid: {// left: 40,left: 60, // 增加左侧间距right: 30,bottom: 60, // 足够空间防止裁剪top: 40,},xAxis: {name: `{offset|${xAxisName}}`,nameLocation: 'end',nameGap: 5,nameTextStyle: {rich: {offset: {lineHeight: 24, // 增加行高实现下移padding: [8, 0, 0, 0], // 调整上边距align: 'center',color: '#999',fontSize: 12,},},},data: xAxisData,axisLine: {lineStyle: { width: 1, color: '#D5D9E0' },},axisLabel: {interval: 0, // 显示所有标签color: '#999',formatter: (value: string, index: number) => {return index % interval === 0 ? value : ''; // 不满足间隔时返回空},},axisTick: { alignWithLabel: true },axisPointer: {show: true,type: 'line',lineStyle: {type: 'dashed',color: `rgb(${rgbColor.join(',')})`,},},},yAxis: {name: yAxisName,nameTextStyle: {color: '#999',fontSize: 12,padding: [0, 0, 0, 0],align: yAxisTextAlign,},type: 'value',splitLine: {lineStyle: {color: '#E6E9F0',type: 'dashed',},},axisLine: { show: false },axisLabel: {color: '#999',margin: 0,interval: 1, // ✅ 正确间隔控制formatter: (value: number) => { // ✅ 移除index参数let result = String(value);if (value >= 1e8) result = `${(value / 1e8).toFixed(1)}亿`;else if (value >= 1e7) result = `${(value / 1e7).toFixed(1)}kw`;else if (value >= 1e4) result = `${(value / 1e4).toFixed(1)}w`;return `${result}${valueUnit}`; // ✅ 直接返回结果},},axisTick: { show: false },},// 在图表配置中修改tooltip配置项tooltip: {trigger: 'axis',backgroundColor: 'rgba(17,18,18,0.7)', // 加深背景色textStyle: {color: '#fff', // 明确设置字体颜色fontSize: 12,lineHeight: 17, // 增加行高},// 修改tooltip formatter部分formatter: (params: any) => {if (renderTooltip) return renderTooltip(params);const firstParam = params?.[0];if (!firstParam) return '';// 安全访问数据const dataIndex = firstParam.dataIndex;const dateValue = firstParam.data?.date || '';// 正确解析日期格式const [year, month, day] = dateValue.split('-');const partial = isOriginX? [dateValue]: [`${month}月${day}日`]; // 直接使用分割后的月日// 处理主数据if (data?.length && data[dataIndex]) {const currentData = data[dataIndex];// 带2位小数(银行金额常用格式)const moneyFormat = new Intl.NumberFormat('zh-CN', {style: 'decimal',});const value = labelProcessor?.(currentData) || moneyFormat.format(Number(currentData.value));partial.push(`${colorPrefix ? `<div class="color-dot" style="background:${colorPrefix}"></div>` : ''}${labelPrefix || ''} ${value} ${valueUnit}`,);}// 处理额外数据extraData?.forEach(item => {if (item.data[dataIndex]) {const currentValue = item.data[dataIndex].value;const value = numberWithCommas(Number(currentValue));partial.push(`${item.colorPrefix ? `<div class="color-dot" style="background:${item.colorPrefix}"></div>` : ''}${item.labelPrefix || ''} ${value} ${valueUnit}`,);}});return partial.join('</br>');},padding: [8, 18, 8, 18],},series: [...(extraData?.map(item =>createSeries(item.rgbColor, item.data, item.labelPrefix),) || []),createSeries(rgbColor, data, name),],};}, [xAxisData, rgbColor, extraData, data, name, isOriginX, xAxisName, yAxisName, yAxisTextAlign, valueUnit, renderTooltip, labelProcessor, colorPrefix, labelPrefix, createSeries]);// 初始化图表useEffect(() => {if (!chartRef.current) return;chartInstance.current = echarts.init(chartRef.current, null, {renderer: 'svg',});chartInstance.current.setOption(getOptions());// 响应式处理const resizeHandler = () => chartInstance.current?.resize();observerRef.current = new ResizeObserver(() => resizeHandler());observerRef.current.observe(chartRef.current);return () => {observerRef.current?.disconnect();chartInstance.current?.dispose();};}, [getOptions]);// 更新图表useEffect(() => {chartInstance.current?.setOption(getOptions());}, [getOptions]);// 暴露组件方法useImperativeHandle(ref, () => ({showLoading: () => {chartInstance.current?.showLoading({text: '',color: '#FF9600',});},hideLoading: () => chartInstance.current?.hideLoading(),getInstance: () => chartInstance.current,}));return (<div className="line-chart" style={{ height }}><div ref={chartRef} className="chart" /><div className={classNames('empty-tips', { 'empty-tips--visible': isEmptyTipsVisible })}>暂无数据, 本月活跃大神的数据将在当月2号6时以后更新.</div></div>);
});export default LineChart;
  • LineChart.css
/* src/components/LineChart/LineChart.css */
.line-chart {width: 100%;position: relative;/* 添加最小高度防止内容塌陷 */min-height: 120px;
}.chart {width: 100%;height: 100%;/* 修复图表可能出现的模糊问题 */transform: translateZ(0);
}.empty-tips {/* 优化空状态样式 */position: absolute;width: 80%;max-width: 280px;padding: 16px;left: 50%;top: 50%;transform: translate(-50%, -50%);background: rgba(0, 0, 0, 0.65);border-radius: 8px;color: #fff;font-size: 14px;text-align: center;line-height: 1.5;opacity: 0;transition: opacity 0.3s;pointer-events: none;
}.empty-tips--visible {opacity: 1;/* 添加轻微动画 */animation: fade-in 0.3s ease;
}/* 新增tooltip容器样式 */
.echarts-tooltip {box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;border-radius: 8px !important;backdrop-filter: blur(4px);
}.color-dot {/* 优化颜色点显示 */width: 10px;height: 10px;border-radius: 50%;margin-right: 6px;box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);/* 修复对齐问题 */display: inline-flex;vertical-align: baseline;
}@keyframes fade-in {from { opacity: 0; transform: translate(-50%, -45%); }to { opacity: 1; transform: translate(-50%, -50%); }
}
  • DashboardPage.tsx
import React, { useRef } from 'react';
import LineChart, {IChartData, LineChartHandle} from '@/component/LineChart';const DashboardPage = () => {const chartRef = useRef<LineChartHandle>(null);// 生成完整5月份数据(31天)const generateMonthlyData = () => {const daysInMonth = 31;const baseValue = 10000000; // 基础值1千万const data: IChartData[] = [];const extra: IChartData[] = [];// 带波动的数据生成函数const generateDataPoint = (day: number, isExtra = false) => {// 基础波动(-20% ~ +20%)let fluctuation = 1 + (Math.random() * 0.4 - 0.2);// 周末效应(周六周日减少15%)const date = new Date(2024, 4, day);if ([0, 6].includes(date.getDay())) {fluctuation *= 0.85;}// 月末促销(最后三天增加40%)if (day > 28) fluctuation *= 1.4;// 额外数据波动较小(-15% ~ +15%)if (isExtra) {fluctuation = 1 + (Math.random() * 0.3 - 0.15);return baseValue * 0.4 * fluctuation; // 主数据的40%左右}return baseValue * fluctuation;};for (let day = 1; day <= daysInMonth; day++) {const dateString = new Date(2024, 4, day).toLocaleDateString('zh-CN', {year: 'numeric',month: '2-digit',day: '2-digit',}).replace(/\//g, '-');data.push({date: dateString,value: Math.round(generateDataPoint(day)),});extra.push({date: dateString,value: Math.round(generateDataPoint(day, true)),});}return { data, extra };};const { data, extra } = generateMonthlyData();const extraData = [{data: extra,rgbColor: [100, 200, 255],colorPrefix: '#64c8ff',labelPrefix: '辅助流水',},];return (<div style={{ padding: 24 }}><h2>数据看板</h2><div style={{ marginTop: 20, height: '500px' }}><LineChartref={chartRef}data={data}extraData={extraData}rgbColor={[255, 150, 0]}height="100%"xAxisName="日期"yAxisName="流水金额(元)"valueUnit="元"colorPrefix="#FF9600"labelPrefix="主要流水"interval={2}/></div></div>);
};export default DashboardPage;

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

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

相关文章

Web前端考核 JavaScript知识点详解

一、JavaScript 基础语法 1.1 变量声明 关键字作用域提升重复声明暂时性死区var函数级✅✅❌let块级❌❌✅const块级❌❌✅ 1.1.1变量提升的例子 在 JavaScript 中&#xff0c;var 声明的变量会存在变量提升的现象&#xff0c;而 let 和 const 则不会。变量提升是指变量的声…

使用 Go 构建 MCP Server

一个互联网技术玩家&#xff0c;一个爱聊技术的家伙。在工作和学习中不断思考&#xff0c;把这些思考总结出来&#xff0c;并分享&#xff0c;和大家一起交流进步。 一、MCP 介绍 1. 基本介绍 MCP&#xff08;Model Context Protocol&#xff0c;模型上下文协议&#xff09;是…

CES Asia 2025赛逸展:科技浪潮中的创新与商贸盛会

在科技发展日新月异的当下&#xff0c;CES Asia 2025第七届亚洲消费电子技术贸易展&#xff08;赛逸展&#xff09;正积极筹备&#xff0c;将在北京举办&#xff0c;有望成为亚洲消费电子领域极具影响力的年度盛会。作为亚洲科技领域的重要展会&#xff0c;此次得到了数十家电子…

Windows桌面采集技术

在进入具体的方式讨论前&#xff0c;我们先看看 Windows 桌面图形界面的简化架构&#xff0c;如下图&#xff1a; 在 Windows Vista 之前&#xff0c;Windows 界面的复合画面经由 Graphics Device Interface&#xff08;以下简称 GDI&#xff09;技术直接渲染到桌面上。 在 Wi…

ElementPlus 快速入门

目录 前言 为什么要学习 ElementPlus&#xff1f; 正文 步骤 1 创建 一个工程化的vue 项目 ​2 安装 element-Plus :Form 表单 | Element Plus 1 点击 当前界面的指南 2 点击左边菜单栏上的安装&#xff0c;选择包管理器 3 运行该命令 demo(案例1 &#xff09; 步骤 …

[蓝桥杯 2023 省 A] 异或和之和

题目来自洛谷网站&#xff1a; 暴力思路&#xff1a; 先进性预处理&#xff0c;找到每个点位置的前缀异或和&#xff0c;在枚举区间。 暴力代码&#xff1a; #include<bits/stdc.h> #define int long long using namespace std; const int N 1e520;int n; int arr[N…

python学习笔记--实现简单的爬虫(二)

任务&#xff1a;爬取B站上最爱欢迎的编程课程 网址&#xff1a;编程-哔哩哔哩_bilibili 打开网页的代码模块&#xff0c;如下图&#xff1a; 标题均位于class_"bili-video-card__info--tit"的h3标签中&#xff0c;下面通过代码来实现&#xff0c;需要说明的是URL中…

windows清除电脑开机密码,可保留原本的系统和资料,不重装系统

前言 很久的一台电脑没有使用了&#xff0c;开机密码忘了&#xff0c;进不去系统 方法 1.将一个闲置u盘设置成pe盘&#xff08;注意&#xff0c;这个操作会清空原来u盘的数据&#xff0c;需要在配置前将重要数据转移走&#xff0c;数据无价&#xff0c;别因为配置这个丢了重…

5.4 位运算专题:LeetCode 137. 只出现一次的数字 II

1. 题目链接 LeetCode 137. 只出现一次的数字 II 2. 题目描述 给定一个整数数组 nums&#xff0c;其中每个元素均出现 三次&#xff0c;除了一个元素只出现 一次。请找出这个只出现一次的元素。 要求&#xff1a; 时间复杂度为 O(n)&#xff0c;空间复杂度为 O(1)。 示例&a…

C语言:扫雷

在编程的世界里&#xff0c;扫雷游戏是一个经典的实践项目。它不仅能帮助我们巩固编程知识&#xff0c;还能锻炼逻辑思维和解决问题的能力。今天&#xff0c;就让我们一起用 C 语言来实现这个有趣的游戏&#xff0c;并且通过图文并茂的方式&#xff0c;让每一步都清晰易懂 1. 游…

【论文#目标检测】YOLO9000: Better, Faster, Stronger

目录 摘要1.引言2.更好&#xff08;Better&#xff09;3.更快&#xff08;Faster&#xff09;4.更健壮&#xff08;Stronger&#xff09;使用 WordTree 组合数据集联合分类和检测评估 YOLO9000 5.结论 Author: Joseph Redmon; Ali Farhadi Published in: 2017 IEEE Conference …

大数据运维实战之YARN任务内存泄露排查实战:从节点掉线到精准定位的完整指南

1.问题背景&#xff1a;集群内存风暴引发的危机 最近某大数据集群频繁出现节点掉线事故&#xff0c;物理内存监控持续爆红。运维人员发现当节点内存使用率达到95%以上时&#xff0c;机器会进入不可响应状态&#xff0c;最终导致服务中断。这种"内存雪崩"现象往往由单…

AI+金融 应用 使用DeepSeek、Qwen等大模型输入自然语言,得到通达信等行情软件公式代码,导入后使用

AI金融 应用 使用DeepSeek、Qwen等大模型输入自然语言&#xff0c;得到通达信等行情软件公式代码&#xff0c;导入后使用。不会编程&#xff0c;也能行情软件中实现个性化条件选股&#xff0c;个性化技术指标。 AIbxm低估值趋势选股策略&#xff0c;参考提示词&#xff1a; 编…

多语言语料库万卷·丝路2.0开源,数据模态全面升级,搭建文化交流互鉴AI桥梁

3月22日&#xff0c;上海人工智能实验室&#xff08;上海AI实验室&#xff09;联合新华社新闻信息中心、上海外国语大学、外研在线等&#xff0c;发布全新升级的“万卷丝路2.0”多语言语料库&#xff0c;通过构建多语言开源数据底座&#xff0c;以人工智能赋能“一带一路”高质…

多语言生成语言模型的少样本学习

摘要 大规模生成语言模型&#xff0c;如GPT-3&#xff0c;是极具竞争力的少样本学习模型。尽管这些模型能够共同表示多种语言&#xff0c;但其训练数据以英语为主&#xff0c;这可能限制了它们的跨语言泛化能力。在本研究中&#xff0c;我们在一个涵盖多种语言的语料库上训练了…

Linux运维篇-系统io调优

目录 磁盘文件系统虚拟文件系统 文件系统的工作原理文件系统 I/OI/O 的分类缓冲与非缓冲 I/O直接与非直接 I/O阻塞与非阻塞 I/O同步与异步 I/O 查看文件系统容量目录项和索引节点缓存 通用块层I/O 栈磁盘性能指标磁盘 I/O 观测进程 I/O 观测I/O瓶颈的排查思路思路一思路二 I/O优…

C语言笔记(鹏哥)上课板书+课件汇总(动态内存管理)--数据结构常用

动态内存管理 引言&#xff1a;将内存升起一段空间存放数据有几种手段 创建变量&#xff1a;存放一个值创建数组&#xff1a;存放多个连续的一组值 以上开辟的内存空间是固定的&#xff0c;创建大了&#xff0c;空间浪费&#xff0c;创建小了&#xff0c;空间不够。并且一旦…

本地安装deepseek大模型,并使用 python 调用

首先进入 ollama 官网 https://ollama.com/点击下载 下载完成后所有都是下一步&#xff0c;就可以 点击搜索 Models &#xff1a; https://ollama.com/search然后点击下载&#xff1a; 选择后复制: ollama run deepseek-r1:32b例如&#xff1a; 让它安装完成后&#xff1…

Linux wifi driver 注册和设备探测流程

基础流程 wifi驱动加载&#xff08;insmod或者modprobe&#xff09; 设备驱动匹配探测&#xff08;我们常见的probe函数&#xff09; 整体流程 驱动加载 → 注册支持设备 → 设备插入 → 匹配驱动 → 初始化硬件 → 创建网络接口 明确两点 两个流程 驱动加载&#xf…

【机器人】复现 GrainGrasp 精细指导的灵巧手抓取

GrainGrasp为每个手指提供细粒度的接触指导&#xff0c;为灵巧手生成精细的抓取策略。 通过单独调整每个手指的接触来实现更稳定的抓取&#xff0c;从而提供了更接近人类能力的抓取指导。 论文地址&#xff1a;GrainGrasp: Dexterous Grasp Generation with Fine-grained Con…