• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:41
CEST 06:41
KST 13:41
  • 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
Serral wins HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
Balance hotfix patch 5.0.16b (July 16)11Reynor: GSL Loss Wasn't About Preparation Format13[IPSL] Spring 2026 Grand Finals - This Weekend!5Weekly Cups (July 6 - 12): Protoss strike back12BSL Season 22 Full Overview & Conclusion8
StarCraft 2
General
Balance hotfix patch 5.0.16b (July 16) Reynor: GSL Loss Wasn't About Preparation Format Is the larve respawn broken? 5.0.16 patch for SC2 goes live (8 worker start) BGE Stara Zagora to be held again in June 2025
Tourneys
Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026 GSL CK #5 Race War RSL Revival: Season 6 - Qualifiers and Main Event HomeStory Cup 29
Strategy
[G] Having the right mentality to improve
Custom Maps
New Map Maker - Looking for Advice - Love or Hate Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together Mutation # 532 Nuclear Family
Brood War
General
Etiquete rules in Asl? Recommended FPV games (post-KeSPA) Pros Debate: Zerg Unfairly Nerfed? (ASL S22 map) BGH Auto Balance -> http://bghmmr.eu/ screpdb: new Starcraft reporting tool
Tourneys
[IPSL] Spring 2026 Grand Finals - This Weekend! Escore Tournament - Season 3 [Megathread] Daily Proleagues [ASL22] Wildcard Qualifier
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Creating a full chart of Zerg builds Relatively freeroll strategies
Other Games
General Games
General RTS Discussion Thread Path of Exile Beyond All Reason Nintendo Switch Thread Stormgate/Frost Giant Megathread
Dota 2
Looking for a Dota Mentor 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
TL Mafia
TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread UK Politics Mega-thread YouTube Thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Movie Discussion! Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Series you have seen recently...
Sports
2024 - 2026 Football Thread MLB/Baseball 2023 McBoner: A hockey love story Tennis[sport] Formula 1 Discussion
World Cup 2022
Tech Support
Simple Questions Simple Answers FPS when play League Of Legend on laptop How to clean a TTe Thermaltake keyboard?
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Poker (part 2)
Nebuchad
The Experiences We Want and …
TrAiDoS
An Exploration of th…
waywardstrategy
Gauntlet SC2: A Retrospectiv…
Ctone23
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Evil Gacha Games and the…
ffswowsucks
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7866 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
Poland17792 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
Poland17792 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
Poland17792 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
Next event in 4h 19m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft712
RuFF_SC2 191
oGsTOP 119
StarCraft: Brood War
Noble 120
Icarus 7
Dota 2
NeuroSwarm70
League of Legends
JimRising 538
Counter-Strike
Coldzera 1080
Other Games
summit1g6033
PiGStarcraft350
C9.Mang0341
XaKoH 169
Maynarde136
ViBE62
Trikslyr17
Organizations
Other Games
gamesdonequick1708
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 14 non-featured ]
StarCraft 2
• practicex 19
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota213
League of Legends
• Stunt529
Other Games
• Scarra1105
Upcoming Events
Replay Cast
4h 19m
CrankTV Team League
6h 19m
WardiTV Qualifier
7h 19m
Epic.LAN
8h 19m
Big Brain Bouts
11h 19m
SHIN vs Elazer
Percival vs Nicoract
Reynor vs Lambo
Replay Cast
19h 19m
RSL Revival
1d 4h
Clem vs Lambo
Scarlett vs Cure
CranKy Ducklings
1d 5h
Epic.LAN
1d 8h
IPSL
1d 11h
Dragon vs Hawk
[ Show More ]
RSL Revival
2 days
Classic vs Trap
herO vs SHIN
Sparkling Tuna Cup
2 days
OSC
2 days
IPSL
2 days
Bonyth vs Ret
WardiTV Weekly
3 days
Monday Night Weeklies
3 days
PiGosaur Cup
4 days
The PondCast
5 days
Replay Cast
6 days
CrankTV Team League
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-07-13
HSC XXIX
Eternal Conflict S2 E2

Ongoing

IPSL Spring 2026
Acropolis #4
CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
Escore Tournament S3: W3
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026

Upcoming

ASL S22 SEASON OPEN Day 1
Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
CSLAN 4
Blizzard Classic Cup 2026
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
Eternal Conflict S2 E3
Logitech G Connect 2026
StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
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.