• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:32
CET 01:32
KST 09:32
  • 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
SC2 All-Star Invitational: Tournament Preview5RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2
Community News
Weekly Cups (Jan 12-18): herO, MaxPax, Solar win0BSL Season 2025 - Full Overview and Conclusion8Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets4$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)16Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns7
StarCraft 2
General
PhD study /w SC2 - help with a survey! When will we find out if there are more tournament Stellar Fest "01" Jersey Charity Auction Weekly Cups (Jan 12-18): herO, MaxPax, Solar win I am looking for StarCraft 2 Beta Patch files
Tourneys
$70 Prize Pool Ladder Legends Academy Weekly Open! SC2 All-Star Invitational: Jan 17-18 Sparkling Tuna Cup - Weekly Open Tournament SC2 AI Tournament 2026 $21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)
Strategy
Simple Questions Simple Answers
Custom Maps
[A] Starcraft Sound Mod
External Content
Mutation # 509 Doomsday Report Mutation # 508 Violent Night Mutation # 507 Well Trained Mutation # 506 Warp Zone
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Gypsy to Korea [ASL21] Potential Map Candidates BSL Season 2025 - Full Overview and Conclusion A cwal.gg Extension - Easily keep track of anyone
Tourneys
[Megathread] Daily Proleagues [BSL21] Non-Korean Championship - Starts Jan 10 Small VOD Thread 2.0 Azhi's Colosseum - Season 2
Strategy
Current Meta Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2 Game Theory for Starcraft
Other Games
General Games
Nintendo Switch Thread Battle Aces/David Kim RTS Megathread Stormgate/Frost Giant Megathread Beyond All Reason Awesome Games Done Quick 2026!
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread NASA and the Private Sector Canadian Politics Mega-thread
Fan Clubs
The herO Fan Club! The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Navigating the Risks and Rew…
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2617 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
Poland17613 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
Spain18194 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
Poland17613 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 Federation372 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
Poland17613 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
Poland17613 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
Poland17613 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
BSL: GosuLeague
21:00
S21 - Semi Final
Mazur vs izu
Alm vs KwarK
ZZZero.O110
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft427
CosmosSc2 87
StarCraft: Brood War
Artosis 647
ZZZero.O 110
Stork 41
HiyA 8
Dota 2
syndereN456
League of Legends
C9.Mang0397
Counter-Strike
Foxcn157
minikerr24
Super Smash Bros
AZ_Axe102
PPMD25
Other Games
summit1g7299
tarik_tv6252
FrodaN1414
shahzam579
hungrybox493
Day[9].tv398
ViBE147
Maynarde119
ArmadaUGS105
XaKoH 98
rGuardiaN58
KnowMe26
Organizations
Other Games
gamesdonequick967
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 20 non-featured ]
StarCraft 2
• RyuSc2 32
• davetesta27
• IndyKCrew
• sooper7s
• Migwel
• AfreecaTV YouTube
• Laughngamez YouTube
• intothetv
• LaughNgamezSOOP
• Kozan
StarCraft: Brood War
• HerbMon 9
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21336
League of Legends
• Doublelift5606
Other Games
• imaqtpie2774
• Scarra473
• Day9tv398
• Shiphtur288
Upcoming Events
PiGosaur Monday
28m
The PondCast
9h 28m
OSC
10h 28m
Clem vs Cure
ByuN vs TBD
TBD vs Solar
MaxPax vs TBD
Krystianer vs TBD
ShoWTimE vs TBD
Big Brain Bouts
2 days
Serral vs TBD
BSL 21
3 days
BSL 21
4 days
Wardi Open
5 days
Monday Night Weeklies
5 days
WardiTV Invitational
6 days
Liquipedia Results

Completed

Proleague 2026-01-20
SC2 All-Star Inv. 2025
NA Kuram Kup

Ongoing

C-Race Season 1
BSL 21 Non-Korean Championship
CSL 2025 WINTER (S19)
KCM Race Survival 2026 Season 1
OSC Championship Season 13
Underdog Cup #3
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025

Upcoming

Escore Tournament S1: W5
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Rongyi Cup S3
Nations Cup 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 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.