Out of curiosity, i'm wondering if anyone has had any experience writing a Dating Website. I hear the word algorithm used alot but have never really came across a situation where i've needed to use one (or so i thought). I also hear that people use algorithms for Dating websites to find matches for people? What sort of language to these sites use for their logic? PHP perhaps?
My question in summary is could you use PHP to construct a Dating website and use "algorithms" to find matches for people or is that not how its done?
An algorithm is a logical construct that performs a task.
If a dating website offers any sort of functionality to "match" people, whether it is calculating compatibility or doing searches based on some sort of "suitability" parameter then it is using an "algorithm" of some sort.
If a dating website merely lets users search the database based on the data entered (where they live, gender, etc. etc.) then it is not using any sort of algorithm beyond those used internally in its components.
The answer to your question in summary is "yes" and "whatever". Yes you could use PHP and you could use "algorithms" to find matches for people. As to "how it is done", I imagine that there is no one single way currently implemented, and certainly there is always room for someone to invent a new way of doing it even if that is how "it is done". Don't feel constrained by custom.
I hear the word algorithm used alot but have never really came across a situation where i've needed to use one
Then you've never written a computer program, never planned anything advance, never solved a mathematical problem, never cooked using a recipe?
I think you've not understood what 'algorithm' means.
Yes you could use PHP or lots of other programming languages and tools for this purpose. Computers and programming languages are just one way to implement algorithms - and a computer/program is by definition an implementation of an algorithm.
There's a nice chapter in "Programming Collective Intelligence" that talks about one algorithm in great detail. The examples are all in Python, but any language could be used.
Yes you can and you should. For example, Facebook which isn't really a dating website tries to find your "possible friends" by comparing common friends with another user. If you have lets say 50 or more friends in common, that means you may also be friends.
For a dating website, where you live, age, interests ... and many more can be added to the algorithm.
I wrote a Dating site in PHP, combined with an "adult store" (which I won't put the link to here...).
But yeah, that's how I did it - Used PHP functions to "match" people...
Related
Can anyone point me in the direction of a site, blog post, etc... that gives clear and concise examples/information about creating a match making site. I should state one point before you bite my head off:
This is NOT for a dating website. It's for a site that will attempt to match potential visitors to our site with other like minded visitors and pros on our site. It's more match making, and potentially social networking, but not exactly. Good examples/information would be algorithms used or code samples. My language of choice is php but I'm not averse to ruby on rails either.
Thanks to all who can contribute.
You could map their preferences onto a multi-dimensional space and then use the Euclidean distance between the two subjects Cartesian coordinates to determine how "matched up" they are. Then you just need to find the subjects with the shortest distances and these are your suitable matches.
You could have a look at http://www.socialengine.net
You need to purchase a license, but you can get a 1 month demo. Its pretty complete (almost like you're own facebook).
Its built on Zend Framework and allows you to extend it with modules.
I currently work in an agency and have been considering trying to branch out on my own. In my current setup, whenever I interact with a client, it's at the later stage after they've hired us and after someone from sales did all the front work with them. I suspect it's very different for developers who deal with clients directly.
My question is how much explanation and training do you have give to clients before they're on the same page with you? How often for example do you find that clients don't understand the concept of a content management system? What other similar "basics" have you found that they don't understand?
They might not know the buzzwords, but they understand what they want and (usually) what they want to do. It is nice to use terms so you and the client can communicate easier, but don't beat them over the head with terminology.
They don't want a "CMS" they want the ability to add/edit/delete pages in a simple UI and have them displayed in the same style as the rest of their site.
Communication is getting ideas and concepts across, not necessarily "educating" your clients.
There is no definite answer to that. Clients differ. Some have more affinity for and experience with technical things and jargon and some dont. Some dig buzzwords, some prefer plain english. You have to adapt to the individual client. The most important thing is finding out together what they really need - not what they think they need. Or As Henry Ford put it:
"If I had asked people what they wanted, they would have said faster horses."
One of the biggest misconceptions I have come around regarding CMS is clients tend to underestimate the effort they have to put into it once they have it. They think (or have been told) a CMS is easy and cheap: you can update your content yourself and you dont have to pay the expensive agency to update your site anymore. Sounds brilliant, but it's a myth.
Clients have to understand that Content Management is a process that requires a lot of work. It's not just some technical thingie you install. That's only the smallest part. It also takes time to know the CMS and it takes practise. Use it or lose it. A CMS has to be used by someone and those people have to understand the aims of the website. They have to have a skillset in editing and writing and - if you allow extensive designing - design. Otherwise, the CMS a) wont be used and/or b) will contain poor content and/or c) look like crap.
Despite being six years old and published on April 1st, I find most of the arguments in Why Content Management Fails still very valid and good to consider when working with clients who want a CMS.
I have worked on both sides, with clients as the resident coding troll and with software shops as one of the programming grunts. And on most jobs the whole engagement is often reduced to the software shop trying to sell a product, do some cursory customization, and then get out as soon as possible. And I don't blame them. I often found that clients:
Didn't know that that content on the web can be copied and pasted.
Thought that a product, i.e. the CMS system itself, can somehow divine content on its own.
Were convinced that the whole process is either an IT problem or the consultant's problem, i.e. they will ask you to keep the content updated for them.
That is to say that most clients will have an intuitive understanding of what a CMS can offer them, but they won't fully realize what it will require of them.
If your agency wants to expand into including a CMS as part of your total offering, which seems to be more about design and content as your question implies, I think you can stand to benefit your clients a lot more, particularly if you're up front with them about what they will need to do.
My understanding is that asking for a work sample is a good way to determine if someone has the skillset you are looking for, as some people just interview well. So I want to ask potential developers to write some sample code for me.
I'm looking for ideas on what kind of small project would be something they could do in an hour or two, and would show that they have a good grasp of OOP, good coding practices, etc. And what to look for once they finish - how to evaluate it fairly and usefully.
For context, I'm a small business owner, interviewing prospective developers, for PHP development on internal projects. I can code PHP but am not an expert (some of the work is refactoring code I've written to be better structured and consistent), and so I'm also looking for what to look for when evaluating the samples, given that I'm not a trained or super experienced programmer.
Especially for people who have done hiring of this type before and used this method.
I was also thinking I could give them some code to refactor, and see how they do on it. Has anyone ever given a refactoring test as part of the hiring process?
Clarification:
I'm not talking about coding during an interview. I'm talking about coding instead of an interview. For context the inspiration for this question came from this article in FastCompany about how work samples are better predictors of job success than interviews:
Why It May Be Wiser To Hire People Without Meeting Them
http://www.fastcompany.com/magazine/136/made-to-stick-hold-the-interview.html
I would create a not necessarily good application and embed some bugs. I would come up with some simple functionality to be added to the program.
Does the applicant find some bugs?
How does the applicant's code integrate into the existing code?
Does the applicant get stuck on something that doesn't really matter?
Does the applicant adapt to the coding standard of the existing code?
After this exercise, discuss the code with the applicant. This may be more valuable than the actual code.
NOTE: with regards to #bpapa answer I would make sure that problem is novel and obviously not to be used in production.
Personally I would refuse to do this when asked. An interview is one thing, and doing programming questions on paper to asses technical knowledge is fine, but actually writing some kind of application for somebody is billable and I wouldn't do it for free. Even if it only is supposed to take an hour.
I think you should focus more on what the person has done in the past, and ask technical questions that you know the answers to (since you said you have limited PHP knowledge and want a PHP developer).
I would heed Joel's advice that giving homework assignments for interviews just weeds out the best programmers (paraphrased from his book). The better programmers have a lot of options and so won't want to go through the exercise of a programming assignment. They just won't apply. That will leave you with the mid-competency people. Unfortunately, in my experience those are the ones most likely to try to look better than they are and if you aren't an expert yourself, the ones most likely to mislead you.
Here's an alternate option. Have them point you at some work they have already done. Not necessarily the code, but the site. During the interview, ask them questions about how they coded it. What data structures did they use? How were the classes or functions organized? What problems did they have to overcome?
Then as traditional programming questions in the interview that they could answer for you ont he spot. This way you can gauge their understanding and their syntax. The two don't have to be the same question.
If you are not an expert then I would suggest you be careful about trying to evaluate other developers. You should probably figure out a better way to assess the dev skills of someone else if you are not that comfortable with your own level.
I am not sure there is a good solution for you.
I'd make the coding samples very straightforward and not have it take an hour or two. Simple coding exercises that take a few minutes should be sufficient - combined with other discussions about best practices, frameworks, design questions, etc.
I like the problems at streamtech. They are pretty easy and can often be done in rather short time, but they show that the applicant is capable of structured thinking and translating this to structured code.
As for evaluation---I would use this as an opportunity to learn. Do the problem yourself first, then compare to the applicant's code. Look up any constructs that you don't know, then ask yourself which version is more obviously correct.
I think the best thing you can do is try to have a real expert sit in on the interview with you. Hire a third party if you need to. I'm not sure it's possible to be able to give a quality assessment of someone who is a more experienced developer than yourself.
The other thing to consider is that really good developers may pick up on the fact that they are more experienced than yourself, and if you indicate that you are one of the developers it may actually put them off (not trying to be offensive, I just mean in the context of you implying that you are not very experienced.)
Give them an address or such as a plain text file and ask them to create a simple script to turn it into XML. I used that once and it worked wonders.
If you want to test them on the spot, ask them to reverse a string. From an organisational standpoint, perseverance, determination and enthusiasm are just as important as being technically adept, IMHO.
Well, everyone seems to be discouraging the coding effort for an interveiw. I'll disagree with the disagreers. To answer your question--if you want an example of what to have them code--drop a simple calculator on the table in front of them and ask them to write a program to create the calculator virtually. Give them half and hour and see how far they get. Some may finish in that time.
Have you ever tried pair programming before? Two people sit down at one machine, they share keyboard and mouse, and talk about what they're doing as they go. I think this is absolutely the best approach, because it will, eventually (after everyone's panic subsides), really indicate how well you two work together.
If you're not a great programmer, this person should be able to teach you and put you at ease. If they're not that good, but you work together well, that might be more desirable than a brilliant but unpleasant person.
At the end of the session, just delete your work. No big deal.
I've never been a part of the hiring process... but in interviews I've done, I was asked once to implement a doubly linked list, and another to work out an algorithm, the classic, how many integer points within a given shape, in this case three points forming a triangle, once in O(n^2) and then again in O(n).
I don't think the way to do it is to make them program something, but to make sure they know how to figure it out. You give them a problem or ask them a question, and tell them to think out loud, and observe their thought process. This doesn't exactly show if they have clean code, but depending on the problem it gives you insight as to wether or not they know what their talking about.
Having a small, well defined task can help you take examine people on a level playing field with a relatively small investment of time on their part. You don't need something complicated to see what people can do.
In the past, I've asked people to write a small web application that exercises a few fundamental concepts. We keep the particulars of what the application is supposed to do really simple.
I would also try to avoid tasks that require a lot of supplemental knowledge (viz, don't ask them to solve a problem from your particular problem domain).
Edit:
Regarding "small, well defined tasks": What I try to shoot for is something that includes a very thorough description of some simple business logic as part of a larger programming task. For example, one of the programming assignments I've given in the past involves setting up a simple Java web application and implementing a few features. We made sure to describe thoroughly how the features were supposed to work to remove ambiguity. This was for a couple reasons:
The point is really to see if the candidate can build a simple application from scratch, not to see whether they can guess correctly about what we want.
If you define the task really well, you get to see more about how thorough someone is with the type of work that they're likely to be doing in a business situation.
We wanted something flexible enough to give to candidates at varying levels of experience.
I should note here that I think programming assignments are most effectively used to check for competency. If you give a really hard assignment, or one that isn't well-defined, odds are that you're not going to get results that tell you what you want to know (unless you're testing specifically for how the candidate handles difficult assignments or ambiguity).
I argree with bpapa about it being an interview instead of a test run, maybe instead consider asking some questions about how they would undergo certain talks to do with the programming...
I once had to sit a Visual Basic MCP exam at the end of which they didn't even bother to give me the result.
Happily though when I asked the question as to whether I would be given the result I was sitting at the Commit/Cancel screen.
So I hit cancel thanked them for wasting my time and walked out.
To answer the question:
For PHP, I think a shopping cart, address book and forum would be good projects. Those usually cover a wide spectrum of web-programming topics - sessions, registration, database, form processing and authentication.
Personally speaking:
It looks like you looking more of an architecture person than a coding guru. I wouldn't penalize the applicant because he cannot come up with the name of an obscure function or need to refer elsewhere. The key thing is that he has the initiative and know where to look (heaven knows how many times I need to look up PHP.NET). A good question for an architecture guy, IMHO, is to tell him you have a data-set, but you have three different ways of displaying them and each view has different operations. If his answer is just a gigantic SWITCH-CASE, then he may be the wrong choice.
Usually weak programmers does not understand recursion pretty well, that's from my observations as far as now, now this does not have anything to do with PHP directly and probably a recursive factorial or fibonacci series wouldn't be a big deal, but let's say to load a tree control with data from a database with some parent-child relationship might be a good sample.
Also as you're not an expert as you said, think off something you can handle confidently.
It usually depends on the language you are hiring for. For example, when I went and gave an interview for PHP, I was asked to write a blog script, using custom MVC framework, whereas when I interviewed for an opening as a JS dev, I was asked to code a certain plugin in jQuery. Its more dependent on you are hiring the guy for ultimately. You dont want to ask someone to write you a music recommendation engine and then have him work on a payments gateway processor.
I would like to use named entity recognition (NER) to find adequate tags for texts in a database.
I know there is a Wikipedia article about this and lots of other pages describing NER, I would preferably hear something about this topic from you:
What experiences did you make with the various algorithms?
Which algorithm would you recommend?
Which algorithm is the easiest to implement (PHP/Python)?
How to the algorithms work? Is manual training necessary?
Example:
"Last year, I was in London where I saw Barack Obama." => Tags: London, Barack Obama
I hope you can help me. Thank you very much in advance!
To start with check out http://www.nltk.org/ if you plan working with python although as far as I know the code isn't "industrial strength" but it will get you started.
Check out section 7.5 from http://nltk.googlecode.com/svn/trunk/doc/book/ch07.html but to understand the algorithms you probably will have to read through a lot of the book.
Also check this out http://nlp.stanford.edu/software/CRF-NER.shtml. It's done with java,
NER isn't an easy subject and probably nobody will tell you "this is the best algorithm", most of them have their pro/cons.
My 0.05 of a dollar.
Cheers,
It depends on whether you want:
To learn about NER: An excellent place to start is with NLTK, and the associated book.
To implement the best solution:
Here you're going to need to look for the state of the art. Have a look at publications in TREC. A more specialised meeting is Biocreative (a good example of NER applied to a narrow field).
To implement the easiest solution: In this case you basically just want to do simple tagging, and pull out the words tagged as nouns. You could use a tagger from nltk, or even just look up each word in PyWordnet and tag it with the most common wordsense.
Most algorithms required some sort of training, and perform best when they're trained on content that represents what you're going to be asking it to tag.
There's a few tools and API's out there.
There's a tool built on top of DBPedia called DBPedia Spotlight (https://github.com/dbpedia-spotlight/dbpedia-spotlight/wiki). You can use their REST interface or download and install your own server. The great thing is it maps entities to their DBPedia presence, which means you can extract interesting linked data.
AlchemyAPI (www.alchemyapi.com) have an API that will do this via REST as well, and they use a freemium model.
I think most techniques rely on a bit of NLP to find entities, then use an underlying database like Wikipedia, DBPedia, Freebase, etc to do disambiguation and relevance (so for instance, trying to decide whether an article that mentions Apple is about the fruit or the company... we would choose the company if the article includes other entities that are linked to Apple the company).
You may want to try Yahoo Research's latest Fast entity Linking system - the paper also has updated references to new approaches to NER using neural network based embeddings:
https://research.yahoo.com/publications/8810/lightweight-multilingual-entity-extraction-and-linking
One can use artificial neural networks to perform named-entity recognition.
Here is an implementation of a bi-directional LSTM + CRF Network in TensorFlow (python) to perform named-entity recognition: https://github.com/Franck-Dernoncourt/NeuroNER (works on Linux/Mac/Windows).
It gives state-of-the-art results (or close to it) on several named-entity recognition datasets. As Ale mentions, each named-entity recognition algorithm has its own downsides and upsides.
ANN architecture:
As viewed in TensorBoard:
I don't really know about NER, but judging from that example, you could make an algorithm that searched for capital letters in the words or something like that. For that I would recommend regex as the most easy to implement solution if you're thinking small.
Another option is to compare the texts with a database, wich yould match string pre-identified as Tags of interest.
my 5 cents.
I am completely new to programming - my interest lies in PHP & MySql for building a dynamic web application for Military Band Administration purposes. i.e. General info and social networking for members + added functionality for the management team to communicate effectively.
OK so the question - as I learn more about PHP there are terms used that I do not understand that must come from a common basis of familiarity between all languages i.e. "stack overflow" appears to be an obvious one - "using too many recursive functions may smash the stack" is another.
So is there a book (a primer perhaps) about programming in general which allows someone like me to have a better understanding of what all this means?
Bear in mind I am 57 years old (young) and am really just starting out.
Steve
Wikipedia is probably your best resource for general information on programming terminology. A large segment of their community overlaps with the programming community, so tech-related pages are normally very accurate, educational, and up to date. See their pages on stack overflows and recursion as examples.
Also, PHP.net is the best place to learn about PHP specifically, but skip the main page and go straight to the tutorial if you're just starting out.
Finally, I highly recommend the book Head First SQL for learning about databases. All of the examples in the book use MySQL. The entire Head First series is great. I hear they have a PHP book as well, but I haven't read that one.
Update: Head First PHP & MySQL is now available.
It sounds like you're missing some of the fundamentals covered in a computer science program. Not to worry, the information is readily available. You don't have to pay someone to teach it (though it's sometimes nice). Wikipedia's computer science entry isn't too bad for highlighting the major fields you're likely to encounter. Topics that are good to know:
Discrete math (Helps to understand formal logic, algorithmic complexity, probability)
Programming fundamentals (sounds like you may have a good start on these)
Data structures (Store and manipulate your data in an appropriate way for a task. For instance, why use a hashtable versus an array versus a linked list? From your list, the stack in a stackoverflow is a data structure.)
Algorithms (Manipulate your data structures in the most efficient way possible or at least know the cost. From your list, using too many recursive functions to "smash the stack" is an algorithmic choice.)
Computer Architecture (Understand what's really happening to your code after it's compiled or interpreted.)
Networks (Learn protocols, what happens to your software when it wants to talk to a machine it's not running on)
Comparative Programming Languages (PHP is just one way to skin a cat. Learn why its designers made the decisions they did and gain exposure to alternatives.)
Operating Systems (Knowing how hardware interacts with your software is good but it's probably more important to understand how it interacts with its operating system. File systems, process management, memory management, security)
Formal Languages/Theory of computation (Models of computing, grammars [used to validate and interpret code], limits of computing. Typically not used day to day as a software engineer. Then again, regular expressions finally made sense after this class.)
Software Design and Life cycle Methodologies (Be deliberate about designing, coding, testing, releasing, and maintaining your software.)
As far as books, I'd start by checking a trusted school's computer science program reading.
Stanford offers a set of classes online for free: http://see.stanford.edu/see/courses.aspx
MIT lets you download course materials for free: http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-Science/
Check youtube for computer science related lectures.
If you want something less school-focused, a quick search on Amazon with any of the topics above will give you results with user reviews.
Obviously, taken together, this list isn't really an introduction. I'd start with a topic that sounds interesting and jump in.
Well it is not book about PHP but I think a book like "Learn to program" from the Pragmatic Bookshelf
might be useful for someone in your situation.
To get a good understanding of the inner workings of computer hardware and software in a very readable (not too technical) manner, I can recommend Code,The Hidden Language of Computer Hardware and Software by Charles Petzold.
The later chapters in particular talk about some of these more general programming concepts that are present in most programming languages. The earlier chapters focus on more the history of the computer and software, so not as relevant to your question.
However it's not a large book so the reading it all should be interesting/useful anyway.
There are better books if you are looking for an introduction to PHP/MySQL programming specifically, however if you want more general knowledge about how software and hardware works, Code is great.
I'm not sure if there's one book that'll teach you "The Fundamentals of Programming." The only way I know of learning all these things is simply practice. Get a PHP tutorial and start building things. Always keep your mind open to learning new things. When you find a better way to do something than a likely very inefficient hack you put together from incomplete knowledge, then use it and learn it and integrate it into your knowledge... after a few years of this you'll be golden.
It's been a couple years since I read it, but Programming PHP did a nice job of introducing the fundamental programming concepts along the way. It didn't do much for helping understand more advanced concepts, like MVC (which is rare in the PHP world), it things like arrays, functions, callbacks, classes, etc, where covered.
I like Corbin's comment, but I'll take the opposite approach.
Basically, with systems today, you really don't need to know all of the low level details of systems. Really, you don't.
If you find this stuff interesting, the entire internet is at your disposal -- and simply let you inner muse guide you through either necessity or simple curiousity. You can go as deep or as high as you want.
The truth is, computing today is simply SO fabulous that the project you want to embark upon is just a perfect opportunity to learn more about the arcane world of computing. The fact that folks can get as far as they can "without having a clue" is testament to how far the field has advanced. It's a good thing.
Is it a good thing to understand the process soup to nuts? Sure. Do you actually NEED that understanding to be productive and get useful results out of your time investment? No, you don't.
And, as you progress, if you actually enjoy this work (you well may not), the field goes as broad as you want.
Computing today is like "Home Depot". You can do it, we can help. There are hundreds of forums and thousands of pages of documentation, books, blogs, and discussion available for most any topic.
The key thing to focus on is simply getting your task done. Don't worry about getting it perfect, don't worry about "doing it the right way", don't "engineer" it. Just hammer bits together until you get something close to resembling what you want to get done using whatever you happen to find or intuit yourself. Because that's the easiest way to find out what you don't know, and how to not do things in your application. Try it and see.
You will be blinded by options, techniques, patterns, frameworks, etc. Not only is there "more than one way to do it", there are HUNDREDS of ways "to do it". Ignore the hundreds, and focus on the "doing it", however seems natural to you.
And don't let the yahoo's in their ivory towers poo-poo your questions, or shred your design. Unless their name is "Babbage" or they were cutting gears for the artillery computers back in WWII, we're all standing on the shoulders of giants here, and we all started somewhere. Honest criticism should always be welcome, but some folks seem to be beyond being able to offer that and instead resort to belittling.
I marvel at the applications I've seen "hacked", "butchered" and "OMG'd" together that folks get real, practical use out of -- and that's the real name of the game.
Good luck on your journey. Success in all your endeavors.
Learning is quite individual, so your mileage may vary, but I find that asking questions in public fora is very helpful. If you don't know a lot of the topic it's easy to ask the wrong questions, or somehow focus on the wrong things. Getting direct feedback from someone more experienced usually helps with that. PHP is blessed in that it has a very large and friendly community. Further, a lot of its users are amateurs or inexperienced programmers, which means that there is a culture of asking basic questions about terminology and the like. I suggest that you tap into this source.
One place to start could be at sitepoint, but there are other places
If you're more of a visual learner I would check out some video tutorials. Start with things like basic programming concepts and then move up to titles like Up and Running with PHP and Advanced PHP and MySQL. Then I'd suggest an MVC framework like codeigniter.
You can find great video tutorials on Lynda.com or Pluralsight.com and several other places.