• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 23:07
CET 05:07
KST 13:07
  • 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
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets0$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)12Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns7[BSL21] Non-Korean Championship - Starts Jan 103SC2 All-Star Invitational: Jan 17-1822
StarCraft 2
General
Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns Spontaneous hotkey change zerg Chinese SC2 server to reopen; live all-star event in Hangzhou SC2 All-Star Invitational: Jan 17-18
Tourneys
$25,000 Streamerzone StarCraft Pro Series announced $21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) WardiTV Winter Cup WardiTV Mondays SC2 AI Tournament 2026
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
Potential ASL qualifier breakthroughs? BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion StarCraft & BroodWar Campaign Speedrun Quest Data analysis on 70 million replays
Tourneys
[Megathread] Daily Proleagues [BSL21] Grand Finals - Sunday 21:00 CET [BSL21] Non-Korean Championship - Starts Jan 10 SLON Grand Finals – Season 2
Strategy
Game Theory for Starcraft Simple Questions, Simple Answers Current Meta [G] How to get started on ladder as a new Z player
Other Games
General Games
Beyond All Reason Nintendo Switch Thread Awesome Games Done Quick 2026! Mechabellum Stormgate/Frost Giant Megathread
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 Russo-Ukrainian War Thread European Politico-economics QA Mega-thread Things Aren’t Peaceful in Palestine Trading/Investing Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced
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: 1220 users

The Big Programming Thread - Page 59

Forum Index > General Forum
Post a Reply
Prev 1 57 58 59 60 61 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.
stafu
Profile Blog Joined January 2009
Australia1196 Posts
June 08 2011 15:10 GMT
#1161
File I/O can be used to store/save run-time variable and data structure states as well as to load saved files in. i.e. A hotel booking system application could write all of its data to a file on exit, and re-load that file the next time it's started.
catamorphist
Profile Joined May 2010
United States297 Posts
Last Edited: 2011-06-08 15:44:28
June 08 2011 15:43 GMT
#1162
On June 08 2011 22:45 Wala.Revolution wrote:
Usually I won't ask a simple question, but I got a final coming up so I must ask.

My teacher told the class there would be a question of what file I/O (in C) could be used for. The class was cut short because she ran out of time after explaining a few function of file I/O. From what I gathered it's a simple access read/write function. So I was going to answer ("To revise everyone's grades) or something akin to that.

Is there any special features of file I/O I should be aware of to answer the question appropriately?


You have a computer, right? And it has a filesystem, with files on it? And you are having a hard time coming up with good uses for reading and writing to files?
http://us.battle.net/sc2/en/profile/281144/1/catamorphist/
ThatGuy
Profile Blog Joined April 2008
Canada695 Posts
June 08 2011 17:12 GMT
#1163
Hi guys, more of an ethical question here: am I liable with the person/company that I design and set up a website for if their operation turns out to be illegal? Someone wants me to set up a site that could be interpreted as gambling (essentially sports betting), and if they run into any legal trouble I don't want any part of it.
Tiranimo
Profile Joined April 2011
Netherlands12 Posts
June 08 2011 19:45 GMT
#1164
On June 09 2011 02:12 ThatGuy wrote:
Hi guys, more of an ethical question here: am I liable with the person/company that I design and set up a website for if their operation turns out to be illegal? Someone wants me to set up a site that could be interpreted as gambling (essentially sports betting), and if they run into any legal trouble I don't want any part of it.


We handled this subject in my class a few weeks back. Basicly it came down to it being a 'grey area'.
You can take the project on but you run the risk of getting in trouble if the owner gets caught. If he doesn't, then you can still feel guilty for making something that is used for 'evil'. Then again, a job is a job. If it makes good money, you should go for it.
Bronze league superstar!
xHassassin
Profile Joined November 2010
United States270 Posts
June 09 2011 02:35 GMT
#1165
So I think I've gotten the Jpanel thing sorted out. Except i'm encountering another problem. How do you set the background of JPanels to transparent? Default is white and setOpaque(false) makes everything transparent
mmp
Profile Blog Joined April 2009
United States2130 Posts
June 09 2011 14:49 GMT
#1166
On June 09 2011 02:12 ThatGuy wrote:
Hi guys, more of an ethical question here: am I liable with the person/company that I design and set up a website for if their operation turns out to be illegal? Someone wants me to set up a site that could be interpreted as gambling (essentially sports betting), and if they run into any legal trouble I don't want any part of it.

