Search Results

Search found 2451 results on 99 pages for 'friend'.

Page 4/99 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Friends, templates, overloading <<

    - by Crystal
    I'm trying to use friend functions to overload << and templates to get familiar with templates. I do not know what these compile errors are: Point.cpp:11: error: shadows template parm 'class T' Point.cpp:12: error: declaration of 'const Point<T>& T' for this file #include "Point.h" template <class T> Point<T>::Point() : xCoordinate(0), yCoordinate(0) {} template <class T> Point<T>::Point(T xCoordinate, T yCoordinate) : xCoordinate(xCoordinate), yCoordinate(yCoordinate) {} template <class T> std::ostream &operator<<(std::ostream &out, const Point<T> &T) { std::cout << "(" << T.xCoordinate << ", " << T.yCoordinate << ")"; return out; } My header looks like: #ifndef POINT_H #define POINT_H #include <iostream> template <class T> class Point { public: Point(); Point(T xCoordinate, T yCoordinate); friend std::ostream &operator<<(std::ostream &out, const Point<T> &T); private: T xCoordinate; T yCoordinate; }; #endif My header also gives the warning: Point.h:12: warning: friend declaration 'std::ostream& operator<<(std::ostream&, const Point<T>&)' declares a non-template function Which I was also unsure why. Any thoughts? Thanks.

    Read the article

  • CSS Horizontal Line

    - by Neb
    In my site I added google friend connect. Now on the right where the sidebar is, there is a small line. How do I remove the line because I dont want it there.

    Read the article

  • Cpp some basic problems

    - by DevAno1
    Hello. My task was as follows : Create class Person with char*name and int age. Implement contructor using dynamic allocation of memory for variables, destructor, function init and friend function show. Then transform this class to header and cpp file and implement in other program. Ok so I've almost finished my Person class, but I get error after destructor. First question is how to write this properly ? #include <iostream> using namespace std; class Person { char* name; int age; public: int * take_age(); Person(){ int size=0; cout << "Give length of char*" << endl; cin >> size; name = new char[size]; age = 0; } ~Person(){ cout << "Destroying resources" << endl; delete *[] name; delete * take_age(); } friend void(Person &p); int * Person::take_age(){ return age; } void init(char* n, int a) { name = n; age = a; } void show(Person &p){ cout << "Name: " << p.name << "," << "age: " << p.age << endl; } }; int main(void) { Person *p = new Person; p->init("Mary", 25); p.show(); system("PAUSE"); return 0; } And now with header/implementation part : - do I need to introduce constructor in header/implementation files ? If yes - how? - my show() function is a friendly function. Should I take it into account somehow ? I already failed to return this task on my exam, but still I'd like to know how to implement it.

    Read the article

  • Friendness and derived class

    - by ereOn
    Hi, Let's say I have the following class hierarchy: class Base { protected: virtual void foo() = 0; friend class Other; }; class Derived : public Base { protected: void foo() { /* Some implementation */ }; }; class Other { public: void bar() { Derived* a = new Derived(); a->foo(); // Compiler error: foo() is protected within this context }; }; I guess I could change it too a->Base::foo() but since foo() is pure virtual in the Base class, the call will result in calling Derived::foo() anyway. However, the compiler seems to refuse a->foo(). I guess it is logical, but I can't really understand why. Am I missing something ? Can't (shouldn't) it handle this special case ? Thank you.

    Read the article

  • Google App Engine - How to implement the activity stream in a social network

    - by spidee
    I want some ideas on the best practice to implement an activity stream for a social network im building in app engine (PYTHON) I first want to keep a log for all activities of each user - so that we have a history. i.e. someone became a friend, added a picture, changed their address etc. This way we have a users history available should we need it. Also mean we can remove friendship joins, change user data but have a historical log. I also want to stream a users activity to their friends. for this only the last X activities need to be kept - that is in the scenario that messages are sent to friends when an activity occurs. Its pretty straight forward designing a history log - ie: when, what, where. The complication comes as to how we notify friends of a user as to their activity. In our app friendships are not mutual - ie they are based on the twitter following model. Some accounts could have thousands of followers. What is the best approach to model this. using a many to many join table and doing a costly query - using a feed class that fired a copy of the activity to all the subscribers - maybe into mcache? As their maybe a need to fire thousands of messages i would imagine a cron job would need to be used. Any help ideas thoughts on this Thx

    Read the article

  • How can I use UML to model a relationship between two classes, where one has functions exposed as friend to the other?

    - by user1796528
    I have a two classes: ------------ --------------- X Y ------------ --------------- relation ------------ ------------------ --------------- A() C() B() D() E() ------------ --------------- I want to inherit just these two functions from X class, where they are defined with the friend access modifier. My class will be: --------------- Y --------------- --------------- C() A() D() --------------- Y class uses some functions of X class namely A and D. How can I model this relationship in a UML class diagram?

    Read the article

  • How does Google Friend Connect accomplish cross domain communication without needing to upload a file to the client domain?

    - by mboyle
    Previously, Google's Friend Connect required users to upload a couple of files to their websites to enable cross domain communication and Facebook Connect still requires you to upload a single file to enabled it. Now, Friend Connect doesn't require any file upload... I was wondering how they were able to accomplish this. Reference: http://www.techcrunch.com/2009/10/02/easy-does-it-google-friend-connect-one-ups-facebook-connects-install-wizard/

    Read the article

  • Only show activities from a specific gadget in OpenSocial

    - by corné
    I created a gadget which is able to post activities: function postActivity(text) { var params = {}; params[opensocial.Activity.Field.TITLE] = text; var activity = opensocial.newActivity(params); opensocial.requestCreateActivity(activity, opensocial.CreateActivityPriority.HIGH); }; And I request activities by doing: req.add(req.newFetchActivitiesRequest( new opensocial.IdSpec({'userId' : 'VIEWER', 'groupId' : 'FRIENDS'})), 'friends_activities'); My question is: How can I filter activities to only show activities posted by a specific gadget? I reckon the field "appId" is meant for this, but this field is empty in the response.

    Read the article

  • Is there a simple way to emulate friendship in php 5.3

    - by Itay Moav
    I need some classes to befriend other classes in my system. Lack of this feature made me publicize some methods which shouldn't be public. The consequences of that are that members of my team implement code in a bad and ugly way which causes a mess. Is there a way to define a friendship in php 5.3? (I am aware of http://bugs.php.net/bug.php?id=34044 You might want to vote there if there is no simple solution).

    Read the article

  • How to make an add friend/defriend function in PHP?

    - by user300371
    I have created a site where people can create a profile. But I am trying to figure out how to start on making an add friend button so users can have friends. In my user table, i have user_id, first_name, last_name, email, etc. Should I somehow relate the user_id of the user and the friend in a friend table? I am a novice to programming, so these things are still new to me. Thanks!

    Read the article

  • I'm trying to use a PHP code for panel visibility in a Panels3 based on Friendlist

    - by user366902
    I'm trying to gain a truth value to gain panel visibility. I have a view in place in a panel to display a listing of heartbeat messages that belong to a user. The display works but I cannot figure out how to restrict access to the panel based on the user who is viewing the panel. Goal is I want the panel to only be visible to friends and some people with certain roles. The roles I can handle but I don't know enough about PHP to get it working based on friendship status. I vaguely guess it would be something like: logged user is twoway with user being viewed based on current uid argument. I know my example is nothing like the actual code but as I said I don't have much to go on here.

    Read the article

  • Dropbox Doubles Referral Credit; Score 500MB for Each Friend You Refer

    - by Jason Fitzpatrick
    Dropbox is doubling the amount of free storage you get per-referral to 500MB, doubling the previous 250MB credit–better yet, the bonus is retroactive and applies to referrals you’ve already made. From the DropBox blog: How much space is that, exactly? For every friend you invite that installs Dropbox, you’ll both get 500 MB of free space. If you’ve got a free account, you can invite up to 32 people for a whopping total of 16 GB of extra space. Pro accounts now earn 1 GB per referral, for a total of 32 GB of extra space. Have you already invited a bunch of people? Don’t worry. Within a few days, you’ll get full credit for every referral that’s already been completed. Boom! Hit up the link below for the full announcement. Dropbox Referrals Now Twice As Nice [Dropbox] How to Sync Your Media Across Your Entire House with XBMC How to Own Your Own Website (Even If You Can’t Build One) Pt 2 How to Own Your Own Website (Even If You Can’t Build One) Pt 1

    Read the article

  • getView() (for a Custom ListView ) doesn't get called on notifyDatasetChanged()

    - by hungson175
    Hi everyone, I have the following problem, and searched for a while but haven't got any solution from the net: I have a custom list view, each item has the following layout (I just post the essential): <LinearLayout> <ImageView android:id="@+id/friendlist_iv_avatar" /> <TextView andorid:id="@+id/friendlist_tv_nick_name" /> <ImageView android:id="@+id/friendlist_iv_status_icon" /> </LinearLayout> And I have a class FriendRowItem, which is inflated from the above layout: public class FriendRowItem extends LinearLayout{ private ImageView ivAvatar; private ImageView ivStatusIcon; private TextView tvNickName; public FriendRowItem(Context context) { super(context); RelativeLayout friendRow = (RelativeLayout) Helpers.inflate(context, R.layout.friendlist_row); this.addView(friendRow); ivAvatar = (ImageView)findViewById(R.id.friendlist_iv_avatar); ivStatusIcon = (ImageView)findViewById(R.id.friendlist_iv_status_icon); tvNickName = (TextView)findViewById(R.id.friendlist_tv_nick_name); } public void setPropeties(Friend friend) { //Avatar ivAvatar.setImageResource(friend.getAvatar().getDrawableResourceId()); //Status Status.Type status = friend.getStatusType(); if ( status == Type.ONLINE) { ivStatusIcon.setImageResource(R.drawable.online_icon); } else { ivStatusIcon.setImageResource(R.drawable.offline_icon); } //Nickname String name = friend.getChatID(); if ( friend.hasName()) { name = friend.getName(); } tvNickName.setText(name); } } In the main activity, I have a custom listview: lvMainListView, with an custom adapter (whose class extends ArrayAdapter - and off course: override the method getView ), the data set of the adapter is: ArrayList<Friend> friends: private class FriendRowAdapter extends ArrayAdapter<Friend> { public FriendRowAdapter(Context applicationContext, int friendlistRow, ArrayList<Friend> friends) { super(applicationContext, friendlistRow, friends); } @Override public View getView(int position,View convertView,ViewGroup parent) { Friend friend = getItem(position); FriendRowItem row = (FriendRowItem) convertView; if ( row == null ) { row = new FriendRowItem(ShowFriendsList.this.getApplicationContext()); } row.setPropeties( friend ); return row; } } the problem is when I change the status of a friend from OFFLINE to ONLINE, then call notifyDataSetChanged(), nothing happens : the status icon of that friend doesn't change. I tried debugging, and saw the code: notifyDataSetChanged() get called, but the custom getView() is not fired ! Can you please tell me, that is normal in Android, or did I do something wrong ? (I am using Android 1.5). Thank you in advance, Son

    Read the article

  • Facebook connect And Yahoo.. How and what exactly happened? Is there way to import facebook friend's email id?

    - by Forte
    Hello, I have seen that yahoo now enables their users to import facebook friend's email addresses into their yahoo addressbook. As far as i know, facebook doesn't allow any API to fetch email addresses of any user on external websites. I have also seen that Yahoo imports email addresses only when the friend's have chosen not to display their contact email to themselves only. Many people in the world trying to implement applications using facebook's API to import email addresses of friend's (Only those email addresses which are visible on user's facebook profile) but API calls always return NULL to their requests. So i would like to know what exactly happened between facebook and yahoo? Does facebook have provided any concessions to Yahoo's addressbook importer application to import facebook user's email addresses? Is there any working API/method/way available to fetch email addresses of facebook friends who have chosen to display their contact email ids on their profile with 1: only visible to friends, 2: visible to everyone privacy settings? I have also seen that, facebook API page clearly listen that email/contact_email field's can be fetched using FQL. Nevertheless there is no official explanation on this issue of returning NULL when email/contact_email is requested from any API call. Regards

    Read the article

  • How to post on my friend's Facebook Wall using koala gem??

    - by Cody
    I am trying to post a message on my friend's Facebook wall using Koala Gem in my Web Application. I am trying using the following code @user.put_wall_post("Hey, Welcome to the Web Application!!!!",{:name => "Friend's Name"} ) I have also tried replacing the name of my friend with his Facebook Id, but it is of no help... @user.put_wall_post("Hey, Welcome to the Web Application!!!!",{:name => "10001010101010"} ) But, both the above methods post the message on my wall. What am I wrong with??

    Read the article

  • Is there an equivalent to C++'s "friend class" in Java?

    - by Ricket
    In C++ there is a concept of a "friend", which has access to a class's private variables and functions. So if you have: class Foo { friend class Bar; private: int x; } then any instance of the class Bar can modify any Foo instance's x member, despite it being private, because Bar is a friend of Foo. Now I have a situation in Java where this functionality would come in handy. There are three classes: Database, Modifier, Viewer. The Database is just a collection of variables (like a struct). Modifier should be "friends" with Database; that is, it should be able to read and write its variables directly. But Viewer should only be able to read Database's variables. How is this best implemented? Is there a good way to enforce Viewer's read-only access of Database?

    Read the article

  • What is the simplest way to send a large batch of pictures to a distant friend or colleague?

    - by Notitze
    What is the simplest way to send a large batch of pictures to a friend, colleague or to a group? I know about social sites like Picasa or Facebook but not everyone in my group has an account, nor I want to make any of the pictures public. Uploading repeated batches won't do for this and definitely sending through email won't cut it. Also Ftp solutions are just too technical. Is there just a simple tool for this?

    Read the article

  • UltraSurf not working, used to work on same network (and is working fine on friend's computer on same network)

    - by Kush
    I'm using UltraSurf (10.17), it used to work fine but now its not working on my computer (Windows 7) and the window keeps showing "Connecting Server..." and after sometime, it fails to establish the connection. While, its working perfectly on the friend's computer on the same network. Any help will be appreciated. (Please note that using Proxifier would be my last option if I can't get UltraSurf working anyway).

    Read the article

  • Is it still true, to make cross broswer layouts for desktop browsers using table+css is easier then

    - by metal-gear-solid
    My one of web designer friend still making sites with table but he use css very nicely and I also use css nicely but with <div> and i face cross browser problem in layout more than my friend. and i given some reason to my friend about cons of <table>. read my whole discussion with friend? I - you site will be problematic with screen reader My friend - OK, but i never got any call from any client regarding this. I - you will devote more time to make any changes in layout, if changes comes from client My friend - I don't think so, but if it is then show me how can i save time with <div>? I - your sites will not work well with search engine. My friend - it's not true. I've made many site and no problem with any site or client regarding this I - layout is old way, non w3c and non standard way. My friend - what is old and what is new, Who is W3C i don't know, What is standard? Whatever i make works in all browsers, it's enough for me and my client will not pay for standard and W3C guidelines rules I - Your site will not work in mobile browsers My friend - No problem for me, my client don't care about mobile phone I - Your sites are not accessible? My Friend - What do u mean not accessible? Whatever i make works in all browsers. my any client never asked about accessibility I - You will not get more work in future, with table? My friend - OK, no problem when clients will not accept site with table then i will learn about div based layouts in future. My questions? Is it still true, to make cross browser layouts for desktop browsers using table+css is easier then div+css? What is the benefit for developer to use DIV+CSS layout in place of <table> layouts if client would not mind if i use ?

    Read the article

  • I lent my 3 USB modem to a friend because her Meteor USB modem had run out of credit.

    - by oddbyte7
    I lent my 3 USB modem to a friend because her Meteor USB modem had run out of credit. The 3 modem worked on her machine fine once the driver was installed. She bought Meteor credit a couple of days later, uninstalled the 3 driver and she only now seems to get on the Meteor server, when you try IE8 or Firefox you get the message “Page could not be found”. I uninstalled the Meteor driver and reinstalled…no change. The OS is Win_7 home edition. Any help would be much appreciated. Regards to all, oddbyte7.

    Read the article

  • Why this friend function can't access a private member of the class?

    - by Alceu Costa
    I am getting the following error when I try to access bins private member of the GHistogram class from within the extractHistogram() implementation: error: 'QVector<double> MyNamespace::GHistogram::bins' is private error: within this context Where the 'within this context' error points to the extractHistogram() implementation. Does anyone knows what's wrong with my friend function declaration? Here's the code: namespace MyNamespace{ class GHistogram { public: GHistogram(qint32 numberOfBins); qint32 getNumberOfBins(); /** * Returns the frequency of the value i. */ double getValueAt(qint32 i); friend GHistogram * Gbdi::extractHistogram(GImage *image, qint32 numberOfBins); private: QVector<double> bins; }; GHistogram * extractHistogram(GImage * image, qint32 numberOfBins); }

    Read the article

  • Why do I get the error "X is not a member of Y" even though X is a friend of Y?

    - by user1232138
    I am trying to write a binary tree. Why does the following code report error C2039, "'<<' : is not a member of 'btree<T'" even though the << operator has been declared as a friend function in the btree class? #include<iostream> using namespace std; template<class T> class btree { public: friend ostream& operator<<(ostream &,T); }; template<class T> ostream& btree<T>::operator<<(ostream &o,T s) { o<<s.i<<'\t'<<s.n; return o; }

    Read the article

  • SQL SERVER – Solution – User Not Able to See Any User Created Object in Tables – Security and Permissions Issue

    - by pinaldave
    There is an old quote “A Picture is Worth a Thousand Words”. I believe this quote immensely. Quite often I get phone calls that something is not working if I can help. My reaction is in most of the cases, I need to know more, send me exact error or a screenshot. Until and unless I see the error or reproduce the scenario myself I prefer not to comment. Yesterday I got a similar phone call from an old friend, where he was not sure what is going on. Here is what he said. “When I try to connect to SQL Server, it lets me connect just fine as well let me open and explore the database. I noticed that I do not see any user created instances but when my colleague attempts to connect to the server, he is able to explore the database as well see all the user created tables and other objects. Can you help me fix it? “ My immediate reaction was he was facing security and permission issue. However, to make the same recommendation I suggested that he send me a screenshot of his own SSMS and his friend’s SSMS. After carefully looking at both the screenshots, I was very confident about the issue and we were able to resolve the issue. Let us reproduce the same scenario and many there is some learning for us. Issue: User not able to see user created objects First let us see the image of my friend’s SSMS screen. (Recreated on my machine) Now let us see my friend’s colleague SSMS screen. (Recreated on my machine) You can see that my friend could not see the user tables but his colleague was able to do the same for sure. Now I believed it was a permissions issue. Further to this I asked him to send me another image where I can see the various permissions of the user in the database. My friends screen My friends colleagues screen This indeed proved that my friend did not have access to the AdventureWorks database and because of the same he was not able to access the database. He did have public access which means he will have similar rights as guest access. However, their SQL Server had followed my earlier advise on having limited access for guest access, which means he was not able to see any user created objects. My next question was to validate what kind of access my friend’s colleague had. He replied that the colleague is the admin of the server. I suggested that if my friend was suppose to have admin access to the database, he should request of having admin access to his colleague. My friend promptly asked for the same to his colleague and on following screen he added him as an admin. You can do the same using following T-SQL script as well. USE [AdventureWorks2012] GO ALTER ROLE [db_owner] ADD MEMBER [testguest] GO Once my friend was admin he was able to access all the user objects just like he was expecting. Please note, this complete exercise was done on a development server. One should not play around with security on live or production server. Security is such an issue, which should be left with only senior administrator of the server. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Security, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • Making one of a group of similar form fields required in CakePHP

    - by Pickledegg
    I have a bunch of name/email fields in my form like this: data[Friend][0][name] data[Friend][1][name] data[Friend][2][name] etc. and data[Friend][0][email] data[Friend][1][email] data[Friend][2][email] etc. I have a custom validation rule on each one that checks to see if the corresponding field is filled in. Ie. if data[Friend][2][name] then data[Friend][2][email] MUST be filled in. FYI, heres what one of the two rules look like: My form validation rule: ( I have an email validation too but that's irrelevant here) 'name' => array( 'checkEmail' => array( 'rule' => 'hasEmail', 'message' => 'You must fill in the name field', 'last' => true ) ) My custom rule code: function hasEmail($data){ $name = array_values($data); $name = $name[0]; if(strlen($name) == 0){ return empty($this->data['Friend']['email']); } return true; } I need to make it so that one of the pairs should be filled in as a minimum. It can be any as long as the indexes correspond. I can't figure a way, as if I set the form rule to be required or allowEmpty false, it fails on ALL empty fields. How can I check for the existence of 1 pair and if present, carry on? Also, I need to strip out all of the remaining empty [Friend] fields, so my saveAll() doesn't save a load of empty rows, but I think I can handle that part using extract in my controller. The main problem is this validation. Thanks.

    Read the article

  • Can I do this in only one query ?

    - by Paté
    Merry christmas everyone, I Know my way around SQL but I'm having a hard time figuring this one out. First here are my tables (examples) User id name friend from //userid to //userid If user 1 is friend with user 10 then you a row with 1,10. User 1 cannot be friend with user 10 if user 10 is not friend with user 1 so you have 1,10 10,1 It may look weird but I need those two rows per relations. Now I'm trying to make a query to select the users that have the most mutual friend with a given user. For example User 1 is friend with user 10,9 and 7 and user 8 is friend with 10,9 and 7 too ,I want to suggest user 1 to invite him (like facebook). I want to get like the 10 first people with the most mutual friend. The output would be like User,NumOfMutualFriends I dont know if that can be done in a single query ? Thanks in advance for any help.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >