• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:37
CET 01:37
KST 09:37
  • 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] Finals Preview: Sweet Victory!12[ASL22] Ro4 Preview: Mirror Mirror6[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5
Community News
Weekly Cups (Oct 26 - Nov 1): MaxPax, herO, Solar win0Weekly Cups (October 19-25): Clem triples first in 5.0.175Evil Geniuses - shutting down23ISSL (IntoTheTV x SOOP SC2 League): Premier7Weekly Cups (October 12-18): 5.0.17 era begins1
StarCraft 2
General
[D] Hacker peak in sc2 ? No more SC2 streamers on team liquid? Liquibets sc2 season 30 Evil Geniuses - shutting down Weekly Cups (Oct 26 - Nov 1): MaxPax, herO, Solar win
Tourneys
SC4ALL: II Venue Change Announcement! Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays ISSL (IntoTheTV x SOOP SC2 League): Premier Stellar Fest TWO the Moon (Dec 16-20)
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[G] How to playtest arcade maps Starcraft 2 Advance [D] the control group Simple Questions/Answers
External Content
Mutation # 550 Graveyard Shift The PondCast: SC2 News & Results Mutation # 549 Endless Sparkles Mutation # 548 Shining Bright
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Rollback Netcode in Brood War SC4ALL: II Venue Change Announcement! Ziemie's Starcraft 1 Prequel Campaign 🇺🇦 Ukrainian StarCraft:BroodWar community reborn
Tourneys
[$1250] International ShieldBattery League [Megathread] Daily Proleagues Small VOD Thread 2.0 KCM Race Survival 2026 Season 4
Strategy
50,000-Word Terran Builds Memo 2026-10-22 Cliff Jump Revisited (1 in a 1000 strategy) Simple Questions, Simple Answers
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Deus Ex 3!? Mobile Legends: Bang Bang Armies of Exigo - YesYes?
Dota 2
Dota 2 Champions League Season 3 Begins April 25!
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Dating: How's your luck? Trading/Investing Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
Fan Club Resource Thread Reynor Fan Club The Flash Fan Club
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece
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
Recent Gifted Posts
Blogs
Why I built Repalyzer (1.1.…
BlueStar
Innovate or Game Over?
TrAiDoS
ShieldBattery on Mac
Kraekkling
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
Can Bots Beat Pros?? Starcr…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 10465 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
Poland17871 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
44313 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
Poland17871 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
PSISTORM Gaming Misc
09:00
FSL season 12 opener: HM vs ST
Freeedom74
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SpeCial 39
StarCraft: Brood War
Britney 7687
Dota 2
PGG 213
League of Legends
Doublelift4873
JimRising 739
Counter-Strike
jkaem63
Other Games
gofns14930
summit1g8824
Grubby2065
Day[9].tv523
shahzam424
PiGStarcraft326
XaKoH 285
C9.Mang0283
syndereN178
Maynarde66
Fuzer 59
NeuroSwarm55
ViBE48
PPMD23
Railgan20
KnowMe15
JuggernautJason4
Organizations
Other Games
gamesdonequick512
Counter-Strike
PGL86
[ Show 18 non-featured ]
StarCraft 2
• Hupsaiya 77
• RyuSc2 24
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Laughngamez YouTube
• Migwel
StarCraft: Brood War
• HerbMon 38
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis3381
• Jankos3336
• Scarra898
Other Games
• imaqtpie613
• Day9tv523
• Shiphtur174
Upcoming Events
IntoTheTV X SOOP
10h 23m
Reynor vs Solar
ByuN vs SHIN
Clem vs MaxPax
herO vs Rogue
IPSL
16h 23m
WorsT vs nOmaD
Dewalt vs andersOn
AI Arena Tournament
18h 23m
IntoTheTV X SOOP
1d 10h
IPSL
1d 16h
Azhi_Dahaki vs ggnore13
Double vs WIZARD
Replay Cast
1d 22h
Replay Cast
2 days
Sparkling Tuna Cup
3 days
WardiTV Invitational
3 days
YoungYakov vs Lambo
SHIN vs TBD
Percival vs Shameless
Solar vs TBD
PiGosaur Cup
4 days
[ Show More ]
The PondCast
5 days
KCM Race Survival
5 days
WardiTV Invitational
5 days
Liquipedia Results

Completed

Proleague 2026-11-05
Blizzard Classic Cup 2026
HCC Season 3

Ongoing

Acropolis #5
KCM Race Survival 2026 Season 4
International ShieldBattery League
BSL Season 23
IPSL Winter 2026-27
Calamity Cup Div. A Season 8
IEM Beijing 2026
PGL Masters Bucharest 2026
Stake Ranked Episode 5
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
FISSURE Playground #3
BLAST Open Fall 2026

Upcoming

Sector 951
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Underdog Cup 2026 Div 2-3
PGL Bucharest 2027
BLAST Bounty Winter 2027
eXTREMESLAND 2026
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals 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.