• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:56
CET 01:56
KST 09:56
  • 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
SC2 All-Star Invitational: Tournament Preview5RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2
Community News
BSL Season 2025 - Full Overview and Conclusion5Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets4$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)16Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns7[BSL21] Non-Korean Championship - Starts Jan 105
StarCraft 2
General
Stellar Fest "01" Jersey Charity Auction SC2 All-Star Invitational: Tournament Preview Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets When will we find out if there are more tournament SC2 Spotted on the EWC 2026 list?
Tourneys
SC2 AI Tournament 2026 SC2 All-Star Invitational: Jan 17-18 $21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) OSC Season 13 World Championship Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Simple Questions Simple Answers
Custom Maps
Map Editor closed ?
External Content
Mutation # 508 Violent Night Mutation # 507 Well Trained Mutation # 506 Warp Zone Mutation # 505 Rise From Ashes
Brood War
General
Fantasy's Q&A video Potential ASL qualifier breakthroughs? BSL Season 2025 - Full Overview and Conclusion [ASL21] Potential Map Candidates BW General Discussion
Tourneys
[BSL21] Non-Korean Championship - Starts Jan 10 Small VOD Thread 2.0 Azhi's Colosseum - Season 2 [Megathread] Daily Proleagues
Strategy
Soma's 9 hatch build from ASL Game 2 Simple Questions, Simple Answers Game Theory for Starcraft Current Meta
Other Games
General Games
Stormgate/Frost Giant Megathread Beyond All Reason Awesome Games Done Quick 2026! Nintendo Switch Thread Mechabellum
Dota 2
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 Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Canadian Politics Mega-thread European Politico-economics QA Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
My 2025 Magic: The Gathering…
DARKING
Physical Exercise (HIIT) Bef…
TrAiDoS
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1054 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 States17274 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 States17274 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
France12907 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
BSL 21
20:00
Non-Korean Championship - D3
Mihu vs eOnzErG
Dewalt vs Sziky
Bonyth vs DuGu
XuanXuan vs eOnzErG
Dewalt vs eOnzErG
LiquipediaDiscussion
AI Arena Tournament
20:00
Swiss - Round 2
Laughngamez YouTube
[ Submit Event ]
Live Streams
Refresh
StarCraft: Brood War
Britney 4391
Shuttle 80
Super Smash Bros
amsayoshi29
Other Games
tarik_tv17969
gofns8987
summit1g7457
FrodaN3250
XaKoH 185
KnowMe154
ViBE120
JimRising 116
minikerr7
PiLiPiLi5
Organizations
Other Games
gamesdonequick2406
StarCraft 2
WardiTV738
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 19 non-featured ]
StarCraft 2
• musti20045 81
• davetesta38
• Airneanach11
• Kozan
• AfreecaTV YouTube
• sooper7s
• intothetv
• IndyKCrew
• LaughNgamezSOOP
• Migwel
StarCraft: Brood War
• Azhi_Dahaki74
• RayReign 23
• HerbMon 18
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21326
League of Legends
• Doublelift5926
Other Games
• imaqtpie2369
Upcoming Events
All-Star Invitational
2h 4m
MMA vs DongRaeGu
herO vs Solar
Clem vs Reynor
Rogue vs Oliveira
Sparkling Tuna Cup
9h 4m
OSC
11h 4m
Shameless vs NightMare
YoungYakov vs MaNa
Nicoract vs Jumy
Gerald vs TBD
Creator vs TBD
BSL 21
19h 4m
Bonyth vs Sziky
Mihu vs QiaoGege
Sziky vs XuanXuan
eOnzErG vs QiaoGege
Mihu vs DuGu
Dewalt vs Bonyth
IPSL
19h 4m
Dewalt vs Sziky
Replay Cast
1d 8h
Wardi Open
1d 11h
Monday Night Weeklies
1d 16h
The PondCast
3 days
Big Brain Bouts
5 days
Serral vs TBD
[ Show More ]
BSL 21
6 days
Liquipedia Results

Completed

Escore Tournament S1: W4
Big Gabe Cup #3
NA Kuram Kup

Ongoing

C-Race Season 1
IPSL Winter 2025-26
BSL 21 Non-Korean Championship
CSL 2025 WINTER (S19)
KCM Race Survival 2026 Season 1
OSC Championship Season 13
SC2 All-Star Inv. 2025
Underdog Cup #3
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025

Upcoming

Escore Tournament S1: W5
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Rongyi Cup S3
Nations Cup 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 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.