• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 06:58
CEST 12:58
KST 19:58
  • 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
Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12TL.net Map Contest #22 - Voting & Ladder Map Selection7Code S Season 2 (2026) - RO8 Preview8[ASL21] Finals Preview: Two Legacies21
Community News
ZeroSpace at Steam NextFest - Last free demo14Weekly Cups (June 8-14): Clem and Solar double, PTR tested0RSL: S6 Finals played at BlizzCon 202611Douyu Cup 2026: $20,000 Legends Event (June 26-28)10[BSL22] Non-Korean Championship from 13 to 28 June4
StarCraft 2
General
StarCraft II 5.0.16 PTR Patch Notes may 26th J188 – Nhà Cái Cá Cược Trực Tuyến Đẳng Cấp Châu Á Code S Season 2 (2026) - RO8 Preview Daily SC2 Player Grid - feedback wanted TL Poll: How do you feel about the 5.0.16 PTR balance changes?
Tourneys
Master Swan Open (Global Bronze-Master 2) GSL CK #4 20-21th June Crank Gathers Season 4: BW vs SC2 Team League Douyu Cup 2026: $20,000 Legends Event (June 26-28) Maestros of The Game 2 announcement and schedule !
Strategy
[G] Having the right mentality to improve
Custom Maps
Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
Mutation # 530 One For All The PondCast: SC2 News & Results Mutation # 529 Opportunities Unleashed Mutation # 528 Infection Detected
Brood War
General
Fact based Zerg Upgrade Tier List vespene.gg — BW replays in browser BGH Auto Balance -> http://bghmmr.eu/ Data needed BW General Discussion
Tourneys
CSLAN 4 is Coming! [Megathread] Daily Proleagues Small VOD Thread 2.0 The Casual Games of the Week Thread
Strategy
Simple Questions, Simple Answers Relatively freeroll strategies Creating a full chart of Zerg builds Why doesn't anyone use restoration?
Other Games
General Games
Stormgate/Frost Giant Megathread ZeroSpace at Steam NextFest - Last free demo Nintendo Switch Thread Path of Exile ZeroSpace 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
Vanilla Mini Mafia {D-2} Late to making 20.06.2026 memorable [p]94718
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread [H]Internet/Gaming Cafe Tips and Tricks The Games Industry And ATVI UK Politics Mega-thread
Fan Clubs
The HerO Fan Club! The herO Fan Club!
Media & Entertainment
Movie Discussion! [Req][Books] Good Fantasy/SciFi books [TV/BOOK] *SPOILERS* Game of Thrones Discussion
Sports
2024 - 2026 Football Thread McBoner: A hockey love story TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion Cricket [SPORT]
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Facing Challenges in Mobile App Development
TL Community
The Automated Ban List
Blogs
How To Predict Tilt in Espor…
TrAiDoS
An Exploration of th…
waywardstrategy
I'm an arrogant trash talke…
FlaShFTW
Gauntlet SC2: A Retrospectiv…
Ctone23
Why RTS gamers make better f…
gosubay
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7882 users

The Big Programming Thread - Page 596

Forum Index > General Forum
Post a Reply
Prev 1 594 595 596 597 598 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.
Manit0u
Profile Blog Joined August 2004
Poland17770 Posts
February 27 2015 11:45 GMT
#11901
On February 27 2015 17:32 Blisse wrote:
how do yall balance working with all the other stuff you wanna do?

i balance it by not sleeping but i feel like there's a better way...


I don't do half the stuff I want to do :/
Time is precious. Waste it wisely.
Umpteen
Profile Blog Joined April 2010
United Kingdom1570 Posts
February 27 2015 15:19 GMT
#11902
Semi-idle question:

Is there a term for bugs where several different errors in the code all cause the same or similar symptoms, so that when you find and fix one, the problem doesn't seem to go away?
The existence of a food chain is inescapable if we evolved unsupervised, and inexcusable otherwise.
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
February 27 2015 15:52 GMT
#11903
On February 27 2015 17:32 Blisse wrote:
how do yall balance working with all the other stuff you wanna do?

i balance it by not sleeping but i feel like there's a better way...

in my case I convince my teachers that they should let me do the things I want to do.

