• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 17:13
CEST 23:13
KST 06:13
  • 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
Maestros of the Game: Week 1/Play-in Preview9[ASL20] Ro24 Preview Pt2: Take-Off7[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature4Team Liquid Map Contest #21 - Presented by Monster Energy9
Community News
Weekly Cups (August 25-31): Clem's Last Straw?2Weekly Cups (Aug 18-24): herO dethrones MaxPax6Maestros of The Game—$20k event w/ live finals in Paris44Weekly Cups (Aug 11-17): MaxPax triples again!15Weekly Cups (Aug 4-10): MaxPax wins a triple6
StarCraft 2
General
Weekly Cups (August 25-31): Clem's Last Straw? #1: Maru - Greatest Players of All Time Maestros of the Game: Week 1/Play-in Preview Weekly Cups (Aug 11-17): MaxPax triples again! 2024/25 Off-Season Roster Moves
Tourneys
Monday Nights Weeklies LiuLi Cup - September 2025 Tournaments Maestros of The Game—$20k event w/ live finals in Paris 🏆 GTL Season 2 – StarCraft II Team League $5,100+ SEL Season 2 Championship (SC: Evo)
Strategy
Custom Maps
External Content
Mutation # 489 Bannable Offense Mutation # 488 What Goes Around Mutation # 487 Think Fast Mutation # 486 Watch the Skies
Brood War
General
ASL20 General Discussion BGH Auto Balance -> http://bghmmr.eu/ Pros React To: herO's Baffling Game Starcraft at lower levels TvP Easiest luckies way to get out of Asl groups
Tourneys
[ASL20] Ro24 Group F [IPSL] CSLAN Review and CSLPRO Reimagined! Small VOD Thread 2.0 Cosmonarchy Pro Showmatches
Strategy
Simple Questions, Simple Answers Muta micro map competition Fighting Spirit mining rates [G] Mineral Boosting
Other Games
General Games
Stormgate/Frost Giant Megathread General RTS Discussion Thread Nintendo Switch Thread Path of Exile Warcraft III: The Frozen Throne
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Canadian Politics Mega-thread Russo-Ukrainian War Thread US Politics Mega-thread YouTube Thread Things Aren’t Peaceful in Palestine
Fan Clubs
The Happy Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread High temperatures on bridge(s) Gtx660 graphics card replacement
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
hello world
radishsoup
Lemme tell you a thing o…
JoinTheRain
How Culture and Conflict Imp…
TrAiDoS
RTS Design in Hypercoven
a11
Evil Gacha Games and the…
ffswowsucks
INDEPENDIENTE LA CTM
XenOsky
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1077 users

The Big Programming Thread - Page 212

Forum Index > General Forum
Post a Reply
Prev 1 210 211 212 213 214 1031 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 States17250 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 States17250 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
France12886 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 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 2h 47m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SteadfastSC 294
Livibee 124
JuggernautJason103
ProTech34
Vindicta 32
StarCraft: Brood War
Calm 2582
Sea 2442
Shuttle 483
Larva 466
Mini 288
EffOrt 228
TY 77
sSak 76
Mong 44
Aegong 33
League of Legends
Reynor78
Counter-Strike
fl0m4749
Stewie2K356
byalli162
Super Smash Bros
PPMD107
Heroes of the Storm
Liquid`Hasu497
Other Games
tarik_tv6120
summit1g5718
Grubby2576
Mew2King67
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 22 non-featured ]
StarCraft 2
• kabyraGe 107
• musti20045 35
• davetesta33
• Kozan
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• IndyKCrew
StarCraft: Brood War
• blackmanpl 27
• iopq 8
• Pr0nogo 3
• HerbMon 3
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21432
• WagamamaTV277
League of Legends
• TFBlade860
Counter-Strike
• Shiphtur330
Other Games
• imaqtpie1430
Upcoming Events
Replay Cast
2h 47m
Sparkling Tuna Cup
12h 47m
PiGosaur Monday
1d 2h
LiuLi Cup
1d 13h
Replay Cast
2 days
The PondCast
2 days
RSL Revival
2 days
Maru vs SHIN
MaNa vs MaxPax
OSC
3 days
MaNa vs SHIN
SKillous vs ShoWTimE
Bunny vs TBD
Cham vs TBD
RSL Revival
3 days
Reynor vs Astrea
Classic vs sOs
BSL Team Wars
3 days
Team Bonyth vs Team Dewalt
[ Show More ]
CranKy Ducklings
4 days
RSL Revival
4 days
GuMiho vs Cham
ByuN vs TriGGeR
Cosmonarchy
4 days
TriGGeR vs YoungYakov
YoungYakov vs HonMonO
HonMonO vs TriGGeR
[BSL 2025] Weekly
4 days
RSL Revival
5 days
Cure vs Bunny
Creator vs Zoun
BSL Team Wars
5 days
Team Hawk vs Team Sziky
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

Acropolis #4 - TS1
SEL Season 2 Championship
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL Season 18: Qualifier 2
CSL 2025 AUTUMN (S18)
Maestros of the Game
Sisters' Call Cup
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

LASL Season 20
2025 Chongqing Offline CUP
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
RSL Revival: Season 2
EC S1
BLAST Rivals Fall 2025
Skyesports Masters 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
MESA Nomadic Masters Fall
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
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 © 2025 TLnet. All Rights Reserved.