Chapter 337 The website is released
readx;
I have to say that Zhang Da's thinking is more out-of-the-box, seeing these photos, he actually thought of making a website to score these photos, although he doesn't understand technology, but he intuitively thinks that this is feasible. Pen & Fun & Pavilion www.biquge.info//
Lin Hong thought about the significance of this matter, in fact, the voting process can be regarded as an algorithm, through a wide range of statistics, the high-quality results are screened out, not to mention the external performance of this algorithm, but the implicit meaning behind it is very interesting.
It's actually a process of harnessing collective intelligence, finding the best answers through collective intelligence.
Lin Hong finally agreed, and he regarded the matter as an experiment, eager to see if he could finally find the best results as expected.
Lin Hong said: "But it can be done, but I don't know how many people will be involved in this process." ”
"Don't worry about this, I'm responsible for publicizing it!" Richie volunteered.
He is still very confident in his communication skills, basically in the past two days, he has known all the boys in the class, and he has also known a lot of boys in other classes on the same floor.
Zhang Da suggested: "It's better for us to be able to make it before the military training, otherwise we will have to wait three weeks later." ”
"Well, it shouldn't take much time."
Just do it, Lin Hong immediately started to do it.
He plans to use his laptop as a server and build such a website on it.
The other three didn't understand this technique at all, so they could only stand behind Lin Hong and watch.
Making a website is also a very high-end job in this period, and most people don't even know the basic operating principles of the website, let alone make a web page.
Lin Hong intended to popularize this knowledge and broaden their horizons, so he began to deploy the server and development environment while explaining to them:
"The website I'm making now requires a browser to access because it's more intuitive and you can browse the pictures directly. A browser is a piece of software that accesses a World Wide Web server, reads a file in a particular format from the server, and then displays it in another format. ”
Lin Hong paused for a moment and thought that this might be a bit abstract, and made an analogy: "It's like a translator who translates a web programming language into a text language that we can understand." The protocol used between the browser and the server is a protocol called HTTP, which stands for Hypertext Transfer Protocol, which allows you to convert Hypertext Markup Language, that is, documents written in htmh, from the language and write a simple "hmlla language" where we can make very rich web pages. Lin Hong continued, "But these web pages are static, if you want to change the content in them, such as what Zhang Da said, give them a score and display it in real time, this involves dynamic language content, and you also need to save the data and use it in the database." ”
Lin Hong doesn't expect to teach them all at once, but just let them have a more intuitive understanding, and if they are interested in it in the future, they can conduct further research. So his explanations are basically all over again, whether they can understand it or not.
The dynamic programming language he intends to use is also the C language he is good at, and uses a "Common Gateway Interface (CGI)" technology to interact with users and record their ratings for photos.
CGI language is a technology developed by the National Supercomputer Application Center in the United States, which appeared in 1993 and quickly became popular on the Internet, becoming a more mainstream dynamic S and can be used to develop CGI programs.
Lin Hong is very familiar with this part, so he quickly deployed the server environment, mounted the CGI module and then wrote a simple addition interactive program, allowing users to enter two numbers on it and then click to confirm, and the result can be calculated.
"Second child, you go to your computer and have a look." Lin Hong said.
"That's it? How do I access it? Zhang Da was still a little confused.
"Just enter my IPN address."
Zhang Da turned on his computer, launched the browser program, and then entered Lin Hong's IP address on the address bar, and after confirming, he saw an addition calculator interface appear in the browser.
He tried to type in a "1," and when he clicked "submit", one was immediately displayed.
It's just a simple feature, but they all think it's amazing.
"Boss, is this the program you just wrote?" Wu Dong asked with interest.
"Yes, it's just the simplest program, but it's also a dynamic interaction, not just a static web page."
In that process, in fact, after Zhang Da submitted, he would run a program called addCGI on Lin Hong's notebook, which is an executable program written in C language and then compiled, which can accept the data submitted from the front-end of the web page, and then process it.
Before that, the three of them thought that website production and programming were very simple, but today seeing Lin Hong demonstrate like this, this mystery was finally revealed, and they found that it was nothing more than that.
Of course, if they don't see this process with their own eyes, it may take a long time for them to understand the rationale. This is the advantage of having a master or a mentor, which can save you a lot of time and energy, and save yourself a lot of detours.
The next step is to design the data structure, the database used by Lin Hong is Mysql, although the company that founded this data software only started last year, but the database they released is open source, and it is very easy to use, and it quickly became popular on the Internet.
Because the function is relatively simple, the data involved is only stored with the score value, so Lin Hong only designed a table to save this value. As for the future statistical results, it is only necessary to make corresponding calculations on this basis.
Although there are a lot of photos, Lin Hong flexibly uses the command line to directly automate the processing, rename the photos and import them into the database, and the names and simple text content are also imported.
It only took less than half an hour for Lin Hong to realize the prototype of this idea.
Wu Dong and the three of them stood behind Lin Hong, they were dizzying, Lin Hong also explained a few words at the beginning, and when they got to the back, because there were more knowledge points designed, he directly omitted one or two sentences that were not clear, so his speed instantly increased.
"It's already made up." Lin Hong called up a graphical browser, directly typed localhost, and a relatively simple interface was displayed, showing rows of photos, which could be browsed by department.
Zhang Da: "Awesome! ”
Rich: "That's fast! ”
Wu Dong: "How can I reach this level? ”
The three of them really can't describe their mood at the moment, although they don't understand technology, they also know that Lin Hong's smooth performance before is not something that just anyone can do.
"There may still be some bugs, you can test them and wait until there are no major problems, and then announce them to the public." Lin Hong gave up his seat.
Programmers know all the details of the software they write, so when they test it themselves, they often use the software according to their own understanding, and the result is that there are no bugs. Therefore, it is generally the other person who is responsible for software testing, so that some unexpected bugs can be found.
Li Qi immediately sat in Lin Hong's place.
And Zhang Da hurriedly ran to his computer, refreshed his page, and also saw the effect.
He clicked into the first chapter photo, and then saw the option to rate it, and immediately after entering the rating, a rating record appeared under the photo. And in the rankings, this classmate immediately ranked first, because she was the only one with a rating record for the time being.
They started grading the photos.
Although Wu Dong didn't grab the position, he didn't care, standing behind Li Qi and kept shouting "5 points, 3 points, 4 points......
A few minutes later, Zhang Dati got rid of the first bug: "I can accept it even if I don't enter a number, for example, I can directly enter a ......"
Lin Hong nodded and said: "It's indeed a problem, I forgot to judge the input, I should limit it, I can only enter the number from 1 to ko, or I just use it as a button form and don't let them enter." ”
Then, Li Qi also asked a question: "It seems that there is no limit to the rating?" A person can repeat the score all the time, so it's easy to brush the score, right? ”
Lin Hong: "This can be achieved by restricting the IP, and the same IP and the same photo are allowed up to four votes." ”
Wu Dong: "I think the ranking algorithm needs to be optimized, and the algorithm of adding and dividing directly is a bit too simple, and the highest and lowest scores should be filtered out to eliminate the interference of these abnormal data." ”
Lin Hong: "That makes sense. ”
After they continued to ask various questions, Lin Hong also continued to improve the program, and some simple prototypes at the beginning gradually became more complex. In the process, he himself was uninspired and had some inspiration, for example, when he met two people with the same score, another mechanism would be triggered, and the two photos would be displayed at the same time, and then people would judge which one was better, so a small value would be added to distinguish them.
At four o'clock, the whole website was basically the same, and they all felt that they could no longer find anything to improve.
So, Li Qi went to the school store to buy red paper, pen and ink, directly designed a propaganda poster, and then posted it on the propaganda board, a necessary place to go to the cafeteria.
The title of the poster is "96 Beauty Rankings Interactive Progress!" The content of the text was also written in a very inflammatory manner, which caused many Mizuki students to watch for a while.