• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 14:18
CET 19:18
KST 03:18
  • 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
[ASL20] Finals Preview: Arrival12TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9
Community News
BSL21 Open Qualifiers Week & CONFIRM PARTICIPATION1Crank Gathers Season 2: SC II Pro Teams6Merivale 8 Open - LAN - Stellar Fest3Chinese SC2 server to reopen; live all-star event in Hangzhou22Weekly Cups (Oct 13-19): Clem Goes for Four3
StarCraft 2
General
Could we add "Avoid Matchup" Feature for rankgame RotterdaM "Serral is the GOAT, and it's not close" Smart servos says it affects liberators as well Chinese SC2 server to reopen; live all-star event in Hangzhou The New Patch Killed Mech!
Tourneys
Crank Gathers Season 2: SC II Pro Teams RSL Offline Finals Dates + Ticket Sales! Merivale 8 Open - LAN - Stellar Fest $5,000+ WardiTV 2025 Championship $3,500 WardiTV Korean Royale S4
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 497 Battle Haredened Mutation # 496 Endless Infection Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment
Brood War
General
[ASL20] Finals Preview: Arrival BSL Season 21 BSL Team A vs Koreans - Sat-Sun 16:00 CET ASL20 Pre-season Tier List ranking! ASL Runner-Up Race Stats
Tourneys
[ASL20] Grand Finals BSL21 Open Qualifiers Week & CONFIRM PARTICIPATION ASL final tickets help [ASL20] Semifinal A
Strategy
Current Meta Soma's 9 hatch build from ASL Game 2 Simple Questions, Simple Answers Roaring Currents ASL final
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile General RTS Discussion Thread Nintendo Switch Thread Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread YouTube Thread The Chess Thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Korean Music Discussion Series you have seen recently... Movie Discussion!
Sports
Formula 1 Discussion 2024 - 2026 Football Thread MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
The Benefits Of Limited Comm…
TrAiDoS
Sabrina was soooo lame on S…
Peanutsc
Our Last Hope in th…
KrillinFromwales
Certified Crazy
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1590 users

The Big Programming Thread - Page 877

Forum Index > General Forum
Post a Reply
Prev 1 875 876 877 878 879 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.
Manit0u
Profile Blog Joined August 2004
Poland17399 Posts
Last Edited: 2017-04-26 03:56:18
April 26 2017 03:55 GMT
#17521
This definitely gets me closer. I'll still need to figure out some more stuff (obviously, the system is a bit more complex than that, with different queues, pipelines, engines, multiple statuses like rejected, blocked etc. and I need to scope it out properly).
Time is precious. Waste it wisely.
Acrofales
Profile Joined August 2010
Spain18100 Posts
April 26 2017 10:34 GMT
#17522
On April 26 2017 12:55 Manit0u wrote:
This definitely gets me closer. I'll still need to figure out some more stuff (obviously, the system is a bit more complex than that, with different queues, pipelines, engines, multiple statuses like rejected, blocked etc. and I need to scope it out properly).

If that's the case is it really worth doin in SQL?
solidbebe
Profile Blog Joined November 2010
Netherlands4921 Posts
April 26 2017 12:59 GMT
#17523
So I'm doing a project where we are making a system that documents and visualizes system architecture and information flow at a company (which uses 3000+ different IT systems). I'm looking for inspiration but I'm finding it very difficult to find examples of projects similar to this online. I just get flooded in UML/sequence diagrams which is obviously not helpful. Does anyone know of anything?

The idea for now is to use javascript and the D3 library to make the visualization. D3 seems very flexible and running it in the browser means we don't have to worry about different versions for OS and updating is easy. I have pretty much no experience with this kind of project so any suggestions are welcome.
That's the 2nd time in a week I've seen someone sig a quote from this GD and I have never witnessed a sig quote happen in my TL history ever before. -Najda
Manit0u
Profile Blog Joined August 2004
Poland17399 Posts
April 26 2017 14:26 GMT
#17524
On April 26 2017 21:59 solidbebe wrote:
So I'm doing a project where we are making a system that documents and visualizes system architecture and information flow at a company (which uses 3000+ different IT systems). I'm looking for inspiration but I'm finding it very difficult to find examples of projects similar to this online. I just get flooded in UML/sequence diagrams which is obviously not helpful. Does anyone know of anything?

