【C++】unordered_set和unordered_map

底层哈希结构

namespace hash_bucket
{
	template<class T>
	struct HashData
	{
		T _data;
		struct HashData* next = nullptr;
		HashData(const T& data)
			:_data(data)
		{}
	};

	//仿函数:这里直接用开散列仿函数
	template <class K>
	struct HashFunc
	{
		size_t operator()(const K& key)
		{
			return (size_t)key;
		}
	};
	template <>
	struct HashFunc<string>//特化
	{
		size_t operator()(const string& key)
		{
			size_t res = 0;
			for (auto e : key)
			{
				res *= 131;
				res += e;
			}
			return res;
		}
	};

	//迭代器
	//前置声明
	template<class K, class T, class Hash, class KeyOfT>
	class HashTable;

	template<class K, class T, class Hash, class KeyOfT>
	struct _HashTableIterator
	{
		typedef HashData<T> Node;
		typedef HashTable<K, T, Hash, KeyOfT> Ht;
		typedef _HashTableIterator<K, T, Hash, KeyOfT> Self;

		Node* _node;
		Ht* _pht;

		_HashTableIterator(Node* node,Ht* pht)
			:_node(node)
			,_pht(pht){}
		T& operator*()
		{
			return _node->_data;
		}
		T* operator->()
		{
			return &_node->_data;
		}
		Self& operator++()
		{
			if (_node->next)
			{
				//当前桶
				_node = _node->next;
			}
			else
			{
				//下一个桶
				KeyOfT kot;
				Hash hash;
				size_t i = hash(kot(_node->_data)) % _pht->_size;
				for (++i; i < _pht->_tables.size(); i++)
				{
					if (_pht->_tables[i])
					{
						_node = _pht->_tables[i];
						if(node)
							break;
					}
				}
				if (i == _pht->_tables.size())
				{
					_node = nullptr;
				}
			}
			return *this;
		}
		bool operator!=(Self& s)const
		{
			return s._node != _node;
		}
		bool operator==(Self& s)const
		{
			return !operator!=(s);
		}
	};

	template<class K, class T, class Hash, class KeyOfT>
	class HashTable
	{
		typedef HashData<T> Node;
		typedef _HashTableIterator<K, T, Hash, KeyOfT> iterator;
	public:
		iterator begin()
		{
			for (size_t i = 0; i < _tables.size(); i++)
			{
				if (_tables[i] != nullptr)
					return iterator(_tables[i], this);
			}
			return end();
		}
		iterator end()
		{
			return iterator(nullptr, this);
		}
	public:
		HashTable()
			:_size(0)
			,_tables(10, nullptr)
		{}
		~HashTable()//这里的析构函数得自己添加,否则只会析构哈希表,导致节点数据没有被释放
		{
			//这里的操作和底下的打印有点像
			for (size_t i = 0; i < _tables.size(); i++)
			{
				Node* cur = _tables[i];
				while (cur)
				{
					Node* next = cur->next;
					delete cur;
					cur = next;
				}
				_tables[i] = nullptr;
			}
		}
		bool Insert(const T& data)
		{
			Hash hash;
			KeyOfT kot;

			if (Find(kot(data)))
				return false;

			//负载因子到 1 就扩容
			if (_size == _tables.size())//扩容
			{
				size_t newSize = _tables.size() * 2;
				vector<Node*> newTables(newSize, nullptr);
				size_t hashi = 0;
				for (size_t i = 0; i < _tables.size(); i++)
				{
					Node* cur = _tables[i];
					while (cur)
					{
						Node* next = cur->next;
						hashi = hash(kot(cur->_data)) % newTables.size();
						cur->next = newTables[hashi];
						newTables[hashi] = cur;
						cur = next;
					}
					_tables[i] = nullptr;
				}
				_tables.swap(newTables);
			}

			size_t hashi = hash(kot(data)) % _tables.size();
			//头插
			Node* old = _tables[hashi];
			_tables[hashi] = new Node(data);
			_tables[hashi]->next = old;
			_size++;
			return true;
		}
		Node* Find(const K& key)
		{
			if (_size == 0)
				return nullptr;

			Hash hash;
			KeyOfT kot;
			size_t hashi = hash(key) % _tables.size();
			Node* cur = nullptr;
			for (size_t i = 0; i < _tables.size(); i++)
			{
				cur = _tables[i];
				while (cur)
				{
					if (kot(cur->_data) == key)
					{
						return cur;
					}
					cur = cur->next;
				}
			}
			return nullptr;
		}
		void Print()
		{
			KeyOfT kot;
			for (size_t i = 0; i < _tables.size(); i++)
			{
				Node* cur = _tables[i];
				while (cur)
				{
					cout << "[" << kot(cur->_data) << ": " << kot(cur->_data) << "]-->";
					cur = cur->next;
				}
			}
			cout << endl;
		}
		bool Erase(const K& key)
		{
			Hash hash;
			KeyOfT kot;
			size_t hashi = hash(key) % _tables.size();
			Node* cur = _tables[hashi];
			Node* prev = nullptr;
			while (cur)
			{
				if (kot(cur->_data) == key)
				{
					if (prev)
					{
						prev->next = cur->next;
					}
					else
					{
						_tables[hashi] = cur->next;

					}
					delete cur;
					cur = nullptr;
					return true;
				}
				else
				{
					prev = cur;
					cur = cur->next;
				}
			}
			return false;
		}
		size_t size()
		{
			return _size;
		}
	private:
		size_t _size = 0;//有效数据个数
		vector<Node*> _tables;
	};
}

