• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:25
CEST 06:25
KST 13:25
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL22] Ro16 Preview: Rough Waters10[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 244
Community News
StarCraft open world shooter announced at BlizzCon54Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism10Official StarCraft website teases new content ahead of BlizzCon?161Stellar Fest TWO the Moon (Dec 16-20)9Weekly Cups (August 24-30): Patches' balance mod takes over3
StarCraft 2
General
How do you feel about the StarCraft shooter announcement at BlizzCon 2026? StarCraft open world shooter announced at BlizzCon Balance hotfix patch 5.0.16b (July 16) Team Liquid Map Contest #22: Results and Winners Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism
Tourneys
RSL goes to London! 2026 Offline Finals Nov 21-22 KSL Week #92 IntoTheTV X SOOP SC2 League : Weekly & Monthly 2026 GSTL Announcement Sparkling Tuna Cup - Weekly Open Tournament
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
Mutation # 542 The Ascended Mutation # 541 Binary Choice The PondCast: SC2 News & Results Mutation # 540 Dodge This
Brood War
General
Official StarCraft website teases new content ahead of BlizzCon? BGH Auto Balance -> http://bghmmr.eu/ Broodwar Prediction Market Practice Partners (Official) [D] Brainstorming a balance patch for Brood war
Tourneys
[ASL22] Ro16 Group A [ASL22] Ro16 Group B Escore Tournament - Season 3 Small VOD Thread 2.0
Strategy
Replay Review Process - What do you do? Simple Questions, Simple Answers Odyssey Mineral Stack Saturation Game Theory for Starcraft
Other Games
General Games
EVE Corporation Diablo IV Nintendo Switch Thread [Maplestory Hardcore] Let's Play~!! General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
Trading/Investing Thread US Politics Mega-thread UK Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
Diablo Animated Series on Netflix Movie Discussion!
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Virtual Romance, Real-Life C…
TrAiDoS
Regacy Esports:Our Goa…
regacyesports
Dreaming of BW patches (mod…
c3rberUs
LOCKPICKING NOOB
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 6326 users

The Big Programming Thread - Page 532

Forum Index > General Forum
Post a Reply
Prev 1 530 531 532 533 534 1032 Next
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.
Manit0u
Profile Blog Joined August 2004
Poland17843 Posts
Last Edited: 2014-10-19 12:30:16
October 19 2014 12:29 GMT
#10621
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.
Time is precious. Waste it wisely.
goody153
Profile Blog Joined April 2013
44300 Posts
Last Edited: 2014-10-19 16:07:33
October 19 2014 14:01 GMT
#10622
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.
this is a quote
MinoMoto
Profile Joined June 2011
Latvia107 Posts
Last Edited: 2014-10-19 22:02:16
October 19 2014 21:06 GMT
#10623
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.
[image loading]


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.
Manit0u
Profile Blog Joined August 2004
Poland17843 Posts
Last Edited: 2014-10-19 21:26:27
October 19 2014 21:22 GMT
#10624
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.
[image loading]


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...
Time is precious. Waste it wisely.
SpiZe
Profile Joined December 2010
Canada3640 Posts
October 19 2014 23:33 GMT
#10625
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.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
October 19 2014 23:38 GMT
#10626
Best book for interview study grinding is called "cracking the coding interview". Should give you all the technical questions you'll need.
There is no one like you in the universe.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
October 20 2014 15:21 GMT
#10627
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.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
October 20 2014 15:31 GMT
#10628
morfildur you old grump!
conspired against by a confederacy of dunces.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-10-20 21:13:38
October 20 2014 21:12 GMT
#10629
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?
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-10-20 21:31:02
October 20 2014 21:28 GMT
#10630
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!
conspired against by a confederacy of dunces.
delHospital
Profile Blog Joined December 2010
Poland261 Posts
Last Edited: 2014-10-20 21:33:37
October 20 2014 21:31 GMT
#10631
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).
nunez
Profile Blog Joined February 2011
Norway4003 Posts
October 20 2014 21:37 GMT
#10632
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;
}
conspired against by a confederacy of dunces.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-10-20 21:46:30
October 20 2014 21:37 GMT
#10633
--- Nuked ---
delHospital
Profile Blog Joined December 2010
Poland261 Posts
Last Edited: 2014-10-20 22:15:10
October 20 2014 22:05 GMT
#10634
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).
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-10-20 22:26:28
October 20 2014 22:20 GMT
#10635
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.
conspired against by a confederacy of dunces.
delHospital
Profile Blog Joined December 2010
Poland261 Posts
October 20 2014 22:39 GMT
#10636
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.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-10-20 22:55:20
October 20 2014 22:44 GMT
#10637
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.
conspired against by a confederacy of dunces.
delHospital
Profile Blog Joined December 2010
Poland261 Posts
October 20 2014 23:06 GMT
#10638
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).
nunez
Profile Blog Joined February 2011
Norway4003 Posts
October 20 2014 23:08 GMT
#10639
ah ok, my bad then.
conspired against by a confederacy of dunces.
MysteryMeat1
Profile Blog Joined June 2011
United States3292 Posts
Last Edited: 2014-10-21 07:19:20
October 21 2014 07:13 GMT
#10640
-need to learn to just do it!
"Cause ya know, Style before victory." -The greatest mafia player alive
Prev 1 530 531 532 533 534 1032 Next
Please log in or register to reply.
Live Events Refresh
OSC
20:30
Masters Cup #151
davetesta56
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft: Brood War
Aegong 60
yabsab 18
Icarus 8
Dota 2
NeuroSwarm182
LuMiX1
Other Games
summit1g12263
JimRising 570
PiGStarcraft304
ViBE138
Organizations
Other Games
BasetradeTV208
[ Show 11 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota22016
League of Legends
• Lourlo1119
• Stunt237
Upcoming Events
Sparkling Tuna Cup
5h 35m
WardiTV Invitational
6h 35m
ByuN vs Percival
Cure vs Classic
Shopify Rebellion Sundays
10h 35m
Spirit vs Mixu
Clem vs TBD
RSL Revival
11h 35m
Serral vs Rogue
BlizzCon
14h 5m
IdrA vs MC
Replay Cast
19h 35m
Afreeca Starleague
1d 5h
Light vs JyJ
Soulkey vs hero
WardiTV Weekly
1d 6h
Monday Night Weeklies
1d 11h
Afreeca Starleague
2 days
Snow vs Shinee
Shine vs EffOrt
[ Show More ]
GSL
2 days
PiGosaur Cup
2 days
The PondCast
3 days
Kung Fu Cup
3 days
Replay Cast
3 days
KCM Race Survival
4 days
IntoTheTV X SOOP
4 days
Replay Cast
4 days
IntoTheTV X SOOP
5 days
Replay Cast
5 days
GSL
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Acropolis #5 - TRS
PiG Sty Festival 8.0
Big Dog Cup 2026 Div 1

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
Acropolis #5
Blizzard Classic Cup 2026
Blizzard Classic Cup 2026
RSL Revival: Season 6
Calamity Invitational
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026

Upcoming

Acropolis #5 - GSA
Acropolis #5 - GSB
Acropolis #5 - GSC
SC4ALL II: Brood War
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.