• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 12:16
CEST 18:16
KST 01:16
  • 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
Serral wins HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
Reynor: GSL Loss Wasn't About Preparation Format12[IPSL] Spring 2026 Grand Finals - This Weekend!5Weekly Cups (July 6 - 12): Protoss strike back12BSL Season 22 Full Overview & Conclusion8BSL Season 22 Full Overview & Conclusion8
StarCraft 2
General
Is the larve respawn broken? BGE Stara Zagora to be held again in June 2025 Weekly Cups (July 6 - 12): Protoss strike back Serral wins HomeStory Cup 29 Yamato Cup Series
Tourneys
WardiTV Summer Cup 2026 GSL CK #5 Race War RSL Revival: Season 6 - Qualifiers and Main Event HomeStory Cup 29 Vespene Cup #1 — $300+ USD, July 10
Strategy
[G] Having the right mentality to improve
Custom Maps
New Map Maker - Looking for Advice - Love or Hate Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together Mutation # 532 Nuclear Family
Brood War
General
Recommended FPV games (post-KeSPA) Pros Debate: Zerg Unfairly Nerfed? (ASL S22 map) BGH Auto Balance -> http://bghmmr.eu/ Etiquete rules in Asl? screpdb: new Starcraft reporting tool
Tourneys
[IPSL] Spring 2026 Grand Finals - This Weekend! Escore Tournament - Season 3 [Megathread] Daily Proleagues [ASL22] Wildcard Qualifier
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Creating a full chart of Zerg builds Relatively freeroll strategies
Other Games
General Games
General RTS Discussion Thread Path of Exile Nintendo Switch Thread Stormgate/Frost Giant Megathread Summer Games Done Quick 2026!
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread UK Politics Mega-thread YouTube Thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Movie Discussion! Series you have seen recently...
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Tennis[sport] Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Simple Questions Simple Answers FPS when play League Of Legend on laptop How to clean a TTe Thermaltake keyboard?
TL Community
Northern Ireland Global Starcraft The Automated Ban List
Blogs
Poker (part 2)
Nebuchad
The Experiences We Want and …
TrAiDoS
An Exploration of th…
waywardstrategy
Gauntlet SC2: A Retrospectiv…
Ctone23
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Evil Gacha Games and the…
ffswowsucks
Customize Sidebar...

Website Feedback

Closed Threads



Active: 6555 users

The Big Programming Thread - Page 212

Forum Index > General Forum
Post a Reply
Prev 1 210 211 212 213 214 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.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2012-12-08 03:54:14
December 08 2012 03:51 GMT
#4221
I've just checked C++'s syntax, and it looks very similar to Java's imho. I'm glad I will have an easier time to learn this language. ^^

Edit: Why does Java use the term 'method', while C++ says function? They look similar to me. lol
phar
Profile Joined August 2011
United States1080 Posts
December 08 2012 04:19 GMT
#4222
a method is a function from a class. In Java, fucking everything is a class, thus it's all methods all the way down.

In C++ I think technically you call methods "member functions" or some shit. It's just an OO term:

http://en.wikipedia.org/wiki/Method_(computer_science)
Who after all is today speaking about the destruction of the Armenians?
Bigpet
Profile Joined July 2010
Germany533 Posts
December 08 2012 04:25 GMT
#4223
On December 08 2012 12:51 darkness wrote:
I've just checked C++'s syntax, and it looks very similar to Java's imho. I'm glad I will have an easier time to learn this language. ^^

Edit: Why does Java use the term 'method', while C++ says function? They look similar to me. lol


Syntactically Java borrows heavily from C++.

Multiple reasons for the name Method. Methods always belong to a class and using the term Method also doesn't clash with the mathematical definition of a function (not really that big of a reason, since basic aspects like the = symbol are still semantically very different from maths). Basically C++ got all the terminology from C and Java borrowed some from other languages like Smalltalk.


//this is a function but not a method since it doesn't belong to any class
int func(double num)
{
return num-5;
}