The idea for now is to use javascript and the D3 library to make the visualization. D3 seems very flexible and running it in the browser means we don't have to worry about different versions for OS and updating is easy. I have pretty much no experience with this kind of project so any suggestions are welcome.


I'd suggest using neo4j database for that (awesome for graphs) and then you could check facebook graph api for how they generate their output:

[image loading]
Time is precious. Waste it wisely.
Djagulingu
Profile Blog Joined December 2010
Germany3605 Posts
April 26 2017 14:28 GMT
#17525
On April 26 2017 21:59 solidbebe wrote:
So I'm doing a project where we are making a system that documents and visualizes system architecture and information flow at a company (which uses 3000+ different IT systems). I'm looking for inspiration but I'm finding it very difficult to find examples of projects similar to this online. I just get flooded in UML/sequence diagrams which is obviously not helpful. Does anyone know of anything?

The idea for now is to use javascript and the D3 library to make the visualization. D3 seems very flexible and running it in the browser means we don't have to worry about different versions for OS and updating is easy. I have pretty much no experience with this kind of project so any suggestions are welcome.

3000+? Is that real? That number is 50 times the amount of different IT systems one of the telecommunications giants in my country uses.

About the project: If you are going to draw anything on the web, you can't ever go wrong with D3. We have done something similar by having JSON objects as blueprints and drawing with D3 according to the blueprint. In such a structure, SVG is much more efficient than Canvas, so D3 is the way to go. Also, don't ever think about server side rendering with this shit.
"windows bash is a steaming heap of shit" tofucake
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
April 26 2017 16:35 GMT
#17526
On April 26 2017 21:59 solidbebe wrote:
So I'm doing a project where we are making a system that documents and visualizes system architecture and information flow at a company (which uses 3000+ different IT systems). I'm looking for inspiration but I'm finding it very difficult to find examples of projects similar to this online. I just get flooded in UML/sequence diagrams which is obviously not helpful. Does anyone know of anything?

The idea for now is to use javascript and the D3 library to make the visualization. D3 seems very flexible and running it in the browser means we don't have to worry about different versions for OS and updating is easy. I have pretty much no experience with this kind of project so any suggestions are welcome.

Maybe gephi.org is of any help?
If you have a good reason to disagree with the above, please tell me. Thank you.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-04-26 17:40:33
April 26 2017 17:39 GMT
#17527
I had a combinatoric question on an exam that blindsided me.

A class has 5 TAs and 2 teachers.
A team of 4 of them is assigned (at random) to grade papers.
What are the odds that the 2 teachers are assigned to grade papers?

Thee question came with a hint that for this one they wanted a ratio of natural numbers (fraction), and that the answer should be found by using fractions and using a process of canceling most of them out. The hint confused the shit out of me.

The only way I see to solve the problem, I THINK, is to do all the combinations where you hit the 2 teachers in 4 tries

which reasonably seems like I should use the number of permutations with the 2 teachers in 4 letters out of the total number of permutations. but calculating this uses factorials which they said not to do

I don't really know how to do it otherwise.

something like multiplying out every actual chance of hitting the teacher each try for every combination of 4 tries, which seems fucking ridiculous

so what am I not getting about that, it makes me mad. we never did anything like that in class
WolfintheSheep
Profile Joined June 2011
Canada14127 Posts
April 26 2017 18:01 GMT
#17528
Isn't that just like...basic combinatorics?

Total combinations with 2 Teachers, divided by total combinations. So like (5C2 + 2C2) / (7C4) or something.
Average means I'm better than half of you.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-04-26 18:32:51
April 26 2017 18:27 GMT
#17529
denominator would be 7c4, yes