If it's illegal in your county/province/country then you probably don't want to maintain or provide services. If you sell a product or service that in itself has nothing to do with the illegal operations, then you're in a nice little grey area. If you're doing auxiliary work (like artwork) that is wholly unrelated to the illegal operations then you're probably safe. If you have to ask, you probably want to pass on this gig.
I (λ (foo) (and (<3 foo) ( T_T foo) (RAGE foo) )) Starcraft
ComaDose
Profile Blog Joined December 2009
Canada10357 Posts
June 09 2011 14:54 GMT
#1167
Ugh... vba...
work is a pretty bland thing today.
just needed a place to complain.
Trying to format the mess this department has made of their "database" so i can put it in the actual sql database I made.
Excel is not my friend.
BW pros training sc2 is like kiss making a dub step album.
mmp
Profile Blog Joined April 2009
United States2130 Posts
June 09 2011 14:58 GMT
#1168
On June 09 2011 23:54 ComaDose wrote:
Ugh... vba...
work is a pretty bland thing today.
just needed a place to complain.
Trying to format the mess this department has made of their "database" so i can put it in the actual sql database I made.
Excel is not my friend.

I won't laugh, I won't laugh, I won't laugh.
+ Show Spoiler +
Still not laughing!

glhf
I (λ (foo) (and (<3 foo) ( T_T foo) (RAGE foo) )) Starcraft
ComaDose
Profile Blog Joined December 2009
Canada10357 Posts
June 09 2011 19:02 GMT
#1169
gee thx.

just to give you something else to not laugh about
this+ Show Spoiler +
Component: Resistor, Fixed|Class: Military|Type: Carbon Comp|Features: Color Band|Package: Axial|Value: 5.6K Ohm|Tolerance: 5%|Power: 0.25 Watts @ 70 Deg. C
and this+ Show Spoiler +
RESISTOR, C.C., 33 OHM, 1/2 W, 5%
are both supposed to be the "long description" column.... how have they functioned without me i wonder
BW pros training sc2 is like kiss making a dub step album.
AkaHenchway
Profile Joined October 2010
United States41 Posts
Last Edited: 2011-06-12 08:00:05
June 12 2011 07:26 GMT
#1170
I am about 2 weeks into my java programming class and I am having trouble figuring out what is wrong with the program I am writing, its a conversion from Celsius to Farenheit.
+ Show Spoiler +
import java.util.Scanner;

public class CelsiusToFahrenheit {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter Degree in Celsius:");
double Celsius = input.nextDouble();
double Fahrenheit = (9/5)* Celsius + 32;
System.out.println("Degree in Celsius " + Celsius +"is" + (9/5) * Celsius + 32 + "Degrees Fahrenheit");
}
}