unordered_set

namespace hash_bucket
{
	template<class K, class Hash = HashFunc<K>>
	class unordered_set
	{
		struct SetKeyOfT
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
	private:
		HashTable<K, K,Hash,SetKeyOfT> _ht;
	public:
		typedef  typename HashTable<K, K, Hash, SetKeyOfT> ::iterator iterator;
		iterator begin()
		{
			return _ht.begin();
		}
		iterator end()
		{
			return _ht.end();
		}
		bool insert(const K& Node)
		{
			return _ht.Insert(Node);
		}
	};
	void unorderedset_test1()
	{
		unordered_set<int> s;

		s.insert(2);
		s.insert(4);
		s.insert(9);
		s.insert(1);
		s.insert(2);
		s.insert(3);

		for (auto e : s)
		{
			cout << e << " ";
		}
	}
}

unordered_map

namespace hash_bucket
{
	template<class K,class V, class Hash = HashFunc<K>>
	class unordered_map
	{
		struct MapKeyOfT
		{
			const K& operator()(const pair<K, V>& key)
			{
				return key.first;
			}
		};
	private:
		HashTable<K, pair<K, V>, Hash, MapKeyOfT> _ht;
	public:
		typedef  typename HashTable<K, pair<K, V>, Hash, MapKeyOfT>::iterator iterator;
		iterator begin()
		{
			return _ht.begin();
		}
		iterator end()
		{
			return _ht.end();
		}
		bool insert(const pair<K, V>& Node)
		{
			return _ht.Insert(Node);
		}
	};
	void unorderedmap_test1()
	{
		unordered_map<string, string> dict;
		dict.insert(make_pair("insert", "插入"));
		dict.insert(make_pair("sort" , "排序"));
		dict.insert(make_pair("delete", "删除"));
		dict.insert(make_pair("string", "字符串"));
		dict.insert(make_pair("iterator", "迭代器"));
		unordered_map<string, string>::iterator umit = dict.begin();
		//while (umit != dict.end())
		//{
		//	cout << umit->first << ":" << umit->second << endl;
		//	++umit;
		//}
		//cout << endl;
	}
}

此时编译:
在这里插入图片描述报错!
HashTable和其迭代器互相调用
从逻辑上讲,HashTable应该给迭代器开放权限,如下设置一个友元类即可
在这里插入图片描述
因为是模板故必须带参数。
经检测,以上代码有个小bug,可能会导致数据打印时无法跳出迭代器,形成死循环打印;
提示:错误点在该段代码中

		Self& operator++()
		{
			if (_node->next)
			{
				//当前桶
				_node = _node->next;
			}
			else
			{
				//下一个桶
				KeyOfT kot;
				Hash hash;
				size_t i = hash(kot(_node->_data)) % _pht->_size;
				for (++i; i < _pht->_tables.size(); i++)
				{
					if (_pht->_tables[i])
					{
						_node = _pht->_tables[i];
						if(node)
							break;
					}
				}
				if (i == _pht->_tables.size())
				{
					_node = nullptr;
				}
			}
			return *this;
		}

在这里插入图片描述
在这里我们是不是应该对哈希表的大小取模,而不是对现在的有效数据个数取模

size_t i = hash(kot(_node->_data)) % _pht->_tables.size();

完整代码