I geuss that would be a big bug? since you have to fix all to get rid of the symptoms.

does anybody know how I can set my stuff up in a way that I only need to recompile 1 file for a change to work instead of my entire project over and over again?
The harder it becomes, the more you should focus on the basics.
FFGenerations
Profile Blog Joined April 2011
7088 Posts
Last Edited: 2015-02-27 16:27:32
February 27 2015 16:20 GMT
#11904
hi

so the next thing i wanna do is take an xml string and parse it into a java object class.

there is a class generator here http://pojo.sodhanalibrary.com/ where you paste in sample xml and it designs a class for you

however some of my sample xml data uses & instead of &amp; which causes it to be invalid xml apparently. for example the anime + Show Spoiler +
<anime href="/encyclopedia/anime.php?id=210">Rurouni Kenshin: Trust & Betrayal (OAV)</anime>


my question is, when my system receives the xml string (by requesting from external api), should it first validate it?

so it would be like

1) request xml from external API

2) search the string for "<warning>no result for anime=uuu</warning>" and if this is the case then don't try to parse the result into an object (or parse it into a different object...or do something with it different...)

3) search the string for "&" and replace them with "&amp;"

4) (parse into object)

(just got out of bed so will look into this myself obv :D )
Cool BW Music Vid - youtube.com/watch?v=W54nlqJ-Nx8 ~~~~~ ᕤ OYSTERS ᕤ CLAMS ᕤ AND ᕤ CUCKOLDS ᕤ ~~~~~~ ༼ ᕤ◕◡◕ ༽ᕤ PUNCH HIM ༼ ᕤ◕◡◕ ༽ᕤ
Ropid
Profile Joined March 2009
Germany3557 Posts
Last Edited: 2015-02-27 16:40:03
February 27 2015 16:29 GMT
#11905
On February 28 2015 00:52 sabas123 wrote:
does anybody know how I can set my stuff up in a way that I only need to recompile 1 file for a change to work instead of my entire project over and over again?

You could use this: http://www.gnu.org/software/make/

If you set up a make file, that make tool will only compile the changed .c files into .o files, but will leave the unchanged files alone. You can't avoid the linker step, that has to be done each time.

To speed up the linker, there's the normal one "ld" and an alternative named "gold" (has the filename ld.gold). That ld.gold can use all CPU cores and stuff. You can have gcc use it by adding "-fuse-ld=gold" to the command line. Adding "-pipe" is also interesting as it makes it so the various processes pipe their output/inputs together instead of using temp files.

I bet there's also a much nicer and easier to use tool than that ancient "make" one, but if you just use an example file to start, it's probably not that annoying.

EDIT: Another thing! You can use clang instead of gcc. It's faster and its error messages are nicer. It can be pretty much a perfect replacement for gcc, exact same command lines often work, etc., so there's nothing to learn really.

I also just remembered "ccache". That's a wrapper that will call the compiler and cache the output. If the input files didn't change, it will use the output from its cache instead of starting the compiler. Using that might be an alternative to a make system. You have nothing you need to learn really with ccache. You are using it by replacing gcc and g++ with links to the ccache executable. It looks like this in practice:

$ which gcc g++ clang clang++
/usr/lib/ccache/bin/gcc
/usr/lib/ccache/bin/g++
/usr/lib/ccache/bin/clang
/usr/lib/ccache/bin/clang++

That's just the /usr/lib/ccache/bin directory added to the front of $PATH.
"My goal is to replace my soul with coffee and become immortal."
Oshuy
Profile Joined September 2011
Netherlands529 Posts
February 27 2015 16:39 GMT
#11906
On February 28 2015 01:20 FFGenerations wrote:
my question is, when my system receives the xml string (by requesting from external api), should it first validate it?


Always validate your inputs first, unless you know the component you use has a reliable validation to protect it against external attacks. Since checking the components you use is often more work than making the validation yourself anyway, always validate your inputs first.
Coooot
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
February 27 2015 16:42 GMT
#11907
On February 28 2015 01:29 Ropid wrote:
Show nested quote +
On February 28 2015 00:52 sabas123 wrote:
does anybody know how I can set my stuff up in a way that I only need to recompile 1 file for a change to work instead of my entire project over and over again?

You could use this: http://www.gnu.org/software/make/

