Search Results

Search found 31807 results on 1273 pages for 'app beginner'.

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

  • C++ Beginner - 'friend' functions and << operator overloading: What is the proper way to overload an

    - by Francisco P.
    Hello, everyone! In a project I'm working on, I have a Score class, defined below in score.h. I am trying to overload it so, when a << operation is performed on it, _points + " " + _name is returned. Here's what I tried to do: ostream & Score::operator<< (ostream & os, Score right) { os << right.getPoints() << " " << right.scoreGetName(); return os; } Here are the errors returned: 1>c:\users\francisco\documents\feup\1a2s\prog\projecto3\projecto3\score.h(30) : error C2804: binary 'operator <<' has too many parameters (This error appears 4 times, actually) I managed to get it working by declaring the overload as a friend function: friend ostream & operator<< (ostream & os, Score right); And removing the Score:: from the function declaration in score.cpp (effectively not declaring it as a member). Why does this work, yet the code describe above doesn't? Thanks for your time! Below is the full score.h /////////////////////////////////////////////////////////// // Score.h // Implementation of the Class Score // Created on: 10-Mai-2010 11:43:56 // Original author: Francisco /////////////////////////////////////////////////////////// #ifndef SCORE_H_ #define SCORE_H_ #include <string> #include <iostream> #include <iostream> using std::string; using std::ostream; class Score { public: Score(string name); Score(); virtual ~Score(); void addPoints(int n); string scoreGetName() const; int getPoints() const; void scoreSetName(string name); bool operator>(const Score right) const; ostream & operator<< (ostream & os, Score right); private: string _name; int _points; }; #endif

    Read the article

  • Beginner SQL section: avoiding repeated expression

    - by polygenelubricants
    I'm entirely new at SQL, but let's say that on the StackExchange Data Explorer, I just want to list the top 15 users by reputation, and I wrote something like this: SELECT TOP 15 DisplayName, Id, Reputation, Reputation/1000 As RepInK FROM Users WHERE RepInK > 10 ORDER BY Reputation DESC Currently this gives an Error: Invalid column name 'RepInK', which makes sense, I think, because RepInK is not a column in Users. I can easily fix this by saying WHERE Reputation/1000 > 10, essentially repeating the formula. So the questions are: Can I actually use the RepInK "column" in the WHERE clause? Do I perhaps need to create a virtual table/view with this column, and then do a SELECT/WHERE query on it? Can I name an expression, e.g. Reputation/1000, so I only have to repeat the names in a few places instead of the formula? What do you call this? A substitution macro? A function? A stored procedure? Is there an SQL quicksheet, glossary of terms, language specification, anything I can use to quickly pick up the syntax and semantics of the language? I understand that there are different "flavors"?

    Read the article

  • C# Keyboard Input (Beginner Help)

    - by ThickBook
    I am trying to ask user "enter any key and when that key is pressed it shows that "You Pressed "Key". Can you help what's wrong in this code? This is what I have written using System; class Program { public static void Main(string[] args) { Console.Write("Enter any Key: "); char name = Console.Read(); Console.WriteLine("You pressed {0}", name); } }

    Read the article

  • Beginner += in Ruby

    - by WANNABE
    Looking at this block, I can follow the whole program until I hit, sum += square. What is he point of this line, what does it say??? sum = 0 [1, 2, 3, 4].each do |value| square = value * value sum += square end puts sum

    Read the article

  • Beginner C++ - Trouble using global constants in a header file

    - by Francisco P.
    Hello! Yet another Scrabble project question... This is a simple one. It seems I am having trouble getting my global constants recognized: My board.h: http://pastebin.com/R10HrYVT Errors returned: 1>C:\Users\Francisco\Documents\FEUP\1A2S\PROG\projecto3\projecto3\Board.h(34): error: variable "TOTAL_ROWS" is not a type name 1> vector< vector<Cell> > _matrix(TOTAL_ROWS , vector<Cell>(TOTAL_COLUMNS)); 1> 1>main.cpp 1>compilation aborted for .\Game.cpp (code 2) 1>Board.cpp 1>.\Board.h(34): error: variable "TOTAL_ROWS" is not a type name 1> vector< vector<Cell> > _matrix(TOTAL_ROWS , vector<Cell>(TOTAL_COLUMNS)); 1> ^ 1> Why does this happen? Why is the compiler expecting types? Thanks for your time!

    Read the article

  • Beginner PHP: I can't insert data into MYSQL database

    - by Victor
    I'm learning PHP right now and I'm trying to insert data into a MySQL database called "pumpl2" The table is set up like this. create table product ( productid int unsigned not null auto_increment primary key, price int(9) not null, value int(9) not null, description text ); I have a form and want to insert the fields from the form in the database. Here is what the php file looks like. <?php // create short variable names $price = $_POST['price']; $value = $_POST['value']; $description = $_POST['description']; if (!$price || !$value || !$description) { echo "You have not entered all the required details.<br />" ."Please go back and try again."; exit; } @ $db = new mysqli('localhost', 'pumpl', '********', 'pumpl2'); if (mysqli_connect_errno()) { echo "Error: Could not connect to database. Please try again later."; exit; } $query = "insert into pumpl2 values ('".$price."', '".$value."', '".$description."')"; $result = $db->query($query); if ($result) { echo $db->affected_rows." product inserted into database."; } else { echo "An error has occurred. The item was not added."; } $db->close(); ?> When I submit the form, I get an error message "An error has occurred. The item was not added." Does anyone know what the problem is? Thank you!

    Read the article

  • what is a fun beginner project?

    - by Atticum
    I am learning HTML and I have a good book to learn with but my cousin told me that I should pick a fun project to learn how to program but im not sure what I should do. what is the most fun project to do when you are learning HTML?

    Read the article

  • Beginner questions regarding Python classes.

    - by Andy
    Hi. I am new to Python so please don't flame me if I ask something too noobish :) 1. Consider I have a class: class Test: def __init__(self, x, y): self.x = x self.y = y def wow(): print 5 * 5 Now I try to create an object of the class: x = Test(3, 4) This works as expected. However, when I try to call the method wow(), it returns an error, which is fixed by changing wow() to: def wow(self) Why do I need to include self and if I don't, what does the method mean?2. In the definition of __init__: def __init__(self, x, y): self.x = x self.y = y Why do I need to declare x and y, when I can do this: def __init__(self): self.x = x self.y = y I hope I am being clear... Thanks for your time.

    Read the article

  • Quick, Beginner C++ Overloading Question - Getting the compiler to perceive << is defined for a spec

    - by Francisco P.
    Hello everyone. I edited a post of mine so I coul I overloaded << for a class, Score (defined in score.h), in score.cpp. ostream& operator<< (ostream & os, const Score & right) { os << right.getPoints() << " " << right.scoreGetName(); return os; } (getPoints fetches an int attribute, getName a string one) I get this compiling error for a test in main(), contained in main.cpp binary '<<' : no operator found which takes a right-hand operand of type 'Score' (or there is no acceptable conversion) How come the compiler doesn't 'recognize' that overload as valid? (includes are proper) Thanks for your time.

    Read the article

  • Hardest concept to grasp as a beginner

    - by noizetoys
    When you were starting to program, what was the hardest concept for you to grasp? Was it recursion, pointers, linked lists, assignments, memory management? I was wondering what gave you headaches and how you overcame this issue and learned to love the bomb, I mean understand it. EDIT: As a followup, what helped you grok your hard-to-grasp concept?

    Read the article

  • C++ Beginner - Trouble using structs and constants!

    - by Francisco P.
    Hello everyone! I am currently working on a simple Scrabble implementation for a college project. I can't get a part of it to work, though! Check this out: My board.h: http://pastebin.com/J9t8VvvB The subroutine where the error lies: //Following snippet contained in board.cpp //I believe the function is self-explanatory... //Pos is a struct containing a char, y, a int, x and an orientation, o, which is not //used in this particular case void Board::showBoard() { Pos temp; temp.o = 0; for (temp.y = 'A'; temp.y < (65 + TOTAL_COLUMNS); ++temp.y) { for (temp.x = 1; temp-x < (1 + TOTAL_ROWS); ++temp.x) { cout << _matrix[temp].getContents(); } cout << endl; } } The errors returned on compile time: http://pastebin.com/bZv7fggq How come the error states that I am trying to compare two Pos when I am comparing chars and ints? I also really can't place these other errors... Thanks for your time!

    Read the article

  • php mysql error beginner

    - by Marcelo
    Hi, I'm trying to print some values on the screen from a table but I having a problem, I don't know much about string, vector and array but I think that my problem is related to them. I'm getting this on the screen Fatal error: Cannot use [] for reading ... My code $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql) or trigger_error(mysql_error().$sql); while($row = mysql_fetch_array($result)){ $DATA = $row[]; } //line with probelm mysql_close(); //html part <table> <? foreach($DATA as $row): ?> <tr> <td><?=$row['id']?></td> //more stuff </tr> <? endforeach ?> </table> What I'm trying to do is print somevalues form a database. But I'm getting this error. I'm sorry for any mistake in English, and thanks in advance for any help.

    Read the article

  • Beginner's Question about accessing mysql using OOP

    - by user345690
    I am reading the PHP and mySQL web development book and so far been doing all the PHP and mysql using procedural. But then it talks about accessing mysql with objects. This works for me: //I define $db so can connect $query="select * FROM testing"; $result=mysqli_query($db,$query); while($row=mysqli_fetch_array($result)){ //echo the data } But when I try to do it with classes, it doesn't $query="select * FROM testing"; $result=$db->query($query); $row=$result->fetch_assoc(); Do I have to write my own class so it defines what query and fetch_assoc does? Or what?

    Read the article

  • need a help regarding android 1.5 and 2.1 (beginner)

    - by piemesons
    I am new to android and last year i bought two books of android 1.5. But at that time i was busy in my project so was not able to work on android. Now i want to start android again. Should i go for those books or should i buy new editions Is there any major change regarding basic learnings? Please let me know. Thanks

    Read the article

  • Help regarding android 1.5 and 2.1 (beginner, issue of Book Version)

    - by piemesons
    I am new to android and last year i bought two books of android 1.5. But at that time i was busy in my project so was not able to work on android. Now i want to start android again. Should i go for those books or should i buy new editions Is there any major change regarding basic learnings? Two books i am having are:- Pragmatic Hello Android (New addition of this book is available, But still in beta phase) Apress begining Android (Dont know about this whether new edition is available or not) Please let me know. Thanks EDIT here i am not asking about the good books of android, as there are lot of questions regarding that. I can find out from them. My question is purely related to change in version

    Read the article

  • problems adding an App Engine app to a Google Apps domains

    - by Ron
    We have been adding domains to our app without any issues for past couple months, following these instructions https://developers.google.com/appengine/articles/domains Since yesterday we have not been able to, when clicking Activate this service we get this error message "An error occurred while trying to install this application. Please try again later." We have tried this also with older domains and with different apps and getting the same error, so the problem seems to be more widespread, not isolated to particular domains / apps. Does anyone know how to solve? Thanks Ron

    Read the article

  • My app 'Howzzat Book–Windows 8 Metro App is in the store now

    - by nmarun
    I’m just so excited that my application Howzzat Book passed all certifications and is now in the Windows Store. Here’s the email from MIcrosoft that I received: “Your app is in the Windows Store! Congratulations! Howzzat Book, release 1 is now in the Windows Store. Use this link to your app’s listing in the Windows Store to let others know about your app.” Link for Howzzat Book Now, since they’ve just added it to the store, it might take some time to be available for download. So if you don’t find...(read more)

    Read the article

  • TTS on App Engine

    - by yati sagade
    I have written a small front-end to the Festival TTS system using Python/Django. I wish to deploy it on the Google App Engine cloud. A few questions: My application uses the Festival app 'text2wave'. Will is work on the cloud? I have used Python primitives like subprocess.call() to invoke the aforementioned program. Will that work? If your answer to any or both of (1) and (2) is no, is there a free api on the web that I can use (from the appengine)? I read somewhere about placing calls from Phono to a Voxeo backend, but I'm not sure what that means. I am aware of the Google Translate extension that allows translation using an HTTP GET (REST) request, but here the text is limited to 100 chars. Bad. Plus, they may take it down any point of time.

    Read the article

  • Finding Database issue for iphone app

    - by David Liu
    I know this is a dumb question and it might not be "conceptual" but, as a self-starter I really want to know how to get connected to some sort of "commercial database"? I'm recently designing my local gas station utility app for iphone and ipad. I have absolutely no clue of find a relevant database. For example, if I want to make an app for pizza ordering in the great Chicago area. How do I get info (price, menu, location, etc.) of those pizza stores scattered all over Chicago? Can any one light something for me? I appreciated your help. **If this question is not suitable here please tell me and I will delete this post. Thank you.

    Read the article

  • Using another domain with Google App Engine

    - by gsingh2011
    I'm trying to change my google app engine domain (domain.appspot.com) to the domain I bought from 1&1.com (mydomain.com). I went into the google app engine settings and added the domain. After making a Google Apps account, I was asked to verify my domain. The directions say that 1&1 doesn't allow me to create TXT records, so I can't use that method for verification. Their alternative is to upload an HTML file to my server, but I didn't buy hosting with my domain, I just bought the domain. My files are on domain.appspot.com. How can I make mydomain.com point to domain.appspot.com? I've added the ns1.googleghs.com as my nameservers in my 1&1 DNS settings, but I still can't verify my domain with Google Apps.

    Read the article

  • Which is better? Native App or hybrid App?

    - by Prabakaran
    I want to develop a simple App for iOS, Android and windows phone. I just wondered that a simple HTML5, JS and CSS combination can work in all of these platforms. I want to know which one will be efficient? No problem with time and coding. But if i can achieve everything with HTML5-JS itself, i will chose Hybrid development. I want to know the major difference between the Native and Hybrid Development with example(I know that the main difference is HTML5-JS supports cross platform). Note : I am not making a game app.

    Read the article

  • Grails Warnings/Errors during run-app

    - by Taylor L
    I'm currently seeing the warnings below when trying to run my Google App Engine/Grails test app in Eclipse. Warning, target causing name overwriting of name startLogging Warning: C:\Users\Some Person.grails\1.2.0\projects\test-grails\plugins\app-engine-0.8.8\grails-app\conf\spring not found. Warning: C:\Users\Some Person.grails\1.2.0\projects\test-grails\plugins\app-engine-0.8.8\grails-app\conf not found. Warning: C:\Users\Some Person.grails\1.2.0\projects\test-grails\plugins\app-engine-0.8.8\grails-app\conf\hibernate not found. Here is the output from the console: Base Directory: C:\Users\Some Person\workspace\test-grails Resolving dependencies... Dependencies resolved in 1160ms. Running script C:\grails-1.2.0\scripts\RunApp.groovy Environment set to development Warning, target causing name overwriting of name startLogging [groovyc] Compiling 1 source file to C:\Users\Some Person\workspace\test-grails\web-app\WEB-INF\classes [copy] Copying 1 file to C:\Users\Some Person\.grails\1.2.0\projects\test-grails [copy] Copying 1 file to C:\Users\Some Person\workspace\test-grails\web-app\WEB-INF Configuring persistence for AppEngine [copy] Warning: C:\Users\Some Person\.grails\1.2.0\projects\test-grails\plugins\app-engine-0.8.8\grails-app\conf\spring not found. [copy] Warning: C:\Users\Some Person\.grails\1.2.0\projects\test-grails\plugins\app-engine-0.8.8\grails-app\conf not found. [copy] Warning: C:\Users\Some Person\.grails\1.2.0\projects\test-grails\plugins\app-engine-0.8.8\grails-app\conf\hibernate not found. I get this error after creating a Grails project with Spring Tools Suite (STS) and then installing the app-engine plugin "grails install-plugin app-engine". Before, I install the app-engine plugin the Grails project runs correctly. Any ideas how to resolve these warnings?

    Read the article

  • iPhone - Native App GeoLocation VS Web App GeoLocation

    - by Sam
    Here's my situation; I've built a very simple web app that looks up a users location and plots it on a Google map. Here's my code: http://pastebin.com/d3a185efd When I test it, my location is detected as being = 500 meters from where I actually stand. BUT When I open up Google Maps or Gowalla my location is correct to within <20 meters? So my question is: Do native iPhone apps benefit from a higher accuracy rate than web apps? If so, why?

    Read the article

  • basic unique ModelForm field for Google App Engine

    - by Alexander Vasiljev
    I do not care about concurrency issues. It is relatively easy to build unique form field: from django import forms class UniqueUserEmailField(forms.CharField): def clean(self, value): self.check_uniqueness(super(UniqueUserEmailField, self).clean(value)) def check_uniqueness(self, value): same_user = users.User.all().filter('email', value).get() if same_user: raise forms.ValidationError('%s already_registered' % value) so one could add users on-the-fly. Editing existing user is tricky. This field would not allow to save user having other user email. At the same time it would not allow to save a user with the same email. What code do you use to put a field with uniqueness check into ModelForm?

    Read the article

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