代码实现标准化,实现[ ]重载

#pragma once
#include "hash.h"
namespace hash_bucket
{
	template<class K, class Hash = HashFunc<K>>
	class unordered_set
	{
		struct SetKeyOfT
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};
	private:
		HashTable<K, K,Hash,SetKeyOfT> _ht;
	public:
		typedef  typename HashTable<K, K, Hash, SetKeyOfT> ::iterator iterator;
		iterator begin()
		{
			return _ht.begin();
		}
		iterator end()
		{
			return _ht.end();
		}
		pair<iterator, bool> insert(const K& Node)
		{
			return _ht.Insert(Node);
		}
	};
	void unorderedset_test1()
	{
		unordered_set<int> s;

		s.insert(2);
		s.insert(4);
		s.insert(9);
		s.insert(1);
		s.insert(2);
		s.insert(3);

		for (auto e : s)
		{
			cout << e << " ";
		}
	}
}
#pragma once
#include "hash.h"
namespace hash_bucket
{
	template<class K,class V, class Hash = HashFunc<K>>
	class unordered_map
	{
		struct MapKeyOfT
		{
			const K& operator()(const pair<K, V>& key)
			{
				return key.first;
			}
		};
	private:
		HashTable<K, pair<K, V>, Hash, MapKeyOfT> _ht;
	public:
		typedef  typename HashTable<K, pair<K, V>, Hash, MapKeyOfT>::iterator iterator;
		iterator begin()
		{
			return _ht.begin();
		}
		iterator end()
		{
			return _ht.end();
		}
		pair<iterator,bool> insert(const pair<K, V>& Node)
		{
			return _ht.Insert(Node);
		}
		V& operator[](const K& key)
		{
			pair<iterator, bool> ret = insert(make_pair(key, V()));
			return ret.first->second;
		}
	};
	void unorderedmap_test1()
	{
		unordered_map<string, string> dict;
		dict.insert(make_pair("insert", "插入"));
		dict.insert(make_pair("sort" , "排序"));
		dict.insert(make_pair("delete", "删除"));
		dict.insert(make_pair("string", "字符串"));
		dict.insert(make_pair("iterator", "迭代器"));
		unordered_map<string, string>::iterator umit = dict.begin();
		while (umit != dict.end())
		{
			cout << umit->first << ":" << umit->second << endl;
			++umit;
		}
		cout << endl;
	}
	void unorderedmap_test2()
	{
		string arr[] = { "梨子","苹果","猕猴桃","桃" ,"梨子","苹果", "猕猴桃","猕猴桃","猕猴桃","梨子","猕猴桃" };
		unordered_map<string, int> countMap;
		for (const auto& str : arr)
		{
			countMap[str]++;
		}
		unordered_map<string, int>::iterator it = countMap.begin();
		while (it != countMap.end())
		{
			cout << (*it).first << ":" << (*it).second << endl;
			++it;
		}
		cout << endl << endl;
		for (auto e : countMap)
		{
			cout << e.first << ":" << e.second << endl;
		}
		cout << endl;
	}
}
namespace hash_bucket
{
	template<class T>
	struct HashData
	{
		T _data;
		struct HashData* next = nullptr;
		HashData(const T& data)
			:_data(data)
		{}
	};

	//仿函数:这里直接用开散列仿函数
	template <class K>
	struct HashFunc
	{
		size_t operator()(const K& key)
		{
			return (size_t)key;
		}
	};
	template <>
	struct HashFunc<string>//特化
	{
		size_t operator()(const string& key)
		{
			size_t res = 0;
			for (auto e : key)
			{
				res *= 131;
				res += e;
			}
			return res;
		}
	};

	//迭代器
	//前置声明
	template<class K, class T, class Hash, class KeyOfT>
	class HashTable;

	template<class K, class T, class Hash, class KeyOfT>
	struct _HashTableIterator
	{
		typedef HashData<T> Node;
		typedef HashTable<K, T, Hash, KeyOfT> Ht;
		typedef _HashTableIterator<K, T, Hash, KeyOfT> Self;

		Node* _node;
		Ht* _pht;

