• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 01:59
CEST 07:59
KST 14:59
  • 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
ByuL, and the Limitations of Standard Play1Team 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
Community News
[TLMC] Summer 2026 Ladder Map Rotation05.0.16 patch for SC2 goes live (8 worker start)83ZeroSpace at Steam NextFest - Last free demo37Weekly Cups (June 8-14): Clem and Solar double, PTR tested0RSL: S6 Finals played at BlizzCon 202611
StarCraft 2
General
Is the larve respawn broken? The Death of Cheese: From a Professional Cheeser 5.0.16 patch for SC2 goes live (8 worker start) Old Replays From 1.4.6 The future of the SC game model
Tourneys
Douyu Cup 2026: $20,000 Legends Event (June 26-28) Maestros of The Game 2 announcement and schedule ! RSL Revival: Season 6 - Qualifiers and Main Event INu's Battles#17 <BO.9> Sparkling Tuna Cup - Weekly Open Tournament
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 # 532 Nuclear Family Mutation # 531 Experimental Artillery Mutation # 530 One For All
Brood War
General
Best thing happen to StarCraft since Remastered? ASL 22 Proposed Map Pool ProGamer Paychecks Story Data needed BW General Discussion
Tourneys
[Megathread] Daily Proleagues [ASL21] Grand Finals The Casual Games of the Week Thread [BSL22] GosuLeague Casts - Tue & Thu 22:00 CEST
Strategy
Simple Questions, Simple Answers Creating a full chart of Zerg builds Relatively freeroll strategies Why doesn't anyone use restoration?
Other Games
General Games
Path of Exile ZeroSpace at Steam NextFest - Last free demo Nintendo Switch Thread Stormgate/Frost Giant Megathread Beyond All Reason
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 Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread The Games Industry And ATVI Russo-Ukrainian War Thread Canadian Politics Mega-thread Things Aren’t Peaceful in Palestine
Fan Clubs
The HerO Fan Club! The herO Fan Club!
Media & Entertainment
Movie Discussion! Series you have seen recently... [Req][Books] Good Fantasy/SciFi books [TV/BOOK] *SPOILERS* Game of Thrones Discussion
Sports
2024 - 2026 Football Thread Formula 1 Discussion McBoner: A hockey love story TeamLiquid Health and Fitness Initiative For 2023 Cricket [SPORT]
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Listen To The Coaches!
TrAiDoS
An Exploration of th…
waywardstrategy
I'm an arrogant trash talke…
FlaShFTW
Gauntlet SC2: A Retrospectiv…
Ctone23
ramps on octagon
StaticNine
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 10307 users

The Big Programming Thread - Page 964

Forum Index > General Forum
Post a Reply
Prev 1 962 963 964 965 966 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.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2018-05-26 13:36:21
May 26 2018 13:29 GMT
#19261
i mean yeah, stuff like this is confusing if you don't know the basic concepts of the language and the standard library (f.ex. that you can define constructors for user-defined types, that the std::vector has a set of constructors, etc), but that is more an admission of guilt than it is a critique.

if you don't a clear mental model of the language, and you get thrown off when different concepts look similar, there is not much point in trying to critique it. if i am confusing the concepts of table and chair, because they both have 4 legs, i don't think anyone should be coming to me to hear my suggestions for how to improve woodworking.
conspired against by a confederacy of dunces.
sc-darkness
Profile Joined August 2017
856 Posts
Last Edited: 2018-05-26 13:35:56
May 26 2018 13:33 GMT
#19262
Well, you can say this about almost anything in C++ because it's guided by rules. It doesn't do things magically and randomly unless something has undefined behaviour. Still, C++ has some things which it could have done better/easier. One of vector's constructors gives you a way to shoot yourself in the foot just because of uniform initialization syntax.

I'm not sure why you defend C++ in this case when even its creator has admitted:

C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off.


I like C++ though.
bo1b
Profile Blog Joined August 2012
Australia12814 Posts
Last Edited: 2018-05-26 13:37:38
May 26 2018 13:37 GMT
#19263
I honestly think in so many ways c++ makes it dramatically easier to shoot yourself in the foot :\ I don't believe anyone who claims to be an expert of it either.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
May 26 2018 13:38 GMT
#19264
yeah, yeah, but it's like a skill-check you know. like a little ling-flood in zvz. if they die to that, then they are not ready to vs me in a macro-game.
conspired against by a confederacy of dunces.
sc-darkness
Profile Joined August 2017
856 Posts
Last Edited: 2018-05-26 13:59:48
May 26 2018 13:40 GMT
#19265
On May 26 2018 22:38 nunez wrote:
yeah, yeah, but it's like a skill-check you know. like a little ling-flood in zvz. if they die to that, then they are not ready to vs me in a macro-game.


