• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 22:02
CEST 04:02
KST 11:02
  • 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
[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 244ByuL, and the Limitations of Standard Play3
Community News
Official StarCraft website teases new content ahead of BlizzCon?16Stellar Fest TWO the Moon (Dec 16-20)8Weekly Cups (August 24-30): Patches' balance mod takes over2New 3v3 BGH Ladder (and more) on ShieldBattery!40Weekly Cups (August 17-23): Zerg dominate the week6
StarCraft 2
General
Nexon wins bid to develop StarCraft IP content, distribute Overwatch mobile game SC4ALL: II Winner Will Earn a Spot at HSC 30! Balance hotfix patch 5.0.16b (July 16) September World Ranking: herO leads, Serral climbs Weekly Cups (August 10-16): SHIN doubles
Tourneys
IntoTheTV X SOOP SC2 League : Weekly & Monthly SC2 INu's Battles#20 [BO.9] 2026 GSTL Announcement Stellar Fest TWO the Moon (Dec 16-20) PIG STY FESTIVAL 8.0! (13 - 23 August)
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
Mutation # 541 Binary Choice The PondCast: SC2 News & Results Mutation # 540 Dodge This Mutation # 539 Thunder Dome
Brood War
General
Official StarCraft website teases new content ahead of BlizzCon? ASL22 General Discussion [Personal Project Share] Terran Defense v0.60 BW General Discussion BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[Megathread] Daily Proleagues KCM Race Survival 2026 Season 3 BSL LAN Party - Kraków 29-30 August - OPEN SIGNUPS [ASL22] Ro24 Group F
Strategy
Replay Review Process - What do you do? Game Theory for Starcraft Odyssey Mineral Stack Saturation Fighting Spirit mining rates
Other Games
General Games
Diablo IV EVE Corporation Nintendo Switch Thread [Maplestory Hardcore] Let's Play~!! General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank TL Mafia Community Thread NeO.D_StephenKing vs This Guy From 1 Million Dance
Community
General
Canadian Politics Mega-thread US Politics Mega-thread UK Politics Mega-thread Things Aren’t Peaceful in Palestine Artificial Intelligence Thread
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
Movie Discussion! Anime Discussion Thread
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023 NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Regacy Esports: The Bh…
regacyesports
Violent Games and Crime Rate…
TrAiDoS
LOCKPICKING NOOB
LUCKY_NOOB
Cathedral Of CS And NY pizza a…
FuDDx
Please support my new stand…
Peanutsc
Customize Sidebar...

Website Feedback

Closed Threads



Active: 8648 users

The Big Programming Thread - Page 402

Forum Index > General Forum
Post a Reply
Prev 1 400 401 402 403 404 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.
SpiZe
Profile Joined December 2010
Canada3640 Posts
November 29 2013 16:45 GMT
#8021
Hi people,

For a school assignment, I have to create a Client/Server application in Java that uses sockets to communicate. All communications have to be in XML format. Now, the difficulty of the assignment is that we have never done Client/Server programing in Java up until now, so I'm kinda lost. I managed to set up pretty much everything except for the XML communication and I'm lost. I use the JDOM library to create a small XML document in my server, and I attempt to send it through a stream to the client. Now thing is, I'm not sure what I need to send. I have a Document object that I guess that I could send, but it's not really XML, it's an object so it can't be read by a say, a python client does it ? Do I actually have to create a file, send the file, delete the file just to send my xml to the client ? Can anyone give me a hint I'm really lost here. Would it be easier in another library ?
DeltaX
Profile Joined August 2011
United States287 Posts
November 29 2013 17:27 GMT
#8022
Think of XML as a format for text. HTML is actually a specific subset of XML if you think about it and that is always just sent as text. When you want to send it to a client, you can turn it into a string and send that. Then the client can look at the string and either recreate the document object or just process the string depending on if the client is another server or something like a javascript ajax call.
Manit0u
Profile Blog Joined August 2004
Poland17838 Posts
Last Edited: 2013-11-29 22:45:23
November 29 2013 22:44 GMT
#8023
On November 25 2013 05:14 3FFA wrote:
Another thing I would like to know is what exactly are the differences between the various C's? Is there specific purposes/situations each is better for?


I think this wasn't explained well enough earlier on since everyone just started talking about what they program in and even I posted a video that only explained how different platforms utilise various C-family languages.

I think it's a valid question that many people ask themselves and I can start explaining it for posteriority here. Since I'm not familiar with all of C's offspring I'll only cover what I know.

Basically, the main difference here will be the level of abstraction and what libraries those languages use for the most part.

Abstraction-wise it's more or less like that:

C < C++ < C#

This means that you will have to put in more work into accomplishing the same thing when using language that has lower abstraction level. It has both its drawbacks and benefits. While you can do something really easy in C# it won't give you the level of control and optimization that C++ offers (and I won't even mention C with manual memory management) as it's closer to the inner-workings of a system and hardware.

Let's take a closer look at the differences between C++ and C# now (since C is too far removed from this layer of abstraction to really talk about it in the same way). On the Windows platform they can both be used for the same things for the most part but C# with higher abstraction is easier to do stuff using .NET libraries. C++ on the other hand is king when it comes to developing using the DirectX and has much greater support for Win32 and COM API stuff than C#.

The choice of preferred language is up to the person using it and what you want to do with it. If you want to build huge databases and an application that spends more time "thinking" than "doing" then you might want to consider F#, if you want to create a simple Metro app then why not use HTML5/CSS/JS?

Perhaps others can add their 2 cents regarding other C offspring (Java, Objective C, JavaScript).
Time is precious. Waste it wisely.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2013-11-30 09:06:15
November 30 2013 08:54 GMT
#8024
On November 30 2013 01:45 SpiZe wrote:
Hi people,

For a school assignment, I have to create a Client/Server application in Java that uses sockets to communicate. All communications have to be in XML format. Now, the difficulty of the assignment is that we have never done Client/Server programing in Java up until now, so I'm kinda lost. I managed to set up pretty much everything except for the XML communication and I'm lost. I use the JDOM library to create a small XML document in my server, and I attempt to send it through a stream to the client. Now thing is, I'm not sure what I need to send. I have a Document object that I guess that I could send, but it's not really XML, it's an object so it can't be read by a say, a python client does it ? Do I actually have to create a file, send the file, delete the file just to send my xml to the client ? Can anyone give me a hint I'm really lost here. Would it be easier in another library ?

Java has some great libraries for communicating with SQL. I did that for a course earlier, but I haven't tried doing client server connections with XML. Sorry I can't be much help. I don't see why you can't read the file and send the contents of the file by stream though.


Unrelated to the above, does anyone know if there is any point to using dateTime vs dateTimeOffset?

DateTimeOffset has everything DateTime does and DateTimeOffset also supports timezones.
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
November 30 2013 09:04 GMT
#8025
On November 30 2013 17:54 obesechicken13 wrote:
Unrelated to the above, does anyone know if there is any point to using dateTime vs dateTimeOffset?

DateTimeOffset has everything DateTime does and DateTimeOffset also supports timezones.

It would always be nice to also mention the language. If it's C#, I think I remember there being some pretty concrete advice on MSDN on this subject.
If you have a good reason to disagree with the above, please tell me. Thank you.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2013-11-30 09:36:09
November 30 2013 09:05 GMT
#8026
On November 30 2013 18:04 spinesheath wrote:
Show nested quote +
On November 30 2013 17:54 obesechicken13 wrote:
Unrelated to the above, does anyone know if there is any point to using dateTime vs dateTimeOffset?

DateTimeOffset has everything DateTime does and DateTimeOffset also supports timezones.

It would always be nice to also mention the language. If it's C#, I think I remember there being some pretty concrete advice on MSDN on this subject.

It is C#.

DateTimeOffset
http://msdn.microsoft.com/en-us/library/bb630289.aspx
DateTime
http://msdn.microsoft.com/en-us/library/bb677335.aspx#feedback
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
Last Edited: 2013-11-30 09:35:27
November 30 2013 09:31 GMT
#8027
On November 30 2013 18:05 obesechicken13 wrote:
Show nested quote +
On November 30 2013 18:04 spinesheath wrote:
On November 30 2013 17:54 obesechicken13 wrote:
Unrelated to the above, does anyone know if there is any point to using dateTime vs dateTimeOffset?

DateTimeOffset has everything DateTime does and DateTimeOffset also supports timezones.

It would always be nice to also mention the language. If it's C#, I think I remember there being some pretty concrete advice on MSDN on this subject.

It is C#.

dateTimeOffset
http://msdn.microsoft.com/en-us/library/bb630289.aspx
DateTime
http://msdn.microsoft.com/en-us/library/bb677335.aspx#feedback

This is not C#, it's T-SQL

As for reason to use one or the other, datetime2 requires at most 8 bytes, at minimum 6 bytes. datetimeoffset requires 10 bytes always. I guess that's a reason to use datetime2, but really, whoever sits on a database so big that this would matter, yet cares about this difference in bytes, is doing something wrong.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2013-11-30 09:35:45
November 30 2013 09:35 GMT
#8028
On November 30 2013 18:31 Tobberoth wrote:
Show nested quote +
On November 30 2013 18:05 obesechicken13 wrote:
On November 30 2013 18:04 spinesheath wrote:
On November 30 2013 17:54 obesechicken13 wrote:
Unrelated to the above, does anyone know if there is any point to using dateTime vs dateTimeOffset?

DateTimeOffset has everything DateTime does and DateTimeOffset also supports timezones.

It would always be nice to also mention the language. If it's C#, I think I remember there being some pretty concrete advice on MSDN on this subject.

It is C#.

dateTimeOffset
http://msdn.microsoft.com/en-us/library/bb630289.aspx
DateTime
http://msdn.microsoft.com/en-us/library/bb677335.aspx#feedback

This is not C#, it's T-SQL

Fk, yes, it is T-SQL. My bad!
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
soiii
Profile Joined July 2011
Germany266 Posts
Last Edited: 2013-11-30 11:39:00
November 30 2013 11:33 GMT
#8029
Can somebody give me a hint what is happening when I declare a struct variable like so (C++): "MyStruct *struct_name();" ?
I have no idea what is happening here

Edit: figured it out, that is actually a function declaration ^^. I am quite new to C++.
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
November 30 2013 13:36 GMT
#8030
I'm learning ARM assembly these days, any idea of something easy to make?
rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
Warri
Profile Joined May 2010
Germany3208 Posts
November 30 2013 13:48 GMT
#8031
On November 30 2013 22:36 Arnstein wrote:
I'm learning ARM assembly these days, any idea of something easy to make?

Do all the sorts!
Manit0u
Profile Blog Joined August 2004
Poland17838 Posts
November 30 2013 15:10 GMT
#8032
On November 30 2013 20:33 soiii wrote:
Can somebody give me a hint what is happening when I declare a struct variable like so (C++): "MyStruct *struct_name();" ?
I have no idea what is happening here

Edit: figured it out, that is actually a function declaration ^^. I am quite new to C++.


This is strange though. You create structs like so:


struct MyStruct{ };


And then if you want to do stuff with it you declare functions like that:


struct MyStruct* MyFunction(args)


Or I'm messing something here?
Time is precious. Waste it wisely.
Rollin
Profile Joined March 2011
Australia1552 Posts
Last Edited: 2013-11-30 15:41:31
November 30 2013 15:26 GMT
#8033
On December 01 2013 00:10 Manit0u wrote:
+ Show Spoiler +
On November 30 2013 20:33 soiii wrote:
Can somebody give me a hint what is happening when I declare a struct variable like so (C++): "MyStruct *struct_name();" ?
I have no idea what is happening here

Edit: figured it out, that is actually a function declaration ^^. I am quite new to C++.


This is strange though. You create structs like so:

struct MyStruct{ };


And then if you want to do stuff with it you declare functions like that:

struct MyStruct* MyFunction(args)


Or I'm messing something here?

C++ doesn't require the struct keyword to set the type (outside of initialisation ofc) regardless of whether or not you use a typedef in the intitalisation. C (ansi at least) requires the struct keyword if you don't typedef the struct.

ie:
typedef struct{
...
} MyStruct;

MyStruct *MyFunction();

Works in ANSI C.

struct{
...
} MyStruct;

struct MyStruct *MyFunction();

Also works in ANSI C.

struct{
...
} MyStruct;

MyStruct *MyFunction();

Only works in C++.

Thus his function prototype was valid =).
Throw off those chains of reason, and your prison disappears. | Check your posting frequency timeline: http://www.teamliquid.net/mytlnet/post_activity_img.php
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
November 30 2013 19:22 GMT
#8034
Hey everyone,