		_HashTableIterator(Node* node,Ht* pht)
			:_node(node)
			,_pht(pht){}
		T& operator*()
		{
			return _node->_data;
		}
		T* operator->()
		{
			return &_node->_data;
		}
		Self& operator++()
		{
			if (_node->next)
			{
				//当前桶
				_node = _node->next;
			}
			else
			{
				//下一个桶
				KeyOfT kot;
				Hash hash;
				size_t i = hash(kot(_node->_data)) % _pht->_tables.size();
				for (++i; i < _pht->_tables.size(); i++)
				{
					if (_pht->_tables[i])
					{
						_node = _pht->_tables[i];
						if (_node)
						{
							break;
						}
					}
				}
				if (i == _pht->_tables.size())
				{
					_node = nullptr;
				}
			}
			return *this;
		}
		Self& operator++(int)
		{
			Self tmp = this;
			if (_node->next)
			{
				//当前桶
				_node = _node->next;
			}
			else
			{
				//下一个桶
				KeyOfT kot;
				Hash hash;
				size_t i = hash(kot(_node->_data)) % _pht->size();
				for (++i; i < _pht->_tables.size(); i++)
				{
					if (_pht->_tables[i])
					{
						_node = _pht->_tables[i];
						break;
					}
				}
				if (i == _pht->_tables.size())
				{
					_node = nullptr;
				}
			}
			return tmp;
		}
		bool operator!=(const Self& s) const
		{
			return s._node != _node;
		}
		bool operator==(const Self& s) const
		{
			return s._node == _node;
		}
	};

	template<class K, class T, class Hash, class KeyOfT>
	class HashTable
	{
		template<class K, class T, class Hash, class KeyOfT>
		friend struct _HashTableIterator;
		typedef HashData<T> Node;
	public:
		typedef _HashTableIterator<K, T, Hash, KeyOfT> iterator;
		iterator begin()
		{
			for (size_t i = 0; i < _tables.size(); i++)
			{
				if (_tables[i] != nullptr)
					return iterator(_tables[i], this);
			}
			return end();
		}
		iterator end()
		{
			return iterator(nullptr, this);
		}
	public:
		HashTable()
			:_size(0)
			,_tables(10, nullptr)
		{}
		~HashTable()//这里的析构函数得自己添加,否则只会析构哈希表,导致节点数据没有被释放
		{
			//这里的操作和底下的打印有点像
			for (size_t i = 0; i < _tables.size(); i++)
			{
				Node* cur = _tables[i];
				while (cur)
				{
					Node* next = cur->next;
					delete cur;
					cur = next;
				}
				_tables[i] = nullptr;
			}
		}
		pair<iterator,bool> Insert(const T& data)
		{
			Hash hash;
			KeyOfT kot;

			iterator ret = Find(kot(data));
			if (ret != end())
				return make_pair(ret, false); 

			//负载因子到 1 就扩容
			if (_size == _tables.size())//扩容
			{
				size_t newSize = _tables.size() * 2;
				vector<Node*> newTables(newSize, nullptr);
				//这里为了减少调用,不像开散列那样采用复用insert的形式,而是直接将原表中的节点拿下来直接用
				//而且复用insert的时候会涉及空间的申请释放问题(申请新节点,将旧节点的值给新节点,然后释放新旧结点)
				size_t hashi = 0;
				//旧表数据移到新表
				//特别注意:一个一个数据移动,不可一串一串移动,那样的话会造成映射位置错误,最后使其数据不能被正常找到
				for (size_t i = 0; i < _tables.size(); i++)
				{
					Node* cur = _tables[i];
					while (cur)
					{
						Node* next = cur->next;
						hashi = hash(kot(cur->_data)) % newTables.size();
						cur->next = newTables[hashi];
						newTables[hashi] = cur;
						cur = next;
					}
					_tables[i] = nullptr;
				}
				_tables.swap(newTables);
			}

			size_t hashi = hash(kot(data)) % _tables.size();
			//头插
			Node* old = _tables[hashi];
			_tables[hashi] = new Node(data);
			_tables[hashi]->next = old;
			_size++;
			return make_pair(iterator(_tables[hashi], this), true);
		}
		iterator Find(const K& key)
		{
			if (_size == 0)
				return iterator(nullptr, this);

			Hash hash;
			KeyOfT kot;
			size_t hashi = hash(key) % _tables.size();
			Node* cur = nullptr;
			for (size_t i = 0; i < _tables.size(); i++)
			{
				cur = _tables[i];
				while (cur)
				{
					if (kot(cur->_data) == key)
					{
						return iterator(cur, this);
					}
					cur = cur->next;
				}
			}
			return end();
		}
		void Print()
		{
			KeyOfT kot;
			for (size_t i = 0; i < _tables.size(); i++)
			{
				Node* cur = _tables[i];
				while (cur)
				{
					cout << "[" << kot(cur->_data) << ": " << kot(cur->_data) << "]-->";
					cur = cur->next;
				}
			}
			cout << endl;
		}
		bool Erase(const K& key)
		{
			Hash hash;
			KeyOfT kot;
			size_t hashi = hash(key) % _tables.size();
			Node* cur = _tables[hashi];
			Node* prev = nullptr;
			while (cur)
			{
				if (kot(cur->_data) == key)
				{
					if (prev)
					{
						prev->next = cur->next;
					}
					else
					{
						_tables[hashi] = cur->next;

					}
					delete cur;
					cur = nullptr;
					return true;
				}
				else
				{
					prev = cur;
					cur = cur->next;
				}
			}
			return false;
		}
		size_t size()
		{
			return _size;
		}
	private:
		size_t _size = 0;//有效数据个数
		vector<Node*> _tables;
	};
}

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

