• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:15
CEST 06:15
KST 13:15
  • 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
[ASL21] Ro24 Preview Pt2: News Flash9[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy16ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book20
Community News
Weekly Cups (March 23-29): herO takes triple6Aligulac acquired by REPLAYMAN.com/Stego Research8Weekly Cups (March 16-22): herO doubles, Cure surprises3Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool51Weekly Cups (March 9-15): herO, Clem, ByuN win4
StarCraft 2
General
Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool What mix of new & old maps do you want in the next ladder pool? (SC2) Team Liquid Map Contest #22 - Presented by Monster Energy Aligulac acquired by REPLAYMAN.com/Stego Research Weekly Cups (March 23-29): herO takes triple
Tourneys
RSL Season 4 announced for March-April Sparkling Tuna Cup - Weekly Open Tournament StarCraft Evolution League (SC Evo Biweekly) WardiTV Mondays World University TeamLeague (500$+) | Signups Open
Strategy
Custom Maps
[M] (2) Frigid Storage Publishing has been re-enabled! [Feb 24th 2026]
External Content
Mutation # 519 Inner Power The PondCast: SC2 News & Results Mutation # 518 Radiation Zone Mutation # 517 Distant Threat
Brood War
General
Gypsy to Korea Pros React To: JaeDong vs Queen BGH Auto Balance -> http://bghmmr.eu/ How Can I Add Timer & APM Count? [ASL21] Ro24 Preview Pt2: News Flash
Tourneys
[Megathread] Daily Proleagues [ASL21] Ro24 Group E [ASL21] Ro24 Group F Azhi's Colosseum - Foreign KCM
Strategy
Fighting Spirit mining rates What's the deal with APM & what's its true value Simple Questions, Simple Answers
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Starcraft Tabletop Miniature Game General RTS Discussion Thread Darkest Dungeon
Dota 2
The Story of Wings Gaming Official 'what is Dota anymore' discussion
League of Legends
G2 just beat GenG in First stand
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
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread NASA and the Private Sector Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion Cricket [SPORT] Tokyo Olympics 2021 Thread General nutrition recommendations
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Funny Nicknames
LUCKY_NOOB
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2259 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 States17281 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 States17281 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
France12911 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 2h 46m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft514
RuFF_SC2 271
SpeCial 68
StarCraft: Brood War
Sea 7296
Shuttle 467
ggaemo 111
JulyZerg 53
GoRush 18
sSak 18
Icarus 7
Dota 2
NeuroSwarm153
LuMiX1
League of Legends
JimRising 755
Other Games
summit1g12053
ViBE106
Organizations
Other Games
gamesdonequick1078
BasetradeTV88
StarCraft: Brood War
UltimateBattle 45
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Hupsaiya 63
• practicex 18
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Stunt295
Other Games
• Scarra2136
Upcoming Events
RSL Revival
2h 46m
Cure vs Rogue
Maru vs TBD
MaxPax vs TBD
uThermal 2v2 Circuit
9h 46m
BSL
14h 46m
Afreeca Starleague
1d 5h
Wardi Open
1d 5h
Replay Cast
1d 19h
Sparkling Tuna Cup
2 days
Kung Fu Cup
3 days
The PondCast
4 days
Replay Cast
4 days
[ Show More ]
Replay Cast
5 days
CranKy Ducklings
6 days
BSL
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Escore Tournament S2: W1
WardiTV Winter 2026
NationLESS Cup

Ongoing

BSL Season 22
CSL Elite League 2026
ASL Season 21
CSL Season 20: Qualifier 2
StarCraft2 Community Team League 2026 Spring
RSL Revival: Season 4
Nations Cup 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026

Upcoming

CSL 2026 SPRING (S20)
IPSL Spring 2026
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
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
CCT Season 3 Global Finals
IEM Rio 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.