• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 13:15
CET 19:15
KST 03:15
  • 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
[TLMC] Fall/Winter 2025 Ladder Map Rotation12Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA8StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7
StarCraft 2
General
Mech is the composition that needs teleportation t RotterdaM "Serral is the GOAT, and it's not close" RSL Season 3 - RO16 Groups C & D Preview [TLMC] Fall/Winter 2025 Ladder Map Rotation TL.net Map Contest #21: Winners
Tourneys
RSL Revival: Season 3 Sparkling Tuna Cup - Weekly Open Tournament Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle What happened to TvZ on Retro? SnOw's ASL S20 Finals Review BW General Discussion Brood War web app to calculate unit interactions
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] RO32 Group D - Sunday 21:00 CET [BSL21] RO32 Group C - Saturday 21:00 CET
Strategy
PvZ map balance Current Meta Simple Questions, Simple Answers How to stay on top of macro?
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread Clair Obscur - Expedition 33 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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread US Politics Mega-thread Artificial Intelligence Thread Canadian Politics Mega-thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread Korean Music Discussion Series you have seen recently...
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
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
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: 2038 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
Poland17433 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
Poland17433 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
IPSL
17:00
Ro16 Group D
ZZZero vs rasowy
Napoleon vs KameZerg
Liquipedia
PSISTORM Gaming Misc
15:55
FSL teamleague CNvsASH, ASHvRR
Freeedom38
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Railgan 184
IndyStarCraft 110
BRAT_OK 47
MindelVK 29
EmSc Tv 13
StarCraft: Brood War
Britney 25290
Calm 2532
Shuttle 775
Stork 341
firebathero 288
Dewaltoss 113
Barracks 68
Mong 61
Rock 43
Shine 18
Dota 2
Gorgc5830
qojqva1713
Dendi963
Counter-Strike
ScreaM1084
byalli378
Heroes of the Storm
Khaldor535
Liquid`Hasu237
Other Games
Beastyqt573
DeMusliM291
Hui .222
Fuzer 215
Lowko213
Trikslyr46
CadenZie18
Organizations
Dota 2
PGL Dota 2 - Main Stream8971
Other Games
EGCTV625
gamesdonequick359
StarCraft 2
angryscii 24
EmSc Tv 13
EmSc2Tv 13
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 22 non-featured ]
StarCraft 2
• HappyZerGling 71
• HeavenSC 61
• printf 5
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• Migwel
• intothetv
• Kozan
• IndyKCrew
StarCraft: Brood War
• Airneanach42
• HerbMon 6
• Michael_bg 3
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 2455
• WagamamaTV359
• Ler79
League of Legends
• Nemesis2825
Other Games
• imaqtpie1125
• Shiphtur313
Upcoming Events
OSC
45m
davetesta15
BSL 21
1h 45m
Tarson vs Julia
Doodle vs OldBoy
eOnzErG vs WolFix
StRyKeR vs Aeternum
Sparkling Tuna Cup
15h 45m
RSL Revival
15h 45m
Reynor vs sOs
Maru vs Ryung
Kung Fu Cup
17h 45m
Cure vs herO
Reynor vs TBD
WardiTV Korean Royale
17h 45m
BSL 21
1d 1h
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
IPSL
1d 1h
Dewalt vs WolFix
eOnzErG vs Bonyth
Replay Cast
1d 4h
Wardi Open
1d 17h
[ Show More ]
Monday Night Weeklies
1d 22h
WardiTV Korean Royale
2 days
BSL: GosuLeague
3 days
The PondCast
3 days
Replay Cast
4 days
RSL Revival
4 days
BSL: GosuLeague
5 days
RSL Revival
5 days
WardiTV Korean Royale
5 days
RSL Revival
6 days
WardiTV Korean Royale
6 days
IPSL
6 days
Julia vs Artosis
JDConan vs DragOn
Liquipedia Results

Completed

Proleague 2025-11-14
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.