• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 15:17
CEST 21:17
KST 04:17
  • 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
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL56Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event19Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
Statistics for vetoed/disliked maps The SCII GOAT: A statistical Evaluation Weekly Cups (June 23-29): Reynor in world title form? PiG Sty Festival #5: Playoffs Preview + Groups Recap The GOAT ranking of GOAT rankings
Tourneys
FEL Cracov 2025 (July 27) - $8000 live event RSL: Revival, a new crowdfunded tournament series Korean Starcraft League Week 77 Master Swan Open (Global Bronze-Master 2) [GSL 2025] Code S: Season 2 - Semi Finals & Finals
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
Flash Announces Hiatus From ASL Player “Jedi” cheat on CSL Replays question BW General Discussion BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[Megathread] Daily Proleagues [BSL20] Grand Finals - Sunday 20:00 CET Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile What do you want from future RTS games? Beyond All Reason
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
Russo-Ukrainian War Thread US Politics Mega-thread Trading/Investing Thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 628 users

The Big Programming Thread - Page 59

Forum Index > General Forum
Post a Reply
Prev 1 57 58 59 60 61 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.
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
Poland17243 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
Poland17243 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 1031 Next
Please log in or register to reply.
Live Events Refresh
FEL
16:00
Cracov 2025: Qualifier #1
RotterdaM825
IndyStarCraft 271
CranKy Ducklings212
Liquipedia
PSISTORM Gaming Misc
15:55
FSL team league: ASP vs PTB
Freeedom10
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 825
IndyStarCraft 271
JuggernautJason88
ProTech56
StarCraft: Brood War
Calm 4543
firebathero 306
JulyZerg 135
BRAT_OK 104
Rock 41
LancerX 14
Stormgate
Nathanias52
Dota 2
monkeys_forever201
LuMiX1
League of Legends
Grubby2589
Dendi1386
Counter-Strike
fl0m1952
Super Smash Bros
Westballz42
Heroes of the Storm
Khaldor323
Liquid`Hasu281
Other Games
FrodaN1400
Mlord591
KnowMe128
Sick44
Trikslyr44
Organizations
Other Games
EGCTV1407
StarCraft 2
angryscii 17
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 23 non-featured ]
StarCraft 2
• Berry_CruncH81
• printf 61
• tFFMrPink 25
• iHatsuTV 10
• OhrlRock 4
• Migwel
• sooper7s
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• Pr0nogo 2
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota2916
• WagamamaTV670
• Ler98
League of Legends
• Jankos1845
• Doublelift1692
Other Games
• imaqtpie949
• Shiphtur405
Upcoming Events
RSL Revival
14h 43m
Clem vs Classic
SHIN vs Cure
FEL
16h 43m
WardiTV European League
16h 43m
BSL: ProLeague
22h 43m
Dewalt vs Bonyth
Replay Cast
2 days
Sparkling Tuna Cup
2 days
WardiTV European League
2 days
The PondCast
3 days
Replay Cast
4 days
RSL Revival
4 days
[ Show More ]
Replay Cast
5 days
RSL Revival
5 days
FEL
5 days
RSL Revival
6 days
FEL
6 days
FEL
6 days
Liquipedia Results

Completed

BSL 2v2 Season 3
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
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
IEM Cologne 2025
FISSURE Playground #1
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.