If you set up a make file, that make tool will only compile the changed .c files into .o files, but will leave the unchanged files alone. You can't avoid the linker step, that has to be done each time.

To speed up the linker, there's the normal one "ld" and an alternative named "gold" (has the filename ld.gold). That ld.gold can use all CPU cores and stuff. You can have gcc use it by adding "-fuse-ld=gold" to the command line. Adding "-pipe" is also interesting as it makes it so the various processes pipe their output/inputs together instead of using temp files.

I bet there's also a much nicer and easier to use tool than that ancient "make" one, but if you just use an example file to start, it's probably not that annoying.

EDIT: Another thing! You can use clang instead of gcc. It's faster and its error messages are nicer. It can be pretty much a perfect replacement for gcc, exact same command lines often work, etc., so there's nothing to learn really.

I also just remembered "ccache". That's a wrapper that will call the compiler and cache the output. If the input files didn't change, it will use the output from its cache instead of starting the compiler. Using that might be an alternative to a make system. You have nothing you need to learn really with ccache. You are using it by replacing gcc and g++ with links to the ccache executable. It looks like this in practice:

$ which gcc g++ clang clang++
/usr/lib/ccache/bin/gcc
/usr/lib/ccache/bin/g++
/usr/lib/ccache/bin/clang
/usr/lib/ccache/bin/clang++

That's just the /usr/lib/ccache/bin directory added to the front of $PATH.

so if I change bla.o by recompiling bla.cpp then there is to see the change in the program itself I have to recompile it no matter what?T_T

also with a make file, can I put it up that it will take an argument only compile the file of the argument?

thanks for the post btw^^
The harder it becomes, the more you should focus on the basics.
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
Last Edited: 2015-02-27 16:58:51
February 27 2015 16:58 GMT
#11908
void pointers confuse meT_T

I need to pass an int to a timer that only accepts a void pointers. and I have to do that through an other function

any idea how?? the current result below is a random between 0 and ~32500.

+ Show Spoiler +


SDL_TimerID runningMarioTimer;
int can_time=1;
uint32_t nextRunningMarioClip(uint32_t interval,void* max){
int magic = *(int *) max;
printf("magic:%d \n" ,magic);

can_time=1;
return 0;
}

void runningMarioClipTimer(void *max){
runningMarioTimer=SDL_AddTimer(300,nextRunningMarioClip,max);
}

void marioRunningRender(int x, int y){
int number =3;
//start the timer for the next clip
if(can_time==1){
runningMarioClipTimer(&number);
can_time=0;
}
}


edit to compile you have to include sdl_timer and init it. will fix the code later
The harder it becomes, the more you should focus on the basics.
Ropid
Profile Joined March 2009
Germany3557 Posts
Last Edited: 2015-02-27 17:02:51
February 27 2015 16:59 GMT
#11909
Yes, you have to recompile it no matter what, but in your example, where you compiled bla.cpp separately (probably to check for error messages), make will see that the .o file has a newer date than the .cpp file and will just start the linker to build a new executable.

Yes, you can compile only parts of your stuff with make. In the config file, there's definitions for "targets" and you can call make with a target name. In your example, there will be a target "bla.o" which depends on "bla.cpp". If you just want to compile bla.cpp and nothing else, you would do "make bla.o".

EDIT:

int number;

number <--- that has type (int)
&number <--- that has type (int *)
(void *) (&number) <--- force it to pretend that the (int *) is a (void *)
"My goal is to replace my soul with coffee and become immortal."
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2015-02-27 17:09:16
February 27 2015 17:08 GMT
#11910
clang might compile faster (it did last time i checked, but gcc seemed to produce faster code), but i doubt sabas would notice the difference. it seems gcc 5 will bring a big boost to compilation speed, which is super nice (i kill compilers).

however i belive the diagnostics on clang are more friendly than the the one on gcc, so if he can swap it out without any hassle i think it's a good advice.
conspired against by a confederacy of dunces.
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
February 27 2015 18:00 GMT
#11911
I can get an int * to a function, but still cant send it as a (void*) (*argument)