class A{
public:
//you could call this a method but most C++ people just call it a member function
int func2(double num)
{
return num-15;
}
};
I'm NOT the caster with a similar nick
fabiano
Profile Blog Joined August 2009
Brazil4644 Posts
December 08 2012 04:36 GMT
#4224
Method and attribute are OOP nomenclatures for class functions and class variables, not something to worry about actually
"When the geyser died, a probe came out" - SirJolt
waxypants
Profile Blog Joined September 2009
United States479 Posts
December 08 2012 06:02 GMT
#4225
On December 06 2012 04:06 Recognizable wrote:
I had to search for what scope is but I guess I understand it a bit better now. Why is this important? Why doesn't the computer understand what you are doing when you aren't indenting?

def f(a,b):
c = a + b
c = g(c) + X
d = c * c + a
return d * b


Am I right in saying that this works because return is in the same scope as C,D and so it can do something with these variables. If return wasn't indented it wouldn't be able to do that because it wasn't in the same scope and therefore can't do anything with those variables?


ambiguity
akarin
Profile Joined February 2011
Ireland42 Posts
Last Edited: 2012-12-08 14:34:44
December 08 2012 12:46 GMT
#4226
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
December 08 2012 13:51 GMT
#4227
On December 08 2012 21:46 akarin wrote:
Show nested quote +
On December 08 2012 03:31 heishe wrote:
On December 07 2012 20:14 akarin wrote:
Hey guys

Anyone here that could help me with a small bit of assembly language through skype? It would be super appreciated <3


Not through skype. Better just post it here, written advice is better for that kind of stuff anyways.


okeydoke


Write code to print the word “racecar” to the VDU twice. Print the word once using the INC instruction to read ASCII values from memory, once using the DEC instruction. You may use loops, but only if you wish. It is possible to write a solution without loops and you will not be docked marks for not doing so

 Use the DB directive to store one value in memory per letter, so seven in
total.
 Using one register as a pointer to memory, read each stored value one
 by one into another register, then into an area in memory starting at [C0].
You MUST use indirect addressing.
 You should increment your pointer register using the INC instruction.
 Once all letters have been printed to the VDU, print them again using the
DEC command to decrement your pointer register. So effectively you will
be printing out the word backwards. In total you will print 14 letters, so your
program will be quite long!
 As the word is a palindrome, your final output should read
racecarracecar


This is not a "We do your homework for you" thread.

How does your current code look and what part do you have problems with?
3FFA
Profile Blog Joined February 2010
United States3931 Posts
December 09 2012 17:29 GMT
#4228
Thanks everyone on the previous page for your help!

As for the reason I'm learning C and not C++ is because that is the language my school is teaching me. When I originally signed up for this class(which is brand new here) it was indeed going to be learning how to use C++ but then they changed the language to C due to not being able to do something a certain way that they wanted to with C++.
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
December 09 2012 17:40 GMT
#4229
On December 10 2012 02:29 3FFA wrote:
Thanks everyone on the previous page for your help!

As for the reason I'm learning C and not C++ is because that is the language my school is teaching me. When I originally signed up for this class(which is brand new here) it was indeed going to be learning how to use C++ but then they changed the language to C due to not being able to do something a certain way that they wanted to with C++.

I wonder what their reasoning was, since C++ is a superset of C, you can do everything in C++ that you can do in C.
Kambing
Profile Joined May 2010
United States1176 Posts
December 09 2012 17:43 GMT
#4230
On December 10 2012 02:40 Tobberoth wrote:
Show nested quote +
On December 10 2012 02:29 3FFA wrote:
Thanks everyone on the previous page for your help!

As for the reason I'm learning C and not C++ is because that is the language my school is teaching me. When I originally signed up for this class(which is brand new here) it was indeed going to be learning how to use C++ but then they changed the language to C due to not being able to do something a certain way that they wanted to with C++.

I wonder what their reasoning was, since C++ is a superset of C, you can do everything in C++ that you can do in C.


If they aren't exploring object-oriented programming, then C is the right choice. You don't want to teach students C-style programming in (un-idiomatic) C++.
windzor
Profile Joined October 2010
Denmark1013 Posts
December 09 2012 17:58 GMT
#4231
On December 10 2012 02:43 Kambing wrote:
Show nested quote +
On December 10 2012 02:40 Tobberoth wrote:
On December 10 2012 02:29 3FFA wrote:
Thanks everyone on the previous page for your help!