For my own personal curiosity, and for a future(legal) business idea I'm looking into creating a botnet by myself. Could someone please point me to a good basic guide for creating a botnet? It doesn't need much info on bypassing security because I'm assuming for now that it will be allowed through.

Thank you.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Zocat
Profile Joined April 2010
Germany2229 Posts
November 30 2013 19:39 GMT
#8035
You have to find an attack vector. Vulnerabilities in (common) server software - look through open source code to find those. Use those to upload your bot software.
Have them connect to another server (IRC is often used) to command them.
Warri
Profile Joined May 2010
Germany3208 Posts
Last Edited: 2013-11-30 19:43:07
November 30 2013 19:42 GMT
#8036
Woa java is driving me nuts today.
I have this endless loop:

boolean pause=true;
while (true) {
if (!pause) {
update();
}
}

At the start of the program pause is set to true and is not changed in the class which contains the loop. It is only changed in another class, which contains a gui. And heres the weird part: pause gets set to false correctly, but the loop still doesnt run. However, if i add a System.out.println("foo"); inside the loop, it works. So my assumption is, java falsely "optimizes", aka removes, the loop, because the condition is never changed to true inside the class. How can i prevent that without adding dummy commands?
Nyxisto
Profile Joined August 2010
Germany6287 Posts
November 30 2013 19:51 GMT
#8037
I also have desperate java problems today:

