• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 06:32
CET 11:32
KST 19: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
[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy7ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289
Community News
Weekly Cups (March 16-22): herO doubles, Cure surprises3Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool42Weekly Cups (March 9-15): herO, Clem, ByuN win42026 KungFu Cup Announcement6BGE Stara Zagora 2026 cancelled12
StarCraft 2
General
Explore the Palmistry Certificate Course at Bivs Weekly Cups (March 16-22): herO doubles, Cure surprises Weekly Cups (August 25-31): Clem's Last Straw? Team Liquid Map Contest #22 - Presented by Monster Energy What mix of new & old maps do you want in the next ladder pool? (SC2)
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament World University TeamLeague (500$+) | Signups Open RSL Season 4 announced for March-April WardiTV Team League Season 10 KSL Week 87
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026]
External Content
The PondCast: SC2 News & Results Mutation # 518 Radiation Zone Mutation # 517 Distant Threat Mutation # 516 Specter of Death
Brood War
General
ASL21 General Discussion Soulkey's decision to leave C9 BGH Auto Balance -> http://bghmmr.eu/ JaeDong's form before ASL [ASL21] Ro24 Preview Pt1: New Chaos
Tourneys
[ASL21] Ro24 Group B [ASL21] Ro24 Group A ASL Season 21 LIVESTREAM with English Commentary [Megathread] Daily Proleagues
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2
Other Games
General Games
General RTS Discussion Thread Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
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
TL Mafia Community Thread Five o'clock TL Mafia Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread Things Aren’t Peaceful in Palestine YouTube Thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books Movie Discussion! [Manga] One Piece
Sports
2024 - 2026 Football Thread Cricket [SPORT] Formula 1 Discussion Tokyo Olympics 2021 Thread General nutrition recommendations
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Funny Nicknames
LUCKY_NOOB
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2113 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
Poland17700 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
Spain18241 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
Poland17700 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 Federation377 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
Poland17700 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
Poland17700 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
Poland17700 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
Afreeca Starleague
10:00
Ro24 Group B
Soulkey vs Ample
JyJ vs sSak
Afreeca ASL 7227
StarCastTV_EN181
Liquipedia
Sparkling Tuna Cup
10:00
Weekly #124
CranKy Ducklings70
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
OGKoka 178
ProTech146
SortOf 101
StarCraft: Brood War
Calm 11662
Flash 4766
Bisu 4167
GuemChi 1606
BeSt 671
firebathero 631
EffOrt 309
Zeus 258
Pusan 242
Leta 216
[ Show more ]
actioN 204
Light 200
ZerO 196
Stork 155
HiyA 121
ToSsGirL 83
Killer 78
Rush 71
Mind 57
Sharp 56
PianO 47
Terrorterran 41
Barracks 36
Hm[arnc] 21
Shinee 20
GoRush 19
Nal_rA 18
yabsab 15
Bale 14
Noble 10
soO 10
Purpose 8
sorry 8
Dota 2
XcaliburYe258
canceldota142
BananaSlamJamma130
League of Legends
JimRising 357
Counter-Strike
olofmeister2098
shoxiejesuss627
byalli447
x6flipin170
Super Smash Bros
Westballz13
Other Games
singsing1846
ceh9692
Sick274
crisheroes233
Happy76
Livibee68
Trikslyr22
Organizations
Other Games
gamesdonequick875
StarCraft: Brood War
UltimateBattle 197
Dota 2
PGL Dota 2 - Main Stream128
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Berry_CruncH191
• StrangeGG 47
• LUISG 29
• CranKy Ducklings SOOP4
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 5
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Upcoming Events
Replay Cast
22h 28m
Afreeca Starleague
23h 28m
hero vs YSC
Larva vs Shine
Kung Fu Cup
1d
Replay Cast
1d 13h
KCM Race Survival
1d 22h
The PondCast
1d 23h
WardiTV Team League
2 days
Replay Cast
2 days
WardiTV Team League
3 days
RSL Revival
3 days
Cure vs Zoun
herO vs Rogue
[ Show More ]
WardiTV Team League
4 days
Platinum Heroes Events
4 days
BSL
4 days
RSL Revival
4 days
ByuN vs Maru
MaxPax vs TriGGeR
WardiTV Team League
5 days
BSL
5 days
Replay Cast
5 days
Afreeca Starleague
5 days
Light vs Calm
Royal vs Mind
Wardi Open
6 days
Monday Night Weeklies
6 days
Sparkling Tuna Cup
6 days
Afreeca Starleague
6 days
Rush vs PianO
Flash vs Speed
Liquipedia Results

Completed

Proleague 2026-03-23
WardiTV Winter 2026
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
BSL Season 22
CSL Elite League 2026
CSL Season 20: Qualifier 1
ASL Season 21
Acropolis #4 - TS6
RSL Revival: Season 4
Nations Cup 2026
NationLESS Cup
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual

Upcoming

2026 Changsha Offline CUP
CSL Season 20: Qualifier 2
CSL 2026 SPRING (S20)
Acropolis #4
IPSL Spring 2026
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
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.