the function that will recieve (void*) (*argument) I convert the argument to int with *(int*) but that causes a segment fault:/
The harder it becomes, the more you should focus on the basics.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
February 27 2015 18:01 GMT
#11912
On February 28 2015 02:08 nunez wrote:
clang might compile faster (it did last time i checked, but gcc seemed to produce faster code), but i doubt sabas would notice the difference. it seems gcc 5 will bring a big boost to compilation speed, which is super nice (i kill compilers).

however i belive the diagnostics on clang are more friendly than the the one on gcc, so if he can swap it out without any hassle i think it's a good advice.

That's what you get for using a turing complete compile time meta language.
If you have a good reason to disagree with the above, please tell me. Thank you.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2015-02-27 18:31:28
February 27 2015 18:12 GMT
#11913
the int number is local to the marioRunningRender function,
when the main thread is done executing it, this number ceases to be.
if the callback runs on the library thread after this, and attempts to
dereference a pointer to this number, then you are out of luck.

@spinesheath
it's hard to despair when your purgatory is a comfortable chair in the proximity of a coffee machine.

My desire to inflict pain on the compilers is large.
They've been tormenting me for the last 7 years.
Now's my chance to strike back!
Scott Haney
src
conspired against by a confederacy of dunces.
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
February 27 2015 19:30 GMT
#11914
On February 28 2015 03:12 nunez wrote:
the int number is local to the marioRunningRender function,
when the main thread is done executing it, this number ceases to be.
if the callback runs on the library thread after this, and attempts to
dereference a pointer to this number, then you are out of luck.

thanks that solved it.
The harder it becomes, the more you should focus on the basics.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
February 27 2015 19:33 GMT
#11915
ah, nice job.
conspired against by a confederacy of dunces.
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
February 28 2015 20:10 GMT
#11916
im trying to add a class pointer to a vector when a class gets initialized. but I can't get it to work:/ any help?
The harder it becomes, the more you should focus on the basics.
teamamerica
Profile Blog Joined July 2010
United States958 Posts
February 28 2015 20:14 GMT
#11917
On February 28 2015 01:20 FFGenerations wrote:
hi

so the next thing i wanna do is take an xml string and parse it into a java object class.

there is a class generator here http://pojo.sodhanalibrary.com/ where you paste in sample xml and it designs a class for you

however some of my sample xml data uses & instead of &amp; which causes it to be invalid xml apparently. for example the anime + Show Spoiler +
<anime href="/encyclopedia/anime.php?id=210">Rurouni Kenshin: Trust & Betrayal (OAV)</anime>


my question is, when my system receives the xml string (by requesting from external api), should it first validate it?

so it would be like

1) request xml from external API

2) search the string for "<warning>no result for anime=uuu</warning>" and if this is the case then don't try to parse the result into an object (or parse it into a different object...or do something with it different...)

3) search the string for "&" and replace them with "&amp;"

4) (parse into object)

(just got out of bed so will look into this myself obv :D )



I think you probably want to look into xml/html decodingfor step 3 (rather than just find and replace). Also there's JAXB stuff for decoding XML but I've never used it before to be honest.

Quick question for Java encryption. I'm trying to build some sample code to encrypt a text file. A bit of googling get's me to this StackOverflow answer.

They have a few different components - salt, iv, and actual passphrase used to generate key. I'm wondering how important it is to keep all of that data private. I was going to simply hardcode salt into code(choose 8 random bytes), and also store the IV with the encrypted text.

In writing this, I suppose I could also store the salt (again in cleartext) with the rest of my text, but I don't know if that helps at all.

Here's what I have so far...https://gist.github.com/anonymous/8c225d610297ae9d11e8

I looked into Jasypt and didn't go with it because it's StrongTextEncryptor uses triple-DES and I remember from some old course the key strength of that isn't that high. But honestly I barely know what I'm going, so maybe I should just go with that?

Thanks!

RIP GOMTV. RIP PROLEAGUE.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
February 28 2015 20:20 GMT
#11918
@sabas
not quite sure what you are trying to do,
maybe you can post some code.
conspired against by a confederacy of dunces.
Manit0u
Profile Blog Joined August 2004
Poland17770 Posts
Last Edited: 2015-02-28 20:32:57
February 28 2015 20:32 GMT
#11919
On March 01 2015 05:14 teamamerica wrote:
They have a few different components - salt, iv, and actual passphrase used to generate key. I'm wondering how important it is to keep all of that data private. I was going to simply hardcode salt into code(choose 8 random bytes), and also store the IV with the encrypted text.