So the task was to write a method that reads hex numbers from a file, converts them, and prints them out through the console.
Problem is, we're not allowed to use Buffered Readers or something similar, we're forced to use a "StdIn" class that we were given, which has a bunch of methods to read from the Standard Input, and we should redirect the Standard Input to read from the file instead from the console.
So i looked it up and the Syntax seems to be something like "java classname.java < filename.txt"
But if i run the program and type that into the console, it just echoes "java classname.java < filename.txt" instead of actually printing out the content of the file.

Would be glad if anyone has an idea what's wrong here.
Manit0u
Profile Blog Joined August 2004
Poland17838 Posts
Last Edited: 2013-11-30 20:05:25
November 30 2013 20:00 GMT
#8038
On December 01 2013 04:42 Warri wrote:
Woa java is driving me nuts today.
I have this endless loop:

boolean pause=true;
while (true) {
if (!pause) {
update();
}
}

At the start of the program pause is set to true and is not changed in the class which contains the loop. It is only changed in another class, which contains a gui. And heres the weird part: pause gets set to false correctly, but the loop still doesnt run. However, if i add a System.out.println("foo"); inside the loop, it works. So my assumption is, java falsely "optimizes", aka removes, the loop, because the condition is never changed to true inside the class. How can i prevent that without adding dummy commands?