For this I keep getting an error that says "CelsiustoFahrenheit.java:7: class CelsiusToFahrenheit is public, should be declared in a file named CelsiusToFahrenheit.java
public class CelsiusToFahrenheit {
^
This is beginning java so I am pretty much clueless as to what I have done wrong here....

2nd Error that I was getting before the previous error started was
+ Show Spoiler +
Exception in thread"main"java.lang.noclassdeffounderror: Celsius/java
Caused by: java.lang.classnotfoundexception: Celsius.java
at java.net.URLClassloader$1.run(URLClassloader.java:202>
Keeps listing several java.net/security lines after this .

ONLY NEED HELP ON 2nd ERROR NOW
Fuck the Bullshit
teamamerica
Profile Blog Joined July 2010
United States958 Posts
June 12 2011 08:04 GMT
#1171
Because you made the class public you need to have the file the class is in to have the same name. I.e your class needs to be in a file called CelsiusToFarenheit. Your class has a lower case "t" in "to". Btw in general naming convention has your variable names start with lower case
So Celsius and Farenheit should be celsius and farenheit.
RIP GOMTV. RIP PROLEAGUE.
MasterOfChaos
Profile Blog Joined April 2007
Germany2896 Posts
June 12 2011 08:13 GMT
#1172
Your math is wrong too. If you divide two integers it performs integer division, which cuts of the fractional part. So (9/5)==1. Use (9.0/5.0) or just 1.8 instead.
LiquipediaOne eye to kill. Two eyes to live.
AkaHenchway
Profile Joined October 2010
United States41 Posts
June 12 2011 08:41 GMT
#1173
Thanks guys I figured it out right after I posted so just need help on the second error now which I dont get when I compile, but get it when I try to run it out of cmd.
Fuck the Bullshit
One Student
Profile Joined April 2011
73 Posts
June 12 2011 09:53 GMT
#1174
On June 12 2011 17:41 AkaHenchway wrote:
Thanks guys I figured it out right after I posted so just need help on the second error now which I dont get when I compile, but get it when I try to run it out of cmd.


Can you tell us which editor program you are using to write and compile the code. I think the problem is with setting up the classpath to the JDK profile in the editor.
Depression is what you get for leading a repetitive life.
Mahs
Profile Blog Joined July 2010
Netherlands171 Posts
June 12 2011 11:21 GMT
#1175
@AkaHenchway

Your code runs fine for me, so the issue isn't in the code. With a few slight adjustments in it, it does exactly what you want from it:
+ Show Spoiler +

import java.util.Scanner;

public class CelsiusToFahrenheit {
      public static void main(String[] args) {
            Scanner input = new Scanner(System.in);
            System.out.print("Enter Degree in Celsius: ");
            double celsius = input.nextDouble();
            double fahrenheit = (9.0 / 5.0) * celsius + 32;
            System.out.println("Degrees in Celsius: " + celsius + "\nDegrees in Fahrenheit: " + fahrenheit);
      }
}


As for the error - it looks a bit awkward to me. Java is looking for a class called Celsius, which isn't called anywhere in the code. What is the filename that contains the above code? A file with the above code should be called CelsiusToFahrenheit.java. If you've named the file Celsius.java, you have to either change the filename, or change "public class CelsiusToFahrenheit" to "public class Celsius" within the code to match the filename.
I'll be in my bunk.
Pe[N]guiN
Profile Joined August 2010
Canada48 Posts
Last Edited: 2011-06-12 23:04:39
June 12 2011 23:00 GMT
#1176
I'm using binary search to insert into an already sorted array, but I made a mistake somewhere in my code... I have been staring at it for a while, if anyone could give me a hand I would appreciate it.
c++:
+ Show Spoiler +

virtual bisearch_simple_set& operator+=(T item){
if(cur_size == 0){
biSet[0] = item;
cur_size++;
return *this;
}
if(cur_size < max_size){
last = cur_size-1;
first = 0;
mid = (first + last) / 2;
while(first <= last){
if (item > biSet[mid])
first = mid + 1;
else if(item < biSet[mid])
last = mid - 1;
else{
for(int i = cur_size; i > mid; i--){
biSet[i] = biSet[i-1];
}
biSet[mid] = item;
cur_size++;
return *this;
}
mid = (first + last) / 2;
}
if(first == cur_size){
biSet[cur_size] = item;
cur_size++;
return *this;
}

else{
for(int i = cur_size; i > mid; i--){
biSet[i] = biSet[i-1];
}
biSet[mid] = item;
cur_size++;
return *this;
}
}
else
cout << "There is no space for addition!" << endl;
return *this;
}






edit: it's not a syntax error, i'm just getting a strange result when I have an array.. for instance with [18, 34, 45] and I add in 27, it gives me [27, 18, 34, 45].
Giant Balls of Karune
HowitZer
Profile Joined February 2003
United States1610 Posts
June 12 2011 23:32 GMT
#1177
On June 08 2011 22:45 Wala.Revolution wrote:
Usually I won't ask a simple question, but I got a final coming up so I must ask.

My teacher told the class there would be a question of what file I/O (in C) could be used for. The class was cut short because she ran out of time after explaining a few function of file I/O. From what I gathered it's a simple access read/write function. So I was going to answer ("To revise everyone's grades) or something akin to that.

Is there any special features of file I/O I should be aware of to answer the question appropriately?


For maintaining a user preference file. When a user sets a global environment option the file gets written to with the name and value of the preference. When the application starts, it loads the file to get the preferences so the application returns to the state the user wants.
Human teleportation, molecular decimation, breakdown and reformation is inherently purging. It makes a man acute.
Manit0u
Profile Blog Joined August 2004
Poland17595 Posts
Last Edited: 2011-06-13 02:14:51
June 13 2011 02:02 GMT
#1178
On June 13 2011 08:00 Pe[N]guiN wrote:
I'm using binary search to insert into an already sorted array, but I made a mistake somewhere in my code... I have been staring at it for a while, if anyone could give me a hand I would appreciate it.
c++:
+ Show Spoiler +


virtual bisearch_simple_set& operator+=(T item)
{
if(cur_size == 0)
{
biSet[0] = item;
cur_size++;

return *this;
}

if(cur_size < max_size)
{
last = cur_size - 1;
first = 0;
mid = (first + last) / 2;

while(first <= last)
{
if (item > biSet[mid]
{
first = mid + 1;
}
else if(item < biSet[mid]
{
last = mid - 1;
}
else
{
for(int i = cur_size; i > mid; i--)
{
biSet[i] = biSet[i-1];
}

biSet[mid] = item;
cur_size++;

return *this;
}

mid = (first + last) / 2;
}

if(first == cur_size)
{
biSet[cur_size] = item;
cur_size++;

return *this;
}
else
{
for(int i = cur_size; i > mid; i--)
{
biSet[i] = biSet[i-1];
}

biSet[mid] = item;
cur_size++;

return *this;
}
}
else
{
cout << "There is no space for addition!" << endl;

return *this;
}
}




Using the 'code' environment here can help others analyze your code easier. Just take a look how does it look in the spoiler I quoted (I've also changed your formatting a bit, you didn't have enough curly braces in my opinion, and things were piled up a bit too much.
Still, I can't really help you here as I'm not really sure what this code is supposed to do (and I'm just starting C++, don't know yet how much different it is from C).
Your code seems to be missing some parts too... WTF is *this? There's no declaration or definition of it anywhere in the code you posted. Also, can you really have an array with [0] size? If you want it empty you could just set its value to NULL or something. And another thing, you're assigning values to first, last, mid and other variables, but in no place in this code is their type mentioned...

Edit: Why the hell are there smileys displayed in code environment? Does spoiler suppress it or something?
Time is precious. Waste it wisely.
fiskrens
Profile Joined June 2010
Sweden196 Posts
Last Edited: 2011-06-13 02:50:59
June 13 2011 02:49 GMT
#1179
On June 13 2011 11:02 Manit0u wrote:
Your code seems to be missing some parts too... WTF is *this? There's no declaration or definition of it anywhere in the code you posted. Also, can you really have an array with [0] size? If you want it empty you could just set its value to NULL or something.


The *this pointer is just returning the current object from the function. How do you know he's using an array with 0 size? He's just assigning values to the index which is 0 in the array.

EDIT: You can have an array with 0 size too, forgot to mention that.


Manit0u
Profile Blog Joined August 2004
Poland17595 Posts
Last Edited: 2011-06-13 14:05:31
June 13 2011 14:03 GMT
#1180
On June 13 2011 11:49 fiskrens wrote:
Show nested quote +
On June 13 2011 11:02 Manit0u wrote:
Your code seems to be missing some parts too... WTF is *this? There's no declaration or definition of it anywhere in the code you posted. Also, can you really have an array with [0] size? If you want it empty you could just set its value to NULL or something.


The *this pointer is just returning the current object from the function. How do you know he's using an array with 0 size? He's just assigning values to the index which is 0 in the array.

EDIT: You can have an array with 0 size too, forgot to mention that.




Oh, ok. I was dealing with some chars lately so my brain automatically assumed that something[0] was a 0-length char haha.

EDIT: Also, that's why he should at least put the variable types in there. This code can be pretty ambiguous without them.
Time is precious. Waste it wisely.
Prev 1 57 58 59 60 61 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 7h 53m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
White-Ra 356
RuFF_SC2 248
WinterStarcraft242
StarCraft: Brood War
Shuttle 107
ZergMaN 75
GoRush 38
Noble 16
Icarus 7
Dota 2
NeuroSwarm139
LuMiX1
League of Legends
JimRising 798
C9.Mang0588
Counter-Strike
summit1g7850
m0e_tv373
minikerr20
Super Smash Bros
hungrybox686
Mew2King20
Other Games
tarik_tv6126
Sick239
Maynarde155
Livibee37
ZombieGrub36
Liquid`Ken8
Models1
Organizations
Other Games
gamesdonequick2948
StarCraft: Brood War
UltimateBattle 102
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Azhi_Dahaki29
• RayReign 23
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota22249
League of Legends
• Rush553
• Lourlo517
Upcoming Events
WardiTV Invitational
7h 53m
PiGosaur Cup
20h 53m
WardiTV Invitational
1d 7h
The PondCast
2 days
OSC
2 days
OSC
3 days
All Star Teams
3 days
INnoVation vs soO
sOs vs Scarlett
uThermal 2v2 Circuit
4 days
All Star Teams
4 days
MMA vs DongRaeGu
Rogue vs Oliveira
Sparkling Tuna Cup
5 days
[ Show More ]
OSC
5 days
Replay Cast
6 days
Wardi Open
6 days
Liquipedia Results

Completed

Proleague 2026-01-12
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)
OSC Championship Season 13
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
PGL Masters Bucharest 2025

Upcoming

Escore Tournament S1: W4
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Rongyi Cup S3
Thunderfire SC2 All-star 2025
Nations Cup 2026
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.