• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 15:38
CEST 21:38
KST 04:38
  • 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
[ASL21] Ro8 Preview Pt2: Progenitors8Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10Team Liquid Map Contest #22 - The Finalists22
Community News
Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event11Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25Maestros of the Game 2 announced9
StarCraft 2
General
Weekly Cups (April 27-May 4): Clem takes triple Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun Team Liquid Map Contest #22 - The Finalists
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament RSL Revival: Season 5 - Qualifiers and Main Event StarCraft Evolution League (SC Evo Biweekly) 2026 GSL Season 2 Qualifiers $1,400 SEL Season 3 Ladder Invitational
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 524 Death and Taxes The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base
Brood War
General
Do we have a pimpest plays list? AI Question ASL21 General Discussion Using AI to optimize marketing campaigns [ASL21] Ro8 Preview Pt2: Progenitors
Tourneys
[ASL21] Ro8 Day 4 [ASL21] Ro8 Day 3 [Megathread] Daily Proleagues [ASL21] Ro8 Day 2
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Stormgate/Frost Giant Megathread Dawn of War IV OutLive 25 (RTS Game) Daigo vs Menard Best of 10 Nintendo Switch Thread
Dota 2
The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread Russo-Ukrainian War Thread 3D technology/software discussion Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread Formula 1 Discussion McBoner: A hockey love story
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Movie Stars In Video Games: …
TrAiDoS
ramps on octagon
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1327 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
Poland17743 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
44272 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
Poland17743 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
Next event in 4h 22m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 604
IndyStarCraft 177
UpATreeSC 119
BRAT_OK 69
JuggernautJason53
StarCraft: Brood War
Britney 21166
Calm 3512
ggaemo 245
Dewaltoss 90
Movie 26
ajuk12(nOOB) 9
Dota 2
XaKoH 496
Counter-Strike
pashabiceps2431
Super Smash Bros
Mew2King62
Heroes of the Storm
Liquid`Hasu361
MindelVK10
Other Games
Grubby5350
B2W.Neo1704
Liquid`RaSZi1151
FrodaN1130
qojqva695
shahzam404
monkeys_forever242
C9.Mang0241
KnowMe133
Hui .82
elazer56
Trikslyr52
Organizations
Other Games
BasetradeTV397
Dota 2
PGL Dota 2 - Main Stream40
StarCraft 2
angryscii 19
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 18 non-featured ]
StarCraft 2
• Reevou 7
• Kozan
• Migwel
• sooper7s
• AfreecaTV YouTube
• intothetv
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• HerbMon 25
• 80smullet 20
• RayReign 9
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• imaqtpie2081
Other Games
• Scarra510
• WagamamaTV464
• Shiphtur266
Upcoming Events
PiGosaur Cup
4h 22m
GSL
13h 52m
Classic vs Cure
Maru vs Rogue
GSL
1d 13h
SHIN vs Zoun
ByuN vs herO
OSC
1d 15h
OSC
1d 17h
Replay Cast
2 days
Escore
2 days
The PondCast
2 days
WardiTV Invitational
2 days
Zoun vs Ryung
Lambo vs ShoWTimE
OSC
3 days
[ Show More ]
Replay Cast
3 days
CranKy Ducklings
3 days
RSL Revival
3 days
SHIN vs Bunny
ByuN vs Shameless
WardiTV Invitational
3 days
Krystianer vs TriGGeR
Cure vs Rogue
uThermal 2v2 Circuit
3 days
BSL
3 days
Replay Cast
4 days
Sparkling Tuna Cup
4 days
RSL Revival
4 days
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
4 days
BSL
4 days
GSL
5 days
Afreeca Starleague
5 days
Monday Night Weeklies
5 days
Afreeca Starleague
6 days
CranKy Ducklings
6 days
Liquipedia Results

Completed

Proleague 2026-05-02
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026

Upcoming

YSL S3
Escore Tournament S2: W6
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
Escore Tournament S2: W7
Escore Tournament S2: W8
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 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.