Can you make it more like this?

Class A

while (true) {
if (!ClassB->queryPause(pause)) {
update();
}
}


Class B

boolean pause = true;

... do stuff with pause ...

public boolean queryPause(boolean pause)
{
return pause;
}


I think it would be even better if you had 3 classes. 2 that actually do stuff and have all the data and another one acting as an interface for the other two to communicate. This way you can easily shuffle stuff around and change things later.
Time is precious. Waste it wisely.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
November 30 2013 20:04 GMT
#8039
So this answered my question from before:
http://msdn.microsoft.com/en-us/library/bb384267(v=vs.110).aspx
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
Warri
Profile Joined May 2010
Germany3208 Posts
Last Edited: 2013-11-30 20:11:29
November 30 2013 20:10 GMT
#8040
On December 01 2013 05:00 Manit0u wrote:
Show nested quote +
On December 01 2013 04:42 Warri wrote:
Woa java is driving me nuts today.
I have this endless loop:

boolean pause=true;
while (true) {
if (!pause) {
update();
}
}

At the start of the program pause is set to true and is not changed in the class which contains the loop. It is only changed in another class, which contains a gui. And heres the weird part: pause gets set to false correctly, but the loop still doesnt run. However, if i add a System.out.println("foo"); inside the loop, it works. So my assumption is, java falsely "optimizes", aka removes, the loop, because the condition is never changed to true inside the class. How can i prevent that without adding dummy commands?