As for the reason I'm learning C and not C++ is because that is the language my school is teaching me. When I originally signed up for this class(which is brand new here) it was indeed going to be learning how to use C++ but then they changed the language to C due to not being able to do something a certain way that they wanted to with C++.

I wonder what their reasoning was, since C++ is a superset of C, you can do everything in C++ that you can do in C.


If they aren't exploring object-oriented programming, then C is the right choice. You don't want to teach students C-style programming in (un-idiomatic) C++.


And depending on the field, you wont be doing C++ programming but C as some of the C++ constructs can impose performance issues in embedded environments.
Yeah
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
December 09 2012 18:38 GMT
#4232
Both valid points, but if the course was intended to use C++, it's weird that they would suddenly come up with something which made C viable in a way C++ isn't.
3FFA
Profile Blog Joined February 2010
United States3931 Posts
Last Edited: 2012-12-09 22:06:56
December 09 2012 22:06 GMT
#4233
It was meant to teach how to program in a programming language, and is made as a beginning programming course, and as both an intro to programming (along w/ the history of it in the first few weeks) as well as an intro to C. In the 2nd semester they will be teaching us how to make an App for an iPhone, Android etc.

edit: it may be the embedded environments portion.
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
Craton
Profile Blog Joined December 2009
United States17294 Posts
Last Edited: 2012-12-09 23:23:17
December 09 2012 23:21 GMT
#4234
Android supports Java/C/C++
iPhone supports Objective C, C, C++ and seems to support other languages now in some fashion
WP7 supports C# w/ Silverlight, though there seems to be roundabout ways to use other languages
WP8 supports at least C and C++

Source: Google
twitch.tv/cratonz
white_horse
Profile Joined July 2010
1019 Posts
December 09 2012 23:34 GMT
#4235
How do you "scale" an array so that its maximum value is 1? Our professor wants us to do that to the array "body" (below) but I have no idea what that means. This is for MATLAB not c++,


Row = 30;
Col = 40;
body = zeros(Row, Col);
Translator
shem
Profile Joined March 2010
United States7 Posts
December 09 2012 23:37 GMT
#4236
Divide each element by the maximum element so that everything is in the range [0,1]? That's all I can think of
Craton
Profile Blog Joined December 2009
United States17294 Posts
Last Edited: 2012-12-09 23:43:53
December 09 2012 23:41 GMT
#4237
I would assume it means something like going from 123.45 -> .12345, but being consistent across all elements (i.e divide everything by 1000), such that all your elements are now [0,1].

This seems to be a popular question on Google, btw.

You could just ask your professor for clarification.
twitch.tv/cratonz
magicmUnky
Profile Joined June 2011
Australia280 Posts
Last Edited: 2012-12-09 23:52:20
December 09 2012 23:49 GMT
#4238
I'm really into embedded control and I can tell you that learning C over C++ is a big mistake... embedded controllers are becoming very powerful and modern applications really don't suffer much from "bloated" C++ implementation.

C is fine for learning the basics of control using really basic controllers (PIC, Arduino, MSP430 etc) but the moment you want to do anything interesting or use over 100Mhz, you'll be likely working with a toolset written with C++ rather than C; and you'll need those extras available in C++ to write effective programs.

For example.. if you want to do any industrial automation or dynamic control, you'll be using something like an Arm Cortex M3, minimum... maybe a TI Concierto (it's a CM3 with a DSP on the side, sharing the same clock http://www.ti.com/mcu/docs/mcuproductcontentnp.tsp?sectionId=95&familyId=2049&tabId=2743 )... any of that stuff will use C++

