Table of Contents
手把手教你做关键词匹配项目(搜索引擎)---- 第十一天,教你做第十一天
Home php教程 php手册 手把手教你做关键词匹配项目(搜索引擎)---- 第十一天,教你做第十一天

手把手教你做关键词匹配项目(搜索引擎)---- 第十一天,教你做第十一天

Jun 13, 2016 am 09:27 AM
- one day Do Key words match Hand in hand search engine teach you project

手把手教你做关键词匹配项目(搜索引擎)---- 第十一天,教你做第十一天

第十一天

起点:

1. 手把手教你做关键词匹配项目(搜索引擎)---- 第一天

回顾:

10. 手把手教你做关键词匹配项目(搜索引擎)---- 第十天

话说又到周末了,小帅帅又得写总结报告了,小帅帅有点不太喜欢做总结,他觉得写代码都比写总结好。

但是是于老大安排的任务,他不得不去完成它。

1. 面向对象编程思维能力的培养

2. TopClient的使用与重构

3. ExtendedCurl深度使用

4. Logger的创建与应用

小帅帅一写到这儿,于老大问的三个问题,至今还在想,就算他把代码写出来了,他还是想不通为啥于老大会未卜先知。

小帅帅的代码如下:

<span>class</span><span> Logger {

    </span><span>const</span> LEVEL_TRACE='trace'<span>;
    </span><span>const</span> LEVEL_WARNING='warning'<span>;
    </span><span>const</span> LEVEL_ERROR='error'<span>;

    </span><span>public</span> <span>static</span> <span>function</span> error(<span>$message</span><span>){
        self</span>::<span>log</span>(<span>$message</span>,self::<span>LEVEL_ERROR);
    }

    </span><span>public</span> <span>static</span> <span>function</span> warning(<span>$message</span><span>){
        self</span>::<span>log</span>(<span>$message</span>,self::<span>LEVEL_WARNING);
    }

    </span><span>public</span> <span>static</span> <span>function</span> trace(<span>$message</span><span>){
        </span><span>if</span><span>(DEBUG)
            self</span>::<span>log</span>(<span>$message</span>,self::<span>LEVEL_TRACE);
    }

    </span><span>public</span> <span>static</span> <span>function</span> <span>log</span>(<span>$message</span>,<span>$level</span> = self::<span>LEVEL_TRACE){
        </span><span>$file</span> = <span>fopen</span>('application.error.log', "a+"<span>);
        </span><span>fwrite</span>(<span>$file</span>, <span>$message</span>."\t".<span>$level</span>."\t".<span>microtime</span>(<span>true</span><span>));
        </span><span>fclose</span>(<span>$file</span><span>);
    }
}</span>
Copy after login

小帅帅想不通的问题,就是喜欢问,他只好又去找于老大。

于老大说道:你们做功能都是满足提需求的人,你们有没有想过,其实你们也是提需求的人。了解测试驱动开发吗?

测试驱动开发:英文全称Test-Driven Development,简称TDD,是一种不同于传统软件开发流程的新型的开发方法。它要求在编写某个功能的代码之前先编写测试代码,然后只编写使测试通过的功能代码,通过测试来推动整个开发的进行。这有助于编写简洁可用和高质量的代码,并加速开发过程。[来自百度词库]

测试驱动开发,很好的描述了用户的输入以及结果。

把自己也当作提需求的人、站在需求者的角度看待问题。

其实小帅帅在写这份代码的时候也在纳闷, 使用下面语句,不就可以记录所有的问题.

Logger::<span>log</span>(<span>$message</span>,'error'<span>);
Logger</span>::<span>log</span>(<span>$message</span>,'warning'<span>);
Logger</span>::<span>log</span>(<span>$message</span>,'trace');
Copy after login

于老大为什么还要单独提出来:

Logger::error(<span>$message</span><span>);
Logger</span>::warning(<span>$message</span><span>);
Logger</span>::trace(<span>$message</span>);
Copy after login

于老大就对他说了一句话:上面两种的用法你更加喜欢用哪一种。

 

需求者都是喜欢简单的功能

( 其实充分体现了他们的懒惰行为,正因为如此才有现在的文明 )

 

小帅帅看完这些后,深深的震撼了,从所未有的感受到理论知识和心态的重要性。

小帅帅第一次感觉到要学习的东西好多丫.....

 

小帅帅也不着急,还是任务要紧,他坚信,只要多完成一些项目,就能成为牛人。

他只好又匆匆忙忙的找于老大,去请教关键词如何应用,技术如何实现。

但是于老大不愿意多说了,要小帅帅自己去想了。

这可苦了小帅帅。

小帅帅这是要站起来的节奏....

 

关键词应用需求:

通过淘宝API取到的宝贝标题以及宝贝属性,匹配出适合该宝贝的关键词.

初期考虑以下因素:

适合人群的匹配 :男装 (匹配出来的关键词不能有女)  女装(匹配出来的关键词不能有男) 情侣装(男女适用)  童装(?)

 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to adjust aperture on Xiaomi Mi 14 Ultra? How to adjust aperture on Xiaomi Mi 14 Ultra? Mar 19, 2024 am 09:01 AM

Adjusting the aperture size has a crucial impact on the photo effect. Xiaomi Mi 14 Ultra provides unprecedented flexibility in camera aperture adjustment. In order to allow everyone to adjust the aperture smoothly and realize the free adjustment of the aperture size, the editor here brings you a detailed tutorial on how to set the aperture on Xiaomi Mi 14Ultra. How to adjust the aperture on Xiaomi Mi 14Ultra? Start the camera, switch to &quot;Professional Mode&quot;, and select the main camera - W lens. Click on the aperture, open the aperture dial, A is automatic, select f/1.9 or f/4.0 as needed.