Can you make it more like this?

Class A

while (true) {
if (!ClassB->queryPause(pause)) {
update();
}
}


Class B

boolean pause = true;

... do stuff with pause ...

public boolean queryPause(boolean pause)
{
return pause;
}


I think it would be even better if you had 3 classes. 2 that actually do stuff and have all the data and another one acting as an interface for the other two to communicate. This way you can easily shuffle stuff around and change things later.

Hm i dont understand what the parameter is for in queryPause, if pause is a member of Class B?
I tried this:
Class A:

while (true) {
if (!B.getPause()) {
update();
}
}

Class B:

boolean pause=true;
...
public boolean getPause() {
return pause;
}

This also doesnt work. But again, if i change the getPause() method to

public boolean getPause() {
System.out.println("qwe");
return pause;
}

it starts working... i dont get it
Prev 1 400 401 402 403 404 1032 Next
Please log in or register to reply.
Live Events Refresh
OSC
22:30
Masters Cup #151
davetesta52
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
CosmosSc2 15
EnDerr 4
StarCraft: Brood War
Rain 3013
GuemChi 1878
Aegong 79
NaDa 35
Dota 2
NeuroSwarm101
League of Legends
Doublelift3836
Counter-Strike
summit1g9771
taco 544
minikerr185
Super Smash Bros
hungrybox632
Mew2King86
PPMD60
Other Games
shahzam461
Artosis408
C9.Mang0169
Maynarde129
ViBE82
XaKoH 68
Trikslyr40
Organizations
Other Games
BasetradeTV26
[ Show 13 non-featured ]
StarCraft 2
• Berry_CruncH351
• EnkiAlexander 17
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• Light_VIP 11
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota21976
Other Games
• Scarra908
Upcoming Events
IntoTheTV X SOOP
8h 58m
CranKy Ducklings
1d 7h
Big Brain Bouts
1d 7h
Garitos vs ArT
Lambo vs Percival
TriGGeR vs ByuN
Sparkling Tuna Cup
2 days
OSC
2 days
Shopify Rebellion Sundays
2 days
Mixu vs TBD
Spirit vs TBD
Clem vs TBD
Patches Events
2 days
Afreeca Starleague
3 days
Soma vs Shuttle
BeSt vs Rush
WardiTV Weekly
3 days
Afreeca Starleague
4 days
Leta vs ggaemo
Jaedong vs Queen
[ Show More ]
GSL
4 days
PiGosaur Cup
4 days
Kung Fu Cup
5 days
Replay Cast
5 days
The PondCast
6 days
Liquipedia Results

Completed

Proleague 2026-09-02
PiG Sty Festival 8.0
Light Tournament 2026

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
RSL Revival: Season 6
Calamity Invitational
Big Dog Cup 2026 Div 1
BLAST Open Fall 2026
Esports World Cup 2026
Esports World Cup 2026: LCQ
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026

Upcoming

Acropolis #5
Acropolis #5 - TRS
Escore Tournament S3: King of Kings
Blizzard Classic Cup 2026
Acropolis #5 - GSA
Acropolis #5 - GSB
Acropolis #5 - GSC
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
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.