• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 16:24
CEST 22:24
KST 05:24
  • 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
Code S Season 1 - RO8 Preview5[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 Star10
Community News
Maestros of The Game 2 announcement and schedule !7Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event12Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25
StarCraft 2
General
Code S Season 1 - RO8 Preview Behind the Blue - Team Liquid History Book Weekly Cups (April 27-May 4): Clem takes triple Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament Sea Duckling Open (Global, Bronze-Diamond) Maestros of The Game 2 announcement and schedule ! GSL Code S Season 1 (2026) RSL Revival: Season 5 - Qualifiers and Main Event
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players
External Content
Mutation # 524 Death and Taxes The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base
Brood War
General
Quality of life changes in BW that you will like ? BGH Auto Balance -> http://bghmmr.eu/ RepMastered™: replay sharing and analyzer site Tulbo's ASL S21 Ro8 Post-Review Why there arent any 256x256 pro maps?
Tourneys
[ASL21] Ro8 Day 4 Escore Tournament StarCraft Season 2 [Megathread] Daily Proleagues Small VOD Thread 2.0
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 Nintendo Switch Thread Daigo vs Menard Best of 10 Path of Exile OutLive 25 (RTS Game)
Dota 2
The Story of Wings Gaming
League of Legends
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 The Letting Off Steam Thread European Politico-economics QA Mega-thread UK Politics Mega-thread 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 McBoner: A hockey love story Formula 1 Discussion
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
How EEG Data Can Predict Gam…
TrAiDoS
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1209 users

The Big Programming Thread - Page 523

Forum Index > General Forum
Post a Reply
Prev 1 521 522 523 524 525 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.
tofucake
Profile Blog Joined October 2009
Hyrule19210 Posts
September 26 2014 17:00 GMT
#10441
On September 26 2014 22:48 ZealotSensei wrote:

function getStations(callback){


var listOfStations = [];

for(var index = 0; index < 10; index++) {
var station = new Station(index);
listOfStations[index] = station;
}
callback(listOfStations);
}

function Station(id){
this.id = id;
}

exports.getStations = getStations;


I would just like to mention that Station class has a lot more members than that. But the problem here is that I cannot access the members from the Station objects I created in database.js from printer.js. I am having quite a bit of trouble figuring out how to do this. I have learned how to create a new object of Station in printer.js by exporting Station, but I still can't access the members of an object I created somewhere else! It just spits out 10 x "id: undefined" Can any of you guys help me?
You need to change your database a bit:

database.prototype.getStations = function(callback) {
//...
}

database.prototype.Station = function(id) {
//...
}

module.exports = database;

Liquipediaasante sana squash banana
MinoMoto
Profile Joined June 2011
Latvia107 Posts
September 26 2014 18:33 GMT
#10442
Hello can someone help me? I need to write program in C# that can do functions below.
1)x+y
2)x-y
3)x*y
4)x/y (integers)
5)x%y (balance)
6)x/y (fraction)
7)x2+ y2
I done the 1,3,4,5 point, can someone tell me my mistakes in 2,6 and 7?
[image loading]
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
Last Edited: 2014-09-26 19:35:57
September 26 2014 19:28 GMT
#10443
On September 27 2014 03:33 MinoMoto wrote:
Hello can someone help me? I need to write program in C# that can do functions below.
1)x+y
2)x-y
3)x*y
4)x/y (integers)
5)x%y (balance)
6)x/y (fraction)
7)x2+ y2
I done the 1,3,4,5 point, can someone tell me my mistakes in 2,6 and 7?
[image loading]


Why do you convert input to int and store it in a double variable? Then you try to simultaneously do concatenation with mathematical operations on it...

Take input, do the math and then print the result as string.

Example:

public function Add(double x, double y) {
double result = x + y;

return result;
}

// do the same for divide, multiply etc. do whatever you need in the functions

public function DoStuff() {
string sum = ToString(Add(x, y));
string ret = String.Concat("x + y = ", sum);

Console.WriteLine(ret);
}