Many of the cheap and easy to work with processors over 600Mhz are programmed using .NET (they're tailored for communication).
Marradron
Profile Blog Joined January 2009
Netherlands1586 Posts
Last Edited: 2012-12-09 23:53:05
December 09 2012 23:51 GMT
#4239
On December 10 2012 08:34 white_horse wrote:
How do you "scale" an array so that its maximum value is 1? Our professor wants us to do that to the array "body" (below) but I have no idea what that means. This is for MATLAB not c++,


Row = 30;
Col = 40;
body = zeros(Row, Col);


A =

2 3
5 7

>> A=A./max(A(: ))

A =

0.2857 0.4286
0.7143 1.0000

Bassically you scale the array by the maximum value in the array.

One problem is that the array in your code is defined as an array with only zeroes. For that case it is not clear what the professor wants.
Poopi
Profile Blog Joined November 2010
France13003 Posts
December 10 2012 00:19 GMT
#4240
Hey guys.
So I just finished a project (well there is this problem so it's not literally finished) in PHP with some mySQL.
However I had a problem with a basic search bar. It won't matter since I already sent my project, with the problem, because of the deadline, but my curiosity wants to know what was the solution for this problem. I could not really find the right key words on google so here I ask you if you can help me.

So I want the request to search in a precised table the word typed, but I want it to only show the results from this table associated with the current userid.
Here is my request showing it but for every id :
SELECT * FROM products WHERE name LIKE '%$search%' ORDER BY name

(not sure about the syntax Im on mobile don't have access to the files).
I would like something like that instead :
SELECT * FROM products WHERE fournid='$fournid' AND name LIKE  etc

$search the $_post of the searchbar and $fournid the $_cookie['userid'] of the current user.
Problem this request won't work and I know it but I don't know how I'm supposed to do it.

Any ideas?
Thanks in advance.

WriterMaru
Prev 1 210 211 212 213 214 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 44m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
LamboSC2 298
Harstem 123
UpATreeSC 35
StarCraft: Brood War
Calm 8323
Sea 1799
Britney 1334
Soma 805
EffOrt 722
Light 591
Mini 509
BeSt 365
Larva 228
Snow 223
[ Show more ]
actioN 196
Soulkey 185
Mong 118
Sharp 94
Sea.KH 57
Zeus 56
JYJ 49
Pusan 46
ggaemo 45
Free 38
Rush 35
sorry 34
soO 30
Terrorterran 30
scan(afreeca) 29
910 27
Killer 25
Sexy 17
Bale 14
IntoTheRainbow 11
zelot 10
Sacsri 9
ajuk12(nOOB) 8
Dota 2
Gorgc8409
qojqva1130
Trikslyr55
Counter-Strike
fl0m1379
x6flipin756
kRYSTAL_303
allub256
Super Smash Bros
C9.Mang028
Other Games
singsing1662
Liquid`RaSZi806
ceh9804
B2W.Neo451
ToD195
XaKoH 141
KnowMe99
QueenE82
Rex12
Organizations
Other Games
gamesdonequick2545
StarCraft 2
TaKeTV292
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 14 non-featured ]
StarCraft 2
• StrangeGG 85
• LUISG 7
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis2104
Other Games
• Shiphtur286
Upcoming Events
OSC
44m
MaxPax vs Solar
ByuN vs Cure
Shameless vs Lambo
SKillous vs Cham
Percival vs Harstem
ShoWTimE vs Krystianer
Replay Cast
16h 44m
CrankTV Team League
18h 44m
WardiTV Qualifier
19h 44m
Epic.LAN
20h 44m
Replay Cast
1d 7h
RSL Revival
1d 16h
Clem vs Lambo
Scarlett vs Cure
CranKy Ducklings
1d 17h
Epic.LAN
1d 20h
IPSL
1d 23h
Dragon vs Hawk
[ Show More ]
RSL Revival
2 days
Classic vs Trap
herO vs SHIN
Sparkling Tuna Cup
2 days
IPSL
2 days
Bonyth vs Ret
WardiTV Weekly
3 days
Monday Night Weeklies
3 days
PiGosaur Cup
5 days
The PondCast
5 days
Replay Cast
6 days
CrankTV Team League
6 days
Liquipedia Results

Completed

Proleague 2026-07-13
HSC XXIX
Eternal Conflict S2 E2

Ongoing

IPSL Spring 2026
Acropolis #4
CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
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
PGL Astana 2026
BLAST Rivals Spring 2026

Upcoming

Escore Tournament S3: W3
ASL S22 SEASON OPEN Day 1
Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
CSLAN 4
Blizzard Classic Cup 2026
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
Eternal Conflict S2 E3
Logitech G Connect 2026
StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
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.