• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 15:52
CET 20:52
KST 04:52
  • 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
ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8
Community News
BGE Stara Zagora 2026 cancelled7Blizzard Classic Cup - Tastosis announced as captains12Weekly Cups (March 2-8): ByuN overcomes PvT block4GSL CK - New online series18BSL Season 224
StarCraft 2
General
BGE Stara Zagora 2026 cancelled BGE Stara Zagora 2026 announced ByuL: The Forgotten Master of ZvT Terran AddOns placement Blizzard Classic Cup - Tastosis announced as captains
Tourneys
StarCraft Evolution League (SC Evo Biweekly) https://www.facebook.com/BubaSocks.Official/ [GSL CK] Team Maru vs. Team herO WardiTV Team League Season 10 Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026] Map Editor closed ?
External Content
The PondCast: SC2 News & Results Mutation # 516 Specter of Death Mutation # 515 Together Forever Mutation # 514 Ulnar New Year
Brood War
General
ASL21 General Discussion BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion Gypsy to Korea Are you ready for ASL 21? Hype VIDEO
Tourneys
[Megathread] Daily Proleagues [BSL22] Open Qualifiers & Ladder Tours IPSL Spring 2026 is here! ASL Season 21 Qualifiers March 7-8
Strategy
Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2 Fighting Spirit mining rates Zealot bombing is no longer popular?
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread PC Games Sales Thread No Man's Sky (PS4 and PC)
Dota 2
Official 'what is Dota anymore' discussion The Story of Wings Gaming
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
Five o'clock TL Mafia Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Mexico's Drug War NASA and the Private Sector
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Movie Discussion! [Req][Books] Good Fantasy/SciFi books [Manga] One Piece
Sports
Formula 1 Discussion 2024 - 2026 Football Thread General nutrition recommendations Cricket [SPORT] TL MMA Pick'em Pool 2013
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
Gaming-Related Deaths
TrAiDoS
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2550 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
Poland17692 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
Poland17692 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 4h 8m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 686
IndyStarCraft 107
ProTech107
JuggernautJason78
RushiSC 17
StarCraft: Brood War
sSak 60
scan(afreeca) 51
Dota 2
Gorgc4875
canceldota62
Counter-Strike
fl0m3288
byalli834
Heroes of the Storm
Liquid`Hasu264
Khaldor163
Other Games
gofns46544
tarik_tv16545
Grubby2888
FrodaN2144
summit1g1426
Beastyqt638
B2W.Neo519
KnowMe465
DeMusliM169
C9.Mang0131
Livibee59
Organizations
Dota 2
PGL Dota 2 - Main Stream13987
Other Games
gamesdonequick1755
ComeBackTV 271
BasetradeTV76
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• StrangeGG 48
• Kozan
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• IndyKCrew
StarCraft: Brood War
• blackmanpl 42
• RayReign 8
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• lizZardDota255
League of Legends
• Doublelift1648
• TFBlade1408
Other Games
• imaqtpie1139
• Shiphtur178
Upcoming Events
Replay Cast
4h 8m
CranKy Ducklings
14h 8m
RSL Revival
14h 8m
MaxPax vs Rogue
Clem vs Bunny
WardiTV Team League
16h 8m
uThermal 2v2 Circuit
21h 8m
BSL
1d
Sparkling Tuna Cup
1d 14h
RSL Revival
1d 14h
ByuN vs SHIN
Maru vs Krystianer
WardiTV Team League
1d 16h
Patches Events
1d 21h
[ Show More ]
BSL
2 days
Replay Cast
2 days
Replay Cast
2 days
Wardi Open
2 days
Monday Night Weeklies
2 days
WardiTV Team League
3 days
GSL
4 days
The PondCast
5 days
WardiTV Team League
5 days
Replay Cast
6 days
WardiTV Team League
6 days
Liquipedia Results

Completed

Proleague 2026-03-12
WardiTV Winter 2026
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Jeongseon Sooper Cup
BSL Season 22
Proleague 2026-03-13
RSL Revival: Season 4
Nations Cup 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
BLAST Bounty Winter Qual

Upcoming

CSL Elite League 2026
ASL Season 21
Acropolis #4 - TS6
2026 Changsha Offline CUP
Acropolis #4
IPSL Spring 2026
CSLAN 4
HSC XXIX
uThermal 2v2 2026 Main Event
NationLESS Cup
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
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 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.