and I think that 5c2 makes sense for a numerator (you wouldn't add 2c2, you would multiply it.. I think)

but the stupid hint told us to use natural number fractions(meaning don't use exponents or factorials or no choose r... it literally said that). so i shouldn't be working in this way at all. and more specifically it told us to cancel fractions out. I think he really fucked me over with his "hint" is what happened

when I did the test I did solve towards 5c2/7c4 at first until i re-read it and saw his "hint"
WolfintheSheep
Profile Joined June 2011
Canada14127 Posts
April 26 2017 18:39 GMT
#17530
Yes, so...

((5*4)/2) / ((7*6*5*4)/(4*3*2))

From there you can separate things out and cancel.
Average means I'm better than half of you.
Acrofales
Profile Joined August 2010
Spain18100 Posts
April 26 2017 18:46 GMT
#17531
On April 27 2017 03:27 travis wrote:
denominator would be 7c4, yes

and I think that 5c2 makes sense for a numerator (you wouldn't add 2c2, you would multiply it.. I think)

but the stupid hint told us to use natural number fractions(meaning don't use exponents or factorials or no choose r... it literally said that). so i shouldn't be working in this way at all. and more specifically it told us to cancel fractions out. I think he really fucked me over with his "hint" is what happened

when I did the test I did solve towards 5c2/7c4 at first until i re-read it and saw his "hint"

So write out your factorials and do the math, lol. Lots will cancel out and you're left with a normal fraction. You know, write out 5c2 as 5! / 2!*3!, etc.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-04-26 18:51:29
April 26 2017 18:50 GMT
#17532
denom should be over 3*2*1 not 4*3*2

but yeah I see where you are going

I could have gotten all the way here just fine (well I would have left it in the form of n-choose r's). But the hint pretty much told us not to use n-choose r at all

so yeah I get 0 points even though I could have solved this fine and I am going to be pretty mad


On April 27 2017 03:46 Acrofales wrote:
Show nested quote +
On April 27 2017 03:27 travis wrote:
denominator would be 7c4, yes

and I think that 5c2 makes sense for a numerator (you wouldn't add 2c2, you would multiply it.. I think)

but the stupid hint told us to use natural number fractions(meaning don't use exponents or factorials or no choose r... it literally said that). so i shouldn't be working in this way at all. and more specifically it told us to cancel fractions out. I think he really fucked me over with his "hint" is what happened

when I did the test I did solve towards 5c2/7c4 at first until i re-read it and saw his "hint"

So write out your factorials and do the math, lol. Lots will cancel out and you're left with a normal fraction. You know, write out 5c2 as 5! / 2!*3!, etc.



I'll quote the "hint" for you when I get my exam back and you will understand my complaint
Acrofales
Profile Joined August 2010
Spain18100 Posts
April 26 2017 18:58 GMT
#17533
Well, you can go from first principles. It's where combinatorics comes from. Will just take longer. The probability of picking exactly the two teachers is 1 - chance of picking less than two teachers = 1 - chance of picking 0 teachers - chance of picking 1 teacher = 1 - 5/7*4/6*3/5*2/4 - 4 ways of doing this and I don't feel like writing it out.

Then math the whole thing out.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
April 26 2017 19:01 GMT
#17534
yeah that's pretty much what I tried and failed to do, because I was looking for a way to do it in which terms would start canceling out and they weren't.

I mean.. it's my failure though either way in that I didn't just have more confidence in that I still was getting the correct result regardless. But it sucks to lose points when you know material.
Zocat
Profile Joined April 2010
Germany2229 Posts
April 26 2017 20:13 GMT
#17535
On April 27 2017 03:27 travis wrote:
denominator would be 7c4, yes

and I think that 5c2 makes sense for a numerator (you wouldn't add 2c2, you would multiply it.. I think)


You are correct, it would be *2c2. You have a Hypergeometric distribution.

You have learned the urn model, right? If not, do that it will make all your combinatorics way easier. You break down your problem and find the correct urn model. Then look up what kind of distribution is associated with that model.
Manit0u
Profile Blog Joined August 2004
Poland17399 Posts
Last Edited: 2017-04-27 11:33:50
April 27 2017 07:31 GMT
#17536
Back to SQL again... With the problem I posted some time back.

We have: A has many B, C has many B.

Now, we do filtering on C matching A where C has no B or CB are a subset of AB.

The thing is, it's pretty slow as soon as you hit about a million records in the db (1.5s query), which is no good for us.

Any ideas how can you optimize it in postgres?

Right now we have join tables that are being aggregated into views (stale data is unacceptable since it's used for live time pooling and assigning C to A with race conditions and all that jazz).

Edit: I'm seriously considering dropping the join tables and simply dumping all the related ids into an uuid[] column in respective tables.
Time is precious. Waste it wisely.
enigmaticcam
Profile Blog Joined October 2010
United States280 Posts
Last Edited: 2017-04-27 16:59:50
April 27 2017 16:59 GMT
#17537
On April 27 2017 16:31 Manit0u wrote:
Back to SQL again... With the problem I posted some time back.

We have: A has many B, C has many B.

Now, we do filtering on C matching A where C has no B or CB are a subset of AB.

The thing is, it's pretty slow as soon as you hit about a million records in the db (1.5s query), which is no good for us.

Any ideas how can you optimize it in postgres?

Right now we have join tables that are being aggregated into views (stale data is unacceptable since it's used for live time pooling and assigning C to A with race conditions and all that jazz).

Edit: I'm seriously considering dropping the join tables and simply dumping all the related ids into an uuid[] column in respective tables.

If I remember correctly, SQL is a bit slow on OR statements. Maybe do the "Has no B" and the "CB are a subset of AB" in separate queries and union them.

Also, in my experience I've found that when I have to do complex joins or filters between large datasets, sometimes it helps to do as much filtering as you can first and insert into temp tables with indexes, and then do joins from there. Not sure if that will help you here.
enigmaticcam
Profile Blog Joined October 2010
United States280 Posts
April 27 2017 17:20 GMT
#17538
If anyone here is familiar with Microsoft SQL Server, I have an optimization question too:

Why does this script only take 1 second to run...

select
PSID
, Product
, [Geography]
, EffectiveMonth
into #temp
from vistaar.VistaarExtractStagingArchive
where JobRequestId = @jobRequestId

select distinct
PSID
, Product as BL
, b.BrandLabelName as BLName
, [Geography] as Market
, EffectiveMonth
from #temp a
left join (
select distinct BrandLabelName, BrandLabelCode
from Vistaar.MasterProduct
) b on b.BrandLabelCode = a.Product

drop table #temp

...and yet this script takes about 10 minutes.

select distinct
PSID
, Product as BL
, b.BrandLabelName as BLName
, [Geography] as Market
, EffectiveMonth
from (
select
PSID
, Product
, [Geography]
, EffectiveMonth
from vistaar.VistaarExtractStagingArchive
where JobRequestId = @jobRequestId
) a
left join (
select distinct BrandLabelName, BrandLabelCode
from Vistaar.MasterProduct
) b on b.BrandLabelCode = a.Product


The table size is about 22 million rows. So I know the issue is that one is doing a distinct on the entire table, and one is doing a distinct only on the temp table. But I would think the second one would first filter for the smaller subset before performing the distinct, but clearly it's not. Is there a reason for that?
Thaniri
Profile Blog Joined March 2011
1264 Posts
Last Edited: 2017-04-27 17:45:49
April 27 2017 17:44 GMT
#17539
It looks to me as though the second query is a correlated subquery. The inner query is re-executed for every product found.

If my understanding is right, you can have a worst case of 22m * 22m results.

The first script doesn't have a subquery at all, so as a whole it never has to be re-executed.

Mind you, I'm not a professional. This is me just regurgitating what I learned from one class where we happened to learn about these optimizations.

edit: You could make it even faster without using a temp table, but perhaps for safety or concurrency reasons you might want to still use it.
Manit0u
Profile Blog Joined August 2004
Poland17399 Posts
April 27 2017 19:18 GMT
#17540
On April 28 2017 01:59 enigmaticcam wrote:
Show nested quote +
On April 27 2017 16:31 Manit0u wrote:
Back to SQL again... With the problem I posted some time back.

We have: A has many B, C has many B.

Now, we do filtering on C matching A where C has no B or CB are a subset of AB.

The thing is, it's pretty slow as soon as you hit about a million records in the db (1.5s query), which is no good for us.

Any ideas how can you optimize it in postgres?

Right now we have join tables that are being aggregated into views (stale data is unacceptable since it's used for live time pooling and assigning C to A with race conditions and all that jazz).

Edit: I'm seriously considering dropping the join tables and simply dumping all the related ids into an uuid[] column in respective tables.

If I remember correctly, SQL is a bit slow on OR statements. Maybe do the "Has no B" and the "CB are a subset of AB" in separate queries and union them.

Also, in my experience I've found that when I have to do complex joins or filters between large datasets, sometimes it helps to do as much filtering as you can first and insert into temp tables with indexes, and then do joins from there. Not sure if that will help you here.


We've removed the join columns entirely now. Switched to just storing ids in an array as a table column. It's super effective but required us to implement some back-end mechanisms for syncing stuff (not that hard since we're only interested in a scenario when a record whose id should go into the array is deleted which should be a rare case).
Time is precious. Waste it wisely.
Prev 1 875 876 877 878 879 1032 Next
Please log in or register to reply.
Live Events Refresh
Monday Night Weeklies
17:00
Open Cup
RotterdaM543
TKL 310
IndyStarCraft 228
SteadfastSC196
ZombieGrub93
BRAT_OK 62
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 543
mouzHeroMarine 459
TKL 310
IndyStarCraft 220
SteadfastSC 191
UpATreeSC 100
ZombieGrub93
ProTech84
MaxPax 74
BRAT_OK 62
MindelVK 28
StarCraft: Brood War
Britney 21552
Sea 638
Yoon 363
Rock 54
Dewaltoss 37
yabsab 20
Dota 2
qojqva4220
Dendi1196
420jenkins581
BananaSlamJamma252
PGG 89
Counter-Strike
fl0m2522
ScreaM1139
FunKaTv 64
Other Games
FrodaN1616
Beastyqt535
ceh9443
Lowko273
Liquid`VortiX236
mouzStarbuck178
B2W.Neo153
ArmadaUGS124
Mew2King74
C9.Mang073
QueenE62
rGuardiaN44
Organizations
Counter-Strike
PGL11530
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 22 non-featured ]
StarCraft 2
• kabyraGe 88
• iHatsuTV 6
• Reevou 2
• Kozan
• sooper7s
• AfreecaTV YouTube
• Migwel
• intothetv
• LaughNgamezSOOP
• IndyKCrew
StarCraft: Brood War
• HerbMon 41
• FirePhoenix10
• Michael_bg 4
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 2788
League of Legends
• Nemesis3464
• imaqtpie1977
• TFBlade833
Other Games
• WagamamaTV415
• Shiphtur91
Upcoming Events
BSL 21
6h 42m
Replay Cast
15h 42m
Streamerzone vs Shopify Rebellion
Streamerzone vs Team Vitality
Shopify Rebellion vs Team Vitality
WardiTV Invitational
17h 42m
CrankTV Team League
18h 42m
BASILISK vs TBD
Team Liquid vs Team Falcon
BSL 21
1d 6h
Replay Cast
1d 15h
BASILISK vs TBD
Team Liquid vs Team Falcon
OSC
1d 17h
CrankTV Team League
1d 18h
Replay Cast
2 days
The PondCast
2 days
[ Show More ]
CrankTV Team League
2 days
Replay Cast
3 days
WardiTV Invitational
3 days
CrankTV Team League
3 days
Replay Cast
4 days
BSL Team A[vengers]
4 days
Dewalt vs Shine
UltrA vs ZeLoT
BSL 21
5 days
Sparkling Tuna Cup
5 days
BSL Team A[vengers]
5 days
Cross vs Motive
Sziky vs HiyA
BSL 21
6 days
Wardi Open
6 days
Liquipedia Results

Completed

ASL Season 20
WardiTV TLMC #15
Eternal Conflict S1

Ongoing

BSL 21 Points
CSL 2025 AUTUMN (S18)
BSL 21 Team A
C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
CranK Gathers Season 2: SC II Pro Teams
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025

Upcoming

SC4ALL: Brood War
YSL S2
BSL Season 21
SLON Tour Season 2
BSL 21 Non-Korean Championship
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
META Madness #9
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 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.