http://security.stackexchange.com/questions/17421/how-to-store-salt

The chosen answer is very informational and a good read in itself. Also, it's important to have a unique salt for each encryption, rather than having a single global salt.
Time is precious. Waste it wisely.
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
February 28 2015 20:36 GMT
#11920
+ Show Spoiler +

class character;
std::vector<characater>objectList;

class character{
character();
};

character::character(){
addObjectToList(*this);
}

addObjectToList(character *obj){
objectList.push_back( character *obj);
}

error:: expecting primal type before '*'


sorry about my terrible post, I hope this clears some stuff up.
The harder it becomes, the more you should focus on the basics.
Prev 1 594 595 596 597 598 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 2m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Railgan 56
trigger 48
StarCraft: Brood War
Britney 25455
Calm 13525
Mini 1894
Shuttle 1544
Horang2 690
Hyuk 579
firebathero 405
Larva 302
Zeus 207
Soma 191
[ Show more ]
actioN 171
Sharp 117
Last 113
PianO 105
Leta 102
Pusan 91
ggaemo 85
ToSsGirL 62
Liquid`Ret 59
JulyZerg 44
Hyun 30
HiyA 26
910 25
Aegong 23
Sacsri 20
Movie 17
Shine 16
ajuk12(nOOB) 11
League of Legends
JimRising 404
Other Games
crisheroes208
KnowMe185
B2W.Neo36
Trikslyr22
TKL 0
Organizations
Dota 2
PGL Dota 2 - Secondary Stream8719
Other Games
gamesdonequick765
StarCraft 2
WardiTV144
TaKeTV 96
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 13 non-featured ]
StarCraft 2
• StrangeGG 73
• Sammyuel 15
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos2350
Upcoming Events
WardiTV Spring Champion…
2m
GSL
1h 2m
Maru vs ShoWTimE
Classic vs Reynor
herO vs Lambo
Solar vs Clem
IPSL
5h 2m
Bonyth vs Dewalt
BSL22 NKC (BSL vs China)
8h 2m
XuanXuan vs Jaystar
Mihu vs Messiah
eOnzErG vs Dewalt
Bonyth vs Jaystar
TerrOr vs Messiah
XuanXuan vs Mihu
eOnzErG vs Jaystar
Replay Cast
13h 2m
WardiTV Spring Champion…
1d
GSL
1d 1h
IPSL
1d 5h
Hawk vs Julia
Patches Events
1d 6h
BSL22 NKC (BSL vs China)
1d 8h
Dewalt vs Messiah
Bonyth vs Mihu
TerrOr vs XuanXuan
eOnzErG vs Messiah
Jaystar vs Mihu
Dewalt vs XuanXuan
Bonyth vs TerrOr
[ Show More ]
Replay Cast
1d 13h
WardiTV Weekly
2 days
Monday Night Weeklies
2 days
Sparkling Tuna Cup
2 days
The PondCast
3 days
Douyu Cup 2020
4 days
Oliveira vs Trap
Jieshi vs XY
soO vs FanTaSy
TY vs Coffee
Douyu Cup 2020
5 days
Neeb vs Impact
MacSed vs Cyan
Scarlett vs Kelazhur
INnoVation vs Dear
Douyu Cup 2020
6 days
Liquipedia Results

Completed

Proleague 2026-06-19
uThermal 2v2 2026 Main Event
Heroes Pulsing #2

Ongoing

IPSL Spring 2026
Acropolis #4
CSCL: Masked Kings S4
YSL S3
BSL 22 Non-Korean Championship
CSL Season 21: Qualifier 1
SCTL 2026 Spring
Maestros of the Game 2
WardiTV Spring 2026
Murky Cup 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026

Upcoming

CSL Season 21: Qualifier 2
CSL 2026 Summer (S21)
CSLAN 4
Blizzard Classic Cup 2026
Kung Fu Cup 2026 Grand Finals
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
HSC XXIX
Douyu Cup 2026
BCC 2026
Light HT
Heroes Pulsing #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
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.