I'm currently getting through the http://www.cplusplus.com tutorial and I came across this section here: http://www.cplusplus.com/doc/tutorial/inheritance.html that deals with the subject of friend functions and friend classes in C++.
My question is, when When is it prudent to use friendship when creating a program?
The only clue I g...
For community websites like Facebook, myspace, etc.. They have a feature called "Friendship", means you can add friends, send "add friends request", etc..
How to structure it in database? I means, what tables required? What are the columns for each table required?
...
Suppose I have a Base class:
class Base {
friend SomeOtherClass;
};
And there is another (different) class that inherits from Base:
class AnotherClass : public Base {}
Is friendship inherited as well?
Thank you
...
I recently got my first programming internship and was extremely excited to finally be able to talk with and interact with fellow programmers. I had this assumption that I would find a bunch of like minded individuals who enjoyed programming and other aspects of geek culture. Unfortunately, I find myself working with normal people who pr...
In section 11.5.1 of "The C++ Programming Language", Bjarne Stroustrup writes:
Like a member declaration, a friend declaration does not introduce a name into an enclosing scope.
For example:
class Matrix
{
friend class Xform;
friend Matrix invert (const Matrix &);
//..
};
Xform x; // error: no Xform in scope
Matrix (*p...
Ok I have searched before asking, all I found was several questions asking what I am but 0 answers so maybe someone who knows will see this or I will make it a more clear question.
I have a social network similar to myspace/facebook. In my code you are either a person's friend or not a friend, so I show all actions from people you are f...
On a social network I am working on in PHP/MySQL, I have a friends page, it will show all friends a user has, like most networks do. I have a friend table in mysql, it only has a few fields. auto_ID, from_user_ID, to_friend_ID, date
I would like to make the friends page have a few different options for sorting the results,
1) By auto...
Hi,
I'm creating a little social network in Rails, where people can add eachother as a friend. I have created a model called 'user', which contains, e-mail, strong md5 hash with salt of password etc...
My question is: how do I create something like an option to add another user as a friend. Is it possible to have something like has_man...
I would need a dynamic foreign key. What I mean? When frienships.profile_id = 1, then the foreign key is friend_id, when is frienships.friend_id = 1, the foreign key is profile_id
Im using this, but is not working.
has_many :removed_friends, :foreign_key => "(CASE WHEN friendships.profile_id = #{self.id} THEN friend_id ELSE profile_id ...
hello there, I have the following class
#ifndef Container_H
#define Container_H
#include <iostream>
using namespace std;
class Container{
friend bool operator==(const Container &rhs,const Container &lhs);
public:
void display(ostream & out) const;
private:
int sizeC; // size of Container
int capacityC; ...
Consider the following:
These classes are in different header files and each header file has its corrresponding source files.
//------------------------------------------
// in Z.h
class Z
{
public:
Z();
~Z();
void DoSomethingNasty();
}
//------------------------------------------
// in X.h
class X
{
public:
X();...
Hi everyone, im trying this concept of building a friend system for my application.I have some sucess in designing a database table for storing message a member updates in his profile.
This is the table model.
Message_id|Message|Message_Author
This is the table model to hold further message that belongs to a particular message.
F...
I have two tables: Users and Friendships.
The actions I have in the website are:
Register
Log in
Select friends/people from users table
Add people as friends
There are a little more actions but in general i wanted to know :
The Question:
Should I use InnoDB or MyISAM for the tables ?
( Or InnoDB for one and MyISAM for the other ? ...