|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
On October 19 2014 16:59 CatNzHat wrote:Show nested quote +On October 19 2014 00:47 goody153 wrote: Hello Sir's,
Me and my friends are planning to put some kind of website that has a drawing app inbound. And i am planning to code a drawing application for the website.
I did some googling and there are i found the HTML canvass + Javascript is an easy way to code such tool.
However i am not sure if this is enough for the long run since we may want to build a more powerful and flexible drawing app than our current plans.
Is there any language, library or framework or something that i should know that is for this certain task drawing webapp and should work better than the html5 + javascript ?
Thanks ..
my current knowledge for web development are html, css, js , php and mysql. I'm also not an expert of those. You will not be limited by javascript, it's only option as far as client-side in browser applications are concerned, and there are various photoshop like web-apps that have very complicated painting engines that all run in the browser (js, canvas)
Or you could make a Java applet for that and take browser compatibility out of the picture entirely? You could also develop it independently of the site itself.
|
Well i'll guess i'll settle for js then as of now.
I did have a experience coding java applets(i forgot to mention) before but i do want to stay away from java as much as possible since it the future users of the site to install java in their respective computers. I want it to be as convenient for users as much as possible.
Thanks for the advice.
|
On October 19 2014 00:51 Nesserev wrote:Show nested quote +On October 18 2014 22:46 darkness wrote:On October 18 2014 21:02 MinoMoto wrote:Guys i need help again I need to create program using "do...while" in C# 1 program is asking you to enter a number(how much times it will do match) 2 program is asking you to enter a number, what will sum with previously entered sum. Pseudo code. int iteration = 0; int maxIterations; int sum = 0; int inputValue;
maxIterations := <take value>
do inputValue := <take value> Print Sum[iteration]=sum+inputValue sum += inputValue ++iteration while iteration < maxIterations
Print Sum[iteration]=sum
+ Show Spoiler +Bonus: check if maxIterations' value is negative.
It's very easy to do it on your own, and part of that assignment is to teach you C# not math. You may also use arrays instead but I don't find it nice with a do-while loop when you depend on a previous iteration.. Well, only problem with using a do-while loop in this case is that you only check for the amount of iterations after asking for the first value. So, when the user wants zero iterations, he/she still has to give input; it won't work as intended, it's semantically incorrect. Ty all works I have another question how can i show arithmetic progression in C# (Using "while")? For example console is asking to enter 3 variables, first how much will arithmetic progression do match, second number = arithmetic progression start number and 3 how much it will + on each cycle.
|
On October 20 2014 06:06 MinoMoto wrote:Show nested quote +On October 19 2014 00:51 Nesserev wrote:On October 18 2014 22:46 darkness wrote:On October 18 2014 21:02 MinoMoto wrote:Guys i need help again I need to create program using "do...while" in C# 1 program is asking you to enter a number(how much times it will do match) 2 program is asking you to enter a number, what will sum with previously entered sum. Pseudo code. int iteration = 0; int maxIterations; int sum = 0; int inputValue;
maxIterations := <take value>
do inputValue := <take value> Print Sum[iteration]=sum+inputValue sum += inputValue ++iteration while iteration < maxIterations
Print Sum[iteration]=sum
+ Show Spoiler +Bonus: check if maxIterations' value is negative.
It's very easy to do it on your own, and part of that assignment is to teach you C# not math. You may also use arrays instead but I don't find it nice with a do-while loop when you depend on a previous iteration.. Well, only problem with using a do-while loop in this case is that you only check for the amount of iterations after asking for the first value. So, when the user wants zero iterations, he/she still has to give input; it won't work as intended, it's semantically incorrect. Ty all works I have another question how can i show arithmetic progression in C# (Using "while")?
Really? It's even in the while example in C# documentation...
|
Hey guys,
I'm gonna pass a couple of interviews for internship soon and I'm a bit nervous. I know they are going to ask technical questions but I'm unsure what kind of question they are going to be, or what topic to are going to cover. Anyone has knowledge of the kind of questions they could ask, knowing I mostly applied on Java and C# offers.
Thanks.
|
Best book for interview study grinding is called "cracking the coding interview". Should give you all the technical questions you'll need.
|
On October 20 2014 08:33 SpiZe wrote: Hey guys,
I'm gonna pass a couple of interviews for internship soon and I'm a bit nervous. I know they are going to ask technical questions but I'm unsure what kind of question they are going to be, or what topic to are going to cover. Anyone has knowledge of the kind of questions they could ask, knowing I mostly applied on Java and C# offers.
Thanks.
Whatever they ask you, don't be afraid to say "I don't know". They will know when you try to pretend knowing things you have no idea of. It's no shame to not have worked with something before, e.g. in my last PHP job interview a year ago they asked me what $x = &DB::getConnection(...) meant. I had never seen "&someFunction();" because that is PHP4 legacy code and I've never worked with PHP before 5.0 (luckily) since those were my Perl, C and C++ years. Even with now ~25 years of programming there are plenty of things I have no idea of because I've never needed them and the interviewers know that this is the case for everyone, so they mostly look for how you deal with things you don't know.
|
|
On October 21 2014 00:21 Morfildur wrote:Show nested quote +On October 20 2014 08:33 SpiZe wrote: Hey guys,
I'm gonna pass a couple of interviews for internship soon and I'm a bit nervous. I know they are going to ask technical questions but I'm unsure what kind of question they are going to be, or what topic to are going to cover. Anyone has knowledge of the kind of questions they could ask, knowing I mostly applied on Java and C# offers.
Thanks. Whatever they ask you, don't be afraid to say "I don't know". They will know when you try to pretend knowing things you have no idea of. It's no shame to not have worked with something before, e.g. in my last PHP job interview a year ago they asked me what $x = &DB::getConnection(...) meant. I had never seen "&someFunction();" because that is PHP4 legacy code and I've never worked with PHP before 5.0 (luckily) since those were my Perl, C and C++ years. Even with now ~25 years of programming there are plenty of things I have no idea of because I've never needed them and the interviewers know that this is the case for everyone, so they mostly look for how you deal with things you don't know.
So as I thought, &function is return by reference. Correct me if I'm wrong but isn't this the default better option in C++? Yeah, I know you talk about PHP but then PHP's explanation is:
Returning by reference is useful when you want to use a function to find to which variable a reference should be bound. Do not use return-by-reference to increase performance. The engine will automatically optimize this on its own. Only return references when you have a valid technical reason to do so.
I don't know if C++ reference is the same as PHP reference but why the warning from excerpt? Is it because of automatic optimisation?
|
hm, not quite sure i understand what you are talking about.
a function returning a reference to a value of some type or taking the reference of the returned value from a function? both only meaningful if the scope of the returnee outlives the function scope, but both have different semantics from each other (a reference is not a pointer), and also different from returning a value. doesn't make sense to me to talk about 'default' better option.
speaking of optimization... an old gcc kept optimizing away the return statement of some driver we had to write in an embedded system construction course, confusion ensued. balls. BALLS. BALLS!
|
On October 21 2014 06:12 darkness wrote:Show nested quote +On October 21 2014 00:21 Morfildur wrote:On October 20 2014 08:33 SpiZe wrote: Hey guys,
I'm gonna pass a couple of interviews for internship soon and I'm a bit nervous. I know they are going to ask technical questions but I'm unsure what kind of question they are going to be, or what topic to are going to cover. Anyone has knowledge of the kind of questions they could ask, knowing I mostly applied on Java and C# offers.
Thanks. Whatever they ask you, don't be afraid to say "I don't know". They will know when you try to pretend knowing things you have no idea of. It's no shame to not have worked with something before, e.g. in my last PHP job interview a year ago they asked me what $x = &DB::getConnection(...) meant. I had never seen "&someFunction();" because that is PHP4 legacy code and I've never worked with PHP before 5.0 (luckily) since those were my Perl, C and C++ years. Even with now ~25 years of programming there are plenty of things I have no idea of because I've never needed them and the interviewers know that this is the case for everyone, so they mostly look for how you deal with things you don't know. So as I thought, &function is return by reference. Correct me if I'm wrong but isn't this the default better option in C++? Yeah, I know you talk about PHP but then PHP's explanation is: Show nested quote + Returning by reference is useful when you want to use a function to find to which variable a reference should be bound. Do not use return-by-reference to increase performance. The engine will automatically optimize this on its own. Only return references when you have a valid technical reason to do so.
I don't know if C++ reference is the same as PHP reference but why the warning from excerpt? Is it because of automatic optimisation? If you return an object in PHP (or Python, or Javascript, or Java, or...), what is returned is a pointer to the object. You don't get a copy by default, so no need to use & here. If you want the same behavior (ie. pointer to a struct, not a copy) in C, you have to ask for it explicitly.
That's why returning a pointer in C is needed very often, but using & in PHP is only necessary when you want to return a pointer to a scalar (or a pointer to a pointer, I suppose).
|
delHospital mixing C and C++?
you could get a pointer to an object if the object outlives the function scope in cpp by taking the reference of the returned lvalue, which seems to be the same behaviour. you don't explicitly have to return a pointer (but you do have to return an lvalue).
#include <iostream> using namespace std;
int value;
int& function(){ return value; }
int main() { int* pointer=&function(); cout<<boolalpha<<(pointer==&value)<<endl; }
|
|
On October 21 2014 06:37 nunez wrote:delHospital mixing C and C++? you could get a pointer to an object if the object outlives the function scope in cpp by taking the reference of the returned lvalue, which seems to be the same behaviour. you don't explicitly have to return a pointer (but you do have to return an lvalue). #include <iostream> using namespace std;
int value;
int& function(){ return value; }
int main() { int* pointer=&function(); cout<<boolalpha<<(pointer==&value)<<endl; } I said "C" and "pointers" instead of "C++" and "references", because every time I say "C++" I feel like I have to wash out my mouth. The principle is the same, though -- you had to write "int&", because "int" would be a copy (well, int is a bad example, but vector<int> vs. vector<int>& is a better one).
|
that is true, you are not worthy of saying c++; but he asked about c++ and references. not c and pointers. references are not pointers in c++, by talking about pointers when references is the topic you could be confusing people.
int* would also be returning a copy, a copy of a pointer (also an rvalue)... decidedly different semantics than if you were returning a reference.
|
On October 21 2014 07:20 nunez wrote: that is true, you are not worthy of saying c++; but he asked about c++ and references. not c and pointers. references are not pointers in c++, by talking about pointers when references is the topic you could be confusing people.
int* would also be returning a copy, a copy of a pointer (also an rvalue)... decidedly different semantics than if you were returning a reference. Okay, let's try again.
In C++, when a function returns an object, it returns a copy of that object (by calling the copy constructor). If you want to return a reference, you have to specify it in the return type.
In PHP, when a function returns an object, it returns a pointer to it and there's no easy way of returning a copy.
That's why explicitly returning a reference is rarely needed in PHP.
|
right off the bat; it will probably, and should probably, call the move constructor (if possible, cross your fingers).
if you want to return a reference, you have to specify it in the return type yes, and same with pointer or a reference to a pointer. but a reference is not a pointer, they have different semantics.
when you answer a question about references in c++ with pointers in c you are confusing the guy posing the question: if he was asking about pointers in c++ then you could answer with pointers in c, as they are the same thing (barring any weird caveats).
i'm sure you managed to explained the php, but that's not my gripe. ;> maybe i misread your post and you moved on, my apologies if that's the case.
|
On October 21 2014 07:44 nunez wrote: right off the bat; it will probably, and should probably, call the move constructor (if possible, cross your fingers).
if you want to return a reference, you have to specify it in the return type yes, and same with pointer or a reference to a pointer. but a reference is not a pointer, they have different semantics.
when you answer a question about references in c++ with pointers in c you are confusing the guy posing the question: if he was asking about pointers in c++ then you could answer with pointers in c, as they are the same thing (barring any weird caveats).
i'm sure you managed to explained the php, but that's not my gripe. ;> maybe i misread your post and you moved on, my apologies if that's the case. Yeah, I'm not explaining the C++ part to you, I'm sure you know it better than I do. I just meant to answer the question from scratch, as you're probably right that I'm confusing people by talking about pointers when the question was about references (obviously they're not the same thing, but they both share the characteristic that they don't return the entire struct/object by value, which is what matters here).
|
|
-need to learn to just do it!
|
|
|
|