如何分类上载的文档以及如何存储文档名称(无论是散列还是纯文本)...

编程入门 行业动态 更新时间:2024-10-26 08:23:10
本文介绍了如何分类上载的文档以及如何存储文档名称(无论是散列还是纯文本)...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨!我需要添加在我的网站中上传文档的功能,但问题是. 我应该如何对这些文件进行分类或分离...即它们是否是恐怖书,喜剧等.... 我已经为这些文档创建了单独的表,因此,一旦这些文档被分类,它们的数据就会存储到d/b中. 而且,我应该如何在d/b中存储文档名称,即.我应该对它们进行散列还是将名称保留为纯文本...哪一种会更有效,这将有助于搜索doc.if散列,那么我应该如何实现它.... 有人可以指导我解决上述问题吗...我以前从未做过这些事情.. 预先感谢...:)

hi!! i need to add feature of uploading documents in my website but the problem is. how should i classify or separate those documents... ie.whether they are horror book,comedy book etc.... i have created separate tables for these doc''s so, as soon as those doc''s are classified their data would be stored into d/b...... and also,how should i store the name of doc''s in d/b ie. should i hash them or keep the name in plain text... which one would be more efficient which would help in searching the doc.if hashing then how should i implement it.... can someone please guide me with the above issues... i have never done these thing''s before.. Thank''s in advance... :)

推荐答案

类型和书籍功能不是互相排斥的.因此,以 bitset 的形式设置一些属性.像这样的东西: The genres and book features are not mutually exclusive. So, make some attributes in the form of a bitset. Something like that: enum BookFeatureClassifiers { Horror = 1 << 1, // 1 Fantasy = 1 << 2, // 2 Sex = 1 << 3, // 4 History = 1 << 4, // 8 //... }

使用按位或运算将元素(以枚举成员之一的形式)添加到集合中. (您未指定语言,因此可能是"And"或"|").要检查是否设置了某个位,请使用按位与运算并将结果与​​0比较(这意味着该位是清除的,否则进行设置). 要将其存储在数据库中,请将枚举值转换为足够大小的整数.

—SA

Use bitwise OR operation to add an element (in the form of one of the enumeration members) to a set. (You did not indicate your language, so it could be ''And'' or ''|''). To check up if a bit is set, use bitwise AND operation and compare the result with 0 (which means that the bit is clear, set otherwise). To store it in a database, cast the enumeration value to an integer numeric value of sufficient size.

—SA

更多推荐

如何分类上载的文档以及如何存储文档名称(无论是散列还是纯文本)...

本文发布于:2023-10-23 22:30:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1522189.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文档   文本   名称   是散列

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!