• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 06:39
CEST 12:39
KST 19:39
  • 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] Ro4 Preview: Mirror Mirror4[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5[ASL22] Ro16 Preview: Rough Waters10
Community News
5.0.17 Patch Notes - October 7, 202617Weekly Cups Results (Sep 28-Oct 4)0SC4ALL: II SC2 Complete Invited Player Lineup10StarCraft II 5.0.17 PTR Patch Notes (Sept 30, 2026)78Weekly Cups (Sept 21-27): herO and ByuN double2
StarCraft 2
General
5.0.17 Patch Notes - October 7, 2026 [Old] StarCraft 3 Reportedly in Development StarCraft II 5.0.17 PTR Patch Notes (Sept 30, 2026) How do you feel about the mass reverts in the 5.0.17 PTR? Weekly Cups Results (Sep 28-Oct 4)
Tourneys
RSL 2026 Offline Finals LCQ Sign-Ups Stellar Fest TWO the Moon (Dec 16-20) ISSL (IntoTheTV x SOOP SC2 League): Premier Sparkling Tuna Cup - Weekly Open Tournament 2026 GSTL Grand Finals
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[M] (2) Sweltering Sands [M] (2) Frigid Storage
External Content
Mutation # 546 Catch the Train The PondCast: SC2 News & Results Mutation # 545 And Drops and Rifts Mutation # 544 Double Trouble
Brood War
General
Fantasy returning? GG Lan Fest Sofia, Bulgaria [this November] Sagi.gg Launcher Released ASL22 General Discussion BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[Megathread] Daily Proleagues [ASL22] Semifinal B [ASL22] Semifinal A [ASL22] Ro8 Day 4
Strategy
Simple Questions, Simple Answers Cliff Jump Revisited (1 in a 1000 strategy) Replay Review Process - What do you do?
Other Games
General Games
Nintendo Switch Thread General RTS Discussion Thread Warcraft III: The Frozen Throne Stormgate/Frost Giant Megathread Total Annihilation Zero
Dota 2
Dota 2 Champions League Season 3 Begins April 25! Official 'what is Dota anymore' discussion
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 Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread Artificial Intelligence Thread Russo-Ukrainian War Thread
Fan Clubs
Serral Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Diablo Animated Series on Netflix
Sports
Football (Soccer) Thread MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts
Blogs
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
Escaping Into Video Games: G…
TrAiDoS
38 yo Retired SWE loo…
PurE)Rabbit-SF
Can Bots Beat Pros?? Starcr…
namkraft
[meme] I finally understa…
LUCKY_NOOB
Regacy Esports:Our Goa…
regacyesports
Customize Sidebar...

Website Feedback

Closed Threads



Active: 8664 users

The Big Programming Thread - Page 108

Forum Index > General Forum
Post a Reply
Prev 1 106 107 108 109 110 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.
Retgery
Profile Joined August 2010
Canada1229 Posts
Last Edited: 2012-01-18 22:39:32
January 18 2012 22:38 GMT
#2141
Well this we are discussing Vb I might as well jump in and ask for help with my problem.
I'm using the bitBlt function to animate a game, but I'm having trouble getting started. Would I need to have a control array of imgboxes for each array. I figured I would use a timer to move make the movement fluid but I'm wondering if this will work with bitBlt? Any thoughts?
Keep in mind this is only a grade 11 computer science class so don;t make fun of me for using VB
Fall down 7 times, stand up 8.
Pawsom
Profile Blog Joined February 2009
United States928 Posts
January 18 2012 22:45 GMT
#2142
I'm doing some very basic ocket programming for my networks class. However, most of it is to be done in a Linux environment and I don't have one setup at home. I'm thinking I'll likely run a virtual computer, and work in there. Does anyone have any recomendations for software for this, or very basic linux distrubutions they would recomend for the project.
jtype
Profile Blog Joined April 2009
England2167 Posts
Last Edited: 2012-01-19 00:31:13
January 19 2012 00:29 GMT
#2143
I'm trying to learn the basics of programming, starting with some Javascript on Codeacademy, but I'm stuck on one of the exercises at the moment. They have a sort of forum where you can ask questions related to the lessons, but I can't seem to get my code to display properly there, it just keeps cutting my post off. I wonder if anyone might be able to help see what's wrong with it here.

