Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Coming from a C and C++ background, with a little SQL at university, I was wanting to move to web development and implement an idea of mine for evaluating movies. In a nutshell, the idea is this: produce a score for each movie by only taking into account opinions of people of your age and psychological profile, as derived from a questionaire. Or a score derived from the opinions they have given about other movies, the more match there is with your opinions about those movies, the higher the coefficient for their opinion in the production of the movie score.
What's the easiest way to implement this, what language is the easiest to learn?
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
That sounds like LAMP -- Linux-Apache-MySQL-PHP (any throw in a little HTML for flavor).
Do a good data base design (so, learn some more about SQL) and you're 99% of the way there. You use PHP between your web page and your data base (so get good a query writing, even more about SQL).
A hint? You do not need to build your own movie data base -- you can use the Internet Movie Data Base (http://www.imdb.com) as a look-up -- you get all kinds of information from there.
That movie site was the inspiration, because of its fundamental flaw: all opinion givers contribute equally to the score of a movie. Which means that if lots of teenagers like a crap movie and vote for it, it will go high in the ratings. Cultural factors as well might raise the score of an average movie, eg lots of Britons who vote at that site value English humour.
It's a long shot, but is it possible to show imdb.com pages with the score modified without copying the entire page to my server? I know a frame can contain content from another site, but can a frame be just a number? Or rather, everything but the number?
From my limited experience with Python and my few years of experience with PHP I'd say go for PHP but I'm clearly biased. However, I learned PHP from knowing nothing about programming, so I can say that it's easy to learn.
Also, someone correct me if I'm wrong (as if I needed to ask!) but PHP is syntactically more similar to C than Python.
Can php be used on the client side too? The reason I'm asking, I hope people can access each other's opinions without going to the central server. The central server would be just for meeting each other, a bit like trackers in p2p filesharing.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
A couple of things -- you can extract information from IMDB into your own data base tables. For example, take a look at Tellico (http://tellico-project.org/), a collection manager for KDE (books, movies, music, etc.). Tellico searches Amazon.com, Internet Movie Data Base, Library of Congress, ISBNdb.com, AnimeNfo.com, arXiv.org, Google Scholar, Discogs Audio Search, MusicBraiz and others to retrieve information for a given book, movie, CD, etc. Tellico maintains multiple files (one for each collection) rather than a LAMP model, but the search-and-extract idea is something that may be worth a look-see (and you can just ignore things like IMDB ratings, eh?).
"PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML." (http://www.php.net/). So, yeah, it's usable in both directions, client and server, but the idea is that you present a web page that permits users to do what they and you wish (including communications back and forth; e.g., "send a messages to blah") under your control -- nothing installed or running on "their" computer save the browser (think Amazon.com here, PHP has been what they use).
A well-designed data base with efficient queries isn't going to bring your server to its knees. MySQL (and other RDBMS') are pretty good at getting stuff quickly and efficiently. PHP is merely the mechanism that serves as the go-between from user browser to data base and back again.
The trick, if you will, is to do an efficient data base design -- no redundancy, ever. Separate distinct data into separate tables, tie them together with an index key or keys and trust the data base "engine" to be able to put stuff in and get stuff out (which relational data base management systems are darned good at doing). If I was going to do a data base for movies, I'd have a table that contains the index key, the title, the production year and the release year. I'd have another table that would contain the index key and the director. I'd have another with the index key and the producer(s). I'd have another with the index key, the actor(s) and their role(s) and so on. Each table would have one row for one item -- so, multiple rows for producers and for actors (like, don't try to make a row to contain 20 actors, have 20 rows (or have two, or have five...). Same thing with user comments -- a table for individual users (with a login and password), and a table for zero or more comments by each user. Keep in mind that a table can have zero or more rows -- no entry, no display, multiple rows, display row by row until you run out.
The nice thing about HTML and PHP is that you have a simple and elegant way of entering a query and displaying the result of that query that does not rely on what the user has available save a browser.
Coming from a C and C++ background, you will find PHP to be very easy to learn. To me it seems to be a combination of C and PERL. It has most of the syntax of C, with the lack of strict data types and some of the string handling functions of PERL.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.