Can AI conquer Fermat's last theorem? Mathematician gave up 5 years of his career to turn 100 pages of proof into code Can AI conquer Fermat's last theorem? Mathematician gave up 5 years of his career to turn 100 pages of proof into code Apr 09, 2024 pm 03:20 PM

Fermat's last theorem, about to be conquered by AI? And the most meaningful part of the whole thing is that Fermat’s Last Theorem, which AI is about to solve, is precisely to prove that AI is useless. Once upon a time, mathematics belonged to the realm of pure human intelligence; now, this territory is being deciphered and trampled by advanced algorithms. Image Fermat's Last Theorem is a "notorious" puzzle that has puzzled mathematicians for centuries. It was proven in 1993, and now mathematicians have a big plan: to recreate the proof using computers. They hope that any logical errors in this version of the proof can be checked by a computer. Project address: https://github.com/riccardobrasca/flt

How to set Chinese in Cheat Engine? How to set Chinese in ce modifier How to set Chinese in Cheat Engine? How to set Chinese in ce modifier Mar 18, 2024 pm 01:20 PM

Ce Modifier (CheatEngine) is a game modification tool dedicated to modifying and editing game memory. So how to set Chinese in CheatEngine? Next, the editor will tell you how to set Chinese in Ce Modifier. I hope it can Help friends in need. In the new software we download, it can be confusing to find that the interface is not in Chinese. Even though this software was not developed in China, there are ways to convert it to the Chinese version. This problem can be solved by simply applying the Chinese patch. After downloading and installing the CheatEngine (ce modifier) ​​software, open the installation location and find the folder named languages, as shown in the figure below

How to update Honor MagicOS 8.0 on Honor 90 GT? How to update Honor MagicOS 8.0 on Honor 90 GT? Mar 18, 2024 pm 06:46 PM

Honor 90GT is a cost-effective smartphone with excellent performance and excellent user experience. However, sometimes we may encounter some problems, such as how to update Honor MagicOS8.0 on Honor 90GT? This step may be different for different mobile phones and different models. So, let us discuss how to upgrade the system correctly. How to update Honor MagicOS 8.0 on Honor 90GT? According to news on February 28, Honor today pushed the MagicOS8.0 public beta update for its three mobile phones 90GT/100/100Pro. The package version number is 8.0.0.106 (C00E106R3P1) 1. Ensure your Honor The battery of the 90GT is fully charged;

Planet Mojo: Building a Web3 game metaverse from the auto-chess game Mojo Melee Planet Mojo: Building a Web3 game metaverse from the auto-chess game Mojo Melee Mar 14, 2024 pm 05:55 PM

Popular Metaverse game projects founded in the last crypto cycle are accelerating their expansion. On March 4, PlanetMojo, the Web3 game metaverse platform, announced a number of important developments in its game ecology, including the announcement of the upcoming parkour game GoGoMojo, the launch of the new season "Way of War" in the flagship auto-chess game MojoMelee, and the celebration of the new The first ETH series "WarBannerNFT" launched this season in cooperation with MagicEden. In addition, PlanetMojo also revealed that they plan to launch Android and iOS mobile versions of MojoMelee later this year. This project will be launched at the end of 2021. After nearly two years of hard work in the bear market, it will soon be completed.

Teach you how to use the new advanced features of iOS 17.4 'Stolen Device Protection' Teach you how to use the new advanced features of iOS 17.4 'Stolen Device Protection' Mar 10, 2024 pm 04:34 PM

Apple rolled out the iOS 17.4 update on Tuesday, bringing a slew of new features and fixes to iPhones. The update includes new emojis, and EU users will also be able to download them from other app stores. In addition, the update also strengthens the control of iPhone security and introduces more "Stolen Device Protection" setting options to provide users with more choices and protection. "iOS17.3 introduces the "Stolen Device Protection" function for the first time, adding extra security to users' sensitive information. When the user is away from home and other familiar places, this function requires the user to enter biometric information for the first time, and after one hour You must enter information again to access and change certain data, such as changing your Apple ID password or turning off stolen device protection.

DaVinci Resolve Studio now supports AV1 hardware encoding for AMD graphics cards DaVinci Resolve Studio now supports AV1 hardware encoding for AMD graphics cards Mar 06, 2024 pm 10:04 PM

Recent news, lackMagic has launched the 18.5PublicBeta2 public beta update of the DaVinci Resolve Studio video editing software, bringing AV1 encoding support to AMD Radeon graphics cards. After updating to the latest version, AMD graphics card users will be able to take advantage of hardware acceleration for AV1 encoding in DaVinci Resolve Studio. Although the official does not specify the supported architectures or models, it is expected that all AMD graphics card users can try this feature. In 2018, AOMedia released a new video coding standard AV1 (AOMediaVideoCodec1.0). AV1 is produced by a number of

Simplify file upload processing with Golang functions Simplify file upload processing with Golang functions May 02, 2024 pm 06:45 PM

Answer: Yes, Golang provides functions that simplify file upload processing. Details: The MultipartFile type provides access to file metadata and content. The FormFile function gets a specific file from the form request. The ParseForm and ParseMultipartForm functions are used to parse form data and multipart form data. Using these functions simplifies the file processing process and allows developers to focus on business logic.

See all articles