Flawed thinking yet again. Yesterday I saw Rotterdam lose to ling rush. Is he GM? He is. Are you GM? I doubt it. Are you ready to beat him? Who knows.

Also, table and chair comparison isn't accurate. It's more like having a Cow factory class, then based on how you type a bracket, you either have 1,000,000 cows who look alike or 2 cows. I'm sure you'll notice the difference at your farm though. :D
nunez
Profile Blog Joined February 2011
Norway4003 Posts
May 26 2018 14:01 GMT
#19266
yes, just one character difference between cow and cows too. so confusing. is it one or is it several?

i cna nveer tell.
conspired against by a confederacy of dunces.
sc-darkness
Profile Joined August 2017
856 Posts
Last Edited: 2018-05-26 21:12:57
May 26 2018 20:08 GMT
#19267
If you can't tell the difference when you've just woken up, then it's not a good feature.


std::vector<int> v(100, 1);
std::vector<int> v{100, 1};


Focusing only on technical details isn't enough to be a good software engineer. Readability is also important.
Khalum
Profile Joined September 2010
Austria831 Posts
May 27 2018 03:07 GMT
#19268
On May 26 2018 20:40 nunez wrote:
Show nested quote +
On May 26 2018 17:55 Khalum wrote:
On May 26 2018 09:05 nunez wrote:
[..] i really dislike the built-in "shared-pointer copy semantics" of openCV.


You mean that you explicitly have to ask for deep copies of matrices? I think that's pretty brilliant since memory operations are minimized but at the same time it's one hell of a trap if someone doesn't really know what they're doing.


'memory operations' are minimized? i am not suggesting making extra copies, but there are oh so many tools ready at hand for "avoiding copies" (references, an arsenal of pointer-types, containers, statics even). in most scenario's you easily get away by using the most trivial of tools (f.ex. a reference).

one only needs thread-safe reference-counting for the most complex of scenarios, and then std::shared_ptr / std::weak_ptr is ready at hand, which works for _any_ type.

types with baked-in reference-counting is haram. 'cloning' and 'deep-copy' is alien terminology.


We're talking about people who are using plain char* for paths while being fully aware that there are a lot of people using the library in Microsoft land. But in the context of your example I defend the motivation - not necessarily the implementation.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
May 27 2018 04:07 GMT
#19269
I've been using this library to do my Ethereum stuff, Web3j. They released 3.4.0 which has websocket support, which is huge because now I can listen for events from Infura. However... they apparently didn't actually put the websocket stuff in the release! It's in the patch notes, it's in the master branch on their git, they said they put it in but I've downloaded like 4 different varieties of their 3.4.0 and it's not in there! Bah!

It sucks because I'm literally just sitting here waiting for it to do a fairly big feature for my app and it's so close, but so far!
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Manit0u
Profile Blog Joined August 2004
Poland17774 Posts
Last Edited: 2018-05-28 16:56:52
May 28 2018 16:56 GMT
#19270
So, I've been to 2 job interviews today (one for Python and one for Ruby). Both went pretty well. Now I have to make a hard decision...

Bonus, weird Ruby question from the interview:

# what will this next line of code return?
Numeric > Integer
Time is precious. Waste it wisely.
Acrofales
Profile Joined August 2010
Spain18333 Posts
May 28 2018 17:23 GMT
#19271
On May 29 2018 01:56 Manit0u wrote:
So, I've been to 2 job interviews today (one for Python and one for Ruby). Both went pretty well. Now I have to make a hard decision...

Bonus, weird Ruby question from the interview:

# what will this next line of code return?
Numeric > Integer

If that were PHP it would cast them to string and do a lexicographic comparison, and return true. In Ruby my guess is whatever Ruby's equivalent is for an illegal argument exception.
Manit0u
Profile Blog Joined August 2004
Poland17774 Posts
Last Edited: 2018-05-28 19:40:01
May 28 2018 17:53 GMT
#19272
On May 29 2018 02:23 Acrofales wrote:
Show nested quote +
On May 29 2018 01:56 Manit0u wrote:
So, I've been to 2 job interviews today (one for Python and one for Ruby). Both went pretty well. Now I have to make a hard decision...