What I posted is very simplistic, there are of course better way of doing it (like using C#'s inherent Sum() method).

And you should really store your results in some enumerable variable and then print it through iteration or recursion.
Time is precious. Waste it wisely.
scudst0rm
Profile Joined May 2010
Canada1149 Posts
September 26 2014 19:34 GMT
#10444
On September 27 2014 03:33 MinoMoto wrote:
Hello can someone help me? I need to write program in C# that can do functions below.
1)x+y
2)x-y
3)x*y
4)x/y (integers)
5)x%y (balance)
6)x/y (fraction)
7)x2+ y2
I done the 1,3,4,5 point, can someone tell me my mistakes in 2,6 and 7?
+ Show Spoiler +
[image loading]


#4 should be different from #6 but you use the same expression for both, why do you expect a different result

#7 you're using Pow wrong, read the reference page
You're like a one ranger army comin' at me...
VyingsP
Profile Joined December 2011
France174 Posts
September 26 2014 20:25 GMT
#10445
On September 27 2014 03:33 MinoMoto wrote:
Hello can someone help me? I need to write program in C# that can do functions below.
1)x+y
2)x-y
3)x*y
4)x/y (integers)
5)x%y (balance)
6)x/y (fraction)
7)x2+ y2
I done the 1,3,4,5 point, can someone tell me my mistakes in 2,6 and 7?
[image loading]


You might want to refer to this :
http://msdn.microsoft.com/en-us/library/aa691323(v=vs.71).aspx

You need parenthesis like everywhere... Even the addition one will not print the expected value
Corrections of my bad english are much welcome
Rotodyne
Profile Blog Joined July 2005
United States2263 Posts
Last Edited: 2014-09-27 03:13:21
September 27 2014 03:12 GMT
#10446
Is it bad practice to use an actual table name when passing data in javascript. Seems like it would give an attacker free information about your database structure? Or does it really not matter? An example would be:

Ajax({
data: some_array,
table: 'actual_table_name'
});

Thanks!

Time for some buzzed programming, this always goes well. (NOT)
I can only play starcraft when I am shit canned. IPXZERG is a god.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
September 27 2014 03:26 GMT
#10447
--- Nuked ---
Rotodyne
Profile Blog Joined July 2005
United States2263 Posts
Last Edited: 2014-09-27 04:40:15
September 27 2014 03:48 GMT
#10448
Cool, makes sense. Thank you very much.

