• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 23:52
CEST 05:52
KST 12:52
  • 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] Ro24 Preview: Summer's End2Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7
Community News
GSTL Returns in 2026!41Weekly Cups (Aug 3-9): Protoss get shut out7RSL goes to London! 2026 Offline Finals Nov 21-2212Weekly Cups (July 27-Aug 2): SHIN's big week0SC4ALL II: Brood War - $2500 - Dec 5-611
StarCraft 2
General
GSTL Returns in 2026! Balance hotfix patch 5.0.16b (July 16) SC4ALL: II Talent Announcement! Protoss AoE skill expression Weekly Cups (Aug 3-9): Protoss get shut out
Tourneys
WardiTV Mondays PIG STY FESTIVAL 8.0! (13 - 23 August) 2026 KungFu Cup Announcement Sparkling Tuna Cup - Weekly Open Tournament 2026 GSTL Announcement
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
The PondCast: SC2 News & Results Mutation # 539 Thunder Dome Mutation # 538 Media Blackout Mutation # 537 Hostile Territory
Brood War
General
BW General Discussion [ASL22] Ro24 Preview: Summer's End Rush's Odyssey Controversy StarCraft 64 is coming to Philly at SC4ALL II Best Games Kespa era
Tourneys
CSLAN 4 is Coming! ASL Season 22 LIVESTREAM with English Commentary [ASL22] Ro24 Group A [Megathread] Daily Proleagues
Strategy
Odyssey Mineral Stack Saturation Fighting Spirit mining rates Any training maps people recommend? Simple Questions, Simple Answers
Other Games
General Games
Nintendo Switch Thread General RTS Discussion Thread Anyone here play Quakeworld back in the day? Stormgate/Frost Giant Megathread EVE Corporation
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank TL Mafia Community Thread NeO.D_StephenKing vs This Guy From 1 Million Dance
Community
General
US Politics Mega-thread Artificial Intelligence Thread Russo-Ukrainian War Thread European Politico-economics QA Mega-thread The Letting Off Steam Thread
Fan Clubs
MarineLorD Fan Club The ShoWTimE Fan Club The herO Fan Club!
Media & Entertainment
Movie Discussion! Anime Discussion Thread Series you have seen recently... [Req][Books] Good Fantasy/SciFi books
Sports
MLB/Baseball 2023 Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Simple Questions Simple Answers FPS when play League Of Legend on laptop
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
LOCKPICKING NOOB
LUCKY_NOOB
Chinese Gen Z: Between Dream…
TrAiDoS
Cathedral Of CS And NY pizza a…
FuDDx
Please support my new stand…
Peanutsc
Hello guys!
LIN1s
Customize Sidebar...

Website Feedback

Closed Threads



Active: 9308 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
Hyrule19237 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 States3702 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 States3702 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
Hyrule19237 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
OSC
00:00
OSC Elite Rising Star #20
Liquipedia
IPSL
16:00
CSLAN Day 2
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft594
RuFF_SC2 226
Nina 43
StarCraft: Brood War
Shuttle 2430
Sharp 317
sorry 45
Noble 15
Dota 2
NeuroSwarm223
febbydoto54
LuMiX1
League of Legends
JimRising 572
Counter-Strike
summit1g9207
taco 554
minikerr48
Super Smash Bros
Mew2King169
Other Games
Maynarde152
UpATreeSC24
Organizations
Other Games
gamesdonequick854
[ Show 12 non-featured ]
StarCraft 2
• Berry_CruncH337
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• RayReign 68
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush727
• Stunt235
Upcoming Events
Afreeca Starleague
6h 8m
Rush vs Hm
Bisu vs Shuttle
WardiTV Weekly
7h 8m
The Patches Monday
12h 8m
Afreeca Starleague
1d 6h
Sharp vs Shinee
Action vs Shine
GSL
1d 7h
PiGosaur Cup
1d 20h
Replay Cast
2 days
Afreeca Starleague
2 days
BeSt vs Paralyze
Jaedong vs Speed
Kung Fu Cup
2 days
Replay Cast
2 days
[ Show More ]
The PondCast
3 days
KCM Race Survival
3 days
Replay Cast
3 days
PiG Sty Festival
4 days
CranKy Ducklings
5 days
PiG Sty Festival
5 days
Sparkling Tuna Cup
6 days
PiG Sty Festival
6 days
Liquipedia Results

Completed

CSLAN 4
CranK Gathers Season 4: BW vs SC2 Team League
Eternal Conflict S2 Finale

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
Acropolis #5
ASL Season 22
RSL Revival: Season 6
PiG Sty Festival 8.0
META DYMY #4
Esports World Cup 2026
Esports World Cup 2026: LCQ
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026

Upcoming

CSL Season 22: Qualifier 1
Escore Tournament S3: W8
CSL Season 22: Qualifier 2
CSL 2026 AUTUMN (S22)
Acropolis #5 - TRS
Blizzard Classic Cup 2026
Acropolis #5 - GSA
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Big Dog Cup 2026 Div 1
Stake Ranked Episode 5
PGL Masters Bucharest 2026
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #5
BLAST Open 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.