Bonus, weird Ruby question from the interview:

# what will this next line of code return?
Numeric > Integer

If that were PHP it would cast them to string and do a lexicographic comparison, and return true. In Ruby my guess is whatever Ruby's equivalent is for an illegal argument exception.


+ Show Spoiler +

It will return true but for completely different reasons

Integer inherits from Numeric, thus making Numeric a class that is higher in the hierarchy. If you compare them like that it will evaluate classes closer to base as greater than those further away (but will evaluate to nil if comparing objects on the same level - unrelated).

[image loading]

Basically, checking if the class is higher up the tree.
Time is precious. Waste it wisely.
iFU.spx
Profile Joined April 2011
Russian Federation378 Posts
May 30 2018 19:04 GMT
#19273
Hi guys.

I am here from Broodwar forum. (starcraft remastered)

Project: Since new starcraft remastered patch released, replay format has changed, i can't continue my project due to unable to parse replays.

General question: I need you guys give me some advices how to be able to parse replay data (i wanna learn decode *.rep by myself). Any info: books, or messages. I know this is really hard problem includes reverse engineering skills needed (as far as i know), but all i need to know is where to start from.

What i've tried already:
Found replay format info, written 14 years ago: https://github.com/HearthSim/pyreplib/blob/master/doc/replay_format.txt

https://github.com/HearthSim/pyreplib - python library, old replays only
https://github.com/icza/screp - Go parser, broken since last patch

So i am investigating it by myself already, but i need you guys tell me some theory i can read to deeply understand how things works. May be some terms, related to this problem, that i can find by them and learn.

Thank you very much

In case if you would want to ask:
Jca (bwchart creator) is probably very busy to speak, so don't advice to speak with him.
Yes, Bwchart 2.00C works well with latest format, but i need to understand how.
Yes, i understand it can take a long time to understand. I am ready.

Thank you again
Manit0u
Profile Blog Joined August 2004
Poland17774 Posts
May 30 2018 20:20 GMT
#19274
I took a peek at pyreplib. It's just a wrapper around some c and c++ code (with gotos in it no less) which does all the unpacking and decoding. From what it seems the authors seemed to know what hides behind some of the bytes in a file (not even all of them) and are parsing it byte by byte to produce what they need.

If you have to reverse engineer data saved in a file you'll have to do the same really. Go through it byte by byte and try to figure out what's hiding behind each of them. Those old libraries might be helpful because maybe it's just a matter of stuff being moved around. If they changed encoding then it might be impossible to get any data without knowing which algorithm they used.
Time is precious. Waste it wisely.
ShoCkeyy
Profile Blog Joined July 2008
7815 Posts
Last Edited: 2018-05-31 13:46:33
May 31 2018 13:43 GMT
#19275
On May 27 2018 05:08 sc-darkness wrote:
If you can't tell the difference when you've just woken up, then it's not a good feature.


std::vector<int> v(100, 1);
std::vector<int> v{100, 1};


Focusing only on technical details isn't enough to be a good software engineer. Readability is also important.


I just woke up, had a fight with my wife, not all there in the head, but I was able to tell the difference immediately. Also, I've been doing a lot of ML/Predictive stuff lately, and still learning about it myself, but I wouldn't mind sharing my learnings if anybody has any questions.

On May 29 2018 01:56 Manit0u wrote:
So, I've been to 2 job interviews today (one for Python and one for Ruby). Both went pretty well. Now I have to make a hard decision...

Bonus, weird Ruby question from the interview:

# what will this next line of code return?
Numeric > Integer


I would of responded with "magick", kidding but also not kidding lol
Life?
Manit0u
Profile Blog Joined August 2004
Poland17774 Posts
May 31 2018 20:36 GMT
#19276
On May 31 2018 22:43 ShoCkeyy wrote:
Show nested quote +
On May 29 2018 01:56 Manit0u wrote:
So, I've been to 2 job interviews today (one for Python and one for Ruby). Both went pretty well. Now I have to make a hard decision...

Bonus, weird Ruby question from the interview:

# what will this next line of code return?
Numeric > Integer