EDIT: My late night programming session went very well, was able to kill a couple issues and more importantly I moved a bunch of features and enhancements from 1.0 launch to version 1.1 which will maybe, possibly, could be released someday! (This is a AJAX based Wordpress plugin that I'm working on)
I can only play starcraft when I am shit canned. IPXZERG is a god.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
September 27 2014 08:27 GMT
#10449
On September 26 2014 23:49 FreeZer wrote:
I just came across generators in python. Generators are the fucking bomb. I'm still wrapping my mind around this new concept and the more I think about it the more stuff I come up with to use them for. I mean... it's a function that can return a value.. but keep its stack data! So you can enter the function again, and it keeps running from where it left off until it returns again. Short example if you don't know what it is:


def mygen():
yield 1
yeild 2
yield 3

gen = mygen()
for n in gen:
print(n)

>>> 1
>>> 2
>>> 3


At first glance this might not seem so awesome, it's just iterating right? WRONG! The cool thing is that the generator can maintain its own state! And you can connect many generators together to form a massive processing pipeline.

If you're intrigued, check out http://www.dabeaz.com/generators/

I just heard generators are coming to Javascript, which made me really excited!

So it's the exact same thing as yield return in C#, I would assume. Though C# likely isn't the origin of the concept. Anyways, it's pretty much an essential concept in C#, whenever you use the linq namespace or IEnumerables in general.
It's extremely useful and allows you to write very clear yet efficient code. For example you can repeatedly apply filters and transformations on a sequence of elements and then shortcut your way out of evaluating all that stuff by finishing with something like Any(), First() or Take(). In which case the filters and transformations are only executed on just as many elements as necessary for the final statement.
If you have a good reason to disagree with the above, please tell me. Thank you.
FreeZer
Profile Joined January 2011
Sweden288 Posts
September 27 2014 13:45 GMT
#10450
On September 27 2014 01:15 Blisse wrote:
If you like generators and iterators you should read about coroutines


Yeah, I've heard about them and I'm planning on learning about those after I'm done with generators.


On September 27 2014 17:27 spinesheath wrote:
So it's the exact same thing as yield return in C#, I would assume. Though C# likely isn't the origin of the concept. Anyways, it's pretty much an essential concept in C#, whenever you use the linq namespace or IEnumerables in general.
It's extremely useful and allows you to write very clear yet efficient code. For example you can repeatedly apply filters and transformations on a sequence of elements and then shortcut your way out of evaluating all that stuff by finishing with something like Any(), First() or Take(). In which case the filters and transformations are only executed on just as many elements as necessary for the final statement.


It seems like the same thing, yes. I've only briefly used C# but I think that when you have an IEnumerable while debugging, and you want to see what's in it, you get a message "Expanding the results will enumerate the IEnumerable" or something like that. Correct me if I'm wrong, but I Imagine that this is because the IEnumerable is a generator that hasn't been iterated through yet (so it doesn't actually contain any values, just information on how to generate those values).

Ahh Scept-- hey where did you come from?
bardtown
Profile Joined June 2011
England2313 Posts
September 27 2014 21:45 GMT
#10451
I am curious about the the feasibility of working as a programmer (not freelance) from home. I imagine this is very rare for junior programmers, but I would like to hear from people who work like this or work with others who do.

Would it be worth getting experience with software like SVN to improve my chances?
Cyx.
Profile Joined November 2010
Canada806 Posts
September 27 2014 22:02 GMT
#10452
On September 28 2014 06:45 bardtown wrote:
I am curious about the the feasibility of working as a programmer (not freelance) from home. I imagine this is very rare for junior programmers, but I would like to hear from people who work like this or work with others who do.

Would it be worth getting experience with software like SVN to improve my chances?

I'm just an intern so I don't get to do it myself, but I know my company allows significant working from home, even some fully remote employees, so it's not unreasonable.

Version control in general is kind of a big deal though... if you want to work with like anyone else ever at all you're probably going to need to know some kind of 'software like SVN'
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
September 27 2014 22:11 GMT
#10453
Version control is mandatory. You should definitely at least know how to use a version control system. Ideally both centralized and distributed systems.
If you have a good reason to disagree with the above, please tell me. Thank you.
MichaelEU
Profile Joined February 2011
Netherlands816 Posts
September 27 2014 22:59 GMT
#10454
I even use version control on solo projects, if only because it's the lazy man's documentation.
世界を革命する力を!― znf: "Michael-oniichan ( *^▽^*)ノ✩キラ✩"
bardtown
Profile Joined June 2011
England2313 Posts
Last Edited: 2014-09-27 23:14:12
September 27 2014 23:08 GMT
#10455
I am overwhelmed by the amount of things I am not even aware of, which is a bit of a problem. Please direct me to any resources you think would be good for me and thanks for your answers

Btw, I have no formal education on this subject, everything I do know is self taught
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
Last Edited: 2014-09-27 23:41:22
September 27 2014 23:40 GMT
#10456
On September 28 2014 07:02 Cyx. wrote:
Show nested quote +
On September 28 2014 06:45 bardtown wrote:
I am curious about the the feasibility of working as a programmer (not freelance) from home. I imagine this is very rare for junior programmers, but I would like to hear from people who work like this or work with others who do.

Would it be worth getting experience with software like SVN to improve my chances?

I'm just an intern so I don't get to do it myself, but I know my company allows significant working from home, even some fully remote employees, so it's not unreasonable.

Version control in general is kind of a big deal though... if you want to work with like anyone else ever at all you're probably going to need to know some kind of 'software like SVN'


SVN blows. Git is the way to go
Time is precious. Waste it wisely.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2014-09-28 00:08:51
September 28 2014 00:07 GMT
#10457
Just use Git and Github when you're developing non-confidential in your spare time and you'll learn in no time. Learning a version control system is mandatory, it doesn't really matter which one, but Git is the least bad.

https://github.com/

I don't find think working at home is worth it because team work is usually more important at work, of course varying per project.
There is no one like you in the universe.
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
September 28 2014 00:36 GMT
#10458
face to face communication is still the way to go though but if your on a solo project, it's best if your WFH
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
xboi209
Profile Blog Joined June 2011
United States1173 Posts
September 28 2014 03:05 GMT
#10459
I'm in search of someone who is skilled in reverse engineering. The assistance will help bring improvements to StarCraft: Brood War and even other Battle.net(v1) games.
PM me if you're interested!
http://www.reddit.com/r/broodwar/
tofucake
Profile Blog Joined October 2009
Hyrule19210 Posts
September 29 2014 02:04 GMT
#10460
On September 28 2014 08:08 bardtown wrote:
I am overwhelmed by the amount of things I am not even aware of, which is a bit of a problem. Please direct me to any resources you think would be good for me and thanks for your answers

Btw, I have no formal education on this subject, everything I do know is self taught

google.com

Programming is one of those things where, generally, people who do it love it in a strange and slightly odd way. I'm also mostly self taught, and I learned a lot of stuff the hard way (like making loads of changes to one of my projects during a coding spree, breaking everything, and not having a backup newer than 8 hours as a firm reminder that version control is good). And nowadays, most programming jobs ask for a github instead of a portfolio.

If you can find an internship or part time job you'll learn a lot, which you can apply to your own stuff.
Liquipediaasante sana squash banana
Prev 1 521 522 523 524 525 1032 Next
Please log in or register to reply.
Live Events Refresh
BSL
19:00
RO16 Group C
Artosis vs TerrOr
spx vs StRyKeR
ZZZero.O370
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 465
BRAT_OK 56
CosmosSc2 50
Vindicta 26
PattyMac 13
StarCraft: Brood War
Calm 3918
Mini 404
ZZZero.O 370
ggaemo 232
firebathero 152
Dewaltoss 135
Backho 37
Hyun 28
NaDa 4
Dota 2
monkeys_forever1056
LuMiX1
League of Legends
Doublelift1749
JimRising 133
Reynor67
Counter-Strike
Fnx 1896
Heroes of the Storm
Liquid`Hasu372
Khaldor228
Other Games
Grubby4970
FrodaN2549
fl0m1250
KnowMe265
RotterdaM228
Hui .189
kaitlyn45
Organizations
Other Games
gamesdonequick3519
StarCraft 2
angryscii 18
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 23 non-featured ]
StarCraft 2
• Hupsaiya 69
• printf 59
• davetesta28
• Adnapsc2 22
• Response 2
• IndyKCrew
• sooper7s
• AfreecaTV YouTube
• Migwel
• intothetv
• LaughNgamezSOOP
• Kozan
StarCraft: Brood War
• FirePhoenix10
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• WagamamaTV913
• masondota2739
• lizZardDota280
League of Legends
• imaqtpie2115
• TFBlade918
Other Games
• Shiphtur269
• tFFMrPink 20
Upcoming Events
Replay Cast
3h 36m
Sparkling Tuna Cup
13h 36m
RSL Revival
13h 36m
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
15h 36m
ByuN vs Rogue
Solar vs Ryung
Zoun vs Percival
Cure vs SHIN
BSL
22h 36m
Dewalt vs DragOn
Aether vs Jimin
GSL
1d 11h
Afreeca Starleague
1d 13h
Soma vs Leta
Wardi Open
1d 15h
Monday Night Weeklies
1d 19h
OSC
2 days
[ Show More ]
CranKy Ducklings
2 days
Afreeca Starleague
2 days
Light vs Flash
Replay Cast
3 days
Replay Cast
4 days
The PondCast
4 days
Replay Cast
5 days
RSL Revival
5 days
Korean StarCraft League
6 days
RSL Revival
6 days
BSL
6 days
Liquipedia Results

Completed

Escore Tournament S2: W6
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
KK 2v2 League Season 1
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
PGL Astana 2026
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

Upcoming

BSL 22 Non-Korean Championship
YSL S3
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
BLAST Bounty Summer 2026: Closed Qualifier
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 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.