• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 10:36
CET 16:36
KST 00:36
  • 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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
RSL Season 3: RO16 results & RO8 bracket13Weekly Cups (Nov 10-16): Reynor, Solar lead Zerg surge1[TLMC] Fall/Winter 2025 Ladder Map Rotation14Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA14
StarCraft 2
General
SC: Evo Complete - Ranked Ladder OPEN ALPHA RSL Season 3: RO16 results & RO8 bracket RSL Season 3 - Playoffs Preview Mech is the composition that needs teleportation t GM / Master map hacker and general hacking and cheating thread
Tourneys
RSL Revival: Season 3 $5,000+ WardiTV 2025 Championship StarCraft Evolution League (SC Evo Biweekly) Constellation Cup - Main Event - Stellar Fest 2025 RSL Offline Finals Dates + Ticket Sales!
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 500 Fright night Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ 2v2 maps which are SC2 style with teams together? Data analysis on 70 million replays soO on: FanTaSy's Potential Return to StarCraft A cwal.gg Extension - Easily keep track of anyone
Tourneys
[BSL21] RO16 Tie Breaker - Group B - Sun 21:00 CET [BSL21] RO16 Tie Breaker - Group A - Sat 21:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
Path of Exile Nintendo Switch Thread Should offensive tower rushing be viable in RTS games? Clair Obscur - Expedition 33 Stormgate/Frost Giant Megathread
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
Mafia Game Mode Feedback/Ideas
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread The Games Industry And ATVI Things Aren’t Peaceful in Palestine About SC2SEA.COM
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread Korean Music Discussion
Sports
Formula 1 Discussion 2024 - 2026 Football Thread NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
The Health Impact of Joining…
TrAiDoS
Dyadica Evangelium — Chapt…
Hildegard
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1868 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
Poland17450 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
Spain18132 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
Poland17450 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
Poland17450 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
Poland17450 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
Poland17450 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
14:00
Bonus Weekend Qualifier
WardiTV827
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 31
StarCraft: Brood War
Hyuk 20576
Calm 4582
Rain 3453
GuemChi 1068
Larva 418
firebathero 303
BeSt 207
Last 89
Barracks 47
Backho 38
[ Show more ]
Killer 36
ToSsGirL 30
soO 29
JulyZerg 17
scan(afreeca) 15
Terrorterran 15
zelot 14
Sacsri 12
HiyA 11
Noble 10
SilentControl 9
Bale 8
Shine 7
yabsab 5
Dota 2
Gorgc8713
singsing2138
qojqva2115
Dendi883
XcaliburYe146
League of Legends
Reynor89
Counter-Strike
ScreaM2072
byalli423
allub257
oskar149
Heroes of the Storm
Khaldor444
Other Games
B2W.Neo2451
crisheroes513
Hui .432
Fuzer 305
Pyrionflax260
KnowMe95
XaKoH 90
Dewaltoss29
Organizations
Dota 2
PGL Dota 2 - Main Stream33483
Other Games
EGCTV1048
StarCraft: Brood War
Kim Chul Min (afreeca) 13
lovetv 12
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Berry_CruncH164
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Azhi_Dahaki6
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2204
• WagamamaTV457
League of Legends
• Nemesis3285
Upcoming Events
IPSL
4h 24m
StRyKeR vs OldBoy
Sziky vs Tarson
BSL 21
4h 24m
StRyKeR vs Artosis
OyAji vs KameZerg
OSC
7h 24m
OSC
17h 24m
Wardi Open
20h 24m
Monday Night Weeklies
1d 1h
OSC
1d 7h
Wardi Open
1d 20h
Replay Cast
2 days
Wardi Open
2 days
[ Show More ]
Tenacious Turtle Tussle
3 days
The PondCast
3 days
Replay Cast
4 days
LAN Event
5 days
Replay Cast
5 days
Replay Cast
5 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

Proleague 2025-11-21
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
SLON Tour Season 2
META Madness #9
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
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 © 2025 TLnet. All Rights Reserved.