• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 13:51
CEST 19:51
KST 02:51
  • 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 Course12Code 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
Code S Season 1 (2026) - RO8 Results1Weekly Cups (May 4-10): Clem, MaxPax, herO win1Maestros of The Game 2 announcement and schedule !11Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event12
StarCraft 2
General
Team Liquid Map Contest #22 - The Finalists Code S Season 1 (2026) - RO8 Results MaNa leaves Team Liquid Weekly Cups (May 4-10): Clem, MaxPax, herO win Code S Season 1 - RO8 Preview
Tourneys
2026 GSL Season 2 Qualifiers Maestros of The Game 2 announcement and schedule ! $5,000 WardiTV Spring Championship 2026 SC2 INu's Battles#16 <BO.9> Master Swan Open (Global Bronze-Master 2)
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
Pros React to: TvT Masterclass in FlaSh vs Light vespene.gg — BW replays in browser BGH Auto Balance -> http://bghmmr.eu/ ASL21 Strategy, Pimpest Plays Discussions Flashes ASL S21 Ro8 Review
Tourneys
[Megathread] Daily Proleagues [ASL21] Semifinals B Escore Tournament StarCraft Season 2 [ASL21] Semifinals A
Strategy
Fighting Spirit mining rates [G] Hydra ZvZ: An Introduction Simple Questions, Simple Answers Muta micro map competition
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Warcraft III: The Frozen Throne Starcraft Tabletop Miniature Game PC Games Sales Thread
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 Russo-Ukrainian War Thread UK Politics Mega-thread YouTube Thread European Politico-economics QA Mega-thread
Fan Clubs
The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [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: 1623 users

The Big Programming Thread - Page 949

Forum Index > General Forum
Post a Reply
Prev 1 947 948 949 950 951 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.
Silvanel
Profile Blog Joined March 2003
Poland4756 Posts
March 01 2018 12:15 GMT
#18961
Exactly, i think it is both resource inefficient and programmer time inefficient. I mean just for checking if filename/path is valid You can just perform some filename/path operation on it and validate basing if it returns error or not. I mean at least for me that would be faster than writing those regex.
Pathetic Greta hater.
tofucake
Profile Blog Joined October 2009
Hyrule19213 Posts
March 01 2018 13:54 GMT
#18962
if that's all you want, use _splitpath_s?
Liquipediaasante sana squash banana
R1CH
Profile Blog Joined May 2007
Netherlands10342 Posts
March 01 2018 14:24 GMT
#18963
I would agree, the best test to see if something is valid is to try and use it. Trying to validate something that the OS already validates is a bad idea in the long run, eg if Windows begins allowing reserved device names then the regex is outdated, similarly the regex for a valid IP address seems to ignore that IPv6 exists.
AdministratorTwitter: @R1CH_TL
TL+ Member
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
March 01 2018 22:54 GMT
#18964
On March 01 2018 23:24 R1CH wrote:
I would agree, the best test to see if something is valid is to try and use it. Trying to validate something that the OS already validates is a bad idea in the long run, eg if Windows begins allowing reserved device names then the regex is outdated, similarly the regex for a valid IP address seems to ignore that IPv6 exists.


The problem is that the client has to transfer files between OS's and they do really stupid things with filenames. I'm not a fan of validating it like that either but that's the demand we have to meet.
Time is precious. Waste it wisely.
Acrofales
Profile Joined August 2010
Spain18291 Posts
March 01 2018 23:50 GMT
#18965
On March 02 2018 07:54 Manit0u wrote:
Show nested quote +
On March 01 2018 23:24 R1CH wrote:
I would agree, the best test to see if something is valid is to try and use it. Trying to validate something that the OS already validates is a bad idea in the long run, eg if Windows begins allowing reserved device names then the regex is outdated, similarly the regex for a valid IP address seems to ignore that IPv6 exists.


The problem is that the client has to transfer files between OS's and they do really stupid things with filenames. I'm not a fan of validating it like that either but that's the demand we have to meet.

Try:
Read stuff from file
Catch:
Raise userisanidioterror

Should be fine.
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
Last Edited: 2018-03-02 16:16:17
March 02 2018 16:15 GMT
#18966
On March 02 2018 08:50 Acrofales wrote:
Show nested quote +
On March 02 2018 07:54 Manit0u wrote:
On March 01 2018 23:24 R1CH wrote:
I would agree, the best test to see if something is valid is to try and use it. Trying to validate something that the OS already validates is a bad idea in the long run, eg if Windows begins allowing reserved device names then the regex is outdated, similarly the regex for a valid IP address seems to ignore that IPv6 exists.


The problem is that the client has to transfer files between OS's and they do really stupid things with filenames. I'm not a fan of validating it like that either but that's the demand we have to meet.

Try:
Read stuff from file
Catch:
Raise userisanidioterror

Should be fine.


Well, I can't do that. The server is on Linux and it allows files that Windows won't allow
Also, I'm never dealing with files directly, we're sending them to S3.
Time is precious. Waste it wisely.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
March 04 2018 17:58 GMT
#18967
Here's a challenge question for you guys:

At the moment, my favorite way to implement graph BFS if by representing paths with binary sequences, and then checking that the intersection between two paths is 0, and therefore they do not contain common nodes.

What I have been doing is mapping a key of [(front node)] to a list of (binary sequence, back node)
where the binary sequences represent the path between back and front.

Doing this I can easily check for overlap in the paths, and look up where two subpaths would connect by (front node)


While this is pretty damn good, I feel it could be better. I don't like having to take a potentially long list of binary sequences and do the intersection between each pair of them. I feel like there must be some sort of structure I could use other than a list, where when I connect two binary sequences subpaths, I could place them into my structure such that groups of sequences with no intersection would be related and easily traversable.

Something like an adjacency list or a tree, based on intersections. Where, from any given sequence, I can traverse the structure in a certain way so that I only would iterate over other sequences that have an intersection of zero with my first sequence.

I don't even really know how to explain what it is I want very well... but hopefully you guys understand. Anyways I have to guess, such a structure isn't really feasible. But maybe it is.
mahrgell
Profile Blog Joined December 2009
Germany3943 Posts
March 04 2018 18:21 GMT
#18968
Uhm....

Assuming each node having an ID, why not just store a sorted list of the IDs that are part of the path.

Then you can easily compare the lists for shared IDs. + Show Spoiler +
If you dont have some quick and available comparison between those lists and you are handwriting that comparison, it would probably be something like the following: (for lists L and K, julia code, but should be all be easily understood)

i = 1
j = 1
while (i<=size(K,1) && j<=size(L,1))
if K[i]==L[j]
return true
end
if K[i]<L[j]
i+=1
else
j+=1
end
end
return false


For small numbers of nodes, having bitsets and using AND between the bitsets is faster, but this has obvious scaling issues.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
March 04 2018 18:39 GMT
#18969
I use this for solving TSP so I don't really care about order. In fact, I can reduce my search space by throwing out suboptimal paths much faster if they are represented in a way that isn't ordered. As far as scaling goes, I understand that bit sequences can quickly get incredibly huge, but I still haven't been convinced that representing pathways with a series of smaller values saves much memory. as the paths get large.
mahrgell
Profile Blog Joined December 2009
Germany3943 Posts
March 04 2018 18:50 GMT
#18970
I was just trying to solve your issue about "how to quickly find out, if the pathes have common nodes".

For this purpose, my described suggestion should compare this rather quick.

But sure, if you assume that bitsets are the most efficient way store all the nodes of a path, then simply using "iszero(L & K)" is the fastest comparison. But then I don't understand the question.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
March 04 2018 19:03 GMT
#18971
Yeah I am sorry, the question is hard for me to formulate.

The idea is that I traverse the graph in "rounds" (typical BFS style).

But, lets say that instead of traversing by adding one edge at a time to my subpaths of size k, I wanted to traverse by adding all the other explored subpaths of size k, to each subpath of size k.

So like, instead of adding edge (0,5) to 3-7-9-4-0, I would be adding subpaths such as 0-5-11-12-1 to 3-7-9-4-0.
And in theory this sounds pretty efficient, but what ends up happening is that the sheer amount of intersections I have to calculate is not worth it. I end up having a large list of bit sequences, and then for every list I have to do [k choose 2], and sometimes its super huge.

So my thought is, what if the subpaths weren't organized with just lists. What if there was a structure (think heap, or tree, or something) - where I could insert my subpaths, and as they were inserted they could be efficiently organized so that I could go to any sequence in the structure, and easily traverse only the other sequences that had intersection 0.

Does that make it a little more clear what I am dreaming up?
mahrgell
Profile Blog Joined December 2009
Germany3943 Posts
March 04 2018 21:45 GMT
#18972
hm?
If you aren't shying away from using bitsets and I understood your problem correctly, then I would do it the following:

Have a struct of

path - howeveryouarestoringthem
bs - bitset with as many bits as there are nodes, with all nodes that are part of the path flagged as 1, rest 0.


Now you can store them in a map, containing lists of those structs... as mapkey you use the first node of a path, and the list contains all pathes (aka the struct from above) starting with that node.

Now if you pick a path A, you can simply access the map, getting all the pathes B you could attach to your path A.
Next you can check "tbs=A.bs & B.bs", remove the shared node from tbs ("tbs.reset(sharednodeID)", and then tbs.any() will tell you if those pathes somehow cross except for that one node.

If you get a new path C, you append your pathes however you do, and "C.bs = A.bs | B.bs" and you have the new struct for your path.
Neshapotamus
Profile Blog Joined May 2006
United States163 Posts
March 04 2018 21:58 GMT
#18973
The data structure you want to use is called UnionFind. Its hyper log fast, so practically constant time check to see if two nodes are connected.

You can use this data structure to see if two nodes have a path between them using the find function. If they don't, you can join them using the union function.

I think this is what you want. Only downside to UF is that you cant unjoin nodes.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2018-03-04 22:58:37
March 04 2018 22:58 GMT
#18974
mahrgell, that's actually exactly what I do right now

The issue is that for larger graphs, as I start to near (n/2)-length subpaths, the list for each start node can be quite long. And you end up having to do [A.bs & (1 million other bitsets)].
And you have to do that for every bitset in the list.
And then you have to do that for every start node.

So I was wanting to take it to another level, where I could structure it so that paths were organized by disjunction (or union).


Neshapotamus:

I had seen this before in my research and I remember being very interested but then I must have gotten distracted or something turned me away. But now, it does look like what I want. To use bit sequences I would need to learn the algorithm really well so that I can write my own version or modify one, though.

If I don't use bit sequences then I may need to find a way to serialize it, which is something I know nothing about. But it sounds like something I should really look into.
Neshapotamus
Profile Blog Joined May 2006
United States163 Posts
March 05 2018 02:28 GMT
#18975
A classic case for union find is percolation. Basically, given two nodes in a graph, find if two nodes are connected in constant time. The data structure wont tell you the exact path, but only if there is a path (connected components). If you know these two nodes are connected and you need a path, you can use BFS or get to the optimum path in O(|V| + |E|). Union Find can be implement in ~10 lines of code.

You can find everything you need to know about the data structure here: (Just watch the first video) http://www.cs.princeton.edu/courses/archive/spring18/cos226/lectures.php

Silvanel
Profile Blog Joined March 2003
Poland4756 Posts
Last Edited: 2018-03-05 12:15:47
March 05 2018 10:37 GMT
#18976
So we have succesfully delivered software to customer. You can see it in new Mercedes A-classes from May/June.
50+ millions lines of code.

Edit: Intially i wanted to write more but then realized i actualy cant so in the end post became short and empty
Pathetic Greta hater.
ZerOCoolSC2
Profile Blog Joined February 2015
9057 Posts
March 05 2018 16:26 GMT
#18977
Is it a dashboard feature or navigation feature? Is that covered by NDA?

So, I'm getting back into programming after 12 years of being MIA. I started with C++ after messing with CSS and HTML and JS back in the good ole days. I'm reading up on C# and was wondering if anyone had any suggestions. I'm using Tutorials Teacher C# at the moment to get a quick overview. I find that I understand it, but I'm just trying to get a better understanding of the syntax. I'm sure I could get more from a MSDN or github search, in regards to code and information that I'm seeking. Just wanted to get some other opinions.

Thanks in advance. I'm using Unity 3D, Visual Studio, and probably notepad when I'm more comfortable.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
March 05 2018 17:11 GMT
#18978
On March 05 2018 19:37 Silvanel wrote:
So we have succesfully delivered software to customer. You can see it in new Mercedes A-classes from May/June.
50+ millions lines of code.

Edit: Intially i wanted to write more but then realized i actualy cant so in the end post became short and empty

How the codebase gets as large as that is still a mystery to me.
If you have a good reason to disagree with the above, please tell me. Thank you.
Silvanel
Profile Blog Joined March 2003
Poland4756 Posts
Last Edited: 2018-03-06 10:02:36
March 05 2018 17:48 GMT
#18979
Well Windows is ~50mln, Linux kernel ~15mln.
Modern car in reality consist of several different computers some of those run more than one OS at the same time. So its not that strange, but it is still a gigantic enterprise to build one, especially from scratch.

We deliver a whole product (complete system and hardware) to customer (Daimler) but we also have our own suppliers delivering various parts of system like Navigation etc.
Pathetic Greta hater.
phar
Profile Joined August 2011
United States1080 Posts
March 06 2018 04:57 GMT
#18980
On March 06 2018 02:11 spinesheath wrote:
Show nested quote +
On March 05 2018 19:37 Silvanel wrote:
So we have succesfully delivered software to customer. You can see it in new Mercedes A-classes from May/June.
50+ millions lines of code.

Edit: Intially i wanted to write more but then realized i actualy cant so in the end post became short and empty

How the codebase gets as large as that is still a mystery to me.

Not too surprising at big companies. That's why there is hopefully market for static analysis tooling on O(100m) LoC repositories like I was talking about week or so back... when code gets that big you start needing different tooling to handle it than you're otherwise used to.
Who after all is today speaking about the destruction of the Armenians?
Prev 1 947 948 949 950 951 1032 Next
Please log in or register to reply.
Live Events Refresh
Big Brain Bouts
16:00
#116
Percival vs YoungYakovLIVE!
Reynor vs GgMaChine
RotterdaM826
IndyStarCraft 120
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 826
IndyStarCraft 120
UpATreeSC 97
BRAT_OK 55
ProTech42
JuggernautJason21
MindelVK 13
EmSc Tv 13
StarCraft: Brood War
Britney 31996
Calm 4488
actioN 181
Soulkey 157
firebathero 155
scan(afreeca) 127
Dewaltoss 94
Mind 59
Trikslyr59
soO 31
[ Show more ]
Noble 25
Barracks 20
Shine 12
Dota 2
Gorgc8378
XaKoH 430
Counter-Strike
fl0m9457
Fnx 1521
Super Smash Bros
Mew2King55
Other Games
Grubby13979
singsing2039
FrodaN1285
Beastyqt847
B2W.Neo639
Hui .206
monkeys_forever181
KnowMe158
ArmadaUGS120
C9.Mang0111
ToD98
QueenE62
Organizations
Counter-Strike
PGL101795
StarCraft 2
EmSc Tv 13
EmSc2Tv 13
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 21 non-featured ]
StarCraft 2
• StrangeGG 60
• 3DClanTV 24
• Adnapsc2 23
• intothetv
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• Migwel
• Kozan
• IndyKCrew
StarCraft: Brood War
• 80smullet 16
• FirePhoenix6
• Michael_bg 1
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• Nemesis4355
Other Games
• imaqtpie666
• Shiphtur205
• WagamamaTV170
• Scarra2
Upcoming Events
Korean StarCraft League
9h 10m
RSL Revival
16h 10m
Clem vs Rogue
Bunny vs Lambo
IPSL
22h 10m
Dewalt vs nOmaD
Ret vs Cross
BSL
1d 1h
Bonyth vs Doodle
Dewalt vs TerrOr
GSL
1d 14h
Cure vs herO
SHIN vs Maru
IPSL
1d 22h
Bonyth vs Napoleon
G5 vs JDConan
BSL
2 days
OyAji vs JDConan
DragOn vs TBD
Replay Cast
2 days
Monday Night Weeklies
2 days
Replay Cast
3 days
[ Show More ]
The PondCast
3 days
GSL
4 days
Replay Cast
5 days
GSL
5 days
Replay Cast
6 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

Proleague 2026-05-14
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
Heroes Pulsing #1
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

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
WardiTV Spring 2026
2026 GSL S2
BLAST Bounty Summer Qual
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.