• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:51
CEST 06:51
KST 13:51
  • 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
TL.net Map Contest #21: Voting7[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5
Community News
Weekly Cups (Oct 6-12): Four star herO65.0.15 Patch Balance Hotfix (2025-10-8)79Weekly Cups (Sept 29-Oct 5): MaxPax triples up3PartinG joins SteamerZone, returns to SC2 competition325.0.15 Balance Patch Notes (Live version)119
StarCraft 2
General
Revisiting the game after10 years and wow it's bad 5.0.15 Patch Balance Hotfix (2025-10-8) TL.net Map Contest #21: Voting How to Block Australia, Brazil, Singapore Servers The New Patch Killed Mech!
Tourneys
RSL Offline Finals Dates + Ticket Sales! SC4ALL $6,000 Open LAN in Philadelphia Crank Gathers Season 2: SC II Pro Teams LiuLi Cup - September 2025 Tournaments Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
External Content
Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers Mutation # 492 Get Out More
Brood War
General
[Interview] Grrrr... 2024 Question regarding recent ASL Bisu vs Larva game BW General Discussion BW caster Sayle Map with fog of war removed for one player?
Tourneys
[ASL20] Semifinal B [Megathread] Daily Proleagues [ASL20] Semifinal A SC4ALL $1,500 Open Bracket LAN
Strategy
Current Meta Relatively freeroll strategies BW - ajfirecracker Strategy & Training Siegecraft - a new perspective
Other Games
General Games
Stormgate/Frost Giant Megathread Dawn of War IV Nintendo Switch Thread ZeroSpace Megathread Path of Exile
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
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
SPIRED by.ASL Mafia {211640} TL Mafia Community Thread
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine Men's Fashion Thread Sex and weight loss
Fan Clubs
The herO Fan Club! The Happy Fan Club!
Media & Entertainment
[Manga] One Piece Series you have seen recently... Anime Discussion Thread Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Inbreeding: Why Do We Do It…
Peanutsc
From Tilt to Ragequit:The Ps…
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1460 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 States17254 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 States17254 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
France12904 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 6h 9m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nathanias 160
Nina 121
StarCraft: Brood War
PianO 273
Bale 41
Noble 15
Icarus 5
NotJumperer 2
League of Legends
JimRising 743
Counter-Strike
Stewie2K516
Coldzera 283
PGG 195
Other Games
summit1g8943
gofns3678
C9.Mang0410
RuFF_SC296
Mew2King70
Models5
Organizations
Other Games
gamesdonequick2690
Counter-Strike
PGL1067
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH182
• practicex 27
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Diggity4
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush1487
Upcoming Events
Wardi Open
6h 9m
CranKy Ducklings
1d 5h
Safe House 2
1d 12h
Sparkling Tuna Cup
2 days
Safe House 2
2 days
Tenacious Turtle Tussle
5 days
The PondCast
6 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
EC S1
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
CranK Gathers Season 2: SC II Pro Teams
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 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.