Basically, I'm trying to get the console.log to display which of the numbers between 1-20 are divisible by 3 (calling out "Fizz"), 5 ("Buzz") and both 3 and 5 simultaneously ("FizzBuzz"). This is the link to the lesson itself. Here is the code that I've got so far. The console is just saying "Fizz". Can anyone help me to see what's wrong with it?

+ Show Spoiler +

for (i=1; i<=20; i++) {
}
if ( i%3 === 0 && i%5 === 0 ){
console.log("FizzBuzz");
}
else if ( i%3 === 0 ){
console.log("Fizz");
}
else if ( i%5 === 0 ){
console.log("Buzz");
}
else {
console.log(i);
}
haxorz
Profile Blog Joined June 2009
United States138 Posts
January 19 2012 00:38 GMT
#2144
On January 19 2012 09:29 jtype wrote:
I'm trying to learn the basics of programming, starting with some Javascript on Codeacademy, but I'm stuck on one of the exercises at the moment. They have a sort of forum where you can ask questions related to the lessons, but I can't seem to get my code to display properly there, it just keeps cutting my post off. I wonder if anyone might be able to help see what's wrong with it here.

Basically, I'm trying to get the console.log to display which of the numbers between 1-20 are divisible by 3 (calling out "Fizz"), 5 ("Buzz") and both 3 and 5 simultaneously ("FizzBuzz"). This is the link to the lesson itself. Here is the code that I've got so far. The console is just saying "Fizz". Can anyone help me to see what's wrong with it?

+ Show Spoiler +

for (i=1; i<=20; i++) {
}
if ( i%3 === 0 && i%5 === 0 ){
console.log("FizzBuzz");
}
else if ( i%3 === 0 ){
console.log("Fizz");
}
else if ( i%5 === 0 ){
console.log("Buzz");
}
else {
console.log(i);
}


Your "for" loop is empty - you probably intended all of the "if" statements to be inside of it. As written, the empty "for" loop
runs until "i" is 21. This is why only "Fizz" is being printed to the console.
And theres the GG.
jtype
Profile Blog Joined April 2009
England2167 Posts
January 19 2012 00:43 GMT
#2145
On January 19 2012 09:38 haxorz wrote:
Show nested quote +
On January 19 2012 09:29 jtype wrote:
I'm trying to learn the basics of programming, starting with some Javascript on Codeacademy, but I'm stuck on one of the exercises at the moment. They have a sort of forum where you can ask questions related to the lessons, but I can't seem to get my code to display properly there, it just keeps cutting my post off. I wonder if anyone might be able to help see what's wrong with it here.

Basically, I'm trying to get the console.log to display which of the numbers between 1-20 are divisible by 3 (calling out "Fizz"), 5 ("Buzz") and both 3 and 5 simultaneously ("FizzBuzz"). This is the link to the lesson itself. Here is the code that I've got so far. The console is just saying "Fizz". Can anyone help me to see what's wrong with it?

+ Show Spoiler +

for (i=1; i<=20; i++) {
}
if ( i%3 === 0 && i%5 === 0 ){
console.log("FizzBuzz");
}
else if ( i%3 === 0 ){
console.log("Fizz");
}
else if ( i%5 === 0 ){
console.log("Buzz");
}
else {
console.log(i);
}


Your "for" loop is empty - you probably intended all of the "if" statements to be inside of it. As written, the empty "for" loop
runs until "i" is 21. This is why only "Fizz" is being printed to the console.


Oh wow! Thanks a lot man. I was almost pulling my hair out over that. I knew it had to be something simple, since the statements all seemed to be in their right place. Thanks! :D
fabiano
Profile Blog Joined August 2009
Brazil4644 Posts
January 19 2012 00:47 GMT
#2146
On January 19 2012 07:45 Pawsom wrote:
I'm doing some very basic ocket programming for my networks class. However, most of it is to be done in a Linux environment and I don't have one setup at home. I'm thinking I'll likely run a virtual computer, and work in there. Does anyone have any recomendations for software for this, or very basic linux distrubutions they would recomend for the project.


Virtual Box or VMWare

Be aware that you might need to configure your virtual machine network correctly before being able to use sockets properly.
"When the geyser died, a probe came out" - SirJolt
v3locity
Profile Joined July 2011
United States3 Posts
January 19 2012 01:19 GMT
#2147
On January 19 2012 09:47 fabiano wrote:
Show nested quote +
On January 19 2012 07:45 Pawsom wrote:
I'm doing some very basic ocket programming for my networks class. However, most of it is to be done in a Linux environment and I don't have one setup at home. I'm thinking I'll likely run a virtual computer, and work in there. Does anyone have any recomendations for software for this, or very basic linux distrubutions they would recomend for the project.