13个Java基础面试题

Hi&#xff0c;大家好&#xff0c;我是王二蛋。 金三银四求职季&#xff0c;特地为大家整理出13个 Java 基础面试题&#xff0c;希望能为正在准备或即将参与面试的小伙伴们提供些许帮助。 后续还会整理关于线程、IO、JUC等Java相关面试题&#xff0c;敬请各位持续关注。 这1…

【Redis】主从复制

文章目录 一、主从复制之一主二仆二、主从复制之薪火相传三、主从复制之反客为主四、总结4.1、复制原理和工作流程4.2、复制的缺点 主从复制指的是当主机数据变化时&#xff0c;自动将新的数据异步同步到其他备用机。主从复制的功能主要有 读写分离容灾恢复数据备份水平扩容支…

YOLO算法改进Backbone系列之:HorNet

在基于点积自注意的新空间建模机制的推动下&#xff0c;视觉变形器的最新进展在各种任务中取得了巨大成功。在本文中&#xff0c;我们展示了视觉变形器背后的关键要素&#xff0c;即输入自适应、长距离和高阶空间交互&#xff0c;也可以通过基于卷积的框架有效实现。我们提出了…

2024Spring> HNU-计算机系统-实验3-Bomblab-导引/答疑

前言 BombLab一定要花时间完成哦&#xff0c;对于期末卷面的提升和计算机系统的理解都非常重要。 导引 ①文件目录概览 助教下发一个文件包&#xff0c;打开之后是这样的几个文件。 这几个文件解释如下 bomb&#xff1a;可执行文件&#xff0c;无法打开&#xff0c;我们主要…

MySQL中的存储过程详解(下篇)

使用语言 MySQL 使用工具 Navicat Premium 16 代码能力快速提升小方法&#xff0c;看完代码自己敲一遍&#xff0c;十分有用 拖动表名到查询文件中就可以直接把名字拉进来中括号&#xff0c;就代表可写可不写 目录 1. 查看存储过程 1.1 查看存储过程的状态 1.1.1 基础…

数据结构学习之路--深入探索栈的核心要点(附C源码)

哈喽~大家&#xff01;今天我们来学习栈的特别节目&#xff0c;精彩马上开始~ 目录 前言 一、栈 1 栈的概念 2 栈的结构 3 栈的实现 3.1 栈的定义 3.2 栈的初始化 3.3 入栈 3.4 出栈 3.5 取栈顶元素 3.6 判断栈是否为空 3.7 栈的大小 3.8 栈的销毁 二、源代…

InnoDB架构:磁盘篇

InnoDB架构&#xff1a;磁盘篇 InnoDB是MySQL数据库中默认的存储引擎&#xff0c;它为数据库提供了事务安全型&#xff08;ACID兼容&#xff09;、行级锁定和外键支持等功能。InnoDB的架构设计优化了对于读取密集和写入密集型应用的性能表现&#xff0c;是一个高度优化的存储系…

ctf.show_web13

上传一句话木马 1.php文件&#xff0c;显示 再改后缀为.jpg&#xff0c;显示错误文件大小 用dirsearch扫一下 备份文件.bak 下载文件源码 <?php header("content-type:text/html;charsetutf-8");$filename $_FILES[file][name];$temp_name $_FILES[file][tm…

C++项目 -- 负载均衡OJ(一)comm