I would of responded with "magick", kidding but also not kidding lol


It's one of those language-specific quirks they sometimes ask at interviews. For Python you get multiple inheritance sheananigans:


class First(object):
def __init__(self):
super(First, self).__init__()
print("first")

class Second(object):
def __init__(self):
super(Second, self).__init__()
print("second")

class Third(First, Second):
def __init__(self):
super(Third, self).__init__()
print("third")
Time is precious. Waste it wisely.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
June 05 2018 17:21 GMT
#19277
What is the fastest way to do the difference between two bitwise values? Is there an operator for that?

Right now I do value1 - (value1&value2). Could also do (value1 & ~value2), I think. But both of these require two separate operations.
Liebig
Profile Joined August 2010
France738 Posts
June 05 2018 20:11 GMT
#19278
On June 06 2018 02:21 travis wrote:
What is the fastest way to do the difference between two bitwise values? Is there an operator for that?

Right now I do value1 - (value1&value2). Could also do (value1 & ~value2), I think. But both of these require two separate operations.

I think v1 ^ (v1 & v2) might be the fastest, or maybe as fast as (value1 & ~value2)

Your first option should be slower i think since - is not a boolean logic operator
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2018-06-06 01:45:15
June 06 2018 01:43 GMT
#19279
cool stuff, thanks

new question, for the few of these that might know about this for some reason.

shortest paths algorithms seem to see a lot of research. particularly, all pairs shortest paths. I can find almost no research on all pairs *all* shortest paths, however. Is there any demand for such an algorithm? I don't see it being useful outside of unweighted graphs or specific types of weighted graphs... but I still see it being useful. I am surprised I could only find one paper on it. I have a couple algorithms I have made that do a pretty good job of finding this, but I am not sure anyone would even care. I've also made a fast all pairs shortest paths lengths algorithm.

I am familiar with say, all the algorithms referenced in wikipedia shortest paths article. But, I do not know any algorithms specialized to find shortest path lengths - or if there actually are any that are distinctly different from the ones that find paths.


another thing I have been working on is a dynamic shortest paths data structure, for updating all pairs shortest paths on edge additions or removals, instead of rerunning from scratch.
Manit0u
Profile Blog Joined August 2004
Poland17774 Posts
Last Edited: 2018-06-06 09:49:45
June 06 2018 09:48 GMT
#19280
Here are some cool implementations of path algorithms: https://www.redblobgames.com/

Maybe it'll be of some use to you
Time is precious. Waste it wisely.
Prev 1 962 963 964 965 966 1032 Next
Please log in or register to reply.
Live Events Refresh
RSL Revival
02:00
S6 Americas Server Qualifier
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft793
NeuroSwarm 166
StarCraft: Brood War
Rain 5059
GuemChi 4453
BeSt 918
Shuttle 548
Mind 73
Bale 21
Noble 17
Purpose 9
Icarus 7
League of Legends
JimRising 853
Counter-Strike
m0e_tv372
Super Smash Bros
Mew2King99
Other Games
summit1g14201
RuFF_SC273
Organizations
Other Games
gamesdonequick847
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 13 non-featured ]
StarCraft 2
• Hupsaiya 178
• Mapu17
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos1165
Upcoming Events
WardiTV Weekly
5h 2m
RSL Revival
1d 4h
RSL Revival
1d 11h
Bombastic Starleague
1d 14h
Kung Fu Cup
2 days
OSC
2 days
CrankTV Team League
3 days
Bombastic Starleague
3 days
Replay Cast
3 days
The PondCast
4 days
[ Show More ]
HomeStory Cup
4 days
Replay Cast
4 days
HomeStory Cup
5 days
Replay Cast
5 days
HomeStory Cup
6 days
Liquipedia Results

Completed

BSL 22 Non-Korean Championship
Douyu Cup 2026
Murky Cup 2026

Ongoing

IPSL Spring 2026
Acropolis #4
CSCL: Masked Kings S4
YSL S3
CSL Season 21: Qualifier 2
SCTL 2026 Spring
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

Upcoming

CSL 2026 Summer (S21)
ASL Season 22:Wild Card Qualifier
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
BCC 2026
Light Tournament 2026
Eternal Conflict S2 Finale
Eternal Conflict S2 E1
Heroes Pulsing #3
FISSURE Playground #5
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.