Virtual Box or VMWare

Be aware that you might need to configure your virtual machine network correctly before being able to use sockets properly.


Yeah, and as for distros I've always liked Fedora/CentOS for developing.
tofucake
Profile Blog Joined October 2009
Hyrule19260 Posts
January 19 2012 01:34 GMT
#2148
On January 19 2012 03:08 Bigpet wrote:
Show nested quote +
On January 18 2012 12:30 Millitron wrote:
Speaking of VB, I had to use it last semester in my database management class.

It was not a good experience. The absolute worst part, was in Visual Basic for Access, it lets you use variables you haven't yet defined, unlike in pretty much any other language where the compiler would bitch at you. Instead of giving you an error, or crashing, it just ignores any statements with undefined variables.


VBA != VB. Syntax may be similar but VBA is interpreted and therefore the compiler doesn't "bitch" because there is no compiler. There are plenty of scripting languages out there that assign default values to undeclared variables.

edit: vba is actually compiled into an intermediate language . But still it just behaves like a scripting language, nothing out of the ordinary.

VB is compiled into byte code. All of it.
Liquipediaasante sana squash banana
Warpath
Profile Joined April 2010
Canada1242 Posts
Last Edited: 2012-01-19 20:12:45
January 19 2012 20:03 GMT
#2149
I was just assigned a project in my XNA programming class. I'm considering working on Multiplayer with Host/Client for a very simple 3D game.
I've looked around but info is limited.. Does anyone know of a good resource or tutorial for setting it up? I've found Lidgren but want to see if there are alternatives before locking in on it.

to be more specific: the requirements of the program is to get 1 or 2 ideas and make a very basic prototype. The 'idea' I'm making is the Multi-player that will function like any FPS.
I want to get the multiplayer working in any way that lets 2 computers communicate (probably via lan direct connection)
whether it does work in host/client or P2P doesn't really bother me.
I'm just looking for resources or tutorials at this point to get me started.
MichaelEU
Profile Joined February 2011
Netherlands816 Posts
January 20 2012 02:08 GMT
#2150
I look at Javascript and I'm like "wat."

