• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 09:38
CEST 15:38
KST 22:38
  • 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] Ro4 Preview: On Course10Code S Season 1 - RO8 Preview7[ASL21] Ro8 Preview Pt2: Progenitors8Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16
Community News
Maestros of The Game 2 announcement and schedule !8Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event12Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25
StarCraft 2
General
Code S Season 1 - RO8 Preview Behind the Blue - Team Liquid History Book Weekly Cups (April 27-May 4): Clem takes triple Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results
Tourneys
Master Swan Open (Global Bronze-Master 2) 2026 GSL Season 2 Qualifiers Maestros of The Game 2 announcement and schedule ! GSL Code S Season 1 (2026) WardiTV Mondays
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players
External Content
Mutation # 525 Wheel of Misfortune The PondCast: SC2 News & Results Mutation # 524 Death and Taxes Mutation # 523 Firewall
Brood War
General
ASL Tickets to Live Event Finals? [ASL21] Ro4 Preview: On Course Quality of life changes in BW that you will like ? Why there arent any 256x256 pro maps? RepMastered™: replay sharing and analyzer site
Tourneys
[ASL21] Semifinals A [BSL22] RO16 Group Stage - 02 - 10 May [Megathread] Daily Proleagues [ASL21] Ro8 Day 3
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates Muta micro map competition What's the deal with APM & what's its true value
Other Games
General Games
Warcraft III: The Frozen Throne Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread Daigo vs Menard Best of 10
Dota 2
The Story of Wings Gaming
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 TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread Russo-Ukrainian War Thread UK Politics Mega-thread The Letting Off Steam Thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
How EEG Data Can Predict Gam…
TrAiDoS
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1284 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
Poland17743 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
Spain18290 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
Poland17743 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
Poland17743 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
Poland17743 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
Poland17743 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
Wardi Open
12:00
#86
WardiTV732
Rex105
Liquipedia
GSL
08:00
2026 Season 2: Qualifiers
SHIN vs CreatorLIVE!
Zoun vs Cure
IntoTheiNu 1122
CranKy Ducklings SOOP111
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
OGKoka 301
Rex 105
MaxPax 95
ProTech56
StarCraft: Brood War
Calm 8822
Bisu 2698
Sea 1895
Jaedong 1483
Leta 1252
Horang2 976
EffOrt 620
Hyuk 486
BeSt 375
Mini 312
[ Show more ]
actioN 299
ggaemo 234
ZerO 226
firebathero 193
Soulkey 189
Larva 183
Snow 173
Rush 167
Mind 113
Hyun 91
Pusan 85
Sharp 75
Sea.KH 63
HiyA 55
Aegong 45
Mong 43
Killer 35
Barracks 29
soO 28
sorry 26
[sc1f]eonzerg 22
SilentControl 16
Hm[arnc] 15
IntoTheRainbow 15
Bale 13
Movie 8
Terrorterran 7
Icarus 7
Dota 2
Gorgc2373
XcaliburYe274
syndereN34
NeuroSwarm10
Counter-Strike
byalli357
Other Games
B2W.Neo918
hiko820
Lowko387
crisheroes193
monkeys_forever131
ArmadaUGS113
elazer93
Livibee45
Happy40
ZerO(Twitch)8
Hui .0
Organizations
Counter-Strike
PGL35555
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 14 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 45
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis4422
• TFBlade1235
Other Games
• WagamamaTV437
Upcoming Events
Monday Night Weeklies
2h 22m
OSC
10h 22m
CranKy Ducklings
20h 22m
Afreeca Starleague
20h 22m
Light vs Flash
PiGosaur Cup
1d 10h
Replay Cast
1d 19h
Replay Cast
2 days
The PondCast
2 days
OSC
2 days
Replay Cast
3 days
[ Show More ]
RSL Revival
3 days
OSC
3 days
Korean StarCraft League
4 days
RSL Revival
4 days
BSL
5 days
GSL
5 days
Cure vs TBD
TBD vs Maru
BSL
6 days
Replay Cast
6 days
Liquipedia Results

Completed

CSL 2026 SPRING (S20)
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2

Upcoming

Escore Tournament S2: W7
YSL S3
Escore Tournament S2: W8
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
BLAST Bounty Summer 2026: Closed Qualifier
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 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.