• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 02:47
CET 08:47
KST 16:47
  • 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 Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13
Community News
RSL Season 3: RO16 results & RO8 bracket0Weekly Cups (Nov 10-16): Reynor, Solar lead Zerg surge1[TLMC] Fall/Winter 2025 Ladder Map Rotation14Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA9
StarCraft 2
General
GM / Master map hacker and general hacking and cheating thread RSL Season 3: RO16 results & RO8 bracket Mech is the composition that needs teleportation t SC: Evo Complete - Ranked Ladder OPEN ALPHA RotterdaM "Serral is the GOAT, and it's not close"
Tourneys
Constellation Cup - Main Event - Stellar Fest 2025 RSL Offline Finals Dates + Ticket Sales! $5,000+ WardiTV 2025 Championship RSL Revival: Season 3 Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 500 Fright night Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle What happened to TvZ on Retro? BGH Auto Balance -> http://bghmmr.eu/ SnOw's ASL S20 Finals Review BW General Discussion
Tourneys
[BSL21] GosuLeague T1 Ro16 - Tue & Thu 22:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] RO32 Group D - Sunday 21:00 CET
Strategy
Current Meta How to stay on top of macro? PvZ map balance Simple Questions, Simple Answers
Other Games
General Games
Clair Obscur - Expedition 33 Beyond All Reason Stormgate/Frost Giant Megathread Should offensive tower rushing be viable in RTS games? Path of Exile
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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI About SC2SEA.COM
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread Korean Music Discussion
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
Dyadica Gospel – a Pulp No…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2321 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
Poland17440 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
Poland17440 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 2h 13m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech127
SortOf 114
Trikslyr31
StarCraft: Brood War
Sea 3931
Free 553
BeSt 385
Zeus 241
Killer 237
EffOrt 138
Sharp 44
Shinee 27
NotJumperer 19
Hm[arnc] 11
Dota 2
monkeys_forever690
League of Legends
JimRising 557
Reynor97
Counter-Strike
Coldzera 1454
Other Games
summit1g11921
C9.Mang0208
Happy92
Fuzer 41
rGuardiaN36
Dewaltoss15
Organizations
Dota 2
PGL Dota 2 - Main Stream1180
Other Games
gamesdonequick602
StarCraft: Brood War
UltimateBattle 106
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• Berry_CruncH59
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush1878
Upcoming Events
The PondCast
2h 13m
Replay Cast
15h 13m
RSL Revival
23h 43m
herO vs Zoun
Classic vs Reynor
Maru vs SHIN
MaxPax vs TriGGeR
BSL: GosuLeague
1d 13h
RSL Revival
1d 23h
WardiTV Korean Royale
2 days
RSL Revival
2 days
WardiTV Korean Royale
3 days
IPSL
3 days
Julia vs Artosis
JDConan vs DragOn
RSL Revival
3 days
[ Show More ]
Wardi Open
4 days
IPSL
4 days
StRyKeR vs OldBoy
Sziky vs Tarson
Replay Cast
4 days
Monday Night Weeklies
5 days
Replay Cast
5 days
Wardi Open
6 days
Liquipedia Results

Completed

Proleague 2025-11-16
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
SLON Tour Season 2
RSL Revival: Season 3
META Madness #9
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 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.