https://www.destroyallsoftware.com/talks/wat
世界を革命する力を!― znf: "Michael-oniichan ( *^▽^*)ノ✩キラ✩"
D4Lorg
Profile Joined January 2010
10 Posts
January 20 2012 03:59 GMT
#2151
hey, today at work ive been thinking, what are each languages respective "bibles".
C is obviously the K&R and
C++ is arguably C++ programming language by stroustrup.
anyone know any others?
maybe "the rails 3 way" for rails and "programming perl" (o'reilly) for perl?
NoSlack
Profile Joined November 2010
United States112 Posts
January 20 2012 04:58 GMT
#2152
Programming PHP and Learning PHP, MySQL, and JavaScript.

These are for PHP of course. The first one is the bible, and the second one puts the trio together as a sort of bible.
tec27
Profile Blog Joined June 2004
United States3715 Posts
January 21 2012 02:26 GMT
#2153
On January 18 2012 14:03 NoSlack wrote:
Show nested quote +
On January 18 2012 10:27 tec27 wrote:
Can you use code tags or put it in a gist next time? Absolutely awful to read as is

Anyway, your code looks fine. For checking a valid email address, most people use regular expressions ( http://www.regular-expressions.info/email.html ).

As an improvement, you should try and separate your content as much as possible from your code. IE: instead of echoing your form, put it outside of the php tags as regular html. Instead of setting error to some html, set error to just the error string, or better yet, an array of error strings and put it in your html like so:

<?php
[ ... your validation code ... ]
?>
<? if(count($errors) > 0) { ?>

<ul class="error">
<? foreach($errors as $error) { ?>
<li><? echo $error; ?></li>
<? } ?>
</ul>

<? } ?>


Thanks for the advice I'll definitely be doing this. This should make the code much easier to read. I have a very OOP mindset, having started with VB, C# mostly, but I haven't grasped the concept of how to apply this to the web. Really, I'd like to have the entire thing be a class, stored in a separate file (that the user can't get to) and just have it spit out the HTML to this php file. I feel like this is overkill though for a PHP page, the OOP (class, object, property, method) mentality doesn't seem to apply as easily yet for me. Does it for you when it comes to PHP? Maybe once my project gets more complicated it will? Also thanks for the link that's a good one to have for sure!


An approach you might want to consider taking is going more MVCish (Model-View-Controller). Essentially you separate all your business logic and data access from the page that gets rendered. So you might have one class that takes in requests and builds a model (this is your controller), then you pass that model along to what amounts to a template file which uses that data to render the page for the user. The template file then stays nice and simple, usually just html, outputting variables, and maybe a few if/else statements, and the controller and model stay focused on their parts as well. Overall it ends up being a much cleaner way to program for the web (usually ). There are some frameworks out there for PHP to do it (not sure what they are, just know they exist ), but it wouldn't be too terribly hard to implement a simple system yourself and you could learn a lot by doing it.
Can you jam with the console cowboys in cyberspace?
iaretehnoob
Profile Joined June 2004
Sweden741 Posts
January 21 2012 09:57 GMT
#2154
On January 20 2012 05:03 Warpath wrote:
I was just assigned a project in my XNA programming class. I'm considering working on Multiplayer with Host/Client for a very simple 3D game.
I've looked around but info is limited.. Does anyone know of a good resource or tutorial for setting it up? I've found Lidgren but want to see if there are alternatives before locking in on it.

to be more specific: the requirements of the program is to get 1 or 2 ideas and make a very basic prototype. The 'idea' I'm making is the Multi-player that will function like any FPS.
I want to get the multiplayer working in any way that lets 2 computers communicate (probably via lan direct connection)
whether it does work in host/client or P2P doesn't really bother me.
I'm just looking for resources or tutorials at this point to get me started.


I've used Lidgren in the past and it should be fine for what you want to do, but I don't remember if I used any tutorial. It should come with some documentation for basic setup etc, right?

Also have a look at the networking built into XNA (http://msdn.microsoft.com/en-us/library/bb975256.aspx), might be the simplest way, if you have the required 2 computers for testing.
klo8
Profile Joined August 2010
Austria1960 Posts
January 21 2012 15:10 GMT
#2155
On January 09 2012 00:20 shannn wrote:
A quick question to the more experienced game programmers or any other experienced programmer.

My iOS game that I'm making right now with Cocos2D has a lot of code. There are a lot of improvements to be done and regarding one of these improvements I'm currently wondering how much does a statement cost in performance or how can I check the performance of my game other than looking at the FPS.

E.g. There is a schedule method called update (how convenient ^^) is called every frame. My current capped framerate is at 30 fps. How big does it affect the game performance if I had like a couple of for leaps and other statements in this schedule method? At first I had a lot of code called in this schedule method and now reduced by 2/3rd compared to before.
My FPS won't drop below 30 right now and when I set the fps cap at 60 it usually runs at 45-55ish fps and almost never at
60.

Does anyone know or know how I can check for these performances? I've searched on the cocos2d forums and other community sites but the threads are old and I don't understand them very well yet Hoping some experienced TL'er could explain it to me in a more beginner way

Use a profiler. It'll show you how much CPU time and memory a certain method uses. I don't know much about iOS development but if Xcode doesn't have a profiler built-in, you should be able to get one as a plug-in.
This post is clearly not a hurr, as you can see from the graph, the durr never intersects with the derp.
tec27
Profile Blog Joined June 2004
United States3715 Posts
January 22 2012 00:07 GMT
#2156
It was bugging me that we couldn't embed Gists here, so I first requested it in Website Feedback, then realized it'd be better to just accomplish that goal in a Greasemonkey script. So I wrote one:

+ Show Spoiler [Script Link or Embed if you have it :)] +

https://gist.github.com/1654534


Should work in both Opera and Chrome. Isn't working in Firefox and I have not a clue why, but I never use Firefox so I can't be arsed to debug it any more than I already have.
Can you jam with the console cowboys in cyberspace?
KaiserJohan
Profile Joined May 2010
Sweden1808 Posts
January 22 2012 00:31 GMT
#2157
On January 20 2012 11:08 MichaelEU wrote:
I look at Javascript and I'm like "wat."

https://www.destroyallsoftware.com/talks/wat


Hahahahahahaha... I've never had to use Javascript and from all the comments and rediculous examples I am quite happy with that.
And the last joke was SUPERB. To bad the guys in the audience were mostly annoying
England will fight to the last American
tofucake
Profile Blog Joined October 2009
Hyrule19260 Posts
January 22 2012 00:40 GMT
#2158
Yeah was a great video
Liquipediaasante sana squash banana
woozie
Profile Joined July 2010
Sweden53 Posts
January 22 2012 04:52 GMT
#2159
I'm currently going through "Head First C#" and I could use a little bit of help from more experienced C# programmers.

It's mainly about bugs or features I'm having trouble with.

In this program called "Reimbursment Calculator" I'm trying to create a program that can (1) calculate how much money should be reimbursed and (2) how many miles you've traveled. I'm having trouble with the second feature.

The program basically consists of two numbericUpDown values that gives the starting mileage and ending mileage. By pressing a button the amount of money that should be reimbursed. A second button should show a message box that displays the total mileage.

private void button1_Click(object sender, EventArgs e)
{
decimal startingMileage = numericUpDown1.Value;
decimal endingMileage = numericUpDown2.Value;
decimal reimburseRate = .39M;

// Make sure that the number in Starting Mileage is smaller than the Ending Mileage field
if (startingMileage > endingMileage)
{
MessageBox.Show("Starting Mileage must be smaller than Ending Mileage!", "Cannot Calculate Mileage");
label4.Text = "N/A";
}
else
{
decimal milesTraveled = endingMileage - startingMileage;
decimal amountOwned = milesTraveled * reimburseRate;

label4.Text = "$" + amountOwned;
}
}

private void button2_Click(object sender, EventArgs e)
{
MessageBox.Show(milesTraveled + " miles", "Miles Traveled");
}

The problem is that the IDE complains that "The name 'milesTraveled' does not exist in the current context". This problem occurs in the code of the second button: MessageBox.Show(milesTravaled + " miles", "Miles Traveled"); I don't understand why it says so. How can I fix it?
Herper
Profile Joined January 2011
501 Posts
January 22 2012 05:04 GMT
#2160
On January 20 2012 12:59 D4Lorg wrote:
hey, today at work ive been thinking, what are each languages respective "bibles".
C is obviously the K&R and
C++ is arguably C++ programming language by stroustrup.
anyone know any others?
maybe "the rails 3 way" for rails and "programming perl" (o'reilly) for perl?


Java:
The Java Programming Language by Arnold, Gosling, Holmes
Prev 1 106 107 108 109 110 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 12h 21m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko188
StarCraft: Brood War
Britney 24746
Calm 4300
Rain 2737
Hyuk 1524
Bisu 873
FanTaSy 563
Horang2 434
Soma 316
Jaedong 262
Rush 257
[ Show more ]
BeSt 238
Mong 201
Zeus 199
Stork 194
Mini 86
Larva 83
Mind 76
Pusan 72
Light 60
ZerO 57
Sexy 50
ToSsGirL 49
Barracks 47
Killer 36
910 35
Yoon 30
Shinee 30
NaDa 27
sorry 18
Free 17
Terrorterran 14
Hm[arnc] 13
Noble 13
Dota 2
Gorgc5618
Counter-Strike
olofmeister1116
byalli822
shoxiejesuss515
edward36
Super Smash Bros
Mew2King71
Other Games
gofns48943
singsing1483
dupreeh321
crisheroes260
ZerO(Twitch)4
[ Show 14 non-featured ]
StarCraft 2
• LUISG 12
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• FirePhoenix7
• iopq 6
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos1805
• Stunt352
Other Games
• WagamamaTV29
Upcoming Events
OSC
12h 21m
Big Brain Bouts
23h 21m
Rex vs INexorable
GgMaChine vs HeRoMaRinE
Reynor vs herO
AI Arena Tournament
1d 6h
BSL: Ladder Tournament
1d 8h
Sparkling Tuna Cup
1d 23h
Patches Events
2 days
BSL Open Qualifier
2 days
BSL Open Qualifier
2 days
WardiTV Weekly
4 days
PiGosaur Cup
4 days
[ Show More ]
The PondCast
5 days
Liquipedia Results

Completed

Proleague 2026-10-08
Blizzard Classic Cup 2026
Copium Cup

Ongoing

ASL Season 22
Super Anchor Qualifying S3
Acropolis #5
Acropolis #5 - GSB
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
Esports World Cup 2026
BLAST Bounty Summer 2026

Upcoming

Acropolis #5 - GSC
BSL Season 23
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
HCC Season 3
eXTREMESLAND 2026
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
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.