C项目 – 负载均衡OJ&#xff08;一&#xff09;comm 文章目录 C项目 -- 负载均衡OJ&#xff08;一&#xff09;comm一、项目宏观结构1.项目功能2.项目结构 二、comm公共模块1.util.hpp2.log.hpp 一、项目宏观结构 1.项目功能 本项目的功能为一个在线的OJ&#xff0c;实现类似…

普通人做抖音小店真的能赚钱吗?可以,但更取决于个人

大家好&#xff0c;我是电商花花。 现在做抖音小店的基本上都是一些新商家&#xff0c;对于我们众多零基础的朋友来说&#xff0c;是期待也是一份挑战。 抖音小店作为一个充满机会的新兴平台&#xff0c;许多人都欣喜的投入其中&#xff0c;期望能够借此来改变自己的命运&…

【教程】ubuntu20.04 下配置 Charm-crypto 0.5 实验环境

目录 前言先决条件基本依赖安装准备好 gcc&#xff0c;make 和 perl准备好 m4&#xff0c;flex&#xff0c;bison 和 libssl-dev安装 Python3.x&#xff0c;pip3 和 pyparsing 安装 OpenSSL安装 GMP5.x安装 PBC安装 Charm-crypto5.0安装开发环境检验 Charm-crypto5.0 安装成功参…

跨国公司网络优化新选择:SD-WAN解决方案

随着全球化的加速推进&#xff0c;跨国企业纷纷实施跨国战略&#xff0c;然而&#xff0c;在各地建立分支机构、数据中心的过程中&#xff0c;往往面临网络性能差异大、数据传输效率低下等问题。在这样的背景下&#xff0c;SD-WAN成为跨国公司网络解决方案的优选。 跨国企业对于…

IO、存储、硬盘、文件系统相关常识

目录 IO 文件系统 文件在硬盘上的存储 IO IO&#xff0c;就是Input和Output&#xff0c;即输入和输出操作。我们的电脑可以通过网络下载文件&#xff0c;也可以通过网络上传文件。通过网络下载文件就是输入操作&#xff0c;上传文件就是输出。如何区分输入和输出呢&#xf…

imgcat 工具

如果经常在远程服务器或嵌入式设备中操作图片&#xff0c;要查看图片效果&#xff0c;就要先把图片dump到本地&#xff0c;比较麻烦。可以使用这个工具&#xff0c;直接在终端上显示。类似于这种效果。 imgcat 是一个终端工具&#xff0c;使用 iTerm2 内置的特性&#xff0c;允…

精益思维驱动人工智能革新:理论到实践的跃迁之旅

随着科技的飞速发展&#xff0c;人工智能&#xff08;AI&#xff09;已成为引领未来的关键力量。在这个变革的时代&#xff0c;如何将精益思维与人工智能相结合&#xff0c;推动AI从理论走向实践&#xff0c;成为行业内外关注的焦点。本文&#xff0c;天行健精益生产顾问将分享…

陇剑杯 流量分析 webshell CTF writeup

陇剑杯 流量分析 链接&#xff1a;https://pan.baidu.com/s/1KSSXOVNPC5hu_Mf60uKM2A?pwdhaek 提取码&#xff1a;haek目录结构 LearnCTF ├───LogAnalize │ ├───linux简单日志分析 │ │ linux-log_2.zip │ │ │ ├───misc日志分析 │ │ …

阿里云优惠券种类介绍及领取教程详解

随着互联网技术的快速发展&#xff0c;越来越多的企业和个人开始将业务和数据迁移到云端。阿里云作为国内领先的云服务提供商&#xff0c;为广大用户提供了丰富多样的云产品和服务。为了回馈用户&#xff0c;阿里云经常推出各种优惠活动&#xff0c;其中优惠券就是其中一种常见…

记录一下我hive连不上DataGrip的问题

用户名和密码都没问题&#xff0c;但报如下这个错误 原因&#xff1a;是因为我在linux上没启hiveserver2服务 解决&#xff1a; [atguiguhadoop102 hadoop]$ hiveserver2 which: no hbase in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/module/jdk1.8…

第19天:信息打点-小程序应用解包反编译动态调试抓包静态分析源码架构

第十九天 本课意义 1.如何获取到目标小程序信息 2.如何从小程序中提取资产信息 一、Web&备案信息&单位名称中发现小程序 1.国内主流小程序平台 微信 百度 支付宝 抖音头条 2.小程序结构 1.主体结构 小程序包含一个描述整体程序的app和多个描述各自页面的page …